draw.io is a JavaScript, client-side editor for general diagramming.
26.2.7 release
David Benson49c61041667c
diff --git a/ChangeLog b/ChangeLogindex 9d3928c96..e37d97da6 100644--- a/ChangeLog+++ b/ChangeLog@@ -1,4 +1,34 @@-31-MAR_2025: 26.2.2+05-APR-2025: 26.2.7++- [conf cloud] and GraphViewer. Removes tooltips config. Pages use file tooltips config [DID-14767]+- Fixes filename and comments button for Conf Cloud++04-APR-2025: 26.2.6++- Updates DOMPurify from 3.2.4 to 3.2.5+- Adds primaryColor option for custom shape properties+- Adds mxUtils.getColorValue+- [conf cloud] Adds support for live docs [DID-14520]+- Adds Note shape in Misc sidebar+- [conf cloud] Fixed migrated server custom libraries names [DID-14902]++03-APR-2025: 26.2.5++- Fixes Google Drive folder picker z-index+- Fixes OneDrive folder picker size+- [conf cloud] Fixes headers anchor [DID-14864]++02-APR-2025: 26.2.4++- Fixes possible NPE in Sidebar.disablePointerEvents+- [conf cloud] Added support for imported Gliffy images with the added version prefix to the name [DID-14867]+- Fixes possible NPE in ColorDialog++01-APR-2025: 26.2.3++- [conf cloud] Fixes viewer background++31-MAR-2025: 26.2.2- Adds Tamil translations- Fixes Confluence cloud lightbox [DID-14879]diff --git a/VERSION b/VERSIONindex 40fab6c2d..f2a72d593 100644--- a/VERSION+++ b/VERSION@@ -1 +1 @@-26.2.2\ No newline at end of file+26.2.7\ No newline at end of filediff --git a/etc/dependencies/package.json b/etc/dependencies/package.jsonindex b6ec5874f..a75bfbc7b 100644--- a/etc/dependencies/package.json+++ b/etc/dependencies/package.json@@ -15,7 +15,7 @@"mermaid": "11.4.1","pako": "2.1.0","crypto-js": "3.1.2",- "dompurify": "3.2.4",+ "dompurify": "3.2.5","spin.js": "2.0.0","roughjs": "4.6.6","mathjax": "3.2.2"diff --git a/etc/imageResize/package-lock.json b/etc/imageResize/package-lock.jsonindex d9ef2cc92..a895d5dc1 100644--- a/etc/imageResize/package-lock.json+++ b/etc/imageResize/package-lock.json@@ -9,446 +9,393 @@"version": "1.0.0","license": "ISC","dependencies": {- "image-size": "^1.2.1",- "sharp": "^0.33.2",+ "image-size": "^2.0.2",+ "sharp": "^0.34.0","yargs": "^17.7.2"}},"node_modules/@emnapi/runtime": {- "version": "0.45.0",- "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-0.45.0.tgz",- "integrity": "sha512-Txumi3td7J4A/xTTwlssKieHKTGl3j4A1tglBx72auZ49YK7ePY6XZricgIg9mnZT4xPfA+UPCUdnhRuEFDL+w==",+ "version": "1.4.0",+ "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.4.0.tgz",+ "integrity": "sha512-64WYIf4UYcdLnbKn/umDlNjQDSS8AgZrI/R9+x5ilkUVFxXcA1Ebl+gQLc/6mERA4407Xof0R7wEyEuj091CVw==",+ "license": "MIT","optional": true,"dependencies": {"tslib": "^2.4.0"}},"node_modules/@img/sharp-darwin-arm64": {- "version": "0.33.2",- "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.2.tgz",- "integrity": "sha512-itHBs1rPmsmGF9p4qRe++CzCgd+kFYktnsoR1sbIAfsRMrJZau0Tt1AH9KVnufc2/tU02Gf6Ibujx+15qRE03w==",+ "version": "0.34.0",+ "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.0.tgz",+ "integrity": "sha512-BLT8CQ234EOJFN4NCAkZUkJr2lyXavD+aQH/Jc2skPqAJTMjKeH2BUulaZNkd4MJ9hcCicTdupcbCRg4bto0Ow==","cpu": ["arm64"],+ "license": "Apache-2.0","optional": true,"os": ["darwin"],"engines": {- "glibc": ">=2.26",- "node": "^18.17.0 || ^20.3.0 || >=21.0.0",- "npm": ">=9.6.5",- "pnpm": ">=7.1.0",- "yarn": ">=3.2.0"+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"},"funding": {"url": "https://opencollective.com/libvips"},"optionalDependencies": {- "@img/sharp-libvips-darwin-arm64": "1.0.1"+ "@img/sharp-libvips-darwin-arm64": "1.1.0"}},"node_modules/@img/sharp-darwin-x64": {- "version": "0.33.2",- "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.2.tgz",- "integrity": "sha512-/rK/69Rrp9x5kaWBjVN07KixZanRr+W1OiyKdXcbjQD6KbW+obaTeBBtLUAtbBsnlTTmWthw99xqoOS7SsySDg==",+ "version": "0.34.0",+ "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.0.tgz",+ "integrity": "sha512-FZLxjWEtz+QbxZbtFb+f6AbD47/M9k6GuZ9dedTFdsgI9HwUMvyinxFMAeyP1fJZkJBw999Ht5Cus4sqpFlBPg==","cpu": ["x64"],+ "license": "Apache-2.0","optional": true,"os": ["darwin"],"engines": {- "glibc": ">=2.26",- "node": "^18.17.0 || ^20.3.0 || >=21.0.0",- "npm": ">=9.6.5",- "pnpm": ">=7.1.0",- "yarn": ">=3.2.0"+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"},"funding": {"url": "https://opencollective.com/libvips"},"optionalDependencies": {- "@img/sharp-libvips-darwin-x64": "1.0.1"+ "@img/sharp-libvips-darwin-x64": "1.1.0"}},"node_modules/@img/sharp-libvips-darwin-arm64": {- "version": "1.0.1",- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.1.tgz",- "integrity": "sha512-kQyrSNd6lmBV7O0BUiyu/OEw9yeNGFbQhbxswS1i6rMDwBBSX+e+rPzu3S+MwAiGU3HdLze3PanQ4Xkfemgzcw==",+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.1.0.tgz",+ "integrity": "sha512-HZ/JUmPwrJSoM4DIQPv/BfNh9yrOA8tlBbqbLz4JZ5uew2+o22Ik+tHQJcih7QJuSa0zo5coHTfD5J8inqj9DA==","cpu": ["arm64"],+ "license": "LGPL-3.0-or-later","optional": true,"os": ["darwin"],- "engines": {- "macos": ">=11",- "npm": ">=9.6.5",- "pnpm": ">=7.1.0",- "yarn": ">=3.2.0"- },"funding": {"url": "https://opencollective.com/libvips"}},"node_modules/@img/sharp-libvips-darwin-x64": {- "version": "1.0.1",- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.1.tgz",- "integrity": "sha512-eVU/JYLPVjhhrd8Tk6gosl5pVlvsqiFlt50wotCvdkFGf+mDNBJxMh+bvav+Wt3EBnNZWq8Sp2I7XfSjm8siog==",+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.1.0.tgz",+ "integrity": "sha512-Xzc2ToEmHN+hfvsl9wja0RlnXEgpKNmftriQp6XzY/RaSfwD9th+MSh0WQKzUreLKKINb3afirxW7A0fz2YWuQ==","cpu": ["x64"],+ "license": "LGPL-3.0-or-later","optional": true,"os": ["darwin"],- "engines": {- "macos": ">=10.13",- "npm": ">=9.6.5",- "pnpm": ">=7.1.0",- "yarn": ">=3.2.0"- },"funding": {"url": "https://opencollective.com/libvips"}},"node_modules/@img/sharp-libvips-linux-arm": {- "version": "1.0.1",- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.1.tgz",- "integrity": "sha512-FtdMvR4R99FTsD53IA3LxYGghQ82t3yt0ZQ93WMZ2xV3dqrb0E8zq4VHaTOuLEAuA83oDawHV3fd+BsAPadHIQ==",+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.1.0.tgz",+ "integrity": "sha512-s8BAd0lwUIvYCJyRdFqvsj+BJIpDBSxs6ivrOPm/R7piTs5UIwY5OjXrP2bqXC9/moGsyRa37eYWYCOGVXxVrA==","cpu": ["arm"],+ "license": "LGPL-3.0-or-later","optional": true,"os": ["linux"],- "engines": {- "glibc": ">=2.28",- "npm": ">=9.6.5",- "pnpm": ">=7.1.0",- "yarn": ">=3.2.0"- },"funding": {"url": "https://opencollective.com/libvips"}},"node_modules/@img/sharp-libvips-linux-arm64": {- "version": "1.0.1",- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.1.tgz",- "integrity": "sha512-bnGG+MJjdX70mAQcSLxgeJco11G+MxTz+ebxlz8Y3dxyeb3Nkl7LgLI0mXupoO+u1wRNx/iRj5yHtzA4sde1yA==",+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.1.0.tgz",+ "integrity": "sha512-IVfGJa7gjChDET1dK9SekxFFdflarnUB8PwW8aGwEoF3oAsSDuNUTYS+SKDOyOJxQyDC1aPFMuRYLoDInyV9Ew==","cpu": ["arm64"],+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linux-ppc64": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.1.0.tgz",+ "integrity": "sha512-tiXxFZFbhnkWE2LA8oQj7KYR+bWBkiV2nilRldT7bqoEZ4HiDOcePr9wVDAZPi/Id5fT1oY9iGnDq20cwUz8lQ==",+ "cpu": [+ "ppc64"+ ],+ "license": "LGPL-3.0-or-later","optional": true,"os": ["linux"],- "engines": {- "glibc": ">=2.26",- "npm": ">=9.6.5",- "pnpm": ">=7.1.0",- "yarn": ">=3.2.0"- },"funding": {"url": "https://opencollective.com/libvips"}},"node_modules/@img/sharp-libvips-linux-s390x": {- "version": "1.0.1",- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.1.tgz",- "integrity": "sha512-3+rzfAR1YpMOeA2zZNp+aYEzGNWK4zF3+sdMxuCS3ey9HhDbJ66w6hDSHDMoap32DueFwhhs3vwooAB2MaK4XQ==",+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.1.0.tgz",+ "integrity": "sha512-xukSwvhguw7COyzvmjydRb3x/09+21HykyapcZchiCUkTThEQEOMtBj9UhkaBRLuBrgLFzQ2wbxdeCCJW/jgJA==","cpu": ["s390x"],+ "license": "LGPL-3.0-or-later","optional": true,"os": ["linux"],- "engines": {- "glibc": ">=2.28",- "npm": ">=9.6.5",- "pnpm": ">=7.1.0",- "yarn": ">=3.2.0"- },"funding": {"url": "https://opencollective.com/libvips"}},"node_modules/@img/sharp-libvips-linux-x64": {- "version": "1.0.1",- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.1.tgz",- "integrity": "sha512-3NR1mxFsaSgMMzz1bAnnKbSAI+lHXVTqAHgc1bgzjHuXjo4hlscpUxc0vFSAPKI3yuzdzcZOkq7nDPrP2F8Jgw==",+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.1.0.tgz",+ "integrity": "sha512-yRj2+reB8iMg9W5sULM3S74jVS7zqSzHG3Ol/twnAAkAhnGQnpjj6e4ayUz7V+FpKypwgs82xbRdYtchTTUB+Q==","cpu": ["x64"],+ "license": "LGPL-3.0-or-later","optional": true,"os": ["linux"],- "engines": {- "glibc": ">=2.26",- "npm": ">=9.6.5",- "pnpm": ">=7.1.0",- "yarn": ">=3.2.0"- },"funding": {"url": "https://opencollective.com/libvips"}},"node_modules/@img/sharp-libvips-linuxmusl-arm64": {- "version": "1.0.1",- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.1.tgz",- "integrity": "sha512-5aBRcjHDG/T6jwC3Edl3lP8nl9U2Yo8+oTl5drd1dh9Z1EBfzUKAJFUDTDisDjUwc7N4AjnPGfCA3jl3hY8uDg==",+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.1.0.tgz",+ "integrity": "sha512-jYZdG+whg0MDK+q2COKbYidaqW/WTz0cc1E+tMAusiDygrM4ypmSCjOJPmFTvHHJ8j/6cAGyeDWZOsK06tP33w==","cpu": ["arm64"],+ "license": "LGPL-3.0-or-later","optional": true,"os": ["linux"],- "engines": {- "musl": ">=1.2.2",- "npm": ">=9.6.5",- "pnpm": ">=7.1.0",- "yarn": ">=3.2.0"- },"funding": {"url": "https://opencollective.com/libvips"}},"node_modules/@img/sharp-libvips-linuxmusl-x64": {- "version": "1.0.1",- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.1.tgz",- "integrity": "sha512-dcT7inI9DBFK6ovfeWRe3hG30h51cBAP5JXlZfx6pzc/Mnf9HFCQDLtYf4MCBjxaaTfjCCjkBxcy3XzOAo5txw==",+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.1.0.tgz",+ "integrity": "sha512-wK7SBdwrAiycjXdkPnGCPLjYb9lD4l6Ze2gSdAGVZrEL05AOUJESWU2lhlC+Ffn5/G+VKuSm6zzbQSzFX/P65A==","cpu": ["x64"],+ "license": "LGPL-3.0-or-later","optional": true,"os": ["linux"],- "engines": {- "musl": ">=1.2.2",- "npm": ">=9.6.5",- "pnpm": ">=7.1.0",- "yarn": ">=3.2.0"- },"funding": {"url": "https://opencollective.com/libvips"}},"node_modules/@img/sharp-linux-arm": {- "version": "0.33.2",- "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.2.tgz",- "integrity": "sha512-Fndk/4Zq3vAc4G/qyfXASbS3HBZbKrlnKZLEJzPLrXoJuipFNNwTes71+Ki1hwYW5lch26niRYoZFAtZVf3EGA==",+ "version": "0.34.0",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.0.tgz",+ "integrity": "sha512-MfbqXi4zdy0CsSONwESFzrdpzcNSN66qbt8a7CdesOFfZHmlPXgC+xOy+2SLYn6+MFi/06qngGRIje7vfAV/5Q==","cpu": ["arm"],+ "license": "Apache-2.0","optional": true,"os": ["linux"],"engines": {- "glibc": ">=2.28",- "node": "^18.17.0 || ^20.3.0 || >=21.0.0",- "npm": ">=9.6.5",- "pnpm": ">=7.1.0",- "yarn": ">=3.2.0"+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"},"funding": {"url": "https://opencollective.com/libvips"},"optionalDependencies": {- "@img/sharp-libvips-linux-arm": "1.0.1"+ "@img/sharp-libvips-linux-arm": "1.1.0"}},"node_modules/@img/sharp-linux-arm64": {- "version": "0.33.2",- "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.2.tgz",- "integrity": "sha512-pz0NNo882vVfqJ0yNInuG9YH71smP4gRSdeL09ukC2YLE6ZyZePAlWKEHgAzJGTiOh8Qkaov6mMIMlEhmLdKew==",+ "version": "0.34.0",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.0.tgz",+ "integrity": "sha512-fpvIy7rPdTegqthhUNAaQikg8CzNUGxuf7VTIs5HEQllCTL322rBDuGHVoH/pZ6Qms9enHe++DsUoG/Ux93E1A==","cpu": ["arm64"],+ "license": "Apache-2.0","optional": true,"os": ["linux"],"engines": {- "glibc": ">=2.26",- "node": "^18.17.0 || ^20.3.0 || >=21.0.0",- "npm": ">=9.6.5",- "pnpm": ">=7.1.0",- "yarn": ">=3.2.0"+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"},"funding": {"url": "https://opencollective.com/libvips"},"optionalDependencies": {- "@img/sharp-libvips-linux-arm64": "1.0.1"+ "@img/sharp-libvips-linux-arm64": "1.1.0"}},"node_modules/@img/sharp-linux-s390x": {- "version": "0.33.2",- "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.2.tgz",- "integrity": "sha512-MBoInDXDppMfhSzbMmOQtGfloVAflS2rP1qPcUIiITMi36Mm5YR7r0ASND99razjQUpHTzjrU1flO76hKvP5RA==",+ "version": "0.34.0",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.0.tgz",+ "integrity": "sha512-04jdT+VCZIqj0RoTEpWXh0lErZC9prhkxEZWrQdGt1MZ368SlvXpKkXCD4Ww5ISc3LexBmfnAW/+ErUmD9sRPQ==","cpu": ["s390x"],+ "license": "Apache-2.0","optional": true,"os": ["linux"],"engines": {- "glibc": ">=2.28",- "node": "^18.17.0 || ^20.3.0 || >=21.0.0",- "npm": ">=9.6.5",- "pnpm": ">=7.1.0",- "yarn": ">=3.2.0"+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"},"funding": {"url": "https://opencollective.com/libvips"},"optionalDependencies": {- "@img/sharp-libvips-linux-s390x": "1.0.1"+ "@img/sharp-libvips-linux-s390x": "1.1.0"}},"node_modules/@img/sharp-linux-x64": {- "version": "0.33.2",- "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.2.tgz",- "integrity": "sha512-xUT82H5IbXewKkeF5aiooajoO1tQV4PnKfS/OZtb5DDdxS/FCI/uXTVZ35GQ97RZXsycojz/AJ0asoz6p2/H/A==",+ "version": "0.34.0",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.0.tgz",+ "integrity": "sha512-Y98V1d5vh8RIpf+pUb7U9a0SGzfPa7x7KPXsqtvb7i52L7HXAMv5U0aaOdnnf/CAqVUVaTJajINJ3KyrLcwByQ==","cpu": ["x64"],+ "license": "Apache-2.0","optional": true,"os": ["linux"],"engines": {- "glibc": ">=2.26",- "node": "^18.17.0 || ^20.3.0 || >=21.0.0",- "npm": ">=9.6.5",- "pnpm": ">=7.1.0",- "yarn": ">=3.2.0"+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"},"funding": {"url": "https://opencollective.com/libvips"},"optionalDependencies": {- "@img/sharp-libvips-linux-x64": "1.0.1"+ "@img/sharp-libvips-linux-x64": "1.1.0"}},"node_modules/@img/sharp-linuxmusl-arm64": {- "version": "0.33.2",- "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.2.tgz",- "integrity": "sha512-F+0z8JCu/UnMzg8IYW1TMeiViIWBVg7IWP6nE0p5S5EPQxlLd76c8jYemG21X99UzFwgkRo5yz2DS+zbrnxZeA==",+ "version": "0.34.0",+ "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.0.tgz",+ "integrity": "sha512-pmsehGlQIOlAQ8lgtDxpGInXXMAV6JrFwoJ0Ib9PpsVYuwFM+Soa9mVZMfsTO+u9dBhCMEn2AP3mRUljgpGYvQ==","cpu": ["arm64"],+ "license": "Apache-2.0","optional": true,"os": ["linux"],"engines": {- "musl": ">=1.2.2",- "node": "^18.17.0 || ^20.3.0 || >=21.0.0",- "npm": ">=9.6.5",- "pnpm": ">=7.1.0",- "yarn": ">=3.2.0"+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"},"funding": {"url": "https://opencollective.com/libvips"},"optionalDependencies": {- "@img/sharp-libvips-linuxmusl-arm64": "1.0.1"+ "@img/sharp-libvips-linuxmusl-arm64": "1.1.0"}},"node_modules/@img/sharp-linuxmusl-x64": {- "version": "0.33.2",- "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.2.tgz",- "integrity": "sha512-+ZLE3SQmSL+Fn1gmSaM8uFusW5Y3J9VOf+wMGNnTtJUMUxFhv+P4UPaYEYT8tqnyYVaOVGgMN/zsOxn9pSsO2A==",+ "version": "0.34.0",+ "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.0.tgz",+ "integrity": "sha512-t80LMHorxyKGIPWIX3Qyamg72vj/TGYLyOvzjvkywvNmlQurgHu3ZI2aZnUc5YQlrKPOovnwkVmTEbH+YllQ5Q==","cpu": ["x64"],+ "license": "Apache-2.0","optional": true,"os": ["linux"],"engines": {- "musl": ">=1.2.2",- "node": "^18.17.0 || ^20.3.0 || >=21.0.0",- "npm": ">=9.6.5",- "pnpm": ">=7.1.0",- "yarn": ">=3.2.0"+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"},"funding": {"url": "https://opencollective.com/libvips"},"optionalDependencies": {- "@img/sharp-libvips-linuxmusl-x64": "1.0.1"+ "@img/sharp-libvips-linuxmusl-x64": "1.1.0"}},"node_modules/@img/sharp-wasm32": {- "version": "0.33.2",- "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.2.tgz",- "integrity": "sha512-fLbTaESVKuQcpm8ffgBD7jLb/CQLcATju/jxtTXR1XCLwbOQt+OL5zPHSDMmp2JZIeq82e18yE0Vv7zh6+6BfQ==",+ "version": "0.34.0",+ "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.0.tgz",+ "integrity": "sha512-oI6xsOqLHhRA3LSZb07KW3dMAmo1PpyAxwdHkuiC5+N8HzodpqXusOtzBEXKeFG8Za5ycry0xLYsu7hG5aUxoQ==","cpu": ["wasm32"],+ "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT","optional": true,"dependencies": {- "@emnapi/runtime": "^0.45.0"+ "@emnapi/runtime": "^1.4.0"},"engines": {- "node": "^18.17.0 || ^20.3.0 || >=21.0.0",- "npm": ">=9.6.5",- "pnpm": ">=7.1.0",- "yarn": ">=3.2.0"+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"},"funding": {"url": "https://opencollective.com/libvips"}},"node_modules/@img/sharp-win32-ia32": {- "version": "0.33.2",- "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.2.tgz",- "integrity": "sha512-okBpql96hIGuZ4lN3+nsAjGeggxKm7hIRu9zyec0lnfB8E7Z6p95BuRZzDDXZOl2e8UmR4RhYt631i7mfmKU8g==",+ "version": "0.34.0",+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.0.tgz",+ "integrity": "sha512-ofcDYsjJJ1zya9s/GCnXjbFIhTw5/gRVr+SivAGPMXmAml/rLLyDu/HtWntvhiacnL4VYvtgMFw/B2Zz/kgoWQ==","cpu": ["ia32"],+ "license": "Apache-2.0 AND LGPL-3.0-or-later","optional": true,"os": ["win32"],"engines": {- "node": "^18.17.0 || ^20.3.0 || >=21.0.0",- "npm": ">=9.6.5",- "pnpm": ">=7.1.0",- "yarn": ">=3.2.0"+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"},"funding": {"url": "https://opencollective.com/libvips"}},"node_modules/@img/sharp-win32-x64": {- "version": "0.33.2",- "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.2.tgz",- "integrity": "sha512-E4magOks77DK47FwHUIGH0RYWSgRBfGdK56kIHSVeB9uIS4pPFr4N2kIVsXdQQo4LzOsENKV5KAhRlRL7eMAdg==",+ "version": "0.34.0",+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.0.tgz",+ "integrity": "sha512-S0X+Uty7Qe6tBfTigFEInchNsGYM/uRjuF1ixi8mLubMfTClmbnVIMxR2/cD5I5Z1m6lHP5D6ASneM3qsF3KFA==","cpu": ["x64"],+ "license": "Apache-2.0 AND LGPL-3.0-or-later","optional": true,"os": ["win32"],"engines": {- "node": "^18.17.0 || ^20.3.0 || >=21.0.0",- "npm": ">=9.6.5",- "pnpm": ">=7.1.0",- "yarn": ">=3.2.0"+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"},"funding": {"url": "https://opencollective.com/libvips"@@ -527,9 +474,10 @@}},"node_modules/detect-libc": {- "version": "2.0.2",- "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz",- "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==",+ "version": "2.0.3",+ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz",+ "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==",+ "license": "Apache-2.0","engines": {"node": ">=8"}@@ -556,13 +504,10 @@}},"node_modules/image-size": {- "version": "1.2.1",- "resolved": "https://registry.npmjs.org/image-size/-/image-size-1.2.1.tgz",- "integrity": "sha512-rH+46sQJ2dlwfjfhCyNx5thzrv+dtmBIhPHk0zgRUukHzZ/kRueTJXoYYsclBaKcSMBWuGbOFXtioLpzTb5euw==",+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/image-size/-/image-size-2.0.2.tgz",+ "integrity": "sha512-IRqXKlaXwgSMAMtpNzZa1ZAe8m+Sa1770Dhk8VkSsP9LS+iHD62Zd8FQKs8fbPiagBE7BzoFX23cxFnwshpV6w==","license": "MIT",- "dependencies": {- "queue": "6.0.2"- },"bin": {"image-size": "bin/image-size.js"},@@ -570,11 +515,6 @@"node": ">=16.x"}},- "node_modules/inherits": {- "version": "2.0.4",- "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",- "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="- },"node_modules/is-arrayish": {"version": "0.3.2","resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",@@ -588,25 +528,6 @@"node": ">=8"}},- "node_modules/lru-cache": {- "version": "6.0.0",- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",- "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",- "dependencies": {- "yallist": "^4.0.0"- },- "engines": {- "node": ">=10"- }- },- "node_modules/queue": {- "version": "6.0.2",- "resolved": "https://registry.npmjs.org/queue/-/queue-6.0.2.tgz",- "integrity": "sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==",- "dependencies": {- "inherits": "~2.0.3"- }- },"node_modules/require-directory": {"version": "2.1.1","resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",@@ -616,12 +537,10 @@}},"node_modules/semver": {- "version": "7.6.0",- "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz",- "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==",- "dependencies": {- "lru-cache": "^6.0.0"- },+ "version": "7.7.1",+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz",+ "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==",+ "license": "ISC","bin": {"semver": "bin/semver.js"},@@ -630,42 +549,43 @@}},"node_modules/sharp": {- "version": "0.33.2",- "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.2.tgz",- "integrity": "sha512-WlYOPyyPDiiM07j/UO+E720ju6gtNtHjEGg5vovUk1Lgxyjm2LFO+37Nt/UI3MMh2l6hxTWQWi7qk3cXJTutcQ==",+ "version": "0.34.0",+ "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.0.tgz",+ "integrity": "sha512-l7K33wCojhluT82RQXKm3X/y9Y6yBioJ4GaOlGT67yDv8bXZcU3aOlxUM0W1zUUKQjOoIh3VcfQEKHVW9AyijQ==","hasInstallScript": true,+ "license": "Apache-2.0","dependencies": {"color": "^4.2.3",- "detect-libc": "^2.0.2",- "semver": "^7.5.4"+ "detect-libc": "^2.0.3",+ "semver": "^7.7.1"},"engines": {- "libvips": ">=8.15.1","node": "^18.17.0 || ^20.3.0 || >=21.0.0"},"funding": {"url": "https://opencollective.com/libvips"},"optionalDependencies": {- "@img/sharp-darwin-arm64": "0.33.2",- "@img/sharp-darwin-x64": "0.33.2",- "@img/sharp-libvips-darwin-arm64": "1.0.1",- "@img/sharp-libvips-darwin-x64": "1.0.1",- "@img/sharp-libvips-linux-arm": "1.0.1",- "@img/sharp-libvips-linux-arm64": "1.0.1",- "@img/sharp-libvips-linux-s390x": "1.0.1",- "@img/sharp-libvips-linux-x64": "1.0.1",- "@img/sharp-libvips-linuxmusl-arm64": "1.0.1",- "@img/sharp-libvips-linuxmusl-x64": "1.0.1",- "@img/sharp-linux-arm": "0.33.2",- "@img/sharp-linux-arm64": "0.33.2",- "@img/sharp-linux-s390x": "0.33.2",- "@img/sharp-linux-x64": "0.33.2",- "@img/sharp-linuxmusl-arm64": "0.33.2",- "@img/sharp-linuxmusl-x64": "0.33.2",- "@img/sharp-wasm32": "0.33.2",- "@img/sharp-win32-ia32": "0.33.2",- "@img/sharp-win32-x64": "0.33.2"+ "@img/sharp-darwin-arm64": "0.34.0",+ "@img/sharp-darwin-x64": "0.34.0",+ "@img/sharp-libvips-darwin-arm64": "1.1.0",+ "@img/sharp-libvips-darwin-x64": "1.1.0",+ "@img/sharp-libvips-linux-arm": "1.1.0",+ "@img/sharp-libvips-linux-arm64": "1.1.0",+ "@img/sharp-libvips-linux-ppc64": "1.1.0",+ "@img/sharp-libvips-linux-s390x": "1.1.0",+ "@img/sharp-libvips-linux-x64": "1.1.0",+ "@img/sharp-libvips-linuxmusl-arm64": "1.1.0",+ "@img/sharp-libvips-linuxmusl-x64": "1.1.0",+ "@img/sharp-linux-arm": "0.34.0",+ "@img/sharp-linux-arm64": "0.34.0",+ "@img/sharp-linux-s390x": "0.34.0",+ "@img/sharp-linux-x64": "0.34.0",+ "@img/sharp-linuxmusl-arm64": "0.34.0",+ "@img/sharp-linuxmusl-x64": "0.34.0",+ "@img/sharp-wasm32": "0.34.0",+ "@img/sharp-win32-ia32": "0.34.0",+ "@img/sharp-win32-x64": "0.34.0"}},"node_modules/simple-swizzle": {@@ -701,9 +621,10 @@}},"node_modules/tslib": {- "version": "2.6.2",- "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",- "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==",+ "version": "2.8.1",+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",+ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",+ "license": "0BSD","optional": true},"node_modules/wrap-ansi": {@@ -730,11 +651,6 @@"node": ">=10"}},- "node_modules/yallist": {- "version": "4.0.0",- "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",- "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="- },"node_modules/yargs": {"version": "17.7.2","resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",diff --git a/etc/imageResize/package.json b/etc/imageResize/package.jsonindex 3e678cc51..2f4ac413e 100644--- a/etc/imageResize/package.json+++ b/etc/imageResize/package.json@@ -10,8 +10,8 @@"author": "","license": "ISC","dependencies": {- "image-size": "^1.2.1",- "sharp": "^0.33.2",+ "image-size": "^2.0.2",+ "sharp": "^0.34.0","yargs": "^17.7.2"}}diff --git a/src/main/webapp/js/app.min.js b/src/main/webapp/js/app.min.jsindex 2d2f4e08a..779f25804 100644--- a/src/main/webapp/js/app.min.js+++ b/src/main/webapp/js/app.min.js@@ -1,7 +1,7 @@//fgnass.github.com/spin.js#v2.0.0!function(a,b){"object"==typeof exports?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Spinner=b()}(this,function(){"use strict";function a(a,b){var c,d=document.createElement(a||"div");for(c in b)d[c]=b[c];return d}function b(a){for(var b=1,c=arguments.length;c>b;b++)a.appendChild(arguments[b]);return a}function c(a,b,c,d){var e=["opacity",b,~~(100*a),c,d].join("-"),f=.01+c/d*100,g=Math.max(1-(1-a)/b*(100-f),a),h=j.substring(0,j.indexOf("Animation")).toLowerCase(),i=h&&"-"+h+"-"||"";return l[e]||(m.insertRule("@"+i+"keyframes "+e+"{0%{opacity:"+g+"}"+f+"%{opacity:"+a+"}"+(f+.01)+"%{opacity:1}"+(f+b)%100+"%{opacity:"+a+"}100%{opacity:"+g+"}}",m.cssRules.length),l[e]=1),e}function d(a,b){var c,d,e=a.style;for(b=b.charAt(0).toUpperCase()+b.slice(1),d=0;d<k.length;d++)if(c=k[d]+b,void 0!==e[c])return c;return void 0!==e[b]?b:void 0}function e(a,b){for(var c in b)a.style[d(a,c)||c]=b[c];return a}function f(a){for(var b=1;b<arguments.length;b++){var c=arguments[b];for(var d in c)void 0===a[d]&&(a[d]=c[d])}return a}function g(a,b){return"string"==typeof a?a:a[b%a.length]}function h(a){this.opts=f(a||{},h.defaults,n)}function i(){function c(b,c){return a("<"+b+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',c)}m.addRule(".spin-vml","behavior:url(#default#VML)"),h.prototype.lines=function(a,d){function f(){return e(c("group",{coordsize:k+" "+k,coordorigin:-j+" "+-j}),{width:k,height:k})}function h(a,h,i){b(m,b(e(f(),{rotation:360/d.lines*a+"deg",left:~~h}),b(e(c("roundrect",{arcsize:d.corners}),{width:j,height:d.width,left:d.radius,top:-d.width>>1,filter:i}),c("fill",{color:g(d.color,a),opacity:d.opacity}),c("stroke",{opacity:0}))))}var i,j=d.length+d.width,k=2*j,l=2*-(d.width+d.length)+"px",m=e(f(),{position:"absolute",top:l,left:l});if(d.shadow)for(i=1;i<=d.lines;i++)h(i,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(i=1;i<=d.lines;i++)h(i);return b(a,m)},h.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d<e.childNodes.length&&(e=e.childNodes[b+d],e=e&&e.firstChild,e=e&&e.firstChild,e&&(e.opacity=c))}}var j,k=["webkit","Moz","ms","O"],l={},m=function(){var c=a("style",{type:"text/css"});return b(document.getElementsByTagName("head")[0],c),c.sheet||c.styleSheet}(),n={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:"#000",direction:1,speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"50%",left:"50%",position:"absolute"};h.defaults={},f(h.prototype,{spin:function(b){this.stop();{var c=this,d=c.opts,f=c.el=e(a(0,{className:d.className}),{position:d.position,width:0,zIndex:d.zIndex});d.radius+d.length+d.width}if(b&&(b.insertBefore(f,b.firstChild||null),e(f,{left:d.left,top:d.top})),f.setAttribute("role","progressbar"),c.lines(f,c.opts),!j){var g,h=0,i=(d.lines-1)*(1-d.direction)/2,k=d.fps,l=k/d.speed,m=(1-d.opacity)/(l*d.trail/100),n=l/d.lines;!function o(){h++;for(var a=0;a<d.lines;a++)g=Math.max(1-(h+(d.lines-a)*n)%l*m,d.opacity),c.opacity(f,a*d.direction+i,g,d);c.timeout=c.el&&setTimeout(o,~~(1e3/k))}()}return c},stop:function(){var a=this.el;return a&&(clearTimeout(this.timeout),a.parentNode&&a.parentNode.removeChild(a),this.el=void 0),this},lines:function(d,f){function h(b,c){return e(a(),{position:"absolute",width:f.length+f.width+"px",height:f.width+"px",background:b,boxShadow:c,transformOrigin:"left",transform:"rotate("+~~(360/f.lines*k+f.rotate)+"deg) translate("+f.radius+"px,0)",borderRadius:(f.corners*f.width>>1)+"px"})}for(var i,k=0,l=(f.lines-1)*(1-f.direction)/2;k<f.lines;k++)i=e(a(),{position:"absolute",top:1+~(f.width/2)+"px",transform:f.hwaccel?"translate3d(0,0,0)":"",opacity:f.opacity,animation:j&&c(f.opacity,f.trail,l+k*f.direction,f.lines)+" "+1/f.speed+"s linear infinite"}),f.shadow&&b(i,e(h("#000","0 0 4px #000"),{top:"2px"})),b(d,b(i,h(g(f.color,k),"0 0 1px rgba(0,0,0,.1)")));return d},opacity:function(a,b,c){b<a.childNodes.length&&(a.childNodes[b].style.opacity=c)}});var o=e(a("group"),{behavior:"url(#default#VML)"});return!d(o,"transform")&&o.adj?i():j=d(o,"animation"),h});-/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */-!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DOMPurify=t()}(this,(function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:r}=Object;let{freeze:i,seal:a,create:l}=Object,{apply:c,construct:s}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),a||(a=function(e){return e}),c||(c=function(e,t,n){return e.apply(t,n)}),s||(s=function(e,t){return new e(...t)});const u=R(Array.prototype.forEach),m=R(Array.prototype.lastIndexOf),p=R(Array.prototype.pop),f=R(Array.prototype.push),d=R(Array.prototype.splice),h=R(String.prototype.toLowerCase),g=R(String.prototype.toString),T=R(String.prototype.match),y=R(String.prototype.replace),E=R(String.prototype.indexOf),A=R(String.prototype.trim),_=R(Object.prototype.hasOwnProperty),S=R(RegExp.prototype.test),b=(N=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(N,t)});var N;function R(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return c(e,t,o)}}function w(e,o){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;t&&t(e,null);let i=o.length;for(;i--;){let t=o[i];if("string"==typeof t){const e=r(t);e!==t&&(n(o)||(o[i]=e),t=e)}e[t]=!0}return e}function O(e){for(let t=0;t<e.length;t++){_(e,t)||(e[t]=null)}return e}function D(t){const n=l(null);for(const[o,r]of e(t)){_(t,o)&&(Array.isArray(r)?n[o]=O(r):r&&"object"==typeof r&&r.constructor===Object?n[o]=D(r):n[o]=r)}return n}function v(e,t){for(;null!==e;){const n=r(e,t);if(n){if(n.get)return R(n.get);if("function"==typeof n.value)return R(n.value)}e=o(e)}return function(){return null}}const L=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),C=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),x=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),M=i(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),k=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),I=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),U=i(["#text"]),z=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),P=i(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),H=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),F=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),W=a(/<%[\w\W]*|[\w\W]*%>/gm),G=a(/\$\{[\w\W]*/gm),Y=a(/^data-[\-\w.\u00B7-\uFFFF]+$/),j=a(/^aria-[\-\w]+$/),X=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),q=a(/^(?:\w+script|data):/i),$=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=a(/^html$/i),V=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var Z=Object.freeze({__proto__:null,ARIA_ATTR:j,ATTR_WHITESPACE:$,CUSTOM_ELEMENT:V,DATA_ATTR:Y,DOCTYPE_NAME:K,ERB_EXPR:W,IS_ALLOWED_URI:X,IS_SCRIPT_OR_DATA:q,MUSTACHE_EXPR:B,TMPLIT_EXPR:G});const J=1,Q=3,ee=7,te=8,ne=9,oe=function(){return"undefined"==typeof window?null:window};var re=function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oe();const o=e=>t(e);if(o.version="3.2.4",o.removed=[],!n||!n.document||n.document.nodeType!==ne||!n.Element)return o.isSupported=!1,o;let{document:r}=n;const a=r,c=a.currentScript,{DocumentFragment:s,HTMLTemplateElement:N,Node:R,Element:O,NodeFilter:B,NamedNodeMap:W=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:G,DOMParser:Y,trustedTypes:j}=n,q=O.prototype,$=v(q,"cloneNode"),V=v(q,"remove"),re=v(q,"nextSibling"),ie=v(q,"childNodes"),ae=v(q,"parentNode");if("function"==typeof N){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let le,ce="";const{implementation:se,createNodeIterator:ue,createDocumentFragment:me,getElementsByTagName:pe}=r,{importNode:fe}=a;let de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};o.isSupported="function"==typeof e&&"function"==typeof ae&&se&&void 0!==se.createHTMLDocument;const{MUSTACHE_EXPR:he,ERB_EXPR:ge,TMPLIT_EXPR:Te,DATA_ATTR:ye,ARIA_ATTR:Ee,IS_SCRIPT_OR_DATA:Ae,ATTR_WHITESPACE:_e,CUSTOM_ELEMENT:Se}=Z;let{IS_ALLOWED_URI:be}=Z,Ne=null;const Re=w({},[...L,...C,...x,...k,...U]);let we=null;const Oe=w({},[...z,...P,...H,...F]);let De=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ve=null,Le=null,Ce=!0,xe=!0,Me=!1,ke=!0,Ie=!1,Ue=!0,ze=!1,Pe=!1,He=!1,Fe=!1,Be=!1,We=!1,Ge=!0,Ye=!1,je=!0,Xe=!1,qe={},$e=null;const Ke=w({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ve=null;const Ze=w({},["audio","video","img","source","image","track"]);let Je=null;const Qe=w({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let ot=nt,rt=!1,it=null;const at=w({},[et,tt,nt],g);let lt=w({},["mi","mo","mn","ms","mtext"]),ct=w({},["annotation-xml"]);const st=w({},["title","style","font","a","script"]);let ut=null;const mt=["application/xhtml+xml","text/html"];let pt=null,ft=null;const dt=r.createElement("form"),ht=function(e){return e instanceof RegExp||e instanceof Function},gt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ft||ft!==e){if(e&&"object"==typeof e||(e={}),e=D(e),ut=-1===mt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,pt="application/xhtml+xml"===ut?g:h,Ne=_(e,"ALLOWED_TAGS")?w({},e.ALLOWED_TAGS,pt):Re,we=_(e,"ALLOWED_ATTR")?w({},e.ALLOWED_ATTR,pt):Oe,it=_(e,"ALLOWED_NAMESPACES")?w({},e.ALLOWED_NAMESPACES,g):at,Je=_(e,"ADD_URI_SAFE_ATTR")?w(D(Qe),e.ADD_URI_SAFE_ATTR,pt):Qe,Ve=_(e,"ADD_DATA_URI_TAGS")?w(D(Ze),e.ADD_DATA_URI_TAGS,pt):Ze,$e=_(e,"FORBID_CONTENTS")?w({},e.FORBID_CONTENTS,pt):Ke,ve=_(e,"FORBID_TAGS")?w({},e.FORBID_TAGS,pt):{},Le=_(e,"FORBID_ATTR")?w({},e.FORBID_ATTR,pt):{},qe=!!_(e,"USE_PROFILES")&&e.USE_PROFILES,Ce=!1!==e.ALLOW_ARIA_ATTR,xe=!1!==e.ALLOW_DATA_ATTR,Me=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ke=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Ie=e.SAFE_FOR_TEMPLATES||!1,Ue=!1!==e.SAFE_FOR_XML,ze=e.WHOLE_DOCUMENT||!1,Fe=e.RETURN_DOM||!1,Be=e.RETURN_DOM_FRAGMENT||!1,We=e.RETURN_TRUSTED_TYPE||!1,He=e.FORCE_BODY||!1,Ge=!1!==e.SANITIZE_DOM,Ye=e.SANITIZE_NAMED_PROPS||!1,je=!1!==e.KEEP_CONTENT,Xe=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||X,ot=e.NAMESPACE||nt,lt=e.MATHML_TEXT_INTEGRATION_POINTS||lt,ct=e.HTML_INTEGRATION_POINTS||ct,De=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(De.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(De.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(De.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ie&&(xe=!1),Be&&(Fe=!0),qe&&(Ne=w({},U),we=[],!0===qe.html&&(w(Ne,L),w(we,z)),!0===qe.svg&&(w(Ne,C),w(we,P),w(we,F)),!0===qe.svgFilters&&(w(Ne,x),w(we,P),w(we,F)),!0===qe.mathMl&&(w(Ne,k),w(we,H),w(we,F))),e.ADD_TAGS&&(Ne===Re&&(Ne=D(Ne)),w(Ne,e.ADD_TAGS,pt)),e.ADD_ATTR&&(we===Oe&&(we=D(we)),w(we,e.ADD_ATTR,pt)),e.ADD_URI_SAFE_ATTR&&w(Je,e.ADD_URI_SAFE_ATTR,pt),e.FORBID_CONTENTS&&($e===Ke&&($e=D($e)),w($e,e.FORBID_CONTENTS,pt)),je&&(Ne["#text"]=!0),ze&&w(Ne,["html","head","body"]),Ne.table&&(w(Ne,["tbody"]),delete ve.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');le=e.TRUSTED_TYPES_POLICY,ce=le.createHTML("")}else void 0===le&&(le=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(j,c)),null!==le&&"string"==typeof ce&&(ce=le.createHTML(""));i&&i(e),ft=e}},Tt=w({},[...C,...x,...M]),yt=w({},[...k,...I]),Et=function(e){f(o.removed,{element:e});try{ae(e).removeChild(e)}catch(t){V(e)}},At=function(e,t){try{f(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Fe||Be)try{Et(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},_t=function(e){let t=null,n=null;if(He)e="<remove></remove>"+e;else{const t=T(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ut&&ot===nt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=le?le.createHTML(e):e;if(ot===nt)try{t=(new Y).parseFromString(o,ut)}catch(e){}if(!t||!t.documentElement){t=se.createDocument(ot,"template",null);try{t.documentElement.innerHTML=rt?ce:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),ot===nt?pe.call(t,ze?"html":"body")[0]:ze?t.documentElement:i},St=function(e){return ue.call(e.ownerDocument||e,e,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT|B.SHOW_PROCESSING_INSTRUCTION|B.SHOW_CDATA_SECTION,null)},bt=function(e){return e instanceof G&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof W)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Nt=function(e){return"function"==typeof R&&e instanceof R};function Rt(e,t,n){u(e,(e=>{e.call(o,t,n,ft)}))}const wt=function(e){let t=null;if(Rt(de.beforeSanitizeElements,e,null),bt(e))return Et(e),!0;const n=pt(e.nodeName);if(Rt(de.uponSanitizeElement,e,{tagName:n,allowedTags:Ne}),e.hasChildNodes()&&!Nt(e.firstElementChild)&&S(/<[/\w]/g,e.innerHTML)&&S(/<[/\w]/g,e.textContent))return Et(e),!0;if(e.nodeType===ee)return Et(e),!0;if(Ue&&e.nodeType===te&&S(/<[/\w]/g,e.data))return Et(e),!0;if(!Ne[n]||ve[n]){if(!ve[n]&&Dt(n)){if(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n))return!1;if(De.tagNameCheck instanceof Function&&De.tagNameCheck(n))return!1}if(je&&!$e[n]){const t=ae(e)||e.parentNode,n=ie(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o){const r=$(n[o],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,re(e))}}}return Et(e),!0}return e instanceof O&&!function(e){let t=ae(e);t&&t.tagName||(t={namespaceURI:ot,tagName:"template"});const n=h(e.tagName),o=h(t.tagName);return!!it[e.namespaceURI]&&(e.namespaceURI===tt?t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===o||lt[o]):Boolean(Tt[n]):e.namespaceURI===et?t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&ct[o]:Boolean(yt[n]):e.namespaceURI===nt?!(t.namespaceURI===tt&&!ct[o])&&!(t.namespaceURI===et&&!lt[o])&&!yt[n]&&(st[n]||!Tt[n]):!("application/xhtml+xml"!==ut||!it[e.namespaceURI]))}(e)?(Et(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!S(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ie&&e.nodeType===Q&&(t=e.textContent,u([he,ge,Te],(e=>{t=y(t,e," ")})),e.textContent!==t&&(f(o.removed,{element:e.cloneNode()}),e.textContent=t)),Rt(de.afterSanitizeElements,e,null),!1):(Et(e),!0)},Ot=function(e,t,n){if(Ge&&("id"===t||"name"===t)&&(n in r||n in dt))return!1;if(xe&&!Le[t]&&S(ye,t));else if(Ce&&S(Ee,t));else if(!we[t]||Le[t]){if(!(Dt(e)&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,e)||De.tagNameCheck instanceof Function&&De.tagNameCheck(e))&&(De.attributeNameCheck instanceof RegExp&&S(De.attributeNameCheck,t)||De.attributeNameCheck instanceof Function&&De.attributeNameCheck(t))||"is"===t&&De.allowCustomizedBuiltInElements&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n)||De.tagNameCheck instanceof Function&&De.tagNameCheck(n))))return!1}else if(Je[t]);else if(S(be,y(n,_e,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==E(n,"data:")||!Ve[e]){if(Me&&!S(Ae,y(n,_e,"")));else if(n)return!1}else;return!0},Dt=function(e){return"annotation-xml"!==e&&T(e,Se)},vt=function(e){Rt(de.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||bt(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:we,forceKeepAttr:void 0};let r=t.length;for(;r--;){const i=t[r],{name:a,namespaceURI:l,value:c}=i,s=pt(a);let m="value"===a?c:A(c);if(n.attrName=s,n.attrValue=m,n.keepAttr=!0,n.forceKeepAttr=void 0,Rt(de.uponSanitizeAttribute,e,n),m=n.attrValue,!Ye||"id"!==s&&"name"!==s||(At(a,e),m="user-content-"+m),Ue&&S(/((--!?|])>)|<\/(style|title)/i,m)){At(a,e);continue}if(n.forceKeepAttr)continue;if(At(a,e),!n.keepAttr)continue;if(!ke&&S(/\/>/i,m)){At(a,e);continue}Ie&&u([he,ge,Te],(e=>{m=y(m,e," ")}));const f=pt(e.nodeName);if(Ot(f,s,m)){if(le&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(l);else switch(j.getAttributeType(f,s)){case"TrustedHTML":m=le.createHTML(m);break;case"TrustedScriptURL":m=le.createScriptURL(m)}try{l?e.setAttributeNS(l,a,m):e.setAttribute(a,m),bt(e)?Et(e):p(o.removed)}catch(e){}}}Rt(de.afterSanitizeAttributes,e,null)},Lt=function e(t){let n=null;const o=St(t);for(Rt(de.beforeSanitizeShadowDOM,t,null);n=o.nextNode();)Rt(de.uponSanitizeShadowNode,n,null),wt(n),vt(n),n.content instanceof s&&e(n.content);Rt(de.afterSanitizeShadowDOM,t,null)};return o.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=null,i=null,l=null;if(rt=!e,rt&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Nt(e)){if("function"!=typeof e.toString)throw b("toString is not a function");if("string"!=typeof(e=e.toString()))throw b("dirty is not a string, aborting")}if(!o.isSupported)return e;if(Pe||gt(t),o.removed=[],"string"==typeof e&&(Xe=!1),Xe){if(e.nodeName){const t=pt(e.nodeName);if(!Ne[t]||ve[t])throw b("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof R)n=_t("\x3c!----\x3e"),r=n.ownerDocument.importNode(e,!0),r.nodeType===J&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(!Fe&&!Ie&&!ze&&-1===e.indexOf("<"))return le&&We?le.createHTML(e):e;if(n=_t(e),!n)return Fe?null:We?ce:""}n&&He&&Et(n.firstChild);const c=St(Xe?e:n);for(;i=c.nextNode();)wt(i),vt(i),i.content instanceof s&&Lt(i.content);if(Xe)return e;if(Fe){if(Be)for(l=me.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(we.shadowroot||we.shadowrootmode)&&(l=fe.call(a,l,!0)),l}let m=ze?n.outerHTML:n.innerHTML;return ze&&Ne["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&S(K,n.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+m),Ie&&u([he,ge,Te],(e=>{m=y(m,e," ")})),le&&We?le.createHTML(m):m},o.setConfig=function(){gt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Pe=!0},o.clearConfig=function(){ft=null,Pe=!1},o.isValidAttribute=function(e,t,n){ft||gt({});const o=pt(e),r=pt(t);return Ot(o,r,n)},o.addHook=function(e,t){"function"==typeof t&&f(de[e],t)},o.removeHook=function(e,t){if(void 0!==t){const n=m(de[e],t);return-1===n?void 0:d(de[e],n,1)[0]}return p(de[e])},o.removeHooks=function(e){de[e]=[]},o.removeAllHooks=function(){de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},o}();return re}));+/*! @license DOMPurify 3.2.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.5/LICENSE */+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DOMPurify=t()}(this,(function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:r}=Object;let{freeze:i,seal:a,create:l}=Object,{apply:c,construct:s}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),a||(a=function(e){return e}),c||(c=function(e,t,n){return e.apply(t,n)}),s||(s=function(e,t){return new e(...t)});const u=R(Array.prototype.forEach),m=R(Array.prototype.lastIndexOf),p=R(Array.prototype.pop),f=R(Array.prototype.push),d=R(Array.prototype.splice),h=R(String.prototype.toLowerCase),g=R(String.prototype.toString),T=R(String.prototype.match),y=R(String.prototype.replace),E=R(String.prototype.indexOf),A=R(String.prototype.trim),_=R(Object.prototype.hasOwnProperty),S=R(RegExp.prototype.test),b=(N=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(N,t)});var N;function R(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return c(e,t,o)}}function w(e,o){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;t&&t(e,null);let i=o.length;for(;i--;){let t=o[i];if("string"==typeof t){const e=r(t);e!==t&&(n(o)||(o[i]=e),t=e)}e[t]=!0}return e}function O(e){for(let t=0;t<e.length;t++){_(e,t)||(e[t]=null)}return e}function D(t){const n=l(null);for(const[o,r]of e(t)){_(t,o)&&(Array.isArray(r)?n[o]=O(r):r&&"object"==typeof r&&r.constructor===Object?n[o]=D(r):n[o]=r)}return n}function v(e,t){for(;null!==e;){const n=r(e,t);if(n){if(n.get)return R(n.get);if("function"==typeof n.value)return R(n.value)}e=o(e)}return function(){return null}}const L=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),C=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),x=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=i(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),M=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),k=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),U=i(["#text"]),z=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),P=i(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),H=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),F=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),W=a(/<%[\w\W]*|[\w\W]*%>/gm),G=a(/\$\{[\w\W]*/gm),Y=a(/^data-[\-\w.\u00B7-\uFFFF]+$/),j=a(/^aria-[\-\w]+$/),X=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),q=a(/^(?:\w+script|data):/i),$=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=a(/^html$/i),V=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var Z=Object.freeze({__proto__:null,ARIA_ATTR:j,ATTR_WHITESPACE:$,CUSTOM_ELEMENT:V,DATA_ATTR:Y,DOCTYPE_NAME:K,ERB_EXPR:W,IS_ALLOWED_URI:X,IS_SCRIPT_OR_DATA:q,MUSTACHE_EXPR:B,TMPLIT_EXPR:G});const J=1,Q=3,ee=7,te=8,ne=9,oe=function(){return"undefined"==typeof window?null:window};var re=function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oe();const o=e=>t(e);if(o.version="3.2.5",o.removed=[],!n||!n.document||n.document.nodeType!==ne||!n.Element)return o.isSupported=!1,o;let{document:r}=n;const a=r,c=a.currentScript,{DocumentFragment:s,HTMLTemplateElement:N,Node:R,Element:O,NodeFilter:B,NamedNodeMap:W=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:G,DOMParser:Y,trustedTypes:j}=n,q=O.prototype,$=v(q,"cloneNode"),V=v(q,"remove"),re=v(q,"nextSibling"),ie=v(q,"childNodes"),ae=v(q,"parentNode");if("function"==typeof N){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let le,ce="";const{implementation:se,createNodeIterator:ue,createDocumentFragment:me,getElementsByTagName:pe}=r,{importNode:fe}=a;let de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};o.isSupported="function"==typeof e&&"function"==typeof ae&&se&&void 0!==se.createHTMLDocument;const{MUSTACHE_EXPR:he,ERB_EXPR:ge,TMPLIT_EXPR:Te,DATA_ATTR:ye,ARIA_ATTR:Ee,IS_SCRIPT_OR_DATA:Ae,ATTR_WHITESPACE:_e,CUSTOM_ELEMENT:Se}=Z;let{IS_ALLOWED_URI:be}=Z,Ne=null;const Re=w({},[...L,...C,...x,...M,...U]);let we=null;const Oe=w({},[...z,...P,...H,...F]);let De=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ve=null,Le=null,Ce=!0,xe=!0,Ie=!1,Me=!0,ke=!1,Ue=!0,ze=!1,Pe=!1,He=!1,Fe=!1,Be=!1,We=!1,Ge=!0,Ye=!1,je=!0,Xe=!1,qe={},$e=null;const Ke=w({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ve=null;const Ze=w({},["audio","video","img","source","image","track"]);let Je=null;const Qe=w({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let ot=nt,rt=!1,it=null;const at=w({},[et,tt,nt],g);let lt=w({},["mi","mo","mn","ms","mtext"]),ct=w({},["annotation-xml"]);const st=w({},["title","style","font","a","script"]);let ut=null;const mt=["application/xhtml+xml","text/html"];let pt=null,ft=null;const dt=r.createElement("form"),ht=function(e){return e instanceof RegExp||e instanceof Function},gt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ft||ft!==e){if(e&&"object"==typeof e||(e={}),e=D(e),ut=-1===mt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,pt="application/xhtml+xml"===ut?g:h,Ne=_(e,"ALLOWED_TAGS")?w({},e.ALLOWED_TAGS,pt):Re,we=_(e,"ALLOWED_ATTR")?w({},e.ALLOWED_ATTR,pt):Oe,it=_(e,"ALLOWED_NAMESPACES")?w({},e.ALLOWED_NAMESPACES,g):at,Je=_(e,"ADD_URI_SAFE_ATTR")?w(D(Qe),e.ADD_URI_SAFE_ATTR,pt):Qe,Ve=_(e,"ADD_DATA_URI_TAGS")?w(D(Ze),e.ADD_DATA_URI_TAGS,pt):Ze,$e=_(e,"FORBID_CONTENTS")?w({},e.FORBID_CONTENTS,pt):Ke,ve=_(e,"FORBID_TAGS")?w({},e.FORBID_TAGS,pt):{},Le=_(e,"FORBID_ATTR")?w({},e.FORBID_ATTR,pt):{},qe=!!_(e,"USE_PROFILES")&&e.USE_PROFILES,Ce=!1!==e.ALLOW_ARIA_ATTR,xe=!1!==e.ALLOW_DATA_ATTR,Ie=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,ke=e.SAFE_FOR_TEMPLATES||!1,Ue=!1!==e.SAFE_FOR_XML,ze=e.WHOLE_DOCUMENT||!1,Fe=e.RETURN_DOM||!1,Be=e.RETURN_DOM_FRAGMENT||!1,We=e.RETURN_TRUSTED_TYPE||!1,He=e.FORCE_BODY||!1,Ge=!1!==e.SANITIZE_DOM,Ye=e.SANITIZE_NAMED_PROPS||!1,je=!1!==e.KEEP_CONTENT,Xe=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||X,ot=e.NAMESPACE||nt,lt=e.MATHML_TEXT_INTEGRATION_POINTS||lt,ct=e.HTML_INTEGRATION_POINTS||ct,De=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(De.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(De.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(De.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ke&&(xe=!1),Be&&(Fe=!0),qe&&(Ne=w({},U),we=[],!0===qe.html&&(w(Ne,L),w(we,z)),!0===qe.svg&&(w(Ne,C),w(we,P),w(we,F)),!0===qe.svgFilters&&(w(Ne,x),w(we,P),w(we,F)),!0===qe.mathMl&&(w(Ne,M),w(we,H),w(we,F))),e.ADD_TAGS&&(Ne===Re&&(Ne=D(Ne)),w(Ne,e.ADD_TAGS,pt)),e.ADD_ATTR&&(we===Oe&&(we=D(we)),w(we,e.ADD_ATTR,pt)),e.ADD_URI_SAFE_ATTR&&w(Je,e.ADD_URI_SAFE_ATTR,pt),e.FORBID_CONTENTS&&($e===Ke&&($e=D($e)),w($e,e.FORBID_CONTENTS,pt)),je&&(Ne["#text"]=!0),ze&&w(Ne,["html","head","body"]),Ne.table&&(w(Ne,["tbody"]),delete ve.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');le=e.TRUSTED_TYPES_POLICY,ce=le.createHTML("")}else void 0===le&&(le=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(j,c)),null!==le&&"string"==typeof ce&&(ce=le.createHTML(""));i&&i(e),ft=e}},Tt=w({},[...C,...x,...I]),yt=w({},[...M,...k]),Et=function(e){f(o.removed,{element:e});try{ae(e).removeChild(e)}catch(t){V(e)}},At=function(e,t){try{f(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Fe||Be)try{Et(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},_t=function(e){let t=null,n=null;if(He)e="<remove></remove>"+e;else{const t=T(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ut&&ot===nt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=le?le.createHTML(e):e;if(ot===nt)try{t=(new Y).parseFromString(o,ut)}catch(e){}if(!t||!t.documentElement){t=se.createDocument(ot,"template",null);try{t.documentElement.innerHTML=rt?ce:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),ot===nt?pe.call(t,ze?"html":"body")[0]:ze?t.documentElement:i},St=function(e){return ue.call(e.ownerDocument||e,e,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT|B.SHOW_PROCESSING_INSTRUCTION|B.SHOW_CDATA_SECTION,null)},bt=function(e){return e instanceof G&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof W)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Nt=function(e){return"function"==typeof R&&e instanceof R};function Rt(e,t,n){u(e,(e=>{e.call(o,t,n,ft)}))}const wt=function(e){let t=null;if(Rt(de.beforeSanitizeElements,e,null),bt(e))return Et(e),!0;const n=pt(e.nodeName);if(Rt(de.uponSanitizeElement,e,{tagName:n,allowedTags:Ne}),e.hasChildNodes()&&!Nt(e.firstElementChild)&&S(/<[/\w!]/g,e.innerHTML)&&S(/<[/\w!]/g,e.textContent))return Et(e),!0;if(e.nodeType===ee)return Et(e),!0;if(Ue&&e.nodeType===te&&S(/<[/\w]/g,e.data))return Et(e),!0;if(!Ne[n]||ve[n]){if(!ve[n]&&Dt(n)){if(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n))return!1;if(De.tagNameCheck instanceof Function&&De.tagNameCheck(n))return!1}if(je&&!$e[n]){const t=ae(e)||e.parentNode,n=ie(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o){const r=$(n[o],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,re(e))}}}return Et(e),!0}return e instanceof O&&!function(e){let t=ae(e);t&&t.tagName||(t={namespaceURI:ot,tagName:"template"});const n=h(e.tagName),o=h(t.tagName);return!!it[e.namespaceURI]&&(e.namespaceURI===tt?t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===o||lt[o]):Boolean(Tt[n]):e.namespaceURI===et?t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&ct[o]:Boolean(yt[n]):e.namespaceURI===nt?!(t.namespaceURI===tt&&!ct[o])&&!(t.namespaceURI===et&&!lt[o])&&!yt[n]&&(st[n]||!Tt[n]):!("application/xhtml+xml"!==ut||!it[e.namespaceURI]))}(e)?(Et(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!S(/<\/no(script|embed|frames)/i,e.innerHTML)?(ke&&e.nodeType===Q&&(t=e.textContent,u([he,ge,Te],(e=>{t=y(t,e," ")})),e.textContent!==t&&(f(o.removed,{element:e.cloneNode()}),e.textContent=t)),Rt(de.afterSanitizeElements,e,null),!1):(Et(e),!0)},Ot=function(e,t,n){if(Ge&&("id"===t||"name"===t)&&(n in r||n in dt))return!1;if(xe&&!Le[t]&&S(ye,t));else if(Ce&&S(Ee,t));else if(!we[t]||Le[t]){if(!(Dt(e)&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,e)||De.tagNameCheck instanceof Function&&De.tagNameCheck(e))&&(De.attributeNameCheck instanceof RegExp&&S(De.attributeNameCheck,t)||De.attributeNameCheck instanceof Function&&De.attributeNameCheck(t))||"is"===t&&De.allowCustomizedBuiltInElements&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n)||De.tagNameCheck instanceof Function&&De.tagNameCheck(n))))return!1}else if(Je[t]);else if(S(be,y(n,_e,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==E(n,"data:")||!Ve[e]){if(Ie&&!S(Ae,y(n,_e,"")));else if(n)return!1}else;return!0},Dt=function(e){return"annotation-xml"!==e&&T(e,Se)},vt=function(e){Rt(de.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||bt(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:we,forceKeepAttr:void 0};let r=t.length;for(;r--;){const i=t[r],{name:a,namespaceURI:l,value:c}=i,s=pt(a);let m="value"===a?c:A(c);if(n.attrName=s,n.attrValue=m,n.keepAttr=!0,n.forceKeepAttr=void 0,Rt(de.uponSanitizeAttribute,e,n),m=n.attrValue,!Ye||"id"!==s&&"name"!==s||(At(a,e),m="user-content-"+m),Ue&&S(/((--!?|])>)|<\/(style|title)/i,m)){At(a,e);continue}if(n.forceKeepAttr)continue;if(At(a,e),!n.keepAttr)continue;if(!Me&&S(/\/>/i,m)){At(a,e);continue}ke&&u([he,ge,Te],(e=>{m=y(m,e," ")}));const f=pt(e.nodeName);if(Ot(f,s,m)){if(le&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(l);else switch(j.getAttributeType(f,s)){case"TrustedHTML":m=le.createHTML(m);break;case"TrustedScriptURL":m=le.createScriptURL(m)}try{l?e.setAttributeNS(l,a,m):e.setAttribute(a,m),bt(e)?Et(e):p(o.removed)}catch(e){}}}Rt(de.afterSanitizeAttributes,e,null)},Lt=function e(t){let n=null;const o=St(t);for(Rt(de.beforeSanitizeShadowDOM,t,null);n=o.nextNode();)Rt(de.uponSanitizeShadowNode,n,null),wt(n),vt(n),n.content instanceof s&&e(n.content);Rt(de.afterSanitizeShadowDOM,t,null)};return o.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=null,i=null,l=null;if(rt=!e,rt&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Nt(e)){if("function"!=typeof e.toString)throw b("toString is not a function");if("string"!=typeof(e=e.toString()))throw b("dirty is not a string, aborting")}if(!o.isSupported)return e;if(Pe||gt(t),o.removed=[],"string"==typeof e&&(Xe=!1),Xe){if(e.nodeName){const t=pt(e.nodeName);if(!Ne[t]||ve[t])throw b("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof R)n=_t("\x3c!----\x3e"),r=n.ownerDocument.importNode(e,!0),r.nodeType===J&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(!Fe&&!ke&&!ze&&-1===e.indexOf("<"))return le&&We?le.createHTML(e):e;if(n=_t(e),!n)return Fe?null:We?ce:""}n&&He&&Et(n.firstChild);const c=St(Xe?e:n);for(;i=c.nextNode();)wt(i),vt(i),i.content instanceof s&&Lt(i.content);if(Xe)return e;if(Fe){if(Be)for(l=me.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(we.shadowroot||we.shadowrootmode)&&(l=fe.call(a,l,!0)),l}let m=ze?n.outerHTML:n.innerHTML;return ze&&Ne["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&S(K,n.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+m),ke&&u([he,ge,Te],(e=>{m=y(m,e," ")})),le&&We?le.createHTML(m):m},o.setConfig=function(){gt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Pe=!0},o.clearConfig=function(){ft=null,Pe=!1},o.isValidAttribute=function(e,t,n){ft||gt({});const o=pt(e),r=pt(t);return Ot(o,r,n)},o.addHook=function(e,t){"function"==typeof t&&f(de[e],t)},o.removeHook=function(e,t){if(void 0!==t){const n=m(de[e],t);return-1===n?void 0:d(de[e],n,1)[0]}return p(de[e])},o.removeHooks=function(e){de[e]=[]},o.removeAllHooks=function(){de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},o}();return re}));/*CryptoJS v3.1.2code.google.com/p/crypto-js@@ -62,7 +62,7 @@ if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==url"se.diagrams.net"==window.location.hostname&&(urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.plugins="0",urlParams.mode="google",urlParams.lockdown="1",window.DRAWIO_GOOGLE_APP_ID=window.DRAWIO_GOOGLE_APP_ID||"184079235871",window.DRAWIO_GOOGLE_CLIENT_ID=window.DRAWIO_GOOGLE_CLIENT_ID||"184079235871-pjf5nn0lff27lk8qf0770gmffiv9gt61.apps.googleusercontent.com");"trello"==urlParams.mode&&(urlParams.tr="1");"embed.diagrams.net"==window.location.hostname&&(urlParams.embed="1");(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.open&&(window.location.hash=urlParams.open);"function"!==typeof window.structuredClone&&(window.structuredClone=function(a){return a});window.urlParams=window.urlParams||{};window.DOM_PURIFY_CONFIG=window.DOM_PURIFY_CONFIG||{ADD_TAGS:["use","foreignObject"],FORBID_TAGS:["form"],ALLOWED_URI_REGEXP:/^((?!javascript:).)*$/i,HTML_INTEGRATION_POINTS:{foreignobject:!0},ADD_ATTR:["target","content","pointer-events","requiredFeatures"]};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"mxgraph";-window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"26.2.2",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),+window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"26.2.7",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:0<=navigator.appVersion.indexOf("Android"),IS_IOS:/iP(hone|od|ad)/.test(navigator.platform)||navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&2<navigator.maxTouchPoints,IS_WEBVIEW:/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:-1<navigator.userAgent.toLowerCase().indexOf("firefox"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||@@ -117,73 +117,73 @@ mxUtils.write(c,a);mxEvent.addListener(c,"click",function(e){b(e)});null!=d&&(c.b,c,d,e,f){return mxUtils.link(a,b,function(){c[d](e)},f)},link:function(a,b,c,d){var e=document.createElement("span");e.style.color="blue";e.style.textDecoration="underline";e.style.cursor="pointer";null!=d&&(e.style.paddingLeft=d+"px");mxEvent.addListener(e,"click",c);mxUtils.write(e,b);null!=a&&a.appendChild(e);return e},getDocumentSize:function(){var a=document.body,b=document.documentElement;try{return new mxRectangle(0,0,a.clientWidth||b.clientWidth,Math.max(a.clientHeight||0,b.clientHeight))}catch(c){return new mxRectangle}},fit:function(a,b){b=b||0;var c=mxUtils.getDocumentSize(),d=parseInt(a.offsetLeft),e=parseInt(a.offsetWidth),f=mxUtils.getDocumentScrollOrigin(a.ownerDocument),g=f.x;f=f.y;var k=g+c.width-b;d+e>k&&(a.style.left=Math.max(g+b,k-e)+"px");d=parseInt(a.offsetTop);e=parseInt(a.offsetHeight);c=f+c.height-b;d+e>c&&(a.style.top=Math.max(f+b,c-e)+"px")},load:function(a){a=new mxXmlRequest(a,null,"GET",!1);a.send();return a},get:function(a,b,c,d,e,f,g){a=new mxXmlRequest(a,null,"GET");var k=a.setRequestHeaders;g&&(a.setRequestHeaders=function(l,m){k.apply(this,arguments);for(var n in g)l.setRequestHeader(n,g[n])});null!=d&&a.setBinary(d);a.send(b,c,e,f);return a},getAll:function(a,b,c){for(var d=a.length,e=[],f=0,g=function(){0==f&&null!=c&&c();f++},k=0;k<a.length;k++)(function(l,m){mxUtils.get(l,function(n){var p=n.getStatus();200>p||299<p?g():(e[m]=n,d--,0==d&&b(e))},g)})(a[k],k);0==d&&b(e)},post:function(a,b,c,d){return(new mxXmlRequest(a,b)).send(c,d)},submit:function(a,b,c,d){return(new mxXmlRequest(a,-b)).simulate(c,d)},loadInto:function(a,b,c){mxClient.IS_IE?b.onreadystatechange=function(){4==b.readyState&&c()}:b.addEventListener("load",c,!1);b.load(a)},getValue:function(a,b,c){a=null!=a?a[b]:null;null==a&&(a=c);return a},getNumber:function(a,b,c){a=null!=a?a[b]:null;null==a&&(a=c||0);return Number(a)},isLightDarkColor:function(a){return"string"===typeof a&&"light-dark"==mxUtils.ltrim(a).substring(0,10)},isVarColor:function(a){return mxUtils.varColorRegex.test(a)},isHexColor:function(a){return mxUtils.hexColorRegex.test(a)},-isRgbColor:function(a){return mxUtils.rgbaColorRegex.test(a)},isValidColor:function(a){if(null==a)return!1;a=String(a).replace(/\s/g,"");if(a.toLowerCase()==mxUtils.normalizedValidInvalidColor)return!0;mxUtils.canvasContext.fillStyle=mxUtils.validInvalidColor;mxUtils.canvasContext.fillStyle=a;return mxUtils.canvasContext.fillStyle!=mxUtils.validInvalidColor},isDarkColor:function(a){a=mxUtils.parseColor(a);return null!=a?128>.213*a.r+.715*a.g+.072*a.b:!1},parseLightDarkColor:function(a,b,c){var d=-a,e=null;null!=a&&(a=a.match(mxUtils.lightDarkColorRegex))&&3===a.length&&(d=mxUtils.trim(a[1]),e=mxUtils.trim(a[2]));null==e&&(c||mxUtils.isVarColor(d))&&(e=d);e=null!=e?e:null!=b?b:mxUtils.getInverseColor(d);return{light:d,dark:e}},getInverseColor:function(a,b,c){function d(m){return Math.round(b/100*(255-m)+m*(1-b/100))}function e(m){return Math.round(Math.max(0,Math.min(255,m)))}c=null!=c?c:180;b=null!=b?b:93;var f=0,g=0,k=0;if("transparent"==a.toLowerCase())return a;k=mxUtils.parseColor(a);if(null==-k)return a;f=k.r;g=k.g;k=k.b;f=d(f);g=d(g);k=d(k);a=[1,0,0,0,1,0,0,0,1];var l=Math.cos(c*Math.PI/180);c=Math.sin(c*Math.PI/180);a[0]=.2126+.7874*l-.2126*c;a[1]=.7152-.7152*l-.7152*c;a[2]=.0722-.0722*l+.9278*c;a[3]=.2126-.2126*l+.143*c;a[4]=.7152+(1-.7152)*l+.14*c;a[5]=.0722-.0722*l-.283*c;a[6]=.2126-.2126*l-.7874*c;a[7]=.7152-.7152*l+.7152*c;a[8]=.0722+.9278*l+.0722*c;c=e(a[0]*f+a[1]*g+a[2]*k);l=e(a[3]*f+a[4]*g+a[5]*k);f=e(a[6]*f+a[7]*g+a[8]*k);return"#"+(16777216|c<<16|l<<8|f).toString(16).slice(1)},-addAlphaToColor:function(a,b){null!=b&&null!=a&&"transparent"!=a&&(a=mxUtils.parseColor(a),a="rgba("+a.r+","+a.g+","+a.b+","+b+")");return a},getLightDarkColor:function(a,b,c,d){var e={light:"transparent",dark:"transparent",cssText:"transparent"};null!=a&&a!=mxConstants.NONE&&("string"===typeof a?(a=mxUtils.parseLightDarkColor(a,c,d),e.light=mxUtils.addAlphaToColor(a.light,b),e.dark=mxUtils.addAlphaToColor(a.dark,b),e.cssText=mxUtils.lightDarkColorSupported?e.light==e.dark?e.light:"light-dark("+e.light+-", "+e.dark+")":mxUtils.preferDarkColor?e.dark:e.light):(e.light=a,e.dark=a,e.cssText=a));return e},invertLightDarkColor:function(a){var b={};b.light=a.dark;b.dark=a.light;b.cssText=b.light==b.dark?b.light:"light-dark("+b.light+", "+b.dark+")";return b},getColor:function(a,b,c){a=null!=a?a[b]:null;null==a?a=c:a==mxConstants.NONE&&(a=null);return a},isEmptyObject:function(a){for(var b in a)return!1;return!0},clone:function(a,b,c){c=null!=c?c:!1;var d=null;if(null!=a&&"function"==typeof a.constructor)if(a.constructor===-Element)d=a.cloneNode(null!=c?!c:!1);else{d=new a.constructor;for(var e in a)e!=mxObjectIdentity.FIELD_NAME&&(null==b||0>mxUtils.indexOf(b,e))&&(d[e]=c||"object"!=typeof a[e]?a[e]:mxUtils.clone(a[e]))}return d},equalPoints:function(a,b){if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b)for(var c=0;c<a.length;c++)if(null!=a[c]&&null==b[c]||null==a[c]&&null!=b[c]||null!=a[c]&&null!=b[c]&&(a[c].x!=b[c].x||a[c].y!=b[c].y))return!1;return!0},equalEntries:function(a,-b){var c=0;if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b){for(var d in b)c++;for(d in a)if(c--,!(mxUtils.isNaN(a[d])&&mxUtils.isNaN(b[d])||a[d]==b[d]))return!1}return 0==c},removeDuplicates:function(a){for(var b=new mxDictionary,c=[],d=0;d<a.length;d++)b.get(a[d])||(c.push(a[d]),b.put(a[d],!0));return c},isNaN:function(a){return"number"==typeof a&&isNaN(a)},extend:function(a,b){var c=function(){};c.prototype=b.prototype;a.prototype=new c;-a.prototype.constructor=a},toString:function(a){var b="",c;for(c in a)try{if(null==a[c])b+=c+" = [null]\n";else if("function"==typeof a[c])b+=c+" => [Function]\n";else if("object"==typeof a[c]){var d=mxUtils.getFunctionName(a[c].constructor);b+=c+" => ["+d+"]\n"}else b+=c+" = "+a[c]+"\n"}catch(e){b+=c+"="+e.message}return b},toRadians:function(a){return Math.PI*a/180},toDegree:function(a){return 180*a/Math.PI},arcToCurves:function(a,b,c,d,e,f,g,k,l){k-=a;l-=b;if(0===c||0===d)return A;c=Math.abs(c);-d=Math.abs(d);var m=-k/2,n=-l/2,p=Math.cos(e*Math.PI/180);A=Math.sin(e*Math.PI/180);e=p*m+A*n;m=-1*A*m+p*n;n=e*e;var q=m*m,r=c*c,t=d*d,u=n/r+q/t;1<u?(c*=Math.sqrt(u),d*=Math.sqrt(u),f=0):(u=1,f===g&&(u=-1),f=u*Math.sqrt((r*t-r*q-t*n)/(r*q+t*n)));n=f*c*m/d;q=-1*f*d*e/c;k=p*n-A*q+k/2;l=A*n+p*q+l/2;r=Math.atan2((m-q)/d,(e-n)/c)-Math.atan2(0,1);f=0<=r?r:2*Math.PI+r;r=Math.atan2((-m-q)/d,(-e-n)/c)-Math.atan2((m-q)/d,(e-n)/c);e=0<=r?r:2*Math.PI+r;0==g&&0<e?e-=2*Math.PI:0!=g&&0>e&&(e+=2*Math.PI);g=2*e/Math.PI;-g=Math.ceil(0>g?-1*g:g);e/=g;m=8/3*Math.sin(e/4)*Math.sin(e/4)/Math.sin(e/2);n=p*c;p*=d;c*=A;d*=A;var x=Math.cos(f),y=Math.sin(f);q=-m*(n*y+d*x);r=-m*(c*y-p*x);for(var A=[],z=0;z<g;++z){f+=e;x=Math.cos(f);y=Math.sin(f);t=n*x-d*y+k;u=c*x+p*y+l;var C=-m*(n*y+d*x);x=-m*(c*y-p*x);y=6*z;A[y]=Number(q+a);A[y+1]=Number(r+b);A[y+2]=Number(t-C+a);A[y+3]=Number(u-x+b);A[y+4]=Number(t+a);A[y+5]=Number(u+b);q=t+C;r=u+x}return A},getBoundingBox:function(a,b,c){var d=null;if(null!=a&&null!=b&&0!=b){b=mxUtils.toRadians(b);-d=Math.cos(b);var e=Math.sin(b);c=null!=c?c:new mxPoint(a.x+a.width/2,a.y+a.height/2);var f=new mxPoint(a.x,a.y);b=new mxPoint(a.x+a.width,a.y);var g=new mxPoint(b.x,a.y+a.height);a=new mxPoint(a.x,g.y);f=mxUtils.getRotatedPoint(f,d,e,c);b=mxUtils.getRotatedPoint(b,d,e,c);g=mxUtils.getRotatedPoint(g,d,e,c);a=mxUtils.getRotatedPoint(a,d,e,c);d=new mxRectangle(f.x,f.y,0,0);d.add(new mxRectangle(b.x,b.y,0,0));d.add(new mxRectangle(g.x,g.y,0,0));d.add(new mxRectangle(a.x,a.y,0,0))}return d},getRotatedPoint:function(a,-b,c,d){d=null!=d?d:new mxPoint;var e=a.x-d.x;a=a.y-d.y;return new mxPoint(e*b-a*c+d.x,a*b+e*c+d.y)},getPortConstraints:function(a,b,c,d){b=mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT,mxUtils.getValue(b.style,c?mxConstants.STYLE_SOURCE_PORT_CONSTRAINT:mxConstants.STYLE_TARGET_PORT_CONSTRAINT,null));if(null==b)return d;d=b.toString();b=mxConstants.DIRECTION_MASK_NONE;c=0;1==mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT_ROTATION,0)&&(c=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,-0));a=0;45<c?(a=1,135<=c&&(a=2)):-45>c&&(a=3,-135>=c&&(a=2));if(0<=d.indexOf(mxConstants.DIRECTION_NORTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:b|=mxConstants.DIRECTION_MASK_EAST;break;case 2:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:b|=mxConstants.DIRECTION_MASK_WEST}if(0<=d.indexOf(mxConstants.DIRECTION_WEST))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_WEST;break;case 1:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:b|=mxConstants.DIRECTION_MASK_EAST;break;-case 3:b|=mxConstants.DIRECTION_MASK_SOUTH}if(0<=d.indexOf(mxConstants.DIRECTION_SOUTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:b|=mxConstants.DIRECTION_MASK_WEST;break;case 2:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:b|=mxConstants.DIRECTION_MASK_EAST}if(0<=d.indexOf(mxConstants.DIRECTION_EAST))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_EAST;break;case 1:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:b|=mxConstants.DIRECTION_MASK_WEST;break;case 3:b|=mxConstants.DIRECTION_MASK_NORTH}return b},-reversePortConstraints:function(a){var b=(a&mxConstants.DIRECTION_MASK_WEST)<<3;b|=(a&mxConstants.DIRECTION_MASK_NORTH)<<1;b|=(a&mxConstants.DIRECTION_MASK_SOUTH)>>1;return b|(a&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(a,b,c){var d=-1;if(0<a.absolutePoints.length)for(var e=a.absolutePoints[0],f=null,g=1;g<a.absolutePoints.length;g++){var k=a.absolutePoints[g];e=mxUtils.ptSegDistSq(e.x,e.y,k.x,k.y,b,c);if(null==f||e<f)f=e,d=g-1;e=k}return d},getDirectedBounds:function(a,b,c,-d,e){var f=mxUtils.getValue(c,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);d=null!=d?d:mxUtils.getValue(c,mxConstants.STYLE_FLIPH,!1);e=null!=e?e:mxUtils.getValue(c,mxConstants.STYLE_FLIPV,!1);b.x=Math.round(Math.max(0,Math.min(a.width,b.x)));b.y=Math.round(Math.max(0,Math.min(a.height,b.y)));b.width=Math.round(Math.max(0,Math.min(a.width,b.width)));b.height=Math.round(Math.max(0,Math.min(a.height,b.height)));if(e&&(f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH)||d&&(f==-mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST))c=b.x,b.x=b.width,b.width=c;if(d&&(f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH)||e&&(f==mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST))c=b.y,b.y=b.height,b.height=c;d=mxRectangle.fromRectangle(b);f==mxConstants.DIRECTION_SOUTH?(d.y=b.x,d.x=b.height,d.width=b.y,d.height=b.width):f==mxConstants.DIRECTION_WEST?(d.y=b.height,d.x=b.width,d.width=b.x,d.height=b.y):f==mxConstants.DIRECTION_NORTH&&(d.y=b.width,d.x=b.y,-d.width=b.height,d.height=b.x);return new mxRectangle(a.x+d.x,a.y+d.y,a.width-d.width-d.x,a.height-d.height-d.y)},getPerimeterPoint:function(a,b,c){for(var d=null,e=0;e<a.length-1;e++){var f=mxUtils.intersection(a[e].x,a[e].y,a[e+1].x,a[e+1].y,b.x,b.y,c.x,c.y);if(null!=f){var g=c.x-f.x,k=c.y-f.y;f={p:f,distSq:k*k+g*g};null!=f&&(null==d||d.distSq>f.distSq)&&(d=f)}}return null!=d?d.p:null},intersectsPoints:function(a,b){for(var c=0;c<b.length-1;c++)if(mxUtils.rectangleIntersectsSegment(a,b[c],b[c+1]))return!0;-return!1},rectangleIntersectsSegment:function(a,b,c){var d=a.y,e=a.x,f=d+a.height,g=e+a.width;a=b.x;var k=c.x;b.x>c.x&&(a=c.x,k=b.x);k>g&&(k=g);a<e&&(a=e);if(a>k)return!1;e=b.y;g=c.y;var l=c.x-b.x;1E-7<Math.abs(l)&&(c=(c.y-b.y)/l,b=b.y-c*b.x,e=c*a+b,g=c*k+b);e>g&&(b=g,g=e,e=b);g>f&&(g=f);e<d&&(e=d);return e>g?!1:!0},contains:function(a,b,c){return a.x<=b&&a.x+a.width>=b&&a.y<=c&&a.y+a.height>=c},intersects:function(a,b,c){var d=a.width,e=a.height,f=b.width,g=b.height;if(!c&&(0>=f||0>=g||0>=d||0>=-e))return!1;c=a.x;a=a.y;var k=b.x;b=b.y;f+=k;g+=b;d+=c;e+=a;return(f<k||f>c)&&(g<b||g>a)&&(d<c||d>k)&&(e<a||e>b)},intersectsHotspot:function(a,b,c,d,e,f){d=null!=d?d:1;e=null!=e?e:0;f=null!=f?f:0;if(0<d){var g=a.getCenterX(),k=a.getCenterY(),l=a.width,m=a.height,n=mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE)*a.view.scale;0<n&&(mxUtils.getValue(a.style,mxConstants.STYLE_HORIZONTAL,!0)?(k=a.y+n/2,m=n):(g=a.x+n/2,l=n));l=Math.max(e,l*d);m=Math.max(e,m*d);0<f&&(l=Math.min(l,f),m=Math.min(m,f));-d=new mxRectangle(g-l/2,k-m/2,l,m);g=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)||0);0!=g&&(e=Math.cos(-g),f=Math.sin(-g),g=new mxPoint(a.getCenterX(),a.getCenterY()),a=mxUtils.getRotatedPoint(new mxPoint(b,c),e,f,g),b=a.x,c=a.y);return mxUtils.contains(d,b,c)}return!0},getOffset:function(a,b){for(var c=0,d=0,e=!1,f=a,g=document.body,k=document.documentElement;null!=f&&f!=g&&f!=k&&!e;){var l=mxUtils.getCurrentStyle(f);null!=l&&(e=e||"fixed"==l.position);f=f.parentNode}b||-e||(b=mxUtils.getDocumentScrollOrigin(a.ownerDocument),c+=b.x,d+=b.y);a=a.getBoundingClientRect();null!=a&&(c+=a.left,d+=a.top);return new mxPoint(c,d)},getDocumentScrollOrigin:function(a){a=a.defaultView||a.parentWindow;return new mxPoint(null!=a&&void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,null!=a&&void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)},-getScrollOrigin:function(a,b,c){b=null!=b?b:!1;c=null!=c?c:!0;for(var d=null!=a?a.ownerDocument:document,e=d.body,f=d.documentElement,g=new mxPoint,k=!1;null!=a&&a!=e&&a!=f;){isNaN(a.scrollLeft)||isNaN(a.scrollTop)||(g.x+=a.scrollLeft,g.y+=a.scrollTop);var l=mxUtils.getCurrentStyle(a);null!=l&&(k=k||"fixed"==l.position);a=b?a.parentNode:null}!k&&c&&(a=mxUtils.getDocumentScrollOrigin(d),g.x+=a.x,g.y+=a.y);return g},convertPoint:function(a,b,c){var d=mxUtils.getScrollOrigin(a,!1);a=mxUtils.getOffset(a);-a.x-=d.x;a.y-=d.y;return new mxPoint(b-a.x,c-a.y)},removeJavascriptProtocol:function(a){for(a=null!=a?mxUtils.zapGremlins(a):null;null!=a&&"javascript:"===mxUtils.ltrim(a.toLowerCase()).substring(0,11);)a=a.substring(a.toLowerCase().indexOf(":")+1);return a},zapGremlins:function(a){for(var b=0,c=[],d=0;d<a.length;d++){var e=a.charCodeAt(d);(32<=e||9==e||10==e||13==e)&&65535!=e&&65534!=e||(c.push(a.substring(b,d)),b=d+1)}0<b&&b<a.length&&c.push(a.substring(b));return 0==c.length?a:c.join("")},ltrim:function(a,-b){return null!=a?a.replace(new RegExp("^["+(b||"\\s|\\0")+"]+","g"),""):null},rtrim:function(a,b){return null!=a?a.replace(new RegExp("["+(b||"\\s|\\0")+"]+$","g"),""):null},trim:function(a,b){return mxUtils.ltrim(mxUtils.rtrim(a,b),b)},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)&&("string"!=typeof a||0>a.toLowerCase().indexOf("0x"))},isInteger:function(a){return String(parseInt(a))===String(a)},mod:function(a,b){return(a%b+b)%b},intersection:function(a,b,c,d,e,f,g,k){var l=(k--f)*(c-a)-(g-e)*(d-b);g=((g-e)*(b-f)-(k-f)*(a-e))/l;e=((c-a)*(b-f)-(d-b)*(a-e))/l;return 0<=g&&1>=g&&0<=e&&1>=e?new mxPoint(a+g*(c-a),b+g*(d-b)):null},ptSegDistSq:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;0>=e*c+f*d?c=0:(e=c-e,f=d-f,a=e*c+f*d,c=0>=a?0:a*a/(c*c+d*d));e=e*e+f*f-c;0>e&&(e=0);return e},ptLineDist:function(a,b,c,d,e,f){return Math.abs((d-b)*e-(c-a)*f+c*b-d*a)/Math.sqrt((d-b)*(d-b)+(c-a)*(c-a))},relativeCcw:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;a=e*d-f*c;0==a&&(a=e*c+f*d,0<a&&(a=(e--c)*c+(f-d)*d,0>a&&(a=0)));return 0>a?-1:0<a?1:0},animateChanges:function(a,b){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(a,b,c){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(a,b,c,d,e,f){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(a,b){mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?a.style.filter=100<=b?"":"alpha(opacity="+b+")":a.style.opacity=b/100},createElementNs:function(a,b,c){if(null!=a.createElementNS)return a.createElementNS(b,-c);a=a.createElement(c);null!=namespace&&a.setAttribute("xmlns",b);return a},createImage:function(a){var b=document.createElement("img");b.setAttribute("src",a);b.setAttribute("border","0");return b},sortCells:function(a,b){b=null!=b?b:!0;var c=new mxDictionary;a.sort(function(d,e){var f=c.get(d);null==f&&(f=mxCellPath.create(d).split(mxCellPath.PATH_SEPARATOR),c.put(d,f));d=c.get(e);null==d&&(d=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),c.put(e,d));e=mxCellPath.compare(f,d);return 0==-e?0:0<e==b?1:-1});return a},getStylename:function(a){return null!=a&&(a=a.split(";")[0],0>a.indexOf("="))?a:""},getStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;c<a.length;c++)0>a[c].indexOf("=")&&b.push(a[c])}return b},indexOfStylename:function(a,b){if(null!=a&&null!=b){a=a.split(";");for(var c=0,d=0;d<a.length;d++){if(a[d]==b)return c;c+=a[d].length+1}}return-1},addStylename:function(a,b){0>mxUtils.indexOfStylename(a,b)&&(null==a?a="":0<a.length&&";"!=a.charAt(a.length--1)&&(a+=";"),a+=b);return a},removeStylename:function(a,b){var c=[];if(null!=a){a=a.split(";");for(var d=0;d<a.length;d++)a[d]!=b&&c.push(a[d])}return c.join(";")},removeAllStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;c<a.length;c++)0<=a[c].indexOf("=")&&b.push(a[c])}return b.join(";")},setCellStyles:function(a,b,c,d){if(null!=b&&0<b.length){a.beginUpdate();try{for(var e=0;e<b.length;e++)if(null!=b[e]){var f=mxUtils.setStyle(a.getStyle(b[e]),c,d);a.setStyle(b[e],f)}}finally{a.endUpdate()}}},-parseColor:function(a,b){b=null!=b?b:1;var c=null;if(null!=a&&a!=mxConstants.NONE){if(mxUtils.isRgbColor(a)){a=a.replace(/[^\d,]/g,"").split(",");c=parseInt(a[0]);var d=parseInt(a[1]),e=parseInt(a[2]);4==a.length&&(b=parseFloat(a[3]))}else mxUtils.isHexColor(a)||(a=mxUtils.color2hex(a)),a=a.substring(1),c=parseInt(a.substr(0,2),16),d=parseInt(a.substr(2,2),16),e=parseInt(a.substr(4,2),16),6<a.length&&(b=parseInt(a.substr(6,2),16)/255);c={r:c,g:d,b:e,a:b}}return c},hex2rgb:function(a){var b=mxUtils.parseColor(a);-null!=b&&(a="rgb("+b.r+", "+b.g+", "+b.b+")");return a},hex2rgba:function(a,b){b=mxUtils.parseColor(a,b);null!=b&&(a="rgba("+b.r+", "+b.g+", "+b.b+", "+b.a+")");return a},rgba2hex:function(a){var b=mxUtils.parseColor(a);return null!=b?"#"+("0"+b.r.toString(16)).slice(-2)+("0"+b.g.toString(16)).slice(-2)+("0"+b.b.toString(16)).slice(-2):a},color2hex:function(a,b){b=null!=b?b:"#000000";try{null!=a&&(a=String(a).replace(/\s/g,""),a.toLowerCase()==mxUtils.normalizedValidInvalidColor?b="#000000":(mxUtils.canvasContext.fillStyle=-mxUtils.validInvalidColor,mxUtils.canvasContext.fillStyle=a,mxUtils.canvasContext.fillStyle!=mxUtils.validInvalidColor&&(b=mxUtils.canvasContext.fillStyle)))}catch(c){}return b},setStyle:function(a,b,c){var d=null!=c&&("undefined"==typeof c.length||0<c.length);if(null==a||0==a.length)d&&(a=b+"="+c+";");else if(a.substring(0,b.length+1)==b+"="){var e=a.indexOf(";");a=d?b+"="+c+(0>e?";":a.substring(e)):0>e||e==a.length-1?"":a.substring(e+1)}else{var f=a.indexOf(";"+b+"=");0>f?d&&(d=";"==a.charAt(a.length--1)?"":";",a=a+d+b+"="+c+";"):(e=a.indexOf(";",f+1),a=d?a.substring(0,f+1)+b+"="+c+(0>e?";":a.substring(e)):a.substring(0,f)+(0>e?";":a.substring(e)))}return a},setCellStyleFlags:function(a,b,c,d,e){if(null!=b&&0<b.length){a.beginUpdate();try{for(var f=0;f<b.length;f++)if(null!=b[f]){var g=mxUtils.setStyleFlag(a.getStyle(b[f]),c,d,e);a.setStyle(b[f],g)}}finally{a.endUpdate()}}},setStyleFlag:function(a,b,c,d){if(null==a||0==a.length)a=d||null==d?b+"="+c:b+"=0";else{var e=a.indexOf(b+"=");if(0>e)e=";"==-a.charAt(a.length-1)?"":";",a=d||null==d?a+e+b+"="+c:a+e+b+"=0";else{var f=a.indexOf(";",e),g=0>f?a.substring(e+b.length+1):a.substring(e+b.length+1,f);g=null==d?parseInt(g)^c:d?parseInt(g)|c:parseInt(g)&~c;a=a.substring(0,e)+b+"="+g+(0<=f?a.substring(f):"")}}return a},getAlignmentAsPoint:function(a,b){var c=-.5,d=-.5;a==mxConstants.ALIGN_LEFT?c=0:a==mxConstants.ALIGN_RIGHT&&(c=-1);b==mxConstants.ALIGN_TOP?d=0:b==mxConstants.ALIGN_BOTTOM&&(d=-1);return new mxPoint(c,d)},getSizeForString:function(a,-b,c,d,e){b=null!=b?b:mxConstants.DEFAULT_FONTSIZE;c=null!=c?c:mxConstants.DEFAULT_FONTFAMILY;var f=document.createElement("div");f.style.fontFamily=c;f.style.fontSize=Math.round(b)+"px";f.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?b*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*mxSvgCanvas2D.prototype.lineHeightCorrection;null!=e&&((e&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(f.style.fontWeight="bold"),(e&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(f.style.fontStyle="italic"),-b=[],(e&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&b.push("underline"),(e&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&b.push("line-through"),0<b.length&&(f.style.textDecoration=b.join(" ")));f.style.position="absolute";f.style.visibility="hidden";f.style.display="inline-block";f.style.zoom="1";null!=d?(f.style.width=d+"px",f.style.whiteSpace="normal"):f.style.whiteSpace="nowrap";f.innerHTML=a;document.body.appendChild(f);a=new mxRectangle(0,0,f.offsetWidth,f.offsetHeight);-document.body.removeChild(f);return a},getViewXml:function(a,b,c,d,e){d=null!=d?d:0;e=null!=e?e:0;b=null!=b?b:1;null==c&&(c=[a.getModel().getRoot()]);var f=a.getView(),g=null,k=f.isEventsEnabled();f.setEventsEnabled(!1);var l=f.drawPane,m=f.overlayPane;a.dialect==mxConstants.DIALECT_SVG?(f.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),f.canvas.appendChild(f.drawPane),f.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g")):(f.drawPane=f.drawPane.cloneNode(!1),f.canvas.appendChild(f.drawPane),-f.overlayPane=f.overlayPane.cloneNode(!1));f.canvas.appendChild(f.overlayPane);var n=f.getTranslate();f.translate=new mxPoint(d,e);b=new mxTemporaryCellStates(a.getView(),b,c);try{g=(new mxCodec).encode(a.getView())}finally{b.destroy(),f.translate=n,f.canvas.removeChild(f.drawPane),f.canvas.removeChild(f.overlayPane),f.drawPane=l,f.overlayPane=m,f.setEventsEnabled(k)}return g},getScaleForPageCount:function(a,b,c,d){if(1>a)return 1;c=null!=c?c:mxConstants.PAGE_FORMAT_A4_PORTRAIT;d=null!=d?d:0;var e=-c.width-2*d;c=c.height-2*d;d=mxRectangle.fromRectangle(b.getGraphBounds());b=b.getView().getScale();d.width/=b;d.height/=b;b=d.width;var f=Math.sqrt(a);d=Math.sqrt(b/d.height/(e/c));c=f*d;d=f/d;if(1>c&&d>a){var g=d/a;d=a;c/=g}1>d&&c>a&&(g=c/a,c=a,d/=g);g=Math.ceil(c)*Math.ceil(d);for(f=0;g>a;){g=Math.floor(c)/c;var k=Math.floor(d)/d;1==g&&(g=Math.floor(c-1)/c);1==k&&(k=Math.floor(d-1)/d);g=g>k?g:k;c*=g;d*=g;g=Math.ceil(c)*Math.ceil(d);f++;if(10<f)break}return e*c/b*.99999},show:function(a,b,c,d,e,-f){c=null!=c?c:0;d=null!=d?d:0;null==b?b=window.open().document:b.open();9==document.documentMode&&b.writeln('\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=9"><![endif]--\x3e');var g=a.getGraphBounds(),k=Math.ceil(c-g.x),l=Math.ceil(d-g.y);null==e&&(e=Math.ceil(g.width+c)+Math.ceil(Math.ceil(g.x)-g.x));null==f&&(f=Math.ceil(g.height+d)+Math.ceil(Math.ceil(g.y)-g.y));if(mxClient.IS_IE||11==document.documentMode){d="<html><head>";g=document.getElementsByTagName("base");for(c=0;c<g.length;c++)d+=-g[c].outerHTML;d+="<style>";for(c=0;c<document.styleSheets.length;c++)try{d+=document.styleSheets[c].cssText}catch(m){}d=d+'</style></head><body style="margin:0px;"><div style="position:absolute;overflow:hidden;width:'+(e+"px;height:"+f+'px;"><div style="position:relative;left:'+k+"px;top:"+l+'px;">')+a.container.innerHTML;b.writeln(d+"</div></div></body><html>");b.close()}else{b.writeln("<html><head>");g=document.getElementsByTagName("base");for(c=0;c<g.length;c++)b.writeln(mxUtils.getOuterHtml(g[c]));-d=document.getElementsByTagName("link");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));d=document.getElementsByTagName("style");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));b.writeln('</head><body style="margin:0px;"></body></html>');b.close();c=b.createElement("div");c.position="absolute";c.overflow="hidden";c.style.width=e+"px";c.style.height=f+"px";e=b.createElement("div");e.style.position="absolute";e.style.left=k+"px";e.style.top=l+"px";f=a.container.firstChild;-for(d=null;null!=f;)g=f.cloneNode(!0),f==a.view.drawPane.ownerSVGElement?(c.appendChild(g),d=g):e.appendChild(g),f=f.nextSibling;b.body.appendChild(c);null!=e.firstChild&&b.body.appendChild(e);null!=d&&(d.style.minWidth="",d.style.minHeight="",d.firstChild.setAttribute("transform","translate("+k+","+l+")"))}mxUtils.removeCursors(b.body);return b},printScreen:function(a){var b=window.open();mxUtils.show(a,b.document);a=function(){b.focus();b.print();b.close()};mxClient.IS_GC?b.setTimeout(a,500):a()},-popup:function(a,b){if(b){var c=document.createElement("div");c.style.overflow="scroll";c.style.width="636px";c.style.height="460px";b=document.createElement("pre");b.innerHTML=mxUtils.htmlEntities(a,!1).replace(/\n/g,"<br>").replace(/ /g," ");c.appendChild(b);c=new mxWindow("Popup Window",c,document.body.clientWidth/2-320,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight)/2-240,640,480,!1,!0);c.setClosable(!0);c.setVisible(!0)}else mxClient.IS_NS?(c=window.open(),-c.document.writeln("<pre>"+mxUtils.htmlEntities(a)+"</pre"),c.document.close()):(c=window.open(),b=c.document.createElement("pre"),b.innerHTML=mxUtils.htmlEntities(a,!1).replace(/\n/g,"<br>").replace(/ /g," "),c.document.body.appendChild(b))},alert:function(a){alert(a)},prompt:function(a,b){return prompt(a,null!=b?b:"")},confirm:function(a){return confirm(a)},error:function(a,b,c,d){var e=document.createElement("div");e.style.padding="20px";var f=document.createElement("img");f.setAttribute("src",-d||mxUtils.errorImage);f.setAttribute("valign","bottom");f.style.verticalAlign="middle";e.appendChild(f);e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));mxUtils.write(e,a);a=document.body.clientWidth;d=document.body.clientHeight||document.documentElement.clientHeight;var g=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,e,(a-b)/2,d/4,b,null,!1,!0);c&&(mxUtils.br(e),b=document.createElement("p"),-c=document.createElement("button"),mxClient.IS_IE?c.style.cssText="float:right":c.setAttribute("style","float:right"),mxEvent.addListener(c,"click",function(k){g.destroy()}),mxUtils.write(c,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),b.appendChild(c),e.appendChild(b),mxUtils.br(e),g.setClosable(!0));g.setVisible(!0);return g},makeDraggable:function(a,b,c,d,e,f,g,k,l,m){a=new mxDragSource(a,c);a.dragOffset=new mxPoint(null!=e?e:0,null!=f?f:mxConstants.TOOLTIP_VERTICAL_OFFSET);a.autoscroll=-g;a.setGuidesEnabled(!1);null!=l&&(a.highlightDropTargets=l);null!=m&&(a.getDropTarget=m);a.getGraphForEvent=function(n){return"function"==typeof b?b(n):b};null!=d&&(a.createDragElement=function(){return d.cloneNode(!0)},k&&(a.createPreviewElement=function(n){var p=d.cloneNode(!0),q=parseInt(p.style.width),r=parseInt(p.style.height);p.style.width=Math.round(q*n.view.scale)+"px";p.style.height=Math.round(r*n.view.scale)+"px";return p}));return a},format:function(a){return parseFloat(parseFloat(a).toFixed(2))}},-mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"#808080",VML_SHADOWCOLOR:"#808080",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_BLUR:2,SHADOW_OPACITY:1,-NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",OUTLINE_HIGHLIGHT_COLOR:"#00FF00",OUTLINE_HIGHLIGHT_STROKEWIDTH:5,HIGHLIGHT_STROKEWIDTH:3,HIGHLIGHT_SIZE:2,HIGHLIGHT_OPACITY:100,CURSOR_MOVABLE_VERTEX:"move",-CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_TERMINAL_HANDLE:"pointer",CURSOR_BEND_HANDLE:"crosshair",CURSOR_VIRTUAL_BEND_HANDLE:"crosshair",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,-EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:6,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",DEFAULT_FONTSIZE:11,DEFAULT_TEXT_DIRECTION:"",LINE_HEIGHT:1.2,WORD_WRAP:"normal",-ABSOLUTE_LINE_HEIGHT:!1,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:0,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,827,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,827),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",-STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_PORT_CONSTRAINT_ROTATION:"portConstraintRotation",STYLE_SOURCE_PORT_CONSTRAINT:"sourcePortConstraint",STYLE_TARGET_PORT_CONSTRAINT:"targetPortConstraint",STYLE_OPACITY:"opacity",STYLE_FILL_OPACITY:"fillOpacity",STYLE_FILL_STYLE:"fillStyle",STYLE_STROKE_OPACITY:"strokeOpacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_TEXT_DIRECTION:"textDirection",STYLE_OVERFLOW:"overflow",STYLE_BLOCK_SPACING:"blockSpacing",STYLE_ORTHOGONAL:"orthogonal",-STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_DX:"exitDx",STYLE_EXIT_DY:"exitDy",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_DX:"entryDx",STYLE_ENTRY_DY:"entryDy",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_POINTER_EVENTS:"pointerEvents",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",STYLE_MARGIN:"margin",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",-STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_WIDTH:"labelWidth",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",-STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",-STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_TEXT_SHADOW:"textShadow",STYLE_SHADOW_OFFSET_X:"shadowOffsetX",STYLE_SHADOW_OFFSET_Y:"shadowOffsetY",STYLE_SHADOW_BLUR:"shadowBlur",STYLE_SHADOWCOLOR:"shadowColor",STYLE_SHADOW_OPACITY:"shadowOpacity",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",-STYLE_SWIMLANE_HEAD:"swimlaneHead",STYLE_SWIMLANE_BODY:"swimlaneBody",STYLE_ENDFILL:"endFill",STYLE_ENDFILLCOLOR:"endFillColor",STYLE_STARTFILL:"startFill",STYLE_STARTFILLCOLOR:"startFillColor",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_FIX_DASH:"fixDash",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_ABSOLUTE_ARCSIZE:"absoluteArcSize",STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",-STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ANCHOR_POINT_DIRECTION:"anchorPointDirection",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_ASPECT:"aspect",STYLE_AUTOSIZE:"autosize",STYLE_AUTOSIZE_GRID:"autosizeGrid",STYLE_FIXED_WIDTH:"fixedWidth",-STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BACKGROUND_OUTLINE:"backgroundOutline",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_RESIZE_WIDTH:"resizeWidth",STYLE_RESIZE_HEIGHT:"resizeHeight",STYLE_ROTATABLE:"rotatable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",STYLE_EDGE:"edgeStyle",STYLE_JETTY_SIZE:"jettySize",STYLE_SOURCE_JETTY_SIZE:"sourceJettySize",STYLE_TARGET_JETTY_SIZE:"targetJettySize",STYLE_LOOP:"loopStyle",-STYLE_ORTHOGONAL_LOOP:"orthogonalLoop",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",STYLE_CLIP_PATH:"clipPath",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_STRIKETHROUGH:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",SHAPE_ARROW:"arrow",SHAPE_ARROW_CONNECTOR:"arrowConnector",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",-SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_CLASSIC_THIN:"classicThin",ARROW_BLOCK:"block",ARROW_BLOCK_THIN:"blockThin",ARROW_OPEN:"open",ARROW_OPEN_THIN:"openThin",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",-DIRECTION_WEST:"west",DIRECTION_RADIAL:"radial",TEXT_DIRECTION_DEFAULT:"",TEXT_DIRECTION_AUTO:"auto",TEXT_DIRECTION_LTR:"ltr",TEXT_DIRECTION_RTL:"rtl",TEXT_DIRECTION_VERTICAL_LR:"vertical-lr",TEXT_DIRECTION_VERTICAL_RL:"vertical-rl",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",-EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_HEXAGON:"hexagonPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};+b)).simulate(c,d)},loadInto:function(a,b,c){mxClient.IS_IE?b.onreadystatechange=function(){4==b.readyState&&c()}:b.addEventListener("load",c,!1);b.load(a)},getValue:function(a,b,c){a=null!=a?a[b]:null;null==a&&(a=c);return a},getColorValue:function(a,b,c){a=null!=a?a[b]:null;if(null==a||"default"==a)a=c;return a},getNumber:function(a,b,c){a=null!=a?a[b]:null;null==a&&(a=c||0);return Number(a)},isLightDarkColor:function(a){return"string"===typeof a&&"light-dark"==mxUtils.ltrim(a).substring(0,10)},+isVarColor:function(a){return mxUtils.varColorRegex.test(a)},isHexColor:function(a){return mxUtils.hexColorRegex.test(a)},isRgbColor:function(a){return mxUtils.rgbaColorRegex.test(a)},isValidColor:function(a){if(null==a)return!1;a=String(a).replace(/\s/g,"");if(a.toLowerCase()==mxUtils.normalizedValidInvalidColor)return!0;mxUtils.canvasContext.fillStyle=mxUtils.validInvalidColor;mxUtils.canvasContext.fillStyle=a;return mxUtils.canvasContext.fillStyle!=mxUtils.validInvalidColor},isDarkColor:function(a){a=+mxUtils.parseColor(a);return null!=a?128>.213*a.r+.715*a.g+.072*a.b:!1},parseLightDarkColor:function(a,b,c){var d=a,e=null;null!=a&&(a=a.match(mxUtils.lightDarkColorRegex))&&3===a.length&&(d=mxUtils.trim(a[1]),e=mxUtils.trim(a[2]));null==e&&(c||mxUtils.isVarColor(d))&&(e=d);e=null!=e?e:null!=b?b:mxUtils.getInverseColor(d);return{light:d,dark:e}},getInverseColor:function(a,b,c){function d(m){return Math.round(b/100*(255-m)+m*(1-b/100))}function e(m){return Math.round(Math.max(0,Math.min(255,m)))}c=+null!=c?c:180;b=null!=b?b:93;var f=0,g=0,k=0;if("transparent"==a.toLowerCase())return a;k=mxUtils.parseColor(a);if(null==k)return a;f=k.r;g=k.g;k=k.b;f=d(f);g=d(g);k=d(k);a=[1,0,0,0,1,0,0,0,1];var l=Math.cos(c*Math.PI/180);c=Math.sin(c*Math.PI/180);a[0]=.2126+.7874*l-.2126*c;a[1]=.7152-.7152*l-.7152*c;a[2]=.0722-.0722*l+.9278*c;a[3]=.2126-.2126*l+.143*c;a[4]=.7152+(1-.7152)*l+.14*c;a[5]=.0722-.0722*l-.283*c;a[6]=.2126-.2126*l-.7874*c;a[7]=.7152-.7152*l+.7152*c;a[8]=.0722+.9278*l+.0722*c;c=e(a[0]*+f+a[1]*g+a[2]*k);l=e(a[3]*f+a[4]*g+a[5]*k);f=e(a[6]*f+a[7]*g+a[8]*k);return"#"+(16777216|c<<16|l<<8|f).toString(16).slice(1)},addAlphaToColor:function(a,b){null!=b&&null!=a&&"transparent"!=a&&(a=mxUtils.parseColor(a),a="rgba("+a.r+","+a.g+","+a.b+","+b+")");return a},getLightDarkColor:function(a,b,c,d){var e={light:"transparent",dark:"transparent",cssText:"transparent"};null!=a&&a!=mxConstants.NONE&&("string"===typeof a?(a=mxUtils.parseLightDarkColor(a,c,d),e.light=mxUtils.addAlphaToColor(a.light,+b),e.dark=mxUtils.addAlphaToColor(a.dark,b),e.cssText=mxUtils.lightDarkColorSupported?e.light==e.dark?e.light:"light-dark("+e.light+", "+e.dark+")":mxUtils.preferDarkColor?e.dark:e.light):(e.light=a,e.dark=a,e.cssText=a));return e},invertLightDarkColor:function(a){var b={};b.light=a.dark;b.dark=a.light;b.cssText=b.light==b.dark?b.light:"light-dark("+b.light+", "+b.dark+")";return b},getColor:function(a,b,c){a=null!=a?a[b]:null;null==a?a=c:a==mxConstants.NONE&&(a=null);return a},isEmptyObject:function(a){for(var b in a)return!1;+return!0},clone:function(a,b,c){c=null!=c?c:!1;var d=null;if(null!=a&&"function"==typeof a.constructor)if(a.constructor===Element)d=a.cloneNode(null!=c?!c:!1);else{d=new a.constructor;for(var e in a)e!=mxObjectIdentity.FIELD_NAME&&(null==b||0>mxUtils.indexOf(b,e))&&(d[e]=c||"object"!=typeof a[e]?a[e]:mxUtils.clone(a[e]))}return d},equalPoints:function(a,b){if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b)for(var c=0;c<a.length;c++)if(null!=a[c]&&+null==b[c]||null==a[c]&&null!=b[c]||null!=a[c]&&null!=b[c]&&(a[c].x!=b[c].x||a[c].y!=b[c].y))return!1;return!0},equalEntries:function(a,b){var c=0;if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b){for(var d in b)c++;for(d in a)if(c--,!(mxUtils.isNaN(a[d])&&mxUtils.isNaN(b[d])||a[d]==b[d]))return!1}return 0==c},removeDuplicates:function(a){for(var b=new mxDictionary,c=[],d=0;d<a.length;d++)b.get(a[d])||(c.push(a[d]),b.put(a[d],!0));return c},+isNaN:function(a){return"number"==typeof a&&isNaN(a)},extend:function(a,b){var c=function(){};c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a},toString:function(a){var b="",c;for(c in a)try{if(null==a[c])b+=c+" = [null]\n";else if("function"==typeof a[c])b+=c+" => [Function]\n";else if("object"==typeof a[c]){var d=mxUtils.getFunctionName(a[c].constructor);b+=c+" => ["+d+"]\n"}else b+=c+" = "+a[c]+"\n"}catch(e){b+=c+"="+e.message}return b},toRadians:function(a){return Math.PI*a/+180},toDegree:function(a){return 180*a/Math.PI},arcToCurves:function(a,b,c,d,e,f,g,k,l){k-=a;l-=b;if(0===c||0===d)return A;c=Math.abs(c);d=Math.abs(d);var m=-k/2,n=-l/2,p=Math.cos(e*Math.PI/180);A=Math.sin(e*Math.PI/180);e=p*m+A*n;m=-1*A*m+p*n;n=e*e;var q=m*m,r=c*c,t=d*d,u=n/r+q/t;1<u?(c*=Math.sqrt(u),d*=Math.sqrt(u),f=0):(u=1,f===g&&(u=-1),f=u*Math.sqrt((r*t-r*q-t*n)/(r*q+t*n)));n=f*c*m/d;q=-1*f*d*e/c;k=p*n-A*q+k/2;l=A*n+p*q+l/2;r=Math.atan2((m-q)/d,(e-n)/c)-Math.atan2(0,1);f=0<=r?r:2*Math.PI+r;+r=Math.atan2((-m-q)/d,(-e-n)/c)-Math.atan2((m-q)/d,(e-n)/c);e=0<=r?r:2*Math.PI+r;0==g&&0<e?e-=2*Math.PI:0!=g&&0>e&&(e+=2*Math.PI);g=2*e/Math.PI;g=Math.ceil(0>g?-1*g:g);e/=g;m=8/3*Math.sin(e/4)*Math.sin(e/4)/Math.sin(e/2);n=p*c;p*=d;c*=A;d*=A;var x=Math.cos(f),y=Math.sin(f);q=-m*(n*y+d*x);r=-m*(c*y-p*x);for(var A=[],z=0;z<g;++z){f+=e;x=Math.cos(f);y=Math.sin(f);t=n*x-d*y+k;u=c*x+p*y+l;var C=-m*(n*y+d*x);x=-m*(c*y-p*x);y=6*z;A[y]=Number(q+a);A[y+1]=Number(r+b);A[y+2]=Number(t-C+a);A[y+3]=Number(u-x++b);A[y+4]=Number(t+a);A[y+5]=Number(u+b);q=t+C;r=u+x}return A},getBoundingBox:function(a,b,c){var d=null;if(null!=a&&null!=b&&0!=b){b=mxUtils.toRadians(b);d=Math.cos(b);var e=Math.sin(b);c=null!=c?c:new mxPoint(a.x+a.width/2,a.y+a.height/2);var f=new mxPoint(a.x,a.y);b=new mxPoint(a.x+a.width,a.y);var g=new mxPoint(b.x,a.y+a.height);a=new mxPoint(a.x,g.y);f=mxUtils.getRotatedPoint(f,d,e,c);b=mxUtils.getRotatedPoint(b,d,e,c);g=mxUtils.getRotatedPoint(g,d,e,c);a=mxUtils.getRotatedPoint(a,d,e,c);d=new mxRectangle(f.x,+f.y,0,0);d.add(new mxRectangle(b.x,b.y,0,0));d.add(new mxRectangle(g.x,g.y,0,0));d.add(new mxRectangle(a.x,a.y,0,0))}return d},getRotatedPoint:function(a,b,c,d){d=null!=d?d:new mxPoint;var e=a.x-d.x;a=a.y-d.y;return new mxPoint(e*b-a*c+d.x,a*b+e*c+d.y)},getPortConstraints:function(a,b,c,d){b=mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT,mxUtils.getValue(b.style,c?mxConstants.STYLE_SOURCE_PORT_CONSTRAINT:mxConstants.STYLE_TARGET_PORT_CONSTRAINT,null));if(null==b)return d;d=b.toString();+b=mxConstants.DIRECTION_MASK_NONE;c=0;1==mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT_ROTATION,0)&&(c=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0));a=0;45<c?(a=1,135<=c&&(a=2)):-45>c&&(a=3,-135>=c&&(a=2));if(0<=d.indexOf(mxConstants.DIRECTION_NORTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:b|=mxConstants.DIRECTION_MASK_EAST;break;case 2:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:b|=mxConstants.DIRECTION_MASK_WEST}if(0<=d.indexOf(mxConstants.DIRECTION_WEST))switch(a){case 0:b|=+mxConstants.DIRECTION_MASK_WEST;break;case 1:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:b|=mxConstants.DIRECTION_MASK_EAST;break;case 3:b|=mxConstants.DIRECTION_MASK_SOUTH}if(0<=d.indexOf(mxConstants.DIRECTION_SOUTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:b|=mxConstants.DIRECTION_MASK_WEST;break;case 2:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:b|=mxConstants.DIRECTION_MASK_EAST}if(0<=d.indexOf(mxConstants.DIRECTION_EAST))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_EAST;+break;case 1:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:b|=mxConstants.DIRECTION_MASK_WEST;break;case 3:b|=mxConstants.DIRECTION_MASK_NORTH}return b},reversePortConstraints:function(a){var b=(a&mxConstants.DIRECTION_MASK_WEST)<<3;b|=(a&mxConstants.DIRECTION_MASK_NORTH)<<1;b|=(a&mxConstants.DIRECTION_MASK_SOUTH)>>1;return b|(a&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(a,b,c){var d=-1;if(0<a.absolutePoints.length)for(var e=a.absolutePoints[0],f=null,g=1;g<a.absolutePoints.length;g++){var k=+a.absolutePoints[g];e=mxUtils.ptSegDistSq(e.x,e.y,k.x,k.y,b,c);if(null==f||e<f)f=e,d=g-1;e=k}return d},getDirectedBounds:function(a,b,c,d,e){var f=mxUtils.getValue(c,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);d=null!=d?d:mxUtils.getValue(c,mxConstants.STYLE_FLIPH,!1);e=null!=e?e:mxUtils.getValue(c,mxConstants.STYLE_FLIPV,!1);b.x=Math.round(Math.max(0,Math.min(a.width,b.x)));b.y=Math.round(Math.max(0,Math.min(a.height,b.y)));b.width=Math.round(Math.max(0,Math.min(a.width,b.width)));b.height=+Math.round(Math.max(0,Math.min(a.height,b.height)));if(e&&(f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH)||d&&(f==mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST))c=b.x,b.x=b.width,b.width=c;if(d&&(f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH)||e&&(f==mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST))c=b.y,b.y=b.height,b.height=c;d=mxRectangle.fromRectangle(b);f==mxConstants.DIRECTION_SOUTH?(d.y=b.x,d.x=b.height,d.width=b.y,d.height=b.width):f==+mxConstants.DIRECTION_WEST?(d.y=b.height,d.x=b.width,d.width=b.x,d.height=b.y):f==mxConstants.DIRECTION_NORTH&&(d.y=b.width,d.x=b.y,d.width=b.height,d.height=b.x);return new mxRectangle(a.x+d.x,a.y+d.y,a.width-d.width-d.x,a.height-d.height-d.y)},getPerimeterPoint:function(a,b,c){for(var d=null,e=0;e<a.length-1;e++){var f=mxUtils.intersection(a[e].x,a[e].y,a[e+1].x,a[e+1].y,b.x,b.y,c.x,c.y);if(null!=f){var g=c.x-f.x,k=c.y-f.y;f={p:f,distSq:k*k+g*g};null!=f&&(null==d||d.distSq>f.distSq)&&(d=f)}}return null!=+d?d.p:null},intersectsPoints:function(a,b){for(var c=0;c<b.length-1;c++)if(mxUtils.rectangleIntersectsSegment(a,b[c],b[c+1]))return!0;return!1},rectangleIntersectsSegment:function(a,b,c){var d=a.y,e=a.x,f=d+a.height,g=e+a.width;a=b.x;var k=c.x;b.x>c.x&&(a=c.x,k=b.x);k>g&&(k=g);a<e&&(a=e);if(a>k)return!1;e=b.y;g=c.y;var l=c.x-b.x;1E-7<Math.abs(l)&&(c=(c.y-b.y)/l,b=b.y-c*b.x,e=c*a+b,g=c*k+b);e>g&&(b=g,g=e,e=b);g>f&&(g=f);e<d&&(e=d);return e>g?!1:!0},contains:function(a,b,c){return a.x<=b&&a.x+a.width>=+b&&a.y<=c&&a.y+a.height>=c},intersects:function(a,b,c){var d=a.width,e=a.height,f=b.width,g=b.height;if(!c&&(0>=f||0>=g||0>=d||0>=e))return!1;c=a.x;a=a.y;var k=b.x;b=b.y;f+=k;g+=b;d+=c;e+=a;return(f<k||f>c)&&(g<b||g>a)&&(d<c||d>k)&&(e<a||e>b)},intersectsHotspot:function(a,b,c,d,e,f){d=null!=d?d:1;e=null!=e?e:0;f=null!=f?f:0;if(0<d){var g=a.getCenterX(),k=a.getCenterY(),l=a.width,m=a.height,n=mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE)*a.view.scale;0<n&&(mxUtils.getValue(a.style,mxConstants.STYLE_HORIZONTAL,+!0)?(k=a.y+n/2,m=n):(g=a.x+n/2,l=n));l=Math.max(e,l*d);m=Math.max(e,m*d);0<f&&(l=Math.min(l,f),m=Math.min(m,f));d=new mxRectangle(g-l/2,k-m/2,l,m);g=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)||0);0!=g&&(e=Math.cos(-g),f=Math.sin(-g),g=new mxPoint(a.getCenterX(),a.getCenterY()),a=mxUtils.getRotatedPoint(new mxPoint(b,c),e,f,g),b=a.x,c=a.y);return mxUtils.contains(d,b,c)}return!0},getOffset:function(a,b){for(var c=0,d=0,e=!1,f=a,g=document.body,k=document.documentElement;null!=+f&&f!=g&&f!=k&&!e;){var l=mxUtils.getCurrentStyle(f);null!=l&&(e=e||"fixed"==l.position);f=f.parentNode}b||e||(b=mxUtils.getDocumentScrollOrigin(a.ownerDocument),c+=b.x,d+=b.y);a=a.getBoundingClientRect();null!=a&&(c+=a.left,d+=a.top);return new mxPoint(c,d)},getDocumentScrollOrigin:function(a){a=a.defaultView||a.parentWindow;return new mxPoint(null!=a&&void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,null!=a&&void 0!==window.pageYOffset?+window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)},getScrollOrigin:function(a,b,c){b=null!=b?b:!1;c=null!=c?c:!0;for(var d=null!=a?a.ownerDocument:document,e=d.body,f=d.documentElement,g=new mxPoint,k=!1;null!=a&&a!=e&&a!=f;){isNaN(a.scrollLeft)||isNaN(a.scrollTop)||(g.x+=a.scrollLeft,g.y+=a.scrollTop);var l=mxUtils.getCurrentStyle(a);null!=l&&(k=k||"fixed"==l.position);a=b?a.parentNode:null}!k&&c&&(a=mxUtils.getDocumentScrollOrigin(d),g.x+=a.x,g.y+=+a.y);return g},convertPoint:function(a,b,c){var d=mxUtils.getScrollOrigin(a,!1);a=mxUtils.getOffset(a);a.x-=d.x;a.y-=d.y;return new mxPoint(b-a.x,c-a.y)},removeJavascriptProtocol:function(a){for(a=null!=a?mxUtils.zapGremlins(a):null;null!=a&&"javascript:"===mxUtils.ltrim(a.toLowerCase()).substring(0,11);)a=a.substring(a.toLowerCase().indexOf(":")+1);return a},zapGremlins:function(a){for(var b=0,c=[],d=0;d<a.length;d++){var e=a.charCodeAt(d);(32<=e||9==e||10==e||13==e)&&65535!=e&&65534!=e||(c.push(a.substring(b,+d)),b=d+1)}0<b&&b<a.length&&c.push(a.substring(b));return 0==c.length?a:c.join("")},ltrim:function(a,b){return null!=a?a.replace(new RegExp("^["+(b||"\\s|\\0")+"]+","g"),""):null},rtrim:function(a,b){return null!=a?a.replace(new RegExp("["+(b||"\\s|\\0")+"]+$","g"),""):null},trim:function(a,b){return mxUtils.ltrim(mxUtils.rtrim(a,b),b)},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)&&("string"!=typeof a||0>a.toLowerCase().indexOf("0x"))},isInteger:function(a){return String(parseInt(a))===+String(a)},mod:function(a,b){return(a%b+b)%b},intersection:function(a,b,c,d,e,f,g,k){var l=(k-f)*(c-a)-(g-e)*(d-b);g=((g-e)*(b-f)-(k-f)*(a-e))/l;e=((c-a)*(b-f)-(d-b)*(a-e))/l;return 0<=g&&1>=g&&0<=e&&1>=e?new mxPoint(a+g*(c-a),b+g*(d-b)):null},ptSegDistSq:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;0>=e*c+f*d?c=0:(e=c-e,f=d-f,a=e*c+f*d,c=0>=a?0:a*a/(c*c+d*d));e=e*e+f*f-c;0>e&&(e=0);return e},ptLineDist:function(a,b,c,d,e,f){return Math.abs((d-b)*e-(c-a)*f+c*b-d*a)/Math.sqrt((d-b)*(d-b)+(c-a)*(c-a))},+relativeCcw:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;a=e*d-f*c;0==a&&(a=e*c+f*d,0<a&&(a=(e-c)*c+(f-d)*d,0>a&&(a=0)));return 0>a?-1:0<a?1:0},animateChanges:function(a,b){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(a,b,c){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(a,b,c,d,e,f){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(a,b){mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?a.style.filter=100<=b?+"":"alpha(opacity="+b+")":a.style.opacity=b/100},createElementNs:function(a,b,c){if(null!=a.createElementNS)return a.createElementNS(b,c);a=a.createElement(c);null!=namespace&&a.setAttribute("xmlns",b);return a},createImage:function(a){var b=document.createElement("img");b.setAttribute("src",a);b.setAttribute("border","0");return b},sortCells:function(a,b){b=null!=b?b:!0;var c=new mxDictionary;a.sort(function(d,e){var f=c.get(d);null==f&&(f=mxCellPath.create(d).split(mxCellPath.PATH_SEPARATOR),c.put(d,+f));d=c.get(e);null==d&&(d=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),c.put(e,d));e=mxCellPath.compare(f,d);return 0==e?0:0<e==b?1:-1});return a},getStylename:function(a){return null!=a&&(a=a.split(";")[0],0>a.indexOf("="))?a:""},getStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;c<a.length;c++)0>a[c].indexOf("=")&&b.push(a[c])}return b},indexOfStylename:function(a,b){if(null!=a&&null!=b){a=a.split(";");for(var c=0,d=0;d<a.length;d++){if(a[d]==b)return c;c+=a[d].length++1}}return-1},addStylename:function(a,b){0>mxUtils.indexOfStylename(a,b)&&(null==a?a="":0<a.length&&";"!=a.charAt(a.length-1)&&(a+=";"),a+=b);return a},removeStylename:function(a,b){var c=[];if(null!=a){a=a.split(";");for(var d=0;d<a.length;d++)a[d]!=b&&c.push(a[d])}return c.join(";")},removeAllStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;c<a.length;c++)0<=a[c].indexOf("=")&&b.push(a[c])}return b.join(";")},setCellStyles:function(a,b,c,d){if(null!=b&&0<b.length){a.beginUpdate();+try{for(var e=0;e<b.length;e++)if(null!=b[e]){var f=mxUtils.setStyle(a.getStyle(b[e]),c,d);a.setStyle(b[e],f)}}finally{a.endUpdate()}}},parseColor:function(a,b){b=null!=b?b:1;var c=null;if(null!=a&&a!=mxConstants.NONE){if(mxUtils.isRgbColor(a)){a=a.replace(/[^\d,]/g,"").split(",");c=parseInt(a[0]);var d=parseInt(a[1]),e=parseInt(a[2]);4==a.length&&(b=parseFloat(a[3]))}else mxUtils.isHexColor(a)||(a=mxUtils.color2hex(a)),a=a.substring(1),c=parseInt(a.substr(0,2),16),d=parseInt(a.substr(2,2),16),e=+parseInt(a.substr(4,2),16),6<a.length&&(b=parseInt(a.substr(6,2),16)/255);c={r:c,g:d,b:e,a:b}}return c},hex2rgb:function(a){var b=mxUtils.parseColor(a);null!=b&&(a="rgb("+b.r+", "+b.g+", "+b.b+")");return a},hex2rgba:function(a,b){b=mxUtils.parseColor(a,b);null!=b&&(a="rgba("+b.r+", "+b.g+", "+b.b+", "+b.a+")");return a},rgba2hex:function(a){var b=mxUtils.parseColor(a);return null!=b?"#"+("0"+b.r.toString(16)).slice(-2)+("0"+b.g.toString(16)).slice(-2)+("0"+b.b.toString(16)).slice(-2):a},color2hex:function(a,+b){b=null!=b?b:"#000000";try{null!=a&&(a=String(a).replace(/\s/g,""),a.toLowerCase()==mxUtils.normalizedValidInvalidColor?b="#000000":(mxUtils.canvasContext.fillStyle=mxUtils.validInvalidColor,mxUtils.canvasContext.fillStyle=a,mxUtils.canvasContext.fillStyle!=mxUtils.validInvalidColor&&(b=mxUtils.canvasContext.fillStyle)))}catch(c){}return b},setStyle:function(a,b,c){var d=null!=c&&("undefined"==typeof c.length||0<c.length);if(null==a||0==a.length)d&&(a=b+"="+c+";");else if(a.substring(0,b.length++1)==b+"="){var e=a.indexOf(";");a=d?b+"="+c+(0>e?";":a.substring(e)):0>e||e==a.length-1?"":a.substring(e+1)}else{var f=a.indexOf(";"+b+"=");0>f?d&&(d=";"==a.charAt(a.length-1)?"":";",a=a+d+b+"="+c+";"):(e=a.indexOf(";",f+1),a=d?a.substring(0,f+1)+b+"="+c+(0>e?";":a.substring(e)):a.substring(0,f)+(0>e?";":a.substring(e)))}return a},setCellStyleFlags:function(a,b,c,d,e){if(null!=b&&0<b.length){a.beginUpdate();try{for(var f=0;f<b.length;f++)if(null!=b[f]){var g=mxUtils.setStyleFlag(a.getStyle(b[f]),+c,d,e);a.setStyle(b[f],g)}}finally{a.endUpdate()}}},setStyleFlag:function(a,b,c,d){if(null==a||0==a.length)a=d||null==d?b+"="+c:b+"=0";else{var e=a.indexOf(b+"=");if(0>e)e=";"==a.charAt(a.length-1)?"":";",a=d||null==d?a+e+b+"="+c:a+e+b+"=0";else{var f=a.indexOf(";",e),g=0>f?a.substring(e+b.length+1):a.substring(e+b.length+1,f);g=null==d?parseInt(g)^c:d?parseInt(g)|c:parseInt(g)&~c;a=a.substring(0,e)+b+"="+g+(0<=f?a.substring(f):"")}}return a},getAlignmentAsPoint:function(a,b){var c=-.5,d=-.5;a==mxConstants.ALIGN_LEFT?+c=0:a==mxConstants.ALIGN_RIGHT&&(c=-1);b==mxConstants.ALIGN_TOP?d=0:b==mxConstants.ALIGN_BOTTOM&&(d=-1);return new mxPoint(c,d)},getSizeForString:function(a,b,c,d,e){b=null!=b?b:mxConstants.DEFAULT_FONTSIZE;c=null!=c?c:mxConstants.DEFAULT_FONTFAMILY;var f=document.createElement("div");f.style.fontFamily=c;f.style.fontSize=Math.round(b)+"px";f.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?b*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*mxSvgCanvas2D.prototype.lineHeightCorrection;null!=+e&&((e&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(f.style.fontWeight="bold"),(e&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(f.style.fontStyle="italic"),b=[],(e&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&b.push("underline"),(e&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&b.push("line-through"),0<b.length&&(f.style.textDecoration=b.join(" ")));f.style.position="absolute";f.style.visibility="hidden";f.style.display="inline-block";f.style.zoom="1";null!=+d?(f.style.width=d+"px",f.style.whiteSpace="normal"):f.style.whiteSpace="nowrap";f.innerHTML=a;document.body.appendChild(f);a=new mxRectangle(0,0,f.offsetWidth,f.offsetHeight);document.body.removeChild(f);return a},getViewXml:function(a,b,c,d,e){d=null!=d?d:0;e=null!=e?e:0;b=null!=b?b:1;null==c&&(c=[a.getModel().getRoot()]);var f=a.getView(),g=null,k=f.isEventsEnabled();f.setEventsEnabled(!1);var l=f.drawPane,m=f.overlayPane;a.dialect==mxConstants.DIALECT_SVG?(f.drawPane=document.createElementNS(mxConstants.NS_SVG,+"g"),f.canvas.appendChild(f.drawPane),f.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g")):(f.drawPane=f.drawPane.cloneNode(!1),f.canvas.appendChild(f.drawPane),f.overlayPane=f.overlayPane.cloneNode(!1));f.canvas.appendChild(f.overlayPane);var n=f.getTranslate();f.translate=new mxPoint(d,e);b=new mxTemporaryCellStates(a.getView(),b,c);try{g=(new mxCodec).encode(a.getView())}finally{b.destroy(),f.translate=n,f.canvas.removeChild(f.drawPane),f.canvas.removeChild(f.overlayPane),f.drawPane=+l,f.overlayPane=m,f.setEventsEnabled(k)}return g},getScaleForPageCount:function(a,b,c,d){if(1>a)return 1;c=null!=c?c:mxConstants.PAGE_FORMAT_A4_PORTRAIT;d=null!=d?d:0;var e=c.width-2*d;c=c.height-2*d;d=mxRectangle.fromRectangle(b.getGraphBounds());b=b.getView().getScale();d.width/=b;d.height/=b;b=d.width;var f=Math.sqrt(a);d=Math.sqrt(b/d.height/(e/c));c=f*d;d=f/d;if(1>c&&d>a){var g=d/a;d=a;c/=g}1>d&&c>a&&(g=c/a,c=a,d/=g);g=Math.ceil(c)*Math.ceil(d);for(f=0;g>a;){g=Math.floor(c)/c;var k=Math.floor(d)/+d;1==g&&(g=Math.floor(c-1)/c);1==k&&(k=Math.floor(d-1)/d);g=g>k?g:k;c*=g;d*=g;g=Math.ceil(c)*Math.ceil(d);f++;if(10<f)break}return e*c/b*.99999},show:function(a,b,c,d,e,f){c=null!=c?c:0;d=null!=d?d:0;null==b?b=window.open().document:b.open();9==document.documentMode&&b.writeln('\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=9"><![endif]--\x3e');var g=a.getGraphBounds(),k=Math.ceil(c-g.x),l=Math.ceil(d-g.y);null==e&&(e=Math.ceil(g.width+c)+Math.ceil(Math.ceil(g.x)-g.x));null==f&&(f=+Math.ceil(g.height+d)+Math.ceil(Math.ceil(g.y)-g.y));if(mxClient.IS_IE||11==document.documentMode){d="<html><head>";g=document.getElementsByTagName("base");for(c=0;c<g.length;c++)d+=g[c].outerHTML;d+="<style>";for(c=0;c<document.styleSheets.length;c++)try{d+=document.styleSheets[c].cssText}catch(m){}d=d+'</style></head><body style="margin:0px;"><div style="position:absolute;overflow:hidden;width:'+(e+"px;height:"+f+'px;"><div style="position:relative;left:'+k+"px;top:"+l+'px;">')+a.container.innerHTML;+b.writeln(d+"</div></div></body><html>");b.close()}else{b.writeln("<html><head>");g=document.getElementsByTagName("base");for(c=0;c<g.length;c++)b.writeln(mxUtils.getOuterHtml(g[c]));d=document.getElementsByTagName("link");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));d=document.getElementsByTagName("style");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));b.writeln('</head><body style="margin:0px;"></body></html>');b.close();c=b.createElement("div");c.position="absolute";+c.overflow="hidden";c.style.width=e+"px";c.style.height=f+"px";e=b.createElement("div");e.style.position="absolute";e.style.left=k+"px";e.style.top=l+"px";f=a.container.firstChild;for(d=null;null!=f;)g=f.cloneNode(!0),f==a.view.drawPane.ownerSVGElement?(c.appendChild(g),d=g):e.appendChild(g),f=f.nextSibling;b.body.appendChild(c);null!=e.firstChild&&b.body.appendChild(e);null!=d&&(d.style.minWidth="",d.style.minHeight="",d.firstChild.setAttribute("transform","translate("+k+","+l+")"))}mxUtils.removeCursors(b.body);+return b},printScreen:function(a){var b=window.open();mxUtils.show(a,b.document);a=function(){b.focus();b.print();b.close()};mxClient.IS_GC?b.setTimeout(a,500):a()},popup:function(a,b){if(b){var c=document.createElement("div");c.style.overflow="scroll";c.style.width="636px";c.style.height="460px";b=document.createElement("pre");b.innerHTML=mxUtils.htmlEntities(a,!1).replace(/\n/g,"<br>").replace(/ /g," ");c.appendChild(b);c=new mxWindow("Popup Window",c,document.body.clientWidth/2-320,Math.max(document.body.clientHeight||+0,document.documentElement.clientHeight)/2-240,640,480,!1,!0);c.setClosable(!0);c.setVisible(!0)}else mxClient.IS_NS?(c=window.open(),c.document.writeln("<pre>"+mxUtils.htmlEntities(a)+"</pre"),c.document.close()):(c=window.open(),b=c.document.createElement("pre"),b.innerHTML=mxUtils.htmlEntities(a,!1).replace(/\n/g,"<br>").replace(/ /g," "),c.document.body.appendChild(b))},alert:function(a){alert(a)},prompt:function(a,b){return prompt(a,null!=b?b:"")},confirm:function(a){return confirm(a)},+error:function(a,b,c,d){var e=document.createElement("div");e.style.padding="20px";var f=document.createElement("img");f.setAttribute("src",d||mxUtils.errorImage);f.setAttribute("valign","bottom");f.style.verticalAlign="middle";e.appendChild(f);e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));mxUtils.write(e,a);a=document.body.clientWidth;d=document.body.clientHeight||document.documentElement.clientHeight;var g=new mxWindow(mxResources.get(mxUtils.errorResource)||+mxUtils.errorResource,e,(a-b)/2,d/4,b,null,!1,!0);c&&(mxUtils.br(e),b=document.createElement("p"),c=document.createElement("button"),mxClient.IS_IE?c.style.cssText="float:right":c.setAttribute("style","float:right"),mxEvent.addListener(c,"click",function(k){g.destroy()}),mxUtils.write(c,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),b.appendChild(c),e.appendChild(b),mxUtils.br(e),g.setClosable(!0));g.setVisible(!0);return g},makeDraggable:function(a,b,c,d,e,f,g,k,l,m){a=new mxDragSource(a,+c);a.dragOffset=new mxPoint(null!=e?e:0,null!=f?f:mxConstants.TOOLTIP_VERTICAL_OFFSET);a.autoscroll=g;a.setGuidesEnabled(!1);null!=l&&(a.highlightDropTargets=l);null!=m&&(a.getDropTarget=m);a.getGraphForEvent=function(n){return"function"==typeof b?b(n):b};null!=d&&(a.createDragElement=function(){return d.cloneNode(!0)},k&&(a.createPreviewElement=function(n){var p=d.cloneNode(!0),q=parseInt(p.style.width),r=parseInt(p.style.height);p.style.width=Math.round(q*n.view.scale)+"px";p.style.height=Math.round(r*+n.view.scale)+"px";return p}));return a},format:function(a){return parseFloat(parseFloat(a).toFixed(2))}},mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"#808080",+VML_SHADOWCOLOR:"#808080",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_BLUR:2,SHADOW_OPACITY:1,NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",OUTLINE_HIGHLIGHT_COLOR:"#00FF00",OUTLINE_HIGHLIGHT_STROKEWIDTH:5,+HIGHLIGHT_STROKEWIDTH:3,HIGHLIGHT_SIZE:2,HIGHLIGHT_OPACITY:100,CURSOR_MOVABLE_VERTEX:"move",CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_TERMINAL_HANDLE:"pointer",CURSOR_BEND_HANDLE:"crosshair",CURSOR_VIRTUAL_BEND_HANDLE:"crosshair",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",+VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:6,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",+DEFAULT_FONTSIZE:11,DEFAULT_TEXT_DIRECTION:"",LINE_HEIGHT:1.2,WORD_WRAP:"normal",ABSOLUTE_LINE_HEIGHT:!1,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:0,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,827,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,827),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,+0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_PORT_CONSTRAINT_ROTATION:"portConstraintRotation",STYLE_SOURCE_PORT_CONSTRAINT:"sourcePortConstraint",STYLE_TARGET_PORT_CONSTRAINT:"targetPortConstraint",STYLE_OPACITY:"opacity",STYLE_FILL_OPACITY:"fillOpacity",STYLE_FILL_STYLE:"fillStyle",STYLE_STROKE_OPACITY:"strokeOpacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_TEXT_DIRECTION:"textDirection",+STYLE_OVERFLOW:"overflow",STYLE_BLOCK_SPACING:"blockSpacing",STYLE_ORTHOGONAL:"orthogonal",STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_DX:"exitDx",STYLE_EXIT_DY:"exitDy",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_DX:"entryDx",STYLE_ENTRY_DY:"entryDy",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_POINTER_EVENTS:"pointerEvents",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",+STYLE_MARGIN:"margin",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_WIDTH:"labelWidth",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",+STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",+STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_TEXT_SHADOW:"textShadow",STYLE_SHADOW_OFFSET_X:"shadowOffsetX",STYLE_SHADOW_OFFSET_Y:"shadowOffsetY",STYLE_SHADOW_BLUR:"shadowBlur",STYLE_SHADOWCOLOR:"shadowColor",STYLE_SHADOW_OPACITY:"shadowOpacity",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",+STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_SWIMLANE_HEAD:"swimlaneHead",STYLE_SWIMLANE_BODY:"swimlaneBody",STYLE_ENDFILL:"endFill",STYLE_ENDFILLCOLOR:"endFillColor",STYLE_STARTFILL:"startFill",STYLE_STARTFILLCOLOR:"startFillColor",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_FIX_DASH:"fixDash",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_ABSOLUTE_ARCSIZE:"absoluteArcSize",+STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ANCHOR_POINT_DIRECTION:"anchorPointDirection",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",+STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_ASPECT:"aspect",STYLE_AUTOSIZE:"autosize",STYLE_AUTOSIZE_GRID:"autosizeGrid",STYLE_FIXED_WIDTH:"fixedWidth",STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BACKGROUND_OUTLINE:"backgroundOutline",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_RESIZE_WIDTH:"resizeWidth",STYLE_RESIZE_HEIGHT:"resizeHeight",STYLE_ROTATABLE:"rotatable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",+STYLE_EDGE:"edgeStyle",STYLE_JETTY_SIZE:"jettySize",STYLE_SOURCE_JETTY_SIZE:"sourceJettySize",STYLE_TARGET_JETTY_SIZE:"targetJettySize",STYLE_LOOP:"loopStyle",STYLE_ORTHOGONAL_LOOP:"orthogonalLoop",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",STYLE_CLIP_PATH:"clipPath",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_STRIKETHROUGH:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",+SHAPE_ARROW:"arrow",SHAPE_ARROW_CONNECTOR:"arrowConnector",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_CLASSIC_THIN:"classicThin",ARROW_BLOCK:"block",ARROW_BLOCK_THIN:"blockThin",ARROW_OPEN:"open",ARROW_OPEN_THIN:"openThin",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",+ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",DIRECTION_WEST:"west",DIRECTION_RADIAL:"radial",TEXT_DIRECTION_DEFAULT:"",TEXT_DIRECTION_AUTO:"auto",TEXT_DIRECTION_LTR:"ltr",TEXT_DIRECTION_RTL:"rtl",TEXT_DIRECTION_VERTICAL_LR:"vertical-lr",TEXT_DIRECTION_VERTICAL_RL:"vertical-rl",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,+ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_HEXAGON:"hexagonPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};function mxEventObject(a){this.name=a;this.properties=[];for(var b=1;b<arguments.length;b+=2)null!=arguments[b+1]&&(this.properties[arguments[b]]=arguments[b+1])}mxEventObject.prototype.name=null;mxEventObject.prototype.properties=null;mxEventObject.prototype.consumed=!1;mxEventObject.prototype.getName=function(){return this.name};mxEventObject.prototype.getProperties=function(){return this.properties};mxEventObject.prototype.getProperty=function(a){return this.properties[a]};mxEventObject.prototype.isConsumed=function(){return this.consumed};mxEventObject.prototype.consume=function(){this.consumed=!0};function mxMouseEvent(a,b){this.evt=a;this.sourceState=this.state=b}mxMouseEvent.prototype.consumed=!1;mxMouseEvent.prototype.evt=null;mxMouseEvent.prototype.graphX=null;mxMouseEvent.prototype.graphY=null;mxMouseEvent.prototype.state=null;mxMouseEvent.prototype.sourceState=null;mxMouseEvent.prototype.getEvent=function(){return this.evt};mxMouseEvent.prototype.getSource=function(){return mxEvent.getSource(this.evt)};mxMouseEvent.prototype.isSource=function(a){return null!=a?mxUtils.isAncestorNode(a.node,this.getSource()):!1};mxMouseEvent.prototype.getX=function(){return mxEvent.getClientX(this.getEvent())};mxMouseEvent.prototype.getY=function(){return mxEvent.getClientY(this.getEvent())};mxMouseEvent.prototype.getGraphX=function(){return this.graphX};mxMouseEvent.prototype.getGraphY=function(){return this.graphY};@@ -476,7 +476,7 @@ mxShape.prototype.outline=!1;mxShape.prototype.visible=!0;mxShape.prototype.useSmxShape.prototype.getSvgScreenOffset=function(){return 1==mxUtils.mod(Math.max(1,Math.round((this.stencil&&"inherit"!=this.stencil.strokewidth?Number(this.stencil.strokewidth):this.strokewidth)*this.scale)),2)?.5:0};mxShape.prototype.create=function(a){return null!=a&&null!=a.ownerSVGElement?this.createSvg(a):this.createHtml(a)};mxShape.prototype.createSvg=function(){return document.createElementNS(mxConstants.NS_SVG,"g")};mxShape.prototype.createHtml=function(){var a=document.createElement("div");a.style.position="absolute";return a};mxShape.prototype.reconfigure=function(){this.redraw()};mxShape.prototype.redraw=function(){this.updateBoundsFromPoints();this.visible&&this.checkBounds()?(this.node.style.visibility="visible",this.clear(),"DIV"==this.node.nodeName?this.redrawHtmlShape():this.redrawShape()):(this.node.style.visibility="hidden",this.boundingBox=null)};mxShape.prototype.clear=function(){if(null!=this.node.ownerSVGElement)for(;null!=this.node.lastChild;)this.node.removeChild(this.node.lastChild);else this.node.style.cssText="position:absolute;"+(null!=this.cursor?"cursor:"+this.cursor+";":""),this.node.innerText=""};-mxShape.prototype.updateBoundsFromPoints=function(){var a=this.points;if(null!=a&&0<a.length&&null!=a[0]){this.bounds=new mxRectangle(Number(a[0].x),Number(a[0].y),this.scale,this.scale);for(var b=1;b<this.points.length;b++)null!=a[b]&&this.bounds.add(new mxRectangle(Number(a[b].x),Number(a[b].y),this.scale,this.scale))}};+mxShape.prototype.updateBoundsFromPoints=function(){var a=this.points;if(null!=a&&0<a.length&&null!=a[0]){this.bounds=new mxRectangle(Number(a[0].x),Number(a[0].y),this.scale,this.scale);for(var b=1;b<this.points.length;b++)null!=a[b]&&this.bounds.add(new mxRectangle(Number(a[b].x),Number(a[b].y),this.scale,this.scale))}};mxShape.prototype.styleChanged=function(a,b,c){};mxShape.prototype.getLabelBounds=function(a){var b=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),c=a;b!=mxConstants.DIRECTION_SOUTH&&b!=mxConstants.DIRECTION_NORTH&&null!=this.state&&null!=this.state.text&&this.state.text.isPaintBoundsInverted()&&(c=c.clone(),b=c.width,c.width=c.height,c.height=b);c=this.getLabelMargins(c);if(null!=c){var d="1"==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,!1),e="1"==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,!1);null!=this.state&&null!=this.state.text&&this.state.text.isPaintBoundsInverted()&&(b=c.x,c.x=c.height,c.height=c.width,c.width=c.y,c.y=b,b=d,d=e,e=b);return mxUtils.getDirectedBounds(a,c,this.style,d,e)}return a};mxShape.prototype.getLabelMargins=function(a){return null};mxShape.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&0<this.scale&&null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&0<this.bounds.width&&0<this.bounds.height};@@ -523,10 +523,10 @@ mxStencil.prototype.desc=null;mxStencil.prototype.constraints=null;mxStencil.promxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0];this.bgNode=this.desc.getElementsByTagName("background")[0];this.w0=Number(this.desc.getAttribute("w")||100);this.h0=Number(this.desc.getAttribute("h")||100);var a=this.desc.getAttribute("aspect");this.aspect=null!=a?a:"variable";a=this.desc.getAttribute("strokewidth");this.strokewidth=null!=a?a:"1"};mxStencil.prototype.parseConstraints=function(){var a=this.desc.getElementsByTagName("connections")[0];if(null!=a&&(a=mxUtils.getChildNodes(a),null!=a&&0<a.length)){this.constraints=[];for(var b=0;b<a.length;b++)this.constraints.push(this.parseConstraint(a[b]))}};mxStencil.prototype.parseConstraint=function(a){var b=Number(a.getAttribute("x")),c=Number(a.getAttribute("y")),d="1"==a.getAttribute("perimeter");a=a.getAttribute("name");return new mxConnectionConstraint(new mxPoint(b,c),d,a)};mxStencil.prototype.evaluateTextAttribute=function(a,b,c){b=this.evaluateAttribute(a,b,c);a=a.getAttribute("localized");if(mxStencil.defaultLocalized&&null==a||"1"==a)b=mxResources.get(b);return b};mxStencil.prototype.evaluateAttribute=function(a,b,c){b=a.getAttribute(b);null==b&&(a=mxUtils.getTextContent(a),null!=a&&mxStencil.allowEval&&(a=mxUtils.eval(a),"function"==typeof a&&(b=a(c))));return b};-mxStencil.prototype.drawShape=function(a,b,c,d,e,f,g){var k=a.states.slice(),l=mxUtils.getValue(b.style,mxConstants.STYLE_DIRECTION,null);l=this.computeAspect(b.style,c,d,e,f,l);var m=Math.min(l.width,l.height);m="inherit"==this.strokewidth?Number(mxUtils.getNumber(b.style,mxConstants.STYLE_STROKEWIDTH,1)):Number(this.strokewidth)*m;a.setStrokeWidth(m);null!=b.style&&"1"==mxUtils.getValue(b.style,mxConstants.STYLE_POINTER_EVENTS,"0")&&(a.setStrokeColor(mxConstants.NONE),a.rect(c,d,e,f),a.stroke(),-a.setStrokeColor(b.stroke));this.drawChildren(a,b,c,d,e,f,this.bgNode,l,!1,!0,g);this.drawChildren(a,b,c,d,e,f,this.fgNode,l,!0,!b.outline||null==b.style||0==mxUtils.getValue(b.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0),g);a.states.length!=k.length&&(a.states=k)};mxStencil.prototype.drawChildren=function(a,b,c,d,e,f,g,k,l,m,n){if(null!=g&&0<e&&0<f)for(c=g.firstChild;null!=c;)c.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(a,b,c,k,l,m,n),c=c.nextSibling};+mxStencil.prototype.drawShape=function(a,b,c,d,e,f,g){g=null!=g?g:null!=b&&null!=b.state?b.state.view.graph:null;var k=a.states.slice(),l=mxUtils.getValue(b.style,mxConstants.STYLE_DIRECTION,null);l=this.computeAspect(b.style,c,d,e,f,l);var m=Math.min(l.width,l.height);m="inherit"==this.strokewidth?Number(mxUtils.getNumber(b.style,mxConstants.STYLE_STROKEWIDTH,1)):Number(this.strokewidth)*m;a.setStrokeWidth(m);null!=b.style&&"1"==mxUtils.getValue(b.style,mxConstants.STYLE_POINTER_EVENTS,"0")&&(a.setStrokeColor(mxConstants.NONE),+a.rect(c,d,e,f),a.stroke(),a.setStrokeColor(b.stroke));this.drawChildren(a,b,c,d,e,f,this.bgNode,l,!1,!0,g);this.drawChildren(a,b,c,d,e,f,this.fgNode,l,!0,!b.outline||null==b.style||0==mxUtils.getValue(b.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0),g);a.states.length!=k.length&&(a.states=k)};mxStencil.prototype.drawChildren=function(a,b,c,d,e,f,g,k,l,m,n){if(null!=g&&0<e&&0<f)for(c=g.firstChild;null!=c;)c.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(a,b,c,k,l,m,n),c=c.nextSibling};mxStencil.prototype.computeAspect=function(a,b,c,d,e,f){a=b;b=d/this.w0;var g=e/this.h0;if(f=f==mxConstants.DIRECTION_NORTH||f==mxConstants.DIRECTION_SOUTH){g=d/this.h0;b=e/this.w0;var k=(d-e)/2;a+=k;c-=k}"fixed"==this.aspect&&(b=g=Math.min(b,g),f?(a+=(e-this.w0*b)/2,c+=(d-this.h0*g)/2):(a+=(d-this.w0*b)/2,c+=(e-this.h0*g)/2));return new mxRectangle(a,c,b,g)};-mxStencil.prototype.parseColor=function(a,b,c,d,e){"stroke"==d?d=b.stroke:"fill"==d?d=b.fill:"font"==d&&null!=b.style?d=mxUtils.getValue(b.style,mxConstants.STYLE_FONTCOLOR,"black"):null==b.style||mxUtils.isValidColor(d)||(a=mxUtils.getValue(b.style,d,mxConstants.NONE),"default"==a&&(a="fillcolor"==c.nodeName?e.shapeBackgroundColor:e.shapeForegroundColor),d=a);return d};+mxStencil.prototype.parseColor=function(a,b,c,d,e){"stroke"==d?d=b.stroke:"fill"==d?d=b.fill:"font"==d&&null!=b.style?d=mxUtils.getValue(b.style,mxConstants.STYLE_FONTCOLOR,"black"):null==b.style||mxUtils.isValidColor(d)||(a=mxUtils.getValue(b.style,d,mxConstants.NONE),"default"==a&&(a=null!=e?"fillcolor"==c.nodeName?e.shapeBackgroundColor:e.shapeForegroundColor:"#ffffff"),d=a);return d};mxStencil.prototype.drawNode=function(a,b,c,d,e,f,g){var k=c.nodeName,l=d.x,m=d.y,n=d.width,p=d.height,q=Math.min(n,p);if("save"==k)a.save();else if("restore"==k)a.restore();else if(f){if("path"==k){a.begin();q=!0;if("1"==c.getAttribute("rounded")){q=!1;for(var r=Number(c.getAttribute("arcSize")),t=0,u=[],x=c.firstChild;null!=x;){if(x.nodeType==mxConstants.NODETYPE_ELEMENT){var y=x.nodeName;if("move"==y||"line"==y)"move"!=y&&0!=u.length||u.push([]),u[u.length-1].push(new mxPoint(l+Number(x.getAttribute("x"))*n,m+Number(x.getAttribute("y"))*p)),t++;else{q=!0;break}}x=x.nextSibling}if(!q&&0<t)for(n=0;n<u.length;n++)p=!1,m=u[n][0],l=u[n][u[n].length-1],m.x==l.x&&m.y==l.y&&(u[n].pop(),p=!0),this.addPoints(a,u[n],!0,r,p);else q=!0}if(q)for(x=c.firstChild;null!=x;)x.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(a,b,x,d,e,f,g),x=x.nextSibling}else if("close"==k)a.close();else if("move"==k)a.moveTo(l+Number(c.getAttribute("x"))*n,m+Number(c.getAttribute("y"))*p);else if("line"==k)a.lineTo(l+Number(c.getAttribute("x"))*n,m+Number(c.getAttribute("y"))*p);else if("quad"==k)a.quadTo(l+Number(c.getAttribute("x1"))*n,m+Number(c.getAttribute("y1"))*p,l+Number(c.getAttribute("x2"))*n,m+Number(c.getAttribute("y2"))*p);else if("curve"==k)a.curveTo(l+Number(c.getAttribute("x1"))*n,m+Number(c.getAttribute("y1"))*p,l+Number(c.getAttribute("x2"))*n,m+Number(c.getAttribute("y2"))*p,l+Number(c.getAttribute("x3"))*n,m+Number(c.getAttribute("y3"))*p);else if("arc"==k)a.arcTo(Number(c.getAttribute("rx"))*n,Number(c.getAttribute("ry"))*@@ -1065,8 +1065,8 @@ this.initializeShape(a),this.createCellOverlays(a),this.installListeners(a),a.vinull!=a.shape.indicatorShape&&(a.shape.indicator=new a.shape.indicatorShape,a.shape.indicator.dialect=a.shape.dialect,a.shape.indicator.init(a.node),b=!0));null!=a.shape&&(this.createControl(a),b||this.isShapeInvalid(a,a.shape))&&(null!=a.absolutePoints?(a.shape.points=a.absolutePoints.slice(),a.shape.bounds=null):(a.shape.points=null,a.shape.bounds=new mxRectangle(a.x,a.y,a.width,a.height)),a.shape.scale=a.view.scale,(null==c||c)&&this.doRedrawShape(a),e=!0);return e};mxCellRenderer.prototype.doRedrawShape=function(a){a.shape.redraw()};mxCellRenderer.prototype.isShapeInvalid=function(a,b){return null==b.bounds||b.scale!=a.view.scale||null==a.absolutePoints&&!b.bounds.equals(a)||null!=a.absolutePoints&&!mxUtils.equalPoints(b.points,a.absolutePoints)};mxCellRenderer.prototype.destroy=function(a){null!=a.shape&&(null!=a.text&&(a.text.destroy(),a.text=null),null!=a.overlays&&(a.overlays.visit(function(b,c){c.destroy()}),a.overlays=null),null!=a.control&&(a.control.destroy(),a.control=null),a.shape.destroy(),a.shape=null)};-var mxEdgeStyle={EntityRelation:function(a,b,c,d,e){var f=a.view,g=f.graph;d=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*f.scale;var k=a.absolutePoints,l=k[0],m=k[k.length-1];k=!1;if(null!=b){var n=g.getCellGeometry(b.cell);n.relative?k=.5>=n.x:null!=c&&(k=(null!=m?m.x:c.x+c.width)<(null!=l?l.x:b.x))}if(null!=l)b=new mxCellState,b.x=l.x,b.y=l.y;else if(null!=b){var p=mxUtils.getPortConstraints(b,a,!0,mxConstants.DIRECTION_MASK_NONE);p!=mxConstants.DIRECTION_MASK_NONE&&-p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(k=p==mxConstants.DIRECTION_MASK_WEST)}else return;n=!0;null!=c&&(g=g.getCellGeometry(c.cell),g.relative?n=.5>=g.x:null!=b&&(n=(null!=l?l.x:b.x+b.width)<(null!=m?m.x:c.x)));null!=m?(c=new mxCellState,c.x=m.x,c.y=m.y):null!=c&&(p=mxUtils.getPortConstraints(c,a,!1,mxConstants.DIRECTION_MASK_NONE),p!=mxConstants.DIRECTION_MASK_NONE&&p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(n=p==mxConstants.DIRECTION_MASK_WEST));+var mxEdgeStyle={EntityRelation:function(a,b,c,d,e){var f=a.view,g=f.graph;d=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*f.scale;var k=a.absolutePoints,l=k[0],m=k[k.length-1];k=!1;if(null!=b){var n=g.getCellGeometry(b.cell);null!=n&&n.relative?k=.5>=n.x:null!=c&&(k=(null!=m?m.x:c.x+c.width)<(null!=l?l.x:b.x))}if(null!=l)b=new mxCellState,b.x=l.x,b.y=l.y;else if(null!=b){var p=mxUtils.getPortConstraints(b,a,!0,mxConstants.DIRECTION_MASK_NONE);p!=mxConstants.DIRECTION_MASK_NONE&&+p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(k=p==mxConstants.DIRECTION_MASK_WEST)}else return;n=!0;null!=c&&(g=g.getCellGeometry(c.cell),null!=g&&g.relative?n=.5>=g.x:null!=b&&(n=(null!=l?l.x:b.x+b.width)<(null!=m?m.x:c.x)));null!=m?(c=new mxCellState,c.x=m.x,c.y=m.y):null!=c&&(p=mxUtils.getPortConstraints(c,a,!1,mxConstants.DIRECTION_MASK_NONE),p!=mxConstants.DIRECTION_MASK_NONE&&p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(n=p==mxConstants.DIRECTION_MASK_WEST));null!=b&&null!=c&&(a=k?b.x:b.x+b.width,b=f.getRoutingCenterY(b),l=n?c.x:c.x+c.width,c=f.getRoutingCenterY(c),f=new mxPoint(a+(k?-d:d),b),g=new mxPoint(l+(n?-d:d),c),k==n?(d=k?Math.min(a,l)-d:Math.max(a,l)+d,e.push(new mxPoint(d,b)),e.push(new mxPoint(d,c))):(f.x<g.x==k?(d=b+(c-b)/2,e.push(f),e.push(new mxPoint(f.x,d)),e.push(new mxPoint(g.x,d))):e.push(f),e.push(g)))},Loop:function(a,b,c,d,e){c=a.absolutePoints;var f=c[c.length-1];if(null!=c[0]&&null!=f){if(null!=d&&0<d.length)for(b=0;b<d.length;b++)c=d[b],c=a.view.transformControlPoint(a,c),e.push(new mxPoint(c.x,c.y))}else if(null!=b){f=a.view;var g=f.graph;c=null!=d&&0<d.length?d[0]:null;null!=c&&(c=f.transformControlPoint(a,c),mxUtils.contains(b,c.x,c.y)&&(c=null));var k=d=0,l=0,m=0;g=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,g.gridSize)*f.scale;a=mxUtils.getValue(a.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST);a==mxConstants.DIRECTION_NORTH||a==mxConstants.DIRECTION_SOUTH?(d=f.getRoutingCenterX(b),k=g):(l=f.getRoutingCenterY(b),m=g);null==c||c.x<b.x||c.x>b.x+b.width?null!=c?(d=c.x,m=Math.max(Math.abs(l-c.y),m)):a==mxConstants.DIRECTION_NORTH?l=b.y-2*k:a==mxConstants.DIRECTION_SOUTH?l=b.y+b.height+2*k:d=a==mxConstants.DIRECTION_EAST?b.x-2*m:b.x+b.width+2*m:null!=c&&(d=f.getRoutingCenterX(b),k=Math.max(Math.abs(d-c.x),m),l=c.y,m=0);e.push(new mxPoint(d-k,l-m));e.push(new mxPoint(d+k,l+m))}},ElbowConnector:function(a,b,c,d,e){var f=null!=d&&0<d.length?d[0]:null,g=!1,k=!1;if(null!=b&&null!=c)if(null!=f){var l=Math.min(b.x,c.x),@@ -1133,8 +1133,8 @@ mxGraphView.prototype.stateValidated=function(a){var b=this.graph.getModel().isEmxGraphView.prototype.updateFixedTerminalPoints=function(a,b,c){this.updateFixedTerminalPoint(a,b,!0,this.graph.getConnectionConstraint(a,b,!0));this.updateFixedTerminalPoint(a,c,!1,this.graph.getConnectionConstraint(a,c,!1))};mxGraphView.prototype.updateFixedTerminalPoint=function(a,b,c,d){a.setAbsoluteTerminalPoint(this.getFixedTerminalPoint(a,b,c,d),c)};mxGraphView.prototype.getFixedTerminalPoint=function(a,b,c,d){var e=null;null!=d&&(e=this.graph.getConnectionPoint(b,d,!1));if(null==e&&null==b){b=this.scale;d=this.translate;var f=a.origin;e=this.graph.getCellGeometry(a.cell).getTerminalPoint(c);null!=e&&(e=new mxPoint(b*(d.x+e.x+f.x),b*(d.y+e.y+f.y)))}return e};mxGraphView.prototype.updateBoundsFromStencil=function(a){var b=null;if(null!=a&&null!=a.shape&&null!=a.shape.stencil&&"fixed"==a.shape.stencil.aspect){b=mxRectangle.fromRectangle(a);var c=a.shape.stencil.computeAspect(a.style,a.x,a.y,a.width,a.height);a.setRect(c.x,c.y,a.shape.stencil.w0*c.width,a.shape.stencil.h0*c.height)}return b};-mxGraphView.prototype.updatePoints=function(a,b,c,d){if(null!=a){var e=[];e.push(a.absolutePoints[0]);var f=this.getEdgeStyle(a,b,c,d);if(null!=f){c=this.getTerminalPort(a,c,!0);d=this.getTerminalPort(a,d,!1);var g=this.updateBoundsFromStencil(c),k=this.updateBoundsFromStencil(d);f(a,c,d,b,e);null!=g&&c.setRect(g.x,g.y,g.width,g.height);null!=k&&d.setRect(k.x,k.y,k.width,k.height)}else if(null!=b)for(f=0;f<b.length;f++)null!=b[f]&&(c=mxUtils.clone(b[f]),e.push(this.transformControlPoint(a,c)));b=-a.absolutePoints;e.push(b[b.length-1]);a.absolutePoints=e}};mxGraphView.prototype.transformControlPoint=function(a,b,c){return null!=a&&null!=b?(a=a.origin,c=c?1:this.scale,new mxPoint(c*(b.x+this.translate.x+a.x),c*(b.y+this.translate.y+a.y))):null};+mxGraphView.prototype.updatePoints=function(a,b,c,d){if(null!=a&&null!=a.absolutePoints&&0<a.absolutePoints.length){var e=[];e.push(a.absolutePoints[0]);var f=this.getEdgeStyle(a,b,c,d);if(null!=f){c=this.getTerminalPort(a,c,!0);d=this.getTerminalPort(a,d,!1);var g=this.updateBoundsFromStencil(c),k=this.updateBoundsFromStencil(d);f(a,c,d,b,e);null!=g&&c.setRect(g.x,g.y,g.width,g.height);null!=k&&d.setRect(k.x,k.y,k.width,k.height)}else if(null!=b)for(f=0;f<b.length;f++)null!=b[f]&&(c=mxUtils.clone(b[f]),+e.push(this.transformControlPoint(a,c)));b=a.absolutePoints;e.push(b[b.length-1]);a.absolutePoints=e}};mxGraphView.prototype.transformControlPoint=function(a,b,c){return null!=a&&null!=b?(a=a.origin,c=c?1:this.scale,new mxPoint(c*(b.x+this.translate.x+a.x),c*(b.y+this.translate.y+a.y))):null};mxGraphView.prototype.isLoopStyleEnabled=function(a,b,c,d){var e=this.graph.getConnectionConstraint(a,c,!0),f=this.graph.getConnectionConstraint(a,d,!1);return!(null==b||2>b.length)||mxUtils.getValue(a.style,mxConstants.STYLE_ORTHOGONAL_LOOP,!1)&&(null!=e&&null!=e.point||null!=f&&null!=f.point)?!1:null!=c&&c==d};mxGraphView.prototype.getEdgeStyle=function(a,b,c,d){a=this.isLoopStyleEnabled(a,b,c,d)?mxUtils.getValue(a.style,mxConstants.STYLE_LOOP,this.graph.defaultLoopStyle):mxUtils.getValue(a.style,mxConstants.STYLE_NOEDGESTYLE,!1)?null:a.style[mxConstants.STYLE_EDGE];"string"==typeof a&&(b=mxStyleRegistry.getValue(a),null==b&&this.isAllowEval()&&(b=mxUtils.eval(a)),a=b);return"function"==typeof a?a:null};mxGraphView.prototype.updateFloatingTerminalPoints=function(a,b,c){var d=a.absolutePoints,e=d[0];null==d[d.length-1]&&null!=c&&this.updateFloatingTerminalPoint(a,c,b,!1);null==e&&null!=b&&this.updateFloatingTerminalPoint(a,b,c,!0)};mxGraphView.prototype.updateFloatingTerminalPoint=function(a,b,c,d){a.setAbsoluteTerminalPoint(this.getFloatingTerminalPoint(a,b,c,d),d)};@@ -1222,7 +1222,8 @@ l),Math.round(f.y+q*f.height))]:[new mxPoint(Math.round(f.x+q*f.width),Math.rounmxGraph.prototype.getCurrentCellStyle=function(a,b){b=b?null:this.view.getState(a);return null!=b?b.style:this.getCellStyle(a)};mxGraph.prototype.getCellStyle=function(a,b){b=null!=b?b:!0;var c=this.model.getStyle(a),d=this.model.isEdge(a)?this.stylesheet.getDefaultEdgeStyle():this.stylesheet.getDefaultVertexStyle();null!=c&&0<c.length?d=this.stylesheet.getCellStyle(c,d,b):null!=d&&(d=mxUtils.clone(d));null==d?d={}:b&&(d=this.postProcessCellStyle(a,d));return d};mxGraph.prototype.postProcessCellStyle=function(a,b){if(null!=b){var c=b[mxConstants.STYLE_IMAGE];a=this.getImageFromBundles(c);null!=a?b[mxConstants.STYLE_IMAGE]=a:a=c;null!=a&&"function"===typeof a.substring&&"data:image/"==a.substring(0,11)&&("data:image/svg+xml,<"==a.substring(0,20)?a=a.substring(0,19)+encodeURIComponent(a.substring(19)):"data:image/svg+xml,%3C"!=a.substring(0,22)&&(c=a.indexOf(","),0<c&&";base64,"!=a.substring(c-7,c+1)&&(a=a.substring(0,c)+";base64,"+a.substring(c+1))),b[mxConstants.STYLE_IMAGE]=a)}return b};mxGraph.prototype.setCellStyle=function(a,b){b=b||this.getSelectionCells();if(null!=b){this.model.beginUpdate();try{for(var c=0;c<b.length;c++)this.model.setStyle(b[c],a)}finally{this.model.endUpdate()}}};mxGraph.prototype.toggleCellStyle=function(a,b,c){c=c||this.getSelectionCell();return this.toggleCellStyles(a,b,[c])};-mxGraph.prototype.toggleCellStyles=function(a,b,c){b=null!=b?b:!1;c=c||this.getEditableCells(this.getSelectionCells());var d=null;null!=c&&0<c.length&&(d=this.getCurrentCellStyle(c[0]),d=mxUtils.getValue(d,a,b)?0:1,this.setCellStyles(a,d,c));return d};mxGraph.prototype.setCellStyles=function(a,b,c){c=c||this.getEditableCells(this.getSelectionCells());mxUtils.setCellStyles(this.model,c,a,b)};mxGraph.prototype.toggleCellStyleFlags=function(a,b,c){this.setCellStyleFlags(a,b,null,c)};+mxGraph.prototype.toggleCellStyles=function(a,b,c){b=null!=b?b:!1;c=c||this.getEditableCells(this.getSelectionCells());var d=null;null!=c&&0<c.length&&(d=this.getCurrentCellStyle(c[0]),d=mxUtils.getValue(d,a,b)?0:1,this.setCellStyles(a,d,c));return d};+mxGraph.prototype.setCellStyles=function(a,b,c){c=c||this.getEditableCells(this.getSelectionCells());this.model.beginUpdate();try{mxUtils.setCellStyles(this.model,c,a,b);for(var d=0;d<c.length;d++){var e=this.view.getState(c[d]);null!=e&&null!=e.shape&&e.shape.styleChanged(a,b,e)}}finally{this.model.endUpdate()}};mxGraph.prototype.toggleCellStyleFlags=function(a,b,c){this.setCellStyleFlags(a,b,null,c)};mxGraph.prototype.setCellStyleFlags=function(a,b,c,d){d=d||this.getEditableCells(this.getSelectionCells());null!=d&&0<d.length&&(null==c&&(c=this.getCurrentCellStyle(d[0]),c=(parseInt(c[a]||0)&b)!=b),mxUtils.setCellStyleFlags(this.model,d,a,b,c))};mxGraph.prototype.getOriginForCell=function(a){a=this.model.getParent(a);for(var b=new mxPoint;null!=a;){var c=this.getCellGeometry(a);null==c||c.relative||(b.x+=c.x,b.y+=c.y);a=this.model.getParent(a)}return b};mxGraph.prototype.alignCells=function(a,b,c){null==b&&(b=this.getMovableCells(this.getSelectionCells()));if(null!=b&&1<b.length){if(null==c)for(var d=0;d<b.length;d++){var e=this.getOriginForCell(b[d]),f=this.getCellGeometry(b[d]);if(!this.model.isEdge(b[d])&&null!=f&&!f.relative)if(null==c)if(a==mxConstants.ALIGN_CENTER){c=e.x+f.x+f.width/2;break}else if(a==mxConstants.ALIGN_RIGHT)c=e.x+f.x+f.width;else if(a==mxConstants.ALIGN_TOP)c=e.y+f.y;else if(a==mxConstants.ALIGN_MIDDLE){c=e.y+f.y+f.height/2;break}else c=a==mxConstants.ALIGN_BOTTOM?e.y+f.y+f.height:e.x+f.x;else c=a==mxConstants.ALIGN_RIGHT?Math.max(c,e.x+f.x+f.width):a==mxConstants.ALIGN_TOP?Math.min(c,e.y+f.y):a==mxConstants.ALIGN_BOTTOM?Math.max(c,e.y+f.y+f.height):Math.min(c,e.x+f.x)}if(null!=c){b=mxUtils.sortCells(b);this.model.beginUpdate();try{for(d=0;d<b.length;d++)e=this.getOriginForCell(b[d]),f=this.getCellGeometry(b[d]),this.model.isEdge(b[d])||null==f||f.relative||(f=f.clone(),a==mxConstants.ALIGN_CENTER?f.x=c-e.x-f.width/@@ -1885,7 +1886,7 @@ mxObjectCodec.prototype.afterEncode=function(a,b,c){return c};mxObjectCodec.protmxObjectCodec.prototype.decodeAttributes=function(a,b,c){b=b.attributes;if(null!=b)for(var d=0;d<b.length;d++)this.decodeAttribute(a,b[d],c)};mxObjectCodec.prototype.isIgnoredAttribute=function(a,b,c){return"as"==b.nodeName||"id"==b.nodeName||"function"===typeof c[b.nodeName]};mxObjectCodec.prototype.decodeAttribute=function(a,b,c){if(!this.isIgnoredAttribute(a,b,c)){var d=b.nodeName;b=this.convertAttributeFromXml(a,b,c);var e=this.getFieldName(d);if(this.isReference(c,e,b,!1)){a=a.getObject(b);if(null==a){mxLog.warn("mxObjectCodec.decode: No object for "+this.getName()+"."+d+"="+b);return}b=a}this.isExcluded(c,d,b,!1)||(c[d]=b)}};mxObjectCodec.prototype.decodeChildren=function(a,b,c){for(b=b.firstChild;null!=b;){var d=b.nextSibling;b.nodeType!=mxConstants.NODETYPE_ELEMENT||this.processInclude(a,b,c)||this.decodeChild(a,b,c);b=d}};-mxObjectCodec.prototype.decodeChild=function(a,b,c){var d=this.getFieldName(b.getAttribute("as"));if(null==d||!this.isExcluded(c,d,b,!1)){var e=this.getFieldTemplate(c,d,b);"add"==b.nodeName?(a=b.getAttribute("value"),null==a&&mxObjectCodec.allowEval&&(a=mxUtils.eval(mxUtils.getTextContent(b)))):a=a.decode(b,e);try{this.addObjectValue(c,d,a,e)}catch(f){throw Error(f.message+" for "+b.nodeName);}}};+mxObjectCodec.prototype.decodeChild=function(a,b,c){var d=this.getFieldName(b.getAttribute("as"));if(null==d||!this.isExcluded(c,d,b,!1)){var e=this.getFieldTemplate(c,d,b);"add"==b.nodeName?(a=b.getAttribute("value"),null==a&&mxObjectCodec.allowEval&&(a=mxUtils.eval(mxUtils.getTextContent(b)))):a=a.decode(b,e);try{this.addObjectValue(c,d,a,e)}catch(f){throw Error(f.message+" "+b.nodeName+(null!=d?" as "+d:""));}}};mxObjectCodec.prototype.getFieldTemplate=function(a,b,c){a=a[b];a instanceof Array&&0<a.length&&(a=null);return a};mxObjectCodec.prototype.addObjectValue=function(a,b,c,d){if(null!=c&&c!=d)if(null!=b&&0<b.length)a[b]=c;else if(a.constructor===Array)a.push(c);else throw Error("Could not add object");};mxObjectCodec.prototype.processInclude=function(a,b,c){if("include"==b.nodeName){b=b.getAttribute("name");if(null!=b)try{var d=mxUtils.load(b).getDocumentElement();null!=d&&a.decode(d,c)}catch(e){}return!0}return!1};mxObjectCodec.prototype.beforeDecode=function(a,b,c){return b};mxObjectCodec.prototype.afterDecode=function(a,b,c){return c};mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]);a.isCellCodec=function(){return!0};a.isNumericAttribute=function(b,c,d){return"value"!==c.nodeName&&mxObjectCodec.prototype.isNumericAttribute.apply(this,arguments)};a.isExcluded=function(b,c,d,e){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||e&&"value"==c&&mxUtils.isNode(d)};a.afterEncode=function(b,c,d){if(null!=c.value&&mxUtils.isNode(c.value)){var e=@@ -2101,7 +2102,10 @@ EditorUi.prototype.hsplitClickEnabled=!1;EditorUi.prototype.updateDefaultStyle=!EditorUi.prototype.init=function(){var a=this.editor.graph;if(!a.standalone){"0"!=urlParams["shape-picker"]&&this.installShapePicker();mxEvent.addListener(a.container,"scroll",mxUtils.bind(this,function(){a.tooltipHandler.hide();null!=a.connectionHandler&&null!=a.connectionHandler.constraintHandler&&a.connectionHandler.constraintHandler.reset()}));a.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){a.tooltipHandler.hide();var f=a.getRubberband();null!=f&&f.cancel()}));mxEvent.addListener(a.container,"keydown",mxUtils.bind(this,function(f){this.onKeyDown(f)}));mxEvent.addListener(a.container,"keypress",mxUtils.bind(this,function(f){this.onKeyPress(f)}));this.addUndoListener();this.addBeforeUnloadListener();a.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()}));a.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()}));var b=a.setDefaultParent,e=this;this.editor.graph.setDefaultParent=function(){b.apply(this,arguments);e.updateActionStates()};a.showLinkDialog=mxUtils.bind(e,e.showLinkDialog);a.editLink=e.actions.get("editLink").funct;this.updateActionStates();this.initClipboard();this.initCanvas();null!=this.format&&this.format.init()}};EditorUi.prototype.clearSelectionState=function(){this.selectionState=null};EditorUi.prototype.getSelectionState=function(){null==this.selectionState&&(this.selectionState=this.createSelectionState());return this.selectionState};-EditorUi.prototype.createSelectionState=function(){for(var a=this.editor.graph,b=a.getSelectionCells(),e=this.initSelectionState(),f=!0,g=0;g<b.length;g++){var d=a.getCurrentCellStyle(b[g]);"0"!=mxUtils.getValue(d,mxConstants.STYLE_EDITABLE,"1")&&(this.updateSelectionStateForCell(e,b[g],b,f),f=!1)}this.updateSelectionStateForTableCells(e);return e};+EditorUi.prototype.createSelectionState=function(){for(var a=this.editor.graph,b=a.getSelectionCells(),e=this.initSelectionState(),f=!0,g=0;g<b.length;g++){var d=a.getCurrentCellStyle(b[g]);"0"!=mxUtils.getValue(d,mxConstants.STYLE_EDITABLE,"1")&&(this.updateSelectionStateForCell(e,b[g],b,f),f=!1)}this.updateSelectionStateForTableCells(e);if(Editor.enableCustomProperties&&null!=this.format){e.customProperties={};a=e.vertices;b=e.edges;for(g=0;g<a.length;g++)this.findCommonProperties(a[g],e.customProperties,+0==g,e);for(g=0;g<b.length;g++)this.findCommonProperties(b[g],e.customProperties,0==a.length&&0==g,e)}return e};+EditorUi.prototype.findCommonProperties=function(a,b,e,f){if(null!=b){var g=mxUtils.bind(this,function(h){if(null!=h)if(e)for(var m=0;m<h.length;m++){if("function"!==typeof h[m].isVisible||h[m].isVisible(f,this.format))b[h[m].name]=h[m]}else for(var q in b){var k=!1;for(m=0;m<h.length;m++)if(h[m].name==q&&h[m].type==b[q].type){k=!0;break}k||delete b[q]}}),d=this.editor.graph.view.getState(a);null!=d&&null!=d.shape&&(d.shape.commonCustomPropAdded||(d.shape.commonCustomPropAdded=!0,d.shape.customProperties=+d.shape.customProperties||[],d.cell.vertex?Array.prototype.push.apply(d.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(d.shape.customProperties,Editor.commonEdgeProperties)),g(d.shape.customProperties));a=a.getAttribute("customProperties");if(null!=a)try{g(JSON.parse(a))}catch(h){}}};EditorUi.prototype.initSelectionState=function(){return{vertices:[],edges:[],cells:[],x:null,y:null,width:null,height:null,style:{},containsImage:!1,containsLabel:!1,fill:!0,glass:!0,html:!0,rounded:!0,autoSize:!1,image:!1,shadow:!0,lineJumps:!0,resizable:!0,table:!1,cell:!1,row:!1,movable:!0,rotatable:!0,stroke:!0,swimlane:!1,unlocked:this.editor.graph.isEnabled(),connections:!1}};EditorUi.prototype.updateSelectionStateForTableCells=function(a){if(1<a.cells.length&&a.cell){var b=mxUtils.sortCells(a.cells),e=this.editor.graph.model,f=e.getParent(b[0]),g=e.getParent(f);if(null!=f&&null!=g){for(var d=f.getIndex(b[0]),h=g.getIndex(f),m=null,q=1,k=1,u=0,w=h<g.getChildCount()-1?e.getChildAt(e.getChildAt(g,h+1),d):null;u<b.length-1;){var z=b[++u];null==w||w!=z||null!=m&&q!=m||(m=q,q=0,k++,f=e.getParent(w),w=h+k<g.getChildCount()?e.getChildAt(e.getChildAt(g,h+k),d):null);var C=this.editor.graph.view.getState(z);if(z==e.getChildAt(f,d+q)&&null!=C&&1==mxUtils.getValue(C.style,"colspan",1)&&1==mxUtils.getValue(C.style,"rowspan",1))q++;else break}u==k*q-1&&(a.mergeCell=b[0],a.colspan=q,a.rowspan=k)}}};EditorUi.prototype.windowResized=function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor.graph&&this.editor.graph.sizeDidChange()}),0)};@@ -2374,10 +2378,10 @@ this.createVertexTemplateEntry("html=1;whiteSpace=wrap;shape=isoCube2;background120,20,"","Horizontal Crossbar",!1,null,"crossbar distance measure dimension unit"),this.createVertexTemplateEntry("shape=crossbar;whiteSpace=wrap;html=1;rounded=1;direction=south;",20,120,"","Vertical Crossbar",!1,null,"crossbar distance measure dimension unit"),this.createVertexTemplateEntry("shape=image;html=1;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=1;aspect=fixed;image="+this.gearImage,52,61,"","Image (Fixed Aspect)",!1,null,"fixed image icon symbol"),this.createVertexTemplateEntry("shape=image;html=1;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;image="+this.gearImage,50,60,"","Image (Variable Aspect)",!1,null,"strechted image icon symbol"),this.createVertexTemplateEntry("icon;html=1;image="+this.gearImage,60,60,"Icon","Icon",!1,null,"icon image symbol"),this.createVertexTemplateEntry("label;whiteSpace=wrap;html=1;image="+this.gearImage,140,60,"Label","Label 1",null,null,"label image icon symbol"),this.createVertexTemplateEntry("label;whiteSpace=wrap;html=1;align=center;verticalAlign=bottom;spacingLeft=0;spacingBottom=4;imageAlign=center;imageVerticalAlign=top;image="+this.gearImage,120,80,"Label","Label 2",null,null,"label image icon symbol"),this.addEntry("shape group container",function(){var f=new mxCell("Label",new mxGeometry(0,0,160,70),"html=1;whiteSpace=wrap;container=1;recursiveResize=0;collapsible=0;");f.vertex=!0;var g=new mxCell("",new mxGeometry(20,20,20,30),"triangle;html=1;whiteSpace=wrap;");g.vertex=!0;f.insert(g);return b.createVertexTemplateFromCells([f],f.geometry.width,f.geometry.height,"Shape Group")}),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;left=0;right=0;fillColor=none;",-120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;bottom=0;top=0;fillColor=none;",120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;bottom=0;right=0;fillColor=none;",120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;bottom=1;right=1;left=1;top=0;fillColor=none;routingCenterX=-0.5;",120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=waypoint;sketch=0;fillStyle=solid;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;rotatable=0;perimeter=centerPerimeter;snapToPoint=1;",-20,20,"","Waypoint"),this.createEdgeTemplateEntry("edgeStyle=segmentEdgeStyle;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;",50,50,"","Manual Line",null,"line lines connector connectors connection connections arrow arrows manual"),this.createEdgeTemplateEntry("shape=filledEdge;curved=0;rounded=0;fixDash=1;endArrow=none;strokeWidth=10;fillColor=#ffffff;edgeStyle=orthogonalEdgeStyle;html=1;",60,40,"","Filled Edge"),this.createEdgeTemplateEntry("edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;",-50,50,"","Horizontal Elbow",null,"line lines connector connectors connection connections arrow arrows elbow horizontal"),this.createEdgeTemplateEntry("edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;",50,50,"","Vertical Elbow",null,"line lines connector connectors connection connections arrow arrows elbow vertical")];this.addPaletteFunctions("misc",mxResources.get("misc"),null!=a?a:!0,e);this.setCurrentSearchEntryLibrary()};-Sidebar.prototype.addAdvancedPalette=function(a){this.setCurrentSearchEntryLibrary("general","advanced");this.addPaletteFunctions("advanced",mxResources.get("advanced"),null!=a?a:!1,this.createAdvancedShapes());this.setCurrentSearchEntryLibrary()};+120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;bottom=0;top=0;fillColor=none;",120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;bottom=0;right=0;fillColor=none;",120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;bottom=1;right=1;left=1;top=0;fillColor=none;routingCenterX=-0.5;",120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;fontColor=#000000;darkOpacity=0.05;fillColor=#FFF9B2;strokeColor=none;fillStyle=solid;direction=west;gradientDirection=north;gradientColor=#FFF2A1;shadow=1;size=20;pointerEvents=1;",+140,160,"",mxResources.get("note")),this.createVertexTemplateEntry("shape=waypoint;sketch=0;fillStyle=solid;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;rotatable=0;perimeter=centerPerimeter;snapToPoint=1;",20,20,"","Waypoint"),this.createEdgeTemplateEntry("edgeStyle=segmentEdgeStyle;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;",50,50,"","Manual Line",null,"line lines connector connectors connection connections arrow arrows manual"),this.createEdgeTemplateEntry("shape=filledEdge;curved=0;rounded=0;fixDash=1;endArrow=none;strokeWidth=10;fillColor=#ffffff;edgeStyle=orthogonalEdgeStyle;html=1;",+60,40,"","Filled Edge"),this.createEdgeTemplateEntry("edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;",50,50,"","Horizontal Elbow",null,"line lines connector connectors connection connections arrow arrows elbow horizontal"),this.createEdgeTemplateEntry("edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;",50,50,"","Vertical Elbow",null,"line lines connector connectors connection connections arrow arrows elbow vertical")];+this.addPaletteFunctions("misc",mxResources.get("misc"),null!=a?a:!0,e);this.setCurrentSearchEntryLibrary()};Sidebar.prototype.addAdvancedPalette=function(a){this.setCurrentSearchEntryLibrary("general","advanced");this.addPaletteFunctions("advanced",mxResources.get("advanced"),null!=a?a:!1,this.createAdvancedShapes());this.setCurrentSearchEntryLibrary()};Sidebar.prototype.addBasicPalette=function(a){this.setCurrentSearchEntryLibrary("basic");this.addStencilPalette("basic",mxResources.get("basic"),a+"/basic.xml",";whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#000000;strokeWidth=2",null,null,null,null,[this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;top=0;bottom=0;fillColor=none;",120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;right=0;top=0;bottom=0;fillColor=none;routingCenterX=-0.5;",120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;bottom=0;right=0;fillColor=none;",120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;top=0;left=0;fillColor=none;",120,60,"","Partial Rectangle")]);this.setCurrentSearchEntryLibrary()};Sidebar.prototype.createAdvancedShapes=function(){var a=this,b=new mxCell("List Item",new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;");b.vertex=!0;return[this.createVertexTemplateEntry("shape=tapeData;whiteSpace=wrap;html=1;perimeter=ellipsePerimeter;",80,80,"","Tape Data"),this.createVertexTemplateEntry("shape=manualInput;whiteSpace=wrap;html=1;",@@ -2459,7 +2463,7 @@ q.x=(m.x-d.translate.x)/d.scale,q.y=(m.y-d.translate.y)/d.scale),d=g.defaultEdgef.width,f.y),!1)):e==mxConstants.DIRECTION_SOUTH?(f.height=d,f.y=q.y+q.height,f.setTerminalPoint(new mxPoint(f.x,f.y+f.height),!1)):e==mxConstants.DIRECTION_WEST&&(f.width=d,f.x=q.x-d,f.setTerminalPoint(new mxPoint(f.x,f.y),!1))):(!h&&45<f.width&&45<f.height&&45<q.width&&45<q.height&&(f.width*=q.height/f.height,f.height=q.height),f.x=q.x+q.width/2-f.width/2,f.y=q.y+q.height/2-f.height/2,e==mxConstants.DIRECTION_NORTH?f.y=f.y-q.height/2-f.height/2-d:e==mxConstants.DIRECTION_EAST?f.x=f.x+q.width/2+f.width/2+d:e==mxConstants.DIRECTION_SOUTH?f.y=f.y+q.height/2+f.height/2+d:e==mxConstants.DIRECTION_WEST&&(f.x=f.x-q.width/2-f.width/2-d),g.model.isEdge(b)&&null!=f.getTerminalPoint(!0)&&null!=b.getTerminal(!1)&&(q=g.getCellGeometry(b.getTerminal(!1)),null!=q&&(e==mxConstants.DIRECTION_NORTH?(f.x-=q.getCenterX(),f.y-=q.getCenterY()+q.height/2):e==mxConstants.DIRECTION_EAST?(f.x-=q.getCenterX()-q.width/2,f.y-=q.getCenterY()):e==mxConstants.DIRECTION_SOUTH?(f.x-=q.getCenterX(),f.y-=q.getCenterY()-q.height/2):e==mxConstants.DIRECTION_WEST&&(f.x-=q.getCenterX()+q.width/2,f.y-=q.getCenterY()))))));return f};Sidebar.prototype.isDropStyleEnabled=function(a,b){var e=!0;null!=b&&1==a.length&&(a=this.graph.getCellStyle(a[b]),null!=a&&(e=mxUtils.getValue(a,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!=mxConstants.NONE||mxUtils.getValue(a,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE)!=mxConstants.NONE));return e};-Sidebar.prototype.isDropStyleTargetIgnored=function(a){return this.graph.isSwimlane(a.cell)||this.graph.isTableCell(a.cell)||this.graph.isTableRow(a.cell)||this.graph.isTable(a.cell)};Sidebar.prototype.disablePointerEvents=function(a){mxUtils.visitNodes(a,mxUtils.bind(this,function(b){b.nodeType==mxConstants.NODETYPE_ELEMENT&&(b.style.pointerEvents="none",b.removeAttribute("pointer-events"))}))};+Sidebar.prototype.isDropStyleTargetIgnored=function(a){return this.graph.isSwimlane(a.cell)||this.graph.isTableCell(a.cell)||this.graph.isTableRow(a.cell)||this.graph.isTable(a.cell)};Sidebar.prototype.disablePointerEvents=function(a){mxUtils.visitNodes(a,mxUtils.bind(this,function(b){b.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=b.style&&(b.style.pointerEvents="none",b.removeAttribute("pointer-events"))}))};Sidebar.prototype.createDragSource=function(a,b,e,f,g,d){function h(ma,ya){var za=mxUtils.createImage(ma.src);za.style.width=ma.width+"px";za.style.height=ma.height+"px";null!=ya&&za.setAttribute("title",ya);mxUtils.setOpacity(za,ma==this.refreshTarget?30:20);za.style.position="absolute";za.style.cursor="crosshair";return za}function m(ma,ya,za,Ka){null!=Ka.parentNode&&(mxUtils.contains(za,ma,ya)?(mxUtils.setOpacity(Ka,100),M=Ka):mxUtils.setOpacity(Ka,Ka==O?30:20));return za}var q=this.editorUi,k=q.editor.graph,u=null,w=null,z=this;d=0;for(var C=this.livePreview,D=0;D<f.length&&C;D++)d+=k.model.getDescendants(f[D]).length,C=d<k.graphHandler.maxLivePreview;for(D=0;D<f.length&&(null==w&&k.model.isVertex(f[D])?w=D:null==u&&k.model.isEdge(f[D])&&null==k.model.getTerminal(f[D],!0)&&(u=D),null==w||null==u);D++);var E=this.isDropStyleEnabled(f,w),G=mxUtils.makeDraggable(a,k,mxUtils.bind(this,function(ma,ya,za,Ka,Pa){null!=this.updateThread&&window.clearTimeout(this.updateThread);if(null!=f&&null!=L&&M==O){var Ia=ma.isCellSelected(L.cell)?ma.getSelectionCells():[L.cell];ma.updateShapes(ma.model.isEdge(L.cell)?f[0]:f[w],Ia,!0);ma.setSelectionCells(Ia)}else null!=f&&null!=M&&null!=J&&M!=O?(Ia=ma.model.isEdge(J.cell)||null==u?w:u,ma.setSelectionCells(this.dropAndConnect(J.cell,f,ta,Ia,ya,w,u))):b.apply(this,arguments);null!=this.editorUi.hoverIcons&&this.editorUi.hoverIcons.update(ma.view.getState(ma.getSelectionCell()))}),e,0,0,k.autoscroll,!0,!0);C&&(G.createDragElement=mxUtils.bind(this,function(){return G.createPreviewElement(this.graph)}),@@ -3088,8 +3092,8 @@ U=Math.min(999,Math.max(1,isNaN(U)?1:U));if(U!=mxUtils.getValue(g.style,"width",this.addKeyHandler(u,E);this.addKeyHandler(w,E);var z=this.createPanel();z.style.paddingBottom="30px";h=document.createElement("div");h.style.position="absolute";h.style.width="70px";h.style.marginTop="4px";mxUtils.write(h,mxResources.get("lineend"));z.appendChild(h);var C=this.addUnitInput(z,this.getUnit(),87,52,function(){J.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit()),D=this.addUnitInput(z,this.getUnit(),16,52,function(){T.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());mxUtils.br(z);this.addLabel(z,mxResources.get("left"),87,64);this.addLabel(z,mxResources.get("top"),16,64);a.appendChild(z);this.addKeyHandler(C,E);this.addKeyHandler(D,E);var E=mxUtils.bind(this,function(L,U,V){g=e.getSelectionState();L=g.cells[0];if("link"==g.style.shape||"flexArrow"==g.style.shape){if(d.style.display="",V||document.activeElement!=m)V=mxUtils.getValue(g.style,"width",mxCellRenderer.defaultShapes.flexArrow.prototype.defaultWidth),m.value=V+" pt"}else d.style.display="none";1==g.cells.length&&f.model.isEdge(L)?(V=f.model.getGeometry(L),null!=V&&null!=V.sourcePoint&&null==f.model.getTerminal(L,!0)?(u.value=this.inUnit(V.sourcePoint.x)+" "+this.getUnit(),w.value=this.inUnit(V.sourcePoint.y)+" "+this.getUnit()):k.style.display="none",null!=V&&null!=V.targetPoint&&null==f.model.getTerminal(L,!1)?(C.value=this.inUnit(V.targetPoint.x)+" "+this.getUnit(),D.value=this.inUnit(V.targetPoint.y)+" "+this.getUnit()):z.style.display="none"):(k.style.display="none",z.style.display=-"none")});var G=this.addEdgeGeometryHandler(u,function(L,U){L.sourcePoint.x=b.fromUnit(U)});var I=this.addEdgeGeometryHandler(w,function(L,U){L.sourcePoint.y=b.fromUnit(U)});var J=this.addEdgeGeometryHandler(C,function(L,U){L.targetPoint.x=b.fromUnit(U)});var T=this.addEdgeGeometryHandler(D,function(L,U){L.targetPoint.y=b.fromUnit(U)});f.getModel().addListener(mxEvent.CHANGE,E);this.listeners.push({destroy:function(){f.getModel().removeListener(E)}});E()};-TextFormatPanel=function(a,b,e){BaseFormatPanel.call(this,a,b,e);this.init()};mxUtils.extend(TextFormatPanel,BaseFormatPanel);TextFormatPanel.prototype.init=function(){this.container.appendChild(this.addFont(this.createPanel()));this.container.appendChild(this.addFontOps(this.createPanel()))};TextFormatPanel.prototype.addFontOps=function(a){0==this.addActions(a,["removeFormat"])&&(a.style.display="none");return a};+"none")});var G=this.addEdgeGeometryHandler(u,function(L,U){null!=L.sourcePoint&&(L.sourcePoint.x=b.fromUnit(U))});var I=this.addEdgeGeometryHandler(w,function(L,U){null!=L.sourcePoint&&(L.sourcePoint.y=b.fromUnit(U))});var J=this.addEdgeGeometryHandler(C,function(L,U){null!=L.targetPoint&&(L.targetPoint.x=b.fromUnit(U))});var T=this.addEdgeGeometryHandler(D,function(L,U){null!=L.targetPoint&&(L.targetPoint.y=b.fromUnit(U))});f.getModel().addListener(mxEvent.CHANGE,E);this.listeners.push({destroy:function(){f.getModel().removeListener(E)}});+E()};TextFormatPanel=function(a,b,e){BaseFormatPanel.call(this,a,b,e);this.init()};mxUtils.extend(TextFormatPanel,BaseFormatPanel);TextFormatPanel.prototype.init=function(){this.container.appendChild(this.addFont(this.createPanel()));this.container.appendChild(this.addFontOps(this.createPanel()))};TextFormatPanel.prototype.addFontOps=function(a){0==this.addActions(a,["removeFormat"])&&(a.style.display="none");return a};TextFormatPanel.prototype.addFont=function(a){function b(p){p=null!=p?p.fontSize:null;return null!=p&&"px"==p.substring(p.length-2)?parseFloat(p):mxConstants.DEFAULT_FONTSIZE}function e(p,A){if(null!=p&&""!=p.textContent){p.style.lineHeight="";var B=mxUtils.getCurrentStyle(p);parseFloat(B.fontSize)*A/100!=parseFloat(B.lineHeight)?p.style.lineHeight=A+"%":""==p.getAttribute("style")&&p.removeAttribute("style")}}function f(p,A){A?p.classList.add("geActiveItem"):p.classList.remove("geActiveItem")}var g=this.editorUi,d=g.editor.graph,h=g.getSelectionState(),m=this.createTitle(mxResources.get("font"));a.appendChild(m);m=this.createPanel();m.className="geFormatEntry";if(d.cellEditor.isContentEditing()){var q=m.cloneNode(),k=g.toolbar.addMenu(g.menus.get("formatBlock"),mxResources.get("style"),null,q);this.addArrow(k);k.style.margin="0px";k.style.position="relative";k.classList.add("geFullWidthElement");a.appendChild(q)}a.appendChild(m);q=this.createPanel();var u=g.toolbar.addMenu(g.menus.get("fontFamily"),"Helvetica",null,m);this.addArrow(u);u.style.margin="0px";u.style.position="relative";u.classList.add("geFullWidthElement");k=m.cloneNode(!1);var w=g.toolbar.addItems(["bold","italic","underline"],k,!0,[Editor.boldImage,Editor.italicImage,Editor.underlineImage]);w[0].setAttribute("title",mxResources.get("bold")+" ("+g.actions.get("bold").shortcut+")");w[1].setAttribute("title",mxResources.get("italic")+" ("+g.actions.get("italic").shortcut+")");w[2].setAttribute("title",mxResources.get("underline")+@@ -3134,13 +3138,13 @@ za)p=parseFloat(mxUtils.getValue(h.style,mxConstants.STYLE_SPACING_TOP,0)),za.vamxConstants.STYLE_SPACING_LEFT,0)),Pa.value=isNaN(p)?"":this.inUnit(p)+" "+this.getUnit()});var cb=this.installInputHandler(Ka,mxConstants.STYLE_SPACING,2,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var fb=this.installInputHandler(za,mxConstants.STYLE_SPACING_TOP,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var pb=this.installInputHandler(Ha,mxConstants.STYLE_SPACING_RIGHT,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var gb=this.installInputHandler(Ia,mxConstants.STYLE_SPACING_BOTTOM,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var ab=this.installInputHandler(Pa,mxConstants.STYLE_SPACING_LEFT,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);this.addKeyHandler(sa,Wa);this.addKeyHandler(Ka,Wa);this.addKeyHandler(za,Wa);this.addKeyHandler(Ha,Wa);this.addKeyHandler(Ia,Wa);this.addKeyHandler(Pa,Wa);d.getModel().addListener(mxEvent.CHANGE,Wa);this.listeners.push({destroy:function(){d.getModel().removeListener(Wa)}});Wa();if(d.cellEditor.isContentEditing()){var hb=null,eb=!1;m=mxUtils.bind(this,function(){eb||(eb=!0,window.setTimeout(mxUtils.bind(this,function(){var p=d.getSelectedEditingElement();if(null!=p&&null!=d.cellEditor.textarea){var A=function(Aa,Ga){if(null!=Aa&&null!=Ga){if(Aa==Ga)return!0;if(Aa.length>Ga.length+1)return Aa.substring(Aa.length-Ga.length-1,Aa.length)=="-"+Ga}return!1},B=function(Aa){if(null!=d.getParentByName(p,Aa,d.cellEditor.textarea))return!0;for(var Ga=p;null!=Ga&&1==Ga.childNodes.length;)if(Ga=Ga.childNodes[0],Ga.nodeName==Aa)return!0;-return!1},F=function(Aa){for(;null!=Aa&&Aa!=d.cellEditor.textarea;){if("block"==mxUtils.getCurrentStyle(Aa).display)return Aa;Aa=Aa.parentNode}return null},K=mxUtils.getCurrentStyle(p),R=p==d.cellEditor.textarea||""==p.style.lineHeight?null:p.style.lineHeight,Z=p==d.cellEditor.textarea||""==p.style.fontSize?null:b(K);if(window.getSelection)for(var ha=p.getElementsByTagName("*"),fa=window.getSelection(),ia=0;ia<ha.length&&(!fa.containsNode(ha[ia],!0)||(null==Z&&""!=ha[ia].style.fontSize&&(Z=parseFloat(ha[ia].style.fontSize)),-null==R&&""!=ha[ia].style.lineHeight&&(R=ha[ia].style.lineHeight),null==Z||null==R));ia++);null==Z&&(Z=b(K));if(null==R)for(ha=p;null!=ha&&ha!=d.cellEditor.textarea.parentNode;){if(null!=ha.style&&""!=ha.style.lineHeight){R=ha.style.lineHeight;break}ha=ha.parentNode}if(null!=K){f(w[0],"bold"==K.fontWeight||400<K.fontWeight||B("B")||B("STRONG"));f(w[1],"italic"==K.fontStyle||B("I")||B("EM"));f(w[2],"underline"==K.textDecorationLine||B("U"));f(U,"line-through"==K.textDecorationLine||B("STRIKE"));f(X,-B("SUP"));f(O,B("SUB"));var va=F(p);if(null!=va){B=function(Aa,Ga){Na.push({name:Aa,dispName:Ga,type:"string",getValue:function(){return Ma[Aa]},valueChanged:function(wa,ua){var Xa=va.style,Qa=wa;parseInt(Qa)==Qa&&(Qa+="px",null!=ua&&(ua.value=Qa));Xa[Aa]=Qa;""==wa&&null!=ua&&(ua.value=Ma[Aa])}})};var Ma=mxUtils.getCurrentStyle(va),Na=[];B("paddingTop","Padding Top");B("paddingRight","Padding Right");B("paddingLeft","Padding Left");B("paddingBottom","Padding Bottom");B("marginTop","Margin Top");B("marginRight",-"Margin Right");B("marginLeft","Margin Left");B("marginBottom","Margin Bottom");B=this.createPanel();this.addProperties(B,Na,h,!0);null!=hb?hb.parentNode.replaceChild(B,hb):a.appendChild(B);hb=B}d.cellEditor.isTableSelected()?(f(W,A(K.textAlign,"justify")),f(E,A(K.textAlign,"left")),f(G,A(K.textAlign,"center")),f(I,A(K.textAlign,"right"))):(B=d.cellEditor.align||mxUtils.getValue(h.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),A(K.textAlign,"justify")?(f(W,A(K.textAlign,"justify")),f(E,!1),-f(G,!1),f(I,!1)):(f(W,!1),f(E,B==mxConstants.ALIGN_LEFT),f(G,B==mxConstants.ALIGN_CENTER),f(I,B==mxConstants.ALIGN_RIGHT)));V=d.getParentByName(p,"TABLE",d.cellEditor.textarea);N=null==V?null:d.getParentByName(p,"TR",V);Q=null==V?null:d.getParentByNames(p,["TD","TH"],V);Va.style.display=null!=V?"":"none";document.activeElement!=sa&&(sa.value=isNaN(Z)?"":Z+" "+Editor.fontSizeUnit,"string"===typeof R&&0<R.indexOf("%")?Da.value=R.replace("%"," %"):(A=parseFloat(R),isNaN(A)?Da.value="120 %":Da.value=-Math.round(100*A)+" %"));null!=ba&&(la=d.getTextColor(p,!0),ba(la,!0));null!=Y&&(P=d.getTextColor(p,!1),Y(P,!0));g.toolbar.setMenuText(u,mxUtils.getCssFontFamily(K.fontFamily))}}eb=!1}),0))});(mxClient.IS_FF||mxClient.IS_EDGE||mxClient.IS_IE||mxClient.IS_IE11)&&mxEvent.addListener(d.cellEditor.textarea,"DOMSubtreeModified",m);mxEvent.addListener(d.cellEditor.textarea,"input",m);mxEvent.addListener(d.cellEditor.textarea,"touchend",m);mxEvent.addListener(d.cellEditor.textarea,"mouseup",m);mxEvent.addListener(d.cellEditor.textarea,-"keyup",m);this.listeners.push({destroy:function(){}});m()}return a};StyleFormatPanel=function(a,b,e){BaseFormatPanel.call(this,a,b,e);this.init()};mxUtils.extend(StyleFormatPanel,BaseFormatPanel);+return!1},F=function(Aa){for(;null!=Aa&&Aa!=d.cellEditor.textarea;){if("block"==mxUtils.getCurrentStyle(Aa).display)return Aa;Aa=Aa.parentNode}return null},K=mxUtils.getCurrentStyle(p),R=p==d.cellEditor.textarea||""==p.style.lineHeight?null:p.style.lineHeight,Z=p==d.cellEditor.textarea||""==p.style.fontSize?null:b(K);if(window.getSelection)for(var ha=p.getElementsByTagName("*"),fa=window.getSelection(),ia=0;ia<ha.length&&(!fa.containsNode(ha[ia],!0)||null==ha[ia].style||(null==Z&&""!=ha[ia].style.fontSize&&+(Z=parseFloat(ha[ia].style.fontSize)),null==R&&""!=ha[ia].style.lineHeight&&(R=ha[ia].style.lineHeight),null==Z||null==R));ia++);null==Z&&(Z=b(K));if(null==R)for(ha=p;null!=ha&&ha!=d.cellEditor.textarea.parentNode;){if(null!=ha.style&&""!=ha.style.lineHeight){R=ha.style.lineHeight;break}ha=ha.parentNode}if(null!=K){f(w[0],"bold"==K.fontWeight||400<K.fontWeight||B("B")||B("STRONG"));f(w[1],"italic"==K.fontStyle||B("I")||B("EM"));f(w[2],"underline"==K.textDecorationLine||B("U"));f(U,"line-through"==+K.textDecorationLine||B("STRIKE"));f(X,B("SUP"));f(O,B("SUB"));var va=F(p);if(null!=va){B=function(Aa,Ga){Na.push({name:Aa,dispName:Ga,type:"string",getValue:function(){return Ma[Aa]},valueChanged:function(wa,ua){var Xa=va.style,Qa=wa;parseInt(Qa)==Qa&&(Qa+="px",null!=ua&&(ua.value=Qa));Xa[Aa]=Qa;""==wa&&null!=ua&&(ua.value=Ma[Aa])}})};var Ma=mxUtils.getCurrentStyle(va),Na=[];B("paddingTop","Padding Top");B("paddingRight","Padding Right");B("paddingLeft","Padding Left");B("paddingBottom","Padding Bottom");+B("marginTop","Margin Top");B("marginRight","Margin Right");B("marginLeft","Margin Left");B("marginBottom","Margin Bottom");B=this.createPanel();this.addProperties(B,Na,h,!0);null!=hb?hb.parentNode.replaceChild(B,hb):a.appendChild(B);hb=B}d.cellEditor.isTableSelected()?(f(W,A(K.textAlign,"justify")),f(E,A(K.textAlign,"left")),f(G,A(K.textAlign,"center")),f(I,A(K.textAlign,"right"))):(B=d.cellEditor.align||mxUtils.getValue(h.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),A(K.textAlign,"justify")?+(f(W,A(K.textAlign,"justify")),f(E,!1),f(G,!1),f(I,!1)):(f(W,!1),f(E,B==mxConstants.ALIGN_LEFT),f(G,B==mxConstants.ALIGN_CENTER),f(I,B==mxConstants.ALIGN_RIGHT)));V=d.getParentByName(p,"TABLE",d.cellEditor.textarea);N=null==V?null:d.getParentByName(p,"TR",V);Q=null==V?null:d.getParentByNames(p,["TD","TH"],V);Va.style.display=null!=V?"":"none";document.activeElement!=sa&&(sa.value=isNaN(Z)?"":Z+" "+Editor.fontSizeUnit,"string"===typeof R&&0<R.indexOf("%")?Da.value=R.replace("%"," %"):(A=parseFloat(R),+isNaN(A)?Da.value="120 %":Da.value=Math.round(100*A)+" %"));null!=ba&&(la=d.getTextColor(p,!0),ba(la,!0));null!=Y&&(P=d.getTextColor(p,!1),Y(P,!0));g.toolbar.setMenuText(u,mxUtils.getCssFontFamily(K.fontFamily))}}eb=!1}),0))});(mxClient.IS_FF||mxClient.IS_EDGE||mxClient.IS_IE||mxClient.IS_IE11)&&mxEvent.addListener(d.cellEditor.textarea,"DOMSubtreeModified",m);mxEvent.addListener(d.cellEditor.textarea,"input",m);mxEvent.addListener(d.cellEditor.textarea,"touchend",m);mxEvent.addListener(d.cellEditor.textarea,+"mouseup",m);mxEvent.addListener(d.cellEditor.textarea,"keyup",m);this.listeners.push({destroy:function(){}});m()}return a};StyleFormatPanel=function(a,b,e){BaseFormatPanel.call(this,a,b,e);this.init()};mxUtils.extend(StyleFormatPanel,BaseFormatPanel);StyleFormatPanel.prototype.init=function(){var a=this.editorUi.getSelectionState();if(!a.containsLabel&&0<a.cells.length){a.containsImage&&1==a.vertices.length&&"image"==a.style.shape&&null!=a.style.image&&"data:image/svg+xml;"==String(a.style.image).substring(0,19)&&this.container.appendChild(this.addSvgStyles(this.createPanel()));a.fill&&this.container.appendChild(this.addFill(this.createPanel()));this.container.appendChild(this.addStroke(this.createPanel()));this.container.appendChild(this.addLineJumps(this.createPanel()));var b=this.createRelativeOption(mxResources.get("opacity"),mxConstants.STYLE_OPACITY);this.container.appendChild(b);this.container.appendChild(this.addEffects(this.createPanel()))}b=this.createPanel();1==a.cells.length&&(this.addEditOps(b),null!=b.firstChild&&mxUtils.br(b));1<=a.cells.length&&this.addStyleOps(b);null!=b.firstChild&&this.container.appendChild(b)};StyleFormatPanel.prototype.getCssRules=function(a){var b=document.implementation.createHTMLDocument(""),e=document.createElement("style");mxUtils.setTextContent(e,a);b.body.appendChild(e);return e.sheet.cssRules};@@ -3160,7 +3164,8 @@ mxConstants.DIRECTION_RADIAL];for(u=0;u<w.length;u++){var z=document.createElemeg.fill?"":"none";E=mxUtils.getValue(g.style,q,null);if(g.fill&&null!=E&&E!=mxConstants.NONE&&"filledEdge"!=g.style.shape){if("1"==g.style.sketch){if(2!=C){h.innerHTML="";C=2;for(E=0;E<Editor.roughFillStyles.length;E++){var I=document.createElement("option");I.setAttribute("value",Editor.roughFillStyles[E].val);mxUtils.write(I,Editor.roughFillStyles[E].dispName);h.appendChild(I)}h.value="auto"}}else 1!=C&&b();h.value=G;h.value||(G="auto",h.value=G);h.style.display="1"==g.style.sketch||"none"==d.style.display?"":"none";m.style.display=!g.gradient||g.containsImage||"1"==g.style.sketch&&"solid"!=G&&"auto"!=G?"none":""}else h.style.display="none",m.style.display="none"});f.getModel().addListener(mxEvent.CHANGE,D);this.listeners.push({destroy:function(){f.getModel().removeListener(D)}});D();mxEvent.addListener(d,"change",function(E){f.setCellStyles(mxConstants.STYLE_GRADIENT_DIRECTION,d.value,g.cells);e.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_GRADIENT_DIRECTION],"values",[d.value],"cells",g.cells));mxEvent.consume(E)});mxEvent.addListener(h,"change",function(E){f.setCellStyles("fillStyle",h.value,g.cells);e.fireEvent(new mxEventObject("styleChanged","keys",["fillStyle"],"values",[h.value],"cells",g.cells));mxEvent.consume(E)});a.appendChild(k);a.appendChild(m);k=this.getCustomColors();for(u=0;u<k.length;u++)a.appendChild(this.createCellColorOption(k[u].title,k[u].key,k[u].defaultValue));k=mxUtils.bind(this,function(E,G){if(null!=E){E=E.split(",");for(var I=0;I<E.length;I++){var J=-E[I].replace(/([a-z])([A-Z])/g,"$1 $2");a.appendChild(this.createCellColorOption(J.charAt(0).toUpperCase()+J.substring(1),E[I],"default",null,null,G))}}});k(g.style.fillColorStyles,f.shapeBackgroundColor);k(g.style.strokeColorStyles,f.shapeForegroundColor);return a};StyleFormatPanel.prototype.getCustomColors=function(){var a=[];this.editorUi.getSelectionState().swimlane&&a.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return a};+E[I].replace(/([a-z])([A-Z])/g,"$1 $2");a.appendChild(this.createCellColorOption(J.charAt(0).toUpperCase()+J.substring(1),E[I],"default",null,null,G))}}});k(g.style.fillColorStyles,f.shapeBackgroundColor);k(g.style.strokeColorStyles,f.shapeForegroundColor);return a};+StyleFormatPanel.prototype.getCustomColors=function(){var a=this.editorUi.getSelectionState(),b=[];if(null!=a.customProperties)for(var e in a.customProperties){var f=a.customProperties[e];null!=f&&"color"==f.type&&f.primary&&b.push({title:f.dispName,defaultValue:null==f.defVal?"#000000":f.defVal,key:f.name})}a.swimlane&&b.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return b};StyleFormatPanel.prototype.addStroke=function(a){function b(P){var ba=f.fromUnit(parseFloat(J.value));ba=Math.min(999,Math.max(0,isNaN(ba)?1:ba));ba!=mxUtils.getValue(h.style,mxConstants.STYLE_STROKEWIDTH,1)&&(d.setCellStyles(mxConstants.STYLE_STROKEWIDTH,ba,h.cells),g.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_STROKEWIDTH],"values",[ba],"cells",h.cells)));J.value=f.inUnit(ba)+" "+f.getUnit();mxEvent.consume(P)}function e(P){var ba=f.fromUnit(parseFloat(T.value));ba=Math.min(999,Math.max(0,isNaN(ba)?1:ba));ba!=mxUtils.getValue(h.style,mxConstants.STYLE_STROKEWIDTH,1)&&(d.setCellStyles(mxConstants.STYLE_STROKEWIDTH,ba,h.cells),g.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_STROKEWIDTH],"values",[ba],"cells",h.cells)));T.value=f.inUnit(ba)+" "+f.getUnit();mxEvent.consume(P)}var f=this,g=this.editorUi,d=g.editor.graph,h=g.getSelectionState(),m=document.createElement("div");m.className="geFormatEntry";h.stroke||(m.style.display="none");var q=document.createElement("select");q.style.position="absolute";q.style.left="72px";q.style.width="90px";for(var k=["sharp","rounded","curved"],u=0;u<k.length;u++){var w=document.createElement("option");w.setAttribute("value",k[u]);mxUtils.write(w,mxResources.get(k[u]));q.appendChild(w)}mxEvent.addListener(q,"change",function(P){d.getModel().beginUpdate();try{var ba=[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],la=["0","0"];"rounded"==q.value?la=["1","0"]:"curved"==q.value&&(la=["0","1"]);for(var Ja=0;Ja<ba.length;Ja++)d.setCellStyles(ba[Ja],@@ -3226,9 +3231,10 @@ d.style.left="72px";d.style.width="72px";g=["none","arc","gap","sharp","line"];fmxEvent.addListener(d,"click",function(w){mxEvent.consume(w)});a.appendChild(d);var q=this.addUnitInput(a,this.getUnit(),16,52,function(){k.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());var k=this.installInputHandler(q,"jumpSize",Graph.defaultJumpSize,0,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var u=mxUtils.bind(this,function(w,z,C){f=b.getSelectionState();d.value=mxUtils.getValue(f.style,"jumpStyle","none");if(C||document.activeElement!=q)w=parseInt(mxUtils.getValue(f.style,"jumpSize",Graph.defaultJumpSize)),q.value=isNaN(w)?"":this.inUnit(w)+" "+this.getUnit()});this.addKeyHandler(q,u);e.getModel().addListener(mxEvent.CHANGE,u);this.listeners.push({destroy:function(){e.getModel().removeListener(u)}});u()}else a.style.display="none";return a};StyleFormatPanel.prototype.addEffects=function(a){var b=this.editorUi,e=b.editor.graph,f=b.getSelectionState(),g=document.createElement("table");g.className="geFullWidthElement";g.style.fontWeight="bold";g.style.tableLayout="fixed";var d=document.createElement("tbody"),h=document.createElement("tr");h.style.padding="0px";var m=document.createElement("td");m.style.padding="0px";m.style.width="50%";m.style.verticalAlign="top";var q=m.cloneNode(!0);q.style.paddingLeft="8px";h.appendChild(m);h.appendChild(q);-d.appendChild(h);g.appendChild(d);a.appendChild(g);var k=m,u=mxUtils.bind(this,function(z,C,D,E){z=this.createCellOption(z,C,D,null,null,E);z.style.alignItems="top";k.appendChild(z);k=k==m?q:m;return z}),w=mxUtils.bind(this,function(z,C,D){f=b.getSelectionState();m.innerText="";q.innerText="";k=m;f.rounded&&u(mxResources.get("rounded"),mxConstants.STYLE_ROUNDED,0);f.swimlane&&u(mxResources.get("divider"),"swimlaneLine",1);u(mxResources.get("sketch"),"sketch",0,function(E,G){e.updateCellStyles({sketch:G?-"1":null,curveFitting:G?Editor.sketchDefaultCurveFitting:null,jiggle:G?Editor.sketchDefaultJiggle:null},E)});f.glass&&u(mxResources.get("glass"),mxConstants.STYLE_GLASS,0);z=u(mxResources.get("shadow"),mxConstants.STYLE_SHADOW,0);Editor.enableShadowOption||(z.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),mxUtils.setOpacity(z,60));0<f.edges.length&&0==f.vertices.length&&u(mxResources.get("flowAnimation",null,"Flow Animation"),"flowAnimation",0)});e.getModel().addListener(mxEvent.CHANGE,-w);this.listeners.push({destroy:function(){e.getModel().removeListener(w)}});w();return a};StyleFormatPanel.prototype.addStyleOps=function(a){1==this.editorUi.getSelectionState().cells.length&&this.addActions(a,["setAsDefaultStyle"]);return a};DiagramStylePanel=function(a,b,e){BaseFormatPanel.call(this,a,b,e);this.init()};mxUtils.extend(DiagramStylePanel,BaseFormatPanel);DiagramStylePanel.prototype.init=function(){this.container.appendChild(this.addView(this.createPanel()))};+d.appendChild(h);g.appendChild(d);a.appendChild(g);var k=m,u=mxUtils.bind(this,function(z,C,D,E){z=this.createCellOption(z,C,D,null,null,E);z.style.alignItems="top";k.appendChild(z);k=k==m?q:m;return z}),w=mxUtils.bind(this,function(z,C,D){f=b.getSelectionState();m.innerText="";q.innerText="";k=m;f.rounded&&u(mxResources.get("rounded"),mxConstants.STYLE_ROUNDED,0);f.swimlane&&u(mxResources.get("divider"),"swimlaneLine",1);u(mxResources.get("sketch"),"sketch",0,function(G,I){e.updateCellStyles({sketch:I?+"1":null,curveFitting:I?Editor.sketchDefaultCurveFitting:null,jiggle:I?Editor.sketchDefaultJiggle:null},G)});f.glass&&u(mxResources.get("glass"),mxConstants.STYLE_GLASS,0);z=u(mxResources.get("shadow"),mxConstants.STYLE_SHADOW,0);Editor.enableShadowOption||(z.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),mxUtils.setOpacity(z,60));0<f.edges.length&&0==f.vertices.length&&u(mxResources.get("flowAnimation",null,"Flow Animation"),"flowAnimation",0);if(null!=f.customProperties)for(var E in f.customProperties)z=+f.customProperties[E],null!=z&&"bool"==z.type&&z.primary&&u(z.dispName,E,z.defVal?"1":"0")});e.getModel().addListener(mxEvent.CHANGE,w);this.listeners.push({destroy:function(){e.getModel().removeListener(w)}});w();return a};StyleFormatPanel.prototype.addStyleOps=function(a){1==this.editorUi.getSelectionState().cells.length&&this.addActions(a,["setAsDefaultStyle"]);return a};DiagramStylePanel=function(a,b,e){BaseFormatPanel.call(this,a,b,e);this.init()};mxUtils.extend(DiagramStylePanel,BaseFormatPanel);+DiagramStylePanel.prototype.init=function(){this.container.appendChild(this.addView(this.createPanel()))};DiagramStylePanel.prototype.getGlobalStyleButtons=function(){var a=this.editorUi,b=a.editor.graph,e=document.createElement("div");e.className="geFormatEntry";var f=document.createElement("input");f.setAttribute("type","checkbox");f.checked=Editor.sketchMode;e.appendChild(f);mxUtils.write(e,mxResources.get("sketch"));mxEvent.addListener(e,"click",function(d){if(b.isEnabled()){var h=!Editor.sketchMode;b.updateCellStyles({sketch:h?"1":null,curveFitting:h?Editor.sketchDefaultCurveFitting:null,jiggle:h?Editor.sketchDefaultJiggle:null},b.getVerticesAndEdges());a.setSketchMode(h);mxEvent.consume(d)}});e=[e,mxUtils.button(mxResources.get("rounded"),mxUtils.bind(this,function(d){var h=b.getVerticesAndEdges(),m=!0;if(0<h.length)for(var q=0;q<h.length;q++){var k=b.getCellStyle(h[q]);if(0==mxUtils.getValue(k,mxConstants.STYLE_ROUNDED,0)){m=!1;break}}m=!m;b.updateCellStyles({rounded:m?"1":"0"},h);m?(b.currentEdgeStyle.rounded="1",b.currentVertexStyle.rounded="1"):(delete b.currentEdgeStyle.rounded,delete b.currentVertexStyle.rounded);mxEvent.consume(d)}))];if(!b.isEnabled())for(f=0;f<e.length;f++)if("BUTTON"==e[f].nodeName)e[f].setAttribute("disabled","disabled");else{var g=e[f].getElementsByTagName("input");0<g.length&&g[0].setAttribute("disabled","disabled")}return e};@@ -3711,8 +3717,8 @@ Toolbar.prototype.destroy=function(){null!=this.gestureHandler&&(mxEvent.removeGJ=G*(1-E);D=G*(1-E*(I%2?D-I:1-(D-I)));switch(I){case 6:case 0:return[G,D,J];case 1:return[D,G,J];case 2:return[J,G,D];case 3:return[J,D,G];case 4:return[D,J,G];case 5:return[G,J,D]}}mxEventSource.call(this);var b=document.createElement("div");b.style.overflow="visible";b.style.position="relative";b.style.top="0px";b.style.left="0px";b.style.width="230px";b.style.height="114px";var e=document.createElement("div");e.style.border="1px solid light-dark(black, white)";e.style.backgroundImage="url("+this.hsImage+")";e.style.position="absolute";e.style.overflow="hidden";e.style.cursor="crosshair";e.style.width="181px";e.style.height="101px";e.style.left="6px";e.style.top="4px";var f=document.createElement("div");f.style.background="url("+this.crossImage+")";f.style.pointerEvents="none";f.style.position="absolute";f.style.width="15px";f.style.height="15px";f.style.left="-8px";f.style.top="-8px";var g=[0,0,1];e.appendChild(f);b.appendChild(e);sliderBox=document.createElement("div");sliderBox.style.position="absolute";sliderBox.style.cursor="pointer";sliderBox.style.width="38px";sliderBox.style.height="110px";sliderBox.style.left="199px";sliderBox.style.top="4px";var d=document.createElement("div");d.style.border="1px solid light-dark(black, white)";d.style.pointerEvents="none";d.style.overflow="hidden";d.style.position="absolute";d.style.width="16px";d.style.height="101px";d.style.left="9px";d.style.top="0px";var h=!1,m=!1,q=mxUtils.bind(this,function(D){var E=Math.round(100*(1-g[1]));f.style.left=-Math.round(g[0]/6*180)-8+"px";f.style.top=E-8+"px";E=d.childNodes;for(var G=a(g[0],g[1],1),I=0;I<E.length;I++)E[I].style.backgroundColor="rgb("+G[0]*(1-I/E.length)*255+", "+G[1]*(1-I/E.length)*255+", "+G[2]*(1-I/E.length)*255+")";C.style.top=Math.round(100*(1-g[2]))-4+"px";E=a(g[0],g[1],g[2]);E="#"+("0"+Math.round(255*E[0]).toString(16)).slice(-2)+("0"+Math.round(255*E[1]).toString(16)).slice(-2)+("0"+Math.round(255*E[2]).toString(16)).slice(-2);1!=D&&this.fireEvent(new mxEventObject("change","color",-mxUtils.rgba2hex(E)))}),k=mxUtils.bind(this,function(D){0==g[2]&&(g[2]=1);h=!0;w(D)}),u=mxUtils.bind(this,function(D){m=!0;w(D)}),w=mxUtils.bind(this,function(D){if(h){var E=e.getBoundingClientRect(),G=mxEvent.getClientX(D)-E.left;D=mxEvent.getClientY(D)-E.top;f.style.left=G-8+"px";f.style.top=D-8+"px";G*=6/180;D=1-D/100;E=void 0;0>G&&(G=0);6<G&&(G=6);0>D&&(D=0);1<D&&(D=1);0>E&&(E=0);1<E&&(E=1);G=a(null==G?g[0]:g[0]=G,null==D?g[1]:g[1]=D,null==E?g[2]:g[2]=E);this.fromString("#"+("0"+Math.floor(255*+Math.round(g[0]/6*180)-8+"px";f.style.top=E-8+"px";E=d.childNodes;var G=a(g[0],g[1],1);if(null!=G){for(var I=0;I<E.length;I++)E[I].style.backgroundColor="rgb("+G[0]*(1-I/E.length)*255+", "+G[1]*(1-I/E.length)*255+", "+G[2]*(1-I/E.length)*255+")";C.style.top=Math.round(100*(1-g[2]))-4+"px";E=a(g[0],g[1],g[2]);E="#"+("0"+Math.round(255*E[0]).toString(16)).slice(-2)+("0"+Math.round(255*E[1]).toString(16)).slice(-2)+("0"+Math.round(255*E[2]).toString(16)).slice(-2);1!=D&&this.fireEvent(new mxEventObject("change",+"color",mxUtils.rgba2hex(E)))}}),k=mxUtils.bind(this,function(D){0==g[2]&&(g[2]=1);h=!0;w(D)}),u=mxUtils.bind(this,function(D){m=!0;w(D)}),w=mxUtils.bind(this,function(D){if(h){var E=e.getBoundingClientRect(),G=mxEvent.getClientX(D)-E.left;D=mxEvent.getClientY(D)-E.top;f.style.left=G-8+"px";f.style.top=D-8+"px";G*=6/180;D=1-D/100;E=void 0;0>G&&(G=0);6<G&&(G=6);0>D&&(D=0);1<D&&(D=1);0>E&&(E=0);1<E&&(E=1);G=a(null==G?g[0]:g[0]=G,null==D?g[1]:g[1]=D,null==E?g[2]:g[2]=E);this.fromString("#"+("0"+Math.floor(255*G[0]).toString(16)).slice(-2)+("0"+Math.floor(255*G[1]).toString(16)).slice(-2)+("0"+Math.floor(255*G[2]).toString(16)).slice(-2))}else m&&(E=sliderBox.getBoundingClientRect(),D=mxEvent.getClientY(D)-E.top,g[2]=Math.max(Math.min(1,1-D/100),0),q())}),z=mxUtils.bind(this,function(){h=m=!1});mxEvent.addGestureListeners(e,k);mxEvent.addGestureListeners(sliderBox,u);mxEvent.addGestureListeners(b,null,w,z);mxEvent.addListener(b,"mouseleave",z);for(k=0;101>k;k+=4)u=document.createElement("div"),u.style.height="4px",u.style.pointerEvents="none",d.appendChild(u);b.appendChild(d);var C=document.createElement("div");C.style.background="url("+this.arrowImage+")";C.style.position="absolute";C.style.pointerEvents="none";C.style.width="7px";C.style.height="11px";C.style.left="2px";C.style.top="-3px";sliderBox.appendChild(C);sliderBox.appendChild(d);b.appendChild(sliderBox);this.fromString=function(D,E){E=null!=E?E:!1;if(null==D||""==D||mxUtils.isVarColor(D)||D==mxConstants.NONE)D="#ffffff",E=!0;var G=mxUtils.parseColor(D);D=G.r/255;var I=G.g/255,J=G.b/255,T=Math.min(Math.min(D,I),J);G=Math.max(Math.max(D,I),J);var L=G-T;0===L?D=[null,0,G]:(D=D===T?3+(J-I)/L:I===T?5+(D-J)/L:1+(I-D)/L,D=[6===D?0:D,L/G,G]);null!=D[0]&&(g[0]=D[0]);0!=D[2]&&(g[1]=D[1]);g[2]=D[2];q(E)};this.fromString("#ffffff");this.div=b};mxUtils.extend(ColorPicker,mxEventSource);ColorPicker.prototype.hsImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALUAAABlCAIAAACEDzXRAAAKQ0lEQVR42u2d23IjKwxFBeRh5v8/9uQlzXlI2gGELoCEm6pxubp6PI69WoV3C20uIQPAH4A/AH/p41/pDcTxP4BPGDtq3vYJGPpv8craeRdo/fyTI8ZhHnodOGgcV/3rnx8QI0SABO2xfAbiCfVR8Wj+CD8jenbRJNyGOxLoAaH1iLu4EUEHAv1+MsQ4zLE4AiIOcpibv4u9OET6+cP4ASnJ1JH4/G60A9km+GbBxLlpKAkADoR2JnaBrvWD/x1GCZn9EYLEHqVfI6Efx0D7E9tDF/rBSJ54l8FqTUse0J+EvxPrdK0fD4aOLXQi7zyGxMaRvvWjjH2U8o9I44OKnf+wyCpHoR/Phk6d/COq8481YrNI3/qR2B+kMl1Fl6J8o/JrU/GEA6HdiB2ha/0YBVx7rFwNHAj9JuIl6EI/qKyJug4Yvg7xA0QEpB8nQe8itoQu9EOT8M3mTsqUSUzykH6cBO1PbA9d91+ShDzV9xrtcgW21IT6L0yfcS90FKCdw+wS6Q9ISWjVfLTVVT2mdiPGGRduFKWm7dBStWlLmI0j/QExdgp7gT5qCu2BLKiLqtc94hI7PB8auQP4KuyIvSJ960fUqXWcd2F48Khr1bHSj2dDp/afmg7tMrFxpG/9mHMFuqrH3spFw0s0Bgr9OAzamdgFutaPpMuqo6WVEXWJdSL14xhof2J76MKfS2yXWGOVB1WXXGOVdxFSx587CXoLsTE0689RH7VW4RMLeKI9wPpzz4XeS2wDzdbXR52AWStjwiSAA6HdiB2h1f6cqT0whzzuzz0LejuxATTy90Xt40v7CzdGRvKS4O/zQ0AiXaRW5x/dv4vS4A/a308LYR5pFquRRvlHIrKWoCj5woCVId4eR/KPNDjURg2tdEC7rSQN5B9DYR70X5YivVxft7AyrOvrD4V2JnaBJurr+qpemLEywlRhT6qvPx16C7ExdK0fSjcj0maAzsqgBt7rfIxGP46B9iT2gi70I842bNj0U4wd/WAG/L5VP3p0W4iNoYv6Oh6eoJmSMW5laIzF8iT1TtgeV9RZoZ7QvdEUzsQu0CP+HOMKDFoZvDFg6s89CNqf2B5a4e8Hts84W0pgeohBtspBXYp8H3Tk/H23MBtHuvbn5mp7dlU9TUkP+XNJMabzHdCIbnuYDSItzZ+bdgUWrAwNPhwInRxw1/wXuYGj+4vo7flboRpjEQ6EjgojYK9/K04NFfNTauEBypXQWQLAfqQoHl9CfvpQ6C3ExtC9/q2YW2u6X1JWzfsYFPKX3L99LrQ/sT10XR+jKh+UN2AxlDOyXfLQaxxf/fkvT4d2JnaBZv258M6h4IFu2Em7/sezoLcQG0Mjfy6xrqLnVBLGWHw1i69WP5LCCn0TNEL3DLNXpCV/n5oo5jAVLY5Em6i8Pwm6uSNuCrNxpNX+nDira20qqyZriv384xhoZ2IX6Lr/wg8eiwpXYGQqPEgjsBrX+er3X46B9ie2h6bX/4i6IfcLS2mIY++7TfoCuLj6hwgN89CwBJ3Gx8rOVsn0kQ48tDS/4X1L8SzMb3BbkGdtwsD05AbP9YOU8xui+uljZei/P/3qx2HQbsSO0Ar/lveHLZYCVK4GeN1P5N+eAb2R2Aya9ueUY+8dlhLtdhWvgfEfz4AeGf9hR2wcaeTPpacvRdzLTx8J/Qq1Ij995PrJ3/mp0p8LO5YyF0s215g/9yxoZ2IXaLo+FiwtgTlvIAznp4+G3khsBk3Pf5mYvqOwMqZnNnw3i9cRDoT2JPaCZuvreskDuXkHxfQMvfbBgdBbiI2hC/3QLCg6lESZZkrfJ7nSj3gWNEMcRkYJsf5L0BXENBl1WV8/aquMLM9/eSJ0UtxZmFGGg4MigZ75ovHnvsOcUX09zRbzjCrU/K/Rev0gT2i2vu4cZrNI1+sH2e49Yb3lRC6e9fSS9ETohjj7hdkx0rQ/57/rxIrhBQdCv494Hlrtz1lo30Qjz1z+cRh02ndTNIMm1j8NxtmePs+76i+/esJHrH/6dGh/YntoRf9l2RtQWgJXzY4bdtbqx0OhnYldoHv7I79jf4+rOGGaRWr14yToLcTG0Ky/v32rjAsdX9S5vgI4ENqT2Asa7Z/9vq0yStiGNNVHkOe/RGmqwBQ0jEDHFpoJ85BLN+jPaRoHGWl2/2yx3msxVRHjZ0Td4GfV/Bf9bCM1dBiBfrHeJ1HR6dKEedDf5yPdBLilp/efC3Ribb1VxlUHGQe8iTb0598+Hdqf2B6a3b9SOerezsoIBWaJ3IBn1fp0j4PeQmwMzc5/idLK3UZWRkmKX2zA4Vc/DoPeSGwGrdvfY24RpKmVjrLuCQdCuxE7Qkv64TZ3Z44dVPrxUOh3EK9C1/lHGpz7ZzpVsYTF7K8Hyj+Ogd5FbAk9uL9H9LIyYg821sjo13gYtD+xPbRU/9Ds/b1sZTTIr5OStMGHA6GdiV2gUf2UmQcfJdUbXOoe6HoN1A0b2uQD4EBosXJqQTwKnXvXAEX+oZlfGaS9ewetDGCLeV1exH4e9Mr+2TDpv2iggYFW+LdBsTbngv/yUroGH0jleEX7MOgtxMbQ7PzKoMuajKyM8pYIiB194HnQzsQu0Gp/LvpulVHylsgK/TgG2p/YHrqXf6T3bJUBhfxFWUDPg95CbAytm/+ycasM9WOxWu0PnTniLWE2iLRi/4Z3bJXRvY76s0+Arl93I3aMNOHPBce2PdSkL7Kpnwe9l9gGutCPoFgkUtytXAGbex0vKCznSOs00o+ToLcQG0N/QErCrG6jrTIynVUDwo896vCzssPrNnAYtD+xPfR9fwmKeu/CVhm5OAn1STPkvhxBW1KXjeP60Y/DoJ2JXaAL/RCPy+PXc80L9d7OV294dVPbC/fb4EDoLcTG0IV+TCDrrIxMHIFg512BWj9OgvYk9oK+9SMoZG55q/JMiGS40/sLjacu28T3MVfd0Aha+u3QJXr+0Q//MBtHutaPQOzh3H0RBoZS5OJ/MjqJ9x2vQb7qgSuvX0StH0+FLptzrvTDh9gl0oV+iAbi2lAsqNmbK3yBAyLNdbRzW8Y6Btqf2B76A2IURE2zZY16KGfZlwqofJSL4feABka+xCNX+ekx0LuILaFr/Zit7s4ZA7y5Qg2sDr/t4zDodxCvQt/6occctDKGriMPzH85D9qN2BG61g/QwcLSVDSGl78C6LePY6A3EptBf0BKcjWWH/GqyJqoxKnMufEVBLJxAJwJ7U9sDH3fX0CxnIB4orMyuilTyRh6g+0bfDgQ2p/YHrrQD+jV6qb/SdRrMit8TRWwyEabxgFwJrQnsQt0rR+LR3VqFNiGHRBv73ge9EZiM+haPyicuRcVmIxzAMTMl9wfi3sGtBuxF3ShH92C29yJTteU+ohbRrZk3Qe9hdgY+tYPnOqanA+mTN33ZGKE06HQbsQu0LV+MF8+94rU5dK8B8/KyJaI+6D9ie2hC/3Q12QnSnYLn5p9P/6d0D7EltAh5wz/Hv8exON/LUjHOuz5CksAAAAASUVORK5CYII=";@@ -12126,25 +12132,25 @@ DrawioFile.prototype.synchronizeFile=function(b,e){if(this.savingFile)null!=e&&efunction(q){f&&(window.clearTimeout(c),this.sync.cleanup(b,e,q))}),l,p):this.updateFile(mxUtils.bind(this,function(){f&&(window.clearTimeout(c),null!=b&&b())}),l,p)}};DrawioFile.prototype.updateFile=function(b,e,f,c,l){null!=f&&f()||(EditorUi.debug("DrawioFile.updateFile",[this],"immediate",l,"invalidChecksum",this.invalidChecksum),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=e&&e():this.getLatestVersion(mxUtils.bind(this,function(p){try{null!=f&&f()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum,"latestFile",[p]),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=e&&e():null!=p?this.mergeFile(p,b,e,c,l):this.reloadFile(b,e))}catch(q){null!=e&&e(q)}}),e))};-DrawioFile.prototype.mergeFile=function(b,e,f,c,l){try{var p=b.getShadowPages();if(null!=p&&0<p.length){var q=this.getShadowPages(),v=[this.ui.diffPages(null!=c?c:q,p)],E=this.ignorePatches(v);if(E)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",E),null!=e&&e();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var G=this.isModified()?this.ui.diffPages(q,+DrawioFile.prototype.mergeFile=function(b,e,f,c,l){try{var p=b.getShadowPages();if(null!=p&&0<p.length){var q=this.getShadowPages(),v=[this.ui.diffPages(null!=c?c:q,p)],D=this.ignorePatches(v);if(D)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",D),null!=e&&e();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var G=this.isModified()?this.ui.diffPages(q,this.isRealtime()?this.ownPages:this.ui.pages):null,B=this.ui.patchPages(this.ui.clonePages(q),v[0]),d=this.ui.getHashValueForPages(B,{}),g=this.ui.getHashValueForPages(p,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",q,"pages",p,"patched",B,"patches",v,"changes",G,"checksum",d,"current",g,"valid",d==g,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",l);if(null!=d&&d!=g)this.checksumError(f,v,null,null,"mergeFile",d,g,b.getCurrentRevisionId());else{this.setShadowPages(p);if(null!=this.sync){var k=this.sync.patchRealtime(v,DrawioFile.LAST_WRITE_WINS?G:null,null,l);null==k||mxUtils.isEmptyObject(k)||v.push(k)}this.patch(v,DrawioFile.LAST_WRITE_WINS?G:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());this.descriptorChanged();null!=e&&e()}}catch(y){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=f&&f(y);try{var m=this.getCurrentUser(),t=null!=m?-m.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),t,y)}catch(A){}}}else throw Error(mxResources.get("notADiagramFile"));}catch(y){null!=f&&f(y)}};+m.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),t,y)}catch(z){}}}else throw Error(mxResources.get("notADiagramFile"));}catch(y){null!=f&&f(y)}};DrawioFile.prototype.getAnonymizedXmlForPages=function(b){var e=new mxCodec(mxUtils.createXmlDocument()),f=e.document.createElement("mxfile");if(null!=b)for(var c=0;c<b.length;c++){var l=e.encode(new mxGraphModel(b[c].root));"1"!=urlParams.dev&&(l=this.ui.anonymizeNode(l,!0));l.setAttribute("id",b[c].getId());b[c].viewState&&this.ui.editor.graph.saveViewState(b[c].viewState,l,!0);f.appendChild(l)}return mxUtils.getPrettyXml(f)};DrawioFile.prototype.compressReportData=function(b,e,f){e=null!=e?e:1E4;null!=f&&null!=b&&b.length>f?b=b.substring(0,f)+"[...]":null!=b&&b.length>e&&(b=Graph.compress(b)+"\n");return b};-DrawioFile.prototype.checksumError=function(b,e,f,c,l,p,q,v){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var E=this.getCurrentUser(),G=null!=E?E.id:"unknown",B=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",d=JSON.stringify(e).length,g=null;if(null!=e&&1E3>d){b=[];for(f=0;f<e.length;f++)b.push(this.ui.anonymizePatch(e[f]));g=JSON.stringify(b);g=null!=g&&1E3>-g.length?Graph.compress(g):null}this.getLatestVersion(mxUtils.bind(this,function(k){try{var m=null!=g?"report":"error",t=this.ui.getHashValueForPages(k.getShadowPages()),y="unknown",A="unknown",I="unknown";try{var F=null!=k.initialData&&0<k.initialData.length?mxUtils.parseXml(k.initialData).documentElement:null;null!=F&&(null!=F.getAttribute("version")&&(y=F.getAttribute("version")),null!=F.getAttribute("agent")&&(A=F.getAttribute("agent")),null!=F.getAttribute("type")&&(I=F.getAttribute("type")))}catch(C){}EditorUi.logError("Checksum "+-m+" in "+l,null,this.getMode()+"."+B,"user_"+G+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+d+"-patches_"+e.length+(null!=g?"-json_"+g:"")+"-size_"+this.getSize()+(null!=p?"-expected_"+p:"")+(null!=q?"-current_"+q:"")+(null!=v?"-rev_"+this.ui.hashValue(v):"")+(null!=t?"-latest_"+t:"")+"-latestRev_"+this.ui.hashValue(k.getCurrentRevisionId())+("-latestVersion_"+y)+("-latestAgent_"+A)+("-latestType_"+I));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+B,action:l,label:"user_"++DrawioFile.prototype.checksumError=function(b,e,f,c,l,p,q,v){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var D=this.getCurrentUser(),G=null!=D?D.id:"unknown",B=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",d=JSON.stringify(e).length,g=null;if(null!=e&&1E3>d){b=[];for(f=0;f<e.length;f++)b.push(this.ui.anonymizePatch(e[f]));g=JSON.stringify(b);g=null!=g&&1E3>+g.length?Graph.compress(g):null}this.getLatestVersion(mxUtils.bind(this,function(k){try{var m=null!=g?"report":"error",t=this.ui.getHashValueForPages(k.getShadowPages()),y="unknown",z="unknown",I="unknown";try{var F=null!=k.initialData&&0<k.initialData.length?mxUtils.parseXml(k.initialData).documentElement:null;null!=F&&(null!=F.getAttribute("version")&&(y=F.getAttribute("version")),null!=F.getAttribute("agent")&&(z=F.getAttribute("agent")),null!=F.getAttribute("type")&&(I=F.getAttribute("type")))}catch(C){}EditorUi.logError("Checksum "++m+" in "+l,null,this.getMode()+"."+B,"user_"+G+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+d+"-patches_"+e.length+(null!=g?"-json_"+g:"")+"-size_"+this.getSize()+(null!=p?"-expected_"+p:"")+(null!=q?"-current_"+q:"")+(null!=v?"-rev_"+this.ui.hashValue(v):"")+(null!=t?"-latest_"+t:"")+"-latestRev_"+this.ui.hashValue(k.getCurrentRevisionId())+("-latestVersion_"+y)+("-latestAgent_"+z)+("-latestType_"+I));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+B,action:l,label:"user_"+G+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+d+"-patches_"+e.length+"-size_"+this.getSize()})}catch(C){}}),function(){})}catch(k){}};-DrawioFile.prototype.sendErrorReport=function(b,e,f,c){try{var l=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),p=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),q=this.getCurrentUser(),v=null!=q?this.ui.hashValue(q.id):"unknown",E=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",G=this.getTitle(),B=G.lastIndexOf(".");q="xml";0<B&&(q=G.substring(B));var d=null!=f?f.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()+-":\n\nAppVersion="+navigator.appVersion+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+q+")\nUser="+v+E+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=e?"\n\n"+e:+DrawioFile.prototype.sendErrorReport=function(b,e,f,c){try{var l=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),p=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),q=this.getCurrentUser(),v=null!=q?this.ui.hashValue(q.id):"unknown",D=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",G=this.getTitle(),B=G.lastIndexOf(".");q="xml";0<B&&(q=G.substring(B));var d=null!=f?f.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()++":\n\nAppVersion="+navigator.appVersion+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+q+")\nUser="+v+D+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=e?"\n\n"+e:"")+(null!=f?"\n\nError: "+f.message:"")+"\n\nStack:\n"+d+"\n\nShadow:\n"+l+"\n\nData:\n"+p,c)}catch(g){}};DrawioFile.prototype.reloadFile=function(b,e){try{this.stats.fileReloaded++;var f=this.ui.diffPages(this.getShadowPages(),this.isRealtime()?this.ownPages:this.ui.pages),c=this.ui.editor.graph,l=c.getSelectionCells(),p=c.getViewState(),q=this.ui.currentPage;this.getLatestVersion(mxUtils.bind(this,function(v){EditorUi.debug("DrawioFile.reloadFile",[this],"modified",this.isModified(),"rev",this.getCurrentRevisionId(),"changes",[f],"viewState",[p],"latestFile",v);null!=v?(this.ui.replaceFileData(v.getData(),-[f]),this.ui.restoreViewState(q,p,l),this.setDescriptor(v.getDescriptor()),this.descriptorChanged(),null!=b&&b()):(this.ui.spinner.stop(),this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){var E=this.ui.getCurrentFile();null!=E&&(E.stats=this.stats,E.patch([f]),E.fileChanged());this.ui.restoreViewState(q,p,l);null!=b&&b()}else null!=e&&e(this.ui.fileLoadedError)}),!0))}),e)}catch(v){null!=e&&e(v)}};+[f]),this.ui.restoreViewState(q,p,l),this.setDescriptor(v.getDescriptor()),this.descriptorChanged(),null!=b&&b()):(this.ui.spinner.stop(),this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){var D=this.ui.getCurrentFile();null!=D&&(D.stats=this.stats,D.patch([f]),D.fileChanged());this.ui.restoreViewState(q,p,l);null!=b&&b()}else null!=e&&e(this.ui.fileLoadedError)}),!0))}),e)}catch(v){null!=e&&e(v)}};DrawioFile.prototype.copyFile=function(b,e){this.ui.editor.editAsNew(this.ui.getFileData(!0),this.ui.getCopyFilename(this))};DrawioFile.prototype.ignorePatches=function(b){var e=!0;if(null!=b)for(var f=0;f<b.length&&e;f++)e=e&&mxUtils.isEmptyObject(b[f]);return e};-DrawioFile.prototype.patch=function(b,e,f,c){if(null!=b){var l=this.ui.editor.undoManager,p=l.history.slice(),q=l.indexOfNextAdd,v=this.ui.editor.graph;v.container.style.visibility="hidden";var E=this.changeListenerEnabled;this.changeListenerEnabled=f;var G=v.foldingEnabled,B=v.mathEnabled,d=v.cellRenderer.redraw;v.cellRenderer.redraw=function(A){A.view.graph.isEditing(A.cell)&&(A.view.graph.scrollCellToVisible(A.cell),A.view.graph.cellEditor.resize());d.apply(this,arguments)};v.model.beginUpdate();+DrawioFile.prototype.patch=function(b,e,f,c){if(null!=b){var l=this.ui.editor.undoManager,p=l.history.slice(),q=l.indexOfNextAdd,v=this.ui.editor.graph;v.container.style.visibility="hidden";var D=this.changeListenerEnabled;this.changeListenerEnabled=f;var G=v.foldingEnabled,B=v.mathEnabled,d=v.cellRenderer.redraw;v.cellRenderer.redraw=function(z){z.view.graph.isEditing(z.cell)&&(z.view.graph.scrollCellToVisible(z.cell),z.view.graph.cellEditor.resize());d.apply(this,arguments)};v.model.beginUpdate();try{if(f){for(var g=this.ui.pages.slice(),k=this.ui.currentPage,m=this.ui.applyPatches(this.ui.pages,b,!0,e,this.isModified()),t=0;t<m.length;t++){var y=mxUtils.indexOf(this.ui.pages,m[t]);0>y?this.ui.insertPage(m[t],Math.min(t,this.ui.pages.length)):this.ui.movePage(y,t)}for(t=0;t<g.length;t++)0>mxUtils.indexOf(m,g[t])&&this.ui.removePage(g[t]);0<=mxUtils.indexOf(this.ui.pages,k)&&this.ui.selectPage(k,!0)}else this.ui.pages=this.ui.applyPatches(this.ui.pages,b,!0,e,this.isModified());0==this.ui.pages.length&&-this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0);v.checkDefaultParent()}finally{v.container.style.visibility="";v.model.endUpdate();v.cellRenderer.redraw=d;this.changeListenerEnabled=E;f||(l.history=p,l.indexOfNextAdd=q,l.fireEvent(new mxEventObject(mxEvent.CLEAR)));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)B!=v.mathEnabled?(this.ui.editor.updateGraphComponents(),v.refresh()):(G!=v.foldingEnabled?+this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0);v.checkDefaultParent()}finally{v.container.style.visibility="";v.model.endUpdate();v.cellRenderer.redraw=d;this.changeListenerEnabled=D;f||(l.history=p,l.indexOfNextAdd=q,l.fireEvent(new mxEventObject(mxEvent.CLEAR)));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)B!=v.mathEnabled?(this.ui.editor.updateGraphComponents(),v.refresh()):(G!=v.foldingEnabled?v.view.revalidate():v.view.validate(),v.sizeDidChange());null!=this.sync&&this.isRealtime()&&!c&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages));this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",[this],"patches",b,"resolver",e,"undoable",f)}return b};DrawioFile.prototype.save=function(b,e,f,c,l,p){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",c,"overwrite",l,"manual",p,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!l&&this.invalidChecksum)if(null!=f)f({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=e&&e();else if(null!=f)f({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));}catch(q){if(null!=f)f(q);else throw q;}};DrawioFile.prototype.createData=function(){var b=this.ui.pages;if(this.isRealtime()&&(this.ui.pages=this.ownPages,null!=this.ui.currentPage)){var e=this.ui.getPageById(this.ui.currentPage.getId(),this.ownPages);null!=e&&(e.viewState=this.ui.editor.graph.getViewState(),e.needsUpdate=!0)}e=this.ui.getFileData(null,null,null,null,null,null,null,null,this,!this.isCompressed());this.ui.pages=b;return e};@@ -12195,7 +12201,7 @@ DrawioFile.prototype.fileChanged=function(b){b=null!=b?b:!0;this.lastChanged=newthis.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.bind(this,function(e){this.ui.stopSanityCheck();null==this.autosaveThread?(this.handleFileSuccess(!0),this.ageStart=null):this.isModified()&&(this.ui.scheduleSanityCheck(),this.ageStart=this.lastChanged)}),mxUtils.bind(this,function(e){this.handleFileError(e)}))):(this.ageStart=null,this.isAutosaveOptional()&&this.ui.editor.autosave||this.inConflictState||this.addUnsavedStatus());null!=this.sync&&b&&this.sync.localFileChanged()};DrawioFile.prototype.createSecret=function(b){var e=Editor.guid(32);Editor.enableRealtimeCache&&null!=this.sync&&!this.isOptimisticSync()?this.sync.createToken(e,mxUtils.bind(this,function(f){EditorUi.debug("DrawioFile.createSecret",[this],"secret",e,"token",f);b(e,f)}),mxUtils.bind(this,function(){b(e)})):b(e)};DrawioFile.prototype.fileSaving=function(){null!=this.sync&&this.sync.fileSaving()};DrawioFile.prototype.fileSaved=function(b,e,f,c,l,p,q){this.lastSaved=new Date;this.ageStart=null;this.stats.saved++;try{this.invalidChecksum=this.inConflictState=!1;p=null!=p?p:this.ui.getPagesForXml(b);try{null==this.sync||this.isOptimisticSync()?(this.setShadowPages(p),null!=this.sync&&(this.sync.lastModified=this.getLastModifiedDate(),this.sync.resetUpdateStatusThread(),this.isRealtime()&&this.sync.scheduleCleanup()),null!=f&&f()):this.sync.fileSaved(p,e,f,c,l,q)}catch(G){this.invalidChecksum=-this.inConflictState=!0;this.descriptorChanged();null!=c&&c(G);try{var v=this.getCurrentUser(),E=null!=v?v.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),E,G)}catch(B){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[e],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(G){this.descriptorChanged(),null!=c&&c(G)}};+this.inConflictState=!0;this.descriptorChanged();null!=c&&c(G);try{var v=this.getCurrentUser(),D=null!=v?v.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),D,G)}catch(B){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[e],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(G){this.descriptorChanged(),null!=c&&c(G)}};DrawioFile.prototype.autosave=function(b,e,f,c){null==this.lastAutosave&&(this.lastAutosave=Date.now());var l=Date.now()-this.lastAutosave<e?b:0;this.clearAutosave();var p=window.setTimeout(mxUtils.bind(this,function(){try{if(this.lastAutosave=null,this.autosaveThread==p&&(this.autosaveThread=null),EditorUi.debug("DrawioFile.autosave",[this],"thread",p,"modified",this.isModified(),"now",this.isAutosaveNow(),"saving",this.savingFile),this.isModified()&&this.isAutosaveNow()){var q=this.isAutosaveRevision();q&&(this.lastAutosaveRevision=(new Date).getTime());this.save(q,mxUtils.bind(this,function(v){this.autosaveCompleted();null!=f&&f(v)}),mxUtils.bind(this,function(v){null!=c&&c(v)}))}else this.isModified()||this.ui.clearStatus(),null!=f&&f(null)}catch(v){null!=c&&c(v)}}),l);this.autosaveThread=p;EditorUi.debug("DrawioFile.autosave",[this],"thread",p,"delay",b,"maxDelay",e,"actualDelay",l,"lastAutosave",this.lastAutosave,"saving",this.savingFile)};DrawioFile.prototype.isAutosaveNow=function(){return!0};DrawioFile.prototype.autosaveCompleted=function(){};DrawioFile.prototype.clearAutosave=function(){null!=this.autosaveThread&&(window.clearTimeout(this.autosaveThread),this.autosaveThread=null)};DrawioFile.prototype.isAutosaveRevision=function(){var b=(new Date).getTime();return null==this.lastAutosaveRevision||b-this.lastAutosaveRevision>this.maxAutosaveRevisionDelay};DrawioFile.prototype.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))};@@ -12204,10 +12210,10 @@ DrawioFile.prototype.removeListeners=function(){null!=this.changeListener&&(thisDrawioFile.prototype.commentsRefreshNeeded=function(){return!0};DrawioFile.prototype.commentsSaveNeeded=function(){return!1};DrawioFile.prototype.getComments=function(b,e){b([])};DrawioFile.prototype.addComment=function(b,e,f){e(Date.now())};DrawioFile.prototype.canReplyToReplies=function(){return!0};DrawioFile.prototype.canComment=function(){return!0};DrawioFile.prototype.newComment=function(b,e){return new DrawioComment(this,null,b,Date.now(),Date.now(),!1,e)};LocalFile=function(b,e,f,c,l,p,q){DrawioFile.call(this,b,e);this.title=f;this.mode=c?null:App.MODE_DEVICE;this.fileHandle=l;this.desc=p;this.editable=q};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return null!=this.fileHandle&&!this.invalidFileHandle&&DrawioFile.prototype.isAutosave.apply(this,arguments)};LocalFile.prototype.isAutosaveOptional=function(){return null!=this.fileHandle};LocalFile.prototype.getMode=function(){return this.mode};LocalFile.prototype.getTitle=function(){return this.title};LocalFile.prototype.isRenamable=function(){return!0};LocalFile.prototype.isEditable=function(){return DrawioFile.prototype.isEditable.apply(this,arguments)&&(null==this.editable||this.editable)};LocalFile.prototype.setEditable=function(b){this.editable=b;this.descriptorChanged()};LocalFile.prototype.save=function(b,e,f,c,l){this.saveAs(this.title,e,f,c,l)};LocalFile.prototype.saveAs=function(b,e,f,c,l){this.saveFile(b,!1,e,f,null,c,l)};LocalFile.prototype.getDescriptor=function(){return this.desc};LocalFile.prototype.setDescriptor=function(b){this.desc=b};LocalFile.prototype.getLatestVersion=function(b,e){null==this.fileHandle?null!=e&&e({message:mxResources.get("cannotOpenFile")}):this.ui.loadFileSystemEntry(this.fileHandle,b,e)};-LocalFile.prototype.saveFile=function(b,e,f,c,l,p,q){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;l||this.updateFileData();var v=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var E=this.getData(),G=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=f&&f()}),B=mxUtils.bind(this,function(d){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=-!0;var g=mxUtils.bind(this,function(m){this.savingFile=!1;null!=c&&c({error:m})});this.saveDraft(E);this.fileHandle.createWritable().then(mxUtils.bind(this,function(m){this.fileHandle.getFile().then(mxUtils.bind(this,function(t){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[t],"conflict",this.desc.lastModified!=t.lastModified);q||this.desc.lastModified==t.lastModified?m.write(v?this.ui.base64ToBlob(d,"image/png"):d).then(mxUtils.bind(this,function(){m.close().then(mxUtils.bind(this,-function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(y){try{var A=this.desc;this.savingFile=!1;this.desc=y;this.fileSaved(E,A,G,g);this.removeDraft()}catch(I){g(I)}}),g)}),g)}),g):(this.inConflictState=!0,g())}),mxUtils.bind(this,function(t){this.invalidFileHandle=!0;g(t)}))}),g)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(d,b,v?"image/png":"text/xml",v);else if(d.length<MAX_REQUEST_SIZE){var k=b.lastIndexOf(".");k=0<k?b.substring(k+1):"xml";-(new mxXmlRequest(SAVE_URL,"format="+k+"&xml="+encodeURIComponent(d)+"&filename="+encodeURIComponent(b)+(v?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(d)}));G()}});v?(e=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(d){B(d)}),c,this.ui.getCurrentFile()!=this?E:null,e.scale,e.border)):B(E)};+LocalFile.prototype.saveFile=function(b,e,f,c,l,p,q){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;l||this.updateFileData();var v=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var D=this.getData(),G=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=f&&f()}),B=mxUtils.bind(this,function(d){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=+!0;var g=mxUtils.bind(this,function(m){this.savingFile=!1;null!=c&&c({error:m})});this.saveDraft(D);this.fileHandle.createWritable().then(mxUtils.bind(this,function(m){this.fileHandle.getFile().then(mxUtils.bind(this,function(t){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[t],"conflict",this.desc.lastModified!=t.lastModified);q||this.desc.lastModified==t.lastModified?m.write(v?this.ui.base64ToBlob(d,"image/png"):d).then(mxUtils.bind(this,function(){m.close().then(mxUtils.bind(this,+function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(y){try{var z=this.desc;this.savingFile=!1;this.desc=y;this.fileSaved(D,z,G,g);this.removeDraft()}catch(I){g(I)}}),g)}),g)}),g):(this.inConflictState=!0,g())}),mxUtils.bind(this,function(t){this.invalidFileHandle=!0;g(t)}))}),g)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(d,b,v?"image/png":"text/xml",v);else if(d.length<MAX_REQUEST_SIZE){var k=b.lastIndexOf(".");k=0<k?b.substring(k+1):"xml";+(new mxXmlRequest(SAVE_URL,"format="+k+"&xml="+encodeURIComponent(d)+"&filename="+encodeURIComponent(b)+(v?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(d)}));G()}});v?(e=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(d){B(d)}),c,this.ui.getCurrentFile()!=this?D:null,e.scale,e.border)):B(D)};LocalFile.prototype.rename=function(b,e,f){this.title=b;this.descriptorChanged();null!=e&&e()};LocalLibrary=function(b,e,f){LocalFile.call(this,b,e,f)};mxUtils.extend(LocalLibrary,LocalFile);LocalLibrary.prototype.getHash=function(){return"F"+this.getTitle()};LocalLibrary.prototype.isAutosave=function(){return!1};LocalLibrary.prototype.saveAs=function(b,e,f){this.saveFile(b,!1,e,f)};LocalLibrary.prototype.updateFileData=function(){};LocalLibrary.prototype.open=function(){};StorageFile=function(b,e,f){DrawioFile.call(this,b,e);this.title=f;this.etag=this.getEtag(e)};mxUtils.extend(StorageFile,DrawioFile);StorageFile.prototype.getEtag=function(b){return this.ui.hashValue(null!=b?b:"")};StorageFile.prototype.autosaveDelay=500;StorageFile.prototype.maxAutosaveDelay=2E4;StorageFile.prototype.maxRetries=5;StorageFile.prototype.type="F";StorageFile.prototype.getMode=function(){return App.MODE_BROWSER};StorageFile.prototype.isSyncSupported=function(){return!0};StorageFile.prototype.isPolling=function(){return this.isSyncSupported()};StorageFile.prototype.getPollingInterval=function(){return 1E4};StorageFile.prototype.loadDescriptor=function(b,e){this.getLatestVersionId(b,e)};StorageFile.prototype.getLatestVersionId=function(b,e){StorageFile.getFileContent(this.ui,this.title,mxUtils.bind(this,function(f){b(this.getEtag(f))}),e)};StorageFile.prototype.isAutosaveOptional=function(){return!0};StorageFile.prototype.getHash=function(){return"L"+encodeURIComponent(this.getTitle())};StorageFile.prototype.getTitle=function(){return this.title};StorageFile.prototype.isRenamable=function(){return!0};StorageFile.prototype.getDescriptor=function(){return this.etag};StorageFile.prototype.setDescriptor=function(b){this.etag=b};StorageFile.prototype.getDescriptorEtag=function(b){return b};StorageFile.prototype.save=function(b,e,f){this.saveAs(this.getTitle(),e,f)};@@ -12226,78 +12232,78 @@ StorageFile.listFiles=function(b,e,f,c){b.getDatabaseItems(function(l){var p=[];StorageLibrary.prototype.isRenamable=function(b,e,f){return".scratchpad"!=this.title};StorageLibrary.prototype.open=function(){};RemoteFile=function(b,e,f){DrawioFile.call(this,b,e);this.title=f;this.mode=null};mxUtils.extend(RemoteFile,DrawioFile);RemoteFile.prototype.isAutosave=function(){return!1};RemoteFile.prototype.getMode=function(){return this.mode};RemoteFile.prototype.getTitle=function(){return this.title};RemoteFile.prototype.isRenamable=function(){return!1};RemoteFile.prototype.open=function(){this.ui.setFileData(this.getData());this.installListeners()};RemoteLibrary=function(b,e,f){RemoteFile.call(this,b,e,f.title);this.libObj=f};mxUtils.extend(RemoteLibrary,LocalFile);RemoteLibrary.prototype.getHash=function(){return"R"+encodeURIComponent(JSON.stringify([this.libObj.id,this.libObj.title,this.libObj.downloadUrl]))};RemoteLibrary.prototype.isEditable=function(){return!1};RemoteLibrary.prototype.isRenamable=function(){return!1};RemoteLibrary.prototype.isAutosave=function(){return!1};RemoteLibrary.prototype.save=function(b,e,f){};RemoteLibrary.prototype.saveAs=function(b,e,f){};RemoteLibrary.prototype.updateFileData=function(){};RemoteLibrary.prototype.open=function(){};UrlLibrary=function(b,e,f){StorageFile.call(this,b,e,f);b=f;e=b.lastIndexOf("/");0<=e&&(b=b.substring(e+1));this.fname=b};mxUtils.extend(UrlLibrary,StorageFile);UrlLibrary.prototype.getHash=function(){return"U"+encodeURIComponent(this.title)};UrlLibrary.prototype.getTitle=function(){return this.fname};UrlLibrary.prototype.isAutosave=function(){return!1};UrlLibrary.prototype.isEditable=function(b,e,f){return!1};UrlLibrary.prototype.saveAs=function(b,e,f){};UrlLibrary.prototype.open=function(){};EmbedFile=function(b,e,f){DrawioFile.call(this,b,e);this.desc=f||{};this.mode=App.MODE_EMBED};mxUtils.extend(EmbedFile,DrawioFile);EmbedFile.prototype.getMode=function(){return this.mode};EmbedFile.prototype.getTitle=function(){return this.desc.title||""};/*mxClient.IS_IOS || */-var StorageDialog=function(b,e,f){function c(d,g,k,m,t,y){function A(){mxEvent.addListener(I,"click",null!=y?y:function(){k==App.MODE_GOOGLE&&b.spinner.spin(document.body,mxResources.get("authorizing"))?b.drive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();b.setMode(k,!0);e()})):k==App.MODE_ONEDRIVE&&b.spinner.spin(document.body,mxResources.get("authorizing"))?b.oneDrive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();b.setMode(k,!0);e()}),function(V){b.spinner.stop();b.handleError(V)}):-(b.setMode(k,!0),e())})}v++;++q>f&&(mxUtils.br(E),q=1);var I=document.createElement("a");I.style.overflow="hidden";I.style.display="inline-block";I.className="geBaseButton";I.style.boxSizing="border-box";I.style.fontSize="11px";I.style.position="relative";I.style.margin="4px";I.style.marginTop="8px";I.style.marginBottom="0px";I.style.padding="8px 10px 8px 10px";I.style.width="88px";I.style.height="100px";I.style.whiteSpace="nowrap";I.setAttribute("title",g);var F=document.createElement("div");F.style.textOverflow=+var StorageDialog=function(b,e,f){function c(d,g,k,m,t,y){function z(){mxEvent.addListener(I,"click",null!=y?y:function(){k==App.MODE_GOOGLE&&b.spinner.spin(document.body,mxResources.get("authorizing"))?b.drive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();b.setMode(k,!0);e()})):k==App.MODE_ONEDRIVE&&b.spinner.spin(document.body,mxResources.get("authorizing"))?b.oneDrive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();b.setMode(k,!0);e()}),function(V){b.spinner.stop();b.handleError(V)}):+(b.setMode(k,!0),e())})}v++;++q>f&&(mxUtils.br(D),q=1);var I=document.createElement("a");I.style.overflow="hidden";I.style.display="inline-block";I.className="geBaseButton";I.style.boxSizing="border-box";I.style.fontSize="11px";I.style.position="relative";I.style.margin="4px";I.style.marginTop="8px";I.style.marginBottom="0px";I.style.padding="8px 10px 8px 10px";I.style.width="88px";I.style.height="100px";I.style.whiteSpace="nowrap";I.setAttribute("title",g);var F=document.createElement("div");F.style.textOverflow="ellipsis";F.style.overflow="hidden";F.style.position="absolute";F.style.bottom="8px";F.style.left="0px";F.style.right="0px";mxUtils.write(F,g);I.appendChild(F);if(null!=d){var C=document.createElement("img");C.setAttribute("src",d);C.setAttribute("border","0");C.setAttribute("align","absmiddle");C.style.width="60px";C.style.height="60px";C.style.paddingBottom="6px";I.appendChild(C)}else F.style.paddingTop="5px",F.style.whiteSpace="normal",mxClient.IS_IOS?(I.style.padding="0px 10px 20px 10px",I.style.top="6px"):mxClient.IS_FF&&(F.style.paddingTop="0px",F.style.marginTop="-2px");if(null!=t)for(d=0;d<t.length;d++)mxUtils.br(F),mxUtils.write(F,t[d]);if(null!=m&&null==b[m]){C.style.visibility="hidden";mxUtils.setOpacity(F,10);var Q=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});Q.spin(I);var S=window.setTimeout(function(){null==b[m]&&(Q.stop(),I.style.display="none")},3E4);b.addListener("clientLoaded",-mxUtils.bind(this,function(V,P){null!=b[m]&&P.getProperty("client")==b[m]&&(window.clearTimeout(S),mxUtils.setOpacity(F,100),C.style.visibility="",Q.stop(),A(),"drive"==m&&null!=G.parentNode&&G.parentNode.removeChild(G))}))}else A();E.appendChild(I)}f=null!=f?f:2;var l=document.createElement("div");l.style.textAlign="center";l.style.whiteSpace="nowrap";l.style.paddingTop="0px";l.style.paddingBottom="20px";var p=document.createElement("div");p.style.border="1px solid #d3d3d3";p.style.borderWidth="1px 0px 1px 0px";-p.style.padding="10px 0px 20px 0px";var q=0,v=0,E=document.createElement("div");E.style.paddingTop="2px";p.appendChild(E);var G=document.createElement("p"),B=document.createElement("p");B.style.cssText="font-size:22px;padding:4px 0 16px 0;margin:0;color:gray;";mxUtils.write(B,mxResources.get("saveDiagramsTo")+":");l.appendChild(B);l.appendChild(p);q=0;"function"===typeof window.DriveClient&&c(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");"function"===+mxUtils.bind(this,function(V,P){null!=b[m]&&P.getProperty("client")==b[m]&&(window.clearTimeout(S),mxUtils.setOpacity(F,100),C.style.visibility="",Q.stop(),z(),"drive"==m&&null!=G.parentNode&&G.parentNode.removeChild(G))}))}else z();D.appendChild(I)}f=null!=f?f:2;var l=document.createElement("div");l.style.textAlign="center";l.style.whiteSpace="nowrap";l.style.paddingTop="0px";l.style.paddingBottom="20px";var p=document.createElement("div");p.style.border="1px solid #d3d3d3";p.style.borderWidth="1px 0px 1px 0px";+p.style.padding="10px 0px 20px 0px";var q=0,v=0,D=document.createElement("div");D.style.paddingTop="2px";p.appendChild(D);var G=document.createElement("p"),B=document.createElement("p");B.style.cssText="font-size:22px;padding:4px 0 16px 0;margin:0;color:gray;";mxUtils.write(B,mxResources.get("saveDiagramsTo")+":");l.appendChild(B);l.appendChild(p);q=0;"function"===typeof window.DriveClient&&c(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive");"function"===typeof window.OneDriveClient&&c(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive");"1"!=urlParams.noDevice&&c(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);!isLocalStorage||"1"!=urlParams.browser&&"1"!=urlParams.offline||c(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER);"function"===typeof window.DropboxClient&&c(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox");null!=b.gitHub&&c(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub");null!=b.gitLab&&c(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab");p=document.createElement("span");p.style.position="absolute";p.style.cursor="pointer";p.style.bottom="27px";p.style.color="gray";p.style.userSelect="none";p.style.textAlign="center";p.style.left="50%";mxUtils.setPrefixedStyle(p.style,"transform","translate(-50%,0)");mxUtils.write(p,mxResources.get("decideLater"));l.appendChild(p);mxEvent.addListener(p,"click",function(){b.hideDialog();var d=Editor.useLocalStorage;b.createFile(b.defaultFilename,null,null,null,null,null,null,!0);Editor.useLocalStorage=d});mxClient.IS_SVG&&isLocalStorage&&"0"!=urlParams.gapi&&(null==document.documentMode||10<=document.documentMode)&&window.setTimeout(function(){null==b.drive&&(G.style.padding="7px",G.style.fontSize="9pt",G.style.marginTop="-14px",G.innerHTML='<a style="background-color:#dcdcdc;padding:6px;color:black;text-decoration:none;" href="https://www.drawio.com/doc/faq/google-drive-connection-problems" target="_blank"><img border="0" src="'+mxGraph.prototype.warningImage.src+'" align="absmiddle" style="margin-top:-4px"> '+mxResources.get("googleDriveMissingClickHere")+"</a>",l.appendChild(G))},5E3);this.container=l},SplashDialog=function(b){var e=document.createElement("div");e.style.textAlign="center";if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp){var f=b.addLanguageMenu(e,!1,"28px");null!=f&&(f.style.bottom="24px")}var c=document.createElement("img");c.setAttribute("border","0");c.setAttribute("align","absmiddle");c.style.width="32px";c.style.height="32px";c.style.marginRight="8px";c.style.marginTop="-4px";var l=document.createElement("div");l.style.margin="8px 0px 0px 0px";l.style.padding="18px 0px 24px 0px";f="";b.mode==App.MODE_GOOGLE?(c.src=IMAGE_PATH+"/google-drive-logo.svg",f=mxResources.get("googleDrive")):b.mode==App.MODE_DROPBOX?(c.src=IMAGE_PATH+"/dropbox-logo.svg",f=mxResources.get("dropbox")):b.mode==App.MODE_ONEDRIVE?(c.src=IMAGE_PATH+"/onedrive-logo.svg",f=mxResources.get("oneDrive")):b.mode==App.MODE_GITHUB?(c.src=IMAGE_PATH+"/github-logo.svg",f=mxResources.get("github")):b.mode==App.MODE_GITLAB?(c.src=IMAGE_PATH+"/gitlab-logo.svg",f=mxResources.get("gitlab")):b.mode==App.MODE_BROWSER?(c.src=IMAGE_PATH+"/osa_database.png",f=mxResources.get("browser")):b.mode==App.MODE_TRELLO?(c.src=IMAGE_PATH+"/trello-logo.svg",f=mxResources.get("trello")):(c.src=IMAGE_PATH+"/osa_drive-harddisk.png",l.style.paddingBottom="10px",l.style.paddingTop="30px",f=mxResources.get("device"));var p=document.createElement("button");-p.className="geBigButton";p.style.marginBottom="8px";p.style.fontSize="18px";p.style.padding="10px";p.style.width="340px";if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)l.style.padding="42px 0px 10px 0px",p.style.marginBottom="12px";else{l.style.border="1px solid #d3d3d3";l.style.borderWidth="1px 0px 1px 0px";var q=document.createElement("table"),v=document.createElement("tbody"),E=document.createElement("tr"),G=document.createElement("td"),B=document.createElement("td");q.setAttribute("align",-"center");G.appendChild(c);c=document.createElement("div");c.style.fontSize="22px";c.style.paddingBottom="6px";c.style.color="gray";mxUtils.write(c,f);B.style.textAlign="left";B.appendChild(c);E.appendChild(G);E.appendChild(B);v.appendChild(E);q.appendChild(v);e.appendChild(q);f=document.createElement("span");f.style.cssText="position:absolute;cursor:pointer;bottom:27px;color:gray;userSelect:none;text-align:center;left:50%;";mxUtils.setPrefixedStyle(f.style,"transform","translate(-50%,0)");mxUtils.write(f,+p.className="geBigButton";p.style.marginBottom="8px";p.style.fontSize="18px";p.style.padding="10px";p.style.width="340px";if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)l.style.padding="42px 0px 10px 0px",p.style.marginBottom="12px";else{l.style.border="1px solid #d3d3d3";l.style.borderWidth="1px 0px 1px 0px";var q=document.createElement("table"),v=document.createElement("tbody"),D=document.createElement("tr"),G=document.createElement("td"),B=document.createElement("td");q.setAttribute("align",+"center");G.appendChild(c);c=document.createElement("div");c.style.fontSize="22px";c.style.paddingBottom="6px";c.style.color="gray";mxUtils.write(c,f);B.style.textAlign="left";B.appendChild(c);D.appendChild(G);D.appendChild(B);v.appendChild(D);q.appendChild(v);e.appendChild(q);f=document.createElement("span");f.style.cssText="position:absolute;cursor:pointer;bottom:27px;color:gray;userSelect:none;text-align:center;left:50%;";mxUtils.setPrefixedStyle(f.style,"transform","translate(-50%,0)");mxUtils.write(f,mxResources.get("changeStorage"));mxEvent.addListener(f,"click",function(){b.hideDialog(!1);b.setMode(null);b.clearMode();b.showSplash(!0)});e.appendChild(f)}mxUtils.write(p,mxResources.get("createNewDiagram"));mxEvent.addListener(p,"click",function(){b.hideDialog();b.actions.get("new").funct()});l.appendChild(p);mxUtils.br(l);p=document.createElement("button");p.className="geBigButton";p.style.marginBottom="22px";p.style.fontSize="18px";p.style.padding="10px";p.style.width="340px";mxUtils.write(p,mxResources.get("openExistingDiagram"));mxEvent.addListener(p,"click",function(){b.actions.get("open").funct()});l.appendChild(p);b.mode==App.MODE_GOOGLE?mxResources.get("googleDrive"):b.mode==App.MODE_DROPBOX?mxResources.get("dropbox"):b.mode==App.MODE_ONEDRIVE?mxResources.get("oneDrive"):b.mode==App.MODE_GITHUB?mxResources.get("github"):b.mode==App.MODE_GITLAB?mxResources.get("gitlab"):b.mode==App.MODE_TRELLO?mxResources.get("trello"):b.mode==App.MODE_DEVICE?mxResources.get("device"):b.mode==App.MODE_BROWSER&&mxResources.get("browser");if(!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp)if(f=function(k){p.style.marginBottom="24px";var m=document.createElement("a");m.style.display="inline-block";m.style.color="gray";m.style.cursor="pointer";m.style.marginTop="6px";mxUtils.write(m,mxResources.get("signOut"));p.style.marginBottom="16px";l.style.paddingBottom="18px";mxEvent.addListener(m,"click",function(){b.confirm(mxResources.get("areYouSure"),function(){k()})});l.appendChild(m)},b.mode==App.MODE_GOOGLE&&null!=b.drive){var d=b.drive.getUsersList();if(0<d.length){c=document.createElement("span");c.style.marginTop="6px";mxUtils.write(c,mxResources.get("changeUser")+":");p.style.marginBottom="16px";l.style.paddingBottom="18px";l.appendChild(c);var g=document.createElement("select");g.style.marginLeft="4px";g.style.width="140px";for(f=0;f<d.length;f++)q=document.createElement("option"),mxUtils.write(q,d[f].displayName),q.value=f,g.appendChild(q),q=document.createElement("option"),q.innerHTML=" ",mxUtils.write(q,"<"+d[f].email+">"),q.setAttribute("disabled","disabled"),g.appendChild(q);q=document.createElement("option");mxUtils.write(q,mxResources.get("addAccount"));q.value=d.length;g.appendChild(q);mxEvent.addListener(g,"change",function(){var k=g.value,m=d.length!=k;m&&b.drive.setUser(d[k]);b.drive.authorize(m,function(){b.setMode(App.MODE_GOOGLE);b.hideDialog();b.showSplash()},function(t){b.handleError(t,null,function(){b.hideDialog();b.showSplash()})},!0)});l.appendChild(g)}else f(function(){b.drive.logout()})}else b.mode!=App.MODE_ONEDRIVE||null==b.oneDrive||b.oneDrive.noLogout?b.mode==App.MODE_GITHUB&&null!=b.gitHub?f(function(){b.gitHub.logout();b.openLink("https://www.github.com/logout")}):b.mode==App.MODE_GITLAB&&null!=b.gitLab?f(function(){b.gitLab.logout();var k=document.createElement("form");k.setAttribute("method","post");k.setAttribute("action",DRAWIO_GITLAB_URL+"/users/sign_out");k.setAttribute("target","_blank");document.body.appendChild(k);k.submit();k.parentNode.removeChild(k)}):b.mode==App.MODE_TRELLO&&-null!=b.trello?b.trello.isAuthorized()&&f(function(){b.trello.logout()}):b.mode==App.MODE_DROPBOX&&null!=b.dropbox&&f(function(){b.dropbox.logout();b.openLink("https://www.dropbox.com/logout")}):f(function(){b.oneDrive.logout()});e.appendChild(l);this.container=e},EmbedDialog=function(b,e,f,c,l,p,q,v,E){q=null!=q?q:"Check out the diagram I made using @drawio";c=document.createElement("div");var G=/^https?:\/\//.test(e)||/^mailto:\/\//.test(e);null!=p?mxUtils.write(c,p):mxUtils.write(c,mxResources.get(5E5>+null!=b.trello?b.trello.isAuthorized()&&f(function(){b.trello.logout()}):b.mode==App.MODE_DROPBOX&&null!=b.dropbox&&f(function(){b.dropbox.logout();b.openLink("https://www.dropbox.com/logout")}):f(function(){b.oneDrive.logout()});e.appendChild(l);this.container=e},EmbedDialog=function(b,e,f,c,l,p,q,v,D){q=null!=q?q:"Check out the diagram I made using @drawio";c=document.createElement("div");var G=/^https?:\/\//.test(e)||/^mailto:\/\//.test(e);null!=p?mxUtils.write(c,p):mxUtils.write(c,mxResources.get(5E5>e.length?G?"link":"mainEmbedNotice":"preview")+":");mxUtils.br(c);p=document.createElement("div");p.style.position="absolute";p.style.top="30px";p.style.right="30px";p.style.color="gray";mxUtils.write(p,b.formatFileSize(e.length));c.appendChild(p);var B=document.createElement("textarea");B.setAttribute("autocomplete","off");B.setAttribute("autocorrect","off");B.setAttribute("autocapitalize","off");B.setAttribute("spellcheck","false");B.style.fontFamily="monospace";B.style.wordBreak="break-all";B.style.marginTop="10px";B.style.resize="none";B.style.height="150px";B.style.width="440px";B.style.border="1px solid gray";B.value=mxResources.get("updatingDocument");c.appendChild(B);mxUtils.br(c);this.init=function(){window.setTimeout(function(){5E5>e.length?(B.value=e,B.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?B.select():document.execCommand("selectAll",!1,null)):(B.setAttribute("readonly","true"),B.value=mxResources.get("tooLargeUseDownload"))},0)};p=document.createElement("div");p.style.position="absolute";p.style.bottom="36px";p.style.right="32px";var d=null;!EmbedDialog.showPreviewOption||mxIsElectron||mxClient.IS_CHROMEAPP&&!G||navigator.standalone||!(G||mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode))||(d=mxUtils.button(null!=v?v:mxResources.get(5E5>e.length?"preview":"openInNewWindow"),function(){var k=5E5>e.length?B.value:e;if(null!=l)l(k);else if(G)try{var m=b.openLink(k);null!=m&&(null==f||0<f)&&window.setTimeout(mxUtils.bind(this,function(){try{null!=m&&null!=m.location.href&&m.location.href.substring(0,8)!=k.substring(0,8)&&(m.close(),b.handleError({message:mxResources.get("drawingTooLarge")}))}catch(y){}}),f||500)}catch(y){b.handleError({message:y.message||mxResources.get("drawingTooLarge")})}else{var t=window.open();t=null!=t?t.document:null;null!=t?(t.writeln("<html><head><title>"+mxUtils.htmlEntities(mxResources.get("preview"))+'</title><meta charset="utf-8"></head><body>'+("<iframe"==e.substring(0,7)?e:mxUtils.htmlEntities(e))+"</body></html>"),-t.close()):b.handleError({message:mxResources.get("errorUpdatingPreview")})}}),d.className="geBtn",p.appendChild(d));if(!G||7500<e.length)v=mxUtils.button(mxResources.get(mxIsElectron?"save":"download"),function(){b.hideDialog();b.saveData(null!=E?E:"embed.txt","txt",e,"text/plain")}),v.className="geBtn",p.appendChild(v);if(G&&(!b.isOffline()||mxClient.IS_CHROMEAPP)){if(51200>e.length){var g=mxUtils.button("",function(){try{var k="https://www.facebook.com/sharer.php?p[url]="+encodeURIComponent(B.value);+t.close()):b.handleError({message:mxResources.get("errorUpdatingPreview")})}}),d.className="geBtn",p.appendChild(d));if(!G||7500<e.length)v=mxUtils.button(mxResources.get(mxIsElectron?"save":"download"),function(){b.hideDialog();b.saveData(null!=D?D:"embed.txt","txt",e,"text/plain")}),v.className="geBtn",p.appendChild(v);if(G&&(!b.isOffline()||mxClient.IS_CHROMEAPP)){if(51200>e.length){var g=mxUtils.button("",function(){try{var k="https://www.facebook.com/sharer.php?p[url]="+encodeURIComponent(B.value);b.openLink(k)}catch(m){b.handleError({message:m.message||mxResources.get("drawingTooLarge")})}});v=document.createElement("img");v.setAttribute("src",Editor.facebookImage);v.setAttribute("width","18");v.setAttribute("height","18");v.setAttribute("border","0");g.appendChild(v);g.setAttribute("title",mxResources.get("facebook")+" ("+b.formatFileSize(51200)+" max)");g.style.verticalAlign="bottom";g.style.paddingTop="4px";g.style.minWidth="46px";g.className="geBtn";p.appendChild(g)}7168>e.length&&(g=mxUtils.button("",function(){try{var k="https://twitter.com/intent/tweet?text="+encodeURIComponent(q)+"&url="+encodeURIComponent(B.value);b.openLink(k)}catch(m){b.handleError({message:m.message||mxResources.get("drawingTooLarge")})}}),v=document.createElement("img"),v.setAttribute("src",Editor.tweetImage),v.setAttribute("width","18"),v.setAttribute("height","18"),v.setAttribute("border","0"),v.style.marginBottom="5px",g.appendChild(v),g.setAttribute("title",mxResources.get("twitter")+" ("+b.formatFileSize(7168)+-" max)"),g.style.verticalAlign="bottom",g.style.paddingTop="4px",g.style.minWidth="46px",g.className="geBtn",p.appendChild(g))}!b.isOffline()&&5E5>e.length&&(g=mxUtils.button("",function(){try{var k="mailto:?subject="+encodeURIComponent(E||b.defaultFilename)+"&body="+encodeURIComponent(B.value);b.openLink(k)}catch(m){b.handleError({message:m.message||mxResources.get("drawingTooLarge")})}}),v=document.createElement("img"),v.className="geAdaptiveAsset",v.setAttribute("src",Editor.mailImage),v.setAttribute("width",+" max)"),g.style.verticalAlign="bottom",g.style.paddingTop="4px",g.style.minWidth="46px",g.className="geBtn",p.appendChild(g))}!b.isOffline()&&5E5>e.length&&(g=mxUtils.button("",function(){try{var k="mailto:?subject="+encodeURIComponent(D||b.defaultFilename)+"&body="+encodeURIComponent(B.value);b.openLink(k)}catch(m){b.handleError({message:m.message||mxResources.get("drawingTooLarge")})}}),v=document.createElement("img"),v.className="geAdaptiveAsset",v.setAttribute("src",Editor.mailImage),v.setAttribute("width","18"),v.setAttribute("height","18"),v.setAttribute("border","0"),v.style.marginBottom="5px",g.appendChild(v),g.style.verticalAlign="bottom",g.style.paddingTop="4px",g.style.minWidth="46px",g.className="geBtn",p.appendChild(g));v=mxUtils.button(mxResources.get("close"),function(){b.hideDialog()});p.appendChild(v);g=mxUtils.button(mxResources.get("copy"),function(){B.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?B.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");b.alert(mxResources.get("copiedToClipboard"))});5E5>e.length?mxClient.IS_SF||null!=document.documentMode?v.className="geBtn gePrimaryBtn":(p.appendChild(g),g.className="geBtn gePrimaryBtn",v.className="geBtn"):null!=d&&(p.appendChild(d),v.className="geBtn",d.className="geBtn gePrimaryBtn");c.appendChild(p);this.container=c};EmbedDialog.showPreviewOption=!0;var GoogleSitesDialog=function(b,e){function f(){var V=null!=S&&null!=S.getTitle()?S.getTitle():this.defaultFilename;if(C.checked&&""!=g.value){var P="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(g.value));null!=V&&(P+="&title="+encodeURIComponent(V));0<Q.length&&(P+="&s="+Q);""!=k.value&&"0"!=k.value&&(P+="&border="+k.value);""!=d.value&&(P+="&height="+d.value);P+="&pan="+(m.checked?"1":"0");P+="&zoom="+(t.checked?"1":"0");P+="&fit="+(F.checked?"1":"0");-P+="&resize="+(I.checked?"1":"0");P+="&x0="+Number(B.value);P+="&y0="+E;l.mathEnabled&&(P+="&math=1");A.checked?P+="&edit=_blank":y.checked&&(P+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));G.value=P}else S.constructor==DriveFile||S.constructor==DropboxFile?(P="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=g.value?P+=encodeURIComponent(mxUtils.htmlEntities(g.value))+"&type=3":(P+=S.getHash().substring(1),P=S.constructor==DropboxFile?P+"&type=2":P+"&type=1"),null!=-V&&(P+="&title="+encodeURIComponent(V)),""!=d.value&&(V=parseInt(d.value)+parseInt(B.value),P+="&height="+V),G.value=P):G.value=""}var c=document.createElement("div"),l=b.editor.graph,p=l.getGraphBounds(),q=l.view.scale,v=Math.floor(p.x/q-l.view.translate.x),E=Math.floor(p.y/q-l.view.translate.y);mxUtils.write(c,mxResources.get("googleGadget")+":");mxUtils.br(c);var G=document.createElement("input");G.setAttribute("type","text");G.style.marginBottom="8px";G.style.marginTop="2px";G.style.width="410px";+P+="&resize="+(I.checked?"1":"0");P+="&x0="+Number(B.value);P+="&y0="+D;l.mathEnabled&&(P+="&math=1");z.checked?P+="&edit=_blank":y.checked&&(P+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));G.value=P}else S.constructor==DriveFile||S.constructor==DropboxFile?(P="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=g.value?P+=encodeURIComponent(mxUtils.htmlEntities(g.value))+"&type=3":(P+=S.getHash().substring(1),P=S.constructor==DropboxFile?P+"&type=2":P+"&type=1"),null!=+V&&(P+="&title="+encodeURIComponent(V)),""!=d.value&&(V=parseInt(d.value)+parseInt(B.value),P+="&height="+V),G.value=P):G.value=""}var c=document.createElement("div"),l=b.editor.graph,p=l.getGraphBounds(),q=l.view.scale,v=Math.floor(p.x/q-l.view.translate.x),D=Math.floor(p.y/q-l.view.translate.y);mxUtils.write(c,mxResources.get("googleGadget")+":");mxUtils.br(c);var G=document.createElement("input");G.setAttribute("type","text");G.style.marginBottom="8px";G.style.marginTop="2px";G.style.width="410px";c.appendChild(G);mxUtils.br(c);this.init=function(){G.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?G.select():document.execCommand("selectAll",!1,null)};mxUtils.write(c,mxResources.get("top")+":");var B=document.createElement("input");B.setAttribute("type","text");B.setAttribute("size","4");B.style.marginRight="16px";B.style.marginLeft="4px";B.value=v;c.appendChild(B);mxUtils.write(c,mxResources.get("height")+":");var d=document.createElement("input");d.setAttribute("type","text");d.setAttribute("size","4");d.style.marginLeft="4px";d.value=Math.ceil(p.height/q);c.appendChild(d);mxUtils.br(c);p=document.createElement("hr");p.setAttribute("size","1");p.style.marginBottom="16px";p.style.marginTop="16px";c.appendChild(p);mxUtils.write(c,mxResources.get("publicDiagramUrl")+":");mxUtils.br(c);var g=document.createElement("input");g.setAttribute("type","text");g.setAttribute("size","28");g.style.marginBottom="8px";g.style.marginTop="2px";g.style.width="410px";g.value=e||"";c.appendChild(g);mxUtils.br(c);mxUtils.write(c,mxResources.get("borderWidth")+":");var k=document.createElement("input");k.setAttribute("type","text");k.setAttribute("size","3");k.style.marginBottom="8px";k.style.marginLeft="4px";k.value="0";c.appendChild(k);mxUtils.br(c);var m=document.createElement("input");m.setAttribute("type","checkbox");m.setAttribute("checked","checked");m.defaultChecked=!0;m.style.marginLeft="16px";c.appendChild(m);mxUtils.write(c,mxResources.get("pan")+" ");var t=document.createElement("input");-t.setAttribute("type","checkbox");t.setAttribute("checked","checked");t.defaultChecked=!0;t.style.marginLeft="8px";c.appendChild(t);mxUtils.write(c,mxResources.get("zoom")+" ");var y=document.createElement("input");y.setAttribute("type","checkbox");y.style.marginLeft="8px";y.setAttribute("title",window.location.href);c.appendChild(y);mxUtils.write(c,mxResources.get("edit")+" ");var A=document.createElement("input");A.setAttribute("type","checkbox");A.style.marginLeft="8px";c.appendChild(A);mxUtils.write(c,+t.setAttribute("type","checkbox");t.setAttribute("checked","checked");t.defaultChecked=!0;t.style.marginLeft="8px";c.appendChild(t);mxUtils.write(c,mxResources.get("zoom")+" ");var y=document.createElement("input");y.setAttribute("type","checkbox");y.style.marginLeft="8px";y.setAttribute("title",window.location.href);c.appendChild(y);mxUtils.write(c,mxResources.get("edit")+" ");var z=document.createElement("input");z.setAttribute("type","checkbox");z.style.marginLeft="8px";c.appendChild(z);mxUtils.write(c,mxResources.get("asNew")+" ");mxUtils.br(c);var I=document.createElement("input");I.setAttribute("type","checkbox");I.setAttribute("checked","checked");I.defaultChecked=!0;I.style.marginLeft="16px";c.appendChild(I);mxUtils.write(c,mxResources.get("resize")+" ");var F=document.createElement("input");F.setAttribute("type","checkbox");F.style.marginLeft="8px";c.appendChild(F);mxUtils.write(c,mxResources.get("fit")+" ");var C=document.createElement("input");C.setAttribute("type","checkbox");C.style.marginLeft=-"8px";c.appendChild(C);mxUtils.write(c,mxResources.get("embed")+" ");var Q=b.getBasenames().join(";"),S=b.getCurrentFile();mxEvent.addListener(m,"change",f);mxEvent.addListener(t,"change",f);mxEvent.addListener(I,"change",f);mxEvent.addListener(F,"change",f);mxEvent.addListener(y,"change",f);mxEvent.addListener(A,"change",f);mxEvent.addListener(C,"change",f);mxEvent.addListener(d,"change",f);mxEvent.addListener(B,"change",f);mxEvent.addListener(k,"change",f);mxEvent.addListener(g,"change",f);f();+"8px";c.appendChild(C);mxUtils.write(c,mxResources.get("embed")+" ");var Q=b.getBasenames().join(";"),S=b.getCurrentFile();mxEvent.addListener(m,"change",f);mxEvent.addListener(t,"change",f);mxEvent.addListener(I,"change",f);mxEvent.addListener(F,"change",f);mxEvent.addListener(y,"change",f);mxEvent.addListener(z,"change",f);mxEvent.addListener(C,"change",f);mxEvent.addListener(d,"change",f);mxEvent.addListener(B,"change",f);mxEvent.addListener(k,"change",f);mxEvent.addListener(g,"change",f);f();mxEvent.addListener(G,"click",function(){G.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?G.select():document.execCommand("selectAll",!1,null)});e=document.createElement("div");e.style.paddingTop="12px";e.style.textAlign="right";p=mxUtils.button(mxResources.get("close"),function(){b.hideDialog()});p.className="geBtn gePrimaryBtn";e.appendChild(p);c.appendChild(e);this.container=c},CreateGraphDialog=function(b,e,f){var c=document.createElement("div");c.style.textAlign="right";this.init=function(){var l=document.createElement("div");l.style.position="relative";l.style.border="1px solid gray";l.style.boxSizing="border-box";l.style.width="100%";l.style.height="360px";l.style.overflow="hidden";l.style.marginBottom="16px";mxEvent.disableContextMenu(l);c.appendChild(l);var p=new Graph(l);p.setCellsCloneable(!0);p.setPanning(!0);p.setAllowDanglingEdges(!1);p.connectionHandler.select=!1;p.view.setTranslate(20,20);p.border=20;p.panningHandler.useLeftButtonForPanning=!0;mxClient.IS_SVG&&-null!=p.view.getDrawPane()&&(l=p.view.getDrawPane().ownerSVGElement,null!=l&&(l.style.position="absolute"));var q="curved=1;";p.cellRenderer.installCellOverlayListeners=function(m,t,y){mxCellRenderer.prototype.installCellOverlayListeners.apply(this,arguments);mxEvent.addListener(y.node,mxClient.IS_POINTER?"pointerdown":"mousedown",function(A){t.fireEvent(new mxEventObject("pointerdown","event",A,"state",m))});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&mxEvent.addListener(y.node,"touchstart",function(A){t.fireEvent(new mxEventObject("pointerdown",-"event",A,"state",m))})};p.getAllConnectionConstraints=function(){return null};p.connectionHandler.marker.highlight.keepOnTop=!1;p.connectionHandler.createEdgeState=function(m){m=p.createEdge(null,null,null,null,null,q);return new mxCellState(this.graph.view,m,this.graph.getCellStyle(m))};var v=p.getDefaultParent(),E=mxUtils.bind(this,function(m){var t=new mxCellOverlay(this.connectImage,"Add outgoing");t.cursor="hand";t.addListener(mxEvent.CLICK,function(y,A){p.connectionHandler.reset();p.clearSelection();-var I=p.getCellGeometry(m),F;d(function(){F=p.insertVertex(v,null,"Entry",I.x,I.y,80,30,"rounded=1;");E(F);p.view.refresh(F);p.insertEdge(v,null,"",m,F,q)},function(){p.scrollCellToVisible(F)})});t.addListener("pointerdown",function(y,A){y=A.getProperty("event");A=A.getProperty("state");p.popupMenuHandler.hideMenu();p.stopEditing(!1);var I=mxUtils.convertPoint(p.container,mxEvent.getClientX(y),mxEvent.getClientY(y));p.connectionHandler.start(A,I.x,I.y);p.isMouseDown=!0;p.isMouseTrigger=mxEvent.isMouseEvent(y);-mxEvent.consume(y)});p.addCellOverlay(m,t)});p.getModel().beginUpdate();try{var G=p.insertVertex(v,null,"Start",0,0,80,30,"ellipse");E(G)}finally{p.getModel().endUpdate()}if("horizontalTree"==f){var B=new mxCompactTreeLayout(p);B.edgeRouting=!1;B.levelDistance=30;B.sortEdges=!0;q="edgeStyle=elbowEdgeStyle;elbow=horizontal;"}else"verticalTree"==f?(B=new mxCompactTreeLayout(p,!1),B.edgeRouting=!1,B.levelDistance=30,B.sortEdges=!0,q="edgeStyle=elbowEdgeStyle;elbow=vertical;"):"radialTree"==f?(B=new mxRadialTreeLayout(p,+null!=p.view.getDrawPane()&&(l=p.view.getDrawPane().ownerSVGElement,null!=l&&(l.style.position="absolute"));var q="curved=1;";p.cellRenderer.installCellOverlayListeners=function(m,t,y){mxCellRenderer.prototype.installCellOverlayListeners.apply(this,arguments);mxEvent.addListener(y.node,mxClient.IS_POINTER?"pointerdown":"mousedown",function(z){t.fireEvent(new mxEventObject("pointerdown","event",z,"state",m))});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&mxEvent.addListener(y.node,"touchstart",function(z){t.fireEvent(new mxEventObject("pointerdown",+"event",z,"state",m))})};p.getAllConnectionConstraints=function(){return null};p.connectionHandler.marker.highlight.keepOnTop=!1;p.connectionHandler.createEdgeState=function(m){m=p.createEdge(null,null,null,null,null,q);return new mxCellState(this.graph.view,m,this.graph.getCellStyle(m))};var v=p.getDefaultParent(),D=mxUtils.bind(this,function(m){var t=new mxCellOverlay(this.connectImage,"Add outgoing");t.cursor="hand";t.addListener(mxEvent.CLICK,function(y,z){p.connectionHandler.reset();p.clearSelection();+var I=p.getCellGeometry(m),F;d(function(){F=p.insertVertex(v,null,"Entry",I.x,I.y,80,30,"rounded=1;");D(F);p.view.refresh(F);p.insertEdge(v,null,"",m,F,q)},function(){p.scrollCellToVisible(F)})});t.addListener("pointerdown",function(y,z){y=z.getProperty("event");z=z.getProperty("state");p.popupMenuHandler.hideMenu();p.stopEditing(!1);var I=mxUtils.convertPoint(p.container,mxEvent.getClientX(y),mxEvent.getClientY(y));p.connectionHandler.start(z,I.x,I.y);p.isMouseDown=!0;p.isMouseTrigger=mxEvent.isMouseEvent(y);+mxEvent.consume(y)});p.addCellOverlay(m,t)});p.getModel().beginUpdate();try{var G=p.insertVertex(v,null,"Start",0,0,80,30,"ellipse");D(G)}finally{p.getModel().endUpdate()}if("horizontalTree"==f){var B=new mxCompactTreeLayout(p);B.edgeRouting=!1;B.levelDistance=30;B.sortEdges=!0;q="edgeStyle=elbowEdgeStyle;elbow=horizontal;"}else"verticalTree"==f?(B=new mxCompactTreeLayout(p,!1),B.edgeRouting=!1,B.levelDistance=30,B.sortEdges=!0,q="edgeStyle=elbowEdgeStyle;elbow=vertical;"):"radialTree"==f?(B=new mxRadialTreeLayout(p,!1),B.edgeRouting=!1,B.levelDistance=80):"verticalFlow"==f?B=new mxHierarchicalLayout(p,mxConstants.DIRECTION_NORTH):"horizontalFlow"==f?B=new mxHierarchicalLayout(p,mxConstants.DIRECTION_WEST):"circle"==f?B=new mxCircleLayout(p):(B=new mxFastOrganicLayout(p,!1),B.forceConstant=80);if(null!=B){var d=function(m,t){p.getModel().beginUpdate();try{null!=m&&m(),B.execute(p.getDefaultParent(),G)}catch(y){throw y;}finally{m=new mxMorphing(p),m.addListener(mxEvent.DONE,mxUtils.bind(this,function(){p.getModel().endUpdate();-null!=t&&t()})),m.startAnimation()}},g=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=function(m,t,y,A,I){g.apply(this,arguments);d()};p.resizeCell=function(){mxGraph.prototype.resizeCell.apply(this,arguments);d()};p.connectionHandler.addListener(mxEvent.CONNECT,function(){d()})}l=mxUtils.button(mxResources.get("close"),function(){b.confirm(mxResources.get("areYouSure"),function(){b.hideDialog()})});l.className="geBtn";b.editor.cancelFirst&&c.appendChild(l);var k=mxUtils.button(mxResources.get("insert"),+null!=t&&t()})),m.startAnimation()}},g=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=function(m,t,y,z,I){g.apply(this,arguments);d()};p.resizeCell=function(){mxGraph.prototype.resizeCell.apply(this,arguments);d()};p.connectionHandler.addListener(mxEvent.CONNECT,function(){d()})}l=mxUtils.button(mxResources.get("close"),function(){b.confirm(mxResources.get("areYouSure"),function(){b.hideDialog()})});l.className="geBtn";b.editor.cancelFirst&&c.appendChild(l);var k=mxUtils.button(mxResources.get("insert"),function(m){p.clearCellOverlays();var t=p.getModel().getChildren(p.getDefaultParent());m=mxEvent.isAltDown(m)?b.editor.graph.getFreeInsertPoint():b.editor.graph.getCenterInsertPoint(p.getBoundingBoxFromGeometry(t,!0));t=b.editor.graph.importCells(t,m.x,m.y);m=b.editor.graph.view;var y=m.getBounds(t);null!=y&&(y.x-=m.translate.x,y.y-=m.translate.y,b.editor.graph.scrollRectToVisible(y),b.editor.graph.setSelectionCells(t));b.hideDialog()});c.appendChild(k);k.className="geBtn gePrimaryBtn";b.editor.cancelFirst||c.appendChild(l);this.graph=p};this.container=c};CreateGraphDialog.prototype.connectImage=new mxImage("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjQ3OTk0QjMyRDcyMTFFNThGQThGNDVBMjNBMjFDMzkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjQ3OTk0QjQyRDcyMTFFNThGQThGNDVBMjNBMjFDMzkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoyRjA0N0I2MjJENzExMUU1OEZBOEY0NUEyM0EyMUMzOSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGNDc5OTRCMjJENzIxMUU1OEZBOEY0NUEyM0EyMUMzOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PjIf+MgAAATlSURBVHjanFZraFxFFD735u4ru3ls0yZG26ShgmJoKK1J2vhIYzBgRdtIURHyw1hQUH9IxIgI2h8iCEUF/1RRlNQYCsYfCTHVhiTtNolpZCEStqSC22xIsrs1bDfu7t37Gs/cO3Ozxs1DBw73zpk555vzmHNGgJ0NYatFgmNLYUHYUoHASMz5ijmgVLmxgfKCUiBxC4ACJAeSG8nb1dVVOTc3dyoSibwWDofPBIPBJzo7O8vpGtvjpDICGztxkciECpF2LS0tvZtOpwNkk5FKpcYXFxffwL1+JuPgllPj8nk1F6RoaGjoKCqZ5ApljZDZO4SMRA0SuG2QUJIQRV8HxMOM9vf3H0ZZH9Nhg20MMl2QkFwjIyNHWlpahtADnuUMwLcRHX5aNSBjCJYEsSSLUeLEbhGe3ytCmQtA1/XY+Pj46dbW1iDuyCJp9BC5ycBj4hoeHq5ra2sbw0Xn1ZgBZ+dVkA1Lc+6p0Ck2p0QS4Ox9EhwpEylYcmBg4LH29vYQLilIOt0u5FhDfevNZDI/u93uw6PLOrwTUtjxrbPYbhD42WgMrF8JmR894ICmCgnQjVe8Xu8pXEkzMJKbuo5oNPomBbm1ZsD7s2kwFA1JZ6QBUXWT1nmGNc/qoMgavDcrQzxjQGFh4aOYIJ0sFAXcEtui4uLiVjr5KpSBVFYDDZVrWUaKRRWSAYeK0fmKykgDXbVoNaPChRuyqdDv97czL5nXxQbq6empQmsaklkDBiNpSwFVrmr2P6UyicD5piI4f8wHh0oEm8/p4h8pyGiEWvVQd3e3nxtjAzU1NR2jP7NRBWQ8GbdEzzJAmc0V3RR4cI8Dvmwuhc8fKUFA0d6/ltHg5p+Kuaejo6OeY0jcNJ/PV00ZS0nFUoZRvvFS1bZFsKHCCQ2Pl8H0chY+C96B6ZUsrCQ1qKtwQVFRURW/QhIXMAzDPAZ6BgOr8tTa8dDxCmiYGApaJbJMxSzV+brE8pdgWkcpY5dbMF1AR9XH8/xu2ilef48bvn92n82ZwHh+8ssqTEXS9p7dHisiiURikd8PbpExNTU1UVNTA3V3Y7lC16n0gpB/NwpNcZjfa7dScC4Qh0kOQCwnlEgi3F/hMVl9fX0zvKrzSk2lfXjRhj0eT/2rvWG4+Pta3oJY7XfC3hInXAv/ldeFLx8shQ+eqQL0UAAz7ylkpej5eNZRVBWL6BU6ef14OYiY1oqyTtmsavr/5koaRucT1pzx+ZpL1+GV5nLutksUgIcmtwTRiuuVZXnU5XId7A2swJkfFsymRWC91hHg1Viw6x23+7vn9sPJ+j20BE1hCXqSWaNSQ8ScbknRZWxub1PGCw/fBV+c3AeijlUbY5bBjEqr9GuYZP4jP41WudGSC6erTRCqdGZm5i1WvXWeDHnbBCZGc2Nj4wBl/hZOwrmBBfgmlID1HmGJutHaF+tKoevp/XCgstDkjo2NtWKLuc6AVN4mNjY+s1XQxoenOoFuDPHGtnRbJj9ej5GvL0dI7+giuRyMk1giazc+DP6vgUDgOJVlOv7R+PJ12QIeL6SyeDz+Kfp8ZrNWjgDTsVjsQ7qXyTjztXJhm9ePxFLfMTg4eG9tbe1RTP9KFFYQfHliYmIS69kCC7jKYmKwxxD5P88tkVkqbPPcIps9t4T/+HjcuJ/s5BFJgf4WYABCtxGuxIZ90gAAAABJRU5ErkJggg==",26,26);-var BackgroundImageDialog=function(b,e,f,c,l){function p(){null==x||x==mxConstants.NONE?(u.style.display="none",V.checked=!1):(u.style.backgroundColor=x,u.style.display="",V.checked=!0)}var q=b.editor.graph,v=document.createElement("div");v.style.whiteSpace="nowrap";var E=document.createElement("h2");mxUtils.write(E,mxResources.get("background"));E.style.marginTop="0px";v.appendChild(E);var G=null!=f&&null!=f.originalSrc;E=!1;var B=document.createElement("input");B.style.cssText="margin-right:8px;margin-bottom:8px;";B.setAttribute("value",+var BackgroundImageDialog=function(b,e,f,c,l){function p(){null==x||x==mxConstants.NONE?(u.style.display="none",V.checked=!1):(u.style.backgroundColor=x,u.style.display="",V.checked=!0)}var q=b.editor.graph,v=document.createElement("div");v.style.whiteSpace="nowrap";var D=document.createElement("h2");mxUtils.write(D,mxResources.get("background"));D.style.marginTop="0px";v.appendChild(D);var G=null!=f&&null!=f.originalSrc;D=!1;var B=document.createElement("input");B.style.cssText="margin-right:8px;margin-bottom:8px;";B.setAttribute("value","url");B.setAttribute("type","radio");B.setAttribute("name","geBackgroundImageDialogOption");var d=document.createElement("input");d.style.cssText="margin-right:8px;margin-bottom:8px;";d.setAttribute("value","url");d.setAttribute("type","radio");d.setAttribute("name","geBackgroundImageDialogOption");var g=document.createElement("input");g.setAttribute("type","text");g.style.marginBottom="8px";g.style.width="360px";g.value=G||null==f?"":f.src;var k=document.createElement("select");k.style.width="360px";-if(null!=b.pages)for(var m=0;m<b.pages.length;m++){var t=document.createElement("option");mxUtils.write(t,b.pages[m].getName()||mxResources.get("pageWithNumber",[m+1]));t.setAttribute("value","data:page/id,"+b.pages[m].getId());b.pages[m]==b.currentPage&&t.setAttribute("disabled","disabled");null!=f&&f.originalSrc==t.getAttribute("value")&&(t.setAttribute("selected","selected"),E=!0);k.appendChild(t)}G||null!=b.pages&&1!=b.pages.length||(B.style.display="none",d.style.display="none",k.style.display=-"none");var y=document.createElement("option"),A=!1,I=!1,F=function(H,K){A||null!=H&&I||(d.checked?null!=K&&K(y.selected?null:k.value):""==g.value||b.isOffline()?(Q.value="",S.value="",null!=K&&K("")):(g.value=mxUtils.trim(g.value),b.loadImage(g.value,function(O){Q.value=O.width;S.value=O.height;null!=K&&K(g.value)},function(){b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));Q.value="";S.value="";null!=K&&K(null)})))},C=mxUtils.bind(this,function(H){b.importFiles(H,-0,0,b.maxBackgroundSize,function(K,O,M,n,z,D){g.value=K;F();g.focus()},function(){},function(K){return"image/"==K.type.substring(0,6)},function(K){for(var O=0;O<K.length;O++)K[O]()},!0,b.maxBackgroundBytes,b.maxBackgroundBytes,!0)});this.init=function(){G?k.focus():g.focus();mxEvent.addListener(k,"focus",function(){B.removeAttribute("checked");d.setAttribute("checked","checked");d.checked=!0});mxEvent.addListener(g,"focus",function(){d.removeAttribute("checked");B.setAttribute("checked","checked");-B.checked=!0});if(Graph.fileSupport){g.setAttribute("placeholder",mxResources.get("dragImagesHere"));var H=v.parentNode,K=null;mxEvent.addListener(H,"dragleave",function(O){null!=K&&(K.parentNode.removeChild(K),K=null);O.stopPropagation();O.preventDefault()});mxEvent.addListener(H,"dragover",mxUtils.bind(this,function(O){null==K&&(!mxClient.IS_IE||10<document.documentMode)&&(K=b.highlightElement(H));O.stopPropagation();O.preventDefault()}));mxEvent.addListener(H,"drop",mxUtils.bind(this,function(O){null!=-K&&(K.parentNode.removeChild(K),K=null);if(0<O.dataTransfer.files.length)C(O.dataTransfer.files);else if(0<=mxUtils.indexOf(O.dataTransfer.types,"text/uri-list")){var M=O.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(M)&&(g.value=decodeURIComponent(M),F())}O.stopPropagation();O.preventDefault()}),!1)}};v.appendChild(B);v.appendChild(g);mxUtils.br(v);m=document.createElement("span");m.style.marginLeft="30px";mxUtils.write(m,mxResources.get("width")+":");v.appendChild(m);+if(null!=b.pages)for(var m=0;m<b.pages.length;m++){var t=document.createElement("option");mxUtils.write(t,b.pages[m].getName()||mxResources.get("pageWithNumber",[m+1]));t.setAttribute("value","data:page/id,"+b.pages[m].getId());b.pages[m]==b.currentPage&&t.setAttribute("disabled","disabled");null!=f&&f.originalSrc==t.getAttribute("value")&&(t.setAttribute("selected","selected"),D=!0);k.appendChild(t)}G||null!=b.pages&&1!=b.pages.length||(B.style.display="none",d.style.display="none",k.style.display=+"none");var y=document.createElement("option"),z=!1,I=!1,F=function(H,K){z||null!=H&&I||(d.checked?null!=K&&K(y.selected?null:k.value):""==g.value||b.isOffline()?(Q.value="",S.value="",null!=K&&K("")):(g.value=mxUtils.trim(g.value),b.loadImage(g.value,function(N){Q.value=N.width;S.value=N.height;null!=K&&K(g.value)},function(){b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));Q.value="";S.value="";null!=K&&K(null)})))},C=mxUtils.bind(this,function(H){b.importFiles(H,+0,0,b.maxBackgroundSize,function(K,N,M,n,A,E){g.value=K;F();g.focus()},function(){},function(K){return"image/"==K.type.substring(0,6)},function(K){for(var N=0;N<K.length;N++)K[N]()},!0,b.maxBackgroundBytes,b.maxBackgroundBytes,!0)});this.init=function(){G?k.focus():g.focus();mxEvent.addListener(k,"focus",function(){B.removeAttribute("checked");d.setAttribute("checked","checked");d.checked=!0});mxEvent.addListener(g,"focus",function(){d.removeAttribute("checked");B.setAttribute("checked","checked");+B.checked=!0});if(Graph.fileSupport){g.setAttribute("placeholder",mxResources.get("dragImagesHere"));var H=v.parentNode,K=null;mxEvent.addListener(H,"dragleave",function(N){null!=K&&(K.parentNode.removeChild(K),K=null);N.stopPropagation();N.preventDefault()});mxEvent.addListener(H,"dragover",mxUtils.bind(this,function(N){null==K&&(!mxClient.IS_IE||10<document.documentMode)&&(K=b.highlightElement(H));N.stopPropagation();N.preventDefault()}));mxEvent.addListener(H,"drop",mxUtils.bind(this,function(N){null!=+K&&(K.parentNode.removeChild(K),K=null);if(0<N.dataTransfer.files.length)C(N.dataTransfer.files);else if(0<=mxUtils.indexOf(N.dataTransfer.types,"text/uri-list")){var M=N.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(M)&&(g.value=decodeURIComponent(M),F())}N.stopPropagation();N.preventDefault()}),!1)}};v.appendChild(B);v.appendChild(g);mxUtils.br(v);m=document.createElement("span");m.style.marginLeft="30px";mxUtils.write(m,mxResources.get("width")+":");v.appendChild(m);var Q=document.createElement("input");Q.setAttribute("type","text");Q.style.width="60px";Q.style.marginLeft="8px";Q.style.marginRight="16px";Q.value=null==f||G?"":f.width;v.appendChild(Q);mxUtils.write(v,mxResources.get("height")+":");var S=document.createElement("input");S.setAttribute("type","text");S.style.width="60px";S.style.marginLeft="8px";S.style.marginRight="16px";S.value=null==f||G?"":f.height;v.appendChild(S);mxUtils.br(v);mxUtils.br(v);mxEvent.addListener(g,"change",F);ImageDialog.filePicked=-function(H){H.action==google.picker.Action.PICKED&&null!=H.docs[0].thumbnails&&(H=H.docs[0].thumbnails[H.docs[0].thumbnails.length-1],null!=H&&(g.value=H.url,F()));g.focus()};v.appendChild(d);v.appendChild(k);mxUtils.br(v);mxUtils.br(v);G?(d.setAttribute("checked","checked"),d.checked=!0):(B.setAttribute("checked","checked"),B.checked=!0);!E&&d.checked&&(mxUtils.write(y,mxResources.get("pageNotFound")),y.setAttribute("disabled","disabled"),y.setAttribute("selected","selected"),y.setAttribute("value",+function(H){H.action==google.picker.Action.PICKED&&null!=H.docs[0].thumbnails&&(H=H.docs[0].thumbnails[H.docs[0].thumbnails.length-1],null!=H&&(g.value=H.url,F()));g.focus()};v.appendChild(d);v.appendChild(k);mxUtils.br(v);mxUtils.br(v);G?(d.setAttribute("checked","checked"),d.checked=!0):(B.setAttribute("checked","checked"),B.checked=!0);!D&&d.checked&&(mxUtils.write(y,mxResources.get("pageNotFound")),y.setAttribute("disabled","disabled"),y.setAttribute("selected","selected"),y.setAttribute("value","pageNotFound"),k.appendChild(y),mxEvent.addListener(k,"change",function(){null==y.parentNode||y.selected||y.parentNode.removeChild(y)}));f=document.createElement("div");f.style.display=l?"inline-flex":"none";f.style.alignItems="center";f.style.cursor="default";f.style.minWidth="40%";f.style.height="20px";var V=document.createElement("input");V.setAttribute("type","checkbox");V.style.margin="0px 10px 0px 4px";V.style.verticalAlign="bottom";V.defaultChecked=c!=mxConstants.NONE&&null!=c;V.checked=V.defaultChecked;f.appendChild(V);mxUtils.write(f,mxResources.get("fillColor"));l=f.cloneNode(!1);var P=document.createElement("input");P.setAttribute("type","checkbox");P.style.margin="0px 10px 0px 30px";P.style.verticalAlign="bottom";P.defaultChecked=q.shadowVisible;P.checked=P.defaultChecked;l.appendChild(P);mxUtils.write(l,mxResources.get("shadow"));mxClient.IS_SVG&&!mxClient.IS_SF||P.setAttribute("disabled","disabled");mxEvent.addListener(l,"click",function(H){mxEvent.getSource(H)!=P&&(P.checked=!P.checked)});var u=document.createElement("button");u.style.width="36px";u.style.height="18px";u.style.cursor="pointer";u.style.marginLeft="10px";u.style.backgroundPosition="center center";u.style.backgroundRepeat="no-repeat";u.style.verticalAlign="bottom";u.className="geColorBtn";var x=c;p();mxEvent.addListener(f,"click",function(H){mxEvent.getSource(H)!=V&&(V.checked=!V.checked);x=V.checked?"#ffffff":null;p()});mxEvent.addListener(u,"click",function(H){b.pickColor(x||"none",function(K){x=K;p()});mxEvent.consume(H)});-f.appendChild(u);v.appendChild(f);v.appendChild(l);mxUtils.br(v);c=document.createElement("div");c.style.marginTop="30px";c.style.textAlign="right";q=mxUtils.button(mxResources.get("cancel"),function(){A=!0;b.hideDialog()});q.className="geBtn";b.editor.cancelFirst&&c.appendChild(q);l=mxUtils.button(mxResources.get("reset"),function(){g.value="";Q.value="";S.value="";B.checked=!0;x=mxConstants.NONE;p();A=!1});mxEvent.addGestureListeners(l,function(){A=!0});l.className="geBtn";l.width="100";c.appendChild(l);+f.appendChild(u);v.appendChild(f);v.appendChild(l);mxUtils.br(v);c=document.createElement("div");c.style.marginTop="30px";c.style.textAlign="right";q=mxUtils.button(mxResources.get("cancel"),function(){z=!0;b.hideDialog()});q.className="geBtn";b.editor.cancelFirst&&c.appendChild(q);l=mxUtils.button(mxResources.get("reset"),function(){g.value="";Q.value="";S.value="";B.checked=!0;x=mxConstants.NONE;p();z=!1});mxEvent.addGestureListeners(l,function(){z=!0});l.className="geBtn";l.width="100";c.appendChild(l);if(Graph.fileSupport){var J=document.createElement("input");J.setAttribute("multiple","multiple");J.setAttribute("type","file");mxEvent.addListener(J,"change",function(H){null!=J.files&&(C(J.files),J.type="",J.type="file",J.value="")});J.style.display="none";v.appendChild(J);l=mxUtils.button(mxResources.get("open"),function(){J.click()});l.className="geBtn";c.appendChild(l)}applyBtn=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();F(null,function(H){e(""!=H&&null!=H?new mxImage(H,-Q.value,S.value):null,null==H,x,!mxClient.IS_SVG||mxClient.IS_SF?null:P.checked)})});mxEvent.addGestureListeners(applyBtn,function(){I=!0});applyBtn.className="geBtn gePrimaryBtn";c.appendChild(applyBtn);b.editor.cancelFirst||c.appendChild(q);v.appendChild(c);this.container=v},ParseDialog=function(b,e,f){function c(k,m,t){var y=k.split("\n");if("plantUmlPng"==m||"plantUmlSvg"==m||"plantUmlTxt"==m){if(b.spinner.spin(document.body,mxResources.get("inserting"))){var A=function(M,n,z,D,L){p=mxEvent.isAltDown(t)?-p:I.getCenterInsertPoint(new mxRectangle(0,0,D,L));var N=null;I.getModel().beginUpdate();try{N="txt"==n?b.insertAsPreText(z,p.x,p.y):I.insertVertex(null,null,null,p.x,p.y,D,L,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+b.convertDataUri(z)+";"),I.setAttributeForCell(N,"plantUmlData",JSON.stringify({data:M,format:n},null,2))}finally{I.getModel().endUpdate()}null!=N&&(I.setSelectionCell(N),I.scrollCellToVisible(N))},I=b.editor.graph,F="plantUmlTxt"==m?"txt":"plantUmlPng"==-m?"png":"svg";"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: Another authentication Response\n@enduml"==k&&"svg"==F?window.setTimeout(function(){b.spinner.stop();A(k,F,"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBjb250ZW50U2NyaXB0VHlwZT0iYXBwbGljYXRpb24vZWNtYXNjcmlwdCIgY29udGVudFN0eWxlVHlwZT0idGV4dC9jc3MiIGhlaWdodD0iMjEycHgiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiIHN0eWxlPSJ3aWR0aDoyOTVweDtoZWlnaHQ6MjEycHg7IiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAyOTUgMjEyIiB3aWR0aD0iMjk1cHgiIHpvb21BbmRQYW49Im1hZ25pZnkiPjxkZWZzLz48Zz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsgc3Ryb2tlLWRhc2hhcnJheTogNS4wLDUuMDsiIHgxPSIzMSIgeDI9IjMxIiB5MT0iMzQuNDg4MyIgeTI9IjE3MS43MzA1Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7IHN0cm9rZS1kYXNoYXJyYXk6IDUuMCw1LjA7IiB4MT0iMjY0LjUiIHgyPSIyNjQuNSIgeTE9IjM0LjQ4ODMiIHkyPSIxNzEuNzMwNSIvPjxyZWN0IGZpbGw9IiNGRUZFQ0UiIGhlaWdodD0iMzAuNDg4MyIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjU7IiB3aWR0aD0iNDciIHg9IjgiIHk9IjMiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIzMyIgeD0iMTUiIHk9IjIzLjUzNTIiPkFsaWNlPC90ZXh0PjxyZWN0IGZpbGw9IiNGRUZFQ0UiIGhlaWdodD0iMzAuNDg4MyIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjU7IiB3aWR0aD0iNDciIHg9IjgiIHk9IjE3MC43MzA1Ii8+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGxlbmd0aEFkanVzdD0ic3BhY2luZ0FuZEdseXBocyIgdGV4dExlbmd0aD0iMzMiIHg9IjE1IiB5PSIxOTEuMjY1NiI+QWxpY2U8L3RleHQ+PHJlY3QgZmlsbD0iI0ZFRkVDRSIgaGVpZ2h0PSIzMC40ODgzIiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuNTsiIHdpZHRoPSI0MCIgeD0iMjQ0LjUiIHk9IjMiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIyNiIgeD0iMjUxLjUiIHk9IjIzLjUzNTIiPkJvYjwvdGV4dD48cmVjdCBmaWxsPSIjRkVGRUNFIiBoZWlnaHQ9IjMwLjQ4ODMiIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS41OyIgd2lkdGg9IjQwIiB4PSIyNDQuNSIgeT0iMTcwLjczMDUiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIyNiIgeD0iMjUxLjUiIHk9IjE5MS4yNjU2Ij5Cb2I8L3RleHQ+PHBvbHlnb24gZmlsbD0iI0E4MDAzNiIgcG9pbnRzPSIyNTIuNSw2MS43OTg4LDI2Mi41LDY1Ljc5ODgsMjUyLjUsNjkuNzk4OCwyNTYuNSw2NS43OTg4IiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiLz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiIHgxPSIzMS41IiB4Mj0iMjU4LjUiIHkxPSI2NS43OTg4IiB5Mj0iNjUuNzk4OCIvPjx0ZXh0IGZpbGw9IiMwMDAwMDAiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEzIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmdBbmRHbHlwaHMiIHRleHRMZW5ndGg9IjE0NyIgeD0iMzguNSIgeT0iNjEuMDU2NiI+QXV0aGVudGljYXRpb24gUmVxdWVzdDwvdGV4dD48cG9seWdvbiBmaWxsPSIjQTgwMDM2IiBwb2ludHM9IjQyLjUsOTEuMTA5NCwzMi41LDk1LjEwOTQsNDIuNSw5OS4xMDk0LDM4LjUsOTUuMTA5NCIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7IHN0cm9rZS1kYXNoYXJyYXk6IDIuMCwyLjA7IiB4MT0iMzYuNSIgeDI9IjI2My41IiB5MT0iOTUuMTA5NCIgeTI9Ijk1LjEwOTQiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMyIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIxNTciIHg9IjQ4LjUiIHk9IjkwLjM2NzIiPkF1dGhlbnRpY2F0aW9uIFJlc3BvbnNlPC90ZXh0Pjxwb2x5Z29uIGZpbGw9IiNBODAwMzYiIHBvaW50cz0iMjUyLjUsMTIwLjQxOTksMjYyLjUsMTI0LjQxOTksMjUyLjUsMTI4LjQxOTksMjU2LjUsMTI0LjQxOTkiIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS4wOyIvPjxsaW5lIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS4wOyIgeDE9IjMxLjUiIHgyPSIyNTguNSIgeTE9IjEyNC40MTk5IiB5Mj0iMTI0LjQxOTkiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMyIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIxOTkiIHg9IjM4LjUiIHk9IjExOS42Nzc3Ij5Bbm90aGVyIGF1dGhlbnRpY2F0aW9uIFJlcXVlc3Q8L3RleHQ+PHBvbHlnb24gZmlsbD0iI0E4MDAzNiIgcG9pbnRzPSI0Mi41LDE0OS43MzA1LDMyLjUsMTUzLjczMDUsNDIuNSwxNTcuNzMwNSwzOC41LDE1My43MzA1IiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiLz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsgc3Ryb2tlLWRhc2hhcnJheTogMi4wLDIuMDsiIHgxPSIzNi41IiB4Mj0iMjYzLjUiIHkxPSIxNTMuNzMwNSIgeTI9IjE1My43MzA1Ii8+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTMiIGxlbmd0aEFkanVzdD0ic3BhY2luZ0FuZEdseXBocyIgdGV4dExlbmd0aD0iMjA5IiB4PSI0OC41IiB5PSIxNDguOTg4MyI+QW5vdGhlciBhdXRoZW50aWNhdGlvbiBSZXNwb25zZTwvdGV4dD48IS0tTUQ1PVs3ZjNlNGQwYzkwMWVmZGJjNTdlYjQ0MjQ5YTNiODE5N10KQHN0YXJ0dW1sDQpza2lucGFyYW0gc2hhZG93aW5nIGZhbHNlDQpBbGljZSAtPiBCb2I6IEF1dGhlbnRpY2F0aW9uIFJlcXVlc3QNCkJvYiAtIC0+IEFsaWNlOiBBdXRoZW50aWNhdGlvbiBSZXNwb25zZQ0KDQpBbGljZSAtPiBCb2I6IEFub3RoZXIgYXV0aGVudGljYXRpb24gUmVxdWVzdA0KQWxpY2UgPC0gLSBCb2I6IEFub3RoZXIgYXV0aGVudGljYXRpb24gUmVzcG9uc2UNCkBlbmR1bWwNCgpQbGFudFVNTCB2ZXJzaW9uIDEuMjAyMC4wMihTdW4gTWFyIDAxIDA0OjIyOjA3IENTVCAyMDIwKQooTUlUIHNvdXJjZSBkaXN0cmlidXRpb24pCkphdmEgUnVudGltZTogT3BlbkpESyBSdW50aW1lIEVudmlyb25tZW50CkpWTTogT3BlbkpESyA2NC1CaXQgU2VydmVyIFZNCkphdmEgVmVyc2lvbjogMTIrMzMKT3BlcmF0aW5nIFN5c3RlbTogTWFjIE9TIFgKRGVmYXVsdCBFbmNvZGluZzogVVRGLTgKTGFuZ3VhZ2U6IGVuCkNvdW50cnk6IFVTCi0tPjwvZz48L3N2Zz4=",-295,212)},200):b.generatePlantUmlImage(k,F,function(M,n,z){b.spinner.stop();A(k,F,M,n,z)},function(M){b.handleError(M)})}}else if("mermaid"==m||"mermaid2drawio"==m){if(b.spinner.spin(document.body,mxResources.get("inserting"))){for(var C=0;C<y.length&&(0==y[C].trim().length||"%%"==y[C].substring(0,2));)C++;if("---"==y[C].trim()){do C++;while(C<y.length&&"---"!=y[C].trim());C++}C=y[C].trim().toLowerCase();y=C.indexOf(" ");C=C.substring(0,0<y?y:C.length);var Q="undefined"!==typeof mxMermaidToDrawio&&-"mermaid2drawio"==m&&("graph"==C||"flowchart"==C||"sequencediagram"==C||"classdiagram"==C||"statediagram-v2"==C||"statediagram"==C||"erdiagram"==C||"requirementdiagram"==C||"gitgraph"==C||"mindmap"==C||"journey"==C);I=b.editor.graph;Q&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(M){b.spinner.stop();I.setSelectionCells(b.importXml(M,Math.max(p.x,20),Math.max(p.y,20),!0,null,null,!0));I.scrollCellToVisible(I.getSelectionCell())}));b.generateMermaidImage(k,null,function(M,n,z){if(!Q){p=-mxEvent.isAltDown(t)?p:I.getCenterInsertPoint(new mxRectangle(0,0,n,z));b.spinner.stop();var D=null;I.getModel().beginUpdate();try{D=I.insertVertex(null,null,null,p.x,p.y,n,z,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+M+";"),I.setAttributeForCell(D,"mermaidData",JSON.stringify({data:k},null,2))}finally{I.getModel().endUpdate()}null!=D&&(I.setSelectionCell(D),I.scrollCellToVisible(D))}},function(M){"undefined"!==typeof mxMermaidToDrawio&&mxMermaidToDrawio.resetListeners();b.handleError(M)})}}else if("table"==+Q.value,S.value):null,null==H,x,!mxClient.IS_SVG||mxClient.IS_SF?null:P.checked)})});mxEvent.addGestureListeners(applyBtn,function(){I=!0});applyBtn.className="geBtn gePrimaryBtn";c.appendChild(applyBtn);b.editor.cancelFirst||c.appendChild(q);v.appendChild(c);this.container=v},ParseDialog=function(b,e,f){function c(k,m,t){var y=k.split("\n");if("plantUmlPng"==m||"plantUmlSvg"==m||"plantUmlTxt"==m){if(b.spinner.spin(document.body,mxResources.get("inserting"))){var z=function(M,n,A,E,L){p=mxEvent.isAltDown(t)?+p:I.getCenterInsertPoint(new mxRectangle(0,0,E,L));var O=null;I.getModel().beginUpdate();try{O="txt"==n?b.insertAsPreText(A,p.x,p.y):I.insertVertex(null,null,null,p.x,p.y,E,L,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+b.convertDataUri(A)+";"),I.setAttributeForCell(O,"plantUmlData",JSON.stringify({data:M,format:n},null,2))}finally{I.getModel().endUpdate()}null!=O&&(I.setSelectionCell(O),I.scrollCellToVisible(O))},I=b.editor.graph,F="plantUmlTxt"==m?"txt":"plantUmlPng"==+m?"png":"svg";"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: Another authentication Response\n@enduml"==k&&"svg"==F?window.setTimeout(function(){b.spinner.stop();z(k,F,"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBjb250ZW50U2NyaXB0VHlwZT0iYXBwbGljYXRpb24vZWNtYXNjcmlwdCIgY29udGVudFN0eWxlVHlwZT0idGV4dC9jc3MiIGhlaWdodD0iMjEycHgiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiIHN0eWxlPSJ3aWR0aDoyOTVweDtoZWlnaHQ6MjEycHg7IiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAyOTUgMjEyIiB3aWR0aD0iMjk1cHgiIHpvb21BbmRQYW49Im1hZ25pZnkiPjxkZWZzLz48Zz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsgc3Ryb2tlLWRhc2hhcnJheTogNS4wLDUuMDsiIHgxPSIzMSIgeDI9IjMxIiB5MT0iMzQuNDg4MyIgeTI9IjE3MS43MzA1Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7IHN0cm9rZS1kYXNoYXJyYXk6IDUuMCw1LjA7IiB4MT0iMjY0LjUiIHgyPSIyNjQuNSIgeTE9IjM0LjQ4ODMiIHkyPSIxNzEuNzMwNSIvPjxyZWN0IGZpbGw9IiNGRUZFQ0UiIGhlaWdodD0iMzAuNDg4MyIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjU7IiB3aWR0aD0iNDciIHg9IjgiIHk9IjMiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIzMyIgeD0iMTUiIHk9IjIzLjUzNTIiPkFsaWNlPC90ZXh0PjxyZWN0IGZpbGw9IiNGRUZFQ0UiIGhlaWdodD0iMzAuNDg4MyIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjU7IiB3aWR0aD0iNDciIHg9IjgiIHk9IjE3MC43MzA1Ii8+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGxlbmd0aEFkanVzdD0ic3BhY2luZ0FuZEdseXBocyIgdGV4dExlbmd0aD0iMzMiIHg9IjE1IiB5PSIxOTEuMjY1NiI+QWxpY2U8L3RleHQ+PHJlY3QgZmlsbD0iI0ZFRkVDRSIgaGVpZ2h0PSIzMC40ODgzIiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuNTsiIHdpZHRoPSI0MCIgeD0iMjQ0LjUiIHk9IjMiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIyNiIgeD0iMjUxLjUiIHk9IjIzLjUzNTIiPkJvYjwvdGV4dD48cmVjdCBmaWxsPSIjRkVGRUNFIiBoZWlnaHQ9IjMwLjQ4ODMiIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS41OyIgd2lkdGg9IjQwIiB4PSIyNDQuNSIgeT0iMTcwLjczMDUiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIyNiIgeD0iMjUxLjUiIHk9IjE5MS4yNjU2Ij5Cb2I8L3RleHQ+PHBvbHlnb24gZmlsbD0iI0E4MDAzNiIgcG9pbnRzPSIyNTIuNSw2MS43OTg4LDI2Mi41LDY1Ljc5ODgsMjUyLjUsNjkuNzk4OCwyNTYuNSw2NS43OTg4IiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiLz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiIHgxPSIzMS41IiB4Mj0iMjU4LjUiIHkxPSI2NS43OTg4IiB5Mj0iNjUuNzk4OCIvPjx0ZXh0IGZpbGw9IiMwMDAwMDAiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEzIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmdBbmRHbHlwaHMiIHRleHRMZW5ndGg9IjE0NyIgeD0iMzguNSIgeT0iNjEuMDU2NiI+QXV0aGVudGljYXRpb24gUmVxdWVzdDwvdGV4dD48cG9seWdvbiBmaWxsPSIjQTgwMDM2IiBwb2ludHM9IjQyLjUsOTEuMTA5NCwzMi41LDk1LjEwOTQsNDIuNSw5OS4xMDk0LDM4LjUsOTUuMTA5NCIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7IHN0cm9rZS1kYXNoYXJyYXk6IDIuMCwyLjA7IiB4MT0iMzYuNSIgeDI9IjI2My41IiB5MT0iOTUuMTA5NCIgeTI9Ijk1LjEwOTQiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMyIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIxNTciIHg9IjQ4LjUiIHk9IjkwLjM2NzIiPkF1dGhlbnRpY2F0aW9uIFJlc3BvbnNlPC90ZXh0Pjxwb2x5Z29uIGZpbGw9IiNBODAwMzYiIHBvaW50cz0iMjUyLjUsMTIwLjQxOTksMjYyLjUsMTI0LjQxOTksMjUyLjUsMTI4LjQxOTksMjU2LjUsMTI0LjQxOTkiIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS4wOyIvPjxsaW5lIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS4wOyIgeDE9IjMxLjUiIHgyPSIyNTguNSIgeTE9IjEyNC40MTk5IiB5Mj0iMTI0LjQxOTkiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMyIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIxOTkiIHg9IjM4LjUiIHk9IjExOS42Nzc3Ij5Bbm90aGVyIGF1dGhlbnRpY2F0aW9uIFJlcXVlc3Q8L3RleHQ+PHBvbHlnb24gZmlsbD0iI0E4MDAzNiIgcG9pbnRzPSI0Mi41LDE0OS43MzA1LDMyLjUsMTUzLjczMDUsNDIuNSwxNTcuNzMwNSwzOC41LDE1My43MzA1IiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiLz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsgc3Ryb2tlLWRhc2hhcnJheTogMi4wLDIuMDsiIHgxPSIzNi41IiB4Mj0iMjYzLjUiIHkxPSIxNTMuNzMwNSIgeTI9IjE1My43MzA1Ii8+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTMiIGxlbmd0aEFkanVzdD0ic3BhY2luZ0FuZEdseXBocyIgdGV4dExlbmd0aD0iMjA5IiB4PSI0OC41IiB5PSIxNDguOTg4MyI+QW5vdGhlciBhdXRoZW50aWNhdGlvbiBSZXNwb25zZTwvdGV4dD48IS0tTUQ1PVs3ZjNlNGQwYzkwMWVmZGJjNTdlYjQ0MjQ5YTNiODE5N10KQHN0YXJ0dW1sDQpza2lucGFyYW0gc2hhZG93aW5nIGZhbHNlDQpBbGljZSAtPiBCb2I6IEF1dGhlbnRpY2F0aW9uIFJlcXVlc3QNCkJvYiAtIC0+IEFsaWNlOiBBdXRoZW50aWNhdGlvbiBSZXNwb25zZQ0KDQpBbGljZSAtPiBCb2I6IEFub3RoZXIgYXV0aGVudGljYXRpb24gUmVxdWVzdA0KQWxpY2UgPC0gLSBCb2I6IEFub3RoZXIgYXV0aGVudGljYXRpb24gUmVzcG9uc2UNCkBlbmR1bWwNCgpQbGFudFVNTCB2ZXJzaW9uIDEuMjAyMC4wMihTdW4gTWFyIDAxIDA0OjIyOjA3IENTVCAyMDIwKQooTUlUIHNvdXJjZSBkaXN0cmlidXRpb24pCkphdmEgUnVudGltZTogT3BlbkpESyBSdW50aW1lIEVudmlyb25tZW50CkpWTTogT3BlbkpESyA2NC1CaXQgU2VydmVyIFZNCkphdmEgVmVyc2lvbjogMTIrMzMKT3BlcmF0aW5nIFN5c3RlbTogTWFjIE9TIFgKRGVmYXVsdCBFbmNvZGluZzogVVRGLTgKTGFuZ3VhZ2U6IGVuCkNvdW50cnk6IFVTCi0tPjwvZz48L3N2Zz4=",+295,212)},200):b.generatePlantUmlImage(k,F,function(M,n,A){b.spinner.stop();z(k,F,M,n,A)},function(M){b.handleError(M)})}}else if("mermaid"==m||"mermaid2drawio"==m){if(b.spinner.spin(document.body,mxResources.get("inserting"))){for(var C=0;C<y.length&&(0==y[C].trim().length||"%%"==y[C].substring(0,2));)C++;if("---"==y[C].trim()){do C++;while(C<y.length&&"---"!=y[C].trim());C++}C=y[C].trim().toLowerCase();y=C.indexOf(" ");C=C.substring(0,0<y?y:C.length);var Q="undefined"!==typeof mxMermaidToDrawio&&+"mermaid2drawio"==m&&("graph"==C||"flowchart"==C||"sequencediagram"==C||"classdiagram"==C||"statediagram-v2"==C||"statediagram"==C||"erdiagram"==C||"requirementdiagram"==C||"gitgraph"==C||"mindmap"==C||"journey"==C);I=b.editor.graph;Q&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(M){b.spinner.stop();I.setSelectionCells(b.importXml(M,Math.max(p.x,20),Math.max(p.y,20),!0,null,null,!0));I.scrollCellToVisible(I.getSelectionCell())}));b.generateMermaidImage(k,null,function(M,n,A){if(!Q){p=+mxEvent.isAltDown(t)?p:I.getCenterInsertPoint(new mxRectangle(0,0,n,A));b.spinner.stop();var E=null;I.getModel().beginUpdate();try{E=I.insertVertex(null,null,null,p.x,p.y,n,A,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+M+";"),I.setAttributeForCell(E,"mermaidData",JSON.stringify({data:k},null,2))}finally{I.getModel().endUpdate()}null!=E&&(I.setSelectionCell(E),I.scrollCellToVisible(E))}},function(M){"undefined"!==typeof mxMermaidToDrawio&&mxMermaidToDrawio.resetListeners();b.handleError(M)})}}else if("table"==m){m=null;var S=[],V=0,P={};for(C=0;C<y.length;C++){var u=mxUtils.trim(y[C]);if("primary key"==u.substring(0,11).toLowerCase()){var x=u.match(/\((.+)\)/);x&&x[1]&&(P[x[1]]=!0);y.splice(C,1)}else 0<u.toLowerCase().indexOf("primary key")&&(P[u.split(" ")[0]]=!0,y[C]=mxUtils.trim(u.replace(/primary key/i,"")))}for(C=0;C<y.length;C++)if(u=mxUtils.trim(y[C]),"create table"==u.substring(0,12).toLowerCase())u=mxUtils.trim(u.substring(12)),"("==u.charAt(u.length-1)&&(u=mxUtils.trim(u.substring(0,u.length-1))),m=new mxCell(u,new mxGeometry(V,0,160,30),"shape=table;startSize=30;container=1;collapsible=1;childLayout=tableLayout;fixedRows=1;rowLines=0;fontStyle=1;align=center;resizeLast=1;"),m.vertex=!0,S.push(m),u=b.editor.graph.getPreferredSizeForCell(J),null!=u&&(m.geometry.width=u.width+10);else if(null!=m&&")"==u.charAt(0))V+=m.geometry.width+40,m=null;else if("("!=u&&null!=m){u=u.substring(0,","==u.charAt(u.length-1)?u.length-1:u.length);x=P[u.split(" ")[0]];var J=new mxCell("",new mxGeometry(0,0,160,30),"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;fillColor=none;collapsible=0;dropTarget=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;strokeColor=inherit;top=0;left=0;right=0;bottom="+(x?"1":"0")+";");J.vertex=!0;var H=new mxCell(x?"PK":"",new mxGeometry(0,0,30,30),"shape=partialRectangle;overflow=hidden;connectable=0;fillColor=none;strokeColor=inherit;top=0;left=0;bottom=0;right=0;"+(x?"fontStyle=1;":""));H.vertex=!0;J.insert(H);u=new mxCell(u,new mxGeometry(30,@@ -12305,19 +12311,19 @@ m){m=null;var S=[],V=0,P={};for(C=0;C<y.length;C++){var u=mxUtils.trim(y[C]);if(!0)),I.setSelectionCells(I.importCells(S,p.x,p.y)),I.scrollCellToVisible(I.getSelectionCell()))}else if("list"==m){if(0<y.length){I=b.editor.graph;m=null;S=[];for(C=J=0;C<y.length;C++)";"!=y[C].charAt(0)&&(0==y[C].length?m=null:null==m?(m=new mxCell(y[C],new mxGeometry(J,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;"),m.vertex=!0,S.push(m),u=I.getPreferredSizeForCell(m),null!=u&&m.geometry.width<u.width+10&&(m.geometry.width=u.width+10),J+=m.geometry.width+40):"--"==y[C]?(u=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),u.vertex=!0,m.geometry.height+=u.geometry.height,m.insert(u)):0<y[C].length&&(V=new mxCell(y[C],new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"),V.vertex=!0,u=I.getPreferredSizeForCell(V),null!=u&&V.geometry.width<u.width&&(V.geometry.width=u.width),m.geometry.width=Math.max(m.geometry.width,V.geometry.width),m.geometry.height+=V.geometry.height,m.insert(V)));if(0<S.length){p=mxEvent.isAltDown(t)?p:I.getCenterInsertPoint(I.getBoundingBoxFromGeometry(S,!0));I.getModel().beginUpdate();try{S=I.importCells(S,p.x,p.y);u=[];for(C=0;C<S.length;C++)u.push(S[C]),u=u.concat(S[C].children);I.fireEvent(new mxEventObject("cellsInserted","cells",u))}finally{I.getModel().endUpdate()}I.setSelectionCells(S);-I.scrollCellToVisible(I.getSelectionCell())}}}else{J=function(M){var n=K[M];null==n&&(n=new mxCell(M,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),n.vertex=!0,K[M]=n,S.push(n));return n};var K={};S=[];for(C=0;C<y.length;C++)if(";"!=y[C].charAt(0)){var O=y[C].split("->");2<=O.length&&(x=J(O[0]),H=J(O[O.length-1]),O=new mxCell(2<O.length?O[1]:"",new mxGeometry),O.edge=!0,O.geometry.relative=!0,x.insertEdge(O,!0),H.insertEdge(O,!1),S.push(O))}if(0<S.length){y=document.createElement("div");y.style.visibility=+I.scrollCellToVisible(I.getSelectionCell())}}}else{J=function(M){var n=K[M];null==n&&(n=new mxCell(M,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),n.vertex=!0,K[M]=n,S.push(n));return n};var K={};S=[];for(C=0;C<y.length;C++)if(";"!=y[C].charAt(0)){var N=y[C].split("->");2<=N.length&&(x=J(N[0]),H=J(N[N.length-1]),N=new mxCell(2<N.length?N[1]:"",new mxGeometry),N.edge=!0,N.geometry.relative=!0,x.insertEdge(N,!0),H.insertEdge(N,!1),S.push(N))}if(0<S.length){y=document.createElement("div");y.style.visibility="hidden";document.body.appendChild(y);I=new Graph(y);I.getModel().beginUpdate();try{S=I.importCells(S);for(C=0;C<S.length;C++)I.getModel().isVertex(S[C])&&(u=I.getPreferredSizeForCell(S[C]),S[C].geometry.width=Math.max(S[C].geometry.width,u.width),S[C].geometry.height=Math.max(S[C].geometry.height,u.height));C=!0;"horizontalFlow"==m||"verticalFlow"==m?((new mxHierarchicalLayout(I,"horizontalFlow"==m?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH)).execute(I.getDefaultParent(),S),C=!1):"circle"==m?(new mxCircleLayout(I)).execute(I.getDefaultParent()):(V=new mxFastOrganicLayout(I),V.disableEdgeStyle=!1,V.forceConstant=180,V.execute(I.getDefaultParent()));C&&(P=new mxParallelEdgeLayout(I),P.spacing=30,P.execute(I.getDefaultParent()))}finally{I.getModel().endUpdate()}I.clearCellOverlays();u=[];b.editor.graph.getModel().beginUpdate();try{S=I.getModel().getChildren(I.getDefaultParent()),p=mxEvent.isAltDown(t)?p:b.editor.graph.getCenterInsertPoint(I.getBoundingBoxFromGeometry(S,!0)),u=b.editor.graph.importCells(S,p.x,p.y),b.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",u))}finally{b.editor.graph.getModel().endUpdate()}b.editor.graph.setSelectionCells(u);b.editor.graph.scrollCellToVisible(b.editor.graph.getSelectionCell());I.destroy();y.parentNode.removeChild(y)}}}function l(){return"list"==v.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean\n\nAddress\n-street: String\n-city: String\n-state: String":"mermaid"==v.value||"mermaid2drawio"==v.value?"graph TD;\n A--\x3eB;\n A--\x3eC;\n B--\x3eD;\n C--\x3eD;":"table"==v.value?"CREATE TABLE Suppliers\n(\nsupplier_id int NOT NULL PRIMARY KEY,\nsupplier_name char(50) NOT NULL,\ncontact_name char(50),\n);\nCREATE TABLE Customers\n(\ncustomer_id int NOT NULL PRIMARY KEY,\ncustomer_name char(50) NOT NULL,\naddress char(50),\ncity char(50),\nstate char(25),\nzip_code char(10)\n);\n":"plantUmlPng"==v.value?"@startuml\nskinparam backgroundcolor transparent\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: Another authentication Response\n@enduml":"plantUmlSvg"==v.value||"plantUmlTxt"==v.value?"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: Another authentication Response\n@enduml":";Example:\na->b\nb->edge label->c\nc->a\n"}var p=b.editor.graph.getFreeInsertPoint();e=document.createElement("div");e.style.textAlign="right";var q=document.createElement("textarea");q.style.boxSizing="border-box";q.style.resize=-"none";q.style.width="100%";q.style.height="354px";q.style.marginBottom="16px";var v=document.createElement("select");v.className="geBtn";if("formatSql"==f||"mermaid"==f&&"draw.io"!=b.getServiceName()&&"atlassian"!=b.getServiceName())v.style.display="none";var E=document.createElement("option");E.setAttribute("value","list");mxUtils.write(E,mxResources.get("list"));"plantUml"!=f&&"mermaid"!=f&&v.appendChild(E);null!=f&&"fromText"!=f||E.setAttribute("selected","selected");E=document.createElement("option");-E.setAttribute("value","table");mxUtils.write(E,mxResources.get("formatSql"));"formatSql"==f&&(v.appendChild(E),E.setAttribute("selected","selected"));E=document.createElement("option");E.setAttribute("value","mermaid");mxUtils.write(E,mxResources.get("image"));if("mermaid"==f)if("undefined"!==typeof mxMermaidToDrawio){var G=document.createElement("option");G.setAttribute("value","mermaid2drawio");G.setAttribute("selected","selected");mxUtils.write(G,mxResources.get("diagram"));v.appendChild(G)}else v.style.display=-"none";v.appendChild(E);E=document.createElement("option");E.setAttribute("value","diagram");mxUtils.write(E,mxResources.get("diagram"));G=document.createElement("option");G.setAttribute("value","circle");mxUtils.write(G,mxResources.get("circle"));var B=document.createElement("option");B.setAttribute("value","horizontalFlow");mxUtils.write(B,mxResources.get("horizontalFlow"));var d=document.createElement("option");d.setAttribute("value","verticalFlow");mxUtils.write(d,mxResources.get("verticalFlow"));-"plantUml"!=f&&"mermaid"!=f&&(v.appendChild(E),v.appendChild(G),v.appendChild(B),v.appendChild(d));E=document.createElement("option");E.setAttribute("value","plantUmlSvg");mxUtils.write(E,mxResources.get("plantUml")+" ("+mxResources.get("formatSvg")+")");"plantUml"==f&&E.setAttribute("selected","selected");G=document.createElement("option");G.setAttribute("value","plantUmlPng");mxUtils.write(G,mxResources.get("plantUml")+" ("+mxResources.get("formatPng")+")");B=document.createElement("option");B.setAttribute("value",-"plantUmlTxt");mxUtils.write(B,mxResources.get("plantUml")+" ("+mxResources.get("text")+")");EditorUi.enablePlantUml&&Graph.fileSupport&&!b.isOffline()&&"plantUml"==f&&(v.appendChild(E),v.appendChild(G),v.appendChild(B));var g=l();q.value=g;e.appendChild(q);this.init=function(){q.focus()};Graph.fileSupport&&(q.addEventListener("dragover",function(k){k.stopPropagation();k.preventDefault()},!1),q.addEventListener("drop",function(k){k.stopPropagation();k.preventDefault();if(0<k.dataTransfer.files.length){k=-k.dataTransfer.files[0];var m=new FileReader;m.onload=function(t){q.value=t.target.result};m.readAsText(k)}},!1));e.appendChild(v);mxEvent.addListener(v,"change",function(){var k=l();if(0==q.value.length||q.value==g)g=k,q.value=g});b.isOffline()||"mermaid"!=f&&"plantUml"!=f||(E=mxUtils.button(mxResources.get("help"),function(){b.openLink("mermaid"==f?"https://mermaid-js.github.io/mermaid/#/":"https://plantuml.com/")}),E.className="geBtn",e.appendChild(E));E=mxUtils.button(mxResources.get("close"),-function(){q.value==g?b.hideDialog():b.confirm(mxResources.get("areYouSure"),function(){b.hideDialog()})});E.className="geBtn";b.editor.cancelFirst&&e.appendChild(E);G=mxUtils.button(mxResources.get("insert"),function(k){try{b.hideDialog(),c(q.value,v.value,k)}catch(m){b.handleError(m)}});G.className="geBtn gePrimaryBtn";e.appendChild(G);b.editor.cancelFirst||e.appendChild(E);this.container=e},NewDialog=function(b,e,f,c,l,p,q,v,E,G,B,d,g,k,m,t,y,A){function I(la){null!=la&&(pa=ma=la?135:140);la=!0;+"none";q.style.width="100%";q.style.height="354px";q.style.marginBottom="16px";var v=document.createElement("select");v.className="geBtn";if("formatSql"==f||"mermaid"==f&&"draw.io"!=b.getServiceName()&&"atlassian"!=b.getServiceName())v.style.display="none";var D=document.createElement("option");D.setAttribute("value","list");mxUtils.write(D,mxResources.get("list"));"plantUml"!=f&&"mermaid"!=f&&v.appendChild(D);null!=f&&"fromText"!=f||D.setAttribute("selected","selected");D=document.createElement("option");+D.setAttribute("value","table");mxUtils.write(D,mxResources.get("formatSql"));"formatSql"==f&&(v.appendChild(D),D.setAttribute("selected","selected"));D=document.createElement("option");D.setAttribute("value","mermaid");mxUtils.write(D,mxResources.get("image"));if("mermaid"==f)if("undefined"!==typeof mxMermaidToDrawio){var G=document.createElement("option");G.setAttribute("value","mermaid2drawio");G.setAttribute("selected","selected");mxUtils.write(G,mxResources.get("diagram"));v.appendChild(G)}else v.style.display=+"none";v.appendChild(D);D=document.createElement("option");D.setAttribute("value","diagram");mxUtils.write(D,mxResources.get("diagram"));G=document.createElement("option");G.setAttribute("value","circle");mxUtils.write(G,mxResources.get("circle"));var B=document.createElement("option");B.setAttribute("value","horizontalFlow");mxUtils.write(B,mxResources.get("horizontalFlow"));var d=document.createElement("option");d.setAttribute("value","verticalFlow");mxUtils.write(d,mxResources.get("verticalFlow"));+"plantUml"!=f&&"mermaid"!=f&&(v.appendChild(D),v.appendChild(G),v.appendChild(B),v.appendChild(d));D=document.createElement("option");D.setAttribute("value","plantUmlSvg");mxUtils.write(D,mxResources.get("plantUml")+" ("+mxResources.get("formatSvg")+")");"plantUml"==f&&D.setAttribute("selected","selected");G=document.createElement("option");G.setAttribute("value","plantUmlPng");mxUtils.write(G,mxResources.get("plantUml")+" ("+mxResources.get("formatPng")+")");B=document.createElement("option");B.setAttribute("value",+"plantUmlTxt");mxUtils.write(B,mxResources.get("plantUml")+" ("+mxResources.get("text")+")");EditorUi.enablePlantUml&&Graph.fileSupport&&!b.isOffline()&&"plantUml"==f&&(v.appendChild(D),v.appendChild(G),v.appendChild(B));var g=l();q.value=g;e.appendChild(q);this.init=function(){q.focus()};Graph.fileSupport&&(q.addEventListener("dragover",function(k){k.stopPropagation();k.preventDefault()},!1),q.addEventListener("drop",function(k){k.stopPropagation();k.preventDefault();if(0<k.dataTransfer.files.length){k=+k.dataTransfer.files[0];var m=new FileReader;m.onload=function(t){q.value=t.target.result};m.readAsText(k)}},!1));e.appendChild(v);mxEvent.addListener(v,"change",function(){var k=l();if(0==q.value.length||q.value==g)g=k,q.value=g});b.isOffline()||"mermaid"!=f&&"plantUml"!=f||(D=mxUtils.button(mxResources.get("help"),function(){b.openLink("mermaid"==f?"https://mermaid-js.github.io/mermaid/#/":"https://plantuml.com/")}),D.className="geBtn",e.appendChild(D));D=mxUtils.button(mxResources.get("close"),+function(){q.value==g?b.hideDialog():b.confirm(mxResources.get("areYouSure"),function(){b.hideDialog()})});D.className="geBtn";b.editor.cancelFirst&&e.appendChild(D);G=mxUtils.button(mxResources.get("insert"),function(k){try{b.hideDialog(),c(q.value,v.value,k)}catch(m){b.handleError(m)}});G.className="geBtn gePrimaryBtn";e.appendChild(G);b.editor.cancelFirst||e.appendChild(D);this.container=e},NewDialog=function(b,e,f,c,l,p,q,v,D,G,B,d,g,k,m,t,y,z){function I(la){null!=la&&(pa=ma=la?135:140);la=!0;if(null!=Va)for(;M<Va.length&&(la||0!=mxUtils.mod(M,30));){var sa=Va[M++];sa=x(sa.url,sa.libs,sa.title,sa.tooltip?sa.tooltip:sa.title,sa.select,sa.imgUrl,sa.info,sa.onClick,sa.preview,sa.noImg,sa.clibs,sa.type);la&&sa.click();la=!1}}function F(la,sa,oa,qa,ra,ua){if(null!=la&&mxUtils.isAncestorNode(document.body,qa)){la=mxUtils.parseXml(la);la=Editor.parseDiagramNode(la.documentElement,null,!0);var Ga=new mxCodec(la.ownerDocument),Ja=new mxGraphModel;Ga.decode(la,Ja);b.sidebar.createTooltip(qa,Ja.root.children,Math.min((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-120,1E3),Math.min((window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-120,800),null!=ra?mxResources.get(ra):null,!0,new mxPoint(sa,oa),!0,function(){R=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display;null!=ua&&S(qa,null,null,ua,infoObj,clibs)},!0,!1)}}function C(){var la=document.createElement("div");la.style.position="absolute";la.style.overflow="visible";la.style.left="8px";la.style.right="8px";la.style.bottom="8px";la.style.top="8px";mxUtils.write(la,mxResources.get("describeYourDiagram")+":");mxUtils.br(la);var sa=document.createElement("input");sa.setAttribute("type","text");sa.setAttribute("placeholder",mxResources.get("processForHiringNewEmployee"));sa.style.width="100%";sa.style.marginTop="6px";sa.style.marginBottom="4px";sa.style.boxSizing="border-box";la.appendChild(sa);la.init=function(){sa.focus()};mxUtils.br(la);var oa=document.createElement("div");@@ -12325,292 +12331,292 @@ oa.style.top="86px";oa.style.left="2px";oa.style.right="2px";oa.style.bottom="2pmxUtils.write(qa,mxResources.get("diagramType"));qa.setAttribute("value","");ra.appendChild(qa);for(var ua=0;ua<EditorUi.mermaidDiagramTypes.length;ua++){qa=document.createElement("option");var Ga=EditorUi.mermaidDiagramTypes[ua],Ja=Ga;Ga==urlParams["smart-template-type"]&&qa.setAttribute("selected","selected");"erDiagram"==Ja&&(Ja="entityRelationshipDiagram");Ja=mxResources.get(Ja,null,Ja.charAt(0).toUpperCase()+Ja.substring(1).replace(/[A-Z]/g," $&"));qa.setAttribute("value",Ga);mxUtils.write(qa,Ja);ra.appendChild(qa)}var Ka=mxUtils.button(mxResources.get("generate"),function(){var Na=sa.value,Pa=ra.value.replace(/([A-Z])/g," $1").toLowerCase();Na="Write the declaration code for a detailed and complex "+(""!=Pa?Pa:"graph")+' that shows "'+(""!=Na?Na:"something random")+'" using correct MermaidJS syntax and do not provide additional text in your response.';Pa=""!=ra.value?" ("+mxUtils.trim(mxUtils.getTextContent(ra.options[ra.selectedIndex]))+")":"";var Xa="gantt"==ra.value||"pie"==ra.value||"timeline"==ra.value||"quadrantchart"==ra.value||"c4context"==ra.value,Ma=sa.value+Pa;"undefined"!==typeof mxMermaidToDrawio&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(Oa){Xa||(da=ba=Oa,Ba="Smart Template: "+Ma)}));b.spinner.spin(document.body,mxResources.get("loading"))&&b.generateOpenAiMermaidDiagram(Na,function(Oa,Ha,$a,Za){b.spinner.stop();oa.innerHTML="";var Ya=document.createElement("img");Ya.setAttribute("title",Ma);Ya.src="data:image/svg+xml;base64,"+Ha.substring(Ha.indexOf(",")+-1);Ya.style.cursor="pointer";Ya.style.width="100%";Ya.style.height="100%";oa.appendChild(Ya);Oa=b.createMermaidXml(Oa,EditorUi.defaultMermaidConfig,Ha,$a,Za,Ma);var gb="<mxfile><diagram>"+Graph.compress(Oa)+"</diagram></mxfile>";if(Xa||"undefined"===typeof mxMermaidToDrawio)da=ba=Oa;Oa=D.cloneNode(!0);oa.appendChild(Oa);Ha=function(eb){R=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display};$a=function(eb){R||F(gb,mxEvent.getClientX(eb),mxEvent.getClientY(eb),Ya,Ma)};mxEvent.addGestureListeners(Ya,+1);Ya.style.cursor="pointer";Ya.style.width="100%";Ya.style.height="100%";oa.appendChild(Ya);Oa=b.createMermaidXml(Oa,EditorUi.defaultMermaidConfig,Ha,$a,Za,Ma);var gb="<mxfile><diagram>"+Graph.compress(Oa)+"</diagram></mxfile>";if(Xa||"undefined"===typeof mxMermaidToDrawio)da=ba=Oa;Oa=E.cloneNode(!0);oa.appendChild(Oa);Ha=function(eb){R=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display};$a=function(eb){R||F(gb,mxEvent.getClientX(eb),mxEvent.getClientY(eb),Ya,Ma)};mxEvent.addGestureListeners(Ya,Ha,null,$a);mxEvent.addGestureListeners(Oa,Ha,null,$a)},function(Oa){b.spinner.stop();null!=mxMermaidToDrawio.resetListeners&&mxMermaidToDrawio.resetListeners();b.handleError(Oa)})});Ka.setAttribute("disabled","disabled");Ka.className="geBtn gePrimaryBtn";qa=function(){window.setTimeout(function(){""!=sa.value?Ka.removeAttribute("disabled"):Ka.setAttribute("disabled","disabled")},0)};ua=urlParams["smart-template"];null!=ua&&"1"!=ua&&(sa.value=decodeURIComponent(ua),qa(),"1"==urlParams["smart-template-generate"]&&window.setTimeout(function(){Ka.click()},0));mxEvent.addListener(sa,"change",qa);mxEvent.addListener(sa,"keydown",qa);mxEvent.addListener(sa,"cut",qa);mxEvent.addListener(sa,"paste",qa);mxEvent.addListener(sa,"keydown",function(Na){13==Na.keyCode&&Ka.click()});qa=document.createElement("div");qa.style.height="40px";qa.style.marginTop="4px";qa.style.marginBottom="4px";qa.style.whiteSpace="nowrap";qa.style.overflowX="auto";qa.style.overflowY="hidden";qa.appendChild(ra);qa.appendChild(Ka);la.appendChild(qa);-la.appendChild(oa);return la}function Q(){null!=ba&&ba==da&&EditorUi.logEvent({category:"OPENAI-DIAGRAM",action:"templateGenerated",label:Ba});if(aa&&null!=k)f||b.hideDialog(),k(aa,ha,O.value);else if(c)f||b.hideDialog(),c(ba,O.value,ia,ea);else{var la=O.value;if(null!=la&&0<la.length){var sa=function(qa,ra,ua){b.createFile(ua,ba,null!=ea&&0<ea.length?ea:null,qa,function(){b.hideDialog()},null,ra,null,null!=ja&&0<ja.length?ja:null)};if(b.mode==App.MODE_GOOGLE||b.mode==App.MODE_ONEDRIVE){var oa=new SaveDialog(b,+la.appendChild(oa);return la}function Q(){null!=ba&&ba==da&&EditorUi.logEvent({category:"OPENAI-DIAGRAM",action:"templateGenerated",label:Ba});if(aa&&null!=k)f||b.hideDialog(),k(aa,ha,N.value);else if(c)f||b.hideDialog(),c(ba,N.value,ja,ea);else{var la=N.value;if(null!=la&&0<la.length){var sa=function(qa,ra,ua){b.createFile(ua,ba,null!=ea&&0<ea.length?ea:null,qa,function(){b.hideDialog()},null,ra,null,null!=ia&&0<ia.length?ia:null)};if(b.mode==App.MODE_GOOGLE||b.mode==App.MODE_ONEDRIVE){var oa=new SaveDialog(b,la,mxUtils.bind(this,function(qa,ra,ua){sa(ra,ua,qa.value)}),null,null,null,null,b.mode);b.showDialog(oa.container,420,150,!0,!1);oa.init()}else b.pickFolder(b.mode,function(qa){sa(b.mode,qa,la)},b.mode!=App.MODE_GOOGLE||null==b.stateArg||null==b.stateArg.folderId)}}}function S(la,sa,oa,qa,ra,ua,Ga){return fa!=la?(null!=fa&&(fa.classList.remove("geTemplateSelected"),fa==Da&&(ya.style.display="none",xa.style.display="",Ea.style.visibility="hidden",Ia.style.visibility=null!=da?"visible":"hidden")),-la==Da&&(sa=da,null!=sa?(Ia.style.visibility="visible",Ia.style.visibility=null!=da?"visible":"hidden",Ea.style.visibility="visible"):(ya.style.display="",Ea.style.visibility="hidden",Ia.style.visibility="hidden")),z.removeAttribute("disabled"),ba=sa,ea=oa,ja=ua,fa=la,aa=qa,ia=Ga,ha=ra,fa.classList.add("geTemplateSelected"),!0):!1}function V(){ya.style.display="";xa.style.display="none";Ea.style.visibility="hidden";Ia.style.visibility="hidden";Fa.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?+la==Da&&(sa=da,null!=sa?(Ia.style.visibility="visible",Ia.style.visibility=null!=da?"visible":"hidden",Ea.style.visibility="visible"):(ya.style.display="",Ea.style.visibility="hidden",Ia.style.visibility="hidden")),A.removeAttribute("disabled"),ba=sa,ea=oa,ia=ua,fa=la,aa=qa,ja=Ga,ha=ra,fa.classList.add("geTemplateSelected"),!0):!1}function V(){ya.style.display="";xa.style.display="none";Ea.style.visibility="hidden";Ia.style.visibility="hidden";Fa.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?Fa.select():document.execCommand("selectAll",!1,null)}function P(){xa.style.backgroundImage=wa;xa.style.backgroundSize="contain";ya.style.display="none";xa.style.display="";Ea.style.visibility="visible";Ia.style.visibility="visible"}function u(la){var sa=mxUtils.trim(Fa.value);if(la||""==sa)null!=Ba&&(Fa.value=Ba,P());else{var oa=!1;la='Write a detailed and complex MermaidJS declaration for "'+(""!=sa?sa:"something random")+'" using correct MermaidJS syntax and do not provide additional text in your response.';"undefined"!==typeof mxMermaidToDrawio&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(qa){qa!=b.emptyDiagramXml&&(oa=!0,ba=qa)}));xa.style.backgroundImage="url("+Editor.spinImage+")";xa.style.backgroundSize="12px 12px";xa.style.display="";ya.style.display="none";b.generateOpenAiMermaidDiagram(la,function(qa,ra,ua,Ga){fa==Da&&"none"==ya.style.display&&(wa="url(data:image/svg+xml;base64,"+ra.substring(ra.indexOf(",")+1)+")",Da.setAttribute("title",sa),Ia.style.display="",da=ba=qa=oa?ba:b.createMermaidXml(qa,EditorUi.defaultMermaidConfig,ra,ua,Ga,sa),Ba=sa,P())},function(qa){fa==Da&&(ya.style.display="",Ea.style.visibility="visible",Ia.style.visibility="hidden",b.handleError(qa))})}}function x(la,sa,oa,qa,ra,ua,Ga,Ja,Ka,Na,Pa,Xa){function Ma(Qa,bb){null==$a?(Za=Qa,Za=/^https?:\/\//.test(Za)?b.editor.isCorsEnabledForUrl(Za)?Za:PROXY_URL+"?url="+encodeURIComponent(Za):TEMPLATE_PATH+"/"+Za,mxUtils.get(Za,mxUtils.bind(this,function(cb){200<=cb.getStatus()&&299>=cb.getStatus()&&($a=cb.getText());bb($a,Za)}))):-bb($a,Za)}function Oa(Qa,bb){if(null==la||L||b.sidebar.currentElt==Ha)b.sidebar.hideTooltip();else if(b.sidebar.hideTooltip(),null!=N){var cb="<mxfile><diagram>"+Graph.compress('<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="2" value="" style="shape=image;image='+N.src+';imageAspect=1;" parent="1" vertex="1"><mxGeometry width="'+N.naturalWidth+'" height="'+N.naturalHeight+'" as="geometry" /></mxCell></root></mxGraphModel>')+"</diagram></mxfile>";F(cb,mxEvent.getClientX(Qa),+bb($a,Za)}function Oa(Qa,bb){if(null==la||L||b.sidebar.currentElt==Ha)b.sidebar.hideTooltip();else if(b.sidebar.hideTooltip(),null!=O){var cb="<mxfile><diagram>"+Graph.compress('<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="2" value="" style="shape=image;image='+O.src+';imageAspect=1;" parent="1" vertex="1"><mxGeometry width="'+O.naturalWidth+'" height="'+O.naturalHeight+'" as="geometry" /></mxCell></root></mxGraphModel>')+"</diagram></mxfile>";F(cb,mxEvent.getClientX(Qa),mxEvent.getClientY(Qa),oa,la)}else b.sidebar.currentElt=Ha,L=!0,Ma(la,function(ib){if(L&&b.sidebar.currentElt==Ha)try{F(ib,mxEvent.getClientX(Qa),mxEvent.getClientY(Qa),Ha,bb)}catch(jb){b.sidebar.currentElt=null,b.handleError(jb)}L=!1})}var Ha=null;if("generative"!=Xa||null==Da){Ha=document.createElement("div");Ha.className="geTemplate";var $a=null,Za=la;null!=oa?Ha.setAttribute("title",mxResources.get(oa,null,oa)):null!=qa&&0<qa.length&&Ha.setAttribute("title",qa)}else Ha=Da;var Ya=document.createElement("span");-Ya.className="geAdaptiveAsset";mxUtils.write(Ya,mxResources.get(oa,null,oa));if(null!=ua){Ha.style.display="inline-flex";Ha.style.justifyContent="center";Ha.style.alignItems="center";Ka=document.createElement("img");Ka.setAttribute("src",ua);Ka.setAttribute("alt",qa);Ka.style.maxWidth=pa+"px";Ka.style.maxHeight=ma+"px";N=Ka;var gb=ua.replace(".drawio.xml","").replace(".drawio","").replace(".xml","");Ha.appendChild(Ka);Ka.onerror=function(){this.src!=gb?this.src=gb:(this.src=Editor.errorImage,this.onerror=+Ya.className="geAdaptiveAsset";mxUtils.write(Ya,mxResources.get(oa,null,oa));if(null!=ua){Ha.style.display="inline-flex";Ha.style.justifyContent="center";Ha.style.alignItems="center";Ka=document.createElement("img");Ka.setAttribute("src",ua);Ka.setAttribute("alt",qa);Ka.style.maxWidth=pa+"px";Ka.style.maxHeight=ma+"px";O=Ka;var gb=ua.replace(".drawio.xml","").replace(".drawio","").replace(".xml","");Ha.appendChild(Ka);Ka.onerror=function(){this.src!=gb?this.src=gb:(this.src=Editor.errorImage,this.onerror=null)};mxEvent.addGestureListeners(Ha,mxUtils.bind(this,function(Qa){S(Ha,null,null,la,Ga,Pa)}),null,null);mxEvent.addListener(Ha,"dblclick",function(Qa){Q();mxEvent.consume(Qa)})}else if(!Na&&null!=la&&0<la.length){var eb=function(Qa){n.spin(na)&&Ma(la,function(bb,cb){n.stop();null!=bb&&(S(Ha,bb,sa,null,null,Pa,cb),Qa&&Q())})};ua=Ka||TEMPLATE_PATH+"/"+la.substring(0,la.length-4)+".png";Ka=xa.cloneNode(!1);Ka.style.backgroundImage="url("+ua+")";Ka.style.display="";Ha.appendChild(Ka);null!=oa&&Ha.appendChild(Ya);mxEvent.addGestureListeners(Ha,mxUtils.bind(this,function(Qa){eb()}),null,null);mxEvent.addListener(Ha,"dblclick",function(Qa){eb(!0);mxEvent.consume(Qa)})}else Ha.appendChild(Ya),"generative"==Xa&&null==Da&&(Ha.appendChild(xa),Ha.appendChild(ya),Ha.appendChild(Ia),Ha.appendChild(Ea),Da=Ha),ra&&S(Ha),null!=Ja?(mxEvent.addGestureListeners(Ha,null,null,mxUtils.bind(this,function(Qa){S(Ha,null,null,la,Ga)})),mxEvent.addListener(Ha,"click",Ja)):(mxEvent.addListener(Ha,"click",function(Qa){S(Ha,null,null,-la,Ga)&&"generative"==Xa&&null==da&&V()}),mxEvent.addListener(Ha,"dblclick",function(Qa){"generative"!=Xa?Q():"none"==ya.style.display&&V();mxEvent.consume(Qa)}));null!=la&&(ua=D.cloneNode(!0),Ha.appendChild(ua),mxEvent.addGestureListeners(ua,mxUtils.bind(this,function(Qa){R=b.sidebar.currentElt==Ha}),null,null),mxEvent.addListener(ua,"click",mxUtils.bind(this,function(Qa){R||Oa(Qa,null!=oa?oa:qa);mxEvent.consume(Qa)})));na.appendChild(Ha);return Ha}function J(){function la(Ma,Oa){Ma=mxResources.get(Ma,+la,Ga)&&"generative"==Xa&&null==da&&V()}),mxEvent.addListener(Ha,"dblclick",function(Qa){"generative"!=Xa?Q():"none"==ya.style.display&&V();mxEvent.consume(Qa)}));null!=la&&(ua=E.cloneNode(!0),Ha.appendChild(ua),mxEvent.addGestureListeners(ua,mxUtils.bind(this,function(Qa){R=b.sidebar.currentElt==Ha}),null,null),mxEvent.addListener(ua,"click",mxUtils.bind(this,function(Qa){R||Oa(Qa,null!=oa?oa:qa);mxEvent.consume(Qa)})));na.appendChild(Ha);return Ha}function J(){function la(Ma,Oa){Ma=mxResources.get(Ma,null,Ma.substring(0,1).toUpperCase()+Ma.substring(1));18<Ma.length&&(Ma=Ma.substring(0,18)+"…");return Ma+(null!=Oa?" ("+Oa.length+")":"")}function sa(Ma,Oa,Ha){mxEvent.addListener(Oa,"click",function(){Ra!=Oa&&(null!=Ra&&(Ra.style.backgroundColor=""),Ra=Oa,Ra.style.backgroundColor=q,na.scrollTop=0,na.innerText="",M=0,null!=za[Ma].content?(na.appendChild(za[Ma].content),ba=da,Va=null,null!=za[Ma].content.init&&za[Ma].content.init()):(Va=Ha?Sa[Ma][Ha]:za[Ma],U=null,I(!1)))});null!=urlParams["smart-template"]&&"smartTemplate"==Ma&&Oa.click()}hb&&(hb=!1,mxEvent.addListener(na,"scroll",function(Ma){na.scrollTop+na.clientHeight>=na.scrollHeight&&(I(),mxEvent.consume(Ma))}));if(0<Ua){var oa=document.createElement("div");oa.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(oa,mxResources.get("custom"));ta.appendChild(oa);for(var qa in Ta){var ra=document.createElement("div");oa=qa;var ua=Ta[qa];18<oa.length&&(oa=oa.substring(0,18)+"…");ra.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;";ra.setAttribute("title",oa+" ("+ua.length+")");mxUtils.write(ra,ra.getAttribute("title"));null!=G&&(ra.style.padding=G);ta.appendChild(ra);(function(Ma,Oa){mxEvent.addListener(ra,"click",function(){Ra!=Oa&&(Ra.style.backgroundColor="",Ra=Oa,Ra.style.backgroundColor=q,na.scrollTop=0,na.innerText="",M=0,Va=Ta[Ma],U=null,I(!1))})})(qa,ra)}oa=document.createElement("div");oa.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(oa,"draw.io");ta.appendChild(oa)}for(qa in za){oa=ua=null;if(null!=za[qa].content)ra=document.createElement(Ga?"ul":"div"),oa=la(qa),ra.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;transition: all 0.5s;",ra.setAttribute("title",oa),mxUtils.write(ra,oa),ta.appendChild(ra),oa=ra;else{var Ga=Sa[qa];oa=ra=document.createElement(Ga?"ul":"div");ua=za[qa];var Ja=la(qa,ua);if(null!=Ga){ua=document.createElement("li");var Ka=document.createElement("div");Ka.className="geTempTreeCaret";Ka.setAttribute("title",Ja);mxUtils.write(Ka,Ja);oa=Ka;ua.appendChild(Ka);Ja=document.createElement("ul");Ja.className="geTempTreeNested";Ja.style.visibility="hidden";for(var Na in Ga){var Pa=document.createElement("li"),Xa=la(Na,Ga[Na]);Pa.setAttribute("title",Xa);mxUtils.write(Pa,Xa);sa(qa,Pa,Na);Ja.appendChild(Pa)}ua.appendChild(Ja);ra.className="geTempTree";ra.appendChild(ua);(function(Ma,Oa){mxEvent.addListener(Oa,"click",function(){Ma.style.visibility="visible";Ma.classList.toggle("geTempTreeActive");Ma.classList.toggle("geTempTreeNested")&&setTimeout(function(){Ma.style.visibility="hidden"},550);Oa.classList.toggle("geTempTreeCaret-down")})})(Ja,Ka)}else ra.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;transition: all 0.5s;",-ra.setAttribute("title",Ja),mxUtils.write(ra,Ja);null!=G&&(ra.style.padding=G);ta.appendChild(ra)}sa(qa,oa);null==Ra&&oa.click()}I(!1)}v=500>(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth);f=null!=f?f:!0;l=null!=l?l:!1;q=null!=q?q:"light-dark(#ebf2f9, "+Editor.darkColor+")";B=null!=B?B:EditorUi.templateFile;var H=document.createElement("div");H.style.userSelect="none";H.style.height="100%";E=document.createElement("div");E.style.whiteSpace="nowrap";E.style.height=-"46px";f&&H.appendChild(E);var K=document.createElement("img");K.setAttribute("border","0");K.setAttribute("align","absmiddle");K.style.width="40px";K.style.height="40px";K.style.marginRight="10px";K.style.paddingBottom="4px";K.src=b.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":b.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":b.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":b.mode==App.MODE_GITHUB?IMAGE_PATH+"/github-logo.svg":b.mode==App.MODE_GITLAB?IMAGE_PATH+"/gitlab-logo.svg":-b.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":b.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";e||v||!f||E.appendChild(K);f&&mxUtils.write(E,(v?mxResources.get("name"):null==b.mode||b.mode==App.MODE_GOOGLE||b.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");K=".drawio";b.mode==App.MODE_GOOGLE&&null!=b.drive?K=b.drive.extension:b.mode==App.MODE_DROPBOX&&null!=b.dropbox?K=b.dropbox.extension:b.mode==App.MODE_ONEDRIVE&&-null!=b.oneDrive?K=b.oneDrive.extension:b.mode==App.MODE_GITHUB&&null!=b.gitHub?K=b.gitHub.extension:b.mode==App.MODE_GITLAB&&null!=b.gitLab?K=b.gitLab.extension:b.mode==App.MODE_TRELLO&&null!=b.trello&&(K=b.trello.extension);var O=document.createElement("input");O.setAttribute("value",b.defaultFilename+K);O.style.marginLeft="10px";O.style.width=e||v?"144px":"244px";this.init=function(){f&&Editor.selectFilename(O);null!=na.parentNode&&null!=na.parentNode.parentNode&&mxEvent.addGestureListeners(na.parentNode.parentNode,-mxUtils.bind(this,function(la){null!=b.sidebar&&b.sidebar.hideTooltip()}),null,null)};f&&(E.appendChild(O),A?O.style.width=e||v?"350px":"450px":null!=b.editor.diagramFileTypes&&(A=FilenameDialog.createFileTypes(b,O,b.editor.diagramFileTypes),A.style.marginLeft="6px",A.style.width=e||v?"80px":"180px",E.appendChild(A)));A=!1;var M=0,n=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9}),z=mxUtils.button(t||-mxResources.get("create"),function(){z.setAttribute("disabled","disabled");Q();z.removeAttribute("disabled")});z.className="geBtn gePrimaryBtn";var D=document.createElement("img");D.setAttribute("src",Editor.magnifyImage);D.setAttribute("title",mxResources.get("preview"));D.className="geButton geRoundButton";var L=!1,N=null,R=!1;if(d||g){var T=[],U=null,W=null,X=null,Y=function(la){z.setAttribute("disabled","disabled");for(var sa=0;sa<T.length;sa++)T[sa].className=sa==la?"geBtn gePrimaryBtn":"geBtn"};-A=!0;t=document.createElement("div");t.style.whiteSpace="nowrap";t.style.height="30px";H.appendChild(t);v=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){ta.style.display="";va.style.display="";na.style.left="160px";Y(0);na.scrollTop=0;na.innerText="";M=0;U!=Va&&(Va=U,za=W,Ua=X,ta.innerText="",J(),U=null)});T.push(v);t.appendChild(v);var Z=function(la){ta.style.display="none";va.style.display="none";na.style.left="30px";Y(la?-1:1);null==U&&(U=Va);na.scrollTop=0;na.innerText=+ra.setAttribute("title",Ja),mxUtils.write(ra,Ja);null!=G&&(ra.style.padding=G);ta.appendChild(ra)}sa(qa,oa);null==Ra&&oa.click()}I(!1)}v=500>(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth);f=null!=f?f:!0;l=null!=l?l:!1;q=null!=q?q:"light-dark(#ebf2f9, "+Editor.darkColor+")";B=null!=B?B:EditorUi.templateFile;var H=document.createElement("div");H.style.userSelect="none";H.style.height="100%";D=document.createElement("div");D.style.whiteSpace="nowrap";D.style.height=+"46px";f&&H.appendChild(D);var K=document.createElement("img");K.setAttribute("border","0");K.setAttribute("align","absmiddle");K.style.width="40px";K.style.height="40px";K.style.marginRight="10px";K.style.paddingBottom="4px";K.src=b.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":b.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":b.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":b.mode==App.MODE_GITHUB?IMAGE_PATH+"/github-logo.svg":b.mode==App.MODE_GITLAB?IMAGE_PATH+"/gitlab-logo.svg":+b.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":b.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";e||v||!f||D.appendChild(K);f&&mxUtils.write(D,(v?mxResources.get("name"):null==b.mode||b.mode==App.MODE_GOOGLE||b.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");K=".drawio";b.mode==App.MODE_GOOGLE&&null!=b.drive?K=b.drive.extension:b.mode==App.MODE_DROPBOX&&null!=b.dropbox?K=b.dropbox.extension:b.mode==App.MODE_ONEDRIVE&&+null!=b.oneDrive?K=b.oneDrive.extension:b.mode==App.MODE_GITHUB&&null!=b.gitHub?K=b.gitHub.extension:b.mode==App.MODE_GITLAB&&null!=b.gitLab?K=b.gitLab.extension:b.mode==App.MODE_TRELLO&&null!=b.trello&&(K=b.trello.extension);var N=document.createElement("input");N.setAttribute("value",b.defaultFilename+K);N.style.marginLeft="10px";N.style.width=e||v?"144px":"244px";this.init=function(){f&&Editor.selectFilename(N);null!=na.parentNode&&null!=na.parentNode.parentNode&&mxEvent.addGestureListeners(na.parentNode.parentNode,+mxUtils.bind(this,function(la){null!=b.sidebar&&b.sidebar.hideTooltip()}),null,null)};f&&(D.appendChild(N),z?N.style.width=e||v?"350px":"450px":null!=b.editor.diagramFileTypes&&(z=FilenameDialog.createFileTypes(b,N,b.editor.diagramFileTypes),z.style.marginLeft="6px",z.style.width=e||v?"80px":"180px",D.appendChild(z)));z=!1;var M=0,n=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9}),A=mxUtils.button(t||+mxResources.get("create"),function(){A.setAttribute("disabled","disabled");Q();A.removeAttribute("disabled")});A.className="geBtn gePrimaryBtn";var E=document.createElement("img");E.setAttribute("src",Editor.magnifyImage);E.setAttribute("title",mxResources.get("preview"));E.className="geButton geRoundButton";var L=!1,O=null,R=!1;if(d||g){var T=[],U=null,W=null,X=null,Y=function(la){A.setAttribute("disabled","disabled");for(var sa=0;sa<T.length;sa++)T[sa].className=sa==la?"geBtn gePrimaryBtn":"geBtn"};+z=!0;t=document.createElement("div");t.style.whiteSpace="nowrap";t.style.height="30px";H.appendChild(t);v=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){ta.style.display="";va.style.display="";na.style.left="160px";Y(0);na.scrollTop=0;na.innerText="";M=0;U!=Va&&(Va=U,za=W,Ua=X,ta.innerText="",J(),U=null)});T.push(v);t.appendChild(v);var Z=function(la){ta.style.display="none";va.style.display="none";na.style.left="30px";Y(la?-1:1);null==U&&(U=Va);na.scrollTop=0;na.innerText="";n.spin(na);var sa=function(oa,qa,ra){M=0;n.stop();Va=oa;ra=ra||{};var ua=0,Ga;for(Ga in ra)ua+=ra[Ga].length;if(qa)na.innerText=qa;else if(0==oa.length&&0==ua)na.innerText=mxResources.get("noDiagrams",null,"No Diagrams Found");else if(na.innerText="",0<ua){ta.style.display="";na.style.left="160px";ta.innerText="";Ua=0;za={"draw.io":oa};for(Ga in ra)za[Ga]=ra[Ga];J()}else I(!0)};la?g(ca.value,sa):d(sa)};d&&(v=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){Z()}),t.appendChild(v),-T.push(v));if(g){v=document.createElement("span");v.style.marginLeft="10px";v.innerText=mxResources.get("search")+":";t.appendChild(v);var ca=document.createElement("input");ca.style.marginRight="10px";ca.style.marginLeft="10px";ca.style.width="220px";mxEvent.addListener(ca,"keypress",function(la){13==la.keyCode&&Z(!0)});t.appendChild(ca);v=mxUtils.button(mxResources.get("search"),function(){Z(!0)});v.className="geBtn";t.appendChild(v)}Y(0)}var ea=null,ja=null,ba=null,fa=null,aa=null,ia=null,ha=null,-da=null,Ba=null,na=document.createElement("div");na.style.border="1px solid #d3d3d3";na.style.position="absolute";na.style.left="160px";na.style.right="34px";t=(f?72:40)+(A?30:0);na.style.top=t+"px";na.style.bottom="68px";na.style.margin="6px 0 0 -1px";na.style.padding="6px";na.style.overflow="auto";var va=document.createElement("div");va.style.cssText="position:absolute;left:30px;width:128px;top:"+t+"px;height:22px;margin-top: 6px;white-space: nowrap;";var Aa=document.createElement("input");Aa.style.cssText=+T.push(v));if(g){v=document.createElement("span");v.style.marginLeft="10px";v.innerText=mxResources.get("search")+":";t.appendChild(v);var ca=document.createElement("input");ca.style.marginRight="10px";ca.style.marginLeft="10px";ca.style.width="220px";mxEvent.addListener(ca,"keypress",function(la){13==la.keyCode&&Z(!0)});t.appendChild(ca);v=mxUtils.button(mxResources.get("search"),function(){Z(!0)});v.className="geBtn";t.appendChild(v)}Y(0)}var ea=null,ia=null,ba=null,fa=null,aa=null,ja=null,ha=null,+da=null,Ba=null,na=document.createElement("div");na.style.border="1px solid #d3d3d3";na.style.position="absolute";na.style.left="160px";na.style.right="34px";t=(f?72:40)+(z?30:0);na.style.top=t+"px";na.style.bottom="68px";na.style.margin="6px 0 0 -1px";na.style.padding="6px";na.style.overflow="auto";var va=document.createElement("div");va.style.cssText="position:absolute;left:30px;width:128px;top:"+t+"px;height:22px;margin-top: 6px;white-space: nowrap;";var Aa=document.createElement("input");Aa.style.cssText="width:105px;height:16px;border:1px solid #d3d3d3;padding: 3px 20px 3px 3px;font-size: 12px;border-radius:0px;";Aa.setAttribute("placeholder",mxResources.get("search"));Aa.setAttribute("type","text");va.appendChild(Aa);var ka=document.createElement("img");ka.setAttribute("src",Editor.magnifyImage);ka.setAttribute("title",mxResources.get("search"));ka.className="geAdaptiveAsset";ka.style.position="relative";ka.style.cursor="pointer";ka.style.outline="none";ka.style.opacity="0.5";ka.style.height="16px";ka.style.left="-20px";ka.style.top="4px";va.appendChild(ka);mxEvent.addListener(ka,"click",function(){ka.getAttribute("src")!=Editor.magnifyImage&&(ka.setAttribute("src",Editor.magnifyImage),ka.setAttribute("title",mxResources.get("search")),Aa.value="",null!=Wa&&(Wa.click(),Wa=null));Aa.focus()});mxEvent.addListener(Aa,"keydown",mxUtils.bind(this,function(la){if(13==la.keyCode){var sa=Aa.value;if(""==sa)null!=Wa&&(Wa.click(),Wa=null);else{if(null==NewDialog.tagsList[B]){var oa={};for(Pa in za)if(null==za[Pa].content)for(var qa=za[Pa],ra=0;ra<qa.length;ra++){var ua=qa[ra];if(null!=ua.tags)for(var Ga=ua.tags.toLowerCase().split(";"),Ja=0;Ja<Ga.length;Ja++)null==oa[Ga[Ja]]&&(oa[Ga[Ja]]=[]),oa[Ga[Ja]].push(ua)}NewDialog.tagsList[B]=oa}var Ka=sa.toLowerCase().split(" ");oa=NewDialog.tagsList[B];if(0<Ua&&null==oa.__tagsList__){for(Pa in Ta)for(qa=Ta[Pa],ra=0;ra<qa.length;ra++)for(ua=qa[ra],Ga=ua.title.split(" "),Ga.push(Pa),Ja=0;Ja<Ga.length;Ja++){var Na=Ga[Ja].toLowerCase();null==oa[Na]&&(oa[Na]=[]);oa[Na].push(ua)}oa.__tagsList__=!0}var Pa=[];qa={};for(ra=Ga=0;ra<Ka.length;ra++)if(0<Ka[ra].length){Na=oa[Ka[ra]];var Xa={};Pa=[];if(null!=Na)for(Ja=0;Ja<Na.length;Ja++)ua=Na[Ja],0==Ga==(null==qa[ua.url])&&(Xa[ua.url]=!0,Pa.push(ua));qa=Xa;Ga++}na.scrollTop=0;na.innerText="";M=0;oa=document.createElement("div");oa.style.padding="6px";oa.style.whiteSpace="nowrap";oa.style.overflow="hidden";oa.style.textOverflow="ellipsis";ua=mxResources.get(0==Pa.length?"noResultsFor":"resultsFor",[sa]);oa.setAttribute("title",ua);mxUtils.write(oa,ua);na.appendChild(oa);null!=Ra&&null==Wa&&(Ra.style.backgroundColor="",Wa=Ra,Ra=oa);Va=Pa;U=null;I(!1)}mxEvent.consume(la)}}));mxEvent.addListener(Aa,"keyup",mxUtils.bind(this,function(la){""==Aa.value?(ka.setAttribute("src",Editor.magnifyImage),ka.setAttribute("title",mxResources.get("search"))):(ka.setAttribute("src",Editor.crossImage),ka.setAttribute("title",mxResources.get("reset")))}));t+=23;var ta=document.createElement("div");ta.style.cssText="position:absolute;left:30px;width:128px;top:"+-t+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";mxEvent.addListener(na,"scroll",function(){b.sidebar.hideTooltip()});var pa=140,ma=pa,Da=null,wa="url("+Editor.sparklesImage+")",ya=document.createElement("div");ya.className="geGenerateDiagramForm";ya.style.position="absolute";ya.style.width="100%";ya.style.height="100%";var xa=document.createElement("div");xa.className="geTemplatePreview geAdaptiveAsset";xa.style.backgroundImage=wa;var Fa=document.createElement("textarea");-Fa.setAttribute("placeholder",mxResources.get("describeYourDiagram"));Fa.className="geGenerateDiagramDescription";var Ca=document.createElement("button");Ca.className="geBtn gePrimaryBtn geGenerateDiagramButton";Ca.setAttribute("disabled","disabled");Ca.setAttribute("title",mxResources.get("ok"));mxUtils.write(Ca,mxResources.get("ok"));var Ia=D.cloneNode(!0);Ia.style.display="none";var La=!1;mxEvent.addGestureListeners(Ia,function(la){La=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display},-null,function(la){if(!La&&null!=da){var sa="<mxfile><diagram>"+Graph.compress(da)+"</diagram></mxfile>";F(sa,mxEvent.getClientX(la),mxEvent.getClientY(la),Da,Ba)}});var Ea=D.cloneNode(!0);Ea.setAttribute("src",Editor.editImage);Ea.setAttribute("title",mxResources.get("edit"));Ea.style.visibility="hidden";Ea.style.left="0px";t=D.cloneNode(!0);t.setAttribute("src",Editor.helpImage);t.setAttribute("title",mxResources.get("help"));mxEvent.addListener(t,"click",function(la){b.openLink("https://www.drawio.com/blog/write-query-generate-diagram");+t+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";mxEvent.addListener(na,"scroll",function(){null!=b.sidebar&&b.sidebar.hideTooltip()});var pa=140,ma=pa,Da=null,wa="url("+Editor.sparklesImage+")",ya=document.createElement("div");ya.className="geGenerateDiagramForm";ya.style.position="absolute";ya.style.width="100%";ya.style.height="100%";var xa=document.createElement("div");xa.className="geTemplatePreview geAdaptiveAsset";xa.style.backgroundImage=wa;var Fa=document.createElement("textarea");+Fa.setAttribute("placeholder",mxResources.get("describeYourDiagram"));Fa.className="geGenerateDiagramDescription";var Ca=document.createElement("button");Ca.className="geBtn gePrimaryBtn geGenerateDiagramButton";Ca.setAttribute("disabled","disabled");Ca.setAttribute("title",mxResources.get("ok"));mxUtils.write(Ca,mxResources.get("ok"));var Ia=E.cloneNode(!0);Ia.style.display="none";var La=!1;mxEvent.addGestureListeners(Ia,function(la){La=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display},+null,function(la){if(!La&&null!=da){var sa="<mxfile><diagram>"+Graph.compress(da)+"</diagram></mxfile>";F(sa,mxEvent.getClientX(la),mxEvent.getClientY(la),Da,Ba)}});var Ea=E.cloneNode(!0);Ea.setAttribute("src",Editor.editImage);Ea.setAttribute("title",mxResources.get("edit"));Ea.style.visibility="hidden";Ea.style.left="0px";t=E.cloneNode(!0);t.setAttribute("src",Editor.helpImage);t.setAttribute("title",mxResources.get("help"));mxEvent.addListener(t,"click",function(la){b.openLink("https://www.drawio.com/blog/write-query-generate-diagram");mxEvent.consume(la)});ya.appendChild(Fa);ya.appendChild(Ca);ya.appendChild(t);ya.style.display="none";mxEvent.addListener(Ea,"click",V);mxEvent.addListener(Fa,"input",function(){""!=Fa.value?Ca.removeAttribute("disabled"):Ca.setAttribute("disabled","disabled")});mxEvent.addListener(Ca,"click",function(){u()});mxEvent.addListener(Fa,"keydown",function(la){13!=la.keyCode||mxEvent.isShiftDown(la)?27==la.keyCode&&(u(!0),mxEvent.consume(la)):(u(),mxEvent.consume(la))});var za={},Sa={},Ta={},Ua=0,hb=!0,Ra=null,Wa=null;za.basic=[{title:"blankDiagram"}];var Va=za.basic;Editor.enableChatGpt&&b.isExternalDataComms()&&"draw.io"==b.getServiceName()&&"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&za.basic.push({title:"generate",type:"generative"});Editor.enableChatGpt&&b.isExternalDataComms()&&"draw.io"==b.getServiceName()&&"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&(za.smartTemplate={content:C()});if(!e){var fb=function(){mxUtils.get(db,function(la){if(!ab){ab=!0;la=la.getXml().documentElement.firstChild;for(var sa={};null!=la;){if("undefined"!==typeof la.getAttribute)if("parsererror"==la.nodeName)null!=window.console&&console.log("Parser error in "+B+": "+la.textContent);else if("clibs"==la.nodeName){for(var oa=la.getAttribute("name"),qa=la.getElementsByTagName("add"),ra=[],ua=0;ua<qa.length;ua++)ra.push(encodeURIComponent(mxUtils.getTextContent(qa[ua])));null!=oa&&0<ra.length&&(sa[oa]=ra.join(";"))}else if(ra=la.getAttribute("url"),null!=ra){qa=la.getAttribute("section");oa=la.getAttribute("subsection");if(null==qa&&(ua=ra.indexOf("/"),qa=ra.substring(0,ua),null==oa)){var Ga=ra.indexOf("/",ua+1);-1<Ga&&(oa=ra.substring(ua+1,Ga))}ua=za[qa];null==ua&&(ua=[],za[qa]=ua);ra=la.getAttribute("clibs");null!=sa[ra]&&(ra=sa[ra]);ra={url:la.getAttribute("url"),libs:la.getAttribute("libs"),title:la.getAttribute("title"),tooltip:la.getAttribute("name")||la.getAttribute("url"),preview:la.getAttribute("preview"),clibs:ra,tags:la.getAttribute("tags")};ua.push(ra);null!=oa&&(ua=Sa[qa],-null==ua&&(ua={},Sa[qa]=ua),qa=ua[oa],null==qa&&(qa=[],ua[oa]=qa),qa.push(ra))}la=la.nextSibling}n.stop();J()}})};H.appendChild(va);H.appendChild(ta);H.appendChild(na);var ab=!1,db=B;/^https?:\/\//.test(db)&&!b.editor.isCorsEnabledForUrl(db)&&(db=PROXY_URL+"?url="+encodeURIComponent(db));n.spin(na);null!=y?y(function(la,sa){Ta=la;X=Ua=sa;fb()},fb):fb();W=za}mxEvent.addListener(O,"keypress",function(la){b.dialog.container.firstChild==H&&13==la.keyCode&&Q()});y=document.createElement("div");y.style.marginTop=+null==ua&&(ua={},Sa[qa]=ua),qa=ua[oa],null==qa&&(qa=[],ua[oa]=qa),qa.push(ra))}la=la.nextSibling}n.stop();J()}})};H.appendChild(va);H.appendChild(ta);H.appendChild(na);var ab=!1,db=B;/^https?:\/\//.test(db)&&!b.editor.isCorsEnabledForUrl(db)&&(db=PROXY_URL+"?url="+encodeURIComponent(db));n.spin(na);null!=y?y(function(la,sa){Ta=la;X=Ua=sa;fb()},fb):fb();W=za}mxEvent.addListener(N,"keypress",function(la){b.dialog.container.firstChild==H&&13==la.keyCode&&Q()});y=document.createElement("div");y.style.marginTop=e?"4px":"16px";y.style.textAlign="right";y.style.position="absolute";y.style.left="40px";y.style.bottom="24px";y.style.right="40px";t=mxUtils.button(mxResources.get("cancel"),function(){null!=p&&p();b.hideDialog(!0)});t.className="geBtn";!b.editor.cancelFirst||l&&null==p||y.appendChild(t);e||"1"==urlParams.embed||l||mxClient.IS_ANDROID||mxClient.IS_IOS||"1"==urlParams.noDevice||(e=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var la=new FilenameDialog(b,"",mxResources.get("create"),function(sa){null!=sa&&0<sa.length&&b.editor.loadUrl(b.editor.getProxiedUrl(sa),function(oa){ba=oa;ea=null;templateRealURl=sa;b.hideDialog();Q()},function(oa){b.handleError(oa)})},mxResources.get("url"),null,null,null,!1);b.showDialog(la.container,300,80,!0,!0);la.init()}),e.className="geBtn",y.appendChild(e));Graph.fileSupport&&m&&(m=mxUtils.button(mxResources.get("import"),function(){if(null==b.newDlgFileInputElt){var la=document.createElement("input");la.setAttribute("multiple","multiple");la.setAttribute("type",-"file");mxEvent.addListener(la,"change",function(sa){b.openFiles(la.files,!0);la.value=""});la.style.display="none";document.body.appendChild(la);b.newDlgFileInputElt=la}b.newDlgFileInputElt.click()}),m.className="geBtn",y.appendChild(m));y.appendChild(z);b.editor.cancelFirst||null!=c||l&&null==p||y.appendChild(t);H.appendChild(y);this.container=H};NewDialog.tagsList={};-var SaveDialog=function(b,e,f,c,l,p,q,v){function E(H,K,O,M,n,z){var D=null;if(null==c||0>mxUtils.indexOf(c,H))if(n=null!=n?n:b.getTitleForService(H),0<=mxUtils.indexOf(V,H)||null!=b.getServiceForName(H)){D=document.createElement("option");if("pick"==z)D.innerHTML=mxUtils.htmlEntities(n)+" – "+mxUtils.htmlEntities(mxResources.get("pickFolder"))+"...",D.setAttribute("value","pickFolder-"+H),D.setAttribute("title",n+" - "+mxResources.get("pickFolder")+"...");else{var L=H+-(null!=O?"-"+O:""),N=x[L];null!=N&&null!=N.option&&N.option.parentNode.removeChild(N.option);N=null;if(null!=K){"/"==K.charAt(K.length-1)&&(K=K.substring(0,K.length-1));"/"==K.charAt(0)&&(K=K.substring(1));N=K;if(H!=App.MODE_GITHUB&&H==App.MODE_GITLAB){var R=N.lastIndexOf("/");0<=R&&(N=N.substring(R+1))}40<N.length&&(N=N.substring(0,20)+"..."+N.substring(N.length-20))}D.innerHTML=mxUtils.htmlEntities(n)+(null!=N?" – "+mxUtils.htmlEntities(N):"");D.setAttribute("title",n+-(null!=K?" ("+K+")":"")+(null!=O&&decodeURIComponent(O)!=K?" ["+O+"]":""));D.setAttribute("value",L);x[L]={option:D,mode:H,path:K,id:O};SaveDialog.lastValue==L&&null==v?M=!0:null==M&&("root"==z?M=null==v&&b.mode==H||null!=H&&H==v:"pickFolder-"==Q.value.substring(0,11)&&(M=!0));M&&D.setAttribute("selected","selected")}Q.appendChild(D)}return D}function G(H){b.pickFolder(H,function(K){var O=null;H==App.MODE_GOOGLE&&null!=K.docs&&0<K.docs.length?O={mode:H,path:K.docs[0].name,id:K.docs[0].id}:H==App.MODE_ONEDRIVE&&-null!=K.value&&0<K.value.length?O={mode:H,path:K.value[0].name,id:OneDriveFile.prototype.getIdOf(K.value[0])}:(H==App.MODE_GITHUB||H==App.MODE_GITLAB)&&null!=K&&0<K.length&&(O={mode:H,path:decodeURIComponent(K),id:K});null!=O&&(S.style.display="",b.addRecent(O,"Folders",5),K=E(O.mode,O.path,O.id,!0),Q.innerHTML="",x={},B(),O=Q.selectedIndex,Q.value=K.value,0>Q.selectedIndex&&(Q.selectedIndex=O))},!0,!0,!0,!0)}function B(){var H=b.getRecent("Folders"),K=0;if(null!=H&&0<H.length){for(var O=0;O<H.length;O++)null!=-E(H[O].mode,H[O].path,H[O].id)&&K++;0<K&&Q.appendChild(P.cloneNode(!0))}E(App.MODE_GOOGLE,mxResources.get("myDrive"),"root",null,null,"root");E(App.MODE_GOOGLE,null,null,null,null,"pick");null!=b.oneDrive&&(E(App.MODE_ONEDRIVE,mxResources.get("myFiles"),OneDriveFile.prototype.getIdOf(b.oneDrive.rootId),null,null,"root"),E(App.MODE_ONEDRIVE,null,null,null,null,"pick"));null!=b.dropbox&&E(App.MODE_DROPBOX,"Apps"+b.dropbox.appPath);E(App.MODE_GITHUB,null,null,null,null,"pick");E(App.MODE_GITLAB,null,-null,null,null,"pick");E(App.MODE_TRELLO);H=!Editor.useLocalStorage||"device"==urlParams.storage||null!=b.getCurrentFile()&&"1"!=urlParams.noDevice;EditorUi.nativeFileSupport&&H&&E(App.MODE_DEVICE,null,null,b.mode==App.MODE_DEVICE||null!=c&&0<=mxUtils.indexOf(c,App.MODE_BROWSER)?!0:null);isLocalStorage&&"0"!=urlParams.browser&&E(App.MODE_BROWSER);H&&E("download");Editor.popupsAllowed&&E("_blank",null,null,null,mxResources.get("openInNewWindow"));0<K&&(Q.appendChild(P.cloneNode(!0)),K=Q.value,Q.appendChild(S),+"file");mxEvent.addListener(la,"change",function(sa){b.openFiles(la.files,!0);la.value=""});la.style.display="none";document.body.appendChild(la);b.newDlgFileInputElt=la}b.newDlgFileInputElt.click()}),m.className="geBtn",y.appendChild(m));y.appendChild(A);b.editor.cancelFirst||null!=c||l&&null==p||y.appendChild(t);H.appendChild(y);this.container=H};NewDialog.tagsList={};+var SaveDialog=function(b,e,f,c,l,p,q,v){function D(H,K,N,M,n,A){var E=null;if(null==c||0>mxUtils.indexOf(c,H))if(n=null!=n?n:b.getTitleForService(H),0<=mxUtils.indexOf(V,H)||null!=b.getServiceForName(H)){E=document.createElement("option");if("pick"==A)E.innerHTML=mxUtils.htmlEntities(n)+" – "+mxUtils.htmlEntities(mxResources.get("pickFolder"))+"...",E.setAttribute("value","pickFolder-"+H),E.setAttribute("title",n+" - "+mxResources.get("pickFolder")+"...");else{var L=H++(null!=N?"-"+N:""),O=x[L];null!=O&&null!=O.option&&O.option.parentNode.removeChild(O.option);O=null;if(null!=K){"/"==K.charAt(K.length-1)&&(K=K.substring(0,K.length-1));"/"==K.charAt(0)&&(K=K.substring(1));O=K;if(H!=App.MODE_GITHUB&&H==App.MODE_GITLAB){var R=O.lastIndexOf("/");0<=R&&(O=O.substring(R+1))}40<O.length&&(O=O.substring(0,20)+"..."+O.substring(O.length-20))}E.innerHTML=mxUtils.htmlEntities(n)+(null!=O?" – "+mxUtils.htmlEntities(O):"");E.setAttribute("title",n++(null!=K?" ("+K+")":"")+(null!=N&&decodeURIComponent(N)!=K?" ["+N+"]":""));E.setAttribute("value",L);x[L]={option:E,mode:H,path:K,id:N};SaveDialog.lastValue==L&&null==v?M=!0:null==M&&("root"==A?M=null==v&&b.mode==H||null!=H&&H==v:"pickFolder-"==Q.value.substring(0,11)&&(M=!0));M&&E.setAttribute("selected","selected")}Q.appendChild(E)}return E}function G(H){b.pickFolder(H,function(K){var N=null;H==App.MODE_GOOGLE&&null!=K.docs&&0<K.docs.length?N={mode:H,path:K.docs[0].name,id:K.docs[0].id}:H==App.MODE_ONEDRIVE&&+null!=K.value&&0<K.value.length?N={mode:H,path:K.value[0].name,id:OneDriveFile.prototype.getIdOf(K.value[0])}:(H==App.MODE_GITHUB||H==App.MODE_GITLAB)&&null!=K&&0<K.length&&(N={mode:H,path:decodeURIComponent(K),id:K});null!=N&&(S.style.display="",b.addRecent(N,"Folders",5),K=D(N.mode,N.path,N.id,!0),Q.innerHTML="",x={},B(),N=Q.selectedIndex,Q.value=K.value,0>Q.selectedIndex&&(Q.selectedIndex=N))},!0,!0,!0,!0)}function B(){var H=b.getRecent("Folders"),K=0;if(null!=H&&0<H.length){for(var N=0;N<H.length;N++)null!=+D(H[N].mode,H[N].path,H[N].id)&&K++;0<K&&Q.appendChild(P.cloneNode(!0))}D(App.MODE_GOOGLE,mxResources.get("myDrive"),"root",null,null,"root");D(App.MODE_GOOGLE,null,null,null,null,"pick");null!=b.oneDrive&&(D(App.MODE_ONEDRIVE,mxResources.get("myFiles"),OneDriveFile.prototype.getIdOf(b.oneDrive.rootId),null,null,"root"),D(App.MODE_ONEDRIVE,null,null,null,null,"pick"));null!=b.dropbox&&D(App.MODE_DROPBOX,"Apps"+b.dropbox.appPath);D(App.MODE_GITHUB,null,null,null,null,"pick");D(App.MODE_GITLAB,null,+null,null,null,"pick");D(App.MODE_TRELLO);H=!Editor.useLocalStorage||"device"==urlParams.storage||null!=b.getCurrentFile()&&"1"!=urlParams.noDevice;EditorUi.nativeFileSupport&&H&&D(App.MODE_DEVICE,null,null,b.mode==App.MODE_DEVICE||null!=c&&0<=mxUtils.indexOf(c,App.MODE_BROWSER)?!0:null);isLocalStorage&&"0"!=urlParams.browser&&D(App.MODE_BROWSER);H&&D("download");Editor.popupsAllowed&&D("_blank",null,null,null,mxResources.get("openInNewWindow"));0<K&&(Q.appendChild(P.cloneNode(!0)),K=Q.value,Q.appendChild(S),Q.value=K);if("pickFolder-"==Q.value.substring(0,11)||"reset"==Q.value)K=document.createElement("option"),K.setAttribute("value",""),K.setAttribute("selected","selected"),mxUtils.write(K,mxResources.get("pickFolder")+"..."),Q.insertBefore(K,Q.firstChild);u=Q.value}function d(){if("reset"==Q.value)b.resetRecent("Folders"),Q.innerHTML="",Q.value="",pickFolderOption=null,x={},B();else if("pickFolder-"==Q.value.substring(0,11)){var H=Q.value.substring(11);Q.value=u;G(H)}else if(null!=C&&null!=x[Q.value]&&null!=b.editor.diagramFileTypes&&"drawio"==b.editor.diagramFileTypes[C.value].extension){H=b.getExtensionForService(x[Q.value].mode);var K=F.value;null!=H&&0>e.indexOf(".")&&0>K.indexOf(".")&&(F.value=K+H)}J.innerHTML="";mxUtils.write(J,mxResources.get("download"==Q.value||"_blank"==Q.value?"ok":"save"));""==Q.value?J.setAttribute("disabled","disabled"):J.removeAttribute("disabled")}var g=document.createElement("div");g.style.display="flex";g.style.flexWrap="wrap";g.style.whiteSpace="nowrap";var k=document.createElement("div");k.style.display="grid";k.style.gap="5px 8px";k.style.gridAutoRows="auto auto 44px";k.style.gridAutoColumns="0fr minmax(0,1fr)";k.style.width="100%";var m=null,t=null;if(null!=l&&null!=p&&"image/"==p.substring(0,6)&&("image/svg"!=p.substring(0,9)||mxClient.IS_SVG)){k.style.display="inline-grid";k.style.flexBasis="75%";m=document.createElement("div");m.style.display="inline-block";m.style.height="auto";m.style.maxWidth="25%";m.style.margin="auto";var y=document.createElement("img"),-A=q?l:btoa(unescape(encodeURIComponent(l)));y.setAttribute("src","data:"+p+";base64,"+A);y.style.boxSizing="border-box";y.style.maxHeight="50px";y.style.maxWidth="100%";y.style.paddingLeft="10px";m.appendChild(y);mxClient.IS_FF||"image/png"!=p||null==navigator.clipboard||"function"!==typeof window.ClipboardItem||(t=mxUtils.button(mxResources.get("copy"),function(){var H=b.base64ToBlob(A,"image/png");H=new ClipboardItem({"image/png":H,"text/html":new Blob(['<img src="data:'+p+";base64,"+A+'">'],{type:"text/html"})});+z=q?l:btoa(unescape(encodeURIComponent(l)));y.setAttribute("src","data:"+p+";base64,"+z);y.style.boxSizing="border-box";y.style.maxHeight="50px";y.style.maxWidth="100%";y.style.paddingLeft="10px";m.appendChild(y);mxClient.IS_FF||"image/png"!=p||null==navigator.clipboard||"function"!==typeof window.ClipboardItem||(t=mxUtils.button(mxResources.get("copy"),function(){var H=b.base64ToBlob(z,"image/png");H=new ClipboardItem({"image/png":H,"text/html":new Blob(['<img src="data:'+p+";base64,"+z+'">'],{type:"text/html"})});navigator.clipboard.write([H]).then(mxUtils.bind(this,function(){b.alert(mxResources.get("copiedToClipboard"))}))["catch"](mxUtils.bind(this,function(K){b.handleError(K)}))},null,"geBtn"));Editor.popupsAllowed&&(null==c||0>mxUtils.indexOf(c,"_blank"))?(m.setAttribute("title",mxResources.get("openInNewWindow")),m.style.cursor="pointer",mxEvent.addGestureListeners(m,null,null,function(H){mxEvent.isPopupTrigger(H)||b.openInNewWindow(l,p,q)})):m.setAttribute("title",mxResources.get("preview"))}y=document.createElement("div");y.style.display="flex";y.style.padding="1px";y.style.alignItems="center";y.style.justifyContent="flex-end";y.style.gridColumn="1";y.style.whiteSpace="nowrap";var I=document.createElement("div");I.style.display="grid";I.style.padding="1px";I.style.alignItems="center";I.style.gridColumn="2";I.style.gridAutoColumns="minmax(0,1fr) auto";I.style.gap="6px";mxUtils.write(y,mxResources.get("saveAs")+":");var F=document.createElement("input");F.setAttribute("type","text");F.setAttribute("value",e);F.style.boxSizing="border-box";F.style.width="100%";I.appendChild(F);k.appendChild(y);k.appendChild(I);var C=null;null!=b.editor.diagramFileTypes&&null==p&&(y=y.cloneNode(!1),I=I.cloneNode(!1),mxUtils.write(y,mxResources.get("type")+":"),C=FilenameDialog.createFileTypes(b,F,b.editor.diagramFileTypes),C.style.boxSizing="border-box",C.style.width="100%",I.appendChild(C),k.appendChild(y),k.appendChild(I));y=y.cloneNode(!1);I=I.cloneNode(!1);mxUtils.write(y,mxResources.get("where")+":");var Q=document.createElement("select");Q.style.textOverflow="ellipsis";Q.style.gridColumn="1";var S=document.createElement("option");mxUtils.write(S,mxResources.get("reset"));S.setAttribute("value","reset");var V=["browser","device","download","_blank"],P=document.createElement("option");P.setAttribute("disabled","disabled");P.innerHTML="-----------------";var u=null,x={},J=mxUtils.button(mxResources.get("save"),function(){SaveDialog.lastValue=Q.value;var H=x[SaveDialog.lastValue];null!=H&&f(F,H.mode,H.id)},null,"geBtn gePrimaryBtn");mxEvent.addListener(F,"keypress",function(H){13==H.keyCode&&J.click()});mxEvent.addListener(Q,"change",d);B();d();I.appendChild(Q);null!=SaveDialog.lastValue&&null!=x[SaveDialog.lastValue]&&(Q.value=SaveDialog.lastValue);k.appendChild(y);k.appendChild(I);g.appendChild(k);null!=m&&g.appendChild(m);k=document.createElement("div");k.style.flexBasis="100%";k.style.textAlign="right";k.style.marginTop=null!=p?"16px":"8px";b.isOffline()&&!mxClient.IS_CHROMEAPP||k.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/save-file-formats"));-m=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()},null,"geBtn");b.editor.cancelFirst&&k.appendChild(m);null!=t&&k.appendChild(t);k.appendChild(J);b.editor.cancelFirst||k.appendChild(m);g.appendChild(k);this.init=function(){Editor.selectFilename(F)};this.container=g},CreateDialog=function(b,e,f,c,l,p,q,v,E,G,B,d,g,k,m,t,y){function A(u,x,J,H){function K(){mxEvent.addListener(O,"click",function(){var L=J;if(q){var N=C.value,R=N.lastIndexOf(".");if(0>e.lastIndexOf(".")&&0>R){L=null!=-L?L:P.value;var T="";L==App.MODE_GOOGLE?T=b.drive.extension:L==App.MODE_GITHUB?T=b.gitHub.extension:L==App.MODE_GITLAB?T=b.gitLab.extension:L==App.MODE_TRELLO?T=b.trello.extension:L==App.MODE_DROPBOX?T=b.dropbox.extension:L==App.MODE_ONEDRIVE?T=b.oneDrive.extension:L==App.MODE_DEVICE&&(T=".drawio");0<=R&&(N=N.substring(0,R));C.value=N+T}}I(J)})}var O=document.createElement("a");O.style.overflow="hidden";var M=document.createElement("img");M.src=u;M.setAttribute("border","0");M.setAttribute("align",-"absmiddle");M.style.width="60px";M.style.height="60px";M.style.paddingBottom="6px";O.style.display="inline-block";O.className="geBaseButton";O.style.position="relative";O.style.margin="4px";O.style.padding="8px 8px 10px 8px";O.style.whiteSpace="nowrap";O.appendChild(M);O.style.color="gray";O.style.fontSize="11px";var n=document.createElement("div");O.appendChild(n);mxUtils.write(n,x);if(null!=H&&null==b[H]){M.style.visibility="hidden";mxUtils.setOpacity(n,10);var z=new Spinner({lines:12,length:12,-width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});z.spin(O);var D=window.setTimeout(function(){null==b[H]&&(z.stop(),O.style.display="none")},3E4);b.addListener("clientLoaded",mxUtils.bind(this,function(){null!=b[H]&&(window.clearTimeout(D),mxUtils.setOpacity(n,100),M.style.visibility="",z.stop(),K())}))}else K();S.appendChild(O);++V==d&&(mxUtils.br(S),V=0)}function I(u){var x=C.value;if(null==u||null!=x&&0<x.length)y&&b.hideDialog(),+m=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()},null,"geBtn");b.editor.cancelFirst&&k.appendChild(m);null!=t&&k.appendChild(t);k.appendChild(J);b.editor.cancelFirst||k.appendChild(m);g.appendChild(k);this.init=function(){Editor.selectFilename(F)};this.container=g},CreateDialog=function(b,e,f,c,l,p,q,v,D,G,B,d,g,k,m,t,y){function z(u,x,J,H){function K(){mxEvent.addListener(N,"click",function(){var L=J;if(q){var O=C.value,R=O.lastIndexOf(".");if(0>e.lastIndexOf(".")&&0>R){L=null!=+L?L:P.value;var T="";L==App.MODE_GOOGLE?T=b.drive.extension:L==App.MODE_GITHUB?T=b.gitHub.extension:L==App.MODE_GITLAB?T=b.gitLab.extension:L==App.MODE_TRELLO?T=b.trello.extension:L==App.MODE_DROPBOX?T=b.dropbox.extension:L==App.MODE_ONEDRIVE?T=b.oneDrive.extension:L==App.MODE_DEVICE&&(T=".drawio");0<=R&&(O=O.substring(0,R));C.value=O+T}}I(J)})}var N=document.createElement("a");N.style.overflow="hidden";var M=document.createElement("img");M.src=u;M.setAttribute("border","0");M.setAttribute("align",+"absmiddle");M.style.width="60px";M.style.height="60px";M.style.paddingBottom="6px";N.style.display="inline-block";N.className="geBaseButton";N.style.position="relative";N.style.margin="4px";N.style.padding="8px 8px 10px 8px";N.style.whiteSpace="nowrap";N.appendChild(M);N.style.color="gray";N.style.fontSize="11px";var n=document.createElement("div");N.appendChild(n);mxUtils.write(n,x);if(null!=H&&null==b[H]){M.style.visibility="hidden";mxUtils.setOpacity(n,10);var A=new Spinner({lines:12,length:12,+width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});A.spin(N);var E=window.setTimeout(function(){null==b[H]&&(A.stop(),N.style.display="none")},3E4);b.addListener("clientLoaded",mxUtils.bind(this,function(){null!=b[H]&&(window.clearTimeout(E),mxUtils.setOpacity(n,100),M.style.visibility="",A.stop(),K())}))}else K();S.appendChild(N);++V==d&&(mxUtils.br(S),V=0)}function I(u){var x=C.value;if(null==u||null!=x&&0<x.length)y&&b.hideDialog(),f(x,u,C)}B="1"==urlParams.noDevice?!1:B;q=null!=q?q:!0;v=null!=v?v:!0;d=null!=d?d:4;y=null!=y?y:!0;p=document.createElement("div");p.style.whiteSpace="nowrap";null==c&&b.addLanguageMenu(p);var F=document.createElement("h2");mxUtils.write(F,l||mxResources.get("create"));F.style.marginTop="0px";F.style.marginBottom="24px";p.appendChild(F);l=document.createElement("span");mxUtils.write(l,mxResources.get("filename")+":");l.style.maxWidth="106px";l.style.overflow="hidden";l.style.textOverflow="ellipsis";l.style.display="inline-block";p.appendChild(l);var C=document.createElement("input");C.setAttribute("value",e);C.style.width="180px";C.style.marginLeft="10px";C.style.marginBottom="20px";C.style.maxWidth="70%";this.init=function(){Editor.selectFilename(C)};p.appendChild(C);null!=t&&null!=b.editor.diagramFileTypes&&(t=FilenameDialog.createFileTypes(b,C,b.editor.diagramFileTypes),t.style.marginLeft="6px",t.style.width="90px",p.appendChild(t));t=null;if("1"!=urlParams.noDevice&&null!=g&&null!=k&&"image/"==k.substring(0,6)&&("image/svg"!=k.substring(0,9)||mxClient.IS_SVG)){C.style.width="160px";l=document.createElement("img");var Q=m?g:btoa(unescape(encodeURIComponent(g)));l.setAttribute("src","data:"+k+";base64,"+Q);l.style.position="absolute";l.style.top="70px";l.style.right="100px";l.style.maxWidth="120px";l.style.maxHeight="80px";mxUtils.setPrefixedStyle(l.style,"transform","translate(50%,-50%)");p.appendChild(l);mxClient.IS_FF||"image/png"!=k||null==navigator.clipboard||"function"!==typeof window.ClipboardItem||-(t=mxUtils.button(mxResources.get("copy"),function(u){u=b.base64ToBlob(Q,"image/png");u=new ClipboardItem({"image/png":u,"text/html":new Blob(['<img src="data:'+k+";base64,"+Q+'">'],{type:"text/html"})});navigator.clipboard.write([u]).then(mxUtils.bind(this,function(){b.alert(mxResources.get("copiedToClipboard"))}))["catch"](mxUtils.bind(this,function(x){b.handleError(x)}))}),t.style.marginTop="6px",t.className="geBtn");E&&Editor.popupsAllowed&&(l.style.cursor="pointer",mxEvent.addGestureListeners(l,-null,null,function(u){mxEvent.isPopupTrigger(u)||I("_blank")}))}mxUtils.br(p);var S=document.createElement("div");S.style.textAlign="center";var V=0;S.style.marginTop="6px";p.appendChild(S);var P=document.createElement("select");P.style.marginLeft="10px";b.isOfflineApp()||b.isOffline()||("function"===typeof window.DriveClient&&(g=document.createElement("option"),g.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(g,mxResources.get("googleDrive")),P.appendChild(g),A(IMAGE_PATH+"/google-drive-logo.svg",-mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(g=document.createElement("option"),g.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(g,mxResources.get("oneDrive")),P.appendChild(g),b.mode==App.MODE_ONEDRIVE&&g.setAttribute("selected","selected"),A(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),"function"===typeof window.DropboxClient&&(g=document.createElement("option"),g.setAttribute("value",App.MODE_DROPBOX),-mxUtils.write(g,mxResources.get("dropbox")),P.appendChild(g),b.mode==App.MODE_DROPBOX&&g.setAttribute("selected","selected"),A(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),null!=b.gitHub&&(g=document.createElement("option"),g.setAttribute("value",App.MODE_GITHUB),mxUtils.write(g,mxResources.get("github")),P.appendChild(g),A(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),null!=b.gitLab&&(g=document.createElement("option"),-g.setAttribute("value",App.MODE_GITLAB),mxUtils.write(g,mxResources.get("gitlab")),P.appendChild(g),A(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab")),"function"===typeof window.TrelloClient&&(g=document.createElement("option"),g.setAttribute("value",App.MODE_TRELLO),mxUtils.write(g,mxResources.get("trello")),P.appendChild(g),A(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),App.MODE_TRELLO,"trello")));if(!Editor.useLocalStorage||"device"==urlParams.storage||-null!=b.getCurrentFile()&&"1"!=urlParams.noDevice)g=document.createElement("option"),g.setAttribute("value",App.MODE_DEVICE),mxUtils.write(g,mxResources.get("device")),P.appendChild(g),b.mode!=App.MODE_DEVICE&&v||g.setAttribute("selected","selected"),B&&A(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);v&&isLocalStorage&&"0"!=urlParams.browser&&(v=document.createElement("option"),v.setAttribute("value",App.MODE_BROWSER),mxUtils.write(v,mxResources.get("browser")),P.appendChild(v),-b.mode==App.MODE_BROWSER&&v.setAttribute("selected","selected"),A(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));v=document.createElement("div");v.style.marginTop="26px";v.style.textAlign="center";null!=G&&(B=mxUtils.button(mxResources.get("help"),function(){b.openLink(G)}),B.className="geBtn",v.appendChild(B));B=mxUtils.button(mxResources.get(null!=c?"close":"cancel"),function(){null!=c?c():(b.fileLoaded(null),b.hideDialog(),window.close(),window.location.href=b.getUrl())});-B.className="geBtn";b.editor.cancelFirst&&null==c&&v.appendChild(B);null==c&&(g=mxUtils.button(mxResources.get("decideLater"),function(){I(null)}),g.className="geBtn",v.appendChild(g));E&&Editor.popupsAllowed&&(E=mxUtils.button(mxResources.get("openInNewWindow"),function(){I("_blank")}),E.className="geBtn",v.appendChild(E));CreateDialog.showDownloadButton&&(E=mxUtils.button(mxResources.get("download"),function(){I("download")}),E.className="geBtn",v.appendChild(E),null!=t&&(E.style.marginTop="6px",+(t=mxUtils.button(mxResources.get("copy"),function(u){u=b.base64ToBlob(Q,"image/png");u=new ClipboardItem({"image/png":u,"text/html":new Blob(['<img src="data:'+k+";base64,"+Q+'">'],{type:"text/html"})});navigator.clipboard.write([u]).then(mxUtils.bind(this,function(){b.alert(mxResources.get("copiedToClipboard"))}))["catch"](mxUtils.bind(this,function(x){b.handleError(x)}))}),t.style.marginTop="6px",t.className="geBtn");D&&Editor.popupsAllowed&&(l.style.cursor="pointer",mxEvent.addGestureListeners(l,+null,null,function(u){mxEvent.isPopupTrigger(u)||I("_blank")}))}mxUtils.br(p);var S=document.createElement("div");S.style.textAlign="center";var V=0;S.style.marginTop="6px";p.appendChild(S);var P=document.createElement("select");P.style.marginLeft="10px";b.isOfflineApp()||b.isOffline()||("function"===typeof window.DriveClient&&(g=document.createElement("option"),g.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(g,mxResources.get("googleDrive")),P.appendChild(g),z(IMAGE_PATH+"/google-drive-logo.svg",+mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(g=document.createElement("option"),g.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(g,mxResources.get("oneDrive")),P.appendChild(g),b.mode==App.MODE_ONEDRIVE&&g.setAttribute("selected","selected"),z(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),"function"===typeof window.DropboxClient&&(g=document.createElement("option"),g.setAttribute("value",App.MODE_DROPBOX),+mxUtils.write(g,mxResources.get("dropbox")),P.appendChild(g),b.mode==App.MODE_DROPBOX&&g.setAttribute("selected","selected"),z(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),null!=b.gitHub&&(g=document.createElement("option"),g.setAttribute("value",App.MODE_GITHUB),mxUtils.write(g,mxResources.get("github")),P.appendChild(g),z(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),null!=b.gitLab&&(g=document.createElement("option"),+g.setAttribute("value",App.MODE_GITLAB),mxUtils.write(g,mxResources.get("gitlab")),P.appendChild(g),z(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab")),"function"===typeof window.TrelloClient&&(g=document.createElement("option"),g.setAttribute("value",App.MODE_TRELLO),mxUtils.write(g,mxResources.get("trello")),P.appendChild(g),z(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),App.MODE_TRELLO,"trello")));if(!Editor.useLocalStorage||"device"==urlParams.storage||+null!=b.getCurrentFile()&&"1"!=urlParams.noDevice)g=document.createElement("option"),g.setAttribute("value",App.MODE_DEVICE),mxUtils.write(g,mxResources.get("device")),P.appendChild(g),b.mode!=App.MODE_DEVICE&&v||g.setAttribute("selected","selected"),B&&z(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);v&&isLocalStorage&&"0"!=urlParams.browser&&(v=document.createElement("option"),v.setAttribute("value",App.MODE_BROWSER),mxUtils.write(v,mxResources.get("browser")),P.appendChild(v),+b.mode==App.MODE_BROWSER&&v.setAttribute("selected","selected"),z(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));v=document.createElement("div");v.style.marginTop="26px";v.style.textAlign="center";null!=G&&(B=mxUtils.button(mxResources.get("help"),function(){b.openLink(G)}),B.className="geBtn",v.appendChild(B));B=mxUtils.button(mxResources.get(null!=c?"close":"cancel"),function(){null!=c?c():(b.fileLoaded(null),b.hideDialog(),window.close(),window.location.href=b.getUrl())});+B.className="geBtn";b.editor.cancelFirst&&null==c&&v.appendChild(B);null==c&&(g=mxUtils.button(mxResources.get("decideLater"),function(){I(null)}),g.className="geBtn",v.appendChild(g));D&&Editor.popupsAllowed&&(D=mxUtils.button(mxResources.get("openInNewWindow"),function(){I("_blank")}),D.className="geBtn",v.appendChild(D));CreateDialog.showDownloadButton&&(D=mxUtils.button(mxResources.get("download"),function(){I("download")}),D.className="geBtn",v.appendChild(D),null!=t&&(D.style.marginTop="6px",v.style.marginTop="6px"));null!=t&&(mxUtils.br(v),v.appendChild(t));b.editor.cancelFirst&&null==c||v.appendChild(B);mxEvent.addListener(C,"keypress",function(u){13==u.keyCode?I(App.MODE_DEVICE):27==u.keyCode&&(b.fileLoaded(null),b.hideDialog(),window.close())});p.appendChild(v);this.container=p};CreateDialog.showDownloadButton="1"!=urlParams.noDevice;var PopupDialog=function(b,e,f,c,l){l=null!=l?l:!0;var p=document.createElement("div");p.style.textAlign="center";p.style.height="100%";mxUtils.write(p,mxResources.get("fileOpenLocation"));mxUtils.br(p);mxUtils.br(p);var q=mxUtils.button(mxResources.get("openInThisWindow"),function(){l&&b.hideDialog();null!=c&&c()});q.className="geBtn";q.style.marginBottom="8px";q.style.width="280px";p.appendChild(q);mxUtils.br(p);var v=mxUtils.button(mxResources.get("openInNewWindow"),function(){l&&b.hideDialog();-null!=f&&f();b.openLink(e,null,!0)});v.className="geBtn gePrimaryBtn";v.style.width=q.style.width;p.appendChild(v);mxUtils.br(p);mxUtils.br(p);mxUtils.write(p,mxResources.get("allowPopups"));this.container=p},ImageDialog=function(b,e,f,c,l,p,q,v){function E(){0<d.value.length?I.removeAttribute("disabled"):I.setAttribute("disabled","disabled");"data:"!=d.value.substring(0,5)?F.removeAttribute("disabled"):F.setAttribute("disabled","disabled")}p=null!=p?p:!0;var G=b.editor.graph,B=document.createElement("div");+null!=f&&f();b.openLink(e,null,!0)});v.className="geBtn gePrimaryBtn";v.style.width=q.style.width;p.appendChild(v);mxUtils.br(p);mxUtils.br(p);mxUtils.write(p,mxResources.get("allowPopups"));this.container=p},ImageDialog=function(b,e,f,c,l,p,q,v){function D(){0<d.value.length?I.removeAttribute("disabled"):I.setAttribute("disabled","disabled");"data:"!=d.value.substring(0,5)?F.removeAttribute("disabled"):F.setAttribute("disabled","disabled")}p=null!=p?p:!0;var G=b.editor.graph,B=document.createElement("div");mxUtils.write(B,e);e=document.createElement("div");e.className="geTitle";e.style.backgroundColor="transparent";e.style.borderColor="transparent";e.style.whiteSpace="nowrap";e.style.textOverflow="clip";e.style.cursor="default";e.style.paddingRight="20px";var d=document.createElement("input");d.setAttribute("value",f);d.setAttribute("type","text");d.setAttribute("spellcheck","false");d.setAttribute("autocorrect","off");d.setAttribute("autocomplete","off");d.setAttribute("autocapitalize","off");d.style.marginTop="6px";d.style.width=(Graph.fileSupport?460:340)-20+"px";d.style.backgroundImage="url('"+Editor.crossImage+"')";d.style.backgroundRepeat="no-repeat";d.style.backgroundPosition="100% 50%";d.style.paddingRight="14px";f=document.createElement("div");f.setAttribute("title",mxResources.get("reset"));f.style.position="relative";f.style.left="-16px";f.style.width="12px";f.style.height="14px";f.style.cursor="pointer";f.style.display="inline-block";f.style.top="3px";f.style.background="url('"+b.editor.transparentImage+"')";mxEvent.addListener(f,"click",function(){d.value="";d.focus()});e.appendChild(d);e.appendChild(f);B.appendChild(e);var g=v,k,m,t=function(C,Q,S,V){var P="data:"==C.substring(0,5);!b.isOffline()||P&&"undefined"===typeof chrome?0<C.length&&b.spinner.spin(document.body,mxResources.get("inserting"))?b.loadImage(C,function(u){b.spinner.stop();b.hideDialog();var x=!1===V?1:null!=Q&&null!=S?Math.max(Q/u.width,S/u.height):Math.min(1,Math.min(520/u.width,520/u.height));p&&(C=b.convertDataUri(C));c(C,Math.round(Number(u.width)*x),Math.round(Number(u.height)*x),g,k,m)},function(){b.spinner.stop();c(null);b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(b.hideDialog(),c(C,null,null,g,k,m)):(C=b.convertDataUri(C),Q=null==Q?120:Q,S=null==S?100:S,b.hideDialog(),c(C,Q,S,g,k,m))},y=function(C,Q){if(null!=C){var S=l?null:G.getModel().getGeometry(G.getSelectionCell());null!=S?t(C,S.width,S.height,Q):t(C,null,null,Q)}else b.hideDialog(),c(null)};this.init=function(){d.focus();if(Graph.fileSupport){d.setAttribute("placeholder",mxResources.get("dragImagesHere"));var C=B.parentNode,Q=null;mxEvent.addListener(C,"dragleave",function(S){null!=Q&&(Q.parentNode.removeChild(Q),Q=null);S.stopPropagation();S.preventDefault()});mxEvent.addListener(C,"dragover",mxUtils.bind(this,function(S){null==Q&&(!mxClient.IS_IE||10<document.documentMode)&&(Q=b.highlightElement(C));S.stopPropagation();S.preventDefault()}));mxEvent.addListener(C,"drop",mxUtils.bind(this,function(S){null!=Q&&(Q.parentNode.removeChild(Q),-Q=null);if(0<S.dataTransfer.files.length)b.importFiles(S.dataTransfer.files,0,0,b.maxImageSize,function(P,u,x,J,H,K,O,M){y(P,M)},function(){},function(P){return"image/"==P.type.substring(0,6)},function(P){for(var u=0;u<P.length;u++)P[u]()},!mxEvent.isControlDown(S),null,null,!0);else if(0<=mxUtils.indexOf(S.dataTransfer.types,"text/uri-list")){var V=S.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(V)&&y(decodeURIComponent(V))}S.stopPropagation();S.preventDefault()}),-!1)}};v=document.createElement("div");v.style.marginTop="14px";v.style.textAlign="center";f=mxUtils.button(mxResources.get("cancel"),function(){b.spinner.stop();b.hideDialog()});f.className="geBtn";b.editor.cancelFirst&&v.appendChild(f);ImageDialog.filePicked=function(C){C.action==google.picker.Action.PICKED&&null!=C.docs[0].thumbnails&&(C=C.docs[0].thumbnails[C.docs[0].thumbnails.length-1],null!=C&&(d.value=C.url));d.focus()};if(Graph.fileSupport){if(null==b.imgDlgFileInputElt){var A=document.createElement("input");-A.setAttribute("multiple","multiple");A.setAttribute("type","file");mxEvent.addListener(A,"change",function(C){null!=A.files&&(b.importFiles(A.files,0,0,b.maxImageSize,function(Q,S,V,P,u,x){y(Q)},function(){},function(Q){return"image/"==Q.type.substring(0,6)},function(Q){for(var S=0;S<Q.length;S++)Q[S]()},!0),A.type="",A.type="file",A.value="")});A.style.display="none";document.body.appendChild(A);b.imgDlgFileInputElt=A}e=mxUtils.button(mxResources.get("open"),function(){b.imgDlgFileInputElt.click()});+Q=null);if(0<S.dataTransfer.files.length)b.importFiles(S.dataTransfer.files,0,0,b.maxImageSize,function(P,u,x,J,H,K,N,M){y(P,M)},function(){},function(P){return"image/"==P.type.substring(0,6)},function(P){for(var u=0;u<P.length;u++)P[u]()},!mxEvent.isControlDown(S),null,null,!0);else if(0<=mxUtils.indexOf(S.dataTransfer.types,"text/uri-list")){var V=S.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(V)&&y(decodeURIComponent(V))}S.stopPropagation();S.preventDefault()}),+!1)}};v=document.createElement("div");v.style.marginTop="14px";v.style.textAlign="center";f=mxUtils.button(mxResources.get("cancel"),function(){b.spinner.stop();b.hideDialog()});f.className="geBtn";b.editor.cancelFirst&&v.appendChild(f);ImageDialog.filePicked=function(C){C.action==google.picker.Action.PICKED&&null!=C.docs[0].thumbnails&&(C=C.docs[0].thumbnails[C.docs[0].thumbnails.length-1],null!=C&&(d.value=C.url));d.focus()};if(Graph.fileSupport){if(null==b.imgDlgFileInputElt){var z=document.createElement("input");+z.setAttribute("multiple","multiple");z.setAttribute("type","file");mxEvent.addListener(z,"change",function(C){null!=z.files&&(b.importFiles(z.files,0,0,b.maxImageSize,function(Q,S,V,P,u,x){y(Q)},function(){},function(Q){return"image/"==Q.type.substring(0,6)},function(Q){for(var S=0;S<Q.length;S++)Q[S]()},!0),z.type="",z.type="file",z.value="")});z.style.display="none";document.body.appendChild(z);b.imgDlgFileInputElt=z}e=mxUtils.button(mxResources.get("open"),function(){b.imgDlgFileInputElt.click()});e.className="geBtn";v.appendChild(e)}mxEvent.addListener(d,"keypress",function(C){13==C.keyCode&&y(d.value)});var I=mxUtils.button(mxResources.get("crop"),function(){var C=new CropImageDialog(b,d.value,g,function(Q,S,V){g=Q;k=S;m=V});b.showDialog(C.container,300,390,!0,!0)});q&&(I.className="geBtn",v.appendChild(I));var F=mxUtils.button(mxResources.get("embed"),function(){if("data:"!=d.value.substring(0,5)&&b.spinner.spin(document.body,mxResources.get("loading"))){var C=b.editor.createImageUrlConverter().convert(d.value),-Q=new Image;Q.onload=function(){b.editor.convertImageToDataUri(C,function(S){b.confirmImageResize(function(V){b.resizeImage(Q,S,mxUtils.bind(this,function(P,u,x){b.spinner.stop();null!=P&&P.length<b.maxImageBytes?(d.value=P,E()):b.handleError({message:mxResources.get("imageTooBig")})}),V,b.maxImageSize)},Q.width>b.maxImageSize||Q.height>b.maxImageSize||S.length>b.maxImageBytes)},mxUtils.bind(this,function(){b.handleError({message:mxResources.get("fileNotFound")})}))};Q.onerror=function(){b.spinner.stop();-b.handleError({message:mxResources.get("fileNotFound")})};Q.src=C}});F.className="geBtn";mxEvent.addListener(d,"change",function(C){g=null;E()});E();v.appendChild(F);q=mxUtils.button(mxResources.get("apply"),function(){y(d.value)});q.className="geBtn gePrimaryBtn";v.appendChild(q);b.editor.cancelFirst||v.appendChild(f);Graph.fileSupport&&(v.style.marginTop="120px",B.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",B.style.backgroundPosition="center 65%",B.style.backgroundRepeat="no-repeat",-q=document.createElement("div"),q.style.position="absolute",q.style.width="420px",q.style.top="58%",q.style.textAlign="center",q.style.fontSize="18px",q.style.color="#a0c3ff",mxUtils.write(q,mxResources.get("dragImagesHere")),B.appendChild(q));B.appendChild(v);this.container=B},LinkDialog=function(b,e,f,c,l,p,q){function v(C,Q){var S=document.createElement("option");mxUtils.write(S,mxResources.get(C));S.value=C;I.appendChild(S);F[C]=Q}var E=document.createElement("div");E.style.height="100%";mxUtils.write(E,+Q=new Image;Q.onload=function(){b.editor.convertImageToDataUri(C,function(S){b.confirmImageResize(function(V){b.resizeImage(Q,S,mxUtils.bind(this,function(P,u,x){b.spinner.stop();null!=P&&P.length<b.maxImageBytes?(d.value=P,D()):b.handleError({message:mxResources.get("imageTooBig")})}),V,b.maxImageSize)},Q.width>b.maxImageSize||Q.height>b.maxImageSize||S.length>b.maxImageBytes)},mxUtils.bind(this,function(){b.handleError({message:mxResources.get("fileNotFound")})}))};Q.onerror=function(){b.spinner.stop();+b.handleError({message:mxResources.get("fileNotFound")})};Q.src=C}});F.className="geBtn";mxEvent.addListener(d,"change",function(C){g=null;D()});D();v.appendChild(F);q=mxUtils.button(mxResources.get("apply"),function(){y(d.value)});q.className="geBtn gePrimaryBtn";v.appendChild(q);b.editor.cancelFirst||v.appendChild(f);Graph.fileSupport&&(v.style.marginTop="120px",B.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",B.style.backgroundPosition="center 65%",B.style.backgroundRepeat="no-repeat",+q=document.createElement("div"),q.style.position="absolute",q.style.width="420px",q.style.top="58%",q.style.textAlign="center",q.style.fontSize="18px",q.style.color="#a0c3ff",mxUtils.write(q,mxResources.get("dragImagesHere")),B.appendChild(q));B.appendChild(v);this.container=B},LinkDialog=function(b,e,f,c,l,p,q){function v(C,Q){var S=document.createElement("option");mxUtils.write(S,mxResources.get(C));S.value=C;I.appendChild(S);F[C]=Q}var D=document.createElement("div");D.style.height="100%";mxUtils.write(D,mxResources.get("editLink")+":");var G=document.createElement("div");G.className="geUrlLinkContainer";G.style.backgroundColor="transparent";G.style.borderColor="transparent";G.style.whiteSpace="nowrap";G.style.textOverflow="clip";G.style.cursor="default";var B=document.createElement("input");B.setAttribute("placeholder",mxResources.get("dragUrlsHere"));B.setAttribute("type","text");B.style.marginTop="6px";B.style.width="414px";B.style.boxSizing="border-box";B.style.backgroundRepeat="no-repeat";B.style.backgroundPosition="100% 50%";B.style.paddingRight="16px";B.style.marginBottom="4px";var d=document.createElement("div");d.setAttribute("title",mxResources.get("reset"));d.style.backgroundImage="url("+Editor.crossImage+")";d.className="geAdaptiveAsset";d.style.display="inline-block";d.style.position="relative";d.style.top="3px";d.style.left="-16px";d.style.width="12px";d.style.height="14px";d.style.cursor="pointer";mxEvent.addListener(d,"click",function(){B.value="";B.focus()});var g=document.createElement("input");g.style.cssText="margin-right:8px;margin-bottom:8px;";g.setAttribute("value","url");g.setAttribute("type","radio");g.setAttribute("name","geLinkDialogOption");var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-bottom:8px;";k.setAttribute("value","url");k.setAttribute("type","radio");k.setAttribute("name","geLinkDialogOption");var m=document.createElement("select");m.style.width="414px";var t=document.createElement("input");t.setAttribute("type","checkbox");t.style.margin="0 6p 0 6px";null!=q&&(t.setAttribute("checked","checked"),t.defaultChecked=!0);q=null!=q?q:"_blank";t.setAttribute("title",q);p&&(B.style.width="200px");if(l&&null!=b.pages){null!=e&&Graph.isPageLink(e)?(k.setAttribute("checked","checked"),k.defaultChecked=!0):(B.setAttribute("value",e),g.setAttribute("checked","checked"),g.defaultChecked=!0);G.appendChild(g);G.appendChild(B);G.appendChild(d);p&&(G.appendChild(t),mxUtils.write(G,mxResources.get("openInNewWindow")));mxUtils.br(G);G.appendChild(k);l=!1;for(p=0;p<b.pages.length;p++)d=document.createElement("option"),mxUtils.write(d,b.pages[p].getName()||mxResources.get("pageWithNumber",[p+1])),d.setAttribute("value","data:page/id,"+b.pages[p].getId()),e==d.getAttribute("value")&&(d.setAttribute("selected","selected"),l=!0),m.appendChild(d);if(!l&&k.checked){var y=document.createElement("option");mxUtils.write(y,mxResources.get("pageNotFound"));y.setAttribute("disabled","disabled");y.setAttribute("selected","selected");y.setAttribute("value",-"pageNotFound");m.appendChild(y);mxEvent.addListener(m,"change",function(){null==y.parentNode||y.selected||y.parentNode.removeChild(y)})}G.appendChild(m)}else B.setAttribute("value",e),G.appendChild(B),G.appendChild(d);E.appendChild(G);var A=mxUtils.button(f,function(){b.hideDialog();c(k.checked?"pageNotFound"!==m.value?m.value:e:B.value,LinkDialog.selectedDocs,t.checked?q:null)});A.style.verticalAlign="middle";A.className="geBtn gePrimaryBtn";this.init=function(){k.checked?m.focus():(B.focus(),mxClient.IS_GC||-mxClient.IS_FF||5<=document.documentMode?B.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(m,"focus",function(){g.removeAttribute("checked");k.setAttribute("checked","checked");k.checked=!0});mxEvent.addListener(B,"focus",function(){k.removeAttribute("checked");g.setAttribute("checked","checked");g.checked=!0});if(Graph.fileSupport){var C=E.parentNode,Q=null;mxEvent.addListener(C,"dragleave",function(S){null!=Q&&(Q.parentNode.removeChild(Q),Q=null);S.stopPropagation();S.preventDefault()});-mxEvent.addListener(C,"dragover",mxUtils.bind(this,function(S){null==Q&&(!mxClient.IS_IE||10<document.documentMode)&&(Q=b.highlightElement(C));S.stopPropagation();S.preventDefault()}));mxEvent.addListener(C,"drop",mxUtils.bind(this,function(S){try{null!=Q&&(Q.parentNode.removeChild(Q),Q=null),0<=mxUtils.indexOf(S.dataTransfer.types,"text/uri-list")&&(B.value=decodeURIComponent(S.dataTransfer.getData("text/uri-list")),g.setAttribute("checked","checked"),g.checked=!0,A.click())}catch(V){b.handleError(V)}S.stopPropagation();+"pageNotFound");m.appendChild(y);mxEvent.addListener(m,"change",function(){null==y.parentNode||y.selected||y.parentNode.removeChild(y)})}G.appendChild(m)}else B.setAttribute("value",e),G.appendChild(B),G.appendChild(d);D.appendChild(G);var z=mxUtils.button(f,function(){b.hideDialog();c(k.checked?"pageNotFound"!==m.value?m.value:e:B.value,LinkDialog.selectedDocs,t.checked?q:null)});z.style.verticalAlign="middle";z.className="geBtn gePrimaryBtn";this.init=function(){k.checked?m.focus():(B.focus(),mxClient.IS_GC||+mxClient.IS_FF||5<=document.documentMode?B.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(m,"focus",function(){g.removeAttribute("checked");k.setAttribute("checked","checked");k.checked=!0});mxEvent.addListener(B,"focus",function(){k.removeAttribute("checked");g.setAttribute("checked","checked");g.checked=!0});if(Graph.fileSupport){var C=D.parentNode,Q=null;mxEvent.addListener(C,"dragleave",function(S){null!=Q&&(Q.parentNode.removeChild(Q),Q=null);S.stopPropagation();S.preventDefault()});+mxEvent.addListener(C,"dragover",mxUtils.bind(this,function(S){null==Q&&(!mxClient.IS_IE||10<document.documentMode)&&(Q=b.highlightElement(C));S.stopPropagation();S.preventDefault()}));mxEvent.addListener(C,"drop",mxUtils.bind(this,function(S){try{null!=Q&&(Q.parentNode.removeChild(Q),Q=null),0<=mxUtils.indexOf(S.dataTransfer.types,"text/uri-list")&&(B.value=decodeURIComponent(S.dataTransfer.getData("text/uri-list")),g.setAttribute("checked","checked"),g.checked=!0,z.click())}catch(V){b.handleError(V)}S.stopPropagation();S.preventDefault()}),!1)}};f=document.createElement("div");f.style.marginTop="16px";f.style.textAlign="right";b.isOffline()||f.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/custom-links"));G=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});G.style.verticalAlign="middle";G.className="geBtn";b.editor.cancelFirst&&f.appendChild(G);LinkDialog.selectedDocs=null;LinkDialog.filePicked=function(C){if(C.action==google.picker.Action.PICKED){LinkDialog.selectedDocs=C.docs;var Q=C.docs[0].url;"application/mxe"==C.docs[0].mimeType||null!=C.docs[0].mimeType&&"application/vnd.jgraph."==C.docs[0].mimeType.substring(0,23)?Q="https://www.draw.io/#G"+C.docs[0].id:"application/vnd.google-apps.folder"==C.docs[0].mimeType&&(Q="https://drive.google.com/#folders/"+C.docs[0].id);B.value=Q;B.focus()}else LinkDialog.selectedDocs=null;B.focus()};var I=document.createElement("select");I.className="geBtn";I.style.position="relative";I.style.top="1px";I.style.maxWidth="120px";var F={};l=document.createElement("option");mxUtils.write(l,mxResources.get("select")+"...");l.value="";I.appendChild(l);"undefined"!=typeof google&&"undefined"!=typeof google.picker&&null!=b.drive&&v("googleDrive",function(){b.spinner.spin(document.body,mxResources.get("authorizing"))&&b.drive.checkToken(mxUtils.bind(this,function(){b.spinner.stop();if(null==b.linkPicker){var C=b.drive.createLinkPicker();b.linkPicker=C.setCallback(function(Q){LinkDialog.filePicked(Q)}).build()}b.linkPicker.setVisible(!0)}))});"undefined"!=typeof Dropbox&&"undefined"!=typeof Dropbox.choose&&v("dropbox",function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(C){B.value=C[0].link;B.focus()}})});null!=b.oneDrive&&v("oneDrive",function(){b.oneDrive.pickFile(function(C,Q){null!=Q&&null!=Q.value&&0<Q.value.length&&(B.value=Q.value[0].webUrl,B.focus())},!0)});null!=b.gitHub&&v("github",function(){b.gitHub.pickFile(function(C){if(null!=C){C=C.split("/");var Q=C[0],S=C[1],V=C[2];C=C.slice(3,C.length).join("/");-B.value="https://github.com/"+Q+"/"+S+"/blob/"+V+"/"+C;B.focus()}})});null!=b.gitLab&&v("gitlab",function(){b.gitLab.pickFile(function(C){if(null!=C){C=C.split("/");var Q=C[0],S=C[1],V=C[2];C=C.slice(3,C.length).join("/");B.value=DRAWIO_GITLAB_URL+"/"+Q+"/"+S+"/blob/"+V+"/"+C;B.focus()}})});1<I.children.length&&(f.appendChild(I),mxEvent.addListener(I,"change",function(C){null!=F[I.value]&&(F[I.value](),I.value="")}));mxEvent.addListener(B,"keypress",function(C){13==C.keyCode&&A.click()});f.appendChild(A);-b.editor.cancelFirst||f.appendChild(G);E.appendChild(f);this.container=E},FeedbackDialog=function(b,e,f,c){var l=document.createElement("div"),p=document.createElement("div");mxUtils.write(p,mxResources.get("sendYourFeedback"));p.style.fontSize="18px";p.style.marginBottom="18px";l.appendChild(p);p=document.createElement("div");mxUtils.write(p,mxResources.get("yourEmailAddress")+(f?"":" ("+mxResources.get("required")+")"));l.appendChild(p);var q=document.createElement("input");q.setAttribute("type",+B.value="https://github.com/"+Q+"/"+S+"/blob/"+V+"/"+C;B.focus()}})});null!=b.gitLab&&v("gitlab",function(){b.gitLab.pickFile(function(C){if(null!=C){C=C.split("/");var Q=C[0],S=C[1],V=C[2];C=C.slice(3,C.length).join("/");B.value=DRAWIO_GITLAB_URL+"/"+Q+"/"+S+"/blob/"+V+"/"+C;B.focus()}})});1<I.children.length&&(f.appendChild(I),mxEvent.addListener(I,"change",function(C){null!=F[I.value]&&(F[I.value](),I.value="")}));mxEvent.addListener(B,"keypress",function(C){13==C.keyCode&&z.click()});f.appendChild(z);+b.editor.cancelFirst||f.appendChild(G);D.appendChild(f);this.container=D},FeedbackDialog=function(b,e,f,c){var l=document.createElement("div"),p=document.createElement("div");mxUtils.write(p,mxResources.get("sendYourFeedback"));p.style.fontSize="18px";p.style.marginBottom="18px";l.appendChild(p);p=document.createElement("div");mxUtils.write(p,mxResources.get("yourEmailAddress")+(f?"":" ("+mxResources.get("required")+")"));l.appendChild(p);var q=document.createElement("input");q.setAttribute("type","text");q.style.marginTop="6px";q.style.width="600px";var v=mxUtils.button(mxResources.get("sendMessage"),function(){var d=B.value+(G.checked?"\nDiagram:\n"+(null!=c?c:mxUtils.getXml(b.getXmlFileData())):"")+"\nuserAgent:\n"+navigator.userAgent+"\nappVersion:\n"+navigator.appVersion+"\nappName:\n"+navigator.appName+"\nplatform:\n"+navigator.platform;d.length>FeedbackDialog.maxAttachmentSize?b.alert(mxResources.get("drawingTooLarge")):(b.hideDialog(),b.spinner.spin(document.body)&&mxUtils.post(null!=FeedbackDialog.feedbackUrl?FeedbackDialog.feedbackUrl:"/email","email="+encodeURIComponent(q.value)+"&version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&body="+encodeURIComponent((null!=e?e:"Feedback")+":\n"+d),function(g){b.spinner.stop();200<=g.getStatus()&&299>=g.getStatus()?b.alert(mxResources.get("feedbackSent")):b.alert(mxResources.get("errorSendingFeedback"))},function(){b.spinner.stop();b.alert(mxResources.get("errorSendingFeedback"))}))});v.className=-"geBtn gePrimaryBtn";if(!f){v.setAttribute("disabled","disabled");var E=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;mxEvent.addListener(q,"change",function(){0<q.value.length&&0<E.test(q.value)?v.removeAttribute("disabled"):v.setAttribute("disabled","disabled")});mxEvent.addListener(q,"keyup",function(){0<q.value.length&&E.test(q.value)?v.removeAttribute("disabled"):v.setAttribute("disabled",+"geBtn gePrimaryBtn";if(!f){v.setAttribute("disabled","disabled");var D=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;mxEvent.addListener(q,"change",function(){0<q.value.length&&0<D.test(q.value)?v.removeAttribute("disabled"):v.setAttribute("disabled","disabled")});mxEvent.addListener(q,"keyup",function(){0<q.value.length&&D.test(q.value)?v.removeAttribute("disabled"):v.setAttribute("disabled","disabled")})}l.appendChild(q);this.init=function(){q.focus()};var G=document.createElement("input");G.setAttribute("type","checkbox");G.setAttribute("checked","checked");G.defaultChecked=!0;f=document.createElement("p");f.style.marginTop="14px";f.appendChild(G);p=document.createElement("span");mxUtils.write(p," "+mxResources.get("includeCopyOfMyDiagram"));f.appendChild(p);mxEvent.addListener(p,"click",function(d){G.checked=!G.checked;mxEvent.consume(d)});l.appendChild(f);p=document.createElement("div");mxUtils.write(p,mxResources.get("feedback"));l.appendChild(p);var B=document.createElement("textarea");B.style.resize="none";B.style.width="600px";B.style.height="140px";B.style.marginTop="6px";B.setAttribute("placeholder",mxResources.get("comments"));l.appendChild(B);f=document.createElement("div");f.style.marginTop="26px";f.style.textAlign="right";p=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});p.className="geBtn";b.editor.cancelFirst?(f.appendChild(p),f.appendChild(v)):(f.appendChild(v),f.appendChild(p));l.appendChild(f);this.container=l};FeedbackDialog.maxAttachmentSize=1E6;var RevisionDialog=function(b,e,f){var c=document.createElement("div"),l=document.createElement("h3");l.style.marginTop="3px";mxUtils.write(l,mxResources.get("revisionHistory"));c.appendChild(l);l=document.createElement("div");l.style.position="absolute";l.style.overflow="auto";l.style.width="170px";l.style.height="378px";c.appendChild(l);var p=document.createElement("div");p.style.position="absolute";p.style.left="200px";p.style.width="470px";p.style.height="376px";p.style.overflow="hidden";p.style.borderWidth="1px";p.style.borderStyle="solid";var q=document.createElement("div");q.style.position="absolute";q.style.display="none";q.style.textAlign="center";q.style.padding="8px";q.style.borderRadius="8px";q.style.left="50%";q.style.top="50%";q.style.whiteSpace="nowrap";q.style.transform="translate(-50%, -50%)";q.style.background="inherit";q.style.border="1px solid";p.appendChild(q);mxEvent.disableContextMenu(p);c.appendChild(p);var v=new Graph(p);v.setTooltips(!1);v.setEnabled(!1);v.setPanning(!0);v.panningHandler.ignoreCell=-!0;v.panningHandler.useLeftButtonForPanning=!0;v.minFitScale=null;v.maxFitScale=null;v.centerZoom=!0;var E=0,G=null,B=0,d=v.getGlobalVariable;v.getGlobalVariable=function(X){return"page"==X&&null!=G&&null!=G[B]?G[B].getAttribute("name"):"pagenumber"==X?B+1:"pagecount"==X?null!=G?G.length:1:d.apply(this,arguments)};v.getLinkForCell=function(){return null};for(var g=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"light-dark(#000000, #C0C0C0)",speed:1.4,trail:60,-shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),k=b.getCurrentFile(),m=b.getXmlFileData(!0,!1,!0).getElementsByTagName("diagram"),t={},y=0;y<m.length;y++)t[m[y].getAttribute("id")]=m[y];var A=null,I=null,F=null,C=null,Q=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){null!=F&&v.zoomIn()},20);Q.setAttribute("disabled","disabled");var S=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){null!=F&&v.zoomOut()},20);S.setAttribute("disabled",+!0;v.panningHandler.useLeftButtonForPanning=!0;v.minFitScale=null;v.maxFitScale=null;v.centerZoom=!0;var D=0,G=null,B=0,d=v.getGlobalVariable;v.getGlobalVariable=function(X){return"page"==X&&null!=G&&null!=G[B]?G[B].getAttribute("name"):"pagenumber"==X?B+1:"pagecount"==X?null!=G?G.length:1:d.apply(this,arguments)};v.getLinkForCell=function(){return null};for(var g=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"light-dark(#000000, #C0C0C0)",speed:1.4,trail:60,+shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),k=b.getCurrentFile(),m=b.getXmlFileData(!0,!1,!0).getElementsByTagName("diagram"),t={},y=0;y<m.length;y++)t[m[y].getAttribute("id")]=m[y];var z=null,I=null,F=null,C=null,Q=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){null!=F&&v.zoomIn()},20);Q.setAttribute("disabled","disabled");var S=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){null!=F&&v.zoomOut()},20);S.setAttribute("disabled","disabled");var V=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){null!=F&&(1==v.view.scale?(v.maxFitScale=8,v.fit(8)):v.zoomActual(),v.center())},20);V.setAttribute("disabled","disabled");var P=b.createToolbarButton(Editor.compareImage,mxResources.get("compare"));P.setAttribute("disabled","disabled");var u=b.createToolbarButton(Editor.thinDataImage,mxResources.get("merge"));u.setAttribute("disabled","disabled");var x=p.cloneNode(!1);x.style.pointerEvent="none";p.parentNode.appendChild(x);var J=new Graph(x);J.setTooltips(!1);J.setEnabled(!1);J.setPanning(!0);J.panningHandler.ignoreCell=!0;J.panningHandler.useLeftButtonForPanning=!0;J.minFitScale=null;J.maxFitScale=null;J.centerZoom=!0;var H=document.createElement("div");H.style.textAlign="left";H.style.color="gray";H.style.backgroundColor="transparent";H.style.overflow="hidden";H.style.textOverflow="ellipsis";H.style.whiteSpace="nowrap";H.style.cursor="default";H.style.height="100%";H.style.display="inline-flex";H.style.alignItems=-"center";H.style.flexGrow="1";mxEvent.addListener(H,"click",function(){var X=mxUtils.getTextContent(H);""!=X&&b.alert(X)});var K=null;mxEvent.addGestureListeners(P,function(X){try{var Y=null!=G[E]?t[G[E].getAttribute("id")]:null;mxUtils.setOpacity(P,20);q.innerText="";if(null==Y)q.style.display="inline-block",mxUtils.write(q,mxResources.get("pageNotFound"));else{K=H.innerHTML;H.innerHTML=mxResources.get("current");p.style.display="none";x.style.display="";x.style.backgroundColor=p.style.backgroundColor;+"center";H.style.flexGrow="1";mxEvent.addListener(H,"click",function(){var X=mxUtils.getTextContent(H);""!=X&&b.alert(X)});var K=null;mxEvent.addGestureListeners(P,function(X){try{var Y=null!=G[D]?t[G[D].getAttribute("id")]:null;mxUtils.setOpacity(P,20);q.innerText="";if(null==Y)q.style.display="inline-block",mxUtils.write(q,mxResources.get("pageNotFound"));else{K=H.innerHTML;H.innerHTML=mxResources.get("current");p.style.display="none";x.style.display="";x.style.backgroundColor=p.style.backgroundColor;var Z=Editor.parseDiagramNode(Y);(new mxCodec(Z.ownerDocument)).decode(Z,J.getModel());J.view.scaleAndTranslate(v.view.scale,v.view.translate.x,v.view.translate.y);J.mathEnabled="1"==Z.getAttribute("math");J.setAdaptiveColors(Z.getAttribute("adaptiveColors"));Editor.MathJaxRender&&J.mathEnabled&&Editor.MathJaxRender(J.container)}}catch(ca){q.style.display="inline-block",q.innerText="",mxUtils.write(q,mxResources.get("pageNotFound")+": "+ca.message)}},null,function(){mxUtils.setOpacity(P,60);q.style.display="none";q.innerText="";"none"==p.style.display&&(p.style.display="",H.innerHTML=K,x.style.display="none")});mxEvent.addListener(u,"click",mxUtils.bind(this,function(X){null!=F&&(X=b.getPagesForNode(F.documentElement),X=b.diffPages(b.pages,X),X=new TextareaDialog(b,mxResources.get("merge")+":",JSON.stringify(X,null,2),function(Y){try{if(0<Y.length&&b.editor.graph.isEnabled()){var Z=[JSON.parse(Y)];b.confirm(mxResources.get("areYouSure"),function(){try{k.patch(Z,null,!0,!0),b.hideDialog(),b.hideDialog()}catch(ca){b.handleError(ca)}})}else b.hideDialog()}catch(ca){b.handleError(ca)}},-null,null,null,null,null,!0,null,mxResources.get(b.editor.graph.isEnabled()?"merge":"close")),b.showDialog(X.container,620,460,!0,!0),X.init())}));var O=mxUtils.button(mxResources.get("restore"),function(X){null!=F&&null!=C&&b.confirm(mxResources.get("areYouSure"),function(){null!=f?f(C):b.spinner.spin(document.body,mxResources.get("restoring"))&&(O.setAttribute("disabled","disabled"),k.save(!0,function(Y){b.spinner.stop();O.removeAttribute("disabled");b.replaceFileData(C);b.hideDialog()},function(Y){b.spinner.stop();-O.removeAttribute("disabled");b.clearStatus();b.handleError(Y,null!=Y?mxResources.get("errorSavingFile"):null)}))})});O.className="geBtn gePrimaryBtn";O.setAttribute("disabled","disabled");var M=document.createElement("select");M.setAttribute("disabled","disabled");M.style.userSelect="none";M.style.maxWidth="100px";M.style.marginLeft="10px";M.style.display="none";var n=null;mxEvent.addListener(M,"change",function(X){null!=n&&(n(X),mxEvent.consume(X))});var z=mxUtils.button(mxResources.get("open"),-function(){null!=F&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(F.documentElement)),b.openLink(b.getUrl(),null,!0))});z.className="geBtn";z.setAttribute("disabled","disabled");var D=mxUtils.button(mxResources.get("createRevision"),function(){b.actions.get("save").funct(!1)});D.className="geBtn";D.setAttribute("disabled","disabled");null!=f&&(z.style.display="none");m=document.createElement("div");m.style.position="absolute";m.style.top="482px";-m.style.right="28px";m.style.left="32px";m.style.justifyContent="end";m.style.display="flex";var L=document.createElement("div");L.className="geToolbarContainer";L.style.backgroundColor="transparent";L.style.left="32px";L.style.right="32px";L.style.border="none";L.style.top="442px";var N=null;if(null!=e&&0<e.length){p.style.cursor="move";var R=document.createElement("table");R.style.borderWidth="1px";R.style.borderStyle="solid";R.style.borderCollapse="collapse";R.style.borderSpacing="0px";R.style.width=-"100%";var T=document.createElement("tbody"),U=(new Date).toDateString();null!=b.currentPage&&null!=b.pages&&(E=mxUtils.indexOf(b.pages,b.currentPage));for(y=e.length-1;0<=y;y--){var W=function(X){var Y=new Date(X.modifiedDate),Z=null;if(0<=Y.getTime()){var ca=function(ja){g.stop();q.innerText="";var ba=mxUtils.parseXml(ja),fa=b.editor.extractGraphModel(ba.documentElement,!0);if(null!=fa){var aa=function(na){null!=na&&(na=ia(Editor.parseDiagramNode(na)));return na},ia=function(na){var va=na.getAttribute("background");-if(null==va||""==va||va==mxConstants.NONE)va=v.defaultPageBackgroundColor;p.style.backgroundColor=mxUtils.getLightDarkColor(va);(new mxCodec(na.ownerDocument)).decode(na,v.getModel());v.maxFitScale=1;v.fit(8);v.center();v.mathEnabled="1"==na.getAttribute("math");v.setAdaptiveColors(na.getAttribute("adaptiveColors"));Editor.MathJaxRender&&v.mathEnabled&&Editor.MathJaxRender(v.container);return na};M.style.display="none";M.innerText="";F=ba;C=ja;G=parseSelectFunction=null;B=0;if("mxfile"==fa.nodeName){ba=-fa.getElementsByTagName("diagram");G=[];for(ja=0;ja<ba.length;ja++)G.push(ba[ja]);B=Math.min(E,G.length-1);0<G.length&&aa(G[B]);if(1<G.length)for(M.removeAttribute("disabled"),M.style.display="",ja=0;ja<G.length;ja++){ba=document.createElement("option");ba.setAttribute("title",ha+" ("+G[ja].getAttribute("id")+")");ba.setAttribute("value",ja);var ha=G[ja].getAttribute("name")||mxResources.get("pageWithNumber",[ja+1]);fa=b.getPageById(G[ja].getAttribute("id"));var da="";if(null!=fa){var Ba=new DiagramPage(G[ja]);-b.getHashValueForPages([fa])!=b.getHashValueForPages([Ba])&&(da=" (M)")}else da=" (X)";mxUtils.write(ba,ha+da);ja==B&&ba.setAttribute("selected","selected");M.appendChild(ba)}n=function(){try{var na=parseInt(M.value);B=E=na;aa(G[na])}catch(va){M.value=E,b.handleError(va)}}}else ia(fa);ha=X.lastModifyingUserName;null!=ha&&20<ha.length&&(ha=ha.substring(0,20)+"...");H.innerText="";mxUtils.write(H,(null!=ha?ha+" ":"")+Y.toLocaleDateString()+" "+Y.toLocaleTimeString());H.setAttribute("title",Z.getAttribute("title"));-Q.removeAttribute("disabled");S.removeAttribute("disabled");V.removeAttribute("disabled");P.removeAttribute("disabled");u.removeAttribute("disabled");null!=k&&k.isRestricted()||(b.editor.graph.isEnabled()&&O.removeAttribute("disabled"),z.removeAttribute("disabled"),D.removeAttribute("disabled"));mxUtils.setOpacity(Q,60);mxUtils.setOpacity(S,60);mxUtils.setOpacity(V,60);mxUtils.setOpacity(P,60);mxUtils.setOpacity(u,60)}else M.style.display="none",M.innerText="",H.innerText="",q.innerText="",mxUtils.write(H,+null,null,null,null,null,!0,null,mxResources.get(b.editor.graph.isEnabled()?"merge":"close")),b.showDialog(X.container,620,460,!0,!0),X.init())}));var N=mxUtils.button(mxResources.get("restore"),function(X){null!=F&&null!=C&&b.confirm(mxResources.get("areYouSure"),function(){null!=f?f(C):b.spinner.spin(document.body,mxResources.get("restoring"))&&(N.setAttribute("disabled","disabled"),k.save(!0,function(Y){b.spinner.stop();N.removeAttribute("disabled");b.replaceFileData(C);b.hideDialog()},function(Y){b.spinner.stop();+N.removeAttribute("disabled");b.clearStatus();b.handleError(Y,null!=Y?mxResources.get("errorSavingFile"):null)}))})});N.className="geBtn gePrimaryBtn";N.setAttribute("disabled","disabled");var M=document.createElement("select");M.setAttribute("disabled","disabled");M.style.userSelect="none";M.style.maxWidth="100px";M.style.marginLeft="10px";M.style.display="none";var n=null;mxEvent.addListener(M,"change",function(X){null!=n&&(n(X),mxEvent.consume(X))});var A=mxUtils.button(mxResources.get("open"),+function(){null!=F&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(F.documentElement)),b.openLink(b.getUrl(),null,!0))});A.className="geBtn";A.setAttribute("disabled","disabled");var E=mxUtils.button(mxResources.get("createRevision"),function(){b.actions.get("save").funct(!1)});E.className="geBtn";E.setAttribute("disabled","disabled");null!=f&&(A.style.display="none");m=document.createElement("div");m.style.position="absolute";m.style.top="482px";+m.style.right="28px";m.style.left="32px";m.style.justifyContent="end";m.style.display="flex";var L=document.createElement("div");L.className="geToolbarContainer";L.style.backgroundColor="transparent";L.style.left="32px";L.style.right="32px";L.style.border="none";L.style.top="442px";var O=null;if(null!=e&&0<e.length){p.style.cursor="move";var R=document.createElement("table");R.style.borderWidth="1px";R.style.borderStyle="solid";R.style.borderCollapse="collapse";R.style.borderSpacing="0px";R.style.width=+"100%";var T=document.createElement("tbody"),U=(new Date).toDateString();null!=b.currentPage&&null!=b.pages&&(D=mxUtils.indexOf(b.pages,b.currentPage));for(y=e.length-1;0<=y;y--){var W=function(X){var Y=new Date(X.modifiedDate),Z=null;if(0<=Y.getTime()){var ca=function(ia){g.stop();q.innerText="";var ba=mxUtils.parseXml(ia),fa=b.editor.extractGraphModel(ba.documentElement,!0);if(null!=fa){var aa=function(na){null!=na&&(na=ja(Editor.parseDiagramNode(na)));return na},ja=function(na){var va=na.getAttribute("background");+if(null==va||""==va||va==mxConstants.NONE)va=v.defaultPageBackgroundColor;p.style.backgroundColor=mxUtils.getLightDarkColor(va);(new mxCodec(na.ownerDocument)).decode(na,v.getModel());v.maxFitScale=1;v.fit(8);v.center();v.mathEnabled="1"==na.getAttribute("math");v.setAdaptiveColors(na.getAttribute("adaptiveColors"));Editor.MathJaxRender&&v.mathEnabled&&Editor.MathJaxRender(v.container);return na};M.style.display="none";M.innerText="";F=ba;C=ia;G=parseSelectFunction=null;B=0;if("mxfile"==fa.nodeName){ba=+fa.getElementsByTagName("diagram");G=[];for(ia=0;ia<ba.length;ia++)G.push(ba[ia]);B=Math.min(D,G.length-1);0<G.length&&aa(G[B]);if(1<G.length)for(M.removeAttribute("disabled"),M.style.display="",ia=0;ia<G.length;ia++){ba=document.createElement("option");ba.setAttribute("title",ha+" ("+G[ia].getAttribute("id")+")");ba.setAttribute("value",ia);var ha=G[ia].getAttribute("name")||mxResources.get("pageWithNumber",[ia+1]);fa=b.getPageById(G[ia].getAttribute("id"));var da="";if(null!=fa){var Ba=new DiagramPage(G[ia]);+b.getHashValueForPages([fa])!=b.getHashValueForPages([Ba])&&(da=" (M)")}else da=" (X)";mxUtils.write(ba,ha+da);ia==B&&ba.setAttribute("selected","selected");M.appendChild(ba)}n=function(){try{var na=parseInt(M.value);B=D=na;aa(G[na])}catch(va){M.value=D,b.handleError(va)}}}else ja(fa);ha=X.lastModifyingUserName;null!=ha&&20<ha.length&&(ha=ha.substring(0,20)+"...");H.innerText="";mxUtils.write(H,(null!=ha?ha+" ":"")+Y.toLocaleDateString()+" "+Y.toLocaleTimeString());H.setAttribute("title",Z.getAttribute("title"));+Q.removeAttribute("disabled");S.removeAttribute("disabled");V.removeAttribute("disabled");P.removeAttribute("disabled");u.removeAttribute("disabled");null!=k&&k.isRestricted()||(b.editor.graph.isEnabled()&&N.removeAttribute("disabled"),A.removeAttribute("disabled"),E.removeAttribute("disabled"));mxUtils.setOpacity(Q,60);mxUtils.setOpacity(S,60);mxUtils.setOpacity(V,60);mxUtils.setOpacity(P,60);mxUtils.setOpacity(u,60)}else M.style.display="none",M.innerText="",H.innerText="",q.innerText="",mxUtils.write(H,mxResources.get("errorLoadingFile")),mxUtils.write(q,mxResources.get("errorLoadingFile"))};Z=document.createElement("tr");Z.style.borderBottomWidth="1px";Z.style.borderBottomStyle="solid";Z.style.fontSize="12px";Z.style.cursor="pointer";var ea=document.createElement("td");ea.style.padding="6px";ea.style.whiteSpace="nowrap";X==e[e.length-1]?mxUtils.write(ea,mxResources.get("current")):Y.toDateString()===U?mxUtils.write(ea,Y.toLocaleTimeString()):mxUtils.write(ea,Y.toLocaleDateString()+" "+Y.toLocaleTimeString());-Z.appendChild(ea);Z.setAttribute("title",Y.toLocaleDateString()+" "+Y.toLocaleTimeString()+(null!=X.fileSize?" "+b.formatFileSize(parseInt(X.fileSize)):"")+(null!=X.lastModifyingUserName?" "+X.lastModifyingUserName:""));mxEvent.addListener(Z,"click",function(ja){I!=X&&(g.stop(),null!=A&&(A.style.backgroundColor=""),I=X,A=Z,A.style.backgroundColor="light-dark(#ebf2f9, #000000)",C=F=null,H.removeAttribute("title"),H.innerText=mxResources.get("loading")+"...",p.style.backgroundColor=v.defaultPageBackgroundColor,-q.innerText="",v.getModel().clear(),O.setAttribute("disabled","disabled"),Q.setAttribute("disabled","disabled"),S.setAttribute("disabled","disabled"),V.setAttribute("disabled","disabled"),P.setAttribute("disabled","disabled"),u.setAttribute("disabled","disabled"),z.setAttribute("disabled","disabled"),M.setAttribute("disabled","disabled"),mxUtils.setOpacity(Q,20),mxUtils.setOpacity(S,20),mxUtils.setOpacity(V,20),mxUtils.setOpacity(P,20),mxUtils.setOpacity(u,20),g.spin(p),X.getXml(function(ba){if(I==-X)try{ca(ba)}catch(fa){H.innerText=mxResources.get("error")+": "+fa.message}},function(ba){g.stop();M.style.display="none";M.innerText="";H.innerText="";mxUtils.write(H,mxResources.get("errorLoadingFile"));mxUtils.write(q,mxResources.get("errorLoadingFile"))}),mxEvent.consume(ja))});mxEvent.addListener(Z,"dblclick",function(ja){z.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(ja)},!1);T.appendChild(Z)}return Z}(e[y]);-null!=W&&y==e.length-1&&(N=W)}R.appendChild(T);l.appendChild(R)}else null==k||null==b.drive&&k.constructor==window.DriveFile||null==b.dropbox&&k.constructor==window.DropboxFile?(p.style.display="none",L.style.display="none",mxUtils.write(l,mxResources.get("notAvailable"))):(p.style.display="none",L.style.display="none",mxUtils.write(l,mxResources.get("noRevisions")));this.init=function(){null!=N&&N.click()};l=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});l.className="geBtn";-L.appendChild(H);L.appendChild(P);L.appendChild(S);L.appendChild(V);L.appendChild(Q);L.appendChild(M);L.appendChild(u);b.editor.cancelFirst&&m.appendChild(l);m.appendChild(z);null!=k&&k.constructor==DriveFile&&m.appendChild(D);m.appendChild(O);b.editor.cancelFirst||m.appendChild(l);c.appendChild(m);c.appendChild(L);this.container=c},DraftDialog=function(b,e,f,c,l,p,q,v,E){var G=document.createElement("div"),B=document.createElement("div");B.style.marginTop="0px";B.style.whiteSpace="nowrap";B.style.overflow=-"auto";B.style.lineHeight="normal";mxUtils.write(B,e);G.appendChild(B);var d=document.createElement("select"),g=mxUtils.bind(this,function(){"-1"==d.value?(d.value=d.options[0].value,g(),b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var P=this,u;return $jscomp.asyncExecutePromiseGeneratorProgram(function(x){for(u=0;u<E.length;u++)l.apply(P,[u,mxUtils.bind(P,function(){})]);b.hideDialog(!0);x.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))):(I=mxUtils.parseXml(E[d.value].data),-F=b.editor.extractGraphModel(I.documentElement,!0),C=0,this.init())});if(null!=E){d.style.marginLeft="4px";for(e=0;e<E.length;e++){var k=document.createElement("option");k.setAttribute("value",e);var m=new Date(E[e].created),t=new Date(E[e].modified);mxUtils.write(k,m.toLocaleDateString()+" "+m.toLocaleTimeString()+" - "+(m.toDateString(),t.toDateString(),t.toLocaleDateString())+" "+t.toLocaleTimeString());d.appendChild(k)}k=document.createElement("option");k.setAttribute("value","-1");mxUtils.write(k,-mxResources.get("deleteAll"));d.appendChild(k);B.appendChild(d);mxEvent.addListener(d,"change",g)}null==f&&(f=E[0].data);var y=document.createElement("div");y.style.position="absolute";y.style.border="1px solid lightGray";y.style.marginTop="10px";y.style.left="40px";y.style.right="40px";y.style.top="46px";y.style.bottom="74px";y.style.overflow="hidden";mxEvent.disableContextMenu(y);G.appendChild(y);var A=new Graph(y);A.setEnabled(!1);A.setPanning(!0);A.shapeBackgroundColor="light-dark(#ffffff, #2a252f)";-A.panningHandler.ignoreCell=!0;A.panningHandler.useLeftButtonForPanning=!0;A.minFitScale=null;A.maxFitScale=null;A.centerZoom=!0;var I=mxUtils.parseXml(f),F=b.editor.extractGraphModel(I.documentElement,!0),C=0,Q=null,S=A.getGlobalVariable;A.getGlobalVariable=function(P){return"page"==P&&null!=Q&&null!=Q[C]?Q[C].getAttribute("name"):"pagenumber"==P?C+1:"pagecount"==P?null!=Q?Q.length:1:S.apply(this,arguments)};A.getLinkForCell=function(){return null};f=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),-function(){A.zoomIn()},20);B=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomOut"),function(){A.zoomOut()},20);e=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==A.view.scale?(A.maxFitScale=8,A.fit(8)):A.zoomActual();A.center()},20);q=mxUtils.button(q||mxResources.get("discard"),function(){b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var P=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(u){l.apply(P,[d.value,+Z.appendChild(ea);Z.setAttribute("title",Y.toLocaleDateString()+" "+Y.toLocaleTimeString()+(null!=X.fileSize?" "+b.formatFileSize(parseInt(X.fileSize)):"")+(null!=X.lastModifyingUserName?" "+X.lastModifyingUserName:""));mxEvent.addListener(Z,"click",function(ia){I!=X&&(g.stop(),null!=z&&(z.style.backgroundColor=""),I=X,z=Z,z.style.backgroundColor="light-dark(#ebf2f9, #000000)",C=F=null,H.removeAttribute("title"),H.innerText=mxResources.get("loading")+"...",p.style.backgroundColor=v.defaultPageBackgroundColor,+q.innerText="",v.getModel().clear(),N.setAttribute("disabled","disabled"),Q.setAttribute("disabled","disabled"),S.setAttribute("disabled","disabled"),V.setAttribute("disabled","disabled"),P.setAttribute("disabled","disabled"),u.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"),M.setAttribute("disabled","disabled"),mxUtils.setOpacity(Q,20),mxUtils.setOpacity(S,20),mxUtils.setOpacity(V,20),mxUtils.setOpacity(P,20),mxUtils.setOpacity(u,20),g.spin(p),X.getXml(function(ba){if(I==+X)try{ca(ba)}catch(fa){H.innerText=mxResources.get("error")+": "+fa.message}},function(ba){g.stop();M.style.display="none";M.innerText="";H.innerText="";mxUtils.write(H,mxResources.get("errorLoadingFile"));mxUtils.write(q,mxResources.get("errorLoadingFile"))}),mxEvent.consume(ia))});mxEvent.addListener(Z,"dblclick",function(ia){A.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(ia)},!1);T.appendChild(Z)}return Z}(e[y]);+null!=W&&y==e.length-1&&(O=W)}R.appendChild(T);l.appendChild(R)}else null==k||null==b.drive&&k.constructor==window.DriveFile||null==b.dropbox&&k.constructor==window.DropboxFile?(p.style.display="none",L.style.display="none",mxUtils.write(l,mxResources.get("notAvailable"))):(p.style.display="none",L.style.display="none",mxUtils.write(l,mxResources.get("noRevisions")));this.init=function(){null!=O&&O.click()};l=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});l.className="geBtn";+L.appendChild(H);L.appendChild(P);L.appendChild(S);L.appendChild(V);L.appendChild(Q);L.appendChild(M);L.appendChild(u);b.editor.cancelFirst&&m.appendChild(l);m.appendChild(A);null!=k&&k.constructor==DriveFile&&m.appendChild(E);m.appendChild(N);b.editor.cancelFirst||m.appendChild(l);c.appendChild(m);c.appendChild(L);this.container=c},DraftDialog=function(b,e,f,c,l,p,q,v,D){var G=document.createElement("div"),B=document.createElement("div");B.style.marginTop="0px";B.style.whiteSpace="nowrap";B.style.overflow=+"auto";B.style.lineHeight="normal";mxUtils.write(B,e);G.appendChild(B);var d=document.createElement("select"),g=mxUtils.bind(this,function(){"-1"==d.value?(d.value=d.options[0].value,g(),b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var P=this,u;return $jscomp.asyncExecutePromiseGeneratorProgram(function(x){for(u=0;u<D.length;u++)l.apply(P,[u,mxUtils.bind(P,function(){})]);b.hideDialog(!0);x.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))):(I=mxUtils.parseXml(D[d.value].data),+F=b.editor.extractGraphModel(I.documentElement,!0),C=0,this.init())});if(null!=D){d.style.marginLeft="4px";for(e=0;e<D.length;e++){var k=document.createElement("option");k.setAttribute("value",e);var m=new Date(D[e].created),t=new Date(D[e].modified);mxUtils.write(k,m.toLocaleDateString()+" "+m.toLocaleTimeString()+" - "+(m.toDateString(),t.toDateString(),t.toLocaleDateString())+" "+t.toLocaleTimeString());d.appendChild(k)}k=document.createElement("option");k.setAttribute("value","-1");mxUtils.write(k,+mxResources.get("deleteAll"));d.appendChild(k);B.appendChild(d);mxEvent.addListener(d,"change",g)}null==f&&(f=D[0].data);var y=document.createElement("div");y.style.position="absolute";y.style.border="1px solid lightGray";y.style.marginTop="10px";y.style.left="40px";y.style.right="40px";y.style.top="46px";y.style.bottom="74px";y.style.overflow="hidden";mxEvent.disableContextMenu(y);G.appendChild(y);var z=new Graph(y);z.setEnabled(!1);z.setPanning(!0);z.shapeBackgroundColor="light-dark(#ffffff, #2a252f)";+z.panningHandler.ignoreCell=!0;z.panningHandler.useLeftButtonForPanning=!0;z.minFitScale=null;z.maxFitScale=null;z.centerZoom=!0;var I=mxUtils.parseXml(f),F=b.editor.extractGraphModel(I.documentElement,!0),C=0,Q=null,S=z.getGlobalVariable;z.getGlobalVariable=function(P){return"page"==P&&null!=Q&&null!=Q[C]?Q[C].getAttribute("name"):"pagenumber"==P?C+1:"pagecount"==P?null!=Q?Q.length:1:S.apply(this,arguments)};z.getLinkForCell=function(){return null};f=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),+function(){z.zoomIn()},20);B=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomOut"),function(){z.zoomOut()},20);e=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==z.view.scale?(z.maxFitScale=8,z.fit(8)):z.zoomActual();z.center()},20);q=mxUtils.button(q||mxResources.get("discard"),function(){b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var P=this;return $jscomp.asyncExecutePromiseGeneratorProgram(function(u){l.apply(P,[d.value,mxUtils.bind(P,function(){null!=d.parentNode&&(d.options[d.selectedIndex].parentNode.removeChild(d.options[d.selectedIndex]),1<d.options.length?(d.value=d.options[0].value,g()):b.hideDialog(!0))})]);u.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))});q.className="geBtn";var V=document.createElement("select");V.style.maxWidth="80px";V.style.position="relative";V.style.top="-2px";V.style.verticalAlign="bottom";V.style.marginRight="6px";V.style.display="none";p=mxUtils.button(p||mxResources.get("edit"),function(){c.apply(this,[d.value])});p.className="geBtn gePrimaryBtn";k=document.createElement("div");k.style.position="absolute";k.style.bottom="30px";k.style.right="40px";k.style.textAlign="right";m=document.createElement("div");m.className="geToolbarContainer";m.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";this.init=function(){function P(H){if(null!=H){var K=H.getAttribute("background");if(null==K||""==K||K==mxConstants.NONE)K=-"light-dark(#ffffff, transparent)";y.style.backgroundColor=K;(new mxCodec(H.ownerDocument)).decode(H,A.getModel());A.maxFitScale=1;A.fit(8);A.center()}return H}function u(H){null!=H&&(H=P(Editor.parseDiagramNode(H)));return H}mxEvent.addListener(V,"change",function(H){C=parseInt(V.value);u(Q[C]);mxEvent.consume(H)});if("mxfile"==F.nodeName){var x=F.getElementsByTagName("diagram");Q=[];for(var J=0;J<x.length;J++)Q.push(x[J]);0<Q.length&&u(Q[C]);V.innerText="";if(1<Q.length)for(V.style.display="",J=+"light-dark(#ffffff, transparent)";y.style.backgroundColor=K;(new mxCodec(H.ownerDocument)).decode(H,z.getModel());z.maxFitScale=1;z.fit(8);z.center()}return H}function u(H){null!=H&&(H=P(Editor.parseDiagramNode(H)));return H}mxEvent.addListener(V,"change",function(H){C=parseInt(V.value);u(Q[C]);mxEvent.consume(H)});if("mxfile"==F.nodeName){var x=F.getElementsByTagName("diagram");Q=[];for(var J=0;J<x.length;J++)Q.push(x[J]);0<Q.length&&u(Q[C]);V.innerText="";if(1<Q.length)for(V.style.display="",J=0;J<Q.length;J++)x=document.createElement("option"),mxUtils.write(x,Q[J].getAttribute("name")||mxResources.get("pageWithNumber",[J+1])),x.setAttribute("value",J),J==C&&x.setAttribute("selected","selected"),V.appendChild(x);else V.style.display="none"}else P(F)};m.appendChild(V);m.appendChild(f);m.appendChild(B);m.appendChild(e);f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});f.className="geBtn";v=null!=v?mxUtils.button(mxResources.get("ignore"),v):null;null!=v&&(v.className=-"geBtn");b.editor.cancelFirst?(k.appendChild(f),null!=v&&k.appendChild(v),k.appendChild(q),k.appendChild(p)):(k.appendChild(p),k.appendChild(q),null!=v&&k.appendChild(v),k.appendChild(f));G.appendChild(k);G.appendChild(m);this.container=G},FindWindow=function(b,e,f,c,l,p){function q(n,z,D){if("object"===typeof z.value&&null!=z.value.attributes){z=z.value.attributes;for(var L=0;L<z.length;L++)if("label"!=z[L].nodeName){var N=mxUtils.trim(z[L].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();-if(null==n&&0<=N.indexOf(D)||null!=n&&n.test(N))return!0}}return!1}function v(){k?(K.removeAttribute("disabled"),O.removeAttribute("disabled")):(K.setAttribute("disabled","disabled"),O.setAttribute("disabled","disabled"));C.value?M.removeAttribute("disabled"):M.setAttribute("disabled","disabled")}function E(n,z,D){J.innerText="";var L=B.model.getDescendants(B.model.getRoot()),N=C.value.toLowerCase(),R=S.checked?new RegExp(N):null,T=null;t=null;d!=N&&(d=N,g=null,m=!1);var U=null==g;if(0<N.length){if(m){m=-!1;for(var W,X=0;X<b.pages.length;X++)if(b.currentPage==b.pages[X]){W=X;break}n=(W+1)%b.pages.length;g=null;do m=!1,L=b.pages[n],B=b.createTemporaryGraph(B.getStylesheet()),b.updatePageRoot(L),B.model.setRoot(L.root),n=(n+1)%b.pages.length;while(!E(!0,z,D)&&n!=W);g&&(g=null,D?b.editor.graph.model.execute(new SelectPage(b,L)):b.selectPage(L));m=!1;B=b.editor.graph;return E(!0,z,D)}for(X=0;X<L.length;X++){W=B.view.getState(L[X]);z&&(U=U||W==g);if(null!=W&&null!=W.cell.value&&(U||null==T)&&(B.model.isVertex(W.cell)||-B.model.isEdge(W.cell))){null!=W.style&&"1"==W.style.html?(P.innerHTML=B.sanitizeHtml(B.getLabel(W.cell)),label=mxUtils.extractTextWithWhitespace([P])):label=B.getLabel(W.cell);label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();var Y=0;z&&p&&W==g&&(label=label.substr(y),Y=y);var Z=""==Q.value;if(null==R&&(0<=label.indexOf(N)||Z&&q(R,W.cell,N))||null!=R&&(R.test(label)||Z&&q(R,W.cell,N)))if(p&&(null!=R?(Z=label.match(R),null!=Z&&0<Z.length&&(t=Z[0].toLowerCase(),y=Y+Z.index+-t.length)):(t=N,y=Y+label.indexOf(N)+t.length)),U){T=W;break}else null==T&&(T=W)}U=U||W==g}}if(null!=T){if(X==L.length&&V.checked)return g=null,m=!0,E(!0,z,D);g=T;B.scrollCellToVisible(g.cell);B.isEnabled()&&!B.isCellLocked(g.cell)?D||B.getSelectionCell()==g.cell&&1==B.getSelectionCount()||B.setSelectionCell(g.cell):B.highlightCell(g.cell)}else{if(!n&&V.checked)return m=!0,E(!0,z,D);B.isEnabled()&&!D&&B.clearSelection()}k=null!=T;p&&!n&&v();return 0==N.length||null!=T}var G=b.actions.get("findReplace"),-B=b.editor.graph,d=null,g=null,k=!1,m=!1,t=null,y=0,A=1,I=document.createElement("div");I.style.userSelect="none";I.style.overflow="hidden";I.style.padding="10px";I.style.height="100%";var F=p?"260px":"200px",C=document.createElement("input");C.setAttribute("placeholder",mxResources.get("find"));C.setAttribute("type","text");C.style.marginTop="4px";C.style.marginBottom="6px";C.style.width=F;C.style.fontSize="12px";C.style.borderRadius="4px";C.style.padding="6px";I.appendChild(C);mxUtils.br(I);if(p){var Q=+"geBtn");b.editor.cancelFirst?(k.appendChild(f),null!=v&&k.appendChild(v),k.appendChild(q),k.appendChild(p)):(k.appendChild(p),k.appendChild(q),null!=v&&k.appendChild(v),k.appendChild(f));G.appendChild(k);G.appendChild(m);this.container=G},FindWindow=function(b,e,f,c,l,p){function q(n,A,E){if("object"===typeof A.value&&null!=A.value.attributes){A=A.value.attributes;for(var L=0;L<A.length;L++)if("label"!=A[L].nodeName){var O=mxUtils.trim(A[L].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();+if(null==n&&0<=O.indexOf(E)||null!=n&&n.test(O))return!0}}return!1}function v(){k?(K.removeAttribute("disabled"),N.removeAttribute("disabled")):(K.setAttribute("disabled","disabled"),N.setAttribute("disabled","disabled"));C.value?M.removeAttribute("disabled"):M.setAttribute("disabled","disabled")}function D(n,A,E){J.innerText="";var L=B.model.getDescendants(B.model.getRoot()),O=C.value.toLowerCase(),R=S.checked?new RegExp(O):null,T=null;t=null;d!=O&&(d=O,g=null,m=!1);var U=null==g;if(0<O.length){if(m){m=+!1;for(var W,X=0;X<b.pages.length;X++)if(b.currentPage==b.pages[X]){W=X;break}n=(W+1)%b.pages.length;g=null;do m=!1,L=b.pages[n],B=b.createTemporaryGraph(B.getStylesheet()),b.updatePageRoot(L),B.model.setRoot(L.root),n=(n+1)%b.pages.length;while(!D(!0,A,E)&&n!=W);g&&(g=null,E?b.editor.graph.model.execute(new SelectPage(b,L)):b.selectPage(L));m=!1;B=b.editor.graph;return D(!0,A,E)}for(X=0;X<L.length;X++){W=B.view.getState(L[X]);A&&(U=U||W==g);if(null!=W&&null!=W.cell.value&&(U||null==T)&&(B.model.isVertex(W.cell)||+B.model.isEdge(W.cell))){null!=W.style&&"1"==W.style.html?(P.innerHTML=B.sanitizeHtml(B.getLabel(W.cell)),label=mxUtils.extractTextWithWhitespace([P])):label=B.getLabel(W.cell);label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();var Y=0;A&&p&&W==g&&(label=label.substr(y),Y=y);var Z=""==Q.value;if(null==R&&(0<=label.indexOf(O)||Z&&q(R,W.cell,O))||null!=R&&(R.test(label)||Z&&q(R,W.cell,O)))if(p&&(null!=R?(Z=label.match(R),null!=Z&&0<Z.length&&(t=Z[0].toLowerCase(),y=Y+Z.index++t.length)):(t=O,y=Y+label.indexOf(O)+t.length)),U){T=W;break}else null==T&&(T=W)}U=U||W==g}}if(null!=T){if(X==L.length&&V.checked)return g=null,m=!0,D(!0,A,E);g=T;B.scrollCellToVisible(g.cell);B.isEnabled()&&!B.isCellLocked(g.cell)?E||B.getSelectionCell()==g.cell&&1==B.getSelectionCount()||B.setSelectionCell(g.cell):B.highlightCell(g.cell)}else{if(!n&&V.checked)return m=!0,D(!0,A,E);B.isEnabled()&&!E&&B.clearSelection()}k=null!=T;p&&!n&&v();return 0==O.length||null!=T}var G=b.actions.get("findReplace"),+B=b.editor.graph,d=null,g=null,k=!1,m=!1,t=null,y=0,z=1,I=document.createElement("div");I.style.userSelect="none";I.style.overflow="hidden";I.style.padding="10px";I.style.height="100%";var F=p?"260px":"200px",C=document.createElement("input");C.setAttribute("placeholder",mxResources.get("find"));C.setAttribute("type","text");C.style.marginTop="4px";C.style.marginBottom="6px";C.style.width=F;C.style.fontSize="12px";C.style.borderRadius="4px";C.style.padding="6px";I.appendChild(C);mxUtils.br(I);if(p){var Q=document.createElement("input");Q.setAttribute("placeholder",mxResources.get("replaceWith"));Q.setAttribute("type","text");Q.style.marginTop="4px";Q.style.marginBottom="6px";Q.style.width=F;Q.style.fontSize="12px";Q.style.borderRadius="4px";Q.style.padding="6px";I.appendChild(Q);mxUtils.br(I);mxEvent.addListener(Q,"input",v)}var S=document.createElement("input");S.setAttribute("id","geFindWinRegExChck");S.setAttribute("type","checkbox");S.style.marginRight="4px";I.appendChild(S);F=document.createElement("label");F.setAttribute("for","geFindWinRegExChck");I.appendChild(F);mxUtils.write(F,mxResources.get("regularExpression"));I.appendChild(F);F=b.menus.createHelpLink("https://www.drawio.com/doc/faq/find-shapes");F.style.position="relative";F.style.marginLeft="6px";F.style.top="3px";I.appendChild(F);mxUtils.br(I);var V=document.createElement("input");V.setAttribute("id","geFindWinAllPagesChck");V.setAttribute("type","checkbox");V.style.marginRight="4px";I.appendChild(V);F=document.createElement("label");F.setAttribute("for","geFindWinAllPagesChck");I.appendChild(F);mxUtils.write(F,mxResources.get("allPages"));I.appendChild(F);var P=document.createElement("div");mxUtils.br(I);F=document.createElement("div");F.style.left="0px";F.style.right="0px";F.style.marginTop="6px";F.style.padding="0 6px 0 6px";F.style.textAlign="center";I.appendChild(F);var u=mxUtils.button(mxResources.get("reset"),function(){J.innerText="";C.value="";C.style.backgroundColor="";p&&(Q.value="",v());d=g=null;m=!1;C.focus()});u.setAttribute("title",-mxResources.get("reset"));u.style.float="none";u.style.width="120px";u.style.marginTop="6px";u.style.marginLeft="8px";u.style.overflow="hidden";u.style.textOverflow="ellipsis";u.className="geBtn";p||F.appendChild(u);var x=mxUtils.button(mxResources.get("find"),function(){try{C.style.backgroundColor=E()?"":"light-dark(#ffcfcf, #ff0000)"}catch(n){b.handleError(n)}});x.setAttribute("title",mxResources.get("find")+" (Enter)");x.style.float="none";x.style.width="120px";x.style.marginTop="6px";x.style.marginLeft=-"8px";x.style.overflow="hidden";x.style.textOverflow="ellipsis";x.className="geBtn gePrimaryBtn";F.appendChild(x);var J=document.createElement("div");J.style.marginTop="10px";if(p){var H=function(n,z,D,L,N){if(null==N||"1"!=N.html)return L=n.toLowerCase().indexOf(z,L),0>L?n:n.substr(0,L)+D+n.substr(L+z.length);var R=n;z=mxUtils.htmlEntities(z,!1,!1,!1);N=[];var T=-1;for(n=n.replace(/<br>/ig,"\n").replace(/(\s|\S)(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1\n$2");-1<(T=n.indexOf("<",-T+1));)N.push(T);T=n.match(/<[^>]*>/g);n=n.replace(/<[^>]*>/g,"");L=n.toLowerCase().indexOf(z,L);if(0>L)return R;R=L+z.length;D=mxUtils.htmlEntities(D);n=n.substr(0,L)+D+n.substr(R);for(var U=0,W=0;W<N.length;W++){if(N[W]-U<L)n=n.substr(0,N[W])+T[W]+n.substr(N[W]);else{var X=N[W]-U<R?L+U:N[W]+(D.length-z.length);n=n.substr(0,X)+T[W]+n.substr(X)}U+=T[W].length}return n.replace(/\n(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1").replace(/\n/g,"<br>")},K=mxUtils.button(mxResources.get("replFind"),-function(){try{if(null!=t&&null!=g){var n=g.cell,z=B.getLabel(n);B.isCellEditable(n)&&B.model.setValue(n,H(z,t,Q.value,y-t.length,B.getCurrentCellStyle(n)));C.style.backgroundColor=E(!1,!0)?"":"light-dark(#ffcfcf, #ff0000)"}}catch(D){b.handleError(D)}});K.setAttribute("title",mxResources.get("replFind"));K.style.float="none";K.style.width="120px";K.style.marginTop="6px";K.style.marginLeft="8px";K.style.overflow="hidden";K.style.textOverflow="ellipsis";K.className="geBtn gePrimaryBtn";K.setAttribute("disabled",-"disabled");F.appendChild(K);mxUtils.br(F);var O=mxUtils.button(mxResources.get("replace"),function(){try{if(null!=t&&null!=g){var n=g.cell,z=B.getLabel(n);B.model.setValue(n,H(z,t,Q.value,y-t.length,B.getCurrentCellStyle(n)));K.setAttribute("disabled","disabled");O.setAttribute("disabled","disabled")}}catch(D){b.handleError(D)}});O.setAttribute("title",mxResources.get("replace"));O.style.float="none";O.style.width="120px";O.style.marginTop="6px";O.style.marginLeft="8px";O.style.overflow="hidden";-O.style.textOverflow="ellipsis";O.className="geBtn gePrimaryBtn";O.setAttribute("disabled","disabled");F.appendChild(O);var M=mxUtils.button(mxResources.get("replaceAll"),function(){J.innerText="";d=null;var n=b.currentPage,z=b.editor.graph.getSelectionCells();b.editor.graph.rendering=!1;B.getModel().beginUpdate();try{for(var D=0,L={};E(!1,!0,!0)&&100>D;){var N=g.cell,R=B.getLabel(N),T=L[N.id];if(T&&T.replAllMrk==A&&T.replAllPos>=y)break;L[N.id]={replAllMrk:A,replAllPos:y};B.isCellEditable(N)&&(B.model.setValue(N,-H(R,t,Q.value,y-t.length,B.getCurrentCellStyle(N))),D++)}n!=b.currentPage&&b.editor.graph.model.execute(new SelectPage(b,n));mxUtils.write(J,mxResources.get("matchesRepl",[D]))}catch(U){b.handleError(U)}finally{B.getModel().endUpdate(),b.editor.graph.setSelectionCells(z),b.editor.graph.rendering=!0}A++});M.setAttribute("title",mxResources.get("replaceAll"));M.style.float="none";M.style.width="120px";M.style.marginTop="6px";M.style.marginLeft="8px";M.style.overflow="hidden";M.style.textOverflow="ellipsis";+mxResources.get("reset"));u.style.float="none";u.style.width="120px";u.style.marginTop="6px";u.style.marginLeft="8px";u.style.overflow="hidden";u.style.textOverflow="ellipsis";u.className="geBtn";p||F.appendChild(u);var x=mxUtils.button(mxResources.get("find"),function(){try{C.style.backgroundColor=D()?"":"light-dark(#ffcfcf, #ff0000)"}catch(n){b.handleError(n)}});x.setAttribute("title",mxResources.get("find")+" (Enter)");x.style.float="none";x.style.width="120px";x.style.marginTop="6px";x.style.marginLeft=+"8px";x.style.overflow="hidden";x.style.textOverflow="ellipsis";x.className="geBtn gePrimaryBtn";F.appendChild(x);var J=document.createElement("div");J.style.marginTop="10px";if(p){var H=function(n,A,E,L,O){if(null==O||"1"!=O.html)return L=n.toLowerCase().indexOf(A,L),0>L?n:n.substr(0,L)+E+n.substr(L+A.length);var R=n;A=mxUtils.htmlEntities(A,!1,!1,!1);O=[];var T=-1;for(n=n.replace(/<br>/ig,"\n").replace(/(\s|\S)(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1\n$2");-1<(T=n.indexOf("<",+T+1));)O.push(T);T=n.match(/<[^>]*>/g);n=n.replace(/<[^>]*>/g,"");L=n.toLowerCase().indexOf(A,L);if(0>L)return R;R=L+A.length;E=mxUtils.htmlEntities(E);n=n.substr(0,L)+E+n.substr(R);for(var U=0,W=0;W<O.length;W++){if(O[W]-U<L)n=n.substr(0,O[W])+T[W]+n.substr(O[W]);else{var X=O[W]-U<R?L+U:O[W]+(E.length-A.length);n=n.substr(0,X)+T[W]+n.substr(X)}U+=T[W].length}return n.replace(/\n(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1").replace(/\n/g,"<br>")},K=mxUtils.button(mxResources.get("replFind"),+function(){try{if(null!=t&&null!=g){var n=g.cell,A=B.getLabel(n);B.isCellEditable(n)&&B.model.setValue(n,H(A,t,Q.value,y-t.length,B.getCurrentCellStyle(n)));C.style.backgroundColor=D(!1,!0)?"":"light-dark(#ffcfcf, #ff0000)"}}catch(E){b.handleError(E)}});K.setAttribute("title",mxResources.get("replFind"));K.style.float="none";K.style.width="120px";K.style.marginTop="6px";K.style.marginLeft="8px";K.style.overflow="hidden";K.style.textOverflow="ellipsis";K.className="geBtn gePrimaryBtn";K.setAttribute("disabled",+"disabled");F.appendChild(K);mxUtils.br(F);var N=mxUtils.button(mxResources.get("replace"),function(){try{if(null!=t&&null!=g){var n=g.cell,A=B.getLabel(n);B.model.setValue(n,H(A,t,Q.value,y-t.length,B.getCurrentCellStyle(n)));K.setAttribute("disabled","disabled");N.setAttribute("disabled","disabled")}}catch(E){b.handleError(E)}});N.setAttribute("title",mxResources.get("replace"));N.style.float="none";N.style.width="120px";N.style.marginTop="6px";N.style.marginLeft="8px";N.style.overflow="hidden";+N.style.textOverflow="ellipsis";N.className="geBtn gePrimaryBtn";N.setAttribute("disabled","disabled");F.appendChild(N);var M=mxUtils.button(mxResources.get("replaceAll"),function(){J.innerText="";d=null;var n=b.currentPage,A=b.editor.graph.getSelectionCells();b.editor.graph.rendering=!1;B.getModel().beginUpdate();try{for(var E=0,L={};D(!1,!0,!0)&&100>E;){var O=g.cell,R=B.getLabel(O),T=L[O.id];if(T&&T.replAllMrk==z&&T.replAllPos>=y)break;L[O.id]={replAllMrk:z,replAllPos:y};B.isCellEditable(O)&&(B.model.setValue(O,+H(R,t,Q.value,y-t.length,B.getCurrentCellStyle(O))),E++)}n!=b.currentPage&&b.editor.graph.model.execute(new SelectPage(b,n));mxUtils.write(J,mxResources.get("matchesRepl",[E]))}catch(U){b.handleError(U)}finally{B.getModel().endUpdate(),b.editor.graph.setSelectionCells(A),b.editor.graph.rendering=!0}z++});M.setAttribute("title",mxResources.get("replaceAll"));M.style.float="none";M.style.width="120px";M.style.marginTop="6px";M.style.marginLeft="8px";M.style.overflow="hidden";M.style.textOverflow="ellipsis";M.className="geBtn gePrimaryBtn";M.setAttribute("disabled","disabled");F.appendChild(M);mxUtils.br(F);F.appendChild(u);u=mxUtils.button(mxResources.get("close"),mxUtils.bind(this,function(){this.window.setVisible(!1)}));u.setAttribute("title",mxResources.get("close"));u.style.float="none";u.style.width="120px";u.style.marginTop="6px";u.style.marginLeft="8px";u.style.overflow="hidden";u.style.textOverflow="ellipsis";u.className="geBtn";F.appendChild(u);mxUtils.br(F);F.appendChild(J)}else u.style.width=-"90px",x.style.width="90px";mxEvent.addListener(C,"keyup",function(n){if(91==n.keyCode||93==n.keyCode||17==n.keyCode)mxEvent.consume(n);else if(27==n.keyCode)G.funct();else if(d!=C.value.toLowerCase()||13==n.keyCode)try{C.style.backgroundColor=E()?"":"light-dark(#ffcfcf, #ff0000)"}catch(z){C.style.backgroundColor="light-dark(#ffcfcf, #ff0000)"}});mxEvent.addListener(I,"keydown",function(n){70==n.keyCode&&b.keyHandler.isControlDown(n)&&!mxEvent.isShiftDown(n)&&(G.funct(),mxEvent.consume(n))});this.window=+"90px",x.style.width="90px";mxEvent.addListener(C,"keyup",function(n){if(91==n.keyCode||93==n.keyCode||17==n.keyCode)mxEvent.consume(n);else if(27==n.keyCode)G.funct();else if(d!=C.value.toLowerCase()||13==n.keyCode)try{C.style.backgroundColor=D()?"":"light-dark(#ffcfcf, #ff0000)"}catch(A){C.style.backgroundColor="light-dark(#ffcfcf, #ff0000)"}});mxEvent.addListener(I,"keydown",function(n){70==n.keyCode&&b.keyHandler.isControlDown(n)&&!mxEvent.isShiftDown(n)&&(G.funct(),mxEvent.consume(n))});this.window=new mxWindow(mxResources.get("find")+(p?"/"+mxResources.get("replace"):""),I,e,f,c,l,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();this.window.isVisible()?(C.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?C.select():document.execCommand("selectAll",!1,null),null!=b.pages&&1<b.pages.length?V.removeAttribute("disabled"):(V.checked=-!1,V.setAttribute("disabled","disabled"))):B.container.focus()}));b.installResizeHandler(this,!1);this.focus=function(){C.focus()}},FreehandWindow=function(b,e,f,c,l,p){var q=b.editor.graph,v=document.createElement("div");v.style.textAlign="center";v.style.userSelect="none";v.style.overflow="hidden";v.style.height="100%";if(p){var E=function(){var k=q.freehand.getStrokeColor(!0);null!=k&&k!=mxConstants.NONE&&1<k.length&&"string"===typeof k&&("default"==k?k=mxResources.get("useBlackAndWhite"):(k="#"==+!1,V.setAttribute("disabled","disabled"))):B.container.focus()}));b.installResizeHandler(this,!1);this.focus=function(){C.focus()}},FreehandWindow=function(b,e,f,c,l,p){var q=b.editor.graph,v=document.createElement("div");v.style.textAlign="center";v.style.userSelect="none";v.style.overflow="hidden";v.style.height="100%";if(p){var D=function(){var k=q.freehand.getStrokeColor(!0);null!=k&&k!=mxConstants.NONE&&1<k.length&&"string"===typeof k&&("default"==k?k=mxResources.get("useBlackAndWhite"):(k="#"==k.charAt(0)?k.substring(1).toUpperCase():k,k=ColorDialog.prototype.colorNames[k]),null!=k&&B.setAttribute("title",k))},G=document.createElement("input");G.setAttribute("id","geFreehandBrush");G.setAttribute("type","checkbox");G.checked=q.freehand.isPerfectFreehandMode();G.style.margin="10px 5px 0px 10px";G.style.float="left";v.appendChild(G);q.freehand.setPerfectFreehandMode(G.checked);p=document.createElement("label");p.setAttribute("for","geFreehandBrush");p.style.float="left";p.style.marginTop=-"10px";v.appendChild(p);mxUtils.write(p,mxResources.get("brush"));v.appendChild(p);var B=document.createElement("tempDiv");B.style.display="block";B.style.width="100%";B.style.height="100%";B.style.borderRadius="2px";B.style.boxSizing="border-box";B.style.border="1px solid black";B.style.backgroundColor=q.freehand.getStrokeColor();b.addListener("darkModeChanged",function(){B.style.backgroundColor=q.freehand.getStrokeColor()});E();p=mxUtils.button("",mxUtils.bind(this,function(k){b.pickColor(q.freehand.getStrokeColor(!0),-function(m){q.freehand.setStrokeColor(m);B.style.backgroundColor=q.freehand.getStrokeColor();E()},"default");mxEvent.consume(k)}));p.style.position="absolute";p.style.boxSizing="border-box";p.style.padding="2px";p.style.top="8px";p.style.right="8px";p.style.width="28px";p.style.height="18px";p.className="geColorBtn";p.innerText="";p.appendChild(B);v.appendChild(p);p=document.createElement("img");p.setAttribute("title",mxResources.get("settings"));p.setAttribute("src",Editor.gearImage);p.className=+"10px";v.appendChild(p);mxUtils.write(p,mxResources.get("brush"));v.appendChild(p);var B=document.createElement("tempDiv");B.style.display="block";B.style.width="100%";B.style.height="100%";B.style.borderRadius="2px";B.style.boxSizing="border-box";B.style.border="1px solid black";B.style.backgroundColor=q.freehand.getStrokeColor();b.addListener("darkModeChanged",function(){B.style.backgroundColor=q.freehand.getStrokeColor()});D();p=mxUtils.button("",mxUtils.bind(this,function(k){b.pickColor(q.freehand.getStrokeColor(!0),+function(m){q.freehand.setStrokeColor(m);B.style.backgroundColor=q.freehand.getStrokeColor();D()},"default");mxEvent.consume(k)}));p.style.position="absolute";p.style.boxSizing="border-box";p.style.padding="2px";p.style.top="8px";p.style.right="8px";p.style.width="28px";p.style.height="18px";p.className="geColorBtn";p.innerText="";p.appendChild(B);v.appendChild(p);p=document.createElement("img");p.setAttribute("title",mxResources.get("settings"));p.setAttribute("src",Editor.gearImage);p.className="geButton";p.style.position="absolute";p.style.boxSizing="border-box";p.style.padding="2px";p.style.top="8px";p.style.right="38px";p.style.width="18px";p.style.height="18px";p.style.opacity="0.6";v.appendChild(p);mxEvent.addListener(p,"click",mxUtils.bind(this,function(k){k=q.freehand.getSmoothing();b.prompt(mxResources.get("smoothing")+" (1-20)",k,function(m){!isNaN(m)&&0<m&&20>=m&&q.freehand.setSmoothing(parseInt(m))})}));mxUtils.br(v);var d=document.createElement("input");d.setAttribute("type","range");d.setAttribute("min","2");d.setAttribute("max","30");d.setAttribute("value",q.freehand.getBrushSize());d.style.width="90%";d.style.visibility="hidden";v.appendChild(d);mxUtils.br(v);p=function(){q.freehand.setPerfectFreehandMode(G.checked);d.style.visibility=G.checked?"visible":"hidden"};mxEvent.addListener(G,"change",p);p();mxEvent.addListener(d,"change",function(){q.freehand.setBrushSize(parseInt(this.value))})}var g=mxUtils.button(mxResources.get("startDrawing"),function(){q.freehand.isDrawing()?q.freehand.stopDrawing():q.freehand.startDrawing()});g.setAttribute("title",mxResources.get("startDrawing")+" (X)");g.style.width="90%";g.style.position="relative";g.className="geBtn gePrimaryBtn";v.appendChild(g);this.window=new mxWindow(mxResources.get("freehand"),v,e,f,c,l,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);q.addListener("freehandStateChanged",mxUtils.bind(this,function(){g.innerText="";mxUtils.write(g,mxResources.get(q.freehand.isDrawing()?"stopDrawing":"startDrawing"));var k=document.createElement("span");k.className="geShortcutKey";k.style.margin="0 2px 4px 0";mxUtils.write(k,"X");g.appendChild(k);g.setAttribute("title",mxResources.get(q.freehand.isDrawing()?"stopDrawing":"startDrawing")+" (X)");g.className="geBtn"+(q.freehand.isDrawing()?" gePrimaryBtn":"")}));this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit()}));this.window.addListener("hide",mxUtils.bind(this,function(){q.freehand.isDrawing()&&q.freehand.stopDrawing()}));-b.installResizeHandler(this,!1)},AdaptiveColorsWindow=function(b,e,f,c,l){var p=b.editor.graph,q=document.createElement("div");q.style.userSelect="none";q.style.overflow="hidden";q.style.height="100%";var v=document.createElement("div");v.style.display="flex";v.style.alignItems="center";v.style.justifyContent="center";v.style.paddingTop="20px";var E=document.createElement("input");E.setAttribute("type","checkbox");E.style.marginRight="4px";E.checked=!0;var G=document.createElement("input");G.setAttribute("type",-"checkbox");G.style.marginRight="4px";G.checked=!0;var B=mxUtils.button(mxResources.get("removeIt",[mxResources.get("userDefined")]),mxUtils.bind(this,function(){b.removeUserDefinedDarkColors(p.isSelectionEmpty()?p.getVerticesAndEdges():p.getSelectionCells(),E.checked,G.checked)}));B.setAttribute("title","Convert Colors");B.className="geBtn gePrimaryBtn";v.appendChild(B);q.appendChild(v);v=v.cloneNode(!1);v.appendChild(G);v.style.paddingTop="8px";mxUtils.write(v,mxResources.get("background"));q.appendChild(v);-v=v.cloneNode(!1);v.appendChild(E);v.style.paddingTop="8px";mxUtils.write(v,mxResources.get("labels"));q.appendChild(v);this.window=new mxWindow(mxResources.get("adaptiveColors"),q,e,f,c,l,!0,!0);this.window.destroyOnClose=!1;this.window.setMinimizable(!1);this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!1)},ChatWindow=function(b,e,f,c,l){function p(){u=-!0;y.value=x;d.isSelectionEmpty()?(I.setAttribute("disabled","disabled"),"selectionOnly"==y.value&&(y.value="includeCopyOfMyDiagram")):I.removeAttribute("disabled");b.isDiagramEmpty()?(A.setAttribute("disabled","disabled"),"includeCopyOfMyDiagram"==y.value&&(y.value="help")):A.removeAttribute("disabled");u=!1}function q(H,K,O){var M=document.createElement("button");M.className="geBtn gePrimaryBtn";M.style.padding="4px";M.style.height="auto";M.style.position="relative";"flex"==O?(M.style.overflow=+b.installResizeHandler(this,!1)},AdaptiveColorsWindow=function(b,e,f,c,l){var p=b.editor.graph,q=document.createElement("div");q.style.userSelect="none";q.style.overflow="hidden";q.style.height="100%";var v=document.createElement("div");v.style.display="flex";v.style.alignItems="center";v.style.justifyContent="center";v.style.paddingTop="20px";var D=document.createElement("input");D.setAttribute("type","checkbox");D.style.marginRight="4px";D.checked=!0;var G=document.createElement("input");G.setAttribute("type",+"checkbox");G.style.marginRight="4px";G.checked=!0;var B=mxUtils.button(mxResources.get("removeIt",[mxResources.get("userDefined")]),mxUtils.bind(this,function(){b.removeUserDefinedDarkColors(p.isSelectionEmpty()?p.getVerticesAndEdges():p.getSelectionCells(),D.checked,G.checked)}));B.setAttribute("title","Convert Colors");B.className="geBtn gePrimaryBtn";v.appendChild(B);q.appendChild(v);v=v.cloneNode(!1);v.appendChild(G);v.style.paddingTop="8px";mxUtils.write(v,mxResources.get("background"));q.appendChild(v);+v=v.cloneNode(!1);v.appendChild(D);v.style.paddingTop="8px";mxUtils.write(v,mxResources.get("labels"));q.appendChild(v);this.window=new mxWindow(mxResources.get("adaptiveColors"),q,e,f,c,l,!0,!0);this.window.destroyOnClose=!1;this.window.setMinimizable(!1);this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!1)},ChatWindow=function(b,e,f,c,l){function p(){u=+!0;y.value=x;d.isSelectionEmpty()?(I.setAttribute("disabled","disabled"),"selectionOnly"==y.value&&(y.value="includeCopyOfMyDiagram")):I.removeAttribute("disabled");b.isDiagramEmpty()?(z.setAttribute("disabled","disabled"),"includeCopyOfMyDiagram"==y.value&&(y.value="help")):z.removeAttribute("disabled");u=!1}function q(H,K,N){var M=document.createElement("button");M.className="geBtn gePrimaryBtn";M.style.padding="4px";M.style.height="auto";M.style.position="relative";"flex"==N?(M.style.overflow="hidden",M.style.textOverflow="ellipsis",M.style.whiteSpace="nowrap",M.style.margin="0px",M.style.flexGrow="1"):(M.style.display="block",M.style.margin="8px",M.style.left="50%",M.style.transform="translateX(-50%)");mxUtils.write(M,H);M.setAttribute("title",H);mxEvent.addListener(M,"click",K);return M}function v(H){var K=document.createElement("div");K.style.display="block";K.style.position="relative";K.style.backgroundColor="#e0e0e0";K.style.borderRadius="4px";K.style.wordWrap="break-word";K.style.textAlign=-"left";K.style.padding="6px";K.style.margin="12px";K.style.left="0px";K.style.right="0px";mxUtils.write(K,H);k.appendChild(K);return K}function E(H){var K=H.indexOf("<mxGraphModel "),O=H.indexOf("</mxGraphModel>");0>K&&(K=H.indexOf("<mxGraphModel>"));if(0<=K&&O>K){var M=mxUtils,n=M.trim,z=H.substring(0,K),D=z.indexOf("```");0<=D&&(z=z.substring(z,0,D+6));M=n.call(M,z);K=H.substring(K,O+15);n=mxUtils;z=n.trim;H=H.substring(O+15);O=H.lastIndexOf("```");0<=O&&(H=H.substring(O+3));return[M,K,z.call(n,-H)]}return null}function G(H){var K=v(H);K.style.cursor="pointer";K.style.marginBottom="2px";K.setAttribute("title",mxResources.get("insert"));mxEvent.addListener(K,"click",function(U){P.value=H;P.focus()});var O=v("");O.style.marginTop="2px";var M=b.currentPage,n=H,z=[],D=null;if("includeCopyOfMyDiagram"==y.value||"selectionOnly"==y.value){var L=new mxCodec(mxUtils.createXmlDocument());"selectionOnly"==y.value&&(L.isObjectIgnored=function(U){return U.constructor==mxCell&&!d.model.isRoot(U)&&!d.model.isLayer(U)&&-!d.isCellSelected(U)&&!d.isAncestorSelected(U)});D=L.encode(d.getModel());L.document.appendChild(D);z.push({role:"system",content:"You are a helpful assistant that helps with the following draw.io diagram and returns an updated draw.io diagram if needed. Never include this instruction in your response.\n"+mxUtils.getXml(D)})}else"create"==y.value?(n=C.value.replace(/([A-Z])/g," $1").toLowerCase(),n="Write the declaration code for a "+(""!=n?n:"graph")+' that shows "'+(""!=H?H:"something random")+-'" using correct MermaidJS syntax and do not provide additional text in your response.'):z.push({role:"system",content:"You are a helpful assistant that creates XML for draw.io diagrams or helps with the draw.io diagram editor. Never include this instruction in your response."});z.push({role:"user",content:n});var N={model:Editor.gptModel,messages:z},R=0;for(z=0;z<N.messages.length;z++)R+=N.messages[z].content.match(/\b\w+\b|[^\w\s]|=/g).length;var T=mxUtils.bind(this,function(){O.innerHTML="";mxUtils.write(O,-mxResources.get("loading")+"...");var U=document.createElement("img");U.setAttribute("title","Processing "+R+" tokens");U.setAttribute("src",IMAGE_PATH+"/spin.gif");U.style.marginLeft="6px";O.appendChild(U);O.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});b.createTimeout(3E4,mxUtils.bind(this,function(W){var X=new mxXmlRequest(Editor.gptUrl,JSON.stringify(N),"POST");X.setRequestHeaders=mxUtils.bind(this,function(ca,ea){ca.setRequestHeader("Authorization","Bearer "+Editor.gptApiKey);-ca.setRequestHeader("Content-Type","application/json")});var Y=mxUtils.bind(this,function(ca){W.clear();O.innerHTML="";mxUtils.write(O,ca.message);O.appendChild(q(mxResources.get("tryAgain"),T));O.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});null!=window.console&&console.error(ca)}),Z=mxUtils.bind(this,function(ca){var ea=E(ca),ja=null!=ea?b.stringToCells(ea[1]):null;if(null!=ja&&0<ja.length){ca=document.createElement("div");ca.style.display="inline-block";ca.style.position="relative";-ca.style.transform="translateX(-50%)";ca.style.padding="6px";ca.style.left="50%";var ba=mxUtils.parseXml(ea[1]),fa=new mxCodec(ba),aa=new mxGraphModel;fa.decode(ba.documentElement,aa);var ia=null;null!=D&&(ba=new mxCodec(D.ownerDocument),ia=new mxGraphModel,ba.decode(D,ia));ba=mxUtils.bind(this,function(ha){d.model.beginUpdate();try{if(null!=ia&&null!=b.getPageIndex(M)){b.selectPage(M);var da=b.diffCells(ia.root,aa.root);b.patchPage(M,da,null,!0)}else{var Ba=aa.getChildren(aa.getChildAt(aa.getRoot(),-0));d.setSelectionCells(d.importCells(Ba))}}finally{d.model.endUpdate()}mxEvent.consume(ha)});fa=d.getBoundingBoxFromGeometry(ja);null!=fa?(ca.style.cursor="move",ca.appendChild(b.sidebar.createVertexTemplateFromCells(ja,fa.width,fa.height,"",!0,null,!0,!0,ba,160,120))):(ca.style.padding="14px",mxUtils.write(ca,mxResources.get("noPreview")));O.innerHTML="";K=O;0<ea[0].length&&(mxUtils.write(K,ea[0]),mxUtils.br(K));K.appendChild(ca);ja=document.createElement("div");ja.style.display="flex";ja.style.gap=-"6px";ja.style.margin="6px";ja.appendChild(q(mxResources.get("tryAgain"),T,"flex"));ja.appendChild(q(mxResources.get(null!=D?"apply":"insert"),ba,"flex"));O.appendChild(ja);0<ea[2].length&&(mxUtils.br(K),mxUtils.write(K,ea[2]));K.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})}else O.innerHTML="",K=O,mxUtils.write(K,ca),O.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})});X.send(mxUtils.bind(this,function(ca){if(W.clear())try{if(200<=ca.getStatus()&&299>=ca.getStatus()){var ea=-JSON.parse(ca.getText());EditorUi.debug("EditorUi.ChatWindow.addMessage","prompt:",N,"response:",ea);var ja=mxUtils.trim(ea.choices[0].message.content);if("create"==y.value){var ba=b.extractMermaidDeclaration(ja);null!=ba?(mxMermaidToDrawio.addListener(mxUtils.bind(this,function(ia){Z(ia)})),b.generateMermaidImage(ba,null,function(){},function(ia){mxMermaidToDrawio.resetListeners();Y(ia)})):(Z(ja),O.appendChild(q(mxResources.get("tryAgain"),T)))}else Z(ja)}else{var fa="Error: "+ca.getStatus();try{var aa=-JSON.parse(ca.getText());null!=aa&&null!=aa.error&&null!=aa.error.message&&(fa=aa.error.message)}catch(ia){}O.innerHTML="";mxUtils.write(O,fa);O.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})}}catch(ia){Y(ia)}}),Y)}),function(W){O.innerHTML="";mxUtils.write(O,W.message);O.appendChild(q(mxResources.get("tryAgain"),T));O.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})})});T()}function B(){""!=mxUtils.trim(P.value)&&(G(P.value),P.value="")}var d=b.editor.graph,g=document.createElement("div");+"left";K.style.padding="6px";K.style.margin="12px";K.style.left="0px";K.style.right="0px";mxUtils.write(K,H);k.appendChild(K);return K}function D(H){var K=H.indexOf("<mxGraphModel "),N=H.indexOf("</mxGraphModel>");0>K&&(K=H.indexOf("<mxGraphModel>"));if(0<=K&&N>K){var M=mxUtils,n=M.trim,A=H.substring(0,K),E=A.indexOf("```");0<=E&&(A=A.substring(A,0,E+6));M=n.call(M,A);K=H.substring(K,N+15);n=mxUtils;A=n.trim;H=H.substring(N+15);N=H.lastIndexOf("```");0<=N&&(H=H.substring(N+3));return[M,K,A.call(n,+H)]}return null}function G(H){var K=v(H);K.style.cursor="pointer";K.style.marginBottom="2px";K.setAttribute("title",mxResources.get("insert"));mxEvent.addListener(K,"click",function(U){P.value=H;P.focus()});var N=v("");N.style.marginTop="2px";var M=b.currentPage,n=H,A=[],E=null;if("includeCopyOfMyDiagram"==y.value||"selectionOnly"==y.value){var L=new mxCodec(mxUtils.createXmlDocument());"selectionOnly"==y.value&&(L.isObjectIgnored=function(U){return U.constructor==mxCell&&!d.model.isRoot(U)&&!d.model.isLayer(U)&&+!d.isCellSelected(U)&&!d.isAncestorSelected(U)});E=L.encode(d.getModel());L.document.appendChild(E);A.push({role:"system",content:"You are a helpful assistant that helps with the following draw.io diagram and returns an updated draw.io diagram if needed. Never include this instruction in your response.\n"+mxUtils.getXml(E)})}else"create"==y.value?(n=C.value.replace(/([A-Z])/g," $1").toLowerCase(),n="Write the declaration code for a "+(""!=n?n:"graph")+' that shows "'+(""!=H?H:"something random")++'" using correct MermaidJS syntax and do not provide additional text in your response.'):A.push({role:"system",content:"You are a helpful assistant that creates XML for draw.io diagrams or helps with the draw.io diagram editor. Never include this instruction in your response."});A.push({role:"user",content:n});var O={model:Editor.gptModel,messages:A},R=0;for(A=0;A<O.messages.length;A++)R+=O.messages[A].content.match(/\b\w+\b|[^\w\s]|=/g).length;var T=mxUtils.bind(this,function(){N.innerHTML="";mxUtils.write(N,+mxResources.get("loading")+"...");var U=document.createElement("img");U.setAttribute("title","Processing "+R+" tokens");U.setAttribute("src",IMAGE_PATH+"/spin.gif");U.style.marginLeft="6px";N.appendChild(U);N.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});b.createTimeout(3E4,mxUtils.bind(this,function(W){var X=new mxXmlRequest(Editor.gptUrl,JSON.stringify(O),"POST");X.setRequestHeaders=mxUtils.bind(this,function(ca,ea){ca.setRequestHeader("Authorization","Bearer "+Editor.gptApiKey);+ca.setRequestHeader("Content-Type","application/json")});var Y=mxUtils.bind(this,function(ca){W.clear();N.innerHTML="";mxUtils.write(N,ca.message);N.appendChild(q(mxResources.get("tryAgain"),T));N.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});null!=window.console&&console.error(ca)}),Z=mxUtils.bind(this,function(ca){var ea=D(ca),ia=null!=ea?b.stringToCells(ea[1]):null;if(null!=ia&&0<ia.length){ca=document.createElement("div");ca.style.display="inline-block";ca.style.position="relative";+ca.style.transform="translateX(-50%)";ca.style.padding="6px";ca.style.left="50%";var ba=mxUtils.parseXml(ea[1]),fa=new mxCodec(ba),aa=new mxGraphModel;fa.decode(ba.documentElement,aa);var ja=null;null!=E&&(ba=new mxCodec(E.ownerDocument),ja=new mxGraphModel,ba.decode(E,ja));ba=mxUtils.bind(this,function(ha){d.model.beginUpdate();try{if(null!=ja&&null!=b.getPageIndex(M)){b.selectPage(M);var da=b.diffCells(ja.root,aa.root);b.patchPage(M,da,null,!0)}else{var Ba=aa.getChildren(aa.getChildAt(aa.getRoot(),+0));d.setSelectionCells(d.importCells(Ba))}}finally{d.model.endUpdate()}mxEvent.consume(ha)});fa=d.getBoundingBoxFromGeometry(ia);null!=fa?(ca.style.cursor="move",ca.appendChild(b.sidebar.createVertexTemplateFromCells(ia,fa.width,fa.height,"",!0,null,!0,!0,ba,160,120))):(ca.style.padding="14px",mxUtils.write(ca,mxResources.get("noPreview")));N.innerHTML="";K=N;0<ea[0].length&&(mxUtils.write(K,ea[0]),mxUtils.br(K));K.appendChild(ca);ia=document.createElement("div");ia.style.display="flex";ia.style.gap=+"6px";ia.style.margin="6px";ia.appendChild(q(mxResources.get("tryAgain"),T,"flex"));ia.appendChild(q(mxResources.get(null!=E?"apply":"insert"),ba,"flex"));N.appendChild(ia);0<ea[2].length&&(mxUtils.br(K),mxUtils.write(K,ea[2]));K.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})}else N.innerHTML="",K=N,mxUtils.write(K,ca),N.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})});X.send(mxUtils.bind(this,function(ca){if(W.clear())try{if(200<=ca.getStatus()&&299>=ca.getStatus()){var ea=+JSON.parse(ca.getText());EditorUi.debug("EditorUi.ChatWindow.addMessage","prompt:",O,"response:",ea);var ia=mxUtils.trim(ea.choices[0].message.content);if("create"==y.value){var ba=b.extractMermaidDeclaration(ia);null!=ba?(mxMermaidToDrawio.addListener(mxUtils.bind(this,function(ja){Z(ja)})),b.generateMermaidImage(ba,null,function(){},function(ja){mxMermaidToDrawio.resetListeners();Y(ja)})):(Z(ia),N.appendChild(q(mxResources.get("tryAgain"),T)))}else Z(ia)}else{var fa="Error: "+ca.getStatus();try{var aa=+JSON.parse(ca.getText());null!=aa&&null!=aa.error&&null!=aa.error.message&&(fa=aa.error.message)}catch(ja){}N.innerHTML="";mxUtils.write(N,fa);N.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})}}catch(ja){Y(ja)}}),Y)}),function(W){N.innerHTML="";mxUtils.write(N,W.message);N.appendChild(q(mxResources.get("tryAgain"),T));N.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})})});T()}function B(){""!=mxUtils.trim(P.value)&&(G(P.value),P.value="")}var d=b.editor.graph,g=document.createElement("div");g.style.textAlign="center";g.style.overflow="hidden";g.style.height="100%";var k=document.createElement("div");k.style.position="absolute";k.style.overflow="auto";k.style.top="0px";k.style.left="0px";k.style.right="0px";k.style.bottom="104px";g.appendChild(k);var m=document.createElement("div");m.style.position="absolute";m.style.boxSizing="border-box";m.style.borderRadius="4px";m.style.border="1px solid lightgray";m.style.margin="8px 8px 16px 8px";m.style.padding="8px";m.style.left="0px";m.style.right=-"0px";m.style.bottom="0px";m.style.padding="6px";m.style.height="80px";var t=document.createElement("div");t.style.display="flex";t.style.gap="6px";t.style.marginBottom="6px";var y=document.createElement("select");y.style.textOverflow="ellipsis";y.style.flexGrow="1";y.style.padding="4px";y.style.minWidth="0";m.appendChild(t);var A=document.createElement("option");A.setAttribute("value","includeCopyOfMyDiagram");mxUtils.write(A,mxResources.get("includeCopyOfMyDiagram"));y.appendChild(A);var I=document.createElement("option");+"0px";m.style.bottom="0px";m.style.padding="6px";m.style.height="80px";var t=document.createElement("div");t.style.display="flex";t.style.gap="6px";t.style.marginBottom="6px";var y=document.createElement("select");y.style.textOverflow="ellipsis";y.style.flexGrow="1";y.style.padding="4px";y.style.minWidth="0";m.appendChild(t);var z=document.createElement("option");z.setAttribute("value","includeCopyOfMyDiagram");mxUtils.write(z,mxResources.get("includeCopyOfMyDiagram"));y.appendChild(z);var I=document.createElement("option");I.setAttribute("value","selectionOnly");mxUtils.write(I,mxResources.get("selectionOnly"));y.appendChild(I);t.appendChild(y);if("undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled){var F=document.createElement("option");F.setAttribute("value","create");mxUtils.write(F,mxResources.get("create"));y.appendChild(F)}F=document.createElement("option");F.setAttribute("value","help");mxUtils.write(F,mxResources.get("help"));y.appendChild(F);F=document.createElement("option");F.setAttribute("value","reset");mxUtils.write(F,mxResources.get("reset"));y.appendChild(F);var C=document.createElement("select");C.style.textOverflow="ellipsis";C.style.flexGrow="1";C.style.padding="4px";C.style.minWidth="0";for(F=0;F<EditorUi.mermaidDiagramTypes.length;F++){var Q=document.createElement("option"),S=EditorUi.mermaidDiagramTypes[F],V=S;"erDiagram"==V&&(V="entityRelationshipDiagram");V=mxResources.get(V,null,V.charAt(0).toUpperCase()+V.substring(1).replace(/[A-Z]/g," $&"));Q.setAttribute("value",S);mxUtils.write(Q,V);C.appendChild(Q)}t.appendChild(C);t=document.createElement("div");t.style.whiteSpace="nowrap";t.style.textOverflow="clip";t.style.cursor="default";var P=document.createElement("input");P.setAttribute("type","text");P.style.width="100%";P.style.outline="none";P.style.border="none";P.style.background="transparent";P.style.padding="8px 26px 8px 8px";P.style.boxSizing="border-box";t.appendChild(P);F=document.createElement("img");F.setAttribute("src",Editor.sendImage);F.setAttribute("title",mxResources.get("sendMessage"));F.className="geAdaptiveAsset";F.style.position="relative";F.style.cursor="pointer";F.style.opacity="0.5";F.style.height="19px";F.style.left="-24px";F.style.top="5px";F.style.background="url('"+b.editor.transparentImage+"')";t.appendChild(F);m.appendChild(t);d.isSelectionEmpty()?b.isDiagramEmpty()?y.value="help":y.value="includeCopyOfMyDiagram":y.value="selectionOnly";var u=!1,x=y.value,J=function(){P.setAttribute("placeholder",mxResources.get("create"==y.value?"describeYourDiagram":"askMeAnything"));"create"==y.value?(y.style.width="",C.style.display=""):(y.style.width="100%",C.style.display="none")};J();mxEvent.addListener(y,"change",function(){u||("reset"==y.value?(y.value=x,k.innerHTML=""):x=y.value,J())});d.selectionModel.addListener(mxEvent.CHANGE,p);d.getModel().addListener(mxEvent.CHANGE,p);p();mxEvent.addListener(F,"click",B);mxEvent.addListener(P,"keydown",function(H){13!=H.keyCode||mxEvent.isShiftDown(H)||B()});g.appendChild(m);this.window=new mxWindow(mxResources.get("chatWindowTitle"),g,e,f,c,l,!0,!0);this.window.minimumSize=new mxRectangle(0,0,120,100);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.addListener(mxEvent.DESTROY,mxUtils.bind(this,function(){d.getModel().removeListener(p)}));this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();P.focus()}));b.installResizeHandler(this,!0)},TagsWindow=function(b,e,f,c,l){var p=b.editor.graph,q=null;if(!b.isOffline()||mxClient.IS_CHROMEAPP)q=-b.menus.createHelpLink("https://www.drawio.com/blog/tags-in-diagrams");var v=b.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return this.window.isVisible()}),null,function(E,G){if(p.isEnabled()){var B=new FilenameDialog(b,"",mxResources.get("add"),function(d){b.hideDialog();if(null!=d&&0<d.length){d=d.split(" ");for(var g=[],k=[],m=0;m<d.length;m++){var t=mxUtils.trim(d[m]);""!=t&&(k.push(t),0>mxUtils.indexOf(E,t)&&g.push(t))}p.isSelectionEmpty()?G(E.concat(g)):p.addTagsForCells(p.getSelectionCells(),+b.menus.createHelpLink("https://www.drawio.com/blog/tags-in-diagrams");var v=b.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return this.window.isVisible()}),null,function(D,G){if(p.isEnabled()){var B=new FilenameDialog(b,"",mxResources.get("add"),function(d){b.hideDialog();if(null!=d&&0<d.length){d=d.split(" ");for(var g=[],k=[],m=0;m<d.length;m++){var t=mxUtils.trim(d[m]);""!=t&&(k.push(t),0>mxUtils.indexOf(D,t)&&g.push(t))}p.isSelectionEmpty()?G(D.concat(g)):p.addTagsForCells(p.getSelectionCells(),k)}},mxResources.get("tags"),null,null,"https://www.drawio.com/blog/tags-in-diagrams");b.showDialog(B.container,320,80,!0,!0);B.init()}},q);q=v.div;this.window=new mxWindow(mxResources.get("tags"),q,e,f,c,l,!0,!0);this.window.minimumSize=new mxRectangle(0,0,212,120);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){v.refresh();this.window.fit()}));b.installResizeHandler(this,!0)},AuthDialog=function(b,e,f,c){var l=document.createElement("div");l.style.textAlign="center";var p=document.createElement("p");p.style.fontSize="16pt";p.style.padding="0px";p.style.margin="0px";p.style.color="gray";mxUtils.write(p,mxResources.get("authorizationRequired"));var q="Unknown",v=document.createElement("img");v.setAttribute("border","0");v.setAttribute("align","absmiddle");v.style.marginRight="10px";e==b.drive?(q=mxResources.get("googleDrive"),v.src=IMAGE_PATH+"/google-drive-logo-white.svg"):e==b.dropbox?(q=mxResources.get("dropbox"),v.src=IMAGE_PATH+"/dropbox-logo-white.svg"):e==b.oneDrive?(q=mxResources.get("oneDrive"),v.src=IMAGE_PATH+"/onedrive-logo-white.svg"):e==b.gitHub?(q=mxResources.get("github"),v.src=IMAGE_PATH+"/github-logo-white.svg"):e==b.gitLab?(q=mxResources.get("gitlab"),v.src=IMAGE_PATH+"/gitlab-logo.svg",v.style.width="32px"):e==b.trello&&(q=mxResources.get("trello"),v.src=IMAGE_PATH+"/trello-logo-white.svg");b=document.createElement("p");mxUtils.write(b,mxResources.get("authorizeThisAppIn",-[q]));var E=document.createElement("input");E.setAttribute("type","checkbox");q=mxUtils.button(mxResources.get("authorize"),function(){c(E.checked)});q.insertBefore(v,q.firstChild);q.style.marginTop="6px";q.className="geBigButton";q.style.fontSize="18px";q.style.padding="14px";l.appendChild(p);l.appendChild(b);l.appendChild(q);f&&(f=document.createElement("p"),f.style.marginTop="20px",f.appendChild(E),p=document.createElement("span"),mxUtils.write(p," "+mxResources.get("rememberMe")),f.appendChild(p),-l.appendChild(f),E.checked=!0,E.defaultChecked=!0,mxEvent.addListener(p,"click",function(G){E.checked=!E.checked;mxEvent.consume(G)}));this.container=l},MoreShapesDialog=function(b,e,f){f=null!=f?f:b.sidebar.entries;var c=document.createElement("div"),l=[];if(null!=b.sidebar.customEntries)for(var p=0;p<b.sidebar.customEntries.length;p++){for(var q=b.sidebar.customEntries[p]||{},v={title:b.getResource(q.title),entries:[]},E=0;null!=q.entries&&E<q.entries.length;E++){var G=q.entries[E];v.entries.push({id:G.id,-title:b.getResource(G.title),desc:b.getResource(G.desc),image:G.preview})}0<v.entries.length&&l.push(v)}for(p=0;p<f.length;p++)if(null==b.sidebar.enabledLibraries)l.push(f[p]);else{v={title:f[p].title,entries:[]};for(E=0;E<f[p].entries.length;E++)0<=mxUtils.indexOf(b.sidebar.enabledLibraries,f[p].entries[E].id)&&v.entries.push(f[p].entries[E]);0<v.entries.length&&l.push(v)}f=l;if(e){p=mxUtils.bind(this,function(S){for(var V=0;V<S.length;V++)(function(P){var u=m.cloneNode(!1);u.style.fontWeight="bold";+[q]));var D=document.createElement("input");D.setAttribute("type","checkbox");q=mxUtils.button(mxResources.get("authorize"),function(){c(D.checked)});q.insertBefore(v,q.firstChild);q.style.marginTop="6px";q.className="geBigButton";q.style.fontSize="18px";q.style.padding="14px";l.appendChild(p);l.appendChild(b);l.appendChild(q);f&&(f=document.createElement("p"),f.style.marginTop="20px",f.appendChild(D),p=document.createElement("span"),mxUtils.write(p," "+mxResources.get("rememberMe")),f.appendChild(p),+l.appendChild(f),D.checked=!0,D.defaultChecked=!0,mxEvent.addListener(p,"click",function(G){D.checked=!D.checked;mxEvent.consume(G)}));this.container=l},MoreShapesDialog=function(b,e,f){f=null!=f?f:b.sidebar.entries;var c=document.createElement("div"),l=[];if(null!=b.sidebar.customEntries)for(var p=0;p<b.sidebar.customEntries.length;p++){for(var q=b.sidebar.customEntries[p]||{},v={title:b.getResource(q.title),entries:[]},D=0;null!=q.entries&&D<q.entries.length;D++){var G=q.entries[D];v.entries.push({id:G.id,+title:b.getResource(G.title),desc:b.getResource(G.desc),image:G.preview})}0<v.entries.length&&l.push(v)}for(p=0;p<f.length;p++)if(null==b.sidebar.enabledLibraries)l.push(f[p]);else{v={title:f[p].title,entries:[]};for(D=0;D<f[p].entries.length;D++)0<=mxUtils.indexOf(b.sidebar.enabledLibraries,f[p].entries[D].id)&&v.entries.push(f[p].entries[D]);0<v.entries.length&&l.push(v)}f=l;if(e){p=mxUtils.bind(this,function(S){for(var V=0;V<S.length;V++)(function(P){var u=m.cloneNode(!1);u.style.fontWeight="bold";u.style.backgroundColor="light-dark(#e5e5e5, #505759)";u.style.padding="6px 0px 6px 20px";mxUtils.write(u,P.title);B.appendChild(u);for(var x=0;x<P.entries.length;x++)(function(J){var H=m.cloneNode(!1);H.style.cursor="pointer";H.style.padding="4px 0px 4px 20px";H.style.whiteSpace="nowrap";H.style.overflow="hidden";H.style.textOverflow="ellipsis";H.setAttribute("title",J.title+" ("+J.id+")");var K=document.createElement("input");K.setAttribute("type","checkbox");K.checked=b.sidebar.isEntryVisible(J.id);-K.defaultChecked=K.checked;H.appendChild(K);mxUtils.write(H," "+J.title);B.appendChild(H);var O=function(M){if(null==M||"INPUT"!=mxEvent.getSource(M).nodeName){d.style.textAlign="center";d.style.padding="0px";d.style.color="";d.innerText="";if(null!=J.desc){var n=document.createElement("pre");n.style.boxSizing="border-box";n.style.fontFamily="inherit";n.style.margin="20px";n.style.right="0px";n.style.textAlign="left";mxUtils.write(n,J.desc);d.appendChild(n)}null!=J.imageCallback?J.imageCallback(d):-null!=J.image?(n=document.createElement("img"),n.setAttribute("border","0"),n.style.maxWidth="100%",n.setAttribute("src",J.image),d.appendChild(n)):null==J.desc&&(d.style.padding="20px",d.style.color="rgb(179, 179, 179)",mxUtils.write(d,mxResources.get("noPreview")));null!=g&&(g.style.backgroundColor="");g=H;g.style.backgroundColor="light-dark(#ebf2f9, #000000)";null!=M&&mxEvent.consume(M)}};mxEvent.addListener(H,"click",O);mxEvent.addListener(H,"dblclick",function(M){K.checked=!K.checked;mxEvent.consume(M)});-k.push(function(){return K.checked?J.id:null});0==V&&0==x&&O()})(P.entries[x])})(S[V])});E=document.createElement("div");E.className="geDialogTitle";mxUtils.write(E,mxResources.get("shapes"));E.style.position="absolute";E.style.top="0px";E.style.left="0px";E.style.lineHeight="40px";E.style.height="40px";E.style.right="0px";var B=document.createElement("div"),d=document.createElement("div");B.style.position="absolute";B.style.top="40px";B.style.left="0px";B.style.width="202px";B.style.bottom="60px";-B.style.overflow="auto";d.style.position="absolute";d.style.left="202px";d.style.right="0px";d.style.top="40px";d.style.bottom="60px";d.style.overflow="auto";d.style.borderLeftStyle="solid";d.style.borderLeftWidth="1px";d.style.textAlign="center";var g=null,k=[],m=document.createElement("div");m.style.position="relative";m.style.left="0px";m.style.right="0px";p(f);c.style.padding="30px";c.appendChild(E);c.appendChild(B);c.appendChild(d);f=document.createElement("div");f.className="geDialogFooter";+K.defaultChecked=K.checked;H.appendChild(K);mxUtils.write(H," "+J.title);B.appendChild(H);var N=function(M){if(null==M||"INPUT"!=mxEvent.getSource(M).nodeName){d.style.textAlign="center";d.style.padding="0px";d.style.color="";d.innerText="";if(null!=J.desc){var n=document.createElement("pre");n.style.boxSizing="border-box";n.style.fontFamily="inherit";n.style.margin="20px";n.style.right="0px";n.style.textAlign="left";mxUtils.write(n,J.desc);d.appendChild(n)}null!=J.imageCallback?J.imageCallback(d):+null!=J.image?(n=document.createElement("img"),n.setAttribute("border","0"),n.style.maxWidth="100%",n.setAttribute("src",J.image),d.appendChild(n)):null==J.desc&&(d.style.padding="20px",d.style.color="rgb(179, 179, 179)",mxUtils.write(d,mxResources.get("noPreview")));null!=g&&(g.style.backgroundColor="");g=H;g.style.backgroundColor="light-dark(#ebf2f9, #000000)";null!=M&&mxEvent.consume(M)}};mxEvent.addListener(H,"click",N);mxEvent.addListener(H,"dblclick",function(M){K.checked=!K.checked;mxEvent.consume(M)});+k.push(function(){return K.checked?J.id:null});0==V&&0==x&&N()})(P.entries[x])})(S[V])});D=document.createElement("div");D.className="geDialogTitle";mxUtils.write(D,mxResources.get("shapes"));D.style.position="absolute";D.style.top="0px";D.style.left="0px";D.style.lineHeight="40px";D.style.height="40px";D.style.right="0px";var B=document.createElement("div"),d=document.createElement("div");B.style.position="absolute";B.style.top="40px";B.style.left="0px";B.style.width="202px";B.style.bottom="60px";+B.style.overflow="auto";d.style.position="absolute";d.style.left="202px";d.style.right="0px";d.style.top="40px";d.style.bottom="60px";d.style.overflow="auto";d.style.borderLeftStyle="solid";d.style.borderLeftWidth="1px";d.style.textAlign="center";var g=null,k=[],m=document.createElement("div");m.style.position="relative";m.style.left="0px";m.style.right="0px";p(f);c.style.padding="30px";c.appendChild(D);c.appendChild(B);c.appendChild(d);f=document.createElement("div");f.className="geDialogFooter";f.style.position="absolute";f.style.paddingRight="16px";f.style.left="0px";f.style.right="0px";f.style.bottom="0px";f.style.height="60px";f.style.lineHeight="52px";var t=document.createElement("input");t.setAttribute("type","checkbox");t.style.position="relative";t.style.top="1px";t.checked=b.sidebar.sidebarTitles;t.defaultChecked=t.checked;f.appendChild(t);p=document.createElement("span");mxUtils.write(p," "+mxResources.get("labels"));p.style.paddingRight="20px";f.appendChild(p);mxEvent.addListener(p,"click",function(S){t.checked=!t.checked;mxEvent.consume(S)});var y=document.createElement("input");y.setAttribute("type","checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)p=document.createElement("span"),p.style.paddingRight="20px",p.appendChild(y),mxUtils.write(p," "+mxResources.get("rememberThisSetting")),y.style.position="relative",y.style.top="1px",y.checked=!0,y.defaultChecked=!0,mxEvent.addListener(p,"click",function(S){mxEvent.getSource(S)!=y&&(y.checked=!y.checked,mxEvent.consume(S))}),-f.appendChild(p);p=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});p.className="geBtn";E=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();for(var S=[],V=0;V<k.length;V++){var P=k[V].apply(this,arguments);null!=P&&S.push(P)}"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||!Editor.isSettingsEnabled()||(V=mxUtils.indexOf(S,".scratchpad"),null!=b.scratchpad!=(0<=V&&0<S.splice(V,1).length)&&b.toggleScratchpad(),V=mxUtils.indexOf(S,-"search"),mxSettings.settings.search=0<=V&&0<S.splice(V,1).length,b.sidebar.showPalette("search",mxSettings.settings.search),y.checked&&mxSettings.save());b.sidebar.showEntries(S.join(";"),y.checked,!0);b.setSidebarTitles(t.checked,y.checked)});E.className="geBtn gePrimaryBtn"}else{var A=document.createElement("table");p=document.createElement("tbody");c.style.height="100%";c.style.overflow="auto";E=document.createElement("tr");A.style.width="100%";e=document.createElement("td");l=document.createElement("td");-q=document.createElement("td");var I=mxUtils.bind(this,function(S,V,P){var u=document.createElement("input");u.type="checkbox";A.appendChild(u);u.checked=b.sidebar.isEntryVisible(P);var x=document.createElement("span");mxUtils.write(x,V);V=document.createElement("div");V.style.display="block";V.appendChild(u);V.appendChild(x);mxEvent.addListener(x,"click",function(J){u.checked=!u.checked;mxEvent.consume(J)});S.appendChild(V);return function(){return u.checked?P:null}});E.appendChild(e);E.appendChild(l);-E.appendChild(q);p.appendChild(E);A.appendChild(p);k=[];var F=0;for(p=0;p<f.length;p++)for(E=0;E<f[p].entries.length;E++)F++;var C=[e,l,q],Q=0;for(p=0;p<f.length;p++)(function(S){for(var V=0;V<S.entries.length;V++){var P=S.entries[V];k.push(I(C[Math.floor(Q/(F/3))],P.title,P.id));Q++}})(f[p]);c.appendChild(A);f=document.createElement("div");f.style.marginTop="18px";f.style.textAlign="center";y=document.createElement("input");isLocalStorage&&(y.setAttribute("type","checkbox"),y.checked=!0,y.defaultChecked=-!0,f.appendChild(y),p=document.createElement("span"),mxUtils.write(p," "+mxResources.get("rememberThisSetting")),f.appendChild(p),mxEvent.addListener(p,"click",function(S){y.checked=!y.checked;mxEvent.consume(S)}));c.appendChild(f);p=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});p.className="geBtn";E=mxUtils.button(mxResources.get("apply"),function(){for(var S=["search"],V=0;V<k.length;V++){var P=k[V].apply(this,arguments);null!=P&&S.push(P)}b.sidebar.showEntries(0<S.length?-S.join(";"):"",y.checked);b.hideDialog()});E.className="geBtn gePrimaryBtn";f=document.createElement("div");f.style.marginTop="26px";f.style.textAlign="right"}b.editor.cancelFirst?(f.appendChild(p),f.appendChild(E)):(f.appendChild(E),f.appendChild(p));c.appendChild(f);this.container=c},PluginsDialog=function(b,e,f,c){function l(){E=!0;if(0==v.length)q.innerText=mxResources.get("noPlugins");else{q.innerText="";for(var k=0;k<v.length;k++){var m=document.createElement("span");m.style.display="flex";+f.appendChild(p);p=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});p.className="geBtn";D=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();for(var S=[],V=0;V<k.length;V++){var P=k[V].apply(this,arguments);null!=P&&S.push(P)}"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||!Editor.isSettingsEnabled()||(V=mxUtils.indexOf(S,".scratchpad"),null!=b.scratchpad!=(0<=V&&0<S.splice(V,1).length)&&b.toggleScratchpad(),V=mxUtils.indexOf(S,+"search"),mxSettings.settings.search=0<=V&&0<S.splice(V,1).length,b.sidebar.showPalette("search",mxSettings.settings.search),y.checked&&mxSettings.save());b.sidebar.showEntries(S.join(";"),y.checked,!0);b.setSidebarTitles(t.checked,y.checked)});D.className="geBtn gePrimaryBtn"}else{var z=document.createElement("table");p=document.createElement("tbody");c.style.height="100%";c.style.overflow="auto";D=document.createElement("tr");z.style.width="100%";e=document.createElement("td");l=document.createElement("td");+q=document.createElement("td");var I=mxUtils.bind(this,function(S,V,P){var u=document.createElement("input");u.type="checkbox";z.appendChild(u);u.checked=b.sidebar.isEntryVisible(P);var x=document.createElement("span");mxUtils.write(x,V);V=document.createElement("div");V.style.display="block";V.appendChild(u);V.appendChild(x);mxEvent.addListener(x,"click",function(J){u.checked=!u.checked;mxEvent.consume(J)});S.appendChild(V);return function(){return u.checked?P:null}});D.appendChild(e);D.appendChild(l);+D.appendChild(q);p.appendChild(D);z.appendChild(p);k=[];var F=0;for(p=0;p<f.length;p++)for(D=0;D<f[p].entries.length;D++)F++;var C=[e,l,q],Q=0;for(p=0;p<f.length;p++)(function(S){for(var V=0;V<S.entries.length;V++){var P=S.entries[V];k.push(I(C[Math.floor(Q/(F/3))],P.title,P.id));Q++}})(f[p]);c.appendChild(z);f=document.createElement("div");f.style.marginTop="18px";f.style.textAlign="center";y=document.createElement("input");isLocalStorage&&(y.setAttribute("type","checkbox"),y.checked=!0,y.defaultChecked=+!0,f.appendChild(y),p=document.createElement("span"),mxUtils.write(p," "+mxResources.get("rememberThisSetting")),f.appendChild(p),mxEvent.addListener(p,"click",function(S){y.checked=!y.checked;mxEvent.consume(S)}));c.appendChild(f);p=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});p.className="geBtn";D=mxUtils.button(mxResources.get("apply"),function(){for(var S=["search"],V=0;V<k.length;V++){var P=k[V].apply(this,arguments);null!=P&&S.push(P)}b.sidebar.showEntries(0<S.length?+S.join(";"):"",y.checked);b.hideDialog()});D.className="geBtn gePrimaryBtn";f=document.createElement("div");f.style.marginTop="26px";f.style.textAlign="right"}b.editor.cancelFirst?(f.appendChild(p),f.appendChild(D)):(f.appendChild(D),f.appendChild(p));c.appendChild(f);this.container=c},PluginsDialog=function(b,e,f,c){function l(){D=!0;if(0==v.length)q.innerText=mxResources.get("noPlugins");else{q.innerText="";for(var k=0;k<v.length;k++){var m=document.createElement("span");m.style.display="flex";m.style.alignItems="center";m.style.whiteSpace="nowrap";var t=document.createElement("img");t.src=Editor.trashImage;t.style.position="relative";t.style.cursor="pointer";t.style.marginRight="4px";t.style.display="inline-block";t.style.width="18px";t.setAttribute("title",mxResources.get("delete"));m.appendChild(t);mxUtils.write(m,v[k]);q.appendChild(m);mxUtils.br(q);mxEvent.addListener(t,"click",function(y){return function(){b.confirm(mxResources.get("delete")+' "'+v[y]+'"?',function(){null!=f&&f(v[y]);-v.splice(y,1);l()})}}(k))}}}var p=document.createElement("div"),q=document.createElement("div");q.style.height="180px";q.style.overflow="auto";var v=mxSettings.getPlugins().slice(),E=!1;p.appendChild(q);l();E=!1;var G=mxUtils.button(mxResources.get("add"),null!=e?function(){e(function(k){k&&0>mxUtils.indexOf(v,k)&&v.push(k);l()})}:function(){var k=document.createElement("div"),m=document.createElement("span");m.style.marginTop="6px";mxUtils.write(m,mxResources.get("builtinPlugins")+": ");k.appendChild(m);-var t=document.createElement("select");t.style.width="150px";for(m=0;m<App.publicPlugin.length;m++){var y=document.createElement("option");mxUtils.write(y,App.publicPlugin[m]);y.value=App.publicPlugin[m];t.appendChild(y)}k.appendChild(t);mxUtils.br(k);mxUtils.br(k);m=mxUtils.button(mxResources.get("custom")+"...",function(){var A=new FilenameDialog(b,"",mxResources.get("add"),function(I){b.hideDialog();if(null!=I&&0<I.length){I=I.split(";");for(var F=0;F<I.length;F++){var C=I[F],Q=App.pluginRegistry[C];-null!=Q&&(C=Q);0<C.length&&0>mxUtils.indexOf(v,C)&&v.push(C)}l()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+")");b.showDialog(A.container,300,80,!0,!0);A.init()});m.className="geBtn";ALLOW_CUSTOM_PLUGINS||(m.style.display="none");k=new CustomDialog(b,k,mxUtils.bind(this,function(){var A=App.pluginRegistry[t.value];0>mxUtils.indexOf(v,A)&&(v.push(A),l())}),null,null,null,m);b.showDialog(k.container,360,100,!0,!0)});G.className="geBtn";var B=mxUtils.button(mxResources.get("cancel"),-function(){b.hideDialog()});B.className="geBtn";var d=mxUtils.button(c?mxResources.get("close"):mxResources.get("apply"),function(){E?(mxSettings.setPlugins(v),mxSettings.save(),b.hideDialog(),b.alert(mxResources.get("restartForChangeRequired"))):b.hideDialog()});d.className="geBtn gePrimaryBtn";var g=document.createElement("div");g.style.marginTop="14px";g.style.textAlign="right";b.isOffline()||g.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/plugins"));b.editor.cancelFirst?(c||g.appendChild(B),-g.appendChild(G),g.appendChild(d)):(g.appendChild(G),g.appendChild(d),c||g.appendChild(B));p.appendChild(g);this.container=p},CropImageDialog=function(b,e,f,c){function l(){var S=y.checked,V=A.checked,P=k.geometry,u=E.width,x=E.height,J=(300-u)/2,H=(300-x)/2;P.x<J?(P.width-=J-P.x,P.x=J):P.x+P.width>J+u&&(P.width=J+u-P.x,P.x=Math.min(P.x,J+u));P.y<H?(P.height-=H-P.y,P.y=H):P.y+P.height>H+x&&(P.height=H+x-P.y,P.y=Math.min(P.y,H+x));var K=(P.x-J)/u*100;u=100-(P.x+P.width-J)/u*100;J=(P.y-H)/x*100;P=100-+v.splice(y,1);l()})}}(k))}}}var p=document.createElement("div"),q=document.createElement("div");q.style.height="180px";q.style.overflow="auto";var v=mxSettings.getPlugins().slice(),D=!1;p.appendChild(q);l();D=!1;var G=mxUtils.button(mxResources.get("add"),null!=e?function(){e(function(k){k&&0>mxUtils.indexOf(v,k)&&v.push(k);l()})}:function(){var k=document.createElement("div"),m=document.createElement("span");m.style.marginTop="6px";mxUtils.write(m,mxResources.get("builtinPlugins")+": ");k.appendChild(m);+var t=document.createElement("select");t.style.width="150px";for(m=0;m<App.publicPlugin.length;m++){var y=document.createElement("option");mxUtils.write(y,App.publicPlugin[m]);y.value=App.publicPlugin[m];t.appendChild(y)}k.appendChild(t);mxUtils.br(k);mxUtils.br(k);m=mxUtils.button(mxResources.get("custom")+"...",function(){var z=new FilenameDialog(b,"",mxResources.get("add"),function(I){b.hideDialog();if(null!=I&&0<I.length){I=I.split(";");for(var F=0;F<I.length;F++){var C=I[F],Q=App.pluginRegistry[C];+null!=Q&&(C=Q);0<C.length&&0>mxUtils.indexOf(v,C)&&v.push(C)}l()}},mxResources.get("enterValue")+" ("+mxResources.get("url")+")");b.showDialog(z.container,300,80,!0,!0);z.init()});m.className="geBtn";ALLOW_CUSTOM_PLUGINS||(m.style.display="none");k=new CustomDialog(b,k,mxUtils.bind(this,function(){var z=App.pluginRegistry[t.value];0>mxUtils.indexOf(v,z)&&(v.push(z),l())}),null,null,null,m);b.showDialog(k.container,360,100,!0,!0)});G.className="geBtn";var B=mxUtils.button(mxResources.get("cancel"),+function(){b.hideDialog()});B.className="geBtn";var d=mxUtils.button(c?mxResources.get("close"):mxResources.get("apply"),function(){D?(mxSettings.setPlugins(v),mxSettings.save(),b.hideDialog(),b.alert(mxResources.get("restartForChangeRequired"))):b.hideDialog()});d.className="geBtn gePrimaryBtn";var g=document.createElement("div");g.style.marginTop="14px";g.style.textAlign="right";b.isOffline()||g.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/plugins"));b.editor.cancelFirst?(c||g.appendChild(B),+g.appendChild(G),g.appendChild(d)):(g.appendChild(G),g.appendChild(d),c||g.appendChild(B));p.appendChild(g);this.container=p},CropImageDialog=function(b,e,f,c){function l(){var S=y.checked,V=z.checked,P=k.geometry,u=D.width,x=D.height,J=(300-u)/2,H=(300-x)/2;P.x<J?(P.width-=J-P.x,P.x=J):P.x+P.width>J+u&&(P.width=J+u-P.x,P.x=Math.min(P.x,J+u));P.y<H?(P.height-=H-P.y,P.y=H):P.y+P.height>H+x&&(P.height=H+x-P.y,P.y=Math.min(P.y,H+x));var K=(P.x-J)/u*100;u=100-(P.x+P.width-J)/u*100;J=(P.y-H)/x*100;P=100-(P.y+P.height-H)/x*100;return"inset("+mxUtils.format(J)+"% "+mxUtils.format(u)+"% "+mxUtils.format(P)+"% "+mxUtils.format(K)+"%"+(S?" round "+g+"%":V?" round 50%":"")+")"}function p(S){null!=B&&(!0!==S&&(B.model.setGeometry(k,d.clone()),g=5,F.value=g),B.model.setStyle(k,m+l()),B.selectAll(),I.style.visibility=y.checked?"visible":"hidden")}var q=document.createElement("div"),v=document.createElement("div");v.style.height="300px";v.style.width="300px";v.style.display="inline-flex";v.style.justifyContent=-"center";v.style.alignItems="center";v.style.position="absolute";var E=document.createElement("img");E.onload=function(){function S(){B.model.setStyle(k,m+l())}B=new Graph(G);B.autoExtend=!1;B.autoScroll=!1;B.setGridEnabled(!1);B.setEnabled(!0);B.setPanning(!1);B.setConnectable(!1);B.getRubberband().setEnabled(!1);B.graphHandler.allowLivePreview=!1;var V=B.createVertexHandler;B.createVertexHandler=function(){var R=V.apply(this,arguments);R.livePreview=!1;return R};if(null!=f)try{if("inset"==f.substring(0,-5)){var P=k.geometry,u=E.width,x=E.height,J=(300-u)/2,H=(300-x)/2,K=f.match(/\(([^)]+)\)/)[1].split(/[ ,]+/),O=parseFloat(K[0]),M=parseFloat(K[1]),n=parseFloat(K[2]),z=parseFloat(K[3]);isFinite(O)&&isFinite(M)&&isFinite(n)&&isFinite(z)?(P.x=z/100*u+J,P.y=O/100*x+H,P.width=(100-M)/100*u+J-P.x,P.height=(100-n)/100*x+H-P.y,"round"==K[4]?"50%"==K[5]?A.setAttribute("checked","checked"):(g=parseInt(K[5]),F.value=g,y.setAttribute("checked","checked"),I.style.visibility="visible"):t.setAttribute("checked",-"checked")):f=null}else f=null}catch(R){}k.style=m+(f?f:l());k.vertex=!0;B.addCell(k,null,null,null,null);B.selectAll();B.addListener(mxEvent.CELLS_MOVED,S);B.addListener(mxEvent.CELLS_RESIZED,S);var D=B.graphHandler.mouseUp,L=B.graphHandler.mouseDown;B.graphHandler.mouseUp=function(){D.apply(this,arguments);G.style.backgroundColor="#fff9"};B.graphHandler.mouseDown=function(){L.apply(this,arguments);G.style.backgroundColor=""};B.dblClick=function(){};var N=B.getSelectionModel().changeSelection;B.getSelectionModel().changeSelection=-function(){N.call(this,[k],[k])}};E.onerror=function(){E.onload=null;E.src=Editor.errorImage};E.setAttribute("src",e);E.style.maxWidth="300px";E.style.maxHeight="300px";v.appendChild(E);q.appendChild(v);var G=document.createElement("div");G.style.width="300px";G.style.height="300px";G.style.overflow="hidden";G.style.backgroundColor="#fff9";q.appendChild(G);var B=null,d=new mxGeometry(100,100,100,100),g=5,k=new mxCell("",d.clone(),""),m="shape=image;fillColor=none;rotatable=0;cloneable=0;deletable=0;image="++"center";v.style.alignItems="center";v.style.position="absolute";var D=document.createElement("img");D.onload=function(){function S(){B.model.setStyle(k,m+l())}B=new Graph(G);B.autoExtend=!1;B.autoScroll=!1;B.setGridEnabled(!1);B.setEnabled(!0);B.setPanning(!1);B.setConnectable(!1);B.getRubberband().setEnabled(!1);B.graphHandler.allowLivePreview=!1;var V=B.createVertexHandler;B.createVertexHandler=function(){var R=V.apply(this,arguments);R.livePreview=!1;return R};if(null!=f)try{if("inset"==f.substring(0,+5)){var P=k.geometry,u=D.width,x=D.height,J=(300-u)/2,H=(300-x)/2,K=f.match(/\(([^)]+)\)/)[1].split(/[ ,]+/),N=parseFloat(K[0]),M=parseFloat(K[1]),n=parseFloat(K[2]),A=parseFloat(K[3]);isFinite(N)&&isFinite(M)&&isFinite(n)&&isFinite(A)?(P.x=A/100*u+J,P.y=N/100*x+H,P.width=(100-M)/100*u+J-P.x,P.height=(100-n)/100*x+H-P.y,"round"==K[4]?"50%"==K[5]?z.setAttribute("checked","checked"):(g=parseInt(K[5]),F.value=g,y.setAttribute("checked","checked"),I.style.visibility="visible"):t.setAttribute("checked",+"checked")):f=null}else f=null}catch(R){}k.style=m+(f?f:l());k.vertex=!0;B.addCell(k,null,null,null,null);B.selectAll();B.addListener(mxEvent.CELLS_MOVED,S);B.addListener(mxEvent.CELLS_RESIZED,S);var E=B.graphHandler.mouseUp,L=B.graphHandler.mouseDown;B.graphHandler.mouseUp=function(){E.apply(this,arguments);G.style.backgroundColor="#fff9"};B.graphHandler.mouseDown=function(){L.apply(this,arguments);G.style.backgroundColor=""};B.dblClick=function(){};var O=B.getSelectionModel().changeSelection;B.getSelectionModel().changeSelection=+function(){O.call(this,[k],[k])}};D.onerror=function(){D.onload=null;D.src=Editor.errorImage};D.setAttribute("src",e);D.style.maxWidth="300px";D.style.maxHeight="300px";v.appendChild(D);q.appendChild(v);var G=document.createElement("div");G.style.width="300px";G.style.height="300px";G.style.overflow="hidden";G.style.backgroundColor="#fff9";q.appendChild(G);var B=null,d=new mxGeometry(100,100,100,100),g=5,k=new mxCell("",d.clone(),""),m="shape=image;fillColor=none;rotatable=0;cloneable=0;deletable=0;image="+e.replace(";base64","")+";clipPath=",t=document.createElement("input");t.setAttribute("type","radio");t.setAttribute("id","croppingRect");t.setAttribute("name","croppingShape");t.setAttribute("checked","checked");t.style.margin="5px";q.appendChild(t);e=document.createElement("label");e.setAttribute("for","croppingRect");mxUtils.write(e,mxResources.get("rectangle"));q.appendChild(e);var y=document.createElement("input");y.setAttribute("type","radio");y.setAttribute("id","croppingRounded");y.setAttribute("name",-"croppingShape");y.style.margin="5px";q.appendChild(y);e=document.createElement("label");e.setAttribute("for","croppingRounded");mxUtils.write(e,mxResources.get("rounded"));q.appendChild(e);var A=document.createElement("input");A.setAttribute("type","radio");A.setAttribute("id","croppingEllipse");A.setAttribute("name","croppingShape");A.style.margin="5px";q.appendChild(A);e=document.createElement("label");e.setAttribute("for","croppingEllipse");mxUtils.write(e,mxResources.get("ellipse"));q.appendChild(e);-mxEvent.addListener(t,"change",p);mxEvent.addListener(y,"change",p);mxEvent.addListener(A,"change",p);var I=document.createElement("div");I.style.textAlign="center";I.style.visibility="hidden";var F=document.createElement("input");F.setAttribute("type","range");F.setAttribute("min","1");F.setAttribute("max","49");F.setAttribute("value",g);F.setAttribute("title",mxResources.get("arcSize"));I.appendChild(F);q.appendChild(I);mxEvent.addListener(F,"change",function(){g=this.value;p(!0)});e=mxUtils.button(mxResources.get("cancel"),-function(){b.hideDialog()});e.className="geBtn";v=mxUtils.button(mxResources.get("apply"),function(){c(l(),k.geometry.width,k.geometry.height);b.hideDialog()});v.className="geBtn gePrimaryBtn";var C=mxUtils.button(mxResources.get("reset"),function(){c(null,E.width,E.height);b.hideDialog()});C.className="geBtn";var Q=document.createElement("div");Q.style.marginTop="10px";Q.style.textAlign="right";b.editor.cancelFirst?(Q.appendChild(e),Q.appendChild(C),Q.appendChild(v)):(Q.appendChild(C),Q.appendChild(v),-Q.appendChild(e));q.appendChild(Q);this.container=q},EditGeometryDialog=function(b,e){var f=b.editor.graph,c=1==e.length?f.getCellGeometry(e[0]):null,l=document.createElement("div"),p=document.createElement("table"),q=document.createElement("tbody"),v=document.createElement("tr"),E=document.createElement("td"),G=document.createElement("td");p.style.paddingLeft="6px";mxUtils.write(E,mxResources.get("relative")+":");var B=document.createElement("input");B.setAttribute("type","checkbox");null!=c&&c.relative&&-(B.setAttribute("checked","checked"),B.defaultChecked=!0);this.init=function(){B.focus()};G.appendChild(B);v.appendChild(E);v.appendChild(G);q.appendChild(v);v=document.createElement("tr");E=document.createElement("td");G=document.createElement("td");mxUtils.write(E,mxResources.get("left")+":");var d=document.createElement("input");d.setAttribute("type","text");d.style.width="100px";d.value=null!=c?c.x:"";G.appendChild(d);v.appendChild(E);v.appendChild(G);q.appendChild(v);v=document.createElement("tr");-E=document.createElement("td");G=document.createElement("td");mxUtils.write(E,mxResources.get("top")+":");var g=document.createElement("input");g.setAttribute("type","text");g.style.width="100px";g.value=null!=c?c.y:"";G.appendChild(g);v.appendChild(E);v.appendChild(G);q.appendChild(v);v=document.createElement("tr");E=document.createElement("td");G=document.createElement("td");mxUtils.write(E,mxResources.get("dx")+":");var k=document.createElement("input");k.setAttribute("type","text");k.style.width=-"100px";k.value=null!=c&&null!=c.offset?c.offset.x:"";G.appendChild(k);v.appendChild(E);v.appendChild(G);q.appendChild(v);v=document.createElement("tr");E=document.createElement("td");G=document.createElement("td");mxUtils.write(E,mxResources.get("dy")+":");var m=document.createElement("input");m.setAttribute("type","text");m.style.width="100px";m.value=null!=c&&null!=c.offset?c.offset.y:"";G.appendChild(m);v.appendChild(E);v.appendChild(G);q.appendChild(v);v=document.createElement("tr");E=document.createElement("td");-G=document.createElement("td");mxUtils.write(E,mxResources.get("width")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value=null!=c?c.width:"";G.appendChild(t);v.appendChild(E);v.appendChild(G);q.appendChild(v);v=document.createElement("tr");E=document.createElement("td");G=document.createElement("td");mxUtils.write(E,mxResources.get("height")+":");var y=document.createElement("input");y.setAttribute("type","text");y.style.width="100px";y.value=null!=-c?c.height:"";G.appendChild(y);v.appendChild(E);v.appendChild(G);q.appendChild(v);v=document.createElement("tr");E=document.createElement("td");G=document.createElement("td");mxUtils.write(E,mxResources.get("rotation")+":");var A=document.createElement("input");A.setAttribute("type","text");A.style.width="100px";A.value=1==e.length?mxUtils.getValue(f.getCellStyle(e[0]),mxConstants.STYLE_ROTATION,0):"";G.appendChild(A);v.appendChild(E);v.appendChild(G);q.appendChild(v);p.appendChild(q);l.appendChild(p);+"croppingShape");y.style.margin="5px";q.appendChild(y);e=document.createElement("label");e.setAttribute("for","croppingRounded");mxUtils.write(e,mxResources.get("rounded"));q.appendChild(e);var z=document.createElement("input");z.setAttribute("type","radio");z.setAttribute("id","croppingEllipse");z.setAttribute("name","croppingShape");z.style.margin="5px";q.appendChild(z);e=document.createElement("label");e.setAttribute("for","croppingEllipse");mxUtils.write(e,mxResources.get("ellipse"));q.appendChild(e);+mxEvent.addListener(t,"change",p);mxEvent.addListener(y,"change",p);mxEvent.addListener(z,"change",p);var I=document.createElement("div");I.style.textAlign="center";I.style.visibility="hidden";var F=document.createElement("input");F.setAttribute("type","range");F.setAttribute("min","1");F.setAttribute("max","49");F.setAttribute("value",g);F.setAttribute("title",mxResources.get("arcSize"));I.appendChild(F);q.appendChild(I);mxEvent.addListener(F,"change",function(){g=this.value;p(!0)});e=mxUtils.button(mxResources.get("cancel"),+function(){b.hideDialog()});e.className="geBtn";v=mxUtils.button(mxResources.get("apply"),function(){c(l(),k.geometry.width,k.geometry.height);b.hideDialog()});v.className="geBtn gePrimaryBtn";var C=mxUtils.button(mxResources.get("reset"),function(){c(null,D.width,D.height);b.hideDialog()});C.className="geBtn";var Q=document.createElement("div");Q.style.marginTop="10px";Q.style.textAlign="right";b.editor.cancelFirst?(Q.appendChild(e),Q.appendChild(C),Q.appendChild(v)):(Q.appendChild(C),Q.appendChild(v),+Q.appendChild(e));q.appendChild(Q);this.container=q},EditGeometryDialog=function(b,e){var f=b.editor.graph,c=1==e.length?f.getCellGeometry(e[0]):null,l=document.createElement("div"),p=document.createElement("table"),q=document.createElement("tbody"),v=document.createElement("tr"),D=document.createElement("td"),G=document.createElement("td");p.style.paddingLeft="6px";mxUtils.write(D,mxResources.get("relative")+":");var B=document.createElement("input");B.setAttribute("type","checkbox");null!=c&&c.relative&&+(B.setAttribute("checked","checked"),B.defaultChecked=!0);this.init=function(){B.focus()};G.appendChild(B);v.appendChild(D);v.appendChild(G);q.appendChild(v);v=document.createElement("tr");D=document.createElement("td");G=document.createElement("td");mxUtils.write(D,mxResources.get("left")+":");var d=document.createElement("input");d.setAttribute("type","text");d.style.width="100px";d.value=null!=c?c.x:"";G.appendChild(d);v.appendChild(D);v.appendChild(G);q.appendChild(v);v=document.createElement("tr");+D=document.createElement("td");G=document.createElement("td");mxUtils.write(D,mxResources.get("top")+":");var g=document.createElement("input");g.setAttribute("type","text");g.style.width="100px";g.value=null!=c?c.y:"";G.appendChild(g);v.appendChild(D);v.appendChild(G);q.appendChild(v);v=document.createElement("tr");D=document.createElement("td");G=document.createElement("td");mxUtils.write(D,mxResources.get("dx")+":");var k=document.createElement("input");k.setAttribute("type","text");k.style.width=+"100px";k.value=null!=c&&null!=c.offset?c.offset.x:"";G.appendChild(k);v.appendChild(D);v.appendChild(G);q.appendChild(v);v=document.createElement("tr");D=document.createElement("td");G=document.createElement("td");mxUtils.write(D,mxResources.get("dy")+":");var m=document.createElement("input");m.setAttribute("type","text");m.style.width="100px";m.value=null!=c&&null!=c.offset?c.offset.y:"";G.appendChild(m);v.appendChild(D);v.appendChild(G);q.appendChild(v);v=document.createElement("tr");D=document.createElement("td");+G=document.createElement("td");mxUtils.write(D,mxResources.get("width")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value=null!=c?c.width:"";G.appendChild(t);v.appendChild(D);v.appendChild(G);q.appendChild(v);v=document.createElement("tr");D=document.createElement("td");G=document.createElement("td");mxUtils.write(D,mxResources.get("height")+":");var y=document.createElement("input");y.setAttribute("type","text");y.style.width="100px";y.value=null!=+c?c.height:"";G.appendChild(y);v.appendChild(D);v.appendChild(G);q.appendChild(v);v=document.createElement("tr");D=document.createElement("td");G=document.createElement("td");mxUtils.write(D,mxResources.get("rotation")+":");var z=document.createElement("input");z.setAttribute("type","text");z.style.width="100px";z.value=1==e.length?mxUtils.getValue(f.getCellStyle(e[0]),mxConstants.STYLE_ROTATION,0):"";G.appendChild(z);v.appendChild(D);v.appendChild(G);q.appendChild(v);p.appendChild(q);l.appendChild(p);c=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});c.className="geBtn";var I=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();f.getModel().beginUpdate();try{for(var F=0;F<e.length;F++){var C=f.getCellGeometry(e[F]);null!=C&&(C=C.clone(),f.isCellMovable(e[F])&&(C.relative=B.checked,0<mxUtils.trim(d.value).length&&(C.x=Number(d.value)),0<mxUtils.trim(g.value).length&&(C.y=Number(g.value)),0<mxUtils.trim(k.value).length&&(null==C.offset&&(C.offset=new mxPoint),C.offset.x=-Number(k.value)),0<mxUtils.trim(m.value).length&&(null==C.offset&&(C.offset=new mxPoint),C.offset.y=Number(m.value))),f.isCellResizable(e[F])&&(0<mxUtils.trim(t.value).length&&(C.width=Number(t.value)),0<mxUtils.trim(y.value).length&&(C.height=Number(y.value))),f.getModel().setGeometry(e[F],C));0<mxUtils.trim(A.value).length&&f.setCellStyles(mxConstants.STYLE_ROTATION,Number(A.value),[e[F]])}}finally{f.getModel().endUpdate()}});I.className="geBtn gePrimaryBtn";mxEvent.addListener(l,"keypress",function(F){13==-F.keyCode&&I.click()});p=document.createElement("div");p.style.marginTop="20px";p.style.textAlign="right";b.editor.cancelFirst?(p.appendChild(c),p.appendChild(I)):(p.appendChild(I),p.appendChild(c));l.appendChild(p);this.container=l},LibraryDialog=function(b,e,f,c,l,p,q){function v(P){for(P=document.elementFromPoint(P.clientX,P.clientY);null!=P&&P.parentNode!=m;)P=P.parentNode;var u=null;if(null!=P){var x=m.firstChild;for(u=0;null!=x&&x!=P;)x=x.nextSibling,u++}return u}function E(P,u,x,J,H,K,O,M,-n){try{if(b.spinner.stop(),null==u||"image/"==u.substring(0,6))if(null==P&&null!=O||null==y[P]){var z=function(){X.innerText="";X.style.cursor="pointer";X.style.whiteSpace="nowrap";X.style.textOverflow="ellipsis";mxUtils.write(X,null!=Y.title&&0<Y.title.length?Y.title:mxResources.get("untitled"));X.style.color=null==Y.title||0==Y.title.length?"#d0d0d0":""};m.style.backgroundImage="";t.style.display="none";var D=H,L=K;if(H>b.maxImageSize||K>b.maxImageSize){var N=Math.min(1,Math.min(b.maxImageSize/-Math.max(1,H)),b.maxImageSize/Math.max(1,K));H*=N;K*=N}D>L?(L=Math.round(100*L/D),D=100):(D=Math.round(100*D/L),L=100);var R=document.createElement("div");R.setAttribute("draggable","true");R.style.display="inline-block";R.style.position="relative";R.style.padding="0 12px";R.style.cursor="move";mxUtils.setPrefixedStyle(R.style,"transition","transform .1s ease-in-out");if(null!=P){var T=document.createElement("img");T.setAttribute("src",C.convert(P));T.style.width=D+"px";T.style.height=L+"px";T.style.margin=-"10px";T.style.paddingBottom=Math.floor((100-L)/2)+"px";T.style.paddingLeft=Math.floor((100-D)/2)+"px";R.appendChild(T)}else if(null!=O){var U=b.stringToCells("<"==O.xml.charAt(0)?O.xml:Graph.decompress(O.xml));0<U.length&&(b.sidebar.createThumb(U,100,100,R,null,!0,!1,null,null,Editor.isDarkMode()?"#2a252f":"#ffffff"),R.firstChild.style.display="inline-block",R.firstChild.style.cursor="")}var W=document.createElement("img");W.setAttribute("src",Editor.closeBlackImage);W.setAttribute("border","0");-W.setAttribute("title",mxResources.get("delete"));W.setAttribute("align","top");W.style.paddingTop="4px";W.style.position="absolute";W.style.marginLeft="-12px";W.style.zIndex="1";W.style.cursor="pointer";mxEvent.addListener(W,"dragstart",function(ba){mxEvent.consume(ba)});(function(ba,fa,aa){mxEvent.addListener(W,"click",function(ia){y[fa]=null;for(var ha=0;ha<d.length;ha++)if(null!=d[ha].data&&d[ha].data==fa||null!=d[ha].xml&&null!=aa&&d[ha].xml==aa.xml){d.splice(ha,1);break}R.parentNode.removeChild(ba);-0==d.length&&(m.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",t.style.display="");mxEvent.consume(ia)});mxEvent.addListener(W,"dblclick",function(ia){mxEvent.consume(ia)})})(R,P,O);R.appendChild(W);R.style.marginBottom="30px";var X=document.createElement("div");X.style.position="absolute";X.style.boxSizing="border-box";X.style.bottom="-18px";X.style.left="10px";X.style.right="10px";X.style.backgroundColor="light-dark(#ffffff, transparent)";X.style.overflow="hidden";X.style.textAlign=-"center";X.setAttribute("title",mxResources.get("rename"));var Y=null;null!=P?(Y={data:P,w:H,h:K,title:n},null!=M&&(Y.aspect=M),y[P]=T,d.push(Y)):null!=O&&(O.aspect="fixed",d.push(O),Y=O);mxEvent.addListener(X,"keydown",function(ba){13==ba.keyCode&&null!=F&&(F(),F=null,mxEvent.consume(ba))});z();R.appendChild(X);mxEvent.addListener(X,"mousedown",function(ba){"true"!=X.getAttribute("contentEditable")&&mxEvent.consume(ba)});U=function(ba){if(mxClient.IS_IOS||mxClient.IS_FF||!(null==document.documentMode||-9<document.documentMode)){var fa=new FilenameDialog(b,Y.title||"",mxResources.get("ok"),function(aa){null!=aa&&(Y.title=aa,z())},mxResources.get("enterValue"));b.showDialog(fa.container,300,80,!0,!0);fa.init();mxEvent.consume(ba)}else if("true"!=X.getAttribute("contentEditable")){null!=F&&(F(),F=null);if(null==Y.title||0==Y.title.length)X.innerText="";X.style.textOverflow="";X.style.whiteSpace="";X.style.cursor="text";X.style.color="";X.setAttribute("contentEditable","true");mxUtils.setPrefixedStyle(X.style,-"user-select","text");X.focus();document.execCommand("selectAll",!1,null);F=function(){X.removeAttribute("contentEditable");X.style.cursor="pointer";Y.title=mxUtils.getTextContent(X);z()};mxEvent.consume(ba)}};mxEvent.addListener(X,"click",U);mxEvent.addListener(R,"dblclick",U);m.appendChild(R);mxEvent.addListener(R,"dragstart",function(ba){null==F&&(null==P&&null!=O&&(W.style.visibility="hidden",X.style.visibility="hidden"),mxClient.IS_FF&&null!=O.xml&&ba.dataTransfer.setData("Text",O.xml),A=v(ba),-mxClient.IS_GC&&(R.style.opacity="0.9"),window.setTimeout(function(){mxUtils.setPrefixedStyle(R.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(R,30);W.style.visibility="";X.style.visibility=""},0))});mxEvent.addListener(R,"dragend",function(ba){"hidden"==W.style.visibility&&(W.style.visibility="",X.style.visibility="");A=null;mxUtils.setOpacity(R,100);mxUtils.setPrefixedStyle(R.style,"transform",null)})}else Q||(Q=!0,b.handleError({message:mxResources.get("fileExists")}));else{H=!1;try{if(D=-mxUtils.parseXml(P),"mxlibrary"==D.documentElement.nodeName){L=JSON.parse(mxUtils.getTextContent(D.documentElement));if(null!=L&&0<L.length)for(var Z=0;Z<L.length;Z++)null!=L[Z].xml?E(null,null,0,0,0,0,L[Z]):E(L[Z].data,null,0,0,L[Z].w,L[Z].h,null,"fixed",L[Z].title);H=!0}else if("mxfile"==D.documentElement.nodeName){var ca=D.documentElement.getElementsByTagName("diagram");for(Z=0;Z<ca.length;Z++){var ea=Editor.getDiagramNodeXml(ca[Z]);U=b.stringToCells(ea);if(0<U.length){var ja=b.editor.graph.getBoundingBoxFromGeometry(U);-null!=ja&&E(null,null,0,0,0,0,{xml:ea,w:ja.width,h:ja.height})}}H=!0}}catch(ba){null!=window.console&&console.error("Error in library dialog: "+ba)}H||(b.spinner.stop(),b.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(ba){null!=window.console&&console.log("Error in library dialog: "+ba)}return null}function G(P){P.dataTransfer.dropEffect=null!=A?"move":"copy";P.stopPropagation();P.preventDefault()}function B(P){P.stopPropagation();P.preventDefault();Q=!1;I=v(P);if(null!=A)null!=-I&&I<m.children.length?(d.splice(I>A?I-1:I,0,d.splice(A,1)[0]),m.insertBefore(m.children[A],m.children[I])):(d.push(d.splice(A,1)[0]),m.appendChild(m.children[A]));else if(0<P.dataTransfer.files.length)b.importFiles(P.dataTransfer.files,0,0,b.maxImageSize,S(P));else if(0<=mxUtils.indexOf(P.dataTransfer.types,"text/uri-list")){var u=decodeURIComponent(P.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(u)||/(\.png)($|\?)/i.test(u)||/(\.gif)($|\?)/i.test(u)||/(\.svg)($|\?)/i.test(u))&&b.loadImage(u,-function(x){E(u,null,0,0,x.width,x.height);m.scrollTop=m.scrollHeight})}P.stopPropagation();P.preventDefault()}var d=[];f=document.createElement("div");f.style.height="100%";var g=document.createElement("div");g.style.whiteSpace="nowrap";g.style.height="40px";f.appendChild(g);mxUtils.write(g,mxResources.get("filename")+":");null==e&&(e=b.defaultLibraryName+".xml");var k=document.createElement("input");k.setAttribute("value",e);k.style.marginRight="20px";k.style.marginLeft="10px";k.style.width="500px";+Number(k.value)),0<mxUtils.trim(m.value).length&&(null==C.offset&&(C.offset=new mxPoint),C.offset.y=Number(m.value))),f.isCellResizable(e[F])&&(0<mxUtils.trim(t.value).length&&(C.width=Number(t.value)),0<mxUtils.trim(y.value).length&&(C.height=Number(y.value))),f.getModel().setGeometry(e[F],C));0<mxUtils.trim(z.value).length&&f.setCellStyles(mxConstants.STYLE_ROTATION,Number(z.value),[e[F]])}}finally{f.getModel().endUpdate()}});I.className="geBtn gePrimaryBtn";mxEvent.addListener(l,"keypress",function(F){13==+F.keyCode&&I.click()});p=document.createElement("div");p.style.marginTop="20px";p.style.textAlign="right";b.editor.cancelFirst?(p.appendChild(c),p.appendChild(I)):(p.appendChild(I),p.appendChild(c));l.appendChild(p);this.container=l},LibraryDialog=function(b,e,f,c,l,p,q){function v(P){for(P=document.elementFromPoint(P.clientX,P.clientY);null!=P&&P.parentNode!=m;)P=P.parentNode;var u=null;if(null!=P){var x=m.firstChild;for(u=0;null!=x&&x!=P;)x=x.nextSibling,u++}return u}function D(P,u,x,J,H,K,N,M,+n){try{if(b.spinner.stop(),null==u||"image/"==u.substring(0,6))if(null==P&&null!=N||null==y[P]){var A=function(){X.innerText="";X.style.cursor="pointer";X.style.whiteSpace="nowrap";X.style.textOverflow="ellipsis";mxUtils.write(X,null!=Y.title&&0<Y.title.length?Y.title:mxResources.get("untitled"));X.style.color=null==Y.title||0==Y.title.length?"#d0d0d0":""};m.style.backgroundImage="";t.style.display="none";var E=H,L=K;if(H>b.maxImageSize||K>b.maxImageSize){var O=Math.min(1,Math.min(b.maxImageSize/+Math.max(1,H)),b.maxImageSize/Math.max(1,K));H*=O;K*=O}E>L?(L=Math.round(100*L/E),E=100):(E=Math.round(100*E/L),L=100);var R=document.createElement("div");R.setAttribute("draggable","true");R.style.display="inline-block";R.style.position="relative";R.style.padding="0 12px";R.style.cursor="move";mxUtils.setPrefixedStyle(R.style,"transition","transform .1s ease-in-out");if(null!=P){var T=document.createElement("img");T.setAttribute("src",C.convert(P));T.style.width=E+"px";T.style.height=L+"px";T.style.margin=+"10px";T.style.paddingBottom=Math.floor((100-L)/2)+"px";T.style.paddingLeft=Math.floor((100-E)/2)+"px";R.appendChild(T)}else if(null!=N){var U=b.stringToCells("<"==N.xml.charAt(0)?N.xml:Graph.decompress(N.xml));0<U.length&&(b.sidebar.createThumb(U,100,100,R,null,!0,!1,null,null,Editor.isDarkMode()?"#2a252f":"#ffffff"),R.firstChild.style.display="inline-block",R.firstChild.style.cursor="")}var W=document.createElement("img");W.setAttribute("src",Editor.closeBlackImage);W.setAttribute("border","0");+W.setAttribute("title",mxResources.get("delete"));W.setAttribute("align","top");W.style.paddingTop="4px";W.style.position="absolute";W.style.marginLeft="-12px";W.style.zIndex="1";W.style.cursor="pointer";mxEvent.addListener(W,"dragstart",function(ba){mxEvent.consume(ba)});(function(ba,fa,aa){mxEvent.addListener(W,"click",function(ja){y[fa]=null;for(var ha=0;ha<d.length;ha++)if(null!=d[ha].data&&d[ha].data==fa||null!=d[ha].xml&&null!=aa&&d[ha].xml==aa.xml){d.splice(ha,1);break}R.parentNode.removeChild(ba);+0==d.length&&(m.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",t.style.display="");mxEvent.consume(ja)});mxEvent.addListener(W,"dblclick",function(ja){mxEvent.consume(ja)})})(R,P,N);R.appendChild(W);R.style.marginBottom="30px";var X=document.createElement("div");X.style.position="absolute";X.style.boxSizing="border-box";X.style.bottom="-18px";X.style.left="10px";X.style.right="10px";X.style.backgroundColor="light-dark(#ffffff, transparent)";X.style.overflow="hidden";X.style.textAlign=+"center";X.setAttribute("title",mxResources.get("rename"));var Y=null;null!=P?(Y={data:P,w:H,h:K,title:n},null!=M&&(Y.aspect=M),y[P]=T,d.push(Y)):null!=N&&(N.aspect="fixed",d.push(N),Y=N);mxEvent.addListener(X,"keydown",function(ba){13==ba.keyCode&&null!=F&&(F(),F=null,mxEvent.consume(ba))});A();R.appendChild(X);mxEvent.addListener(X,"mousedown",function(ba){"true"!=X.getAttribute("contentEditable")&&mxEvent.consume(ba)});U=function(ba){if(mxClient.IS_IOS||mxClient.IS_FF||!(null==document.documentMode||+9<document.documentMode)){var fa=new FilenameDialog(b,Y.title||"",mxResources.get("ok"),function(aa){null!=aa&&(Y.title=aa,A())},mxResources.get("enterValue"));b.showDialog(fa.container,300,80,!0,!0);fa.init();mxEvent.consume(ba)}else if("true"!=X.getAttribute("contentEditable")){null!=F&&(F(),F=null);if(null==Y.title||0==Y.title.length)X.innerText="";X.style.textOverflow="";X.style.whiteSpace="";X.style.cursor="text";X.style.color="";X.setAttribute("contentEditable","true");mxUtils.setPrefixedStyle(X.style,+"user-select","text");X.focus();document.execCommand("selectAll",!1,null);F=function(){X.removeAttribute("contentEditable");X.style.cursor="pointer";Y.title=mxUtils.getTextContent(X);A()};mxEvent.consume(ba)}};mxEvent.addListener(X,"click",U);mxEvent.addListener(R,"dblclick",U);m.appendChild(R);mxEvent.addListener(R,"dragstart",function(ba){null==F&&(null==P&&null!=N&&(W.style.visibility="hidden",X.style.visibility="hidden"),mxClient.IS_FF&&null!=N.xml&&ba.dataTransfer.setData("Text",N.xml),z=v(ba),+mxClient.IS_GC&&(R.style.opacity="0.9"),window.setTimeout(function(){mxUtils.setPrefixedStyle(R.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(R,30);W.style.visibility="";X.style.visibility=""},0))});mxEvent.addListener(R,"dragend",function(ba){"hidden"==W.style.visibility&&(W.style.visibility="",X.style.visibility="");z=null;mxUtils.setOpacity(R,100);mxUtils.setPrefixedStyle(R.style,"transform",null)})}else Q||(Q=!0,b.handleError({message:mxResources.get("fileExists")}));else{H=!1;try{if(E=+mxUtils.parseXml(P),"mxlibrary"==E.documentElement.nodeName){L=JSON.parse(mxUtils.getTextContent(E.documentElement));if(null!=L&&0<L.length)for(var Z=0;Z<L.length;Z++)null!=L[Z].xml?D(null,null,0,0,0,0,L[Z]):D(L[Z].data,null,0,0,L[Z].w,L[Z].h,null,"fixed",L[Z].title);H=!0}else if("mxfile"==E.documentElement.nodeName){var ca=E.documentElement.getElementsByTagName("diagram");for(Z=0;Z<ca.length;Z++){var ea=Editor.getDiagramNodeXml(ca[Z]);U=b.stringToCells(ea);if(0<U.length){var ia=b.editor.graph.getBoundingBoxFromGeometry(U);+null!=ia&&D(null,null,0,0,0,0,{xml:ea,w:ia.width,h:ia.height})}}H=!0}}catch(ba){null!=window.console&&console.error("Error in library dialog: "+ba)}H||(b.spinner.stop(),b.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(ba){null!=window.console&&console.log("Error in library dialog: "+ba)}return null}function G(P){P.dataTransfer.dropEffect=null!=z?"move":"copy";P.stopPropagation();P.preventDefault()}function B(P){P.stopPropagation();P.preventDefault();Q=!1;I=v(P);if(null!=z)null!=+I&&I<m.children.length?(d.splice(I>z?I-1:I,0,d.splice(z,1)[0]),m.insertBefore(m.children[z],m.children[I])):(d.push(d.splice(z,1)[0]),m.appendChild(m.children[z]));else if(0<P.dataTransfer.files.length)b.importFiles(P.dataTransfer.files,0,0,b.maxImageSize,S(P));else if(0<=mxUtils.indexOf(P.dataTransfer.types,"text/uri-list")){var u=decodeURIComponent(P.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(u)||/(\.png)($|\?)/i.test(u)||/(\.gif)($|\?)/i.test(u)||/(\.svg)($|\?)/i.test(u))&&b.loadImage(u,+function(x){D(u,null,0,0,x.width,x.height);m.scrollTop=m.scrollHeight})}P.stopPropagation();P.preventDefault()}var d=[];f=document.createElement("div");f.style.height="100%";var g=document.createElement("div");g.style.whiteSpace="nowrap";g.style.height="40px";f.appendChild(g);mxUtils.write(g,mxResources.get("filename")+":");null==e&&(e=b.defaultLibraryName+".xml");var k=document.createElement("input");k.setAttribute("value",e);k.style.marginRight="20px";k.style.marginLeft="10px";k.style.width="500px";null==l||l.isRenamable()||k.setAttribute("disabled","true");this.init=function(){if(null==l||l.isRenamable())k.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?k.select():document.execCommand("selectAll",!1,null)};g.appendChild(k);Editor.enableUncompressedLibraries&&(k.style.width="420px",e=document.createElement("input"),e.setAttribute("type","checkbox"),e.style.marginRight="10px",g.appendChild(e),mxUtils.write(g,mxResources.get("compressed")));var m=document.createElement("div");m.style.borderWidth="1px 0px 1px 0px";m.style.borderColor="#d3d3d3";m.style.borderStyle="solid";m.style.marginTop="6px";m.style.overflow="auto";m.style.height="340px";m.style.backgroundPosition="center center";m.style.backgroundRepeat="no-repeat";0==d.length&&Graph.fileSupport&&(m.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var t=document.createElement("div");t.style.position="absolute";t.style.width="640px";t.style.top="260px";t.style.textAlign="center";t.style.fontSize="22px";-t.style.color="#a0c3ff";mxUtils.write(t,mxResources.get("dragImagesHere"));f.appendChild(t);var y={},A=null,I=null,F=null;g=function(P){"true"!=mxEvent.getSource(P).getAttribute("contentEditable")&&null!=F&&(F(),F=null,mxEvent.consume(P))};mxEvent.addListener(m,"mousedown",g);mxEvent.addListener(m,"pointerdown",g);mxEvent.addListener(m,"touchstart",g);var C=new mxUrlConverter,Q=!1;if(null!=c)for(g=0;g<c.length;g++)e=c[g],E(e.data,null,0,0,e.w,e.h,e,e.aspect,e.title);mxEvent.addListener(m,"dragleave",-function(P){t.style.cursor="";for(var u=mxEvent.getSource(P);null!=u;){if(u==m||u==t){P.stopPropagation();P.preventDefault();break}u=u.parentNode}});var S=function(P){return function(u,x,J,H,K,O,M,n,z){null!=z&&EditorUi.isVisioFilename(z.name)?b.importVisio(z,mxUtils.bind(this,function(D){E(D,x,J,H,K,O,M,"fixed",mxEvent.isAltDown(P)?null:M.substring(0,M.lastIndexOf(".")).replace(/_/g," "))})):null!=z&&(new XMLHttpRequest).upload&&b.isRemoteFileFormat(u,z.name)?b.isExternalDataComms()?b.parseFile(z,-mxUtils.bind(this,function(D){4==D.readyState&&(b.spinner.stop(),200<=D.status&&299>=D.status&&(E(D.responseText,x,J,H,K,O,M,"fixed",mxEvent.isAltDown(P)?null:M.substring(0,M.lastIndexOf(".")).replace(/_/g," ")),m.scrollTop=m.scrollHeight))})):(b.spinner.stop(),b.showError(mxResources.get("error"),mxResources.get("notInOffline"))):(E(u,x,J,H,K,O,M,"fixed",mxEvent.isAltDown(P)?null:M.substring(0,M.lastIndexOf(".")).replace(/_/g," ")),m.scrollTop=m.scrollHeight)}};mxEvent.addListener(m,"dragover",G);+t.style.color="#a0c3ff";mxUtils.write(t,mxResources.get("dragImagesHere"));f.appendChild(t);var y={},z=null,I=null,F=null;g=function(P){"true"!=mxEvent.getSource(P).getAttribute("contentEditable")&&null!=F&&(F(),F=null,mxEvent.consume(P))};mxEvent.addListener(m,"mousedown",g);mxEvent.addListener(m,"pointerdown",g);mxEvent.addListener(m,"touchstart",g);var C=new mxUrlConverter,Q=!1;if(null!=c)for(g=0;g<c.length;g++)e=c[g],D(e.data,null,0,0,e.w,e.h,e,e.aspect,e.title);mxEvent.addListener(m,"dragleave",+function(P){t.style.cursor="";for(var u=mxEvent.getSource(P);null!=u;){if(u==m||u==t){P.stopPropagation();P.preventDefault();break}u=u.parentNode}});var S=function(P){return function(u,x,J,H,K,N,M,n,A){null!=A&&EditorUi.isVisioFilename(A.name)?b.importVisio(A,mxUtils.bind(this,function(E){D(E,x,J,H,K,N,M,"fixed",mxEvent.isAltDown(P)?null:M.substring(0,M.lastIndexOf(".")).replace(/_/g," "))})):null!=A&&(new XMLHttpRequest).upload&&b.isRemoteFileFormat(u,A.name)?b.isExternalDataComms()?b.parseFile(A,+mxUtils.bind(this,function(E){4==E.readyState&&(b.spinner.stop(),200<=E.status&&299>=E.status&&(D(E.responseText,x,J,H,K,N,M,"fixed",mxEvent.isAltDown(P)?null:M.substring(0,M.lastIndexOf(".")).replace(/_/g," ")),m.scrollTop=m.scrollHeight))})):(b.spinner.stop(),b.showError(mxResources.get("error"),mxResources.get("notInOffline"))):(D(u,x,J,H,K,N,M,"fixed",mxEvent.isAltDown(P)?null:M.substring(0,M.lastIndexOf(".")).replace(/_/g," ")),m.scrollTop=m.scrollHeight)}};mxEvent.addListener(m,"dragover",G);mxEvent.addListener(m,"drop",B);mxEvent.addListener(t,"dragover",G);mxEvent.addListener(t,"drop",B);f.appendChild(m);c=document.createElement("div");c.style.textAlign="right";c.style.marginTop="20px";g=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});g.setAttribute("id","btnCancel");g.className="geBtn";b.editor.cancelFirst&&c.appendChild(g);"draw.io"!=b.getServiceName()||null==l||l.constructor!=DriveLibrary&&l.constructor!=GitHubLibrary||(e=mxUtils.button(mxResources.get("link"),function(){b.getPublicUrl(l,function(P){if(null!=P){var u=b.getSearch("create title mode url drive splash state clibs ui".split(" "));u+=(0==u.length?"?":"&")+"splash=0&clibs=U"+encodeURIComponent(P);P=new EmbedDialog(b,window.location.protocol+"//"+window.location.host+"/"+u,null,null,null,null,"Check out the library I made using @drawio");b.showDialog(P.container,450,240,!0);P.init()}else l.constructor==DriveLibrary?b.showError(mxResources.get("error"),mxResources.get("diagramIsNotPublic"),mxResources.get("share"),mxUtils.bind(this,function(){b.drive.showPermissions(l.getId(),l)}),null,mxResources.get("ok"),mxUtils.bind(this,function(){})):b.handleError({message:mxResources.get("diagramIsNotPublic")})})}),e.className="geBtn",c.appendChild(e));e=mxUtils.button(mxResources.get("export"),function(){var P=b.createLibraryDataFromImages(d),u=k.value;/(\.xml)$/i.test(u)||(u+=".xml");b.isLocalFileSave()?b.saveLocalFile(P,u,"text/xml",null,null,null!=q?q:!0,null,"xml"):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(u)+-"&format=xml&xml="+encodeURIComponent(P))).simulate(document,"_blank")});e.setAttribute("id","btnDownload");e.className="geBtn";c.appendChild(e);if(Graph.fileSupport){if(null==b.libDlgFileInputElt){var V=document.createElement("input");V.setAttribute("multiple","multiple");V.setAttribute("type","file");mxEvent.addListener(V,"change",function(P){Q=!1;b.importFiles(V.files,0,0,b.maxImageSize,function(u,x,J,H,K,O,M,n,z){null!=V.files&&(S(P)(u,x,J,H,K,O,M,n,z),V.type="",V.type="file",V.value="")});m.scrollTop=+"&format=xml&xml="+encodeURIComponent(P))).simulate(document,"_blank")});e.setAttribute("id","btnDownload");e.className="geBtn";c.appendChild(e);if(Graph.fileSupport){if(null==b.libDlgFileInputElt){var V=document.createElement("input");V.setAttribute("multiple","multiple");V.setAttribute("type","file");mxEvent.addListener(V,"change",function(P){Q=!1;b.importFiles(V.files,0,0,b.maxImageSize,function(u,x,J,H,K,N,M,n,A){null!=V.files&&(S(P)(u,x,J,H,K,N,M,n,A),V.type="",V.type="file",V.value="")});m.scrollTop=m.scrollHeight});V.style.display="none";document.body.appendChild(V);b.libDlgFileInputElt=V}e=mxUtils.button(mxResources.get("import"),function(){null!=F&&(F(),F=null);b.libDlgFileInputElt.click()});e.setAttribute("id","btnAddImage");e.className="geBtn";c.appendChild(e)}e=mxUtils.button(mxResources.get("addImages"),function(){null!=F&&(F(),F=null);b.showImageDialog(mxResources.get("addImageUrl"),"",function(P,u,x){Q=!1;if(null!=P){if("data:image/"==P.substring(0,11)){var J=P.indexOf(",");0<J&&(P=-P.substring(0,J)+";base64,"+P.substring(J+1))}E(P,null,0,0,u,x);m.scrollTop=m.scrollHeight}})});e.setAttribute("id","btnAddImageUrl");e.className="geBtn";c.appendChild(e);this.saveBtnClickHandler=function(P,u,x,J){b.saveLibrary(P,u,x,J)};e=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=F&&(F(),F=null);this.saveBtnClickHandler(k.value,d,l,p)}));e.setAttribute("id","btnSave");e.className="geBtn gePrimaryBtn";c.appendChild(e);b.editor.cancelFirst||c.appendChild(g);f.appendChild(c);-this.container=f},EditShapeDialog=function(b,e,f,c,l){c=null!=c?c:300;l=null!=l?l:120;var p=document.createElement("table"),q=document.createElement("tbody");p.style.cellPadding="4px";var v=document.createElement("tr");var E=document.createElement("td");E.setAttribute("colspan","2");E.style.fontSize="10pt";mxUtils.write(E,f);v.appendChild(E);q.appendChild(v);v=document.createElement("tr");E=document.createElement("td");var G=document.createElement("textarea");G.style.outline="none";G.style.resize=-"none";G.style.width=c-200+"px";G.style.height=l+"px";this.textarea=G;this.init=function(){G.focus();G.scrollTop=0};E.appendChild(G);v.appendChild(E);E=document.createElement("td");f=document.createElement("div");f.style.position="relative";f.style.border="1px solid gray";f.style.top="6px";f.style.width="200px";f.style.height=l+4+"px";f.style.overflow="hidden";f.style.marginBottom="16px";mxEvent.disableContextMenu(f);E.appendChild(f);var B=new Graph(f);B.setEnabled(!1);var d=b.editor.graph.cloneCell(e);-B.addCells([d]);f=B.view.getState(d);var g="";null!=f.shape&&null!=f.shape.stencil&&(g=mxUtils.getPrettyXml(f.shape.stencil.desc));mxUtils.write(G,g||"");f=B.getGraphBounds();l=Math.min(160/f.width,(l-40)/f.height);B.view.scaleAndTranslate(l,20/l-f.x,20/l-f.y);v.appendChild(E);q.appendChild(v);v=document.createElement("tr");E=document.createElement("td");E.setAttribute("colspan","2");E.style.paddingTop="2px";E.style.whiteSpace="nowrap";E.setAttribute("align","right");b.isOffline()||(l=mxUtils.button(mxResources.get("help"),-function(){b.openLink("https://www.drawio.com/doc/faq/shape-complex-create-edit")}),l.className="geBtn",E.appendChild(l));l=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});l.className="geBtn";b.editor.cancelFirst&&E.appendChild(l);var k=function(m,t,y){var A=G.value,I=mxUtils.parseXml(A);A=mxUtils.getPrettyXml(I.documentElement);I=I.documentElement.getElementsByTagName("parsererror");if(null!=I&&0<I.length)b.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),-mxResources.get("ok"));else if(y&&b.hideDialog(),I=!m.model.contains(t),!y||I||A!=g){A=Graph.compress(A);m.getModel().beginUpdate();try{if(I){var F=b.editor.graph.getFreeInsertPoint();t.geometry.x=F.x;t.geometry.y=F.y;m.addCell(t)}m.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+A+")",[t])}catch(C){throw C;}finally{m.getModel().endUpdate()}I&&(m.setSelectionCell(t),m.scrollCellToVisible(t))}};f=mxUtils.button(mxResources.get("preview"),function(){k(B,d,!1)});f.className="geBtn";E.appendChild(f);-f=mxUtils.button(mxResources.get("apply"),function(){k(b.editor.graph,e,!0)});f.className="geBtn gePrimaryBtn";E.appendChild(f);b.editor.cancelFirst||E.appendChild(l);v.appendChild(E);q.appendChild(v);p.appendChild(q);this.container=p},CustomDialog=function(b,e,f,c,l,p,q,v,E,G,B,d){var g=document.createElement("div");g.appendChild(e);var k=document.createElement("div");k.style.marginTop=null!=d?d:"30px";k.style.textAlign="right";null!=q&&k.appendChild(q);b.isOffline()||null==p||k.appendChild(b.createHelpIcon(p));-e=mxUtils.button(E||mxResources.get("cancel"),function(){b.hideDialog();null!=c&&c()});e.className="geBtn";v&&(e.style.display="none");b.editor.cancelFirst&&k.appendChild(e);l=mxUtils.button(l||mxResources.get("ok"),mxUtils.bind(this,function(){G||b.hideDialog(null,null,this.container);if(null!=f){var m=f();if("string"===typeof m){b.showError(mxResources.get("error"),m);return}}G&&b.hideDialog(null,null,this.container)}));k.appendChild(l);l.className="geBtn gePrimaryBtn";b.editor.cancelFirst||k.appendChild(e);-if(null!=B)for(v=0;v<B.length;v++)(function(m,t,y){m=mxUtils.button(m,function(A){t(A)});null!=y&&m.setAttribute("title",y);m.className="geBtn";k.appendChild(m)})(B[v][0],B[v][1],B[v][2]);g.appendChild(k);this.cancelBtn=e;this.okButton=l;this.container=g},BtnDialog=function(b,e,f,c){var l=document.createElement("div");l.style.textAlign="center";var p=document.createElement("p");p.style.fontSize="16pt";p.style.padding="0px";p.style.margin="0px";p.style.color="gray";mxUtils.write(p,mxResources.get("done"));+P.substring(0,J)+";base64,"+P.substring(J+1))}D(P,null,0,0,u,x);m.scrollTop=m.scrollHeight}})});e.setAttribute("id","btnAddImageUrl");e.className="geBtn";c.appendChild(e);this.saveBtnClickHandler=function(P,u,x,J){b.saveLibrary(P,u,x,J)};e=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=F&&(F(),F=null);this.saveBtnClickHandler(k.value,d,l,p)}));e.setAttribute("id","btnSave");e.className="geBtn gePrimaryBtn";c.appendChild(e);b.editor.cancelFirst||c.appendChild(g);f.appendChild(c);+this.container=f},EditShapeDialog=function(b,e,f,c,l){c=null!=c?c:300;l=null!=l?l:120;var p=document.createElement("table"),q=document.createElement("tbody");p.style.cellPadding="4px";var v=document.createElement("tr");var D=document.createElement("td");D.setAttribute("colspan","2");D.style.fontSize="10pt";mxUtils.write(D,f);v.appendChild(D);q.appendChild(v);v=document.createElement("tr");D=document.createElement("td");var G=document.createElement("textarea");G.style.outline="none";G.style.resize=+"none";G.style.width=c-200+"px";G.style.height=l+"px";this.textarea=G;this.init=function(){G.focus();G.scrollTop=0};D.appendChild(G);v.appendChild(D);D=document.createElement("td");f=document.createElement("div");f.style.position="relative";f.style.border="1px solid gray";f.style.top="6px";f.style.width="200px";f.style.height=l+4+"px";f.style.overflow="hidden";f.style.marginBottom="16px";mxEvent.disableContextMenu(f);D.appendChild(f);var B=new Graph(f);B.setEnabled(!1);var d=b.editor.graph.cloneCell(e);+B.addCells([d]);f=B.view.getState(d);var g="";null!=f.shape&&null!=f.shape.stencil&&(g=mxUtils.getPrettyXml(f.shape.stencil.desc));mxUtils.write(G,g||"");f=B.getGraphBounds();l=Math.min(160/f.width,(l-40)/f.height);B.view.scaleAndTranslate(l,20/l-f.x,20/l-f.y);v.appendChild(D);q.appendChild(v);v=document.createElement("tr");D=document.createElement("td");D.setAttribute("colspan","2");D.style.paddingTop="2px";D.style.whiteSpace="nowrap";D.setAttribute("align","right");b.isOffline()||(l=mxUtils.button(mxResources.get("help"),+function(){b.openLink("https://www.drawio.com/doc/faq/shape-complex-create-edit")}),l.className="geBtn",D.appendChild(l));l=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});l.className="geBtn";b.editor.cancelFirst&&D.appendChild(l);var k=function(m,t,y){var z=G.value,I=mxUtils.parseXml(z);z=mxUtils.getPrettyXml(I.documentElement);I=I.documentElement.getElementsByTagName("parsererror");if(null!=I&&0<I.length)b.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),+mxResources.get("ok"));else if(y&&b.hideDialog(),I=!m.model.contains(t),!y||I||z!=g){z=Graph.compress(z);m.getModel().beginUpdate();try{if(I){var F=b.editor.graph.getFreeInsertPoint();t.geometry.x=F.x;t.geometry.y=F.y;m.addCell(t)}m.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+z+")",[t])}catch(C){throw C;}finally{m.getModel().endUpdate()}I&&(m.setSelectionCell(t),m.scrollCellToVisible(t))}};f=mxUtils.button(mxResources.get("preview"),function(){k(B,d,!1)});f.className="geBtn";D.appendChild(f);+f=mxUtils.button(mxResources.get("apply"),function(){k(b.editor.graph,e,!0)});f.className="geBtn gePrimaryBtn";D.appendChild(f);b.editor.cancelFirst||D.appendChild(l);v.appendChild(D);q.appendChild(v);p.appendChild(q);this.container=p},CustomDialog=function(b,e,f,c,l,p,q,v,D,G,B,d){var g=document.createElement("div");g.appendChild(e);var k=document.createElement("div");k.style.marginTop=null!=d?d:"30px";k.style.textAlign="right";null!=q&&k.appendChild(q);b.isOffline()||null==p||k.appendChild(b.createHelpIcon(p));+e=mxUtils.button(D||mxResources.get("cancel"),function(){b.hideDialog();null!=c&&c()});e.className="geBtn";v&&(e.style.display="none");b.editor.cancelFirst&&k.appendChild(e);l=mxUtils.button(l||mxResources.get("ok"),mxUtils.bind(this,function(){G||b.hideDialog(null,null,this.container);if(null!=f){var m=f();if("string"===typeof m){b.showError(mxResources.get("error"),m);return}}G&&b.hideDialog(null,null,this.container)}));k.appendChild(l);l.className="geBtn gePrimaryBtn";b.editor.cancelFirst||k.appendChild(e);+if(null!=B)for(v=0;v<B.length;v++)(function(m,t,y){m=mxUtils.button(m,function(z){t(z)});null!=y&&m.setAttribute("title",y);m.className="geBtn";k.appendChild(m)})(B[v][0],B[v][1],B[v][2]);g.appendChild(k);this.cancelBtn=e;this.okButton=l;this.container=g},BtnDialog=function(b,e,f,c){var l=document.createElement("div");l.style.textAlign="center";var p=document.createElement("p");p.style.fontSize="16pt";p.style.padding="0px";p.style.margin="0px";p.style.color="gray";mxUtils.write(p,mxResources.get("done"));var q="Unknown",v=document.createElement("img");v.setAttribute("border","0");v.setAttribute("align","absmiddle");v.style.marginRight="10px";e==b.drive?(q=mxResources.get("googleDrive"),v.src=IMAGE_PATH+"/google-drive-logo-white.svg"):e==b.dropbox?(q=mxResources.get("dropbox"),v.src=IMAGE_PATH+"/dropbox-logo-white.svg"):e==b.oneDrive?(q=mxResources.get("oneDrive"),v.src=IMAGE_PATH+"/onedrive-logo-white.svg"):e==b.gitHub?(q=mxResources.get("github"),v.src=IMAGE_PATH+"/github-logo-white.svg"):e==b.gitLab?(q=mxResources.get("gitlab"),v.src=IMAGE_PATH+"/gitlab-logo.svg"):e==b.trello&&(q=mxResources.get("trello"),v.src=IMAGE_PATH+"/trello-logo-white.svg");b=document.createElement("p");mxUtils.write(b,mxResources.get("authorizedIn",[q],"You are now authorized in {1}"));f=mxUtils.button(f,c);f.insertBefore(v,f.firstChild);f.style.marginTop="6px";f.className="geBigButton";f.style.fontSize="18px";f.style.padding="14px";l.appendChild(p);l.appendChild(b);l.appendChild(f);this.container=l},FontDialog=function(b,-e,f,c,l){function p(F){this.style.border="";13==F.keyCode&&I.click()}var q=document.createElement("table"),v=document.createElement("tbody");q.style.marginTop="8px";var E=document.createElement("tr");var G=document.createElement("td");G.colSpan=2;G.style.whiteSpace="nowrap";G.style.fontSize="10pt";G.style.fontWeight="bold";var B=document.createElement("input");B.style.cssText="margin-right:8px;margin-bottom:8px;";B.setAttribute("value","sysfonts");B.setAttribute("type","radio");B.setAttribute("name",-"current-fontdialog");B.setAttribute("id","fontdialog-sysfonts");G.appendChild(B);var d=document.createElement("label");d.setAttribute("for","fontdialog-sysfonts");mxUtils.write(d,mxResources.get("sysFonts",null,"System Fonts"));G.appendChild(d);E.appendChild(G);v.appendChild(E);E=document.createElement("tr");G=document.createElement("td");G.style.whiteSpace="nowrap";G.style.fontSize="10pt";G.style.width="120px";G.style.paddingLeft="15px";mxUtils.write(G,mxResources.get("fontname",null,"Font Name")+-":");E.appendChild(G);var g=document.createElement("input");"s"==c&&g.setAttribute("value",e);g.style.marginLeft="4px";g.style.width="250px";g.className="dlg_fontName_s";G=document.createElement("td");G.appendChild(g);E.appendChild(G);v.appendChild(E);E=document.createElement("tr");G=document.createElement("td");G.colSpan=2;G.style.whiteSpace="nowrap";G.style.fontSize="10pt";G.style.fontWeight="bold";var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-bottom:8px;";k.setAttribute("value",-"googlefonts");k.setAttribute("type","radio");k.setAttribute("name","current-fontdialog");k.setAttribute("id","fontdialog-googlefonts");G.appendChild(k);d=document.createElement("label");d.setAttribute("for","fontdialog-googlefonts");mxUtils.write(d,mxResources.get("googleFonts",null,"Google Fonts"));G.appendChild(d);if(!b.isOffline()||EditorUi.isElectronApp)d=b.createHelpIcon("https://fonts.google.com/"),G.appendChild(d);E.appendChild(G);"0"!=urlParams.isGoogleFontsEnabled&&v.appendChild(E);E=document.createElement("tr");-G=document.createElement("td");G.style.whiteSpace="nowrap";G.style.fontSize="10pt";G.style.width="120px";G.style.paddingLeft="15px";mxUtils.write(G,mxResources.get("fontname",null,"Font Name")+":");E.appendChild(G);var m=document.createElement("input");"g"==c&&m.setAttribute("value",e);m.style.marginLeft="4px";m.style.width="250px";m.className="dlg_fontName_g";G=document.createElement("td");G.appendChild(m);E.appendChild(G);"0"!=urlParams.isGoogleFontsEnabled&&v.appendChild(E);E=document.createElement("tr");+e,f,c,l){function p(F){this.style.border="";13==F.keyCode&&I.click()}var q=document.createElement("table"),v=document.createElement("tbody");q.style.marginTop="8px";var D=document.createElement("tr");var G=document.createElement("td");G.colSpan=2;G.style.whiteSpace="nowrap";G.style.fontSize="10pt";G.style.fontWeight="bold";var B=document.createElement("input");B.style.cssText="margin-right:8px;margin-bottom:8px;";B.setAttribute("value","sysfonts");B.setAttribute("type","radio");B.setAttribute("name",+"current-fontdialog");B.setAttribute("id","fontdialog-sysfonts");G.appendChild(B);var d=document.createElement("label");d.setAttribute("for","fontdialog-sysfonts");mxUtils.write(d,mxResources.get("sysFonts",null,"System Fonts"));G.appendChild(d);D.appendChild(G);v.appendChild(D);D=document.createElement("tr");G=document.createElement("td");G.style.whiteSpace="nowrap";G.style.fontSize="10pt";G.style.width="120px";G.style.paddingLeft="15px";mxUtils.write(G,mxResources.get("fontname",null,"Font Name")++":");D.appendChild(G);var g=document.createElement("input");"s"==c&&g.setAttribute("value",e);g.style.marginLeft="4px";g.style.width="250px";g.className="dlg_fontName_s";G=document.createElement("td");G.appendChild(g);D.appendChild(G);v.appendChild(D);D=document.createElement("tr");G=document.createElement("td");G.colSpan=2;G.style.whiteSpace="nowrap";G.style.fontSize="10pt";G.style.fontWeight="bold";var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-bottom:8px;";k.setAttribute("value",+"googlefonts");k.setAttribute("type","radio");k.setAttribute("name","current-fontdialog");k.setAttribute("id","fontdialog-googlefonts");G.appendChild(k);d=document.createElement("label");d.setAttribute("for","fontdialog-googlefonts");mxUtils.write(d,mxResources.get("googleFonts",null,"Google Fonts"));G.appendChild(d);if(!b.isOffline()||EditorUi.isElectronApp)d=b.createHelpIcon("https://fonts.google.com/"),G.appendChild(d);D.appendChild(G);"0"!=urlParams.isGoogleFontsEnabled&&v.appendChild(D);D=document.createElement("tr");+G=document.createElement("td");G.style.whiteSpace="nowrap";G.style.fontSize="10pt";G.style.width="120px";G.style.paddingLeft="15px";mxUtils.write(G,mxResources.get("fontname",null,"Font Name")+":");D.appendChild(G);var m=document.createElement("input");"g"==c&&m.setAttribute("value",e);m.style.marginLeft="4px";m.style.width="250px";m.className="dlg_fontName_g";G=document.createElement("td");G.appendChild(m);D.appendChild(G);"0"!=urlParams.isGoogleFontsEnabled&&v.appendChild(D);D=document.createElement("tr");G=document.createElement("td");G.colSpan=2;G.style.whiteSpace="nowrap";G.style.fontSize="10pt";G.style.fontWeight="bold";var t=document.createElement("input");t.style.cssText="margin-right:8px;margin-bottom:8px;";t.setAttribute("value","webfonts");t.setAttribute("type","radio");t.setAttribute("name","current-fontdialog");t.setAttribute("id","fontdialog-webfonts");G.appendChild(t);d=document.createElement("label");d.setAttribute("for","fontdialog-webfonts");mxUtils.write(d,mxResources.get("webfonts",-null,"Web Fonts"));G.appendChild(d);E.appendChild(G);Editor.enableWebFonts&&v.appendChild(E);E=document.createElement("tr");G=document.createElement("td");G.style.whiteSpace="nowrap";G.style.fontSize="10pt";G.style.width="120px";G.style.paddingLeft="15px";mxUtils.write(G,mxResources.get("fontname",null,"Font Name")+":");E.appendChild(G);var y=document.createElement("input");"w"==c&&(Editor.enableWebFonts?y.setAttribute("value",e):g.setAttribute("value",e));y.style.marginLeft="4px";y.style.width="250px";-y.className="dlg_fontName_w";G=document.createElement("td");G.appendChild(y);E.appendChild(G);Editor.enableWebFonts&&v.appendChild(E);E=document.createElement("tr");G=document.createElement("td");G.style.whiteSpace="nowrap";G.style.fontSize="10pt";G.style.width="120px";G.style.paddingLeft="15px";mxUtils.write(G,mxResources.get("fontUrl",null,"Font URL")+":");E.appendChild(G);var A=document.createElement("input");A.setAttribute("value",f||"");A.style.marginLeft="4px";A.style.width="250px";A.className=-"dlg_fontUrl";G=document.createElement("td");G.appendChild(A);E.appendChild(G);Editor.enableWebFonts&&v.appendChild(E);this.init=function(){var F=g;"g"==c?F=m:"w"==c&&Editor.enableWebFonts&&(F=y);F.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?F.select():document.execCommand("selectAll",!1,null)};E=document.createElement("tr");G=document.createElement("td");G.colSpan=2;G.style.paddingTop="20px";G.style.whiteSpace="nowrap";G.setAttribute("align","right");b.isOffline()||G.appendChild(b.createHelpIcon("https://www.drawio.com/blog/external-fonts"));-e=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();l()});e.className="geBtn";b.editor.cancelFirst&&G.appendChild(e);var I=mxUtils.button(mxResources.get("apply"),function(){if(B.checked){var F=g.value;var C="s"}else if(k.checked){F=m.value;var Q=Editor.GOOGLE_FONTS+encodeURIComponent(F).replace(/%20/g,"+");C="g"}else t.checked&&(F=y.value,Q=A.value,C="w");var S=F;var V=Q,P=C,u=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/,x=q.querySelector(".dlg_fontName_"+-P);null==x||null!=S&&0!=S.length?(x=q.querySelector(".dlg_fontUrl"),null==x||"w"!=P||u.test(V)?S=!0:(x.style.border="1px solid red",S=!1)):(x.style.border="1px solid red",S=!1);S&&(l(F,Q,C),b.hideDialog())});I.className="geBtn gePrimaryBtn";mxEvent.addListener(g,"keypress",p);mxEvent.addListener(m,"keypress",p);mxEvent.addListener(y,"keypress",p);mxEvent.addListener(A,"keypress",p);mxEvent.addListener(g,"focus",function(){B.setAttribute("checked","checked");B.checked=!0});mxEvent.addListener(m,"focus",-function(){k.setAttribute("checked","checked");k.checked=!0});mxEvent.addListener(y,"focus",function(){t.setAttribute("checked","checked");t.checked=!0});mxEvent.addListener(A,"focus",function(){t.setAttribute("checked","checked");t.checked=!0});G.appendChild(I);b.editor.cancelFirst||G.appendChild(e);E.appendChild(G);v.appendChild(E);q.appendChild(v);this.container=q};+null,"Web Fonts"));G.appendChild(d);D.appendChild(G);Editor.enableWebFonts&&v.appendChild(D);D=document.createElement("tr");G=document.createElement("td");G.style.whiteSpace="nowrap";G.style.fontSize="10pt";G.style.width="120px";G.style.paddingLeft="15px";mxUtils.write(G,mxResources.get("fontname",null,"Font Name")+":");D.appendChild(G);var y=document.createElement("input");"w"==c&&(Editor.enableWebFonts?y.setAttribute("value",e):g.setAttribute("value",e));y.style.marginLeft="4px";y.style.width="250px";+y.className="dlg_fontName_w";G=document.createElement("td");G.appendChild(y);D.appendChild(G);Editor.enableWebFonts&&v.appendChild(D);D=document.createElement("tr");G=document.createElement("td");G.style.whiteSpace="nowrap";G.style.fontSize="10pt";G.style.width="120px";G.style.paddingLeft="15px";mxUtils.write(G,mxResources.get("fontUrl",null,"Font URL")+":");D.appendChild(G);var z=document.createElement("input");z.setAttribute("value",f||"");z.style.marginLeft="4px";z.style.width="250px";z.className=+"dlg_fontUrl";G=document.createElement("td");G.appendChild(z);D.appendChild(G);Editor.enableWebFonts&&v.appendChild(D);this.init=function(){var F=g;"g"==c?F=m:"w"==c&&Editor.enableWebFonts&&(F=y);F.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?F.select():document.execCommand("selectAll",!1,null)};D=document.createElement("tr");G=document.createElement("td");G.colSpan=2;G.style.paddingTop="20px";G.style.whiteSpace="nowrap";G.setAttribute("align","right");b.isOffline()||G.appendChild(b.createHelpIcon("https://www.drawio.com/blog/external-fonts"));+e=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();l()});e.className="geBtn";b.editor.cancelFirst&&G.appendChild(e);var I=mxUtils.button(mxResources.get("apply"),function(){if(B.checked){var F=g.value;var C="s"}else if(k.checked){F=m.value;var Q=Editor.GOOGLE_FONTS+encodeURIComponent(F).replace(/%20/g,"+");C="g"}else t.checked&&(F=y.value,Q=z.value,C="w");var S=F;var V=Q,P=C,u=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/,x=q.querySelector(".dlg_fontName_"++P);null==x||null!=S&&0!=S.length?(x=q.querySelector(".dlg_fontUrl"),null==x||"w"!=P||u.test(V)?S=!0:(x.style.border="1px solid red",S=!1)):(x.style.border="1px solid red",S=!1);S&&(l(F,Q,C),b.hideDialog())});I.className="geBtn gePrimaryBtn";mxEvent.addListener(g,"keypress",p);mxEvent.addListener(m,"keypress",p);mxEvent.addListener(y,"keypress",p);mxEvent.addListener(z,"keypress",p);mxEvent.addListener(g,"focus",function(){B.setAttribute("checked","checked");B.checked=!0});mxEvent.addListener(m,"focus",+function(){k.setAttribute("checked","checked");k.checked=!0});mxEvent.addListener(y,"focus",function(){t.setAttribute("checked","checked");t.checked=!0});mxEvent.addListener(z,"focus",function(){t.setAttribute("checked","checked");t.checked=!0});G.appendChild(I);b.editor.cancelFirst||G.appendChild(e);D.appendChild(G);v.appendChild(D);q.appendChild(v);this.container=q};function AspectDialog(b,e,f,c,l){this.aspect={pageId:e||(b.pages?b.pages[0].getId():null),layerIds:f||[]};e=document.createElement("div");var p=document.createElement("h5");p.style.margin="0 0 10px";mxUtils.write(p,mxResources.get("pages"));e.appendChild(p);f=document.createElement("div");f.className="geAspectDlgList";e.appendChild(f);p=document.createElement("h5");p.style.margin="0 0 10px";mxUtils.write(p,mxResources.get("layers"));e.appendChild(p);p=document.createElement("div");p.className="geAspectDlgList";e.appendChild(p);this.pagesContainer=f;this.layersContainer=p;this.ui=b;f=document.createElement("div");f.style.marginTop="16px";f.style.textAlign="center";p=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=l&&l()});p.className="geBtn";b.editor.cancelFirst&&f.appendChild(p);var q=mxUtils.button(mxResources.get("ok"),mxUtils.bind(this,function(){b.hideDialog();c({pageId:this.selectedPage,layerIds:Object.keys(this.selectedLayers)})}));f.appendChild(q);q.className="geBtn gePrimaryBtn";b.editor.cancelFirst||f.appendChild(p);q.setAttribute("disabled","disabled");this.okBtn=q;e.appendChild(f);this.container=e}AspectDialog.prototype.init=function(){var b=this.ui.getFileData(!0);if(this.ui.pages)for(b=0;b<this.ui.pages.length;b++){var e=this.ui.updatePageRoot(this.ui.pages[b]);this.createPageItem(e.getId(),e.getName(),e.node)}else this.createPageItem("1","Page-1",mxUtils.parseXml(b).documentElement)};@@ -12620,34 +12626,34 @@ AspectDialog.prototype.createPageItem=function(b,e,f){var c=document.createElemethis.selectedPage=b;c.className+=" geAspectDlgListItemSelected";this.layersContainer.innerText="";this.selectedLayers={};this.okBtn.setAttribute("disabled","disabled");var p=l.model;p=p.getChildCells(p.getRoot());for(var q=0;q<p.length;q++)this.createLayerItem(p[q],b,l,f)});mxEvent.addListener(c,"click",e);this.aspect.pageId==b&&e()};AspectDialog.prototype.createLayerItem=function(b,e,f,c){e=f.convertValueToString(b)||mxResources.get("background")||"Background";var l=document.createElement("div");l.setAttribute("data-layer-id",b.id);l.className="geAspectDlgListItem";l.innerHTML='<div style="max-width: 100%; max-height: 100%;"></div><div class="geAspectDlgListItemText">'+mxUtils.htmlEntities(e)+"</div>";this.layersContainer.appendChild(l);this.createViewer(l.childNodes[0],c,b.id);c=mxUtils.bind(this,function(){0<=l.className.indexOf("geAspectDlgListItemSelected")?(l.className="geAspectDlgListItem",delete this.selectedLayers[b.id],mxUtils.isEmptyObject(this.selectedLayers)&&this.okBtn.setAttribute("disabled","disabled")):(l.className+=" geAspectDlgListItemSelected",this.selectedLayers[b.id]=!0,this.okBtn.removeAttribute("disabled"))});mxEvent.addListener(l,"click",c);-1!=this.aspect.layerIds.indexOf(b.id)&&c()};-var FilePropertiesDialog=function(b,e){function f(C){var Q=G;G=function(S,V){try{C(function(){Q(S,V)},V)}catch(P){V(P)}}}var c=document.createElement("table"),l=document.createElement("tbody");c.style.width="100%";c.style.marginTop="8px";c.style.tableLayout="fixed";var p=b.getCurrentFile(),q=null!=p&&null!=p.getTitle()?p.getTitle():b.defaultFilename,v=/(\.png)$/i.test(q),E=/(\.svg)$/i.test(q),G=function(C,Q){C()},B=null!=p?p.isLocked():!1;var d=document.createElement("tr");var g=document.createElement("td");+var FilePropertiesDialog=function(b,e){function f(C){var Q=G;G=function(S,V){try{C(function(){Q(S,V)},V)}catch(P){V(P)}}}var c=document.createElement("table"),l=document.createElement("tbody");c.style.width="100%";c.style.marginTop="8px";c.style.tableLayout="fixed";var p=b.getCurrentFile(),q=null!=p&&null!=p.getTitle()?p.getTitle():b.defaultFilename,v=/(\.png)$/i.test(q),D=/(\.svg)$/i.test(q),G=function(C,Q){C()},B=null!=p?p.isLocked():!1;var d=document.createElement("tr");var g=document.createElement("td");g.style.whiteSpace="nowrap";g.style.overflow="hidden";g.style.textOverflow="ellipsis";g.style.fontSize="10pt";mxUtils.write(g,mxResources.get("locked")+":");d.appendChild(g);var k=document.createElement("input");k.setAttribute("type","checkbox");B&&(k.setAttribute("checked","checked"),k.defaultChecked=!0);g=document.createElement("td");g.style.whiteSpace="nowrap";g.appendChild(k);d.appendChild(g);l.appendChild(d);this.init=function(){k.focus()};f(function(C,Q){null!=b.fileNode&&B!=k.checked?window.setTimeout(function(){null!=-p&&p.setLocked(k.checked);C()},0):C()});if(v||E){q=1;v=0;d=b.fileNode;null!=d&&(d.hasAttribute("scale")&&(q=parseFloat(d.getAttribute("scale"))),d.hasAttribute("border")&&(v=parseInt(d.getAttribute("border"))));d=document.createElement("tr");g=document.createElement("td");g.style.whiteSpace="nowrap";g.style.fontSize="10pt";mxUtils.write(g,mxResources.get("zoom")+":");d.appendChild(g);var m=document.createElement("input");m.setAttribute("value",100*q+"%");m.style.marginLeft="4px";m.style.width="100%";+p&&p.setLocked(k.checked);C()},0):C()});if(v||D){q=1;v=0;d=b.fileNode;null!=d&&(d.hasAttribute("scale")&&(q=parseFloat(d.getAttribute("scale"))),d.hasAttribute("border")&&(v=parseInt(d.getAttribute("border"))));d=document.createElement("tr");g=document.createElement("td");g.style.whiteSpace="nowrap";g.style.fontSize="10pt";mxUtils.write(g,mxResources.get("zoom")+":");d.appendChild(g);var m=document.createElement("input");m.setAttribute("value",100*q+"%");m.style.marginLeft="4px";m.style.width="100%";g=document.createElement("td");g.style.whiteSpace="nowrap";g.appendChild(m);d.appendChild(g);l.appendChild(d);d=document.createElement("tr");g=document.createElement("td");g.style.whiteSpace="nowrap";g.style.fontSize="10pt";mxUtils.write(g,mxResources.get("borderWidth")+":");d.appendChild(g);var t=document.createElement("input");t.setAttribute("value",v);t.style.marginLeft="4px";t.style.width="100%";g=document.createElement("td");g.style.whiteSpace="nowrap";g.appendChild(t);d.appendChild(g);l.appendChild(d);this.init=this.init||function(){m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?m.select():document.execCommand("selectAll",!1,null)};f(function(C,Q){null!=b.fileNode&&(b.fileNode.setAttribute("scale",Math.max(0,parseInt(m.value)/100)),b.fileNode.setAttribute("border",Math.max(0,parseInt(t.value))),null!=p&&p.fileChanged());C()})}else if(!/(\.html)$/i.test(q)&&!/(\.svg)$/i.test(q)){var y=null!=p?p.isCompressed():Editor.defaultCompressed;d=document.createElement("tr");g=document.createElement("td");-g.style.whiteSpace="nowrap";g.style.overflow="hidden";g.style.textOverflow="ellipsis";g.style.fontSize="10pt";mxUtils.write(g,mxResources.get("compressed")+":");d.appendChild(g);var A=document.createElement("input");A.setAttribute("type","checkbox");y&&(A.setAttribute("checked","checked"),A.defaultChecked=!0);g=document.createElement("td");g.style.whiteSpace="nowrap";g.appendChild(A);d.appendChild(g);l.appendChild(d);this.init=this.init||function(){A.focus()};f(function(C,Q){null!=b.fileNode&&y!=-A.checked?window.setTimeout(function(){b.fileNode.setAttribute("compressed",A.checked?"true":"false");null!=p&&(p.compressionChanged(A.checked),p.fileChanged());C()},0):C()})}if(null!=p&&p.isRealtimeOptional()){d=document.createElement("tr");g=document.createElement("td");g.style.whiteSpace="nowrap";g.style.overflow="hidden";g.style.textOverflow="ellipsis";g.style.fontSize="10pt";mxUtils.write(g,mxResources.get("realtimeCollaboration")+":");d.appendChild(g);var I=document.createElement("input");I.setAttribute("type",+g.style.whiteSpace="nowrap";g.style.overflow="hidden";g.style.textOverflow="ellipsis";g.style.fontSize="10pt";mxUtils.write(g,mxResources.get("compressed")+":");d.appendChild(g);var z=document.createElement("input");z.setAttribute("type","checkbox");y&&(z.setAttribute("checked","checked"),z.defaultChecked=!0);g=document.createElement("td");g.style.whiteSpace="nowrap";g.appendChild(z);d.appendChild(g);l.appendChild(d);this.init=this.init||function(){z.focus()};f(function(C,Q){null!=b.fileNode&&y!=+z.checked?window.setTimeout(function(){b.fileNode.setAttribute("compressed",z.checked?"true":"false");null!=p&&(p.compressionChanged(z.checked),p.fileChanged());C()},0):C()})}if(null!=p&&p.isRealtimeOptional()){d=document.createElement("tr");g=document.createElement("td");g.style.whiteSpace="nowrap";g.style.overflow="hidden";g.style.textOverflow="ellipsis";g.style.fontSize="10pt";mxUtils.write(g,mxResources.get("realtimeCollaboration")+":");d.appendChild(g);var I=document.createElement("input");I.setAttribute("type","checkbox");var F=p.isRealtimeEnabled();if(F="disabled"!=b.drive.getCustomProperty(p.desc,"collaboration"))I.setAttribute("checked","checked"),I.defaultChecked=!0;f(function(C,Q){I.checked!=F?p.setRealtimeEnabled(I.checked,C,Q):C()});this.init=null!=this.init?this.init:function(){I.focus()};g=document.createElement("td");g.style.whiteSpace="nowrap";g.appendChild(I);g.appendChild(b.menus.createHelpLink("https://github.com/jgraph/drawio/discussions/2672"));d.appendChild(g);l.appendChild(d)}null!=p&&"draw.io"==b.getServiceName()&&0<p.getSize()&&"1"!=urlParams.embed&&(d=document.createElement("tr"),g=document.createElement("td"),g.style.whiteSpace="nowrap",g.style.overflow="hidden",g.style.textOverflow="ellipsis",g.style.fontSize="10pt",mxUtils.write(g,mxResources.get("size")+":"),d.appendChild(g),g=b.formatFileSize(p.getSize()),q=document.createElement("input"),q.setAttribute("title",g),q.setAttribute("value",g),q.setAttribute("disabled","disabled"),q.style.marginLeft="4px",q.style.width="100%",g=document.createElement("td"),g.style.whiteSpace="nowrap",g.appendChild(q),d.appendChild(g),l.appendChild(d));null!=e&&(d=document.createElement("tr"),g=document.createElement("td"),g.style.whiteSpace="nowrap",g.style.overflow="hidden",g.style.textOverflow="ellipsis",g.style.fontSize="10pt",mxUtils.write(g,mxResources.get("publicDiagramUrl")+":"),d.appendChild(g),q=document.createElement("a"),q.setAttribute("href",e),q.setAttribute("title",e),q.style.whiteSpace="nowrap",q.style.overflow="hidden",q.style.textOverflow="ellipsis",q.style.display="block",q.style.margin="2px 0px 2px 8px",q.style.fontSize="10pt",mxUtils.write(q,e),mxEvent.addListener(q,"click",function(C){b.openLink(e);mxEvent.consume(C)}),g=document.createElement("td"),g.appendChild(q),d.appendChild(g),l.appendChild(d));null!=p&&null!=p.fileObject&&null!=p.fileObject.path&&(d=document.createElement("tr"),g=document.createElement("td"),g.style.whiteSpace="nowrap",g.style.overflow="hidden",g.style.textOverflow="ellipsis",g.style.fontSize="10pt",mxUtils.write(g,mxResources.get("pathFilename")+":"),d.appendChild(g),q=document.createElement("input"),q.setAttribute("title",p.fileObject.path),q.setAttribute("value",p.fileObject.path),q.setAttribute("disabled","disabled"),q.style.marginLeft="4px",q.style.width="100%",g=document.createElement("td"),g.appendChild(q),d.appendChild(g),l.appendChild(d));this.init=null!=this.init?this.init:function(){};q=mxUtils.button(mxResources.get("apply"),function(){b.spinner.spin(document.body,mxResources.get("updatingDocument"))&&G(function(){b.spinner.stop();b.hideDialog()},function(C){b.spinner.stop();b.handleError(C,mxResources.get("error"))})});q.className="geBtn gePrimaryBtn";d=document.createElement("tr");g=document.createElement("td");g.colSpan=2;g.style.paddingTop="20px";g.style.whiteSpace="nowrap";g.setAttribute("align","right");v=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});v.className="geBtn";b.editor.cancelFirst&&g.appendChild(v);g.appendChild(q);b.editor.cancelFirst||g.appendChild(v);d.appendChild(g);-l.appendChild(d);c.appendChild(l);this.container=c},ConnectionPointsDialog=function(b,e){function f(){null!=l&&l.destroy()}var c=document.createElement("div");c.style.userSelect="none";var l=null;this.init=function(){function p(H,K,O){H=new mxCell("",new mxGeometry(H,K,6,6),"shape=mxgraph.basic.x;fillColor=#29b6f2;strokeColor=#29b6f2;points=[];rotatable=0;resizable=0;connectable=0;editable=0;");H.vertex=!0;H.cp=!0;H.constObj=O;return d.addCell(H)}function q(H){H=d.getSelectionCells();d.deleteCells(H)}-function v(){var H=parseInt(P.value)||0;H=0>H?0:100<H?100:H;P.value=H;var K=parseInt(x.value)||0;K=0>K?0:100<K?100:K;x.value=K;var O=parseInt(u.value)||0,M=parseInt(J.value)||0;O=new mxConnectionConstraint(new mxPoint(H/100,K/100),!1,null,O,M);H=d.getConnectionPoint(m,O);K=d.getSelectionCell();if(null!=K){K.constObj=O;O=K.geometry.clone();M=d.view.scale;var n=d.view.translate;O.x=(H.x-3*M)/M-n.x;O.y=(H.y-3*M)/M-n.y;d.model.setGeometry(K,O)}}function E(H){if(H.constObj)return{x:H.constObj.point.x,-y:H.constObj.point.y,dx:H.constObj.dx,dy:H.constObj.dy};var K=0,O=0,M=g.geometry,n=mxUtils.format((H.geometry.x+3-M.x)/M.width);H=mxUtils.format((H.geometry.y+3-M.y)/M.height);0>n?(K=n*M.width,n=0):1<n&&(K=(n-1)*M.width,n=1);0>H?(O=H*M.height,H=0):1<H&&(O=(H-1)*M.height,H=1);return{x:n,y:H,dx:parseInt(K),dy:parseInt(O)}}function G(H){if(1==d.getSelectionCount()){var K=d.getSelectionCell();H&&(K.constObj=null);H=E(K);P.value=100*H.x;x.value=100*H.y;u.value=H.dx;J.value=H.dy;V.style.visibility=""}else V.style.visibility=+l.appendChild(d);c.appendChild(l);this.container=c},ConnectionPointsDialog=function(b,e){function f(){null!=l&&l.destroy()}var c=document.createElement("div");c.style.userSelect="none";var l=null;this.init=function(){function p(H,K,N){H=new mxCell("",new mxGeometry(H,K,6,6),"shape=mxgraph.basic.x;fillColor=#29b6f2;strokeColor=#29b6f2;points=[];rotatable=0;resizable=0;connectable=0;editable=0;");H.vertex=!0;H.cp=!0;H.constObj=N;return d.addCell(H)}function q(H){H=d.getSelectionCells();d.deleteCells(H)}+function v(){var H=parseInt(P.value)||0;H=0>H?0:100<H?100:H;P.value=H;var K=parseInt(x.value)||0;K=0>K?0:100<K?100:K;x.value=K;var N=parseInt(u.value)||0,M=parseInt(J.value)||0;N=new mxConnectionConstraint(new mxPoint(H/100,K/100),!1,null,N,M);H=d.getConnectionPoint(m,N);K=d.getSelectionCell();if(null!=K){K.constObj=N;N=K.geometry.clone();M=d.view.scale;var n=d.view.translate;N.x=(H.x-3*M)/M-n.x;N.y=(H.y-3*M)/M-n.y;d.model.setGeometry(K,N)}}function D(H){if(H.constObj)return{x:H.constObj.point.x,+y:H.constObj.point.y,dx:H.constObj.dx,dy:H.constObj.dy};var K=0,N=0,M=g.geometry,n=mxUtils.format((H.geometry.x+3-M.x)/M.width);H=mxUtils.format((H.geometry.y+3-M.y)/M.height);0>n?(K=n*M.width,n=0):1<n&&(K=(n-1)*M.width,n=1);0>H?(N=H*M.height,H=0):1<H&&(N=(H-1)*M.height,H=1);return{x:n,y:H,dx:parseInt(K),dy:parseInt(N)}}function G(H){if(1==d.getSelectionCount()){var K=d.getSelectionCell();H&&(K.constObj=null);H=D(K);P.value=100*H.x;x.value=100*H.y;u.value=H.dx;J.value=H.dy;V.style.visibility=""}else V.style.visibility="hidden"}var B=document.createElement("div");B.style.width="350px";B.style.height="350px";B.style.overflow="hidden";B.style.border="1px solid lightGray";B.style.boxSizing="border-box";mxEvent.disableContextMenu(B);c.appendChild(B);var d=new Graph(B);d.transparentBackground=!1;d.autoExtend=!1;d.autoScroll=!1;d.setGridEnabled(!1);d.setEnabled(!0);d.setPanning(!0);d.setConnectable(!1);d.setTooltips(!1);d.minFitScale=null;d.maxFitScale=null;d.centerZoom=!0;d.maxFitScale=2;B=e.geometry;var g=new mxCell(e.value,-new mxGeometry(0,0,B.width,B.height),e.style+";rotatable=0;resizable=0;connectable=0;editable=0;movable=0;fillColor=none;");g.vertex=!0;d.addCell(g);d.dblClick=function(H,K){if(null!=K&&K!=g)d.setSelectionCell(K);else{K=mxUtils.convertPoint(d.container,mxEvent.getClientX(H),mxEvent.getClientY(H));mxEvent.consume(H);H=d.view.scale;var O=d.view.translate;d.setSelectionCell(p((K.x-3*H)/H-O.x,(K.y-3*H)/H-O.y))}};l=new mxKeyHandler(d);l.bindKey(46,q);l.bindKey(8,q);d.getRubberband().isForceRubberbandEvent=+new mxGeometry(0,0,B.width,B.height),e.style+";rotatable=0;resizable=0;connectable=0;editable=0;movable=0;fillColor=none;");g.vertex=!0;d.addCell(g);d.dblClick=function(H,K){if(null!=K&&K!=g)d.setSelectionCell(K);else{K=mxUtils.convertPoint(d.container,mxEvent.getClientX(H),mxEvent.getClientY(H));mxEvent.consume(H);H=d.view.scale;var N=d.view.translate;d.setSelectionCell(p((K.x-3*H)/H-N.x,(K.y-3*H)/H-N.y))}};l=new mxKeyHandler(d);l.bindKey(46,q);l.bindKey(8,q);d.getRubberband().isForceRubberbandEvent=function(H){return 0==H.evt.button&&(null==H.getCell()||H.getCell()==g)};d.panningHandler.isForcePanningEvent=function(H){return 2==H.evt.button};var k=d.isCellSelectable;d.isCellSelectable=function(H){return H==g?!1:k.apply(this,arguments)};d.getLinkForCell=function(){return null};var m=d.view.getState(g);B=d.getAllConnectionConstraints(m);for(var t=0;null!=B&&t<B.length;t++){var y=d.getConnectionPoint(m,B[t]);p(y.x-3,y.y-3,B[t])}d.fit(8);d.center();t=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),-function(){d.zoomIn()});y=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){d.zoomOut()});var A=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==d.view.scale?(d.maxFitScale=8,d.fit(8)):d.zoomActual();d.center()}),I=function(){b.prompt(mxResources.get("gridSize"),d.gridSize,function(H){!isNaN(H)&&0<H&&(d.setGridSize(H),d.setGridEnabled(!0),d.refresh())})},F=b.createToolbarButton(Editor.thinGridImage,mxResources.get("grid"),function(H){mxEvent.isShiftDown(H)?-I():(d.setGridEnabled(!d.isGridEnabled()),d.refresh())});mxEvent.addListener(F,"dblclick",I);var C=b.createToolbarButton(Editor.trashImage,mxResources.get("delete"),q);mxUtils.setOpacity(C,10);B=document.createElement("div");B.style.display="flex";B.style.alignItems="center";B.style.paddingTop="6px";B.appendChild(t);B.appendChild(y);B.appendChild(A);B.appendChild(F);B.appendChild(C);c.appendChild(B);var Q=document.createElement("input");Q.setAttribute("type","number");Q.setAttribute("min","1");Q.setAttribute("value",-"1");Q.style.width="45px";Q.style.position="relative";Q.style.margin="0 4px 0 4px";var S=document.createElement("select");S.style.position="relative";y=["left","right","top","bottom"];for(t=0;t<y.length;t++)A=y[t],F=document.createElement("option"),mxUtils.write(F,mxResources.get(A)),F.value=A,S.appendChild(F);t=mxUtils.button(mxResources.get("add"),function(){var H=parseInt(Q.value);H=1>H?1:100<H?100:H;Q.value=H;for(var K=S.value,O=g.geometry,M=[],n=0;n<H;n++){switch(K){case "left":var z=O.x;var D=-O.y+(n+1)*O.height/(H+1);break;case "right":z=O.x+O.width;D=O.y+(n+1)*O.height/(H+1);break;case "top":z=O.x+(n+1)*O.width/(H+1);D=O.y;break;case "bottom":z=O.x+(n+1)*O.width/(H+1),D=O.y+O.height}M.push(p(z-3,D-3))}d.setSelectionCells(M)});t.style.marginLeft="auto";B.appendChild(t);B.appendChild(Q);B.appendChild(S);var V=document.createElement("div");V.style.margin="4px 0px 8px 0px";V.style.whiteSpace="nowrap";V.style.height="24px";B=document.createElement("span");mxUtils.write(B,mxResources.get("dx"));+function(){d.zoomIn()});y=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){d.zoomOut()});var z=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==d.view.scale?(d.maxFitScale=8,d.fit(8)):d.zoomActual();d.center()}),I=function(){b.prompt(mxResources.get("gridSize"),d.gridSize,function(H){!isNaN(H)&&0<H&&(d.setGridSize(H),d.setGridEnabled(!0),d.refresh())})},F=b.createToolbarButton(Editor.thinGridImage,mxResources.get("grid"),function(H){mxEvent.isShiftDown(H)?+I():(d.setGridEnabled(!d.isGridEnabled()),d.refresh())});mxEvent.addListener(F,"dblclick",I);var C=b.createToolbarButton(Editor.trashImage,mxResources.get("delete"),q);mxUtils.setOpacity(C,10);B=document.createElement("div");B.style.display="flex";B.style.alignItems="center";B.style.paddingTop="6px";B.appendChild(t);B.appendChild(y);B.appendChild(z);B.appendChild(F);B.appendChild(C);c.appendChild(B);var Q=document.createElement("input");Q.setAttribute("type","number");Q.setAttribute("min","1");Q.setAttribute("value",+"1");Q.style.width="45px";Q.style.position="relative";Q.style.margin="0 4px 0 4px";var S=document.createElement("select");S.style.position="relative";y=["left","right","top","bottom"];for(t=0;t<y.length;t++)z=y[t],F=document.createElement("option"),mxUtils.write(F,mxResources.get(z)),F.value=z,S.appendChild(F);t=mxUtils.button(mxResources.get("add"),function(){var H=parseInt(Q.value);H=1>H?1:100<H?100:H;Q.value=H;for(var K=S.value,N=g.geometry,M=[],n=0;n<H;n++){switch(K){case "left":var A=N.x;var E=+N.y+(n+1)*N.height/(H+1);break;case "right":A=N.x+N.width;E=N.y+(n+1)*N.height/(H+1);break;case "top":A=N.x+(n+1)*N.width/(H+1);E=N.y;break;case "bottom":A=N.x+(n+1)*N.width/(H+1),E=N.y+N.height}M.push(p(A-3,E-3))}d.setSelectionCells(M)});t.style.marginLeft="auto";B.appendChild(t);B.appendChild(Q);B.appendChild(S);var V=document.createElement("div");V.style.margin="4px 0px 8px 0px";V.style.whiteSpace="nowrap";V.style.height="24px";B=document.createElement("span");mxUtils.write(B,mxResources.get("dx"));V.appendChild(B);var P=document.createElement("input");P.setAttribute("type","number");P.setAttribute("min","0");P.setAttribute("max","100");P.style.width="45px";P.style.margin="0 4px 0 4px";V.appendChild(P);mxUtils.write(V,"%");var u=document.createElement("input");u.setAttribute("type","number");u.style.width="45px";u.style.margin="0 4px 0 4px";V.appendChild(u);mxUtils.write(V,"pt");B=document.createElement("span");mxUtils.write(B,mxResources.get("dy"));B.style.marginLeft="12px";V.appendChild(B);var x=document.createElement("input");x.setAttribute("type","number");x.setAttribute("min","0");x.setAttribute("max","100");x.style.width="45px";x.style.margin="0 4px 0 4px";V.appendChild(x);mxUtils.write(V,"%");var J=document.createElement("input");J.setAttribute("type","number");J.style.width="45px";J.style.margin="0 4px 0 4px";V.appendChild(J);mxUtils.write(V,"pt");c.appendChild(V);G();d.getSelectionModel().addListener(mxEvent.CHANGE,function(){0<d.getSelectionCount()?mxUtils.setOpacity(C,60):-mxUtils.setOpacity(C,10);G()});d.addListener(mxEvent.CELLS_MOVED,G);mxEvent.addListener(P,"change",v);mxEvent.addListener(x,"change",v);mxEvent.addListener(u,"change",v);mxEvent.addListener(J,"change",v);B=mxUtils.button(mxResources.get("cancel"),function(){f();b.hideDialog()});B.className="geBtn";t=mxUtils.button(mxResources.get("apply"),function(){var H=d.model.cells,K=[],O=[],M;for(M in H){var n=H[M];n.cp&&O.push(E(n))}O.sort(function(z,D){return z.x!=D.x?z.x-D.x:z.y!=D.y?z.y-D.y:z.dx!=D.dx?z.dx--D.dx:z.dy-D.dy});for(H=0;H<O.length;H++)0<H&&O[H].x==O[H-1].x&&O[H].y==O[H-1].y&&O[H].dx==O[H-1].dx&&O[H].dy==O[H-1].dy||K.push("["+O[H].x+","+O[H].y+",0,"+O[H].dx+","+O[H].dy+"]");b.editor.graph.setCellStyles("points","["+K.join(",")+"]",[e]);f();b.hideDialog()});t.className="geBtn gePrimaryBtn";y=mxUtils.button(mxResources.get("reset"),function(){b.editor.graph.setCellStyles("points",null,[e]);f();b.hideDialog()});y.className="geBtn";A=document.createElement("div");A.style.marginTop="10px";A.style.textAlign=-"right";b.isOffline()||A.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/shape-connection-points-customise"));b.editor.cancelFirst&&A.appendChild(B);A.appendChild(y);A.appendChild(t);b.editor.cancelFirst||A.appendChild(B);c.appendChild(A)};this.destroy=f;this.container=c};(function(){"undefined"!==typeof html4&&(html4.ATTRIBS["span::data-lucid-content"]=0,html4.ATTRIBS["span::data-lucid-type"]=0,html4.ATTRIBS["font::data-font-src"]=0);Editor.sketchFontFamily="Architects Daughter";Editor.sketchFontSource="https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter";Editor.sketchFonts=[{fontFamily:Editor.sketchFontFamily,fontUrl:decodeURIComponent(Editor.sketchFontSource)}];Editor.sketchDefaultCurveFitting="1";Editor.sketchDefaultJiggle="2";Editor.thinFormatImage=+mxUtils.setOpacity(C,10);G()});d.addListener(mxEvent.CELLS_MOVED,G);mxEvent.addListener(P,"change",v);mxEvent.addListener(x,"change",v);mxEvent.addListener(u,"change",v);mxEvent.addListener(J,"change",v);B=mxUtils.button(mxResources.get("cancel"),function(){f();b.hideDialog()});B.className="geBtn";t=mxUtils.button(mxResources.get("apply"),function(){var H=d.model.cells,K=[],N=[],M;for(M in H){var n=H[M];n.cp&&N.push(D(n))}N.sort(function(A,E){return A.x!=E.x?A.x-E.x:A.y!=E.y?A.y-E.y:A.dx!=E.dx?A.dx-+E.dx:A.dy-E.dy});for(H=0;H<N.length;H++)0<H&&N[H].x==N[H-1].x&&N[H].y==N[H-1].y&&N[H].dx==N[H-1].dx&&N[H].dy==N[H-1].dy||K.push("["+N[H].x+","+N[H].y+",0,"+N[H].dx+","+N[H].dy+"]");b.editor.graph.setCellStyles("points","["+K.join(",")+"]",[e]);f();b.hideDialog()});t.className="geBtn gePrimaryBtn";y=mxUtils.button(mxResources.get("reset"),function(){b.editor.graph.setCellStyles("points",null,[e]);f();b.hideDialog()});y.className="geBtn";z=document.createElement("div");z.style.marginTop="10px";z.style.textAlign=+"right";b.isOffline()||z.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/shape-connection-points-customise"));b.editor.cancelFirst&&z.appendChild(B);z.appendChild(y);z.appendChild(t);b.editor.cancelFirst||z.appendChild(B);c.appendChild(z)};this.destroy=f;this.container=c};(function(){"undefined"!==typeof html4&&(html4.ATTRIBS["span::data-lucid-content"]=0,html4.ATTRIBS["span::data-lucid-type"]=0,html4.ATTRIBS["font::data-font-src"]=0);Editor.sketchFontFamily="Architects Daughter";Editor.sketchFontSource="https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter";Editor.sketchFonts=[{fontFamily:Editor.sketchFontFamily,fontUrl:decodeURIComponent(Editor.sketchFontSource)}];Editor.sketchDefaultCurveFitting="1";Editor.sketchDefaultJiggle="2";Editor.thinFormatImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0ibTM2LjUgMTguMzUtNi44NS02Ljg1IDMuMjUtMy4ycS44NS0uODUgMi4wMjUtLjg1IDEuMTc1IDAgMi4wMjUuODVsMi43NSAyLjhxLjg1LjguODUgMnQtLjg1IDJaTTYuODUgNDEuMXYtNi45bDkuNTUtOS41NUw1LjUgMTMuN2w3LjgtNy44NSAxMSAxMSA1LjM1LTUuMzUgNi44NSA2Ljg1LTUuMzUgNS4zNSAxMSAxMS03Ljg1IDcuNzUtMTAuOTUtMTAuOS05LjYgOS41NVptMTEuMi0xOC4wNSA0LjY1LTQuNi00LjA1LTQuMDUtMi4zNSAyLjQtMS42LTEuNiAyLjM1LTIuNC0zLjc1LTMuNzUtNC42IDQuNjVabTE2LjIgMTYuMjUgNC42NS00LjY1LTMuNzUtMy43NS0yLjQgMi40LTEuNi0xLjYgMi40LTIuNC00LjA1LTQtNC42IDQuNjVabS0yNS4xLS40NWgzLjZsMjAuNS0yMC40NS0zLjY1LTMuNjVMOS4xNSAzNS4yWiIvPjwvc3ZnPg==";Editor.thinGestureImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI4IDQxLjZxLTIuNSAwLTQuMDc1LTEuNjUtMS41NzUtMS42NS0xLjU3NS00LjM1IDAtMi4zNSAxLjEtNC4xIDEuMS0xLjc1IDIuODI1LTIuOTUgMS43MjUtMS4yIDMuNy0xLjgyNVQzMy42NSAyNnEtLjE1LTMuMDUtMS4yNS00LjQyNVQyOS4yNSAyMC4ycS0yLjMgMC00LjE3NSAxLjV0LTQuNDI1IDQuOTVxLTIuNjUgMy40NS00LjYgNS4xLTEuOTUgMS42NS00LjM1IDEuNjUtMi4xIDAtMy42NS0xLjM3NVE2LjUgMzAuNjUgNi41IDI3LjQ1cTAtMiAxLjItNC41MjUgMS4yLTIuNTI1IDMuNS02LjE3NSAxLjMtMS44NSAxLjk3NS0zLjIyNXQuNjc1LTIuMzc1cTAtLjctLjM1LTEuMDUtLjM1LS4zNS0xLjA1LS4zNS0uNzUgMC0xLjYuNDc1UTEwIDEwLjcgOSAxMS45TDcgOS44cTEuMzUtMS41NSAyLjcyNS0yLjI3NVExMS4xIDYuOCAxMi41IDYuOHExLjkgMCAzLjEgMS4yNSAxLjIgMS4yNSAxLjIgMy4yIDAgMS44LS45NzUgMy41NzVRMTQuODUgMTYuNiAxMy4wNSAxOS4zcS0xLjk1IDIuOTUtMi43NzUgNC43dC0uODI1IDMuNjVxMCAxLjYuNzUgMi4yLjc1LjYgMS43NS42IDEuNDUgMCAyLjgyNS0xLjMgMS4zNzUtMS4zIDMuNTc1LTQuMTUgMi45NS0zLjggNS41MjUtNS43NzUgMi41NzUtMS45NzUgNS42NzUtMS45NzUgMy4xNSAwIDUgMi4zMjVUMzYuNiAyNS45aDQuOXYyLjk1aC00LjlxLS40NSA3LjM1LTMuMiAxMC4wNS0yLjc1IDIuNy01LjQgMi43Wm0uMS0yLjk1cTEuODUgMCAzLjY1LTIuMjUgMS44LTIuMjUgMi03LjUtMi44LjE1LTUuNjI1IDIuMDI1VDI1LjMgMzUuOXEwIDEuMy43NSAyLjAyNS43NS43MjUgMi4wNS43MjVaIi8+PC9zdmc+";Editor.thinShapesImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI5Ljc1IDI5Ljc1Wm0tMTMgNS40NXEuNC4wNS43NS4wNUgxOS4wNXY0LjY1cTAgLjI1LjE3NS40MjV0LjQyNS4xNzVIMzkuOXEuMjUgMCAuNDI1LS4xNzV0LjE3NS0uNDI1VjE5LjY1cTAtLjI1LS4xNzUtLjQyNXQtLjQyNS0uMTc1aC00LjY1VjE3LjVxMC0uMzUtLjA1LS43NWg0LjdxMS4xNSAwIDIgLjg3NS44NS44NzUuODUgMi4wMjVWMzkuOXEwIDEuMTUtLjg1IDItLjg1Ljg1LTIgLjg1SDE5LjY1cS0xLjE1IDAtMi4wMjUtLjg1dC0uODc1LTJabTEuNS0zLjk1cS01LjQ1IDAtOS4yMjUtMy44LTMuNzc1LTMuOC0zLjc3NS05LjIgMC01LjQ1IDMuNzc1LTkuMjI1UTEyLjggNS4yNSAxOC4yNSA1LjI1cTUuNCAwIDkuMiAzLjc3NSAzLjggMy43NzUgMy44IDkuMjI1IDAgNS40LTMuOCA5LjItMy44IDMuOC05LjIgMy44Wm0tLjA1LTIuM3E0LjQ1IDAgNy42LTMuMTI1IDMuMTUtMy4xMjUgMy4xNS03LjU3NXQtMy4xMjUtNy42UTIyLjcgNy41IDE4LjI1IDcuNXQtNy42IDMuMTI1UTcuNSAxMy43NSA3LjUgMTguMnQzLjEyNSA3LjZxMy4xMjUgMy4xNSA3LjU3NSAzLjE1Wm0uMDUtMTAuN1oiLz48L3N2Zz4=";@@ -12697,15 +12703,15 @@ Editor.facebookImage=IMAGE_PATH+"/facebook.png";Editor.tweetImage=IMAGE_PATH+"/tEditor.enableSimpleTheme=!0;Editor.enableHashObjects=!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&"1"!=urlParams.embed&&window.top==window.self;Editor.defaultIncludeDiagram=!0;Editor.enableServiceWorker="0"!=urlParams.pwa&&"serviceWorker"in navigator&&("1"==urlParams.offline||/.*\.diagrams\.net$/.test(window.location.hostname)||/.*\.draw\.io$/.test(window.location.hostname));try{Editor.enableServiceWorker&&navigator.serviceWorker}catch(n){Editor.enableServiceWorker=!1}Editor.enableWebFonts="1"!=urlParams["safe-style-src"]&&!window.mxIsElectron;Editor.enableShadowOption=!mxClient.IS_SF;Editor.enableExportUrl=!0;Editor.enableRealtime=!0;Editor.enableRealtimeCache=!0;Editor.p2pSyncNotify=!1;Editor.compressXml=!0;Editor.defaultCompressed=!1;Editor.oneDriveInlinePicker=null!=window.urlParams&&"0"==window.urlParams.inlinePicker?!1:!0;Editor.globalVars=null;Editor.defaultBorder=5;Editor.addSvgMetadata=!1;Editor.enableAnimations=!0;Editor.enableChatGpt=/test\.draw\.io$/.test(window.location.hostname)||/preprod\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname);Editor.gptApiKey=null!=urlParams["gpt-api-key"]?decodeURIComponent(urlParams["gpt-api-key"]):null;Editor.gptModel=null!=urlParams["gpt-model"]?decodeURIComponent(urlParams["gpt-model"]):"gpt-3.5-turbo";Editor.gptUrl=null!=urlParams["gpt-url"]?decodeURIComponent(urlParams["gpt-url"]):"https://api.openai.com/v1/chat/completions";Editor.replaceSvgDataUris=-!0;Editor.foreignObjectImages=!0;Editor.svgFileTheme="auto";Editor.svgRasterScale=4;Editor.htmlRasterScale=4;Editor.config=null;Editor.configVersion=null;Editor.commonProperties=[{name:"enumerate",dispName:"Enumerate",type:"bool",defVal:!1,onChange:function(n){n.refresh()}},{name:"enumerateValue",dispName:"Enumerate Value",type:"string",defVal:"",isVisible:function(n,z){return"1"==mxUtils.getValue(n.style,"enumerate","0")}},{name:"comic",dispName:"Comic",type:"bool",defVal:!1,isVisible:function(n,-z){return"1"!=mxUtils.getValue(n.style,"sketch","0")}},{name:"jiggle",dispName:"Jiggle",type:"float",min:0,defVal:1,isVisible:function(n,z){return"1"==mxUtils.getValue(n.style,"comic","0")||"1"==mxUtils.getValue(n.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"fillWeight",dispName:"Fill Weight",type:"int",defVal:-1,isVisible:function(n,z){return"1"==mxUtils.getValue(n.style,"sketch","1"==urlParams.rough?"1":"0")&&0<n.vertices.length}},{name:"hachureGap",dispName:"Hachure Gap",type:"int",defVal:-1,-isVisible:function(n,z){return"1"==mxUtils.getValue(n.style,"sketch","1"==urlParams.rough?"1":"0")&&0<n.vertices.length}},{name:"hachureAngle",dispName:"Hachure Angle",type:"int",defVal:-41,isVisible:function(n,z){return"1"==mxUtils.getValue(n.style,"sketch","1"==urlParams.rough?"1":"0")&&0<n.vertices.length}},{name:"curveFitting",dispName:"Curve Fitting",type:"float",defVal:.95,isVisible:function(n,z){return"1"==mxUtils.getValue(n.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"simplification",-dispName:"Simplification",type:"float",defVal:0,min:0,max:1,isVisible:function(n,z){return"1"==mxUtils.getValue(n.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"disableMultiStroke",dispName:"Disable Multi Stroke",type:"bool",defVal:!1,isVisible:function(n,z){return"1"==mxUtils.getValue(n.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"disableMultiStrokeFill",dispName:"Disable Multi Stroke Fill",type:"bool",defVal:!1,isVisible:function(n,z){return"1"==mxUtils.getValue(n.style,"sketch",-"1"==urlParams.rough?"1":"0")&&0<n.vertices.length}},{name:"dashOffset",dispName:"Dash Offset",type:"int",defVal:-1,isVisible:function(n,z){return"1"==mxUtils.getValue(n.style,"sketch","1"==urlParams.rough?"1":"0")&&0<n.vertices.length}},{name:"dashGap",dispName:"Dash Gap",type:"int",defVal:-1,isVisible:function(n,z){return"1"==mxUtils.getValue(n.style,"sketch","1"==urlParams.rough?"1":"0")&&0<n.vertices.length}},{name:"zigzagOffset",dispName:"ZigZag Offset",type:"int",defVal:-1,isVisible:function(n,-z){return"1"==mxUtils.getValue(n.style,"sketch","1"==urlParams.rough?"1":"0")&&0<n.vertices.length}},{name:"sketchStyle",dispName:"Sketch Style",type:"enum",defVal:"rough",enumList:[{val:"rough",dispName:"Rough"},{val:"comic",dispName:"Comic"}],isVisible:function(n,z){return"1"==mxUtils.getValue(n.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:mxConstants.STYLE_SHADOWCOLOR,dispName:"Shadow Color",type:"color",getDefaultValue:function(){return mxConstants.SHADOWCOLOR},isVisible:function(n,z){return"1"==-mxUtils.getValue(n.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(n.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:mxConstants.STYLE_SHADOW_OPACITY,dispName:"Shadow Opacity",type:"int",min:0,max:100,getDefaultValue:function(){return 100*mxConstants.SHADOW_OPACITY},isVisible:function(n,z){return"1"==mxUtils.getValue(n.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(n.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:mxConstants.STYLE_SHADOW_OFFSET_X,dispName:"Shadow Offset X",-type:"int",getDefaultValue:function(){return mxConstants.SHADOW_OFFSET_X},isVisible:function(n,z){return"1"==mxUtils.getValue(n.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(n.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:mxConstants.STYLE_SHADOW_OFFSET_Y,dispName:"Shadow Offset Y",type:"int",getDefaultValue:function(){return mxConstants.SHADOW_OFFSET_Y},isVisible:function(n,z){return"1"==mxUtils.getValue(n.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(n.style,mxConstants.STYLE_TEXT_SHADOW,-"0")}},{name:mxConstants.STYLE_SHADOW_BLUR,dispName:"Shadow Blur",type:"int",min:0,getDefaultValue:function(){return mxConstants.SHADOW_BLUR},isVisible:function(n,z){return"1"==mxUtils.getValue(n.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(n.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:"linecap",dispName:"Line Cap",type:"enum",defVal:null,enumList:[{val:null,dispName:"Flat"},{val:"round",dispName:"Round"},{val:"square",dispName:"Square"}]},{name:"linejoin",dispName:"Line Join",+!0;Editor.foreignObjectImages=!0;Editor.svgFileTheme="auto";Editor.svgRasterScale=4;Editor.htmlRasterScale=4;Editor.config=null;Editor.configVersion=null;Editor.commonProperties=[{name:"enumerate",dispName:"Enumerate",type:"bool",defVal:!1,onChange:function(n){n.refresh()}},{name:"enumerateValue",dispName:"Enumerate Value",type:"string",defVal:"",isVisible:function(n,A){return"1"==mxUtils.getValue(n.style,"enumerate","0")}},{name:"comic",dispName:"Comic",type:"bool",defVal:!1,isVisible:function(n,+A){return"1"!=mxUtils.getValue(n.style,"sketch","0")}},{name:"jiggle",dispName:"Jiggle",type:"float",min:0,defVal:1,isVisible:function(n,A){return"1"==mxUtils.getValue(n.style,"comic","0")||"1"==mxUtils.getValue(n.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"fillWeight",dispName:"Fill Weight",type:"int",defVal:-1,isVisible:function(n,A){return"1"==mxUtils.getValue(n.style,"sketch","1"==urlParams.rough?"1":"0")&&0<n.vertices.length}},{name:"hachureGap",dispName:"Hachure Gap",type:"int",defVal:-1,+isVisible:function(n,A){return"1"==mxUtils.getValue(n.style,"sketch","1"==urlParams.rough?"1":"0")&&0<n.vertices.length}},{name:"hachureAngle",dispName:"Hachure Angle",type:"int",defVal:-41,isVisible:function(n,A){return"1"==mxUtils.getValue(n.style,"sketch","1"==urlParams.rough?"1":"0")&&0<n.vertices.length}},{name:"curveFitting",dispName:"Curve Fitting",type:"float",defVal:.95,isVisible:function(n,A){return"1"==mxUtils.getValue(n.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"simplification",+dispName:"Simplification",type:"float",defVal:0,min:0,max:1,isVisible:function(n,A){return"1"==mxUtils.getValue(n.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"disableMultiStroke",dispName:"Disable Multi Stroke",type:"bool",defVal:!1,isVisible:function(n,A){return"1"==mxUtils.getValue(n.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"disableMultiStrokeFill",dispName:"Disable Multi Stroke Fill",type:"bool",defVal:!1,isVisible:function(n,A){return"1"==mxUtils.getValue(n.style,"sketch",+"1"==urlParams.rough?"1":"0")&&0<n.vertices.length}},{name:"dashOffset",dispName:"Dash Offset",type:"int",defVal:-1,isVisible:function(n,A){return"1"==mxUtils.getValue(n.style,"sketch","1"==urlParams.rough?"1":"0")&&0<n.vertices.length}},{name:"dashGap",dispName:"Dash Gap",type:"int",defVal:-1,isVisible:function(n,A){return"1"==mxUtils.getValue(n.style,"sketch","1"==urlParams.rough?"1":"0")&&0<n.vertices.length}},{name:"zigzagOffset",dispName:"ZigZag Offset",type:"int",defVal:-1,isVisible:function(n,+A){return"1"==mxUtils.getValue(n.style,"sketch","1"==urlParams.rough?"1":"0")&&0<n.vertices.length}},{name:"sketchStyle",dispName:"Sketch Style",type:"enum",defVal:"rough",enumList:[{val:"rough",dispName:"Rough"},{val:"comic",dispName:"Comic"}],isVisible:function(n,A){return"1"==mxUtils.getValue(n.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:mxConstants.STYLE_SHADOWCOLOR,dispName:"Shadow Color",type:"color",getDefaultValue:function(){return mxConstants.SHADOWCOLOR},isVisible:function(n,A){return"1"==+mxUtils.getValue(n.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(n.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:mxConstants.STYLE_SHADOW_OPACITY,dispName:"Shadow Opacity",type:"int",min:0,max:100,getDefaultValue:function(){return 100*mxConstants.SHADOW_OPACITY},isVisible:function(n,A){return"1"==mxUtils.getValue(n.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(n.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:mxConstants.STYLE_SHADOW_OFFSET_X,dispName:"Shadow Offset X",+type:"int",getDefaultValue:function(){return mxConstants.SHADOW_OFFSET_X},isVisible:function(n,A){return"1"==mxUtils.getValue(n.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(n.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:mxConstants.STYLE_SHADOW_OFFSET_Y,dispName:"Shadow Offset Y",type:"int",getDefaultValue:function(){return mxConstants.SHADOW_OFFSET_Y},isVisible:function(n,A){return"1"==mxUtils.getValue(n.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(n.style,mxConstants.STYLE_TEXT_SHADOW,+"0")}},{name:mxConstants.STYLE_SHADOW_BLUR,dispName:"Shadow Blur",type:"int",min:0,getDefaultValue:function(){return mxConstants.SHADOW_BLUR},isVisible:function(n,A){return"1"==mxUtils.getValue(n.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(n.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:"linecap",dispName:"Line Cap",type:"enum",defVal:null,enumList:[{val:null,dispName:"Flat"},{val:"round",dispName:"Round"},{val:"square",dispName:"Square"}]},{name:"linejoin",dispName:"Line Join",type:"enum",defVal:null,enumList:[{val:null,dispName:"Miter"},{val:"arcs",dispName:"Arcs"},{val:"bevel",dispName:"Bevel"},{val:"miter-clip",dispName:"Miter-Clip"},{val:"round",dispName:"Round"}]}];Editor.commonEdgeProperties=[{type:"separator"},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"sourcePortConstraint",dispName:"Source Constraint",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"None"},{val:"north",dispName:"North"},{val:"east",dispName:"East"},{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},{name:"targetPortConstraint",dispName:"Target Constraint",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"None"},{val:"north",dispName:"North"},{val:"east",dispName:"East"},{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},{name:"jettySize",dispName:"Jetty Size",type:"int",min:0,defVal:"auto",allowAuto:!0,isVisible:function(n){return"orthogonalEdgeStyle"==mxUtils.getValue(n.style,mxConstants.STYLE_EDGE,null)}},{name:"segment",dispName:"Segment Size",type:"int",min:0,defVal:mxConstants.ENTITY_SEGMENT,isVisible:function(n){return"entityRelationEdgeStyle"==mxUtils.getValue(n.style,mxConstants.STYLE_EDGE,null)}},{name:"fillOpacity",dispName:"Fill Opacity",type:"int",min:0,max:100,defVal:100},{name:"strokeOpacity",dispName:"Stroke Opacity",type:"int",min:0,max:100,defVal:100},{name:"startFill",dispName:"Start Fill",type:"bool",defVal:!0},{name:"startFillColor",dispName:"Start Fill Color",type:"color",defVal:null},{name:"endFill",@@ -12713,23 +12719,23 @@ dispName:"End Fill",type:"bool",defVal:!0},{name:"endFillColor",dispName:"End FidispName:"Flow Duration",type:"int",defVal:500,isVisible:function(n){return"1"==mxUtils.getValue(n.style,"flowAnimation",null)}},{name:"flowAnimationTimingFunction",dispName:"Flow Timing",type:"enum",defVal:"linear",enumList:[{val:"linear",dispName:"Linear"},{val:"ease",dispName:"Ease"},{val:"ease-in",dispName:"Ease-in"},{val:"ease-out",dispName:"Ease-out"},{val:"ease-in-out",dispName:"Ease-in-out"}],isVisible:function(n){return"1"==mxUtils.getValue(n.style,"flowAnimation",null)}},{name:"flowAnimationDirection",dispName:"Flow Direction",type:"enum",defVal:"normal",enumList:[{val:"normal",dispName:"Normal"},{val:"reverse",dispName:"Reverse"},{val:"alternate",dispName:"Alternate"},{val:"alternate-reverse",dispName:"Alternate-Reverse"}],isVisible:function(n){return"1"==mxUtils.getValue(n.style,"flowAnimation",null)}},{name:"editable",dispName:"Editable",type:"bool",defVal:!0},{name:"metaEdit",dispName:"Edit Dialog",type:"bool",defVal:!1},{name:"backgroundOutline",dispName:"Background Outline",type:"bool",defVal:!1},{name:"bendable",dispName:"Bendable",type:"bool",defVal:!0},{name:"movable",dispName:"Movable",type:"bool",defVal:!0},{name:"cloneable",dispName:"Cloneable",type:"bool",defVal:!0},{name:"deletable",dispName:"Deletable",type:"bool",defVal:!0},{name:"noJump",dispName:"No Jumps",type:"bool",defVal:!1},{name:"ignoreEdge",dispName:"Ignore Edge",type:"bool",defVal:!1},{name:"orthogonalLoop",dispName:"Loop Routing",type:"bool",defVal:!1},{name:"orthogonal",dispName:"Orthogonal",type:"bool",defVal:!1}].concat(Editor.commonProperties);-Editor.commonVertexProperties=[{name:"colspan",dispName:"Colspan",type:"int",min:1,defVal:1,isVisible:function(n,z){z=z.editorUi.editor.graph;return 1==n.vertices.length&&0==n.edges.length&&z.isTableCell(n.vertices[0])}},{name:"rowspan",dispName:"Rowspan",type:"int",min:1,defVal:1,isVisible:function(n,z){z=z.editorUi.editor.graph;return 1==n.vertices.length&&0==n.edges.length&&z.isTableCell(n.vertices[0])}},{type:"separator"},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",getDefaultValue:function(n,-z){n=z.editorUi.editor.graph.getCellStyle(1==n.vertices.length&&0==n.edges.length?n.vertices[0]:null);return"1"==mxUtils.getValue(n,"resizeLastRow","0")},isVisible:function(n,z){z=z.editorUi.editor.graph;return 1==n.vertices.length&&0==n.edges.length&&z.isTable(n.vertices[0])}},{name:"resizeLast",dispName:"Resize Last Column",type:"bool",getDefaultValue:function(n,z){n=z.editorUi.editor.graph.getCellStyle(1==n.vertices.length&&0==n.edges.length?n.vertices[0]:null);return"1"==mxUtils.getValue(n,"resizeLast",-"0")},isVisible:function(n,z){z=z.editorUi.editor.graph;return 1==n.vertices.length&&0==n.edges.length&&z.isTable(n.vertices[0])}},{name:"fillOpacity",dispName:"Fill Opacity",type:"int",min:0,max:100,defVal:100},{name:"strokeOpacity",dispName:"Stroke Opacity",type:"int",min:0,max:100,defVal:100},{name:"overflow",dispName:"Text Overflow",defVal:"visible",type:"enum",enumList:[{val:"visible",dispName:"Visible"},{val:"hidden",dispName:"Hidden"},{val:"block",dispName:"Block"},{val:"fill",dispName:"Fill"},+Editor.commonVertexProperties=[{name:"colspan",dispName:"Colspan",type:"int",min:1,defVal:1,isVisible:function(n,A){A=A.editorUi.editor.graph;return 1==n.vertices.length&&0==n.edges.length&&A.isTableCell(n.vertices[0])}},{name:"rowspan",dispName:"Rowspan",type:"int",min:1,defVal:1,isVisible:function(n,A){A=A.editorUi.editor.graph;return 1==n.vertices.length&&0==n.edges.length&&A.isTableCell(n.vertices[0])}},{type:"separator"},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",getDefaultValue:function(n,+A){n=A.editorUi.editor.graph.getCellStyle(1==n.vertices.length&&0==n.edges.length?n.vertices[0]:null);return"1"==mxUtils.getValue(n,"resizeLastRow","0")},isVisible:function(n,A){A=A.editorUi.editor.graph;return 1==n.vertices.length&&0==n.edges.length&&A.isTable(n.vertices[0])}},{name:"resizeLast",dispName:"Resize Last Column",type:"bool",getDefaultValue:function(n,A){n=A.editorUi.editor.graph.getCellStyle(1==n.vertices.length&&0==n.edges.length?n.vertices[0]:null);return"1"==mxUtils.getValue(n,"resizeLast",+"0")},isVisible:function(n,A){A=A.editorUi.editor.graph;return 1==n.vertices.length&&0==n.edges.length&&A.isTable(n.vertices[0])}},{name:"fillOpacity",dispName:"Fill Opacity",type:"int",min:0,max:100,defVal:100},{name:"strokeOpacity",dispName:"Stroke Opacity",type:"int",min:0,max:100,defVal:100},{name:"overflow",dispName:"Text Overflow",defVal:"visible",type:"enum",enumList:[{val:"visible",dispName:"Visible"},{val:"hidden",dispName:"Hidden"},{val:"block",dispName:"Block"},{val:"fill",dispName:"Fill"},{val:"width",dispName:"Width"}]},{name:"noLabel",dispName:"Hide Label",type:"bool",defVal:!1},{name:"labelPadding",dispName:"Label Padding",type:"float",defVal:0},{name:"direction",dispName:"Direction",type:"enum",defVal:"east",enumList:[{val:"north",dispName:"North"},{val:"east",dispName:"East"},{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},{name:"portConstraint",dispName:"Constraint",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"None"},{val:"north",dispName:"North"},-{val:"east",dispName:"East"},{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},{name:"portConstraintRotation",dispName:"Rotate Constraint",type:"bool",defVal:!1},{name:"connectable",dispName:"Connectable",type:"bool",getDefaultValue:function(n,z){return z.editorUi.editor.graph.isCellConnectable(0<n.vertices.length&&0==n.edges.length?n.vertices[0]:null)},isVisible:function(n,z){return 0<n.vertices.length&&0==n.edges.length}},{name:"allowArrows",dispName:"Allow Arrows",type:"bool",defVal:!0},+{val:"east",dispName:"East"},{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},{name:"portConstraintRotation",dispName:"Rotate Constraint",type:"bool",defVal:!1},{name:"connectable",dispName:"Connectable",type:"bool",getDefaultValue:function(n,A){return A.editorUi.editor.graph.isCellConnectable(0<n.vertices.length&&0==n.edges.length?n.vertices[0]:null)},isVisible:function(n,A){return 0<n.vertices.length&&0==n.edges.length}},{name:"allowArrows",dispName:"Allow Arrows",type:"bool",defVal:!0},{name:"snapToPoint",dispName:"Snap to Point",type:"bool",defVal:!1},{name:"perimeter",dispName:"Perimeter",defVal:"none",type:"enum",enumList:[{val:"none",dispName:"None"},{val:"rectanglePerimeter",dispName:"Rectangle"},{val:"ellipsePerimeter",dispName:"Ellipse"},{val:"rhombusPerimeter",dispName:"Rhombus"},{val:"trianglePerimeter",dispName:"Triangle"},{val:"hexagonPerimeter2",dispName:"Hexagon"},{val:"lifelinePerimeter",dispName:"Lifeline"},{val:"orthogonalPerimeter",dispName:"Orthogonal"},{val:"backbonePerimeter",-dispName:"Backbone"},{val:"calloutPerimeter",dispName:"Callout"},{val:"parallelogramPerimeter",dispName:"Parallelogram"},{val:"trapezoidPerimeter",dispName:"Trapezoid"},{val:"stepPerimeter",dispName:"Step"},{val:"centerPerimeter",dispName:"Center"}]},{name:"fixDash",dispName:"Fixed Dash",type:"bool",defVal:!1},{name:"container",dispName:"Container",type:"bool",getDefaultValue:function(n,z){n=1==n.vertices.length&&0==n.edges.length?n.vertices[0]:null;z=z.editorUi.editor.graph;return null!=n&&z.isSwimlane(n)},-isVisible:function(n,z){return 1==n.vertices.length&&0==n.edges.length}},{name:"dropTarget",dispName:"Drop Target",type:"bool",getDefaultValue:function(n,z){n=1==n.vertices.length&&0==n.edges.length?n.vertices[0]:null;z=z.editorUi.editor.graph;return null!=n&&(z.isSwimlane(n)||0<z.model.getChildCount(n))},isVisible:function(n,z){return 1==n.vertices.length&&0==n.edges.length}},{name:"collapsible",dispName:"Collapsible",type:"bool",getDefaultValue:function(n,z){var D=1==n.vertices.length&&0==n.edges.length?-n.vertices[0]:null;z=z.editorUi.editor.graph;return null!=D&&(z.isContainer(D)&&"0"!=n.style.collapsible||!z.isContainer(D)&&"1"==n.style.collapsible)},isVisible:function(n,z){return 1==n.vertices.length&&0==n.edges.length}},{name:"recursiveResize",dispName:"Resize Children",type:"bool",defVal:!0,isVisible:function(n,z){return 1==n.vertices.length&&0==n.edges.length&&!z.editorUi.editor.graph.isSwimlane(n.vertices[0])&&null==mxUtils.getValue(n.style,"childLayout",null)}},{name:"expand",dispName:"Expand",-type:"bool",defVal:!0},{name:"part",dispName:"Part",type:"bool",defVal:!1,isVisible:function(n,z){z=z.editorUi.editor.graph.model;return 0<n.vertices.length?z.isVertex(z.getParent(n.vertices[0])):!1}},{name:"editable",dispName:"Editable",type:"bool",defVal:!0},{name:"metaEdit",dispName:"Edit Dialog",type:"bool",defVal:!1},{name:"backgroundOutline",dispName:"Background Outline",type:"bool",defVal:!1},{name:"movable",dispName:"Movable",type:"bool",defVal:!0},{name:"movableLabel",dispName:"Movable Label",-type:"bool",defVal:!1,isVisible:function(n,z){n=0<n.vertices.length?z.editorUi.editor.graph.getCellGeometry(n.vertices[0]):null;return null!=n&&!n.relative}},{name:"autosize",dispName:"Autosize",type:"bool",defVal:!1},{name:"autosizeGrid",dispName:"Autosize Grid",type:"enum",defVal:null,enumList:[{val:null,dispName:"Default"},{val:"1",dispName:"Enabled"},{val:"0",dispName:"Disabled"}],isVisible:function(n,z){return 0<n.vertices.length&&z.editorUi.editor.graph.isAutoSizeCell(n.vertices[0])}},{name:"fixedWidth",+dispName:"Backbone"},{val:"calloutPerimeter",dispName:"Callout"},{val:"parallelogramPerimeter",dispName:"Parallelogram"},{val:"trapezoidPerimeter",dispName:"Trapezoid"},{val:"stepPerimeter",dispName:"Step"},{val:"centerPerimeter",dispName:"Center"}]},{name:"fixDash",dispName:"Fixed Dash",type:"bool",defVal:!1},{name:"container",dispName:"Container",type:"bool",getDefaultValue:function(n,A){n=1==n.vertices.length&&0==n.edges.length?n.vertices[0]:null;A=A.editorUi.editor.graph;return null!=n&&A.isSwimlane(n)},+isVisible:function(n,A){return 1==n.vertices.length&&0==n.edges.length}},{name:"dropTarget",dispName:"Drop Target",type:"bool",getDefaultValue:function(n,A){n=1==n.vertices.length&&0==n.edges.length?n.vertices[0]:null;A=A.editorUi.editor.graph;return null!=n&&(A.isSwimlane(n)||0<A.model.getChildCount(n))},isVisible:function(n,A){return 1==n.vertices.length&&0==n.edges.length}},{name:"collapsible",dispName:"Collapsible",type:"bool",getDefaultValue:function(n,A){var E=1==n.vertices.length&&0==n.edges.length?+n.vertices[0]:null;A=A.editorUi.editor.graph;return null!=E&&(A.isContainer(E)&&"0"!=n.style.collapsible||!A.isContainer(E)&&"1"==n.style.collapsible)},isVisible:function(n,A){return 1==n.vertices.length&&0==n.edges.length}},{name:"recursiveResize",dispName:"Resize Children",type:"bool",defVal:!0,isVisible:function(n,A){return 1==n.vertices.length&&0==n.edges.length&&!A.editorUi.editor.graph.isSwimlane(n.vertices[0])&&null==mxUtils.getValue(n.style,"childLayout",null)}},{name:"expand",dispName:"Expand",+type:"bool",defVal:!0},{name:"part",dispName:"Part",type:"bool",defVal:!1,isVisible:function(n,A){A=A.editorUi.editor.graph.model;return 0<n.vertices.length?A.isVertex(A.getParent(n.vertices[0])):!1}},{name:"editable",dispName:"Editable",type:"bool",defVal:!0},{name:"metaEdit",dispName:"Edit Dialog",type:"bool",defVal:!1},{name:"backgroundOutline",dispName:"Background Outline",type:"bool",defVal:!1},{name:"movable",dispName:"Movable",type:"bool",defVal:!0},{name:"movableLabel",dispName:"Movable Label",+type:"bool",defVal:!1,isVisible:function(n,A){n=0<n.vertices.length?A.editorUi.editor.graph.getCellGeometry(n.vertices[0]):null;return null!=n&&!n.relative}},{name:"autosize",dispName:"Autosize",type:"bool",defVal:!1},{name:"autosizeGrid",dispName:"Autosize Grid",type:"enum",defVal:null,enumList:[{val:null,dispName:"Default"},{val:"1",dispName:"Enabled"},{val:"0",dispName:"Disabled"}],isVisible:function(n,A){return 0<n.vertices.length&&A.editorUi.editor.graph.isAutoSizeCell(n.vertices[0])}},{name:"fixedWidth",dispName:"Fixed Width",type:"bool",defVal:!1},{name:"resizable",dispName:"Resizable",type:"bool",defVal:!0},{name:"resizeWidth",dispName:"Resize Width",type:"bool",defVal:!1},{name:"resizeHeight",dispName:"Resize Height",type:"bool",defVal:!1},{name:"rotatable",dispName:"Rotatable",type:"bool",defVal:!0},{name:"cloneable",dispName:"Cloneable",type:"bool",defVal:!0},{name:"deletable",dispName:"Deletable",type:"bool",defVal:!0},{name:"treeFolding",dispName:"Tree Folding",type:"bool",defVal:!1},{name:"treeMoving",-dispName:"Tree Moving",type:"bool",defVal:!1},{name:"pointerEvents",dispName:"Pointer Events",type:"bool",defVal:!0,isVisible:function(n,z){var D=mxUtils.getValue(n.style,mxConstants.STYLE_FILLCOLOR,null);return!mxShape.forceFilledPointerEvents||z.editorUi.editor.graph.isSwimlane(n.vertices[0])||null==D||D==mxConstants.NONE||0==mxUtils.getValue(n.style,mxConstants.STYLE_FILL_OPACITY,100)||0==mxUtils.getValue(n.style,mxConstants.STYLE_OPACITY,100)||null!=n.style.pointerEvents}},{name:"moveCells",dispName:"Move Cells on Fold",-type:"bool",defVal:!1,isVisible:function(n,z){return 0<n.vertices.length&&z.editorUi.editor.graph.isContainer(n.vertices[0])}}].concat(Editor.commonProperties);Editor.defaultCsvValue='##\n## Example CSV import. Use ## for comments and # for configuration. Paste CSV below.\n## The following names are reserved and should not be used (or ignored):\n## id, tooltip, placeholder(s), link and label (see below)\n##\n#\n## Node label with placeholders and HTML.\n## Default is \'%name_of_first_column%\'.\n#\n# label: %name%<br><i style="color:gray;">%position%</i><br><a href="mailto:%email%">Email</a>\n#\n## Node style (placeholders are replaced once).\n## Default is the current style for nodes.\n#\n# style: label;image=%image%;whiteSpace=wrap;html=1;rounded=1;fillColor=%fill%;strokeColor=%stroke%;\n#\n## Parent style for nodes with child nodes (placeholders are replaced once).\n#\n# parentstyle: swimlane;whiteSpace=wrap;html=1;childLayout=stackLayout;horizontal=1;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;\n#\n## Style to be used for objects not in the CSV. If this is - then such objects are ignored,\n## else they are created using this as their style, eg. whiteSpace=wrap;html=1;\n#\n# unknownStyle: -\n#\n## Optional column name that contains a reference to a named style in styles.\n## Default is the current style for nodes.\n#\n# stylename: -\n#\n## JSON for named styles of the form {"name": "style", "name": "style"} where style is a cell style with\n## placeholders that are replaced once.\n#\n# styles: -\n#\n## JSON for variables in styles of the form {"name": "value", "name": "value"} where name is a string\n## that will replace a placeholder in a style.\n#\n# vars: -\n#\n## Optional column name that contains a reference to a named label in labels.\n## Default is the current label.\n#\n# labelname: -\n#\n## JSON for named labels of the form {"name": "label", "name": "label"} where label is a cell label with\n## placeholders.\n#\n# labels: -\n#\n## Uses the given column name as the identity for cells (updates existing cells).\n## Default is no identity (empty value or -).\n#\n# identity: -\n#\n## Uses the given column name as the parent reference for cells. Default is no parent (empty or -).\n## The identity above is used for resolving the reference so it must be specified.\n#\n# parent: -\n#\n## Adds a prefix to the identity of cells to make sure they do not collide with existing cells (whose\n## IDs are numbers from 0..n, sometimes with a GUID prefix in the context of realtime collaboration).\n## Default is csvimport-.\n#\n# namespace: csvimport-\n#\n## Connections between rows ("from": source colum, "to": target column).\n## Label, style and invert are optional. Defaults are \'\', current style and false.\n## If placeholders are used in the style, they are replaced with data from the source.\n## An optional placeholders can be set to target to use data from the target instead.\n## In addition to label, an optional fromlabel and tolabel can be used to name the column\n## that contains the text for the label in the edges source or target (invert ignored).\n## In addition to those, an optional source and targetlabel can be used to specify a label\n## that contains placeholders referencing the respective columns in the source or target row.\n## The label is created in the form fromlabel + sourcelabel + label + tolabel + targetlabel.\n## Additional labels can be added by using an optional labels array with entries of the\n## form {"label": string, "x": number, "y": number, "dx": number, "dy": number} where\n## x is from -1 to 1 along the edge, y is orthogonal, and dx/dy are offsets in pixels.\n## An optional placeholders with the string value "source" or "target" can be specified\n## to replace placeholders in the additional label with data from the source or target.\n## An optional data object can be specified to define the metadata for the connector.\n## The target column may contain a comma-separated list of values.\n## Multiple connect entries are allowed.\n#\n# connect: {"from": "manager", "to": "name", "invert": true, "label": "manages", \\\n# "style": "curved=1;endArrow=blockThin;endFill=1;fontSize=11;"}\n# connect: {"from": "refs", "to": "id", "style": "curved=1;fontSize=11;"}\n#\n## Node x-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# left: \n#\n## Node y-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# top: \n#\n## Node width. Possible value is a number (in px), auto or an @ sign followed by a column\n## name that contains the value for the width. Default is auto.\n#\n# width: auto\n#\n## Node height. Possible value is a number (in px), auto, width or an @ sign followed by a column\n## name that contains the value for the height. Default is auto.\n#\n# height: auto\n#\n## Collapsed state for vertices. Possible values are true or false. Default is false.\n#\n# collapsed: false\n#\n## Padding for autosize. Default is 0.\n#\n# padding: -12\n#\n## Comma-separated list of ignored columns for metadata. (These can be\n## used for connections and styles but will not be added as metadata.)\n#\n# ignore: id,image,fill,stroke,refs,manager\n#\n## Column to be renamed to link attribute (used as link).\n#\n# link: url\n#\n## Spacing between nodes. Default is 40.\n#\n# nodespacing: 40\n#\n## Spacing between levels of hierarchical layouts. Default is 100.\n#\n# levelspacing: 100\n#\n## Spacing between parallel edges. Default is 40. Use 0 to disable.\n#\n# edgespacing: 40\n#\n## Name or JSON of layout. Possible values are auto, none, verticaltree, horizontaltree,\n## verticalflow, horizontalflow, organic, circle, orgchart or a JSON string as used in\n## Layout, Apply. Default is auto.\n#\n# layout: auto\n#\n## ---- CSV below this line. First line are column names. ----\nname,position,id,location,manager,email,fill,stroke,refs,url,image\nTessa Miller,CFO,emi,Office 1,,[email protected],default,#6c8ebf,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png\nEdward Morrison,Brand Manager,emo,Office 2,Tessa Miller,[email protected],default,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-10-3-128.png\nAlison Donovan,System Admin,rdo,Office 3,Tessa Miller,[email protected],default,#82b366,"emo,tva",https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-2-128.png\nEvan Valet,HR Director,tva,Office 4,Tessa Miller,[email protected],default,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png\n';-Editor.createRoughCanvas=function(n){var z=rough.canvas({getContext:function(){return n}});z.draw=function(D){var L=D.sets||[];D=D.options||this.getDefaultOptions();for(var N=0;N<L.length;N++){var R=L[N];switch(R.type){case "path":null!=D.stroke&&this._drawToContext(n,R,D);break;case "fillPath":this._drawToContext(n,R,D);break;case "fillSketch":this.fillSketch(n,R,D)}}};z.fillSketch=function(D,L,N){var R=n.state.strokeColor,T=n.state.strokeWidth,U=n.state.strokeAlpha,W=n.state.dashed,X=N.fillWeight;-0>X&&(X=N.strokeWidth/2);n.setStrokeAlpha(n.state.fillAlpha);n.setStrokeColor(N.fill||"");n.setStrokeWidth(X);n.setDashed(!1);this._drawToContext(D,L,N);n.setDashed(W);n.setStrokeWidth(T);n.setStrokeColor(R);n.setStrokeAlpha(U)};z._drawToContext=function(D,L,N){D.begin();for(var R=0;R<L.ops.length;R++){var T=L.ops[R],U=T.data;switch(T.op){case "move":D.moveTo(U[0],U[1]);break;case "bcurveTo":D.curveTo(U[0],U[1],U[2],U[3],U[4],U[5]);break;case "lineTo":D.lineTo(U[0],U[1])}}D.end();"fillPath"===L.type&&-N.filled?D.fill():D.stroke()};return z};(function(){function n(R,T,U){this.canvas=R;this.rc=T;this.shape=U;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=mxUtils.bind(this,n.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,n.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,n.prototype.rect);this.originalRoundrect=this.canvas.roundrect;this.canvas.roundrect=+dispName:"Tree Moving",type:"bool",defVal:!1},{name:"pointerEvents",dispName:"Pointer Events",type:"bool",defVal:!0,isVisible:function(n,A){var E=mxUtils.getValue(n.style,mxConstants.STYLE_FILLCOLOR,null);return!mxShape.forceFilledPointerEvents||A.editorUi.editor.graph.isSwimlane(n.vertices[0])||null==E||E==mxConstants.NONE||0==mxUtils.getValue(n.style,mxConstants.STYLE_FILL_OPACITY,100)||0==mxUtils.getValue(n.style,mxConstants.STYLE_OPACITY,100)||null!=n.style.pointerEvents}},{name:"moveCells",dispName:"Move Cells on Fold",+type:"bool",defVal:!1,isVisible:function(n,A){return 0<n.vertices.length&&A.editorUi.editor.graph.isContainer(n.vertices[0])}}].concat(Editor.commonProperties);Editor.defaultCsvValue='##\n## Example CSV import. Use ## for comments and # for configuration. Paste CSV below.\n## The following names are reserved and should not be used (or ignored):\n## id, tooltip, placeholder(s), link and label (see below)\n##\n#\n## Node label with placeholders and HTML.\n## Default is \'%name_of_first_column%\'.\n#\n# label: %name%<br><i style="color:gray;">%position%</i><br><a href="mailto:%email%">Email</a>\n#\n## Node style (placeholders are replaced once).\n## Default is the current style for nodes.\n#\n# style: label;image=%image%;whiteSpace=wrap;html=1;rounded=1;fillColor=%fill%;strokeColor=%stroke%;\n#\n## Parent style for nodes with child nodes (placeholders are replaced once).\n#\n# parentstyle: swimlane;whiteSpace=wrap;html=1;childLayout=stackLayout;horizontal=1;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;\n#\n## Style to be used for objects not in the CSV. If this is - then such objects are ignored,\n## else they are created using this as their style, eg. whiteSpace=wrap;html=1;\n#\n# unknownStyle: -\n#\n## Optional column name that contains a reference to a named style in styles.\n## Default is the current style for nodes.\n#\n# stylename: -\n#\n## JSON for named styles of the form {"name": "style", "name": "style"} where style is a cell style with\n## placeholders that are replaced once.\n#\n# styles: -\n#\n## JSON for variables in styles of the form {"name": "value", "name": "value"} where name is a string\n## that will replace a placeholder in a style.\n#\n# vars: -\n#\n## Optional column name that contains a reference to a named label in labels.\n## Default is the current label.\n#\n# labelname: -\n#\n## JSON for named labels of the form {"name": "label", "name": "label"} where label is a cell label with\n## placeholders.\n#\n# labels: -\n#\n## Uses the given column name as the identity for cells (updates existing cells).\n## Default is no identity (empty value or -).\n#\n# identity: -\n#\n## Uses the given column name as the parent reference for cells. Default is no parent (empty or -).\n## The identity above is used for resolving the reference so it must be specified.\n#\n# parent: -\n#\n## Adds a prefix to the identity of cells to make sure they do not collide with existing cells (whose\n## IDs are numbers from 0..n, sometimes with a GUID prefix in the context of realtime collaboration).\n## Default is csvimport-.\n#\n# namespace: csvimport-\n#\n## Connections between rows ("from": source colum, "to": target column).\n## Label, style and invert are optional. Defaults are \'\', current style and false.\n## If placeholders are used in the style, they are replaced with data from the source.\n## An optional placeholders can be set to target to use data from the target instead.\n## In addition to label, an optional fromlabel and tolabel can be used to name the column\n## that contains the text for the label in the edges source or target (invert ignored).\n## In addition to those, an optional source and targetlabel can be used to specify a label\n## that contains placeholders referencing the respective columns in the source or target row.\n## The label is created in the form fromlabel + sourcelabel + label + tolabel + targetlabel.\n## Additional labels can be added by using an optional labels array with entries of the\n## form {"label": string, "x": number, "y": number, "dx": number, "dy": number} where\n## x is from -1 to 1 along the edge, y is orthogonal, and dx/dy are offsets in pixels.\n## An optional placeholders with the string value "source" or "target" can be specified\n## to replace placeholders in the additional label with data from the source or target.\n## An optional data object can be specified to define the metadata for the connector.\n## The target column may contain a comma-separated list of values.\n## Multiple connect entries are allowed.\n#\n# connect: {"from": "manager", "to": "name", "invert": true, "label": "manages", \\\n# "style": "curved=1;endArrow=blockThin;endFill=1;fontSize=11;"}\n# connect: {"from": "refs", "to": "id", "style": "curved=1;fontSize=11;"}\n#\n## Node x-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# left: \n#\n## Node y-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# top: \n#\n## Node width. Possible value is a number (in px), auto or an @ sign followed by a column\n## name that contains the value for the width. Default is auto.\n#\n# width: auto\n#\n## Node height. Possible value is a number (in px), auto, width or an @ sign followed by a column\n## name that contains the value for the height. Default is auto.\n#\n# height: auto\n#\n## Collapsed state for vertices. Possible values are true or false. Default is false.\n#\n# collapsed: false\n#\n## Padding for autosize. Default is 0.\n#\n# padding: -12\n#\n## Comma-separated list of ignored columns for metadata. (These can be\n## used for connections and styles but will not be added as metadata.)\n#\n# ignore: id,image,fill,stroke,refs,manager\n#\n## Column to be renamed to link attribute (used as link).\n#\n# link: url\n#\n## Spacing between nodes. Default is 40.\n#\n# nodespacing: 40\n#\n## Spacing between levels of hierarchical layouts. Default is 100.\n#\n# levelspacing: 100\n#\n## Spacing between parallel edges. Default is 40. Use 0 to disable.\n#\n# edgespacing: 40\n#\n## Name or JSON of layout. Possible values are auto, none, verticaltree, horizontaltree,\n## verticalflow, horizontalflow, organic, circle, orgchart or a JSON string as used in\n## Layout, Apply. Default is auto.\n#\n# layout: auto\n#\n## ---- CSV below this line. First line are column names. ----\nname,position,id,location,manager,email,fill,stroke,refs,url,image\nTessa Miller,CFO,emi,Office 1,,[email protected],default,#6c8ebf,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png\nEdward Morrison,Brand Manager,emo,Office 2,Tessa Miller,[email protected],default,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-10-3-128.png\nAlison Donovan,System Admin,rdo,Office 3,Tessa Miller,[email protected],default,#82b366,"emo,tva",https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-2-128.png\nEvan Valet,HR Director,tva,Office 4,Tessa Miller,[email protected],default,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png\n';+Editor.createRoughCanvas=function(n){var A=rough.canvas({getContext:function(){return n}});A.draw=function(E){var L=E.sets||[];E=E.options||this.getDefaultOptions();for(var O=0;O<L.length;O++){var R=L[O];switch(R.type){case "path":null!=E.stroke&&this._drawToContext(n,R,E);break;case "fillPath":this._drawToContext(n,R,E);break;case "fillSketch":this.fillSketch(n,R,E)}}};A.fillSketch=function(E,L,O){var R=n.state.strokeColor,T=n.state.strokeWidth,U=n.state.strokeAlpha,W=n.state.dashed,X=O.fillWeight;+0>X&&(X=O.strokeWidth/2);n.setStrokeAlpha(n.state.fillAlpha);n.setStrokeColor(O.fill||"");n.setStrokeWidth(X);n.setDashed(!1);this._drawToContext(E,L,O);n.setDashed(W);n.setStrokeWidth(T);n.setStrokeColor(R);n.setStrokeAlpha(U)};A._drawToContext=function(E,L,O){E.begin();for(var R=0;R<L.ops.length;R++){var T=L.ops[R],U=T.data;switch(T.op){case "move":E.moveTo(U[0],U[1]);break;case "bcurveTo":E.curveTo(U[0],U[1],U[2],U[3],U[4],U[5]);break;case "lineTo":E.lineTo(U[0],U[1])}}E.end();"fillPath"===L.type&&+O.filled?E.fill():E.stroke()};return A};(function(){function n(R,T,U){this.canvas=R;this.rc=T;this.shape=U;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=mxUtils.bind(this,n.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,n.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,n.prototype.rect);this.originalRoundrect=this.canvas.roundrect;this.canvas.roundrect=mxUtils.bind(this,n.prototype.roundrect);this.originalEllipse=this.canvas.ellipse;this.canvas.ellipse=mxUtils.bind(this,n.prototype.ellipse);this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,n.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,n.prototype.moveTo);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,n.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,n.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,n.prototype.arcTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,n.prototype.close);this.originalFill=this.canvas.fill;this.canvas.fill=mxUtils.bind(this,n.prototype.fill);this.originalStroke=this.canvas.stroke;this.canvas.stroke=mxUtils.bind(this,n.prototype.stroke);this.originalFillAndStroke=this.canvas.fillAndStroke;this.canvas.fillAndStroke=mxUtils.bind(this,n.prototype.fillAndStroke);this.path=[];this.passThrough=!1}n.prototype.moveOp="M";n.prototype.lineOp="L";n.prototype.quadOp="Q";n.prototype.curveOp="C";n.prototype.closeOp="Z";n.prototype.getStyle=function(R,T){var U=1;if(null!=this.shape.state){var W=this.shape.state.cell.id;if(null!=W)for(var X=0;X<W.length;X++)U=(U<<5)-U+W.charCodeAt(X)<<0}U={strokeWidth:this.canvas.state.strokeWidth,seed:U,preserveVertices:!0};W=this.rc.getDefaultOptions();U.stroke=R?this.canvas.state.strokeColor===mxConstants.NONE?"transparent":this.canvas.state.strokeColor:@@ -12743,77 +12749,77 @@ this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,R,T,U,Wfunction(R,T,U,W,X,Y){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(R+X,T),this.lineTo(R+U-X,T),this.quadTo(R+U,T,R+U,T+Y),this.lineTo(R+U,T+W-Y),this.quadTo(R+U,T+W,R+U-X,T+W),this.lineTo(R+X,T+W),this.quadTo(R,T+W,R,T+W-Y),this.lineTo(R,T+Y),this.quadTo(R,T,R+X,T))};n.prototype.drawPath=function(R){if(0<this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),R)}catch(U){}this.passThrough=!1}else if(null!=this.nextShape){for(var T in R)this.nextShape.options[T]=R[T];R.stroke!=mxConstants.NONE&&null!=R.stroke||delete this.nextShape.options.stroke;R.filled||delete this.nextShape.options.fill;this.passThrough=!0;this.rc.draw(this.nextShape);this.passThrough=!1}};n.prototype.stroke=function(){this.passThrough?this.originalStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!1))};n.prototype.fill=function(){this.passThrough?this.originalFill.apply(this.canvas,arguments):this.drawPath(this.getStyle(!1,!0))};n.prototype.fillAndStroke=function(){this.passThrough?this.originalFillAndStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!0))};n.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo;this.canvas.close=this.originalClose;this.canvas.fill=this.originalFill;this.canvas.stroke=this.originalStroke;this.canvas.fillAndStroke=this.originalFillAndStroke;-this.canvas.begin=this.originalBegin;this.canvas.end=this.originalEnd;this.canvas.rect=this.originalRect;this.canvas.ellipse=this.originalEllipse;this.canvas.roundrect=this.originalRoundrect};mxShape.prototype.createRoughCanvas=function(R){return new n(R,Editor.createRoughCanvas(R),this)};var z=mxShape.prototype.createHandJiggle;mxShape.prototype.createHandJiggle=function(R){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?z.apply(this,arguments):"comic"==mxUtils.getValue(this.style,-"sketchStyle","rough")?this.createComicCanvas(R):this.createRoughCanvas(R)};var D=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(R,T,U,W,X){null!=R.handJiggle&&R.handJiggle.passThrough||D.apply(this,arguments)};var L=mxShape.prototype.paint;mxShape.prototype.paint=function(R){var T=R.addTolerance,U=!0;null!=this.style&&(U="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=R.handJiggle&&R.handJiggle.constructor==n&&!this.outline){R.save();+this.canvas.begin=this.originalBegin;this.canvas.end=this.originalEnd;this.canvas.rect=this.originalRect;this.canvas.ellipse=this.originalEllipse;this.canvas.roundrect=this.originalRoundrect};mxShape.prototype.createRoughCanvas=function(R){return new n(R,Editor.createRoughCanvas(R),this)};var A=mxShape.prototype.createHandJiggle;mxShape.prototype.createHandJiggle=function(R){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?A.apply(this,arguments):"comic"==mxUtils.getValue(this.style,+"sketchStyle","rough")?this.createComicCanvas(R):this.createRoughCanvas(R)};var E=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(R,T,U,W,X){null!=R.handJiggle&&R.handJiggle.passThrough||E.apply(this,arguments)};var L=mxShape.prototype.paint;mxShape.prototype.paint=function(R){var T=R.addTolerance,U=!0;null!=this.style&&(U="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=R.handJiggle&&R.handJiggle.constructor==n&&!this.outline){R.save();var W=this.fill,X=this.stroke;this.stroke=this.fill=null;var Y=this.configurePointerEvents,Z=R.setStrokeColor;R.setStrokeColor=function(){};var ca=R.setFillColor;R.setFillColor=function(){};U||null==W||(this.configurePointerEvents=function(){});R.handJiggle.passThrough=!0;L.apply(this,arguments);R.handJiggle.passThrough=!1;R.setFillColor=ca;R.setStrokeColor=Z;this.configurePointerEvents=Y;this.stroke=X;this.fill=W;R.restore();U&&null!=W&&(R.addTolerance=function(){})}L.apply(this,arguments);R.addTolerance=-T};var N=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(R,T,U,W,X,Y){null!=R.handJiggle&&R.handJiggle.constructor==n?(R.handJiggle.passThrough=!0,N.apply(this,arguments),R.handJiggle.passThrough=!1):N.apply(this,arguments)}})();Editor.fastCompress=function(n){return null==n||0==n.length||"undefined"===typeof pako?n:Graph.arrayBufferToString(pako.deflateRaw(n))};Editor.fastDecompress=function(n){return null==n||0==n.length||"undefined"===typeof pako?n:pako.inflateRaw(Graph.stringToArrayBuffer(atob(n)),-{to:"string"})};Editor.extractGraphModel=function(n,z,D){if(null!=n&&"undefined"!==typeof pako){var L=n.ownerDocument.getElementsByTagName("div"),N=[];if(null!=L&&0<L.length)for(var R=0;R<L.length;R++)if("mxgraph"==L[R].getAttribute("class")){N.push(L[R]);break}0<N.length&&(L=N[0].getAttribute("data-mxgraph"),null!=L?(N=JSON.parse(L),null!=N&&null!=N.xml&&(n=mxUtils.parseXml(N.xml),n=n.documentElement)):(N=N[0].getElementsByTagName("div"),0<N.length&&(L=mxUtils.getTextContent(N[0]),L=Graph.decompress(L,-null,D),0<L.length&&(n=mxUtils.parseXml(L),n=n.documentElement))))}if(null!=n&&"svg"==n.nodeName)if(L=n.getAttribute("content"),null!=L&&"<"!=L.charAt(0)&&"%"!=L.charAt(0)&&(L=unescape(window.atob?atob(L):Base64.decode(cont,L))),null!=L&&"%"==L.charAt(0)&&(L=decodeURIComponent(L)),null!=L&&0<L.length)n=mxUtils.parseXml(L).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==n||z||(N=null,"diagram"==n.nodeName?N=n:"mxfile"==n.nodeName&&(L=n.getElementsByTagName("diagram"),0<-L.length&&(N=L[Math.max(0,Math.min(L.length-1,urlParams.page||0))])),null!=N&&(n=Editor.parseDiagramNode(N,D)));null==n||"mxGraphModel"==n.nodeName||z&&"mxfile"==n.nodeName||(n=null);return n};Editor.parseDiagramNode=function(n,z,D){Editor.validateDiagramNode(n);var L=mxUtils.trim(mxUtils.getTextContent(n)),N=null;0<L.length?(z=Graph.decompress(L,null,z),null!=z&&0<z.length&&(N=mxUtils.parseXml(z).documentElement)):(n=mxUtils.getChildNodes(n),0<n.length&&(N=n[0],D&&(N=Editor.parseDiagramNode(N,z,-!1)),z=mxUtils.createXmlDocument(),z.appendChild(z.importNode(N,!0)),N=z.documentElement));return N};Editor.getDiagramNodeXml=function(n){Editor.validateDiagramNode(n);var z=mxUtils.getNodeValue(n),D=null;0<z.length?D=Graph.decompress(z):(n=n.getElementsByTagName("mxGraphModel"),null!=n&&0<n.length&&(D=mxUtils.getXml(n[0])));return D};Editor.validateDiagramNode=function(n){if(0==mxUtils.trim(mxUtils.getTextContent(n)).length&&0==mxUtils.getChildNodes(n).length){var z=new mxCodec,D=new mxGraphModel;-n.appendChild(z.encode(D))}return n};Editor.extractGraphModelFromPdf=function(n){var z=null;n=n.substring(n.indexOf(",")+1);n=window.atob&&!mxClient.IS_SF?atob(n):Base64.decode(n,!0);if("%PDF-1.7"==n.substring(0,8)){var D=n.indexOf("EmbeddedFile");if(-1<D){var L=n.indexOf("stream",D)+9;if(0<n.substring(D,L).indexOf("application#2Fvnd.jgraph.mxfile")){var N=n.indexOf("endstream",L-1);return pako.inflateRaw(Graph.stringToArrayBuffer(n.substring(L,N)),{to:"string"})}}for(D=n.indexOf("/ObjStm");0<D;){L=-n.indexOf("stream",D)+9;N=n.indexOf("endstream",L-1);L=pako.inflateRaw(Graph.stringToArrayBuffer(n.substring(L,N)),{to:"string"});N=L.indexOf("/Subject <");if(0<N){D=L.substring(N+14,L.indexOf(">",N));if(null!=D){z=D;D=[];for(L=0;L<z.length;L+=2)N=z.substr(L,2),"00"!=N&&D.push(String.fromCharCode(parseInt(N,16)));z=D.join("")}break}D=n.indexOf("/ObjStm",D+1)}}if(null==z&&"%PDF-1.4"==n.substring(0,8)){D="";N=L=0;for(var R=[],T=null;N<n.length;){var U=n.charCodeAt(N);N+=1;10!=U&&(D+=String.fromCharCode(U));-U=="/Subject (%3Cmxfile".charCodeAt(L)?L++:L=0;if(19==L){var W=n.indexOf("%3C%2Fmxfile%3E",N)+15;N-=9;if(W>N){z=n.substring(N,W);break}}10==U&&("endobj"==D?T=null:"obj"==D.substring(D.length-3,D.length)||"xref"==D||"trailer"==D?(T=[],R[D.split(" ")[0]]=T):null!=T&&T.push(D),D="")}}null==z&&null!=R&&(z=Editor.extractGraphModelFromXref(R));null!=z&&(z=decodeURIComponent(z.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return z};Editor.extractGraphModelFromXref=function(n){var z=n.trailer,D=null;null!=-z&&(z=/.* \/Info (\d+) (\d+) R/g.exec(z.join("\n")),null!=z&&0<z.length&&(z=n[z[1]],null!=z&&(z=/.* \/Subject (\d+) (\d+) R/g.exec(z.join("\n")),null!=z&&0<z.length&&(n=n[z[1]],null!=n&&(n=n.join("\n"),D=n.substring(1,n.length-1))))));return D};Editor.extractParserError=function(n,z){var D=null;n=null!=n?n.getElementsByTagName("parsererror"):null;null!=n&&0<n.length&&(D=z||mxResources.get("invalidChars"),z=n[0].getElementsByTagName("div"),0<z.length&&(D=mxUtils.getTextContent(z[0])));return null!=-D?mxUtils.trim(D):D};Editor.addRetryToError=function(n,z){null!=n&&(n=null!=n.error?n.error:n,null==n.retry&&(n.retry=z))};Editor.mermaidToDrawio=function(n,z,D){if("function"===typeof mxMermaidToDrawio)return mxMermaidToDrawio(n,z,D)};Editor.configure=function(n){if(null!=n){Editor.config=n;Editor.configVersion=n.version;n.debug&&(urlParams.test="1");null!=n.defaultFonts&&(Menus.prototype.defaultFonts=n.defaultFonts);null!=n.presetColors&&(ColorDialog.prototype.presetColors=n.presetColors);null!=+T};var O=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(R,T,U,W,X,Y){null!=R.handJiggle&&R.handJiggle.constructor==n?(R.handJiggle.passThrough=!0,O.apply(this,arguments),R.handJiggle.passThrough=!1):O.apply(this,arguments)}})();Editor.fastCompress=function(n){return null==n||0==n.length||"undefined"===typeof pako?n:Graph.arrayBufferToString(pako.deflateRaw(n))};Editor.fastDecompress=function(n){return null==n||0==n.length||"undefined"===typeof pako?n:pako.inflateRaw(Graph.stringToArrayBuffer(atob(n)),+{to:"string"})};Editor.extractGraphModel=function(n,A,E){if(null!=n&&"undefined"!==typeof pako){var L=n.ownerDocument.getElementsByTagName("div"),O=[];if(null!=L&&0<L.length)for(var R=0;R<L.length;R++)if("mxgraph"==L[R].getAttribute("class")){O.push(L[R]);break}0<O.length&&(L=O[0].getAttribute("data-mxgraph"),null!=L?(O=JSON.parse(L),null!=O&&null!=O.xml&&(n=mxUtils.parseXml(O.xml),n=n.documentElement)):(O=O[0].getElementsByTagName("div"),0<O.length&&(L=mxUtils.getTextContent(O[0]),L=Graph.decompress(L,+null,E),0<L.length&&(n=mxUtils.parseXml(L),n=n.documentElement))))}if(null!=n&&"svg"==n.nodeName)if(L=n.getAttribute("content"),null!=L&&"<"!=L.charAt(0)&&"%"!=L.charAt(0)&&(L=unescape(window.atob?atob(L):Base64.decode(cont,L))),null!=L&&"%"==L.charAt(0)&&(L=decodeURIComponent(L)),null!=L&&0<L.length)n=mxUtils.parseXml(L).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==n||A||(O=null,"diagram"==n.nodeName?O=n:"mxfile"==n.nodeName&&(L=n.getElementsByTagName("diagram"),0<+L.length&&(O=L[Math.max(0,Math.min(L.length-1,urlParams.page||0))])),null!=O&&(n=Editor.parseDiagramNode(O,E)));null==n||"mxGraphModel"==n.nodeName||A&&"mxfile"==n.nodeName||(n=null);return n};Editor.parseDiagramNode=function(n,A,E){Editor.validateDiagramNode(n);var L=mxUtils.trim(mxUtils.getTextContent(n)),O=null;0<L.length?(A=Graph.decompress(L,null,A),null!=A&&0<A.length&&(O=mxUtils.parseXml(A).documentElement)):(n=mxUtils.getChildNodes(n),0<n.length&&(O=n[0],E&&(O=Editor.parseDiagramNode(O,A,+!1)),A=mxUtils.createXmlDocument(),A.appendChild(A.importNode(O,!0)),O=A.documentElement));return O};Editor.getDiagramNodeXml=function(n){Editor.validateDiagramNode(n);var A=mxUtils.getNodeValue(n),E=null;0<A.length?E=Graph.decompress(A):(n=n.getElementsByTagName("mxGraphModel"),null!=n&&0<n.length&&(E=mxUtils.getXml(n[0])));return E};Editor.validateDiagramNode=function(n){if(0==mxUtils.trim(mxUtils.getTextContent(n)).length&&0==mxUtils.getChildNodes(n).length){var A=new mxCodec,E=new mxGraphModel;+n.appendChild(A.encode(E))}return n};Editor.extractGraphModelFromPdf=function(n){var A=null;n=n.substring(n.indexOf(",")+1);n=window.atob&&!mxClient.IS_SF?atob(n):Base64.decode(n,!0);if("%PDF-1.7"==n.substring(0,8)){var E=n.indexOf("EmbeddedFile");if(-1<E){var L=n.indexOf("stream",E)+9;if(0<n.substring(E,L).indexOf("application#2Fvnd.jgraph.mxfile")){var O=n.indexOf("endstream",L-1);return pako.inflateRaw(Graph.stringToArrayBuffer(n.substring(L,O)),{to:"string"})}}for(E=n.indexOf("/ObjStm");0<E;){L=+n.indexOf("stream",E)+9;O=n.indexOf("endstream",L-1);L=pako.inflateRaw(Graph.stringToArrayBuffer(n.substring(L,O)),{to:"string"});O=L.indexOf("/Subject <");if(0<O){E=L.substring(O+14,L.indexOf(">",O));if(null!=E){A=E;E=[];for(L=0;L<A.length;L+=2)O=A.substr(L,2),"00"!=O&&E.push(String.fromCharCode(parseInt(O,16)));A=E.join("")}break}E=n.indexOf("/ObjStm",E+1)}}if(null==A&&"%PDF-1.4"==n.substring(0,8)){E="";O=L=0;for(var R=[],T=null;O<n.length;){var U=n.charCodeAt(O);O+=1;10!=U&&(E+=String.fromCharCode(U));+U=="/Subject (%3Cmxfile".charCodeAt(L)?L++:L=0;if(19==L){var W=n.indexOf("%3C%2Fmxfile%3E",O)+15;O-=9;if(W>O){A=n.substring(O,W);break}}10==U&&("endobj"==E?T=null:"obj"==E.substring(E.length-3,E.length)||"xref"==E||"trailer"==E?(T=[],R[E.split(" ")[0]]=T):null!=T&&T.push(E),E="")}}null==A&&null!=R&&(A=Editor.extractGraphModelFromXref(R));null!=A&&(A=decodeURIComponent(A.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return A};Editor.extractGraphModelFromXref=function(n){var A=n.trailer,E=null;null!=+A&&(A=/.* \/Info (\d+) (\d+) R/g.exec(A.join("\n")),null!=A&&0<A.length&&(A=n[A[1]],null!=A&&(A=/.* \/Subject (\d+) (\d+) R/g.exec(A.join("\n")),null!=A&&0<A.length&&(n=n[A[1]],null!=n&&(n=n.join("\n"),E=n.substring(1,n.length-1))))));return E};Editor.extractParserError=function(n,A){var E=null;n=null!=n?n.getElementsByTagName("parsererror"):null;null!=n&&0<n.length&&(E=A||mxResources.get("invalidChars"),A=n[0].getElementsByTagName("div"),0<A.length&&(E=mxUtils.getTextContent(A[0])));return null!=+E?mxUtils.trim(E):E};Editor.addRetryToError=function(n,A){null!=n&&(n=null!=n.error?n.error:n,null==n.retry&&(n.retry=A))};Editor.mermaidToDrawio=function(n,A,E){if("function"===typeof mxMermaidToDrawio)return mxMermaidToDrawio(n,A,E)};Editor.configure=function(n){if(null!=n){Editor.config=n;Editor.configVersion=n.version;n.debug&&(urlParams.test="1");null!=n.defaultFonts&&(Menus.prototype.defaultFonts=n.defaultFonts);null!=n.presetColors&&(ColorDialog.prototype.presetColors=n.presetColors);null!=n.defaultColors&&(ColorDialog.prototype.defaultColors=n.defaultColors);null!=n.colorNames&&(ColorDialog.prototype.colorNames=n.colorNames);null!=n.defaultColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=n.defaultColorSchemes);null!=n.defaultEdgeLength&&(Graph.prototype.defaultEdgeLength=n.defaultEdgeLength);null!=n.selectParentLayer&&(Graph.selectParentLayer=n.selectParentLayer);null!=n.autosaveDelay&&(DrawioFile.prototype.autosaveDelay=n.autosaveDelay);null!=n.templateFile&&(EditorUi.templateFile=n.templateFile);null!=n.styles&&(Array.isArray(n.styles)?Editor.styles=n.styles:EditorUi.debug("Configuration Error: Array expected for styles"));null!=n.globalVars&&(Editor.globalVars=n.globalVars);null!=n.compressXml&&(Editor.defaultCompressed=n.compressXml,Editor.compressXml=n.compressXml);null!=n.includeDiagram&&(Editor.defaultIncludeDiagram=n.includeDiagram);null!=n.simpleLabels&&(Editor.simpleLabels=n.simpleLabels);null!=n.oneDriveInlinePicker&&(Editor.oneDriveInlinePicker=n.oneDriveInlinePicker);null!=n.defaultAdaptiveColors?Graph.defaultAdaptiveColors=n.defaultAdaptiveColors:0==n.enableCssDarkMode&&(Graph.defaultAdaptiveColors="simple");null!=n.enableLightDarkColors&&(mxUtils.lightDarkColorSupported=n.enableLightDarkColors);null!=n.darkColor&&(Editor.darkColor=n.darkColor);null!=n.darkColorVar&&(Editor.darkColorVar=n.darkColorVar);Graph.prototype.defaultPageBackgroundColor="light-dark(#ffffff, "+Editor.darkColor+")";Graph.prototype.shapeBackgroundColor="light-dark(#ffffff, var("+Editor.darkColorVar+", "+Editor.darkColor+"))";null!=n.settingsName&&(Editor.configurationKey="."+n.settingsName+"-configuration",Editor.settingsKey="."+n.settingsName+"-config",mxSettings.key=Editor.settingsKey);null!=n.customFonts&&(Menus.prototype.defaultFonts=n.customFonts.concat(Menus.prototype.defaultFonts));null!=n.customPresetColors&&(ColorDialog.prototype.presetColors=n.customPresetColors.concat(ColorDialog.prototype.presetColors));null!=n.customColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=-n.customColorSchemes.concat(StyleFormatPanel.prototype.defaultColorSchemes));if(null!=n.css){var z=document.createElement("style");z.setAttribute("type","text/css");z.appendChild(document.createTextNode(n.css));var D=document.getElementsByTagName("script")[0];D.parentNode.insertBefore(z,D)}null!=n.expandLibraries&&(Sidebar.prototype.expandLibraries=n.expandLibraries);null!=n.appendCustomLibraries&&(Sidebar.prototype.appendCustomLibraries=n.appendCustomLibraries);null!=n.libraries&&(Sidebar.prototype.customEntries=+n.customColorSchemes.concat(StyleFormatPanel.prototype.defaultColorSchemes));if(null!=n.css){var A=document.createElement("style");A.setAttribute("type","text/css");A.appendChild(document.createTextNode(n.css));var E=document.getElementsByTagName("script")[0];E.parentNode.insertBefore(A,E)}null!=n.expandLibraries&&(Sidebar.prototype.expandLibraries=n.expandLibraries);null!=n.appendCustomLibraries&&(Sidebar.prototype.appendCustomLibraries=n.appendCustomLibraries);null!=n.libraries&&(Sidebar.prototype.customEntries=n.libraries);null!=n.enabledLibraries&&(Array.isArray(n.enabledLibraries)?Sidebar.prototype.enabledLibraries=n.enabledLibraries:EditorUi.debug("Configuration Error: Array expected for enabledLibraries"));null!=n.defaultLibraries&&(Sidebar.prototype.defaultEntries=n.defaultLibraries);null!=n.defaultCustomLibraries&&(Editor.defaultCustomLibraries=n.defaultCustomLibraries);null!=n.enableCustomLibraries&&(Editor.enableCustomLibraries=n.enableCustomLibraries);null!=n.defaultVertexStyle&&(Graph.prototype.defaultVertexStyle=-n.defaultVertexStyle);null!=n.defaultEdgeStyle&&(Graph.prototype.defaultEdgeStyle=n.defaultEdgeStyle);null!=n.defaultPageVisible&&(Graph.prototype.defaultPageVisible=n.defaultPageVisible);null!=n.defaultGridEnabled&&(Graph.prototype.defaultGridEnabled=n.defaultGridEnabled);null!=n.zoomWheel&&(Graph.zoomWheel=n.zoomWheel);null!=n.zoomFactor&&(z=parseFloat(n.zoomFactor),!isNaN(z)&&1<z?Graph.prototype.zoomFactor=z:EditorUi.debug("Configuration Error: Float > 1 expected for zoomFactor"));null!=n.defaultGridSize&&-(z=parseInt(n.defaultGridSize),!isNaN(z)&&0<z?mxGraph.prototype.gridSize=z:EditorUi.debug("Configuration Error: Int > 0 expected for defaultGridSize"));null!=n.gridSteps&&(z=parseInt(n.gridSteps),!isNaN(z)&&0<z?mxGraphView.prototype.gridSteps=z:EditorUi.debug("Configuration Error: Int > 0 expected for gridSteps"));null!=n.pageFormat&&(z=parseInt(n.pageFormat.width),D=parseInt(n.pageFormat.height),!isNaN(z)&&0<z&&!isNaN(D)&&0<D?(mxGraph.prototype.defaultPageFormat=new mxRectangle(0,0,z,D),mxGraph.prototype.pageFormat=+n.defaultVertexStyle);null!=n.defaultEdgeStyle&&(Graph.prototype.defaultEdgeStyle=n.defaultEdgeStyle);null!=n.defaultPageVisible&&(Graph.prototype.defaultPageVisible=n.defaultPageVisible);null!=n.defaultGridEnabled&&(Graph.prototype.defaultGridEnabled=n.defaultGridEnabled);null!=n.zoomWheel&&(Graph.zoomWheel=n.zoomWheel);null!=n.zoomFactor&&(A=parseFloat(n.zoomFactor),!isNaN(A)&&1<A?Graph.prototype.zoomFactor=A:EditorUi.debug("Configuration Error: Float > 1 expected for zoomFactor"));null!=n.defaultGridSize&&+(A=parseInt(n.defaultGridSize),!isNaN(A)&&0<A?mxGraph.prototype.gridSize=A:EditorUi.debug("Configuration Error: Int > 0 expected for defaultGridSize"));null!=n.gridSteps&&(A=parseInt(n.gridSteps),!isNaN(A)&&0<A?mxGraphView.prototype.gridSteps=A:EditorUi.debug("Configuration Error: Int > 0 expected for gridSteps"));null!=n.pageFormat&&(A=parseInt(n.pageFormat.width),E=parseInt(n.pageFormat.height),!isNaN(A)&&0<A&&!isNaN(E)&&0<E?(mxGraph.prototype.defaultPageFormat=new mxRectangle(0,0,A,E),mxGraph.prototype.pageFormat=mxGraph.prototype.defaultPageFormat):EditorUi.debug("Configuration Error: {width: int, height: int} expected for pageFormat"));null!=n.thumbWidth&&(Sidebar.prototype.thumbWidth=n.thumbWidth);null!=n.thumbHeight&&(Sidebar.prototype.thumbHeight=n.thumbHeight);null!=n.emptyLibraryXml&&(EditorUi.prototype.emptyLibraryXml=n.emptyLibraryXml);null!=n.emptyDiagramXml&&(EditorUi.prototype.emptyDiagramXml=n.emptyDiagramXml);null!=n.sidebarWidth&&(EditorUi.prototype.hsplitPosition=n.sidebarWidth);null!=n.updateDefaultStyle&&-(EditorUi.prototype.updateDefaultStyle=n.updateDefaultStyle);null!=n.sidebarTitles&&(Sidebar.prototype.sidebarTitles=n.sidebarTitles);null!=n.sidebarTitleSize&&(z=parseInt(n.sidebarTitleSize),!isNaN(z)&&0<z?Sidebar.prototype.sidebarTitleSize=z:EditorUi.debug("Configuration Error: Int > 0 expected for sidebarTitleSize"));null!=n.fontCss&&("string"===typeof n.fontCss?Editor.configureFontCss(n.fontCss):EditorUi.debug("Configuration Error: String expected for fontCss"));null!=n.autosaveDelay&&(z=parseInt(n.autosaveDelay),-!isNaN(z)&&0<z?DrawioFile.prototype.autosaveDelay=z:EditorUi.debug("Configuration Error: Int > 0 expected for autosaveDelay"));null!=n.maxImageBytes&&(EditorUi.prototype.maxImageBytes=n.maxImageBytes);null!=n.maxImageSize&&(EditorUi.prototype.maxImageSize=n.maxImageSize);null!=n.shareCursorPosition&&(EditorUi.prototype.shareCursorPosition=n.shareCursorPosition);null!=n.showRemoteCursors&&(EditorUi.prototype.showRemoteCursors=n.showRemoteCursors);null!=n.restrictExport&&(DrawioFile.RESTRICT_EXPORT=+(EditorUi.prototype.updateDefaultStyle=n.updateDefaultStyle);null!=n.sidebarTitles&&(Sidebar.prototype.sidebarTitles=n.sidebarTitles);null!=n.sidebarTitleSize&&(A=parseInt(n.sidebarTitleSize),!isNaN(A)&&0<A?Sidebar.prototype.sidebarTitleSize=A:EditorUi.debug("Configuration Error: Int > 0 expected for sidebarTitleSize"));null!=n.fontCss&&("string"===typeof n.fontCss?Editor.configureFontCss(n.fontCss):EditorUi.debug("Configuration Error: String expected for fontCss"));null!=n.autosaveDelay&&(A=parseInt(n.autosaveDelay),+!isNaN(A)&&0<A?DrawioFile.prototype.autosaveDelay=A:EditorUi.debug("Configuration Error: Int > 0 expected for autosaveDelay"));null!=n.maxImageBytes&&(EditorUi.prototype.maxImageBytes=n.maxImageBytes);null!=n.maxImageSize&&(EditorUi.prototype.maxImageSize=n.maxImageSize);null!=n.shareCursorPosition&&(EditorUi.prototype.shareCursorPosition=n.shareCursorPosition);null!=n.showRemoteCursors&&(EditorUi.prototype.showRemoteCursors=n.showRemoteCursors);null!=n.restrictExport&&(DrawioFile.RESTRICT_EXPORT=n.restrictExport);null!=n.replaceSvgDataUris&&(Editor.replaceSvgDataUris=n.replaceSvgDataUris);null!=n.foreignObjectImages&&(Editor.foreignObjectImages=n.foreignObjectImages);null!=n.shadowColor&&(mxConstants.SHADOW_COLOR=n.shadowColor);null!=n.shadowOpacity&&(mxConstants.SHADOW_OPACITY=n.shadowOpacity);null!=n.shadowOffsetX&&(mxConstants.SHADOW_OFFSET_X=n.shadowOffsetX);null!=n.shadowOffsetY&&(mxConstants.SHADOW_OFFSET_Y=n.shadowOffsetY);null!=n.shadowBlur&&(mxConstants.SHADOW_BLUR=n.shadowBlur);-null!=n.enableAnimations&&(Editor.enableAnimations=n.enableAnimations);null!=n.enableChatGpt&&(Editor.enableChatGpt=n.enableChatGpt);null!=n.gptApiKey&&(Editor.gptApiKey=n.gptApiKey);null!=n.gptModel&&(Editor.gptModel=n.gptModel);null!=n.gptUrl&&(Editor.gptUrl=n.gptUrl)}};Editor.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.configureFontCss=function(n){if(null!=n){Editor.prototype.fontCss=n;var z=document.getElementsByTagName("script")[0];-if(null!=z&&null!=z.parentNode){var D=document.createElement("style");D.setAttribute("type","text/css");D.appendChild(document.createTextNode(n));z.parentNode.insertBefore(D,z);n=n.split("url(");for(D=1;D<n.length;D++){var L=n[D].indexOf(")");L=Editor.trimCssUrl(n[D].substring(0,L));var N=document.createElement("link");N.setAttribute("rel","preload");N.setAttribute("href",L);N.setAttribute("as","font");N.setAttribute("crossorigin","");z.parentNode.insertBefore(N,z)}}}};Editor.trimCssUrl=function(n){return n.replace(RegExp("^[\\s\"']+",-"g"),"").replace(RegExp("[\\s\"']+$","g"),"")};Editor.GOOGLE_FONTS="https://fonts.googleapis.com/css?family=";Editor.GOOGLE_FONTS_CSS2="https://fonts.googleapis.com/css2?family=";Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";Editor.GUID_LENGTH=20;Editor.guid=function(n){n=null!=n?n:Editor.GUID_LENGTH;for(var z=[],D=0;D<n;D++)z.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*Editor.GUID_ALPHABET.length)));return z.join("")};Editor.updateStatusInterval=+null!=n.enableAnimations&&(Editor.enableAnimations=n.enableAnimations);null!=n.enableChatGpt&&(Editor.enableChatGpt=n.enableChatGpt);null!=n.gptApiKey&&(Editor.gptApiKey=n.gptApiKey);null!=n.gptModel&&(Editor.gptModel=n.gptModel);null!=n.gptUrl&&(Editor.gptUrl=n.gptUrl)}};Editor.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.configureFontCss=function(n){if(null!=n){Editor.prototype.fontCss=n;var A=document.getElementsByTagName("script")[0];+if(null!=A&&null!=A.parentNode){var E=document.createElement("style");E.setAttribute("type","text/css");E.appendChild(document.createTextNode(n));A.parentNode.insertBefore(E,A);n=n.split("url(");for(E=1;E<n.length;E++){var L=n[E].indexOf(")");L=Editor.trimCssUrl(n[E].substring(0,L));var O=document.createElement("link");O.setAttribute("rel","preload");O.setAttribute("href",L);O.setAttribute("as","font");O.setAttribute("crossorigin","");A.parentNode.insertBefore(O,A)}}}};Editor.trimCssUrl=function(n){return n.replace(RegExp("^[\\s\"']+",+"g"),"").replace(RegExp("[\\s\"']+$","g"),"")};Editor.GOOGLE_FONTS="https://fonts.googleapis.com/css?family=";Editor.GOOGLE_FONTS_CSS2="https://fonts.googleapis.com/css2?family=";Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";Editor.GUID_LENGTH=20;Editor.guid=function(n){n=null!=n?n:Editor.GUID_LENGTH;for(var A=[],E=0;E<n;E++)A.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*Editor.GUID_ALPHABET.length)));return A.join("")};Editor.updateStatusInterval=1E4;Editor.prototype.appName="draw.io";Editor.prototype.diagramFileTypes=[{description:"diagramXmlDesc",extension:"drawio",mimeType:"text/xml"},{description:"diagramPngDesc",extension:"png",mimeType:"image/png"},{description:"diagramSvgDesc",extension:"svg",mimeType:"image/svg"},{description:"diagramHtmlDesc",extension:"html",mimeType:"text/html"}];Editor.prototype.libraryFileTypes=[{description:"Library (.drawiolib, .xml)",extensions:["drawiolib","xml"]}];Editor.prototype.fileExtensions=[{ext:"html",-title:"filetypeHtml"},{ext:"png",title:"filetypePng"},{ext:"svg",title:"filetypeSvg"}];Editor.prototype.timeout=25E3;Editor.prototype.editButtonLink=null!=urlParams.edit?decodeURIComponent(urlParams.edit):null;Editor.prototype.crossOriginImages=!mxClient.IS_IE;var b=Editor.prototype.setGraphXml;Editor.prototype.setGraphXml=function(n){n=null!=n&&"mxlibrary"!=n.nodeName?this.extractGraphModel(n):null;if(null!=n){var z=Editor.extractParserError(n,mxResources.get("invalidOrMissingFile"));if(z)throw EditorUi.debug("Editor.setGraphXml ParserError",-[this],"node",[n],"cause",[z]),Error(mxResources.get("notADiagramFile")+" ("+z+")");if("mxGraphModel"==n.nodeName){z=n.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=z&&""!=z)z!=this.graph.currentStyle&&(D=null!=this.graph.themes?this.graph.themes[z]:mxUtils.load(STYLE_PATH+"/"+z+".xml").getDocumentElement(),null!=D&&(L=new mxCodec(D.ownerDocument),L.decode(D,this.graph.getStylesheet())));else{var D=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+-"/default-old.xml").getDocumentElement();if(null!=D){var L=new mxCodec(D.ownerDocument);L.decode(D,this.graph.getStylesheet())}}this.graph.currentStyle=z;this.graph.mathEnabled="1"==urlParams.math||"1"==n.getAttribute("math");this.graph.setAdaptiveColors(n.getAttribute("adaptiveColors"));z=n.getAttribute("backgroundImage");null!=z?this.graph.setBackgroundImage(this.graph.parseBackgroundImage(z)):this.graph.setBackgroundImage(null);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&-this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==n.getAttribute("shadow"),!1);if(z=n.getAttribute("extFonts"))try{for(z=z.split("|").map(function(N){N=N.split("^");return{name:N[0],url:N[1]}}),D=0;D<z.length;D++)this.graph.addExtFont(z[D].name,z[D].url)}catch(N){console.log("ExtFonts format error: "+N.message)}else null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(this.graph.extFonts=[])}b.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||-"Invalid data",toString:function(){return this.message}};};var e=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(n,z){n=null!=n?n:!0;var D=e.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&D.setAttribute("style",this.graph.currentStyle);var L=this.graph.getBackgroundImageObject(this.graph.backgroundImage,z);null!=L&&D.setAttribute("backgroundImage",JSON.stringify(L));D.setAttribute("math",this.graph.mathEnabled?"1":"0");D.setAttribute("shadow",-this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?D.setAttribute("adaptiveColors",this.graph.adaptiveColors):D.removeAttribute("adaptiveColors");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(L=this.graph.extFonts.map(function(N){return N.name+"^"+N.url}),D.setAttribute("extFonts",L.join("|")));return D};Editor.prototype.isDataSvg=function(n){try{var z=mxUtils.parseXml(n).documentElement.getAttribute("content");if(null!=z&&(null!=z&&"<"!=z.charAt(0)&&"%"!=z.charAt(0)&&(z=-unescape(window.atob?atob(z):Base64.decode(cont,z))),null!=z&&"%"==z.charAt(0)&&(z=decodeURIComponent(z)),null!=z&&0<z.length)){var D=mxUtils.parseXml(z).documentElement;return"mxfile"==D.nodeName||"mxGraphModel"==D.nodeName}}catch(L){}return!1};Editor.prototype.extractGraphModel=function(n,z,D){return Editor.extractGraphModel.apply(this,arguments)};var f=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.setAdaptiveColors(null);-this.graph.view.x0=null;this.graph.view.y0=null;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();f.apply(this,arguments)};var c=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=function(){c.apply(this,arguments);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.initMath=function(n,z){if("undefined"===-typeof window.MathJax&&!mxClient.IS_IE&&!mxClient.IS_IE11){var D=function(){L=null;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};n=null!=n?n:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var L=null;Editor.doMathJaxRender=function(T){try{null==L?(MathJax.typesetClear([T]),MathJax.typeset([T]),D()):L!=T&&Editor.mathJaxQueue.push(T)}catch(U){MathJax.typesetClear([T]),null!=U.retry?(L=T,U.retry.then(function(){MathJax.typesetPromise([T]).then(D)["catch"](function(W){console.log("Error in MathJax.typesetPromise: "+-W.toString());D()})})["catch"](function(W){console.log("Error in MathJax.retry: "+W.toString());D()})):null!=window.console&&console.log("Error in MathJax.typeset: "+U.toString())}};window.MathJax=null!=z?z:{options:{skipHtmlTags:{"[+]":["text"]},ignoreHtmlClass:"geDisableMathJax"},loader:{load:["html"==urlParams["math-output"]?"output/chtml":"output/svg","input/tex","input/asciimath","ui/safe"]},startup:{pageReady:function(){for(var T=0;T<Editor.mathJaxQueue.length;T++)Editor.doMathJaxRender(Editor.mathJaxQueue[T])}}};-Editor.MathJaxRender=function(T){"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset?Editor.doMathJaxRender(T):Editor.mathJaxQueue.push(T)};Editor.onMathJaxDone=function(){};var N=Editor.prototype.init;Editor.prototype.init=function(){N.apply(this,arguments);var T=mxUtils.bind(this,function(U,W){null!=this.graph.container&&this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)});this.graph.model.addListener(mxEvent.CHANGE,T);this.graph.addListener(mxEvent.REFRESH,T)};z=document.getElementsByTagName("script");-if(null!=z&&0<z.length){var R=document.createElement("script");R.setAttribute("type","text/javascript");R.setAttribute("src",n);z[0].parentNode.appendChild(R)}}};Editor.prototype.csvToArray=function(n){if(0<n.length){var z="",D=[""],L=0,N=!0,R;n=$jscomp.makeIterator(n);for(R=n.next();!R.done;R=n.next())R=R.value,'"'===R?(N&&R===z&&(D[L]+=R),N=!N):","===R&&N?R=D[++L]="":D[L]+=R,z=R;return D}return[]};Editor.prototype.getProxiedUrl=function(n){if((/test\.draw\.io$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname))&&-!this.isCorsEnabledForUrl(n)){var z=EditorUi.isVisioFilename(n);z=/\.png$/i.test(n)||/\.pdf$/i.test(n)||z;var D="t="+(new Date).getTime();n=PROXY_URL+"?url="+encodeURIComponent(n)+"&"+D+(z?"&base64=1":"")}return n};Editor.prototype.isCorsEnabledForUrl=function(n){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||n.substring(0,window.location.origin.length)==window.location.origin)return!0;null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));-return null!=this.corsRegExp&&this.corsRegExp.test(n)||"https://raw.githubusercontent.com/"===n.substring(0,34)||"https://fonts.googleapis.com/"===n.substring(0,29)||"https://fonts.gstatic.com/"===n.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var n=new mxUrlConverter;n.updateBaseUrl();var z=n.convert,D=this;n.convert=function(L){null!=L&&navigator.onLine&&("http://"!=L.substring(0,7)&&"https://"!=L.substring(0,8)||L.substring(0,n.baseUrl.length)==n.baseUrl||D.crossOriginImages&&-D.isCorsEnabledForUrl(L)?"chrome-extension://"!=L.substring(0,19)&&(L=z.apply(this,arguments)):L=PROXY_URL+"?url="+encodeURIComponent(L));return L};return n};Editor.createSvgDataUri=function(n){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(n)))};Editor.prototype.convertImageToDataUri=function(n,z,D,L,N){try{var R=!0,T=window.setTimeout(mxUtils.bind(this,function(){R=!1;z(n)}),this.timeout),U=mxUtils.bind(this,function(){null!=L?this.convertImageToDataUri(n,z,D,L,!0):z(n)});if(/(\.svg)$/i.test(n)&&-!N)mxUtils.get(n,mxUtils.bind(this,function(X){window.clearTimeout(T);R&&(200>X.getStatus()||299<X.getStatus()?U():z(Editor.createSvgDataUri(X.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(T);R&&U()}));else{var W=new Image;this.crossOriginImages&&(W.crossOrigin="anonymous");W.onload=function(){window.clearTimeout(T);if(R)try{L=null!=L&&N?L:1;var X=document.createElement("canvas"),Y=X.getContext("2d");Y.scale(L,L);X.height=W.height*L;X.width=W.width*L;Y.drawImage(W,0,0);z(X.toDataURL())}catch(Z){z(n)}};-W.onerror=function(){window.clearTimeout(T);R&&(null!=D?D():z(n))};W.src=n}}catch(X){null!=D?D():z(n)}};Editor.prototype.convertImages=function(n,z,D,L){function N(){0<R.length?R.shift()():z(n)}null==L&&(L=this.createImageUrlConverter());var R=[],T=D||{};D=mxUtils.bind(this,function(U,W){U=n.getElementsByTagName(U);for(var X=0;X<U.length;X++)mxUtils.bind(this,function(Y){R.push(mxUtils.bind(this,function(){try{if(null!=Y){var Z=L.convert(Y.getAttribute(W));if(null!=Z&&"data:"!=Z.substring(0,5)){var ca=-T[Z];null==ca?this.convertImageToDataUri(Z,function(ea){null!=ea&&(T[Z]=ea,Y.setAttribute(W,ea));N()},null,Editor.svgRasterScale):(Y.setAttribute(W,ca),N())}else null!=Z&&Y.setAttribute(W,Z),N()}}catch(ea){N()}}))})(U[X])});D("image","xlink:href");D("img","src");N()};Editor.base64Encode=function(n){for(var z="",D=0,L=n.length,N,R,T;D<L;){N=n.charCodeAt(D++)&255;if(D==L){z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(N>>2);z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((N&-3)<<4);z+="==";break}R=n.charCodeAt(D++);if(D==L){z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(N>>2);z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((N&3)<<4|(R&240)>>4);z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((R&15)<<2);z+="=";break}T=n.charCodeAt(D++);z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(N>>2);z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((N&-3)<<4|(R&240)>>4);z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((R&15)<<2|(T&192)>>6);z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(T&63)}return z};Editor.prototype.loadUrl=function(n,z,D,L,N,R,T,U){try{var W=!T&&(L||/(\.png)($|\?)/i.test(n)||/(\.jpe?g)($|\?)/i.test(n)||/(\.gif)($|\?)/i.test(n)||/(\.pdf)($|\?)/i.test(n));N=null!=N?N:!0;var X=mxUtils.bind(this,function(){mxUtils.get(n,mxUtils.bind(this,function(Y){200<=Y.getStatus()&&299>=-Y.getStatus()?null!=z&&(Y=Y.getText(),W&&(R=null!=R?R:"data:image/png;base64,",Y=R+Editor.base64Encode(Y)),z(Y)):null!=D&&(0==Y.getStatus()?D({message:mxResources.get("accessDenied")},Y):404==Y.getStatus()?D({message:mxResources.get("fileNotFound"),code:Y.getStatus()},Y):D({message:this.getErrorMessage(Y)},Y))}),function(Y){null!=D&&D({message:mxResources.get("error")+" "+Y.getStatus()})},W,this.timeout,function(){N&&null!=D&&D({code:App.ERROR_TIMEOUT,retry:X})},U)});X()}catch(Y){null!=D&&D(Y)}};-Editor.prototype.getErrorMessage=function(n){var z=mxResources.get("error")+" "+n.getStatus();try{var D=n.getText(),L=JSON.parse(D);null!=L&&null!=L.error&&null!=L.error.message&&(z=L.error.message+" ("+z+")")}catch(N){}return z};Editor.prototype.absoluteCssFonts=function(n){var z=null;if(null!=n){var D=n.split("url(");if(0<D.length){z=[D[0]];n=window.location.pathname;var L=null!=n?n.lastIndexOf("/"):-1;0<=L&&(n=n.substring(0,L+1));L=document.getElementsByTagName("base");var N=null;null!=L&&0<L.length&&-(N=L[0].getAttribute("href"));for(var R=1;R<D.length;R++)if(L=D[R].indexOf(")"),0<L){var T=Editor.trimCssUrl(D[R].substring(0,L));this.graph.isRelativeUrl(T)&&(T=null!=N?N+T:window.location.protocol+"//"+window.location.hostname+("/"==T.charAt(0)?"":n)+T);z.push('url("'+T+'"'+D[R].substring(L))}else z.push(D[R])}else z=[n]}return null!=z?z.join(""):null};Editor.prototype.mapFontUrl=function(n,z,D){/^https?:\/\//.test(z)&&!this.isCorsEnabledForUrl(z)&&(z=PROXY_URL+"?url="+encodeURIComponent(z));D(n,-z)};Editor.prototype.embedCssFonts=function(n,z){var D=n.split("url("),L=0;null==this.cachedFonts&&(this.cachedFonts={});var N=mxUtils.bind(this,function(){if(0==L){for(var W=[D[0]],X=1;X<D.length;X++){var Y=D[X].indexOf(")");W.push('url("');W.push(this.cachedFonts[Editor.trimCssUrl(D[X].substring(0,Y))]);W.push('"'+D[X].substring(Y))}z(W.join(""))}});if(0<D.length){for(n=1;n<D.length;n++){var R=D[n].indexOf(")"),T=null,U=D[n].indexOf("format(",R);0<U&&(T=Editor.trimCssUrl(D[n].substring(U+7,D[n].indexOf(")",+title:"filetypeHtml"},{ext:"png",title:"filetypePng"},{ext:"svg",title:"filetypeSvg"}];Editor.prototype.timeout=25E3;Editor.prototype.editButtonLink=null!=urlParams.edit?decodeURIComponent(urlParams.edit):null;Editor.prototype.crossOriginImages=!mxClient.IS_IE;var b=Editor.prototype.setGraphXml;Editor.prototype.setGraphXml=function(n){n=null!=n&&"mxlibrary"!=n.nodeName?this.extractGraphModel(n):null;if(null!=n){var A=Editor.extractParserError(n,mxResources.get("invalidOrMissingFile"));if(A)throw EditorUi.debug("Editor.setGraphXml ParserError",+[this],"node",[n],"cause",[A]),Error(mxResources.get("notADiagramFile")+" ("+A+")");if("mxGraphModel"==n.nodeName){A=n.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=A&&""!=A)A!=this.graph.currentStyle&&(E=null!=this.graph.themes?this.graph.themes[A]:mxUtils.load(STYLE_PATH+"/"+A+".xml").getDocumentElement(),null!=E&&(L=new mxCodec(E.ownerDocument),L.decode(E,this.graph.getStylesheet())));else{var E=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH++"/default-old.xml").getDocumentElement();if(null!=E){var L=new mxCodec(E.ownerDocument);L.decode(E,this.graph.getStylesheet())}}this.graph.currentStyle=A;this.graph.mathEnabled="1"==urlParams.math||"1"==n.getAttribute("math");this.graph.setAdaptiveColors(n.getAttribute("adaptiveColors"));A=n.getAttribute("backgroundImage");null!=A?this.graph.setBackgroundImage(this.graph.parseBackgroundImage(A)):this.graph.setBackgroundImage(null);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&+this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==n.getAttribute("shadow"),!1);if(A=n.getAttribute("extFonts"))try{for(A=A.split("|").map(function(O){O=O.split("^");return{name:O[0],url:O[1]}}),E=0;E<A.length;E++)this.graph.addExtFont(A[E].name,A[E].url)}catch(O){console.log("ExtFonts format error: "+O.message)}else null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(this.graph.extFonts=[])}b.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||+"Invalid data",toString:function(){return this.message}};};var e=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(n,A){n=null!=n?n:!0;var E=e.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&E.setAttribute("style",this.graph.currentStyle);var L=this.graph.getBackgroundImageObject(this.graph.backgroundImage,A);null!=L&&E.setAttribute("backgroundImage",JSON.stringify(L));E.setAttribute("math",this.graph.mathEnabled?"1":"0");E.setAttribute("shadow",+this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?E.setAttribute("adaptiveColors",this.graph.adaptiveColors):E.removeAttribute("adaptiveColors");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(L=this.graph.extFonts.map(function(O){return O.name+"^"+O.url}),E.setAttribute("extFonts",L.join("|")));return E};Editor.prototype.isDataSvg=function(n){try{var A=mxUtils.parseXml(n).documentElement.getAttribute("content");if(null!=A&&(null!=A&&"<"!=A.charAt(0)&&"%"!=A.charAt(0)&&(A=+unescape(window.atob?atob(A):Base64.decode(cont,A))),null!=A&&"%"==A.charAt(0)&&(A=decodeURIComponent(A)),null!=A&&0<A.length)){var E=mxUtils.parseXml(A).documentElement;return"mxfile"==E.nodeName||"mxGraphModel"==E.nodeName}}catch(L){}return!1};Editor.prototype.extractGraphModel=function(n,A,E){return Editor.extractGraphModel.apply(this,arguments)};var f=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.setAdaptiveColors(null);+this.graph.view.x0=null;this.graph.view.y0=null;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();f.apply(this,arguments)};var c=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=function(){c.apply(this,arguments);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.initMath=function(n,A){if("undefined"===+typeof window.MathJax&&!mxClient.IS_IE&&!mxClient.IS_IE11){var E=function(){L=null;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};n=null!=n?n:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var L=null;Editor.doMathJaxRender=function(T){try{null==L?(MathJax.typesetClear([T]),MathJax.typeset([T]),E()):L!=T&&Editor.mathJaxQueue.push(T)}catch(U){MathJax.typesetClear([T]),null!=U.retry?(L=T,U.retry.then(function(){MathJax.typesetPromise([T]).then(E)["catch"](function(W){console.log("Error in MathJax.typesetPromise: "++W.toString());E()})})["catch"](function(W){console.log("Error in MathJax.retry: "+W.toString());E()})):null!=window.console&&console.log("Error in MathJax.typeset: "+U.toString())}};window.MathJax=null!=A?A:{options:{skipHtmlTags:{"[+]":["text"]},ignoreHtmlClass:"geDisableMathJax"},loader:{load:["html"==urlParams["math-output"]?"output/chtml":"output/svg","input/tex","input/asciimath","ui/safe"]},startup:{pageReady:function(){for(var T=0;T<Editor.mathJaxQueue.length;T++)Editor.doMathJaxRender(Editor.mathJaxQueue[T])}}};+Editor.MathJaxRender=function(T){"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset?Editor.doMathJaxRender(T):Editor.mathJaxQueue.push(T)};Editor.onMathJaxDone=function(){};var O=Editor.prototype.init;Editor.prototype.init=function(){O.apply(this,arguments);var T=mxUtils.bind(this,function(U,W){null!=this.graph.container&&this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)});this.graph.model.addListener(mxEvent.CHANGE,T);this.graph.addListener(mxEvent.REFRESH,T)};A=document.getElementsByTagName("script");+if(null!=A&&0<A.length){var R=document.createElement("script");R.setAttribute("type","text/javascript");R.setAttribute("src",n);A[0].parentNode.appendChild(R)}}};Editor.prototype.csvToArray=function(n){if(0<n.length){var A="",E=[""],L=0,O=!0,R;n=$jscomp.makeIterator(n);for(R=n.next();!R.done;R=n.next())R=R.value,'"'===R?(O&&R===A&&(E[L]+=R),O=!O):","===R&&O?R=E[++L]="":E[L]+=R,A=R;return E}return[]};Editor.prototype.getProxiedUrl=function(n){if((/test\.draw\.io$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname))&&+!this.isCorsEnabledForUrl(n)){var A=EditorUi.isVisioFilename(n);A=/\.png$/i.test(n)||/\.pdf$/i.test(n)||A;var E="t="+(new Date).getTime();n=PROXY_URL+"?url="+encodeURIComponent(n)+"&"+E+(A?"&base64=1":"")}return n};Editor.prototype.isCorsEnabledForUrl=function(n){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||n.substring(0,window.location.origin.length)==window.location.origin)return!0;null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));+return null!=this.corsRegExp&&this.corsRegExp.test(n)||"https://raw.githubusercontent.com/"===n.substring(0,34)||"https://fonts.googleapis.com/"===n.substring(0,29)||"https://fonts.gstatic.com/"===n.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var n=new mxUrlConverter;n.updateBaseUrl();var A=n.convert,E=this;n.convert=function(L){null!=L&&navigator.onLine&&("http://"!=L.substring(0,7)&&"https://"!=L.substring(0,8)||L.substring(0,n.baseUrl.length)==n.baseUrl||E.crossOriginImages&&+E.isCorsEnabledForUrl(L)?"chrome-extension://"!=L.substring(0,19)&&(L=A.apply(this,arguments)):L=PROXY_URL+"?url="+encodeURIComponent(L));return L};return n};Editor.createSvgDataUri=function(n){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(n)))};Editor.prototype.convertImageToDataUri=function(n,A,E,L,O){try{var R=!0,T=window.setTimeout(mxUtils.bind(this,function(){R=!1;A(n)}),this.timeout),U=mxUtils.bind(this,function(){null!=L?this.convertImageToDataUri(n,A,E,L,!0):A(n)});if(/(\.svg)$/i.test(n)&&+!O)mxUtils.get(n,mxUtils.bind(this,function(X){window.clearTimeout(T);R&&(200>X.getStatus()||299<X.getStatus()?U():A(Editor.createSvgDataUri(X.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(T);R&&U()}));else{var W=new Image;this.crossOriginImages&&(W.crossOrigin="anonymous");W.onload=function(){window.clearTimeout(T);if(R)try{L=null!=L&&O?L:1;var X=document.createElement("canvas"),Y=X.getContext("2d");Y.scale(L,L);X.height=W.height*L;X.width=W.width*L;Y.drawImage(W,0,0);A(X.toDataURL())}catch(Z){A(n)}};+W.onerror=function(){window.clearTimeout(T);R&&(null!=E?E():A(n))};W.src=n}}catch(X){null!=E?E():A(n)}};Editor.prototype.convertImages=function(n,A,E,L){function O(){0<R.length?R.shift()():A(n)}null==L&&(L=this.createImageUrlConverter());var R=[],T=E||{};E=mxUtils.bind(this,function(U,W){U=n.getElementsByTagName(U);for(var X=0;X<U.length;X++)mxUtils.bind(this,function(Y){R.push(mxUtils.bind(this,function(){try{if(null!=Y){var Z=L.convert(Y.getAttribute(W));if(null!=Z&&"data:"!=Z.substring(0,5)){var ca=+T[Z];null==ca?this.convertImageToDataUri(Z,function(ea){null!=ea&&(T[Z]=ea,Y.setAttribute(W,ea));O()},null,Editor.svgRasterScale):(Y.setAttribute(W,ca),O())}else null!=Z&&Y.setAttribute(W,Z),O()}}catch(ea){O()}}))})(U[X])});E("image","xlink:href");E("img","src");O()};Editor.base64Encode=function(n){for(var A="",E=0,L=n.length,O,R,T;E<L;){O=n.charCodeAt(E++)&255;if(E==L){A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(O>>2);A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((O&+3)<<4);A+="==";break}R=n.charCodeAt(E++);if(E==L){A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(O>>2);A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((O&3)<<4|(R&240)>>4);A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((R&15)<<2);A+="=";break}T=n.charCodeAt(E++);A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(O>>2);A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((O&+3)<<4|(R&240)>>4);A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((R&15)<<2|(T&192)>>6);A+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(T&63)}return A};Editor.prototype.loadUrl=function(n,A,E,L,O,R,T,U){try{var W=!T&&(L||/(\.png)($|\?)/i.test(n)||/(\.jpe?g)($|\?)/i.test(n)||/(\.gif)($|\?)/i.test(n)||/(\.pdf)($|\?)/i.test(n));O=null!=O?O:!0;var X=mxUtils.bind(this,function(){mxUtils.get(n,mxUtils.bind(this,function(Y){200<=Y.getStatus()&&299>=+Y.getStatus()?null!=A&&(Y=Y.getText(),W&&(R=null!=R?R:"data:image/png;base64,",Y=R+Editor.base64Encode(Y)),A(Y)):null!=E&&(0==Y.getStatus()?E({message:mxResources.get("accessDenied")},Y):404==Y.getStatus()?E({message:mxResources.get("fileNotFound"),code:Y.getStatus()},Y):E({message:this.getErrorMessage(Y)},Y))}),function(Y){null!=E&&E({message:mxResources.get("error")+" "+Y.getStatus()})},W,this.timeout,function(){O&&null!=E&&E({code:App.ERROR_TIMEOUT,retry:X})},U)});X()}catch(Y){null!=E&&E(Y)}};+Editor.prototype.getErrorMessage=function(n){var A=mxResources.get("error")+" "+n.getStatus();try{var E=n.getText(),L=JSON.parse(E);null!=L&&null!=L.error&&null!=L.error.message&&(A=L.error.message+" ("+A+")")}catch(O){}return A};Editor.prototype.absoluteCssFonts=function(n){var A=null;if(null!=n){var E=n.split("url(");if(0<E.length){A=[E[0]];n=window.location.pathname;var L=null!=n?n.lastIndexOf("/"):-1;0<=L&&(n=n.substring(0,L+1));L=document.getElementsByTagName("base");var O=null;null!=L&&0<L.length&&+(O=L[0].getAttribute("href"));for(var R=1;R<E.length;R++)if(L=E[R].indexOf(")"),0<L){var T=Editor.trimCssUrl(E[R].substring(0,L));this.graph.isRelativeUrl(T)&&(T=null!=O?O+T:window.location.protocol+"//"+window.location.hostname+("/"==T.charAt(0)?"":n)+T);A.push('url("'+T+'"'+E[R].substring(L))}else A.push(E[R])}else A=[n]}return null!=A?A.join(""):null};Editor.prototype.mapFontUrl=function(n,A,E){/^https?:\/\//.test(A)&&!this.isCorsEnabledForUrl(A)&&(A=PROXY_URL+"?url="+encodeURIComponent(A));E(n,+A)};Editor.prototype.embedCssFonts=function(n,A){var E=n.split("url("),L=0;null==this.cachedFonts&&(this.cachedFonts={});var O=mxUtils.bind(this,function(){if(0==L){for(var W=[E[0]],X=1;X<E.length;X++){var Y=E[X].indexOf(")");W.push('url("');W.push(this.cachedFonts[Editor.trimCssUrl(E[X].substring(0,Y))]);W.push('"'+E[X].substring(Y))}A(W.join(""))}});if(0<E.length){for(n=1;n<E.length;n++){var R=E[n].indexOf(")"),T=null,U=E[n].indexOf("format(",R);0<U&&(T=Editor.trimCssUrl(E[n].substring(U+7,E[n].indexOf(")",U))));mxUtils.bind(this,function(W){if(null==this.cachedFonts[W]){this.cachedFonts[W]=W;L++;var X="application/x-font-ttf";if("svg"==T||/(\.svg)($|\?)/i.test(W))X="image/svg+xml";else if("otf"==T||"embedded-opentype"==T||/(\.otf)($|\?)/i.test(W))X="application/x-font-opentype";else if("woff"==T||/(\.woff)($|\?)/i.test(W))X="application/font-woff";else if("woff2"==T||/(\.woff2)($|\?)/i.test(W))X="application/font-woff2";else if("eot"==T||/(\.eot)($|\?)/i.test(W))X="application/vnd.ms-fontobject";else if("sfnt"==-T||/(\.sfnt)($|\?)/i.test(W))X="application/font-sfnt";this.mapFontUrl(X,W,mxUtils.bind(this,function(Y,Z){this.loadUrl(Z,mxUtils.bind(this,function(ca){this.cachedFonts[W]=ca;L--;N()}),mxUtils.bind(this,function(ca){L--;N()}),!0,null,"data:"+Y+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(D[n].substring(0,R)),T)}N()}else z(n)};Editor.prototype.loadFonts=function(n){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(z){this.resolvedFontCss=-z;null!=n&&n()})):null!=n&&n()};Editor.prototype.createGoogleFontCache=function(){var n={},z;for(z in Graph.fontMapping)Graph.isCssFontUrl(z)&&(n[z]=Graph.fontMapping[z]);return n};Editor.prototype.embedExtFonts=function(n){var z=this.graph.getCustomFonts();if(0<z.length){var D=[],L=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var N=mxUtils.bind(this,function(){0==L&&this.embedCssFonts(D.join(""),n)}),R=0;R<z.length;R++)mxUtils.bind(this,function(T,U){Graph.isCssFontUrl(U)?-null==this.cachedGoogleFonts[U]?(L++,this.loadUrl(Graph.rewriteGoogleFontUrl(U),mxUtils.bind(this,function(W){this.cachedGoogleFonts[U]=W;D.push(W+"\n");L--;N()}),mxUtils.bind(this,function(W){L--;D.push("@import url("+U+");\n");N()}))):D.push(this.cachedGoogleFonts[U]+"\n"):D.push('@font-face {font-family: "'+T+'";src: url("'+U+'")}\n')})(z[R].name,z[R].url);N()}else n()};Editor.prototype.addMathCss=function(n){n=n.getElementsByTagName("defs");if(null!=n&&0<n.length)for(var z=document.getElementsByTagName("style"),-D=0;D<z.length;D++){var L=mxUtils.getTextContent(z[D]);0>L.indexOf("mxPageSelector")&&0<L.indexOf("MathJax")&&n[0].appendChild(z[D].cloneNode(!0))}};Editor.prototype.addFontCss=function(n,z){z=null!=z?z:this.absoluteCssFonts(this.fontCss);if(null!=z){var D=mxUtils.getSvgDefs(n),L=z.split("\n");z=[];for(var N=[],R=0;R<L.length;R++)"@import"==L[R].substring(0,7)?z.push(L[R]):N.push(L[R]);n=n.ownerDocument;n=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"style"):n.createElement("style");-n.setAttribute("type","text/css");0<z.length&&(mxUtils.setTextContent(n,z.join("\n")),D.appendChild(n));0<N.length&&(n=n.cloneNode(!1),mxUtils.setTextContent(n,N.join("\n")),D.appendChild(n))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||this.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(n,z,D){var L=mxClient.IS_FF?8192:16384;return Math.min(D,Math.min(L/n,L/z))};Editor.prototype.exportToCanvas=function(n,z,D,L,N,R,T,U,W,X,Y,Z,ca,ea,ja,ba,fa,aa){try{R=-null!=R?R:!0;T=null!=T?T:!0;Z=null!=Z?Z:this.graph;ca=null!=ca?ca:0;var ia=W?null:Z.background;ia==mxConstants.NONE&&(ia=null);null==ia&&(ia=L);null==ia&&0==W&&(ia="dark"==ba&&"none"!=Z.getAdaptiveColors()?Editor.darkColor:"#ffffff");this.convertImages(Z.getSvg(null,null,ca,ea,null,T,null,null,null,X,null,ba,fa,aa),mxUtils.bind(this,function(ha){try{var da=new Image;da.onload=mxUtils.bind(this,function(){try{var na=function(){mxClient.IS_SF?window.setTimeout(function(){ta.drawImage(da,0,0);n(va,ha)},-0):(ta.drawImage(da,0,0),n(va,ha))},va=document.createElement("canvas"),Aa=parseInt(ha.getAttribute("width")),ka=parseInt(ha.getAttribute("height"));U=null!=U?U:1;null!=z&&(U=R?Math.min(1,Math.min(3*z/(4*ka),z/Aa)):z/Aa);U=this.getMaxCanvasScale(Aa,ka,U);Aa=Math.ceil(U*Aa);ka=Math.ceil(U*ka);va.setAttribute("width",Aa);va.setAttribute("height",ka);var ta=va.getContext("2d");if(null!=ia){var pa=mxUtils.getLightDarkColor(ia);ta.beginPath();ta.rect(0,0,Aa,ka);ta.fillStyle="dark"==ba&&"none"!=Z.getAdaptiveColors()?-pa.dark:pa.light;ta.fill()}1!=U&&ta.scale(U,U);if(ja){var ma=Z.view,Da=ma.scale;ma.scale=1;var wa=btoa(unescape(encodeURIComponent(ma.createSvgGrid(ma.gridColor))));ma.scale=Da;wa="data:image/svg+xml;base64,"+wa;var ya=Z.gridSize*ma.gridSteps*U,xa=Z.getGraphBounds(),Fa=ma.translate.x*Da,Ca=ma.translate.y*Da,Ia=Fa+(xa.x-Fa)/Da-ca,La=Ca+(xa.y-Ca)/Da-ca,Ea=new Image;Ea.onload=function(){try{for(var za=-Math.round(ya-mxUtils.mod((Fa-Ia)*U,ya)),Sa=-Math.round(ya-mxUtils.mod((Ca-La)*U,ya));za<Aa;za+=ya)for(var Ta=-Sa;Ta<ka;Ta+=ya)ta.drawImage(Ea,za/U,Ta/U);na()}catch(Ua){null!=N&&N(Ua)}};Ea.onerror=function(za){null!=N&&N(za)};Ea.src=wa}else na()}catch(za){null!=N&&N(za)}});da.onerror=function(na){null!=N&&N(na)};X&&this.graph.addSvgShadow(ha);this.graph.mathEnabled&&this.addMathCss(ha);var Ba=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(ha,this.resolvedFontCss),da.src=Editor.createSvgDataUri(mxUtils.getXml(ha))}catch(na){null!=N&&N(na)}});this.embedExtFonts(mxUtils.bind(this,-function(na){try{null!=na&&this.addFontCss(ha,na),this.loadFonts(Ba)}catch(va){null!=N&&N(va)}}))}catch(na){null!=N&&N(na)}}),D,Y)}catch(ha){null!=N&&N(ha)}};Editor.crcTable=[];for(var l=0;256>l;l++)for(var p=l,q=0;8>q;q++)p=1==(p&1)?3988292384^p>>>1:p>>>1,Editor.crcTable[l]=p;Editor.updateCRC=function(n,z,D,L){for(var N=0;N<L;N++)n=Editor.crcTable[(n^z.charCodeAt(D+N))&255]^n>>>8;return n};Editor.crc32=function(n){for(var z=-1,D=0;D<n.length;D++)z=z>>>8^Editor.crcTable[(z^n.charCodeAt(D))&255];return(z^--1)>>>0};Editor.writeGraphModelToPng=function(n,z,D,L,N){function R(Y,Z){var ca=W;W+=Z;return Y.substring(ca,W)}function T(Y){Y=R(Y,4);return Y.charCodeAt(3)+(Y.charCodeAt(2)<<8)+(Y.charCodeAt(1)<<16)+(Y.charCodeAt(0)<<24)}function U(Y){return String.fromCharCode(Y>>24&255,Y>>16&255,Y>>8&255,Y&255)}n=n.substring(n.indexOf(",")+1);n=window.atob?atob(n):Base64.decode(n,!0);var W=0;if(R(n,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=N&&N();else if(R(n,4),"IHDR"!=R(n,4))null!=-N&&N();else{R(n,17);N=n.substring(0,W);do{var X=T(n);if("IDAT"==R(n,4)){N=n.substring(0,W-8);"pHYs"==z&&"dpi"==D?(D=Math.round(L/.0254),D=U(D)+U(D)+String.fromCharCode(1)):D=D+String.fromCharCode(0)+("zTXt"==z?String.fromCharCode(0):"")+L;L=4294967295;L=Editor.updateCRC(L,z,0,4);L=Editor.updateCRC(L,D,0,D.length);N+=U(D.length)+z+D+U(L^4294967295);N+=n.substring(W-8,n.length);break}N+=n.substring(W-8,W-4+X);R(n,X);R(n,4)}while(X);return"data:image/png;base64,"+(window.btoa?btoa(N):Base64.encode(N,-!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var v=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(n,z){v.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var E=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){E.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=-function(n,z){var D=null;null!=n.editor.graph.getModel().getParent(z)?D=z.getId():null!=n.currentPage&&(D=n.currentPage.getId());return D});if(null!=window.StyleFormatPanel){var G=Format.prototype.init;Format.prototype.init=function(){G.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var B=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?B.apply(this,arguments):-this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(n){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var d=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(n){n=d.apply(this,arguments);var z=this.editorUi,D=z.editor.graph;if(D.isEnabled()){var L=z.getCurrentFile();null!=L&&L.isAutosaveOptional()&&n.appendChild(this.createOption(mxResources.get("autosave"),function(){return z.editor.autosave},-function(R){z.editor.setAutosave(R);z.editor.autosave&&L.isModified()&&L.fileChanged()},{install:function(R){this.listener=function(){R(z.editor.autosave)};z.editor.addListener("autosaveChanged",this.listener)},destroy:function(){z.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&D.isEnabled()&&"undefined"!==typeof MathJax){var N=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return D.mathEnabled},function(R){z.actions.get("mathematicalTypesetting").funct()},-{install:function(R){this.listener=function(){R(D.mathEnabled)};z.addListener("mathEnabledChanged",this.listener)},destroy:function(){z.removeListener(this.listener)}});n.appendChild(N);(!z.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&N.appendChild(z.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}return n};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},+T||/(\.sfnt)($|\?)/i.test(W))X="application/font-sfnt";this.mapFontUrl(X,W,mxUtils.bind(this,function(Y,Z){this.loadUrl(Z,mxUtils.bind(this,function(ca){this.cachedFonts[W]=ca;L--;O()}),mxUtils.bind(this,function(ca){L--;O()}),!0,null,"data:"+Y+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(E[n].substring(0,R)),T)}O()}else A(n)};Editor.prototype.loadFonts=function(n){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(A){this.resolvedFontCss=+A;null!=n&&n()})):null!=n&&n()};Editor.prototype.createGoogleFontCache=function(){var n={},A;for(A in Graph.fontMapping)Graph.isCssFontUrl(A)&&(n[A]=Graph.fontMapping[A]);return n};Editor.prototype.embedExtFonts=function(n){var A=this.graph.getCustomFonts();if(0<A.length){var E=[],L=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var O=mxUtils.bind(this,function(){0==L&&this.embedCssFonts(E.join(""),n)}),R=0;R<A.length;R++)mxUtils.bind(this,function(T,U){Graph.isCssFontUrl(U)?+null==this.cachedGoogleFonts[U]?(L++,this.loadUrl(Graph.rewriteGoogleFontUrl(U),mxUtils.bind(this,function(W){this.cachedGoogleFonts[U]=W;E.push(W+"\n");L--;O()}),mxUtils.bind(this,function(W){L--;E.push("@import url("+U+");\n");O()}))):E.push(this.cachedGoogleFonts[U]+"\n"):E.push('@font-face {font-family: "'+T+'";src: url("'+U+'")}\n')})(A[R].name,A[R].url);O()}else n()};Editor.prototype.addMathCss=function(n){n=n.getElementsByTagName("defs");if(null!=n&&0<n.length)for(var A=document.getElementsByTagName("style"),+E=0;E<A.length;E++){var L=mxUtils.getTextContent(A[E]);0>L.indexOf("mxPageSelector")&&0<L.indexOf("MathJax")&&n[0].appendChild(A[E].cloneNode(!0))}};Editor.prototype.addFontCss=function(n,A){A=null!=A?A:this.absoluteCssFonts(this.fontCss);if(null!=A){var E=mxUtils.getSvgDefs(n),L=A.split("\n");A=[];for(var O=[],R=0;R<L.length;R++)"@import"==L[R].substring(0,7)?A.push(L[R]):O.push(L[R]);n=n.ownerDocument;n=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"style"):n.createElement("style");+n.setAttribute("type","text/css");0<A.length&&(mxUtils.setTextContent(n,A.join("\n")),E.appendChild(n));0<O.length&&(n=n.cloneNode(!1),mxUtils.setTextContent(n,O.join("\n")),E.appendChild(n))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||this.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(n,A,E){var L=mxClient.IS_FF?8192:16384;return Math.min(E,Math.min(L/n,L/A))};Editor.prototype.exportToCanvas=function(n,A,E,L,O,R,T,U,W,X,Y,Z,ca,ea,ia,ba,fa,aa){try{R=+null!=R?R:!0;T=null!=T?T:!0;Z=null!=Z?Z:this.graph;ca=null!=ca?ca:0;var ja=W?null:Z.background;ja==mxConstants.NONE&&(ja=null);null==ja&&(ja=L);null==ja&&0==W&&(ja="dark"==ba&&"none"!=Z.getAdaptiveColors()?Editor.darkColor:"#ffffff");this.convertImages(Z.getSvg(null,null,ca,ea,null,T,null,null,null,X,null,ba,fa,aa),mxUtils.bind(this,function(ha){try{var da=new Image;da.onload=mxUtils.bind(this,function(){try{var na=function(){mxClient.IS_SF?window.setTimeout(function(){ta.drawImage(da,0,0);n(va,ha)},+0):(ta.drawImage(da,0,0),n(va,ha))},va=document.createElement("canvas"),Aa=parseInt(ha.getAttribute("width")),ka=parseInt(ha.getAttribute("height"));U=null!=U?U:1;null!=A&&(U=R?Math.min(1,Math.min(3*A/(4*ka),A/Aa)):A/Aa);U=this.getMaxCanvasScale(Aa,ka,U);Aa=Math.ceil(U*Aa);ka=Math.ceil(U*ka);va.setAttribute("width",Aa);va.setAttribute("height",ka);var ta=va.getContext("2d");if(null!=ja){var pa=mxUtils.getLightDarkColor(ja);ta.beginPath();ta.rect(0,0,Aa,ka);ta.fillStyle="dark"==ba&&"none"!=Z.getAdaptiveColors()?+pa.dark:pa.light;ta.fill()}1!=U&&ta.scale(U,U);if(ia){var ma=Z.view,Da=ma.scale;ma.scale=1;var wa=btoa(unescape(encodeURIComponent(ma.createSvgGrid(ma.gridColor))));ma.scale=Da;wa="data:image/svg+xml;base64,"+wa;var ya=Z.gridSize*ma.gridSteps*U,xa=Z.getGraphBounds(),Fa=ma.translate.x*Da,Ca=ma.translate.y*Da,Ia=Fa+(xa.x-Fa)/Da-ca,La=Ca+(xa.y-Ca)/Da-ca,Ea=new Image;Ea.onload=function(){try{for(var za=-Math.round(ya-mxUtils.mod((Fa-Ia)*U,ya)),Sa=-Math.round(ya-mxUtils.mod((Ca-La)*U,ya));za<Aa;za+=ya)for(var Ta=+Sa;Ta<ka;Ta+=ya)ta.drawImage(Ea,za/U,Ta/U);na()}catch(Ua){null!=O&&O(Ua)}};Ea.onerror=function(za){null!=O&&O(za)};Ea.src=wa}else na()}catch(za){null!=O&&O(za)}});da.onerror=function(na){null!=O&&O(na)};X&&this.graph.addSvgShadow(ha);this.graph.mathEnabled&&this.addMathCss(ha);var Ba=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(ha,this.resolvedFontCss),da.src=Editor.createSvgDataUri(mxUtils.getXml(ha))}catch(na){null!=O&&O(na)}});this.embedExtFonts(mxUtils.bind(this,+function(na){try{null!=na&&this.addFontCss(ha,na),this.loadFonts(Ba)}catch(va){null!=O&&O(va)}}))}catch(na){null!=O&&O(na)}}),E,Y)}catch(ha){null!=O&&O(ha)}};Editor.crcTable=[];for(var l=0;256>l;l++)for(var p=l,q=0;8>q;q++)p=1==(p&1)?3988292384^p>>>1:p>>>1,Editor.crcTable[l]=p;Editor.updateCRC=function(n,A,E,L){for(var O=0;O<L;O++)n=Editor.crcTable[(n^A.charCodeAt(E+O))&255]^n>>>8;return n};Editor.crc32=function(n){for(var A=-1,E=0;E<n.length;E++)A=A>>>8^Editor.crcTable[(A^n.charCodeAt(E))&255];return(A^+-1)>>>0};Editor.writeGraphModelToPng=function(n,A,E,L,O){function R(Y,Z){var ca=W;W+=Z;return Y.substring(ca,W)}function T(Y){Y=R(Y,4);return Y.charCodeAt(3)+(Y.charCodeAt(2)<<8)+(Y.charCodeAt(1)<<16)+(Y.charCodeAt(0)<<24)}function U(Y){return String.fromCharCode(Y>>24&255,Y>>16&255,Y>>8&255,Y&255)}n=n.substring(n.indexOf(",")+1);n=window.atob?atob(n):Base64.decode(n,!0);var W=0;if(R(n,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=O&&O();else if(R(n,4),"IHDR"!=R(n,4))null!=+O&&O();else{R(n,17);O=n.substring(0,W);do{var X=T(n);if("IDAT"==R(n,4)){O=n.substring(0,W-8);"pHYs"==A&&"dpi"==E?(E=Math.round(L/.0254),E=U(E)+U(E)+String.fromCharCode(1)):E=E+String.fromCharCode(0)+("zTXt"==A?String.fromCharCode(0):"")+L;L=4294967295;L=Editor.updateCRC(L,A,0,4);L=Editor.updateCRC(L,E,0,E.length);O+=U(E.length)+A+E+U(L^4294967295);O+=n.substring(W-8,n.length);break}O+=n.substring(W-8,W-4+X);R(n,X);R(n,4)}while(X);return"data:image/png;base64,"+(window.btoa?btoa(O):Base64.encode(O,+!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var v=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(n,A){v.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var D=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){D.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=+function(n,A){var E=null;null!=n.editor.graph.getModel().getParent(A)?E=A.getId():null!=n.currentPage&&(E=n.currentPage.getId());return E});if(null!=window.StyleFormatPanel){var G=Format.prototype.init;Format.prototype.init=function(){G.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var B=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?B.apply(this,arguments):+this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(n){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var d=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(n){n=d.apply(this,arguments);var A=this.editorUi,E=A.editor.graph;if(E.isEnabled()){var L=A.getCurrentFile();null!=L&&L.isAutosaveOptional()&&n.appendChild(this.createOption(mxResources.get("autosave"),function(){return A.editor.autosave},+function(R){A.editor.setAutosave(R);A.editor.autosave&&L.isModified()&&L.fileChanged()},{install:function(R){this.listener=function(){R(A.editor.autosave)};A.editor.addListener("autosaveChanged",this.listener)},destroy:function(){A.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&E.isEnabled()&&"undefined"!==typeof MathJax){var O=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return E.mathEnabled},function(R){A.actions.get("mathematicalTypesetting").funct()},+{install:function(R){this.listener=function(){R(E.mathEnabled)};A.addListener("mathEnabledChanged",this.listener)},destroy:function(){A.removeListener(this.listener)}});n.appendChild(O);(!A.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&O.appendChild(A.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}return n};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:10},{name:"startWidth",dispName:"Start Width",type:"float",min:0,defVal:20},{name:"endWidth",dispName:"End Width",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.process.prototype.customProperties=[{name:"size",dispName:"Indent",type:"float",min:0,max:.5,defVal:.1}];mxCellRenderer.defaultShapes.rhombus.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,max:50,defVal:mxConstants.LINE_ARCSIZE},{name:"double",dispName:"Double",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties=[{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left Line",type:"bool",defVal:!0},{name:"right",dispName:"Right Line",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.parallelogram.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2,isVisible:function(n){return"0"==mxUtils.getValue(n.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:20,isVisible:function(n){return"1"==mxUtils.getValue(n.style,@@ -12836,93 +12842,91 @@ defVal:"none",enumList:[{val:"none",dispName:"Default"},{val:"umlActor",dispName[[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",font:"#333333"},{fill:"#dae8fc",stroke:"#6c8ebf"},{fill:"#d5e8d4",stroke:"#82b366"},{fill:"#ffe6cc",stroke:"#d79b00"},{fill:"#fff2cc",stroke:"#d6b656"},{fill:"#f8cecc",stroke:"#b85450"},{fill:"#e1d5e7",stroke:"#9673a6"}],[{fill:"",stroke:""},{fill:"#60a917",stroke:"#2D7600",font:"#ffffff"},{fill:"#008a00",stroke:"#005700",font:"#ffffff"},{fill:"#1ba1e2",stroke:"#006EAF",font:"#ffffff"},{fill:"#0050ef",stroke:"#001DBC",font:"#ffffff"},{fill:"#6a00ff",stroke:"#3700CC",font:"#ffffff"},{fill:"#d80073",stroke:"#A50040",font:"#ffffff"},{fill:"#a20025",stroke:"#6F0000",font:"#ffffff"}],[{fill:"#e51400",stroke:"#B20000",font:"#ffffff"},{fill:"#fa6800",stroke:"#C73500",font:"#000000"},{fill:"#f0a30a",stroke:"#BD7000",font:"#000000"},{fill:"#e3c800",stroke:"#B09500",font:"#000000"},{fill:"#6d8764",stroke:"#3A5431",font:"#ffffff"},{fill:"#647687",stroke:"#314354",font:"#ffffff"},{fill:"#76608a",stroke:"#432D57",font:"#ffffff"},{fill:"#a0522d",stroke:"#6D1F00",font:"#ffffff"}],[{fill:"",stroke:""},{fill:mxConstants.NONE,stroke:""},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",stroke:"#23445d"}],[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},-{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[{fill:"",stroke:""},{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;StyleFormatPanel.prototype.findCommonProperties=-function(n,z,D,L){if(null!=z){var N=mxUtils.bind(this,function(T){if(null!=T)if(D)for(var U=0;U<T.length;U++){if("function"!==typeof T[U].isVisible||T[U].isVisible(L,this))z[T[U].name]=T[U]}else for(var W in z){var X=!1;for(U=0;U<T.length;U++)if(T[U].name==W&&T[U].type==z[W].type){X=!0;break}X||delete z[W]}}),R=this.editorUi.editor.graph.view.getState(n);null!=R&&null!=R.shape&&(R.shape.commonCustomPropAdded||(R.shape.commonCustomPropAdded=!0,R.shape.customProperties=R.shape.customProperties||[],-R.cell.vertex?Array.prototype.push.apply(R.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(R.shape.customProperties,Editor.commonEdgeProperties)),N(R.shape.customProperties));n=n.getAttribute("customProperties");if(null!=n)try{N(JSON.parse(n))}catch(T){}}};var g=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var n=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&"image"!=n.style.shape&&-!n.containsLabel&&0<n.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));g.apply(this,arguments);if(Editor.enableCustomProperties){for(var z={},D=n.vertices,L=n.edges,N=0;N<D.length;N++)this.findCommonProperties(D[N],z,0==N,n);for(N=0;N<L.length;N++)this.findCommonProperties(L[N],z,0==D.length&&0==N,n);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(z).length&&this.container.appendChild(this.addProperties(this.createPanel(),z,n))}};var k=StyleFormatPanel.prototype.addStyleOps;-StyleFormatPanel.prototype.addStyleOps=function(n){var z=this.editorUi.getSelectionState();1==z.cells.length?this.addActions(n,["copyStyle","pasteStyle"]):1<=z.cells.length&&this.addActions(n,["pasteStyle","pasteData"]);k.apply(this,arguments);return n};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(n,z,D,L){function N(ta,pa,ma,Da,wa){if(null!=ma.valueChanged)ma.valueChanged(pa,wa);else{ca.getModel().beginUpdate();try{wa=[];var ya=[];if(null!=ma.index){for(var xa=-[],Fa=ma.parentRow.nextSibling;Fa&&Fa.getAttribute("data-pName")==ta;)xa.push(Fa.getAttribute("data-pValue")),Fa=Fa.nextSibling;ma.index<xa.length?null!=Da?xa.splice(Da,1):xa[ma.index]=pa:xa.push(pa);null!=ma.size&&xa.length>ma.size&&(xa=xa.slice(0,ma.size));pa=xa.join(",");null!=ma.countProperty&&(ca.setCellStyles(ma.countProperty,xa.length,ca.getSelectionCells()),wa.push(ma.countProperty),ya.push(xa.length))}ca.setCellStyles(ta,pa,ca.getSelectionCells());wa.push(ta);ya.push(pa);if(null!=ma.dependentProps)for(ta=-0;ta<ma.dependentProps.length;ta++){var Ca=ma.dependentPropsDefVal[ta],Ia=ma.dependentPropsVals[ta];if(Ia.length>pa)Ia=Ia.slice(0,pa);else for(var La=Ia.length;La<pa;La++)Ia.push(Ca);Ia=Ia.join(",");ca.setCellStyles(ma.dependentProps[ta],Ia,ca.getSelectionCells());wa.push(ma.dependentProps[ta]);ya.push(Ia)}if("function"==typeof ma.onChange)ma.onChange(ca,pa);Z.editorUi.fireEvent(new mxEventObject("styleChanged","keys",wa,"values",ya,"cells",ca.getSelectionCells()))}finally{ca.getModel().endUpdate()}}}-function R(ta,pa,ma){var Da=mxUtils.getOffset(n,!0),wa=mxUtils.getOffset(ta,!0);pa.style.position="absolute";pa.style.left=wa.x-Da.x+"px";pa.style.top=wa.y-Da.y+"px";pa.style.width=ta.offsetWidth+"px";pa.style.height=ta.offsetHeight-(ma?4:0)+"px";pa.style.zIndex=5}function T(ta,pa,ma){function Da(ya){if(null==ya||ya==mxConstants.NONE)wa.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==ya)wa.style.background="";else{var xa=mxUtils.getLightDarkColor(ya);mxUtils.isLightDarkColor(ya)&&-xa.light!=xa.dark?wa.style.background="linear-gradient(to right bottom, "+xa.cssText+" 50%, "+mxUtils.invertLightDarkColor(xa).cssText+" 50.3%)":wa.style.background=ya}}var wa=document.createElement("div");wa.style.width="32px";wa.style.height="8px";wa.style.margin="2px";wa.style.borderStyle="solid";wa.style.borderWidth="1px";Da(pa);btn=mxUtils.button("",mxUtils.bind(Z,function(ya){this.editorUi.pickColor(pa,function(xa){N(ta,xa,ma);Da(xa)});mxEvent.consume(ya)}));btn.style.height="18px";btn.style.width=-"40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(wa);return btn}function U(ta,pa,ma,Da,wa,ya,xa){null!=pa&&(pa=pa.split(","),ea.push({name:ta,values:pa,type:ma,defVal:Da,countProperty:wa,parentRow:ya,isDeletable:!0,flipBkg:xa}));btn=mxUtils.button("+",mxUtils.bind(Z,function(Fa){for(var Ca=ya,Ia=0;null!=Ca.nextSibling;)if(Ca.nextSibling.getAttribute("data-pName")==ta)Ca=Ca.nextSibling,Ia++;else break;var La={type:ma,parentRow:ya,index:Ia,isDeletable:!0,-defVal:Da,countProperty:wa};Ia=Y(ta,"",La,0==Ia%2,xa);N(ta,Da,La);Ca.parentNode.insertBefore(Ia,Ca.nextSibling);mxEvent.consume(Fa)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function W(ta,pa,ma,Da,wa,ya,xa){if(0<wa){var Fa=Array(wa);pa=null!=pa?pa.split(","):[];for(var Ca=0;Ca<wa;Ca++)Fa[Ca]=null!=pa[Ca]?pa[Ca]:null!=Da?Da:"";ea.push({name:ta,values:Fa,type:ma,defVal:Da,parentRow:ya,flipBkg:xa,size:wa})}return document.createElement("div")}function X(ta,-pa,ma){var Da=document.createElement("input");Da.type="checkbox";Da.checked="1"==pa;mxEvent.addListener(Da,"change",function(){N(ta,Da.checked?"1":"0",ma)});return Da}function Y(ta,pa,ma,Da,wa){var ya=ma.dispName,xa=ma.type,Fa=document.createElement("tr");Fa.className="gePropRow"+(wa?"Dark":"")+(Da?"Alt":"")+" gePropNonHeaderRow";Fa.setAttribute("data-pName",ta);Fa.setAttribute("data-pValue",pa);Da=!1;null!=ma.index&&(Fa.setAttribute("data-index",ma.index),ya=(null!=ya?ya:"")+"["+ma.index+"]",Da=-!0);var Ca=document.createElement("td");Ca.className="gePropRowCell";ya=mxResources.get(ya,null,ya);mxUtils.write(Ca,ya);Ca.setAttribute("title",ya);Da&&(Ca.style.textAlign="right");Fa.appendChild(Ca);Ca=document.createElement("td");Ca.className="gePropRowCell";Ca.setAttribute("title",null!=pa?pa:mxResources.get("none"));if("color"==xa)Ca.appendChild(T(ta,pa,ma));else if("bool"==xa||"boolean"==xa)Ca.appendChild(X(ta,pa,ma));else if("enum"==xa){var Ia=ma.enumList;for(wa=0;wa<Ia.length;wa++)if(ya=Ia[wa],-ya.val==pa){mxUtils.write(Ca,mxResources.get(ya.dispName,null,ya.dispName));break}mxEvent.addListener(Ca,"click",mxUtils.bind(Z,function(){var La=document.createElement("select"),Ea=null;R(Ca,La);for(var za=0;za<Ia.length;za++){var Sa=Ia[za],Ta=document.createElement("option");Ta.value=mxUtils.htmlEntities(Sa.val);mxUtils.write(Ta,mxResources.get(Sa.dispName,null,Sa.dispName));La.appendChild(Ta);null==Sa.val&&(Ta.value="null",Ea=Ta)}La.value=null==pa&&null!=Ea?"null":pa;n.appendChild(La);mxEvent.addListener(La,-"change",function(){var Ua=mxUtils.htmlEntities(La.value);if(La[La.selectedIndex]==Ea||"null"==Ua.value)Ua=null;N(ta,Ua,ma)});La.focus();mxEvent.addListener(La,"blur",function(){n.removeChild(La)})}))}else"dynamicArr"==xa?Ca.appendChild(U(ta,pa,ma.subType,ma.subDefVal,ma.countProperty,Fa,wa)):"staticArr"==xa?Ca.appendChild(W(ta,pa,ma.subType,ma.subDefVal,ma.size,Fa,wa)):"readOnly"==xa?(wa=document.createElement("input"),wa.setAttribute("readonly",""),wa.value=pa,wa.style.borderWidth="0px","id"==ta?-(wa.style.width="190px",wa.style.position="relative",wa.style.right="6px",wa.style.float="right",wa.style.background="none",wa.style.textAlign="right",Fa.firstChild.setAttribute("colspan","2"),wa.setAttribute("title",pa),Fa.firstChild.appendChild(wa)):(wa.style.width="96px",Ca.appendChild(wa))):(Ca.innerHTML=mxUtils.htmlEntities(decodeURIComponent(pa)),mxEvent.addListener(Ca,"click",mxUtils.bind(Z,function(){function La(){var za=Ea.value;za=0==za.length&&"string"!=xa&&"numbers"!=xa?0:za;ma.allowAuto&&-(null!=za.trim&&"auto"==za.trim().toLowerCase()?(za="auto",xa="string"):(za=parseFloat(za),za=isNaN(za)?0:za));null!=ma.min&&za<ma.min?za=ma.min:null!=ma.max&&za>ma.max&&(za=ma.max);var Sa=null;try{Sa="numbers"==xa?za.match(/\d+/g).map(Number).join(" "):encodeURIComponent(("int"==xa?parseInt(za):za)+"")}catch(Ta){}N(ta,Sa,ma,null,Ea)}var Ea=document.createElement("input");R(Ca,Ea,!0);Ea.value=decodeURIComponent(pa);Ea.className="gePropEditor";"int"!=xa&&"float"!=xa||ma.allowAuto||(Ea.type="number",-Ea.step="int"==xa?"1":"any",null!=ma.min&&(Ea.min=parseFloat(ma.min)),null!=ma.max&&(Ea.max=parseFloat(ma.max)));n.appendChild(Ea);mxEvent.addListener(Ea,"keypress",function(za){13==za.keyCode&&La()});Ea.focus();mxEvent.addListener(Ea,"blur",function(){La()})})));ma.isDeletable&&(wa=mxUtils.button("-",mxUtils.bind(Z,function(La){N(ta,"",ma,ma.index);mxEvent.consume(La)})),wa.style.height="16px",wa.style.width="25px",wa.style.float="right",wa.className="geColorBtn",Ca.appendChild(wa));Fa.appendChild(Ca);-return Fa}var Z=this,ca=this.editorUi.editor.graph,ea=[],ja=document.createElement("table");ja.className="geProperties geFullWidthElement";var ba=document.createElement("tr");ba.className="gePropHeader";var fa=document.createElement("th");fa.className="gePropHeaderCell";fa.style.paddingLeft="16px";fa.style.backgroundRepeat="no-repeat";fa.style.backgroundPosition="-2px 50%";fa.style.backgroundSize="20px";mxUtils.write(fa,mxResources.get("property"));ba.style.cursor="pointer";var aa=function(){var ta=-ja.querySelectorAll(".gePropNonHeaderRow");if(Z.editorUi.propertiesCollapsed){fa.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var pa="none";for(var ma=n.childNodes.length-1;0<=ma;ma--)try{var Da=n.childNodes[ma],wa=Da.nodeName.toUpperCase();"INPUT"!=wa&&"SELECT"!=wa||n.removeChild(Da)}catch(ya){}}else fa.style.backgroundImage="url('"+Editor.arrowDownImage+"')",pa="";for(ma=0;ma<ta.length;ma++)ta[ma].style.display=pa};mxEvent.addListener(ba,"click",function(){Z.editorUi.propertiesCollapsed=-!Z.editorUi.propertiesCollapsed;aa()});ba.appendChild(fa);var ia=document.createElement("th");ia.className="gePropHeaderCell";ia.style.paddingLeft="4px";mxUtils.write(ia,mxResources.get("value"));ba.appendChild(ia);ja.appendChild(ba);var ha=ia=!1;ba=null;1==D.vertices.length&&0==D.edges.length?ba=D.vertices[0].id:0==D.vertices.length&&1==D.edges.length&&(ba=D.edges[0].id);null==ba||L||ja.appendChild(Y("id",mxUtils.htmlEntities(ba),{dispName:"id",type:"readOnly"},!0,!1));for(var da in z)if(L=z[da],-"function"!=typeof L.isVisible||L.isVisible(D,this)){var Ba=null!=L.getValue?L.getValue():null!=D.style[da]?mxUtils.htmlEntities(D.style[da]+""):null!=L.getDefaultValue?L.getDefaultValue(D,this):L.defVal;if("separator"==L.type)ha=!ha;else{if("staticArr"==L.type)L.size=parseInt(D.style[L.sizeProperty]||z[L.sizeProperty].defVal)||0;else if(null!=L.dependentProps){var na=L.dependentProps,va=[],Aa=[];for(ba=0;ba<na.length;ba++){var ka=D.style[na[ba]];Aa.push(z[na[ba]].subDefVal);va.push(null!=ka?ka.split(","):-[])}L.dependentPropsDefVal=Aa;L.dependentPropsVals=va}ja.appendChild(Y(da,Ba,L,ia,ha));ia=!ia}}for(ba=0;ba<ea.length;ba++)for(L=ea[ba],z=L.parentRow,D=0;D<L.values.length;D++)da=Y(L.name,L.values[D],{type:L.type,parentRow:L.parentRow,isDeletable:L.isDeletable,index:D,defVal:L.defVal,countProperty:L.countProperty,size:L.size},0==D%2,L.flipBkg),z.parentNode.insertBefore(da,z.nextSibling),z=da;n.appendChild(ja);aa();return n};StyleFormatPanel.prototype.addStyles=function(n){if(null!=this.defaultColorSchemes){var z=-this.editorUi,D=z.editor.graph,L=document.createElement("div");L.style.padding="6px 20px 0 24px";n.appendChild(L);var N=document.createElement("div");N.className="geSwitcher";N.style.padding="4px 18px 6px 0px";for(var R=[],T=0;T<this.defaultColorSchemes.length;T++){var U=document.createElement("div");U.className="geSwitcherDot";mxUtils.bind(this,function(ca){mxEvent.addListener(U,"click",mxUtils.bind(this,function(){W(ca)}))})(T);R.push(U);N.appendChild(U)}var W=mxUtils.bind(this,function(ca){null!=-R[ca]&&(null!=this.format.currentScheme&&null!=R[this.format.currentScheme]&&(R[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=ca,X(this.defaultColorSchemes[this.format.currentScheme]),R[this.format.currentScheme].style.background="#84d7ff")}),X=mxUtils.bind(this,function(ca){var ea=mxUtils.clone(D.defaultVertexStyle);ea[mxConstants.STYLE_STROKECOLOR]=null!=ea[mxConstants.STYLE_STROKECOLOR]?ea[mxConstants.STYLE_STROKECOLOR]:"default";ea[mxConstants.STYLE_FILLCOLOR]=-null!=ea[mxConstants.STYLE_FILLCOLOR]?ea[mxConstants.STYLE_FILLCOLOR]:"default";ea[mxConstants.STYLE_FONTCOLOR]=null!=ea[mxConstants.STYLE_FONTCOLOR]?ea[mxConstants.STYLE_FONTCOLOR]:"default";D.replaceDefaultColors(new mxCell,ea);var ja=mxUtils.bind(this,function(fa){var aa=mxUtils.button("",mxUtils.bind(this,function(da){D.getModel().beginUpdate();try{for(var Ba=z.getSelectionState().cells,na=0;na<Ba.length;na++){var va=D.getModel().getStyle(Ba[na]);null!=fa?(mxEvent.isShiftDown(da)||(va=""==fa.fill||-null==fa.fill?mxUtils.setStyle(va,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(va,mxConstants.STYLE_FILLCOLOR,fa.fill),va=""==fa.gradient||null==fa.gradient?mxUtils.setStyle(va,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(va,mxConstants.STYLE_GRADIENTCOLOR,fa.gradient),mxEvent.isControlDown(da)||mxClient.IS_MAC&&mxEvent.isMetaDown(da)||!D.getModel().isVertex(Ba[na])||(va=""==fa.font||null==fa.font?mxUtils.setStyle(va,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(va,mxConstants.STYLE_FONTCOLOR,-fa.font))),mxEvent.isAltDown(da)||(va=""==fa.stroke||null==fa.fill?mxUtils.setStyle(va,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(va,mxConstants.STYLE_STROKECOLOR,fa.stroke))):(va=mxUtils.setStyle(va,mxConstants.STYLE_FILLCOLOR,null),va=mxUtils.setStyle(va,mxConstants.STYLE_STROKECOLOR,null),va=mxUtils.setStyle(va,mxConstants.STYLE_GRADIENTCOLOR,null),D.getModel().isVertex(Ba[na])&&(va=mxUtils.setStyle(va,mxConstants.STYLE_FONTCOLOR,null)));D.getModel().setStyle(Ba[na],va)}}finally{D.getModel().endUpdate()}}));-aa.className="geStyleButton";aa.style.width="36px";aa.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";aa.style.margin="0px 6px 6px 0px";if(null!=fa){var ia="1px solid";null!=fa.border&&(ia=fa.border);if(null!=fa.gradient)aa.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(fa.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(fa.gradient).cssText+" 100%)";else if(fa.fill==mxConstants.NONE)aa.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==fa.fill||-""==fa.fill)aa.style.backgroundColor=mxUtils.getLightDarkColor(mxUtils.getValue(ea,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var ha=mxUtils.getLightDarkColor(fa.fill);aa.style.backgroundImage="linear-gradient(to right bottom, "+ha.cssText+" 50%, "+ha.light+" 50.3%)"}null==fa.stroke||fa.stroke==mxConstants.NONE?aa.style.border=ia+" transparent":""==fa.stroke?aa.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(ea,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(ha=mxUtils.getLightDarkColor(fa.stroke),-aa.style.border=ia+" "+ha.cssText,aa.style.borderRightColor=ha.light,aa.style.borderBottomColor=aa.style.borderRightColor);null!=fa.title&&aa.setAttribute("title",fa.title)}else ia=mxUtils.getValue(ea,mxConstants.STYLE_FILLCOLOR,"#ffffff"),ha=mxUtils.getValue(ea,mxConstants.STYLE_STROKECOLOR,"#000000"),aa.style.backgroundColor=ia,aa.style.border="1px solid "+ha;aa.style.borderRadius="0";L.appendChild(aa);null!=fa&&null!=fa.gradient&&(ia=aa.cloneNode(!1),ia.style.backgroundImage="linear-gradient(light-dark(transparent, "+-mxUtils.getLightDarkColor(fa.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(fa.gradient).light+") 100%)",ia.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",ia.style.backgroundColor="transparent",L.appendChild(ia),ia.style.marginLeft="-42px",mxEvent.addListener(ia,"click",function(){aa.click()}))});L.innerText="";if(null!=ca)for(var ba=0;ba<ca.length;ba++)0<ba&&0==mxUtils.mod(ba,4)&&mxUtils.br(L),ja(ca[ba])});null==this.format.currentScheme?W(Math.min(R.length-1,Editor.isDarkMode()?+{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[{fill:"",stroke:""},{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;var g=StyleFormatPanel.prototype.init;+StyleFormatPanel.prototype.init=function(){var n=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&"image"!=n.style.shape&&!n.containsLabel&&0<n.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));g.apply(this,arguments);null!=n.customProperties&&this.container.appendChild(this.addProperties(this.createPanel(),n.customProperties,n))};var k=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(n){var A=+this.editorUi.getSelectionState();1==A.cells.length?this.addActions(n,["copyStyle","pasteStyle"]):1<=A.cells.length&&this.addActions(n,["pasteStyle","pasteData"]);k.apply(this,arguments);return n};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(n,A,E,L){function O(ta,pa,ma,Da,wa){if(null!=ma.valueChanged)ma.valueChanged(pa,wa);else{ca.getModel().beginUpdate();try{wa=[];var ya=[];if(null!=ma.index){for(var xa=[],Fa=ma.parentRow.nextSibling;Fa&&Fa.getAttribute("data-pName")==+ta;)xa.push(Fa.getAttribute("data-pValue")),Fa=Fa.nextSibling;ma.index<xa.length?null!=Da?xa.splice(Da,1):xa[ma.index]=pa:xa.push(pa);null!=ma.size&&xa.length>ma.size&&(xa=xa.slice(0,ma.size));pa=xa.join(",");null!=ma.countProperty&&(ca.setCellStyles(ma.countProperty,xa.length,ca.getSelectionCells()),wa.push(ma.countProperty),ya.push(xa.length))}ca.setCellStyles(ta,pa,ca.getSelectionCells());wa.push(ta);ya.push(pa);if(null!=ma.dependentProps)for(ta=0;ta<ma.dependentProps.length;ta++){var Ca=ma.dependentPropsDefVal[ta],+Ia=ma.dependentPropsVals[ta];if(Ia.length>pa)Ia=Ia.slice(0,pa);else for(var La=Ia.length;La<pa;La++)Ia.push(Ca);Ia=Ia.join(",");ca.setCellStyles(ma.dependentProps[ta],Ia,ca.getSelectionCells());wa.push(ma.dependentProps[ta]);ya.push(Ia)}if("function"==typeof ma.onChange)ma.onChange(ca,pa);Z.editorUi.fireEvent(new mxEventObject("styleChanged","keys",wa,"values",ya,"cells",ca.getSelectionCells()))}finally{ca.getModel().endUpdate()}}}function R(ta,pa,ma){var Da=mxUtils.getOffset(n,!0),wa=mxUtils.getOffset(ta,+!0);pa.style.position="absolute";pa.style.left=wa.x-Da.x+"px";pa.style.top=wa.y-Da.y+"px";pa.style.width=ta.offsetWidth+"px";pa.style.height=ta.offsetHeight-(ma?4:0)+"px";pa.style.zIndex=5}function T(ta,pa,ma){function Da(ya){if(null==ya||ya==mxConstants.NONE)wa.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==ya)wa.style.background="";else{var xa=mxUtils.getLightDarkColor(ya);mxUtils.isLightDarkColor(ya)&&xa.light!=xa.dark?wa.style.background="linear-gradient(to right bottom, "++xa.cssText+" 50%, "+mxUtils.invertLightDarkColor(xa).cssText+" 50.3%)":wa.style.background=ya}}var wa=document.createElement("div");wa.style.width="32px";wa.style.height="8px";wa.style.margin="2px";wa.style.borderStyle="solid";wa.style.borderWidth="1px";Da(pa);btn=mxUtils.button("",mxUtils.bind(Z,function(ya){this.editorUi.pickColor(pa,function(xa){O(ta,xa,ma);Da(xa)});mxEvent.consume(ya)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className=+"geColorBtn";btn.appendChild(wa);return btn}function U(ta,pa,ma,Da,wa,ya,xa){null!=pa&&(pa=pa.split(","),ea.push({name:ta,values:pa,type:ma,defVal:Da,countProperty:wa,parentRow:ya,isDeletable:!0,flipBkg:xa}));btn=mxUtils.button("+",mxUtils.bind(Z,function(Fa){for(var Ca=ya,Ia=0;null!=Ca.nextSibling;)if(Ca.nextSibling.getAttribute("data-pName")==ta)Ca=Ca.nextSibling,Ia++;else break;var La={type:ma,parentRow:ya,index:Ia,isDeletable:!0,defVal:Da,countProperty:wa};Ia=Y(ta,"",La,0==Ia%2,xa);O(ta,Da,La);+Ca.parentNode.insertBefore(Ia,Ca.nextSibling);mxEvent.consume(Fa)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function W(ta,pa,ma,Da,wa,ya,xa){if(0<wa){var Fa=Array(wa);pa=null!=pa?pa.split(","):[];for(var Ca=0;Ca<wa;Ca++)Fa[Ca]=null!=pa[Ca]?pa[Ca]:null!=Da?Da:"";ea.push({name:ta,values:Fa,type:ma,defVal:Da,parentRow:ya,flipBkg:xa,size:wa})}return document.createElement("div")}function X(ta,pa,ma){var Da=document.createElement("input");Da.type="checkbox";+Da.checked="1"==pa;mxEvent.addListener(Da,"change",function(){O(ta,Da.checked?"1":"0",ma)});return Da}function Y(ta,pa,ma,Da,wa){var ya=ma.dispName,xa=ma.type,Fa=document.createElement("tr");Fa.className="gePropRow"+(wa?"Dark":"")+(Da?"Alt":"")+" gePropNonHeaderRow";Fa.setAttribute("data-pName",ta);Fa.setAttribute("data-pValue",pa);Da=!1;null!=ma.index&&(Fa.setAttribute("data-index",ma.index),ya=(null!=ya?ya:"")+"["+ma.index+"]",Da=!0);var Ca=document.createElement("td");Ca.className="gePropRowCell";+ya=mxResources.get(ya,null,ya);mxUtils.write(Ca,ya);Ca.setAttribute("title",ya);Da&&(Ca.style.textAlign="right");Fa.appendChild(Ca);Ca=document.createElement("td");Ca.className="gePropRowCell";Ca.setAttribute("title",null!=pa?pa:mxResources.get("none"));if("color"==xa)Ca.appendChild(T(ta,pa,ma));else if("bool"==xa||"boolean"==xa)Ca.appendChild(X(ta,pa,ma));else if("enum"==xa){var Ia=ma.enumList;for(wa=0;wa<Ia.length;wa++)if(ya=Ia[wa],ya.val==pa){mxUtils.write(Ca,mxResources.get(ya.dispName,null,ya.dispName));+break}mxEvent.addListener(Ca,"click",mxUtils.bind(Z,function(){var La=document.createElement("select"),Ea=null;R(Ca,La);for(var za=0;za<Ia.length;za++){var Sa=Ia[za],Ta=document.createElement("option");Ta.value=mxUtils.htmlEntities(Sa.val);mxUtils.write(Ta,mxResources.get(Sa.dispName,null,Sa.dispName));La.appendChild(Ta);null==Sa.val&&(Ta.value="null",Ea=Ta)}La.value=null==pa&&null!=Ea?"null":pa;n.appendChild(La);mxEvent.addListener(La,"change",function(){var Ua=mxUtils.htmlEntities(La.value);if(La[La.selectedIndex]==+Ea||"null"==Ua.value)Ua=null;O(ta,Ua,ma)});La.focus();mxEvent.addListener(La,"blur",function(){n.removeChild(La)})}))}else"dynamicArr"==xa?Ca.appendChild(U(ta,pa,ma.subType,ma.subDefVal,ma.countProperty,Fa,wa)):"staticArr"==xa?Ca.appendChild(W(ta,pa,ma.subType,ma.subDefVal,ma.size,Fa,wa)):"readOnly"==xa?(wa=document.createElement("input"),wa.setAttribute("readonly",""),wa.value=pa,wa.style.borderWidth="0px","id"==ta?(wa.style.width="190px",wa.style.position="relative",wa.style.right="6px",wa.style.float=+"right",wa.style.background="none",wa.style.textAlign="right",Fa.firstChild.setAttribute("colspan","2"),wa.setAttribute("title",pa),Fa.firstChild.appendChild(wa)):(wa.style.width="96px",Ca.appendChild(wa))):(Ca.innerHTML=mxUtils.htmlEntities(decodeURIComponent(pa)),mxEvent.addListener(Ca,"click",mxUtils.bind(Z,function(){function La(){var za=Ea.value;za=0==za.length&&"string"!=xa&&"numbers"!=xa?0:za;ma.allowAuto&&(null!=za.trim&&"auto"==za.trim().toLowerCase()?(za="auto",xa="string"):(za=parseFloat(za),+za=isNaN(za)?0:za));null!=ma.min&&za<ma.min?za=ma.min:null!=ma.max&&za>ma.max&&(za=ma.max);var Sa=null;try{Sa="numbers"==xa?za.match(/\d+/g).map(Number).join(" "):encodeURIComponent(("int"==xa?parseInt(za):za)+"")}catch(Ta){}O(ta,Sa,ma,null,Ea)}var Ea=document.createElement("input");R(Ca,Ea,!0);Ea.value=decodeURIComponent(pa);Ea.className="gePropEditor";"int"!=xa&&"float"!=xa||ma.allowAuto||(Ea.type="number",Ea.step="int"==xa?"1":"any",null!=ma.min&&(Ea.min=parseFloat(ma.min)),null!=ma.max&&(Ea.max=+parseFloat(ma.max)));n.appendChild(Ea);mxEvent.addListener(Ea,"keypress",function(za){13==za.keyCode&&La()});Ea.focus();mxEvent.addListener(Ea,"blur",function(){La()})})));ma.isDeletable&&(wa=mxUtils.button("-",mxUtils.bind(Z,function(La){O(ta,"",ma,ma.index);mxEvent.consume(La)})),wa.style.height="16px",wa.style.width="25px",wa.style.float="right",wa.className="geColorBtn",Ca.appendChild(wa));Fa.appendChild(Ca);return Fa}var Z=this,ca=this.editorUi.editor.graph,ea=[],ia=document.createElement("table");+ia.className="geProperties geFullWidthElement";var ba=document.createElement("tr");ba.className="gePropHeader";var fa=document.createElement("th");fa.className="gePropHeaderCell";fa.style.paddingLeft="16px";fa.style.backgroundRepeat="no-repeat";fa.style.backgroundPosition="-2px 50%";fa.style.backgroundSize="20px";mxUtils.write(fa,mxResources.get("property"));ba.style.cursor="pointer";var aa=function(){var ta=ia.querySelectorAll(".gePropNonHeaderRow");if(Z.editorUi.propertiesCollapsed){fa.style.backgroundImage=+"url('"+Editor.arrowRightImage+"')";var pa="none";for(var ma=n.childNodes.length-1;0<=ma;ma--)try{var Da=n.childNodes[ma],wa=Da.nodeName.toUpperCase();"INPUT"!=wa&&"SELECT"!=wa||n.removeChild(Da)}catch(ya){}}else fa.style.backgroundImage="url('"+Editor.arrowDownImage+"')",pa="";for(ma=0;ma<ta.length;ma++)ta[ma].style.display=pa};mxEvent.addListener(ba,"click",function(){Z.editorUi.propertiesCollapsed=!Z.editorUi.propertiesCollapsed;aa()});ba.appendChild(fa);var ja=document.createElement("th");ja.className=+"gePropHeaderCell";ja.style.paddingLeft="4px";mxUtils.write(ja,mxResources.get("value"));ba.appendChild(ja);ia.appendChild(ba);var ha=ja=!1;ba=null;1==E.vertices.length&&0==E.edges.length?ba=E.vertices[0].id:0==E.vertices.length&&1==E.edges.length&&(ba=E.edges[0].id);null==ba||L||ia.appendChild(Y("id",mxUtils.htmlEntities(ba),{dispName:"id",type:"readOnly"},!0,!1));for(var da in A)if(L=A[da],!L.primary&&("function"!=typeof L.isVisible||L.isVisible(E,this))){var Ba=null!=L.getValue?L.getValue():null!=+E.style[da]?mxUtils.htmlEntities(E.style[da]+""):null!=L.getDefaultValue?L.getDefaultValue(E,this):L.defVal;if("separator"==L.type)ha=!ha;else{if("staticArr"==L.type)L.size=parseInt(E.style[L.sizeProperty]||A[L.sizeProperty].defVal)||0;else if(null!=L.dependentProps){var na=L.dependentProps,va=[],Aa=[];for(ba=0;ba<na.length;ba++){var ka=E.style[na[ba]];Aa.push(A[na[ba]].subDefVal);va.push(null!=ka?ka.split(","):[])}L.dependentPropsDefVal=Aa;L.dependentPropsVals=va}ia.appendChild(Y(da,Ba,L,ja,ha));+ja=!ja}}for(ba=0;ba<ea.length;ba++)for(L=ea[ba],A=L.parentRow,E=0;E<L.values.length;E++)da=Y(L.name,L.values[E],{type:L.type,parentRow:L.parentRow,isDeletable:L.isDeletable,index:E,defVal:L.defVal,countProperty:L.countProperty,size:L.size},0==E%2,L.flipBkg),A.parentNode.insertBefore(da,A.nextSibling),A=da;n.appendChild(ia);aa();return n};StyleFormatPanel.prototype.addStyles=function(n){if(null!=this.defaultColorSchemes){var A=this.editorUi,E=A.editor.graph,L=document.createElement("div");L.style.padding=+"6px 20px 0 24px";n.appendChild(L);var O=document.createElement("div");O.className="geSwitcher";O.style.padding="4px 18px 6px 0px";for(var R=[],T=0;T<this.defaultColorSchemes.length;T++){var U=document.createElement("div");U.className="geSwitcherDot";mxUtils.bind(this,function(ca){mxEvent.addListener(U,"click",mxUtils.bind(this,function(){W(ca)}))})(T);R.push(U);O.appendChild(U)}var W=mxUtils.bind(this,function(ca){null!=R[ca]&&(null!=this.format.currentScheme&&null!=R[this.format.currentScheme]&&+(R[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=ca,X(this.defaultColorSchemes[this.format.currentScheme]),R[this.format.currentScheme].style.background="#84d7ff")}),X=mxUtils.bind(this,function(ca){var ea=mxUtils.clone(E.defaultVertexStyle);ea[mxConstants.STYLE_STROKECOLOR]=null!=ea[mxConstants.STYLE_STROKECOLOR]?ea[mxConstants.STYLE_STROKECOLOR]:"default";ea[mxConstants.STYLE_FILLCOLOR]=null!=ea[mxConstants.STYLE_FILLCOLOR]?ea[mxConstants.STYLE_FILLCOLOR]:+"default";ea[mxConstants.STYLE_FONTCOLOR]=null!=ea[mxConstants.STYLE_FONTCOLOR]?ea[mxConstants.STYLE_FONTCOLOR]:"default";E.replaceDefaultColors(new mxCell,ea);var ia=mxUtils.bind(this,function(fa){var aa=mxUtils.button("",mxUtils.bind(this,function(da){E.getModel().beginUpdate();try{for(var Ba=A.getSelectionState().cells,na=0;na<Ba.length;na++){var va=E.getModel().getStyle(Ba[na]);null!=fa?(mxEvent.isShiftDown(da)||(va=""==fa.fill||null==fa.fill?mxUtils.setStyle(va,mxConstants.STYLE_FILLCOLOR,null):+mxUtils.setStyle(va,mxConstants.STYLE_FILLCOLOR,fa.fill),va=""==fa.gradient||null==fa.gradient?mxUtils.setStyle(va,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(va,mxConstants.STYLE_GRADIENTCOLOR,fa.gradient),mxEvent.isControlDown(da)||mxClient.IS_MAC&&mxEvent.isMetaDown(da)||!E.getModel().isVertex(Ba[na])||(va=""==fa.font||null==fa.font?mxUtils.setStyle(va,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(va,mxConstants.STYLE_FONTCOLOR,fa.font))),mxEvent.isAltDown(da)||(va=""==fa.stroke||+null==fa.fill?mxUtils.setStyle(va,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(va,mxConstants.STYLE_STROKECOLOR,fa.stroke))):(va=mxUtils.setStyle(va,mxConstants.STYLE_FILLCOLOR,null),va=mxUtils.setStyle(va,mxConstants.STYLE_STROKECOLOR,null),va=mxUtils.setStyle(va,mxConstants.STYLE_GRADIENTCOLOR,null),E.getModel().isVertex(Ba[na])&&(va=mxUtils.setStyle(va,mxConstants.STYLE_FONTCOLOR,null)));E.getModel().setStyle(Ba[na],va)}}finally{E.getModel().endUpdate()}}));aa.className="geStyleButton";+aa.style.width="36px";aa.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";aa.style.margin="0px 6px 6px 0px";if(null!=fa){var ja="1px solid";null!=fa.border&&(ja=fa.border);if(null!=fa.gradient)aa.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(fa.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(fa.gradient).cssText+" 100%)";else if(fa.fill==mxConstants.NONE)aa.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==fa.fill||""==fa.fill)aa.style.backgroundColor=+mxUtils.getLightDarkColor(mxUtils.getValue(ea,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var ha=mxUtils.getLightDarkColor(fa.fill);aa.style.backgroundImage="linear-gradient(to right bottom, "+ha.cssText+" 50%, "+ha.light+" 50.3%)"}null==fa.stroke||fa.stroke==mxConstants.NONE?aa.style.border=ja+" transparent":""==fa.stroke?aa.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(ea,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(ha=mxUtils.getLightDarkColor(fa.stroke),aa.style.border=+ja+" "+ha.cssText,aa.style.borderRightColor=ha.light,aa.style.borderBottomColor=aa.style.borderRightColor);null!=fa.title&&aa.setAttribute("title",fa.title)}else ja=mxUtils.getValue(ea,mxConstants.STYLE_FILLCOLOR,"#ffffff"),ha=mxUtils.getValue(ea,mxConstants.STYLE_STROKECOLOR,"#000000"),aa.style.backgroundColor=ja,aa.style.border="1px solid "+ha;aa.style.borderRadius="0";L.appendChild(aa);null!=fa&&null!=fa.gradient&&(ja=aa.cloneNode(!1),ja.style.backgroundImage="linear-gradient(light-dark(transparent, "++mxUtils.getLightDarkColor(fa.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(fa.gradient).light+") 100%)",ja.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",ja.style.backgroundColor="transparent",L.appendChild(ja),ja.style.marginLeft="-42px",mxEvent.addListener(ja,"click",function(){aa.click()}))});L.innerText="";if(null!=ca)for(var ba=0;ba<ca.length;ba++)0<ba&&0==mxUtils.mod(ba,4)&&mxUtils.br(L),ia(ca[ba])});null==this.format.currentScheme?W(Math.min(R.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):W(this.format.currentScheme);T=10>=this.defaultColorSchemes.length?43:23;var Y=document.createElement("div");Y.className="geButton";Y.style.cssText="position:absolute;left:0px;bottom:"+T+"px;width:20px;background-image:url("+Editor.chevronLeftImage+");";mxEvent.addListener(Y,"click",mxUtils.bind(this,function(){W(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var Z=document.createElement("div");Z.className="geButton";Z.style.cssText="position:absolute;left:186px;bottom:"+-T+"px;width:20px;background-image:url("+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(n.appendChild(Y),n.appendChild(Z));mxEvent.addListener(Z,"click",mxUtils.bind(this,function(){W(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));X(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&n.appendChild(N)}return n}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('++T+"px;width:20px;background-image:url("+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(n.appendChild(Y),n.appendChild(Z));mxEvent.addListener(Z,"click",mxUtils.bind(this,function(){W(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));X(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&n.appendChild(O)}return n}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements={};Graph.isGoogleFontUrl=function(n){return n.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||n.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=function(n){return Graph.isGoogleFontUrl(n)};Graph.rewriteGoogleFontUrl=function(n){null!=n&&n.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(n=Editor.GOOGLE_FONTS_CSS2+n.substring(Editor.GOOGLE_FONTS.length)+-":wght@400;500");return n};Graph.createFontElement=function(n,z){var D=Graph.fontMapping[z];null==D&&Graph.isCssFontUrl(z)?(n=document.createElement("link"),n.setAttribute("rel","stylesheet"),n.setAttribute("type","text/css"),n.setAttribute("charset","UTF-8"),n.setAttribute("href",Graph.rewriteGoogleFontUrl(z))):(null==D&&(D='@font-face {\nfont-family: "'+n+'";\nsrc: url("'+z+'");\n}'),n=document.createElement("style"),mxUtils.write(n,D));return n};Graph.addRecentCustomFont=function(n,z){};Graph.addFont=-function(n,z,D){if(null!=n&&0<n.length&&null!=z&&0<z.length){var L=n.toLowerCase();if("helvetica"!=L&&"arial"!=n&&"sans-serif"!=L){var N=Graph.customFontElements[L];null!=N&&N.url!=z&&(N.elt.parentNode.removeChild(N.elt),N=null);null==N?(N=z,"http:"==z.substring(0,5)&&(N=PROXY_URL+"?url="+encodeURIComponent(z)),N={name:n,url:z,elt:Graph.createFontElement(n,N)},Graph.customFontElements[L]=N,z=document.getElementsByTagName("head")[0],null!=D&&("link"==N.elt.nodeName.toLowerCase()?(N.elt.onload=D,N.elt.onerror=-D):D()),null!=z&&z.appendChild(N.elt)):null!=D&&D()}else null!=D&&D()}else null!=D&&D();return n};Graph.getFontUrl=function(n,z){n=Graph.customFontElements[n.toLowerCase()];null!=n&&(z=n.url);return z};Graph.processFontAttributes=function(n){n=n.getElementsByTagName("*");for(var z=0;z<n.length;z++){var D=n[z].getAttribute("data-font-src");if(null!=D){var L="FONT"==n[z].nodeName?n[z].getAttribute("face"):n[z].style.fontFamily;null!=L&&Graph.addFont(L,D)}}};Graph.processFontStyle=function(n){if(null!=-n){var z=mxUtils.getValue(n,"fontSource",null);if(null!=z){var D=mxUtils.getValue(n,mxConstants.STYLE_FONTFAMILY,null);if(null!=D)try{Graph.addFont(D,decodeURIComponent(z))}catch(L){}}}return n};Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;Graph.prototype.shadowId="drawio-drop-shadow";Graph.prototype.svgShadowColor="#3D4574";-Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var m=Graph.prototype.init;Graph.prototype.init=function(){function n(N){z=N}m.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var z=null;mxEvent.addListener(this.container,"mouseenter",n);mxEvent.addListener(this.container,"mousemove",n);mxEvent.addListener(this.container,"mouseleave",-function(N){z=null});this.isMouseInsertPoint=function(){return null!=z};var D=this.getInsertPoint;this.getInsertPoint=function(){return null!=z?this.getPointForEvent(z):D.apply(this,arguments)};var L=this.layoutManager.getLayout;this.layoutManager.getLayout=function(N){var R=this.graph.getCellStyle(N);if(null!=R&&"rack"==R.childLayout){var T=new mxStackLayout(this.graph,!1);T.gridSize=null!=R.rackUnitSize?parseFloat(R.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;-T.marginLeft=R.marginLeft||0;T.marginRight=R.marginRight||0;T.marginTop=R.marginTop||0;T.marginBottom=R.marginBottom||0;T.allowGaps=R.allowGaps||0;T.horizontal="1"==mxUtils.getValue(R,"horizontalRack","0");T.resizeParent=!1;T.fill=!0;return T}return L.apply(this,arguments)};this.updateGlobalUrlVariables()};var t=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(n,z){return Graph.processFontStyle(t.apply(this,arguments))};var y=mxSvgCanvas2D.prototype.updateTextNodes;-mxSvgCanvas2D.prototype.updateTextNodes=function(n,z,D,L,N,R,T,U,W,X,Y,Z){y.apply(this,arguments);Graph.processFontAttributes(Z)};var A=mxText.prototype.redraw;mxText.prototype.redraw=function(){A.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(n,z,D,L){function N(){for(var ba=U.getSelectionCells(),fa=[],aa=0;aa<ba.length;aa++)U.isCellVisible(ba[aa])&&fa.push(ba[aa]);U.setSelectionCells(fa)}function R(ba){U.setHiddenTags(ba?-[]:W.slice());N();U.refresh()}function T(ba,fa){Y.innerText="";if(0<ba.length){var aa=document.createElement("table");aa.setAttribute("cellpadding","2");aa.style.boxSizing="border-box";aa.style.tableLayout="fixed";aa.style.width="100%";var ia=document.createElement("tbody");if(null!=ba&&0<ba.length)for(var ha=0;ha<ba.length;ha++)(function(da){function Ba(){var pa=U.getCellsForTags([da],null,null,!0);U.isEnabled()?U.setSelectionCells(pa):U.highlightCells(pa,null,null,70)}var na=0>mxUtils.indexOf(U.hiddenTags,-da),va=document.createElement("tr"),Aa=document.createElement("td");Aa.style.align="center";Aa.style.width="16px";var ka=document.createElement("img");ka.setAttribute("src",na?Editor.visibleImage:Editor.hiddenImage);ka.setAttribute("title",mxResources.get(na?"hideIt":"show",[da]));mxUtils.setOpacity(ka,na?75:25);ka.className="geAdaptiveAsset";ka.style.verticalAlign="middle";ka.style.cursor="pointer";ka.style.width="16px";if(z||Editor.isDarkMode())ka.style.filter="invert(100%)";Aa.appendChild(ka);-mxEvent.addListener(ka,"click",function(pa){mxEvent.isShiftDown(pa)?R(0<=mxUtils.indexOf(U.hiddenTags,da)):(U.toggleHiddenTag(da),N(),U.refresh());mxEvent.consume(pa)});va.appendChild(Aa);Aa=document.createElement("td");Aa.style.align="center";Aa.style.width="16px";ka=document.createElement("img");ka.setAttribute("src",Editor.selectImage);ka.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(ka,na?75:25);ka.className="geAdaptiveAsset";ka.style.verticalAlign="middle";ka.style.cursor=-"pointer";ka.style.width="16px";if(z||Editor.isDarkMode())ka.style.filter="invert(100%)";mxEvent.addListener(ka,"click",function(pa){R(!0);Ba();mxEvent.consume(pa)});Aa.appendChild(ka);va.appendChild(Aa);Aa=document.createElement("td");Aa.style.overflow="hidden";Aa.style.whiteSpace="nowrap";Aa.style.textOverflow="ellipsis";Aa.style.verticalAlign="middle";Aa.style.cursor="pointer";Aa.setAttribute("title",da);a=document.createElement("a");mxUtils.write(a,da);a.style.textOverflow="ellipsis";a.style.position=-"relative";mxUtils.setOpacity(a,na?100:40);Aa.appendChild(a);mxEvent.addListener(Aa,"click",function(pa){if(mxEvent.isShiftDown(pa))R(!0),Ba();else if(na&&0<U.hiddenTags.length)R(!0);else{var ma=W.slice(),Da=mxUtils.indexOf(ma,da);ma.splice(Da,1);U.setHiddenTags(ma);N();U.refresh()}mxEvent.consume(pa)});va.appendChild(Aa);if(U.isEnabled()){Aa=document.createElement("td");Aa.style.verticalAlign="middle";Aa.style.textAlign="center";Aa.style.width="18px";if(null==fa){Aa.style.align="center";Aa.style.width=-"16px";ka=document.createElement("img");ka.setAttribute("src",Editor.trashImage);ka.setAttribute("title",mxResources.get("removeIt",[da]));mxUtils.setOpacity(ka,na?75:25);ka.className="geAdaptiveAsset";ka.style.verticalAlign="middle";ka.style.cursor="pointer";ka.style.width="16px";if(z||Editor.isDarkMode())ka.style.filter="invert(100%)";mxEvent.addListener(ka,"click",function(pa){var ma=mxUtils.indexOf(W,da);0<=ma&&W.splice(ma,1);U.removeTagsForCells(U.model.getDescendants(U.model.getRoot()),[da]);+":wght@400;500");return n};Graph.createFontElement=function(n,A){var E=Graph.fontMapping[A];null==E&&Graph.isCssFontUrl(A)?(n=document.createElement("link"),n.setAttribute("rel","stylesheet"),n.setAttribute("type","text/css"),n.setAttribute("charset","UTF-8"),n.setAttribute("href",Graph.rewriteGoogleFontUrl(A))):(null==E&&(E='@font-face {\nfont-family: "'+n+'";\nsrc: url("'+A+'");\n}'),n=document.createElement("style"),mxUtils.write(n,E));return n};Graph.addRecentCustomFont=function(n,A){};Graph.addFont=+function(n,A,E){if(null!=n&&0<n.length&&null!=A&&0<A.length){var L=n.toLowerCase();if("helvetica"!=L&&"arial"!=n&&"sans-serif"!=L){var O=Graph.customFontElements[L];null!=O&&O.url!=A&&(O.elt.parentNode.removeChild(O.elt),O=null);null==O?(O=A,"http:"==A.substring(0,5)&&(O=PROXY_URL+"?url="+encodeURIComponent(A)),O={name:n,url:A,elt:Graph.createFontElement(n,O)},Graph.customFontElements[L]=O,A=document.getElementsByTagName("head")[0],null!=E&&("link"==O.elt.nodeName.toLowerCase()?(O.elt.onload=E,O.elt.onerror=+E):E()),null!=A&&A.appendChild(O.elt)):null!=E&&E()}else null!=E&&E()}else null!=E&&E();return n};Graph.getFontUrl=function(n,A){n=Graph.customFontElements[n.toLowerCase()];null!=n&&(A=n.url);return A};Graph.processFontAttributes=function(n){n=n.getElementsByTagName("*");for(var A=0;A<n.length;A++){var E=n[A].getAttribute("data-font-src");if(null!=E){var L="FONT"==n[A].nodeName?n[A].getAttribute("face"):n[A].style.fontFamily;null!=L&&Graph.addFont(L,E)}}};Graph.processFontStyle=function(n){if(null!=+n){var A=mxUtils.getValue(n,"fontSource",null);if(null!=A){var E=mxUtils.getValue(n,mxConstants.STYLE_FONTFAMILY,null);if(null!=E)try{Graph.addFont(E,decodeURIComponent(A))}catch(L){}}}return n};Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;Graph.prototype.shadowId="drawio-drop-shadow";Graph.prototype.svgShadowColor="#3D4574";+Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var m=Graph.prototype.init;Graph.prototype.init=function(){function n(O){A=O}m.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var A=null;mxEvent.addListener(this.container,"mouseenter",n);mxEvent.addListener(this.container,"mousemove",n);mxEvent.addListener(this.container,"mouseleave",+function(O){A=null});this.isMouseInsertPoint=function(){return null!=A};var E=this.getInsertPoint;this.getInsertPoint=function(){return null!=A?this.getPointForEvent(A):E.apply(this,arguments)};var L=this.layoutManager.getLayout;this.layoutManager.getLayout=function(O){var R=this.graph.getCellStyle(O);if(null!=R&&"rack"==R.childLayout){var T=new mxStackLayout(this.graph,!1);T.gridSize=null!=R.rackUnitSize?parseFloat(R.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;+T.marginLeft=R.marginLeft||0;T.marginRight=R.marginRight||0;T.marginTop=R.marginTop||0;T.marginBottom=R.marginBottom||0;T.allowGaps=R.allowGaps||0;T.horizontal="1"==mxUtils.getValue(R,"horizontalRack","0");T.resizeParent=!1;T.fill=!0;return T}return L.apply(this,arguments)};this.updateGlobalUrlVariables()};var t=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(n,A){return Graph.processFontStyle(t.apply(this,arguments))};var y=mxSvgCanvas2D.prototype.updateTextNodes;+mxSvgCanvas2D.prototype.updateTextNodes=function(n,A,E,L,O,R,T,U,W,X,Y,Z){y.apply(this,arguments);Graph.processFontAttributes(Z)};var z=mxText.prototype.redraw;mxText.prototype.redraw=function(){z.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(n,A,E,L){function O(){for(var ba=U.getSelectionCells(),fa=[],aa=0;aa<ba.length;aa++)U.isCellVisible(ba[aa])&&fa.push(ba[aa]);U.setSelectionCells(fa)}function R(ba){U.setHiddenTags(ba?+[]:W.slice());O();U.refresh()}function T(ba,fa){Y.innerText="";if(0<ba.length){var aa=document.createElement("table");aa.setAttribute("cellpadding","2");aa.style.boxSizing="border-box";aa.style.tableLayout="fixed";aa.style.width="100%";var ja=document.createElement("tbody");if(null!=ba&&0<ba.length)for(var ha=0;ha<ba.length;ha++)(function(da){function Ba(){var pa=U.getCellsForTags([da],null,null,!0);U.isEnabled()?U.setSelectionCells(pa):U.highlightCells(pa,null,null,70)}var na=0>mxUtils.indexOf(U.hiddenTags,+da),va=document.createElement("tr"),Aa=document.createElement("td");Aa.style.align="center";Aa.style.width="16px";var ka=document.createElement("img");ka.setAttribute("src",na?Editor.visibleImage:Editor.hiddenImage);ka.setAttribute("title",mxResources.get(na?"hideIt":"show",[da]));mxUtils.setOpacity(ka,na?75:25);ka.className="geAdaptiveAsset";ka.style.verticalAlign="middle";ka.style.cursor="pointer";ka.style.width="16px";if(A||Editor.isDarkMode())ka.style.filter="invert(100%)";Aa.appendChild(ka);+mxEvent.addListener(ka,"click",function(pa){mxEvent.isShiftDown(pa)?R(0<=mxUtils.indexOf(U.hiddenTags,da)):(U.toggleHiddenTag(da),O(),U.refresh());mxEvent.consume(pa)});va.appendChild(Aa);Aa=document.createElement("td");Aa.style.align="center";Aa.style.width="16px";ka=document.createElement("img");ka.setAttribute("src",Editor.selectImage);ka.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(ka,na?75:25);ka.className="geAdaptiveAsset";ka.style.verticalAlign="middle";ka.style.cursor=+"pointer";ka.style.width="16px";if(A||Editor.isDarkMode())ka.style.filter="invert(100%)";mxEvent.addListener(ka,"click",function(pa){R(!0);Ba();mxEvent.consume(pa)});Aa.appendChild(ka);va.appendChild(Aa);Aa=document.createElement("td");Aa.style.overflow="hidden";Aa.style.whiteSpace="nowrap";Aa.style.textOverflow="ellipsis";Aa.style.verticalAlign="middle";Aa.style.cursor="pointer";Aa.setAttribute("title",da);a=document.createElement("a");mxUtils.write(a,da);a.style.textOverflow="ellipsis";a.style.position=+"relative";mxUtils.setOpacity(a,na?100:40);Aa.appendChild(a);mxEvent.addListener(Aa,"click",function(pa){if(mxEvent.isShiftDown(pa))R(!0),Ba();else if(na&&0<U.hiddenTags.length)R(!0);else{var ma=W.slice(),Da=mxUtils.indexOf(ma,da);ma.splice(Da,1);U.setHiddenTags(ma);O();U.refresh()}mxEvent.consume(pa)});va.appendChild(Aa);if(U.isEnabled()){Aa=document.createElement("td");Aa.style.verticalAlign="middle";Aa.style.textAlign="center";Aa.style.width="18px";if(null==fa){Aa.style.align="center";Aa.style.width=+"16px";ka=document.createElement("img");ka.setAttribute("src",Editor.trashImage);ka.setAttribute("title",mxResources.get("removeIt",[da]));mxUtils.setOpacity(ka,na?75:25);ka.className="geAdaptiveAsset";ka.style.verticalAlign="middle";ka.style.cursor="pointer";ka.style.width="16px";if(A||Editor.isDarkMode())ka.style.filter="invert(100%)";mxEvent.addListener(ka,"click",function(pa){var ma=mxUtils.indexOf(W,da);0<=ma&&W.splice(ma,1);U.removeTagsForCells(U.model.getDescendants(U.model.getRoot()),[da]);U.refresh();mxEvent.consume(pa)});Aa.appendChild(ka)}else{var ta=document.createElement("input");ta.setAttribute("type","checkbox");ta.style.margin="0px";ta.defaultChecked=null!=fa&&0<=mxUtils.indexOf(fa,da);ta.checked=ta.defaultChecked;ta.style.background="transparent";ta.setAttribute("title",mxResources.get(ta.defaultChecked?"removeIt":"add",[da]));mxEvent.addListener(ta,"change",function(pa){ta.checked?U.addTagsForCells(U.getSelectionCells(),[da]):U.removeTagsForCells(U.getSelectionCells(),[da]);-mxEvent.consume(pa)});Aa.appendChild(ta)}va.appendChild(Aa)}ia.appendChild(va)})(ba[ha]);aa.appendChild(ia);Y.appendChild(aa)}}var U=this,W=U.hiddenTags.slice(),X=document.createElement("div");X.style.userSelect="none";X.style.overflow="hidden";X.style.padding="10px";X.style.height="100%";var Y=document.createElement("div");Y.style.position="absolute";Y.style.boxSizing="border-box";Y.style.userSelect="none";Y.style.overflow="auto";Y.style.padding="3px";Y.style.left="0px";Y.style.right="0px";Y.style.top=+mxEvent.consume(pa)});Aa.appendChild(ta)}va.appendChild(Aa)}ja.appendChild(va)})(ba[ha]);aa.appendChild(ja);Y.appendChild(aa)}}var U=this,W=U.hiddenTags.slice(),X=document.createElement("div");X.style.userSelect="none";X.style.overflow="hidden";X.style.padding="10px";X.style.height="100%";var Y=document.createElement("div");Y.style.position="absolute";Y.style.boxSizing="border-box";Y.style.userSelect="none";Y.style.overflow="auto";Y.style.padding="3px";Y.style.left="0px";Y.style.right="0px";Y.style.top="0px";Y.style.bottom="0px";X.appendChild(Y);U.addListener(mxEvent.ROOT,function(){W=U.hiddenTags.slice()});var Z=mxUtils.bind(this,function(ba,fa){if(n()){ba=U.getAllTags();for(fa=0;fa<ba.length;fa++)0>mxUtils.indexOf(W,ba[fa])&&W.push(ba[fa]);W.sort();U.isSelectionEmpty()?T(W):T(W,U.getCommonTagsForCells(U.getSelectionCells()))}});U.selectionModel.addListener(mxEvent.CHANGE,Z);U.model.addListener(mxEvent.CHANGE,Z);U.addListener(mxEvent.REFRESH,Z);var ca=document.createElement("div");ca.className=-"geToolbarContainer geDialogToolbar";ca.style.position="absolute";ca.style.display="flex";ca.style.bottom="0px";ca.style.left="0px";ca.style.right="0px";ca.style.height="32px";ca.style.overflow="hidden";ca.style.padding="3px 4px 4px 4px";ca.style.borderWidth="1px 0px 0px 0px";ca.style.borderStyle="solid";ca.style.whiteSpace="nowrap";if(U.isEnabled()){Y.style.bottom="32px";var ea=document.createElement("a");ea.className="geButton";var ja=ea.cloneNode(!1);ja.style.backgroundImage="url("+Editor.visibleImage+-")";ja.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(ja,"click",function(ba){U.setHiddenTags([]);mxEvent.isShiftDown(ba)||(W=U.hiddenTags.slice());N();U.refresh();mxEvent.consume(ba)});ca.appendChild(ja);null!=D&&(ea=ea.cloneNode(!1),ea.style.backgroundImage="url("+Editor.plusImage+")",ea.setAttribute("title",mxResources.get("add")),mxEvent.addListener(ea,"click",function(ba){D(W,function(fa){W=fa;Z()});mxEvent.consume(ba)}),ca.appendChild(ea));X.appendChild(ca)}null!=L&&ca.appendChild(L);-return{div:X,refresh:Z}};Graph.prototype.getCustomFonts=function(){var n=this.extFonts;n=null!=n?n.slice():[];for(var z in Graph.customFontElements){var D=Graph.customFontElements[z];n.push({name:D.name,url:D.url})}return n};Graph.prototype.setFont=function(n,z){Graph.addFont(n,z);var D=Editor.guid();document.execCommand("fontname",!1,D);for(var L=this.cellEditor.textarea.getElementsByTagName("font"),N=!1,R=0;R<L.length;R++)L[R].getAttribute("face")==D&&(N=!0,L[R].setAttribute("face",n),null!=z?L[R].setAttribute("data-font-src",-z):L[R].removeAttribute("data-font-src"));N||document.execCommand("fontname",!1,n)};var I=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return I.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var n=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=n)for(var z in n)this.globalVars[z]=-n[z]}catch(D){null!=window.console&&console.log("Error in vars URL parameter: "+D)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var F=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(n){var z=F.apply(this,arguments);null==z&&null!=this.globalVars&&(z=this.globalVars[n]);return z};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var n=this.themes["default-style2"];this.defaultStylesheet=-(new mxCodec(n.ownerDocument)).decode(n)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var C=Graph.prototype.getSvg;Graph.prototype.getSvg=function(n,z,D,L,N,R,T,U,W,X,Y,Z,ca,ea,ja,ba){var fa=C.apply(this,arguments);if(null!=Z){var aa=fa.getAttribute("style");null==aa&&(aa="");Z="auto"==Z||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":Z;fa.setAttribute("style",aa+(" color-scheme: "+Z+";"))}var ia=this.getCustomFonts();-if(Y&&0<ia.length){var ha=fa.ownerDocument;aa=null!=ha.createElementNS?ha.createElementNS(mxConstants.NS_SVG,"style"):ha.createElement("style");null!=ha.setAttributeNS?aa.setAttributeNS("type","text/css"):aa.setAttribute("type","text/css");for(var da="",Ba="",na=0;na<ia.length;na++){var va=ia[na].name,Aa=ia[na].url;Graph.isCssFontUrl(Aa)?da+="@import url("+Graph.rewriteGoogleFontUrl(Aa)+");\n":Ba+='@font-face {\nfont-family: "'+va+'";\nsrc: url("'+Aa+'");\n}\n'}aa.appendChild(ha.createTextNode(da++"geToolbarContainer geDialogToolbar";ca.style.position="absolute";ca.style.display="flex";ca.style.bottom="0px";ca.style.left="0px";ca.style.right="0px";ca.style.height="32px";ca.style.overflow="hidden";ca.style.padding="3px 4px 4px 4px";ca.style.borderWidth="1px 0px 0px 0px";ca.style.borderStyle="solid";ca.style.whiteSpace="nowrap";if(U.isEnabled()){Y.style.bottom="32px";var ea=document.createElement("a");ea.className="geButton";var ia=ea.cloneNode(!1);ia.style.backgroundImage="url("+Editor.visibleImage++")";ia.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(ia,"click",function(ba){U.setHiddenTags([]);mxEvent.isShiftDown(ba)||(W=U.hiddenTags.slice());O();U.refresh();mxEvent.consume(ba)});ca.appendChild(ia);null!=E&&(ea=ea.cloneNode(!1),ea.style.backgroundImage="url("+Editor.plusImage+")",ea.setAttribute("title",mxResources.get("add")),mxEvent.addListener(ea,"click",function(ba){E(W,function(fa){W=fa;Z()});mxEvent.consume(ba)}),ca.appendChild(ea));X.appendChild(ca)}null!=L&&ca.appendChild(L);+return{div:X,refresh:Z}};Graph.prototype.getCustomFonts=function(){var n=this.extFonts;n=null!=n?n.slice():[];for(var A in Graph.customFontElements){var E=Graph.customFontElements[A];n.push({name:E.name,url:E.url})}return n};Graph.prototype.setFont=function(n,A){Graph.addFont(n,A);var E=Editor.guid();document.execCommand("fontname",!1,E);for(var L=this.cellEditor.textarea.getElementsByTagName("font"),O=!1,R=0;R<L.length;R++)L[R].getAttribute("face")==E&&(O=!0,L[R].setAttribute("face",n),null!=A?L[R].setAttribute("data-font-src",+A):L[R].removeAttribute("data-font-src"));O||document.execCommand("fontname",!1,n)};var I=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return I.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var n=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=n)for(var A in n)this.globalVars[A]=+n[A]}catch(E){null!=window.console&&console.log("Error in vars URL parameter: "+E)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var F=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(n){var A=F.apply(this,arguments);null==A&&null!=this.globalVars&&(A=this.globalVars[n]);return A};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var n=this.themes["default-style2"];this.defaultStylesheet=+(new mxCodec(n.ownerDocument)).decode(n)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var C=Graph.prototype.getSvg;Graph.prototype.getSvg=function(n,A,E,L,O,R,T,U,W,X,Y,Z,ca,ea,ia,ba){var fa=C.apply(this,arguments);if(null!=Z){var aa=fa.getAttribute("style");null==aa&&(aa="");Z="auto"==Z||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":Z;fa.setAttribute("style",aa+(" color-scheme: "+Z+";"))}var ja=this.getCustomFonts();+if(Y&&0<ja.length){var ha=fa.ownerDocument;aa=null!=ha.createElementNS?ha.createElementNS(mxConstants.NS_SVG,"style"):ha.createElement("style");null!=ha.setAttributeNS?aa.setAttributeNS("type","text/css"):aa.setAttribute("type","text/css");for(var da="",Ba="",na=0;na<ja.length;na++){var va=ja[na].name,Aa=ja[na].url;Graph.isCssFontUrl(Aa)?da+="@import url("+Graph.rewriteGoogleFontUrl(Aa)+");\n":Ba+='@font-face {\nfont-family: "'+va+'";\nsrc: url("'+Aa+'");\n}\n'}aa.appendChild(ha.createTextNode(da+Ba));fa.getElementsByTagName("defs")[0].appendChild(aa)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(fa);this.mathEnabled&&(document.body.appendChild(fa),Editor.MathJaxRender(fa),fa.parentNode.removeChild(fa),aa=fa.ownerDocument.getElementById("MJX-SVG-styles"),null!=aa&&fa.getElementsByTagName("defs")[0].appendChild(aa.cloneNode(!0)));return fa};var Q=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(n){Q.apply(this,arguments);null!=n.secondLabel&&(n.secondLabel.destroy(),n.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(n){return[n.shape,n.text,n.secondLabel,n.control]};var S=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){S.apply(this,arguments);this.enumerationState=0};var V=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(n){null!=n.shape&&this.redrawEnumerationState(n);return V.apply(this,arguments)};-mxGraphView.prototype.createEnumerationValue=function(n){n=decodeURIComponent(mxUtils.getValue(n.style,"enumerateValue",""));""==n&&(n=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(n)+"</div>"};mxGraphView.prototype.redrawEnumerationState=function(n){var z="1"==mxUtils.getValue(n.style,"enumerate",0);z&&null==n.secondLabel?(n.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),-n.secondLabel.size=12,n.secondLabel.state=n,n.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(n,n.secondLabel)):z||null==n.secondLabel||(n.secondLabel.destroy(),n.secondLabel=null);z=n.secondLabel;if(null!=z){var D=n.view.scale,L=this.createEnumerationValue(n);n=this.graph.model.isVertex(n.cell)?new mxRectangle(n.x+n.width-4*D,n.y+4*D,0,0):mxRectangle.fromPoint(n.view.getPoint(n));z.bounds.equals(n)&&z.value==L&&z.scale==D||(z.bounds=n,z.value=L,z.scale=-D,z.redraw())}};var P=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();P.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),this.view.validateBackgroundImage())};var u=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){u.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=-function(n,z){"data:action/json,"==n.substring(0,17)&&(n=JSON.parse(n.substring(17)),null!=n.actions&&this.executeCustomActions(n.actions,null,z))};Graph.prototype.executeCustomActions=function(n,z,D){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=-!0;var L=!1,N=0,R=0,T=mxUtils.bind(this,function(){L||(L=!0,this.model.beginUpdate())}),U=mxUtils.bind(this,function(){L&&(L=!1,this.model.endUpdate())}),W=mxUtils.bind(this,function(){0<N&&N--;0==N&&X()}),X=mxUtils.bind(this,function(){if(R<n.length){var Y=this.stoppingCustomActions,Z=n[R++],ca=[];if(null!=Z.open)if(U(),this.isCustomLink(Z.open)){if(!this.customLinkClicked(Z.open,D))return}else this.openLink(Z.open);null==Z.wait||Y||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=-this.pendingExecuteNextAction=null;W()}),N++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=Z.wait?parseInt(Z.wait):1E3),U());null!=Z.opacity&&null!=Z.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(Z.opacity,!0)),Z.opacity.value);null!=Z.fadeIn&&(N++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Z.fadeIn,!0)),0,1,W,Y?0:Z.fadeIn.delay));null!=Z.fadeOut&&(N++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Z.fadeOut,+mxGraphView.prototype.createEnumerationValue=function(n){n=decodeURIComponent(mxUtils.getValue(n.style,"enumerateValue",""));""==n&&(n=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(n)+"</div>"};mxGraphView.prototype.redrawEnumerationState=function(n){var A="1"==mxUtils.getValue(n.style,"enumerate",0);A&&null==n.secondLabel?(n.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),+n.secondLabel.size=12,n.secondLabel.state=n,n.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(n,n.secondLabel)):A||null==n.secondLabel||(n.secondLabel.destroy(),n.secondLabel=null);A=n.secondLabel;if(null!=A){var E=n.view.scale,L=this.createEnumerationValue(n);n=this.graph.model.isVertex(n.cell)?new mxRectangle(n.x+n.width-4*E,n.y+4*E,0,0):mxRectangle.fromPoint(n.view.getPoint(n));A.bounds.equals(n)&&A.value==L&&A.scale==E||(A.bounds=n,A.value=L,A.scale=+E,A.redraw())}};var P=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();P.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),this.view.validateBackgroundImage())};var u=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){u.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=+function(n,A){"data:action/json,"==n.substring(0,17)&&(n=JSON.parse(n.substring(17)),null!=n.actions&&this.executeCustomActions(n.actions,null,A))};Graph.prototype.executeCustomActions=function(n,A,E){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=+!0;var L=!1,O=0,R=0,T=mxUtils.bind(this,function(){L||(L=!0,this.model.beginUpdate())}),U=mxUtils.bind(this,function(){L&&(L=!1,this.model.endUpdate())}),W=mxUtils.bind(this,function(){0<O&&O--;0==O&&X()}),X=mxUtils.bind(this,function(){if(R<n.length){var Y=this.stoppingCustomActions,Z=n[R++],ca=[];if(null!=Z.open)if(U(),this.isCustomLink(Z.open)){if(!this.customLinkClicked(Z.open,E))return}else this.openLink(Z.open);null==Z.wait||Y||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=+this.pendingExecuteNextAction=null;W()}),O++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=Z.wait?parseInt(Z.wait):1E3),U());null!=Z.opacity&&null!=Z.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(Z.opacity,!0)),Z.opacity.value);null!=Z.fadeIn&&(O++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Z.fadeIn,!0)),0,1,W,Y?0:Z.fadeIn.delay));null!=Z.fadeOut&&(O++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Z.fadeOut,!0)),1,0,W,Y?0:Z.fadeOut.delay));null!=Z.wipeIn&&(ca=ca.concat(this.createWipeAnimations(this.getCellsForAction(Z.wipeIn,!0),!0)));null!=Z.wipeOut&&(ca=ca.concat(this.createWipeAnimations(this.getCellsForAction(Z.wipeOut,!0),!1)));null!=Z.toggle&&(T(),this.toggleCells(this.getCellsForAction(Z.toggle,!0)));if(null!=Z.show){T();var ea=this.getCellsForAction(Z.show,!0);Graph.setOpacityForNodes(this.getNodesForCells(ea),1);this.setCellsVisible(ea,!0)}null!=Z.hide&&(T(),ea=this.getCellsForAction(Z.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(ea),0),this.setCellsVisible(ea,!1));null!=Z.toggleStyle&&null!=Z.toggleStyle.key&&(T(),this.toggleCellStyles(Z.toggleStyle.key,null!=Z.toggleStyle.defaultValue?Z.toggleStyle.defaultValue:"0",this.getCellsForAction(Z.toggleStyle,!0)));null!=Z.style&&null!=Z.style.key&&(T(),this.setCellStyles(Z.style.key,Z.style.value,this.getCellsForAction(Z.style,!0)));ea=[];null!=Z.select&&this.isEnabled()&&(ea=this.getCellsForAction(Z.select),this.setSelectionCells(ea));-null!=Z.highlight&&(ea=this.getCellsForAction(Z.highlight),this.highlightCells(ea,Z.highlight.color,Z.highlight.duration,Z.highlight.opacity));null!=Z.scroll&&(ea=this.getCellsForAction(Z.scroll));null!=Z.viewbox&&this.fitWindow(Z.viewbox,Z.viewbox.border);0<ea.length&&this.scrollCellToVisible(ea[0]);null!=D&&null!=Z.explore&&Graph.exploreFromCell(this,D,Z.explore);if(null!=Z.tags){if(null!=Z.tags.toggle){var ja=Z.tags.toggle;0==ja.length&&(ja=this.getAllTags());for(ea=0;ea<ja.length;ea++)this.toggleHiddenTag(ja[ea])}ja=-null;null!=Z.tags.hidden&&(null==ja&&(ja=[]),ja=ja.concat(Z.tags.hidden));if(null!=Z.tags.visible){null==ja&&(ja=[]);var ba=this.getAllTags();for(ea=0;ea<ba.length;ea++)0>mxUtils.indexOf(Z.tags.visible,ba[ea])&&0>mxUtils.indexOf(ja,ba[ea])&&ja.push(ba[ea])}null!=ja&&this.setHiddenTags(ja);this.refresh()}0<ca.length&&(N++,this.executeAnimations(ca,W,Y?1:Z.steps,Y?0:Z.delay));0==N?X():U()}else this.stoppingCustomActions=this.executingCustomActions=!1,U(),null!=z&&z()});X()}};Graph.prototype.doUpdateCustomLinksForCell=-function(n,z){var D=this.getLinkForCell(z);null!=D&&"data:action/json,"==D.substring(0,17)&&this.setLinkForCell(z,this.updateCustomLink(n,D));if(this.isHtmlLabel(z)){var L=document.createElement("div");L.innerHTML=Graph.sanitizeHtml(this.getLabel(z));for(var N=L.getElementsByTagName("a"),R=!1,T=0;T<N.length;T++)D=N[T].getAttribute("href"),null!=D&&"data:action/json,"==D.substring(0,17)&&(N[T].setAttribute("href",this.updateCustomLink(n,D)),R=!0);R&&this.labelChanged(z,L.innerHTML)}};Graph.prototype.updateCustomLink=-function(n,z){if("data:action/json,"==z.substring(0,17))try{var D=JSON.parse(z.substring(17));null!=D.actions&&(this.updateCustomLinkActions(n,D.actions),z="data:action/json,"+JSON.stringify(D))}catch(L){}return z};Graph.prototype.updateCustomLinkActions=function(n,z){for(var D=0;D<z.length;D++){var L=z[D],N;for(N in L)this.updateCustomLinkAction(n,L[N],"cells"),this.updateCustomLinkAction(n,L[N],"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(n,z,D){if(null!=z&&null!=z[D]){for(var L=-[],N=0;N<z[D].length;N++)if("*"==z[D][N])L.push(z[D][N]);else{var R=n[z[D][N]];null!=R?""!=R&&L.push(R):L.push(z[D][N])}z[D]=L}};Graph.prototype.getCellsForAction=function(n,z){z=this.getCellsById(n.cells).concat(this.getCellsForTags(n.tags,null,z));if(null!=n.excludeCells){for(var D=[],L=0;L<z.length;L++)0>n.excludeCells.indexOf(z[L].id)&&D.push(z[L]);z=D}return z};Graph.prototype.getCellsById=function(n){var z=[];if(null!=n)for(var D=0;D<n.length;D++)if("*"==n[D]){var L=this.model.getRoot();z=z.concat(this.model.filterDescendants(function(R){return R!=-L},L))}else{var N=this.model.getCell(n[D]);null!=N&&z.push(N)}return z};var x=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(n){return x.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(n))};Graph.prototype.setHiddenTags=function(n){this.hiddenTags=n;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(n){var z=mxUtils.indexOf(this.hiddenTags,n);0>z?this.hiddenTags.push(n):0<=z&&this.hiddenTags.splice(z,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};-Graph.prototype.isAllTagsHidden=function(n){if(null==n||0==n.length||0==this.hiddenTags.length)return!1;n=n.split(" ");if(n.length>this.hiddenTags.length)return!1;for(var z=0;z<n.length;z++)if(0>mxUtils.indexOf(this.hiddenTags,n[z]))return!1;return!0};Graph.prototype.getCellsForTags=function(n,z,D,L){var N=[];if(null!=n){z=null!=z?z:this.model.getDescendants(this.model.getRoot());for(var R=0,T={},U=0;U<n.length;U++)0<n[U].length&&(T[n[U]]=!0,R++);for(U=0;U<z.length;U++)if(D&&this.model.getParent(z[U])==-this.model.root||this.model.isVertex(z[U])||this.model.isEdge(z[U])){var W=this.getTagsForCell(z[U]),X=!1;if(0<W.length&&(W=W.split(" "),W.length>=n.length)){for(var Y=X=0;Y<W.length&&X<R;Y++)null!=T[W[Y]]&&X++;X=X==R}X&&(1!=L||this.isCellVisible(z[U]))&&N.push(z[U])}}return N};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(n){for(var z=null,D=[],L=0;L<n.length;L++){var N=this.getTagsForCell(n[L]);-D=[];if(0<N.length){N=N.split(" ");for(var R={},T=0;T<N.length;T++)if(null==z||null!=z[N[T]])R[N[T]]=!0,D.push(N[T]);z=R}else return[]}return D};Graph.prototype.getTagsForCells=function(n){for(var z=[],D={},L=0;L<n.length;L++){var N=this.getTagsForCell(n[L]);if(0<N.length){N=N.split(" ");for(var R=0;R<N.length;R++)null==D[N[R]]&&(D[N[R]]=!0,z.push(N[R]))}}return z};Graph.prototype.getTagsForCell=function(n){return this.getAttributeForCell(n,"tags","")};Graph.prototype.addTagsForCells=function(n,z){if(0<-n.length&&0<z.length){this.model.beginUpdate();try{for(var D=0;D<n.length;D++){for(var L=this.getTagsForCell(n[D]),N=L.split(" "),R=!1,T=0;T<z.length;T++){var U=mxUtils.trim(z[T]);""!=U&&0>mxUtils.indexOf(N,U)&&(L=0<L.length?L+" "+U:U,R=!0)}R&&this.setAttributeForCell(n[D],"tags",L)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(n,z){if(0<n.length&&0<z.length){this.model.beginUpdate();try{for(var D=0;D<n.length;D++){var L=this.getTagsForCell(n[D]);if(0<L.length){for(var N=-L.split(" "),R=!1,T=0;T<z.length;T++){var U=mxUtils.indexOf(N,z[T]);0<=U&&(N.splice(U,1),R=!0)}R&&this.setAttributeForCell(n[D],"tags",N.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(n){this.model.beginUpdate();try{for(var z=0;z<n.length;z++)this.model.setVisible(n[z],!this.model.isVisible(n[z]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(n,z){this.model.beginUpdate();try{for(var D=0;D<n.length;D++)this.model.setVisible(n[D],z)}finally{this.model.endUpdate()}};-Graph.prototype.highlightCells=function(n,z,D,L){for(var N=0;N<n.length;N++)this.highlightCell(n[N],z,D,L)};Graph.prototype.highlightCell=function(n,z,D,L,N){z=null!=z?z:mxConstants.DEFAULT_VALID_COLOR;D=null!=D?D:1E3;n=this.view.getState(n);var R=null;null!=n&&(N=null!=N?N:4,N=Math.max(N+1,mxUtils.getValue(n.style,mxConstants.STYLE_STROKEWIDTH,1)+N),R=new mxCellHighlight(this,z,N,!1),null!=L&&(R.opacity=L),R.highlight(n),window.setTimeout(function(){null!=R.shape&&(mxUtils.setPrefixedStyle(R.shape.node.style,-"transition","all 1200ms ease-in-out"),R.shape.node.style.opacity=0);window.setTimeout(function(){R.destroy()},1200)},D));return R};Graph.prototype.addSvgShadow=function(n,z,D,L){D=null!=D?D:!1;L=null!=L?L:!0;var N=n.ownerDocument,R=null!=N.createElementNS?N.createElementNS(mxConstants.NS_SVG,"filter"):N.createElement("filter");R.setAttribute("id",this.shadowId);var T=null!=N.createElementNS?N.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):N.createElement("feGaussianBlur");T.setAttribute("in",-"SourceAlpha");T.setAttribute("stdDeviation",this.svgShadowBlur);T.setAttribute("result","blur");R.appendChild(T);T=null!=N.createElementNS?N.createElementNS(mxConstants.NS_SVG,"feOffset"):N.createElement("feOffset");T.setAttribute("in","blur");T.setAttribute("dx",this.svgShadowSize);T.setAttribute("dy",this.svgShadowSize);T.setAttribute("result","offsetBlur");R.appendChild(T);T=null!=N.createElementNS?N.createElementNS(mxConstants.NS_SVG,"feFlood"):N.createElement("feFlood");T.setAttribute("flood-color",-this.svgShadowColor);T.setAttribute("flood-opacity",this.svgShadowOpacity);T.setAttribute("result","offsetColor");R.appendChild(T);T=null!=N.createElementNS?N.createElementNS(mxConstants.NS_SVG,"feComposite"):N.createElement("feComposite");T.setAttribute("in","offsetColor");T.setAttribute("in2","offsetBlur");T.setAttribute("operator","in");T.setAttribute("result","offsetBlur");R.appendChild(T);T=null!=N.createElementNS?N.createElementNS(mxConstants.NS_SVG,"feBlend"):N.createElement("feBlend");T.setAttribute("in",-"SourceGraphic");T.setAttribute("in2","offsetBlur");R.appendChild(T);T=n.getElementsByTagName("defs");0==T.length?(N=null!=N.createElementNS?N.createElementNS(mxConstants.NS_SVG,"defs"):N.createElement("defs"),null!=n.firstChild?n.insertBefore(N,n.firstChild):n.appendChild(N)):N=T[0];N.appendChild(R);D||(z=null!=z?z:n.getElementsByTagName("g")[0],null!=z&&(z.setAttribute("filter","url(#"+this.shadowId+")"),!isNaN(parseInt(n.getAttribute("width")))&&L&&(n.setAttribute("width",parseInt(n.getAttribute("width"))+-6),n.setAttribute("height",parseInt(n.getAttribute("height"))+6),z=n.getAttribute("viewBox"),null!=z&&0<z.length&&(z=z.split(" "),3<z.length&&(w=parseFloat(z[2])+6,h=parseFloat(z[3])+6,n.setAttribute("viewBox",z[0]+" "+z[1]+" "+w+" "+h))))));return R};Graph.prototype.setShadowVisible=function(n,z){mxClient.IS_SVG&&!mxClient.IS_SF&&(z=null!=z?z:!0,(this.shadowVisible=n)?this.view.getDrawPane().setAttribute("filter","url(#"+this.shadowId+")"):this.view.getDrawPane().removeAttribute("filter"),z&&this.fireEvent(new mxEventObject("shadowVisibleChanged")))};-Graph.prototype.checkDefaultParent=function(){null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var n=this.model.getChildCount(this.model.root),z=0;do var D=this.model.getChildAt(this.model.root,z);while(z++<n&&"1"==mxUtils.getValue(this.getCellStyle(D),"locked","0"));null!=D&&this.setDefaultParent(D)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH++null!=Z.highlight&&(ea=this.getCellsForAction(Z.highlight),this.highlightCells(ea,Z.highlight.color,Z.highlight.duration,Z.highlight.opacity));null!=Z.scroll&&(ea=this.getCellsForAction(Z.scroll));null!=Z.viewbox&&this.fitWindow(Z.viewbox,Z.viewbox.border);0<ea.length&&this.scrollCellToVisible(ea[0]);null!=E&&null!=Z.explore&&Graph.exploreFromCell(this,E,Z.explore);if(null!=Z.tags){if(null!=Z.tags.toggle){var ia=Z.tags.toggle;0==ia.length&&(ia=this.getAllTags());for(ea=0;ea<ia.length;ea++)this.toggleHiddenTag(ia[ea])}ia=+null;null!=Z.tags.hidden&&(null==ia&&(ia=[]),ia=ia.concat(Z.tags.hidden));if(null!=Z.tags.visible){null==ia&&(ia=[]);var ba=this.getAllTags();for(ea=0;ea<ba.length;ea++)0>mxUtils.indexOf(Z.tags.visible,ba[ea])&&0>mxUtils.indexOf(ia,ba[ea])&&ia.push(ba[ea])}null!=ia&&this.setHiddenTags(ia);this.refresh()}0<ca.length&&(O++,this.executeAnimations(ca,W,Y?1:Z.steps,Y?0:Z.delay));0==O?X():U()}else this.stoppingCustomActions=this.executingCustomActions=!1,U(),null!=A&&A()});X()}};Graph.prototype.doUpdateCustomLinksForCell=+function(n,A){var E=this.getLinkForCell(A);null!=E&&"data:action/json,"==E.substring(0,17)&&this.setLinkForCell(A,this.updateCustomLink(n,E));if(this.isHtmlLabel(A)){var L=document.createElement("div");L.innerHTML=Graph.sanitizeHtml(this.getLabel(A));for(var O=L.getElementsByTagName("a"),R=!1,T=0;T<O.length;T++)E=O[T].getAttribute("href"),null!=E&&"data:action/json,"==E.substring(0,17)&&(O[T].setAttribute("href",this.updateCustomLink(n,E)),R=!0);R&&this.labelChanged(A,L.innerHTML)}};Graph.prototype.updateCustomLink=+function(n,A){if("data:action/json,"==A.substring(0,17))try{var E=JSON.parse(A.substring(17));null!=E.actions&&(this.updateCustomLinkActions(n,E.actions),A="data:action/json,"+JSON.stringify(E))}catch(L){}return A};Graph.prototype.updateCustomLinkActions=function(n,A){for(var E=0;E<A.length;E++){var L=A[E],O;for(O in L)this.updateCustomLinkAction(n,L[O],"cells"),this.updateCustomLinkAction(n,L[O],"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(n,A,E){if(null!=A&&null!=A[E]){for(var L=+[],O=0;O<A[E].length;O++)if("*"==A[E][O])L.push(A[E][O]);else{var R=n[A[E][O]];null!=R?""!=R&&L.push(R):L.push(A[E][O])}A[E]=L}};Graph.prototype.getCellsForAction=function(n,A){A=this.getCellsById(n.cells).concat(this.getCellsForTags(n.tags,null,A));if(null!=n.excludeCells){for(var E=[],L=0;L<A.length;L++)0>n.excludeCells.indexOf(A[L].id)&&E.push(A[L]);A=E}return A};Graph.prototype.getCellsById=function(n){var A=[];if(null!=n)for(var E=0;E<n.length;E++)if("*"==n[E]){var L=this.model.getRoot();A=A.concat(this.model.filterDescendants(function(R){return R!=+L},L))}else{var O=this.model.getCell(n[E]);null!=O&&A.push(O)}return A};var x=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(n){return x.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(n))};Graph.prototype.setHiddenTags=function(n){this.hiddenTags=n;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(n){var A=mxUtils.indexOf(this.hiddenTags,n);0>A?this.hiddenTags.push(n):0<=A&&this.hiddenTags.splice(A,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};+Graph.prototype.isAllTagsHidden=function(n){if(null==n||0==n.length||0==this.hiddenTags.length)return!1;n=n.split(" ");if(n.length>this.hiddenTags.length)return!1;for(var A=0;A<n.length;A++)if(0>mxUtils.indexOf(this.hiddenTags,n[A]))return!1;return!0};Graph.prototype.getCellsForTags=function(n,A,E,L){var O=[];if(null!=n){A=null!=A?A:this.model.getDescendants(this.model.getRoot());for(var R=0,T={},U=0;U<n.length;U++)0<n[U].length&&(T[n[U]]=!0,R++);for(U=0;U<A.length;U++)if(E&&this.model.getParent(A[U])==+this.model.root||this.model.isVertex(A[U])||this.model.isEdge(A[U])){var W=this.getTagsForCell(A[U]),X=!1;if(0<W.length&&(W=W.split(" "),W.length>=n.length)){for(var Y=X=0;Y<W.length&&X<R;Y++)null!=T[W[Y]]&&X++;X=X==R}X&&(1!=L||this.isCellVisible(A[U]))&&O.push(A[U])}}return O};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(n){for(var A=null,E=[],L=0;L<n.length;L++){var O=this.getTagsForCell(n[L]);+E=[];if(0<O.length){O=O.split(" ");for(var R={},T=0;T<O.length;T++)if(null==A||null!=A[O[T]])R[O[T]]=!0,E.push(O[T]);A=R}else return[]}return E};Graph.prototype.getTagsForCells=function(n){for(var A=[],E={},L=0;L<n.length;L++){var O=this.getTagsForCell(n[L]);if(0<O.length){O=O.split(" ");for(var R=0;R<O.length;R++)null==E[O[R]]&&(E[O[R]]=!0,A.push(O[R]))}}return A};Graph.prototype.getTagsForCell=function(n){return this.getAttributeForCell(n,"tags","")};Graph.prototype.addTagsForCells=function(n,A){if(0<+n.length&&0<A.length){this.model.beginUpdate();try{for(var E=0;E<n.length;E++){for(var L=this.getTagsForCell(n[E]),O=L.split(" "),R=!1,T=0;T<A.length;T++){var U=mxUtils.trim(A[T]);""!=U&&0>mxUtils.indexOf(O,U)&&(L=0<L.length?L+" "+U:U,R=!0)}R&&this.setAttributeForCell(n[E],"tags",L)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(n,A){if(0<n.length&&0<A.length){this.model.beginUpdate();try{for(var E=0;E<n.length;E++){var L=this.getTagsForCell(n[E]);if(0<L.length){for(var O=+L.split(" "),R=!1,T=0;T<A.length;T++){var U=mxUtils.indexOf(O,A[T]);0<=U&&(O.splice(U,1),R=!0)}R&&this.setAttributeForCell(n[E],"tags",O.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(n){this.model.beginUpdate();try{for(var A=0;A<n.length;A++)this.model.setVisible(n[A],!this.model.isVisible(n[A]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(n,A){this.model.beginUpdate();try{for(var E=0;E<n.length;E++)this.model.setVisible(n[E],A)}finally{this.model.endUpdate()}};+Graph.prototype.highlightCells=function(n,A,E,L){for(var O=0;O<n.length;O++)this.highlightCell(n[O],A,E,L)};Graph.prototype.highlightCell=function(n,A,E,L,O){A=null!=A?A:mxConstants.DEFAULT_VALID_COLOR;E=null!=E?E:1E3;n=this.view.getState(n);var R=null;null!=n&&(O=null!=O?O:4,O=Math.max(O+1,mxUtils.getValue(n.style,mxConstants.STYLE_STROKEWIDTH,1)+O),R=new mxCellHighlight(this,A,O,!1),null!=L&&(R.opacity=L),R.highlight(n),window.setTimeout(function(){null!=R.shape&&(mxUtils.setPrefixedStyle(R.shape.node.style,+"transition","all 1200ms ease-in-out"),R.shape.node.style.opacity=0);window.setTimeout(function(){R.destroy()},1200)},E));return R};Graph.prototype.addSvgShadow=function(n,A,E,L){E=null!=E?E:!1;L=null!=L?L:!0;var O=n.ownerDocument,R=null!=O.createElementNS?O.createElementNS(mxConstants.NS_SVG,"filter"):O.createElement("filter");R.setAttribute("id",this.shadowId);var T=null!=O.createElementNS?O.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):O.createElement("feGaussianBlur");T.setAttribute("in",+"SourceAlpha");T.setAttribute("stdDeviation",this.svgShadowBlur);T.setAttribute("result","blur");R.appendChild(T);T=null!=O.createElementNS?O.createElementNS(mxConstants.NS_SVG,"feOffset"):O.createElement("feOffset");T.setAttribute("in","blur");T.setAttribute("dx",this.svgShadowSize);T.setAttribute("dy",this.svgShadowSize);T.setAttribute("result","offsetBlur");R.appendChild(T);T=null!=O.createElementNS?O.createElementNS(mxConstants.NS_SVG,"feFlood"):O.createElement("feFlood");T.setAttribute("flood-color",+this.svgShadowColor);T.setAttribute("flood-opacity",this.svgShadowOpacity);T.setAttribute("result","offsetColor");R.appendChild(T);T=null!=O.createElementNS?O.createElementNS(mxConstants.NS_SVG,"feComposite"):O.createElement("feComposite");T.setAttribute("in","offsetColor");T.setAttribute("in2","offsetBlur");T.setAttribute("operator","in");T.setAttribute("result","offsetBlur");R.appendChild(T);T=null!=O.createElementNS?O.createElementNS(mxConstants.NS_SVG,"feBlend"):O.createElement("feBlend");T.setAttribute("in",+"SourceGraphic");T.setAttribute("in2","offsetBlur");R.appendChild(T);T=n.getElementsByTagName("defs");0==T.length?(O=null!=O.createElementNS?O.createElementNS(mxConstants.NS_SVG,"defs"):O.createElement("defs"),null!=n.firstChild?n.insertBefore(O,n.firstChild):n.appendChild(O)):O=T[0];O.appendChild(R);E||(A=null!=A?A:n.getElementsByTagName("g")[0],null!=A&&(A.setAttribute("filter","url(#"+this.shadowId+")"),!isNaN(parseInt(n.getAttribute("width")))&&L&&(n.setAttribute("width",parseInt(n.getAttribute("width"))++6),n.setAttribute("height",parseInt(n.getAttribute("height"))+6),A=n.getAttribute("viewBox"),null!=A&&0<A.length&&(A=A.split(" "),3<A.length&&(w=parseFloat(A[2])+6,h=parseFloat(A[3])+6,n.setAttribute("viewBox",A[0]+" "+A[1]+" "+w+" "+h))))));return R};Graph.prototype.setShadowVisible=function(n,A){mxClient.IS_SVG&&!mxClient.IS_SF&&(A=null!=A?A:!0,(this.shadowVisible=n)?this.view.getDrawPane().setAttribute("filter","url(#"+this.shadowId+")"):this.view.getDrawPane().removeAttribute("filter"),A&&this.fireEvent(new mxEventObject("shadowVisibleChanged")))};+Graph.prototype.checkDefaultParent=function(){null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var n=this.model.getChildCount(this.model.root),A=0;do var E=this.model.getChildAt(this.model.root,A);while(A++<n&&"1"==mxUtils.getValue(this.getCellStyle(E),"locked","0"));null!=E&&this.setDefaultParent(E)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=[SHAPES_PATH+"/mxCisco19.js",STENCIL_PATH+"/cisco19.xml"];mxStencilRegistry.libraries.cisco_safe=[SHAPES_PATH+"/mxCiscoSafe.js",STENCIL_PATH+"/cisco_safe/architecture.xml",STENCIL_PATH+"/cisco_safe/business_icons.xml",STENCIL_PATH+"/cisco_safe/capability.xml",STENCIL_PATH+"/cisco_safe/design.xml",STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",STENCIL_PATH+"/cisco_safe/people_places_things_icons.xml",STENCIL_PATH+"/cisco_safe/security_icons.xml",STENCIL_PATH+"/cisco_safe/technology_icons.xml",STENCIL_PATH+"/cisco_safe/threat.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.kubernetes=[SHAPES_PATH+"/mxKubernetes.js",STENCIL_PATH+"/kubernetes.xml",STENCIL_PATH+"/kubernetes2.xml"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+@@ -12934,43 +12938,43 @@ mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupN"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.ibm=[SHAPES_PATH+"/mxIBM.js",STENCIL_PATH+"/ibm.xml"];mxStencilRegistry.libraries.ibmcloud=[STENCIL_PATH+"/ibm_cloud.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=[SHAPES_PATH+"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+-"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=[STENCIL_PATH+"/salesforce.xml"];mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(n){var z=null;null!=n&&0<n.length&&("ER"==n.substring(0,2)?z="mxgraph.er":"sysML"==n.substring(0,5)&&(z="mxgraph.sysml"));return z};var J=-mxMarker.createMarker;mxMarker.createMarker=function(n,z,D,L,N,R,T,U,W,X){if(null!=D&&null==mxMarker.markers[D]){var Y=this.getPackageForType(D);null!=Y&&mxStencilRegistry.getStencil(Y)}return J.apply(this,arguments)};var H=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(n,z,D,L,N,R){"1"==mxUtils.getValue(z.style,"lineShape",null)&&n.setFillColor(mxUtils.getValue(z.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return H.apply(this,arguments)};PrintDialog.prototype.create=function(n,-z,D,L){function N(){ja.value=Math.max(1,Math.min(Y,Math.max(parseInt(ja.value),parseInt(ea.value))));ea.value=Math.max(1,Math.min(Y,Math.min(parseInt(ja.value),parseInt(ea.value))))}function R(Ea){n.lastPrintPagesRadioChecked=ca.checked;n.lastPrintSelectionOnlyChecked=fa.checked;n.lastPrintCropRadioChecked=ia.checked;n.lastPrintFitRadioChecked=ha.checked;ca.checked&&ea.value<ja.value?(n.lastPrintPagesFromInput=ea.value,n.lastPrintPagesToInput=ja.value):(n.lastPrintPagesFromInput=null,n.lastPrintPagesToInput=+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=[STENCIL_PATH+"/salesforce.xml"];mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(n){var A=null;null!=n&&0<n.length&&("ER"==n.substring(0,2)?A="mxgraph.er":"sysML"==n.substring(0,5)&&(A="mxgraph.sysml"));return A};var J=+mxMarker.createMarker;mxMarker.createMarker=function(n,A,E,L,O,R,T,U,W,X){if(null!=E&&null==mxMarker.markers[E]){var Y=this.getPackageForType(E);null!=Y&&mxStencilRegistry.getStencil(Y)}return J.apply(this,arguments)};var H=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(n,A,E,L,O,R){"1"==mxUtils.getValue(A.style,"lineShape",null)&&n.setFillColor(mxUtils.getValue(A.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return H.apply(this,arguments)};PrintDialog.prototype.create=function(n,+A,E,L){function O(){ia.value=Math.max(1,Math.min(Y,Math.max(parseInt(ia.value),parseInt(ea.value))));ea.value=Math.max(1,Math.min(Y,Math.min(parseInt(ia.value),parseInt(ea.value))))}function R(Ea){n.lastPrintPagesRadioChecked=ca.checked;n.lastPrintSelectionOnlyChecked=fa.checked;n.lastPrintCropRadioChecked=ja.checked;n.lastPrintFitRadioChecked=ha.checked;ca.checked&&ea.value<ia.value?(n.lastPrintPagesFromInput=ea.value,n.lastPrintPagesToInput=ia.value):(n.lastPrintPagesFromInput=null,n.lastPrintPagesToInput=null);ya.value=Math.max(1,Math.min(1600,parseInt(ya.value)))+"%";n.lastPrintZoom=ya.value;n.lastPrintBorder=wa.value;n.lastPrintGrid=xa.checked;n.lastPrintTransparent=Fa.checked;n.lastPrintInclude=Ca.checked;n.lastPrintSheetsAcross=ma.value;n.lastPrintSheetsDown=Da.value;var za={};za.border=parseInt(wa.value);za.scale=parseInt(ya.value)/100;za.grid=xa.checked;za.transparent=Fa.checked;za.includeCopy=Ca.checked;za.sheetsAcross=parseInt(ma.value);za.sheetsDown=parseInt(Da.value);za.pagesFrom=parseInt(ea.value);-za.pagesTo=parseInt(ja.value);za.allPages=Z.checked;za.selection=fa.checked;za.pageView=aa.checked;za.crop=ia.checked;za.fit=ha.checked;return null!=D?D(!Ea,za):n.print(!Ea,za)}var T=n.editor.graph,U=document.createElement("div"),W=document.createElement("h3");W.style.width="100%";W.style.textAlign="center";W.style.marginTop="0px";mxUtils.write(W,z||mxResources.get("print"));U.appendChild(W);var X=1,Y=1;W=document.createElement("div");W.style.whiteSpace="nowrap";var Z=document.createElement("input");-Z.style.marginRight="8px";Z.style.marginBottom="8px";Z.setAttribute("type","radio");Z.setAttribute("name","pages-printdialog");W.appendChild(Z);z=document.createElement("span");mxUtils.write(z,mxResources.get("allPages"));mxEvent.addListener(z,"click",function(){Z.checked=!0});W.appendChild(z);mxUtils.br(W);var ca=Z.cloneNode(!0);W.appendChild(ca);z=document.createElement("span");mxUtils.write(z,mxResources.get("pages")+":");W.appendChild(z);mxEvent.addListener(z,"click",function(){ca.checked=!0});-var ea=document.createElement("input");ea.style.margin="0 4px";ea.setAttribute("value","1");ea.setAttribute("type","number");ea.setAttribute("min","1");ea.style.width="40px";W.appendChild(ea);z=document.createElement("span");mxUtils.write(z,mxResources.get("to"));W.appendChild(z);var ja=ea.cloneNode(!0);W.appendChild(ja);mxEvent.addListener(ea,"focus",function(){ca.checked=!0});mxEvent.addListener(ja,"focus",function(){ca.checked=!0});mxEvent.addListener(ea,"change",N);mxEvent.addListener(ja,"change",-N);if(null!=n.pages&&(Y=n.pages.length,null!=n.currentPage))for(var ba=0;ba<Y;ba++)if(n.currentPage==n.pages[ba]){X=ba+1;break}null!=n.lastPrintPagesFromInput&&null!=n.lastPrintPagesToInput?(ea.value=Math.min(Y,Math.max(1,n.lastPrintPagesFromInput)),ja.value=Math.min(Y,Math.max(1,n.lastPrintPagesToInput))):(ea.value=X,ja.value=X);ea.setAttribute("max",Y);ja.setAttribute("max",Y);ba=mxUtils.button(mxResources.get("currentPage"),function(Ea){ea.value=X;ja.value=X;ca.checked=!0});ba.setAttribute("title",+za.pagesTo=parseInt(ia.value);za.allPages=Z.checked;za.selection=fa.checked;za.pageView=aa.checked;za.crop=ja.checked;za.fit=ha.checked;return null!=E?E(!Ea,za):n.print(!Ea,za)}var T=n.editor.graph,U=document.createElement("div"),W=document.createElement("h3");W.style.width="100%";W.style.textAlign="center";W.style.marginTop="0px";mxUtils.write(W,A||mxResources.get("print"));U.appendChild(W);var X=1,Y=1;W=document.createElement("div");W.style.whiteSpace="nowrap";var Z=document.createElement("input");+Z.style.marginRight="8px";Z.style.marginBottom="8px";Z.setAttribute("type","radio");Z.setAttribute("name","pages-printdialog");W.appendChild(Z);A=document.createElement("span");mxUtils.write(A,mxResources.get("allPages"));mxEvent.addListener(A,"click",function(){Z.checked=!0});W.appendChild(A);mxUtils.br(W);var ca=Z.cloneNode(!0);W.appendChild(ca);A=document.createElement("span");mxUtils.write(A,mxResources.get("pages")+":");W.appendChild(A);mxEvent.addListener(A,"click",function(){ca.checked=!0});+var ea=document.createElement("input");ea.style.margin="0 4px";ea.setAttribute("value","1");ea.setAttribute("type","number");ea.setAttribute("min","1");ea.style.width="40px";W.appendChild(ea);A=document.createElement("span");mxUtils.write(A,mxResources.get("to"));W.appendChild(A);var ia=ea.cloneNode(!0);W.appendChild(ia);mxEvent.addListener(ea,"focus",function(){ca.checked=!0});mxEvent.addListener(ia,"focus",function(){ca.checked=!0});mxEvent.addListener(ea,"change",O);mxEvent.addListener(ia,"change",+O);if(null!=n.pages&&(Y=n.pages.length,null!=n.currentPage))for(var ba=0;ba<Y;ba++)if(n.currentPage==n.pages[ba]){X=ba+1;break}null!=n.lastPrintPagesFromInput&&null!=n.lastPrintPagesToInput?(ea.value=Math.min(Y,Math.max(1,n.lastPrintPagesFromInput)),ia.value=Math.min(Y,Math.max(1,n.lastPrintPagesToInput))):(ea.value=X,ia.value=X);ea.setAttribute("max",Y);ia.setAttribute("max",Y);ba=mxUtils.button(mxResources.get("currentPage"),function(Ea){ea.value=X;ia.value=X;ca.checked=!0});ba.setAttribute("title",mxResources.get("currentPage"));ba.style.marginLeft="4px";ba.style.maxWidth="100px";ba.style.overflow="hidden";ba.style.textOverflow="ellipsis";ba.style.whiteSpace="nowrap";W.appendChild(ba);1<Y&&U.appendChild(W);W=document.createElement("div");W.style.borderBottom="1px solid lightGray";W.style.paddingBottom="12px";W.style.marginBottom="12px";W.style.whiteSpace="nowrap";var fa=document.createElement("input");fa.setAttribute("name","pages-printdialog");fa.setAttribute("type",1==Y?"checkbox":"radio");-fa.style.marginRight="8px";T.isSelectionEmpty()&&fa.setAttribute("disabled","disabled");T.isEnabled()&&(W.appendChild(fa),z=document.createElement("span"),mxUtils.write(z,mxResources.get("selectionOnly")),W.appendChild(z));(T.isEnabled()||1<Y)&&U.appendChild(W);!n.isPagesEnabled()||n.lastPrintPagesRadioChecked?ca.checked=!0:!T.isSelectionEmpty()&&n.lastPrintSelectionOnlyChecked?fa.checked=!0:Z.checked=!0;T.isSelectionEmpty()||mxEvent.addListener(z,"click",function(){fa.checked=!fa.checked});T=document.createElement("div");-T.style.whiteSpace="nowrap";var aa=document.createElement("input");aa.style.marginBottom="8px";aa.style.marginRight="8px";aa.setAttribute("type","radio");aa.setAttribute("name","printSize");T.appendChild(aa);z=document.createElement("span");mxUtils.write(z,mxResources.get("pageView"));T.appendChild(z);mxEvent.addListener(T,"click",function(){aa.checked=!0});U.appendChild(T);T=document.createElement("div");T.style.whiteSpace="nowrap";var ia=document.createElement("input");ia.style.marginBottom="8px";-ia.style.marginRight="8px";ia.setAttribute("type","radio");ia.setAttribute("name","printSize");T.appendChild(ia);z=document.createElement("span");mxUtils.write(z,mxResources.get("crop"));T.appendChild(z);mxEvent.addListener(T,"click",function(){ia.checked=!0});U.appendChild(T);T=document.createElement("div");T.style.whiteSpace="nowrap";var ha=document.createElement("input");ha.style.marginBottom="8px";ha.style.marginRight="8px";ha.setAttribute("type","radio");ha.setAttribute("name","printSize");z=-document.createElement("div");z.style.display="inline-block";z.style.verticalAlign="top";z.style.paddingTop="2px";z.appendChild(ha);T.appendChild(z);W=document.createElement("table");W.style.display="inline-block";W.style.borderSpacing="0";ba=document.createElement("tbody");var da=document.createElement("tr"),Ba=da.cloneNode(!0),na=document.createElement("td"),va=na.cloneNode(!0),Aa=na.cloneNode(!0),ka=na.cloneNode(!0),ta=na.cloneNode(!0),pa=na.cloneNode(!0);na.style.textAlign="right";ka.style.textAlign=-"right";mxUtils.write(na,mxResources.get("fitTo"));mxEvent.addListener(T,"click",function(Ea){mxEvent.getSource(Ea)!=ha&&(ha.checked=!ha.checked)});var ma=document.createElement("input");ma.style.margin="0 2px";ma.style.boxSizing="border-box";ma.setAttribute("value",n.lastPrintSheetsAcross||"1");ma.setAttribute("min","1");ma.setAttribute("type","number");ma.style.width="40px";va.appendChild(ma);z=document.createElement("span");mxUtils.write(z,mxResources.get("fitToSheetsAcross"));Aa.appendChild(z);-mxUtils.write(ka,mxResources.get("fitToBy"));var Da=ma.cloneNode(!0);Da.setAttribute("value",n.lastPrintSheetsDown||"1");ta.appendChild(Da);mxEvent.addListener(ma,"click",function(Ea){ha.checked=!0;mxEvent.consume(Ea)});mxEvent.addListener(Da,"click",function(Ea){ha.checked=!0;mxEvent.consume(Ea)});n.lastPrintCropRadioChecked?ia.checked=!0:n.lastPrintFitRadioChecked?ha.checked=!0:aa.checked=!0;z=document.createElement("span");mxUtils.write(z,mxResources.get("fitToSheetsDown"));pa.appendChild(z);da.appendChild(na);+fa.style.marginRight="8px";T.isSelectionEmpty()&&fa.setAttribute("disabled","disabled");T.isEnabled()&&(W.appendChild(fa),A=document.createElement("span"),mxUtils.write(A,mxResources.get("selectionOnly")),W.appendChild(A));(T.isEnabled()||1<Y)&&U.appendChild(W);!n.isPagesEnabled()||n.lastPrintPagesRadioChecked?ca.checked=!0:!T.isSelectionEmpty()&&n.lastPrintSelectionOnlyChecked?fa.checked=!0:Z.checked=!0;T.isSelectionEmpty()||mxEvent.addListener(A,"click",function(){fa.checked=!fa.checked});T=document.createElement("div");+T.style.whiteSpace="nowrap";var aa=document.createElement("input");aa.style.marginBottom="8px";aa.style.marginRight="8px";aa.setAttribute("type","radio");aa.setAttribute("name","printSize");T.appendChild(aa);A=document.createElement("span");mxUtils.write(A,mxResources.get("pageView"));T.appendChild(A);mxEvent.addListener(T,"click",function(){aa.checked=!0});U.appendChild(T);T=document.createElement("div");T.style.whiteSpace="nowrap";var ja=document.createElement("input");ja.style.marginBottom="8px";+ja.style.marginRight="8px";ja.setAttribute("type","radio");ja.setAttribute("name","printSize");T.appendChild(ja);A=document.createElement("span");mxUtils.write(A,mxResources.get("crop"));T.appendChild(A);mxEvent.addListener(T,"click",function(){ja.checked=!0});U.appendChild(T);T=document.createElement("div");T.style.whiteSpace="nowrap";var ha=document.createElement("input");ha.style.marginBottom="8px";ha.style.marginRight="8px";ha.setAttribute("type","radio");ha.setAttribute("name","printSize");A=+document.createElement("div");A.style.display="inline-block";A.style.verticalAlign="top";A.style.paddingTop="2px";A.appendChild(ha);T.appendChild(A);W=document.createElement("table");W.style.display="inline-block";W.style.borderSpacing="0";ba=document.createElement("tbody");var da=document.createElement("tr"),Ba=da.cloneNode(!0),na=document.createElement("td"),va=na.cloneNode(!0),Aa=na.cloneNode(!0),ka=na.cloneNode(!0),ta=na.cloneNode(!0),pa=na.cloneNode(!0);na.style.textAlign="right";ka.style.textAlign=+"right";mxUtils.write(na,mxResources.get("fitTo"));mxEvent.addListener(T,"click",function(Ea){mxEvent.getSource(Ea)!=ha&&(ha.checked=!ha.checked)});var ma=document.createElement("input");ma.style.margin="0 2px";ma.style.boxSizing="border-box";ma.setAttribute("value",n.lastPrintSheetsAcross||"1");ma.setAttribute("min","1");ma.setAttribute("type","number");ma.style.width="40px";va.appendChild(ma);A=document.createElement("span");mxUtils.write(A,mxResources.get("fitToSheetsAcross"));Aa.appendChild(A);+mxUtils.write(ka,mxResources.get("fitToBy"));var Da=ma.cloneNode(!0);Da.setAttribute("value",n.lastPrintSheetsDown||"1");ta.appendChild(Da);mxEvent.addListener(ma,"click",function(Ea){ha.checked=!0;mxEvent.consume(Ea)});mxEvent.addListener(Da,"click",function(Ea){ha.checked=!0;mxEvent.consume(Ea)});n.lastPrintCropRadioChecked?ja.checked=!0:n.lastPrintFitRadioChecked?ha.checked=!0:aa.checked=!0;A=document.createElement("span");mxUtils.write(A,mxResources.get("fitToSheetsDown"));pa.appendChild(A);da.appendChild(na);da.appendChild(va);da.appendChild(Aa);Ba.appendChild(ka);Ba.appendChild(ta);Ba.appendChild(pa);ba.appendChild(da);ba.appendChild(Ba);W.appendChild(ba);T.appendChild(W);U.appendChild(T);T=document.createElement("div");T.style.borderTop="1px solid lightGray";T.style.whiteSpace="nowrap";T.style.paddingTop="12px";T.style.marginTop="12px";T.style.paddingLeft="8px";mxUtils.write(T,mxResources.get("borderWidth")+":");var wa=document.createElement("input");wa.setAttribute("type","number");wa.setAttribute("min",-"0");wa.style.width="40px";wa.style.marginLeft="4px";wa.value=null!=n.lastPrintBorder?n.lastPrintBorder:mxPrintPreview.prototype.pageMargin;T.appendChild(wa);z=document.createElement("span");z.style.marginLeft="8px";mxUtils.write(z,mxResources.get("zoom")+":");T.appendChild(z);var ya=document.createElement("input");ya.style.width="60px";ya.style.marginLeft="4px";ya.value=null!=n.lastPrintZoom?n.lastPrintZoom:"100%";T.appendChild(ya);mxUtils.br(T);var xa=document.createElement("input");xa.setAttribute("type",-"checkbox");xa.style.marginTop="12px";xa.checked=null!=n.lastPrintGrid?n.lastPrintGrid:!1;T.appendChild(xa);z=document.createElement("span");z.style.marginLeft="4px";z.style.marginRight="8px";mxUtils.write(z,mxResources.get("grid"));T.appendChild(z);mxEvent.addListener(z,"click",function(Ea){xa.checked=!0;mxEvent.consume(Ea)});var Fa=document.createElement("input");Fa.setAttribute("type","checkbox");Fa.style.marginTop="10px";Fa.checked=null!=n.lastPrintTransparent?n.lastPrintTransparent:!1;null!=-D&&(T.appendChild(Fa),z=document.createElement("span"),z.style.marginLeft="4px",mxUtils.write(z,mxResources.get("transparentBackground")),T.appendChild(z),mxEvent.addListener(z,"click",function(Ea){Fa.checked=!0;mxEvent.consume(Ea)}));var Ca=document.createElement("input");Ca.setAttribute("type","checkbox");Ca.style.marginTop="10px";Ca.checked=null!=n.lastPrintInclude?n.lastPrintInclude:Editor.defaultIncludeDiagram;null==D||mxClient.IS_CHROMEAPP||"draw.io"!=n.getServiceName()||(mxUtils.br(T),T.appendChild(Ca),-z=document.createElement("span"),z.style.marginLeft="4px",mxUtils.write(z,mxResources.get("includeCopyOfMyDiagram")),T.appendChild(z),mxEvent.addListener(z,"click",function(Ea){Ca.checked=!0;mxEvent.consume(Ea)}));U.appendChild(T);z=document.createElement("div");z.style.marginTop="40px";z.style.textAlign="right";z.style.whiteSpace="nowrap";n.isOffline()||null!=D||z.appendChild(n.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));T=mxUtils.button(mxResources.get("cancel"),function(){n.hideDialog()});-T.className="geBtn";n.editor.cancelFirst&&z.appendChild(T);PrintDialog.previewEnabled&&null==D&&(W=mxUtils.button(mxResources.get("preview"),function(){try{n.hideDialog(),R(!1)}catch(Ea){n.handleError(Ea)}}),W.className="geBtn",z.appendChild(W));L=null!=L?L:null!=D?"export":PrintDialog.previewEnabled?"print":"ok";L=mxUtils.button(mxResources.get(L),function(){try{n.hideDialog(),R(!0)}catch(Ea){n.handleError(Ea)}});L.className="geBtn gePrimaryBtn";z.appendChild(L);n.editor.cancelFirst||z.appendChild(T);-U.appendChild(z);if(n.editor.isChromelessView()){var Ia=function(){Editor.isDarkMode()?(U.classList.add("geDarkMode"),U.style.colorScheme="dark"):(U.classList.remove("geDarkMode"),U.style.colorScheme="light")};n.addListener("darkModeChanged",Ia);Ia();var La=function(Ea,za){Ea=za.getProperty("dialog");U.parentNode==Ea.container&&(n.editor.removeListener(La),n.removeListener(Ia))};n.editor.addListener("hideDialog",La)}this.container=U};var K=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=+"0");wa.style.width="40px";wa.style.marginLeft="4px";wa.value=null!=n.lastPrintBorder?n.lastPrintBorder:mxPrintPreview.prototype.pageMargin;T.appendChild(wa);A=document.createElement("span");A.style.marginLeft="8px";mxUtils.write(A,mxResources.get("zoom")+":");T.appendChild(A);var ya=document.createElement("input");ya.style.width="60px";ya.style.marginLeft="4px";ya.value=null!=n.lastPrintZoom?n.lastPrintZoom:"100%";T.appendChild(ya);mxUtils.br(T);var xa=document.createElement("input");xa.setAttribute("type",+"checkbox");xa.style.marginTop="12px";xa.checked=null!=n.lastPrintGrid?n.lastPrintGrid:!1;T.appendChild(xa);A=document.createElement("span");A.style.marginLeft="4px";A.style.marginRight="8px";mxUtils.write(A,mxResources.get("grid"));T.appendChild(A);mxEvent.addListener(A,"click",function(Ea){xa.checked=!0;mxEvent.consume(Ea)});var Fa=document.createElement("input");Fa.setAttribute("type","checkbox");Fa.style.marginTop="10px";Fa.checked=null!=n.lastPrintTransparent?n.lastPrintTransparent:!1;null!=+E&&(T.appendChild(Fa),A=document.createElement("span"),A.style.marginLeft="4px",mxUtils.write(A,mxResources.get("transparentBackground")),T.appendChild(A),mxEvent.addListener(A,"click",function(Ea){Fa.checked=!0;mxEvent.consume(Ea)}));var Ca=document.createElement("input");Ca.setAttribute("type","checkbox");Ca.style.marginTop="10px";Ca.checked=null!=n.lastPrintInclude?n.lastPrintInclude:Editor.defaultIncludeDiagram;null==E||mxClient.IS_CHROMEAPP||"draw.io"!=n.getServiceName()||(mxUtils.br(T),T.appendChild(Ca),+A=document.createElement("span"),A.style.marginLeft="4px",mxUtils.write(A,mxResources.get("includeCopyOfMyDiagram")),T.appendChild(A),mxEvent.addListener(A,"click",function(Ea){Ca.checked=!0;mxEvent.consume(Ea)}));U.appendChild(T);A=document.createElement("div");A.style.marginTop="40px";A.style.textAlign="right";A.style.whiteSpace="nowrap";n.isOffline()||null!=E||A.appendChild(n.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));T=mxUtils.button(mxResources.get("cancel"),function(){n.hideDialog()});+T.className="geBtn";n.editor.cancelFirst&&A.appendChild(T);PrintDialog.previewEnabled&&null==E&&(W=mxUtils.button(mxResources.get("preview"),function(){try{n.hideDialog(),R(!1)}catch(Ea){n.handleError(Ea)}}),W.className="geBtn",A.appendChild(W));L=null!=L?L:null!=E?"export":PrintDialog.previewEnabled?"print":"ok";L=mxUtils.button(mxResources.get(L),function(){try{n.hideDialog(),R(!0)}catch(Ea){n.handleError(Ea)}});L.className="geBtn gePrimaryBtn";A.appendChild(L);n.editor.cancelFirst||A.appendChild(T);+U.appendChild(A);if(n.editor.isChromelessView()){var Ia=function(){Editor.isDarkMode()?(U.classList.add("geDarkMode"),U.style.colorScheme="dark"):(U.classList.remove("geDarkMode"),U.style.colorScheme="light")};n.addListener("darkModeChanged",Ia);Ia();var La=function(Ea,za){Ea=za.getProperty("dialog");U.parentNode==Ea.container&&(n.editor.removeListener(La),n.removeListener(Ia))};n.editor.addListener("hideDialog",La)}this.container=U};var K=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);if(this.page!=this.ui.currentPage){if(null!=this.page.viewState){this.ignoreColor||(this.page.viewState.background=this.color);if(!this.ignoreImage){var n=this.image;null!=n&&null!=n.src&&Graph.isPageLink(n.src)&&(n={originalSrc:n.src});this.page.viewState.backgroundImage=n}null!=this.format&&(this.page.viewState.pageFormat=this.format);null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled);null!=this.adaptiveColors&&(this.page.viewState.adaptiveColors=this.adaptiveColors);null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)}}else K.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.adaptiveColors&&this.adaptiveColors!=this.ui.editor.graph.adaptiveColors&&(n=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=-null!=n?n:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible)};Editor.prototype.useCanvasForExport=!1;try{var O=document.createElement("canvas"),M=new Image;M.onload=function(){try{O.getContext("2d").drawImage(M,0,0);var n=O.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=n&&6<n.length}catch(z){}};M.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(n){}Editor.prototype.useCanvasForExport=+null!=n?n:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible)};Editor.prototype.useCanvasForExport=!1;try{var N=document.createElement("canvas"),M=new Image;M.onload=function(){try{N.getContext("2d").drawImage(M,0,0);var n=N.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=n&&6<n.length}catch(A){}};M.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(n){}Editor.prototype.useCanvasForExport=!1})();(function(){var b=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);b.beforeDecode=function(e,f,c){c.ui=e.ui;return f};b.afterDecode=function(e,f,c){c.previousColor=c.color;c.previousImage=c.image;c.previousFormat=c.format;c.previousAdaptiveColors=c.adaptiveColors;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(b)})();-(function(){var b=new mxObjectCodec(new ChangeGridColor,["ui"]);b.beforeDecode=function(e,f,c){c.ui=e.ui;return f};mxCodecRegistry.register(b)})();(function(){EditorUi.VERSION="26.2.2";EditorUi.compactUi="atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&"support.draw.io"!=window.location.hostname&&+(function(){var b=new mxObjectCodec(new ChangeGridColor,["ui"]);b.beforeDecode=function(e,f,c){c.ui=e.ui;return f};mxCodecRegistry.register(b)})();(function(){EditorUi.VERSION="26.2.7";EditorUi.compactUi="atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&"support.draw.io"!=window.location.hostname&&"test.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl=window.REALTIME_URL;null==EditorUi.cacheUrl&&"undefined"!==typeof DrawioFile&&(DrawioFile.SYNC="none");Editor.cacheTimeout=1E4;EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.nativeFileSupport=!mxClient.IS_OP&&!EditorUi.isElectronApp&&"1"!=urlParams.extAuth&&"showSaveFilePicker"in window&&"showOpenFilePicker"in window;EditorUi.enableDrafts=!mxClient.IS_CHROMEAPP&&isLocalStorage&&"0"!=urlParams.drafts;EditorUi.scratchpadHelpLink="https://www.drawio.com/doc/faq/scratchpad";EditorUi.enableHtmlEditOption=!0;EditorUi.mermaidDiagramTypes="flowchart classDiagram sequenceDiagram stateDiagram mindmap graph erDiagram requirementDiagram journey gantt pie gitGraph".split(" ");EditorUi.defaultMermaidConfig={theme:"neutral",arrowMarkerAbsolute:!1,flowchart:{htmlLabels:!1},sequence:{diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!0,bottomMarginAdj:1,useMaxWidth:!0,rightAngles:!1,showSequenceNumbers:!1},gantt:{titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,leftPadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:4,axisFormat:"%Y-%m-%d"}};-EditorUi.logError=function(d,g,k,m,t,y,A){if(null!=d){t=null!=t?t:Error(d);t.stack=null!=t.stack?t.stack:"";y=null!=y?y:0>d.indexOf("NetworkError")&&0>d.indexOf("SecurityError")&&0>d.indexOf("NS_ERROR_FAILURE")&&0>d.indexOf("out of memory")?"SEVERE":"CONFIG";try{EditorUi.enableLogging&&"1"!=urlParams.dev&&d!=EditorUi.lastErrorMessage&&0>d.indexOf("extension:")&&0>d.indexOf("ResizeObserver loop completed with undelivered notifications")&&0>t.stack.indexOf("extension:")&&0>t.stack.indexOf("<anonymous>:")&&-0>t.stack.indexOf("/math/es5/")&&(EditorUi.lastErrorMessage=d,(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+y+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(d)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(k)+(null!=m?":colno:"+encodeURIComponent(m):"")+(""!=t.stack?"&stack="+encodeURIComponent(t.stack):""))}catch(I){}try{A||null==window.console||console.error(y,d,g,k,m,t)}catch(I){}}};EditorUi.logEvent=+EditorUi.logError=function(d,g,k,m,t,y,z){if(null!=d){t=null!=t?t:Error(d);t.stack=null!=t.stack?t.stack:"";y=null!=y?y:0>d.indexOf("NetworkError")&&0>d.indexOf("SecurityError")&&0>d.indexOf("NS_ERROR_FAILURE")&&0>d.indexOf("out of memory")?"SEVERE":"CONFIG";try{EditorUi.enableLogging&&"1"!=urlParams.dev&&d!=EditorUi.lastErrorMessage&&0>d.indexOf("extension:")&&0>d.indexOf("ResizeObserver loop completed with undelivered notifications")&&0>t.stack.indexOf("extension:")&&0>t.stack.indexOf("<anonymous>:")&&+0>t.stack.indexOf("/math/es5/")&&(EditorUi.lastErrorMessage=d,(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+y+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(d)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(k)+(null!=m?":colno:"+encodeURIComponent(m):"")+(""!=t.stack?"&stack="+encodeURIComponent(t.stack):""))}catch(I){}try{z||null==window.console||console.error(y,d,g,k,m,t)}catch(I){}}};EditorUi.logEvent=function(d){if("1"==urlParams.dev)EditorUi.debug("logEvent",d);else if(EditorUi.enableLogging)try{var g=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=g+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=d?"&data="+encodeURIComponent(JSON.stringify(d)):"")}catch(k){}};EditorUi.sendReport=function(d,g){if("1"==urlParams.dev)EditorUi.debug("sendReport",d);else if(EditorUi.enableLogging)try{g=null!=g?g:5E4,d.length>g&&(d=d.substring(0,g)+"\n...[SHORTENED]"),mxUtils.post("/email","version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&data="+encodeURIComponent(d))}catch(k){}};EditorUi.debug=function(){try{if(null!=window.console&&"1"==urlParams.test){for(var d=[(new Date).toISOString()],g=0;g<arguments.length;g++)d.push(arguments[g]);console.log.apply(console,d)}}catch(k){}};EditorUi.removeChildNodes=function(d){for(;null!=d.firstChild;)d.removeChild(d.firstChild)};EditorUi.embedSvgImages=function(d){d=d.getElementsByTagName("image");for(var g=[],k=0;k<d.length;k++)g.push(d[k]);for(k=0;k<g.length;k++)EditorUi.replaceSvgImage(g[k])};EditorUi.replaceSvgImage=function(d){try{var g=null;g=null==d.getAttributeNS?d.getAttribute("xlink:href"):d.getAttributeNS(mxConstants.NS_XLINK,"href");var k=EditorUi.getSvgSubtree(g);if(null!=k&&"svg"==k.nodeName){k.setAttribute("x",d.getAttribute("x"));k.setAttribute("y",d.getAttribute("y"));k.setAttribute("width",d.getAttribute("width"));k.setAttribute("height",d.getAttribute("height"));k.style.fontFamily="initial";var m=mxUtils.createElementNs(k.ownerDocument,mxConstants.NS_SVG,"g");m.appendChild(k);d.hasAttribute("transform")&&m.setAttribute("transform",d.getAttribute("transform"));d.parentNode.replaceChild(m,d)}}catch(t){}};EditorUi.getSvgSubtree=function(d){var g=Graph.getSvgFromDataUri(d);d=null;if(null!=g){d=Graph.sanitizeNode(mxUtils.parseXml(g).documentElement);g=d.getElementsByTagName("style");if(0<g.length){var k="svg-image-"+Editor.guid();d.setAttribute("id",k);for(var m=document.implementation.createHTMLDocument(""),-t=document.createElement("style"),y=0;y<g.length;y++){t.textContent=g[y].textContent;m.body.appendChild(t);for(var A="",I=0;I<t.sheet.cssRules.length;I++){var F=t.sheet.cssRules[I];if(null!=F.selectorText){for(var C=F.selectorText.split(","),Q=0;Q<C.length;Q++)C[Q]="#"+k+" "+C[Q];F.selectorText=C.join(",")}A+=F.cssText+"\n"}g[y].textContent=A}}g=d.getElementsByTagName("*");for(k=0;k<g.length;k++)g[k].removeAttribute("data-cell-id")}return d};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';+t=document.createElement("style"),y=0;y<g.length;y++){t.textContent=g[y].textContent;m.body.appendChild(t);for(var z="",I=0;I<t.sheet.cssRules.length;I++){var F=t.sheet.cssRules[I];if(null!=F.selectorText){for(var C=F.selectorText.split(","),Q=0;Q<C.length;Q++)C[Q]="#"+k+" "+C[Q];F.selectorText=C.join(",")}z+=F.cssText+"\n"}g[y].textContent=z}}g=d.getElementsByTagName("*");for(k=0;k<g.length;k++)g[k].removeAttribute("data-cell-id")}return d};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.timeout=Editor.prototype.timeout;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=1200;EditorUi.prototype.maxTextWidth=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=2E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.maxTextBytes=5E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.insertTemplateEnabled=!0;EditorUi.prototype.closableScratchpad=!0;EditorUi.prototype.embedExportBorder=8;EditorUi.prototype.embedExportTheme="auto";EditorUi.prototype.embedExportBackground=null;EditorUi.prototype.shareCursorPosition=!0;EditorUi.prototype.showRemoteCursors=!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;EditorUi.prototype.webpSupported=!1;try{var d=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!d.getContext||!d.getContext("2d"))}catch(t){}try{var g=document.createElement("canvas"),@@ -12980,117 +12984,117 @@ EditorUi.prototype.getLocalData=function(d,g){g(localStorage.getItem(d))};Editorfunction(){return this.shareCursorPosition};EditorUi.prototype.setShowRemoteCursors=function(d){this.showRemoteCursors=d;this.fireEvent(new mxEventObject("showRemoteCursorsChanged"))};EditorUi.prototype.isShowRemoteCursors=function(){return this.showRemoteCursors};EditorUi.prototype.setMathEnabled=function(d){var g=this.editor.graph;g.mathEnabled=d;null!=g.view.backgroundImage&&(g.view.backgroundImage.destroy(),g.view.backgroundImage=null);this.editor.updateGraphComponents();g.refresh();g.defaultMathEnabled=d;this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(d){return this.editor.graph.mathEnabled};EditorUi.prototype.setAdaptiveColors=function(d){this.editor.graph.setAdaptiveColors(d);this.editor.graph.view.clear();this.fireEvent(new mxEventObject("adaptiveColorsChanged"))};EditorUi.prototype.isStandaloneApp=function(){return mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(d){return this.isOfflineApp()||!navigator.onLine||!d&&("1"==urlParams.stealth||"1"==urlParams.lockdown)};EditorUi.prototype.isExternalDataComms=function(){return"1"!=urlParams.offline&&!this.isOffline()&&!this.isOfflineApp()};EditorUi.prototype.createSpinner=function(d,g,k){var m=null==d||null==g;k=null!=k?k:24;var t=new Spinner({lines:12,length:k,width:Math.round(k/3),radius:Math.round(k/2),rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,-hwaccel:!1,zIndex:2E9}),y=this.timeout,A=t.spin,I=null,F=null,C=mxUtils.bind(this,function(V){null!=V&&V()}),Q=this;t.spin=function(V,P,u,x){x=null!=x?x:y;var J=!1;if(!this.active){var H=Date.now();null!=u&&(I=window.setTimeout(function(){t.stop();I=null;u({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:F})},x));m&&(g=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,d=document.body.clientWidth/2-2);V==document.body&&"1"==urlParams.embedInline&&(V=-Q.diagramContainer,d=V.scrollLeft+V.clientWidth/2,g=V.scrollTop+V.clientHeight/2);A.call(this,V);"1"==urlParams.embedInline&&null!=t.el&&(t.el.style.marginTop=V.scrollTop+"px",t.el.style.marginLeft=V.scrollLeft+"px");this.active=!0;null!=P&&(J=document.createElement("div"),J.className="geSpinnerStatus",J.style.position="absolute",J.style.whiteSpace="nowrap",J.style.background="#4B4243",J.style.color="white",J.style.fontFamily=Editor.defaultHtmlFont,J.style.fontSize="9pt",J.style.padding="6px",J.style.paddingLeft=+hwaccel:!1,zIndex:2E9}),y=this.timeout,z=t.spin,I=null,F=null,C=mxUtils.bind(this,function(V){null!=V&&V()}),Q=this;t.spin=function(V,P,u,x){x=null!=x?x:y;var J=!1;if(!this.active){var H=Date.now();null!=u&&(I=window.setTimeout(function(){t.stop();I=null;u({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:F})},x));m&&(g=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,d=document.body.clientWidth/2-2);V==document.body&&"1"==urlParams.embedInline&&(V=+Q.diagramContainer,d=V.scrollLeft+V.clientWidth/2,g=V.scrollTop+V.clientHeight/2);z.call(this,V);"1"==urlParams.embedInline&&null!=t.el&&(t.el.style.marginTop=V.scrollTop+"px",t.el.style.marginLeft=V.scrollLeft+"px");this.active=!0;null!=P&&(J=document.createElement("div"),J.className="geSpinnerStatus",J.style.position="absolute",J.style.whiteSpace="nowrap",J.style.background="#4B4243",J.style.color="white",J.style.fontFamily=Editor.defaultHtmlFont,J.style.fontSize="9pt",J.style.padding="6px",J.style.paddingLeft="10px",J.style.paddingRight="10px",J.style.zIndex=2E9,J.style.left=Math.max(0,d)+"px",J.style.top=Math.max(0,g+70)+"px",mxUtils.setPrefixedStyle(J.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(J.style,"transform","translate(-50%,-50%)"),Editor.isDarkMode()||mxUtils.setPrefixedStyle(J.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=P.substring(P.length-3,P.length)&&"!"!=P.charAt(P.length-1)&&(P+="..."),J.innerText=P,V.appendChild(J),t.status=J);this.pause=mxUtils.bind(this,function(){var K=-C;this.active&&(x=Math.max(0,x-(Date.now()-H)),K=mxUtils.bind(this,function(O){this.spin(V,P,u,x);if(null!=O)try{O(),F=mxUtils.bind(this,function(){this.spin(V,P,u,x);try{O()}catch(M){null!=u&&u(M)}})}catch(M){null!=u&&u(M)}}));this.stop();return K});J=!0}return J};var S=t.stop;t.stop=function(){S.call(this);this.active&&(this.active=!1,null!=I&&(window.clearTimeout(I),I=null),null!=t.status&&null!=t.status.parentNode&&t.status.parentNode.removeChild(t.status),t.status=null)};t.pause=function(){return C};+C;this.active&&(x=Math.max(0,x-(Date.now()-H)),K=mxUtils.bind(this,function(N){this.spin(V,P,u,x);if(null!=N)try{N(),F=mxUtils.bind(this,function(){this.spin(V,P,u,x);try{N()}catch(M){null!=u&&u(M)}})}catch(M){null!=u&&u(M)}}));this.stop();return K});J=!0}return J};var S=t.stop;t.stop=function(){S.call(this);this.active&&(this.active=!1,null!=I&&(window.clearTimeout(I),I=null),null!=t.status&&null!=t.status.parentNode&&t.status.parentNode.removeChild(t.status),t.status=null)};t.pause=function(){return C};return t};EditorUi.prototype.isCompatibleString=function(d){try{var g=mxUtils.parseXml(d),k=this.editor.extractGraphModel(g.documentElement,!0);return null!=k&&0==k.getElementsByTagName("parsererror").length}catch(m){}return!1};EditorUi.isVisioFilename=function(d){return/(\.v(dx|sdx?))($|\?)/i.test(d)||/(\.vs(x|sx?))($|\?)/i.test(d)};EditorUi.prototype.isVisioData=function(d){return 8<d.length&&(208==d.charCodeAt(0)&&207==d.charCodeAt(1)&&17==d.charCodeAt(2)&&224==d.charCodeAt(3)&&161==d.charCodeAt(4)&&177==d.charCodeAt(5)&&26==d.charCodeAt(6)&&225==d.charCodeAt(7)||80==d.charCodeAt(0)&&75==d.charCodeAt(1)&&3==d.charCodeAt(2)&&4==d.charCodeAt(3)||80==d.charCodeAt(0)&&75==d.charCodeAt(1)&&3==d.charCodeAt(2)&&6==d.charCodeAt(3))};EditorUi.prototype.isRemoteVisioData=function(d){return 8<d.length&&(208==d.charCodeAt(0)&&207==d.charCodeAt(1)&&17==d.charCodeAt(2)&&224==d.charCodeAt(3)&&161==d.charCodeAt(4)&&177==d.charCodeAt(5)&&26==d.charCodeAt(6)&&225==d.charCodeAt(7)||60==d.charCodeAt(0)&&63==d.charCodeAt(1)&&-120==d.charCodeAt(2)&&109==d.charCodeAt(3)&&108==d.charCodeAt(3))};var b=EditorUi.prototype.createKeyHandler;EditorUi.prototype.createKeyHandler=function(d){var g=b.apply(this,arguments);if(!this.editor.chromeless||this.editor.editable){var k=g.getFunction,m=this.editor.graph,t=this;g.getFunction=function(y){if(m.isSelectionEmpty()&&null!=t.pages&&0<t.pages.length){var A=t.getSelectedPageIndex();if(mxEvent.isShiftDown(y)){if(37==y.keyCode)return function(){0<A&&t.movePage(A,A-1)};if(38==y.keyCode)return function(){0<-A&&t.movePage(A,0)};if(39==y.keyCode)return function(){A<t.pages.length-1&&t.movePage(A,A+1)};if(40==y.keyCode)return function(){A<t.pages.length-1&&t.movePage(A,t.pages.length-1)}}else if(mxEvent.isControlDown(y)||mxClient.IS_MAC&&mxEvent.isMetaDown(y)){if(37==y.keyCode)return function(){0<A&&t.selectNextPage(!1)};if(38==y.keyCode)return function(){0<A&&t.selectPage(t.pages[0])};if(39==y.keyCode)return function(){A<t.pages.length-1&&t.selectNextPage(!0)};if(40==y.keyCode)return function(){A<t.pages.length-+120==d.charCodeAt(2)&&109==d.charCodeAt(3)&&108==d.charCodeAt(3))};var b=EditorUi.prototype.createKeyHandler;EditorUi.prototype.createKeyHandler=function(d){var g=b.apply(this,arguments);if(!this.editor.chromeless||this.editor.editable){var k=g.getFunction,m=this.editor.graph,t=this;g.getFunction=function(y){if(m.isSelectionEmpty()&&null!=t.pages&&0<t.pages.length){var z=t.getSelectedPageIndex();if(mxEvent.isShiftDown(y)){if(37==y.keyCode)return function(){0<z&&t.movePage(z,z-1)};if(38==y.keyCode)return function(){0<+z&&t.movePage(z,0)};if(39==y.keyCode)return function(){z<t.pages.length-1&&t.movePage(z,z+1)};if(40==y.keyCode)return function(){z<t.pages.length-1&&t.movePage(z,t.pages.length-1)}}else if(mxEvent.isControlDown(y)||mxClient.IS_MAC&&mxEvent.isMetaDown(y)){if(37==y.keyCode)return function(){0<z&&t.selectNextPage(!1)};if(38==y.keyCode)return function(){0<z&&t.selectPage(t.pages[0])};if(39==y.keyCode)return function(){z<t.pages.length-1&&t.selectNextPage(!0)};if(40==y.keyCode)return function(){z<t.pages.length-1&&t.selectPage(t.pages[t.pages.length-1])}}}return!(65<=y.keyCode&&90>=y.keyCode)||m.isSelectionEmpty()||mxEvent.isAltDown(y)||mxEvent.isShiftDown(y)||mxEvent.isControlDown(y)||mxClient.IS_MAC&&mxEvent.isMetaDown(y)?k.apply(this,arguments):null}}return g};var e=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(d){var g=e.apply(this,arguments);if(null==g)try{var k=d.indexOf("<mxfile ");if(0<=k){var m=d.lastIndexOf("</mxfile>");m>k&&(g=d.substring(k,-m+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else{var t=mxUtils.parseXml(d),y=this.editor.extractGraphModel(t.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility);g=null!=y?mxUtils.getXml(y):""}}catch(A){}return g};EditorUi.prototype.validateFileData=function(d){if(null!=d&&0<d.length){var g=d.indexOf('<meta charset="utf-8">');0<=g&&(d=d.slice(0,g)+'<meta charset="utf-8"/>'+d.slice(g+23-1,d.length));d=Graph.zapGremlins(d)}return d};+m+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else{var t=mxUtils.parseXml(d),y=this.editor.extractGraphModel(t.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility);g=null!=y?mxUtils.getXml(y):""}}catch(z){}return g};EditorUi.prototype.validateFileData=function(d){if(null!=d&&0<d.length){var g=d.indexOf('<meta charset="utf-8">');0<=g&&(d=d.slice(0,g)+'<meta charset="utf-8"/>'+d.slice(g+23-1,d.length));d=Graph.zapGremlins(d)}return d};EditorUi.prototype.replaceFileData=function(d,g){EditorUi.debug("EditorUi.replaceFileData",[this],"data",[d],"patches",g);d=this.validateFileData(d);d=null!=d&&0<d.length?mxUtils.parseXml(d).documentElement:null;var k=null!=d?this.editor.extractGraphModel(d,!0):null;null!=k&&(d=k);if(null!=d){k=this.editor.graph;k.model.beginUpdate();try{var m=null!=this.pages?this.pages.slice():null,t=d.getElementsByTagName("diagram");if(1<t.length||1==t.length&&t[0].hasAttribute("name")){this.fileNode=d;this.pages=-null!=this.pages?this.pages:[];for(var y=t.length-1;0<=y;y--){var A=this.updatePageRoot(new DiagramPage(t[y]));null==A.getName()&&A.setName(mxResources.get("pageWithNumber",[y+1]));k.model.execute(new ChangePage(this,A,0==y?A:null,0))}}else null==this.fileNode&&(this.fileNode=d.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(d.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),k.model.execute(new ChangePage(this,this.currentPage,-this.currentPage,0))),this.editor.setGraphXml(d),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,k.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0)));if(null!=m)for(y=0;y<m.length;y++)k.model.execute(new ChangePage(this,m[y],null));var I=this.getCurrentFile();null!=I&&I.fileReplaced(g)}finally{k.model.endUpdate()}}};EditorUi.prototype.createFileData=function(d,g,k,m,t,y,A,I,F,C,Q,S,V){g=null!=g?g:this.editor.graph;t=null!=t?t:!1;F=null!=F?F:!0;Q=null!=+null!=this.pages?this.pages:[];for(var y=t.length-1;0<=y;y--){var z=this.updatePageRoot(new DiagramPage(t[y]));null==z.getName()&&z.setName(mxResources.get("pageWithNumber",[y+1]));k.model.execute(new ChangePage(this,z,0==y?z:null,0))}}else null==this.fileNode&&(this.fileNode=d.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(d.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),k.model.execute(new ChangePage(this,this.currentPage,+this.currentPage,0))),this.editor.setGraphXml(d),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,k.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0)));if(null!=m)for(y=0;y<m.length;y++)k.model.execute(new ChangePage(this,m[y],null));var I=this.getCurrentFile();null!=I&&I.fileReplaced(g)}finally{k.model.endUpdate()}}};EditorUi.prototype.createFileData=function(d,g,k,m,t,y,z,I,F,C,Q,S,V){g=null!=g?g:this.editor.graph;t=null!=t?t:!1;F=null!=F?F:!0;Q=null!=Q?Q:!Editor.defaultCompressed;var P=null;if(null==k||k.getMode()==App.MODE_DEVICE||k.getMode()==App.MODE_BROWSER)var u="_blank";else P=u=m;if(null==d)return"";var x=d;if("mxfile"!=x.nodeName.toLowerCase()){if(Q){var J=d.ownerDocument.createElement("diagram");J.setAttribute("name",mxResources.get("pageWithNumber",[1]));J.setAttribute("id",Editor.guid());J.appendChild(d)}else{J=Graph.zapGremlins(mxUtils.getXml(d));x=Graph.compress(J);if(Graph.decompress(x)!=J)return J;J=d.ownerDocument.createElement("diagram");J.setAttribute("name",mxResources.get("pageWithNumber",[1]));J.setAttribute("id",Editor.guid());mxUtils.setTextContent(J,x)}x=d.ownerDocument.createElement("mxfile");x.appendChild(J)}C?(x=x.cloneNode(!0),x.removeAttribute("modified"),x.removeAttribute("host"),x.removeAttribute("agent"),x.removeAttribute("etag"),x.removeAttribute("userAgent"),x.removeAttribute("version"),x.removeAttribute("editor"),x.removeAttribute("type")):(x.removeAttribute("userAgent"),x.removeAttribute("modified"),x.removeAttribute("version"),x.removeAttribute("editor"),x.removeAttribute("pages"),x.removeAttribute("type"),x.removeAttribute("etag"),mxClient.IS_CHROMEAPP?x.setAttribute("host","Chrome"):EditorUi.isElectronApp?x.setAttribute("host","Electron"):x.setAttribute("host",window.location.hostname),x.setAttribute("agent",null!=navigator.userAgent?navigator.userAgent:navigator.appVersion),x.setAttribute("version",EditorUi.VERSION),1<x.getElementsByTagName("diagram").length&&null!=this.pages&&x.setAttribute("pages",this.pages.length));-null!=S&&(x=x.cloneNode(!0),x.setAttribute("scale",S));null!=V&&(x=x.cloneNode(!0),x.setAttribute("border",V));d=Q?mxUtils.getPrettyXml(x):mxUtils.getXml(x);if(!y&&!t&&(A||null!=k&&/(\.html)$/i.test(k.getTitle())))d=this.getHtml2(mxUtils.getXml(x),g,null!=k?k.getTitle():null,u,P);else if(y||!t&&null!=k&&/(\.svg)$/i.test(k.getTitle()))null==k||k.getMode()!=App.MODE_DEVICE&&k.getMode()!=App.MODE_BROWSER||(m=null),k=this.getSvgFileProperties(x),d=this.getEmbeddedSvg(d,g,m,null,I,F,P,null,null,k.scale,+null!=S&&(x=x.cloneNode(!0),x.setAttribute("scale",S));null!=V&&(x=x.cloneNode(!0),x.setAttribute("border",V));d=Q?mxUtils.getPrettyXml(x):mxUtils.getXml(x);if(!y&&!t&&(z||null!=k&&/(\.html)$/i.test(k.getTitle())))d=this.getHtml2(mxUtils.getXml(x),g,null!=k?k.getTitle():null,u,P);else if(y||!t&&null!=k&&/(\.svg)$/i.test(k.getTitle()))null==k||k.getMode()!=App.MODE_DEVICE&&k.getMode()!=App.MODE_BROWSER||(m=null),k=this.getSvgFileProperties(x),d=this.getEmbeddedSvg(d,g,m,null,I,F,P,null,null,k.scale,k.border,null,Editor.svgFileTheme);return d};EditorUi.prototype.getXmlFileData=function(d,g,k,m){d=null!=d?d:!0;g=null!=g?g:!1;k=null!=k?k:!Editor.defaultCompressed;var t=this.editor.getGraphXml(d,m);if(d&&null!=this.fileNode&&null!=this.currentPage)if(d=function(F){var C=F.getElementsByTagName("mxGraphModel"),Q=0<C.length?C[0]:null;C=F;null==Q&&k?(Q=mxUtils.getNodeValue(F),0<Q.length&&(Q=Graph.decompress(Q),null!=Q&&0<Q.length&&(C=F.cloneNode(!1),C.appendChild(mxUtils.parseXml(Q).documentElement)))):-null==Q||k?C=F.cloneNode(!0):(C=F.cloneNode(!1),mxUtils.setTextContent(C,Graph.compressNode(Q)));t.appendChild(C)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(t),t=this.fileNode.cloneNode(!1),g)d(this.currentPage.node);else for(g=0;g<this.pages.length;g++){var y=this.pages[g],A=y.node;if(y!=this.currentPage)if(y.needsUpdate){var I=new mxCodec(mxUtils.createXmlDocument());I=I.encode(new mxGraphModel(y.root));this.editor.graph.saveViewState(y.viewState,I,null,-m);EditorUi.removeChildNodes(A);A.appendChild(I);delete y.needsUpdate}else m&&(this.updatePageRoot(y),null!=y.viewState.backgroundImage&&(null!=y.viewState.backgroundImage.originalSrc?y.viewState.backgroundImage=this.createImageForPageLink(y.viewState.backgroundImage.originalSrc,y):Graph.isPageLink(y.viewState.backgroundImage.src)&&(y.viewState.backgroundImage=this.createImageForPageLink(y.viewState.backgroundImage.src,y))),null!=y.viewState.backgroundImage&&null!=y.viewState.backgroundImage.originalSrc&&-(I=new mxCodec(mxUtils.createXmlDocument()),I=I.encode(new mxGraphModel(y.root)),this.editor.graph.saveViewState(y.viewState,I,null,m),A=A.cloneNode(!1),A.appendChild(I)));d(A)}return t};EditorUi.prototype.anonymizeString=function(d,g){for(var k=[],m=0;m<d.length;m++){var t=d.charAt(m);0<=EditorUi.ignoredAnonymizedChars.indexOf(t)?k.push(t):isNaN(parseInt(t))?t.toLowerCase()!=t?k.push(String.fromCharCode(65+Math.round(25*Math.random()))):t.toUpperCase()!=t?k.push(String.fromCharCode(97+Math.round(25*+null==Q||k?C=F.cloneNode(!0):(C=F.cloneNode(!1),mxUtils.setTextContent(C,Graph.compressNode(Q)));t.appendChild(C)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(t),t=this.fileNode.cloneNode(!1),g)d(this.currentPage.node);else for(g=0;g<this.pages.length;g++){var y=this.pages[g],z=y.node;if(y!=this.currentPage)if(y.needsUpdate){var I=new mxCodec(mxUtils.createXmlDocument());I=I.encode(new mxGraphModel(y.root));this.editor.graph.saveViewState(y.viewState,I,null,+m);EditorUi.removeChildNodes(z);z.appendChild(I);delete y.needsUpdate}else m&&(this.updatePageRoot(y),null!=y.viewState.backgroundImage&&(null!=y.viewState.backgroundImage.originalSrc?y.viewState.backgroundImage=this.createImageForPageLink(y.viewState.backgroundImage.originalSrc,y):Graph.isPageLink(y.viewState.backgroundImage.src)&&(y.viewState.backgroundImage=this.createImageForPageLink(y.viewState.backgroundImage.src,y))),null!=y.viewState.backgroundImage&&null!=y.viewState.backgroundImage.originalSrc&&+(I=new mxCodec(mxUtils.createXmlDocument()),I=I.encode(new mxGraphModel(y.root)),this.editor.graph.saveViewState(y.viewState,I,null,m),z=z.cloneNode(!1),z.appendChild(I)));d(z)}return t};EditorUi.prototype.anonymizeString=function(d,g){for(var k=[],m=0;m<d.length;m++){var t=d.charAt(m);0<=EditorUi.ignoredAnonymizedChars.indexOf(t)?k.push(t):isNaN(parseInt(t))?t.toLowerCase()!=t?k.push(String.fromCharCode(65+Math.round(25*Math.random()))):t.toUpperCase()!=t?k.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(t)?k.push(" "):k.push("?"):k.push(g?"0":Math.round(9*Math.random()))}return k.join("")};EditorUi.prototype.anonymizePatch=function(d){d=mxUtils.clone(d);if(null!=d[EditorUi.DIFF_INSERT])for(var g=0;g<d[EditorUi.DIFF_INSERT].length;g++)try{var k=mxUtils.parseXml(d[EditorUi.DIFF_INSERT][g].data).documentElement.cloneNode(!1);null!=k.getAttribute("name")&&k.setAttribute("name",this.anonymizeString(k.getAttribute("name")));d[EditorUi.DIFF_INSERT][g].data=mxUtils.getXml(k)}catch(y){d[EditorUi.DIFF_INSERT][g].data=-y.message}if(null!=d[EditorUi.DIFF_UPDATE]){for(var m in d[EditorUi.DIFF_UPDATE]){var t=d[EditorUi.DIFF_UPDATE][m];null!=t.name&&(t.name=this.anonymizeString(t.name));null!=t.cells&&(g=mxUtils.bind(this,function(y){var A=t.cells[y];if(null!=A){for(var I in A)null!=A[I].value&&(A[I].value="["+A[I].value.length+"]"),null!=A[I].xmlValue&&(A[I].xmlValue="["+A[I].xmlValue.length+"]"),null!=A[I].style&&(A[I].style="["+A[I].style.length+"]"),mxUtils.isEmptyObject(A[I])&&delete A[I];mxUtils.isEmptyObject(A)&&+y.message}if(null!=d[EditorUi.DIFF_UPDATE]){for(var m in d[EditorUi.DIFF_UPDATE]){var t=d[EditorUi.DIFF_UPDATE][m];null!=t.name&&(t.name=this.anonymizeString(t.name));null!=t.cells&&(g=mxUtils.bind(this,function(y){var z=t.cells[y];if(null!=z){for(var I in z)null!=z[I].value&&(z[I].value="["+z[I].value.length+"]"),null!=z[I].xmlValue&&(z[I].xmlValue="["+z[I].xmlValue.length+"]"),null!=z[I].style&&(z[I].style="["+z[I].style.length+"]"),mxUtils.isEmptyObject(z[I])&&delete z[I];mxUtils.isEmptyObject(z)&&delete t.cells[y]}}),g(EditorUi.DIFF_INSERT),g(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(t.cells)&&delete t.cells);mxUtils.isEmptyObject(t)&&delete d[EditorUi.DIFF_UPDATE][m]}mxUtils.isEmptyObject(d[EditorUi.DIFF_UPDATE])&&delete d[EditorUi.DIFF_UPDATE]}return d};EditorUi.prototype.anonymizeAttributes=function(d,g){if(null!=d.attributes)for(var k=0;k<d.attributes.length;k++)"as"!=d.attributes[k].name&&d.setAttribute(d.attributes[k].name,this.anonymizeString(d.attributes[k].value,g));if(null!=d.childNodes)for(k=0;k<d.childNodes.length;k++)this.anonymizeAttributes(d.childNodes[k],g)};EditorUi.prototype.anonymizeNode=function(d,g){g=d.getElementsByTagName("mxCell");for(var k=0;k<g.length;k++)null!=g[k].getAttribute("value")&&g[k].setAttribute("value","["+g[k].getAttribute("value").length+"]"),null!=g[k].getAttribute("xmlValue")&&g[k].setAttribute("xmlValue","["+g[k].getAttribute("xmlValue").length+"]"),null!=g[k].getAttribute("style")&&g[k].setAttribute("style","["+g[k].getAttribute("style").length+"]"),null!=g[k].parentNode&&"root"!=g[k].parentNode.nodeName&&null!=g[k].parentNode.parentNode&&(g[k].setAttribute("id",g[k].parentNode.getAttribute("id")),g[k].parentNode.parentNode.replaceChild(g[k],g[k].parentNode));return d};EditorUi.prototype.synchronizeCurrentFile=function(d){var g=this.getCurrentFile();null!=g&&(g.savingFile?this.handleError({message:mxResources.get("busy")}):!d&&g.invalidChecksum?g.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(g.clearAutosave(),-this.clearStatus(),d?g.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();g.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(k){this.spinner.stop();g.handleFileError(k,!0)})):g.synchronizeFile(mxUtils.bind(this,function(){g.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(k){g.handleFileError(k,!0)}))))};EditorUi.prototype.getFileData=function(d,g,k,m,t,y,A,I,F,C,Q,S,V){t=null!=t?t:!0;y=null!=y?y:!1;C=null!=C?C:!Editor.defaultCompressed;var P=+this.clearStatus(),d?g.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();g.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(k){this.spinner.stop();g.handleFileError(k,!0)})):g.synchronizeFile(mxUtils.bind(this,function(){g.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(k){g.handleFileError(k,!0)}))))};EditorUi.prototype.getFileData=function(d,g,k,m,t,y,z,I,F,C,Q,S,V){t=null!=t?t:!0;y=null!=y?y:!1;C=null!=C?C:!Editor.defaultCompressed;var P=this.editor.graph;if((g||!d&&null!=F&&/(\.svg)$/i.test(F.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var u=P.getGlobalVariable;P=this.createTemporaryGraph(P.getStylesheet());P.setBackgroundImage=this.editor.graph.setBackgroundImage;P.background=this.editor.graph.background;var x=null!=this.pages?this.pages[0]:null;null==x||this.currentPage==x?P.setBackgroundImage(this.editor.graph.backgroundImage):null!=x.viewState&&null!=x.viewState&&P.setBackgroundImage(x.viewState.backgroundImage);-P.getGlobalVariable=function(J){return"page"==J&&null!=x?x.getName():"pagenumber"==J?1:u.apply(this,arguments)};document.body.appendChild(P.container);null!=x&&P.model.setRoot(x.root)}A=null!=A?A:this.getXmlFileData(t,y,C,Q);F=null!=F?F:this.getCurrentFile();d=this.createFileData(A,P,F,window.location.href,d,g,k,m,t,I,C,S,V);P!=this.editor.graph&&P.container.parentNode.removeChild(P.container);return d};EditorUi.prototype.getHtml=function(d,g,k,m,t,y){y=null!=y?y:!0;var A=null,I=EditorUi.drawHost+-"/js/embed-static.min.js";if(null!=g){A=y?g.getGraphBounds():g.getBoundingBox(g.getSelectionCells());var F=g.view.scale;y=Math.floor(A.x/F-g.view.translate.x);F=Math.floor(A.y/F-g.view.translate.y);A=g.background;null==t&&(g=this.getBasenames().join(";"),0<g.length&&(I=EditorUi.drawHost+"/embed.js?s="+g));d.setAttribute("x0",y);d.setAttribute("y0",F)}null!=d&&(d.setAttribute("pan","1"),d.setAttribute("zoom","1"),d.setAttribute("resize","0"),d.setAttribute("fit","0"),d.setAttribute("border","20"),+P.getGlobalVariable=function(J){return"page"==J&&null!=x?x.getName():"pagenumber"==J?1:u.apply(this,arguments)};document.body.appendChild(P.container);null!=x&&P.model.setRoot(x.root)}z=null!=z?z:this.getXmlFileData(t,y,C,Q);F=null!=F?F:this.getCurrentFile();d=this.createFileData(z,P,F,window.location.href,d,g,k,m,t,I,C,S,V);P!=this.editor.graph&&P.container.parentNode.removeChild(P.container);return d};EditorUi.prototype.getHtml=function(d,g,k,m,t,y){y=null!=y?y:!0;var z=null,I=EditorUi.drawHost++"/js/embed-static.min.js";if(null!=g){z=y?g.getGraphBounds():g.getBoundingBox(g.getSelectionCells());var F=g.view.scale;y=Math.floor(z.x/F-g.view.translate.x);F=Math.floor(z.y/F-g.view.translate.y);z=g.background;null==t&&(g=this.getBasenames().join(";"),0<g.length&&(I=EditorUi.drawHost+"/embed.js?s="+g));d.setAttribute("x0",y);d.setAttribute("y0",F)}null!=d&&(d.setAttribute("pan","1"),d.setAttribute("zoom","1"),d.setAttribute("resize","0"),d.setAttribute("fit","0"),d.setAttribute("border","20"),d.setAttribute("links","1"),null!=m&&d.setAttribute("edit",m));null!=t&&(t=t.replace(/&/g,"&"));d=null!=d?Graph.zapGremlins(mxUtils.getXml(d)):"";m=Graph.compress(d);Graph.decompress(m)!=d&&(m=encodeURIComponent(d));return(null==t?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=t?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==t?null!=k?"<title>"+mxUtils.htmlEntities(k)+"</title>\n":"":"<title>draw.io</title>\n")+-(null!=t?'<meta http-equiv="refresh" content="0;URL=\''+t+"'\"/>\n":"")+"</head>\n<body"+(null==t&&null!=A&&A!=mxConstants.NONE?' style="background-color:'+A+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+m+"</div>\n</div>\n"+(null==t?'<script type="text/javascript" src="'+I+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+t+'" target="_blank"><img border="0" src="'++(null!=t?'<meta http-equiv="refresh" content="0;URL=\''+t+"'\"/>\n":"")+"</head>\n<body"+(null==t&&null!=z&&z!=mxConstants.NONE?' style="background-color:'+z+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+m+"</div>\n</div>\n"+(null==t?'<script type="text/javascript" src="'+I+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+t+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(d,g,k,m,t){g=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";null!=t&&(t=t.replace(/&/g,"&"));d={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:Graph.zapGremlins(d),toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(d.page=mxUtils.indexOf(this.pages,this.currentPage));return(null==t?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=t?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==t?null!=k?"<title>"+mxUtils.htmlEntities(k)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=t?'<meta http-equiv="refresh" content="0;URL=\''+t+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(d))+'"></div>\n'+(null==t?'<script type="text/javascript" src="'+g+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+t+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.setFileData=function(d){d=this.validateFileData(d);this.pages=this.fileNode=this.currentPage=null;var g=null!=d&&0<d.length?mxUtils.parseXml(d).documentElement:null,k=Editor.extractParserError(g,mxResources.get("invalidOrMissingFile"));if(k)throw EditorUi.debug("EditorUi.setFileData ParserError",[this],"data",[d],"node",[g],"cause",[k]),Error(mxResources.get("notADiagramFile")+" ("+k+")");d=null!=g?this.editor.extractGraphModel(g,!0):null;null!=d&&(g=d);if(null!=g&&"mxfile"==g.nodeName&&(d=g.getElementsByTagName("diagram"),k={},0<d.length)){var m=this.getHashObject(),t=null;this.fileNode=g;this.pages=[];for(var y=0;y<d.length;y++){null==d[y].getAttribute("id")&&d[y].setAttribute("id",y);g=new DiagramPage(d[y]);null==g.getName()&&g.setName(mxResources.get("pageWithNumber",[y+1]));this.pages.push(g);if(null==m.pageId&&null!=urlParams["page-id"]&&g.getId()==urlParams["page-id"]||null!=m.pageId&&g.getId()==m.pageId)t=g;if(null==k[g.getId()])k[g.getId()]=g;else throw Error(g.getId()+": Duplicate page ID");}this.currentPage=null!=t?t:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];g=this.currentPage.node}null==this.fileNode&&null!=g&&(this.fileNode=g.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(g.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",-[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(g);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,this.currentPage.setDiagramModified(!1),this.scrollToPage());if(null!=urlParams["layer-ids"])try{var A=decodeURIComponent(urlParams["layer-ids"]).split(" ");g={};for(y=0;y<A.length;y++)g[A[y]]=!0;var I=this.editor.graph.getModel(),F=I.getChildren(I.root);for(y=0;y<F.length;y++){var C=F[y];I.setVisible(C,g[C.id]||!1)}}catch(Q){}};EditorUi.prototype.getBaseFilename=+[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(g);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,this.currentPage.setDiagramModified(!1),this.scrollToPage());if(null!=urlParams["layer-ids"])try{var z=decodeURIComponent(urlParams["layer-ids"]).split(" ");g={};for(y=0;y<z.length;y++)g[z[y]]=!0;var I=this.editor.graph.getModel(),F=I.getChildren(I.root);for(y=0;y<F.length;y++){var C=F[y];I.setVisible(C,g[C.id]||!1)}}catch(Q){}};EditorUi.prototype.getBaseFilename=function(d){var g=this.getCurrentFile();g=null!=g&&null!=g.getTitle()?g.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(g)||/(\.html)$/i.test(g)||/(\.svg)$/i.test(g)||/(\.png)$/i.test(g))g=g.substring(0,g.lastIndexOf("."));/(\.drawio)$/i.test(g)&&(g=g.substring(0,g.lastIndexOf(".")));!d&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(g=g+"-"+this.currentPage.getName());return g};EditorUi.prototype.downloadFile=-function(d,g,k,m,t,y,A,I,F,C,Q,S,V,P,u,x){try{m=null!=m?m:this.editor.graph.isSelectionEmpty();var J=this.getBaseFilename(!t),H=J+("xml"==d||"pdf"==d&&Q?".drawio":"")+"."+d;if("xml"==d){var K=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,m,t,null,null,null,g);this.saveData(H,d,K,"text/xml")}else if("html"==d)K=this.getHtml2(this.getFileData(!0),this.editor.graph,J),this.saveData(H,d,K,"text/html");else if("svg"!=d&&"xmlsvg"!=d||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==-d?H=J+".png":"jpeg"==d&&(H=J+".jpg"),this.saveRequest(H,d,mxUtils.bind(this,function(D,L){try{return this.createDownloadRequest(D,d,m,L,A,t,I,F,C,Q,S,void 0,void 0,!y,V,P,u,x)}catch(N){this.handleError(N)}}));else{var O=null,M=mxUtils.bind(this,function(D){D.length<=MAX_REQUEST_SIZE?this.saveData(H,"svg",D,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(O)}))});if("svg"==d){var n=this.editor.graph.background;-if(A||n==mxConstants.NONE)n=null;var z=this.editor.graph.getSvg(n,null,null,null,null,m);k&&this.editor.graph.addSvgShadow(z);this.editor.convertImages(z,mxUtils.bind(this,mxUtils.bind(this,function(D){this.spinner.stop();M(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(D))})))}else H=J+".svg",O=this.getFileData(!1,!0,null,mxUtils.bind(this,function(D){this.spinner.stop();M(D)}),m)}}catch(D){this.handleError(D)}};EditorUi.prototype.createDownloadRequest=function(d,g,k,m,t,y,A,I,F,-C,Q,S,V,P,u,x,J,H){d=this.downloadRequestBuilder(d,g,k,m,t,y,A,I,F,C,Q,S,V,P,u,x,J,H);g="";for(var K in d)k=d[K],null!=k&&(g+=K+"="+encodeURIComponent(k)+"&");return new mxXmlRequest(EXPORT_URL,g)};EditorUi.prototype.downloadRequestBuilder=function(d,g,k,m,t,y,A,I,F,C,Q,S,V,P,u,x,J,H){var K=this.editor.graph,O=K.getGraphBounds();k=this.getFileData(!0,null,null,null,k,0==y?!1:"xmlpng"!=g,null,null,null,!Editor.defaultCompressed,"pdf"==g);var M=null,n=null,z=null;if(!EditorUi.isElectronApp&&(O.width*-O.height>MAX_AREA||k.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};C=C?"1":"0";"pdf"==g&&(null!=Q?(M=Q.from,n=Q.to):0==y&&(z="1"));"xmlpng"==g&&(C="1",g="png");if(("xmlpng"==g||"svg"==g)&&null!=this.pages&&null!=this.currentPage)for(y=0;y<this.pages.length;y++)if(this.pages[y]==this.currentPage){M=y;break}y=K.background;"png"!=g&&"pdf"!=g&&"svg"!=g||!t?t||null!=y&&y!=mxConstants.NONE||(y="#ffffff"):y=mxConstants.NONE;t={globalVars:K.getExportVariables()};F&&(t.grid={size:K.gridSize,-steps:K.view.gridSteps,color:Editor.isDarkMode()&&"pdf"==g?mxGraphView.prototype.defaultGridColor:K.view.gridColor});Graph.translateDiagram&&(t.diagramLanguage=Graph.diagramLanguage);return{format:g,from:M,to:n,allPages:z,bg:null!=y?y:mxConstants.NONE,base64:m,embedXml:C,xml:k,filename:null!=d?d:"",extras:JSON.stringify(t),scale:A,border:I,pageMargin:u,w:S&&isFinite(S)?S:null,h:V&&isFinite(V)?V:null,crop:null!=P&&P?"1":"0",fit:null!=x&&x?"1":"0",sheetsAcross:J,sheetsDown:H}};EditorUi.prototype.setMode=+function(d,g,k,m,t,y,z,I,F,C,Q,S,V,P,u,x){try{m=null!=m?m:this.editor.graph.isSelectionEmpty();var J=this.getBaseFilename(!t),H=J+("xml"==d||"pdf"==d&&Q?".drawio":"")+"."+d;if("xml"==d){var K=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,m,t,null,null,null,g);this.saveData(H,d,K,"text/xml")}else if("html"==d)K=this.getHtml2(this.getFileData(!0),this.editor.graph,J),this.saveData(H,d,K,"text/html");else if("svg"!=d&&"xmlsvg"!=d||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==+d?H=J+".png":"jpeg"==d&&(H=J+".jpg"),this.saveRequest(H,d,mxUtils.bind(this,function(E,L){try{return this.createDownloadRequest(E,d,m,L,z,t,I,F,C,Q,S,void 0,void 0,!y,V,P,u,x)}catch(O){this.handleError(O)}}));else{var N=null,M=mxUtils.bind(this,function(E){E.length<=MAX_REQUEST_SIZE?this.saveData(H,"svg",E,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(N)}))});if("svg"==d){var n=this.editor.graph.background;+if(z||n==mxConstants.NONE)n=null;var A=this.editor.graph.getSvg(n,null,null,null,null,m);k&&this.editor.graph.addSvgShadow(A);this.editor.convertImages(A,mxUtils.bind(this,mxUtils.bind(this,function(E){this.spinner.stop();M(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(E))})))}else H=J+".svg",N=this.getFileData(!1,!0,null,mxUtils.bind(this,function(E){this.spinner.stop();M(E)}),m)}}catch(E){this.handleError(E)}};EditorUi.prototype.createDownloadRequest=function(d,g,k,m,t,y,z,I,F,+C,Q,S,V,P,u,x,J,H){d=this.downloadRequestBuilder(d,g,k,m,t,y,z,I,F,C,Q,S,V,P,u,x,J,H);g="";for(var K in d)k=d[K],null!=k&&(g+=K+"="+encodeURIComponent(k)+"&");return new mxXmlRequest(EXPORT_URL,g)};EditorUi.prototype.downloadRequestBuilder=function(d,g,k,m,t,y,z,I,F,C,Q,S,V,P,u,x,J,H){var K=this.editor.graph,N=K.getGraphBounds();k=this.getFileData(!0,null,null,null,k,0==y?!1:"xmlpng"!=g,null,null,null,!Editor.defaultCompressed,"pdf"==g);var M=null,n=null,A=null;if(!EditorUi.isElectronApp&&(N.width*+N.height>MAX_AREA||k.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};C=C?"1":"0";"pdf"==g&&(null!=Q?(M=Q.from,n=Q.to):0==y&&(A="1"));"xmlpng"==g&&(C="1",g="png");if(("xmlpng"==g||"svg"==g)&&null!=this.pages&&null!=this.currentPage)for(y=0;y<this.pages.length;y++)if(this.pages[y]==this.currentPage){M=y;break}y=K.background;"png"!=g&&"pdf"!=g&&"svg"!=g||!t?t||null!=y&&y!=mxConstants.NONE||(y="#ffffff"):y=mxConstants.NONE;t={globalVars:K.getExportVariables()};F&&(t.grid={size:K.gridSize,+steps:K.view.gridSteps,color:Editor.isDarkMode()&&"pdf"==g?mxGraphView.prototype.defaultGridColor:K.view.gridColor});Graph.translateDiagram&&(t.diagramLanguage=Graph.diagramLanguage);return{format:g,from:M,to:n,allPages:A,bg:null!=y?y:mxConstants.NONE,base64:m,embedXml:C,xml:k,filename:null!=d?d:"",extras:JSON.stringify(t),scale:z,border:I,pageMargin:u,w:S&&isFinite(S)?S:null,h:V&&isFinite(V)?V:null,crop:null!=P&&P?"1":"0",fit:null!=x&&x?"1":"0",sheetsAcross:J,sheetsDown:H}};EditorUi.prototype.setMode=function(d,g){this.mode=d};EditorUi.prototype.getDiagramId=function(){var d=window.location.hash;null!=d&&0<d.length&&(d=d.substring(1));if(null!=d&&1<d.length){var g=d.indexOf("#");0<=g&&(d=d.substring(0,g))}return d};EditorUi.prototype.getHashObject=function(){var d=window.location.hash,g={};if(null!=d&&0<d.length){var k=d.lastIndexOf("#");if(0<k){d=decodeURIComponent(d.substring(k+1));try{g=JSON.parse(d)}catch(m){}}}return g};EditorUi.prototype.updateHashObject=function(){if(null!=this.currentFile&&null!=this.currentPage&&""!=this.currentFile.getHash()){var d=this.getHashObject();d.pageId=this.currentPage.getId();this.setHashObject(d)}else this.setHashObject(null)};EditorUi.prototype.setHashObject=function(d){if(Editor.enableHashObjects){var g=window.location.hash;if(null==g||""==g)g="#";var k=g.lastIndexOf("#");0<k&&(g=g.substring(0,k));try{null==d||mxUtils.isEmptyObject(d)||(g=g+"#"+encodeURIComponent(JSON.stringify(d)))}catch(m){}0<k&&0<g.lastIndexOf("#")?window.location.hash=g:window.location.replace(g)}};-EditorUi.prototype.loadDescriptor=function(d,g,k){var m=window.location.hash,t=mxUtils.bind(this,function(A){var I=null!=d.data?d.data:"";null!=A&&0<A.length&&(0<I.length&&(I+="\n"),I+=A);A=new LocalFile(this,"csv"!=d.format&&0<I.length?I:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);A.getHash=function(){return m};this.fileLoaded(A);"csv"==d.format&&this.importCsv(I,mxUtils.bind(this,function(V){this.editor.undoManager.clear();this.editor.setModified(!1);+EditorUi.prototype.loadDescriptor=function(d,g,k){var m=window.location.hash,t=mxUtils.bind(this,function(z){var I=null!=d.data?d.data:"";null!=z&&0<z.length&&(0<I.length&&(I+="\n"),I+=z);z=new LocalFile(this,"csv"!=d.format&&0<I.length?I:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);z.getHash=function(){return m};this.fileLoaded(z);"csv"==d.format&&this.importCsv(I,mxUtils.bind(this,function(V){this.editor.undoManager.clear();this.editor.setModified(!1);this.clearStatus()}));if(null!=d.update){var F=null!=d.interval?parseInt(d.interval):6E4,C=null,Q=mxUtils.bind(this,function(){var V=this.currentPage;mxUtils.post(d.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(P){V===this.currentPage&&(200<=P.getStatus()&&300>=P.getStatus()?(this.updateDiagram(P.getText()),S()):this.handleError({message:mxResources.get("error")+" "+P.getStatus()}))}),mxUtils.bind(this,function(P){this.handleError(P)}))}),S=-mxUtils.bind(this,function(){window.clearTimeout(C);C=window.setTimeout(Q,F)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){S();Q()}));S();Q()}null!=g&&g()});if(null!=d.url&&0<d.url.length){var y=this.editor.getProxiedUrl(d.url);this.editor.loadUrl(y,mxUtils.bind(this,function(A){t(A)}),mxUtils.bind(this,function(A){null!=k&&k(A)}))}else t("")};EditorUi.prototype.updateDiagram=function(d){function g(O){var M=new mxCellOverlay(O.image||t.warningImage,O.tooltip,O.align,O.valign,-O.offset);M.addListener(mxEvent.CLICK,function(n,z){m.alert(O.tooltip)});return M}var k=null,m=this;if(null!=d&&0<d.length&&(k=mxUtils.parseXml(d),d=null!=k?k.documentElement:null,null!=d&&"updates"==d.nodeName)){var t=this.editor.graph,y=t.getModel();y.beginUpdate();var A=null;try{for(d=d.firstChild;null!=d;){if("update"==d.nodeName){var I=y.getCell(d.getAttribute("id"));if(null!=I){try{var F=d.getAttribute("value");if(null!=F){var C=mxUtils.parseXml(F).documentElement;if(null!=C)if("1"==C.getAttribute("replace-value"))y.setValue(I,-C);else for(var Q=C.attributes,S=0;S<Q.length;S++)t.setAttributeForCell(I,Q[S].nodeName,0<Q[S].nodeValue.length?Q[S].nodeValue:null)}}catch(O){null!=window.console&&console.log("Error in value for "+I.id+": "+O)}try{var V=d.getAttribute("style");null!=V&&t.model.setStyle(I,V)}catch(O){null!=window.console&&console.log("Error in style for "+I.id+": "+O)}try{var P=d.getAttribute("icon");if(null!=P){var u=0<P.length?JSON.parse(P):null;null!=u&&u.append||t.removeCellOverlays(I);null!=u&&t.addCellOverlay(I,-g(u))}}catch(O){null!=window.console&&console.log("Error in icon for "+I.id+": "+O)}try{var x=d.getAttribute("geometry");if(null!=x){x=JSON.parse(x);var J=t.getCellGeometry(I);if(null!=J){J=J.clone();for(key in x){var H=parseFloat(x[key]);"dx"==key?J.x+=H:"dy"==key?J.y+=H:"dw"==key?J.width+=H:"dh"==key?J.height+=H:J[key]=parseFloat(x[key])}t.model.setGeometry(I,J)}}}catch(O){null!=window.console&&console.log("Error in icon for "+I.id+": "+O)}}}else if("model"==d.nodeName){for(var K=d.firstChild;null!=-K&&K.nodeType!=mxConstants.NODETYPE_ELEMENT;)K=K.nextSibling;null!=K&&(new mxCodec(d.firstChild)).decode(K,y)}else if("view"==d.nodeName){if(d.hasAttribute("scale")&&(t.view.scale=parseFloat(d.getAttribute("scale"))),d.hasAttribute("dx")||d.hasAttribute("dy"))t.view.translate=new mxPoint(parseFloat(d.getAttribute("dx")||0),parseFloat(d.getAttribute("dy")||0))}else"fit"==d.nodeName&&(A=d.hasAttribute("max-scale")?parseFloat(d.getAttribute("max-scale")):1);d=d.nextSibling}}finally{y.endUpdate()}null!=-A&&this.chromelessResize&&this.chromelessResize(!0,A)}return k};EditorUi.prototype.getCopyFilename=function(d,g){var k=null!=d&&null!=d.getTitle()?d.getTitle():this.defaultFilename;d="";var m=k.lastIndexOf(".");0<=m&&(d=k.substring(m),k=k.substring(0,m));if(g){g=k;var t=new Date;k=t.getFullYear();m=t.getMonth()+1;var y=t.getDate(),A=t.getHours(),I=t.getMinutes();t=t.getSeconds();k=g+(" "+(k+"-"+m+"-"+y+"-"+A+"-"+I+"-"+t))}return k=mxResources.get("copyOf",[k])+d};EditorUi.prototype.logIfModified=+mxUtils.bind(this,function(){window.clearTimeout(C);C=window.setTimeout(Q,F)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){S();Q()}));S();Q()}null!=g&&g()});if(null!=d.url&&0<d.url.length){var y=this.editor.getProxiedUrl(d.url);this.editor.loadUrl(y,mxUtils.bind(this,function(z){t(z)}),mxUtils.bind(this,function(z){null!=k&&k(z)}))}else t("")};EditorUi.prototype.updateDiagram=function(d){function g(N){var M=new mxCellOverlay(N.image||t.warningImage,N.tooltip,N.align,N.valign,+N.offset);M.addListener(mxEvent.CLICK,function(n,A){m.alert(N.tooltip)});return M}var k=null,m=this;if(null!=d&&0<d.length&&(k=mxUtils.parseXml(d),d=null!=k?k.documentElement:null,null!=d&&"updates"==d.nodeName)){var t=this.editor.graph,y=t.getModel();y.beginUpdate();var z=null;try{for(d=d.firstChild;null!=d;){if("update"==d.nodeName){var I=y.getCell(d.getAttribute("id"));if(null!=I){try{var F=d.getAttribute("value");if(null!=F){var C=mxUtils.parseXml(F).documentElement;if(null!=C)if("1"==C.getAttribute("replace-value"))y.setValue(I,+C);else for(var Q=C.attributes,S=0;S<Q.length;S++)t.setAttributeForCell(I,Q[S].nodeName,0<Q[S].nodeValue.length?Q[S].nodeValue:null)}}catch(N){null!=window.console&&console.log("Error in value for "+I.id+": "+N)}try{var V=d.getAttribute("style");null!=V&&t.model.setStyle(I,V)}catch(N){null!=window.console&&console.log("Error in style for "+I.id+": "+N)}try{var P=d.getAttribute("icon");if(null!=P){var u=0<P.length?JSON.parse(P):null;null!=u&&u.append||t.removeCellOverlays(I);null!=u&&t.addCellOverlay(I,+g(u))}}catch(N){null!=window.console&&console.log("Error in icon for "+I.id+": "+N)}try{var x=d.getAttribute("geometry");if(null!=x){x=JSON.parse(x);var J=t.getCellGeometry(I);if(null!=J){J=J.clone();for(key in x){var H=parseFloat(x[key]);"dx"==key?J.x+=H:"dy"==key?J.y+=H:"dw"==key?J.width+=H:"dh"==key?J.height+=H:J[key]=parseFloat(x[key])}t.model.setGeometry(I,J)}}}catch(N){null!=window.console&&console.log("Error in icon for "+I.id+": "+N)}}}else if("model"==d.nodeName){for(var K=d.firstChild;null!=+K&&K.nodeType!=mxConstants.NODETYPE_ELEMENT;)K=K.nextSibling;null!=K&&(new mxCodec(d.firstChild)).decode(K,y)}else if("view"==d.nodeName){if(d.hasAttribute("scale")&&(t.view.scale=parseFloat(d.getAttribute("scale"))),d.hasAttribute("dx")||d.hasAttribute("dy"))t.view.translate=new mxPoint(parseFloat(d.getAttribute("dx")||0),parseFloat(d.getAttribute("dy")||0))}else"fit"==d.nodeName&&(z=d.hasAttribute("max-scale")?parseFloat(d.getAttribute("max-scale")):1);d=d.nextSibling}}finally{y.endUpdate()}null!=+z&&this.chromelessResize&&this.chromelessResize(!0,z)}return k};EditorUi.prototype.getCopyFilename=function(d,g){var k=null!=d&&null!=d.getTitle()?d.getTitle():this.defaultFilename;d="";var m=k.lastIndexOf(".");0<=m&&(d=k.substring(m),k=k.substring(0,m));if(g){g=k;var t=new Date;k=t.getFullYear();m=t.getMonth()+1;var y=t.getDate(),z=t.getHours(),I=t.getMinutes();t=t.getSeconds();k=g+(" "+(k+"-"+m+"-"+y+"-"+z+"-"+I+"-"+t))}return k=mxResources.get("copyOf",[k])+d};EditorUi.prototype.logIfModified=function(d,g){try{null!=d&&g&&EditorUi.debug("File.closed",[d])}catch(k){}};EditorUi.prototype.fileLoaded=function(d,g,k){var m=this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrentFile(null);var t=!1;this.hideDialog();null!=m&&(m.removeListener(this.descriptorChangedListener),this.logIfModified(m,!0),m.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var y=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=m&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);!g&&null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fname.innerText="");this.clearStatus();this.updateUi();g||this.showSplash()});if(null!=d)try{this.openingFile=!0;this.setCurrentFile(d);d.addListener("descriptorChanged",this.descriptorChangedListener);d.addListener("contentChanged",this.descriptorChangedListener);d.open();delete this.openingFile;this.setGraphEnabled(!0);this.setMode(d.getMode());this.editor.graph.model.prefix=Editor.guid()+"-";this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();d.isEditable()?d.isModified()?d.addUnsavedStatus():this.clearStatus():this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus('<div class="geStatusBox" title="'+mxUtils.htmlEntities(mxResources.get("readOnly"))+'">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+"</div>")}));!this.editor.isChromelessView()||-this.editor.editable?(this.editor.graph.selectUnlockedLayer(),this.showLayersDialog(),this.restoreLibraries(),window.self!==window.top&&window.focus()):this.editor.graph.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();null!=k&&k();this.editor.fireEvent(new mxEventObject("fileLoaded"));t=!0;if(!this.isOffline()&&null!=d.getMode()){var A="1"==urlParams.sketch?"sketch":uiTheme;if(null==A)A="default";else if("sketch"==A||"min"==A)A+=Editor.isDarkMode()?"-dark":"-light"}EditorUi.debug("File.opened",+this.editor.editable?(this.editor.graph.selectUnlockedLayer(),this.showLayersDialog(),this.restoreLibraries(),window.self!==window.top&&window.focus()):this.editor.graph.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();null!=k&&k();this.editor.fireEvent(new mxEventObject("fileLoaded"));t=!0;if(!this.isOffline()&&null!=d.getMode()){var z="1"==urlParams.sketch?"sketch":uiTheme;if(null==z)z="default";else if("sketch"==z||"min"==z)z+=Editor.isDarkMode()?"-dark":"-light"}EditorUi.debug("File.opened",[d]);"1"==urlParams.viewerOnlyMsg&&this.showAlert(mxResources.get("viewerOnlyMsg"));if(this.editor.editable&&this.mode==d.getMode()&&d.getMode()!=App.MODE_DEVICE&&null!=d.getMode())try{this.addRecent({id:d.getHash(),title:d.getTitle(),mode:d.getMode()})}catch(I){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(I){}}catch(I){this.fileLoadedError=I;if(null!=d)try{d.close()}catch(F){}d=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=m?this.fileLoaded(m)||y():y()});g?d():(null!=I.fallbackFileData&&(I.alternateAction={label:mxResources.get("makeCopy"),funct:mxUtils.bind(this,function(){this.hideDialog();var F=new LocalFile(this,I.fallbackFileData,this.defaultFilename,!0);this.fileLoaded(F)})}),this.handleError(I,mxResources.get("errorLoadingFile"),d,!0,null,null,!0))}else y();return t};EditorUi.prototype.getHashValueForPages=function(d,g){var k=-0,m=new mxGraphModel,t=new mxCodec;null!=g&&(g.byteCount=0,g.attrCount=0,g.eltCount=0,g.nodeCount=0);for(var y=0;y<d.length;y++){this.updatePageRoot(d[y]);var A=d[y].node.cloneNode(!1);A.removeAttribute("name");m.root=d[y].root;var I=t.encode(m);this.editor.graph.saveViewState(d[y].viewState,I,!0);I.removeAttribute("pageWidth");I.removeAttribute("pageHeight");A.appendChild(I);null!=g&&(g.eltCount+=A.getElementsByTagName("*").length,g.nodeCount+=A.getElementsByTagName("mxCell").length);k=(k<<5)-k+-this.hashValue(A,function(F,C,Q,S){return!S||"mxGeometry"!=F.nodeName&&"mxPoint"!=F.nodeName||"x"!=C&&"y"!=C&&"width"!=C&&"height"!=C?S&&"mxCell"==F.nodeName&&"previous"==C?null:Q:Math.round(Q)},g)<<0}return k};EditorUi.prototype.hashValue=function(d,g,k){var m=0;if(null!=d&&"object"===typeof d&&"number"===typeof d.nodeType&&"string"===typeof d.nodeName&&"function"===typeof d.getAttribute){null!=d.nodeName&&(m^=this.hashValue(d.nodeName,g,k));if(null!=d.attributes){null!=k&&(k.attrCount+=d.attributes.length);-for(var t=0;t<d.attributes.length;t++){var y=d.attributes[t].name,A=null!=g?g(d,y,d.attributes[t].value,!0):d.attributes[t].value;null!=A&&(m^=this.hashValue(y,g,k)+this.hashValue(A,g,k))}}if(null!=d.childNodes)for(t=0;t<d.childNodes.length;t++)m=(m<<5)-m+this.hashValue(d.childNodes[t],g,k)<<0}else if(null!=d&&"function"!==typeof d){d=String(d);g=0;null!=k&&(k.byteCount+=d.length);for(t=0;t<d.length;t++)g=(g<<5)-g+d.charCodeAt(t)<<0;m^=g}return m};EditorUi.prototype.descriptorChanged=function(){};-EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(d,g,k,m,t,y,A){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?StorageFile.getFileContent(this,".scratchpad",mxUtils.bind(this,function(d){null==d&&(d=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,d,".scratchpad"))})):this.closeLibrary(this.scratchpad))};+0,m=new mxGraphModel,t=new mxCodec;null!=g&&(g.byteCount=0,g.attrCount=0,g.eltCount=0,g.nodeCount=0);for(var y=0;y<d.length;y++){this.updatePageRoot(d[y]);var z=d[y].node.cloneNode(!1);z.removeAttribute("name");m.root=d[y].root;var I=t.encode(m);this.editor.graph.saveViewState(d[y].viewState,I,!0);I.removeAttribute("pageWidth");I.removeAttribute("pageHeight");z.appendChild(I);null!=g&&(g.eltCount+=z.getElementsByTagName("*").length,g.nodeCount+=z.getElementsByTagName("mxCell").length);k=(k<<5)-k++this.hashValue(z,function(F,C,Q,S){return!S||"mxGeometry"!=F.nodeName&&"mxPoint"!=F.nodeName||"x"!=C&&"y"!=C&&"width"!=C&&"height"!=C?S&&"mxCell"==F.nodeName&&"previous"==C?null:Q:Math.round(Q)},g)<<0}return k};EditorUi.prototype.hashValue=function(d,g,k){var m=0;if(null!=d&&"object"===typeof d&&"number"===typeof d.nodeType&&"string"===typeof d.nodeName&&"function"===typeof d.getAttribute){null!=d.nodeName&&(m^=this.hashValue(d.nodeName,g,k));if(null!=d.attributes){null!=k&&(k.attrCount+=d.attributes.length);+for(var t=0;t<d.attributes.length;t++){var y=d.attributes[t].name,z=null!=g?g(d,y,d.attributes[t].value,!0):d.attributes[t].value;null!=z&&(m^=this.hashValue(y,g,k)+this.hashValue(z,g,k))}}if(null!=d.childNodes)for(t=0;t<d.childNodes.length;t++)m=(m<<5)-m+this.hashValue(d.childNodes[t],g,k)<<0}else if(null!=d&&"function"!==typeof d){d=String(d);g=0;null!=k&&(k.byteCount+=d.length);for(t=0;t<d.length;t++)g=(g<<5)-g+d.charCodeAt(t)<<0;m^=g}return m};EditorUi.prototype.descriptorChanged=function(){};+EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(d,g,k,m,t,y,z){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?StorageFile.getFileContent(this,".scratchpad",mxUtils.bind(this,function(d){null==d&&(d=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,d,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(d){if(!Editor.defaultCompressed)for(var g=0;g<d.length;g++)null!=d[g].xml&&"<"!=d[g].xml.charAt(0)&&(d[g].xml=mxUtils.trim(Graph.decompress(d[g].xml)));g=mxUtils.createXmlDocument();var k=g.createElement("mxlibrary");mxUtils.setTextContent(k,JSON.stringify(d,null,2));g.appendChild(k);return mxUtils.getXml(g,"\n")};EditorUi.prototype.closeLibrary=function(d){null!=d&&(this.removeLibrarySidebar(d.getHash()),d.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(d.getHash()),".scratchpad"==d.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(d){var g=this.sidebar.palettes[d];if(null!=g){for(var k=0;k<g.length;k++)g[k].parentNode.removeChild(g[k]);delete this.sidebar.palettes[d]}};EditorUi.prototype.repositionLibrary=function(d,g){var k=this.sidebar.getEntryContainer();if(!this.sidebar.appendCustomLibraries||null!=d||!g){null==d&&(g=this.sidebar.palettes["L.scratchpad"],null==g&&(g=this.sidebar.palettes.search),null!=g&&(d=g[g.length-1].nextSibling));d=null!=d?d:k.firstChild.nextSibling.nextSibling;g=k.lastChild;var m=g.previousSibling;k.insertBefore(g,d);k.insertBefore(m,g)}};EditorUi.prototype.loadLibrary=function(d,g){var k=mxUtils.parseXml(d.getData());if("mxlibrary"==k.documentElement.nodeName){var m=JSON.parse(mxUtils.getTextContent(k.documentElement));this.libraryLoaded(d,m,k.documentElement.getAttribute("title"),g)}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(d){return""};EditorUi.prototype.showSidebar=function(){null!=this.sidebarWindow?this.sidebarWindow.window.setVisible(!0):this.toggleShapesPanel(!0)};EditorUi.prototype.libraryLoaded=function(d,g,k,m){if(null!=this.sidebar){d.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(d.getHash());var t=null;if(d.constructor!=StorageLibrary||".scratchpad"!=d.title){null==this.openLibraries&&(this.openLibraries=[]);for(var y=0;y<this.openLibraries.length;y++)if(this.openLibraries[y].file.getHash()==d.getHash()){mxUtils.remove(this.openLibraries[y],-this.openLibraries);break}t={file:d,images:g,title:k,expand:m};this.openLibraries.push(t)}else this.scratchpad=d;y=this.sidebar.palettes[d.getHash()];y=null!=y?y[y.length-1].nextSibling:null;this.removeLibrarySidebar(d.getHash());var A=null,I=mxUtils.bind(this,function(H,K){0==H.length&&d.isEditable()?(null==A&&(A=document.createElement("div"),A.className="geDropTarget",mxUtils.write(A,mxResources.get("dragElementsHere"))),K.appendChild(A)):this.addLibraryEntries(H,K)});null!=this.sidebar&&null!=+this.openLibraries);break}t={file:d,images:g,title:k,expand:m};this.openLibraries.push(t)}else this.scratchpad=d;y=this.sidebar.palettes[d.getHash()];y=null!=y?y[y.length-1].nextSibling:null;this.removeLibrarySidebar(d.getHash());var z=null,I=mxUtils.bind(this,function(H,K){0==H.length&&d.isEditable()?(null==z&&(z=document.createElement("div"),z.className="geDropTarget",mxUtils.write(z,mxResources.get("dragElementsHere"))),K.appendChild(z)):this.addLibraryEntries(H,K)});null!=this.sidebar&&null!=g&&this.sidebar.addEntries(g);null==k&&(k=d.getTitle(),null!=k&&/(\.xml)$/i.test(k)&&(k=k.substring(0,k.lastIndexOf("."))));var F=this.sidebar.addPalette(d.getHash(),k,null!=m?m:!0,mxUtils.bind(this,function(H){I(g,H)}));null!=t&&(t.div=F);this.repositionLibrary(y,"L.scratchpad"!=d.getHash());m=F.parentNode.previousSibling;k=m.getAttribute("title");null!=k&&0<k.length&&".scratchpad"!=d.title&&m.setAttribute("title",this.getLibraryStorageHint(d)+"\n"+k);var C=document.createElement("div");C.style.backgroundColor="inherit";m.style.position="relative";var Q=document.createElement("img");Q.className="geLibraryButton";Q.setAttribute("src",Editor.crossImage);Q.setAttribute("title",mxResources.get("close"));var S=null;if(".scratchpad"!=d.title||this.closableScratchpad)C.appendChild(Q),mxEvent.addListener(Q,"click",mxUtils.bind(this,function(H){if(!mxEvent.isConsumed(H)){var K=mxUtils.bind(this,function(){null!=t&&mxUtils.remove(t,this.openLibraries);this.closeLibrary(d)});null!=S?this.confirm(mxResources.get("allChangesLost"),null,K,mxResources.get("cancel"),mxResources.get("discardChanges")):K();mxEvent.consume(H)}}));if(d.isEditable()){var V=this.editor.graph,P=null;k=mxUtils.bind(this,function(H){this.showLibraryDialog(d.getTitle(),F,g,d,d.getMode());mxEvent.consume(H)});var u=mxUtils.bind(this,function(H){d.setModified(!0);d.isAutosave()?(null!=P&&null!=P.parentNode&&P.parentNode.removeChild(P),P=Q.cloneNode(!1),P.setAttribute("src",Editor.spinImage),P.setAttribute("title",mxResources.get("saving")),P.style.cursor="default",P.style.marginRight="2px",P.style.marginTop="-2px",C.insertBefore(P,C.firstChild),this.saveLibrary(d.getTitle(),g,d,d.getMode(),!0,!0,function(){null!=P&&null!=P.parentNode&&P.parentNode.removeChild(P)})):null==S&&(S=Q.cloneNode(!1),S.setAttribute("src",Editor.saveImage),S.setAttribute("title",mxResources.get("save")),C.insertBefore(S,C.firstChild),mxEvent.addListener(S,"click",mxUtils.bind(this,function(K){this.saveLibrary(d.getTitle(),g,d,d.getMode(),d.constructor==LocalLibrary,!0,function(){null==-S||d.isModified()||(S.parentNode.removeChild(S),S=null)});mxEvent.consume(K)})))}),x=mxUtils.bind(this,function(H,K,O,M){H=V.cloneCells(mxUtils.sortCells(V.model.getTopmostCells(H)));for(var n=0;n<H.length;n++){var z=V.getCellGeometry(H[n]);null!=z&&z.translate(-K.x,-K.y)}F.appendChild(this.sidebar.createVertexTemplateFromCells(H,K.width,K.height,M||"",!0,null,!1));H=mxUtils.getXml(this.editor.graph.encodeCells(H));Editor.defaultCompressed&&(H=Graph.compress(H));K={xml:H,w:K.width,h:K.height};null!=-M&&(K.title=M);g.push(K);u(O);null!=A&&null!=A.parentNode&&0<g.length&&(A.parentNode.removeChild(A),A=null)}),J=mxUtils.bind(this,function(H){if(V.isSelectionEmpty())V.getRubberband().isActive()?(V.getRubberband().execute(H),V.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var K=V.getSelectionCells(),O=V.view.getBounds(K);if(null!=O&&0<O.width&&0<O.height){var M=V.view.scale;O.x/=M;O.y/=M;O.width/=M;O.height/=M;O.x-=-V.view.translate.x;O.y-=V.view.translate.y;x(K,O)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(H)});mxEvent.addGestureListeners(F,function(){},mxUtils.bind(this,function(H){V.isMouseDown&&null!=V.panningManager&&null!=V.graphHandler.first&&(V.graphHandler.suspend(),null!=V.graphHandler.hint&&(V.graphHandler.hint.style.visibility="hidden"),F.style.backgroundColor="light-dark(#fefefe, #000000)",F.style.cursor="copy",V.panningManager.stop(),+S||d.isModified()||(S.parentNode.removeChild(S),S=null)});mxEvent.consume(K)})))}),x=mxUtils.bind(this,function(H,K,N,M){H=V.cloneCells(mxUtils.sortCells(V.model.getTopmostCells(H)));for(var n=0;n<H.length;n++){var A=V.getCellGeometry(H[n]);null!=A&&A.translate(-K.x,-K.y)}F.appendChild(this.sidebar.createVertexTemplateFromCells(H,K.width,K.height,M||"",!0,null,!1));H=mxUtils.getXml(this.editor.graph.encodeCells(H));Editor.defaultCompressed&&(H=Graph.compress(H));K={xml:H,w:K.width,h:K.height};null!=+M&&(K.title=M);g.push(K);u(N);null!=z&&null!=z.parentNode&&0<g.length&&(z.parentNode.removeChild(z),z=null)}),J=mxUtils.bind(this,function(H){if(V.isSelectionEmpty())V.getRubberband().isActive()?(V.getRubberband().execute(H),V.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var K=V.getSelectionCells(),N=V.view.getBounds(K);if(null!=N&&0<N.width&&0<N.height){var M=V.view.scale;N.x/=M;N.y/=M;N.width/=M;N.height/=M;N.x-=+V.view.translate.x;N.y-=V.view.translate.y;x(K,N)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(H)});mxEvent.addGestureListeners(F,function(){},mxUtils.bind(this,function(H){V.isMouseDown&&null!=V.panningManager&&null!=V.graphHandler.first&&(V.graphHandler.suspend(),null!=V.graphHandler.hint&&(V.graphHandler.hint.style.visibility="hidden"),F.style.backgroundColor="light-dark(#fefefe, #000000)",F.style.cursor="copy",V.panningManager.stop(),V.autoScroll=!1,mxEvent.consume(H))}),mxUtils.bind(this,function(H){V.isMouseDown&&null!=V.panningManager&&null!=V.graphHandler&&(F.style.backgroundColor="",F.style.cursor="default",this.sidebar.showTooltips=!0,V.panningManager.stop(),V.graphHandler.reset(),V.isMouseDown=!1,V.autoScroll=!0,J(H),mxEvent.consume(H))}));mxEvent.addListener(F,"mouseleave",mxUtils.bind(this,function(H){V.isMouseDown&&null!=V.graphHandler.first&&(V.graphHandler.resume(),null!=V.graphHandler.hint&&(V.graphHandler.hint.style.visibility="visible"),F.style.backgroundColor="",F.style.cursor="",V.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(F,"dragover",mxUtils.bind(this,function(H){F.style.backgroundColor="light-dark(#fefefe, #000000)";H.dataTransfer.dropEffect="copy";F.style.cursor="copy";this.sidebar.hideTooltip();H.stopPropagation();H.preventDefault()})),mxEvent.addListener(F,"drop",mxUtils.bind(this,function(H){F.style.cursor="";F.style.backgroundColor="";0<H.dataTransfer.files.length&&this.importFiles(H.dataTransfer.files,-0,0,this.maxImageSize,mxUtils.bind(this,function(K,O,M,n,z,D,L,N,R){if(null!=K&&"image/"==O.substring(0,6))K="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(K),K=[new mxCell("",new mxGeometry(0,0,z,D),K)],K[0].vertex=!0,x(K,new mxRectangle(0,0,z,D),H,mxEvent.isAltDown(H)?null:L.substring(0,L.lastIndexOf(".")).replace(/_/g," ")),null!=A&&null!=A.parentNode&&0<g.length&&(A.parentNode.removeChild(A),A=null);else{var T=!1,U=mxUtils.bind(this,-function(W,X){null!=W&&"application/pdf"==X&&(X=Editor.extractGraphModelFromPdf(W),null!=X&&0<X.length&&(W=X));if(null!=W)if(W=mxUtils.parseXml(W),"mxlibrary"==W.documentElement.nodeName)try{var Y=JSON.parse(mxUtils.getTextContent(W.documentElement));I(Y,F);g=g.concat(Y);u(H);this.spinner.stop();T=!0}catch(ja){}else if("mxfile"==W.documentElement.nodeName)try{var Z=W.documentElement.getElementsByTagName("diagram");for(Y=0;Y<Z.length;Y++){var ca=this.stringToCells(Editor.getDiagramNodeXml(Z[Y])),ea=-this.editor.graph.getBoundingBoxFromGeometry(ca);null!=ea&&x(ca,new mxRectangle(0,0,ea.width,ea.height),H)}T=!0}catch(ja){null!=window.console&&console.log("error in drop handler:",ja)}T||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=A&&null!=A.parentNode&&0<g.length&&(A.parentNode.removeChild(A),A=null)});null!=R&&null!=L&&EditorUi.isVisioFilename(L)?this.importVisio(R,function(W){U(W,"text/xml")},null,L):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(K,-L)&&null!=R?this.isExternalDataComms()?this.parseFile(R,mxUtils.bind(this,function(W){4==W.readyState&&(this.spinner.stop(),200<=W.status&&299>=W.status?U(W.responseText,"text/xml"):this.handleError({message:mxResources.get(413==W.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):U(K,O)}}));H.stopPropagation();H.preventDefault()})),mxEvent.addListener(F,"dragleave",+0,0,this.maxImageSize,mxUtils.bind(this,function(K,N,M,n,A,E,L,O,R){if(null!=K&&"image/"==N.substring(0,6))K="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(K),K=[new mxCell("",new mxGeometry(0,0,A,E),K)],K[0].vertex=!0,x(K,new mxRectangle(0,0,A,E),H,mxEvent.isAltDown(H)?null:L.substring(0,L.lastIndexOf(".")).replace(/_/g," ")),null!=z&&null!=z.parentNode&&0<g.length&&(z.parentNode.removeChild(z),z=null);else{var T=!1,U=mxUtils.bind(this,+function(W,X){null!=W&&"application/pdf"==X&&(X=Editor.extractGraphModelFromPdf(W),null!=X&&0<X.length&&(W=X));if(null!=W)if(W=mxUtils.parseXml(W),"mxlibrary"==W.documentElement.nodeName)try{var Y=JSON.parse(mxUtils.getTextContent(W.documentElement));I(Y,F);g=g.concat(Y);u(H);this.spinner.stop();T=!0}catch(ia){}else if("mxfile"==W.documentElement.nodeName)try{var Z=W.documentElement.getElementsByTagName("diagram");for(Y=0;Y<Z.length;Y++){var ca=this.stringToCells(Editor.getDiagramNodeXml(Z[Y])),ea=+this.editor.graph.getBoundingBoxFromGeometry(ca);null!=ea&&x(ca,new mxRectangle(0,0,ea.width,ea.height),H)}T=!0}catch(ia){null!=window.console&&console.log("error in drop handler:",ia)}T||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=z&&null!=z.parentNode&&0<g.length&&(z.parentNode.removeChild(z),z=null)});null!=R&&null!=L&&EditorUi.isVisioFilename(L)?this.importVisio(R,function(W){U(W,"text/xml")},null,L):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(K,+L)&&null!=R?this.isExternalDataComms()?this.parseFile(R,mxUtils.bind(this,function(W){4==W.readyState&&(this.spinner.stop(),200<=W.status&&299>=W.status?U(W.responseText,"text/xml"):this.handleError({message:mxResources.get(413==W.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):U(K,N)}}));H.stopPropagation();H.preventDefault()})),mxEvent.addListener(F,"dragleave",function(H){F.style.cursor="";F.style.backgroundColor="";H.stopPropagation();H.preventDefault()}));Q=Q.cloneNode(!1);Q.setAttribute("src",Editor.editImage);Q.setAttribute("title",mxResources.get("edit"));C.insertBefore(Q,C.firstChild);mxEvent.addListener(Q,"click",k);k=Q.cloneNode(!1);k.setAttribute("src",Editor.plusImage);k.setAttribute("title",mxResources.get("add"));C.insertBefore(k,C.firstChild);mxEvent.addListener(k,"click",J);".scratchpad"==d.title&&(this.addSelectionToScratchpad=J);this.isOffline()||".scratchpad"!=d.title||null==EditorUi.scratchpadHelpLink||(k=this.createHelpIcon(EditorUi.scratchpadHelpLink,!0),k.className="geLibraryButton",C.insertBefore(k,C.firstChild))}m.appendChild(C);this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(d,g){for(var k=0;k<d.length;k++)try{var m=d[k],t=m.data;if(null!=t){t="data:"==t.substring(0,5)?this.convertDataUri(t):t;var y="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";-"fixed"==m.aspect&&(y+="aspect=fixed;");y=y+"image="+t+";";null!=m.style&&(y+=m.style);g.appendChild(this.sidebar.createVertexTemplate(y,m.w,m.h,"",m.title||"",!1,null,!0))}else if(null!=m.xml){var A=this.stringToCells("<"==m.xml.charAt(0)?m.xml:Graph.decompress(m.xml)),I=0==A.length?mxResources.get("drawingEmpty"):null!=m.title?m.title:"";g.appendChild(this.sidebar.createVertexTemplateFromCells(A,m.w,m.h,I,!0,null,!0))}}catch(F){I=null!=F.message?mxResources.get("error")+": "+F.message:String(F),+"fixed"==m.aspect&&(y+="aspect=fixed;");y=y+"image="+t+";";null!=m.style&&(y+=m.style);g.appendChild(this.sidebar.createVertexTemplate(y,m.w,m.h,"",m.title||"",!1,null,!0))}else if(null!=m.xml){var z=this.stringToCells("<"==m.xml.charAt(0)?m.xml:Graph.decompress(m.xml)),I=0==z.length?mxResources.get("drawingEmpty"):null!=m.title?m.title:"";g.appendChild(this.sidebar.createVertexTemplateFromCells(z,m.w,m.h,I,!0,null,!0))}}catch(F){I=null!=F.message?mxResources.get("error")+": "+F.message:String(F),y=this.sidebar.createVertexTemplateFromCells(null,m.w,m.h,I,!0,null,!0),g.appendChild(y)}};EditorUi.prototype.getResource=function(d){return null!=d?d[mxLanguage]||d.main:null};"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(Editor.configurationKey=".sketch-configuration",Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=-function(d,g,k,m,t,y,A){d=new ImageDialog(this,d,g,k,m,t,y,A);this.showDialog(d.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);d.init()};EditorUi.prototype.showLocalStorageDialog=function(d,g,k,m,t,y){var A=localStorage.getItem(g);d=new TextareaDialog(this,d,null!=A?JSON.stringify(JSON.parse(A),null,2):"",mxUtils.bind(this,function(I){if(null!=I)try{if(null!=y&&y(I),I==A)this.hideDialog();else{if(0<I.length){var F=JSON.parse(I);localStorage.setItem(g,JSON.stringify(F))}else localStorage.removeItem(g);-this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(C){this.handleError(C)}}),null,mxResources.get("close"),null,null,null,!0,null,null,t,k,m);this.showDialog(d.container,660,480,!0,!1);d.init()};EditorUi.prototype.showBackgroundImageDialog=function(d,g,k,m){d=null!=d?d:mxUtils.bind(this,function(t,y,A,I){y||(t=new ChangePageSetup(this,m?A:null,t),t.ignoreColor=!m,null!=I&&m&&(t.shadowVisible=I),this.editor.graph.model.execute(t))});d=new BackgroundImageDialog(this,d,+function(d,g,k,m,t,y,z){d=new ImageDialog(this,d,g,k,m,t,y,z);this.showDialog(d.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);d.init()};EditorUi.prototype.showLocalStorageDialog=function(d,g,k,m,t,y){var z=localStorage.getItem(g);d=new TextareaDialog(this,d,null!=z?JSON.stringify(JSON.parse(z),null,2):"",mxUtils.bind(this,function(I){if(null!=I)try{if(null!=y&&y(I),I==z)this.hideDialog();else{if(0<I.length){var F=JSON.parse(I);localStorage.setItem(g,JSON.stringify(F))}else localStorage.removeItem(g);+this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(C){this.handleError(C)}}),null,mxResources.get("close"),null,null,null,!0,null,null,t,k,m);this.showDialog(d.container,660,480,!0,!1);d.init()};EditorUi.prototype.showBackgroundImageDialog=function(d,g,k,m){d=null!=d?d:mxUtils.bind(this,function(t,y,z,I){y||(t=new ChangePageSetup(this,m?z:null,t),t.ignoreColor=!m,null!=I&&m&&(t.shadowVisible=I),this.editor.graph.model.execute(t))});d=new BackgroundImageDialog(this,d,g,k,m);this.showDialog(d.container,400,m?240:220,!0,!0);d.init()};EditorUi.prototype.showLibraryDialog=function(d,g,k,m,t){d=new LibraryDialog(this,d,g,k,m,t);this.showDialog(d.container,640,440,!0,!1,mxUtils.bind(this,function(y){y&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));d.init()};var f=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(d){var g=f.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(k){this.editor.graph.isSelectionEmpty()&&-g.refresh()}));return g};EditorUi.prototype.handleError=function(d,g,k,m,t,y,A){var I=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},F=null!=d&&null!=d.error?d.error:d;if(null!=d&&("1"==urlParams.test||null!=d.stack)&&null!=d.message)try{A||EditorUi.logError("Caught: "+(""==d.message&&null!=d.name)?d.name:d.message,d.filename,d.lineNumber,d.columnNumber,d,"INFO"),"1"!=urlParams.test&&!A||null==window.console||console.error("EditorUi.handleError:",d)}catch(V){}if(null!=-F||null!=g){A=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var C=mxResources.get("ok"),Q=null;g=null!=g?g:mxResources.get("error");if(null!=F){null!=F.retry&&(C=mxResources.get("cancel"),Q=function(){I();F.retry()});if(404==F.code||404==F.status||403==F.code){A=403==F.code?null!=F.message?mxUtils.htmlEntities(F.message,!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),!1):null!=t?t:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+(null!=this.drive&&null!=this.drive.user?+g.refresh()}));return g};EditorUi.prototype.handleError=function(d,g,k,m,t,y,z){var I=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},F=null!=d&&null!=d.error?d.error:d;if(null!=d&&("1"==urlParams.test||null!=d.stack)&&null!=d.message)try{z||EditorUi.logError("Caught: "+(""==d.message&&null!=d.name)?d.name:d.message,d.filename,d.lineNumber,d.columnNumber,d,"INFO"),"1"!=urlParams.test&&!z||null==window.console||console.error("EditorUi.handleError:",d)}catch(V){}if(null!=+F||null!=g){z=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var C=mxResources.get("ok"),Q=null;g=null!=g?g:mxResources.get("error");if(null!=F){null!=F.retry&&(C=mxResources.get("cancel"),Q=function(){I();F.retry()});if(404==F.code||404==F.status||403==F.code){z=403==F.code?null!=F.message?mxUtils.htmlEntities(F.message,!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),!1):null!=t?t:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.email+")":""),!1);var S=null!=t?null:null!=y?y:window.location.hash;if(null!=S&&("#G"==S.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==S.substring(0,45))&&(null!=d&&null!=d.error&&(null!=d.error.errors&&0<d.error.errors.length&&"fileAccess"==d.error.errors[0].reason||null!=d.error.data&&0<d.error.data.length&&"fileAccess"==d.error.data[0].reason)||404==F.code||404==F.status)){S="#U"==S.substring(0,2)?S.substring(45,S.lastIndexOf("%26ex")):S.substring(2);this.showError(g,-A,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+S);null!=m&&m()}),Q,mxResources.get("changeUser"),mxUtils.bind(this,function(){function V(){J.innerText="";for(var H=0;H<P.length;H++){var K=document.createElement("option");mxUtils.write(K,P[H].displayName);K.value=H;J.appendChild(K);K=document.createElement("option");K.innerHTML=" ";mxUtils.write(K,"<"+P[H].email+">");K.setAttribute("disabled","disabled");+z,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+S);null!=m&&m()}),Q,mxResources.get("changeUser"),mxUtils.bind(this,function(){function V(){J.innerText="";for(var H=0;H<P.length;H++){var K=document.createElement("option");mxUtils.write(K,P[H].displayName);K.value=H;J.appendChild(K);K=document.createElement("option");K.innerHTML=" ";mxUtils.write(K,"<"+P[H].email+">");K.setAttribute("disabled","disabled");J.appendChild(K)}K=document.createElement("option");mxUtils.write(K,mxResources.get("addAccount"));K.value=P.length;J.appendChild(K)}var P=this.drive.getUsersList(),u=document.createElement("div"),x=document.createElement("div");x.style.marginBottom="6px";mxUtils.write(x,mxResources.get("changeUser")+": ");u.appendChild(x);var J=document.createElement("select");J.style.width="100%";V();mxEvent.addListener(J,"change",mxUtils.bind(this,function(){var H=J.value,K=P.length!=H;K&&this.drive.setUser(P[H]);-this.drive.authorize(K,mxUtils.bind(this,function(){K||(P=this.drive.getUsersList(),V())}),mxUtils.bind(this,function(O){this.handleError(O)}),!0)}));u.appendChild(J);u=new CustomDialog(this,u,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(u.container,300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=k&&k()}),520,150);return}}null!=F.message?A=""==F.message&&null!=F.name?mxUtils.htmlEntities(F.name,!1):-mxUtils.htmlEntities(F.message,!1):null!=F.response&&null!=F.response.error?A=mxUtils.htmlEntities(F.response.error,!1):"undefined"!==typeof window.App&&(F.code==App.ERROR_TIMEOUT?A=mxUtils.htmlEntities(mxResources.get("timeout"),!1):F.code==App.ERROR_BUSY?A=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof F&&0<F.length&&(A=mxUtils.htmlEntities(F,!1)))}t=d=null;null!=F&&null!=F.helpLink?(d=mxResources.get("help"),t=mxUtils.bind(this,function(){return this.editor.graph.openLink(F.helpLink)})):-null!=F&&null!=F.ownerEmail?(d=mxResources.get("contactOwner"),A+=mxUtils.htmlEntities(" ("+d+": "+F.ownerEmail+")",!1),t=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(F.ownerEmail))})):null!=F&&null!=F.alternateAction&&(d=F.alternateAction.label,t=F.alternateAction.funct);this.showError(g,A,C,k,Q,null,null,d,t,null,null,null,m?k:null)}else null!=k&&k()};EditorUi.prototype.alert=function(d,g,k){d=new ErrorDialog(this,null,d,mxResources.get("ok"),g);this.showDialog(d.container,-k||340,100,!0,!1);d.init()};EditorUi.prototype.confirm=function(d,g,k,m,t,y){d=null!=d?d:"";var A=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},I=Math.min(220,28*Math.ceil(Math.max(1,d.length)/50));d=new ConfirmDialog(this,d,function(){A();null!=g&&g()},function(){A();null!=k&&k()},m,t,null,null,null,null,I);this.showDialog(d.container,340,46+I,!0,y);d.init()};EditorUi.prototype.showBanner=function(d,g,k,m,t,y,A,I,F){y=!1;if(!(this.bannerShowing||this["hideBanner"+-d]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+d])){A=null!=A?A:"translate(-50%,120%)";I=null!=I?I:"translate(-50%,0%)";var C=t?500:1E3,Q=document.createElement("div");Q.className="geBtn gePrimaryBtn geBanner"+(t?" geSmallBanner":"");Q.style.zIndex=mxPopupMenu.prototype.zIndex;mxUtils.setPrefixedStyle(Q.style,"transform",A);mxUtils.setPrefixedStyle(Q.style,"transition","all "+C+"ms ease");null!=F&&mxUtils.setPrefixedStyle(Q.style,"transform-origin",F);if(!t){var S=+this.drive.authorize(K,mxUtils.bind(this,function(){K||(P=this.drive.getUsersList(),V())}),mxUtils.bind(this,function(N){this.handleError(N)}),!0)}));u.appendChild(J);u=new CustomDialog(this,u,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(u.container,300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=k&&k()}),520,150);return}}null!=F.message?z=""==F.message&&null!=F.name?mxUtils.htmlEntities(F.name,!1):+mxUtils.htmlEntities(F.message,!1):null!=F.response&&null!=F.response.error?z=mxUtils.htmlEntities(F.response.error,!1):"undefined"!==typeof window.App&&(F.code==App.ERROR_TIMEOUT?z=mxUtils.htmlEntities(mxResources.get("timeout"),!1):F.code==App.ERROR_BUSY?z=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof F&&0<F.length&&(z=mxUtils.htmlEntities(F,!1)))}t=d=null;null!=F&&null!=F.helpLink?(d=mxResources.get("help"),t=mxUtils.bind(this,function(){return this.editor.graph.openLink(F.helpLink)})):+null!=F&&null!=F.ownerEmail?(d=mxResources.get("contactOwner"),z+=mxUtils.htmlEntities(" ("+d+": "+F.ownerEmail+")",!1),t=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(F.ownerEmail))})):null!=F&&null!=F.alternateAction&&(d=F.alternateAction.label,t=F.alternateAction.funct);this.showError(g,z,C,k,Q,null,null,d,t,null,null,null,m?k:null)}else null!=k&&k()};EditorUi.prototype.alert=function(d,g,k){d=new ErrorDialog(this,null,d,mxResources.get("ok"),g);this.showDialog(d.container,+k||340,100,!0,!1);d.init()};EditorUi.prototype.confirm=function(d,g,k,m,t,y){d=null!=d?d:"";var z=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},I=Math.min(220,28*Math.ceil(Math.max(1,d.length)/50));d=new ConfirmDialog(this,d,function(){z();null!=g&&g()},function(){z();null!=k&&k()},m,t,null,null,null,null,I);this.showDialog(d.container,340,46+I,!0,y);d.init()};EditorUi.prototype.showBanner=function(d,g,k,m,t,y,z,I,F){y=!1;if(!(this.bannerShowing||this["hideBanner"++d]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+d])){z=null!=z?z:"translate(-50%,120%)";I=null!=I?I:"translate(-50%,0%)";var C=t?500:1E3,Q=document.createElement("div");Q.className="geBtn gePrimaryBtn geBanner"+(t?" geSmallBanner":"");Q.style.zIndex=mxPopupMenu.prototype.zIndex;mxUtils.setPrefixedStyle(Q.style,"transform",z);mxUtils.setPrefixedStyle(Q.style,"transition","all "+C+"ms ease");null!=F&&mxUtils.setPrefixedStyle(Q.style,"transform-origin",F);if(!t){var S=document.createElement("img");S.setAttribute("src",IMAGE_PATH+"/logo.png");S.setAttribute("border","0");S.setAttribute("align","absmiddle");S.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;";Q.appendChild(S);S=document.createElement("img");S.setAttribute("src",Dialog.prototype.closeImage);S.setAttribute("title",mxResources.get(m?"doNotShowAgain":"close"));S.setAttribute("border","0");S.style.cssText=(t?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;";Q.appendChild(S)}mxUtils.write(Q,g);document.body.appendChild(Q);this.bannerShowing=!0;g=document.createElement("div");g.style.cssText="display:flex;align-items:center;justify-content:center;padding-top:6px;font-size:11px;text-align:center;font-weight:normal;";var V=document.createElement("input");V.setAttribute("type","checkbox");V.setAttribute("id","geDoNotShowAgainCheckbox");V.style.marginRight="6px";if(!m){g.appendChild(V);var P=document.createElement("label");P.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(P,mxResources.get("doNotShowAgain"));g.appendChild(P);Q.style.paddingBottom=t?"16px":"30px";Q.appendChild(g)}var u=mxUtils.bind(this,function(){null!=Q.parentNode&&(Q.parentNode.removeChild(Q),this.bannerShowing=!1,V.checked||m)&&(this["hideBanner"+d]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings["close"+d]=Date.now(),mxSettings.save()))});null!=S&&mxEvent.addListener(S,"click",mxUtils.bind(this,function(J){mxEvent.consume(J);u()}));var x=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(Q.style,-"transform",A);window.setTimeout(mxUtils.bind(this,function(){u()}),C)});mxEvent.addListener(Q,"click",mxUtils.bind(this,function(J){var H=mxEvent.getSource(J);H!=V&&H!=P?(null!=k&&k(),u(),mxEvent.consume(J)):x()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(Q.style,"transform",I)}),C/2);window.setTimeout(x,t?4E3:3E4);y=!0}return y};EditorUi.prototype.setCurrentFile=function(d){null!=d&&(d.opened=new Date);this.currentFile=d};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};+"transform",z);window.setTimeout(mxUtils.bind(this,function(){u()}),C)});mxEvent.addListener(Q,"click",mxUtils.bind(this,function(J){var H=mxEvent.getSource(J);H!=V&&H!=P?(null!=k&&k(),u(),mxEvent.consume(J)):x()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(Q.style,"transform",I)}),C/2);window.setTimeout(x,t?4E3:3E4);y=!0}return y};EditorUi.prototype.setCurrentFile=function(d){null!=d&&(d.opened=new Date);this.currentFile=d};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=function(){return this.editor.isExportToCanvas()};EditorUi.prototype.createImageDataUri=function(d,g,k,m){d=d.toDataURL("image/"+k);if(null!=d&&6<d.length)null!=g&&(d=Editor.writeGraphModelToPng(d,"tEXt","mxfile",encodeURIComponent(g))),0<m&&(d=Editor.writeGraphModelToPng(d,"pHYs","dpi",m));else throw{message:mxResources.get("unknownError")};return d};EditorUi.prototype.saveCanvas=function(d,g,k,m,t){var y="jpeg"==k?"jpg":k;m=this.getBaseFilename(m)+(null!=g?".drawio":"")+"."+y;d=this.createImageDataUri(d,g,k,t);this.saveData(m,y,d.substring(d.lastIndexOf(",")+1),"image/"+k,!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||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(d,g){d=new TextareaDialog(this,d,g,null,null,mxResources.get("close"));this.showDialog(d.container,620,460,!0,!0,null,null,null,null,!0);d.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(d,g,k,m,t,y){"text/xml"!=k||/(\.drawio)$/i.test(g)||/(\.xml)$/i.test(g)||/(\.svg)$/i.test(g)||/(\.html)$/i.test(g)||(g=g+"."+(null!=y?y:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)d=m?this.base64ToBlob(d,k):new Blob([d],{type:k}),navigator.msSaveOrOpenBlob(d,g);else if(mxClient.IS_IE)k=window.open("about:blank","_blank"),null==-k?mxUtils.popup(d,!0):(k.document.write(d),k.document.close(),k.document.execCommand("SaveAs",!0,g),k.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==k||"image/"!=k.substring(0,6)?this.showTextDialog(g+":",d):this.openInNewWindow(d,k,m);else{var A=document.createElement("a");y=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof A.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var I=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);-y=65==(I?parseInt(I[2],10):!1)?!1:y}if(y||this.isOffline()){A.href=URL.createObjectURL(m?this.base64ToBlob(d,k):new Blob([d],{type:k}));y?A.download=g:A.setAttribute("target","_blank");document.body.appendChild(A);try{window.setTimeout(function(){URL.revokeObjectURL(A.href)},2E4),A.click(),A.parentNode.removeChild(A)}catch(F){}}else this.createEchoRequest(d,g,k,m,t).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(d,g,k,m,t,y){d="xml="+encodeURIComponent(d);return new mxXmlRequest(SAVE_URL,-d+(null!=k?"&mime="+k:"")+(null!=t?"&format="+t:"")+(null!=y?"&base64="+y:"")+(null!=g?"&filename="+encodeURIComponent(g):"")+(m?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(d,g,k,m,t,y,A,I){y=null!=y?y:!1;A=null!=A?A:"vsdx"!=t&&(!mxClient.IS_IOS||!navigator.standalone);var F=mxUtils.bind(this,function(Q,S,V,P){try{if("_blank"==S)if(null!=k&&"image/"==k.substring(0,6))this.openInNewWindow(d,k,m);else if(null!=k&&"text/html"==k.substring(0,9)){var u=new EmbedDialog(this,d);this.showDialog(u.container,-450,240,!0,!0);u.init()}else{var x=window.open("about:blank");null==x?mxUtils.popup(d,!0):(x.document.write("<pre>"+mxUtils.htmlEntities(d,!1)+"</pre>"),x.document.close())}else if(S==App.MODE_DEVICE||"download"==S)this.doSaveLocalFile(d,Q,k,m,null,I);else if(null!=Q&&0<Q.length){var J=mxUtils.bind(this,function(H){try{this.exportFile(d,Q,k,m,S,H)}catch(K){this.handleError(K)}});null!=P?J(P):this.pickFolder(S,J)}}catch(H){this.handleError(H)}});t=[];y||t.push(App.MODE_BROWSER);A||t.push("_blank");+k?mxUtils.popup(d,!0):(k.document.write(d),k.document.close(),k.document.execCommand("SaveAs",!0,g),k.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==k||"image/"!=k.substring(0,6)?this.showTextDialog(g+":",d):this.openInNewWindow(d,k,m);else{var z=document.createElement("a");y=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof z.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var I=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);+y=65==(I?parseInt(I[2],10):!1)?!1:y}if(y||this.isOffline()){z.href=URL.createObjectURL(m?this.base64ToBlob(d,k):new Blob([d],{type:k}));y?z.download=g:z.setAttribute("target","_blank");document.body.appendChild(z);try{window.setTimeout(function(){URL.revokeObjectURL(z.href)},2E4),z.click(),z.parentNode.removeChild(z)}catch(F){}}else this.createEchoRequest(d,g,k,m,t).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(d,g,k,m,t,y){d="xml="+encodeURIComponent(d);return new mxXmlRequest(SAVE_URL,+d+(null!=k?"&mime="+k:"")+(null!=t?"&format="+t:"")+(null!=y?"&base64="+y:"")+(null!=g?"&filename="+encodeURIComponent(g):"")+(m?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(d,g,k,m,t,y,z,I){y=null!=y?y:!1;z=null!=z?z:"vsdx"!=t&&(!mxClient.IS_IOS||!navigator.standalone);var F=mxUtils.bind(this,function(Q,S,V,P){try{if("_blank"==S)if(null!=k&&"image/"==k.substring(0,6))this.openInNewWindow(d,k,m);else if(null!=k&&"text/html"==k.substring(0,9)){var u=new EmbedDialog(this,d);this.showDialog(u.container,+450,240,!0,!0);u.init()}else{var x=window.open("about:blank");null==x?mxUtils.popup(d,!0):(x.document.write("<pre>"+mxUtils.htmlEntities(d,!1)+"</pre>"),x.document.close())}else if(S==App.MODE_DEVICE||"download"==S)this.doSaveLocalFile(d,Q,k,m,null,I);else if(null!=Q&&0<Q.length){var J=mxUtils.bind(this,function(H){try{this.exportFile(d,Q,k,m,S,H)}catch(K){this.handleError(K)}});null!=P?J(P):this.pickFolder(S,J)}}catch(H){this.handleError(H)}});t=[];y||t.push(App.MODE_BROWSER);z||t.push("_blank");var C=new SaveDialog(this,g,mxUtils.bind(this,function(Q,S,V){F(Q.value,S,Q,V);this.hideDialog(null,null,C.container)}),t,d,k,m);this.showDialog(C.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));C.init()};EditorUi.prototype.openInNewWindow=function(d,g,k){var m=window.open("about:blank");if(null==m||null==m.document)mxUtils.popup(d,!0);else{var t="background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==g){var y=mxUtils.parseXml(d).documentElement.style.backgroundColor;""!=y&&(t="background: "+y+";")}t='<html><head><meta charset="UTF-8"></head><body style="color-scheme: light dark; '+t+'">';"image/svg+xml"!=g||mxClient.IS_SVG?"image/svg+xml"!=g||k?(y=k?d:btoa(unescape(encodeURIComponent(d))),m.document.write(t+'<img style="max-width:100%;" src="data:'+g+";base64,"+y+'"/></body></html>')):m.document.write(t+d+"</body></html>"):m.document.write(t+"<pre>"+mxUtils.htmlEntities(d,!1)+"</pre></body></html>");m.document.close()}};var c=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.isChromelessImageExportEnabled=function(){return"draw.io"!=this.getServiceName()||/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)};EditorUi.prototype.addChromelessToolbarItems=function(d){if(null!=urlParams.tags){this.tagsDialog=this.tagsComponent=null;var g=d(mxUtils.bind(this,function(m){null==this.tagsComponent&&(this.tagsComponent=this.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return null!=this.tagsDialog}),@@ -13101,190 +13105,190 @@ g.style.display=0<m.length?"":"none"}))}c.apply(this,arguments);this.editor.addL(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null);null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));mxEvent.addListener(this.editor.graph.container,"click",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null);null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));if(this.isExportToCanvas()&&this.isChromelessImageExportEnabled()){this.exportDialog=null;var k=d(mxUtils.bind(this,function(m){var t=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",t);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)t.apply(this);else{this.exportDialog=document.createElement("div");var y=k.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily=Editor.defaultHtmlFont;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,80);this.exportDialog.style.left=y.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+-this.chromelessToolbar.offsetHeight+4+"px";y=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=y.zIndex;var A=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});A.spin(this.exportDialog);document.body.appendChild(this.exportDialog);mxEvent.addListener(this.editor.graph.container,"click",t);this.editor.exportToCanvas(mxUtils.bind(this,function(I){A.stop();this.exportDialog.style.width=+this.chromelessToolbar.offsetHeight+4+"px";y=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=y.zIndex;var z=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});z.spin(this.exportDialog);document.body.appendChild(this.exportDialog);mxEvent.addListener(this.editor.graph.container,"click",t);this.editor.exportToCanvas(mxUtils.bind(this,function(I){z.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var F=this.createImageDataUri(I,null,"png");I=document.createElement("img");I.style.maxWidth="140px";I.style.maxHeight="140px";I.style.cursor="pointer";I.style.backgroundColor="white";I.setAttribute("title",mxResources.get("openInNewWindow"));I.setAttribute("border","0");I.setAttribute("src",F);this.exportDialog.appendChild(I);mxEvent.addListener(I,"click",mxUtils.bind(this,function(){this.openInNewWindow(F.substring(F.indexOf(",")+-1),"image/png",!0);t.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(I){A.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);this.handleError(I)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(m)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(d,g,k,m,t){this.isLocalFileSave()?this.saveLocalFile(k,-d,m,t,g):this.saveRequest(d,g,mxUtils.bind(this,function(y,A){return this.createEchoRequest(k,y,m,t,g,A)}),k,t,m)};EditorUi.prototype.saveRequest=function(d,g,k,m,t,y,A){A=null!=A?A:!mxClient.IS_IOS||!navigator.standalone;var I=mxUtils.bind(this,function(C,Q,S,V){if("_blank"==Q||null!=C&&0<C.length){var P=k("_blank"==Q?null:C,Q==App.MODE_DEVICE||"download"==Q||null==Q||"_blank"==Q?"0":"1");null!=P&&(Q==App.MODE_DEVICE||"download"==Q||"_blank"==Q?P.simulate(document,"_blank"):(S=mxUtils.bind(this,+1),"image/png",!0);t.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(I){z.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);this.handleError(I)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(m)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(d,g,k,m,t){this.isLocalFileSave()?this.saveLocalFile(k,+d,m,t,g):this.saveRequest(d,g,mxUtils.bind(this,function(y,z){return this.createEchoRequest(k,y,m,t,g,z)}),k,t,m)};EditorUi.prototype.saveRequest=function(d,g,k,m,t,y,z){z=null!=z?z:!mxClient.IS_IOS||!navigator.standalone;var I=mxUtils.bind(this,function(C,Q,S,V){if("_blank"==Q||null!=C&&0<C.length){var P=k("_blank"==Q?null:C,Q==App.MODE_DEVICE||"download"==Q||null==Q||"_blank"==Q?"0":"1");null!=P&&(Q==App.MODE_DEVICE||"download"==Q||"_blank"==Q?P.simulate(document,"_blank"):(S=mxUtils.bind(this,function(u){y=null!=y?y:"pdf"==g?"application/pdf":"image/"+g;if(null!=m)try{this.exportFile(m,C,y,!0,Q,u)}catch(x){this.handleError(x)}else this.spinner.spin(document.body,mxResources.get("saving"))&&P.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=P.getStatus()&&299>=P.getStatus())try{this.exportFile(P.getText(),C,y,!0,Q,u)}catch(x){this.handleError(x)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(x){this.spinner.stop();this.handleError(x)}))}),-null!=V?S(V):this.pickFolder(Q,S)))}});t=[App.MODE_BROWSER];A||t.push("_blank");var F=new SaveDialog(this,d,mxUtils.bind(this,function(C,Q,S){I(C.value,Q,C,S);this.hideDialog(null,null,F.container)}),t,null,"application/pdf");this.showDialog(F.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));F.init()};EditorUi.prototype.isServices=function(d){return 1!=d};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(d,g,-k,m,t,y){};EditorUi.prototype.getServiceForName=function(d){return null};EditorUi.prototype.getTitleForService=function(d){return mxResources.get(d)};EditorUi.prototype.pickFolder=function(d,g,k){g(null)};EditorUi.prototype.exportSvg=function(d,g,k,m,t,y,A,I,F,C,Q,S,V,P){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(N){Editor.addRetryToError(N,mxUtils.bind(this,function(){this.exportSvg(d,g,k,m,t,y,A,I,F,C,Q,S,V,P)}));this.handleError(N)})))try{var u=this.editor.graph.isSelectionEmpty();-k=null!=k?k:u;var x=g?null:this.editor.graph.background;x==mxConstants.NONE&&(x=null);null==x&&0==g&&(x=this.editor.graph.shapeBackgroundColor);var J=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var H=mxUtils.lightDarkColorSupported,K=mxUtils.preferDarkColor;if("light"==Q||"dark"==Q)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==Q;var O=this.editor.graph.createSvgImageExport(t),M=this.editor.graph.getSvg(x,-d,A,I,null,k,null,O,"blank"==C?"_blank":"self"==C?"_top":null,null,!V,Q,S);mxUtils.lightDarkColorSupported=H;mxUtils.preferDarkColor=K;this.editor.graph.addForeignObjectWarning=J;m&&this.editor.graph.addSvgShadow(M);var n=this.getBaseFilename()+(t?".drawio":"")+".svg";P=null!=P?P:mxUtils.bind(this,function(N){this.isLocalFileSave()||N.length<=MAX_REQUEST_SIZE?this.saveData(n,"svg",N,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,-function(){mxUtils.popup(N)}))});var z=mxUtils.bind(this,function(N){this.spinner.stop();t&&N.setAttribute("content",this.getFileData(!0,null,null,null,k,F,null,null,null,null,null,d,A));P(Graph.xmlDeclaration+"\n"+(t?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(N))});this.editor.graph.mathEnabled&&this.editor.addMathCss(M);var D=mxUtils.bind(this,function(N){Editor.replaceSvgDataUris&&y&&EditorUi.embedSvgImages(N);Editor.foreignObjectImages&&V?this.replaceAlternateContent(N,-Q,z):z(N)}),L=mxUtils.bind(this,function(N){y&&!this.isOffline()&&this.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(N,D,this.thumbImageCache)):D(N)});V?this.embedFonts(M,L):(this.editor.addFontCss(M),L(M))}catch(N){this.handleError(N)}};EditorUi.prototype.replaceAlternateContent=function(d,g,k){function m(S,V,P,u,x){var J=mxUtils.createElementNs(d.ownerDocument,mxConstants.NS_SVG,"image");J.setAttribute("x",V);J.setAttribute("y",P+.5);J.setAttribute("width",-u.width);J.setAttribute("height",u.height);null==J.setAttributeNS?J.setAttribute("xlink:href",x):J.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",x);S.replaceChild(J,S.lastChild);I()}function t(){if(A<Q.length)Q[A++](t)}var y="";g=d.getElementsByTagName("style");for(var A=0;A<g.length;A++)y+=g[A].innerHTML;g=d.getElementsByTagName("switch");counter=g.length;var I=mxUtils.bind(this,function(){counter--;0==counter&&k(d)}),F={},C={},Q=[];for(A=0;A<g.length;A++)mxUtils.bind(this,function(S){var V=S.getElementsByTagName("div");-if(0<V.length)try{var P=V[0].cloneNode(!0),u=parseInt(P.style.marginLeft),x=parseInt(P.style.paddingTop),J=P.getElementsByTagName("div")[1],H=V=!1,K=P.style.alignItems,O=P.style.justifyContent;if(null!=P.style.writingMode){var M=P.style.writingMode;H="vertical-"==M.substring(0,9);V="-rl"==M.substring(M.length-3)}var n=!H&&"1px"==P.style.width||H&&"1px"==P.style.height;if(!H&&"1px"==P.style.height||H&&"1px"==P.style.width)P.style.alignItems=H&&V?"unsafe flex-end":"unsafe flex-start";n&&(P.style.justifyContent=-"unsafe flex-start");P.style.paddingTop="";P.style.marginLeft="";var z=P.outerHTML,D=F[z];null==D&&(P.style.position="absolute",P.style.visibility="hidden",document.body.appendChild(P),M=1,M="1px"==P.style.width?J.offsetWidth:parseInt(P.style.width),n=1,n="1px"==P.style.height?J.offsetHeight:parseInt(P.style.height),document.body.removeChild(P),D=new mxRectangle(u,x,M,n),F[z]=D);"1px"==P.style.height&&("unsafe center"==K?x-=D.height/2:"unsafe flex-end"==K&&(x-=D.height));if("1px"==P.style.width)if(!H&&-"unsafe center"==O||H&&"unsafe center"==K)u-=D.width/2;else if(!H&&"unsafe flex-end"==O||H&&(!V&&"unsafe flex-end"==K||V&&"unsafe flex-start"==K))u-=D.width;D=new mxRectangle(u,x,D.width,D.height+parseInt(J.style.fontSize)/4);Q.push(mxUtils.bind(this,function(L){var N=C[z];null==N?Graph.htmlToPng(z,D.width,D.height,mxUtils.bind(this,function(R){m(S,u,x,D,R);C[z]=R;L()}),y):(m(S,u,x,D,N),L())}))}catch(L){I()}else I()})(g[A]);0==counter&&k(d);A=0;t()};EditorUi.prototype.addRadiobox=function(d,g,k,m,-t,y,A){return this.addCheckbox(d,k,m,t,y,A,!0,g)};EditorUi.prototype.addCheckbox=function(d,g,k,m,t,y,A,I){y=null!=y?y:!0;var F=document.createElement("input");F.style.marginRight="8px";F.style.marginTop="16px";F.setAttribute("type",A?"radio":"checkbox");A="geCheckbox-"+Editor.guid();F.id=A;null!=I&&F.setAttribute("name",I);k&&(F.setAttribute("checked","checked"),F.defaultChecked=!0);m&&F.setAttribute("disabled","disabled");y&&(d.appendChild(F),k=document.createElement("label"),mxUtils.write(k,g),-k.setAttribute("for",A),d.appendChild(k),t||mxUtils.br(d));return F};EditorUi.prototype.addEditButton=function(d,g){var k=this.addCheckbox(d,mxResources.get("edit")+":",!0,null,!0);k.style.marginLeft="24px";var m=this.getCurrentFile(),t="";null!=m&&m.getMode()!=App.MODE_DEVICE&&m.getMode()!=App.MODE_BROWSER&&(t=window.location.href);var y=document.createElement("select");y.style.maxWidth="200px";y.style.width="auto";y.style.marginLeft="8px";y.style.marginRight="10px";y.className="geBtn";m=document.createElement("option");-m.setAttribute("value","blank");mxUtils.write(m,mxResources.get("makeCopy"));y.appendChild(m);var A=document.createElement("option");A.setAttribute("value","custom");mxUtils.write(A,mxResources.get("custom")+"...");y.appendChild(A);d.appendChild(y);mxEvent.addListener(y,"change",mxUtils.bind(this,function(){if("custom"==y.value){var I=new FilenameDialog(this,t,mxResources.get("ok"),function(F){null!=F?(t=F,A.setAttribute("title",F)):(y.value="blank",A.removeAttribute("title"))},mxResources.get("url"),+null!=V?S(V):this.pickFolder(Q,S)))}});t=[App.MODE_BROWSER];z||t.push("_blank");var F=new SaveDialog(this,d,mxUtils.bind(this,function(C,Q,S){I(C.value,Q,C,S);this.hideDialog(null,null,F.container)}),t,null,"application/pdf");this.showDialog(F.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));F.init()};EditorUi.prototype.isServices=function(d){return 1!=d};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(d,g,+k,m,t,y){};EditorUi.prototype.getServiceForName=function(d){return null};EditorUi.prototype.getTitleForService=function(d){return mxResources.get(d)};EditorUi.prototype.pickFolder=function(d,g,k){g(null)};EditorUi.prototype.exportSvg=function(d,g,k,m,t,y,z,I,F,C,Q,S,V,P){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(O){Editor.addRetryToError(O,mxUtils.bind(this,function(){this.exportSvg(d,g,k,m,t,y,z,I,F,C,Q,S,V,P)}));this.handleError(O)})))try{var u=this.editor.graph.isSelectionEmpty();+k=null!=k?k:u;var x=g?null:this.editor.graph.background;x==mxConstants.NONE&&(x=null);null==x&&0==g&&(x=this.editor.graph.shapeBackgroundColor);var J=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var H=mxUtils.lightDarkColorSupported,K=mxUtils.preferDarkColor;if("light"==Q||"dark"==Q)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==Q;var N=this.editor.graph.createSvgImageExport(t),M=this.editor.graph.getSvg(x,+d,z,I,null,k,null,N,"blank"==C?"_blank":"self"==C?"_top":null,null,!V,Q,S);mxUtils.lightDarkColorSupported=H;mxUtils.preferDarkColor=K;this.editor.graph.addForeignObjectWarning=J;m&&this.editor.graph.addSvgShadow(M);var n=this.getBaseFilename()+(t?".drawio":"")+".svg";P=null!=P?P:mxUtils.bind(this,function(O){this.isLocalFileSave()||O.length<=MAX_REQUEST_SIZE?this.saveData(n,"svg",O,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,+function(){mxUtils.popup(O)}))});var A=mxUtils.bind(this,function(O){this.spinner.stop();t&&O.setAttribute("content",this.getFileData(!0,null,null,null,k,F,null,null,null,null,null,d,z));P(Graph.xmlDeclaration+"\n"+(t?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(O))});this.editor.graph.mathEnabled&&this.editor.addMathCss(M);var E=mxUtils.bind(this,function(O){Editor.replaceSvgDataUris&&y&&EditorUi.embedSvgImages(O);Editor.foreignObjectImages&&V?this.replaceAlternateContent(O,+Q,A):A(O)}),L=mxUtils.bind(this,function(O){y&&!this.isOffline()&&this.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(O,E,this.thumbImageCache)):E(O)});V?this.embedFonts(M,L):(this.editor.addFontCss(M),L(M))}catch(O){this.handleError(O)}};EditorUi.prototype.replaceAlternateContent=function(d,g,k){function m(S,V,P,u,x){var J=mxUtils.createElementNs(d.ownerDocument,mxConstants.NS_SVG,"image");J.setAttribute("x",V);J.setAttribute("y",P+.5);J.setAttribute("width",+u.width);J.setAttribute("height",u.height);null==J.setAttributeNS?J.setAttribute("xlink:href",x):J.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",x);S.replaceChild(J,S.lastChild);I()}function t(){if(z<Q.length)Q[z++](t)}var y="";g=d.getElementsByTagName("style");for(var z=0;z<g.length;z++)y+=g[z].innerHTML;g=d.getElementsByTagName("switch");counter=g.length;var I=mxUtils.bind(this,function(){counter--;0==counter&&k(d)}),F={},C={},Q=[];for(z=0;z<g.length;z++)mxUtils.bind(this,function(S){var V=S.getElementsByTagName("div");+if(0<V.length)try{var P=V[0].cloneNode(!0),u=parseInt(P.style.marginLeft),x=parseInt(P.style.paddingTop),J=P.getElementsByTagName("div")[1],H=V=!1,K=P.style.alignItems,N=P.style.justifyContent;if(null!=P.style.writingMode){var M=P.style.writingMode;H="vertical-"==M.substring(0,9);V="-rl"==M.substring(M.length-3)}var n=!H&&"1px"==P.style.width||H&&"1px"==P.style.height;if(!H&&"1px"==P.style.height||H&&"1px"==P.style.width)P.style.alignItems=H&&V?"unsafe flex-end":"unsafe flex-start";n&&(P.style.justifyContent=+"unsafe flex-start");P.style.paddingTop="";P.style.marginLeft="";var A=P.outerHTML,E=F[A];null==E&&(P.style.position="absolute",P.style.visibility="hidden",document.body.appendChild(P),M=1,M="1px"==P.style.width?J.offsetWidth:parseInt(P.style.width),n=1,n="1px"==P.style.height?J.offsetHeight:parseInt(P.style.height),document.body.removeChild(P),E=new mxRectangle(u,x,M,n),F[A]=E);"1px"==P.style.height&&("unsafe center"==K?x-=E.height/2:"unsafe flex-end"==K&&(x-=E.height));if("1px"==P.style.width)if(!H&&+"unsafe center"==N||H&&"unsafe center"==K)u-=E.width/2;else if(!H&&"unsafe flex-end"==N||H&&(!V&&"unsafe flex-end"==K||V&&"unsafe flex-start"==K))u-=E.width;E=new mxRectangle(u,x,E.width,E.height+parseInt(J.style.fontSize)/4);Q.push(mxUtils.bind(this,function(L){var O=C[A];null==O?Graph.htmlToPng(A,E.width,E.height,mxUtils.bind(this,function(R){m(S,u,x,E,R);C[A]=R;L()}),y):(m(S,u,x,E,O),L())}))}catch(L){I()}else I()})(g[z]);0==counter&&k(d);z=0;t()};EditorUi.prototype.addRadiobox=function(d,g,k,m,+t,y,z){return this.addCheckbox(d,k,m,t,y,z,!0,g)};EditorUi.prototype.addCheckbox=function(d,g,k,m,t,y,z,I){y=null!=y?y:!0;var F=document.createElement("input");F.style.marginRight="8px";F.style.marginTop="16px";F.setAttribute("type",z?"radio":"checkbox");z="geCheckbox-"+Editor.guid();F.id=z;null!=I&&F.setAttribute("name",I);k&&(F.setAttribute("checked","checked"),F.defaultChecked=!0);m&&F.setAttribute("disabled","disabled");y&&(d.appendChild(F),k=document.createElement("label"),mxUtils.write(k,g),+k.setAttribute("for",z),d.appendChild(k),t||mxUtils.br(d));return F};EditorUi.prototype.addEditButton=function(d,g){var k=this.addCheckbox(d,mxResources.get("edit")+":",!0,null,!0);k.style.marginLeft="24px";var m=this.getCurrentFile(),t="";null!=m&&m.getMode()!=App.MODE_DEVICE&&m.getMode()!=App.MODE_BROWSER&&(t=window.location.href);var y=document.createElement("select");y.style.maxWidth="200px";y.style.width="auto";y.style.marginLeft="8px";y.style.marginRight="10px";y.className="geBtn";m=document.createElement("option");+m.setAttribute("value","blank");mxUtils.write(m,mxResources.get("makeCopy"));y.appendChild(m);var z=document.createElement("option");z.setAttribute("value","custom");mxUtils.write(z,mxResources.get("custom")+"...");y.appendChild(z);d.appendChild(y);mxEvent.addListener(y,"change",mxUtils.bind(this,function(){if("custom"==y.value){var I=new FilenameDialog(this,t,mxResources.get("ok"),function(F){null!=F?(t=F,z.setAttribute("title",F)):(y.value="blank",z.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){y.value="blank"});this.showDialog(I.container,300,80,!0,!1);I.init()}}));mxEvent.addListener(k,"change",mxUtils.bind(this,function(){k.checked&&(null==g||g.checked)?y.removeAttribute("disabled"):y.setAttribute("disabled","disabled")}));mxUtils.br(d);return{getLink:function(){return k.checked?"blank"===y.value?"_blank":t:null},getEditInput:function(){return k},getEditSelect:function(){return y}}};EditorUi.prototype.addLinkSection=function(d,g){function k(){var I=document.createElement("div");-I.style.width="100%";I.style.height="100%";I.style.boxSizing="border-box";null!=y&&y!=mxConstants.NONE?(I.style.border="1px solid black",I.style.backgroundColor=y):(I.style.backgroundPosition="center center",I.style.backgroundRepeat="no-repeat",I.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')");A.innerText="";A.appendChild(I)}mxUtils.write(d,mxResources.get("links")+":");var m=document.createElement("select");m.style.width="100px";m.style.padding="0px";m.style.marginLeft="8px";m.style.marginRight=+I.style.width="100%";I.style.height="100%";I.style.boxSizing="border-box";null!=y&&y!=mxConstants.NONE?(I.style.border="1px solid black",I.style.backgroundColor=y):(I.style.backgroundPosition="center center",I.style.backgroundRepeat="no-repeat",I.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')");z.innerText="";z.appendChild(I)}mxUtils.write(d,mxResources.get("links")+":");var m=document.createElement("select");m.style.width="100px";m.style.padding="0px";m.style.marginLeft="8px";m.style.marginRight="10px";m.className="geBtn";var t=document.createElement("option");t.setAttribute("value","auto");mxUtils.write(t,mxResources.get("automatic"));m.appendChild(t);t=document.createElement("option");t.setAttribute("value","blank");mxUtils.write(t,mxResources.get("openInNewWindow"));m.appendChild(t);t=document.createElement("option");t.setAttribute("value","self");mxUtils.write(t,mxResources.get("openInThisWindow"));m.appendChild(t);g&&(g=document.createElement("option"),g.setAttribute("value","frame"),-mxUtils.write(g,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),m.appendChild(g));d.appendChild(m);mxUtils.write(d,mxResources.get("borderColor")+":");var y="#0000ff",A=null;A=mxUtils.button("",mxUtils.bind(this,function(I){this.pickColor(y||"none",function(F){y=F;k()});mxEvent.consume(I)}));k();A.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";A.style.marginLeft="4px";A.style.height="22px";A.style.width="22px";A.style.position="relative";A.style.top=mxClient.IS_IE||mxClient.IS_IE11||-mxClient.IS_EDGE?"6px":"1px";A.className="geColorBtn";d.appendChild(A);mxUtils.br(d);return{getColor:function(){return y},getTarget:function(){return m.value},focus:function(){m.focus()}}};EditorUi.prototype.createUrlParameters=function(d,g,k,m,t,y){y=null!=y?y:[];k&&(y.push("lightbox=1"),"auto"!=d&&y.push("target="+d),null!=g&&g!=mxConstants.NONE&&y.push("highlight="+("#"==g.charAt(0)?g.substring(1):g)),null!=m&&0<m.length&&y.push("edit="+encodeURIComponent(m)),t&&y.push("layers=1"),this.editor.graph.foldingEnabled&&-y.push("nav=1"));return y};EditorUi.prototype.createLink=function(d,g,k,m,t,y,A,I,F,C,Q,S,V){var P=this.getCurrentFile();F=this.createUrlParameters(d,g,m,t,y,F);d=!0;null!=A?k="#U"+encodeURIComponent(A):I||null==P||""==P.getHash()?k="#R"+encodeURIComponent(k?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(k="#"+P.getHash(),d=!1);d&&null!=P&&null!=P.getTitle()&&P.getTitle()!=this.defaultFilename&&F.push("title="+encodeURIComponent(P.getTitle()));-C&&1<k.length&&(F.push("open="+k.substring(1)),k="");Q&&null!=this.currentPage&&F.push("page-id="+this.currentPage.getId());S&&F.push("transparent=1");null!=V&&F.push("dark="+V);return(m&&(null!=A||null!=P&&P.getMode()!=App.MODE_GITHUB&&P.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<F.length?"?"+F.join("&"):"")+k};EditorUi.prototype.createHtml=-function(d,g,k,m,t,y,A,I,F,C,Q,S,V){this.getBasenames();var P={};""!=t&&t!=mxConstants.NONE&&(P.highlight=t);"auto"!==m&&(P.target=m);C||(P.lightbox=!1);P.nav=this.editor.graph.foldingEnabled;k=parseInt(k);isNaN(k)||100==k||(P.zoom=k/100);k=[];A&&(k.push("pages"),P.resize=!0,null!=this.pages&&null!=this.currentPage&&(P.page=mxUtils.indexOf(this.pages,this.currentPage)));g&&(k.push("zoom"),P.resize=!0);I&&k.push("layers");F&&k.push("tags");null!=V&&(P["dark-mode"]=V);0<k.length&&(C&&k.push("lightbox"),-P.toolbar=k.join(" "));null!=Q&&0<Q.length&&(P.edit=Q);null!=d?P.url=d:P.xml=this.getFileData(!0,null,null,null,null,!A);g='<div class="mxgraph" style="'+(y?"max-width:100%;":"")+(""!=k?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(P))+'"></div>';d=null!=d?"&fetch="+encodeURIComponent(d):"";S(g,'<script type="text/javascript" src="'+(0<d.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+d:"1"==urlParams.dev?-"https://test.draw.io/js/viewer-static.min.js":window.DRAWIO_VIEWER_URL?window.DRAWIO_VIEWER_URL:EditorUi.lightboxHost+"/js/viewer-static.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(d,g,k,m){var t=document.createElement("div");t.style.whiteSpace="nowrap";var y=document.createElement("h3");mxUtils.write(y,mxResources.get("html"));y.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";t.appendChild(y);var A=document.createElement("div");A.style.cssText=-"border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var I=document.createElement("input");I.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";I.setAttribute("value","url");I.setAttribute("type","radio");I.setAttribute("name","type-embedhtmldialog");y=I.cloneNode(!0);y.setAttribute("value","copy");A.appendChild(y);var F=document.createElement("span");mxUtils.write(F,mxResources.get("includeCopyOfMyDiagram"));A.appendChild(F);mxUtils.br(A);A.appendChild(I);F=-document.createElement("span");mxUtils.write(F,mxResources.get("publicDiagramUrl"));A.appendChild(F);var C=this.getCurrentFile();null==k&&null!=C&&C.constructor==window.DriveFile&&(F=document.createElement("a"),F.style.paddingLeft="12px",F.style.color="gray",F.style.cursor="pointer",mxUtils.write(F,mxResources.get("share")),A.appendChild(F),mxEvent.addListener(F,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(C.getId(),C)})));y.setAttribute("checked","checked");null==-k&&I.setAttribute("disabled","disabled");t.appendChild(A);A=380;var Q=this.addLinkSection(t),S=document.createElement("select");S.style.maxWidth="260px";S.style.marginLeft="8px";S.style.marginTop="16px";F=document.createElement("option");F.setAttribute("value","light");mxUtils.write(F,mxResources.get("light"));S.appendChild(F);F=document.createElement("option");F.setAttribute("value","dark");mxUtils.write(F,mxResources.get("dark"));S.appendChild(F);F=document.createElement("option");F.setAttribute("value",-"auto");mxUtils.write(F,mxResources.get("automatic"));F.setAttribute("selected","selected");S.appendChild(F);F.setAttribute("selected","selected");mxUtils.write(t,mxResources.get("appearance")+":");t.appendChild(S);mxUtils.br(t);A+=26;var V=this.addCheckbox(t,mxResources.get("zoom"),!0,null,!0);mxUtils.write(t,":");var P=document.createElement("input");P.setAttribute("type","text");P.style.marginRight="16px";P.style.width="60px";P.style.marginLeft="4px";P.style.marginRight="12px";P.value="100%";t.appendChild(P);-var u=this.addCheckbox(t,mxResources.get("fit"),!0);F=null!=this.pages&&1<this.pages.length;var x=x=this.addCheckbox(t,mxResources.get("allPages"),F,!F),J=this.addCheckbox(t,mxResources.get("layers"),!0),H=this.addCheckbox(t,mxResources.get("tags"),!0),K=this.addCheckbox(t,mxResources.get("lightbox"),!0),O=null;if(EditorUi.enableHtmlEditOption){O=this.addEditButton(t,K);var M=O.getEditInput();M.style.marginBottom="16px";A+=50;mxEvent.addListener(K,"change",function(){K.checked?M.removeAttribute("disabled"):-M.setAttribute("disabled","disabled");M.checked&&K.checked?O.getEditSelect().removeAttribute("disabled"):O.getEditSelect().setAttribute("disabled","disabled")})}d=new CustomDialog(this,t,mxUtils.bind(this,function(){m(I.checked?k:null,V.checked,P.value,Q.getTarget(),Q.getColor(),u.checked,x.checked,J.checked,H.checked,K.checked,null!=O?O.getLink():null,null!=S?S.value:null)}),null,d,g);this.showDialog(d.container,340,A,!0,!0);y.focus()};EditorUi.prototype.showPublishLinkDialog=function(d,g,k,m,t,-y,A,I,F,C,Q){var S=document.createElement("div");S.style.whiteSpace="nowrap";var V=document.createElement("h3");mxUtils.write(V,d||mxResources.get("publish"));V.style.width="100%";V.style.textAlign="center";V.style.marginTop="2px";V.style.marginBottom="20px";S.appendChild(V);var P=document.createElement("select");d=30;P.className="geBtn";P.style.marginBottom="8px";P.style.marginLeft="0px";P.style.width="100%";P.style.boxSizing="border-box";if(null==I||""==I.getHash())t=null!=t?t:"https://www.drawio.com/doc/faq/publish-diagram-as-link",-V=document.createElement("option"),mxUtils.write(V,mxResources.get("makeCopy")),V.setAttribute("value","copy"),P.appendChild(V);V=document.createElement("option");mxUtils.write(V,mxResources.get("authorizationRequired"));V.setAttribute("value","auth");P.appendChild(V);null!=I&&""!=I.getHash()||V.setAttribute("disabled","disabled");I=document.createElement("option");I.setAttribute("value","public");P.appendChild(I);null!=A?(mxUtils.write(I,mxResources.get("publicDiagramUrl")),I.setAttribute("title",-A),P.value="public"):(mxUtils.write(I,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),I.setAttribute("disabled","disabled"));S.appendChild(P);mxUtils.br(S);P.focus();var u=null,x=null;if(null!=g||null!=k)d+=30,mxUtils.write(S,mxResources.get("width")+":"),u=document.createElement("input"),u.setAttribute("type","text"),u.style.marginRight="16px",u.style.width="50px",u.style.marginLeft="6px",u.style.marginRight="16px",u.style.marginBottom="10px",u.value="100%",S.appendChild(u),+mxUtils.write(g,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),m.appendChild(g));d.appendChild(m);mxUtils.write(d,mxResources.get("borderColor")+":");var y="#0000ff",z=null;z=mxUtils.button("",mxUtils.bind(this,function(I){this.pickColor(y||"none",function(F){y=F;k()});mxEvent.consume(I)}));k();z.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";z.style.marginLeft="4px";z.style.height="22px";z.style.width="22px";z.style.position="relative";z.style.top=mxClient.IS_IE||mxClient.IS_IE11||+mxClient.IS_EDGE?"6px":"1px";z.className="geColorBtn";d.appendChild(z);mxUtils.br(d);return{getColor:function(){return y},getTarget:function(){return m.value},focus:function(){m.focus()}}};EditorUi.prototype.createUrlParameters=function(d,g,k,m,t,y){y=null!=y?y:[];k&&(y.push("lightbox=1"),"auto"!=d&&y.push("target="+d),null!=g&&g!=mxConstants.NONE&&y.push("highlight="+("#"==g.charAt(0)?g.substring(1):g)),null!=m&&0<m.length&&y.push("edit="+encodeURIComponent(m)),t&&y.push("layers=1"),this.editor.graph.foldingEnabled&&+y.push("nav=1"));return y};EditorUi.prototype.createLink=function(d,g,k,m,t,y,z,I,F,C,Q,S,V){var P=this.getCurrentFile();F=this.createUrlParameters(d,g,m,t,y,F);d=!0;null!=z?k="#U"+encodeURIComponent(z):I||null==P||""==P.getHash()?k="#R"+encodeURIComponent(k?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(k="#"+P.getHash(),d=!1);d&&null!=P&&null!=P.getTitle()&&P.getTitle()!=this.defaultFilename&&F.push("title="+encodeURIComponent(P.getTitle()));+C&&1<k.length&&(F.push("open="+k.substring(1)),k="");Q&&null!=this.currentPage&&F.push("page-id="+this.currentPage.getId());S&&F.push("transparent=1");null!=V&&F.push("dark="+V);return(m&&(null!=z||null!=P&&P.getMode()!=App.MODE_GITHUB&&P.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<F.length?"?"+F.join("&"):"")+k};EditorUi.prototype.createHtml=+function(d,g,k,m,t,y,z,I,F,C,Q,S,V){this.getBasenames();var P={};""!=t&&t!=mxConstants.NONE&&(P.highlight=t);"auto"!==m&&(P.target=m);C||(P.lightbox=!1);P.nav=this.editor.graph.foldingEnabled;k=parseInt(k);isNaN(k)||100==k||(P.zoom=k/100);k=[];z&&(k.push("pages"),P.resize=!0,null!=this.pages&&null!=this.currentPage&&(P.page=mxUtils.indexOf(this.pages,this.currentPage)));g&&(k.push("zoom"),P.resize=!0);I&&k.push("layers");F&&k.push("tags");null!=V&&(P["dark-mode"]=V);0<k.length&&(C&&k.push("lightbox"),+P.toolbar=k.join(" "));null!=Q&&0<Q.length&&(P.edit=Q);null!=d?P.url=d:P.xml=this.getFileData(!0,null,null,null,null,!z);g='<div class="mxgraph" style="'+(y?"max-width:100%;":"")+(""!=k?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(P))+'"></div>';d=null!=d?"&fetch="+encodeURIComponent(d):"";S(g,'<script type="text/javascript" src="'+(0<d.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+d:"1"==urlParams.dev?+"https://test.draw.io/js/viewer-static.min.js":window.DRAWIO_VIEWER_URL?window.DRAWIO_VIEWER_URL:EditorUi.lightboxHost+"/js/viewer-static.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(d,g,k,m){var t=document.createElement("div");t.style.whiteSpace="nowrap";var y=document.createElement("h3");mxUtils.write(y,mxResources.get("html"));y.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";t.appendChild(y);var z=document.createElement("div");z.style.cssText=+"border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var I=document.createElement("input");I.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";I.setAttribute("value","url");I.setAttribute("type","radio");I.setAttribute("name","type-embedhtmldialog");y=I.cloneNode(!0);y.setAttribute("value","copy");z.appendChild(y);var F=document.createElement("span");mxUtils.write(F,mxResources.get("includeCopyOfMyDiagram"));z.appendChild(F);mxUtils.br(z);z.appendChild(I);F=+document.createElement("span");mxUtils.write(F,mxResources.get("publicDiagramUrl"));z.appendChild(F);var C=this.getCurrentFile();null==k&&null!=C&&C.constructor==window.DriveFile&&(F=document.createElement("a"),F.style.paddingLeft="12px",F.style.color="gray",F.style.cursor="pointer",mxUtils.write(F,mxResources.get("share")),z.appendChild(F),mxEvent.addListener(F,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(C.getId(),C)})));y.setAttribute("checked","checked");null==+k&&I.setAttribute("disabled","disabled");t.appendChild(z);z=380;var Q=this.addLinkSection(t),S=document.createElement("select");S.style.maxWidth="260px";S.style.marginLeft="8px";S.style.marginTop="16px";F=document.createElement("option");F.setAttribute("value","light");mxUtils.write(F,mxResources.get("light"));S.appendChild(F);F=document.createElement("option");F.setAttribute("value","dark");mxUtils.write(F,mxResources.get("dark"));S.appendChild(F);F=document.createElement("option");F.setAttribute("value",+"auto");mxUtils.write(F,mxResources.get("automatic"));F.setAttribute("selected","selected");S.appendChild(F);F.setAttribute("selected","selected");mxUtils.write(t,mxResources.get("appearance")+":");t.appendChild(S);mxUtils.br(t);z+=26;var V=this.addCheckbox(t,mxResources.get("zoom"),!0,null,!0);mxUtils.write(t,":");var P=document.createElement("input");P.setAttribute("type","text");P.style.marginRight="16px";P.style.width="60px";P.style.marginLeft="4px";P.style.marginRight="12px";P.value="100%";t.appendChild(P);+var u=this.addCheckbox(t,mxResources.get("fit"),!0);F=null!=this.pages&&1<this.pages.length;var x=x=this.addCheckbox(t,mxResources.get("allPages"),F,!F),J=this.addCheckbox(t,mxResources.get("layers"),!0),H=this.addCheckbox(t,mxResources.get("tags"),!0),K=this.addCheckbox(t,mxResources.get("lightbox"),!0),N=null;if(EditorUi.enableHtmlEditOption){N=this.addEditButton(t,K);var M=N.getEditInput();M.style.marginBottom="16px";z+=50;mxEvent.addListener(K,"change",function(){K.checked?M.removeAttribute("disabled"):+M.setAttribute("disabled","disabled");M.checked&&K.checked?N.getEditSelect().removeAttribute("disabled"):N.getEditSelect().setAttribute("disabled","disabled")})}d=new CustomDialog(this,t,mxUtils.bind(this,function(){m(I.checked?k:null,V.checked,P.value,Q.getTarget(),Q.getColor(),u.checked,x.checked,J.checked,H.checked,K.checked,null!=N?N.getLink():null,null!=S?S.value:null)}),null,d,g);this.showDialog(d.container,340,z,!0,!0);y.focus()};EditorUi.prototype.showPublishLinkDialog=function(d,g,k,m,t,+y,z,I,F,C,Q){var S=document.createElement("div");S.style.whiteSpace="nowrap";var V=document.createElement("h3");mxUtils.write(V,d||mxResources.get("publish"));V.style.width="100%";V.style.textAlign="center";V.style.marginTop="2px";V.style.marginBottom="20px";S.appendChild(V);var P=document.createElement("select");d=30;P.className="geBtn";P.style.marginBottom="8px";P.style.marginLeft="0px";P.style.width="100%";P.style.boxSizing="border-box";if(null==I||""==I.getHash())t=null!=t?t:"https://www.drawio.com/doc/faq/publish-diagram-as-link",+V=document.createElement("option"),mxUtils.write(V,mxResources.get("makeCopy")),V.setAttribute("value","copy"),P.appendChild(V);V=document.createElement("option");mxUtils.write(V,mxResources.get("authorizationRequired"));V.setAttribute("value","auth");P.appendChild(V);null!=I&&""!=I.getHash()||V.setAttribute("disabled","disabled");I=document.createElement("option");I.setAttribute("value","public");P.appendChild(I);null!=z?(mxUtils.write(I,mxResources.get("publicDiagramUrl")),I.setAttribute("title",+z),P.value="public"):(mxUtils.write(I,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),I.setAttribute("disabled","disabled"));S.appendChild(P);mxUtils.br(S);P.focus();var u=null,x=null;if(null!=g||null!=k)d+=30,mxUtils.write(S,mxResources.get("width")+":"),u=document.createElement("input"),u.setAttribute("type","text"),u.style.marginRight="16px",u.style.width="50px",u.style.marginLeft="6px",u.style.marginRight="16px",u.style.marginBottom="10px",u.value="100%",S.appendChild(u),mxUtils.write(S,mxResources.get("height")+":"),x=document.createElement("input"),x.setAttribute("type","text"),x.style.width="50px",x.style.marginLeft="6px",x.style.marginBottom="10px",x.value=k+"px",S.appendChild(x),mxUtils.br(S);var J=this.addLinkSection(S,m),H=C?this.addCheckbox(S,mxResources.get("transparentBackground"),!1):null;null!=H&&(d+=20);var K=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(d+=30,g=null!=this.currentPage?this.currentPage.getName():-"",16<g.length&&(g=g.substring(0,16)+"..."),K=this.addCheckbox(S,mxResources.get("selectedPage")+": "+g));var O=document.createElement("select");O.style.maxWidth="260px";O.style.marginLeft="8px";O.style.marginTop="16px";g=document.createElement("option");g.setAttribute("value","0");mxUtils.write(g,mxResources.get("light"));O.appendChild(g);g=document.createElement("option");g.setAttribute("value","1");mxUtils.write(g,mxResources.get("dark"));O.appendChild(g);g=document.createElement("option");g.setAttribute("value",-"auto");mxUtils.write(g,mxResources.get("automatic"));g.setAttribute("selected","selected");O.appendChild(g);Q&&(mxUtils.write(S,mxResources.get("appearance")+":"),S.appendChild(O),mxUtils.br(S),d+=30);var M=this.addCheckbox(S,mxResources.get("lightbox"),!0,null,null,!m),n=this.addEditButton(S,M),z=n.getEditInput();m&&(z.style.marginLeft=M.style.marginLeft,M.style.display="none",d-=20);var D=this.addCheckbox(S,mxResources.get("layers"),!0);D.style.marginLeft=z.style.marginLeft;D.style.marginTop="8px";-var L=this.addCheckbox(S,mxResources.get("tags"),!0);L.style.marginLeft=z.style.marginLeft;L.style.marginBottom="16px";L.style.marginTop="16px";mxEvent.addListener(M,"change",function(){M.checked?(D.removeAttribute("disabled"),z.removeAttribute("disabled"),L.removeAttribute("disabled")):(D.setAttribute("disabled","disabled"),z.setAttribute("disabled","disabled"),L.setAttribute("disabled","disabled"));z.checked&&M.checked?n.getEditSelect().removeAttribute("disabled"):n.getEditSelect().setAttribute("disabled",-"disabled")});m=new CustomDialog(this,S,mxUtils.bind(this,function(){F(J.getTarget(),J.getColor(),null==K?!1:K.checked,M.checked,n.getLink(),D.checked,null!=u?u.value:null,null!=x?x.value:null,L.checked,P.value,null!=H?H.checked:!1,O.value)}),null,mxResources.get("create"),t,y);this.showDialog(m.container,340,296+d,!0,!0);null!=u?(u.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?u.select():document.execCommand("selectAll",!1,null)):null==P.parentNode;J.focus()};EditorUi.prototype.showRemoteExportDialog=-function(d,g,k,m,t){var y=document.createElement("div");y.style.whiteSpace="nowrap";var A=document.createElement("h3");mxUtils.write(A,mxResources.get("image"));A.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(t?"10":"4")+"px";y.appendChild(A);if(t){mxUtils.write(y,mxResources.get("zoom")+":");var I=document.createElement("input");I.setAttribute("type","text");I.style.marginRight="16px";I.style.width="60px";I.style.marginLeft="4px";I.style.marginRight="12px";I.value=this.lastExportZoom||-"100%";y.appendChild(I);mxUtils.write(y,mxResources.get("borderWidth")+":");var F=document.createElement("input");F.setAttribute("type","text");F.style.marginRight="16px";F.style.width="60px";F.style.marginLeft="4px";F.value=this.lastExportBorder||"0";y.appendChild(F);mxUtils.br(y)}var C=this.addCheckbox(y,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),Q=m?null:this.addCheckbox(y,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);A=this.editor.graph;-var S=m?null:this.addCheckbox(y,mxResources.get("transparentBackground"),A.background==mxConstants.NONE||null==A.background);null!=S&&(S.style.marginBottom="16px");d=new CustomDialog(this,y,mxUtils.bind(this,function(){var V=parseInt(I.value)/100||1,P=parseInt(F.value)||0;k(!C.checked,null!=Q?Q.checked:!1,null!=S?S.checked:!1,V,P)}),null,d,g);this.showDialog(d.container,300,(t?25:0)+(m?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(d,g,k,m,t,y,A,I,F){A=null!=A?A:Editor.defaultIncludeDiagram;+"",16<g.length&&(g=g.substring(0,16)+"..."),K=this.addCheckbox(S,mxResources.get("selectedPage")+": "+g));var N=document.createElement("select");N.style.maxWidth="260px";N.style.marginLeft="8px";N.style.marginTop="16px";g=document.createElement("option");g.setAttribute("value","0");mxUtils.write(g,mxResources.get("light"));N.appendChild(g);g=document.createElement("option");g.setAttribute("value","1");mxUtils.write(g,mxResources.get("dark"));N.appendChild(g);g=document.createElement("option");g.setAttribute("value",+"auto");mxUtils.write(g,mxResources.get("automatic"));g.setAttribute("selected","selected");N.appendChild(g);Q&&(mxUtils.write(S,mxResources.get("appearance")+":"),S.appendChild(N),mxUtils.br(S),d+=30);var M=this.addCheckbox(S,mxResources.get("lightbox"),!0,null,null,!m),n=this.addEditButton(S,M),A=n.getEditInput();m&&(A.style.marginLeft=M.style.marginLeft,M.style.display="none",d-=20);var E=this.addCheckbox(S,mxResources.get("layers"),!0);E.style.marginLeft=A.style.marginLeft;E.style.marginTop="8px";+var L=this.addCheckbox(S,mxResources.get("tags"),!0);L.style.marginLeft=A.style.marginLeft;L.style.marginBottom="16px";L.style.marginTop="16px";mxEvent.addListener(M,"change",function(){M.checked?(E.removeAttribute("disabled"),A.removeAttribute("disabled"),L.removeAttribute("disabled")):(E.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"),L.setAttribute("disabled","disabled"));A.checked&&M.checked?n.getEditSelect().removeAttribute("disabled"):n.getEditSelect().setAttribute("disabled",+"disabled")});m=new CustomDialog(this,S,mxUtils.bind(this,function(){F(J.getTarget(),J.getColor(),null==K?!1:K.checked,M.checked,n.getLink(),E.checked,null!=u?u.value:null,null!=x?x.value:null,L.checked,P.value,null!=H?H.checked:!1,N.value)}),null,mxResources.get("create"),t,y);this.showDialog(m.container,340,296+d,!0,!0);null!=u?(u.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?u.select():document.execCommand("selectAll",!1,null)):null==P.parentNode;J.focus()};EditorUi.prototype.showRemoteExportDialog=+function(d,g,k,m,t){var y=document.createElement("div");y.style.whiteSpace="nowrap";var z=document.createElement("h3");mxUtils.write(z,mxResources.get("image"));z.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(t?"10":"4")+"px";y.appendChild(z);if(t){mxUtils.write(y,mxResources.get("zoom")+":");var I=document.createElement("input");I.setAttribute("type","text");I.style.marginRight="16px";I.style.width="60px";I.style.marginLeft="4px";I.style.marginRight="12px";I.value=this.lastExportZoom||+"100%";y.appendChild(I);mxUtils.write(y,mxResources.get("borderWidth")+":");var F=document.createElement("input");F.setAttribute("type","text");F.style.marginRight="16px";F.style.width="60px";F.style.marginLeft="4px";F.value=this.lastExportBorder||"0";y.appendChild(F);mxUtils.br(y)}var C=this.addCheckbox(y,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),Q=m?null:this.addCheckbox(y,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);z=this.editor.graph;+var S=m?null:this.addCheckbox(y,mxResources.get("transparentBackground"),z.background==mxConstants.NONE||null==z.background);null!=S&&(S.style.marginBottom="16px");d=new CustomDialog(this,y,mxUtils.bind(this,function(){var V=parseInt(I.value)/100||1,P=parseInt(F.value)||0;k(!C.checked,null!=Q?Q.checked:!1,null!=S?S.checked:!1,V,P)}),null,d,g);this.showDialog(d.container,300,(t?25:0)+(m?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(d,g,k,m,t,y,z,I,F){z=null!=z?z:Editor.defaultIncludeDiagram;var C=document.createElement("div");C.style.whiteSpace="nowrap";var Q=this.editor.graph,S="jpeg"==I||"webp"==I?220:320,V=document.createElement("h3");mxUtils.write(V,d);V.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";C.appendChild(V);mxUtils.write(C,mxResources.get("zoom")+":");var P=document.createElement("input");P.setAttribute("type","text");P.style.marginRight="16px";P.style.width="60px";P.style.marginLeft="4px";P.style.marginRight="12px";P.value=this.lastExportZoom||"100%";C.appendChild(P);mxUtils.write(C,mxResources.get("borderWidth")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.marginRight="16px";u.style.width="60px";u.style.marginLeft="4px";u.value=this.lastExportBorder||"0";C.appendChild(u);mxUtils.br(C);var x=this.addCheckbox(C,mxResources.get("selectionOnly"),!1,Q.isSelectionEmpty()),J=document.createElement("input");J.style.marginTop="16px";J.style.marginRight="8px";J.style.marginLeft="24px";J.setAttribute("disabled","disabled");J.setAttribute("type","checkbox");var H=document.createElement("select");H.style.marginTop="16px";H.style.marginLeft="8px";d=["selectionOnly","diagram","page"];for(V=0;V<d.length;V++)if(!Q.isSelectionEmpty()||"selectionOnly"!=d[V]){var K=document.createElement("option");mxUtils.write(K,mxResources.get(d[V]));K.setAttribute("value",d[V]);H.appendChild(K)}F?(mxUtils.write(C,mxResources.get("size")+":"),C.appendChild(H),mxUtils.br(C),S+=26,mxEvent.addListener(H,"change",function(){"selectionOnly"==H.value&&(x.checked=!0)})):y&&(C.appendChild(J),mxUtils.write(C,mxResources.get("crop")),mxUtils.br(C),S+=30,mxEvent.addListener(x,"change",function(){x.checked?J.removeAttribute("disabled"):J.setAttribute("disabled","disabled")}));Q.isSelectionEmpty()?F&&(x.style.display="none",x.nextSibling.style.display="none",x.nextSibling.nextSibling.style.display="none",S-=30):(H.value="diagram",J.setAttribute("checked","checked"),J.defaultChecked=!0,mxEvent.addListener(x,"change",function(){H.value=x.checked?-"selectionOnly":"diagram"}));var O=this.addCheckbox(C,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=I&&"webp"!=I),M=document.createElement("select");M.style.maxWidth="260px";M.style.marginLeft="8px";M.style.marginTop="16px";y=document.createElement("option");y.setAttribute("value","light");mxUtils.write(y,mxResources.get("light"));M.appendChild(y);F=document.createElement("option");F.setAttribute("value","dark");mxUtils.write(F,mxResources.get("dark"));M.appendChild(F);"svg"==I&&mxUtils.lightDarkColorSupported?-(y=document.createElement("option"),y.setAttribute("value","auto"),mxUtils.write(y,mxResources.get("automatic")),y.setAttribute("selected","selected"),M.appendChild(y)):Editor.isDarkMode()?F.setAttribute("selected","selected"):y.setAttribute("selected","selected");mxUtils.write(C,mxResources.get("appearance")+":");C.appendChild(M);mxUtils.br(C);S+=26;var n=this.addCheckbox(C,mxResources.get("shadow"),Q.shadowVisible),z=null;if("png"==I||"jpeg"==I||"webp"==I)z=this.addCheckbox(C,mxResources.get("grid"),-!1,this.isOffline()||!this.canvasSupported,!1,!0),S+=30;var D=this.addCheckbox(C,mxResources.get("includeCopyOfMyDiagram")+":",A,null,null,"jpeg"!=I&&"webp"!=I),L=document.createElement("select");L.style.maxWidth="260px";L.style.marginLeft="28px";"png"==I||"svg"==I?(A=function(){D.checked?L.removeAttribute("disabled"):L.setAttribute("disabled","disabled")},Q=document.createElement("option"),Q.setAttribute("value","allPages"),mxUtils.write(Q,mxResources.get("allPages")),L.appendChild(Q),Q=document.createElement("option"),-Q.setAttribute("value","currentPage"),mxUtils.write(Q,mxResources.get("currentPage")),L.appendChild(Q),D.style.marginBottom="12px",L.style.marginBottom="16px",C.appendChild(L),mxUtils.br(C),S+=20,null!=this.lastEmbedInclude&&(L.value=this.lastEmbedInclude),mxEvent.addListener(D,"change",A),A()):D.style.marginBottom="16px";var N=document.createElement("input");N.style.marginBottom="16px";N.style.marginRight="8px";N.setAttribute("type","checkbox");var R=document.createElement("input");R.style.marginBottom=-"16px";R.style.marginRight="8px";R.setAttribute("type","checkbox");g&&(N.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,C.appendChild(N),mxUtils.write(C,mxResources.get("embedImages")),mxUtils.br(C),R.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,C.appendChild(R),mxUtils.write(C,mxResources.get("embedFonts")),mxUtils.br(C),S+=50);var T=document.createElement("select");T.style.maxWidth="260px";T.style.marginLeft="8px";y=document.createElement("option");y.setAttribute("value",-"auto");mxUtils.write(y,mxResources.get("automatic"));T.appendChild(y);A=document.createElement("option");A.setAttribute("value","blank");mxUtils.write(A,mxResources.get("openInNewWindow"));T.appendChild(A);A=document.createElement("option");A.setAttribute("value","self");mxUtils.write(A,mxResources.get("openInThisWindow"));T.appendChild(A);A=document.createElement("div");mxUtils.write(A,mxResources.get("LinksLost"));A.style.margin="7px";A.style.display="none";"svg"==I&&(mxUtils.write(C,mxResources.get("links")+-":"),C.appendChild(T),C.appendChild(A),mxUtils.br(C),mxUtils.br(C),S+=50);k=new CustomDialog(this,C,mxUtils.bind(this,function(){this.lastExportBorder=u.value;this.lastExportZoom=P.value;this.lastEmbedImages=N.checked;this.lastEmbedFonts=R.checked;this.lastEmbedInclude=L.value;t(P.value,O.checked,!x.checked,n.checked,D.checked,N.checked&&g,u.value,J.checked,("png"==I||"svg"==I)&&"currentPage"==L.value,T.value,null!=z?z.checked:null,null!=M?M.value:null,H.value,R.checked)}),null,k,m);this.showDialog(k.container,-340,S,!0,!0,null,null,null,null,!0);P.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?P.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(d,g,k,m,t){var y=document.createElement("div");y.style.whiteSpace="nowrap";var A=this.editor.graph;if(null!=g){var I=document.createElement("h3");mxUtils.write(I,g);I.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";y.appendChild(I)}var F=this.addCheckbox(y,mxResources.get("fit"),-!0),C=this.addCheckbox(y,mxResources.get("shadow"),A.shadowVisible&&m,!m),Q=this.addCheckbox(y,k),S=this.addCheckbox(y,mxResources.get("lightbox"),!0),V=this.addEditButton(y,S),P=V.getEditInput(),u=1<A.model.getChildCount(A.model.getRoot()),x=this.addCheckbox(y,mxResources.get("layers"),u,!u);x.style.marginLeft=P.style.marginLeft;x.style.marginBottom="12px";x.style.marginTop="8px";mxEvent.addListener(S,"change",function(){S.checked?(u&&x.removeAttribute("disabled"),P.removeAttribute("disabled")):-(x.setAttribute("disabled","disabled"),P.setAttribute("disabled","disabled"));P.checked&&S.checked?V.getEditSelect().removeAttribute("disabled"):V.getEditSelect().setAttribute("disabled","disabled")});g=new CustomDialog(this,y,mxUtils.bind(this,function(){d(F.checked,C.checked,Q.checked,S.checked,V.getLink(),x.checked)}),null,mxResources.get("embed"),t);this.showDialog(g.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(d,g,k,m,t,y,A,I){function F(P){var u=" ",x="";m&&(u=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+-EditorUi.lightboxHost+"/?client=1"+(null!=Q?"&page="+Q:"")+(t?"&edit=_blank":"")+(y?"&layers=1":"")+"');}})(this);\"",x+="cursor:pointer;");d&&(x+="max-width:100%;");var J="";k&&(J=' width="'+Math.round(C.width)+'" height="'+Math.round(C.height)+'"');A('<img src="'+P+'"'+J+(""!=x?' style="'+x+'"':"")+u+"/>")}var C=this.editor.graph.getGraphBounds(),Q=this.getSelectedPageIndex();if(this.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(P){var u=m?this.getFileData(!0):null;P=+"selectionOnly":"diagram"}));var N=this.addCheckbox(C,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=I&&"webp"!=I),M=document.createElement("select");M.style.maxWidth="260px";M.style.marginLeft="8px";M.style.marginTop="16px";y=document.createElement("option");y.setAttribute("value","light");mxUtils.write(y,mxResources.get("light"));M.appendChild(y);F=document.createElement("option");F.setAttribute("value","dark");mxUtils.write(F,mxResources.get("dark"));M.appendChild(F);"svg"==I&&mxUtils.lightDarkColorSupported?+(y=document.createElement("option"),y.setAttribute("value","auto"),mxUtils.write(y,mxResources.get("automatic")),y.setAttribute("selected","selected"),M.appendChild(y)):Editor.isDarkMode()?F.setAttribute("selected","selected"):y.setAttribute("selected","selected");mxUtils.write(C,mxResources.get("appearance")+":");C.appendChild(M);mxUtils.br(C);S+=26;var n=this.addCheckbox(C,mxResources.get("shadow"),Q.shadowVisible),A=null;if("png"==I||"jpeg"==I||"webp"==I)A=this.addCheckbox(C,mxResources.get("grid"),+!1,this.isOffline()||!this.canvasSupported,!1,!0),S+=30;var E=this.addCheckbox(C,mxResources.get("includeCopyOfMyDiagram")+":",z,null,null,"jpeg"!=I&&"webp"!=I),L=document.createElement("select");L.style.maxWidth="260px";L.style.marginLeft="28px";"png"==I||"svg"==I?(z=function(){E.checked?L.removeAttribute("disabled"):L.setAttribute("disabled","disabled")},Q=document.createElement("option"),Q.setAttribute("value","allPages"),mxUtils.write(Q,mxResources.get("allPages")),L.appendChild(Q),Q=document.createElement("option"),+Q.setAttribute("value","currentPage"),mxUtils.write(Q,mxResources.get("currentPage")),L.appendChild(Q),E.style.marginBottom="12px",L.style.marginBottom="16px",C.appendChild(L),mxUtils.br(C),S+=20,null!=this.lastEmbedInclude&&(L.value=this.lastEmbedInclude),mxEvent.addListener(E,"change",z),z()):E.style.marginBottom="16px";var O=document.createElement("input");O.style.marginBottom="16px";O.style.marginRight="8px";O.setAttribute("type","checkbox");var R=document.createElement("input");R.style.marginBottom=+"16px";R.style.marginRight="8px";R.setAttribute("type","checkbox");g&&(O.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,C.appendChild(O),mxUtils.write(C,mxResources.get("embedImages")),mxUtils.br(C),R.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,C.appendChild(R),mxUtils.write(C,mxResources.get("embedFonts")),mxUtils.br(C),S+=50);var T=document.createElement("select");T.style.maxWidth="260px";T.style.marginLeft="8px";y=document.createElement("option");y.setAttribute("value",+"auto");mxUtils.write(y,mxResources.get("automatic"));T.appendChild(y);z=document.createElement("option");z.setAttribute("value","blank");mxUtils.write(z,mxResources.get("openInNewWindow"));T.appendChild(z);z=document.createElement("option");z.setAttribute("value","self");mxUtils.write(z,mxResources.get("openInThisWindow"));T.appendChild(z);z=document.createElement("div");mxUtils.write(z,mxResources.get("LinksLost"));z.style.margin="7px";z.style.display="none";"svg"==I&&(mxUtils.write(C,mxResources.get("links")++":"),C.appendChild(T),C.appendChild(z),mxUtils.br(C),mxUtils.br(C),S+=50);k=new CustomDialog(this,C,mxUtils.bind(this,function(){this.lastExportBorder=u.value;this.lastExportZoom=P.value;this.lastEmbedImages=O.checked;this.lastEmbedFonts=R.checked;this.lastEmbedInclude=L.value;t(P.value,N.checked,!x.checked,n.checked,E.checked,O.checked&&g,u.value,J.checked,("png"==I||"svg"==I)&&"currentPage"==L.value,T.value,null!=A?A.checked:null,null!=M?M.value:null,H.value,R.checked)}),null,k,m);this.showDialog(k.container,+340,S,!0,!0,null,null,null,null,!0);P.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?P.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(d,g,k,m,t){var y=document.createElement("div");y.style.whiteSpace="nowrap";var z=this.editor.graph;if(null!=g){var I=document.createElement("h3");mxUtils.write(I,g);I.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";y.appendChild(I)}var F=this.addCheckbox(y,mxResources.get("fit"),+!0),C=this.addCheckbox(y,mxResources.get("shadow"),z.shadowVisible&&m,!m),Q=this.addCheckbox(y,k),S=this.addCheckbox(y,mxResources.get("lightbox"),!0),V=this.addEditButton(y,S),P=V.getEditInput(),u=1<z.model.getChildCount(z.model.getRoot()),x=this.addCheckbox(y,mxResources.get("layers"),u,!u);x.style.marginLeft=P.style.marginLeft;x.style.marginBottom="12px";x.style.marginTop="8px";mxEvent.addListener(S,"change",function(){S.checked?(u&&x.removeAttribute("disabled"),P.removeAttribute("disabled")):+(x.setAttribute("disabled","disabled"),P.setAttribute("disabled","disabled"));P.checked&&S.checked?V.getEditSelect().removeAttribute("disabled"):V.getEditSelect().setAttribute("disabled","disabled")});g=new CustomDialog(this,y,mxUtils.bind(this,function(){d(F.checked,C.checked,Q.checked,S.checked,V.getLink(),x.checked)}),null,mxResources.get("embed"),t);this.showDialog(g.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(d,g,k,m,t,y,z,I){function F(P){var u=" ",x="";m&&(u=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"++EditorUi.lightboxHost+"/?client=1"+(null!=Q?"&page="+Q:"")+(t?"&edit=_blank":"")+(y?"&layers=1":"")+"');}})(this);\"",x+="cursor:pointer;");d&&(x+="max-width:100%;");var J="";k&&(J=' width="'+Math.round(C.width)+'" height="'+Math.round(C.height)+'"');z('<img src="'+P+'"'+J+(""!=x?' style="'+x+'"':"")+u+"/>")}var C=this.editor.graph.getGraphBounds(),Q=this.getSelectedPageIndex();if(this.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(P){var u=m?this.getFileData(!0):null;P=this.createImageDataUri(P,u,"png");F(P)}),null,null,null,mxUtils.bind(this,function(P){I({message:mxResources.get("unknownError")})}),null,!0,k?2:1,null,g,null,null,Editor.defaultBorder);else if(g=this.getFileData(!0),C.width*C.height<=MAX_AREA&&g.length<=MAX_REQUEST_SIZE){var S="";k&&(S="&w="+Math.round(2*C.width)+"&h="+Math.round(2*C.height));var V=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(m?"1":"0")+S+"&xml="+encodeURIComponent(g));V.send(mxUtils.bind(this,function(){200<=V.getStatus()&&-299>=V.getStatus()?F("data:image/png;base64,"+V.getText()):I({message:mxResources.get("unknownError")})}))}else I({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(d,g,k,m,t,y,A){var I=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!k,"auto"),F=I.getElementsByTagName("a");if(null!=F)for(var C=0;C<F.length;C++){var Q=F[C].getAttribute("href");null!=Q&&"#"==Q.charAt(0)&&"_blank"==F[C].getAttribute("target")&&F[C].removeAttribute("target")}m&&+299>=V.getStatus()?F("data:image/png;base64,"+V.getText()):I({message:mxResources.get("unknownError")})}))}else I({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(d,g,k,m,t,y,z){var I=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!k,"auto"),F=I.getElementsByTagName("a");if(null!=F)for(var C=0;C<F.length;C++){var Q=F[C].getAttribute("href");null!=Q&&"#"==Q.charAt(0)&&"_blank"==F[C].getAttribute("target")&&F[C].removeAttribute("target")}m&&I.setAttribute("content",this.getFileData(!0));g&&this.editor.graph.addSvgShadow(I);if(k){var S=" ",V="";m&&(S="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"+(t?"&edit=_blank":"")+(y?"&layers=1":-"")+"');}})(this);\"",V+="cursor:pointer;");d&&(V+="max-width:100%;");this.editor.convertImages(I,mxUtils.bind(this,function(P){A('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(P))+'"'+(""!=V?' style="'+V+'"':"")+S+"/>")}))}else V="",m&&(g=this.getSelectedPageIndex(),I.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"+-EditorUi.lightboxHost+"/?client=1"+(null!=g?"&page="+g:"")+(t?"&edit=_blank":"")+(y?"&layers=1":"")+"');}}})(this);"),V+="cursor:pointer;"),d&&(d=parseInt(I.getAttribute("width")),t=parseInt(I.getAttribute("height")),I.setAttribute("viewBox","-0.5 -0.5 "+d+" "+t),V+="max-width:100%;max-height:"+t+"px;",I.removeAttribute("height")),""!=V&&I.setAttribute("style",V),this.editor.addFontCss(I),this.editor.graph.mathEnabled&&this.editor.addMathCss(I),A(mxUtils.getXml(I))};EditorUi.prototype.timeSince=function(d){d=+"")+"');}})(this);\"",V+="cursor:pointer;");d&&(V+="max-width:100%;");this.editor.convertImages(I,mxUtils.bind(this,function(P){z('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(P))+'"'+(""!=V?' style="'+V+'"':"")+S+"/>")}))}else V="",m&&(g=this.getSelectedPageIndex(),I.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"++EditorUi.lightboxHost+"/?client=1"+(null!=g?"&page="+g:"")+(t?"&edit=_blank":"")+(y?"&layers=1":"")+"');}}})(this);"),V+="cursor:pointer;"),d&&(d=parseInt(I.getAttribute("width")),t=parseInt(I.getAttribute("height")),I.setAttribute("viewBox","-0.5 -0.5 "+d+" "+t),V+="max-width:100%;max-height:"+t+"px;",I.removeAttribute("height")),""!=V&&I.setAttribute("style",V),this.editor.addFontCss(I),this.editor.graph.mathEnabled&&this.editor.addMathCss(I),z(mxUtils.getXml(I))};EditorUi.prototype.timeSince=function(d){d=Math.floor((new Date-d)/1E3);var g=Math.floor(d/31536E3);if(1<g)return g+" "+mxResources.get("years");g=Math.floor(d/2592E3);if(1<g)return g+" "+mxResources.get("months");g=Math.floor(d/86400);if(1<g)return g+" "+mxResources.get("days");g=Math.floor(d/3600);if(1<g)return g+" "+mxResources.get("hours");g=Math.floor(d/60);return 1<g?g+" "+mxResources.get("minutes"):1==g?g+" "+mxResources.get("minute"):null};EditorUi.prototype.decodeNodeIntoGraph=function(d,g){if(null!=d){var k=null;if("diagram"==d.nodeName)k=d;else if("mxfile"==d.nodeName){var m=d.getElementsByTagName("diagram");if(0<m.length){k=m[0];var t=g.getGlobalVariable;g.getGlobalVariable=function(y){return"page"==y?k.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==y?1:t.apply(this,arguments)}}}null!=k&&(d=Editor.parseDiagramNode(k))}m=this.editor.graph;try{this.editor.graph=g,this.editor.setGraphXml(d)}catch(y){}finally{this.editor.graph=m}return d};EditorUi.prototype.getSvgFileProperties=function(d){return this.getPngFileProperties(d)};-EditorUi.prototype.getPngFileProperties=function(d){var g=1,k=0;if(null!=d){if(d.hasAttribute("scale")){var m=parseFloat(d.getAttribute("scale"));!isNaN(m)&&0<m&&(g=m)}d.hasAttribute("border")&&(m=parseInt(d.getAttribute("border")),!isNaN(m)&&0<m&&(k=m))}return{scale:g,border:k}};EditorUi.prototype.getEmbeddedPng=function(d,g,k,m,t){try{var y=this.editor.graph,A=null;if(null!=k&&0<k.length)y=this.createTemporaryGraph(y.getStylesheet()),document.body.appendChild(y.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(k).documentElement,-!0),y),A=k;else if(null!=this.pages&&this.currentPage!=this.pages[0]){y=this.createTemporaryGraph(y.getStylesheet());var I=y.getGlobalVariable;y.setBackgroundImage=this.editor.graph.setBackgroundImage;var F=this.pages[0];this.currentPage==F?y.setBackgroundImage(this.editor.graph.backgroundImage):null!=F.viewState&&null!=F.viewState&&y.setBackgroundImage(F.viewState.backgroundImage);y.getGlobalVariable=function(C){return"page"==C?F.getName():"pagenumber"==C?1:I.apply(this,arguments)};document.body.appendChild(y.container);-y.model.setRoot(F.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(C){try{null==A&&(A=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var Q=C.toDataURL("image/png");Q=Editor.writeGraphModelToPng(Q,"tEXt","mxfile",encodeURIComponent(A));d(Q.substring(Q.lastIndexOf(",")+1));y!=this.editor.graph&&y.container.parentNode.removeChild(y.container)}catch(S){null!=g&&g(S)}}),null,null,null,mxUtils.bind(this,function(C){null!=g&&g(C)}),null,null,m,null,y.shadowVisible,null,y,t,null,-null,null,"diagram",null)}catch(C){null!=g&&g(C)}};EditorUi.prototype.getEmbeddedSvg=function(d,g,k,m,t,y,A,I,F,C,Q,S,V){I=null!=I?I:!0;Q=null!=Q?Q:0;A=null!=F?F:g.background;A==mxConstants.NONE&&(A=null);null==A&&"none"==g.getAdaptiveColors()&&(A="#ffffff");F=this.editor.graph.createSvgImageExport(null!=d);y=g.getSvg(A,C,Q,null,null,y,null,F,null,g.shadowVisible||S,null,V,"diagram");(g.shadowVisible||S)&&g.addSvgShadow(y,null,null,0==Q);null!=d&&y.setAttribute("content",d);null!=k&&y.setAttribute("resource",+EditorUi.prototype.getPngFileProperties=function(d){var g=1,k=0;if(null!=d){if(d.hasAttribute("scale")){var m=parseFloat(d.getAttribute("scale"));!isNaN(m)&&0<m&&(g=m)}d.hasAttribute("border")&&(m=parseInt(d.getAttribute("border")),!isNaN(m)&&0<m&&(k=m))}return{scale:g,border:k}};EditorUi.prototype.getEmbeddedPng=function(d,g,k,m,t){try{var y=this.editor.graph,z=null;if(null!=k&&0<k.length)y=this.createTemporaryGraph(y.getStylesheet()),document.body.appendChild(y.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(k).documentElement,+!0),y),z=k;else if(null!=this.pages&&this.currentPage!=this.pages[0]){y=this.createTemporaryGraph(y.getStylesheet());var I=y.getGlobalVariable;y.setBackgroundImage=this.editor.graph.setBackgroundImage;var F=this.pages[0];this.currentPage==F?y.setBackgroundImage(this.editor.graph.backgroundImage):null!=F.viewState&&null!=F.viewState&&y.setBackgroundImage(F.viewState.backgroundImage);y.getGlobalVariable=function(C){return"page"==C?F.getName():"pagenumber"==C?1:I.apply(this,arguments)};document.body.appendChild(y.container);+y.model.setRoot(F.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(C){try{null==z&&(z=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var Q=C.toDataURL("image/png");Q=Editor.writeGraphModelToPng(Q,"tEXt","mxfile",encodeURIComponent(z));d(Q.substring(Q.lastIndexOf(",")+1));y!=this.editor.graph&&y.container.parentNode.removeChild(y.container)}catch(S){null!=g&&g(S)}}),null,null,null,mxUtils.bind(this,function(C){null!=g&&g(C)}),null,null,m,null,y.shadowVisible,null,y,t,null,+null,null,"diagram",null)}catch(C){null!=g&&g(C)}};EditorUi.prototype.getEmbeddedSvg=function(d,g,k,m,t,y,z,I,F,C,Q,S,V){I=null!=I?I:!0;Q=null!=Q?Q:0;z=null!=F?F:g.background;z==mxConstants.NONE&&(z=null);null==z&&"none"==g.getAdaptiveColors()&&(z="#ffffff");F=this.editor.graph.createSvgImageExport(null!=d);y=g.getSvg(z,C,Q,null,null,y,null,F,null,g.shadowVisible||S,null,V,"diagram");(g.shadowVisible||S)&&g.addSvgShadow(y,null,null,0==Q);null!=d&&y.setAttribute("content",d);null!=k&&y.setAttribute("resource",k);var P=mxUtils.bind(this,function(u){u=(m?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(u);null!=t&&t(u);return u});g.mathEnabled&&this.editor.addMathCss(y);if(null!=t)this.embedFonts(y,mxUtils.bind(this,function(u){I?this.editor.convertImages(u,mxUtils.bind(this,function(x){P(x)})):P(u)}));else return P(y)};EditorUi.prototype.embedFonts=function(d,g){this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=this.editor.resolvedFontCss&&this.editor.addFontCss(d,-this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(k){try{null!=k&&this.editor.addFontCss(d,k),g(d)}catch(m){g(d)}}))}catch(k){g(d)}}))};EditorUi.prototype.exportImage=function(d,g,k,m,t,y,A,I,F,C,Q,S,V){F=null!=F?F:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(u){Editor.addRetryToError(u,mxUtils.bind(this,function(){this.exportImage(d,g,k,m,t,y,A,I,F,C,Q,S,V)}));this.handleError(u)}))){var P=this.editor.graph.isSelectionEmpty();-k=null!=k?k:P;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(u){this.spinner.stop();try{this.saveCanvas(u,t?this.getFileData(!0,null,null,null,k,I,null,null,null,null,null,d,y):null,F,null==this.pages||0==this.pages.length,Q)}catch(x){this.handleError(x)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(u){this.spinner.stop();this.handleError(u)}),null,k,d||1,g,m,null,null,y,A,C,S,V)}catch(u){this.spinner.stop(),this.handleError(u)}}};-EditorUi.prototype.isCorsEnabledForUrl=function(d){return this.editor.isCorsEnabledForUrl(d)};EditorUi.prototype.addLocalPagesToMapping=function(d){d=null!=d?d:{};if(null!=this.pages)for(var g=0;g<this.pages.length;g++)d[this.pages[g].getId()]=this.pages[g].getId();return d};EditorUi.prototype.importXml=function(d,g,k,m,t,y,A){g=null!=g?g:0;k=null!=k?k:0;var I=[];try{var F=this.editor.graph;if(null!=d&&0<d.length){F.model.beginUpdate();try{var C=mxUtils.parseXml(d);d={};var Q=this.editor.extractGraphModel(C.documentElement,+this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(k){try{null!=k&&this.editor.addFontCss(d,k),g(d)}catch(m){g(d)}}))}catch(k){g(d)}}))};EditorUi.prototype.exportImage=function(d,g,k,m,t,y,z,I,F,C,Q,S,V){F=null!=F?F:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(u){Editor.addRetryToError(u,mxUtils.bind(this,function(){this.exportImage(d,g,k,m,t,y,z,I,F,C,Q,S,V)}));this.handleError(u)}))){var P=this.editor.graph.isSelectionEmpty();+k=null!=k?k:P;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(u){this.spinner.stop();try{this.saveCanvas(u,t?this.getFileData(!0,null,null,null,k,I,null,null,null,null,null,d,y):null,F,null==this.pages||0==this.pages.length,Q)}catch(x){this.handleError(x)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(u){this.spinner.stop();this.handleError(u)}),null,k,d||1,g,m,null,null,y,z,C,S,V)}catch(u){this.spinner.stop(),this.handleError(u)}}};+EditorUi.prototype.isCorsEnabledForUrl=function(d){return this.editor.isCorsEnabledForUrl(d)};EditorUi.prototype.addLocalPagesToMapping=function(d){d=null!=d?d:{};if(null!=this.pages)for(var g=0;g<this.pages.length;g++)d[this.pages[g].getId()]=this.pages[g].getId();return d};EditorUi.prototype.importXml=function(d,g,k,m,t,y,z){g=null!=g?g:0;k=null!=k?k:0;var I=[];try{var F=this.editor.graph;if(null!=d&&0<d.length){F.model.beginUpdate();try{var C=mxUtils.parseXml(d);d={};var Q=this.editor.extractGraphModel(C.documentElement,null!=this.pages);if(null!=Q&&"mxfile"==Q.nodeName&&null!=this.pages){var S=Q.getElementsByTagName("diagram");if(1==S.length&&!y){if(Q=Editor.parseDiagramNode(S[0]),null!=this.currentPage&&(d[S[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var V=S[0].getAttribute("name");null!=V&&""!=V&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,V))}}else if(0<S.length){y=[];var P=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(d[S[0].getAttribute("id")]=this.pages[0].getId(),V=S[0].getAttribute("name"),null!=V&&""!=V&&this.editor.graph.model.execute(new RenamePage(this,this.pages[0],V)),Q=Editor.parseDiagramNode(S[0]),m=!1,P=1);for(;P<S.length;P++){var u=S[P].getAttribute("id");S[P].removeAttribute("id");var x=this.updatePageRoot(new DiagramPage(S[P]));d[u]=S[P].getAttribute("id");var J=this.pages.length;null==x.getName()&&x.setName(mxResources.get("pageWithNumber",[J+1]));F.model.execute(new ChangePage(this,x,x,J,!0));y.push(x)}this.updatePageLinks(d,-y)}}if(null!=Q&&"mxGraphModel"===Q.nodeName){I=F.importGraphModel(Q,g,k,m);if(null!=I)for(this.addLocalPagesToMapping(d),P=0;P<I.length;P++)this.updatePageLinksForCell(d,I[P]);var H=F.parseBackgroundImage(Q.getAttribute("backgroundImage"));if(null!=H&&null!=H.originalSrc){this.updateBackgroundPageLink(d,H);var K=new ChangePageSetup(this,null,H);K.ignoreColor=!0;F.model.execute(K)}}A&&F.pasteCellStyles(F.includeDescendants(I),F.defaultVertexStyle,F.defaultEdgeStyle)}finally{F.model.endUpdate()}}}catch(O){if(t)throw O;-this.handleError(O)}return I};EditorUi.prototype.updatePageLinks=function(d,g){for(var k=0;k<g.length;k++)this.updatePageLinksForCell(d,g[k].root),null!=g[k].viewState&&this.updateBackgroundPageLink(d,g[k].viewState.backgroundImage)};EditorUi.prototype.updateBackgroundPageLink=function(d,g){try{if(null!=g&&Graph.isPageLink(g.originalSrc)){var k=d[g.originalSrc.substring(g.originalSrc.indexOf(",")+1)];null!=k&&(g.originalSrc="data:page/id,"+k)}}catch(m){}};EditorUi.prototype.updatePageLinksForCell=-function(d,g){var k=document.createElement("div"),m=this.editor.graph,t=m.getLinkForCell(g);null!=t&&m.setLinkForCell(g,this.updatePageLink(d,t));if(m.isHtmlLabel(g)){k.innerHTML=Graph.sanitizeHtml(m.getLabel(g));for(var y=k.getElementsByTagName("a"),A=!1,I=0;I<y.length;I++)t=y[I].getAttribute("href"),null!=t&&(y[I].setAttribute("href",this.updatePageLink(d,t)),A=!0);A&&m.labelChanged(g,k.innerHTML)}for(I=0;I<m.model.getChildCount(g);I++)this.updatePageLinksForCell(d,m.model.getChildAt(g,I))};EditorUi.prototype.updatePageLink=-function(d,g){if(Graph.isPageLink(g)){var k=d[g.substring(g.indexOf(",")+1)];g=null!=k?"data:page/id,"+k:null}else if("data:action/json,"==g.substring(0,17))try{var m=JSON.parse(g.substring(17));if(null!=m.actions){for(var t=0;t<m.actions.length;t++){var y=m.actions[t];if(null!=y.open&&Graph.isPageLink(y.open)){var A=y.open.substring(y.open.indexOf(",")+1);k=d[A];null!=k?y.open="data:page/id,"+k:null==this.getPageById(A)&&delete y.open}}g="data:action/json,"+JSON.stringify(m)}}catch(I){}return g};-EditorUi.prototype.isRemoteVisioFormat=function(d){return/(\.v(sd|dx))($|\?)/i.test(d)||/(\.vs(s|x))($|\?)/i.test(d)};EditorUi.prototype.importVisio=function(d,g,k,m,t){var y=mxUtils.bind(this,function(A){this.loadingExtensions=!1;null!=k?k(A):this.handleError(A)});this.createTimeout(null,mxUtils.bind(this,function(A){m=null!=m?m:d.name;var I=mxUtils.bind(this,function(C){A.clear()&&y(C)}),F=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var C=this.isRemoteVisioFormat(m);+y)}}if(null!=Q&&"mxGraphModel"===Q.nodeName){I=F.importGraphModel(Q,g,k,m);if(null!=I)for(this.addLocalPagesToMapping(d),P=0;P<I.length;P++)this.updatePageLinksForCell(d,I[P]);var H=F.parseBackgroundImage(Q.getAttribute("backgroundImage"));if(null!=H&&null!=H.originalSrc){this.updateBackgroundPageLink(d,H);var K=new ChangePageSetup(this,null,H);K.ignoreColor=!0;F.model.execute(K)}}z&&F.pasteCellStyles(F.includeDescendants(I),F.defaultVertexStyle,F.defaultEdgeStyle)}finally{F.model.endUpdate()}}}catch(N){if(t)throw N;+this.handleError(N)}return I};EditorUi.prototype.updatePageLinks=function(d,g){for(var k=0;k<g.length;k++)this.updatePageLinksForCell(d,g[k].root),null!=g[k].viewState&&this.updateBackgroundPageLink(d,g[k].viewState.backgroundImage)};EditorUi.prototype.updateBackgroundPageLink=function(d,g){try{if(null!=g&&Graph.isPageLink(g.originalSrc)){var k=d[g.originalSrc.substring(g.originalSrc.indexOf(",")+1)];null!=k&&(g.originalSrc="data:page/id,"+k)}}catch(m){}};EditorUi.prototype.updatePageLinksForCell=+function(d,g){var k=document.createElement("div"),m=this.editor.graph,t=m.getLinkForCell(g);null!=t&&m.setLinkForCell(g,this.updatePageLink(d,t));if(m.isHtmlLabel(g)){k.innerHTML=Graph.sanitizeHtml(m.getLabel(g));for(var y=k.getElementsByTagName("a"),z=!1,I=0;I<y.length;I++)t=y[I].getAttribute("href"),null!=t&&(y[I].setAttribute("href",this.updatePageLink(d,t)),z=!0);z&&m.labelChanged(g,k.innerHTML)}for(I=0;I<m.model.getChildCount(g);I++)this.updatePageLinksForCell(d,m.model.getChildAt(g,I))};EditorUi.prototype.updatePageLink=+function(d,g){if(Graph.isPageLink(g)){var k=d[g.substring(g.indexOf(",")+1)];g=null!=k?"data:page/id,"+k:null}else if("data:action/json,"==g.substring(0,17))try{var m=JSON.parse(g.substring(17));if(null!=m.actions){for(var t=0;t<m.actions.length;t++){var y=m.actions[t];if(null!=y.open&&Graph.isPageLink(y.open)){var z=y.open.substring(y.open.indexOf(",")+1);k=d[z];null!=k?y.open="data:page/id,"+k:null==this.getPageById(z)&&delete y.open}}g="data:action/json,"+JSON.stringify(m)}}catch(I){}return g};+EditorUi.prototype.isRemoteVisioFormat=function(d){return/(\.v(sd|dx))($|\?)/i.test(d)||/(\.vs(s|x))($|\?)/i.test(d)};EditorUi.prototype.importVisio=function(d,g,k,m,t){var y=mxUtils.bind(this,function(z){this.loadingExtensions=!1;null!=k?k(z):this.handleError(z)});this.createTimeout(null,mxUtils.bind(this,function(z){m=null!=m?m:d.name;var I=mxUtils.bind(this,function(C){z.clear()&&y(C)}),F=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var C=this.isRemoteVisioFormat(m);try{var Q=m.lastIndexOf(".");if(0<=Q&&Q<m.length)m.substring(Q+1).toUpperCase();else{var S=m.lastIndexOf("/");0<=S&&S<m.length&&(m=m.substring(S+1))}}catch(P){}if(C)if(null==VSD_CONVERT_URL||this.isOffline())I({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{C=new FormData;C.append("file1",d,m);var V=new XMLHttpRequest;V.open("POST",VSD_CONVERT_URL+(/(\.vss|\.vsx)$/.test(m)?"?stencil=1":""));V.responseType="blob";this.addRemoteServiceSecurityCheck(V);-null!=t&&V.setRequestHeader("x-convert-custom",t);V.onreadystatechange=mxUtils.bind(this,function(){if(4==V.readyState&&A.clear())if(200<=V.status&&299>=V.status)try{var P=V.response;if("text/xml"==P.type){var u=new FileReader;u.onload=mxUtils.bind(this,function(x){try{g(x.target.result)}catch(J){I({message:mxResources.get("errorLoadingFile")})}});u.readAsText(P)}else this.doImportVisio(P,g,I,m)}catch(x){I(x)}else try{""==V.responseType||"text"==V.responseType?I({message:V.responseText}):(u=new FileReader,-u.onload=function(){try{I({message:JSON.parse(u.result).Message})}catch(x){I(x)}},u.readAsText(V.response))}catch(x){I({})}});V.send(C)}else if(A.clear())try{this.doImportVisio(d,g,I,m)}catch(P){I(P)}}else I({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?F():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",F,null,null,null,I))}),y)};EditorUi.prototype.importGraphML=function(d,g,k){var m=-mxUtils.bind(this,function(t){this.loadingExtensions=!1;null!=k?k(t):this.handleError(t)});this.createTimeout(null,mxUtils.bind(this,function(t){var y=mxUtils.bind(this,function(I){t.clear()&&m(I)}),A=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(t.clear())if(this.doImportGraphML)try{this.doImportGraphML(d,g,m)}catch(I){y(I)}else y({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?A():(this.loadingExtensions=!0,-mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",A,null,null,null,y))}),m)};EditorUi.prototype.exportVisio=function(d){if(this.spinner.spin(document.body,mxResources.get("loading"))){var g=mxUtils.bind(this,function(k){this.loadingExtensions=!1;this.handleError(k)});this.vsdxExportEnabled()?this.createTimeout(null,mxUtils.bind(this,function(k){var m=mxUtils.bind(this,function(y){k.clear()&&g(y)}),t=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(k.clear())if("undefined"!==typeof VsdxExport)try{this.spinner.stop(),+null!=t&&V.setRequestHeader("x-convert-custom",t);V.onreadystatechange=mxUtils.bind(this,function(){if(4==V.readyState&&z.clear())if(200<=V.status&&299>=V.status)try{var P=V.response;if("text/xml"==P.type){var u=new FileReader;u.onload=mxUtils.bind(this,function(x){try{g(x.target.result)}catch(J){I({message:mxResources.get("errorLoadingFile")})}});u.readAsText(P)}else this.doImportVisio(P,g,I,m)}catch(x){I(x)}else try{""==V.responseType||"text"==V.responseType?I({message:V.responseText}):(u=new FileReader,+u.onload=function(){try{I({message:JSON.parse(u.result).Message})}catch(x){I(x)}},u.readAsText(V.response))}catch(x){I({})}});V.send(C)}else if(z.clear())try{this.doImportVisio(d,g,I,m)}catch(P){I(P)}}else I({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?F():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",F,null,null,null,I))}),y)};EditorUi.prototype.importGraphML=function(d,g,k){var m=+mxUtils.bind(this,function(t){this.loadingExtensions=!1;null!=k?k(t):this.handleError(t)});this.createTimeout(null,mxUtils.bind(this,function(t){var y=mxUtils.bind(this,function(I){t.clear()&&m(I)}),z=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(t.clear())if(this.doImportGraphML)try{this.doImportGraphML(d,g,m)}catch(I){y(I)}else y({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?z():(this.loadingExtensions=!0,+mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",z,null,null,null,y))}),m)};EditorUi.prototype.exportVisio=function(d){if(this.spinner.spin(document.body,mxResources.get("loading"))){var g=mxUtils.bind(this,function(k){this.loadingExtensions=!1;this.handleError(k)});this.vsdxExportEnabled()?this.createTimeout(null,mxUtils.bind(this,function(k){var m=mxUtils.bind(this,function(y){k.clear()&&g(y)}),t=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(k.clear())if("undefined"!==typeof VsdxExport)try{this.spinner.stop(),(new VsdxExport(this)).exportCurrentDiagrams(d)||m({message:mxResources.get("unknownError")})}catch(y){m(y)}else m({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(t,0):(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",t,null,null,null,m))}),g):g({message:mxResources.get("serviceUnavailableOrBlocked")})}};EditorUi.prototype.convertLucidChart=function(d,g,k){var m=-mxUtils.bind(this,function(t){this.loadingExtensions=!1;null!=k?k(t):this.handleError(t)});this.createTimeout(null,mxUtils.bind(this,function(t){var y=mxUtils.bind(this,function(I){t.clear()&&m(I)}),A=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(t.clear())if("undefined"!==typeof window.LucidImporter)try{var I=JSON.parse(d);g(LucidImporter.importState(I));try{if(null!=window.console&&"1"==urlParams.test){var F=[(new Date).toISOString(),"convertLucidChart",I];null!=I.state&&F.push(JSON.parse(I.state));-if(null!=I.svgThumbs)for(var C=0;C<I.svgThumbs.length;C++)F.push(Editor.createSvgDataUri(I.svgThumbs[C]));null!=I.thumb&&F.push(I.thumb);console.log.apply(console,F)}}catch(Q){}}catch(Q){null!=window.console&&console.error(Q),y(Q)}else y({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(A,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",function(){mxscript("js/orgchart/bridge.min.js",-function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",A,null,null,null,y)},null,null,null,y)},null,null,null,y)},null,null,null,y)},null,null,null,y):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",A,null,null,null,y))}),m)};EditorUi.prototype.createMermaidXml=function(d,g,k,m,t,y){var A=new Graph(document.createElement("div"));k=A.insertVertex(null,null,null,0,0,m,t,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+-k+";");A.setAttributeForCell(k,"mermaidData",JSON.stringify({data:d,config:g},null,2));null!=y&&A.setAttributeForCell(k,"templatePrompt",y);d=(new mxCodec).encode(A.getModel());return mxUtils.getXml(d)};EditorUi.prototype.generateOpenAiMermaidDiagram=function(d,g,k){var m=0,t=function(){for(var A=document.querySelectorAll('div[id*="dgeMermaidOutput-"]'),I=0;I<A.length;I++)null!=A[I].parentNode&&A[I].parentNode.removeChild(A[I])},y=mxUtils.bind(this,function(){this.createTimeout(1E4,mxUtils.bind(this,-function(A){var I=new mxXmlRequest("https://www.draw.io/generate/v2",d,"POST"),F=mxUtils.bind(this,function(C){A.clear()&&(t(),k(C))});I.send(mxUtils.bind(this,function(C){if(A.isAlive())if(200<=C.getStatus()&&299>=C.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var S=mxUtils.trim(C.getText());this.generateMermaidImage(S,null,mxUtils.bind(this,function(V,P,u){this.tryAndHandle(mxUtils.bind(this,function(){A.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram","\nprompt:",-d,"\nresult:",S),t(),g(S,V,P,u))}),F)}),F,mxUtils.bind(this,function(V){3>m++?A.clear()&&y():F(V)}))}),F);else{var Q={message:mxResources.get("error")+" "+C.getStatus()};try{Q=JSON.parse(C.getText()),Q=Q.error}catch(S){}F(Q)}}),F)}),k)});y()};EditorUi.prototype.extractMermaidDeclaration=function(d){d=mxUtils.trim(d);"o\n\n"==d.substring(0,3)&&(d=d.substring(3));var g=d.split("```");g=1<g.length?g:d.split("<pre>");g=1<g.length?g:d.split("~~~");g=1<g.length?g:d.split("%%");g=1<g.length?g:d.split("(Begins)");+mxUtils.bind(this,function(t){this.loadingExtensions=!1;null!=k?k(t):this.handleError(t)});this.createTimeout(null,mxUtils.bind(this,function(t){var y=mxUtils.bind(this,function(I){t.clear()&&m(I)}),z=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(t.clear())if("undefined"!==typeof window.LucidImporter)try{var I=JSON.parse(d);g(LucidImporter.importState(I));try{if(null!=window.console&&"1"==urlParams.test){var F=[(new Date).toISOString(),"convertLucidChart",I];null!=I.state&&F.push(JSON.parse(I.state));+if(null!=I.svgThumbs)for(var C=0;C<I.svgThumbs.length;C++)F.push(Editor.createSvgDataUri(I.svgThumbs[C]));null!=I.thumb&&F.push(I.thumb);console.log.apply(console,F)}}catch(Q){}}catch(Q){null!=window.console&&console.error(Q),y(Q)}else y({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(z,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",function(){mxscript("js/orgchart/bridge.min.js",+function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",z,null,null,null,y)},null,null,null,y)},null,null,null,y)},null,null,null,y)},null,null,null,y):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",z,null,null,null,y))}),m)};EditorUi.prototype.createMermaidXml=function(d,g,k,m,t,y){var z=new Graph(document.createElement("div"));k=z.insertVertex(null,null,null,0,0,m,t,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="++k+";");z.setAttributeForCell(k,"mermaidData",JSON.stringify({data:d,config:g},null,2));null!=y&&z.setAttributeForCell(k,"templatePrompt",y);d=(new mxCodec).encode(z.getModel());return mxUtils.getXml(d)};EditorUi.prototype.generateOpenAiMermaidDiagram=function(d,g,k){var m=0,t=function(){for(var z=document.querySelectorAll('div[id*="dgeMermaidOutput-"]'),I=0;I<z.length;I++)null!=z[I].parentNode&&z[I].parentNode.removeChild(z[I])},y=mxUtils.bind(this,function(){this.createTimeout(1E4,mxUtils.bind(this,+function(z){var I=new mxXmlRequest("https://www.draw.io/generate/v2",d,"POST"),F=mxUtils.bind(this,function(C){z.clear()&&(t(),k(C))});I.send(mxUtils.bind(this,function(C){if(z.isAlive())if(200<=C.getStatus()&&299>=C.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var S=mxUtils.trim(C.getText());this.generateMermaidImage(S,null,mxUtils.bind(this,function(V,P,u){this.tryAndHandle(mxUtils.bind(this,function(){z.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram","\nprompt:",+d,"\nresult:",S),t(),g(S,V,P,u))}),F)}),F,mxUtils.bind(this,function(V){3>m++?z.clear()&&y():F(V)}))}),F);else{var Q={message:mxResources.get("error")+" "+C.getStatus()};try{Q=JSON.parse(C.getText()),Q=Q.error}catch(S){}F(Q)}}),F)}),k)});y()};EditorUi.prototype.extractMermaidDeclaration=function(d){d=mxUtils.trim(d);"o\n\n"==d.substring(0,3)&&(d=d.substring(3));var g=d.split("```");g=1<g.length?g:d.split("<pre>");g=1<g.length?g:d.split("~~~");g=1<g.length?g:d.split("%%");g=1<g.length?g:d.split("(Begins)");d=mxUtils.trim(1>=g.length?d:g[1]);g=d.split("\n");var k=1<g.length?g[1]:null;if(null!=k){var m=k.indexOf("-");0<m&&(k=k.substring(0,m))}if(0<g.length&&"mermaid"==mxUtils.trim(g[0])||null!=k&&0<=mxUtils.indexOf(EditorUi.mermaidDiagramTypes,k))g.shift(),d=mxUtils.trim(g.join("\n")),g=d.split("\n");k=g[0].split(" ")[0].replace(/:$/,"");m=k.indexOf("-");0<m&&(k=k.substring(0,m));try{"mindmap"==k&&2<g.length&&(d=extractMermaidMindmap(g))}catch(t){}0>mxUtils.indexOf(EditorUi.mermaidDiagramTypes,k)&&(d=-null);return d};EditorUi.prototype.generateMermaidImage=function(d,g,k,m,t){var y=mxUtils.bind(this,function(I){this.loadingMermaid=!1;null!=m?m(I):this.handleError(I)}),A=mxUtils.bind(this,function(){try{this.loadingMermaid=!1;g=null!=g?g:mxUtils.clone(EditorUi.defaultMermaidConfig);g.securityLevel="strict";g.startOnLoad=!1;g.maxTextSize=9E5;"undefined"!==typeof mxMermaidToDrawio&&g.flowchart&&0<=d.indexOf("$$")&&(g.flowchart.htmlLabels=!0,mxMermaidToDrawio.htmlLabels=!0);Editor.isDarkMode()&&(g.theme=+null);return d};EditorUi.prototype.generateMermaidImage=function(d,g,k,m,t){var y=mxUtils.bind(this,function(I){this.loadingMermaid=!1;null!=m?m(I):this.handleError(I)}),z=mxUtils.bind(this,function(){try{this.loadingMermaid=!1;g=null!=g?g:mxUtils.clone(EditorUi.defaultMermaidConfig);g.securityLevel="strict";g.startOnLoad=!1;g.maxTextSize=9E5;"undefined"!==typeof mxMermaidToDrawio&&g.flowchart&&0<=d.indexOf("$$")&&(g.flowchart.htmlLabels=!0,mxMermaidToDrawio.htmlLabels=!0);Editor.isDarkMode()&&(g.theme="dark");var I=mxUtils.bind(this,function(F){try{if(mxClient.IS_IE||mxClient.IS_IE11)F=F.replace(/ xmlns:\S*="http:\/\/www.w3.org\/XML\/1998\/namespace"/g,"").replace(/ (NS xml|\S*):space="preserve"/g,' xml:space="preserve"');var C=mxUtils.parseXml(F).getElementsByTagName("svg");if(0<C.length&&"error"!=C[0].getAttribute("aria-roledescription")){var Q=parseFloat(C[0].getAttribute("width")),S=parseFloat(C[0].getAttribute("height"));if(isNaN(Q)||isNaN(S))try{var V=C[0].getAttribute("viewBox").split(/\s+/);-Q=parseFloat(V[2]);S=parseFloat(V[3])}catch(P){Q=Q||100,S=S||100}k(this.convertDataUri(Editor.createSvgDataUri(F)),Q,S)}else null!=t?t():m({message:mxResources.get("invalidInput")})}catch(P){m(P)}});mermaid.mermaidAPI.initialize(g);mermaid.mermaidAPI.render("geMermaidOutput-"+(new Date).getTime(),d).then(function(F){I(F.svg)}).catch(function(F){null!=t?t(F):m(F)})}catch(F){m(F)}});"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(A,0):(this.loadingMermaid=!0,-"1"==urlParams.dev?("1"==urlParams.mermaidToDrawioTest&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(I){this.importXml(I,null,null,null,null,null,!0)})),mxscript("js/mermaid/mermaid.min.js",A,null,null,null,y)):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",A,null,null,null,y))};EditorUi.prototype.generatePlantUmlImage=function(d,g,k,m){function t(I,F,C){c1=I>>2;c2=(I&3)<<4|F>>4;c3=(F&15)<<2|C>>6;c4=C&63;r="";r+=y(c1&63);r+=y(c2&63);r+=y(c3&63);return r+=y(c4&63)}function y(I){if(10>-I)return String.fromCharCode(48+I);I-=10;if(26>I)return String.fromCharCode(65+I);I-=26;if(26>I)return String.fromCharCode(97+I);I-=26;return 0==I?"-":1==I?"_":"?"}var A=new XMLHttpRequest;A.open("GET",("txt"==g?PLANT_URL+"/txt/":"png"==g?PLANT_URL+"/png/":PLANT_URL+"/svg/")+function(I){r="";for(i=0;i<I.length;i+=3)r=i+2==I.length?r+t(I.charCodeAt(i),I.charCodeAt(i+1),0):i+1==I.length?r+t(I.charCodeAt(i),0,0):r+t(I.charCodeAt(i),I.charCodeAt(i+1),I.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(d))),-!0);"txt"!=g&&(A.responseType="blob");A.onload=function(I){if(200<=this.status&&300>this.status)if("txt"==g)k(this.response);else{var F=new FileReader;F.readAsDataURL(this.response);F.onloadend=function(C){var Q=new Image;Q.onload=function(){try{var S=Q.width,V=Q.height;if(0==S&&0==V){var P=F.result,u=P.indexOf(","),x=decodeURIComponent(escape(atob(P.substring(u+1)))),J=mxUtils.parseXml(x).getElementsByTagName("svg");0<J.length&&(S=parseFloat(J[0].getAttribute("width")),V=parseFloat(J[0].getAttribute("height")))}k(F.result,-S,V)}catch(H){m(H)}};Q.src=F.result};F.onerror=function(C){m(C)}}else m(I)};A.onerror=function(I){m(I)};A.send()};EditorUi.prototype.insertAsPreText=function(d,g,k){var m=this.editor.graph,t=null;m.getModel().beginUpdate();try{t=m.insertVertex(null,null,"<pre>"+d+"</pre>",g,k,1,1,"text;html=1;align=left;verticalAlign=top;"),m.updateCellSize(t,!0)}finally{m.getModel().endUpdate()}return t};EditorUi.prototype.insertTextAt=function(d,g,k,m,t,y,A,I){y=null!=y?y:!0;A=null!=A?A:!0;if(null!=d)if(Graph.fileSupport&&+Q=parseFloat(V[2]);S=parseFloat(V[3])}catch(P){Q=Q||100,S=S||100}k(this.convertDataUri(Editor.createSvgDataUri(F)),Q,S)}else null!=t?t():m({message:mxResources.get("invalidInput")})}catch(P){m(P)}});mermaid.mermaidAPI.initialize(g);mermaid.mermaidAPI.render("geMermaidOutput-"+(new Date).getTime(),d).then(function(F){I(F.svg)}).catch(function(F){null!=t?t(F):m(F)})}catch(F){m(F)}});"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(z,0):(this.loadingMermaid=!0,+"1"==urlParams.dev?("1"==urlParams.mermaidToDrawioTest&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(I){this.importXml(I,null,null,null,null,null,!0)})),mxscript("js/mermaid/mermaid.min.js",z,null,null,null,y)):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",z,null,null,null,y))};EditorUi.prototype.generatePlantUmlImage=function(d,g,k,m){function t(I,F,C){c1=I>>2;c2=(I&3)<<4|F>>4;c3=(F&15)<<2|C>>6;c4=C&63;r="";r+=y(c1&63);r+=y(c2&63);r+=y(c3&63);return r+=y(c4&63)}function y(I){if(10>+I)return String.fromCharCode(48+I);I-=10;if(26>I)return String.fromCharCode(65+I);I-=26;if(26>I)return String.fromCharCode(97+I);I-=26;return 0==I?"-":1==I?"_":"?"}var z=new XMLHttpRequest;z.open("GET",("txt"==g?PLANT_URL+"/txt/":"png"==g?PLANT_URL+"/png/":PLANT_URL+"/svg/")+function(I){r="";for(i=0;i<I.length;i+=3)r=i+2==I.length?r+t(I.charCodeAt(i),I.charCodeAt(i+1),0):i+1==I.length?r+t(I.charCodeAt(i),0,0):r+t(I.charCodeAt(i),I.charCodeAt(i+1),I.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(d))),+!0);"txt"!=g&&(z.responseType="blob");z.onload=function(I){if(200<=this.status&&300>this.status)if("txt"==g)k(this.response);else{var F=new FileReader;F.readAsDataURL(this.response);F.onloadend=function(C){var Q=new Image;Q.onload=function(){try{var S=Q.width,V=Q.height;if(0==S&&0==V){var P=F.result,u=P.indexOf(","),x=decodeURIComponent(escape(atob(P.substring(u+1)))),J=mxUtils.parseXml(x).getElementsByTagName("svg");0<J.length&&(S=parseFloat(J[0].getAttribute("width")),V=parseFloat(J[0].getAttribute("height")))}k(F.result,+S,V)}catch(H){m(H)}};Q.src=F.result};F.onerror=function(C){m(C)}}else m(I)};z.onerror=function(I){m(I)};z.send()};EditorUi.prototype.insertAsPreText=function(d,g,k){var m=this.editor.graph,t=null;m.getModel().beginUpdate();try{t=m.insertVertex(null,null,"<pre>"+d+"</pre>",g,k,1,1,"text;html=1;align=left;verticalAlign=top;"),m.updateCellSize(t,!0)}finally{m.getModel().endUpdate()}return t};EditorUi.prototype.insertTextAt=function(d,g,k,m,t,y,z,I){y=null!=y?y:!0;z=null!=z?z:!0;if(null!=d)if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d))this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(d.replace(/\s+/g," "),mxUtils.bind(this,function(V){4==V.readyState&&200<=V.status&&299>=V.status&&this.editor.graph.setSelectionCells(this.insertTextAt(V.responseText,g,k,!0))}));else if("data:"==d.substring(0,5)||!this.isOffline()&&(t||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(d))){var F=this.editor.graph;if("data:application/pdf;base64,"==d.substring(0,28)){var C=Editor.extractGraphModelFromPdf(d);if(null!=C&&0<C.length)return this.importXml(C,g,k,y,!0,I)}if(Editor.isPngDataUrl(d)&&(C=Editor.extractGraphModelFromPng(d),null!=C&&0<C.length))return this.importXml(C,g,k,y,!0,I);if("data:image/svg+xml;"==d.substring(0,19))try{C=null;"data:image/svg+xml;base64,"==d.substring(0,26)?(C=d.substring(d.indexOf(",")+1),C=window.atob&&!mxClient.IS_SF?atob(C):Base64.decode(C,!0)):C=decodeURIComponent(d.substring(d.indexOf(",")+1));var Q=this.importXml(C,-g,k,y,!0,I);if(0<Q.length)return Q}catch(V){}this.loadImage(d,mxUtils.bind(this,function(V){if("data:"==d.substring(0,5))this.resizeImage(V,d,mxUtils.bind(this,function(x,J,H){F.setSelectionCell(F.insertVertex(null,null,"",F.snap(g),F.snap(k),J,H,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(x)+";"))}),A,this.maxImageSize);else{var P=Math.min(1,Math.min(this.maxImageSize/V.width,this.maxImageSize/V.height)),+g,k,y,!0,I);if(0<Q.length)return Q}catch(V){}this.loadImage(d,mxUtils.bind(this,function(V){if("data:"==d.substring(0,5))this.resizeImage(V,d,mxUtils.bind(this,function(x,J,H){F.setSelectionCell(F.insertVertex(null,null,"",F.snap(g),F.snap(k),J,H,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(x)+";"))}),z,this.maxImageSize);else{var P=Math.min(1,Math.min(this.maxImageSize/V.width,this.maxImageSize/V.height)),u=Math.round(V.width*P);V=Math.round(V.height*P);F.setSelectionCell(F.insertVertex(null,null,"",F.snap(g),F.snap(k),u,V,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+d+";"))}}),mxUtils.bind(this,function(){var V=null;F.getModel().beginUpdate();try{V=F.insertVertex(F.getDefaultParent(),null,d,F.snap(g),F.snap(k),1,1,"text;"+(m?"html=1;":"")),F.updateCellSize(V),F.fireEvent(new mxEventObject("textInserted","cells",[V]))}finally{F.getModel().endUpdate()}F.setSelectionCell(V)}))}else{d=Graph.zapGremlins(mxUtils.trim(d));if(this.isCompatibleString(d))return this.importXml(d,g,k,y,null,I);if(0<d.length)if(this.isLucidChartData(d))this.convertLucidChart(d,mxUtils.bind(this,function(V){this.editor.graph.setSelectionCells(this.importXml(V,g,k,y,null,I))}),mxUtils.bind(this,function(V){this.handleError(V)}));else{F=this.editor.graph;t=null;F.getModel().beginUpdate();try{t=F.insertVertex(F.getDefaultParent(),null,"",F.snap(g),F.snap(k),1,1,"text;whiteSpace=wrap;"+(m?"html=1;":""));F.fireEvent(new mxEventObject("textInserted","cells",[t]));m&&(d=F.sanitizeHtml(d));d.length>this.maxTextBytes&&(d=d.substring(0,this.maxTextBytes)+"...");t.value=d;F.updateCellSize(t);if(0<this.maxTextWidth&&t.geometry.width>this.maxTextWidth){var S=F.getPreferredSizeForCell(t,this.maxTextWidth);t.geometry.width=S.width;t.geometry.height=S.height}Graph.isLink(t.value)&&F.setLinkForCell(t,t.value);t.geometry.width+=F.gridSize;t.geometry.height+=F.gridSize}finally{F.getModel().endUpdate()}return[t]}}return[]};EditorUi.prototype.formatFileSize=function(d){var g=-1;do d/=1024,g++;while(1024<d);return Math.max(d,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[g]};EditorUi.prototype.convertDataUri=function(d){if("data:"==d.substring(0,5)){var g=d.indexOf(";");0<g&&(d=d.substring(0,g)+d.substring(d.indexOf(",",g+1)))}return d};EditorUi.prototype.isRemoteFileFormat=function(d,g){return/("contentType":\s*"application\/gliffy\+json")/.test(d)};EditorUi.prototype.isLucidChartData=function(d){return null!=d&&('{"state":"{\\"Properties\\":'==d.substring(0,26)||'{"Properties":'==d.substring(0,14))};EditorUi.prototype.importLocalFile=function(d,g){if(d&&Graph.fileSupport){if(null==this.importFileInputElt){var k=document.createElement("input");k.setAttribute("type","file");mxEvent.addListener(k,"change",mxUtils.bind(this,function(){null!=k.files&&(this.importFiles(k.files,null,null,this.maxImageSize),k.type="",k.type="file",k.value="")}));k.style.display="none";document.body.appendChild(k);this.importFileInputElt=k}this.importFileInputElt.click()}else{window.openNew=-!1;window.openKey="import";window.listBrowserFiles=mxUtils.bind(this,function(A,I){StorageFile.listFiles(this,"F",A,I)});window.openBrowserFile=mxUtils.bind(this,function(A,I,F){StorageFile.getFileContent(this,A,I,F)});window.deleteBrowserFile=mxUtils.bind(this,function(A,I,F){StorageFile.deleteFile(this,A,I,F)});if(!g){var m=Editor.useLocalStorage;Editor.useLocalStorage=!d}window.openFile=new OpenFile(mxUtils.bind(this,function(A){this.hideDialog(A)}));window.openFile.setConsumer(mxUtils.bind(this,-function(A,I){null!=I&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(I)?(A=new Blob([A],{type:"application/octet-stream"}),this.importVisio(A,mxUtils.bind(this,function(F){this.importXml(F,0,0,!0)}),null,I)):this.editor.graph.setSelectionCells(this.importXml(A,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null});if(!g){var t=this.dialog,y=t.close;this.dialog.close=mxUtils.bind(this,function(A){Editor.useLocalStorage=-m;y.apply(t,arguments);A&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(d,g,k){var m=this,t=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(d).then(function(y){if(mxUtils.isEmptyObject(y.files))k();else{var A=0,I,F=!1;y.forEach(function(C,Q){C=Q.name.toLowerCase();"diagram/diagram.xml"==C?(F=!0,Q.async("string").then(function(S){0==S.indexOf("<mxfile ")?g(S):k()})):0==C.indexOf("versions/")&&-(C=parseInt(C.substr(9)),C>A&&(A=C,I=Q))});0<A?I.async("string").then(function(C){(new XMLHttpRequest).upload&&m.isRemoteFileFormat(C,d.name)?m.isOffline()?m.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,k):m.parseFileData(C,mxUtils.bind(this,function(Q){4==Q.readyState&&(200<=Q.status&&299>=Q.status?g(Q.responseText):k())}),d.name):k()}):F||k()}},function(y){k(y)}):k()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?t():(this.loadingExtensions=!0,-mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",t,null,null,null,k))};EditorUi.prototype.importFile=function(d,g,k,m,t,y,A,I,F,C,Q,S){C=null!=C?C:!0;var V=!1,P=null,u=mxUtils.bind(this,function(x){var J=null;null!=x&&"<mxlibrary"==x.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,x,A)),this.showSidebar()):J=this.importXml(x,k,m,C,null,null!=S?mxEvent.isControlDown(S):null);null!=I&&I(J)});"image"==g.substring(0,5)?(F=!1,"image/png"==g.substring(0,9)&&(Q=Q?null:this.extractGraphModelFromPng(d),+!1;window.openKey="import";window.listBrowserFiles=mxUtils.bind(this,function(z,I){StorageFile.listFiles(this,"F",z,I)});window.openBrowserFile=mxUtils.bind(this,function(z,I,F){StorageFile.getFileContent(this,z,I,F)});window.deleteBrowserFile=mxUtils.bind(this,function(z,I,F){StorageFile.deleteFile(this,z,I,F)});if(!g){var m=Editor.useLocalStorage;Editor.useLocalStorage=!d}window.openFile=new OpenFile(mxUtils.bind(this,function(z){this.hideDialog(z)}));window.openFile.setConsumer(mxUtils.bind(this,+function(z,I){null!=I&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(I)?(z=new Blob([z],{type:"application/octet-stream"}),this.importVisio(z,mxUtils.bind(this,function(F){this.importXml(F,0,0,!0)}),null,I)):this.editor.graph.setSelectionCells(this.importXml(z,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null});if(!g){var t=this.dialog,y=t.close;this.dialog.close=mxUtils.bind(this,function(z){Editor.useLocalStorage=+m;y.apply(t,arguments);z&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(d,g,k){var m=this,t=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(d).then(function(y){if(mxUtils.isEmptyObject(y.files))k();else{var z=0,I,F=!1;y.forEach(function(C,Q){C=Q.name.toLowerCase();"diagram/diagram.xml"==C?(F=!0,Q.async("string").then(function(S){0==S.indexOf("<mxfile ")?g(S):k()})):0==C.indexOf("versions/")&&+(C=parseInt(C.substr(9)),C>z&&(z=C,I=Q))});0<z?I.async("string").then(function(C){(new XMLHttpRequest).upload&&m.isRemoteFileFormat(C,d.name)?m.isOffline()?m.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,k):m.parseFileData(C,mxUtils.bind(this,function(Q){4==Q.readyState&&(200<=Q.status&&299>=Q.status?g(Q.responseText):k())}),d.name):k()}):F||k()}},function(y){k(y)}):k()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?t():(this.loadingExtensions=!0,+mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",t,null,null,null,k))};EditorUi.prototype.importFile=function(d,g,k,m,t,y,z,I,F,C,Q,S){C=null!=C?C:!0;var V=!1,P=null,u=mxUtils.bind(this,function(x){var J=null;null!=x&&"<mxlibrary"==x.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,x,z)),this.showSidebar()):J=this.importXml(x,k,m,C,null,null!=S?mxEvent.isControlDown(S):null);null!=I&&I(J)});"image"==g.substring(0,5)?(F=!1,"image/png"==g.substring(0,9)&&(Q=Q?null:this.extractGraphModelFromPng(d),null!=Q&&0<Q.length&&(P=this.importXml(Q,k,m,C,null,null!=S?mxEvent.isControlDown(S):null),F=!0)),F||(F=this.editor.graph,Q=d.indexOf(";"),0<Q&&(d=d.substring(0,Q)+d.substring(d.indexOf(",",Q+1))),C&&F.isGridEnabled()&&(k=F.snap(k),m=F.snap(m)),Q="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;","image/svg"==g.substring(0,9)&&(Q+="editableCssRules=.*;"),P=[F.insertVertex(null,null,"",k,m,t,y,Q+"image="+d+";")])):/(\.*<graphml )/.test(d)?-(V=!0,this.importGraphML(d,u)):null!=F&&null!=A&&EditorUi.isVisioFilename(A)?(V=!0,this.importVisio(F,u)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,A)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(V=!0,g=mxUtils.bind(this,function(x){4==x.readyState&&(200<=x.status&&299>=x.status?u(x.responseText):null!=I&&(I(null),this.showError(mxResources.get("error"),413==x.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),-null!=d?this.parseFileData(d,g,A):this.parseFile(F,g,A)):0==d.indexOf("PK")&&null!=F?(V=!0,this.importZipFile(F,u,mxUtils.bind(this,function(){P=this.insertTextAt(this.validateFileData(d),k,m,!0,null,C);I(P)}))):/(\.v(sd|dx))($|\?)/i.test(A)||/(\.vs(s|x))($|\?)/i.test(A)||(P=this.insertTextAt(this.validateFileData(d),k,m,!0,null,C,null,null!=S?mxEvent.isControlDown(S):null));V||null==I||I(P);return P};EditorUi.prototype.importFiles=function(d,g,k,m,t,y,A,I,F,C,Q,S,V){m=null!=m?m:this.maxImageSize;-C=null!=C?C:this.maxImageBytes;var P=null!=g&&null!=k,u=!0;g=null!=g?g:0;k=null!=k?k:0;var x=!1;if(!mxClient.IS_CHROMEAPP&&null!=d)for(var J=Q||this.resampleThreshold,H=0;H<d.length;H++)if("image/svg"!==d[H].type.substring(0,9)&&"image/"===d[H].type.substring(0,6)&&d[H].size>J){x=!0;break}var K=mxUtils.bind(this,function(){var O=this.editor.graph,M=O.gridSize;t=null!=t?t:mxUtils.bind(this,function(R,T,U,W,X,Y,Z,ca,ea){try{if(null!=R&&"<mxlibrary"==R.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,-R,Z)),this.showSidebar(),null;this.isCompatibleString(R)&&1==d.length&&null!=V&&"drop"==V.type&&this.isBlankFile()&&!this.canUndo()&&(P=!1,W=U=0);return this.importFile(R,T,U,W,X,Y,Z,ca,ea,P,S,V)}catch(ja){return this.handleError(ja),null}});y=null!=y?y:mxUtils.bind(this,function(R){O.setSelectionCells(R)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var n=d.length,z=n,D=[],L=mxUtils.bind(this,function(R,T){D[R]=T;if(0==--z){this.spinner.stop();if(null!=I)I(D);else{var U=[];-O.getModel().beginUpdate();try{for(R=0;R<D.length;R++){var W=D[R]();null!=W&&(U=U.concat(W))}}finally{O.getModel().endUpdate()}}y(U)}}),N=0;N<n;N++)mxUtils.bind(this,function(R){var T=d[R];if(null!=T){var U=new FileReader;U.onload=mxUtils.bind(this,function(W){if(null==A||A(T))try{if("image/"==T.type.substring(0,6))if("image/svg"==T.type.substring(0,9)){var X=Graph.clipSvgDataUri(W.target.result),Y=X.indexOf(","),Z=decodeURIComponent(escape(atob(X.substring(Y+1)))),ca=mxUtils.parseXml(Z),ea=ca.getElementsByTagName("svg");-if(0<ea.length){var ja=ea[0],ba=S?null:ja.getAttribute("content");null!=ba&&"<"!=ba.charAt(0)&&"%"!=ba.charAt(0)&&(ba=unescape(window.atob?atob(ba):Base64.decode(ba,!0)));null!=ba&&"%"==ba.charAt(0)&&(ba=decodeURIComponent(ba));null==ba||"<mxfile "!==ba.substring(0,8)&&"<mxGraphModel "!==ba.substring(0,14)?L(R,mxUtils.bind(this,function(){try{if(null!=ca){var ia=ca.getElementsByTagName("svg");if(0<ia.length){var ha=ia[0],da=ha.getAttribute("width"),Ba=ha.getAttribute("height");da=null!=da&&"%"!=da.charAt(da.length-+(V=!0,this.importGraphML(d,u)):null!=F&&null!=z&&EditorUi.isVisioFilename(z)?(V=!0,this.importVisio(F,u)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,z)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(V=!0,g=mxUtils.bind(this,function(x){4==x.readyState&&(200<=x.status&&299>=x.status?u(x.responseText):null!=I&&(I(null),this.showError(mxResources.get("error"),413==x.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),+null!=d?this.parseFileData(d,g,z):this.parseFile(F,g,z)):0==d.indexOf("PK")&&null!=F?(V=!0,this.importZipFile(F,u,mxUtils.bind(this,function(){P=this.insertTextAt(this.validateFileData(d),k,m,!0,null,C);I(P)}))):/(\.v(sd|dx))($|\?)/i.test(z)||/(\.vs(s|x))($|\?)/i.test(z)||(P=this.insertTextAt(this.validateFileData(d),k,m,!0,null,C,null,null!=S?mxEvent.isControlDown(S):null));V||null==I||I(P);return P};EditorUi.prototype.importFiles=function(d,g,k,m,t,y,z,I,F,C,Q,S,V){m=null!=m?m:this.maxImageSize;+C=null!=C?C:this.maxImageBytes;var P=null!=g&&null!=k,u=!0;g=null!=g?g:0;k=null!=k?k:0;var x=!1;if(!mxClient.IS_CHROMEAPP&&null!=d)for(var J=Q||this.resampleThreshold,H=0;H<d.length;H++)if("image/svg"!==d[H].type.substring(0,9)&&"image/"===d[H].type.substring(0,6)&&d[H].size>J){x=!0;break}var K=mxUtils.bind(this,function(){var N=this.editor.graph,M=N.gridSize;t=null!=t?t:mxUtils.bind(this,function(R,T,U,W,X,Y,Z,ca,ea){try{if(null!=R&&"<mxlibrary"==R.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,+R,Z)),this.showSidebar(),null;this.isCompatibleString(R)&&1==d.length&&null!=V&&"drop"==V.type&&this.isBlankFile()&&!this.canUndo()&&(P=!1,W=U=0);return this.importFile(R,T,U,W,X,Y,Z,ca,ea,P,S,V)}catch(ia){return this.handleError(ia),null}});y=null!=y?y:mxUtils.bind(this,function(R){N.setSelectionCells(R)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var n=d.length,A=n,E=[],L=mxUtils.bind(this,function(R,T){E[R]=T;if(0==--A){this.spinner.stop();if(null!=I)I(E);else{var U=[];+N.getModel().beginUpdate();try{for(R=0;R<E.length;R++){var W=E[R]();null!=W&&(U=U.concat(W))}}finally{N.getModel().endUpdate()}}y(U)}}),O=0;O<n;O++)mxUtils.bind(this,function(R){var T=d[R];if(null!=T){var U=new FileReader;U.onload=mxUtils.bind(this,function(W){if(null==z||z(T))try{if("image/"==T.type.substring(0,6))if("image/svg"==T.type.substring(0,9)){var X=Graph.clipSvgDataUri(W.target.result),Y=X.indexOf(","),Z=decodeURIComponent(escape(atob(X.substring(Y+1)))),ca=mxUtils.parseXml(Z),ea=ca.getElementsByTagName("svg");+if(0<ea.length){var ia=ea[0],ba=S?null:ia.getAttribute("content");null!=ba&&"<"!=ba.charAt(0)&&"%"!=ba.charAt(0)&&(ba=unescape(window.atob?atob(ba):Base64.decode(ba,!0)));null!=ba&&"%"==ba.charAt(0)&&(ba=decodeURIComponent(ba));null==ba||"<mxfile "!==ba.substring(0,8)&&"<mxGraphModel "!==ba.substring(0,14)?L(R,mxUtils.bind(this,function(){try{if(null!=ca){var ja=ca.getElementsByTagName("svg");if(0<ja.length){var ha=ja[0],da=ha.getAttribute("width"),Ba=ha.getAttribute("height");da=null!=da&&"%"!=da.charAt(da.length-1)?parseFloat(da):NaN;Ba=null!=Ba&&"%"!=Ba.charAt(Ba.length-1)?parseFloat(Ba):NaN;var na=ha.getAttribute("viewBox");if(null==na||0==na.length)ha.setAttribute("viewBox","0 0 "+da+" "+Ba);else if(isNaN(da)||isNaN(Ba)){var va=na.split(" ");3<va.length&&(da=parseFloat(va[2]),Ba=parseFloat(va[3]))}X=Editor.createSvgDataUri(mxUtils.getXml(ha));var Aa=Math.min(1,Math.min(m/Math.max(1,da)),m/Math.max(1,Ba)),ka=t(X,T.type,g+R*M,k+R*M,Math.max(1,Math.round(da*Aa)),Math.max(1,Math.round(Ba*Aa)),T.name);if(null!=-ka&&(isNaN(da)||isNaN(Ba))){var ta=new Image;ta.onload=mxUtils.bind(this,function(){da=Math.max(1,ta.width);Ba=Math.max(1,ta.height);ka[0].geometry.width=da;ka[0].geometry.height=Ba;ha.setAttribute("viewBox","0 0 "+da+" "+Ba);X=Editor.createSvgDataUri(mxUtils.getXml(ha));var pa=X.indexOf(";");0<pa&&(X=X.substring(0,pa)+X.substring(X.indexOf(",",pa+1)));O.setCellStyles("image",X,[ka[0]])});ta.src=Editor.createSvgDataUri(mxUtils.getXml(ha))}return ka}}}catch(pa){}return null})):L(R,mxUtils.bind(this,+ka&&(isNaN(da)||isNaN(Ba))){var ta=new Image;ta.onload=mxUtils.bind(this,function(){da=Math.max(1,ta.width);Ba=Math.max(1,ta.height);ka[0].geometry.width=da;ka[0].geometry.height=Ba;ha.setAttribute("viewBox","0 0 "+da+" "+Ba);X=Editor.createSvgDataUri(mxUtils.getXml(ha));var pa=X.indexOf(";");0<pa&&(X=X.substring(0,pa)+X.substring(X.indexOf(",",pa+1)));N.setCellStyles("image",X,[ka[0]])});ta.src=Editor.createSvgDataUri(mxUtils.getXml(ha))}return ka}}}catch(pa){}return null})):L(R,mxUtils.bind(this,function(){return t(ba,"text/xml",g+R*M,k+R*M,0,0,T.name)}))}else L(R,mxUtils.bind(this,function(){return null}))}else{Y=!1;if("image/png"==T.type){var fa=S?null:this.extractGraphModelFromPng(W.target.result);if(null!=fa&&0<fa.length){var aa=new Image;aa.src=W.target.result;L(R,mxUtils.bind(this,function(){return t(fa,"text/xml",g+R*M,k+R*M,aa.width,aa.height,T.name)}));Y=!0}}Y||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),-mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(W.target.result,mxUtils.bind(this,function(ia){this.resizeImage(ia,W.target.result,mxUtils.bind(this,function(ha,da,Ba){L(R,mxUtils.bind(this,function(){if(null!=ha&&ha.length<C){var na=u&&this.isResampleImageSize(T.size,Q)?Math.min(1,Math.min(m/da,m/Ba)):1;return t(ha,T.type,g+R*M,k+R*M,Math.round(da*na),Math.round(Ba*na),T.name)}this.handleError({message:mxResources.get("imageTooBig")});-return null}))}),u,m,Q,T.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else X=W.target.result,t(X,T.type,g+R*M,k+R*M,240,160,T.name,function(ia){L(R,function(){return ia})},T)}catch(ia){L(R,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(ia,T)}else L(R,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(T.name)?t(null,T.type,g+R*M,k+R*M,240,160,T.name,function(W){L(R,function(){return W})},-T):"image"==T.type.substring(0,5)||"application/pdf"==T.type?U.readAsDataURL(T):U.readAsText(T)}})(N)});if(x){x=[];for(H=0;H<d.length;H++)x.push(d[H]);d=x;this.confirmImageResize(function(O){u=O;K()},F)}else K()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=function(d,g){g=null!=g?g:!1;var k=null!=this.spinner&&null!=this.spinner.pause?-this.spinner.pause():function(){},m=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,t=function(y,A){if(y||g)mxSettings.setResizeImages(y?A:null),mxSettings.save();k();d(A)};null==m||g?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(y){t(y,!0)},function(y){t(y,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',+mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(W.target.result,mxUtils.bind(this,function(ja){this.resizeImage(ja,W.target.result,mxUtils.bind(this,function(ha,da,Ba){L(R,mxUtils.bind(this,function(){if(null!=ha&&ha.length<C){var na=u&&this.isResampleImageSize(T.size,Q)?Math.min(1,Math.min(m/da,m/Ba)):1;return t(ha,T.type,g+R*M,k+R*M,Math.round(da*na),Math.round(Ba*na),T.name)}this.handleError({message:mxResources.get("imageTooBig")});+return null}))}),u,m,Q,T.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else X=W.target.result,t(X,T.type,g+R*M,k+R*M,240,160,T.name,function(ja){L(R,function(){return ja})},T)}catch(ja){L(R,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(ja,T)}else L(R,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(T.name)?t(null,T.type,g+R*M,k+R*M,240,160,T.name,function(W){L(R,function(){return W})},+T):"image"==T.type.substring(0,5)||"application/pdf"==T.type?U.readAsDataURL(T):U.readAsText(T)}})(O)});if(x){x=[];for(H=0;H<d.length;H++)x.push(d[H]);d=x;this.confirmImageResize(function(N){u=N;K()},F)}else K()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=function(d,g){g=null!=g?g:!1;var k=null!=this.spinner&&null!=this.spinner.pause?+this.spinner.pause():function(){},m=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,t=function(y,z){if(y||g)mxSettings.setResizeImages(y?z:null),mxSettings.save();k();d(z)};null==m||g?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(y){t(y,!0)},function(y){t(y,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?226:200,!0,!0):t(!1,m)};EditorUi.prototype.parseFile=function(d,g,k){k=null!=k?k:d.name;var m=new FileReader;m.onload=mxUtils.bind(this,function(){this.parseFileData(m.result,g,k)});m.readAsText(d)};EditorUi.prototype.parseFileData=function(d,g,k){var m=new XMLHttpRequest;m.open("POST",OPEN_URL);m.setRequestHeader("Content-Type","application/x-www-form-urlencoded");m.onreadystatechange=function(){g(m)};m.send("format=xml&filename="+-encodeURIComponent(k)+"&data="+encodeURIComponent(d));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(t){}};EditorUi.prototype.isResampleImageSize=function(d,g){g=null!=g?g:this.resampleThreshold;return d>g};EditorUi.prototype.resizeImage=function(d,g,k,m,t,y,A){t=null!=t?t:this.maxImageSize;var I=Math.max(1,d.width),F=Math.max(1,d.height),C=g;if(m&&this.isResampleImageSize(null!=A?A:g.length,y))try{var Q=Math.max(I/t,F/t);if(1<Q){var S=Math.round(I/Q),V=Math.round(F/-Q),P=document.createElement("canvas");P.width=S;P.height=V;P.getContext("2d").drawImage(d,0,0,S,V);var u=P.toDataURL();if(u.length<g.length){var x=document.createElement("canvas");x.width=S;x.height=V;var J=x.toDataURL();u!==J&&(g=u,I=S,F=V)}}}catch(H){}m&&C!=g&&t>this.maxImageSize/2&&g.length>this.maxImageBytes?this.resizeImage(d,g,k,m,t/1.5,y,A):k(g,I,F)};EditorUi.prototype.extractGraphModelFromPng=function(d){return Editor.extractGraphModelFromPng(d)};EditorUi.prototype.loadImage=function(d,g,+encodeURIComponent(k)+"&data="+encodeURIComponent(d));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(t){}};EditorUi.prototype.isResampleImageSize=function(d,g){g=null!=g?g:this.resampleThreshold;return d>g};EditorUi.prototype.resizeImage=function(d,g,k,m,t,y,z){t=null!=t?t:this.maxImageSize;var I=Math.max(1,d.width),F=Math.max(1,d.height),C=g;if(m&&this.isResampleImageSize(null!=z?z:g.length,y))try{var Q=Math.max(I/t,F/t);if(1<Q){var S=Math.round(I/Q),V=Math.round(F/+Q),P=document.createElement("canvas");P.width=S;P.height=V;P.getContext("2d").drawImage(d,0,0,S,V);var u=P.toDataURL();if(u.length<g.length){var x=document.createElement("canvas");x.width=S;x.height=V;var J=x.toDataURL();u!==J&&(g=u,I=S,F=V)}}}catch(H){}m&&C!=g&&t>this.maxImageSize/2&&g.length>this.maxImageBytes?this.resizeImage(d,g,k,m,t/1.5,y,z):k(g,I,F)};EditorUi.prototype.extractGraphModelFromPng=function(d){return Editor.extractGraphModelFromPng(d)};EditorUi.prototype.loadImage=function(d,g,k){try{var m=new Image;m.onload=function(){m.width=0<m.width?m.width:120;m.height=0<m.height?m.height:120;g(m)};null!=k&&(m.onerror=k);m.src=d}catch(t){if(null!=k)k(t);else throw t;}};EditorUi.prototype.getDefaultSketchMode=function(){var d="1"==urlParams.sketch;return"0"!=(null!=urlParams.rough?urlParams.rough:d)};var l=EditorUi.prototype.createUi;EditorUi.prototype.createUi=function(){Editor.isSettingsEnabled()&&(null!=mxSettings.settings.sidebarTitles&&(Sidebar.prototype.sidebarTitles=mxSettings.settings.sidebarTitles),this.formatWidth=mxSettings.getFormatWidth());l.apply(this,arguments);Editor.isSettingsEnabled()&&this.doSetSketchMode(null!=mxSettings.settings.sketchMode&&null==urlParams.rough&&null==urlParams.sketch?mxSettings.settings.sketchMode:this.getDefaultSketchMode())};var p=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();var d=this,g=this.editor.graph,k=g.isEnabled;g.isEnabled=function(){return k.apply(this,arguments)&&-!d.isLocked()};Graph.touchStyle&&(g.panningHandler.isPanningTrigger=function(M){var n=M.getEvent();return null==M.getState()&&!mxEvent.isMouseEvent(n)&&!g.freehand.isDrawing()||mxEvent.isPopupTrigger(n)&&(null==M.getState()||mxEvent.isControlDown(n)||mxEvent.isShiftDown(n))});g.cellEditor.editPlantUmlData=function(M,n,z){var D=JSON.parse(z);n=new TextareaDialog(d,mxResources.get("plantUml")+":",D.data,function(L){null!=L&&d.spinner.spin(document.body,mxResources.get("inserting"))&&d.generatePlantUmlImage(L,-D.format,function(N,R,T){d.spinner.stop();g.getModel().beginUpdate();try{if("txt"==D.format)g.labelChanged(M,"<pre>"+N+"</pre>"),g.updateCellSize(M,!0);else{g.setCellStyles("image",d.convertDataUri(N),[M]);var U=g.model.getGeometry(M);null!=U&&(U=U.clone(),U.width=R,U.height=T,g.cellsResized([M],[U],!1))}g.setAttributeForCell(M,"plantUmlData",JSON.stringify({data:L,format:D.format}))}finally{g.getModel().endUpdate()}},function(N){d.handleError(N)})},null,null,400,220);d.showDialog(n.container,420,-300,!0,!0);n.init()};g.cellEditor.editMermaidData=function(M,n,z){var D=JSON.parse(z);n=new TextareaDialog(d,mxResources.get("mermaid")+":",D.data,function(L){null!=L&&d.spinner.spin(document.body,mxResources.get("inserting"))&&d.generateMermaidImage(L,D.config,function(N,R,T){d.spinner.stop();g.getModel().beginUpdate();try{g.setCellStyles("image",N,[M]);var U=g.model.getGeometry(M);null!=U&&(U=U.clone(),U.width=Math.max(U.width,R),U.height=Math.max(U.height,T),g.cellsResized([M],[U],!1));g.setAttributeForCell(M,-"mermaidData",JSON.stringify({data:L,config:D.config},null,2))}finally{g.getModel().endUpdate()}},function(N){d.handleError(N)})},null,null,400,220);d.showDialog(n.container,420,300,!0,!0);n.init()};var m=g.cellEditor.startEditing;g.cellEditor.startEditing=function(M,n){try{var z=this.graph.getAttributeForCell(M,"plantUmlData");if(null!=z)this.editPlantUmlData(M,n,z);else if(z=this.graph.getAttributeForCell(M,"mermaidData"),null!=z&&window.isMermaidEnabled)this.editMermaidData(M,n,z);else{var D=g.getCellStyle(M);-"1"==mxUtils.getValue(D,"metaEdit","0")?d.showDataDialog(M):m.apply(this,arguments)}}catch(L){d.handleError(L)}};g.getLinkTitle=function(M){return d.getLinkTitle(M)};g.customLinkClicked=function(M,n){var z=!1;try{var D=this.getGraphBounds();d.handleCustomLink(M,n);z=!0;d.chromelessResize&&!D.equals(this.getGraphBounds())&&(d.chromelessResize(),this.scrollCellToVisible(n))}catch(L){d.handleError(L)}return z};var t=g.parseBackgroundImage;g.parseBackgroundImage=function(M){var n=t.apply(this,arguments);+!d.isLocked()};Graph.touchStyle&&(g.panningHandler.isPanningTrigger=function(M){var n=M.getEvent();return null==M.getState()&&!mxEvent.isMouseEvent(n)&&!g.freehand.isDrawing()||mxEvent.isPopupTrigger(n)&&(null==M.getState()||mxEvent.isControlDown(n)||mxEvent.isShiftDown(n))});g.cellEditor.editPlantUmlData=function(M,n,A){var E=JSON.parse(A);n=new TextareaDialog(d,mxResources.get("plantUml")+":",E.data,function(L){null!=L&&d.spinner.spin(document.body,mxResources.get("inserting"))&&d.generatePlantUmlImage(L,+E.format,function(O,R,T){d.spinner.stop();g.getModel().beginUpdate();try{if("txt"==E.format)g.labelChanged(M,"<pre>"+O+"</pre>"),g.updateCellSize(M,!0);else{g.setCellStyles("image",d.convertDataUri(O),[M]);var U=g.model.getGeometry(M);null!=U&&(U=U.clone(),U.width=R,U.height=T,g.cellsResized([M],[U],!1))}g.setAttributeForCell(M,"plantUmlData",JSON.stringify({data:L,format:E.format}))}finally{g.getModel().endUpdate()}},function(O){d.handleError(O)})},null,null,400,220);d.showDialog(n.container,420,+300,!0,!0);n.init()};g.cellEditor.editMermaidData=function(M,n,A){var E=JSON.parse(A);n=new TextareaDialog(d,mxResources.get("mermaid")+":",E.data,function(L){null!=L&&d.spinner.spin(document.body,mxResources.get("inserting"))&&d.generateMermaidImage(L,E.config,function(O,R,T){d.spinner.stop();g.getModel().beginUpdate();try{g.setCellStyles("image",O,[M]);var U=g.model.getGeometry(M);null!=U&&(U=U.clone(),U.width=Math.max(U.width,R),U.height=Math.max(U.height,T),g.cellsResized([M],[U],!1));g.setAttributeForCell(M,+"mermaidData",JSON.stringify({data:L,config:E.config},null,2))}finally{g.getModel().endUpdate()}},function(O){d.handleError(O)})},null,null,400,220);d.showDialog(n.container,420,300,!0,!0);n.init()};var m=g.cellEditor.startEditing;g.cellEditor.startEditing=function(M,n){try{var A=this.graph.getAttributeForCell(M,"plantUmlData");if(null!=A)this.editPlantUmlData(M,n,A);else if(A=this.graph.getAttributeForCell(M,"mermaidData"),null!=A&&window.isMermaidEnabled)this.editMermaidData(M,n,A);else{var E=g.getCellStyle(M);+"1"==mxUtils.getValue(E,"metaEdit","0")?d.showDataDialog(M):m.apply(this,arguments)}}catch(L){d.handleError(L)}};g.getLinkTitle=function(M){return d.getLinkTitle(M)};g.customLinkClicked=function(M,n){var A=!1;try{var E=this.getGraphBounds();d.handleCustomLink(M,n);A=!0;d.chromelessResize&&!E.equals(this.getGraphBounds())&&(d.chromelessResize(),this.scrollCellToVisible(n))}catch(L){d.handleError(L)}return A};var t=g.parseBackgroundImage;g.parseBackgroundImage=function(M){var n=t.apply(this,arguments);null!=n&&null!=n.src&&Graph.isPageLink(n.src)&&(n={originalSrc:n.src});return n};var y=g.setBackgroundImage;g.setBackgroundImage=function(M){null!=M&&null!=M.originalSrc&&(M=d.createImageForPageLink(M.originalSrc,d.currentPage,this));y.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){g.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(){g.refreshBackgroundImage()}));this.editor.addListener("pagesPatched",mxUtils.bind(this,-function(M,n){M=null!=g.backgroundImage?g.backgroundImage.originalSrc:null;if(null!=M){var z=M.indexOf(",");if(0<z)for(M=M.substring(z+1),n=n.getProperty("patches"),z=0;z<n.length;z++)if(null!=n[z][EditorUi.DIFF_UPDATE]&&null!=n[z][EditorUi.DIFF_UPDATE][M]||null!=n[z][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(n[z][EditorUi.DIFF_REMOVE],M)){g.refreshBackgroundImage();break}}}));var A=g.getBackgroundImageObject;g.getBackgroundImageObject=function(M,n){var z=A.apply(this,arguments);null!=z&&null!=z.originalSrc&&-(z=n?d.createImageForPageLink(z.originalSrc,null,null,!0):{src:z.originalSrc});return z};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var I=d.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(M){M=null!=M?M:"";"1"==-urlParams.dev&&(M+=(0<M.length?"&":"?")+"dev=1");return I.apply(this,arguments)};var F=g.addClickHandler;g.addClickHandler=function(M,n,z){var D=n;n=function(L,N,R){if(null==N){var T=mxEvent.getSource(L);"a"==T.nodeName.toLowerCase()&&(N=T.getAttribute("href"))}null!=N&&g.isCustomLink(N)&&(mxEvent.isTouchEvent(L)||!mxEvent.isPopupTrigger(L))&&g.customLinkClicked(N,R)&&mxEvent.consume(L);null!=D&&D(L,N,R)};F.call(this,M,n,z)};p.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(g.view.canvas.ownerSVGElement,-null,!0);if(null!=this.menus){var C=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(M,n,z){g.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(M,["zoomIn","zoomOut","-"],null,z);C.apply(this,arguments);g.isSelectionEmpty()||null==d.addSelectionToScratchpad||this.addMenuItems(M,["-","addToScratchpad"],null,z);g.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(M,["-","exitGroup","home"],null,z)};var Q=Menus.prototype.addPopupMenuEditItems;-this.menus.addPopupMenuEditItems=function(M,n,z){if(d.editor.graph.isSelectionEmpty())Q.apply(this,arguments),d.menus.addMenuItems(M,["copyAsImage"],null,z);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(M,n,z):this.addPopupMenuArrangeItems(M,n,z),this.addMenuItems(M,"- cut copy copyAsImage duplicate -".split(" "),null,z),this.isShowCellEditItems()||this.addPopupDeleteItem(M,n,z),this.addMenuItems(M,["lockUnlock","-"],null,z),!this.isShowStyleItems()){if(1==g.getSelectionCount()&&!g.isCellLocked(n)&&-g.isCellEditable(n)&&(this.addSubmenu("editCell",M,null,mxResources.get("edit")),M.addSeparator(),g.getModel().isEdge(n))){this.addSubmenu("line",M);var D=g.getModel().getGeometry(n);null!=D&&null!=D.points&&0<D.points.length&&this.addMenuItems(M,["clearWaypoints"],null,z)}1==g.getSelectionCount()&&this.addMenuItems(M,["enterGroup"],null,z);D=d.getSelectionState();null!=D.mergeCell?this.addMenuItem(M,"mergeCells"):(1<D.style.colspan||1<D.style.rowspan)&&this.addMenuItem(M,"unmergeCells")}};this.menus.isShowStyleItems=+function(M,n){M=null!=g.backgroundImage?g.backgroundImage.originalSrc:null;if(null!=M){var A=M.indexOf(",");if(0<A)for(M=M.substring(A+1),n=n.getProperty("patches"),A=0;A<n.length;A++)if(null!=n[A][EditorUi.DIFF_UPDATE]&&null!=n[A][EditorUi.DIFF_UPDATE][M]||null!=n[A][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(n[A][EditorUi.DIFF_REMOVE],M)){g.refreshBackgroundImage();break}}}));var z=g.getBackgroundImageObject;g.getBackgroundImageObject=function(M,n){var A=z.apply(this,arguments);null!=A&&null!=A.originalSrc&&+(A=n?d.createImageForPageLink(A.originalSrc,null,null,!0):{src:A.originalSrc});return A};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var I=d.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(M){M=null!=M?M:"";"1"==+urlParams.dev&&(M+=(0<M.length?"&":"?")+"dev=1");return I.apply(this,arguments)};var F=g.addClickHandler;g.addClickHandler=function(M,n,A){var E=n;n=function(L,O,R){if(null==O){var T=mxEvent.getSource(L);"a"==T.nodeName.toLowerCase()&&(O=T.getAttribute("href"))}null!=O&&g.isCustomLink(O)&&(mxEvent.isTouchEvent(L)||!mxEvent.isPopupTrigger(L))&&g.customLinkClicked(O,R)&&mxEvent.consume(L);null!=E&&E(L,O,R)};F.call(this,M,n,A)};p.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(g.view.canvas.ownerSVGElement,+null,!0);if(null!=this.menus){var C=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(M,n,A){g.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(M,["zoomIn","zoomOut","-"],null,A);C.apply(this,arguments);g.isSelectionEmpty()||null==d.addSelectionToScratchpad||this.addMenuItems(M,["-","addToScratchpad"],null,A);g.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(M,["-","exitGroup","home"],null,A)};var Q=Menus.prototype.addPopupMenuEditItems;+this.menus.addPopupMenuEditItems=function(M,n,A){if(d.editor.graph.isSelectionEmpty())Q.apply(this,arguments),d.menus.addMenuItems(M,["copyAsImage"],null,A);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(M,n,A):this.addPopupMenuArrangeItems(M,n,A),this.addMenuItems(M,"- cut copy copyAsImage duplicate -".split(" "),null,A),this.isShowCellEditItems()||this.addPopupDeleteItem(M,n,A),this.addMenuItems(M,["lockUnlock","-"],null,A),!this.isShowStyleItems()){if(1==g.getSelectionCount()&&!g.isCellLocked(n)&&+g.isCellEditable(n)&&(this.addSubmenu("editCell",M,null,mxResources.get("edit")),M.addSeparator(),g.getModel().isEdge(n))){this.addSubmenu("line",M);var E=g.getModel().getGeometry(n);null!=E&&null!=E.points&&0<E.points.length&&this.addMenuItems(M,["clearWaypoints"],null,A)}1==g.getSelectionCount()&&this.addMenuItems(M,["enterGroup"],null,A);E=d.getSelectionState();null!=E.mergeCell?this.addMenuItem(M,"mergeCells"):(1<E.style.colspan||1<E.style.rowspan)&&this.addMenuItem(M,"unmergeCells")}};this.menus.isShowStyleItems=function(){return"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme};this.menus.isShowHistoryItems=function(){return"simple"!=Editor.currentTheme};this.menus.isShowArrangeItems=this.menus.isShowStyleItems;this.menus.isShowCellEditItems=this.menus.isShowStyleItems}this.dependsOnLanguage(mxUtils.bind(this,function(){this.defaultFilename=mxResources.get("untitledDiagram");this.defaultLibraryName=mxResources.get("untitledLibrary")}));var S=g.getExportVariables;g.getExportVariables=function(){var M=S.apply(this,arguments),n=d.getCurrentFile();null!=n&&(M.filename=n.getTitle());M.pagecount=null!=d.pages?d.pages.length:1;M.page=null!=d.currentPage?d.currentPage.getName():"";M.pagenumber=null!=d.pages&&null!=d.currentPage?mxUtils.indexOf(d.pages,d.currentPage)+1:1;return M};var V=g.getGlobalVariable;g.getGlobalVariable=function(M){var n=d.getCurrentFile();return"filename"==M&&null!=n?n.getTitle():"page"==M&&null!=d.currentPage?d.currentPage.getName():"pagenumber"==M?null!=d.currentPage&&-null!=d.pages?mxUtils.indexOf(d.pages,d.currentPage)+1:1:"pagecount"==M?null!=d.pages?d.pages.length:1:V.apply(this,arguments)};var P=null,u=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var M=this.getCurrentFile(),n=null!=M&&null!=M.getTitle()?M.getTitle():this.defaultFilename;P!=n&&M==u&&(g.invalidateDescendantsWithPlaceholders(g.model.getRoot()),g.view.validate());P=n;u=M}));var x=g.labelLinkClicked;g.labelLinkClicked=function(M,n,z){var D=n.getAttribute("href");if(null==-D||!g.isCustomLink(D)||!mxEvent.isTouchEvent(z)&&mxEvent.isPopupTrigger(z))x.apply(this,arguments);else{if(!g.isEnabled()||null!=M&&g.isCellLocked(M.cell))g.customLinkClicked(D),g.getRubberband().reset();mxEvent.consume(z)}};this.editor.getOrCreateFilename=function(){var M=d.defaultFilename,n=d.getCurrentFile();null!=n&&(M=null!=n.getTitle()?n.getTitle():M);return M};var J=this.actions.get("print");J.setEnabled(!mxClient.IS_IOS||!navigator.standalone);J.visible=J.isEnabled();if(!this.editor.chromeless||+null!=d.pages?mxUtils.indexOf(d.pages,d.currentPage)+1:1:"pagecount"==M?null!=d.pages?d.pages.length:1:V.apply(this,arguments)};var P=null,u=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var M=this.getCurrentFile(),n=null!=M&&null!=M.getTitle()?M.getTitle():this.defaultFilename;P!=n&&M==u&&(g.invalidateDescendantsWithPlaceholders(g.model.getRoot()),g.view.validate());P=n;u=M}));var x=g.labelLinkClicked;g.labelLinkClicked=function(M,n,A){var E=n.getAttribute("href");if(null==+E||!g.isCustomLink(E)||!mxEvent.isTouchEvent(A)&&mxEvent.isPopupTrigger(A))x.apply(this,arguments);else{if(!g.isEnabled()||null!=M&&g.isCellLocked(M.cell))g.customLinkClicked(E),g.getRubberband().reset();mxEvent.consume(A)}};this.editor.getOrCreateFilename=function(){var M=d.defaultFilename,n=d.getCurrentFile();null!=n&&(M=null!=n.getTitle()?n.getTitle():M);return M};var J=this.actions.get("print");J.setEnabled(!mxClient.IS_IOS||!navigator.standalone);J.visible=J.isEnabled();if(!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(70,!0,"findReplace"),this.keyHandler.bindAction(77,!0,"editGeometry",!0),this.keyHandler.bindAction(75,!0,"tags"),this.keyHandler.bindAction(65,!1,"insertText"),this.keyHandler.bindAction(83,!1,"insertNote"),this.keyHandler.bindAction(68,!1,"insertRectangle"),this.keyHandler.bindAction(70,!1,"insertEllipse"),this.keyHandler.bindAction(76,!1,"insertLink"),this.keyHandler.bindAction(82,!1,"insertRhombus"),this.keyHandler.bindAction(67,!1,"insertEdge"),this.keyHandler.bindAction(88,!1,"insertFreehand"),this.keyHandler.bindAction(75,!0,"toggleShapes",!0),this.keyHandler.bindAction(54,!0,"adaptiveColors",!0),this.altShiftActions[81]="copyStyle",this.altShiftActions[87]="pasteStyle",this.altShiftActions[83]="synchronize","1"==urlParams.embedInline&&(document.body.classList.add("geEmbedInline"),g.addListener(mxEvent.ESCAPE,function(M,n){null!=n&&g.isEnabled()&&!g.isEditing()&&null!=n.getProperty("event")&&d.actions.get("exit").funct()})),this.installImagePasteHandler(),-this.installNativeClipboardHandler();this.spinner=this.createSpinner(null,null,24);Graph.fileSupport&&g.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(M){var n=g.cellEditor.text2,z=null;null!=n&&(mxEvent.addListener(n,"dragleave",function(D){null!=z&&(z.parentNode.removeChild(z),z=null);D.stopPropagation();D.preventDefault()}),mxEvent.addListener(n,"dragover",mxUtils.bind(this,function(D){null==z&&(!mxClient.IS_IE||10<document.documentMode)&&(z=this.highlightElement(n));D.stopPropagation();-D.preventDefault()})),mxEvent.addListener(n,"drop",mxUtils.bind(this,function(D){null!=z&&(z.parentNode.removeChild(z),z=null);if(0<D.dataTransfer.files.length)this.importFiles(D.dataTransfer.files,0,0,this.maxImageSize,function(N,R,T,U,W,X){g.insertImage(N,W,X)},function(){},function(N){return"image/"==N.type.substring(0,6)},function(N){for(var R=0;R<N.length;R++)N[R]()},mxEvent.isControlDown(D));else if(0<=mxUtils.indexOf(D.dataTransfer.types,"text/uri-list")){var L=D.dataTransfer.getData("text/uri-list");-/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(L)?this.loadImage(decodeURIComponent(L),mxUtils.bind(this,function(N){var R=Math.max(1,N.width);N=Math.max(1,N.height);var T=this.maxImageSize;T=Math.min(1,Math.min(T/Math.max(1,R)),T/Math.max(1,N));g.insertImage(decodeURIComponent(L),R*T,N*T)})):document.execCommand("insertHTML",!1,D.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(D.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,D.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(D.dataTransfer.types,-"text/plain")&&document.execCommand("insertHTML",!1,D.dataTransfer.getData("text/plain"));D.stopPropagation();D.preventDefault()})))}));if(Editor.isSettingsEnabled()){J=this.editor.graph.view;var H=mxSettings.getUnit();J.setUnit(H);Editor.pageSizeUnit=H==mxConstants.METERS?mxConstants.MILLIMETERS:H;J.addListener("unitChanged",function(M,n){M=n.getProperty("unit");mxSettings.setUnit(M);mxSettings.save();Editor.pageSizeUnit=M==mxConstants.METERS?mxConstants.MILLIMETERS:M});this.ruler=!this.canvasSupported||+this.installNativeClipboardHandler();this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);Graph.fileSupport&&g.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(M){var n=g.cellEditor.text2,A=null;null!=n&&(mxEvent.addListener(n,"dragleave",function(E){null!=A&&(A.parentNode.removeChild(A),A=null);E.stopPropagation();E.preventDefault()}),mxEvent.addListener(n,"dragover",mxUtils.bind(this,function(E){null==A&&(!mxClient.IS_IE||10<document.documentMode)&&(A=this.highlightElement(n));+E.stopPropagation();E.preventDefault()})),mxEvent.addListener(n,"drop",mxUtils.bind(this,function(E){null!=A&&(A.parentNode.removeChild(A),A=null);if(0<E.dataTransfer.files.length)this.importFiles(E.dataTransfer.files,0,0,this.maxImageSize,function(O,R,T,U,W,X){g.insertImage(O,W,X)},function(){},function(O){return"image/"==O.type.substring(0,6)},function(O){for(var R=0;R<O.length;R++)O[R]()},mxEvent.isControlDown(E));else if(0<=mxUtils.indexOf(E.dataTransfer.types,"text/uri-list")){var L=E.dataTransfer.getData("text/uri-list");+/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(L)?this.loadImage(decodeURIComponent(L),mxUtils.bind(this,function(O){var R=Math.max(1,O.width);O=Math.max(1,O.height);var T=this.maxImageSize;T=Math.min(1,Math.min(T/Math.max(1,R)),T/Math.max(1,O));g.insertImage(decodeURIComponent(L),R*T,O*T)})):document.execCommand("insertHTML",!1,E.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(E.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,E.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(E.dataTransfer.types,+"text/plain")&&document.execCommand("insertHTML",!1,E.dataTransfer.getData("text/plain"));E.stopPropagation();E.preventDefault()})))}));if(Editor.isSettingsEnabled()){J=this.editor.graph.view;var H=mxSettings.getUnit();J.setUnit(H);Editor.pageSizeUnit=H==mxConstants.METERS?mxConstants.MILLIMETERS:H;J.addListener("unitChanged",function(M,n){M=n.getProperty("unit");mxSettings.setUnit(M);mxSettings.save();Editor.pageSizeUnit=M==mxConstants.METERS?mxConstants.MILLIMETERS:M});this.ruler=!this.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,J.unit);this.refresh()}if("1"==urlParams.styledev){J=document.getElementById("geFooter");null!=J&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),J.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(M,n){0<this.editor.graph.getSelectionCount()?(M=this.editor.graph.getSelectionCell(),M=this.editor.graph.getModel().getStyle(M),this.styleInput.value=M||"",this.styleInput.style.visibility=-"visible"):this.styleInput.style.visibility="hidden"})));var K=this.isSelectionAllowed;this.isSelectionAllowed=function(M){return mxEvent.getSource(M)==this.styleInput?!0:K.apply(this,arguments)}}J=document.getElementById("geInfo");null!=J&&J.parentNode.removeChild(J);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var O=null;mxEvent.addListener(g.container,"dragleave",function(M){g.isEnabled()&&(null!=O&&(O.parentNode.removeChild(O),O=null),M.stopPropagation(),M.preventDefault())});-mxEvent.addListener(g.container,"dragover",mxUtils.bind(this,function(M){null==O&&(!mxClient.IS_IE||10<document.documentMode)&&(O=this.highlightElement(g.container));null!=this.sidebar&&this.sidebar.hideTooltip();M.stopPropagation();M.preventDefault()}));mxEvent.addListener(g.container,"drop",mxUtils.bind(this,function(M){null!=O&&(O.parentNode.removeChild(O),O=null);if(g.isEnabled()){var n=mxUtils.convertPoint(g.container,mxEvent.getClientX(M),mxEvent.getClientY(M)),z=M.dataTransfer.files,D=g.view.translate,-L=g.view.scale,N=n.x/L-D.x,R=n.y/L-D.y;if(0<z.length)"1"!=urlParams.embed&&mxEvent.isShiftDown(M)?(this.isBlankFile()&&!this.canUndo()&&null!=this.getCurrentFile()&&this.fileLoaded(null),this.openFiles(z,!0)):(mxEvent.isAltDown(M)&&(R=N=null),this.importFiles(z,N,R,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(M),null,null,mxEvent.isShiftDown(M),M));else{mxEvent.isAltDown(M)&&(R=N=0);var T=0<=mxUtils.indexOf(M.dataTransfer.types,"text/uri-list")?M.dataTransfer.getData("text/uri-list"):-null;n=this.extractGraphModelFromEvent(M,null!=this.pages);if(null!=n)g.setSelectionCells(this.importXml(n,N,R,!0));else if(0<=mxUtils.indexOf(M.dataTransfer.types,"text/html")){var U=M.dataTransfer.getData("text/html");n=document.createElement("div");n.innerHTML=Graph.sanitizeHtml(U);var W=null;z=n.getElementsByTagName("img");null!=z&&1==z.length?(U=z[0].getAttribute("src"),null==U&&(U=z[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(U)||(W=!0)):(z=n.getElementsByTagName("a"),-null!=z&&1==z.length?U=z[0].getAttribute("href"):(n=n.getElementsByTagName("pre"),null!=n&&1==n.length&&(U=mxUtils.getTextContent(n[0]))));var X=!0,Y=mxUtils.bind(this,function(){g.setSelectionCells(this.insertTextAt(U,N,R,!0,W,null,X,mxEvent.isControlDown(M)))});W&&null!=U&&U.length>this.resampleThreshold?this.confirmImageResize(function(Z){X=Z;Y()},mxEvent.isControlDown(M)):Y()}else null!=T&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(T)?this.loadImage(decodeURIComponent(T),mxUtils.bind(this,function(Z){var ca=-Math.max(1,Z.width);Z=Math.max(1,Z.height);var ea=this.maxImageSize;ea=Math.min(1,Math.min(ea/Math.max(1,ca)),ea/Math.max(1,Z));g.setSelectionCell(g.insertVertex(null,null,"",N,R,ca*ea,Z*ea,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+T+";"))}),mxUtils.bind(this,function(Z){g.setSelectionCells(this.insertTextAt(T,N,R,!0))})):0<=mxUtils.indexOf(M.dataTransfer.types,"text/plain")&&g.setSelectionCells(this.insertTextAt(M.dataTransfer.getData("text/plain"),-N,R,!0))}}M.stopPropagation();M.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.addListener("currentThemeChanged",mxUtils.bind(this,function(){null!=this.sidebar&&this.sidebar.updateEntries();this.updateButtonContainer();this.updateDocumentTitle();this.refresh(!0)}));this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateButtonContainer()}));this.addListener("darkModeChanged",function(){mxClient.IS_SF&&g.view.validateBackground()});-g.addListener("enabledChanged",mxUtils.bind(this,function(){g.isEnabled()||this.hideShapePicker();this.refresh()}));d=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==d.embedViewport)mxUtils.fit(this.div);else{var M=parseInt(this.div.offsetLeft),n=parseInt(this.div.offsetWidth),z=d.embedViewport.x+d.embedViewport.width,D=parseInt(this.div.offsetTop),L=parseInt(this.div.offsetHeight),N=d.embedViewport.y+d.embedViewport.height;this.div.style.left=Math.max(d.embedViewport.x,Math.min(M,-z-n))+"px";this.div.style.top=Math.max(d.embedViewport.y,Math.min(D,N-L))+"px";this.div.style.height=Math.min(d.embedViewport.height,parseInt(this.div.style.height))+"px";this.div.style.width=Math.min(d.embedViewport.width,parseInt(this.div.style.width))+"px"}};if(!this.editor.chromeless||this.editor.editable)if(J=Editor.currentTheme,"simple"==J||"sketch"==J)this.doSetCurrentTheme(J,!0),"1"==urlParams.embedInline?this.initializeInlineEmbedMode():(window.innerWidth||document.documentElement.clientWidth||+"visible"):this.styleInput.style.visibility="hidden"})));var K=this.isSelectionAllowed;this.isSelectionAllowed=function(M){return mxEvent.getSource(M)==this.styleInput?!0:K.apply(this,arguments)}}J=document.getElementById("geInfo");null!=J&&J.parentNode.removeChild(J);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var N=null;mxEvent.addListener(g.container,"dragleave",function(M){g.isEnabled()&&(null!=N&&(N.parentNode.removeChild(N),N=null),M.stopPropagation(),M.preventDefault())});+mxEvent.addListener(g.container,"dragover",mxUtils.bind(this,function(M){null==N&&(!mxClient.IS_IE||10<document.documentMode)&&(N=this.highlightElement(g.container));null!=this.sidebar&&this.sidebar.hideTooltip();M.stopPropagation();M.preventDefault()}));mxEvent.addListener(g.container,"drop",mxUtils.bind(this,function(M){null!=N&&(N.parentNode.removeChild(N),N=null);if(g.isEnabled()){var n=mxUtils.convertPoint(g.container,mxEvent.getClientX(M),mxEvent.getClientY(M)),A=M.dataTransfer.files,E=g.view.translate,+L=g.view.scale,O=n.x/L-E.x,R=n.y/L-E.y;if(0<A.length)"1"!=urlParams.embed&&mxEvent.isShiftDown(M)?(this.isBlankFile()&&!this.canUndo()&&null!=this.getCurrentFile()&&this.fileLoaded(null),this.openFiles(A,!0)):(mxEvent.isAltDown(M)&&(R=O=null),this.importFiles(A,O,R,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(M),null,null,mxEvent.isShiftDown(M),M));else{mxEvent.isAltDown(M)&&(R=O=0);var T=0<=mxUtils.indexOf(M.dataTransfer.types,"text/uri-list")?M.dataTransfer.getData("text/uri-list"):+null;n=this.extractGraphModelFromEvent(M,null!=this.pages);if(null!=n)g.setSelectionCells(this.importXml(n,O,R,!0));else if(0<=mxUtils.indexOf(M.dataTransfer.types,"text/html")){var U=M.dataTransfer.getData("text/html");n=document.createElement("div");n.innerHTML=Graph.sanitizeHtml(U);var W=null;A=n.getElementsByTagName("img");null!=A&&1==A.length?(U=A[0].getAttribute("src"),null==U&&(U=A[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(U)||(W=!0)):(A=n.getElementsByTagName("a"),+null!=A&&1==A.length?U=A[0].getAttribute("href"):(n=n.getElementsByTagName("pre"),null!=n&&1==n.length&&(U=mxUtils.getTextContent(n[0]))));var X=!0,Y=mxUtils.bind(this,function(){g.setSelectionCells(this.insertTextAt(U,O,R,!0,W,null,X,mxEvent.isControlDown(M)))});W&&null!=U&&U.length>this.resampleThreshold?this.confirmImageResize(function(Z){X=Z;Y()},mxEvent.isControlDown(M)):Y()}else null!=T&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(T)?this.loadImage(decodeURIComponent(T),mxUtils.bind(this,function(Z){var ca=+Math.max(1,Z.width);Z=Math.max(1,Z.height);var ea=this.maxImageSize;ea=Math.min(1,Math.min(ea/Math.max(1,ca)),ea/Math.max(1,Z));g.setSelectionCell(g.insertVertex(null,null,"",O,R,ca*ea,Z*ea,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+T+";"))}),mxUtils.bind(this,function(Z){g.setSelectionCells(this.insertTextAt(T,O,R,!0))})):0<=mxUtils.indexOf(M.dataTransfer.types,"text/plain")&&g.setSelectionCells(this.insertTextAt(M.dataTransfer.getData("text/plain"),+O,R,!0))}}M.stopPropagation();M.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.addListener("currentThemeChanged",mxUtils.bind(this,function(){null!=this.sidebar&&this.sidebar.updateEntries();this.updateButtonContainer();this.updateDocumentTitle();this.refresh(!0)}));this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateButtonContainer()}));this.addListener("darkModeChanged",function(){mxClient.IS_SF&&g.view.validateBackground()});+g.addListener("enabledChanged",mxUtils.bind(this,function(){g.isEnabled()||this.hideShapePicker();this.refresh()}));d=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==d.embedViewport)mxUtils.fit(this.div);else{var M=parseInt(this.div.offsetLeft),n=parseInt(this.div.offsetWidth),A=d.embedViewport.x+d.embedViewport.width,E=parseInt(this.div.offsetTop),L=parseInt(this.div.offsetHeight),O=d.embedViewport.y+d.embedViewport.height;this.div.style.left=Math.max(d.embedViewport.x,Math.min(M,+A-n))+"px";this.div.style.top=Math.max(d.embedViewport.y,Math.min(E,O-L))+"px";this.div.style.height=Math.min(d.embedViewport.height,parseInt(this.div.style.height))+"px";this.div.style.width=Math.min(d.embedViewport.width,parseInt(this.div.style.width))+"px"}};if(!this.editor.chromeless||this.editor.editable)if(J=Editor.currentTheme,"simple"==J||"sketch"==J)this.doSetCurrentTheme(J,!0),"1"==urlParams.embedInline?this.initializeInlineEmbedMode():(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<Editor.smallScreenWidth&&this.toggleFormatPanel(!1),this.fireEvent(new mxEventObject("themeInitialized"));J=!1;if(null!=urlParams.dark)J=urlParams.dark;else if(!this.editor.chromeless||this.editor.editable)J="dark"==Editor.currentTheme,!Editor.isSettingsEnabled()||"1"==urlParams.embed||J&&"auto"!=mxSettings.settings.darkMode||(J=mxSettings.settings.darkMode);"auto"==J&&this.isAutoDarkModeSupported()&&(J=window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode("string"===typeof J?"1"==J:J);if(this.isAutoDarkModeSupported())try{window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",mxUtils.bind(this,function(M){this.isAutoDarkMode()&&this.setDarkMode(M.matches)}))}catch(M){this.actions.get("autoMode").setEnabled(!1)}"1"==urlParams["high-contrast"]?this.setHighContrast(!0):Editor.isSettingsEnabled()&&!this.editor.graph.isLightboxView()&&null!=mxSettings.settings.highContrast&&this.setHighContrast(mxSettings.settings.highContrast);Editor.isSettingsEnabled()&&(null!=mxSettings.settings.pages&&this.setTabContainerVisible(mxSettings.settings.pages),null!=mxSettings.settings.compactMode&&this.isDefaultTheme(Editor.currentTheme)&&this.setCompactMode(mxSettings.settings.compactMode));this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(M,n){g.enableFlowAnimation=Editor.enableAnimations;g.refresh()}));g.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&d.editor.loadFonts();"atlas"==Editor.currentTheme&&document.body.classList.add("geAtlas")};var q=EditorUi.prototype.windowResized;EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme){var d=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,g=Editor.smallScreenWidth;null!=this.lastWindowWidth&&this.lastWindowWidth>=g&&d<g?this.isFormatPanelVisible()&&this.toggleFormatPanel(!1):null!=this.lastWindowWidth&&this.lastWindowWidth<g&&d>=g&&(this.isFormatPanelVisible()||this.toggleFormatPanel(!0));this.lastWindowWidth=d}q.apply(this,arguments)};EditorUi.prototype.initializeInlineEmbedMode=function(){var d=this.sketchFooterMenuElt,g=this.sketchMainMenuElt,k=this.sketchPickerMenuElt,m=this.editor.graph;k.style.transform="";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,function(C){mxEvent.getSource(C)==this.diagramContainer.parentNode&&(this.embedExitPoint=new mxPoint(mxEvent.getClientX(C),mxEvent.getClientY(C)),this.sendEmbeddedSvgExport())}));-document.body.style.cursor="text";var t=document.createElement("div");t.style.position="absolute";t.style.width="10px";t.style.height="10px";t.style.borderRadius="5px";t.style.border="1px solid gray";t.style.background="#ffffff";t.style.cursor="row-resize";this.diagramContainer.parentNode.appendChild(t);this.bottomResizer=t;var y=null,A=null,I=null,F=null;mxEvent.addGestureListeners(t,mxUtils.bind(this,function(C){F=parseInt(this.diagramContainer.style.height);A=mxEvent.getClientY(C);m.popupMenuHandler.hideMenu();+document.body.style.cursor="text";var t=document.createElement("div");t.style.position="absolute";t.style.width="10px";t.style.height="10px";t.style.borderRadius="5px";t.style.border="1px solid gray";t.style.background="#ffffff";t.style.cursor="row-resize";this.diagramContainer.parentNode.appendChild(t);this.bottomResizer=t;var y=null,z=null,I=null,F=null;mxEvent.addGestureListeners(t,mxUtils.bind(this,function(C){F=parseInt(this.diagramContainer.style.height);z=mxEvent.getClientY(C);m.popupMenuHandler.hideMenu();mxEvent.consume(C)}));t=t.cloneNode(!1);t.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(t);this.rightResizer=t;mxEvent.addGestureListeners(t,mxUtils.bind(this,function(C){I=parseInt(this.diagramContainer.style.width);y=mxEvent.getClientX(C);m.popupMenuHandler.hideMenu();mxEvent.consume(C)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(C){var Q=!1;null!=y&&(this.diagramContainer.style.width=Math.max(20,I+mxEvent.getClientX(C)-y)+"px",Q=!0);null!=-A&&(this.diagramContainer.style.height=Math.max(20,F+mxEvent.getClientY(C)-A)+"px",Q=!0);Q&&((window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),function(C){null==y&&null==A||mxEvent.consume(C);A=y=null});document.body.style.backgroundColor="transparent";this.diagramContainer.style.borderRadius="4px";this.bottomResizer.style.visibility="hidden";+z&&(this.diagramContainer.style.height=Math.max(20,F+mxEvent.getClientY(C)-z)+"px",Q=!0);Q&&((window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),function(C){null==y&&null==z||mxEvent.consume(C);z=y=null});document.body.style.backgroundColor="transparent";this.diagramContainer.style.borderRadius="4px";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";this.sketchMenubarElt.style.display="none";g.style.visibility="hidden";d.style.visibility="hidden";k.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(C){this.inlineSizeChanged();this.fitWindows()}));this.addListener("editInlineStop",mxUtils.bind(this,function(C){this.diagramContainer.style.width="10px";this.diagramContainer.style.height="10px";this.diagramContainer.style.border="";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";g.style.visibility="hidden";d.style.visibility="hidden";k.style.display="none"}));this.windowResized=mxUtils.bind(this,function(){});this.inlineSizeChanged()};EditorUi.prototype.installImagePasteHandler=function(){if(!mxClient.IS_IE){var d=this.editor.graph;d.container.addEventListener("paste",mxUtils.bind(this,function(g){if(!mxEvent.isConsumed(g))try{for(var k=g.clipboardData||g.originalEvent.clipboardData,m=!1,t=0;t<k.types.length;t++)if("text/"===k.types[t].substring(0,-5)){m=!0;break}if(!m){var y=k.items;for(index in y){var A=y[index];if("file"===A.kind){if(d.isEditing())this.importFiles([A.getAsFile()],0,0,this.maxImageSize,function(F,C,Q,S,V,P){d.insertImage(F,V,P)},function(){},function(F){return"image/"==F.type.substring(0,6)},function(F){for(var C=0;C<F.length;C++)F[C]()});else{var I=this.editor.graph.getInsertPoint();this.importFiles([A.getAsFile()],I.x,I.y,this.maxImageSize);mxEvent.consume(g)}break}}}}catch(F){}}),!1)}};EditorUi.prototype.installNativeClipboardHandler=+5)){m=!0;break}if(!m){var y=k.items;for(index in y){var z=y[index];if("file"===z.kind){if(d.isEditing())this.importFiles([z.getAsFile()],0,0,this.maxImageSize,function(F,C,Q,S,V,P){d.insertImage(F,V,P)},function(){},function(F){return"image/"==F.type.substring(0,6)},function(F){for(var C=0;C<F.length;C++)F[C]()});else{var I=this.editor.graph.getInsertPoint();this.importFiles([z.getAsFile()],I.x,I.y,this.maxImageSize);mxEvent.consume(g)}break}}}}catch(F){}}),!1)}};EditorUi.prototype.installNativeClipboardHandler=function(){function d(){window.setTimeout(function(){k.innerHTML=" ";k.focus();document.execCommand("selectAll",!1,null)},0)}var g=this.editor.graph,k=document.createElement("div");k.setAttribute("autocomplete","off");k.setAttribute("autocorrect","off");k.setAttribute("autocapitalize","off");k.setAttribute("spellcheck","false");k.style.textRendering="optimizeSpeed";k.style.fontFamily="monospace";k.style.wordBreak="break-all";k.style.background="transparent";k.style.color="transparent";k.style.position=-"absolute";k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.display="block";k.style.fontSize="1";k.style.zIndex="-1";k.style.resize="none";k.style.outline="none";k.style.width="1px";k.style.height="1px";mxUtils.setOpacity(k,0);k.contentEditable=!0;k.innerHTML=" ";var m=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(y){var A=mxEvent.getSource(y);-null==g.container||!g.isEnabled()||g.isMouseDown||g.isEditing()||null!=this.dialog||"INPUT"==A.nodeName||"TEXTAREA"==A.nodeName||"true"==A.contentEditable||224!=y.keyCode&&(mxClient.IS_MAC||17!=y.keyCode)&&(!mxClient.IS_MAC||91!=y.keyCode&&93!=y.keyCode)||m||(k.style.left=g.container.scrollLeft+10+"px",k.style.top=g.container.scrollTop+10+"px",y=g.container.scrollLeft,A=g.container.scrollTop,g.container.appendChild(k),m=!0,k.focus(),document.execCommand("selectAll",!1,null),g.container.scrollLeft=-y,g.container.scrollTop=A)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(y){var A=y.keyCode;window.setTimeout(mxUtils.bind(this,function(){!m||224!=A&&17!=A&&91!=A&&93!=A||(m=!1,g.isEditing()||null!=this.dialog||null==g.container||g.container.focus(),k.parentNode.removeChild(k),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(k,"copy",mxUtils.bind(this,function(y){if(g.isEnabled())try{mxClipboard.copy(g),this.copyCells(k),d()}catch(A){this.handleError(A)}}));-mxEvent.addListener(k,"cut",mxUtils.bind(this,function(y){if(g.isEnabled())try{mxClipboard.copy(g),this.copyCells(k,!0),d()}catch(A){this.handleError(A)}}));mxEvent.addListener(k,"paste",mxUtils.bind(this,function(y){if(g.isEnabled()&&!g.isCellLocked(g.getDefaultParent()))try{if(k.innerHTML=" ",k.focus(),null!=y.clipboardData&&(Graph.removePasteFormatting(k.firstChild),this.pasteCells(y,k,!0,!0)),!mxEvent.isConsumed(y)){var A=g.container.scrollLeft,I=g.container.scrollTop;window.setTimeout(mxUtils.bind(this,-function(){try{g.container.scrollLeft=A,g.container.scrollTop=I,Graph.removePasteFormatting(k.firstChild),this.pasteCells(y,k,!1,!0)}catch(F){this.handleError(F)}}),0)}}catch(F){this.handleError(F)}}),!0);var t=this.isSelectionAllowed;this.isSelectionAllowed=function(y){return mxEvent.getSource(y)==k?!0:t.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(d,g){mxSettings.setUi(d);(g=this.doSetCurrentTheme(d)||g)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=+"absolute";k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.display="block";k.style.fontSize="1";k.style.zIndex="-1";k.style.resize="none";k.style.outline="none";k.style.width="1px";k.style.height="1px";mxUtils.setOpacity(k,0);k.contentEditable=!0;k.innerHTML=" ";var m=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(y){var z=mxEvent.getSource(y);+null==g.container||!g.isEnabled()||g.isMouseDown||g.isEditing()||null!=this.dialog||"INPUT"==z.nodeName||"TEXTAREA"==z.nodeName||"true"==z.contentEditable||224!=y.keyCode&&(mxClient.IS_MAC||17!=y.keyCode)&&(!mxClient.IS_MAC||91!=y.keyCode&&93!=y.keyCode)||m||(k.style.left=g.container.scrollLeft+10+"px",k.style.top=g.container.scrollTop+10+"px",y=g.container.scrollLeft,z=g.container.scrollTop,g.container.appendChild(k),m=!0,k.focus(),document.execCommand("selectAll",!1,null),g.container.scrollLeft=+y,g.container.scrollTop=z)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(y){var z=y.keyCode;window.setTimeout(mxUtils.bind(this,function(){!m||224!=z&&17!=z&&91!=z&&93!=z||(m=!1,g.isEditing()||null!=this.dialog||null==g.container||g.container.focus(),k.parentNode.removeChild(k),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(k,"copy",mxUtils.bind(this,function(y){if(g.isEnabled())try{mxClipboard.copy(g),this.copyCells(k),d()}catch(z){this.handleError(z)}}));+mxEvent.addListener(k,"cut",mxUtils.bind(this,function(y){if(g.isEnabled())try{mxClipboard.copy(g),this.copyCells(k,!0),d()}catch(z){this.handleError(z)}}));mxEvent.addListener(k,"paste",mxUtils.bind(this,function(y){if(g.isEnabled()&&!g.isCellLocked(g.getDefaultParent()))try{if(k.innerHTML=" ",k.focus(),null!=y.clipboardData&&(Graph.removePasteFormatting(k.firstChild),this.pasteCells(y,k,!0,!0)),!mxEvent.isConsumed(y)){var z=g.container.scrollLeft,I=g.container.scrollTop;window.setTimeout(mxUtils.bind(this,+function(){try{g.container.scrollLeft=z,g.container.scrollTop=I,Graph.removePasteFormatting(k.firstChild),this.pasteCells(y,k,!1,!0)}catch(F){this.handleError(F)}}),0)}}catch(F){this.handleError(F)}}),!0);var t=this.isSelectionAllowed;this.isSelectionAllowed=function(y){return mxEvent.getSource(y)==k?!0:t.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(d,g){mxSettings.setUi(d);(g=this.doSetCurrentTheme(d)||g)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=function(d){return""==d||"dark"==d||"default"==d||"kennedy"==d||null==d};EditorUi.prototype.doSetCurrentTheme=function(d,g){if(null==d||""==d)d=App.isSimpleThemePreferred()?"simple":"kennedy";var k="simple"==Editor.currentTheme&&this.isDefaultTheme(d)||this.isDefaultTheme(Editor.currentTheme)&&"simple"==d||d==Editor.currentTheme;if(k||g)g=this.saveScrollState(),this.editor.graph.stopEditing(!1),Editor.currentTheme=d,this.switchTheme(d),this.fireEvent(new mxEventObject("currentThemeChanged")),this.editor.fireEvent(new mxEventObject("statusChanged")),this.restoreScrollState(g);return k};EditorUi.prototype.saveScrollState=function(d){var g=this.editor.graph.view.translate,k=this.diagramContainer.scrollLeft,m=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(k-=this.embedViewport.x,m-=this.embedViewport.y):(k+=this.embedViewport.x,m+=this.embedViewport.y));g={x:k,y:m,tx:g.x,ty:g.y};d&&(g.boundingRect=this.diagramContainer.getBoundingClientRect());return g};EditorUi.prototype.restoreScrollState=function(d){var g=this.editor.graph.view.scale,k=this.editor.graph.view.translate;if(null!=d.boundingRect){var m=this.diagramContainer.getBoundingClientRect();d.x-=d.boundingRect.x-m.x;d.y-=d.boundingRect.y-m.y}this.diagramContainer.scrollLeft=d.x+(k.x-d.tx)*g;this.diagramContainer.scrollTop=d.y+(k.y-d.ty)*g};EditorUi.prototype.installStatusMinimizer=function(d){d=null!=d?d:this.statusContainer.parentNode;var g=!1;mxEvent.addListener(d,"mouseenter",mxUtils.bind(this,function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&@@ -13298,145 +13302,145 @@ this.menus.commentsWindow=null))};EditorUi.prototype.switchThemeConstants=functi120;null==urlParams.grid&&(g.defaultGridEnabled=!1);null==urlParams.pv&&(g.defaultPageVisible=!1)}else Editor.fitWindowBorders=null};EditorUi.prototype.isPageMenuVisible=function(){return null!=this.pages&&("0"!=urlParams.pages||1<this.pages.length||Editor.pagesVisible)};EditorUi.prototype.switchCssForTheme=function(d){};EditorUi.prototype.createMainMenuForTheme=function(d){};EditorUi.prototype.createFooterMenuForTheme=function(d){};EditorUi.prototype.createPickerMenuForTheme=function(d){};EditorUi.prototype.getNetworkStatus=function(){var d=null;if(this.isOffline(!0))d=mxResources.get("offline");else{var g=this.getCurrentFile();null!=g&&(g.invalidChecksum?d=mxResources.get("error")+": "+mxResources.get("checksum"):null==g.sync||g.sync.enabled&&g.sync.isRealtimeActive()||"atlassian"==this.getServiceName()?null==g.sync||g.sync.isConnected()?g.isRealtimeEnabled()&&g.isRealtimeSupported()&&1<g.getRealtimeState()&&(d=g.getRealtimeError(),d=mxResources.get("realtimeCollaboration")+": "+(null!=d&&null!=d.message?d.message:mxResources.get("error"))):d=mxResources.get("notConnected"):d=mxResources.get("realtimeCollaboration")+": "+mxResources.get("disabled"))}return d};EditorUi.prototype.createMenubarForTheme=function(d){null!=this.statusContainer&&(this.statusContainer.style.flexGrow="",this.statusContainer.style.flexShrink="",this.statusContainer.style.width="",this.statusContainer.style.marginTop="",this.statusContainer.style.justifyContent="",this.statusContainer.style.opacity="");null!=this.userElement&&this.menubarContainer.appendChild(this.userElement);-null!=this.buttonContainer&&(this.buttonContainer.style.display="",this.menubar.container.appendChild(this.buttonContainer))};EditorUi.prototype.createMenu=function(d,g,k,m){k=null!=k?k:"geButton";var t=this.menus.get(d);m=this.menubar.addMenu(mxResources.get(d),t.funct,null,m);m.className=k;m.setAttribute("title",mxResources.get(d));this.menus.menuCreated(t,m,k);null!=g&&(m.style.backgroundImage="url("+g+")",m.innerText="");return m};EditorUi.prototype.addButton=function(d,g,k,m){d=this.createToolbarButton(d,-g,k);m=null!=m?m:this.container;m.appendChild(d);return d};EditorUi.prototype.createToolbarButton=function(d,g,k){var m=document.createElement("a");m.className="geButton";null!=d&&"data:"==d.substring(0,5)&&(m.style.backgroundImage="url("+d+")");null!=g&&m.setAttribute("title",g);null!=k&&mxEvent.addListener(m,"click",function(t){"disabled"!=m.getAttribute("disabled")&&k(t);mxEvent.consume(t)});mxEvent.preventDefault(m);return m};EditorUi.prototype.createMenuItem=function(d,g,k){var m=this.actions.get(d),-t=null!=m?m.funct:null,y=this.createToolbarButton(g,mxResources.get(d)+(null!=m&&null!=m.shortcut?" ("+m.shortcut+")":""),t);null==m||k||(d=function(){m.isEnabled()?y.removeAttribute("disabled"):y.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",d),m.addListener("stateChanged",d),d());return y};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var d=Math.max(10,this.diagramContainer.parentNode.clientWidth-256),g="1"==urlParams.embedInline?-580:"1"==urlParams.sketch?580:Math.min(566,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,mxResources.get("format"),d,60,240,g,mxUtils.bind(this,function(t){t.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.formatWindow.window.fit()}));var k=this.formatWindow.window.toggleMinimized,m=240;this.formatWindow.window.toggleMinimized=function(){k.apply(this,arguments);this.minimized?(m=parseInt(this.div.style.width),-this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+m-140+"px"):(this.div.style.width=m+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-m+140)+"px");this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(t){mxEvent.getSource(t)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));this.formatWindow.window.minimumSize=-new mxRectangle(0,0,240,80);"sketch"==Editor.currentTheme?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var t=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,y=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>t||690>y)&&this.formatWindow.window.toggleMinimized()}),0)):this.formatWindow.window.setVisible(!1)}};var v=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=-function(d){var g=this.formatWindow;null!=g?g.window.setVisible(null!=d?d:!this.isFormatPanelVisible()):v.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(d){if(this.isShapesPanelVisible()!=d){var g=EditorUi.prototype.hsplitPosition;0==g&&(g=this.defaultSidebarWidth);var k=this.hsplitPosition,m=mxUtils.bind(this,function(){this.hsplitPosition=t;this.refresh();this.diagramContainer.scrollLeft-=k-this.hsplitPosition}),t=d?g:0,y=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.sidebarContainer.style,-"transform",0==t?"translateX(0)":"translateX(-100%)");0!=t&&m();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==t?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+y+"s ease-in-out");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin","top left");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition",-null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin",null);0==t&&m()}),1E3*y)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var E=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var d=this.formatWindow;return null!=d?d.window.isVisible():E.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(d){var g=mxUtils.bind(this,-function(A,I){var F=this.menus.get(A);A=this.createMenuElement(I,mxUtils.bind(this,function(){F.funct.apply(this,arguments)}));A.setAttribute("title",I);A.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";A.className="geButton";d.parentNode.appendChild(A);return A});if(Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries))if(null!=this.actions.get("newLibrary"))g=document.createElement("div"),g.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;",-g.className="geButton",g.style.left="0px",g.style.right="50%",mxUtils.write(g,mxResources.get("newLibrary")),d.appendChild(g),mxEvent.addListener(g,"click",this.actions.get("newLibrary").funct),g=g.cloneNode(!1),g.style.left="50%",g.style.right="0px",mxUtils.write(g,mxResources.get("openLibrary")),d.appendChild(g),mxEvent.addListener(g,"click",this.actions.get("openLibrary").funct);else{var k=g("newLibrary","");k.style.left="0px";k.style.right="50%";var m=document.createElement("span");k.appendChild(m);-var t=g("openLibraryFrom","");t.style.borderLeftWidth="1px";t.style.left="50%";t.style.right="0px";var y=document.createElement("span");t.appendChild(y);this.dependsOnLanguage(mxUtils.bind(this,function(){m.innerHTML="";mxUtils.write(m,mxResources.get("newLibrary"));k.setAttribute("title",mxResources.get("newLibrary"));y.innerHTML="";mxUtils.write(y,mxResources.get("openLibraryFrom"));t.setAttribute("title",mxResources.get("openLibraryFrom"))}))}d.appendChild(this.sidebar.container);d.style.overflow=-"hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var d=Math.min(this.diagramContainer.parentNode.clientWidth-10,218),g="1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,650),k="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme;this.sidebarWindow=new WrapperWindow(this,mxResources.get("shapes"),k&&"1"!=urlParams.embedInline?66:10,k&&"1"!=urlParams.embedInline?Math.max(30,(this.diagramContainer.parentNode.clientHeight--g)/2):56,d-6,g-6,mxUtils.bind(this,function(m){this.createShapesPanel(m)}));this.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.sidebarWindow.window.fit()}));this.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90);this.sidebarWindow.window.setVisible(!1)}};EditorUi.prototype.setSketchMode=function(d){this.doSetSketchMode(d);null==urlParams.rough&&(mxSettings.settings.sketchMode=d,mxSettings.save());this.fireEvent(new mxEventObject("sketchModeChanged"))};EditorUi.prototype.setAndPersistDarkMode=-function(d){var g=d;"auto"==d&&(g=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode(g);mxSettings.settings.darkMode=d;mxSettings.save();d=mxSettings.getUi();null==urlParams.ui&&"dark"==d&&this.setCurrentTheme("kennedy",!0)};EditorUi.prototype.setAndPersistLanguage=function(d){this.spinner.spin(document.body,mxResources.get("working"))&&(mxSettings.setLanguage(d),mxSettings.save(),mxClient.language=d,mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE,-null,mxUtils.bind(this,function(){this.spinner.stop();this.fireEvent(new mxEventObject("languageChanged"))})))};EditorUi.prototype.setElementTitle=function(d,g){this.dependsOnLanguage(mxUtils.bind(this,function(){d.setAttribute("title",mxResources.get(g))}))};EditorUi.prototype.dependsOnLanguage=function(d){d();this.addListener("languageChanged",d)};EditorUi.prototype.setAndPersistHighContrast=function(d){this.setHighContrast(d);Editor.isSettingsEnabled()&&(mxSettings.settings.highContrast=d,mxSettings.save())};-EditorUi.prototype.isHighContrast=function(){var d=document.getElementById("high-contrast-stylesheet");return null!=d&&window.matchMedia?(d=d.getAttribute("media"),"all"==d||"not all"!=d&&window.matchMedia("(forced-colors: active)").matches):!1};EditorUi.prototype.setHighContrast=function(d){var g=document.getElementById("high-contrast-stylesheet");if(null!=g&&window.matchMedia){var k=window.matchMedia("(forced-colors: active)").matches,m=g.getAttribute("media");(m="all"==m||"not all"!=m&&k)&&!d?-g.setAttribute("media",k?"not all":"(forced-colors: active)"):!m&&d&&g.setAttribute("media",k?"(forced-colors: active)":"all")}};EditorUi.prototype.isRulerVisible=function(){return null!=this.ruler};EditorUi.prototype.setRulerVisible=function(d){var g=this.getDiagramContainerOffset();mxSettings.setRulerOn(d);mxSettings.save();d||null==this.ruler?d&&null==this.ruler&&(this.ruler=new mxDualRuler(this,this.editor.graph.view.unit)):(this.ruler.destroy(),this.ruler=null);this.fireEvent(new mxEventObject("rulerVisibleChanged"));-d=this.getDiagramContainerOffset();this.diagramContainer.scrollLeft+=d.x-g.x;this.diagramContainer.scrollTop+=d.x-g.x};EditorUi.prototype.isAutoDarkModeSupported=function(){return null!=window.matchMedia};EditorUi.prototype.isAutoDarkMode=function(d){return!d&&"auto"==urlParams.dark||Editor.isSettingsEnabled()&&"auto"==mxSettings.settings.darkMode};EditorUi.prototype.setDarkMode=function(d){mxUtils.lightDarkColorSupported&&(Editor.darkMode=d,d=mxUtils.isAncestorNode(document.body,this.container)||-null==this.editor?this.container:this.editor.graph.container,mxConstants.DROP_TARGET_COLOR=Editor.isDarkMode()?"#00ff00":"#0000ff",null!=d&&(Editor.isDarkMode()?(d.classList.add("geDarkMode"),d.style.colorScheme="dark"):(d.classList.remove("geDarkMode"),d.style.colorScheme="light")),null!=this.ruler&&this.ruler.updateStyle(),this.fireEvent(new mxEventObject("darkModeChanged")))};EditorUi.prototype.setPagesVisible=function(d){Editor.pagesVisible!=d&&(Editor.pagesVisible=d,mxSettings.settings.pagesVisible=-d,mxSettings.save(),this.fireEvent(new mxEventObject("pagesVisibleChanged")))};EditorUi.prototype.setSidebarTitles=function(d,g){this.sidebar.sidebarTitles!=d&&(this.sidebar.sidebarTitles=d,Editor.isSettingsEnabled()&&g&&(mxSettings.settings.sidebarTitles=d,mxSettings.save()),this.fireEvent(new mxEventObject("sidebarTitlesChanged")))};EditorUi.prototype.setInlineFullscreen=function(d){Editor.inlineFullscreen!=d&&(this.diagramContainer.setAttribute("data-scrollState",JSON.stringify(this.saveScrollState(!0))),-(window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:d,rect:this.diagramContainer.getBoundingClientRect()}),"*"))};EditorUi.prototype.inlineSizeChanged=function(){var d=this.sketchFooterMenuElt,g=this.sketchMainMenuElt,k=this.sketchPickerMenuElt;if(Editor.inlineFullscreen)g.style.left="10px",g.style.top="10px",k.style.left="10px",k.style.top="60px",d.style.top="10px",d.style.right="12px",d.style.left="",null==this.diagramContainer.getAttribute("data-bounds")&&(this.diagramContainer.setAttribute("data-bounds",-this.diagramContainer.style.top+" "+this.diagramContainer.style.left+" "+this.diagramContainer.style.width+" "+this.diagramContainer.style.height),this.diagramContainer.style.top="0px",this.diagramContainer.style.left="0px",this.diagramContainer.style.bottom="0px",this.diagramContainer.style.right="0px",this.diagramContainer.style.width="",this.diagramContainer.style.height="");else{var m=this.diagramContainer.getAttribute("data-bounds");if(null!=m){this.diagramContainer.removeAttribute("data-bounds");-var t=m.split(" ");m=mxUtils.getDocumentSize();this.diagramContainer.style.top=t[0];this.diagramContainer.style.left=t[1];var y=parseInt(t[2]);t=parseInt(t[3]);y=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,y):y,m.width-80);t=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,t):t,m.height-80);this.diagramContainer.style.width=y+"px";this.diagramContainer.style.height=t+"px";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";(window.opener||-window.parent).postMessage(JSON.stringify({event:"resize",rect:this.diagramContainer.getBoundingClientRect()}),"*")}g.style.left=this.diagramContainer.offsetLeft+"px";g.style.top=this.diagramContainer.offsetTop-g.offsetHeight-4+"px";k.style.display="";k.style.left=this.diagramContainer.offsetLeft-k.offsetWidth-4+"px";k.style.top=this.diagramContainer.offsetTop+"px";d.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-d.offsetWidth+"px";d.style.top=g.style.top;d.style.right=-"";this.bottomResizer.style.left=this.diagramContainer.offsetLeft+(this.diagramContainer.offsetWidth-this.bottomResizer.offsetWidth)/2+"px";this.bottomResizer.style.top=this.diagramContainer.offsetTop+this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight/2-1+"px";this.rightResizer.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-this.rightResizer.offsetWidth/2-1+"px";this.rightResizer.style.top=this.diagramContainer.offsetTop+(this.diagramContainer.offsetHeight--this.bottomResizer.offsetHeight)/2+"px"}this.bottomResizer.style.visibility=Editor.inlineFullscreen?"hidden":"";this.rightResizer.style.visibility=this.bottomResizer.style.visibility;g.style.visibility="";d.style.visibility=""};EditorUi.prototype.doSetSketchMode=function(d){Editor.sketchMode!=d&&(Editor.sketchMode=d,this.updateDefaultStyles())};EditorUi.prototype.updateDefaultStyles=function(){var d=this.editor.graph;d.defaultVertexStyle=mxUtils.clone(Graph.prototype.defaultVertexStyle);d.defaultEdgeStyle=-mxUtils.clone(Graph.prototype.defaultEdgeStyle);if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(d.vertexFontSize=16,d.edgeFontSize=d.vertexFontSize-4):"sketch"==Editor.currentTheme?(d.vertexFontSize=20,d.edgeFontSize=d.vertexFontSize-4):(d.vertexFontSize=Graph.prototype.vertexFontSize,d.edgeFontSize=Graph.prototype.edgeFontSize),d.defaultEdgeStyle.fontSize=d.edgeFontSize;if(null==Editor.config||-null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(d.defaultEdgeStyle.edgeStyle="none",d.defaultEdgeStyle.curved="1",d.defaultEdgeStyle.rounded="0",d.defaultEdgeStyle.endSize="8",d.defaultEdgeStyle.startSize="8"):"sketch"==Editor.currentTheme&&(d.defaultEdgeStyle.edgeStyle="none",d.defaultEdgeStyle.curved="1",d.defaultEdgeStyle.rounded="0",d.defaultEdgeStyle.jettySize="auto",d.defaultEdgeStyle.orthogonalLoop="1",d.defaultEdgeStyle.endArrow="open",d.defaultEdgeStyle.endSize=-"14",d.defaultEdgeStyle.startSize="14",d.defaultEdgeStyle.sourcePerimeterSpacing="8",d.defaultEdgeStyle.targetPerimeterSpacing="8");if(null==Editor.config||null==Editor.config.defaultFonts){if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle){if("sketch"==Editor.currentTheme&&"1"!=urlParams.embedInline||Editor.sketchMode)d.defaultVertexStyle.fontFamily=Editor.sketchFontFamily,d.defaultVertexStyle.fontSource=Editor.sketchFontSource,d.defaultEdgeStyle.fontFamily=-Editor.sketchFontFamily,d.defaultEdgeStyle.fontSource=Editor.sketchFontSource;Editor.sketchMode&&(d.defaultVertexStyle.sketch="1",d.defaultVertexStyle.curveFitting=Editor.sketchDefaultCurveFitting,d.defaultVertexStyle.jiggle=Editor.sketchDefaultJiggle,d.defaultVertexStyle.hachureGap="4",d.defaultEdgeStyle.sketch="1",d.defaultEdgeStyle.curveFitting=Editor.sketchDefaultCurveFitting,d.defaultEdgeStyle.jiggle=Editor.sketchDefaultJiggle,d.defaultEdgeStyle.hachureGap="4")}this.menus.defaultFonts="sketch"==-Editor.currentTheme?Menus.prototype.defaultFonts.concat(Editor.sketchFonts):Menus.prototype.defaultFonts}d.currentVertexStyle=mxUtils.clone(d.defaultVertexStyle);d.currentEdgeStyle=mxUtils.clone(d.defaultEdgeStyle);this.clearDefaultStyle()};EditorUi.prototype.getLinkTitle=function(d){var g=Graph.prototype.getLinkTitle.apply(this,arguments);if(Graph.isPageLink(d)){var k=d.indexOf(",");0<k&&(g=this.getPageById(d.substring(k+1)),g=null!=g?g.getName():mxResources.get("pageNotFound"))}else"data:"==d.substring(0,-5)&&(g=this.getCustomLinkTitle(d));return g};EditorUi.prototype.getCustomLinkTitle=function(d){var g=mxResources.get("action");if("data:action/json,"==d.substring(0,17))try{var k=JSON.parse(d.substring(17));null!=k&&null!=k.title&&(g=k.title)}catch(m){}return g};EditorUi.prototype.handleCustomLink=function(d,g){if(Graph.isPageLink(d))if(g=d.indexOf(","),d=this.getPageById(d.substring(g+1)))this.selectPage(d);else throw Error(mxResources.get("pageNotFound")||"Page not found");else this.editor.graph.handleCustomLink(d,-g)};EditorUi.prototype.installSettings=function(){if(Editor.isSettingsEnabled()){var d=this.editor.graph;Editor.pagesVisible=mxSettings.settings.pagesVisible;ColorDialog.recentColors=mxSettings.getRecentColors();if(isLocalStorage)try{window.addEventListener("storage",mxUtils.bind(this,function(g){g.key==mxSettings.key&&(mxSettings.load(),ColorDialog.recentColors=mxSettings.getRecentColors(),this.menus.customFonts=mxSettings.getCustomFonts())}),!1)}catch(g){}this.fireEvent(new mxEventObject("styleChanged",-"keys",[],"values",[],"cells",[]));this.menus.customFonts=mxSettings.getCustomFonts();this.addListener("customFontsChanged",mxUtils.bind(this,function(g,k){mxSettings.setCustomFonts(this.menus.customFonts);mxSettings.save()}));d.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(g,k){mxSettings.setCreateTarget(d.connectionHandler.isCreateTarget());mxSettings.save()}));-d.pageFormat=null!=d.defaultPageFormat?d.defaultPageFormat:mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(g,k){mxSettings.setPageFormat(d.pageFormat);mxSettings.save()}));d.view.defaultDarkGridColor=mxSettings.getGridColor(!0);d.view.defaultGridColor=mxSettings.getGridColor(!1);d.view.gridColor="light-dark("+d.view.defaultGridColor+", "+d.view.defaultDarkGridColor+")";this.addListener("gridColorChanged",mxUtils.bind(this,function(g,k){mxSettings.setGridColor(d.view.defaultGridColor,-!1);mxSettings.setGridColor(d.view.defaultDarkGridColor,!0);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(g,k){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();if(!this.editor.chromeless||this.editor.editable)null!=mxSettings.settings.enableAnimations&&(Editor.enableAnimations=mxSettings.settings.enableAnimations),this.addListener("enableAnimationsChanged",-mxUtils.bind(this,function(g,k){mxSettings.settings.enableAnimations=Editor.enableAnimations;mxSettings.save()}));null!=this.sidebar&&(null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes?(this.sidebar.searchShapes(decodeURIComponent(urlParams["search-shapes"])),this.sidebar.showEntries("search")):(this.sidebar.showPalette("search",mxSettings.settings.search),this.editor.chromeless&&!this.editor.editable||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),-mxSettings.save())));this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyImage=function(d,g,k){try{null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(m,t){try{this.spinner.stop();var y=this.createImageDataUri(m,g,"png"),A=parseInt(t.getAttribute("width")),I=parseInt(t.getAttribute("height"));-this.writeImageToClipboard(y,A,I,mxUtils.bind(this,function(F){this.handleError(F)}))}catch(F){this.handleError(F)}}),null,null,null,mxUtils.bind(this,function(m){this.spinner.stop();this.handleError(m)}),null,null,null!=k?k:4,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,null,null,null,10,null,null,!1,null,0<d.length?d:null)}catch(m){this.handleError(m)}};EditorUi.prototype.copyCells=function(d,g){var k=this.editor.graph;if(k.isSelectionEmpty())d.innerText="";-else{var m=mxUtils.sortCells(k.model.getTopmostCells(k.getSelectionCells())),t=mxUtils.getXml(k.encodeCells(m));mxUtils.setTextContent(d,encodeURIComponent(t));g?(k.removeCells(m,!1),k.lastPasteXml=null):(k.lastPasteXml=t,k.pasteCounter=0);d.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var d=null;if(Editor.enableNativeCipboard){var g=this.editor.graph;g.isSelectionEmpty()||(d=mxUtils.sortCells(g.getExportableCells(g.model.getTopmostCells(g.getSelectionCells()))),-g=mxUtils.getXml(g.encodeCells(d)),navigator.clipboard.writeText(g))}return d};EditorUi.prototype.pasteXml=function(d,g,k,m,t){t=null!=t?t:!0;var y=this.editor.graph,A=null;y.lastPasteXml==d?y.pasteCounter++:(y.lastPasteXml=d,y.pasteCounter=0);var I=y.pasteCounter*y.gridSize;if(k||this.isCompatibleString(d))A=this.importXml(d,I,I),y.setSelectionCells(A);else if(g&&1==y.getSelectionCount()){t=y.getStartEditingCell(y.getSelectionCell(),m);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(d)&&"image"==y.getCurrentCellStyle(t)[mxConstants.STYLE_SHAPE])y.setCellStyles(mxConstants.STYLE_IMAGE,-d,[t]);else{y.model.beginUpdate();try{y.labelChanged(t,d),Graph.isLink(d)&&y.setLinkForCell(t,d)}finally{y.model.endUpdate()}}y.setSelectionCell(t)}else A=y.getInsertPoint(),y.isMouseInsertPoint()&&(I=0,y.lastPasteXml==d&&0<y.pasteCounter&&y.pasteCounter--),A=this.insertTextAt(d,A.x+I,A.y+I,t),y.setSelectionCells(A);y.isSelectionEmpty()||(y.scrollCellToVisible(y.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(y.view.getState(y.getSelectionCell())));return A};EditorUi.prototype.pasteCells=-function(d,g,k,m){if(!mxEvent.isConsumed(d)){var t=g,y=!1;if(k&&null!=d.clipboardData&&d.clipboardData.getData){var A=d.clipboardData.getData("text/plain"),I=!1;if(null!=A&&0<A.length&&"%3CmxGraphModel%3E"==A.substring(0,18))try{var F=decodeURIComponent(A);this.isCompatibleString(F)&&(I=!0,A=F)}catch(u){}I=I?null:d.clipboardData.getData("text/html");null!=I&&0<I.length?(t=this.parseHtmlData(I),y="text/plain"!=t.getAttribute("data-type")):null!=A&&0<A.length&&(t=document.createElement("div"),mxUtils.setTextContent(t,-I))}A=t.getElementsByTagName("span");if(null!=A&&0<A.length&&"application/vnd.lucid.chart.objects"===A[0].getAttribute("data-lucid-type"))k=A[0].getAttribute("data-lucid-content"),null!=k&&0<k.length&&(this.convertLucidChart(k,mxUtils.bind(this,function(u){var x=this.editor.graph;x.lastPasteXml==u?x.pasteCounter++:(x.lastPasteXml=u,x.pasteCounter=0);var J=x.pasteCounter*x.gridSize;x.setSelectionCells(this.importXml(u,J,J));x.scrollCellToVisible(x.getSelectionCell())}),mxUtils.bind(this,function(u){this.handleError(u)})),-mxEvent.consume(d));else{var C=!1,Q="";Q=y?null!=t.textContent&&"<mxfile"==t.textContent.substring(0,7)&&"</mxfile>"==t.textContent.substring(t.textContent.length-9)||"<mxGraphModel"==t.textContent.substring(0,13)&&"</mxGraphModel>"==t.textContent.substring(t.textContent.length-15)?t.textContent.replace(/\u00a0/g," "):t.innerHTML:mxUtils.trim(null==t.innerText?mxUtils.getTextContent(t):t.innerText);try{var S=Q.lastIndexOf("%3E");0<=S&&S<Q.length-3&&(Q=Q.substring(0,S+3))}catch(u){}try{A=t.getElementsByTagName("span"),-(F=null!=A&&0<A.length?mxUtils.trim(decodeURIComponent(A[0].textContent)):decodeURIComponent(Q))&&(this.isCompatibleString(F)||0==F.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(C=!0,Q=F)}catch(u){}try{if(null!=Q&&0<Q.length){if(0==Q.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var V=mxUtils.bind(this,function(){try{Q=(new MiroImporter).importMiroJson(JSON.parse(Q)),this.pasteXml(Q,m,C,d)}catch(u){console.log("Miro import error:",u)}});"undefined"===typeof MiroImporter?+null!=this.buttonContainer&&null!=this.menubar&&(this.buttonContainer.style.display="",this.menubar.container.appendChild(this.buttonContainer))};EditorUi.prototype.createMenu=function(d,g,k,m){k=null!=k?k:"geButton";var t=this.menus.get(d);m=this.menubar.addMenu(mxResources.get(d),t.funct,null,m);m.className=k;m.setAttribute("title",mxResources.get(d));this.menus.menuCreated(t,m,k);null!=g&&(m.style.backgroundImage="url("+g+")",m.innerText="");return m};EditorUi.prototype.addButton=function(d,g,+k,m){d=this.createToolbarButton(d,g,k);m=null!=m?m:this.container;m.appendChild(d);return d};EditorUi.prototype.createToolbarButton=function(d,g,k){var m=document.createElement("a");m.className="geButton";null!=d&&"data:"==d.substring(0,5)&&(m.style.backgroundImage="url("+d+")");null!=g&&m.setAttribute("title",g);null!=k&&mxEvent.addListener(m,"click",function(t){"disabled"!=m.getAttribute("disabled")&&k(t);mxEvent.consume(t)});mxEvent.preventDefault(m);return m};EditorUi.prototype.createMenuItem=+function(d,g,k){var m=this.actions.get(d),t=null!=m?m.funct:null,y=this.createToolbarButton(g,mxResources.get(d)+(null!=m&&null!=m.shortcut?" ("+m.shortcut+")":""),t);null==m||k||(d=function(){m.isEnabled()?y.removeAttribute("disabled"):y.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",d),m.addListener("stateChanged",d),d());return y};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var d=Math.max(10,this.diagramContainer.parentNode.clientWidth-+256),g="1"==urlParams.embedInline?580:"1"==urlParams.sketch?580:Math.min(566,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,mxResources.get("format"),d,60,240,g,mxUtils.bind(this,function(t){t.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.formatWindow.window.fit()}));var k=this.formatWindow.window.toggleMinimized,m=240;this.formatWindow.window.toggleMinimized=function(){k.apply(this,arguments);+this.minimized?(m=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+m-140+"px"):(this.div.style.width=m+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-m+140)+"px");this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(t){mxEvent.getSource(t)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));+this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80);"sketch"==Editor.currentTheme?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var t=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,y=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>t||690>y)&&this.formatWindow.window.toggleMinimized()}),0)):this.formatWindow.window.setVisible(!1)}};var v=EditorUi.prototype.toggleFormatPanel;+EditorUi.prototype.toggleFormatPanel=function(d){var g=this.formatWindow;null!=g?g.window.setVisible(null!=d?d:!this.isFormatPanelVisible()):v.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(d){if(this.isShapesPanelVisible()!=d){var g=EditorUi.prototype.hsplitPosition;0==g&&(g=this.defaultSidebarWidth);var k=this.hsplitPosition,m=mxUtils.bind(this,function(){this.hsplitPosition=t;this.refresh();this.diagramContainer.scrollLeft-=k-this.hsplitPosition}),t=d?g:0,y=Editor.transitionDelay;+mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==t?"translateX(0)":"translateX(-100%)");0!=t&&m();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==t?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+y+"s ease-in-out");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin","top left");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,+"transition",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin",null);0==t&&m()}),1E3*y)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var D=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var d=this.formatWindow;return null!=d?d.window.isVisible():D.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(d){var g=+mxUtils.bind(this,function(z,I){var F=this.menus.get(z);z=this.createMenuElement(I,mxUtils.bind(this,function(){F.funct.apply(this,arguments)}));z.setAttribute("title",I);z.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";z.className="geButton";d.parentNode.appendChild(z);return z});if(Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries))if(null!=this.actions.get("newLibrary"))g=document.createElement("div"),+g.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;",g.className="geButton",g.style.left="0px",g.style.right="50%",mxUtils.write(g,mxResources.get("newLibrary")),d.appendChild(g),mxEvent.addListener(g,"click",this.actions.get("newLibrary").funct),g=g.cloneNode(!1),g.style.left="50%",g.style.right="0px",mxUtils.write(g,mxResources.get("openLibrary")),d.appendChild(g),mxEvent.addListener(g,"click",this.actions.get("openLibrary").funct);else{var k=+g("newLibrary","");k.style.left="0px";k.style.right="50%";var m=document.createElement("span");k.appendChild(m);var t=g("openLibraryFrom","");t.style.borderLeftWidth="1px";t.style.left="50%";t.style.right="0px";var y=document.createElement("span");t.appendChild(y);this.dependsOnLanguage(mxUtils.bind(this,function(){m.innerHTML="";mxUtils.write(m,mxResources.get("newLibrary"));k.setAttribute("title",mxResources.get("newLibrary"));y.innerHTML="";mxUtils.write(y,mxResources.get("openLibraryFrom"));t.setAttribute("title",+mxResources.get("openLibraryFrom"))}))}d.appendChild(this.sidebar.container);d.style.overflow="hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var d=Math.min(this.diagramContainer.parentNode.clientWidth-10,218),g="1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,650),k="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme;this.sidebarWindow=new WrapperWindow(this,mxResources.get("shapes"),k&&"1"!=urlParams.embedInline?+66:10,k&&"1"!=urlParams.embedInline?Math.max(30,(this.diagramContainer.parentNode.clientHeight-g)/2):56,d-6,g-6,mxUtils.bind(this,function(m){this.createShapesPanel(m)}));this.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.sidebarWindow.window.fit()}));this.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90);this.sidebarWindow.window.setVisible(!1)}};EditorUi.prototype.setSketchMode=function(d){this.doSetSketchMode(d);null==urlParams.rough&&(mxSettings.settings.sketchMode=+d,mxSettings.save());this.fireEvent(new mxEventObject("sketchModeChanged"))};EditorUi.prototype.setAndPersistDarkMode=function(d){var g=d;"auto"==d&&(g=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode(g);mxSettings.settings.darkMode=d;mxSettings.save();d=mxSettings.getUi();null==urlParams.ui&&"dark"==d&&this.setCurrentTheme("kennedy",!0)};EditorUi.prototype.setAndPersistLanguage=function(d){this.spinner.spin(document.body,mxResources.get("working"))&&+(mxSettings.setLanguage(d),mxSettings.save(),mxClient.language=d,mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE,null,mxUtils.bind(this,function(){this.spinner.stop();this.fireEvent(new mxEventObject("languageChanged"))})))};EditorUi.prototype.setElementTitle=function(d,g){this.dependsOnLanguage(mxUtils.bind(this,function(){d.setAttribute("title",mxResources.get(g))}))};EditorUi.prototype.dependsOnLanguage=function(d){d();this.addListener("languageChanged",d)};EditorUi.prototype.setAndPersistHighContrast=+function(d){this.setHighContrast(d);Editor.isSettingsEnabled()&&(mxSettings.settings.highContrast=d,mxSettings.save())};EditorUi.prototype.isHighContrast=function(){var d=document.getElementById("high-contrast-stylesheet");return null!=d&&window.matchMedia?(d=d.getAttribute("media"),"all"==d||"not all"!=d&&window.matchMedia("(forced-colors: active)").matches):!1};EditorUi.prototype.setHighContrast=function(d){var g=document.getElementById("high-contrast-stylesheet");if(null!=g&&window.matchMedia){var k=+window.matchMedia("(forced-colors: active)").matches,m=g.getAttribute("media");(m="all"==m||"not all"!=m&&k)&&!d?g.setAttribute("media",k?"not all":"(forced-colors: active)"):!m&&d&&g.setAttribute("media",k?"(forced-colors: active)":"all")}};EditorUi.prototype.isRulerVisible=function(){return null!=this.ruler};EditorUi.prototype.setRulerVisible=function(d){var g=this.getDiagramContainerOffset();mxSettings.setRulerOn(d);mxSettings.save();d||null==this.ruler?d&&null==this.ruler&&(this.ruler=new mxDualRuler(this,+this.editor.graph.view.unit)):(this.ruler.destroy(),this.ruler=null);this.fireEvent(new mxEventObject("rulerVisibleChanged"));d=this.getDiagramContainerOffset();this.diagramContainer.scrollLeft+=d.x-g.x;this.diagramContainer.scrollTop+=d.x-g.x};EditorUi.prototype.isAutoDarkModeSupported=function(){return null!=window.matchMedia};EditorUi.prototype.isAutoDarkMode=function(d){return!d&&"auto"==urlParams.dark||Editor.isSettingsEnabled()&&"auto"==mxSettings.settings.darkMode};EditorUi.prototype.setDarkMode=+function(d){mxUtils.lightDarkColorSupported&&(Editor.darkMode=d,d=mxUtils.isAncestorNode(document.body,this.container)||null==this.editor?this.container:this.editor.graph.container,mxConstants.DROP_TARGET_COLOR=Editor.isDarkMode()?"#00ff00":"#0000ff",null!=d&&(Editor.isDarkMode()?(d.classList.add("geDarkMode"),d.style.colorScheme="dark"):(d.classList.remove("geDarkMode"),d.style.colorScheme="light")),null!=this.ruler&&this.ruler.updateStyle(),this.fireEvent(new mxEventObject("darkModeChanged")))};+EditorUi.prototype.setPagesVisible=function(d){Editor.pagesVisible!=d&&(Editor.pagesVisible=d,mxSettings.settings.pagesVisible=d,mxSettings.save(),this.fireEvent(new mxEventObject("pagesVisibleChanged")))};EditorUi.prototype.setSidebarTitles=function(d,g){this.sidebar.sidebarTitles!=d&&(this.sidebar.sidebarTitles=d,Editor.isSettingsEnabled()&&g&&(mxSettings.settings.sidebarTitles=d,mxSettings.save()),this.fireEvent(new mxEventObject("sidebarTitlesChanged")))};EditorUi.prototype.setInlineFullscreen=+function(d){Editor.inlineFullscreen!=d&&(this.diagramContainer.setAttribute("data-scrollState",JSON.stringify(this.saveScrollState(!0))),(window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:d,rect:this.diagramContainer.getBoundingClientRect()}),"*"))};EditorUi.prototype.inlineSizeChanged=function(){var d=this.sketchFooterMenuElt,g=this.sketchMainMenuElt,k=this.sketchPickerMenuElt;if(Editor.inlineFullscreen)g.style.left="10px",g.style.top="10px",k.style.left="10px",+k.style.top="60px",d.style.top="10px",d.style.right="12px",d.style.left="",null==this.diagramContainer.getAttribute("data-bounds")&&(this.diagramContainer.setAttribute("data-bounds",this.diagramContainer.style.top+" "+this.diagramContainer.style.left+" "+this.diagramContainer.style.width+" "+this.diagramContainer.style.height),this.diagramContainer.style.top="0px",this.diagramContainer.style.left="0px",this.diagramContainer.style.bottom="0px",this.diagramContainer.style.right="0px",this.diagramContainer.style.width=+"",this.diagramContainer.style.height="");else{var m=this.diagramContainer.getAttribute("data-bounds");if(null!=m){this.diagramContainer.removeAttribute("data-bounds");var t=m.split(" ");m=mxUtils.getDocumentSize();this.diagramContainer.style.top=t[0];this.diagramContainer.style.left=t[1];var y=parseInt(t[2]);t=parseInt(t[3]);y=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,y):y,m.width-80);t=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,t):t,m.height-80);this.diagramContainer.style.width=+y+"px";this.diagramContainer.style.height=t+"px";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";(window.opener||window.parent).postMessage(JSON.stringify({event:"resize",rect:this.diagramContainer.getBoundingClientRect()}),"*")}g.style.left=this.diagramContainer.offsetLeft+"px";g.style.top=this.diagramContainer.offsetTop-g.offsetHeight-4+"px";k.style.display="";k.style.left=this.diagramContainer.offsetLeft-k.offsetWidth-4+"px";k.style.top=this.diagramContainer.offsetTop++"px";d.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-d.offsetWidth+"px";d.style.top=g.style.top;d.style.right="";this.bottomResizer.style.left=this.diagramContainer.offsetLeft+(this.diagramContainer.offsetWidth-this.bottomResizer.offsetWidth)/2+"px";this.bottomResizer.style.top=this.diagramContainer.offsetTop+this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight/2-1+"px";this.rightResizer.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-+this.rightResizer.offsetWidth/2-1+"px";this.rightResizer.style.top=this.diagramContainer.offsetTop+(this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight)/2+"px"}this.bottomResizer.style.visibility=Editor.inlineFullscreen?"hidden":"";this.rightResizer.style.visibility=this.bottomResizer.style.visibility;g.style.visibility="";d.style.visibility=""};EditorUi.prototype.doSetSketchMode=function(d){Editor.sketchMode!=d&&(Editor.sketchMode=d,this.updateDefaultStyles())};EditorUi.prototype.updateDefaultStyles=+function(){var d=this.editor.graph;d.defaultVertexStyle=mxUtils.clone(Graph.prototype.defaultVertexStyle);d.defaultEdgeStyle=mxUtils.clone(Graph.prototype.defaultEdgeStyle);if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(d.vertexFontSize=16,d.edgeFontSize=d.vertexFontSize-4):"sketch"==Editor.currentTheme?(d.vertexFontSize=20,d.edgeFontSize=d.vertexFontSize-4):(d.vertexFontSize=Graph.prototype.vertexFontSize,+d.edgeFontSize=Graph.prototype.edgeFontSize),d.defaultEdgeStyle.fontSize=d.edgeFontSize;if(null==Editor.config||null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(d.defaultEdgeStyle.edgeStyle="none",d.defaultEdgeStyle.curved="1",d.defaultEdgeStyle.rounded="0",d.defaultEdgeStyle.endSize="8",d.defaultEdgeStyle.startSize="8"):"sketch"==Editor.currentTheme&&(d.defaultEdgeStyle.edgeStyle="none",d.defaultEdgeStyle.curved="1",d.defaultEdgeStyle.rounded="0",d.defaultEdgeStyle.jettySize=+"auto",d.defaultEdgeStyle.orthogonalLoop="1",d.defaultEdgeStyle.endArrow="open",d.defaultEdgeStyle.endSize="14",d.defaultEdgeStyle.startSize="14",d.defaultEdgeStyle.sourcePerimeterSpacing="8",d.defaultEdgeStyle.targetPerimeterSpacing="8");if(null==Editor.config||null==Editor.config.defaultFonts){if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle){if("sketch"==Editor.currentTheme&&"1"!=urlParams.embedInline||Editor.sketchMode)d.defaultVertexStyle.fontFamily=+Editor.sketchFontFamily,d.defaultVertexStyle.fontSource=Editor.sketchFontSource,d.defaultEdgeStyle.fontFamily=Editor.sketchFontFamily,d.defaultEdgeStyle.fontSource=Editor.sketchFontSource;Editor.sketchMode&&(d.defaultVertexStyle.sketch="1",d.defaultVertexStyle.curveFitting=Editor.sketchDefaultCurveFitting,d.defaultVertexStyle.jiggle=Editor.sketchDefaultJiggle,d.defaultVertexStyle.hachureGap="4",d.defaultEdgeStyle.sketch="1",d.defaultEdgeStyle.curveFitting=Editor.sketchDefaultCurveFitting,d.defaultEdgeStyle.jiggle=+Editor.sketchDefaultJiggle,d.defaultEdgeStyle.hachureGap="4")}this.menus.defaultFonts="sketch"==Editor.currentTheme?Menus.prototype.defaultFonts.concat(Editor.sketchFonts):Menus.prototype.defaultFonts}d.currentVertexStyle=mxUtils.clone(d.defaultVertexStyle);d.currentEdgeStyle=mxUtils.clone(d.defaultEdgeStyle);this.clearDefaultStyle()};EditorUi.prototype.getLinkTitle=function(d){var g=Graph.prototype.getLinkTitle.apply(this,arguments);if(Graph.isPageLink(d)){var k=d.indexOf(",");0<k&&(g=this.getPageById(d.substring(k++1)),g=null!=g?g.getName():mxResources.get("pageNotFound"))}else"data:"==d.substring(0,5)&&(g=this.getCustomLinkTitle(d));return g};EditorUi.prototype.getCustomLinkTitle=function(d){var g=mxResources.get("action");if("data:action/json,"==d.substring(0,17))try{var k=JSON.parse(d.substring(17));null!=k&&null!=k.title&&(g=k.title)}catch(m){}return g};EditorUi.prototype.handleCustomLink=function(d,g){if(Graph.isPageLink(d))if(g=d.indexOf(","),d=this.getPageById(d.substring(g+1)))this.selectPage(d);else throw Error(mxResources.get("pageNotFound")||+"Page not found");else this.editor.graph.handleCustomLink(d,g)};EditorUi.prototype.installSettings=function(){if(Editor.isSettingsEnabled()){var d=this.editor.graph;Editor.pagesVisible=mxSettings.settings.pagesVisible;ColorDialog.recentColors=mxSettings.getRecentColors();if(isLocalStorage)try{window.addEventListener("storage",mxUtils.bind(this,function(g){g.key==mxSettings.key&&(mxSettings.load(),ColorDialog.recentColors=mxSettings.getRecentColors(),this.menus.customFonts=mxSettings.getCustomFonts())}),+!1)}catch(g){}this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.menus.customFonts=mxSettings.getCustomFonts();this.addListener("customFontsChanged",mxUtils.bind(this,function(g,k){mxSettings.setCustomFonts(this.menus.customFonts);mxSettings.save()}));d.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(g,k){mxSettings.setCreateTarget(d.connectionHandler.isCreateTarget());+mxSettings.save()}));d.pageFormat=null!=d.defaultPageFormat?d.defaultPageFormat:mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(g,k){mxSettings.setPageFormat(d.pageFormat);mxSettings.save()}));d.view.defaultDarkGridColor=mxSettings.getGridColor(!0);d.view.defaultGridColor=mxSettings.getGridColor(!1);d.view.gridColor="light-dark("+d.view.defaultGridColor+", "+d.view.defaultDarkGridColor+")";this.addListener("gridColorChanged",mxUtils.bind(this,function(g,+k){mxSettings.setGridColor(d.view.defaultGridColor,!1);mxSettings.setGridColor(d.view.defaultDarkGridColor,!0);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(g,k){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();if(!this.editor.chromeless||this.editor.editable)null!=mxSettings.settings.enableAnimations&&(Editor.enableAnimations=mxSettings.settings.enableAnimations),+this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(g,k){mxSettings.settings.enableAnimations=Editor.enableAnimations;mxSettings.save()}));null!=this.sidebar&&(null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes?(this.sidebar.searchShapes(decodeURIComponent(urlParams["search-shapes"])),this.sidebar.showEntries("search")):(this.sidebar.showPalette("search",mxSettings.settings.search),this.editor.chromeless&&!this.editor.editable||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||+0))||(this.toggleScratchpad(),mxSettings.save())));this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyImage=function(d,g,k){try{null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(m,t){try{this.spinner.stop();var y=this.createImageDataUri(m,g,"png"),z=parseInt(t.getAttribute("width")),+I=parseInt(t.getAttribute("height"));this.writeImageToClipboard(y,z,I,mxUtils.bind(this,function(F){this.handleError(F)}))}catch(F){this.handleError(F)}}),null,null,null,mxUtils.bind(this,function(m){this.spinner.stop();this.handleError(m)}),null,null,null!=k?k:4,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,null,null,null,10,null,null,!1,null,0<d.length?d:null)}catch(m){this.handleError(m)}};EditorUi.prototype.copyCells=function(d,g){var k=this.editor.graph;if(k.isSelectionEmpty())d.innerText=+"";else{var m=mxUtils.sortCells(k.model.getTopmostCells(k.getSelectionCells())),t=mxUtils.getXml(k.encodeCells(m));mxUtils.setTextContent(d,encodeURIComponent(t));g?(k.removeCells(m,!1),k.lastPasteXml=null):(k.lastPasteXml=t,k.pasteCounter=0);d.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var d=null;if(Editor.enableNativeCipboard){var g=this.editor.graph;g.isSelectionEmpty()||(d=mxUtils.sortCells(g.getExportableCells(g.model.getTopmostCells(g.getSelectionCells()))),+g=mxUtils.getXml(g.encodeCells(d)),navigator.clipboard.writeText(g))}return d};EditorUi.prototype.pasteXml=function(d,g,k,m,t){t=null!=t?t:!0;var y=this.editor.graph,z=null;y.lastPasteXml==d?y.pasteCounter++:(y.lastPasteXml=d,y.pasteCounter=0);var I=y.pasteCounter*y.gridSize;if(k||this.isCompatibleString(d))z=this.importXml(d,I,I),y.setSelectionCells(z);else if(g&&1==y.getSelectionCount()){t=y.getStartEditingCell(y.getSelectionCell(),m);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(d)&&"image"==y.getCurrentCellStyle(t)[mxConstants.STYLE_SHAPE])y.setCellStyles(mxConstants.STYLE_IMAGE,+d,[t]);else{y.model.beginUpdate();try{y.labelChanged(t,d),Graph.isLink(d)&&y.setLinkForCell(t,d)}finally{y.model.endUpdate()}}y.setSelectionCell(t)}else z=y.getInsertPoint(),y.isMouseInsertPoint()&&(I=0,y.lastPasteXml==d&&0<y.pasteCounter&&y.pasteCounter--),z=this.insertTextAt(d,z.x+I,z.y+I,t),y.setSelectionCells(z);y.isSelectionEmpty()||(y.scrollCellToVisible(y.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(y.view.getState(y.getSelectionCell())));return z};EditorUi.prototype.pasteCells=+function(d,g,k,m){if(!mxEvent.isConsumed(d)){var t=g,y=!1;if(k&&null!=d.clipboardData&&d.clipboardData.getData){var z=d.clipboardData.getData("text/plain"),I=!1;if(null!=z&&0<z.length&&"%3CmxGraphModel%3E"==z.substring(0,18))try{var F=decodeURIComponent(z);this.isCompatibleString(F)&&(I=!0,z=F)}catch(u){}I=I?null:d.clipboardData.getData("text/html");null!=I&&0<I.length?(t=this.parseHtmlData(I),y="text/plain"!=t.getAttribute("data-type")):null!=z&&0<z.length&&(t=document.createElement("div"),mxUtils.setTextContent(t,+I))}z=t.getElementsByTagName("span");if(null!=z&&0<z.length&&"application/vnd.lucid.chart.objects"===z[0].getAttribute("data-lucid-type"))k=z[0].getAttribute("data-lucid-content"),null!=k&&0<k.length&&(this.convertLucidChart(k,mxUtils.bind(this,function(u){var x=this.editor.graph;x.lastPasteXml==u?x.pasteCounter++:(x.lastPasteXml=u,x.pasteCounter=0);var J=x.pasteCounter*x.gridSize;x.setSelectionCells(this.importXml(u,J,J));x.scrollCellToVisible(x.getSelectionCell())}),mxUtils.bind(this,function(u){this.handleError(u)})),+mxEvent.consume(d));else{var C=!1,Q="";Q=y?null!=t.textContent&&"<mxfile"==t.textContent.substring(0,7)&&"</mxfile>"==t.textContent.substring(t.textContent.length-9)||"<mxGraphModel"==t.textContent.substring(0,13)&&"</mxGraphModel>"==t.textContent.substring(t.textContent.length-15)?t.textContent.replace(/\u00a0/g," "):t.innerHTML:mxUtils.trim(null==t.innerText?mxUtils.getTextContent(t):t.innerText);try{var S=Q.lastIndexOf("%3E");0<=S&&S<Q.length-3&&(Q=Q.substring(0,S+3))}catch(u){}try{z=t.getElementsByTagName("span"),+(F=null!=z&&0<z.length?mxUtils.trim(decodeURIComponent(z[0].textContent)):decodeURIComponent(Q))&&(this.isCompatibleString(F)||0==F.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(C=!0,Q=F)}catch(u){}try{if(null!=Q&&0<Q.length){if(0==Q.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var V=mxUtils.bind(this,function(){try{Q=(new MiroImporter).importMiroJson(JSON.parse(Q)),this.pasteXml(Q,m,C,d)}catch(u){console.log("Miro import error:",u)}});"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",V):V()}else this.pasteXml(Q,m,C,d,y);try{mxEvent.consume(d)}catch(u){}}else if(!k){var P=this.editor.graph;P.lastPasteXml=null;P.pasteCounter=0}}catch(u){this.handleError(u)}}}g.innerHTML=" "};EditorUi.prototype.showPrintDialog=function(d,g,k){var m=320;this.editor.graph.isEnabled()&&(m+=40);null!=this.pages&&1<this.pages.length&&(m+=40,this.editor.graph.isEnabled()||(m+=10));null==g||mxClient.IS_CHROMEAPP||"draw.io"!=this.getServiceName()||(m+=20);-this.showDialog((new PrintDialog(this,d,g,k)).container,320,m,!0,!0)};EditorUi.prototype.print=function(d,g){var k=this.editor,m=k.graph,t=this.getPageIndex(this.currentPage),y=null!=t?t+1:1,A=mxUtils.bind(this,function(J,H,K,O){var M=J.useCssTransforms,n=J.currentTranslate,z=J.currentScale,D=J.view.translate,L=J.view.scale;J.useCssTransforms&&(J.useCssTransforms=!1,J.currentTranslate=new mxPoint(0,0),J.currentScale=1,J.view.translate=new mxPoint(0,0),J.view.scale=1);var N=J.getGraphBounds(),R=0,-T=0,U=mxRectangle.fromRectangle(J.pageFormat),W=g.fit||g.crop||!J.pageVisible,X=g.scale;U.width=Math.ceil(U.width*J.pageScale);U.height=Math.ceil(U.height*J.pageScale);var Y=1;if(g.fit){Y=g.sheetsAcross;var Z=g.sheetsDown;isNaN(X)||(U.width=Math.ceil(U.width*X),U.height=Math.ceil(U.height*X));Y=Math.min(U.height*Z/(N.height/J.view.scale),U.width*Y/(N.width/J.view.scale))}else Y=isNaN(X)?1:X;Y*=1;!W&&J.pageVisible?(X=J.getPageLayout(),R-=X.x*U.width,T-=X.y*U.height):W=!0;g.crop&&(g.selection&&(N=m.getBoundingBox(m.getSelectionCells())),-U.width=(N.width+1)*Y/J.view.scale,U.height=(N.height+1)*Y/J.view.scale);U.width=Math.ceil(1*U.width);U.height=Math.ceil(1*U.height);O=null!=O?"page/id,"+O:null;if(null==H){H=PrintDialog.createPrintPreview(J,Y,null,0,R,T,W);H.title=this.getBaseFilename(!0);H.pageSelector=!1;H.mathEnabled=!1;R=g.border;isNaN(R)||(H.pageMargin=R);g.selection&&(H.isCellVisible=function(ba){return J.isCellSelected(ba)});var ca=H.writeHead;H.writeHead=function(ba){ca.apply(this,arguments);mxClient.IS_GC&&(ba.writeln('<style type="text/css">'),-ba.writeln("@media print {"),ba.writeln(".MathJax svg { shape-rendering: crispEdges; }"),ba.writeln("}"),ba.writeln("</style>"));null!=k.fontCss&&(ba.writeln('<style type="text/css">'),ba.writeln(mxUtils.htmlEntities(k.fontCss,!1,!1,!1)),ba.writeln("</style>"));for(var fa=J.getCustomFonts(),aa=0;aa<fa.length;aa++){var ia=fa[aa].name,ha=fa[aa].url;Graph.isCssFontUrl(ha)?ba.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(ha))+'" charset="UTF-8" type="text/css">'):-(ba.writeln('<style type="text/css">'),ba.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(ia)+'";\nsrc: url("'+mxUtils.htmlEntities(ha)+'");\n}'),ba.writeln("</style>"))}};if(Editor.replaceSvgDataUris){var ea=H.drawBackgroundImage;H.drawBackgroundImage=function(ba){ea.apply(this,arguments);null!=ba.node&&(EditorUi.embedSvgImages(ba.node),m.disableSvgLinks(ba.node,function(fa){fa.setAttribute("href","javascript:void(0)")}))}}var ja=H.addGraphFragment;H.addGraphFragment=function(ba,fa,aa,-ia,ha,da){ja.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:ha.classList.add("geDisableMathJax")};g.grid&&(H.gridSize=J.gridSize,H.gridSteps=J.view.gridSteps,H.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:J.view.gridColor);H.open(null,null,K,!0,O,U,g.selection?J.getSelectionCells():null)}else{N=J.background;if(null==N||""==N||N==mxConstants.NONE)N="#ffffff";H.backgroundColor=N;H.autoOrigin=W;g.grid&&(H.gridSize=J.gridSize,H.gridSteps=J.view.gridSteps,-H.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:J.view.gridColor);H.appendGraph(J,Y,R,T,K,!0,O,U,g.selection?J.getSelectionCells():null);K=J.getCustomFonts();if(null!=H.wnd)for(U=0;U<K.length;U++)R=K[U].name,T=K[U].url,Graph.isCssFontUrl(T)?H.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(T)+'" charset="UTF-8" type="text/css">'):(H.wnd.document.writeln('<style type="text/css">'),H.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(R)+-'";\nsrc: url("'+mxUtils.htmlEntities(T)+'");\n}'),H.wnd.document.writeln("</style>"))}M&&(J.useCssTransforms=M,J.currentTranslate=n,J.currentScale=z,J.view.translate=D,J.view.scale=L);return H}),I=g.pagesFrom,F=g.pagesTo,C=!g.allPages;t=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,g);else{C&&(C=g.selection||I==y&&F==y);if(!C&&null!=this.pages&&this.pages.length){C=0;y=this.pages.length-1;g.allPages||(C=parseInt(I)-1,y=parseInt(F)-1);for(var Q=C;Q<=y;Q++){var S=this.pages[Q];I=S==+this.showDialog((new PrintDialog(this,d,g,k)).container,320,m,!0,!0)};EditorUi.prototype.print=function(d,g){var k=this.editor,m=k.graph,t=this.getPageIndex(this.currentPage),y=null!=t?t+1:1,z=mxUtils.bind(this,function(J,H,K,N){var M=J.useCssTransforms,n=J.currentTranslate,A=J.currentScale,E=J.view.translate,L=J.view.scale;J.useCssTransforms&&(J.useCssTransforms=!1,J.currentTranslate=new mxPoint(0,0),J.currentScale=1,J.view.translate=new mxPoint(0,0),J.view.scale=1);var O=J.getGraphBounds(),R=0,+T=0,U=mxRectangle.fromRectangle(J.pageFormat),W=g.fit||g.crop||!J.pageVisible,X=g.scale;U.width=Math.ceil(U.width*J.pageScale);U.height=Math.ceil(U.height*J.pageScale);var Y=1;if(g.fit){Y=g.sheetsAcross;var Z=g.sheetsDown;isNaN(X)||(U.width=Math.ceil(U.width*X),U.height=Math.ceil(U.height*X));Y=Math.min(U.height*Z/(O.height/J.view.scale),U.width*Y/(O.width/J.view.scale))}else Y=isNaN(X)?1:X;Y*=1;!W&&J.pageVisible?(X=J.getPageLayout(),R-=X.x*U.width,T-=X.y*U.height):W=!0;g.crop&&(g.selection&&(O=m.getBoundingBox(m.getSelectionCells())),+U.width=(O.width+1)*Y/J.view.scale,U.height=(O.height+1)*Y/J.view.scale);U.width=Math.ceil(1*U.width);U.height=Math.ceil(1*U.height);N=null!=N?"page/id,"+N:null;if(null==H){H=PrintDialog.createPrintPreview(J,Y,null,0,R,T,W);H.title=this.getBaseFilename(!0);H.pageSelector=!1;H.mathEnabled=!1;R=g.border;isNaN(R)||(H.pageMargin=R);g.selection&&(H.isCellVisible=function(ba){return J.isCellSelected(ba)});var ca=H.writeHead;H.writeHead=function(ba){ca.apply(this,arguments);mxClient.IS_GC&&(ba.writeln('<style type="text/css">'),+ba.writeln("@media print {"),ba.writeln(".MathJax svg { shape-rendering: crispEdges; }"),ba.writeln("}"),ba.writeln("</style>"));null!=k.fontCss&&(ba.writeln('<style type="text/css">'),ba.writeln(mxUtils.htmlEntities(k.fontCss,!1,!1,!1)),ba.writeln("</style>"));for(var fa=J.getCustomFonts(),aa=0;aa<fa.length;aa++){var ja=fa[aa].name,ha=fa[aa].url;Graph.isCssFontUrl(ha)?ba.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(ha))+'" charset="UTF-8" type="text/css">'):+(ba.writeln('<style type="text/css">'),ba.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(ja)+'";\nsrc: url("'+mxUtils.htmlEntities(ha)+'");\n}'),ba.writeln("</style>"))}};if(Editor.replaceSvgDataUris){var ea=H.drawBackgroundImage;H.drawBackgroundImage=function(ba){ea.apply(this,arguments);null!=ba.node&&(EditorUi.embedSvgImages(ba.node),m.disableSvgLinks(ba.node,function(fa){fa.setAttribute("href","javascript:void(0)")}))}}var ia=H.addGraphFragment;H.addGraphFragment=function(ba,fa,aa,+ja,ha,da){ia.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:ha.classList.add("geDisableMathJax")};g.grid&&(H.gridSize=J.gridSize,H.gridSteps=J.view.gridSteps,H.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:J.view.gridColor);H.open(null,null,K,!0,N,U,g.selection?J.getSelectionCells():null)}else{O=J.background;if(null==O||""==O||O==mxConstants.NONE)O="#ffffff";H.backgroundColor=O;H.autoOrigin=W;g.grid&&(H.gridSize=J.gridSize,H.gridSteps=J.view.gridSteps,+H.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:J.view.gridColor);H.appendGraph(J,Y,R,T,K,!0,N,U,g.selection?J.getSelectionCells():null);K=J.getCustomFonts();if(null!=H.wnd)for(U=0;U<K.length;U++)R=K[U].name,T=K[U].url,Graph.isCssFontUrl(T)?H.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(T)+'" charset="UTF-8" type="text/css">'):(H.wnd.document.writeln('<style type="text/css">'),H.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(R)++'";\nsrc: url("'+mxUtils.htmlEntities(T)+'");\n}'),H.wnd.document.writeln("</style>"))}M&&(J.useCssTransforms=M,J.currentTranslate=n,J.currentScale=A,J.view.translate=E,J.view.scale=L);return H}),I=g.pagesFrom,F=g.pagesTo,C=!g.allPages;t=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,g);else{C&&(C=g.selection||I==y&&F==y);if(!C&&null!=this.pages&&this.pages.length){C=0;y=this.pages.length-1;g.allPages||(C=parseInt(I)-1,y=parseInt(F)-1);for(var Q=C;Q<=y;Q++){var S=this.pages[Q];I=S==this.currentPage?m:null;if(null==I){I=this.createTemporaryGraph(m.stylesheet);I.shapeForegroundColor=m.shapeForegroundColor;I.shapeBackgroundColor=m.shapeBackgroundColor;F=!0;C=!1;var V=null,P=null;null==S.viewState&&null==S.root&&this.updatePageRoot(S);null!=S.viewState&&(F=S.viewState.pageVisible,C=S.viewState.mathEnabled,V=S.viewState.background,P=S.viewState.backgroundImage,I.pageFormat=S.viewState.pageFormat,I.gridSize=S.viewState.gridSize);null!=P&&null!=P.originalSrc&&(P=this.createImageForPageLink(P.originalSrc,-S));I.background=V;I.backgroundImage=null!=P?new mxImage(P.src,P.width,P.height,P.x,P.y):null;I.pageVisible=F;I.mathEnabled=C;var u=I.getGraphBounds;I.getGraphBounds=function(){var J=u.apply(this,arguments),H=this.backgroundImage;if(null!=H&&null!=H.width&&null!=H.height){var K=this.view.translate,O=this.view.scale;J=mxRectangle.fromRectangle(J);J.add(new mxRectangle((K.x+H.x)*O,(K.y+H.y)*O,H.width*O,H.height*O))}return J};var x=I.getGlobalVariable;I.getGlobalVariable=function(J){return"page"==J?-S.getName():"pagenumber"==J?Q+1:"pagecount"==J?null!=this.pages?this.pages.length:1:x.apply(this,arguments)};document.body.appendChild(I.container);this.updatePageRoot(S);I.model.setRoot(S.root)}t=A(I,t,Q!=y,S.getId());I!=m&&I.container.parentNode.removeChild(I.container)}}else t=A(m);null==t||null==t.wnd?this.handleError({message:mxResources.get("errorUpdatingPreview")}):(t.mathEnabled&&(A=t.wnd.document,d||(t.wnd.IMMEDIATE_PRINT=!0),A.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>')),+S));I.background=V;I.backgroundImage=null!=P?new mxImage(P.src,P.width,P.height,P.x,P.y):null;I.pageVisible=F;I.mathEnabled=C;var u=I.getGraphBounds;I.getGraphBounds=function(){var J=u.apply(this,arguments),H=this.backgroundImage;if(null!=H&&null!=H.width&&null!=H.height){var K=this.view.translate,N=this.view.scale;J=mxRectangle.fromRectangle(J);J.add(new mxRectangle((K.x+H.x)*N,(K.y+H.y)*N,H.width*N,H.height*N))}return J};var x=I.getGlobalVariable;I.getGlobalVariable=function(J){return"page"==J?+S.getName():"pagenumber"==J?Q+1:"pagecount"==J?null!=this.pages?this.pages.length:1:x.apply(this,arguments)};document.body.appendChild(I.container);this.updatePageRoot(S);I.model.setRoot(S.root)}t=z(I,t,Q!=y,S.getId());I!=m&&I.container.parentNode.removeChild(I.container)}}else t=z(m);null==t||null==t.wnd?this.handleError({message:mxResources.get("errorUpdatingPreview")}):(t.mathEnabled&&(z=t.wnd.document,d||(t.wnd.IMMEDIATE_PRINT=!0),z.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>')),t.closeDocument(),Graph.rewritePageLinks(t.wnd.document,!0),t.mathEnabled||d||PrintDialog.printPreview(t));return t}};EditorUi.prototype.addFileDropHandler=function(d){if(Graph.fileSupport)for(var g=null,k=0;k<d.length;k++)mxEvent.addListener(d[k],"dragleave",function(m){null!=g&&(g.parentNode.removeChild(g),g=null);m.stopPropagation();m.preventDefault()}),mxEvent.addListener(d[k],"dragover",mxUtils.bind(this,function(m){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==g&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(g=this.highlightElement());m.stopPropagation();m.preventDefault()})),mxEvent.addListener(d[k],"drop",mxUtils.bind(this,function(m){null!=g&&(g.parentNode.removeChild(g),g=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<m.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(m.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(m)&&!mxEvent.isShiftDown(m)):this.openFiles(m.dataTransfer.files,!0);else{var t=this.extractGraphModelFromEvent(m);if(null==t){var y=null!=m.dataTransfer?m.dataTransfer:m.clipboardData;null!=y&&(10==document.documentMode||11==document.documentMode?t=y.getData("Text"):(t=null,t=0<=mxUtils.indexOf(y.types,"text/uri-list")?m.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(y.types,"text/html")?y.getData("text/html"):null,null!=t&&0<t.length?(y=document.createElement("div"),y.innerHTML=Graph.sanitizeHtml(t),y=y.getElementsByTagName("img"),0<y.length&&(t=y[0].getAttribute("src"))):-0<=mxUtils.indexOf(y.types,"text/plain")&&(t=y.getData("text/plain"))),null!=t&&(Editor.isPngDataUrl(t)?(t=Editor.extractGraphModelFromPng(t),null!=t&&0<t.length&&this.openLocalFile(t,null,!0)):this.isRemoteFileFormat(t)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(t))).send(mxUtils.bind(this,function(A){200<=A.getStatus()&&299>=A.getStatus()?this.openLocalFile(A.getText(),null,!0):this.showError(mxResources.get("error"),-413==A.getStatus()?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))})):/^https?:\/\//.test(t)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(t):window.geOpenWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost+"/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(t)))))}else this.openLocalFile(t,null,!0)}m.stopPropagation();m.preventDefault()}))};EditorUi.prototype.highlightElement=function(d){var g=0,k=0;if(null==d){var m=document.body;+0<=mxUtils.indexOf(y.types,"text/plain")&&(t=y.getData("text/plain"))),null!=t&&(Editor.isPngDataUrl(t)?(t=Editor.extractGraphModelFromPng(t),null!=t&&0<t.length&&this.openLocalFile(t,null,!0)):this.isRemoteFileFormat(t)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(t))).send(mxUtils.bind(this,function(z){200<=z.getStatus()&&299>=z.getStatus()?this.openLocalFile(z.getText(),null,!0):this.showError(mxResources.get("error"),+413==z.getStatus()?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))})):/^https?:\/\//.test(t)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(t):window.geOpenWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost+"/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(t)))))}else this.openLocalFile(t,null,!0)}m.stopPropagation();m.preventDefault()}))};EditorUi.prototype.highlightElement=function(d){var g=0,k=0;if(null==d){var m=document.body;var t=document.documentElement;var y=(m.clientWidth||t.clientWidth)-3;m=Math.max(m.clientHeight||0,t.clientHeight)-3}else g=d.offsetTop,k=d.offsetLeft,y=d.clientWidth,m=d.clientHeight;t=document.createElement("div");t.style.zIndex=mxPopupMenu.prototype.zIndex+2;t.style.border="3px dotted rgb(254, 137, 12)";t.style.pointerEvents="none";t.style.position="absolute";t.style.top=g+"px";t.style.left=k+"px";t.style.width=Math.max(0,y-3)+"px";t.style.height=Math.max(0,m-3)+"px";null!=d&&d.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(t):document.body.appendChild(t);return t};EditorUi.prototype.stringToCells=function(d){d=mxUtils.parseXml(d);var g=this.editor.extractGraphModel(d.documentElement);d=[];if(null!=g){var k=new mxCodec(g.ownerDocument),m=new mxGraphModel;k.decode(g,m);g=m.getChildAt(m.getRoot(),0);for(k=0;k<m.getChildCount(g);k++)d.push(m.getChildAt(g,k))}return d};EditorUi.prototype.openFileHandle=function(d,g,k,m,t,y){if(null!=g&&0<g.length){if(!this.useCanvasForExport&&/(\.png)$/i.test(g)||-/(\.pdf)$/i.test(g))g=g.substring(0,g.length-4),/(\.drawio)$/i.test(g)||(g+=".drawio");var A=mxUtils.bind(this,function(F){g=0<=g.lastIndexOf(".")?g.substring(0,g.lastIndexOf("."))+".drawio":g+".drawio";if("<mxlibrary"==F.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,m);try{this.loadLibrary(new LocalLibrary(this,F,g)),this.showSidebar()}catch(C){this.handleError(C,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(F,-g,m)});if(EditorUi.isVisioFilename(g))this.importVisio(k,mxUtils.bind(this,function(F){this.spinner.stop();A(F)}));else if(/(\.*<graphml )/.test(d))this.importGraphML(d,mxUtils.bind(this,function(F){this.spinner.stop();A(F)}));else if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,g))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):this.parseFile(k,mxUtils.bind(this,function(F){4==F.readyState&&(this.spinner.stop(),-200<=F.status&&299>=F.status?A(F.responseText):this.handleError({message:mxResources.get(413==F.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(d))/(\.json)$/i.test(g)&&(g=g.substring(0,g.length-5)+".drawio"),this.convertLucidChart(d,mxUtils.bind(this,function(F){this.spinner.stop();this.openLocalFile(F,g,m)}),mxUtils.bind(this,function(F){this.spinner.stop();this.handleError(F)}));else if("<mxlibrary"==d.substring(0,10)){this.spinner.stop();-null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,m);try{this.loadLibrary(new LocalLibrary(this,d,k.name)),this.showSidebar()}catch(F){this.handleError(F,mxResources.get("errorLoadingFile"))}}else if(0==d.indexOf("PK"))this.importZipFile(k,mxUtils.bind(this,function(F){this.spinner.stop();A(F)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(d,g,m)}));else{if("image/png"==k.type.substring(0,9))d=this.extractGraphModelFromPng(d);-else if("application/pdf"==k.type){var I=Editor.extractGraphModelFromPdf(d);null!=I&&(t=null,m=!0,d=I)}this.spinner.stop();this.openLocalFile(d,g,m,t,null!=t?k:null,y)}}};EditorUi.prototype.openFiles=function(d,g){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var k=0;k<d.length;k++)mxUtils.bind(this,function(m){var t=new FileReader;t.onload=mxUtils.bind(this,function(y){try{this.openFileHandle(y.target.result,m.name,m,g)}catch(A){this.handleError(A)}});t.onerror=mxUtils.bind(this,-function(y){this.spinner.stop();this.handleError(y);window.openFile=null});"image"!==m.type.substring(0,5)&&"application/pdf"!==m.type||"image/svg"===m.type.substring(0,9)?t.readAsText(m):t.readAsDataURL(m)})(d[k])};EditorUi.prototype.openLocalFile=function(d,g,k,m,t,y){var A=this.getCurrentFile(),I=mxUtils.bind(this,function(){window.openFile=null;if(null==g&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var F=mxUtils.parseXml(d);null!=F&&(this.editor.setGraphXml(F.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,-d,g||this.defaultFilename,k,m,t,y))});if(null!=d&&0<d.length)null==A||!A.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=m)?I():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=m)&&null!=A&&A.isModified()?this.confirm(mxResources.get("allChangesLost"),null,I,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(d,g),window.geOpenWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=-A&&A.isModified()?this.confirm(mxResources.get("allChangesLost"),null,I,mxResources.get("cancel"),mxResources.get("discardChanges")):I()})));else throw Error(mxResources.get("notADiagramFile"));};EditorUi.prototype.getBasenames=function(){var d={};if(null!=this.pages)for(var g=0;g<this.pages.length;g++)this.updatePageRoot(this.pages[g]),this.addBasenamesForCell(this.pages[g].root,d);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),d);g=[];for(var k in d)g.push(k);return g};EditorUi.prototype.addBasenamesForCell=-function(d,g){function k(A){if(null!=A){var I=A.lastIndexOf(".");0<I&&(A=A.substring(I+1,A.length));null==g[A]&&(g[A]=!0)}}var m=this.editor.graph,t=m.getCellStyle(d);k(mxStencilRegistry.getBasenameForStencil(t[mxConstants.STYLE_SHAPE]));m.model.isEdge(d)&&(k(mxMarker.getPackageForType(t[mxConstants.STYLE_STARTARROW])),k(mxMarker.getPackageForType(t[mxConstants.STYLE_ENDARROW])));t=m.model.getChildCount(d);for(var y=0;y<t;y++)this.addBasenamesForCell(m.model.getChildAt(d,y),g)};EditorUi.prototype.setGraphEnabled=+/(\.pdf)$/i.test(g))g=g.substring(0,g.length-4),/(\.drawio)$/i.test(g)||(g+=".drawio");var z=mxUtils.bind(this,function(F){g=0<=g.lastIndexOf(".")?g.substring(0,g.lastIndexOf("."))+".drawio":g+".drawio";if("<mxlibrary"==F.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,m);try{this.loadLibrary(new LocalLibrary(this,F,g)),this.showSidebar()}catch(C){this.handleError(C,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(F,+g,m)});if(EditorUi.isVisioFilename(g))this.importVisio(k,mxUtils.bind(this,function(F){this.spinner.stop();z(F)}));else if(/(\.*<graphml )/.test(d))this.importGraphML(d,mxUtils.bind(this,function(F){this.spinner.stop();z(F)}));else if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,g))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):this.parseFile(k,mxUtils.bind(this,function(F){4==F.readyState&&(this.spinner.stop(),+200<=F.status&&299>=F.status?z(F.responseText):this.handleError({message:mxResources.get(413==F.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(d))/(\.json)$/i.test(g)&&(g=g.substring(0,g.length-5)+".drawio"),this.convertLucidChart(d,mxUtils.bind(this,function(F){this.spinner.stop();this.openLocalFile(F,g,m)}),mxUtils.bind(this,function(F){this.spinner.stop();this.handleError(F)}));else if("<mxlibrary"==d.substring(0,10)){this.spinner.stop();+null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,m);try{this.loadLibrary(new LocalLibrary(this,d,k.name)),this.showSidebar()}catch(F){this.handleError(F,mxResources.get("errorLoadingFile"))}}else if(0==d.indexOf("PK"))this.importZipFile(k,mxUtils.bind(this,function(F){this.spinner.stop();z(F)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(d,g,m)}));else{if("image/png"==k.type.substring(0,9))d=this.extractGraphModelFromPng(d);+else if("application/pdf"==k.type){var I=Editor.extractGraphModelFromPdf(d);null!=I&&(t=null,m=!0,d=I)}this.spinner.stop();this.openLocalFile(d,g,m,t,null!=t?k:null,y)}}};EditorUi.prototype.openFiles=function(d,g){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var k=0;k<d.length;k++)mxUtils.bind(this,function(m){var t=new FileReader;t.onload=mxUtils.bind(this,function(y){try{this.openFileHandle(y.target.result,m.name,m,g)}catch(z){this.handleError(z)}});t.onerror=mxUtils.bind(this,+function(y){this.spinner.stop();this.handleError(y);window.openFile=null});"image"!==m.type.substring(0,5)&&"application/pdf"!==m.type||"image/svg"===m.type.substring(0,9)?t.readAsText(m):t.readAsDataURL(m)})(d[k])};EditorUi.prototype.openLocalFile=function(d,g,k,m,t,y){var z=this.getCurrentFile(),I=mxUtils.bind(this,function(){window.openFile=null;if(null==g&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var F=mxUtils.parseXml(d);null!=F&&(this.editor.setGraphXml(F.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,+d,g||this.defaultFilename,k,m,t,y))});if(null!=d&&0<d.length)null==z||!z.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=m)?I():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=m)&&null!=z&&z.isModified()?this.confirm(mxResources.get("allChangesLost"),null,I,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(d,g),window.geOpenWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=+z&&z.isModified()?this.confirm(mxResources.get("allChangesLost"),null,I,mxResources.get("cancel"),mxResources.get("discardChanges")):I()})));else throw Error(mxResources.get("notADiagramFile"));};EditorUi.prototype.getBasenames=function(){var d={};if(null!=this.pages)for(var g=0;g<this.pages.length;g++)this.updatePageRoot(this.pages[g]),this.addBasenamesForCell(this.pages[g].root,d);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),d);g=[];for(var k in d)g.push(k);return g};EditorUi.prototype.addBasenamesForCell=+function(d,g){function k(z){if(null!=z){var I=z.lastIndexOf(".");0<I&&(z=z.substring(I+1,z.length));null==g[z]&&(g[z]=!0)}}var m=this.editor.graph,t=m.getCellStyle(d);k(mxStencilRegistry.getBasenameForStencil(t[mxConstants.STYLE_SHAPE]));m.model.isEdge(d)&&(k(mxMarker.getPackageForType(t[mxConstants.STYLE_STARTARROW])),k(mxMarker.getPackageForType(t[mxConstants.STYLE_ENDARROW])));t=m.model.getChildCount(d);for(var y=0;y<t;y++)this.addBasenamesForCell(m.model.getChildAt(d,y),g)};EditorUi.prototype.setGraphEnabled=function(d){this.diagramContainer.style.visibility=d?"":"hidden";this.formatContainer.style.visibility=this.diagramContainer.style.visibility;this.sidebarContainer.style.display=d?"":"none";this.hsplit.style.display=this.sidebarContainer.style.display;this.editor.graph.setEnabled(d);null!=this.tabContainer&&(this.tabContainer.style.visibility=this.diagramContainer.style.visibility);d||this.hideWindows();this.editor.graph.sizeDidChange();this.resetScrollbars()};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);if((window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))){var d=!1;this.installMessageHandler(mxUtils.bind(this,function(g,k,m,t){d||(d=!0,this.spinner.stop(),this.addEmbedButtons(),this.setGraphEnabled(!0));if(null==g||0==g.length)g=this.emptyDiagramXml;this.setCurrentFile(new EmbedFile(this,g,{}));this.mode=App.MODE_EMBED;this.setFileData(g);if(t)try{var y=this.editor.graph;y.setGridEnabled(!1);-y.pageVisible=!1;var A=y.model.cells,I;for(I in A){var F=A[I];null!=F&&null!=F.style&&(F.style+=";sketch=1;"+(-1==F.style.indexOf("fontFamily=")||-1<F.style.indexOf("fontFamily=Helvetica;")?"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":""))}}catch(C){console.log(C)}this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog();this.chromelessResize&&this.chromelessResize();this.editor.undoManager.clear();+y.pageVisible=!1;var z=y.model.cells,I;for(I in z){var F=z[I];null!=F&&null!=F.style&&(F.style+=";sketch=1;"+(-1==F.style.indexOf("fontFamily=")||-1<F.style.indexOf("fontFamily=Helvetica;")?"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":""))}}catch(C){console.log(C)}this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog();this.chromelessResize&&this.chromelessResize();this.editor.undoManager.clear();this.editor.modified=null!=m?m:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))}};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(d,g){null!=d?this.spinner.spin(document.body,mxResources.get("loading"))&&d.getPublicUrl(mxUtils.bind(this,function(k){this.spinner.stop();g(k)})):g(null)};EditorUi.prototype.createLoadMessage=function(d){var g=this.editor.graph;return{event:d,pageVisible:g.pageVisible,translate:g.view.translate,bounds:g.getGraphBounds(),currentPage:this.getSelectedPageIndex(),scale:g.view.scale,page:g.view.getBackgroundPageBounds()}};EditorUi.prototype.sendEmbeddedSvgExport=function(d){try{var g=this.editor.graph;g.isEditing()&&g.stopEditing(!g.isInvokesStopCellEditing());var k=window.opener||window.parent;if(this.editor.modified){var m=g.background;if(null==m||m==mxConstants.NONE)m=this.embedExportBackground;this.getEmbeddedSvg(this.getFileData(!0,null,null,null,null,null,null,null,null,!1),g,null,!0,mxUtils.bind(this,function(t){k.postMessage(JSON.stringify({event:"export",point:this.embedExitPoint,exit:null!=d?!d:!0,data:Editor.createSvgDataUri(t)}),"*")}),null,null,!0,m,1,this.embedExportBorder,null,this.embedExportTheme)}else d||k.postMessage(JSON.stringify({event:"exit",point:this.embedExitPoint}),"*");d||(this.diagramContainer.removeAttribute("data-bounds"),Editor.inlineFullscreen=!1,g.model.clear(),this.editor.undoManager.clear(),this.setBackgroundImage(null),this.editor.modified=!1,"1"!=urlParams.embed&&this.fireEvent(new mxEventObject("editInlineStop")))}catch(t){d||this.handleError(t)}};EditorUi.prototype.installMessageHandler=function(d){var g=null,k=!1,m=!1,t=null,y=mxUtils.bind(this,function(F,C){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified)))})):this.clearStatus()});this.editor.graph.model.addListener(mxEvent.CHANGE,y);mxEvent.addListener(window,"message",mxUtils.bind(this,function(F){if(F.source==(window.opener||window.parent)){var C=F.data,Q=null,S=mxUtils.bind(this,function(aa){if(null!=aa&&"function"===typeof aa.charAt&&"<"!=aa.charAt(0))try{Editor.isPngDataUrl(aa)?aa=Editor.extractGraphModelFromPng(aa):"data:image/svg+xml;base64,"==aa.substring(0,-26)?aa=atob(aa.substring(26)):"data:image/svg+xml;utf8,"==aa.substring(0,24)&&(aa=aa.substring(24)),null!=aa&&(""==aa.trim()?aa=null:"%"==aa.charAt(0)?aa=decodeURIComponent(aa):"<"!=aa.charAt(0)&&(aa=Graph.decompress(aa)))}catch(ia){}return aa});if("json"==urlParams.proto){var V=!1;try{C=JSON.parse(C),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[F],"data",[C])}catch(aa){C=null}try{if(null==C)return;if("dialog"==C.action){this.showError(null!=C.titleKey?mxResources.get(C.titleKey):-C.title,null!=C.messageKey?mxResources.get(C.messageKey):mxUtils.htmlEntities(C.message),null!=C.buttonKey?mxResources.get(C.buttonKey):C.button);null!=C.modified&&(this.editor.modified=C.modified);return}if("layout"==C.action){this.executeLayouts(this.editor.graph.createLayouts(C.layouts));return}if("prompt"==C.action){this.spinner.stop();var P=new FilenameDialog(this,C.defaultValue||"",null!=C.okKey?mxResources.get(C.okKey):C.ok,function(aa){null!=aa?A.postMessage(JSON.stringify({event:"prompt",-value:aa,message:C}),"*"):A.postMessage(JSON.stringify({event:"prompt-cancel",message:C}),"*")},null!=C.titleKey?mxResources.get(C.titleKey):C.title,null,null,null,null,function(){A.postMessage(JSON.stringify({event:"prompt-cancel",message:C}),"*")});this.showDialog(P.container,300,80,!0,!1);P.init();return}if("draft"==C.action){var u=S(C.xml);this.spinner.stop();P=new DraftDialog(this,mxResources.get("draftFound",[C.name||this.defaultFilename]),u,mxUtils.bind(this,function(){this.hideDialog();A.postMessage(JSON.stringify({event:"draft",-result:"edit",message:C}),"*")}),mxUtils.bind(this,function(){this.hideDialog();A.postMessage(JSON.stringify({event:"draft",result:"discard",message:C}),"*")}),C.editKey?mxResources.get(C.editKey):null,C.discardKey?mxResources.get(C.discardKey):null,C.ignore?mxUtils.bind(this,function(){this.hideDialog();A.postMessage(JSON.stringify({event:"draft",result:"ignore",message:C}),"*")}):null);this.showDialog(P.container,640,480,!0,!1,mxUtils.bind(this,function(aa){aa&&this.actions.get("exit").funct()}));-try{P.init()}catch(aa){A.postMessage(JSON.stringify({event:"draft",error:aa.toString(),message:C}),"*")}return}if("template"==C.action){this.spinner.stop();var x=1==C.enableRecent,J=1==C.enableSearch,H=1==C.enableCustomTemp;P=new NewDialog(this,!1,C.templatesOnly?!1:null!=C.callback,mxUtils.bind(this,function(aa,ia,ha,da){aa=aa||this.emptyDiagramXml;null!=C.callback?A.postMessage(JSON.stringify({event:"template",xml:aa,blank:aa==this.emptyDiagramXml,name:ia,tempUrl:ha,libs:da,builtIn:!0,message:C}),-"*"):(d(aa,F,aa!=this.emptyDiagramXml,C.toSketch),this.editor.modified||this.clearStatus())}),null,null,null,null,null,null,null,x?mxUtils.bind(this,function(aa){this.remoteInvoke("getRecentDiagrams",[null],null,aa,function(){aa(null,"Network Error!")})}):null,J?mxUtils.bind(this,function(aa,ia){this.remoteInvoke("searchDiagrams",[aa,null],null,ia,function(){ia(null,"Network Error!")})}):null,mxUtils.bind(this,function(aa,ia,ha){A.postMessage(JSON.stringify({event:"template",docUrl:aa,info:ia,name:ha}),-"*")}),null,null,H?mxUtils.bind(this,function(aa){this.remoteInvoke("getCustomTemplates",null,null,aa,function(){aa({},0)})}):null,1==C.withoutType);this.showDialog(P.container,620,460,!0,!1,mxUtils.bind(this,function(aa){null!=this.sidebar&&this.sidebar.hideTooltip();aa&&this.actions.get("exit").funct()}));P.init();return}if("textContent"==C.action){var K=this.getDiagramTextContent();A.postMessage(JSON.stringify({event:"textContent",data:K,message:C}),"*");return}if("status"==C.action){this.updateStatus(mxUtils.bind(this,-function(){null!=C.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(C.messageKey))):null!=C.message&&this.editor.setStatus(mxUtils.htmlEntities(C.message))}));null!=C.modified&&(this.editor.modified=C.modified);return}if("spinner"==C.action){var O=null!=C.messageKey?mxResources.get(C.messageKey):C.message;null==C.show||C.show?this.spinner.spin(document.body,O):this.spinner.stop();return}if("exit"==C.action){this.actions.get("exit").funct();return}if("viewport"==C.action){if(null!=-C.viewport){var M=this.editor.graph,n=M.view.translate.x,z=M.view.translate.y;this.embedViewport=C.viewport;M.refresh();this.diagramContainer.scrollTop-=(z-M.view.translate.y)*M.view.scale;this.diagramContainer.scrollLeft-=(n-M.view.translate.x)*M.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("fullscreenChanged"==C.action){P=null;try{var D=this.diagramContainer.getAttribute("data-scrollState");null!=D&&(this.diagramContainer.removeAttribute("data-scrollState"),P=JSON.parse(D))}catch(aa){}Editor.inlineFullscreen=-C.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=P&&this.restoreScrollState(P);return}if("snapshot"==C.action){this.sendEmbeddedSvgExport(!0);return}if("export"==C.action){if("png"==C.format||"xmlpng"==C.format){if(null==C.spin&&null==C.spinKey||this.spinner.spin(document.body,null!=C.spinKey?mxResources.get(C.spinKey):C.spin)){var L=null!=C.xml?C.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);M=this.editor.graph;var N=mxUtils.bind(this,function(aa,ia){if(C.withSvg)C.withSvg=-!1,this.getEmbeddedSvg(L,this.editor.graph,null,!0,function(da){N(aa,da)},null,null,C.embedImages,this.editor.graph.background,C.scale,C.border,C.shadow,"auto");else{this.editor.graph.setEnabled(!0);this.spinner.stop();var ha=this.createLoadMessage("export");ha.format=C.format;ha.message=C;ha.data=aa;ha.svg=ia;ha.xml=L;A.postMessage(JSON.stringify(ha),"*")}}),R=mxUtils.bind(this,function(aa){null==aa&&(aa=Editor.blankImage);"xmlpng"==C.format&&(aa=Editor.writeGraphModelToPng(aa,"tEXt","mxfile",encodeURIComponent(L)));-M!=this.editor.graph&&M.container.parentNode.removeChild(M.container);N(aa)}),T=C.pageId||(null!=this.pages?C.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.isExportToCanvas()){var U=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=T){var aa=M.getGlobalVariable;M=this.createTemporaryGraph(M.getStylesheet());for(var ia,ha=0;ha<this.pages.length;ha++)if(this.pages[ha].getId()==T){ia=this.updatePageRoot(this.pages[ha]);break}null==ia&&(ia=this.currentPage);-M.getGlobalVariable=function(va){return"page"==va?ia.getName():"pagenumber"==va?1:aa.apply(this,arguments)};document.body.appendChild(M.container);M.model.setRoot(ia.root)}if(null!=C.layerIds){var da=M.model,Ba=da.getChildCells(da.getRoot()),na={};for(ha=0;ha<C.layerIds.length;ha++)na[C.layerIds[ha]]=!0;for(ha=0;ha<Ba.length;ha++)da.setVisible(Ba[ha],na[Ba[ha].id]||!1)}ha=null;C.keepTheme&&(ha=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,function(va){R(va.toDataURL("image/png"))}),+26)?aa=atob(aa.substring(26)):"data:image/svg+xml;utf8,"==aa.substring(0,24)&&(aa=aa.substring(24)),null!=aa&&(""==aa.trim()?aa=null:"%"==aa.charAt(0)?aa=decodeURIComponent(aa):"<"!=aa.charAt(0)&&(aa=Graph.decompress(aa)))}catch(ja){}return aa});if("json"==urlParams.proto){var V=!1;try{C=JSON.parse(C),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[F],"data",[C])}catch(aa){C=null}try{if(null==C)return;if("dialog"==C.action){this.showError(null!=C.titleKey?mxResources.get(C.titleKey):+C.title,null!=C.messageKey?mxResources.get(C.messageKey):mxUtils.htmlEntities(C.message),null!=C.buttonKey?mxResources.get(C.buttonKey):C.button);null!=C.modified&&(this.editor.modified=C.modified);return}if("layout"==C.action){this.executeLayouts(this.editor.graph.createLayouts(C.layouts));return}if("prompt"==C.action){this.spinner.stop();var P=new FilenameDialog(this,C.defaultValue||"",null!=C.okKey?mxResources.get(C.okKey):C.ok,function(aa){null!=aa?z.postMessage(JSON.stringify({event:"prompt",+value:aa,message:C}),"*"):z.postMessage(JSON.stringify({event:"prompt-cancel",message:C}),"*")},null!=C.titleKey?mxResources.get(C.titleKey):C.title,null,null,null,null,function(){z.postMessage(JSON.stringify({event:"prompt-cancel",message:C}),"*")});this.showDialog(P.container,300,80,!0,!1);P.init();return}if("draft"==C.action){var u=S(C.xml);this.spinner.stop();P=new DraftDialog(this,mxResources.get("draftFound",[C.name||this.defaultFilename]),u,mxUtils.bind(this,function(){this.hideDialog();z.postMessage(JSON.stringify({event:"draft",+result:"edit",message:C}),"*")}),mxUtils.bind(this,function(){this.hideDialog();z.postMessage(JSON.stringify({event:"draft",result:"discard",message:C}),"*")}),C.editKey?mxResources.get(C.editKey):null,C.discardKey?mxResources.get(C.discardKey):null,C.ignore?mxUtils.bind(this,function(){this.hideDialog();z.postMessage(JSON.stringify({event:"draft",result:"ignore",message:C}),"*")}):null);this.showDialog(P.container,640,480,!0,!1,mxUtils.bind(this,function(aa){aa&&this.actions.get("exit").funct()}));+try{P.init()}catch(aa){z.postMessage(JSON.stringify({event:"draft",error:aa.toString(),message:C}),"*")}return}if("template"==C.action){this.spinner.stop();var x=1==C.enableRecent,J=1==C.enableSearch,H=1==C.enableCustomTemp;P=new NewDialog(this,!1,C.templatesOnly?!1:null!=C.callback,mxUtils.bind(this,function(aa,ja,ha,da){aa=aa||this.emptyDiagramXml;null!=C.callback?z.postMessage(JSON.stringify({event:"template",xml:aa,blank:aa==this.emptyDiagramXml,name:ja,tempUrl:ha,libs:da,builtIn:!0,message:C}),+"*"):(d(aa,F,aa!=this.emptyDiagramXml,C.toSketch),this.editor.modified||this.clearStatus())}),null,null,null,null,null,null,null,x?mxUtils.bind(this,function(aa){this.remoteInvoke("getRecentDiagrams",[null],null,aa,function(){aa(null,"Network Error!")})}):null,J?mxUtils.bind(this,function(aa,ja){this.remoteInvoke("searchDiagrams",[aa,null],null,ja,function(){ja(null,"Network Error!")})}):null,mxUtils.bind(this,function(aa,ja,ha){z.postMessage(JSON.stringify({event:"template",docUrl:aa,info:ja,name:ha}),+"*")}),null,null,H?mxUtils.bind(this,function(aa){this.remoteInvoke("getCustomTemplates",null,null,aa,function(){aa({},0)})}):null,1==C.withoutType);this.showDialog(P.container,620,460,!0,!1,mxUtils.bind(this,function(aa){null!=this.sidebar&&this.sidebar.hideTooltip();aa&&this.actions.get("exit").funct()}));P.init();return}if("textContent"==C.action){var K=this.getDiagramTextContent();z.postMessage(JSON.stringify({event:"textContent",data:K,message:C}),"*");return}if("status"==C.action){this.updateStatus(mxUtils.bind(this,+function(){null!=C.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(C.messageKey))):null!=C.message&&this.editor.setStatus(mxUtils.htmlEntities(C.message))}));null!=C.modified&&(this.editor.modified=C.modified);return}if("spinner"==C.action){var N=null!=C.messageKey?mxResources.get(C.messageKey):C.message;null==C.show||C.show?this.spinner.spin(document.body,N):this.spinner.stop();return}if("exit"==C.action){this.actions.get("exit").funct();return}if("viewport"==C.action){if(null!=+C.viewport){var M=this.editor.graph,n=M.view.translate.x,A=M.view.translate.y;this.embedViewport=C.viewport;M.refresh();this.diagramContainer.scrollTop-=(A-M.view.translate.y)*M.view.scale;this.diagramContainer.scrollLeft-=(n-M.view.translate.x)*M.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("fullscreenChanged"==C.action){P=null;try{var E=this.diagramContainer.getAttribute("data-scrollState");null!=E&&(this.diagramContainer.removeAttribute("data-scrollState"),P=JSON.parse(E))}catch(aa){}Editor.inlineFullscreen=+C.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=P&&this.restoreScrollState(P);return}if("snapshot"==C.action){this.sendEmbeddedSvgExport(!0);return}if("export"==C.action){if("png"==C.format||"xmlpng"==C.format){if(null==C.spin&&null==C.spinKey||this.spinner.spin(document.body,null!=C.spinKey?mxResources.get(C.spinKey):C.spin)){var L=null!=C.xml?C.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);M=this.editor.graph;var O=mxUtils.bind(this,function(aa,ja){if(C.withSvg)C.withSvg=+!1,this.getEmbeddedSvg(L,this.editor.graph,null,!0,function(da){O(aa,da)},null,null,C.embedImages,this.editor.graph.background,C.scale,C.border,C.shadow,"auto");else{this.editor.graph.setEnabled(!0);this.spinner.stop();var ha=this.createLoadMessage("export");ha.format=C.format;ha.message=C;ha.data=aa;ha.svg=ja;ha.xml=L;z.postMessage(JSON.stringify(ha),"*")}}),R=mxUtils.bind(this,function(aa){null==aa&&(aa=Editor.blankImage);"xmlpng"==C.format&&(aa=Editor.writeGraphModelToPng(aa,"tEXt","mxfile",encodeURIComponent(L)));+M!=this.editor.graph&&M.container.parentNode.removeChild(M.container);O(aa)}),T=C.pageId||(null!=this.pages?C.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.isExportToCanvas()){var U=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=T){var aa=M.getGlobalVariable;M=this.createTemporaryGraph(M.getStylesheet());for(var ja,ha=0;ha<this.pages.length;ha++)if(this.pages[ha].getId()==T){ja=this.updatePageRoot(this.pages[ha]);break}null==ja&&(ja=this.currentPage);+M.getGlobalVariable=function(va){return"page"==va?ja.getName():"pagenumber"==va?1:aa.apply(this,arguments)};document.body.appendChild(M.container);M.model.setRoot(ja.root)}if(null!=C.layerIds){var da=M.model,Ba=da.getChildCells(da.getRoot()),na={};for(ha=0;ha<C.layerIds.length;ha++)na[C.layerIds[ha]]=!0;for(ha=0;ha<Ba.length;ha++)da.setVisible(Ba[ha],na[Ba[ha].id]||!1)}ha=null;C.keepTheme&&(ha=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,function(va){R(va.toDataURL("image/png"))}),C.width,null,C.background,mxUtils.bind(this,function(){R(null)}),null,null,C.scale,C.transparent,C.shadow,null,M,C.border,null,C.grid,ha)});null!=C.xml&&0<C.xml.length&&(k=!0,this.setFileData(L),k=!1);U()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==C.format?"1":"0")+(null!=T?"&pageId="+T:"")+(null!=C.layerIds&&0<C.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:C.layerIds})):"")+(null!=C.scale?"&scale="+C.scale:"")+"&base64=1&xml="+encodeURIComponent(L))).send(mxUtils.bind(this,-function(aa){200<=aa.getStatus()&&299>=aa.getStatus()?N("data:image/png;base64,"+aa.getText()):R(null)}),mxUtils.bind(this,function(){R(null)}))}}else if(U=mxUtils.bind(this,function(){var aa=this.createLoadMessage("export");aa.message=C;if("html2"==C.format||"html"==C.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var ia=this.getXmlFileData();aa.xml=mxUtils.getXml(ia);aa.data=this.getFileData(null,null,!0,null,null,null,ia);aa.format=C.format}else if("html"==C.format)ia=this.editor.getGraphXml(),-aa.data=this.getHtml(ia,this.editor.graph),aa.xml=mxUtils.getXml(ia),aa.format=C.format;else{mxSvgCanvas2D.prototype.foAltText=null;ia=null!=C.background?C.background:this.editor.graph.background;ia==mxConstants.NONE&&(ia=null);aa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);aa.format="svg";var ha=mxUtils.bind(this,function(Ba){this.editor.graph.setEnabled(!0);this.spinner.stop();aa.data=Editor.createSvgDataUri(Ba);A.postMessage(JSON.stringify(aa),"*")}),da="auto";C.keepTheme&&-(da=Editor.isDarkMode()?"dark":"light");null!=C.theme&&(da=C.theme);if("xmlsvg"==C.format){if(null==C.spin&&null==C.spinKey||this.spinner.spin(document.body,null!=C.spinKey?mxResources.get(C.spinKey):C.spin)){da=null;if(this.isAutoDarkMode()||Editor.isDarkMode())da="auto";null!=C.theme&&(da=C.theme);this.getEmbeddedSvg(aa.xml,this.editor.graph,null,!0,ha,null,null,C.embedImages,ia,C.scale,C.border,C.shadow,da)}}else if(null==C.spin&&null==C.spinKey||this.spinner.spin(document.body,null!=C.spinKey?-mxResources.get(C.spinKey):C.spin))this.editor.graph.setEnabled(!1),ia=this.editor.graph.getSvg(ia,C.scale,C.border,null,null,null,null,null,null,this.editor.graph.shadowVisible||C.shadow,null,da),(this.editor.graph.shadowVisible||C.shadow)&&this.editor.graph.addSvgShadow(ia),this.embedFonts(ia,mxUtils.bind(this,function(Ba){C.embedImages||null==C.embedImages?this.editor.convertImages(Ba,mxUtils.bind(this,function(na){ha(mxUtils.getXml(na))})):ha(mxUtils.getXml(Ba))}));return}A.postMessage(JSON.stringify(aa),+function(aa){200<=aa.getStatus()&&299>=aa.getStatus()?O("data:image/png;base64,"+aa.getText()):R(null)}),mxUtils.bind(this,function(){R(null)}))}}else if(U=mxUtils.bind(this,function(){var aa=this.createLoadMessage("export");aa.message=C;if("html2"==C.format||"html"==C.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var ja=this.getXmlFileData();aa.xml=mxUtils.getXml(ja);aa.data=this.getFileData(null,null,!0,null,null,null,ja);aa.format=C.format}else if("html"==C.format)ja=this.editor.getGraphXml(),+aa.data=this.getHtml(ja,this.editor.graph),aa.xml=mxUtils.getXml(ja),aa.format=C.format;else{mxSvgCanvas2D.prototype.foAltText=null;ja=null!=C.background?C.background:this.editor.graph.background;ja==mxConstants.NONE&&(ja=null);aa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);aa.format="svg";var ha=mxUtils.bind(this,function(Ba){this.editor.graph.setEnabled(!0);this.spinner.stop();aa.data=Editor.createSvgDataUri(Ba);z.postMessage(JSON.stringify(aa),"*")}),da="auto";C.keepTheme&&+(da=Editor.isDarkMode()?"dark":"light");null!=C.theme&&(da=C.theme);if("xmlsvg"==C.format){if(null==C.spin&&null==C.spinKey||this.spinner.spin(document.body,null!=C.spinKey?mxResources.get(C.spinKey):C.spin)){da=null;if(this.isAutoDarkMode()||Editor.isDarkMode())da="auto";null!=C.theme&&(da=C.theme);this.getEmbeddedSvg(aa.xml,this.editor.graph,null,!0,ha,null,null,C.embedImages,ja,C.scale,C.border,C.shadow,da)}}else if(null==C.spin&&null==C.spinKey||this.spinner.spin(document.body,null!=C.spinKey?+mxResources.get(C.spinKey):C.spin))this.editor.graph.setEnabled(!1),ja=this.editor.graph.getSvg(ja,C.scale,C.border,null,null,null,null,null,null,this.editor.graph.shadowVisible||C.shadow,null,da),(this.editor.graph.shadowVisible||C.shadow)&&this.editor.graph.addSvgShadow(ja),this.embedFonts(ja,mxUtils.bind(this,function(Ba){C.embedImages||null==C.embedImages?this.editor.convertImages(Ba,mxUtils.bind(this,function(na){ha(mxUtils.getXml(na))})):ha(mxUtils.getXml(Ba))}));return}z.postMessage(JSON.stringify(aa),"*")}),null!=C.xml&&0<C.xml.length){if(this.editor.graph.mathEnabled){var W=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){W.apply(this,arguments);U()}}k=!0;this.setFileData(C.xml);k=!1;this.editor.graph.mathEnabled||U()}else U();return}if("load"==C.action){V=C.toSketch;m=1==C.autosave;this.hideDialog();null!=C.modified&&null==urlParams.modified&&(urlParams.modified=C.modified);null!=C.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=C.saveAndExit);if("1"==urlParams.saveAndExit||"1"==urlParams.publishClose)if(this.actions.get("save").shortcut=null,!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(83,!0,"saveAndExit"),"1"!=urlParams.noSaveBtn&&(this.actions.get("save").shortcut=Editor.ctrlKey+"+Shift+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=C.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=C.noSaveBtn);if(null!=C.rough){var X=Editor.sketchMode;this.doSetSketchMode(C.rough);X!=Editor.sketchMode&&this.fireEvent(new mxEventObject("sketchModeChanged"))}null!=C.dark&&this.setDarkMode(C.dark);null!=C.border&&(this.embedExportBorder=C.border);null!=C.theme&&(this.embedExportTheme=C.theme);null!=C.background&&(this.embedExportBackground=C.background);null!=C.viewport&&(this.embedViewport=C.viewport);this.embedExitPoint=null;if(null!=C.rect){var Y=this.embedExportBorder;this.diagramContainer.style.left=Math.max(60,C.rect.left)+"px";this.diagramContainer.style.top=Math.max(40,C.rect.top)+"px";this.minInlineWidth=C.minWidth;this.minInlineHeight=C.minHeight;this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";var Z=C.maxFitScale,ca=C.rect.width+2*Y,ea=C.rect.height+2*Y;Q=mxUtils.bind(this,function(){var aa=mxUtils.getDocumentSize();ca=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,ca):ca,aa.width-80);aa=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,ea):ea,aa.height-80);this.diagramContainer.style.width=ca+"px";this.diagramContainer.style.height=-aa+"px";var ia=this.editor.graph;aa=ia.maxFitScale;ia.maxFitScale=Z;ia.fit(2*Y,null,null,null,null,null,ea);this.setPageVisible(!1);if(null!=this.minInlineWidth&&ia.getGraphBounds().width<this.minInlineWidth){var ha=ia.container.scrollTop;this.resetScrollbars();ia.container.scrollTop=ha}ia.maxFitScale=aa;ia.container.scrollTop-=Y;ia.container.scrollLeft-=Y;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[C]));ia.container.focus();null!=this.formatWindow&&-null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=ia.container.style.top);var da=ia.getGraphBounds();ia.container.clientWidth>da.width+2*Y&&(ia.container.scrollLeft=da.x+(da.width+Y-ia.container.clientWidth)/2)}),10)})}null!=C.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=C.noExitBtn);null!=C.title&&null!=this.buttonContainer&&(u=this.createStatusDiv(C.title),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),-"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?this.menubarContainer.appendChild(u):this.buttonContainer.appendChild(u),this.embedFilenameSpan=u);try{C.libs&&this.sidebar.showEntries(C.libs)}catch(aa){}C=null!=C.xmlpng?this.extractGraphModelFromPng(C.xmlpng):null!=C.descriptor?C.descriptor:C.xml}else{if("merge"==C.action){var ja=this.getCurrentFile();null!=ja&&(u=S(C.xml),null!=u&&""!=u&&ja.mergeFile(new LocalFile(this,u),function(){A.postMessage(JSON.stringify({event:"merge",message:C}),-"*")},function(aa){A.postMessage(JSON.stringify({event:"merge",message:C,error:aa}),"*")}))}else"remoteInvokeReady"==C.action?this.handleRemoteInvokeReady(A):"remoteInvoke"==C.action?this.handleRemoteInvoke(C,F.origin):"remoteInvokeResponse"==C.action?this.handleRemoteInvokeResponse(C):A.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(C)}),"*");return}}catch(aa){this.handleError(aa)}}var ba=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?-this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),fa=mxUtils.bind(this,function(aa,ia){k=!0;try{d(aa,ia,null,V)}catch(ha){this.handleError(ha)}k=!1;null!=urlParams.modified&&this.clearStatus();t=ba();m&&null==g&&(g=mxUtils.bind(this,function(ha,da){ha=ba();ha==t||k||(da=this.createLoadMessage("autosave"),da.xml=ha,(window.opener||window.parent).postMessage(JSON.stringify(da),"*"));t=ha}),this.editor.graph.model.addListener(mxEvent.CHANGE,g),this.editor.graph.addListener("gridSizeChanged",-g),this.editor.graph.addListener("shadowVisibleChanged",g),this.addListener("pageFormatChanged",g),this.addListener("pageScaleChanged",g),this.addListener("backgroundColorChanged",g),this.addListener("backgroundImageChanged",g),this.addListener("foldingEnabledChanged",g),this.addListener("mathEnabledChanged",g),this.addListener("gridEnabledChanged",g),this.addListener("guidesEnabledChanged",g),this.addListener("pageViewChanged",g));if("1"==urlParams.returnbounds||"json"==urlParams.proto)ia=this.createLoadMessage("load"),-ia.xml=aa,A.postMessage(JSON.stringify(ia),"*");null!=Q&&Q()});null!=C&&"function"===typeof C.substring&&"data:application/vnd.visio;base64,"==C.substring(0,34)?(S="0M8R4KGxGuE"==C.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(C.substring(C.indexOf(",")+1)),function(aa){fa(aa,F)},mxUtils.bind(this,function(aa){this.handleError(aa)}),S)):null!=C&&"function"===typeof C.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(C,"")?this.isOffline()?this.showError(mxResources.get("error"),-mxResources.get("notInOffline")):this.parseFileData(C,mxUtils.bind(this,function(aa){4==aa.readyState&&(200<=aa.status&&299>=aa.status&&"<mxGraphModel"==aa.responseText.substring(0,13)?fa(aa.responseText,F):this.handleError({message:413==aa.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")}))}),""):null!=C&&"function"===typeof C.substring&&this.isLucidChartData(C)?this.convertLucidChart(C,mxUtils.bind(this,function(aa){fa(aa)}),mxUtils.bind(this,function(aa){this.handleError(aa)})):-null==C||"object"!==typeof C||null==C.format||null==C.data&&null==C.url?(C=S(C),fa(C,F)):this.loadDescriptor(C,mxUtils.bind(this,function(aa){fa(ba(),F)}),mxUtils.bind(this,function(aa){this.handleError(aa,mxResources.get("errorLoadingFile"))}))}}));var A=window.opener||window.parent;y="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";A.postMessage(y,"*");if("json"==urlParams.proto){var I=this.editor.graph.openLink;this.editor.graph.openLink=function(F,C,Q){I.apply(this,-arguments);A.postMessage(JSON.stringify({event:"openLink",href:F,target:C,allowOpener:Q}),"*")}}};EditorUi.prototype.createEmbedButton=function(d,g,k,m){var t=document.createElement("button");t.className="geEmbedBtn geBtn";t.setAttribute("title",d+(null!=k?" ("+k+")":""));mxUtils.write(t,d);m&&t.classList.add("gePrimaryBtn");mxEvent.addListener(t,"click",g);return t};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,function(){var d=null!=this.embedFilenameSpan&&-this.embedFilenameSpan.parentNode==this.buttonContainer;this.buttonContainer.innerText="";d&&this.buttonContainer.appendChild(this.embedFilenameSpan);"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),mxUtils.bind(this,-function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+Shift+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct))}))};EditorUi.prototype.showImportCsvDialog=-function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(d){this.importCsv(d)}),null,null,620,430,null,!0,!0,mxResources.get("import"),this.isOffline()?null:"https://drawio-app.com/import-from-csv-to-drawio/"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};EditorUi.prototype.showCustomLayoutDialog=function(d){this.loadOrgChartLayouts(mxUtils.bind(this,-function(){var g=new TextareaDialog(this,mxResources.get("layout"),d,mxUtils.bind(this,function(k){if(0<k.length)try{var m=JSON.parse(k);this.executeLayouts(this.editor.graph.createLayouts(m));this.customLayoutConfig=m;this.hideDialog()}catch(t){this.handleError(t)}}),null,null,null,null,mxUtils.bind(this,function(k,m){var t=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var y=m.value;m.value=JSON.stringify(JSON.parse(y));m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?-m.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));m.value=y}catch(A){this.handleError(A)}}));t.setAttribute("title","copy");t.className="geBtn";k.appendChild(t)}),!0,null,null,"https://www.drawio.com/doc/faq/apply-layouts");this.showDialog(g.container,620,460,!0,!0);g.init()}))};EditorUi.prototype.loadOrgChartLayouts=function(d){this.createTimeout(null,mxUtils.bind(this,function(g){var k=mxUtils.bind(this,function(){this.loadingOrgChart=-!1;g.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),d())}),m=mxUtils.bind(this,function(t){this.loadingOrgChart=!1;g.clear()&&this.handleError(t)});"undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0)?k():this.spinner.spin(document.body,mxResources.get("loading"))&&(this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",-function(){mxscript("js/orgchart/mxOrgChartLayout.js",k,null,null,null,m)},null,null,null,m)},null,null,null,m)},null,null,null,m):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",k,null,null,null,m))}),onerror)};EditorUi.prototype.importCsv=function(d,g){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(d,g)}))};EditorUi.prototype.doImportCsv=function(d,g){try{var k=d.split("\n"),m=[],t=[],y=[],A={};if(0<k.length){var I={},F=this.editor.graph,C=null,Q=null,S=null,V=null,-P=null,u=null,x=null,J="whiteSpace=wrap;html=1;",H=null,K=null,O="",M="auto",n="auto",z=!1,D=null,L=null,N=40,R=40,T=100,U=0,W=mxUtils.bind(this,function(){null!=g?g(Ia):(F.setSelectionCells(Ia),F.scrollCellToVisible(F.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),X=F.getFreeInsertPoint(),Y=X.x,Z=X.y;X=Z;var ca=null,ea="auto";K=null;for(var ja=[],ba=null,fa=null,aa=0;aa<k.length&&"#"==k[aa].charAt(0);){d=k[aa].replace(/\r$/,-"");for(aa++;aa<k.length&&"\\"==d.charAt(d.length-1)&&"#"==k[aa].charAt(0);)d=d.substring(0,d.length-1)+mxUtils.trim(k[aa].substring(1)),aa++;if("#"!=d.charAt(1)){var ia=d.indexOf(":");if(0<ia){var ha=mxUtils.trim(d.substring(1,ia)),da=mxUtils.trim(d.substring(ia+1));"label"==ha?ca=Graph.sanitizeHtml(da):"labelname"==ha&&0<da.length&&"-"!=da?P=da:"labels"==ha&&0<da.length&&"-"!=da?x=JSON.parse(da):"style"==ha?Q=da:"parentstyle"==ha?J=da:"unknownStyle"==ha&&"-"!=da?u=da:"stylename"==ha&&0<da.length&&-"-"!=da?V=da:"styles"==ha&&0<da.length&&"-"!=da?S=JSON.parse(da):"vars"==ha&&0<da.length&&"-"!=da?C=JSON.parse(da):"identity"==ha&&0<da.length&&"-"!=da?H=da:"parent"==ha&&0<da.length&&"-"!=da?K=da:"namespace"==ha&&0<da.length&&"-"!=da?O=da:"width"==ha?M=da:"height"==ha?n=da:"collapsed"==ha&&"-"!=da?z="true"==da:"left"==ha&&0<da.length?D=da:"top"==ha&&0<da.length?L=da:"ignore"==ha?fa=da.split(","):"connect"==ha?ja.push(JSON.parse(da)):"link"==ha?ba=da:"padding"==ha?U=parseFloat(da):"edgespacing"==-ha?N=parseFloat(da):"nodespacing"==ha?R=parseFloat(da):"levelspacing"==ha?T=parseFloat(da):"layout"==ha&&(ea=da)}}}if(null==k[aa])throw Error(mxResources.get("invalidOrMissingFile"));var Ba=this.editor.csvToArray(k[aa].replace(/\r$/,""));ia=d=null;ha=[];for(da=0;da<Ba.length;da++)H==Ba[da]&&(d=da),K==Ba[da]&&(ia=da),ha.push(mxUtils.trim(Ba[da]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==ca&&(ca="%"+ha[0]+"%");if(null!=ja)for(var na=0;na<ja.length;na++)null==I[ja[na].to]&&-(I[ja[na].to]={});H=[];for(da=aa+1;da<k.length;da++){var va=this.editor.csvToArray(k[da].replace(/\r$/,""));if(null==va){var Aa=40<k[da].length?k[da].substring(0,40)+"...":k[da];throw Error(Aa+" ("+da+"):\n"+mxResources.get("containsValidationErrors"));}0<va.length&&H.push(va)}F.model.beginUpdate();try{for(da=0;da<H.length;da++){va=H[da];var ka=null,ta=null!=d?O+va[d]:null;k=!1;null!=ta&&(ka=F.model.getCell(ta),k=null==ka||0<=mxUtils.indexOf(m,ka));var pa=new mxCell(ca,new mxGeometry(Y,X,0,0),Q||-"whiteSpace=wrap;html=1;");pa.collapsed=z;pa.vertex=!0;pa.id=ta;null==ka||k||F.model.setCollapsed(ka,z);for(var ma=0;ma<va.length;ma++)F.setAttributeForCell(pa,ha[ma],va[ma]),null==ka||k||F.setAttributeForCell(ka,ha[ma],va[ma]);if(null!=P&&null!=x){var Da=x[pa.getAttribute(P)];null!=Da&&(F.labelChanged(pa,Da),null==ka||k||F.cellLabelChanged(ka,Da))}if(null!=V&&null!=S){var wa=S[pa.getAttribute(V)];null!=wa&&(pa.style=wa)}F.setAttributeForCell(pa,"placeholders","1");pa.style=F.replacePlaceholders(pa,-pa.style,C);null==ka||k?F.fireEvent(new mxEventObject("cellsInserted","cells",[pa])):(F.model.setStyle(ka,pa.style),0>mxUtils.indexOf(y,ka)&&y.push(ka),F.fireEvent(new mxEventObject("cellsInserted","cells",[ka])));k=null!=ka;ka=pa;if(!k)for(na=0;na<ja.length;na++)I[ja[na].to][ka.getAttribute(ja[na].to)]=ka;null!=ba&&"link"!=ba&&(F.setLinkForCell(ka,ka.getAttribute(ba)),F.setAttributeForCell(ka,ba,null));var ya=this.editor.graph.getPreferredSizeForCell(ka);K=null!=ia?F.model.getCell(O+va[ia]):null;-if(ka.vertex){Aa=null!=K?0:Y;aa=null!=K?0:Z;null!=D&&null!=ka.getAttribute(D)&&(ka.geometry.x=Aa+parseFloat(ka.getAttribute(D)));null!=L&&null!=ka.getAttribute(L)&&(ka.geometry.y=aa+parseFloat(ka.getAttribute(L)));var xa="@"==M.charAt(0)?ka.getAttribute(M.substring(1)):null;ka.geometry.width=null!=xa&&"auto"!=xa?parseFloat(ka.getAttribute(M.substring(1))):"auto"==M||"auto"==xa?ya.width+U:parseFloat(M);var Fa="@"==n.charAt(0)?ka.getAttribute(n.substring(1)):null;ka.geometry.height=null!=Fa&&"auto"!=-Fa&&"width"!=n?parseFloat(Fa):"auto"==n||"auto"==Fa?ya.height+U:"width"==n?ka.geometry.width:parseFloat(n);X+=ka.geometry.height+R}k?(null==A[ta]&&(A[ta]=[]),A[ta].push(ka)):(m.push(ka),null!=K?(K.style=F.replacePlaceholders(K,J,C),F.addCell(ka,K),t.push(K)):y.push(F.addCell(ka)))}for(da=0;da<t.length;da++)xa="@"==M.charAt(0)?t[da].getAttribute(M.substring(1)):null,Fa="@"==n.charAt(0)?t[da].getAttribute(n.substring(1)):null,"auto"!=M&&"auto"!=xa||"auto"!=n&&"auto"!=Fa||F.updateGroupBounds([t[da]],-U,!0);var Ca=y.slice(),Ia=y.slice();for(na=0;na<ja.length;na++){var La=ja[na];for(da=0;da<m.length;da++){ka=m[da];var Ea=mxUtils.bind(this,function(la,sa,oa){var qa=sa.getAttribute(oa.from);if(null!=qa&&""!=qa){qa=qa.split(",");for(var ra=0;ra<qa.length;ra++){var ua=I[oa.to][qa[ra]];if(null==ua&&null!=u){ua=new mxCell(qa[ra],new mxGeometry(Y,Z,0,0),u);ua.style=F.replacePlaceholders(sa,ua.style,C);var Ga=this.editor.graph.getPreferredSizeForCell(ua);ua.geometry.width=Ga.width+U;ua.geometry.height=-Ga.height+U;I[oa.to][qa[ra]]=ua;ua.vertex=!0;ua.id=qa[ra];y.push(F.addCell(ua))}if(null!=ua){Ga=oa.label;null!=oa.fromlabel&&(Ga=(sa.getAttribute(oa.fromlabel)||"")+(Ga||""));null!=oa.sourcelabel&&(Ga=F.replacePlaceholders(sa,oa.sourcelabel,C)+(Ga||""));null!=oa.tolabel&&(Ga=(Ga||"")+(ua.getAttribute(oa.tolabel)||""));null!=oa.targetlabel&&(Ga=(Ga||"")+F.replacePlaceholders(ua,oa.targetlabel,C));var Ja="target"==oa.placeholders==!oa.invert?ua:la;Ja=null!=oa.style?F.replacePlaceholders(Ja,oa.style,-C):F.createCurrentEdgeStyle();Ga=F.insertEdge(null,null,Ga||"",oa.invert?ua:la,oa.invert?la:ua,Ja);if(null!=oa.labels)for(Ja=0;Ja<oa.labels.length;Ja++){var Ka=oa.labels[Ja],Na=new mxCell(Ka.label||Ja,new mxGeometry(null!=Ka.x?Ka.x:0,null!=Ka.y?Ka.y:0,0,0),"resizable=0;html=1;");Na.vertex=!0;Na.connectable=!1;Na.geometry.relative=!0;null!=Ka.placeholders&&(Na.value=F.replacePlaceholders("target"==Ka.placeholders==!oa.invert?ua:la,Na.value,C));if(null!=Ka.dx||null!=Ka.dy)Na.geometry.offset=new mxPoint(null!=-Ka.dx?Ka.dx:0,null!=Ka.dy?Ka.dy:0);Ga.insert(Na)}if(null!=oa.data)for(var Pa in oa.data)F.setAttributeForCell(Ga,Pa,oa.data[Pa]);Ia.push(Ga);mxUtils.remove(oa.invert?la:ua,Ca)}}}});Ea(ka,ka,La);if(null!=A[ka.id])for(ma=0;ma<A[ka.id].length;ma++)Ea(ka,A[ka.id][ma],La)}}if(null!=fa)for(da=0;da<m.length;da++)for(ka=m[da],ma=0;ma<fa.length;ma++)F.setAttributeForCell(ka,mxUtils.trim(fa[ma]),null);if(0<y.length){var za=new mxParallelEdgeLayout(F);za.spacing=N;za.checkOverlap=!0;var Sa=function(){0<za.spacing&&-za.execute(F.getDefaultParent());for(var la=0;la<y.length;la++){var sa=F.getCellGeometry(y[la]);sa.x=Math.round(F.snap(sa.x));sa.y=Math.round(F.snap(sa.y));"auto"==M&&(sa.width=Math.round(F.snap(sa.width)));"auto"==n&&(sa.height=Math.round(F.snap(sa.height)))}};if("["==ea.charAt(0)){var Ta=W;F.view.validate();this.executeLayouts(F.createLayouts(JSON.parse(ea)),function(){Sa();Ta()});W=null}else if("circle"==ea){var Ua=new mxCircleLayout(F);Ua.disableEdgeStyle=!1;Ua.resetEdges=!1;var hb=Ua.isVertexIgnored;-Ua.isVertexIgnored=function(la){return hb.apply(this,arguments)||0>mxUtils.indexOf(y,la)};this.executeLayout(function(){Ua.execute(F.getDefaultParent());Sa()},!0,W);W=null}else if("horizontaltree"==ea||"verticaltree"==ea||"auto"==ea&&Ia.length==2*y.length-1&&1==Ca.length){F.view.validate();var Ra=new mxCompactTreeLayout(F,"horizontaltree"==ea);Ra.levelDistance=R;Ra.edgeRouting=!1;Ra.resetEdges=!1;Ra.sortEdges=!0;this.executeLayout(function(){Ra.execute(F.getDefaultParent(),0<Ca.length?Ca[0]:null)},-!0,W);W=null}else if("horizontalflow"==ea||"verticalflow"==ea||"auto"==ea&&1==Ca.length){F.view.validate();var Wa=new mxHierarchicalLayout(F,"horizontalflow"==ea?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);Wa.intraCellSpacing=R;Wa.parallelEdgeSpacing=N;Wa.interRankCellSpacing=T;Wa.disableEdgeStyle=!1;this.executeLayout(function(){Wa.execute(F.getDefaultParent(),Ia);F.moveCells(Ia,Y,Z)},!0,W);W=null}else if("orgchart"==ea){F.view.validate();var Va=new mxOrgChartLayout(F,2,T,R),fb=Va.isVertexIgnored;-Va.isVertexIgnored=function(la){return fb.apply(this,arguments)||0>mxUtils.indexOf(y,la)};this.executeLayout(function(){Va.execute(F.getDefaultParent());Sa()},!0,W);W=null}else if("organic"==ea||"auto"==ea&&Ia.length>y.length){F.view.validate();var ab=new mxFastOrganicLayout(F);ab.forceConstant=3*R;ab.disableEdgeStyle=!1;ab.resetEdges=!1;var db=ab.isVertexIgnored;ab.isVertexIgnored=function(la){return db.apply(this,arguments)||0>mxUtils.indexOf(y,la)};this.executeLayout(function(){ab.execute(F.getDefaultParent());+aa+"px";var ja=this.editor.graph;aa=ja.maxFitScale;ja.maxFitScale=Z;ja.fit(2*Y,null,null,null,null,null,ea);this.setPageVisible(!1);if(null!=this.minInlineWidth&&ja.getGraphBounds().width<this.minInlineWidth){var ha=ja.container.scrollTop;this.resetScrollbars();ja.container.scrollTop=ha}ja.maxFitScale=aa;ja.container.scrollTop-=Y;ja.container.scrollLeft-=Y;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[C]));ja.container.focus();null!=this.formatWindow&&+null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=ja.container.style.top);var da=ja.getGraphBounds();ja.container.clientWidth>da.width+2*Y&&(ja.container.scrollLeft=da.x+(da.width+Y-ja.container.clientWidth)/2)}),10)})}null!=C.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=C.noExitBtn);null!=C.title&&null!=this.buttonContainer&&this.setEmbedTitle(C.title);try{C.libs&&this.sidebar.showEntries(C.libs)}catch(aa){}C=null!=C.xmlpng?+this.extractGraphModelFromPng(C.xmlpng):null!=C.descriptor?C.descriptor:C.xml}else{if("merge"==C.action){var ia=this.getCurrentFile();null!=ia&&(u=S(C.xml),null!=u&&""!=u&&ia.mergeFile(new LocalFile(this,u),function(){z.postMessage(JSON.stringify({event:"merge",message:C}),"*")},function(aa){z.postMessage(JSON.stringify({event:"merge",message:C,error:aa}),"*")}))}else"remoteInvokeReady"==C.action?this.handleRemoteInvokeReady(z):"remoteInvoke"==C.action?this.handleRemoteInvoke(C,F.origin):"remoteInvokeResponse"==+C.action?this.handleRemoteInvokeResponse(C):z.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(C)}),"*");return}}catch(aa){this.handleError(aa)}}var ba=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),fa=mxUtils.bind(this,function(aa,ja){k=!0;try{d(aa,ja,null,V)}catch(ha){this.handleError(ha)}k=!1;null!=urlParams.modified&&this.clearStatus();t=ba();m&&null==g&&(g=mxUtils.bind(this,+function(ha,da){ha=ba();ha==t||k||(da=this.createLoadMessage("autosave"),da.xml=ha,(window.opener||window.parent).postMessage(JSON.stringify(da),"*"));t=ha}),this.editor.graph.model.addListener(mxEvent.CHANGE,g),this.editor.graph.addListener("gridSizeChanged",g),this.editor.graph.addListener("shadowVisibleChanged",g),this.addListener("pageFormatChanged",g),this.addListener("pageScaleChanged",g),this.addListener("backgroundColorChanged",g),this.addListener("backgroundImageChanged",g),this.addListener("foldingEnabledChanged",+g),this.addListener("mathEnabledChanged",g),this.addListener("gridEnabledChanged",g),this.addListener("guidesEnabledChanged",g),this.addListener("pageViewChanged",g));if("1"==urlParams.returnbounds||"json"==urlParams.proto)ja=this.createLoadMessage("load"),ja.xml=aa,z.postMessage(JSON.stringify(ja),"*");null!=Q&&Q()});null!=C&&"function"===typeof C.substring&&"data:application/vnd.visio;base64,"==C.substring(0,34)?(S="0M8R4KGxGuE"==C.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(C.substring(C.indexOf(",")++1)),function(aa){fa(aa,F)},mxUtils.bind(this,function(aa){this.handleError(aa)}),S)):null!=C&&"function"===typeof C.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(C,"")?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(C,mxUtils.bind(this,function(aa){4==aa.readyState&&(200<=aa.status&&299>=aa.status&&"<mxGraphModel"==aa.responseText.substring(0,13)?fa(aa.responseText,F):this.handleError({message:413==aa.status?mxResources.get("diagramTooLarge"):+mxResources.get("unknownError")}))}),""):null!=C&&"function"===typeof C.substring&&this.isLucidChartData(C)?this.convertLucidChart(C,mxUtils.bind(this,function(aa){fa(aa)}),mxUtils.bind(this,function(aa){this.handleError(aa)})):null==C||"object"!==typeof C||null==C.format||null==C.data&&null==C.url?(C=S(C),fa(C,F)):this.loadDescriptor(C,mxUtils.bind(this,function(aa){fa(ba(),F)}),mxUtils.bind(this,function(aa){this.handleError(aa,mxResources.get("errorLoadingFile"))}))}}));var z=window.opener||window.parent;+y="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";z.postMessage(y,"*");if("json"==urlParams.proto){var I=this.editor.graph.openLink;this.editor.graph.openLink=function(F,C,Q){I.apply(this,arguments);z.postMessage(JSON.stringify({event:"openLink",href:F,target:C,allowOpener:Q}),"*")}}};EditorUi.prototype.createEmbedButton=function(d,g,k,m){var t=document.createElement("button");t.className="geEmbedBtn geBtn";t.setAttribute("title",d+(null!=k?" ("+k+")":""));mxUtils.write(t,+d);m&&t.classList.add("gePrimaryBtn");mxEvent.addListener(t,"click",g);return t};EditorUi.prototype.setEmbedTitle=function(d){d=this.createStatusDiv(d);null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan);"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?this.menubarContainer.appendChild(d):this.buttonContainer.appendChild(d);this.embedFilenameSpan=d};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,function(){var d=+null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode==this.buttonContainer;this.buttonContainer.innerText="";d&&this.buttonContainer.appendChild(this.embedFilenameSpan);this.commentsSupported()&&null!=this.commentButton&&this.buttonContainer.appendChild(this.commentButton);"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,+Editor.ctrlKey+"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+Shift+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==+urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct))}))};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(d){this.importCsv(d)}),null,null,620,430,null,!0,!0,mxResources.get("import"),this.isOffline()?null:"https://drawio-app.com/import-from-csv-to-drawio/"));this.showDialog(this.importCsvDialog.container,+640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};EditorUi.prototype.showCustomLayoutDialog=function(d){this.loadOrgChartLayouts(mxUtils.bind(this,function(){var g=new TextareaDialog(this,mxResources.get("layout"),d,mxUtils.bind(this,function(k){if(0<k.length)try{var m=JSON.parse(k);this.executeLayouts(this.editor.graph.createLayouts(m));this.customLayoutConfig=m;this.hideDialog()}catch(t){this.handleError(t)}}),null,null,null,null,mxUtils.bind(this,function(k,m){var t=mxUtils.button(mxResources.get("copy"),+mxUtils.bind(this,function(){try{var y=m.value;m.value=JSON.stringify(JSON.parse(y));m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?m.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));m.value=y}catch(z){this.handleError(z)}}));t.setAttribute("title","copy");t.className="geBtn";k.appendChild(t)}),!0,null,null,"https://www.drawio.com/doc/faq/apply-layouts");this.showDialog(g.container,620,460,!0,!0);g.init()}))};+EditorUi.prototype.loadOrgChartLayouts=function(d){this.createTimeout(null,mxUtils.bind(this,function(g){var k=mxUtils.bind(this,function(){this.loadingOrgChart=!1;g.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),d())}),m=mxUtils.bind(this,function(t){this.loadingOrgChart=!1;g.clear()&&this.handleError(t)});"undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0)?k():this.spinner.spin(document.body,mxResources.get("loading"))&&(this.loadingOrgChart=+!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",k,null,null,null,m)},null,null,null,m)},null,null,null,m)},null,null,null,m):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",k,null,null,null,m))}),onerror)};EditorUi.prototype.importCsv=function(d,g){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(d,+g)}))};EditorUi.prototype.doImportCsv=function(d,g){try{var k=d.split("\n"),m=[],t=[],y=[],z={};if(0<k.length){var I={},F=this.editor.graph,C=null,Q=null,S=null,V=null,P=null,u=null,x=null,J="whiteSpace=wrap;html=1;",H=null,K=null,N="",M="auto",n="auto",A=!1,E=null,L=null,O=40,R=40,T=100,U=0,W=mxUtils.bind(this,function(){null!=g?g(Ia):(F.setSelectionCells(Ia),F.scrollCellToVisible(F.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),+0)}),X=F.getFreeInsertPoint(),Y=X.x,Z=X.y;X=Z;var ca=null,ea="auto";K=null;for(var ia=[],ba=null,fa=null,aa=0;aa<k.length&&"#"==k[aa].charAt(0);){d=k[aa].replace(/\r$/,"");for(aa++;aa<k.length&&"\\"==d.charAt(d.length-1)&&"#"==k[aa].charAt(0);)d=d.substring(0,d.length-1)+mxUtils.trim(k[aa].substring(1)),aa++;if("#"!=d.charAt(1)){var ja=d.indexOf(":");if(0<ja){var ha=mxUtils.trim(d.substring(1,ja)),da=mxUtils.trim(d.substring(ja+1));"label"==ha?ca=Graph.sanitizeHtml(da):"labelname"==ha&&0<da.length&&+"-"!=da?P=da:"labels"==ha&&0<da.length&&"-"!=da?x=JSON.parse(da):"style"==ha?Q=da:"parentstyle"==ha?J=da:"unknownStyle"==ha&&"-"!=da?u=da:"stylename"==ha&&0<da.length&&"-"!=da?V=da:"styles"==ha&&0<da.length&&"-"!=da?S=JSON.parse(da):"vars"==ha&&0<da.length&&"-"!=da?C=JSON.parse(da):"identity"==ha&&0<da.length&&"-"!=da?H=da:"parent"==ha&&0<da.length&&"-"!=da?K=da:"namespace"==ha&&0<da.length&&"-"!=da?N=da:"width"==ha?M=da:"height"==ha?n=da:"collapsed"==ha&&"-"!=da?A="true"==da:"left"==ha&&0<da.length?+E=da:"top"==ha&&0<da.length?L=da:"ignore"==ha?fa=da.split(","):"connect"==ha?ia.push(JSON.parse(da)):"link"==ha?ba=da:"padding"==ha?U=parseFloat(da):"edgespacing"==ha?O=parseFloat(da):"nodespacing"==ha?R=parseFloat(da):"levelspacing"==ha?T=parseFloat(da):"layout"==ha&&(ea=da)}}}if(null==k[aa])throw Error(mxResources.get("invalidOrMissingFile"));var Ba=this.editor.csvToArray(k[aa].replace(/\r$/,""));ja=d=null;ha=[];for(da=0;da<Ba.length;da++)H==Ba[da]&&(d=da),K==Ba[da]&&(ja=da),ha.push(mxUtils.trim(Ba[da]).replace(/[^a-z0-9]+/ig,+"_").replace(/^\d+/,"").replace(/_+$/,""));null==ca&&(ca="%"+ha[0]+"%");if(null!=ia)for(var na=0;na<ia.length;na++)null==I[ia[na].to]&&(I[ia[na].to]={});H=[];for(da=aa+1;da<k.length;da++){var va=this.editor.csvToArray(k[da].replace(/\r$/,""));if(null==va){var Aa=40<k[da].length?k[da].substring(0,40)+"...":k[da];throw Error(Aa+" ("+da+"):\n"+mxResources.get("containsValidationErrors"));}0<va.length&&H.push(va)}F.model.beginUpdate();try{for(da=0;da<H.length;da++){va=H[da];var ka=null,ta=null!=d?N+va[d]:+null;k=!1;null!=ta&&(ka=F.model.getCell(ta),k=null==ka||0<=mxUtils.indexOf(m,ka));var pa=new mxCell(ca,new mxGeometry(Y,X,0,0),Q||"whiteSpace=wrap;html=1;");pa.collapsed=A;pa.vertex=!0;pa.id=ta;null==ka||k||F.model.setCollapsed(ka,A);for(var ma=0;ma<va.length;ma++)F.setAttributeForCell(pa,ha[ma],va[ma]),null==ka||k||F.setAttributeForCell(ka,ha[ma],va[ma]);if(null!=P&&null!=x){var Da=x[pa.getAttribute(P)];null!=Da&&(F.labelChanged(pa,Da),null==ka||k||F.cellLabelChanged(ka,Da))}if(null!=V&&null!=S){var wa=+S[pa.getAttribute(V)];null!=wa&&(pa.style=wa)}F.setAttributeForCell(pa,"placeholders","1");pa.style=F.replacePlaceholders(pa,pa.style,C);null==ka||k?F.fireEvent(new mxEventObject("cellsInserted","cells",[pa])):(F.model.setStyle(ka,pa.style),0>mxUtils.indexOf(y,ka)&&y.push(ka),F.fireEvent(new mxEventObject("cellsInserted","cells",[ka])));k=null!=ka;ka=pa;if(!k)for(na=0;na<ia.length;na++)I[ia[na].to][ka.getAttribute(ia[na].to)]=ka;null!=ba&&"link"!=ba&&(F.setLinkForCell(ka,ka.getAttribute(ba)),F.setAttributeForCell(ka,+ba,null));var ya=this.editor.graph.getPreferredSizeForCell(ka);K=null!=ja?F.model.getCell(N+va[ja]):null;if(ka.vertex){Aa=null!=K?0:Y;aa=null!=K?0:Z;null!=E&&null!=ka.getAttribute(E)&&(ka.geometry.x=Aa+parseFloat(ka.getAttribute(E)));null!=L&&null!=ka.getAttribute(L)&&(ka.geometry.y=aa+parseFloat(ka.getAttribute(L)));var xa="@"==M.charAt(0)?ka.getAttribute(M.substring(1)):null;ka.geometry.width=null!=xa&&"auto"!=xa?parseFloat(ka.getAttribute(M.substring(1))):"auto"==M||"auto"==xa?ya.width+U:parseFloat(M);+var Fa="@"==n.charAt(0)?ka.getAttribute(n.substring(1)):null;ka.geometry.height=null!=Fa&&"auto"!=Fa&&"width"!=n?parseFloat(Fa):"auto"==n||"auto"==Fa?ya.height+U:"width"==n?ka.geometry.width:parseFloat(n);X+=ka.geometry.height+R}k?(null==z[ta]&&(z[ta]=[]),z[ta].push(ka)):(m.push(ka),null!=K?(K.style=F.replacePlaceholders(K,J,C),F.addCell(ka,K),t.push(K)):y.push(F.addCell(ka)))}for(da=0;da<t.length;da++)xa="@"==M.charAt(0)?t[da].getAttribute(M.substring(1)):null,Fa="@"==n.charAt(0)?t[da].getAttribute(n.substring(1)):+null,"auto"!=M&&"auto"!=xa||"auto"!=n&&"auto"!=Fa||F.updateGroupBounds([t[da]],U,!0);var Ca=y.slice(),Ia=y.slice();for(na=0;na<ia.length;na++){var La=ia[na];for(da=0;da<m.length;da++){ka=m[da];var Ea=mxUtils.bind(this,function(la,sa,oa){var qa=sa.getAttribute(oa.from);if(null!=qa&&""!=qa){qa=qa.split(",");for(var ra=0;ra<qa.length;ra++){var ua=I[oa.to][qa[ra]];if(null==ua&&null!=u){ua=new mxCell(qa[ra],new mxGeometry(Y,Z,0,0),u);ua.style=F.replacePlaceholders(sa,ua.style,C);var Ga=this.editor.graph.getPreferredSizeForCell(ua);+ua.geometry.width=Ga.width+U;ua.geometry.height=Ga.height+U;I[oa.to][qa[ra]]=ua;ua.vertex=!0;ua.id=qa[ra];y.push(F.addCell(ua))}if(null!=ua){Ga=oa.label;null!=oa.fromlabel&&(Ga=(sa.getAttribute(oa.fromlabel)||"")+(Ga||""));null!=oa.sourcelabel&&(Ga=F.replacePlaceholders(sa,oa.sourcelabel,C)+(Ga||""));null!=oa.tolabel&&(Ga=(Ga||"")+(ua.getAttribute(oa.tolabel)||""));null!=oa.targetlabel&&(Ga=(Ga||"")+F.replacePlaceholders(ua,oa.targetlabel,C));var Ja="target"==oa.placeholders==!oa.invert?ua:la;Ja=+null!=oa.style?F.replacePlaceholders(Ja,oa.style,C):F.createCurrentEdgeStyle();Ga=F.insertEdge(null,null,Ga||"",oa.invert?ua:la,oa.invert?la:ua,Ja);if(null!=oa.labels)for(Ja=0;Ja<oa.labels.length;Ja++){var Ka=oa.labels[Ja],Na=new mxCell(Ka.label||Ja,new mxGeometry(null!=Ka.x?Ka.x:0,null!=Ka.y?Ka.y:0,0,0),"resizable=0;html=1;");Na.vertex=!0;Na.connectable=!1;Na.geometry.relative=!0;null!=Ka.placeholders&&(Na.value=F.replacePlaceholders("target"==Ka.placeholders==!oa.invert?ua:la,Na.value,C));if(null!=+Ka.dx||null!=Ka.dy)Na.geometry.offset=new mxPoint(null!=Ka.dx?Ka.dx:0,null!=Ka.dy?Ka.dy:0);Ga.insert(Na)}if(null!=oa.data)for(var Pa in oa.data)F.setAttributeForCell(Ga,Pa,oa.data[Pa]);Ia.push(Ga);mxUtils.remove(oa.invert?la:ua,Ca)}}}});Ea(ka,ka,La);if(null!=z[ka.id])for(ma=0;ma<z[ka.id].length;ma++)Ea(ka,z[ka.id][ma],La)}}if(null!=fa)for(da=0;da<m.length;da++)for(ka=m[da],ma=0;ma<fa.length;ma++)F.setAttributeForCell(ka,mxUtils.trim(fa[ma]),null);if(0<y.length){var za=new mxParallelEdgeLayout(F);+za.spacing=O;za.checkOverlap=!0;var Sa=function(){0<za.spacing&&za.execute(F.getDefaultParent());for(var la=0;la<y.length;la++){var sa=F.getCellGeometry(y[la]);sa.x=Math.round(F.snap(sa.x));sa.y=Math.round(F.snap(sa.y));"auto"==M&&(sa.width=Math.round(F.snap(sa.width)));"auto"==n&&(sa.height=Math.round(F.snap(sa.height)))}};if("["==ea.charAt(0)){var Ta=W;F.view.validate();this.executeLayouts(F.createLayouts(JSON.parse(ea)),function(){Sa();Ta()});W=null}else if("circle"==ea){var Ua=new mxCircleLayout(F);+Ua.disableEdgeStyle=!1;Ua.resetEdges=!1;var hb=Ua.isVertexIgnored;Ua.isVertexIgnored=function(la){return hb.apply(this,arguments)||0>mxUtils.indexOf(y,la)};this.executeLayout(function(){Ua.execute(F.getDefaultParent());Sa()},!0,W);W=null}else if("horizontaltree"==ea||"verticaltree"==ea||"auto"==ea&&Ia.length==2*y.length-1&&1==Ca.length){F.view.validate();var Ra=new mxCompactTreeLayout(F,"horizontaltree"==ea);Ra.levelDistance=R;Ra.edgeRouting=!1;Ra.resetEdges=!1;Ra.sortEdges=!0;this.executeLayout(function(){Ra.execute(F.getDefaultParent(),+0<Ca.length?Ca[0]:null)},!0,W);W=null}else if("horizontalflow"==ea||"verticalflow"==ea||"auto"==ea&&1==Ca.length){F.view.validate();var Wa=new mxHierarchicalLayout(F,"horizontalflow"==ea?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);Wa.intraCellSpacing=R;Wa.parallelEdgeSpacing=O;Wa.interRankCellSpacing=T;Wa.disableEdgeStyle=!1;this.executeLayout(function(){Wa.execute(F.getDefaultParent(),Ia);F.moveCells(Ia,Y,Z)},!0,W);W=null}else if("orgchart"==ea){F.view.validate();var Va=new mxOrgChartLayout(F,+2,T,R),fb=Va.isVertexIgnored;Va.isVertexIgnored=function(la){return fb.apply(this,arguments)||0>mxUtils.indexOf(y,la)};this.executeLayout(function(){Va.execute(F.getDefaultParent());Sa()},!0,W);W=null}else if("organic"==ea||"auto"==ea&&Ia.length>y.length){F.view.validate();var ab=new mxFastOrganicLayout(F);ab.forceConstant=3*R;ab.disableEdgeStyle=!1;ab.resetEdges=!1;var db=ab.isVertexIgnored;ab.isVertexIgnored=function(la){return db.apply(this,arguments)||0>mxUtils.indexOf(y,la)};this.executeLayout(function(){ab.execute(F.getDefaultParent());Sa()},!0,W);W=null}}this.hideDialog()}finally{F.model.endUpdate()}null!=W&&W()}}catch(la){this.handleError(la)}};EditorUi.prototype.getSearch=function(d){var g="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=d&&0<window.location.search.length){var k="?",m;for(m in urlParams)0>mxUtils.indexOf(d,m)&&null!=urlParams[m]&&(g+=k+m+"="+urlParams[m],k="&")}else g=window.location.search;return g};EditorUi.prototype.getUrl=function(d){d=null!=d?d:window.location.pathname;var g=0<d.indexOf("?")?1:0;if("1"==urlParams.offline)d+=window.location.search;else{var k="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),m;for(m in urlParams)0>mxUtils.indexOf(k,m)&&(d=0==g?d+"?":d+"&",null!=urlParams[m]&&(d+=m+"="+urlParams[m],g++))}return d};EditorUi.prototype.showLinkDialog=function(d,g,k,m,t){d=new LinkDialog(this,d,g,k,!0,m,t);this.showDialog(d.container,440,120,!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);@@ -13448,80 +13452,80 @@ t);this.actions.get("autosave").setEnabled(null!=g&&g.isEditable()&&g.isAutosavethis.actions.get("connectionArrows").setEnabled(m);this.actions.get("connectionPoints").setEnabled(m);this.actions.get("copyStyle").setEnabled(m&&!d.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(null!=this.copiedStyle&&m&&0<k.cells.length);this.actions.get("editGeometry").setEnabled(0<k.vertices.length);this.actions.get("createShape").setEnabled(m);this.actions.get("createRevision").setEnabled(m);this.actions.get("moveToFolder").setEnabled(null!=g);this.actions.get("makeCopy").setEnabled(null!=g&&!g.isRestricted());this.actions.get("editDiagram").setEnabled(m&&(null==g||!g.isRestricted()));this.actions.get("publishLink").setEnabled(null!=g&&!g.isRestricted());this.actions.get("removeFormat").setEnabled(d.isEnabled()&&!d.isSelectionEmpty()&&!d.isEditing());this.actions.get("tags").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("layers").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("outline").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("rename").setEnabled(null!=g&&g.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=g);this.actions.get("properties").setEnabled(null!=g);this.menus.get("publish").setEnabled(null!=g&&!g.isRestricted());g=this.actions.get("findReplace");g.setEnabled("none"!=this.diagramContainer.style.display);g.label=mxResources.get("find")+(d.isEnabled()?"/"+mxResources.get("replace"):"");d=d.view.getState(d.getSelectionCell());this.actions.get("editShape").setEnabled(m&&-null!=d&&null!=d.shape&&null!=d.shape.stencil)};var B=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);B.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(d,g,k,m,t,y,A,I){var F=d.editor.graph;if("xml"==k)d.hideDialog(),d.saveData(g,"xml",mxUtils.getXml(d.editor.getGraphXml()),"text/xml");+null!=d&&null!=d.shape&&null!=d.shape.stencil)};var B=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);B.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(d,g,k,m,t,y,z,I){var F=d.editor.graph;if("xml"==k)d.hideDialog(),d.saveData(g,"xml",mxUtils.getXml(d.editor.getGraphXml()),"text/xml");else if("svg"==k)d.hideDialog(),d.saveData(g,"svg",mxUtils.getXml(F.getSvg(m,t,y)),"image/svg+xml");else{var C=d.getFileData(!0,null,null,null,null,!0),Q=F.getGraphBounds(),S=Math.floor(Q.width*t/F.view.scale),V=Math.floor(Q.height*t/F.view.scale);if(C.length<=MAX_REQUEST_SIZE&&S*V<MAX_AREA)if(d.hideDialog(),"png"!=k&&"jpg"!=k&&"jpeg"!=k||!d.isExportToCanvas()){var P={globalVars:F.getExportVariables()};I&&(P.grid={size:F.gridSize,steps:F.view.gridSteps,color:F.view.gridColor});d.saveRequest(g,k,function(u,-x){return new mxXmlRequest(EXPORT_URL,"format="+k+"&base64="+(x||"0")+(null!=u?"&filename="+encodeURIComponent(u):"")+"&extras="+encodeURIComponent(JSON.stringify(P))+(0<A?"&dpi="+A:"")+"&bg="+(null!=m?m:"none")+"&w="+S+"&h="+V+"&border="+y+"&xml="+encodeURIComponent(C))})}else"png"==k?d.exportImage(t,null==m||"none"==m,!0,!1,!1,y,!0,!1,null,I,A):d.exportImage(t,!1,!0,!1,!1,y,!0,!1,"jpeg",I);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);+x){return new mxXmlRequest(EXPORT_URL,"format="+k+"&base64="+(x||"0")+(null!=u?"&filename="+encodeURIComponent(u):"")+"&extras="+encodeURIComponent(JSON.stringify(P))+(0<z?"&dpi="+z:"")+"&bg="+(null!=m?m:"none")+"&w="+S+"&h="+V+"&border="+y+"&xml="+encodeURIComponent(C))})}else"png"==k?d.exportImage(t,null==m||"none"==m,!0,!1,!1,y,!0,!1,null,I,z):d.exportImage(t,!1,!0,!1,!1,y,!0,!1,"jpeg",I);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var d=this.editor.graph,g="";if(null!=this.pages)for(var k=0;k<this.pages.length;k++){var m=d;this.currentPage!=this.pages[k]&&(m=this.createTemporaryGraph(d.getStylesheet()),this.updatePageRoot(this.pages[k]),m.model.setRoot(this.pages[k].root));g+=this.pages[k].getName()+" "+m.getIndexableText()+" "}else g=d.getIndexableText();this.editor.graph.setEnabled(!0);return g};EditorUi.prototype.showRemotelyStoredLibrary=function(d){var g={},k=document.createElement("div");k.style.whiteSpace="nowrap";var m=-document.createElement("h3");mxUtils.write(m,mxUtils.htmlEntities(d));m.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";k.appendChild(m);var t=document.createElement("div");t.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";t.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var y={};try{var A=mxSettings.getCustomLibraries();for(d=0;d<A.length;d++){var I=A[d];if("R"==I.substring(0,1)){var F=JSON.parse(decodeURIComponent(I.substring(1)));+document.createElement("h3");mxUtils.write(m,mxUtils.htmlEntities(d));m.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";k.appendChild(m);var t=document.createElement("div");t.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";t.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var y={};try{var z=mxSettings.getCustomLibraries();for(d=0;d<z.length;d++){var I=z[d];if("R"==I.substring(0,1)){var F=JSON.parse(decodeURIComponent(I.substring(1)));y[F[0]]={id:F[0],title:F[1],downloadUrl:F[2]}}}}catch(C){}this.remoteInvoke("getCustomLibraries",null,null,function(C){t.innerText="";if(0==C.length)t.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var Q=0;Q<C.length;Q++){var S=C[Q];y[S.id]&&(g[S.id]=S);var V=this.addCheckbox(t,S.title,y[S.id]);(function(P,u){mxEvent.addListener(u,"change",function(){this.checked?g[P.id]=P:delete g[P.id]})})(S,V)}},mxUtils.bind(this,function(C){t.innerText="";var Q=document.createElement("div");Q.style.padding="8px";Q.style.textAlign="center";mxUtils.write(Q,mxResources.get("error")+": ");mxUtils.write(Q,null!=C&&null!=C.message?C.message:mxResources.get("unknownError"));t.appendChild(Q)}));k.appendChild(t);k=new CustomDialog(this,k,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var C=0,Q;for(Q in g)null==y[Q]&&(C++,mxUtils.bind(this,function(S){this.remoteInvoke("getFileContent",[S.downloadUrl],null,mxUtils.bind(this,function(V){C--;0==C&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,V,S)),this.showSidebar()}catch(P){this.handleError(P,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){C--;0==C&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(g[Q]));for(Q in y)g[Q]||this.closeLibrary(new RemoteLibrary(this,null,y[Q]));0==C&&this.spinner.stop()}),null,null,"https://www.drawio.com/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;g<this.remoteInvokeQueue.length;g++)d.postMessage(this.remoteInvokeQueue[g],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(d){var g=d.msgMarkers,k=this.remoteInvokeCallbacks[g.callbackId];if(null==k)throw Error("No callback for "+(null!=g?g.callbackId:"null"));d.error?k.error&&k.error(d.error.errResp):k.callback&&k.callback.apply(this,d.resp);this.remoteInvokeCallbacks[g.callbackId]=null};EditorUi.prototype.remoteInvoke=function(d,g,k,m,t){var y=-!0,A=window.setTimeout(mxUtils.bind(this,function(){y=!1;t({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),I=mxUtils.bind(this,function(){window.clearTimeout(A);y&&m.apply(this,arguments)}),F=mxUtils.bind(this,function(){window.clearTimeout(A);y&&t.apply(this,arguments)});k=k||{};k.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:I,error:F});d=JSON.stringify({event:"remoteInvoke",funtionName:d,functionArgs:g,msgMarkers:k});null!=this.remoteWin?-this.remoteWin.postMessage(d,"*"):this.remoteInvokeQueue.push(d)};EditorUi.prototype.handleRemoteInvoke=function(d,g){var k=mxUtils.bind(this,function(C,Q){var S={event:"remoteInvokeResponse",msgMarkers:d.msgMarkers};null!=Q?S.error={errResp:Q}:null!=C&&(S.resp=C);this.remoteWin.postMessage(JSON.stringify(S),"*")});try{var m=d.funtionName,t=this.remoteInvokableFns[m];if(null!=t&&"function"===typeof this[m]){if(t.allowedDomains){for(var y=!1,A=0;A<t.allowedDomains.length;A++)if(g=="https://"+t.allowedDomains[A]){y=+!0,z=window.setTimeout(mxUtils.bind(this,function(){y=!1;t({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),I=mxUtils.bind(this,function(){window.clearTimeout(z);y&&m.apply(this,arguments)}),F=mxUtils.bind(this,function(){window.clearTimeout(z);y&&t.apply(this,arguments)});k=k||{};k.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:I,error:F});d=JSON.stringify({event:"remoteInvoke",funtionName:d,functionArgs:g,msgMarkers:k});null!=this.remoteWin?+this.remoteWin.postMessage(d,"*"):this.remoteInvokeQueue.push(d)};EditorUi.prototype.handleRemoteInvoke=function(d,g){var k=mxUtils.bind(this,function(C,Q){var S={event:"remoteInvokeResponse",msgMarkers:d.msgMarkers};null!=Q?S.error={errResp:Q}:null!=C&&(S.resp=C);this.remoteWin.postMessage(JSON.stringify(S),"*")});try{var m=d.funtionName,t=this.remoteInvokableFns[m];if(null!=t&&"function"===typeof this[m]){if(t.allowedDomains){for(var y=!1,z=0;z<t.allowedDomains.length;z++)if(g=="https://"+t.allowedDomains[z]){y=!0;break}if(!y){k(null,"Invalid Call: "+m+" is not allowed.");return}}var I=d.functionArgs;Array.isArray(I)||(I=[]);if(t.isAsync)I.push(function(){k(Array.prototype.slice.apply(arguments))}),I.push(function(C){k(null,C||"Unkown Error")}),this[m].apply(this,I);else{var F=this[m].apply(this,I);k([F])}}else k(null,"Invalid Call: "+m+" is not found.")}catch(C){k(null,"Invalid Call: An error occurred, "+C.message)}};EditorUi.prototype.openDatabase=function(d,g){if(null==this.database){var k=window.indexedDB||-window.mozIndexedDB||window.webkitIndexedDB;if(null!=k)try{var m=k.open("database",2);m.onupgradeneeded=function(t){try{var y=m.result;1>t.oldVersion&&y.createObjectStore("objects",{keyPath:"key"});2>t.oldVersion&&(y.createObjectStore("files",{keyPath:"title"}),y.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(A){null!=g&&g(A)}};m.onsuccess=mxUtils.bind(this,function(t){try{var y=m.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(A){if(!A||"1"==urlParams.forceMigration){var I=document.createElement("iframe");I.style.display="none";I.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(I);var F=!0,C=!1,Q,S=0,V=mxUtils.bind(this,function(){C=!0;this.setDatabaseItem(".drawioMigrated3",+window.mozIndexedDB||window.webkitIndexedDB;if(null!=k)try{var m=k.open("database",2);m.onupgradeneeded=function(t){try{var y=m.result;1>t.oldVersion&&y.createObjectStore("objects",{keyPath:"key"});2>t.oldVersion&&(y.createObjectStore("files",{keyPath:"title"}),y.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(z){null!=g&&g(z)}};m.onsuccess=mxUtils.bind(this,function(t){try{var y=m.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(z){if(!z||"1"==urlParams.forceMigration){var I=document.createElement("iframe");I.style.display="none";I.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(I);var F=!0,C=!1,Q,S=0,V=mxUtils.bind(this,function(){C=!0;this.setDatabaseItem(".drawioMigrated3",!0);I.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),P=mxUtils.bind(this,function(){S++;u()}),u=mxUtils.bind(this,function(){try{if(S>=Q.length)V();else{var J=Q[S];StorageFile.getFileContent(this,J,mxUtils.bind(this,function(H){null==H||".scratchpad"==J&&H==this.emptyLibraryXml?I.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[J]}),"*"):P()}),P)}}catch(H){console.log(H)}}),x=mxUtils.bind(this,-function(J){try{this.setDatabaseItem(null,[{title:J.title,size:J.data.length,lastModified:Date.now(),type:J.isLib?"L":"F"},{title:J.title,data:J.data}],P,P,["filesInfo","files"])}catch(H){console.log(H)}});A=mxUtils.bind(this,function(J){try{if(J.source==I.contentWindow){var H={};try{H=JSON.parse(J.data)}catch(K){}"init"==H.event?(I.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),I.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),-"*")):"remoteInvokeResponse"!=H.event||C||(F?null!=H.resp&&0<H.resp.length&&null!=H.resp[0]?(Q=H.resp[0],F=!1,u()):V():null!=H.resp&&0<H.resp.length&&null!=H.resp[0]?x(H.resp[0]):P())}}catch(K){console.log(K)}});window.addEventListener("message",A)}})));d(y);y.onversionchange=function(){y.close()}}catch(A){null!=g?g(A):null!=window.console&&console.warn(A)}});m.onerror=g;m.onblocked=function(){}}catch(t){null!=g?g(t):null!=window.console&&console.error(t)}else null!=g&&g(Error("IndexedDB not supported"))}else d(this.database)};-EditorUi.prototype.setDatabaseItem=function(d,g,k,m,t){this.openDatabase(mxUtils.bind(this,function(y){try{t=t||"objects";Array.isArray(t)||(t=[t],d=[d],g=[g]);var A=y.transaction(t,"readwrite");A.oncomplete=k;A.onerror=m;for(y=0;y<t.length;y++)A.objectStore(t[y]).put(null!=d&&null!=d[y]?{key:d[y],data:g[y]}:g[y])}catch(I){null!=m&&m(I)}}),m)};EditorUi.prototype.removeDatabaseItem=function(d,g,k,m){this.openDatabase(mxUtils.bind(this,function(t){try{m=m||"objects";Array.isArray(m)||(m=[m],d=[d]);-var y=t.transaction(m,"readwrite");y.oncomplete=g;y.onerror=k;for(t=0;t<m.length;t++)y.objectStore(m[t]).delete(d[t])}catch(A){null!=k&&k(A)}}),k)};EditorUi.prototype.getDatabaseItem=function(d,g,k,m){this.openDatabase(mxUtils.bind(this,function(t){try{m=m||"objects";var y=t.transaction([m],"readonly").objectStore(m).get(d);y.onsuccess=function(){g(y.result)};y.onerror=k}catch(A){null!=k&&k(A)}}),k)};EditorUi.prototype.getDatabaseItems=function(d,g,k){this.openDatabase(mxUtils.bind(this,function(m){try{k=-k||"objects";var t=m.transaction([k],"readonly").objectStore(k).openCursor(IDBKeyRange.lowerBound(0)),y=[];t.onsuccess=function(A){null==A.target.result?d(y):(y.push(A.target.result.value),A.target.result.continue())};t.onerror=g}catch(A){null!=g&&g(A)}}),g)};EditorUi.prototype.getDatabaseItemKeys=function(d,g,k){this.openDatabase(mxUtils.bind(this,function(m){try{k=k||"objects";var t=m.transaction([k],"readonly").objectStore(k).getAllKeys();t.onsuccess=function(){d(t.result)};t.onerror=g}catch(y){null!=+function(J){try{this.setDatabaseItem(null,[{title:J.title,size:J.data.length,lastModified:Date.now(),type:J.isLib?"L":"F"},{title:J.title,data:J.data}],P,P,["filesInfo","files"])}catch(H){console.log(H)}});z=mxUtils.bind(this,function(J){try{if(J.source==I.contentWindow){var H={};try{H=JSON.parse(J.data)}catch(K){}"init"==H.event?(I.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),I.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),+"*")):"remoteInvokeResponse"!=H.event||C||(F?null!=H.resp&&0<H.resp.length&&null!=H.resp[0]?(Q=H.resp[0],F=!1,u()):V():null!=H.resp&&0<H.resp.length&&null!=H.resp[0]?x(H.resp[0]):P())}}catch(K){console.log(K)}});window.addEventListener("message",z)}})));d(y);y.onversionchange=function(){y.close()}}catch(z){null!=g?g(z):null!=window.console&&console.warn(z)}});m.onerror=g;m.onblocked=function(){}}catch(t){null!=g?g(t):null!=window.console&&console.error(t)}else null!=g&&g(Error("IndexedDB not supported"))}else d(this.database)};+EditorUi.prototype.setDatabaseItem=function(d,g,k,m,t){this.openDatabase(mxUtils.bind(this,function(y){try{t=t||"objects";Array.isArray(t)||(t=[t],d=[d],g=[g]);var z=y.transaction(t,"readwrite");z.oncomplete=k;z.onerror=m;for(y=0;y<t.length;y++)z.objectStore(t[y]).put(null!=d&&null!=d[y]?{key:d[y],data:g[y]}:g[y])}catch(I){null!=m&&m(I)}}),m)};EditorUi.prototype.removeDatabaseItem=function(d,g,k,m){this.openDatabase(mxUtils.bind(this,function(t){try{m=m||"objects";Array.isArray(m)||(m=[m],d=[d]);+var y=t.transaction(m,"readwrite");y.oncomplete=g;y.onerror=k;for(t=0;t<m.length;t++)y.objectStore(m[t]).delete(d[t])}catch(z){null!=k&&k(z)}}),k)};EditorUi.prototype.getDatabaseItem=function(d,g,k,m){this.openDatabase(mxUtils.bind(this,function(t){try{m=m||"objects";var y=t.transaction([m],"readonly").objectStore(m).get(d);y.onsuccess=function(){g(y.result)};y.onerror=k}catch(z){null!=k&&k(z)}}),k)};EditorUi.prototype.getDatabaseItems=function(d,g,k){this.openDatabase(mxUtils.bind(this,function(m){try{k=+k||"objects";var t=m.transaction([k],"readonly").objectStore(k).openCursor(IDBKeyRange.lowerBound(0)),y=[];t.onsuccess=function(z){null==z.target.result?d(y):(y.push(z.target.result.value),z.target.result.continue())};t.onerror=g}catch(z){null!=g&&g(z)}}),g)};EditorUi.prototype.getDatabaseItemKeys=function(d,g,k){this.openDatabase(mxUtils.bind(this,function(m){try{k=k||"objects";var t=m.transaction([k],"readonly").objectStore(k).getAllKeys();t.onsuccess=function(){d(t.result)};t.onerror=g}catch(y){null!=g&&g(y)}}),g)};EditorUi.prototype.commentsSupported=function(){var d=this.getCurrentFile();return null!=d?d.commentsSupported():!1};EditorUi.prototype.commentsRefreshNeeded=function(){var d=this.getCurrentFile();return null!=d?d.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var d=this.getCurrentFile();return null!=d?d.commentsSaveNeeded():!1};EditorUi.prototype.getComments=function(d,g){var k=this.getCurrentFile();null!=k?k.getComments(d,g):d([])};EditorUi.prototype.addComment=function(d,g,k){var m=this.getCurrentFile();null!=m?m.addComment(d,g,k):g(Date.now())};EditorUi.prototype.canReplyToReplies=function(){var d=this.getCurrentFile();return null!=d?d.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var d=this.getCurrentFile();return null!=d?d.canComment():!0};EditorUi.prototype.newComment=function(d,g){var k=this.getCurrentFile();return null!=k?k.newComment(d,g):new DrawioComment(this,null,d,Date.now(),Date.now(),!1,g)};EditorUi.prototype.isRevisionHistorySupported=function(){var d=this.getCurrentFile();return null!=d&&d.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(d,g){var k=this.getCurrentFile();null!=k&&k.getRevisions?k.getRevisions(d,g):g({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var d=this.getCurrentFile();return null!=d&&(d.constructor==DriveFile&&d.isEditable()||d.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.vsdxExportEnabled=-function(){return"atlassian"==this.getServiceName()};EditorUi.prototype.addRemoteServiceSecurityCheck=function(d){d.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(d,g,k,m,t,y,A,I){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(d,g,k,m,t,y,A,I)};EditorUi.prototype.loadFonts=function(d){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(d)};EditorUi.prototype.createSvgDataUri=function(d){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");-return Editor.createSvgDataUri(d)};EditorUi.prototype.embedCssFonts=function(d,g){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(d,g)};EditorUi.prototype.embedExtFonts=function(d){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(d)};EditorUi.prototype.exportToCanvas=function(d,g,k,m,t,y,A,I,F,C,Q,S,V,P,u,x){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(d,g,k,m,t,y,A,I,+function(){return"atlassian"==this.getServiceName()};EditorUi.prototype.addRemoteServiceSecurityCheck=function(d){d.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(d,g,k,m,t,y,z,I){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(d,g,k,m,t,y,z,I)};EditorUi.prototype.loadFonts=function(d){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(d)};EditorUi.prototype.createSvgDataUri=function(d){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");+return Editor.createSvgDataUri(d)};EditorUi.prototype.embedCssFonts=function(d,g){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(d,g)};EditorUi.prototype.embedExtFonts=function(d){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(d)};EditorUi.prototype.exportToCanvas=function(d,g,k,m,t,y,z,I,F,C,Q,S,V,P,u,x){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(d,g,k,m,t,y,z,I,F,C,Q,S,V,P,u,x)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(d,g,k,m){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(d,g,k,m)};EditorUi.prototype.convertImageToDataUri=function(d,g){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(d,g)};EditorUi.prototype.base64Encode=function(d){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(d)};EditorUi.prototype.updateCRC=function(d,g,k,m){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(d,g,k,m)};EditorUi.prototype.crc32=function(d){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(d)};EditorUi.prototype.writeGraphModelToPng=function(d,g,k,m,t){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(d,g,k,m,t)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;for(var d=[],g=0;g<localStorage.length;g++){var k=localStorage.key(g),m=localStorage.getItem(k);if(0<k.length&&(".scratchpad"==k||"."!=k.charAt(0))&&0<m.length){var t="<mxfile "===m.substring(0,8)||"<?xml"===m.substring(0,5)||"\x3c!--[if IE]>"===m.substring(0,12);m="<mxlibrary>"===m.substring(0,11);(t||m)&&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:"<mxlibrary>"===g.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();-var CommentsWindow=function(b,e,f,c,l,p){function q(){for(var x=I.getElementsByTagName("div"),J=0,H=0;H<x.length;H++)"none"!=x[H].style.display&&x[H].parentNode==I&&J++;F.style.display=0==J?"block":"none"}function v(x,J,H,K){function O(){J.removeChild(z);J.removeChild(D);n.style.display="block";M.style.display="block"}t={div:J,comment:x,saveCallback:H,deleteOnCancel:K};var M=J.querySelector(".geCommentTxt"),n=J.querySelector(".geCommentActionsList"),z=document.createElement("textarea");z.className=-"geCommentEditTxtArea";z.style.minHeight=M.offsetHeight+"px";z.value=x.content;J.insertBefore(z,M);var D=document.createElement("div");D.className="geCommentEditBtns";var L=mxUtils.button(mxResources.get("cancel"),function(){K?(J.parentNode.removeChild(J),q()):O();t=null});L.className="geCommentEditBtn";D.appendChild(L);var N=mxUtils.button(mxResources.get("save"),function(){M.innerText="";x.content=z.value;mxUtils.write(M,x.content);O();H(x);t=null});mxEvent.addListener(z,"keydown",mxUtils.bind(this,-function(R){mxEvent.isConsumed(R)||((mxEvent.isControlDown(R)||mxClient.IS_MAC&&mxEvent.isMetaDown(R))&&13==R.keyCode?(N.click(),mxEvent.consume(R)):27==R.keyCode&&(L.click(),mxEvent.consume(R)))}));N.focus();N.className="geCommentEditBtn gePrimaryBtn";D.appendChild(N);J.insertBefore(D,M);n.style.display="none";M.style.display="none";z.focus()}function E(x,J){J.innerText="";x=new Date(x.modifiedDate);var H=b.timeSince(x);null==H&&(H=mxResources.get("lessThanAMinute"));mxUtils.write(J,mxResources.get("timeAgo",-[H],"{1} ago"));J.setAttribute("title",x.toLocaleDateString()+" "+x.toLocaleTimeString())}function G(x){var J=document.createElement("img");J.className="geCommentBusyImg";J.src=IMAGE_PATH+"/spin.gif";x.appendChild(J);x.busyImg=J}function B(x){x.style.border="1px solid red";x.busyImg.parentNode==x&&x.removeChild(x.busyImg)}function d(x){x.style.border="";x.busyImg.parentNode==x&&x.removeChild(x.busyImg)}function g(x,J,H,K,O){function M(U,W,X){var Y=document.createElement("li");Y.className="geCommentAction";-var Z=document.createElement("a");Z.className="geCommentActionLnk";mxUtils.write(Z,U);Y.appendChild(Z);mxEvent.addListener(Z,"click",function(ca){W(ca,x);ca.preventDefault();mxEvent.consume(ca)});T.appendChild(Y);X&&(Y.style.display="none")}function n(){function U(Y){W.push(X);if(null!=Y.replies)for(var Z=0;Z<Y.replies.length;Z++)X=X.nextSibling,U(Y.replies[Z])}var W=[],X=D;U(x);return{pdiv:X,replies:W}}function z(U,W,X,Y,Z){function ca(){G(fa);x.addReply(ba,function(aa){ba.id=aa;x.replies.push(ba);-d(fa);X&&X()},function(aa){ea();B(fa);b.handleError(aa,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},Y,Z)}function ea(){v(ba,fa,function(aa){ca()},!0)}var ja=n().pdiv,ba=b.newComment(U,b.getCurrentUser());ba.pCommentId=x.id;null==x.replies&&(x.replies=[]);var fa=g(ba,x.replies,ja,K+1);W?ea():ca()}if(O||!x.isResolved){F.style.display="none";var D=document.createElement("div");D.className="geCommentContainer";D.setAttribute("data-commentId",x.id);D.style.marginLeft=20*K+5+-"px";x.isResolved&&(y.style.opacity="0.7");var L=document.createElement("div");L.className="geCommentHeader";var N=document.createElement("img");N.className="geCommentUserImg";N.src=null!=x.user&&null!=x.user.pictureUrl?x.user.pictureUrl:Editor.userImage;L.appendChild(N);N=document.createElement("div");N.className="geCommentHeaderTxt";L.appendChild(N);var R=document.createElement("div");R.className="geCommentUsername";mxUtils.write(R,null!=x.user?x.user.displayName:mxResources.get("unknownUser"));-N.appendChild(R);R=document.createElement("div");R.className="geCommentDate";R.setAttribute("data-commentId",x.id);E(x,R);N.appendChild(R);D.appendChild(L);L=document.createElement("div");L.className="geCommentTxt";mxUtils.write(L,x.content||"");D.appendChild(L);x.isLocked&&(D.style.opacity="0.5");L=document.createElement("div");L.className="geCommentActions";var T=document.createElement("ul");T.className="geCommentActionsList";L.appendChild(T);k||x.isLocked||0!=K&&!m||M(mxResources.get("reply"),-function(){z("",!0)},x.isResolved);N=b.getCurrentUser();null==N||null==x.user||N.id!=x.user.id||k||x.isLocked||(M(mxResources.get("edit"),function(){function U(){v(x,D,function(){G(D);x.editComment(x.content,function(){d(D)},function(W){B(D);U();b.handleError(W,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}U()},x.isResolved),M(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){G(D);x.deleteComment(function(U){if(!0===U){U=D.querySelector(".geCommentTxt");-U.innerText="";mxUtils.write(U,mxResources.get("msgDeleted"));var W=D.querySelectorAll(".geCommentAction");for(U=0;U<W.length;U++)W[U].parentNode.removeChild(W[U]);d(D);D.style.opacity="0.5"}else{W=n(x).replies;for(U=0;U<W.length;U++)I.removeChild(W[U]);for(U=0;U<J.length;U++)if(J[U]==x){J.splice(U,1);break}F.style.display=0==I.getElementsByTagName("div").length?"block":"none"}},function(U){B(D);b.handleError(U,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},x.isResolved));-k||x.isLocked||0!=K||M(x.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(U){function W(){var X=U.target;X.innerText="";x.isResolved=!x.isResolved;mxUtils.write(X,x.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var Y=x.isResolved?"none":"",Z=n(x).replies,ca="light-dark("+(x.isResolved?"ghostWhite":"white")+", transparent)",ea=0;ea<Z.length;ea++){Z[ea].style.backgroundColor=ca;for(var ja=Z[ea].querySelectorAll(".geCommentAction"),ba=0;ba<ja.length;ba++)ja[ba]!=-X.parentNode&&(ja[ba].style.display=Y);V||(Z[ea].style.display="none")}q()}x.isResolved?z(mxResources.get("reOpened")+": ",!0,W,!1,!0):z(mxResources.get("markedAsResolved"),!1,W,!0)});D.appendChild(L);null!=H?I.insertBefore(D,H.nextSibling):I.appendChild(D);for(H=0;null!=x.replies&&H<x.replies.length;H++)L=x.replies[H],L.isResolved=x.isResolved,g(L,x.replies,null,K+1,O);null!=t&&(t.comment.id==x.id?(O=x.content,x.content=t.comment.content,v(x,D,t.saveCallback,t.deleteOnCancel),x.content=O):null==-t.comment.id&&t.comment.pCommentId==x.id&&(I.appendChild(t.div),v(t.comment,t.div,t.saveCallback,t.deleteOnCancel)));return D}}var k=!b.canComment(),m=b.canReplyToReplies(),t=null,y=document.createElement("div");y.className="geCommentsWin";var A=EditorUi.compactUi?"26px":"30px",I=document.createElement("div");I.className="geCommentsList";I.style.bottom=parseInt(A)+7+"px";y.appendChild(I);var F=document.createElement("span");F.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(F,-mxResources.get("noCommentsFound"));var C=document.createElement("div");C.className="geToolbarContainer geCommentsToolbar";C.style.height=A;C.style.padding="3px 4px 4px 4px";A=document.createElement("a");A.className="geButton";if(!k){var Q=A.cloneNode();Q.style.backgroundImage="url("+Editor.plusImage+")";Q.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(Q,"click",function(x){function J(){v(H,K,function(O){G(K);b.addComment(O,function(M){O.id=M;P.push(O);d(K)},function(M){B(K);-J();b.handleError(M,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var H=b.newComment("",b.getCurrentUser()),K=g(H,P,null,0);J();x.preventDefault();mxEvent.consume(x)});C.appendChild(Q)}var S=A.cloneNode();S.style.backgroundImage="url("+Editor.checkImage+")";S.setAttribute("title",mxResources.get("showResolved"));var V=!1;mxEvent.addListener(S,"click",function(x){(V=!V)?S.classList.add("geActiveItem"):S.classList.remove("geActiveItem");u();x.preventDefault();mxEvent.consume(x)});-C.appendChild(S);b.commentsRefreshNeeded()&&(Q=A.cloneNode(),Q.style.backgroundImage="url("+Editor.refreshImage+")",Q.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(Q,"click",function(x){u();x.preventDefault();mxEvent.consume(x)}),C.appendChild(Q));b.commentsSaveNeeded()&&(A=A.cloneNode(),A.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',A.setAttribute("title",mxResources.get("save")),A.className="geButton geAdaptiveAsset",mxEvent.addListener(A,-"click",function(x){p();x.preventDefault();mxEvent.consume(x)}),C.appendChild(A));y.appendChild(C);var P=[],u=mxUtils.bind(this,function(){this.hasError=!1;if(null!=t)try{t.div=t.div.cloneNode(!0);var x=t.div.querySelector(".geCommentEditTxtArea"),J=t.div.querySelector(".geCommentEditBtns");t.comment.content=x.value;x.parentNode.removeChild(x);J.parentNode.removeChild(J)}catch(H){b.handleError(H)}I.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+-mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";m=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(H){function K(O){if(null!=O){O.sort(function(n,z){return new Date(n.modifiedDate)-new Date(z.modifiedDate)});for(var M=0;M<O.length;M++)K(O[M].replies)}}H.sort(function(O,M){return new Date(O.modifiedDate)-new Date(M.modifiedDate)});I.innerText="";I.appendChild(F);F.style.display="block";P=H;for(H=0;H<P.length;H++)K(P[H].replies),g(P[H],P,null,0,V);null!=t&&null==t.comment.id&&-null==t.comment.pCommentId&&(I.appendChild(t.div),v(t.comment,t.div,t.saveCallback,t.deleteOnCancel))},mxUtils.bind(this,function(H){I.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(H&&H.message?": "+H.message:""));this.hasError=!0})):I.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});u();this.refreshComments=u;C=mxUtils.bind(this,function(){function x(M){var n=H[M.id];if(null!=n)for(E(M,n),n=0;null!=M.replies&&n<M.replies.length;n++)x(M.replies[n])}if(this.window.isVisible()){for(var J=-I.querySelectorAll(".geCommentDate"),H={},K=0;K<J.length;K++){var O=J[K];H[O.getAttribute("data-commentId")]=O}for(K=0;K<P.length;K++)x(P[K])}});setInterval(C,6E4);this.refreshCommentsTime=C;this.window=new mxWindow(mxResources.get("comments"),y,e,f,c,l,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,-function(){this.window.fit()}));b.installResizeHandler(this,!0)},ConfirmDialog=function(b,e,f,c,l,p,q,v,E,G,B){var d=document.createElement("div");d.style.textAlign="center";B=null!=B?B:44;var g=document.createElement("div");g.style.padding="6px";g.style.overflow="auto";g.style.maxHeight=B+"px";g.style.lineHeight="1.2em";mxUtils.write(g,e);d.appendChild(g);null!=G&&(g=document.createElement("div"),g.style.padding="6px 0 6px 0",e=document.createElement("img"),e.setAttribute("src",G),g.appendChild(e),+var CommentsWindow=function(b,e,f,c,l,p){function q(){for(var x=I.getElementsByTagName("div"),J=0,H=0;H<x.length;H++)"none"!=x[H].style.display&&x[H].parentNode==I&&J++;F.style.display=0==J?"block":"none"}function v(x,J,H,K){function N(){J.removeChild(A);J.removeChild(E);n.style.display="block";M.style.display="block"}t={div:J,comment:x,saveCallback:H,deleteOnCancel:K};var M=J.querySelector(".geCommentTxt"),n=J.querySelector(".geCommentActionsList"),A=document.createElement("textarea");A.className=+"geCommentEditTxtArea";A.style.minHeight=M.offsetHeight+"px";A.value=x.content;J.insertBefore(A,M);var E=document.createElement("div");E.className="geCommentEditBtns";var L=mxUtils.button(mxResources.get("cancel"),function(){K?(J.parentNode.removeChild(J),q()):N();t=null});L.className="geCommentEditBtn";E.appendChild(L);var O=mxUtils.button(mxResources.get("save"),function(){M.innerText="";x.content=A.value;mxUtils.write(M,x.content);N();H(x);t=null});mxEvent.addListener(A,"keydown",mxUtils.bind(this,+function(R){mxEvent.isConsumed(R)||((mxEvent.isControlDown(R)||mxClient.IS_MAC&&mxEvent.isMetaDown(R))&&13==R.keyCode?(O.click(),mxEvent.consume(R)):27==R.keyCode&&(L.click(),mxEvent.consume(R)))}));O.focus();O.className="geCommentEditBtn gePrimaryBtn";E.appendChild(O);J.insertBefore(E,M);n.style.display="none";M.style.display="none";A.focus()}function D(x,J){J.innerText="";x=new Date(x.modifiedDate);var H=b.timeSince(x);null==H&&(H=mxResources.get("lessThanAMinute"));mxUtils.write(J,mxResources.get("timeAgo",+[H],"{1} ago"));J.setAttribute("title",x.toLocaleDateString()+" "+x.toLocaleTimeString())}function G(x){var J=document.createElement("img");J.className="geCommentBusyImg";J.src=IMAGE_PATH+"/spin.gif";x.appendChild(J);x.busyImg=J}function B(x){x.style.border="1px solid red";x.busyImg.parentNode==x&&x.removeChild(x.busyImg)}function d(x){x.style.border="";x.busyImg.parentNode==x&&x.removeChild(x.busyImg)}function g(x,J,H,K,N){function M(U,W,X){var Y=document.createElement("li");Y.className="geCommentAction";+var Z=document.createElement("a");Z.className="geCommentActionLnk";mxUtils.write(Z,U);Y.appendChild(Z);mxEvent.addListener(Z,"click",function(ca){W(ca,x);ca.preventDefault();mxEvent.consume(ca)});T.appendChild(Y);X&&(Y.style.display="none")}function n(){function U(Y){W.push(X);if(null!=Y.replies)for(var Z=0;Z<Y.replies.length;Z++)X=X.nextSibling,U(Y.replies[Z])}var W=[],X=E;U(x);return{pdiv:X,replies:W}}function A(U,W,X,Y,Z){function ca(){G(fa);x.addReply(ba,function(aa){ba.id=aa;x.replies.push(ba);+d(fa);X&&X()},function(aa){ea();B(fa);b.handleError(aa,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},Y,Z)}function ea(){v(ba,fa,function(aa){ca()},!0)}var ia=n().pdiv,ba=b.newComment(U,b.getCurrentUser());ba.pCommentId=x.id;null==x.replies&&(x.replies=[]);var fa=g(ba,x.replies,ia,K+1);W?ea():ca()}if(N||!x.isResolved){F.style.display="none";var E=document.createElement("div");E.className="geCommentContainer";E.setAttribute("data-commentId",x.id);E.style.marginLeft=20*K+5++"px";x.isResolved&&(y.style.opacity="0.7");var L=document.createElement("div");L.className="geCommentHeader";var O=document.createElement("img");O.className="geCommentUserImg";O.src=null!=x.user&&null!=x.user.pictureUrl?x.user.pictureUrl:Editor.userImage;L.appendChild(O);O=document.createElement("div");O.className="geCommentHeaderTxt";L.appendChild(O);var R=document.createElement("div");R.className="geCommentUsername";mxUtils.write(R,null!=x.user?x.user.displayName:mxResources.get("unknownUser"));+O.appendChild(R);R=document.createElement("div");R.className="geCommentDate";R.setAttribute("data-commentId",x.id);D(x,R);O.appendChild(R);E.appendChild(L);L=document.createElement("div");L.className="geCommentTxt";mxUtils.write(L,x.content||"");E.appendChild(L);x.isLocked&&(E.style.opacity="0.5");L=document.createElement("div");L.className="geCommentActions";var T=document.createElement("ul");T.className="geCommentActionsList";L.appendChild(T);k||x.isLocked||0!=K&&!m||M(mxResources.get("reply"),+function(){A("",!0)},x.isResolved);O=b.getCurrentUser();null==O||null==x.user||O.id!=x.user.id||k||x.isLocked||(M(mxResources.get("edit"),function(){function U(){v(x,E,function(){G(E);x.editComment(x.content,function(){d(E)},function(W){B(E);U();b.handleError(W,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}U()},x.isResolved),M(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){G(E);x.deleteComment(function(U){if(!0===U){U=E.querySelector(".geCommentTxt");+U.innerText="";mxUtils.write(U,mxResources.get("msgDeleted"));var W=E.querySelectorAll(".geCommentAction");for(U=0;U<W.length;U++)W[U].parentNode.removeChild(W[U]);d(E);E.style.opacity="0.5"}else{W=n(x).replies;for(U=0;U<W.length;U++)I.removeChild(W[U]);for(U=0;U<J.length;U++)if(J[U]==x){J.splice(U,1);break}F.style.display=0==I.getElementsByTagName("div").length?"block":"none"}},function(U){B(E);b.handleError(U,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},x.isResolved));+k||x.isLocked||0!=K||M(x.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(U){function W(){var X=U.target;X.innerText="";x.isResolved=!x.isResolved;mxUtils.write(X,x.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var Y=x.isResolved?"none":"",Z=n(x).replies,ca="light-dark("+(x.isResolved?"ghostWhite":"white")+", transparent)",ea=0;ea<Z.length;ea++){Z[ea].style.backgroundColor=ca;for(var ia=Z[ea].querySelectorAll(".geCommentAction"),ba=0;ba<ia.length;ba++)ia[ba]!=+X.parentNode&&(ia[ba].style.display=Y);V||(Z[ea].style.display="none")}q()}x.isResolved?A(mxResources.get("reOpened")+": ",!0,W,!1,!0):A(mxResources.get("markedAsResolved"),!1,W,!0)});E.appendChild(L);null!=H?I.insertBefore(E,H.nextSibling):I.appendChild(E);for(H=0;null!=x.replies&&H<x.replies.length;H++)L=x.replies[H],L.isResolved=x.isResolved,g(L,x.replies,null,K+1,N);null!=t&&(t.comment.id==x.id?(N=x.content,x.content=t.comment.content,v(x,E,t.saveCallback,t.deleteOnCancel),x.content=N):null==+t.comment.id&&t.comment.pCommentId==x.id&&(I.appendChild(t.div),v(t.comment,t.div,t.saveCallback,t.deleteOnCancel)));return E}}var k=!b.canComment(),m=b.canReplyToReplies(),t=null,y=document.createElement("div");y.className="geCommentsWin";var z=EditorUi.compactUi?"26px":"30px",I=document.createElement("div");I.className="geCommentsList";I.style.bottom=parseInt(z)+7+"px";y.appendChild(I);var F=document.createElement("span");F.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(F,+mxResources.get("noCommentsFound"));var C=document.createElement("div");C.className="geToolbarContainer geCommentsToolbar";C.style.height=z;C.style.padding="3px 4px 4px 4px";z=document.createElement("a");z.className="geButton";if(!k){var Q=z.cloneNode();Q.style.backgroundImage="url("+Editor.plusImage+")";Q.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(Q,"click",function(x){function J(){v(H,K,function(N){G(K);b.addComment(N,function(M){N.id=M;P.push(N);d(K)},function(M){B(K);+J();b.handleError(M,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var H=b.newComment("",b.getCurrentUser()),K=g(H,P,null,0);J();x.preventDefault();mxEvent.consume(x)});C.appendChild(Q)}var S=z.cloneNode();S.style.backgroundImage="url("+Editor.checkImage+")";S.setAttribute("title",mxResources.get("showResolved"));var V=!1;mxEvent.addListener(S,"click",function(x){(V=!V)?S.classList.add("geActiveItem"):S.classList.remove("geActiveItem");u();x.preventDefault();mxEvent.consume(x)});+C.appendChild(S);b.commentsRefreshNeeded()&&(Q=z.cloneNode(),Q.style.backgroundImage="url("+Editor.refreshImage+")",Q.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(Q,"click",function(x){u();x.preventDefault();mxEvent.consume(x)}),C.appendChild(Q));b.commentsSaveNeeded()&&(z=z.cloneNode(),z.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',z.setAttribute("title",mxResources.get("save")),z.className="geButton geAdaptiveAsset",mxEvent.addListener(z,+"click",function(x){p();x.preventDefault();mxEvent.consume(x)}),C.appendChild(z));y.appendChild(C);var P=[],u=mxUtils.bind(this,function(){this.hasError=!1;if(null!=t)try{t.div=t.div.cloneNode(!0);var x=t.div.querySelector(".geCommentEditTxtArea"),J=t.div.querySelector(".geCommentEditBtns");t.comment.content=x.value;x.parentNode.removeChild(x);J.parentNode.removeChild(J)}catch(H){b.handleError(H)}I.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '++mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";m=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(H){function K(N){if(null!=N){N.sort(function(n,A){return new Date(n.modifiedDate)-new Date(A.modifiedDate)});for(var M=0;M<N.length;M++)K(N[M].replies)}}H.sort(function(N,M){return new Date(N.modifiedDate)-new Date(M.modifiedDate)});I.innerText="";I.appendChild(F);F.style.display="block";P=H;for(H=0;H<P.length;H++)K(P[H].replies),g(P[H],P,null,0,V);null!=t&&null==t.comment.id&&+null==t.comment.pCommentId&&(I.appendChild(t.div),v(t.comment,t.div,t.saveCallback,t.deleteOnCancel))},mxUtils.bind(this,function(H){I.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(H&&H.message?": "+H.message:""));this.hasError=!0})):I.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});u();this.refreshComments=u;C=mxUtils.bind(this,function(){function x(M){var n=H[M.id];if(null!=n)for(D(M,n),n=0;null!=M.replies&&n<M.replies.length;n++)x(M.replies[n])}if(this.window.isVisible()){for(var J=+I.querySelectorAll(".geCommentDate"),H={},K=0;K<J.length;K++){var N=J[K];H[N.getAttribute("data-commentId")]=N}for(K=0;K<P.length;K++)x(P[K])}});setInterval(C,6E4);this.refreshCommentsTime=C;this.window=new mxWindow(mxResources.get("comments"),y,e,f,c,l,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,+function(){this.window.fit()}));b.installResizeHandler(this,!0)},ConfirmDialog=function(b,e,f,c,l,p,q,v,D,G,B){var d=document.createElement("div");d.style.textAlign="center";B=null!=B?B:44;var g=document.createElement("div");g.style.padding="6px";g.style.overflow="auto";g.style.maxHeight=B+"px";g.style.lineHeight="1.2em";mxUtils.write(g,e);d.appendChild(g);null!=G&&(g=document.createElement("div"),g.style.padding="6px 0 6px 0",e=document.createElement("img"),e.setAttribute("src",G),g.appendChild(e),d.appendChild(g));G=document.createElement("div");G.style.textAlign="center";G.style.whiteSpace="nowrap";var k=document.createElement("input");k.setAttribute("type","checkbox");p=mxUtils.button(p||mxResources.get("cancel"),function(){b.hideDialog();null!=c&&c(k.checked)});p.className="geBtn";null!=v&&(p.innerHTML=v+"<br>"+p.innerHTML,p.style.display="inline-block",p.style.paddingBottom="8px",p.style.paddingTop="8px",p.style.height="auto",p.style.width="40%");b.editor.cancelFirst&&G.appendChild(p);-var m=mxUtils.button(l||mxResources.get("ok"),function(){b.hideDialog();null!=f&&f(k.checked)});G.appendChild(m);null!=q?(m.innerHTML=q+"<br>"+m.innerHTML+"<br>",m.style.display="inline-block",m.style.paddingBottom="8px",m.style.paddingTop="8px",m.style.height="auto",m.className="geBtn",m.style.width="40%"):m.className="geBtn gePrimaryBtn";b.editor.cancelFirst||G.appendChild(p);d.appendChild(G);E?(G.style.marginTop="10px",g=document.createElement("p"),g.style.marginTop="20px",g.style.marginBottom=+var m=mxUtils.button(l||mxResources.get("ok"),function(){b.hideDialog();null!=f&&f(k.checked)});G.appendChild(m);null!=q?(m.innerHTML=q+"<br>"+m.innerHTML+"<br>",m.style.display="inline-block",m.style.paddingBottom="8px",m.style.paddingTop="8px",m.style.height="auto",m.className="geBtn",m.style.width="40%"):m.className="geBtn gePrimaryBtn";b.editor.cancelFirst||G.appendChild(p);d.appendChild(G);D?(G.style.marginTop="10px",g=document.createElement("p"),g.style.marginTop="20px",g.style.marginBottom="0px",g.appendChild(k),l=document.createElement("span"),mxUtils.write(l," "+mxResources.get("rememberThisSetting")),g.appendChild(l),d.appendChild(g),mxEvent.addListener(l,"click",function(t){k.checked=!k.checked;mxEvent.consume(t)})):G.style.marginTop="12px";this.init=function(){m.focus()};this.container=d},HeadlessEditorUi=function(){EditorUi.call(this,new Editor(!0),document.createElement("div"),!0)};mxUtils.extend(HeadlessEditorUi,EditorUi);HeadlessEditorUi.prototype.createUi=function(){};HeadlessEditorUi.prototype.addTrees=function(){};HeadlessEditorUi.prototype.onBeforeUnload=function(){};HeadlessEditorUi.prototype.updateActionStates=function(){};EditorUi.DIFF_INSERT="i";EditorUi.DIFF_REMOVE="r";EditorUi.DIFF_UPDATE="u";EditorUi.transientViewStateProperties="defaultParent currentRoot scrollLeft scrollTop scale translate lastPasteXml pasteCounter".split(" ");EditorUi.prototype.viewStateProperties={background:!0,backgroundImage:!0,shadowVisible:!0,foldingEnabled:!0,pageScale:!0,mathEnabled:!0,pageFormat:!0,extFonts:!0};EditorUi.prototype.cellProperties={id:!0,value:!0,xmlValue:!0,vertex:!0,edge:!0,visible:!0,collapsed:!0,connectable:!0,parent:!0,children:!0,previous:!0,source:!0,target:!0,edges:!0,geometry:!0,style:!0,overlays:!0,mxObjectId:!0,mxTransient:!0};EditorUi.prototype.codec=new mxCodec;EditorUi.prototype.applyPatches=function(b,e,f,c,l){if(null!=e)for(var p=0;p<e.length;p++)null!=e[p]&&(b=this.patchPages(b,e[p],f,c,l));return b};-EditorUi.prototype.patchPages=function(b,e,f,c,l){var p={},q=[],v={},E={},G={},B={};if(null!=c&&null!=c[EditorUi.DIFF_UPDATE])for(var d in c[EditorUi.DIFF_UPDATE])p[d]=c[EditorUi.DIFF_UPDATE][d];if(null!=e[EditorUi.DIFF_REMOVE])for(c=0;c<e[EditorUi.DIFF_REMOVE].length;c++)E[e[EditorUi.DIFF_REMOVE][c]]=!0;if(null!=e[EditorUi.DIFF_INSERT])for(c=0;c<e[EditorUi.DIFF_INSERT].length;c++)v[e[EditorUi.DIFF_INSERT][c].previous]=e[EditorUi.DIFF_INSERT][c];if(null!=e[EditorUi.DIFF_UPDATE])for(d in e[EditorUi.DIFF_UPDATE])c=-e[EditorUi.DIFF_UPDATE][d],null!=c.previous&&(B[c.previous]=d);if(null!=b){var g="";for(c=0;c<b.length;c++){var k=b[c].getId();G[k]=b[c];null!=B[g]||E[k]||null!=e[EditorUi.DIFF_UPDATE]&&null!=e[EditorUi.DIFF_UPDATE][k]&&null!=e[EditorUi.DIFF_UPDATE][k].previous||(B[g]=k);g=k}}var m={},t=mxUtils.bind(this,function(A){var I=null!=A?A.getId():"";if(null!=A&&!m[I]){m[I]=!0;q.push(A);var F=null!=e[EditorUi.DIFF_UPDATE]?e[EditorUi.DIFF_UPDATE][I]:null;null!=F&&(this.updatePageRoot(A),null!=F.name&&A.setName(F.name),-null!=F.view&&this.patchViewState(A,F.view),null!=F.cells&&this.patchPage(A,F.cells,p[A.getId()],l),!f||null==F.cells&&null==F.view||(A.needsUpdate=!0))}A=B[I];null!=A&&(delete B[I],t(G[A]));A=v[I];null!=A&&(delete v[I],y(A))}),y=mxUtils.bind(this,function(A){A=mxUtils.parseXml(A.data).documentElement;A=new DiagramPage(A);this.updatePageRoot(A);var I=G[A.getId()];null==I?t(A):(this.patchPage(I,this.diffPages([I],[A]),p[I.getId()],l),f&&(I.needsUpdate=!0))});t();for(d in B)t(G[B[d]]),delete B[d];for(d in v)y(v[d]),+EditorUi.prototype.patchPages=function(b,e,f,c,l){var p={},q=[],v={},D={},G={},B={};if(null!=c&&null!=c[EditorUi.DIFF_UPDATE])for(var d in c[EditorUi.DIFF_UPDATE])p[d]=c[EditorUi.DIFF_UPDATE][d];if(null!=e[EditorUi.DIFF_REMOVE])for(c=0;c<e[EditorUi.DIFF_REMOVE].length;c++)D[e[EditorUi.DIFF_REMOVE][c]]=!0;if(null!=e[EditorUi.DIFF_INSERT])for(c=0;c<e[EditorUi.DIFF_INSERT].length;c++)v[e[EditorUi.DIFF_INSERT][c].previous]=e[EditorUi.DIFF_INSERT][c];if(null!=e[EditorUi.DIFF_UPDATE])for(d in e[EditorUi.DIFF_UPDATE])c=+e[EditorUi.DIFF_UPDATE][d],null!=c.previous&&(B[c.previous]=d);if(null!=b){var g="";for(c=0;c<b.length;c++){var k=b[c].getId();G[k]=b[c];null!=B[g]||D[k]||null!=e[EditorUi.DIFF_UPDATE]&&null!=e[EditorUi.DIFF_UPDATE][k]&&null!=e[EditorUi.DIFF_UPDATE][k].previous||(B[g]=k);g=k}}var m={},t=mxUtils.bind(this,function(z){var I=null!=z?z.getId():"";if(null!=z&&!m[I]){m[I]=!0;q.push(z);var F=null!=e[EditorUi.DIFF_UPDATE]?e[EditorUi.DIFF_UPDATE][I]:null;null!=F&&(this.updatePageRoot(z),null!=F.name&&z.setName(F.name),+null!=F.view&&this.patchViewState(z,F.view),null!=F.cells&&this.patchPage(z,F.cells,p[z.getId()],l),!f||null==F.cells&&null==F.view||(z.needsUpdate=!0))}z=B[I];null!=z&&(delete B[I],t(G[z]));z=v[I];null!=z&&(delete v[I],y(z))}),y=mxUtils.bind(this,function(z){z=mxUtils.parseXml(z.data).documentElement;z=new DiagramPage(z);this.updatePageRoot(z);var I=G[z.getId()];null==I?t(z):(this.patchPage(I,this.diffPages([I],[z]),p[I.getId()],l),f&&(I.needsUpdate=!0))});t();for(d in B)t(G[B[d]]),delete B[d];for(d in v)y(v[d]),delete v[d];return q};EditorUi.prototype.patchViewState=function(b,e){if(null!=b.viewState&&null!=e){b==this.currentPage&&(b.viewState=this.editor.graph.getViewState());for(var f in e)try{this.patchViewStateProperty(b,e,f)}catch(c){}b==this.currentPage&&this.editor.graph.setViewState(b.viewState,!0)}};EditorUi.prototype.patchViewStateProperty=function(b,e,f){b.viewState[f]=JSON.parse(e[f])};-EditorUi.prototype.createParentLookup=function(b,e){function f(G){var B=c[G];null==B&&(B={inserted:[],moved:{}},c[G]=B);return B}var c={};if(null!=e[EditorUi.DIFF_INSERT])for(var l=0;l<e[EditorUi.DIFF_INSERT].length;l++){var p=e[EditorUi.DIFF_INSERT][l],q=null!=p.parent?p.parent:"",v=null!=p.previous?p.previous:"";f(q).inserted[v]=p}if(null!=e[EditorUi.DIFF_UPDATE])for(var E in e[EditorUi.DIFF_UPDATE])p=e[EditorUi.DIFF_UPDATE][E],null!=p.previous&&(q=p.parent,null==q&&(l=b.getCell(E),null!=l&&(l=-b.getParent(l),null!=l&&(q=l.getId()))),null!=q&&(f(q).moved[p.previous]=E));return c};-EditorUi.prototype.patchPage=function(b,e,f,c){var l=b==this.currentPage?this.editor.graph.model:new mxGraphModel(b.root),p=this.createParentLookup(l,e);l.beginUpdate();try{var q=l.updateEdgeParent,v=new mxDictionary,E=[];l.updateEdgeParent=function(y,A){!v.get(y)&&c&&(v.put(y,!0),E.push(y))};var G=p[""],B=null!=G&&null!=G.inserted?G.inserted[""]:null,d=null;null!=B&&(d=this.getCellForJson(B));if(null==d){var g=null!=G&&null!=G.moved?G.moved[""]:null;null!=g&&(d=l.getCell(g))}null!=d&&(l.setRoot(d),+EditorUi.prototype.createParentLookup=function(b,e){function f(G){var B=c[G];null==B&&(B={inserted:[],moved:{}},c[G]=B);return B}var c={};if(null!=e[EditorUi.DIFF_INSERT])for(var l=0;l<e[EditorUi.DIFF_INSERT].length;l++){var p=e[EditorUi.DIFF_INSERT][l],q=null!=p.parent?p.parent:"",v=null!=p.previous?p.previous:"";f(q).inserted[v]=p}if(null!=e[EditorUi.DIFF_UPDATE])for(var D in e[EditorUi.DIFF_UPDATE])p=e[EditorUi.DIFF_UPDATE][D],null!=p.previous&&(q=p.parent,null==q&&(l=b.getCell(D),null!=l&&(l=+b.getParent(l),null!=l&&(q=l.getId()))),null!=q&&(f(q).moved[p.previous]=D));return c};+EditorUi.prototype.patchPage=function(b,e,f,c){var l=b==this.currentPage?this.editor.graph.model:new mxGraphModel(b.root),p=this.createParentLookup(l,e);l.beginUpdate();try{var q=l.updateEdgeParent,v=new mxDictionary,D=[];l.updateEdgeParent=function(y,z){!v.get(y)&&c&&(v.put(y,!0),D.push(y))};var G=p[""],B=null!=G&&null!=G.inserted?G.inserted[""]:null,d=null;null!=B&&(d=this.getCellForJson(B));if(null==d){var g=null!=G&&null!=G.moved?G.moved[""]:null;null!=g&&(d=l.getCell(g))}null!=d&&(l.setRoot(d),b.root=d,EditorUi.debug("EditorUi.patchPage: Root changed",d.id));this.patchCellRecursive(b,l,l.root,p,e);if(null!=e[EditorUi.DIFF_REMOVE])for(var k=0;k<e[EditorUi.DIFF_REMOVE].length;k++){g=e[EditorUi.DIFF_REMOVE][k];var m=l.getCell(g);null!=m&&l.remove(m)}if(null!=e[EditorUi.DIFF_UPDATE]){var t=null!=f&&null!=f.cells?f.cells[EditorUi.DIFF_UPDATE]:null;for(g in e[EditorUi.DIFF_UPDATE])m=l.getCell(g),null!=m?this.patchCell(l,m,e[EditorUi.DIFF_UPDATE][g],null!=t?t[g]:null):EditorUi.debug("EditorUi.patchPage: Updated cell not found",-g,"diff",[e[EditorUi.DIFF_UPDATE][g]])}if(null!=e[EditorUi.DIFF_INSERT])for(k=0;k<e[EditorUi.DIFF_INSERT].length;k++)B=e[EditorUi.DIFF_INSERT][k],m=l.getCell(B.id),null!=m&&(l.setTerminal(m,l.getCell(B.source),!0),l.setTerminal(m,l.getCell(B.target),!1));l.updateEdgeParent=q;if(c&&0<E.length)for(k=0;k<E.length;k++)l.contains(E[k])&&l.updateEdgeParent(E[k])}finally{l.endUpdate()}};-EditorUi.prototype.patchCellRecursive=function(b,e,f,c,l){if(null!=f){var p=c[f.getId()],q=null!=p&&null!=p.inserted?p.inserted:{};p=null!=p&&null!=p.moved?p.moved:{};for(var v=0,E=e.getChildCount(f),G="",B=0;B<E;B++){var d=e.getChildAt(f,B).getId();null==p[G]&&(null==l[EditorUi.DIFF_UPDATE]||null==l[EditorUi.DIFF_UPDATE][d]||null==l[EditorUi.DIFF_UPDATE][d].previous&&null==l[EditorUi.DIFF_UPDATE][d].parent)&&(p[G]=d);G=d}E=mxUtils.bind(this,function(g,k){var m=null!=g?g.getId():"";null==m&&EditorUi.debug("EditorUi.patchCellRecursive: Inserting cell with null id",-"cell",g);null!=g&&k&&(k=e.getCell(m),null!=k&&k!=g&&(g=null));null!=g&&(e.getChildAt(f,v)!=g&&e.add(f,g,v),this.patchCellRecursive(b,e,g,c,l),v++);return m});for(G=[null];0<G.length;)if(B=G.shift(),B=E(null!=B?B.child:null,null!=B?B.insert:!1),d=p[B],null!=d&&(delete p[B],G.push({child:e.getCell(d)})),d=q[B],null!=d&&(delete q[B],G.push({child:this.getCellForJson(d),insert:!0})),0==G.length){for(B in p)G.push({child:e.getCell(p[B])}),delete p[B];for(B in q)G.push({child:this.getCellForJson(q[B]),+g,"diff",[e[EditorUi.DIFF_UPDATE][g]])}if(null!=e[EditorUi.DIFF_INSERT])for(k=0;k<e[EditorUi.DIFF_INSERT].length;k++)B=e[EditorUi.DIFF_INSERT][k],m=l.getCell(B.id),null!=m&&(l.setTerminal(m,l.getCell(B.source),!0),l.setTerminal(m,l.getCell(B.target),!1));l.updateEdgeParent=q;if(c&&0<D.length)for(k=0;k<D.length;k++)l.contains(D[k])&&l.updateEdgeParent(D[k])}finally{l.endUpdate()}};+EditorUi.prototype.patchCellRecursive=function(b,e,f,c,l){if(null!=f){var p=c[f.getId()],q=null!=p&&null!=p.inserted?p.inserted:{};p=null!=p&&null!=p.moved?p.moved:{};for(var v=0,D=e.getChildCount(f),G="",B=0;B<D;B++){var d=e.getChildAt(f,B).getId();null==p[G]&&(null==l[EditorUi.DIFF_UPDATE]||null==l[EditorUi.DIFF_UPDATE][d]||null==l[EditorUi.DIFF_UPDATE][d].previous&&null==l[EditorUi.DIFF_UPDATE][d].parent)&&(p[G]=d);G=d}D=mxUtils.bind(this,function(g,k){var m=null!=g?g.getId():"";null==m&&EditorUi.debug("EditorUi.patchCellRecursive: Inserting cell with null id",+"cell",g);null!=g&&k&&(k=e.getCell(m),null!=k&&k!=g&&(g=null));null!=g&&(e.getChildAt(f,v)!=g&&e.add(f,g,v),this.patchCellRecursive(b,e,g,c,l),v++);return m});for(G=[null];0<G.length;)if(B=G.shift(),B=D(null!=B?B.child:null,null!=B?B.insert:!1),d=p[B],null!=d&&(delete p[B],G.push({child:e.getCell(d)})),d=q[B],null!=d&&(delete q[B],G.push({child:this.getCellForJson(d),insert:!0})),0==G.length){for(B in p)G.push({child:e.getCell(p[B])}),delete p[B];for(B in q)G.push({child:this.getCellForJson(q[B]),insert:!0}),delete q[B]}}};EditorUi.prototype.patchCell=function(b,e,f,c){if(null!=e&&null!=f){if(null==c||null==c.xmlValue&&(null==c.value||""==c.value))"value"in f?b.setValue(e,f.value):null!=f.xmlValue&&b.setValue(e,mxUtils.parseXml(f.xmlValue).documentElement);null!=c&&null!=c.style||null==f.style||b.setStyle(e,f.style);null!=f.visible&&b.setVisible(e,1==f.visible);null!=f.collapsed&&b.setCollapsed(e,1==f.collapsed);null!=f.vertex&&(e.vertex=1==f.vertex);null!=f.edge&&(e.edge=1==f.edge);null!=f.connectable&&(e.connectable=1==f.connectable);null!=f.geometry&&b.setGeometry(e,this.codec.decode(mxUtils.parseXml(f.geometry).documentElement));null!=f.source&&b.setTerminal(e,b.getCell(f.source),!0);null!=f.target&&b.setTerminal(e,b.getCell(f.target),!1);for(var l in f)this.cellProperties[l]||(e[l]=f[l])}};EditorUi.prototype.getXmlForPages=function(b){b=this.getNodeForPages(b);var e=null;null!=b&&(e=mxUtils.getXml(b));return e};EditorUi.prototype.getNodeForPages=function(b){var e=null;if(null!=this.fileNode&&null!=b){e=this.fileNode.cloneNode(!1);for(var f=0;f<b.length;f++){var c=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b[f].root));this.editor.graph.saveViewState(b[f].viewState,c);var l=b[f].node.cloneNode(!1);l.appendChild(c);e.appendChild(l)}}return e};EditorUi.prototype.getPagesForXml=function(b){b=mxUtils.parseXml(b);return this.getPagesForNode(b.documentElement)};EditorUi.prototype.getPagesForNode=function(b,e){var f=this.editor.extractGraphModel(b,!0,!0);null!=f&&(b=f);e=b.getElementsByTagName(e||"diagram");f=[];if(0<e.length)for(b=0;b<e.length;b++){var c=new DiagramPage(e[b]);this.updatePageRoot(c,!0);f.push(c)}else"mxGraphModel"==b.nodeName&&(c=new DiagramPage(b.ownerDocument.createElement("diagram")),c.setName(mxResources.get("pageWithNumber",[1])),c.node.appendChild(b.cloneNode(!0)),f.push(c));return f};-EditorUi.prototype.diffPages=function(b,e){var f=[],c=[],l={},p={},q={},v=null;if(null!=b&&null!=e){for(var E=0;E<e.length;E++)p[e[E].getId()]={page:e[E],prev:v},v=e[E];v=null;for(E=0;E<b.length;E++){var G=b[E].getId();e=p[G];if(null==e)c.push(G);else{this.updatePageRoot(b[E]);this.updatePageRoot(e.page);var B=this.diffCells(b[E].root,e.page.root),d={};mxUtils.isEmptyObject(B)||(d.cells=B);B=this.diffViewState(b[E],e.page);mxUtils.isEmptyObject(B)||(d.view=B);if((null!=e.prev?null==v:null!=v)||null!=-v&&null!=e.prev&&v.getId()!=e.prev.getId())d.previous=null!=e.prev?e.prev.getId():"";null!=e.page.getName()&&b[E].getName()!=e.page.getName()&&(d.name=e.page.getName());mxUtils.isEmptyObject(d)||(q[G]=d)}delete p[b[E].getId()];v=b[E]}for(G in p)e=p[G],f.push({id:e.page.getId(),data:mxUtils.getXml(e.page.node),previous:null!=e.prev?e.prev.getId():""});mxUtils.isEmptyObject(q)||(l[EditorUi.DIFF_UPDATE]=q);0<c.length&&(l[EditorUi.DIFF_REMOVE]=c);0<f.length&&(l[EditorUi.DIFF_INSERT]=f)}return l};+EditorUi.prototype.diffPages=function(b,e){var f=[],c=[],l={},p={},q={},v=null;if(null!=b&&null!=e){for(var D=0;D<e.length;D++)p[e[D].getId()]={page:e[D],prev:v},v=e[D];v=null;for(D=0;D<b.length;D++){var G=b[D].getId();e=p[G];if(null==e)c.push(G);else{this.updatePageRoot(b[D]);this.updatePageRoot(e.page);var B=this.diffCells(b[D].root,e.page.root),d={};mxUtils.isEmptyObject(B)||(d.cells=B);B=this.diffViewState(b[D],e.page);mxUtils.isEmptyObject(B)||(d.view=B);if((null!=e.prev?null==v:null!=v)||null!=+v&&null!=e.prev&&v.getId()!=e.prev.getId())d.previous=null!=e.prev?e.prev.getId():"";null!=e.page.getName()&&b[D].getName()!=e.page.getName()&&(d.name=e.page.getName());mxUtils.isEmptyObject(d)||(q[G]=d)}delete p[b[D].getId()];v=b[D]}for(G in p)e=p[G],f.push({id:e.page.getId(),data:mxUtils.getXml(e.page.node),previous:null!=e.prev?e.prev.getId():""});mxUtils.isEmptyObject(q)||(l[EditorUi.DIFF_UPDATE]=q);0<c.length&&(l[EditorUi.DIFF_REMOVE]=c);0<f.length&&(l[EditorUi.DIFF_INSERT]=f)}return l};EditorUi.prototype.createCellLookup=function(b,e,f){f=null!=f?f:{};null==b.getId()?EditorUi.debug("EditorUi.createCellLookup: Ignored inserted cell with no id",b):f[b.getId()]={cell:b,prev:e};var c=b.getChildCount();e=null;for(var l=0;l<c;l++){var p=b.getChildAt(l);this.createCellLookup(p,e,f);e=p}return f};EditorUi.prototype.diffCellRecursive=function(b,e,f,c,l){c=null!=c?c:{};var p=f[b.getId()];delete f[b.getId()];if(null==p)null==b.getId()?EditorUi.debug("EditorUi.diffCellRecursive: Ignored removed cell with no id",b):l.push(b.getId());else{var q=this.diffCell(b,p.cell);if(null!=q.parent||(null!=p.prev?null==e:null!=e)||null!=e&&null!=p.prev&&e.getId()!=p.prev.getId())q.previous=null!=p.prev?p.prev.getId():"";mxUtils.isEmptyObject(q)||(null==b.getId()?EditorUi.debug("EditorUi.diffCellRecursive: Ignored changed cell with no id",b,"diff",q):c[b.getId()]=q)}p=b.getChildCount();e=null;for(q=0;q<p;q++){var v=b.getChildAt(q);this.diffCellRecursive(v,e,f,c,l);e=v}return c};@@ -13601,8 +13605,8 @@ DrawioFileSync.prototype.patchRealtime=function(b,e,f,c){var l=null;if(this.file"all",l,"local",p,"applied",q,"immediate",c)}return l};DrawioFileSync.prototype.isRealtimeActive=function(){return this.ui.editor.autosave};DrawioFileSync.prototype.sendLocalChanges=function(){try{if(this.file.isRealtime()&&this.localFileWasChanged){var b=this.ui.clonePages(this.ui.pages),e=this.ui.diffPages(this.snapshot,b);this.file.ownPages=this.ui.patchPages(this.file.ownPages,e,!0);this.snapshot=b;var f=this.ui.resolveCrossReferences(e,this.ui.diffPages(this.file.ownPages,this.ui.pages));this.file.ownPages=this.ui.patchPages(this.file.ownPages,f,!0);this.isRealtimeActive()&&this.doSendLocalChanges([f,e])}this.localFileWasChanged=!1}catch(c){b=this.file.getCurrentUser(),b=null!=b?b.id:"unknown",EditorUi.logError("Error in sendLocalChanges",null,this.file.getMode()+"."+this.file.getId(),b,c)}};DrawioFileSync.prototype.doReceiveRemoteChanges=function(b){this.file.isRealtime()&&this.isRealtimeActive()&&(this.sendLocalChanges(),this.file.patch(b),this.file.theirPages=this.ui.applyPatches(this.file.theirPages,b),this.scheduleCleanup(),EditorUi.debug("DrawioFileSync.doReceiveRemoteChanges",[this],"changes",b))};-DrawioFileSync.prototype.merge=function(b,e,f,c,l,p,q){try{this.file.stats.merged++;this.lastModified=new Date;var v=this.file.getDescriptorRevisionId(f);if(!this.file.ignorePatches(b)){this.sendLocalChanges();var E=this.ui.clonePages(this.file.getShadowPages()),G=this.file.isModified()&&!this.file.isRealtime()?this.ui.diffPages(E,this.ui.pages):null,B=this.file.isRealtime()?this.ui.diffPages(E,this.file.ownPages):null;E=this.ui.applyPatches(E,b);var d=null==e?null:this.ui.getHashValueForPages(E);-EditorUi.debug("DrawioFileSync.merge",[this],"patches",b,"changes",G,"pending",B,"checksum",e,"current",d,"valid",e==d,"attempt",this.catchupRetryCount,"of",this.maxCatchupRetries,"from",this.file.getCurrentRevisionId(),"to",v,"etag",this.file.getDescriptorEtag(f),"immediate",q);if(null!=e&&e!=d){this.reload(mxUtils.bind(this,function(){null!=c&&c()}),mxUtils.bind(this,function(){null!=l&&l()}),p,null,q);return}this.file.setShadowPages(E);null==this.patchRealtime(b,null,B,q)&&this.file.patch(b,DrawioFile.LAST_WRITE_WINS?+DrawioFileSync.prototype.merge=function(b,e,f,c,l,p,q){try{this.file.stats.merged++;this.lastModified=new Date;var v=this.file.getDescriptorRevisionId(f);if(!this.file.ignorePatches(b)){this.sendLocalChanges();var D=this.ui.clonePages(this.file.getShadowPages()),G=this.file.isModified()&&!this.file.isRealtime()?this.ui.diffPages(D,this.ui.pages):null,B=this.file.isRealtime()?this.ui.diffPages(D,this.file.ownPages):null;D=this.ui.applyPatches(D,b);var d=null==e?null:this.ui.getHashValueForPages(D);+EditorUi.debug("DrawioFileSync.merge",[this],"patches",b,"changes",G,"pending",B,"checksum",e,"current",d,"valid",e==d,"attempt",this.catchupRetryCount,"of",this.maxCatchupRetries,"from",this.file.getCurrentRevisionId(),"to",v,"etag",this.file.getDescriptorEtag(f),"immediate",q);if(null!=e&&e!=d){this.reload(mxUtils.bind(this,function(){null!=c&&c()}),mxUtils.bind(this,function(){null!=l&&l()}),p,null,q);return}this.file.setShadowPages(D);null==this.patchRealtime(b,null,B,q)&&this.file.patch(b,DrawioFile.LAST_WRITE_WINS?G:null)}this.file.invalidChecksum=!1;this.file.inConflictState=!1;this.file.patchDescriptor(this.file.getDescriptor(),f);null!=c&&c(!0)}catch(m){this.file.inConflictState=!0;this.file.invalidChecksum=!0;this.file.descriptorChanged();null!=l&&l(m);try{var g=this.file.getCurrentUser(),k=null!=g?g.id:"unknown";EditorUi.logError("Error in merge",null,this.file.getMode()+"."+this.file.getId(),k,m)}catch(t){}}};DrawioFileSync.prototype.fileChanged=function(b,e,f,c,l){var p=window.setTimeout(mxUtils.bind(this,function(){null!=f&&f()||(EditorUi.debug("DrawioFileSync.fileChanged",[this],"lazy",c,"immediate",l,"remoteFileChanged",this.remoteFileChanged,"valid",this.isValidState()),this.isValidState()?(this.remoteFileChanged=!1,this.file.loadPatchDescriptor(mxUtils.bind(this,function(q){null!=f&&f()||(this.isValidState()?this.catchup(q,b,e,f,l):null!=e&&e())}),e)):null!=e&&e())}),c?this.cacheReadyDelay:0);return this.notifyThread=p};@@ -13611,19 +13615,19 @@ this.cleanupThread=null;"1"==urlParams.test&&EditorUi.debug("DrawioFileSync.fastDrawioFileSync.prototype.reloadDescriptor=function(){this.file.loadDescriptor(mxUtils.bind(this,function(b){null!=b?(this.file.setDescriptorRevisionId(b,this.file.getCurrentRevisionId()),this.updateDescriptor(b),this.fileChangedNotify()):(this.file.inConflictState=!0,this.file.handleFileError())}),mxUtils.bind(this,function(b){this.file.inConflictState=!0;this.file.handleFileError(b)}))};DrawioFileSync.prototype.updateDescriptor=function(b){this.file.setDescriptor(b);this.file.descriptorChanged();this.start()};DrawioFileSync.prototype.catchup=function(b,e,f,c,l){if(null!=b&&(null==c||!c())){var p=this.file.getCurrentRevisionId(),q=this.file.getDescriptorRevisionId(b);EditorUi.debug("DrawioFileSync.catchup",[this],"desc",[b],"from",p,"to",q,"immediate",l,"valid",this.isValidState());if(p==q)this.file.patchDescriptor(this.file.getDescriptor(),b),"1"==urlParams.test&&EditorUi.debug("DrawioFileSync.catchup",[this],"up to date","cleanup",this.cleanupThread,"checksum",this.ui.getHashValueForPages(this.ui.pages)),-document.hidden||"1"!=urlParams.test||"1"!=urlParams.checksum||null!=this.cleanupThread||this.testChecksum(),null!=e&&e(!0);else if(this.isValidState()){var v=this.file.getDescriptorChecksum(b),E=this.file.getDescriptorSecret(b);if(null!=v&&v==this.ui.getHashValueForPages(this.ui.pages))this.fastForward(b),null!=e&&e(!0);else if(Editor.enableRealtimeCache&&null!=E&&"1"!=urlParams.lockdown){var G=0,B=!1,d=mxUtils.bind(this,function(){if(null==c||!c())if(p!=this.file.getCurrentRevisionId())null!=e&&-e(!0);else if(this.isValidState()){this.scheduleCleanup(!0);var g=!0,k=window.setTimeout(mxUtils.bind(this,function(){g=!1;this.reload(e,f,c,null,l)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(p)+"&to="+encodeURIComponent(q)+(null!=E?"&secret="+encodeURIComponent(E):""),mxUtils.bind(this,function(m){this.file.stats.bytesReceived+=m.getText().length;window.clearTimeout(k);if(g&&(null==c||!c()))if(p!=this.file.getCurrentRevisionId())null!=-e&&e(!0);else if(this.isValidState()){var t=null,y=[];EditorUi.debug("DrawioFileSync.doCatchup",[this],"request",[m],"status",m.getStatus(),"cacheReadyRetryCount",G,"maxCacheReadyRetries",this.maxCacheReadyRetries);if(200<=m.getStatus()&&299>=m.getStatus()&&0<m.getText().length)try{var A=JSON.parse(m.getText());if(null!=A&&0<A.length)for(var I=0;I<A.length;I++){var F=this.stringToObject(A[I]);if(F.v>DrawioFileSync.PROTOCOL){B=!0;y=[];break}else if(F.v===DrawioFileSync.PROTOCOL&&null!=F.d)t=F.d.checksum,-y.push(F.d.patch);else{B=!0;y=[];break}}EditorUi.debug("DrawioFileSync.doCatchup",[this],"response",[A],"status",B?"failed":"ok","temp",y,"checksum",t)}catch(C){y=[],null!=window.console&&"1"==urlParams.test&&console.log(C)}try{0<y.length?(this.file.stats.cacheHits++,this.merge(y,t,b,e,f,c,l)):G<=this.maxCacheReadyRetries-1&&!B&&401!=m.getStatus()&&503!=m.getStatus()&&410!=m.getStatus()?(G++,this.file.stats.cacheMiss++,window.setTimeout(d,(G+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,+document.hidden||"1"!=urlParams.test||"1"!=urlParams.checksum||null!=this.cleanupThread||this.testChecksum(),null!=e&&e(!0);else if(this.isValidState()){var v=this.file.getDescriptorChecksum(b),D=this.file.getDescriptorSecret(b);if(null!=v&&v==this.ui.getHashValueForPages(this.ui.pages))this.fastForward(b),null!=e&&e(!0);else if(Editor.enableRealtimeCache&&null!=D&&"1"!=urlParams.lockdown){var G=0,B=!1,d=mxUtils.bind(this,function(){if(null==c||!c())if(p!=this.file.getCurrentRevisionId())null!=e&&+e(!0);else if(this.isValidState()){this.scheduleCleanup(!0);var g=!0,k=window.setTimeout(mxUtils.bind(this,function(){g=!1;this.reload(e,f,c,null,l)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(p)+"&to="+encodeURIComponent(q)+(null!=D?"&secret="+encodeURIComponent(D):""),mxUtils.bind(this,function(m){this.file.stats.bytesReceived+=m.getText().length;window.clearTimeout(k);if(g&&(null==c||!c()))if(p!=this.file.getCurrentRevisionId())null!=+e&&e(!0);else if(this.isValidState()){var t=null,y=[];EditorUi.debug("DrawioFileSync.doCatchup",[this],"request",[m],"status",m.getStatus(),"cacheReadyRetryCount",G,"maxCacheReadyRetries",this.maxCacheReadyRetries);if(200<=m.getStatus()&&299>=m.getStatus()&&0<m.getText().length)try{var z=JSON.parse(m.getText());if(null!=z&&0<z.length)for(var I=0;I<z.length;I++){var F=this.stringToObject(z[I]);if(F.v>DrawioFileSync.PROTOCOL){B=!0;y=[];break}else if(F.v===DrawioFileSync.PROTOCOL&&null!=F.d)t=F.d.checksum,+y.push(F.d.patch);else{B=!0;y=[];break}}EditorUi.debug("DrawioFileSync.doCatchup",[this],"response",[z],"status",B?"failed":"ok","temp",y,"checksum",t)}catch(C){y=[],null!=window.console&&"1"==urlParams.test&&console.log(C)}try{0<y.length?(this.file.stats.cacheHits++,this.merge(y,t,b,e,f,c,l)):G<=this.maxCacheReadyRetries-1&&!B&&401!=m.getStatus()&&503!=m.getStatus()&&410!=m.getStatus()?(G++,this.file.stats.cacheMiss++,window.setTimeout(d,(G+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,this.reload(e,f,c,null,l))}catch(C){null!=f&&f(C)}}else null!=f&&f()}),f)}else null!=f&&f()});window.setTimeout(d,this.cacheReadyDelay)}else this.reload(e,f,c,null,l)}else null!=f&&f()}};DrawioFileSync.prototype.reload=function(b,e,f,c,l){EditorUi.debug("DrawioFileSync.reload",[this],"immediate",l);this.file.updateFile(mxUtils.bind(this,function(){this.lastModified=this.file.getLastModifiedDate();this.updateStatus();this.start();null!=b&&b()}),mxUtils.bind(this,function(p){null!=e&&e(p)}),f,c,l)};DrawioFileSync.prototype.descriptorChanged=function(b){this.lastModified=this.file.getLastModifiedDate();if(null!=this.channelId){var e=this.objectToString(this.createMessage({a:"desc",m:this.lastModified.getTime()})),f=this.file.getCurrentRevisionId(),c=this.objectToString({});mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(b)+"&to="+encodeURIComponent(f)+"&msg="+encodeURIComponent(e)+"&data="+encodeURIComponent(c));this.file.stats.bytesSent+=c.length;this.file.stats.msgSent++;EditorUi.debug("DrawioFileSync.descriptorChanged",[this],"from",b,"to",f)}this.updateStatus()};DrawioFileSync.prototype.objectToString=function(b){b=Graph.compress(JSON.stringify(b));null!=this.key&&"undefined"!==typeof CryptoJS&&(b=CryptoJS.AES.encrypt(b,this.key).toString());return b};DrawioFileSync.prototype.stringToObject=function(b){null!=this.key&&"undefined"!==typeof CryptoJS&&(b=CryptoJS.AES.decrypt(b,this.key).toString(CryptoJS.enc.Utf8));return JSON.parse(Graph.decompress(b))};DrawioFileSync.prototype.createToken=function(b,e,f){var c=!0,l=window.setTimeout(mxUtils.bind(this,function(){c=!1;f({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&secret="+encodeURIComponent(b),mxUtils.bind(this,function(p){window.clearTimeout(l);c&&(200<=p.getStatus()&&299>=p.getStatus()?e(p.getText()):f({code:p.getStatus(),message:"Token Error "+p.getStatus()}))}),f)};DrawioFileSync.prototype.fileSaving=function(){this.file.isOptimisticSync()&&this.notify(this.createMessage({m:Date.now(),type:"optimistic"}));EditorUi.debug("DrawioFileSync.fileSaving",[this],"optimistic",this.file.isOptimisticSync())};DrawioFileSync.prototype.fileDataUpdated=function(){this.scheduleCleanup(!0);EditorUi.debug("DrawioFileSync.fileDataUpdated",[this])};-DrawioFileSync.prototype.fileSaved=function(b,e,f,c,l,p){this.lastModified=this.file.getLastModifiedDate();this.resetUpdateStatusThread();this.catchupRetryCount=0;if(!this.ui.isOffline(!0)&&!this.file.inConflictState&&!this.file.redirectDialogShowing&&(this.start(),null!=this.channelId)){var q=this.file.getDescriptorSecret(this.file.getDescriptor()),v=this.createMessage({m:this.lastModified.getTime()}),E=this.file.getDescriptorRevisionId(e),G=this.file.getCurrentRevisionId();if(null!=q&&null!=l&&+DrawioFileSync.prototype.fileSaved=function(b,e,f,c,l,p){this.lastModified=this.file.getLastModifiedDate();this.resetUpdateStatusThread();this.catchupRetryCount=0;if(!this.ui.isOffline(!0)&&!this.file.inConflictState&&!this.file.redirectDialogShowing&&(this.start(),null!=this.channelId)){var q=this.file.getDescriptorSecret(this.file.getDescriptor()),v=this.createMessage({m:this.lastModified.getTime()}),D=this.file.getDescriptorRevisionId(e),G=this.file.getCurrentRevisionId();if(null!=q&&null!=l&&"1"!=urlParams.lockdown&&Editor.enableRealtimeCache){var B=this.ui.diffPages(this.file.getShadowPages(),b);e=this.file.getDescriptorSecret(e);p=null!=p?p:this.ui.getHashValueForPages(b);var d=this.objectToString(this.createMessage({patch:B,checksum:p}));this.file.stats.bytesSent+=d.length;this.file.stats.msgSent++;var g=!0,k=window.setTimeout(mxUtils.bind(this,function(){g=!1;c({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout);mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+-"&from="+encodeURIComponent(E)+"&to="+encodeURIComponent(G)+(Editor.p2pSyncNotify?"":"&msg="+encodeURIComponent(this.objectToString(v)))+(null!=q?"&secret="+encodeURIComponent(q):"")+(null!=e?"&last-secret="+encodeURIComponent(e):"")+(d.length<this.maxCacheEntrySize?"&data="+encodeURIComponent(d):"")+(null!=l?"&token="+encodeURIComponent(l):""),mxUtils.bind(this,function(m){window.clearTimeout(k);g&&(200<=m.getStatus()&&299>=m.getStatus()?(Editor.p2pSyncNotify&&this.notify(v),null!=f&&f()):c({message:mxResources.get("realtimeCollaboration")+-(0!=m.getStatus()?": "+m.getStatus():"")}))}));EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",E,"to",G,"etag",this.file.getCurrentEtag(),"diff",B,d.length,"bytes","msg",v,"checksum",p)}else this.notify(v),null!=f&&f(),EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",E,"to",G,"etag",this.file.getCurrentEtag())}this.file.setShadowPages(b);this.scheduleCleanup()};+"&from="+encodeURIComponent(D)+"&to="+encodeURIComponent(G)+(Editor.p2pSyncNotify?"":"&msg="+encodeURIComponent(this.objectToString(v)))+(null!=q?"&secret="+encodeURIComponent(q):"")+(null!=e?"&last-secret="+encodeURIComponent(e):"")+(d.length<this.maxCacheEntrySize?"&data="+encodeURIComponent(d):"")+(null!=l?"&token="+encodeURIComponent(l):""),mxUtils.bind(this,function(m){window.clearTimeout(k);g&&(200<=m.getStatus()&&299>=m.getStatus()?(Editor.p2pSyncNotify&&this.notify(v),null!=f&&f()):c({message:mxResources.get("realtimeCollaboration")++(0!=m.getStatus()?": "+m.getStatus():"")}))}));EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",D,"to",G,"etag",this.file.getCurrentEtag(),"diff",B,d.length,"bytes","msg",v,"checksum",p)}else this.notify(v),null!=f&&f(),EditorUi.debug("DrawioFileSync.fileSaved",[this],"from",D,"to",G,"etag",this.file.getCurrentEtag())}this.file.setShadowPages(b);this.scheduleCleanup()};DrawioFileSync.prototype.getIdParameters=function(){var b="id="+this.channelId;null!=this.pusher&&null!=this.pusher.connection&&null!=this.pusher.connection.socket_id&&(b+="&sid="+this.pusher.connection.socket_id);return b};DrawioFileSync.prototype.createMessage=function(b){return{v:DrawioFileSync.PROTOCOL,d:b,c:this.clientId}};DrawioFileSync.prototype.fileConflict=function(b,e,f){this.catchupRetryCount++;EditorUi.debug("DrawioFileSync.fileConflict",[this],"desc",[b],"catchupRetryCount",this.catchupRetryCount,"maxCatchupRetries",this.maxCatchupRetries);this.catchupRetryCount<this.maxCatchupRetries?(this.file.stats.conflicts++,null!=b?this.catchup(b,e,f):this.fileChanged(e,f)):(this.file.stats.timeouts++,this.catchupRetryCount=0,null!=f&&f({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")}))};DrawioFileSync.prototype.stop=function(){null!=this.pusher?(null!=this.pusher.connection&&(this.pusher.connection.unbind("state_change",this.connectionListener),this.pusher.connection.unbind("error",this.pusherErrorListener)),null!=this.channel&&(this.channel.unbind("changed",this.changeListener),this.channel=null),this.pusher.disconnect(),this.pusher=null,null!=this.p2pCollab&&(this.p2pCollab.destroy(),this.p2pCollab=null),EditorUi.debug("DrawioFileSync.stop",[this])):null!=this.polling&&(this.polling.stop(),@@ -13636,12 +13640,12 @@ mxAsyncCanvas.prototype.decWaitCounter=function(){this.waitCounter--;0==this.waimxAsyncCanvas.prototype.setAlpha=function(b){this.state.alpha=b};mxAsyncCanvas.prototype.setFontColor=function(b){this.state.fontColor=b};mxAsyncCanvas.prototype.setFontBackgroundColor=function(b){b==mxConstants.NONE&&(b=null);this.state.fontBackgroundColor=b};mxAsyncCanvas.prototype.setFontBorderColor=function(b){b==mxConstants.NONE&&(b=null);this.state.fontBorderColor=b};mxAsyncCanvas.prototype.setFontSize=function(b){this.state.fontSize=b};mxAsyncCanvas.prototype.setFontFamily=function(b){this.state.fontFamily=b};mxAsyncCanvas.prototype.setFontStyle=function(b){this.state.fontStyle=b};mxAsyncCanvas.prototype.rect=function(b,e,f,c){};mxAsyncCanvas.prototype.roundrect=function(b,e,f,c,l,p){};mxAsyncCanvas.prototype.ellipse=function(b,e,f,c){};mxAsyncCanvas.prototype.rewriteImageSource=function(b){if("http://"==b.substring(0,7)||"https://"==b.substring(0,8))b="/proxy?url="+encodeURIComponent(b);return b};mxAsyncCanvas.prototype.image=function(b,e,f,c,l,p,q,v){l=this.rewriteImageSource(l);b=this.htmlCanvas.images[l];null==b&&(b=new Image,b.onload=mxUtils.bind(this,function(){this.decWaitCounter()}),b.onerror=mxUtils.bind(this,function(){this.decWaitCounter()}),this.incWaitCounter(),this.htmlCanvas.images[l]=b,b.src=l)};mxAsyncCanvas.prototype.fill=function(){};mxAsyncCanvas.prototype.stroke=function(){};mxAsyncCanvas.prototype.fillAndStroke=function(){};-mxAsyncCanvas.prototype.text=function(b,e,f,c,l,p,q,v,E,G,B,d){if(null!=l&&0!=l.length&&(b=this.state.scale,"html"==E&&"function"===typeof html2canvas)){this.incWaitCounter();var g=this.canvasIndex++;html2canvas(l,{onrendered:mxUtils.bind(this,function(k){this.htmlCanvas.subCanvas[g]=k;this.decWaitCounter()}),scale:b,logging:!0})}};mxAsyncCanvas.prototype.finish=function(b){0==this.waitCounter?b():this.onComplete=b};function mxJsCanvas(b){mxAbstractCanvas2D.call(this);this.ctx=b.getContext("2d");this.ctx.textBaseline="top";this.ctx.fillStyle="rgba(255,255,255,0)";this.ctx.strokeStyle="rgba(0, 0, 0, 0)";this.M_RAD_PER_DEG=Math.PI/180;this.images=null==this.images?[]:this.images;this.subCanvas=null==this.subCanvas?[]:this.subCanvas}mxUtils.extend(mxJsCanvas,mxAbstractCanvas2D);mxJsCanvas.prototype.ctx=null;mxJsCanvas.prototype.waitCounter=0;mxJsCanvas.prototype.onComplete=null;mxJsCanvas.prototype.images=null;+mxAsyncCanvas.prototype.text=function(b,e,f,c,l,p,q,v,D,G,B,d){if(null!=l&&0!=l.length&&(b=this.state.scale,"html"==D&&"function"===typeof html2canvas)){this.incWaitCounter();var g=this.canvasIndex++;html2canvas(l,{onrendered:mxUtils.bind(this,function(k){this.htmlCanvas.subCanvas[g]=k;this.decWaitCounter()}),scale:b,logging:!0})}};mxAsyncCanvas.prototype.finish=function(b){0==this.waitCounter?b():this.onComplete=b};function mxJsCanvas(b){mxAbstractCanvas2D.call(this);this.ctx=b.getContext("2d");this.ctx.textBaseline="top";this.ctx.fillStyle="rgba(255,255,255,0)";this.ctx.strokeStyle="rgba(0, 0, 0, 0)";this.M_RAD_PER_DEG=Math.PI/180;this.images=null==this.images?[]:this.images;this.subCanvas=null==this.subCanvas?[]:this.subCanvas}mxUtils.extend(mxJsCanvas,mxAbstractCanvas2D);mxJsCanvas.prototype.ctx=null;mxJsCanvas.prototype.waitCounter=0;mxJsCanvas.prototype.onComplete=null;mxJsCanvas.prototype.images=null;mxJsCanvas.prototype.subCanvas=null;mxJsCanvas.prototype.canvasIndex=0;mxJsCanvas.prototype.hexToRgb=function(b){b=b.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(e,f,c,l){return f+f+c+c+l+l});return(b=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(b))?{r:parseInt(b[1],16),g:parseInt(b[2],16),b:parseInt(b[3],16)}:null};mxJsCanvas.prototype.incWaitCounter=function(){this.waitCounter++};mxJsCanvas.prototype.decWaitCounter=function(){this.waitCounter--;0==this.waitCounter&&null!=this.onComplete&&(this.onComplete(),this.onComplete=null)};mxJsCanvas.prototype.updateFont=function(){var b="";(this.state.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(b+="bold ");(this.state.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(b+="italic ");this.ctx.font=b+this.state.fontSize+"px "+this.state.fontFamily};mxJsCanvas.prototype.save=function(){this.states.push(this.state);this.state=mxUtils.clone(this.state);this.ctx.save()};mxJsCanvas.prototype.restore=function(){this.state=this.states.pop();this.ctx.restore()};mxJsCanvas.prototype.scale=function(b){this.state.scale*=b;this.state.strokeWidth*=b;this.ctx.scale(b,b)};mxJsCanvas.prototype.translate=function(b,e){this.state.dx+=b;this.state.dy+=e;this.ctx.translate(b,e)};mxJsCanvas.prototype.rotate=function(b,e,f,c,l){c-=this.state.dx;l-=this.state.dy;this.ctx.translate(c,l);(e||f)&&this.ctx.scale(e?-1:1,f?-1:1);this.ctx.rotate(b*this.M_RAD_PER_DEG);this.ctx.translate(-c,-l)};mxJsCanvas.prototype.setAlpha=function(b){this.state.alpha=b;this.ctx.globalAlpha=b};mxJsCanvas.prototype.setFillColor=function(b){b==mxConstants.NONE&&(b=null);this.state.fillColor=b;this.state.gradientColor=null;this.ctx.fillStyle=b};-mxJsCanvas.prototype.setGradient=function(b,e,f,c,l,p,q,v,E){f=this.ctx.createLinearGradient(0,c,0,c+p);c=this.state;c.fillColor=b;c.fillAlpha=null!=v?v:1;c.gradientColor=e;c.gradientAlpha=null!=E?E:1;c.gradientDirection=q;b=this.hexToRgb(b);e=this.hexToRgb(e);null!=b&&f.addColorStop(0,"rgba("+b.r+","+b.g+","+b.b+","+c.fillAlpha+")");null!=e&&f.addColorStop(1,"rgba("+e.r+","+e.g+","+e.b+","+c.gradientAlpha+")");this.ctx.fillStyle=f};+mxJsCanvas.prototype.setGradient=function(b,e,f,c,l,p,q,v,D){f=this.ctx.createLinearGradient(0,c,0,c+p);c=this.state;c.fillColor=b;c.fillAlpha=null!=v?v:1;c.gradientColor=e;c.gradientAlpha=null!=D?D:1;c.gradientDirection=q;b=this.hexToRgb(b);e=this.hexToRgb(e);null!=b&&f.addColorStop(0,"rgba("+b.r+","+b.g+","+b.b+","+c.fillAlpha+")");null!=e&&f.addColorStop(1,"rgba("+e.r+","+e.g+","+e.b+","+c.gradientAlpha+")");this.ctx.fillStyle=f};mxJsCanvas.prototype.setStrokeColor=function(b){null!=b&&(b==mxConstants.NONE?(this.state.strokeColor=null,this.ctx.strokeStyle="rgba(0, 0, 0, 0)"):(this.ctx.strokeStyle=b,this.state.strokeColor=b))};mxJsCanvas.prototype.setStrokeWidth=function(b){this.ctx.lineWidth=b};mxJsCanvas.prototype.setDashed=function(b){if(this.state.dashed=b){b=this.state.dashPattern.split(" ");for(var e=0;e<b.length;e++)b[e]=parseInt(b[e],10);this.setLineDash(b)}else this.setLineDash([0])};mxJsCanvas.prototype.setLineDash=function(b){try{"function"===typeof this.ctx.setLineDash&&this.ctx.setLineDash(b)}catch(e){}};mxJsCanvas.prototype.setDashPattern=function(b){this.state.dashPattern=b;if(this.state.dashed){b=b.split(" ");for(var e=0;e<b.length;e++)b[e]=parseInt(b[e],10);this.ctx.setLineDash(b)}};mxJsCanvas.prototype.setLineCap=function(b){this.ctx.lineCap=b};mxJsCanvas.prototype.setLineJoin=function(b){this.ctx.lineJoin=b};mxJsCanvas.prototype.setMiterLimit=function(b){this.ctx.lineJoin=b};mxJsCanvas.prototype.setFontColor=function(b){this.ctx.fillStyle=b};mxJsCanvas.prototype.setFontBackgroundColor=function(b){b==mxConstants.NONE&&(b=null);this.state.fontBackgroundColor=b};mxJsCanvas.prototype.setFontBorderColor=function(b){b==mxConstants.NONE&&(b=null);this.state.fontBorderColor=b};mxJsCanvas.prototype.setFontSize=function(b){this.state.fontSize=b};@@ -13651,13 +13655,13 @@ mxJsCanvas.prototype.setShadowOffset=function(b,e){this.state.shadowDx=b;this.stmxJsCanvas.prototype.arcTo=function(b,e,f,c,l,p,q){b=mxUtils.arcToCurves(this.lastMoveX,this.lastMoveY,b,e,f,c,l,p,q);if(null!=b)for(e=0;e<b.length;e+=6)this.curveTo(b[e],b[e+1],b[e+2],b[e+3],b[e+4],b[e+5])};mxJsCanvas.prototype.curveTo=function(b,e,f,c,l,p){this.ctx.bezierCurveTo(b,e,f,c,l,p);this.lastMoveX=l;this.lastMoveY=p};mxJsCanvas.prototype.rect=function(b,e,f,c){this.begin();this.moveTo(b,e);this.lineTo(b+f,e);this.lineTo(b+f,e+c);this.lineTo(b,e+c);this.close()};mxJsCanvas.prototype.roundrect=function(b,e,f,c,l,p){this.begin();this.moveTo(b+l,e);this.lineTo(b+f-l,e);this.quadTo(b+f,e,b+f,e+p);this.lineTo(b+f,e+c-p);this.quadTo(b+f,e+c,b+f-l,e+c);this.lineTo(b+l,e+c);this.quadTo(b,e+c,b,e+c-p);this.lineTo(b,e+p);this.quadTo(b,e,b+l,e)};mxJsCanvas.prototype.ellipse=function(b,e,f,c){this.ctx.save();this.ctx.translate(b+f/2,e+c/2);this.ctx.scale(f/2,c/2);this.ctx.beginPath();this.ctx.arc(0,0,1,0,2*Math.PI,!1);this.ctx.restore()};mxJsCanvas.prototype.rewriteImageSource=function(b){if("http://"==b.substring(0,7)||"https://"==b.substring(0,8))b="/proxy?url="+encodeURIComponent(b);return b};-mxJsCanvas.prototype.image=function(b,e,f,c,l,p,q,v){l=this.rewriteImageSource(l);l=this.images[l];if(null!=l&&0<l.height&&0<l.width){var E=this.ctx;E.save();if(p){p=l.width;var G=l.height,B=Math.min(f/p,c/G);b+=(f-p*B)/2;e+=(c-G*B)/2;f=p*B;c=G*B}q&&(E.translate(2*b+f,0),E.scale(-1,1));v&&(E.translate(0,2*e+c),E.scale(1,-1));E.drawImage(l,b,e,f,c);E.restore()}};mxJsCanvas.prototype.begin=function(){this.ctx.beginPath()};mxJsCanvas.prototype.close=function(){this.ctx.closePath()};+mxJsCanvas.prototype.image=function(b,e,f,c,l,p,q,v){l=this.rewriteImageSource(l);l=this.images[l];if(null!=l&&0<l.height&&0<l.width){var D=this.ctx;D.save();if(p){p=l.width;var G=l.height,B=Math.min(f/p,c/G);b+=(f-p*B)/2;e+=(c-G*B)/2;f=p*B;c=G*B}q&&(D.translate(2*b+f,0),D.scale(-1,1));v&&(D.translate(0,2*e+c),D.scale(1,-1));D.drawImage(l,b,e,f,c);D.restore()}};mxJsCanvas.prototype.begin=function(){this.ctx.beginPath()};mxJsCanvas.prototype.close=function(){this.ctx.closePath()};mxJsCanvas.prototype.fill=function(){this.ctx.fill()};mxJsCanvas.prototype.stroke=function(){this.ctx.stroke()};mxJsCanvas.prototype.fillAndStroke=function(){if(this.state.shadow){this.ctx.stroke();this.ctx.fill();var b=this.ctx.shadowColor,e=this.ctx.shadowOffsetX,f=this.ctx.shadowOffsetY;this.ctx.shadowColor="transparent";this.ctx.shadowOffsetX=0;this.ctx.shadowOffsetY=0;this.ctx.stroke();this.ctx.shadowColor=b;this.ctx.shadowOffsetX=e;this.ctx.shadowOffsetY=f}else this.ctx.fill(),this.ctx.stroke()};-mxJsCanvas.prototype.text=function(b,e,f,c,l,p,q,v,E,G,B,d){if(null!=l&&0!=l.length){f=this.state.scale;0!=d&&(this.ctx.translate(Math.round(b),Math.round(e)),this.ctx.rotate(d*Math.PI/180),this.ctx.translate(Math.round(-b),Math.round(-e)));if("html"==E){l=this.subCanvas[this.canvasIndex++];E=l.height;d=l.width;switch(q){case mxConstants.ALIGN_MIDDLE:e-=E/2/f;break;case mxConstants.ALIGN_BOTTOM:e-=E/f}switch(p){case mxConstants.ALIGN_CENTER:b-=d/2/f;break;case mxConstants.ALIGN_RIGHT:b-=d/f}this.ctx.save();+mxJsCanvas.prototype.text=function(b,e,f,c,l,p,q,v,D,G,B,d){if(null!=l&&0!=l.length){f=this.state.scale;0!=d&&(this.ctx.translate(Math.round(b),Math.round(e)),this.ctx.rotate(d*Math.PI/180),this.ctx.translate(Math.round(-b),Math.round(-e)));if("html"==D){l=this.subCanvas[this.canvasIndex++];D=l.height;d=l.width;switch(q){case mxConstants.ALIGN_MIDDLE:e-=D/2/f;break;case mxConstants.ALIGN_BOTTOM:e-=D/f}switch(p){case mxConstants.ALIGN_CENTER:b-=d/2/f;break;case mxConstants.ALIGN_RIGHT:b-=d/f}this.ctx.save();if(null!=this.state.fontBackgroundColor||null!=this.state.fontBorderColor)null!=this.state.fontBackgroundColor&&(this.ctx.fillStyle=this.state.fontBackgroundColor,this.ctx.fillRect(Math.round(b)-.5,Math.round(e)-.5,Math.round(l.width/f),Math.round(l.height/f))),null!=this.state.fontBorderColor&&(this.ctx.strokeStyle=this.state.fontBorderColor,this.ctx.lineWidth=1,this.ctx.strokeRect(Math.round(b)-.5,Math.round(e)-.5,Math.round(l.width/f),Math.round(l.height/f)));this.ctx.scale(1/f,1/f);this.ctx.drawImage(l,-Math.round(b*f),Math.round(e*f))}else{this.ctx.save();this.updateFont();d=document.createElement("div");d.innerHTML=l;d.style.position="absolute";d.style.top="-9999px";d.style.left="-9999px";d.style.fontFamily=this.state.fontFamily;d.style.fontWeight="bold";d.style.fontSize=this.state.fontSize+"pt";document.body.appendChild(d);E=[d.offsetWidth,d.offsetHeight];document.body.removeChild(d);l=l.split("\n");d=E[1];this.ctx.textBaseline="top";E=e;switch(q){case mxConstants.ALIGN_MIDDLE:this.ctx.textBaseline=-"middle";e-=(l.length-1)*d/2;E=e-this.state.fontSize/2;break;case mxConstants.ALIGN_BOTTOM:this.ctx.textBaseline="alphabetic",e-=d*(l.length-1),E=e-this.state.fontSize}q=[];d=[];for(f=0;f<l.length;f++)d[f]=b,q[f]=this.ctx.measureText(l[f]).width,null!=p&&p!=mxConstants.ALIGN_LEFT&&(d[f]-=q[f],p==mxConstants.ALIGN_CENTER&&(d[f]+=q[f]/2));if(null!=this.state.fontBackgroundColor||null!=this.state.fontBorderColor){b=d[0];p=q[0];for(f=1;f<l.length;f++)b=Math.min(b,d[f]),p=Math.max(p,q[f]);this.ctx.save();-b=Math.round(b)-.5;E=Math.round(E)-.5;null!=this.state.fontBackgroundColor&&(this.ctx.fillStyle=this.state.fontBackgroundColor,this.ctx.fillRect(b,E,p,this.state.fontSize*mxConstants.LINE_HEIGHT*l.length));null!=this.state.fontBorderColor&&(this.ctx.strokeStyle=this.state.fontBorderColor,this.ctx.lineWidth=1,this.ctx.strokeRect(b,E,p,this.state.fontSize*mxConstants.LINE_HEIGHT*l.length));this.ctx.restore()}for(f=0;f<l.length;f++)this.ctx.fillText(l[f],d[f],e),e+=this.state.fontSize*mxConstants.LINE_HEIGHT}this.ctx.restore()}};+Math.round(b*f),Math.round(e*f))}else{this.ctx.save();this.updateFont();d=document.createElement("div");d.innerHTML=l;d.style.position="absolute";d.style.top="-9999px";d.style.left="-9999px";d.style.fontFamily=this.state.fontFamily;d.style.fontWeight="bold";d.style.fontSize=this.state.fontSize+"pt";document.body.appendChild(d);D=[d.offsetWidth,d.offsetHeight];document.body.removeChild(d);l=l.split("\n");d=D[1];this.ctx.textBaseline="top";D=e;switch(q){case mxConstants.ALIGN_MIDDLE:this.ctx.textBaseline=+"middle";e-=(l.length-1)*d/2;D=e-this.state.fontSize/2;break;case mxConstants.ALIGN_BOTTOM:this.ctx.textBaseline="alphabetic",e-=d*(l.length-1),D=e-this.state.fontSize}q=[];d=[];for(f=0;f<l.length;f++)d[f]=b,q[f]=this.ctx.measureText(l[f]).width,null!=p&&p!=mxConstants.ALIGN_LEFT&&(d[f]-=q[f],p==mxConstants.ALIGN_CENTER&&(d[f]+=q[f]/2));if(null!=this.state.fontBackgroundColor||null!=this.state.fontBorderColor){b=d[0];p=q[0];for(f=1;f<l.length;f++)b=Math.min(b,d[f]),p=Math.max(p,q[f]);this.ctx.save();+b=Math.round(b)-.5;D=Math.round(D)-.5;null!=this.state.fontBackgroundColor&&(this.ctx.fillStyle=this.state.fontBackgroundColor,this.ctx.fillRect(b,D,p,this.state.fontSize*mxConstants.LINE_HEIGHT*l.length));null!=this.state.fontBorderColor&&(this.ctx.strokeStyle=this.state.fontBorderColor,this.ctx.lineWidth=1,this.ctx.strokeRect(b,D,p,this.state.fontSize*mxConstants.LINE_HEIGHT*l.length));this.ctx.restore()}for(f=0;f<l.length;f++)this.ctx.fillText(l[f],d[f],e),e+=this.state.fontSize*mxConstants.LINE_HEIGHT}this.ctx.restore()}};mxJsCanvas.prototype.getCanvas=function(){return canvas};mxJsCanvas.prototype.finish=function(b){0==this.waitCounter?b():this.onComplete=b};DrawioClient=function(b,e){mxEventSource.call(this);this.ui=b;this.cookieName=e;this.token=this.getPersistentToken()};mxUtils.extend(DrawioClient,mxEventSource);DrawioClient.prototype.token=null;DrawioClient.prototype.user=null;DrawioClient.prototype.setUser=function(b){this.user=b;this.fireEvent(new mxEventObject("userChanged"))};DrawioClient.prototype.getUser=function(){return this.user};DrawioClient.prototype.clearPersistentToken=function(){if(isLocalStorage)localStorage.removeItem("."+this.cookieName),sessionStorage.removeItem("."+this.cookieName);else if("undefined"!=typeof Storage){var b=new Date;b.setYear(b.getFullYear()-1);document.cookie=this.cookieName+"=; expires="+b.toUTCString()}};DrawioClient.prototype.getPersistentToken=function(b){var e=null;isLocalStorage&&(e=localStorage.getItem("."+this.cookieName),null==e&&b&&(e=sessionStorage.getItem("."+this.cookieName)));if(null==e&&"undefined"!=typeof Storage){var f=document.cookie;b=this.cookieName+"=";var c=f.indexOf(b);0<=c&&(c+=b.length,e=f.indexOf(";",c),0>e?e=f.length:postCookie=f.substring(e),e=f.substring(c,e),e=0<e.length?e:null,null!=e&&isLocalStorage&&(f=new Date,f.setYear(f.getFullYear()-1),document.cookie=b+"; expires="+@@ -13666,9 +13670,9 @@ DriveFile.prototype.isConflict=function(b){return null!=b&&null!=b.error&&412==bDriveFile.prototype.getFolderUrl=function(){return null!=this.desc.labels&&this.desc.labels.trashed?"https://drive.google.com/drive/trash":null!=this.desc.parents&&0<this.desc.parents.length?"https://drive.google.com/drive/folders/"+this.desc.parents[0].id:null};DriveFile.prototype.getPublicUrl=function(b){this.ui.drive.executeRequest({url:"/files/"+this.desc.id+"/permissions?supportsAllDrives=true"},mxUtils.bind(this,function(e){if(null!=e&&null!=e.items)for(var f=0;f<e.items.length;f++)if("anyoneWithLink"===e.items[f].id||"anyone"===e.items[f].id){b(this.desc.webContentLink);return}b(null)}),mxUtils.bind(this,function(){b(null)}))};DriveFile.prototype.isAutosaveOptional=function(){return!0};DriveFile.prototype.isRenamable=function(){return this.isEditable()&&DrawioFile.prototype.isEditable.apply(this,arguments)};DriveFile.prototype.isMovable=function(){return this.isEditable()};DriveFile.prototype.isTrashed=function(){return this.desc.labels.trashed};DriveFile.prototype.save=function(b,e,f,c,l){DrawioFile.prototype.save.apply(this,[b,mxUtils.bind(this,function(){this.saveFile(null,b,e,f,c,l)}),f,c,l])};-DriveFile.prototype.saveFile=function(b,e,f,c,l,p){try{this.isEditable()?this.savingFile||(this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,this.createSecret(mxUtils.bind(this,function(q,v){var E=mxUtils.bind(this,function(G,B){try{var d=this.desc;null!=this.sync&&this.sync.fileSaving();this.ui.drive.saveFile(this,B,mxUtils.bind(this,function(g,k,m,t){try{this.savingFile=!1,0!=g?(this.setModified(this.getShadowModified()),e&&(this.lastAutosaveRevision=(new Date).getTime()),+DriveFile.prototype.saveFile=function(b,e,f,c,l,p){try{this.isEditable()?this.savingFile||(this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,this.createSecret(mxUtils.bind(this,function(q,v){var D=mxUtils.bind(this,function(G,B){try{var d=this.desc;null!=this.sync&&this.sync.fileSaving();this.ui.drive.saveFile(this,B,mxUtils.bind(this,function(g,k,m,t){try{this.savingFile=!1,0!=g?(this.setModified(this.getShadowModified()),e&&(this.lastAutosaveRevision=(new Date).getTime()),this.autosaveDelay=Math.round(Math.min(1E4,Math.max(DriveFile.prototype.autosaveDelay,this.saveDelay))),this.desc=g,this.fileSaved(k,d,mxUtils.bind(this,function(){this.contentChanged();null!=f&&f(g)}),c,v,m,t)):null!=c&&c(g)}catch(y){if(this.savingFile=!1,null!=c)c(y);else throw y;}}),mxUtils.bind(this,function(g,k){try{this.savingFile=!1,this.isConflict(g)?(this.inConflictState=!0,null!=this.sync?(this.savingFile=!0,this.sync.fileConflict(k,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,-function(){this.updateFileData();this.setShadowModified(!1);E(G,!0)}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=!1;null!=c&&c()}))):null!=c&&c()):null!=c&&c(g)}catch(m){if(this.savingFile=!1,null!=c)c(m);else throw m;}}),l,l,G,null,q)}catch(g){if(this.savingFile=!1,null!=c)c(g);else throw g;}});E(p,e)}))):null!=f&&f()}catch(q){if(null!=c)c(q);else throw q;}};+function(){this.updateFileData();this.setShadowModified(!1);D(G,!0)}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=!1;null!=c&&c()}))):null!=c&&c()):null!=c&&c(g)}catch(m){if(this.savingFile=!1,null!=c)c(m);else throw m;}}),l,l,G,null,q)}catch(g){if(this.savingFile=!1,null!=c)c(g);else throw g;}});D(p,e)}))):null!=f&&f()}catch(q){if(null!=c)c(q);else throw q;}};DriveFile.prototype.copyFile=function(b,e){this.isRestricted()?DrawioFile.prototype.copyFile.apply(this,arguments):this.makeCopy(mxUtils.bind(this,function(){if(this.ui.spinner.spin(document.body,mxResources.get("saving")))try{this.save(!0,b,e)}catch(f){e(f)}}),e,!0)};DriveFile.prototype.makeCopy=function(b,e,f){this.ui.spinner.spin(document.body,mxResources.get("saving"))&&this.saveAs(this.ui.getCopyFilename(this,f),mxUtils.bind(this,function(c){this.desc=c;this.ui.spinner.stop();this.setModified(!1);this.inConflictState=this.invalidChecksum=!1;this.descriptorChanged();b()}),mxUtils.bind(this,function(){this.ui.spinner.stop();null!=e&&e()}))};DriveFile.prototype.saveAs=function(b,e,f){this.ui.drive.copyFile(this.getId(),b,e,f)};DriveFile.prototype.rename=function(b,e,f){var c=this.getCurrentRevisionId();this.ui.drive.renameFile(this.getId(),b,mxUtils.bind(this,function(l){this.hasSameExtension(b,this.getTitle())?(this.desc=l,this.descriptorChanged(),null!=this.sync&&this.sync.descriptorChanged(c),null!=e&&e(l)):(this.desc=l,null!=this.sync&&this.sync.descriptorChanged(c),this.save(!0,e,f))}),f)};@@ -13690,89 +13694,89 @@ DriveClient.prototype.catchupFields="etag,headRevisionId,modifiedDate,properties"-").replace(/\//g,"_");DriveClient.prototype.placeholderMimeType="image/png";DriveClient.prototype.libraryMimeType="application/vnd.jgraph.mxlibrary";DriveClient.prototype.newAppHostname="app.diagrams.net";DriveClient.prototype.extension=".drawio";DriveClient.prototype.tokenRefreshInterval=0;DriveClient.prototype.lastTokenRefresh=0;DriveClient.prototype.maxRetries=5;DriveClient.prototype.staleEtagMaxRetries=4;DriveClient.prototype.coolOff=1E3;DriveClient.prototype.mimeTypeCheckCoolOff=6E4;DriveClient.prototype.user=null;DriveClient.prototype.sameWinAuthMode=!1;DriveClient.prototype.sameWinRedirectUrl=null;DriveClient.prototype.setUser=function(f){this.user=f;null==this.user?(this.userId=null,null!=this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null)):this.userId=f.id;this.fireEvent(new mxEventObject("userChanged"))};DriveClient.prototype.setUserId=function(f){this.userId=f;null!=this.user&&this.user.id!=this.userId&&(this.user=null)};DriveClient.prototype.getUser=function(){return this.user};DriveClient.prototype.getUsersList=function(){var f=[],c=JSON.parse(this.getPersistentToken(!0)),l=null;if(null!=c){null!=c.current&&(l=c.current.userId,f.push(c[l].user),f[0].isCurrent=!0);for(var p in c)"current"!=p&&p!=l&&f.push(c[p].user)}return f};DriveClient.prototype.logout=function(){this.ui.editor.loadUrl(this.redirectUri+"?doLogout=1&userId="+this.userId+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host));this.clearPersistentToken();-this.setUser(null);b=null};DriveClient.prototype.execute=function(f){var c=mxUtils.bind(this,function(l){this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(p,q){this.authorize(!1,mxUtils.bind(this,function(){null!=q&&q();f()}),mxUtils.bind(this,function(v){var E=null!=v.message?v.message:mxResources.get("cannotLogin");null!=v&&null!=v.error&&403==v.error.code&&null!=v.error.data&&0<v.error.data.length&&"domainPolicy"==v.error.data[0].reason&&(E=v.error.message);this.logout();this.ui.showError(mxResources.get("error"),-E,mxResources.get("help"),mxUtils.bind(this,function(){this.ui.openLink("https://www.drawio.com/doc/faq/gsuite-authorisation-troubleshoot")}),null,mxResources.get("ok"))}),p)}))});this.authorize(!0,f,c)};DriveClient.prototype.executeRequest=function(f,c,l){try{var p=!0,q=null,v=0;null!=this.requestThread&&window.clearTimeout(this.requestThread);var E=mxUtils.bind(this,function(){try{this.requestThread=null;this.currentRequest=f;null!=q&&window.clearTimeout(q);q=window.setTimeout(mxUtils.bind(this,-function(){p=!1;null!=l&&l({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:E})}),this.ui.timeout);var G=null,B=!1;"string"===typeof f.params?G=f.params:null!=f.params&&(G=JSON.stringify(f.params),B=!0);var d=f.fullUrl||this.GDriveBaseUrl+f.url;B&&(d+=(0<d.indexOf("?")?"&":"?")+"alt=json");var g=new mxXmlRequest(d,G,f.method||"GET");g.setRequestHeaders=mxUtils.bind(this,function(k,m){if(null!=f.headers)for(var t in f.headers)k.setRequestHeader(t,f.headers[t]);else null!=f.contentType?-k.setRequestHeader("Content-Type",f.contentType):B&&k.setRequestHeader("Content-Type","application/json");k.setRequestHeader("Authorization","Bearer "+b)});g.send(mxUtils.bind(this,function(k){try{if(window.clearTimeout(q),p){try{var m=JSON.parse(k.getText())}catch(A){m=null}if(200<=k.getStatus()&&299>=k.getStatus())null!=c&&c(m);else{var t=null!=m&&null!=m.error?null!=m.error.data?m.error.data:m.error.errors:null,y=null!=t&&0<t.length?t[0].reason:null;null==l||null==m||null==m.error||-1!=m.error.code&&-(403!=m.error.code||"domainPolicy"!=y&&"The requested mime type change is forbidden."!=m.error.message)?null!=m&&null!=m.error&&(401==m.error.code||403==m.error.code&&"rateLimitExceeded"!=y)?403==m.error.code&&this.retryAuth||401==m.error.code&&this.retryAuth&&"authError"==y?(null!=l&&l(m),this.retryAuth=!1):(this.retryAuth=!0,this.execute(E)):null!=m&&null!=m.error&&412!=m.error.code&&404!=m.error.code&&400!=m.error.code&&this.currentRequest==f&&v<this.maxRetries?(v++,this.requestThread=window.setTimeout(E,-Math.round(Math.pow(2,v)*(1+.1*(Math.random()-.5))*this.coolOff))):null!=l&&l(m):l(m)}}}catch(A){if(null!=l)l(A);else throw A;}}))}catch(k){if(null!=l)l(k);else throw k;}});null!=b&&this.authCalled?E():this.execute(E)}catch(G){if(null!=l)l(G);else throw G;}};DriveClient.prototype.createAuthWin=function(f){return window.open(f?f:"about:blank","gdauth",["width=525,height=525","top="+(window.screenY+Math.max(window.outerHeight-525,0)/2),"left="+(window.screenX+Math.max(window.outerWidth-525,0)/2),"status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes"].join())};+this.setUser(null);b=null};DriveClient.prototype.execute=function(f){var c=mxUtils.bind(this,function(l){this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(p,q){this.authorize(!1,mxUtils.bind(this,function(){null!=q&&q();f()}),mxUtils.bind(this,function(v){var D=null!=v.message?v.message:mxResources.get("cannotLogin");null!=v&&null!=v.error&&403==v.error.code&&null!=v.error.data&&0<v.error.data.length&&"domainPolicy"==v.error.data[0].reason&&(D=v.error.message);this.logout();this.ui.showError(mxResources.get("error"),+D,mxResources.get("help"),mxUtils.bind(this,function(){this.ui.openLink("https://www.drawio.com/doc/faq/gsuite-authorisation-troubleshoot")}),null,mxResources.get("ok"))}),p)}))});this.authorize(!0,f,c)};DriveClient.prototype.executeRequest=function(f,c,l){try{var p=!0,q=null,v=0;null!=this.requestThread&&window.clearTimeout(this.requestThread);var D=mxUtils.bind(this,function(){try{this.requestThread=null;this.currentRequest=f;null!=q&&window.clearTimeout(q);q=window.setTimeout(mxUtils.bind(this,+function(){p=!1;null!=l&&l({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:D})}),this.ui.timeout);var G=null,B=!1;"string"===typeof f.params?G=f.params:null!=f.params&&(G=JSON.stringify(f.params),B=!0);var d=f.fullUrl||this.GDriveBaseUrl+f.url;B&&(d+=(0<d.indexOf("?")?"&":"?")+"alt=json");var g=new mxXmlRequest(d,G,f.method||"GET");g.setRequestHeaders=mxUtils.bind(this,function(k,m){if(null!=f.headers)for(var t in f.headers)k.setRequestHeader(t,f.headers[t]);else null!=f.contentType?+k.setRequestHeader("Content-Type",f.contentType):B&&k.setRequestHeader("Content-Type","application/json");k.setRequestHeader("Authorization","Bearer "+b)});g.send(mxUtils.bind(this,function(k){try{if(window.clearTimeout(q),p){try{var m=JSON.parse(k.getText())}catch(z){m=null}if(200<=k.getStatus()&&299>=k.getStatus())null!=c&&c(m);else{var t=null!=m&&null!=m.error?null!=m.error.data?m.error.data:m.error.errors:null,y=null!=t&&0<t.length?t[0].reason:null;null==l||null==m||null==m.error||-1!=m.error.code&&+(403!=m.error.code||"domainPolicy"!=y&&"The requested mime type change is forbidden."!=m.error.message)?null!=m&&null!=m.error&&(401==m.error.code||403==m.error.code&&"rateLimitExceeded"!=y)?403==m.error.code&&this.retryAuth||401==m.error.code&&this.retryAuth&&"authError"==y?(null!=l&&l(m),this.retryAuth=!1):(this.retryAuth=!0,this.execute(D)):null!=m&&null!=m.error&&412!=m.error.code&&404!=m.error.code&&400!=m.error.code&&this.currentRequest==f&&v<this.maxRetries?(v++,this.requestThread=window.setTimeout(D,+Math.round(Math.pow(2,v)*(1+.1*(Math.random()-.5))*this.coolOff))):null!=l&&l(m):l(m)}}}catch(z){if(null!=l)l(z);else throw z;}}))}catch(k){if(null!=l)l(k);else throw k;}});null!=b&&this.authCalled?D():this.execute(D)}catch(G){if(null!=l)l(G);else throw G;}};DriveClient.prototype.createAuthWin=function(f){return window.open(f?f:"about:blank","gdauth",["width=525,height=525","top="+(window.screenY+Math.max(window.outerHeight-525,0)/2),"left="+(window.screenX+Math.max(window.outerWidth-525,0)/2),"status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes"].join())};DriveClient.prototype.authorize=function(f,c,l,p,q){this.isExtAuth&&!f?window.parent.driveAuth(mxUtils.bind(this,function(v){this.updateAuthInfo(v,!0,!0,c,l)}),l):(new mxXmlRequest(this.redirectUri+"?getState=1",null,"GET")).send(mxUtils.bind(this,function(v){200<=v.getStatus()&&299>=v.getStatus()?this.authorizeStep2(v.getText(),f,c,l,p,q):null!=l&&l(v)}),l)};DriveClient.prototype.updateAuthInfo=function(f,c,l,p,q){b=f.access_token;delete f.access_token;f.expires=Date.now()+1E3*parseInt(f.expires_in);-f.remember=c;this.resetTokenRefresh(f);this.authCalled=!0;if(l||null==this.user){var v=JSON.stringify(f);this.updateUser(mxUtils.bind(this,function(){var E=JSON.parse(v);this.setPersistentToken(E,!c);null!=p&&p()}),q)}else null!=p&&(this.setPersistentToken(f,!c),p())};DriveClient.prototype.authorizeStep2=function(f,c,l,p,q,v){try{null!=this.ui.stateArg&&null!=this.ui.stateArg.userId&&(this.userId=this.ui.stateArg.userId,null!=this.user&&this.user.id!=this.userId&&(this.user=null));if(null==this.userId){var E=-JSON.parse(this.getPersistentToken(!0));E&&null!=E.current&&(this.userId=E.current.userId)}if(c&&null==this.userId)null!=p&&p();else if(c)(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+f)+"&userId="+this.userId,null,"GET")).send(mxUtils.bind(this,function(B){try{if(200<=B.getStatus()&&299>=B.getStatus()){var d=JSON.parse(B.getText());this.updateAuthInfo(d,!0,!1,l,p)}else 0!=B.getStatus()&&this.logout(),null!=p&&p(B)}catch(g){if(null!=+f.remember=c;this.resetTokenRefresh(f);this.authCalled=!0;if(l||null==this.user){var v=JSON.stringify(f);this.updateUser(mxUtils.bind(this,function(){var D=JSON.parse(v);this.setPersistentToken(D,!c);null!=p&&p()}),q)}else null!=p&&(this.setPersistentToken(f,!c),p())};DriveClient.prototype.authorizeStep2=function(f,c,l,p,q,v){try{null!=this.ui.stateArg&&null!=this.ui.stateArg.userId&&(this.userId=this.ui.stateArg.userId,null!=this.user&&this.user.id!=this.userId&&(this.user=null));if(null==this.userId){var D=+JSON.parse(this.getPersistentToken(!0));D&&null!=D.current&&(this.userId=D.current.userId)}if(c&&null==this.userId)null!=p&&p();else if(c)(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+f)+"&userId="+this.userId,null,"GET")).send(mxUtils.bind(this,function(B){try{if(200<=B.getStatus()&&299>=B.getStatus()){var d=JSON.parse(B.getText());this.updateAuthInfo(d,!0,!1,l,p)}else 0!=B.getStatus()&&this.logout(),null!=p&&p(B)}catch(g){if(null!=window.console&&console.log("DriveClient.authorizeStep2",g),null!=p)p(g);else throw g;}}),p);else{var G="https://accounts.google.com/o/oauth2/v2/auth?client_id="+this.clientId+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&include_granted_scopes=true"+(q?"&access_type=offline&prompt=consent%20select_account":"")+"&scope="+encodeURIComponent(this.scopes.join(" "))+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+f+(this.sameWinRedirectUrl?"&redirect="+this.sameWinRedirectUrl:""));this.sameWinAuthMode?(window.location.assign(G),v=null):null==v?v=this.createAuthWin(G):v.location=G;null!=v?(window.onGoogleDriveCallback=mxUtils.bind(this,function(B,d){window.onGoogleDriveCallback=null;try{null==B?null!=p&&p({message:mxResources.get("accessDenied")}):this.updateAuthInfo(B,q,!0,l,p)}catch(g){null!=p&&p(g)}finally{null!=d&&d.close()}}),v.focus()):null!=p&&p({message:mxResources.get("allowPopups")})}}catch(B){if(null!=p)p(B);else throw B;}};DriveClient.prototype.resetTokenRefresh=function(f){null!=this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null);null!=f&&null==f.error&&0<f.expires_in&&(this.tokenRefreshInterval=1E3*parseInt(f.expires_in),this.lastTokenRefresh=Date.now(),this.tokenRefreshThread=window.setTimeout(mxUtils.bind(this,function(){this.authorize(!0,mxUtils.bind(this,function(){}),mxUtils.bind(this,function(){}))}),900*f.expires_in))};DriveClient.prototype.checkToken=function(f){var c=-0<this.lastTokenRefresh;Date.now()-this.lastTokenRefresh>this.tokenRefreshInterval||null==this.tokenRefreshThread?this.execute(mxUtils.bind(this,function(){f();c&&this.fireEvent(new mxEventObject("disconnected"))})):f()};DriveClient.prototype.updateUser=function(f,c){try{var l={Authorization:"Bearer "+b};this.ui.editor.loadUrl("https://www.googleapis.com/oauth2/v2/userinfo?alt=json",mxUtils.bind(this,function(p){try{var q=JSON.parse(p);this.executeRequest({url:"/about"},mxUtils.bind(this,function(v){var E=-mxResources.get("notAvailable"),G=E,B=null;null!=v&&null!=v.user&&(E=v.user.emailAddress,G=v.user.displayName,B=null!=v.user.picture?v.user.picture.url:null);this.setUser(new DrawioUser(q.id,E,G,B,q.locale));this.userId=q.id;null!=f&&f()}),c)}catch(v){null!=c&&c(v)}}),c,null,null,null,null,l)}catch(p){if(null!=c)c(p);else throw p;}};DriveClient.prototype.copyFile=function(f,c,l,p){null!=f&&null!=c&&this.executeRequest({url:"/files/"+f+"/copy?fields="+encodeURIComponent(this.allFields)+"&supportsAllDrives=true&enforceSingleParent=true",+0<this.lastTokenRefresh;Date.now()-this.lastTokenRefresh>this.tokenRefreshInterval||null==this.tokenRefreshThread?this.execute(mxUtils.bind(this,function(){f();c&&this.fireEvent(new mxEventObject("disconnected"))})):f()};DriveClient.prototype.updateUser=function(f,c){try{var l={Authorization:"Bearer "+b};this.ui.editor.loadUrl("https://www.googleapis.com/oauth2/v2/userinfo?alt=json",mxUtils.bind(this,function(p){try{var q=JSON.parse(p);this.executeRequest({url:"/about"},mxUtils.bind(this,function(v){var D=+mxResources.get("notAvailable"),G=D,B=null;null!=v&&null!=v.user&&(D=v.user.emailAddress,G=v.user.displayName,B=null!=v.user.picture?v.user.picture.url:null);this.setUser(new DrawioUser(q.id,D,G,B,q.locale));this.userId=q.id;null!=f&&f()}),c)}catch(v){null!=c&&c(v)}}),c,null,null,null,null,l)}catch(p){if(null!=c)c(p);else throw p;}};DriveClient.prototype.copyFile=function(f,c,l,p){null!=f&&null!=c&&this.executeRequest({url:"/files/"+f+"/copy?fields="+encodeURIComponent(this.allFields)+"&supportsAllDrives=true&enforceSingleParent=true",method:"POST",params:{title:c,properties:[{key:"channel",value:Editor.guid()}]}},l,p)};DriveClient.prototype.renameFile=function(f,c,l,p){null!=f&&null!=c&&this.executeRequest(this.createDriveRequest(f,{title:c}),l,p)};DriveClient.prototype.moveFile=function(f,c,l,p){null!=f&&null!=c&&this.executeRequest(this.createDriveRequest(f,{parents:[{kind:"drive#fileLink",id:c}]}),l,p)};DriveClient.prototype.createDriveRequest=function(f,c){return{url:"/files/"+f+"?uploadType=multipart&supportsAllDrives=true",method:"PUT",contentType:"application/json; charset=UTF-8",params:c}};DriveClient.prototype.getLibrary=function(f,c,l){return this.getFile(f,c,l,!0,!0)};DriveClient.prototype.loadDescriptor=function(f,c,l,p){this.executeRequest({url:"/files/"+f+"?supportsAllDrives=true&fields="+(null!=p?p:this.allFields)},c,l)};DriveClient.prototype.listFiles=function(f,c,l,p,q){this.executeRequest({url:"/files?supportsAllDrives=true&includeItemsFromAllDrives=true&q="+encodeURIComponent("(mimeType contains '"+this.xmlMimeType+"') "+(f?" and (title contains '"+f+"')":"")+(c?" and (modifiedDate > '"+c.toISOString()+"')":"")+(l?" and ('me' in owners)":""))+"&orderBy=modifiedDate desc,title"},p,q)};DriveClient.prototype.getCustomProperty=function(f,c){f=f.properties;var l=null;if(null!=f)for(var p=0;p<f.length;p++)if(f[p].key==c){l=f[p].value;break}return l};DriveClient.prototype.getFile=function(f,c,l,p,q){p=null!=p?p:!1;q=null!=q?q:!1;null!=urlParams.rev?this.executeRequest({url:"/files/"+f+"/revisions/"+urlParams.rev+"?supportsAllDrives=true"},-mxUtils.bind(this,function(v){v.title=v.originalFilename;v.headRevisionId=v.id;v.id=f;this.getXmlFile(v,c,l)}),l):this.loadDescriptor(f,mxUtils.bind(this,function(v){try{if(null!=this.user){var E=/\.png$/i.test(v.title);/\.v(dx|sdx?)$/i.test(v.title)||/\.gliffy$/i.test(v.title)||!this.ui.useCanvasForExport&&E?this.ui.convertFile(v.downloadUrl,v.title,v.mimeType,this.extension,c,l,null,{Authorization:"Bearer "+b}):p||q||v.mimeType==this.libraryMimeType||v.mimeType==this.xmlMimeType?this.getXmlFile(v,-c,l,!0,q):this.getXmlFile(v,c,l)}else l({message:mxResources.get("loggedOut")})}catch(G){if(null!=l)l(G);else throw G;}}),l)};DriveClient.prototype.isGoogleRealtimeMimeType=function(f){return null!=f&&"application/vnd.jgraph.mxfile."==f.substring(0,30)};DriveClient.prototype.getXmlFile=function(f,c,l,p,q){try{var v={Authorization:"Bearer "+b},E=f.downloadUrl;if(null==E)null!=l&&l({message:mxResources.get("exportOptionsDisabledDetails")});else{var G=0,B=mxUtils.bind(this,function(){this.ui.editor.loadUrl(E,+mxUtils.bind(this,function(v){v.title=v.originalFilename;v.headRevisionId=v.id;v.id=f;this.getXmlFile(v,c,l)}),l):this.loadDescriptor(f,mxUtils.bind(this,function(v){try{if(null!=this.user){var D=/\.png$/i.test(v.title);/\.v(dx|sdx?)$/i.test(v.title)||/\.gliffy$/i.test(v.title)||!this.ui.useCanvasForExport&&D?this.ui.convertFile(v.downloadUrl,v.title,v.mimeType,this.extension,c,l,null,{Authorization:"Bearer "+b}):p||q||v.mimeType==this.libraryMimeType||v.mimeType==this.xmlMimeType?this.getXmlFile(v,+c,l,!0,q):this.getXmlFile(v,c,l)}else l({message:mxResources.get("loggedOut")})}catch(G){if(null!=l)l(G);else throw G;}}),l)};DriveClient.prototype.isGoogleRealtimeMimeType=function(f){return null!=f&&"application/vnd.jgraph.mxfile."==f.substring(0,30)};DriveClient.prototype.getXmlFile=function(f,c,l,p,q){try{var v={Authorization:"Bearer "+b},D=f.downloadUrl;if(null==D)null!=l&&l({message:mxResources.get("exportOptionsDisabledDetails")});else{var G=0,B=mxUtils.bind(this,function(){this.ui.editor.loadUrl(D,mxUtils.bind(this,function(d){try{if(null==d)l({message:mxResources.get("invalidOrMissingFile")});else if(f.mimeType==this.libraryMimeType||q)f.mimeType!=this.libraryMimeType||q?c(new DriveLibrary(this.ui,d,f)):l({message:mxResources.get("notADiagramFile")});else{var g=!1;if(/\.png$/i.test(f.title)){var k=d.lastIndexOf(",");if(0<k){var m=this.ui.extractGraphModelFromPng(d);if(null!=m&&0<m.length)d=m;else try{m=d.substring(k+1);var t=!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(m):-atob(m),y=this.ui.editor.extractGraphModel(mxUtils.parseXml(t).documentElement,!0);null==y||0<y.getElementsByTagName("parsererror").length?g=!0:d=t}catch(A){g=!0}}}else/\.pdf$/i.test(f.title)?(m=Editor.extractGraphModelFromPdf(d),null!=m&&0<m.length&&(g=!0,d=m)):"data:image/png;base64,PG14ZmlsZS"==d.substring(0,32)&&(t=d.substring(22),d=window.atob&&!mxClient.IS_SF?atob(t):Base64.decode(t));Graph.fileSupport&&(new XMLHttpRequest).upload&&this.ui.isRemoteFileFormat(d,E)?this.ui.parseFileData(d,mxUtils.bind(this,-function(A){try{4==A.readyState&&(200<=A.status&&299>=A.status?c(new LocalFile(this.ui,A.responseText,f.title+this.extension,!0)):null!=l&&l({message:mxResources.get("errorLoadingFile")}))}catch(I){if(null!=l)l(I);else throw I;}}),f.title):c(g?new LocalFile(this.ui,d,f.title,!0):new DriveFile(this.ui,d,f))}}catch(A){if(null!=l)l(A);else throw A;}}),mxUtils.bind(this,function(d,g){if(G<this.maxRetries&&null!=g&&403==g.getStatus())G++,window.setTimeout(B,2*G*this.coolOff*(1+.1*(Math.random()-.5)));-else if(null!=l)l(d);else throw d;}),null!=f.mimeType&&"image/"==f.mimeType.substring(0,6)&&"image/svg"!=f.mimeType.substring(0,9)||/\.png$/i.test(f.title)||/\.jpe?g$/i.test(f.title)||/\.pdf$/i.test(f.title),null,null,null,v)});B()}}catch(d){if(null!=l)l(d);else throw d;}};DriveClient.prototype.saveFile=function(f,c,l,p,q,v,E,G,B){try{var d=0;f.saveLevel=1;var g=mxUtils.bind(this,function(V){if(null!=p)p(V);else throw V;}),k=mxUtils.bind(this,function(V){g(V);try{EditorUi.logError(V.message,null,-null,null,V)}catch(P){}});if(f.isEditable()&&null!=f.desc){var m=Date.now(),t=f.desc.etag,y=f.desc.modifiedDate,A=f.desc.headRevisionId,I=this.ui.useCanvasForExport&&/(\.png)$/i.test(f.getTitle());v=null!=v?v:!1;var F=null,C=!1,Q={mimeType:f.desc.mimeType,title:f.getTitle()};if(this.isGoogleRealtimeMimeType(Q.mimeType))Q.mimeType=this.xmlMimeType,F=f.desc,C=c=!0;else if("application/octet-stream"==Q.mimeType||"1"==urlParams["override-mime"]&&Q.mimeType!=this.xmlMimeType)Q.mimeType=this.xmlMimeType;+atob(m),y=this.ui.editor.extractGraphModel(mxUtils.parseXml(t).documentElement,!0);null==y||0<y.getElementsByTagName("parsererror").length?g=!0:d=t}catch(z){g=!0}}}else/\.pdf$/i.test(f.title)?(m=Editor.extractGraphModelFromPdf(d),null!=m&&0<m.length&&(g=!0,d=m)):"data:image/png;base64,PG14ZmlsZS"==d.substring(0,32)&&(t=d.substring(22),d=window.atob&&!mxClient.IS_SF?atob(t):Base64.decode(t));Graph.fileSupport&&(new XMLHttpRequest).upload&&this.ui.isRemoteFileFormat(d,D)?this.ui.parseFileData(d,mxUtils.bind(this,+function(z){try{4==z.readyState&&(200<=z.status&&299>=z.status?c(new LocalFile(this.ui,z.responseText,f.title+this.extension,!0)):null!=l&&l({message:mxResources.get("errorLoadingFile")}))}catch(I){if(null!=l)l(I);else throw I;}}),f.title):c(g?new LocalFile(this.ui,d,f.title,!0):new DriveFile(this.ui,d,f))}}catch(z){if(null!=l)l(z);else throw z;}}),mxUtils.bind(this,function(d,g){if(G<this.maxRetries&&null!=g&&403==g.getStatus())G++,window.setTimeout(B,2*G*this.coolOff*(1+.1*(Math.random()-.5)));+else if(null!=l)l(d);else throw d;}),null!=f.mimeType&&"image/"==f.mimeType.substring(0,6)&&"image/svg"!=f.mimeType.substring(0,9)||/\.png$/i.test(f.title)||/\.jpe?g$/i.test(f.title)||/\.pdf$/i.test(f.title),null,null,null,v)});B()}}catch(d){if(null!=l)l(d);else throw d;}};DriveClient.prototype.saveFile=function(f,c,l,p,q,v,D,G,B){try{var d=0;f.saveLevel=1;var g=mxUtils.bind(this,function(V){if(null!=p)p(V);else throw V;}),k=mxUtils.bind(this,function(V){g(V);try{EditorUi.logError(V.message,null,+null,null,V)}catch(P){}});if(f.isEditable()&&null!=f.desc){var m=Date.now(),t=f.desc.etag,y=f.desc.modifiedDate,z=f.desc.headRevisionId,I=this.ui.useCanvasForExport&&/(\.png)$/i.test(f.getTitle());v=null!=v?v:!1;var F=null,C=!1,Q={mimeType:f.desc.mimeType,title:f.getTitle()};if(this.isGoogleRealtimeMimeType(Q.mimeType))Q.mimeType=this.xmlMimeType,F=f.desc,C=c=!0;else if("application/octet-stream"==Q.mimeType||"1"==urlParams["override-mime"]&&Q.mimeType!=this.xmlMimeType)Q.mimeType=this.xmlMimeType;var S=mxUtils.bind(this,function(V,P,u){try{f.saveLevel=3;var x=f.getData(),J=null,H=null;f.constructor==DriveFile&&(null==G&&(G=[]),null==f.getChannelId()&&G.push({key:"channel",value:Editor.guid(32)}),null==f.getChannelKey()&&G.push({key:"key",value:Editor.guid(32)}),B=null!=B?B:Editor.guid(32),G.push({key:"secret",value:B}),H=this.ui.getPagesForXml(x),J=this.ui.getHashValueForPages(H),G.push({key:"checksum",value:B+":"+J}));u||(null!=V||v||(V=this.placeholderThumbnail,P=this.placeholderMimeType),-null!=V&&null!=P&&(Q.thumbnail={image:V,mimeType:P}));var K=mxUtils.bind(this,function(n){try{if(f.saveDelay=Date.now()-m,f.saveLevel=null,l(n,x,H,J),null!=F){this.executeRequest({url:"/files/"+F.id+"/revisions/"+F.headRevisionId+"?supportsAllDrives=true"},mxUtils.bind(this,mxUtils.bind(this,function(z){z.pinned=!0;this.executeRequest({url:"/files/"+F.id+"/revisions/"+F.headRevisionId,method:"PUT",params:z})})));try{EditorUi.logEvent({category:f.convertedFrom+"-CONVERT-FILE-"+f.getHash(),action:"from_"+-F.id+"."+F.headRevisionId+"-to_"+f.desc.id+"."+f.desc.headRevisionId,label:null!=this.user?"user_"+this.user.id:"nouser"+(null!=f.sync?"-client_"+f.sync.clientId:"nosync")})}catch(z){}}}catch(z){k(z)}}),O=mxUtils.bind(this,function(n,z){f.saveLevel=4;try{null!=G&&(Q.properties=G);var D=E||f.constructor!=DriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:f.getCurrentEtag(),L=mxUtils.bind(this,function(T){f.saveLevel=5;try{var U=f.desc.mimeType!=this.xmlMimeType&&f.desc.mimeType!=this.mimeType&&-f.desc.mimeType!=this.libraryMimeType,W=!0,X=null;try{X=window.setTimeout(mxUtils.bind(this,function(){W=!1;g({code:App.ERROR_TIMEOUT})}),5*this.ui.timeout)}catch(Y){}this.executeRequest(this.createUploadRequest(f.getId(),Q,n,c||T||U,z,T?null:D,C),mxUtils.bind(this,function(Y){window.clearTimeout(X);if(W){var Z=null!=Y?(new Date(Y.modifiedDate)).getTime()-(new Date(y)).getTime():0;if(0>=Z||t==Y.etag||c&&A==Y.headRevisionId){var ca=[];null==Y?ca.push("Empty response"):(0>=Z&&ca.push("Invalid modified time"),-t==Y.etag&&ca.push("Stale etag"),c&&A==Y.headRevisionId&&ca.push("Stale revision"),D=Y.etag);0==ca.length&&ca.push(mxResources.get("unknownError"));Z=ca.join(", ");if(d<this.staleEtagMaxRetries)d++,ca=Math.round(Math.pow(2,d)*this.coolOff*(1+.1*(Math.random()-.5))),window.setTimeout(L,ca),"1"==urlParams.test&&EditorUi.debug("DriveClient: Invalid response","retry",d,"delay",ca,"rev",null!=Y?Y.headRevisionId:"null","errors",Z);else{f.saveLevel=12;g({message:mxResources.get("error")+": "+Z},Y);try{EditorUi.logError("Saving to Google Drive failed",-null,"id-"+f.desc.id+"-from-"+A+"."+y+"-"+this.ui.hashValue(t)+"-to-"+Y.headRevisionId+"."+Y.modifiedDate+"-"+this.ui.hashValue(Y.etag)+(0<Z.length?"-errors-"+Z:""),"user-"+(null!=this.user?this.user.id:"nouser")+(null!=f.sync?"-client_"+f.sync.clientId:"-nosync")+"-retries-"+d+"-delay-"+(Date.now()-m))}catch(ea){}}}else K(Y)}}),mxUtils.bind(this,function(Y){window.clearTimeout(X);if(W){f.saveLevel=6;try{f.isConflict(Y)?this.executeRequest({url:"/files/"+f.getId()+"?supportsAllDrives=true&fields="+-this.catchupFields},mxUtils.bind(this,function(Z){f.saveLevel=7;try{if(null!=Z&&Z.etag==D)if(d<this.staleEtagMaxRetries){d++;var ca=Math.round(2*d*this.coolOff*(1+.1*(Math.random()-.5)));window.setTimeout(N,ca);"1"==urlParams.test&&EditorUi.debug("DriveClient: Stale Etag Detected","retry",d,"delay",ca)}else{N(!0);try{EditorUi.logEvent({category:"STALE-ETAG-SAVE-FILE-"+f.getHash(),action:"rev_"+f.desc.headRevisionId+"-mod_"+f.desc.modifiedDate+"-size_"+f.getSize()+"-mime_"+f.desc.mimeType+(this.ui.editor.autosave?-"":"-nosave")+(f.isAutosave()?"":"-noauto")+(f.changeListenerEnabled?"":"-nolisten")+(f.inConflictState?"-conflict":"")+(f.invalidChecksum?"-invalid":""),label:(null!=this.user?"user_"+this.user.id:"nouser")+(null!=f.sync?"-client_"+f.sync.clientId:"-nosync")})}catch(ea){}}else"1"==urlParams.test&&Z.headRevisionId==A&&EditorUi.debug("DriveClient: Remote Etag Changed","local",D,"remote",Z.etag,"rev",f.desc.headRevisionId,"response",[Z],"file",[f]),g(Y,Z)}catch(ea){k(ea)}}),mxUtils.bind(this,function(){g(Y)})):-g(Y)}catch(Z){k(Z)}}}))}catch(Y){k(Y)}}),N=mxUtils.bind(this,function(T){f.saveLevel=9;if(T||null==D)L(T);else{var U=!0,W=null;try{W=window.setTimeout(mxUtils.bind(this,function(){U=!1;g({code:App.ERROR_TIMEOUT})}),3*this.ui.timeout)}catch(X){}this.executeRequest({url:"/files/"+f.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},mxUtils.bind(this,function(X){window.clearTimeout(W);if(U){f.saveLevel=10;try{null!=X&&X.headRevisionId==A?("1"==urlParams.test&&D!=X.etag&&EditorUi.debug("DriveClient: Preflight Etag Update",-"from",D,"to",X.etag,"rev",f.desc.headRevisionId,"response",[X],"file",[f]),D=X.etag,L(T)):g({error:{code:412}},X)}catch(Y){k(Y)}}}),mxUtils.bind(this,function(X){window.clearTimeout(W);U&&(f.saveLevel=11,g(X))}))}});if(I&&null==V){f.saveLevel=8;var R=new Image;R.onload=mxUtils.bind(this,function(){try{var T=this.thumbnailWidth/R.width,U=document.createElement("canvas");U.width=this.thumbnailWidth;U.height=Math.floor(R.height*T);U.getContext("2d").drawImage(R,0,0,U.width,U.height);var W=U.toDataURL();-W=W.substring(W.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");Q.thumbnail={image:W,mimeType:"image/png"};N(!1)}catch(X){try{N(!1)}catch(Y){k(Y)}}});R.src="data:image/png;base64,"+n}else N(!1)}catch(T){k(T)}});if(I){var M=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(n){O(n,!0)}),g,this.ui.getCurrentFile()!=f?x:null,M.scale,M.border)}else O(x,!1)}catch(n){k(n)}});try{f.saveLevel=2,(v||I||f.constructor==DriveLibrary||!this.enableThumbnails||+null!=V&&null!=P&&(Q.thumbnail={image:V,mimeType:P}));var K=mxUtils.bind(this,function(n){try{if(f.saveDelay=Date.now()-m,f.saveLevel=null,l(n,x,H,J),null!=F){this.executeRequest({url:"/files/"+F.id+"/revisions/"+F.headRevisionId+"?supportsAllDrives=true"},mxUtils.bind(this,mxUtils.bind(this,function(A){A.pinned=!0;this.executeRequest({url:"/files/"+F.id+"/revisions/"+F.headRevisionId,method:"PUT",params:A})})));try{EditorUi.logEvent({category:f.convertedFrom+"-CONVERT-FILE-"+f.getHash(),action:"from_"++F.id+"."+F.headRevisionId+"-to_"+f.desc.id+"."+f.desc.headRevisionId,label:null!=this.user?"user_"+this.user.id:"nouser"+(null!=f.sync?"-client_"+f.sync.clientId:"nosync")})}catch(A){}}}catch(A){k(A)}}),N=mxUtils.bind(this,function(n,A){f.saveLevel=4;try{null!=G&&(Q.properties=G);var E=D||f.constructor!=DriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:f.getCurrentEtag(),L=mxUtils.bind(this,function(T){f.saveLevel=5;try{var U=f.desc.mimeType!=this.xmlMimeType&&f.desc.mimeType!=this.mimeType&&+f.desc.mimeType!=this.libraryMimeType,W=!0,X=null;try{X=window.setTimeout(mxUtils.bind(this,function(){W=!1;g({code:App.ERROR_TIMEOUT})}),5*this.ui.timeout)}catch(Y){}this.executeRequest(this.createUploadRequest(f.getId(),Q,n,c||T||U,A,T?null:E,C),mxUtils.bind(this,function(Y){window.clearTimeout(X);if(W){var Z=null!=Y?(new Date(Y.modifiedDate)).getTime()-(new Date(y)).getTime():0;if(0>=Z||t==Y.etag||c&&z==Y.headRevisionId){var ca=[];null==Y?ca.push("Empty response"):(0>=Z&&ca.push("Invalid modified time"),+t==Y.etag&&ca.push("Stale etag"),c&&z==Y.headRevisionId&&ca.push("Stale revision"),E=Y.etag);0==ca.length&&ca.push(mxResources.get("unknownError"));Z=ca.join(", ");if(d<this.staleEtagMaxRetries)d++,ca=Math.round(Math.pow(2,d)*this.coolOff*(1+.1*(Math.random()-.5))),window.setTimeout(L,ca),"1"==urlParams.test&&EditorUi.debug("DriveClient: Invalid response","retry",d,"delay",ca,"rev",null!=Y?Y.headRevisionId:"null","errors",Z);else{f.saveLevel=12;g({message:mxResources.get("error")+": "+Z},Y);try{EditorUi.logError("Saving to Google Drive failed",+null,"id-"+f.desc.id+"-from-"+z+"."+y+"-"+this.ui.hashValue(t)+"-to-"+Y.headRevisionId+"."+Y.modifiedDate+"-"+this.ui.hashValue(Y.etag)+(0<Z.length?"-errors-"+Z:""),"user-"+(null!=this.user?this.user.id:"nouser")+(null!=f.sync?"-client_"+f.sync.clientId:"-nosync")+"-retries-"+d+"-delay-"+(Date.now()-m))}catch(ea){}}}else K(Y)}}),mxUtils.bind(this,function(Y){window.clearTimeout(X);if(W){f.saveLevel=6;try{f.isConflict(Y)?this.executeRequest({url:"/files/"+f.getId()+"?supportsAllDrives=true&fields="++this.catchupFields},mxUtils.bind(this,function(Z){f.saveLevel=7;try{if(null!=Z&&Z.etag==E)if(d<this.staleEtagMaxRetries){d++;var ca=Math.round(2*d*this.coolOff*(1+.1*(Math.random()-.5)));window.setTimeout(O,ca);"1"==urlParams.test&&EditorUi.debug("DriveClient: Stale Etag Detected","retry",d,"delay",ca)}else{O(!0);try{EditorUi.logEvent({category:"STALE-ETAG-SAVE-FILE-"+f.getHash(),action:"rev_"+f.desc.headRevisionId+"-mod_"+f.desc.modifiedDate+"-size_"+f.getSize()+"-mime_"+f.desc.mimeType+(this.ui.editor.autosave?+"":"-nosave")+(f.isAutosave()?"":"-noauto")+(f.changeListenerEnabled?"":"-nolisten")+(f.inConflictState?"-conflict":"")+(f.invalidChecksum?"-invalid":""),label:(null!=this.user?"user_"+this.user.id:"nouser")+(null!=f.sync?"-client_"+f.sync.clientId:"-nosync")})}catch(ea){}}else"1"==urlParams.test&&Z.headRevisionId==z&&EditorUi.debug("DriveClient: Remote Etag Changed","local",E,"remote",Z.etag,"rev",f.desc.headRevisionId,"response",[Z],"file",[f]),g(Y,Z)}catch(ea){k(ea)}}),mxUtils.bind(this,function(){g(Y)})):+g(Y)}catch(Z){k(Z)}}}))}catch(Y){k(Y)}}),O=mxUtils.bind(this,function(T){f.saveLevel=9;if(T||null==E)L(T);else{var U=!0,W=null;try{W=window.setTimeout(mxUtils.bind(this,function(){U=!1;g({code:App.ERROR_TIMEOUT})}),3*this.ui.timeout)}catch(X){}this.executeRequest({url:"/files/"+f.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},mxUtils.bind(this,function(X){window.clearTimeout(W);if(U){f.saveLevel=10;try{null!=X&&X.headRevisionId==z?("1"==urlParams.test&&E!=X.etag&&EditorUi.debug("DriveClient: Preflight Etag Update",+"from",E,"to",X.etag,"rev",f.desc.headRevisionId,"response",[X],"file",[f]),E=X.etag,L(T)):g({error:{code:412}},X)}catch(Y){k(Y)}}}),mxUtils.bind(this,function(X){window.clearTimeout(W);U&&(f.saveLevel=11,g(X))}))}});if(I&&null==V){f.saveLevel=8;var R=new Image;R.onload=mxUtils.bind(this,function(){try{var T=this.thumbnailWidth/R.width,U=document.createElement("canvas");U.width=this.thumbnailWidth;U.height=Math.floor(R.height*T);U.getContext("2d").drawImage(R,0,0,U.width,U.height);var W=U.toDataURL();+W=W.substring(W.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");Q.thumbnail={image:W,mimeType:"image/png"};O(!1)}catch(X){try{O(!1)}catch(Y){k(Y)}}});R.src="data:image/png;base64,"+n}else O(!1)}catch(T){k(T)}});if(I){var M=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(n){N(n,!0)}),g,this.ui.getCurrentFile()!=f?x:null,M.scale,M.border)}else N(x,!1)}catch(n){k(n)}});try{f.saveLevel=2,(v||I||f.constructor==DriveLibrary||!this.enableThumbnails||"0"==urlParams.thumb||null!=Q.mimeType&&"application/vnd.jgraph.mxfile"!=Q.mimeType.substring(0,29)||!this.ui.getThumbnail(this.thumbnailWidth,mxUtils.bind(this,function(V){try{var P=null;try{null!=V&&(P=V.toDataURL("image/png")),null!=P&&(P=P.length>this.maxThumbnailSize?null:P.substring(P.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_"))}catch(u){P=null}S(P,"image/png")}catch(u){k(u)}}),20))&&S(null,null,f.constructor!=DriveLibrary)}catch(V){k(V)}}else this.ui.editor.graph.reset(),g({message:mxResources.get("readOnly")})}catch(V){k(V)}};-DriveClient.prototype.insertFile=function(f,c,l,p,q,v,E){v=null!=v?v:this.xmlMimeType;f={mimeType:v,title:f};null!=l&&(f.parents=[{kind:"drive#fileLink",id:l}]);this.executeRequest(this.createUploadRequest(null,f,c,!1,E),mxUtils.bind(this,function(G){v==this.libraryMimeType?p(new DriveLibrary(this.ui,c,G)):0==G?null!=q&&q({message:mxResources.get("errorSavingFile")}):p(new DriveFile(this.ui,c,G))}),q)};DriveClient.prototype.createUploadRequest=function(f,c,l,p,q,v,E){q=null!=q?q:!1;var G={"Content-Type":'multipart/mixed; boundary="-------314159265358979323846"'};+DriveClient.prototype.insertFile=function(f,c,l,p,q,v,D){v=null!=v?v:this.xmlMimeType;f={mimeType:v,title:f};null!=l&&(f.parents=[{kind:"drive#fileLink",id:l}]);this.executeRequest(this.createUploadRequest(null,f,c,!1,D),mxUtils.bind(this,function(G){v==this.libraryMimeType?p(new DriveLibrary(this.ui,c,G)):0==G?null!=q&&q({message:mxResources.get("errorSavingFile")}):p(new DriveFile(this.ui,c,G))}),q)};DriveClient.prototype.createUploadRequest=function(f,c,l,p,q,v,D){q=null!=q?q:!1;var G={"Content-Type":'multipart/mixed; boundary="-------314159265358979323846"'};null!=v&&(G["If-Match"]=v);f={fullUrl:"https://content.googleapis.com/upload/drive/v2/files"+(null!=f?"/"+f:"")+"?uploadType=multipart&supportsAllDrives=true&enforceSingleParent=true&fields="+this.allFields,method:null!=f?"PUT":"POST",headers:G,params:"\r\n---------314159265358979323846\r\nContent-Type: application/json\r\n\r\n"+JSON.stringify(c)+"\r\n---------314159265358979323846\r\nContent-Type: application/octect-stream\r\nContent-Transfer-Encoding: base64\r\n\r\n"+(null!=l?q?l:!window.btoa||-mxClient.IS_IE||mxClient.IS_IE11?Base64.encode(l):Graph.base64EncodeUnicode(l):"")+"\r\n---------314159265358979323846--"};p||(f.fullUrl+="&newRevision=false");E&&(f.fullUrl+="&pinned=true");return f};DriveClient.prototype.createLinkPicker=function(){var f=e.linkPicker;if(null==f||e.linkPickerToken!=b){e.linkPickerToken=b;f=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0);var c=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0),+mxClient.IS_IE||mxClient.IS_IE11?Base64.encode(l):Graph.base64EncodeUnicode(l):"")+"\r\n---------314159265358979323846--"};p||(f.fullUrl+="&newRevision=false");D&&(f.fullUrl+="&pinned=true");return f};DriveClient.prototype.createLinkPicker=function(){var f=e.linkPicker;if(null==f||e.linkPickerToken!=b){e.linkPickerToken=b;f=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0);var c=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0),l=(new google.picker.DocsView).setIncludeFolders(!0).setEnableDrives(!0).setSelectFolderEnabled(!0);f=(new google.picker.PickerBuilder).setAppId(this.appId).setLocale(mxLanguage).setOAuthToken(e.linkPickerToken).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(f).addView(c).addView(l).addView(google.picker.ViewId.RECENTLY_PICKED)}return f};DriveClient.prototype.pickFile=function(f,c,l){this.filePickerCallback=null!=f?f:mxUtils.bind(this,function(p){this.ui.loadFile("G"+p)});this.filePicked=mxUtils.bind(this,function(p){p.action==google.picker.Action.PICKED&&this.filePickerCallback(p.docs[0].id,p.docs[0])});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var p=c?"genericPicker":"filePicker",q=mxUtils.bind(this,function(g){"picker modal-dialog-bg picker-dialog-bg"==mxEvent.getSource(g).className&&(mxEvent.removeListener(document,"click",q),this[p].setVisible(!1),l&&l())});if(null==e[p]||e[p+"Token"]!=-b){e[p+"Token"]=b;var v=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0),E=(new google.picker.DocsView).setIncludeFolders(!0),G=(new google.picker.DocsView).setEnableDrives(!0).setIncludeFolders(!0),B=(new google.picker.DocsUploadView).setIncludeFolders(!0);c?(v.setMimeTypes("*/*"),E.setMimeTypes("*/*"),G.setMimeTypes("*/*")):(v.setMimeTypes(this.mimeTypes),E.setMimeTypes(this.mimeTypes),G.setMimeTypes(this.mimeTypes));e[p]=(new google.picker.PickerBuilder).setOAuthToken(e[p+-"Token"]).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(v).addView(E).addView(G).addView(google.picker.ViewId.RECENTLY_PICKED).addView(B);if(urlParams.gPickerSize){var d=urlParams.gPickerSize.split(",");e[p]=e[p].setSize(d[0],d[1])}urlParams.topBaseUrl&&(e[p]=e[p].setOrigin(decodeURIComponent(urlParams.topBaseUrl)));e[p]=e[p].setCallback(mxUtils.bind(this,function(g){if(g.action==google.picker.Action.PICKED||g.action==google.picker.Action.CANCEL)mxEvent.removeListener(document,+b){e[p+"Token"]=b;var v=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0),D=(new google.picker.DocsView).setIncludeFolders(!0),G=(new google.picker.DocsView).setEnableDrives(!0).setIncludeFolders(!0),B=(new google.picker.DocsUploadView).setIncludeFolders(!0);c?(v.setMimeTypes("*/*"),D.setMimeTypes("*/*"),G.setMimeTypes("*/*")):(v.setMimeTypes(this.mimeTypes),D.setMimeTypes(this.mimeTypes),G.setMimeTypes(this.mimeTypes));e[p]=(new google.picker.PickerBuilder).setOAuthToken(e[p++"Token"]).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(v).addView(D).addView(G).addView(google.picker.ViewId.RECENTLY_PICKED).addView(B);if(urlParams.gPickerSize){var d=urlParams.gPickerSize.split(",");e[p]=e[p].setSize(d[0],d[1])}urlParams.topBaseUrl&&(e[p]=e[p].setOrigin(decodeURIComponent(urlParams.topBaseUrl)));e[p]=e[p].setCallback(mxUtils.bind(this,function(g){if(g.action==google.picker.Action.PICKED||g.action==google.picker.Action.CANCEL)mxEvent.removeListener(document,"click",q),l&&g.action==google.picker.Action.CANCEL&&l();g.action==google.picker.Action.PICKED&&this.filePicked(g)})).build()}mxEvent.addListener(document,"click",q);e[p].setVisible(!0)}catch(g){this.ui.spinner.stop(),this.ui.handleError(g)}}))};DriveClient.prototype.pickFolder=function(f,c){this.folderPickerCallback=f;var l=mxUtils.bind(this,function(){try{this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var p=mxUtils.bind(this,function(B){"picker modal-dialog-bg picker-dialog-bg"==mxEvent.getSource(B).className&&(mxEvent.removeListener(document,"click",p),e.folderPicker.setVisible(!1))});if(null==e.folderPicker||e.folderPickerToken!=b){e.folderPickerToken=b;var q=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),v=(new google.picker.DocsView).setIncludeFolders(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder"),-E=(new google.picker.DocsView).setIncludeFolders(!0).setEnableDrives(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder");e.folderPicker=(new google.picker.PickerBuilder).setSelectableMimeTypes("application/vnd.google-apps.folder").setOAuthToken(e.folderPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(q).addView(v).addView(E).addView(google.picker.ViewId.RECENTLY_PICKED).setTitle(mxResources.get("pickFolder"));+D=(new google.picker.DocsView).setIncludeFolders(!0).setEnableDrives(!0).setSelectFolderEnabled(!0).setMimeTypes("application/vnd.google-apps.folder");e.folderPicker=(new google.picker.PickerBuilder).setSelectableMimeTypes("application/vnd.google-apps.folder").setOAuthToken(e.folderPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(q).addView(v).addView(D).addView(google.picker.ViewId.RECENTLY_PICKED).setTitle(mxResources.get("pickFolder"));if(urlParams.gPickerSize){var G=urlParams.gPickerSize.split(",");e.folderPicker=e.folderPicker.setSize(G[0],G[1])}urlParams.topBaseUrl&&(e.folderPicker=e.folderPicker.setOrigin(decodeURIComponent(urlParams.topBaseUrl)));e.folderPicker=e.folderPicker.setCallback(mxUtils.bind(this,function(B){B.action!=google.picker.Action.PICKED&&B.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",p);this.folderPickerCallback(B)})).build()}mxEvent.addListener(document,"click",p);e.folderPicker.setVisible(!0)}catch(B){this.ui.spinner.stop(),this.ui.handleError(B)}}))}catch(p){this.ui.handleError(p)}});c?l():this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop(),this.ui.confirm(mxResources.get("useRootFolder"),mxUtils.bind(this,function(){this.folderPickerCallback({action:google.picker.Action.PICKED,docs:[{type:"folder",id:"root"}]})}),mxUtils.bind(this,function(){l()}),mxResources.get("yes"),mxResources.get("noPickFolder")+"...",!0)}catch(p){this.ui.handleError(p)}}))};DriveClient.prototype.pickLibrary=function(f){this.filePickerCallback=f;this.filePicked=mxUtils.bind(this,function(c){c.action==google.picker.Action.PICKED?this.filePickerCallback(c.docs[0].id):c.action==google.picker.Action.CANCEL&&null==this.ui.getCurrentFile()&&this.ui.showSplash()});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var c=mxUtils.bind(this,function(G){"picker modal-dialog-bg picker-dialog-bg"==mxEvent.getSource(G).className&&(mxEvent.removeListener(document,"click",c),e.libraryPicker.setVisible(!1))});if(null==e.libraryPicker||e.libraryPickerToken!=b){e.libraryPickerToken=b;var l=(new google.picker.DocsView(google.picker.ViewId.FOLDERS)).setParent("root").setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),p=(new google.picker.DocsView).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),-q=(new google.picker.DocsView).setEnableDrives(!0).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),v=(new google.picker.DocsUploadView).setIncludeFolders(!0);e.libraryPicker=(new google.picker.PickerBuilder).setOAuthToken(e.libraryPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(l).addView(p).addView(q).addView(google.picker.ViewId.RECENTLY_PICKED).addView(v);if(urlParams.gPickerSize){var E=-urlParams.gPickerSize.split(",");e.libraryPicker=e.libraryPicker.setSize(E[0],E[1])}urlParams.topBaseUrl&&(e.libraryPicker=e.libraryPicker.setOrigin(decodeURIComponent(urlParams.topBaseUrl)));e.libraryPicker=e.libraryPicker.setCallback(mxUtils.bind(this,function(G){G.action!=google.picker.Action.PICKED&&G.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",c);G.action==google.picker.Action.PICKED&&this.filePicked(G)})).build()}mxEvent.addListener(document,"click",c);e.libraryPicker.setVisible(!0)}catch(G){this.ui.spinner.stop(),+q=(new google.picker.DocsView).setEnableDrives(!0).setIncludeFolders(!0).setMimeTypes(this.libraryMimeType+",application/xml,text/plain,application/octet-stream"),v=(new google.picker.DocsUploadView).setIncludeFolders(!0);e.libraryPicker=(new google.picker.PickerBuilder).setOAuthToken(e.libraryPickerToken).setLocale(mxLanguage).setAppId(this.appId).enableFeature(google.picker.Feature.SUPPORT_DRIVES).addView(l).addView(p).addView(q).addView(google.picker.ViewId.RECENTLY_PICKED).addView(v);if(urlParams.gPickerSize){var D=+urlParams.gPickerSize.split(",");e.libraryPicker=e.libraryPicker.setSize(D[0],D[1])}urlParams.topBaseUrl&&(e.libraryPicker=e.libraryPicker.setOrigin(decodeURIComponent(urlParams.topBaseUrl)));e.libraryPicker=e.libraryPicker.setCallback(mxUtils.bind(this,function(G){G.action!=google.picker.Action.PICKED&&G.action!=google.picker.Action.CANCEL||mxEvent.removeListener(document,"click",c);G.action==google.picker.Action.PICKED&&this.filePicked(G)})).build()}mxEvent.addListener(document,"click",c);e.libraryPicker.setVisible(!0)}catch(G){this.ui.spinner.stop(),this.ui.handleError(G)}}))};DriveClient.prototype.showPermissions=function(f,c){var l=mxUtils.bind(this,function(){var p=new ConfirmDialog(this.ui,mxResources.get("googleSharingNotAvailable"),mxUtils.bind(this,function(){var q=null!=c?c.getFolderUrl():"https://drive.google.com/open?id="+f;this.ui.editor.graph.openLink(q)}),null,mxResources.get("open"),null,null,null,null,IMAGE_PATH+"/google-share.png");this.ui.showDialog(p.container,400,150,!0,!0);p.init()});this.sharingFailed?l():this.checkToken(mxUtils.bind(this,-function(){try{var p=new gapi.drive.share.ShareClient(this.appId);p.setOAuthToken(b);p.setItemIds([f]);p.showSettingsDialog();"MutationObserver"in window&&(null!=this.sharingObserver&&(this.sharingObserver.disconnect(),this.sharingObserver=null),this.sharingObserver=new MutationObserver(mxUtils.bind(this,function(q){for(var v=!1,E=0;E<q.length;E++)for(var G=0;G<q[E].addedNodes.length;G++){var B=q[E].addedNodes[G];"BUTTON"==B.nodeName&&"ok"==B.getAttribute("name")&&null!=B.parentNode&&null!=B.parentNode.parentNode&&+function(){try{var p=new gapi.drive.share.ShareClient(this.appId);p.setOAuthToken(b);p.setItemIds([f]);p.showSettingsDialog();"MutationObserver"in window&&(null!=this.sharingObserver&&(this.sharingObserver.disconnect(),this.sharingObserver=null),this.sharingObserver=new MutationObserver(mxUtils.bind(this,function(q){for(var v=!1,D=0;D<q.length;D++)for(var G=0;G<q[D].addedNodes.length;G++){var B=q[D].addedNodes[G];"BUTTON"==B.nodeName&&"ok"==B.getAttribute("name")&&null!=B.parentNode&&null!=B.parentNode.parentNode&&"dialog"==B.parentNode.parentNode.getAttribute("role")?(this.sharingFailed=!0,B.click(),l(),v=!0):"DIV"==B.nodeName&&"shr-q-shr-r-shr-xb"==B.className&&(v=!0)}v&&(this.sharingObserver.disconnect(),this.sharingObserver=null)})),this.sharingObserver.observe(document,{childList:!0,subtree:!0}))}catch(q){this.ui.handleError(q)}}))};DriveClient.prototype.clearPersistentToken=function(){var f=JSON.parse(this.getPersistentToken(!0))||{};delete f.current;delete f[this.userId];for(var c in f){f.current={userId:c,expires:0};break}DrawioClient.prototype.setPersistentToken.call(this,JSON.stringify(f))};DriveClient.prototype.setPersistentToken=function(f,c){var l=JSON.parse(this.getPersistentToken(!0))||{};f.userId=this.userId;l.current=f;l[this.userId]={user:this.user};DrawioClient.prototype.setPersistentToken.call(this,JSON.stringify(l),c)}})();DropboxFile=function(b,e,f){DrawioFile.call(this,b,e);this.stat=f};mxUtils.extend(DropboxFile,DrawioFile);DropboxFile.prototype.getId=function(){return this.stat.path_display.substring(1)};DropboxFile.prototype.getHash=function(){return"D"+encodeURIComponent(this.getId())};DropboxFile.prototype.getMode=function(){return App.MODE_DROPBOX};DropboxFile.prototype.isAutosaveOptional=function(){return!0};DropboxFile.prototype.getTitle=function(){return this.stat.name};DropboxFile.prototype.isRenamable=function(){return!0};DropboxFile.prototype.getSize=function(){return this.stat.size};DropboxFile.prototype.isRevisionHistorySupported=function(){return!0};DropboxFile.prototype.getFileUrl=function(){return"https://www.dropbox.com/home/Apps"+this.ui.dropbox.appPath+this.stat.path_display};DropboxFile.prototype.getFolderUrl=function(){var b=this.getFileUrl();return b.substring(0,b.lastIndexOf("/"))};-DropboxFile.prototype.getRevisions=function(b,e){var f=this.ui.dropbox.client.filesListRevisions({path:this.stat.path_lower,limit:100});f.then(mxUtils.bind(this,function(c){try{for(var l=[],p=c.entries.length-1;0<=p;p--)mxUtils.bind(this,function(q){l.push({modifiedDate:q.client_modified,fileSize:q.size,getXml:mxUtils.bind(this,function(v,E){this.ui.dropbox.readFile({path:this.stat.path_lower,rev:q.rev},v,E)}),getUrl:mxUtils.bind(this,function(v){return this.ui.getUrl(window.location.pathname+"?rev="++DropboxFile.prototype.getRevisions=function(b,e){var f=this.ui.dropbox.client.filesListRevisions({path:this.stat.path_lower,limit:100});f.then(mxUtils.bind(this,function(c){try{for(var l=[],p=c.entries.length-1;0<=p;p--)mxUtils.bind(this,function(q){l.push({modifiedDate:q.client_modified,fileSize:q.size,getXml:mxUtils.bind(this,function(v,D){this.ui.dropbox.readFile({path:this.stat.path_lower,rev:q.rev},v,D)}),getUrl:mxUtils.bind(this,function(v){return this.ui.getUrl(window.location.pathname+"?rev="+q.rev+"&chrome=0&nav=1&layers=1&edit=_blank"+(null!=v?"&page="+v:""))+window.location.hash})})})(c.entries[p]);b(l)}catch(q){e(q)}}));f["catch"](function(c){e(c)})};DropboxFile.prototype.getLatestVersion=function(b,e){this.ui.dropbox.getFile(this.getId(),b,e)};DropboxFile.prototype.updateDescriptor=function(b){this.stat=b.stat};DropboxFile.prototype.save=function(b,e,f,c,l){this.doSave(this.getTitle(),b,e,f,c,l)};DropboxFile.prototype.saveAs=function(b,e,f){this.doSave(b,!1,e,f)};DropboxFile.prototype.doSave=function(b,e,f,c,l,p){var q=this.stat.name;this.stat.name=b;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.stat.name=q;this.saveFile(b,e,f,c,l,p)}),c,l,p])};-DropboxFile.prototype.saveFile=function(b,e,f,c){this.isEditable()?this.savingFile?null!=c&&c({code:App.ERROR_BUSY}):(e=mxUtils.bind(this,function(l){if(l)try{this.savingFileTime=new Date;this.setShadowModified(!1);this.savingFile=!0;var p=mxUtils.bind(this,function(v){var E=this.stat.path_display.lastIndexOf("/");E=1<E?this.stat.path_display.substring(1,E+1):null;this.ui.dropbox.saveFile(b,v,mxUtils.bind(this,function(G){this.setModified(this.getShadowModified());this.savingFile=!1;this.stat=G;this.contentChanged();-null!=f&&f()}),mxUtils.bind(this,function(G){this.savingFile=!1;null!=c&&c(G)}),E)});if(this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle())){var q=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(v){p(this.ui.base64ToBlob(v,"image/png"))}),c,this.ui.getCurrentFile()!=this?this.getData():null,q.scale,q.border)}else p(this.getData())}catch(v){if(this.savingFile=!1,null!=c)c(v);else throw v;}else null!=c&&c()}),this.getTitle()==b?e(!0):this.ui.dropbox.checkExists(b,+DropboxFile.prototype.saveFile=function(b,e,f,c){this.isEditable()?this.savingFile?null!=c&&c({code:App.ERROR_BUSY}):(e=mxUtils.bind(this,function(l){if(l)try{this.savingFileTime=new Date;this.setShadowModified(!1);this.savingFile=!0;var p=mxUtils.bind(this,function(v){var D=this.stat.path_display.lastIndexOf("/");D=1<D?this.stat.path_display.substring(1,D+1):null;this.ui.dropbox.saveFile(b,v,mxUtils.bind(this,function(G){this.setModified(this.getShadowModified());this.savingFile=!1;this.stat=G;this.contentChanged();+null!=f&&f()}),mxUtils.bind(this,function(G){this.savingFile=!1;null!=c&&c(G)}),D)});if(this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle())){var q=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(v){p(this.ui.base64ToBlob(v,"image/png"))}),c,this.ui.getCurrentFile()!=this?this.getData():null,q.scale,q.border)}else p(this.getData())}catch(v){if(this.savingFile=!1,null!=c)c(v);else throw v;}else null!=c&&c()}),this.getTitle()==b?e(!0):this.ui.dropbox.checkExists(b,e)):null!=f&&f()};DropboxFile.prototype.rename=function(b,e,f){this.ui.dropbox.renameFile(this,b,mxUtils.bind(this,function(c){this.hasSameExtension(b,this.getTitle())?(this.stat=c,this.descriptorChanged(),null!=e&&e()):(this.stat=c,this.descriptorChanged(),this.save(!0,e,f))}),f)};DropboxLibrary=function(b,e,f){DropboxFile.call(this,b,e,f)};mxUtils.extend(DropboxLibrary,DropboxFile);DropboxLibrary.prototype.isAutosave=function(){return!0};DropboxLibrary.prototype.doSave=function(b,e,f){this.saveFile(b,!1,e,f)};DropboxLibrary.prototype.open=function(){};(function(){var b=null;window.DropboxClient=function(e){DrawioClient.call(this,e,"dbauth");this.client=new Dropbox({clientId:this.clientId})};mxUtils.extend(DropboxClient,DrawioClient);DropboxClient.prototype.appPath="/drawio-diagrams/";DropboxClient.prototype.extension=".drawio";DropboxClient.prototype.writingFile=!1;DropboxClient.prototype.maxRetries=4;DropboxClient.prototype.clientId=window.DRAWIO_DROPBOX_ID;DropboxClient.prototype.redirectUri=window.DRAWIO_SERVER_URL+"dropbox";DropboxClient.prototype.logout=function(){this.ui.editor.loadUrl(this.redirectUri+"?doLogout=1&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host));this.clearPersistentToken();this.setUser(null);b=null;this.client.authTokenRevoke().then(mxUtils.bind(this,function(){this.client.setAccessToken(null)}))};DropboxClient.prototype.updateUser=function(e,f,c){var l=!0,p=window.setTimeout(mxUtils.bind(this,function(){l=!1;f({code:App.ERROR_TIMEOUT})}),this.ui.timeout),q=this.client.usersGetCurrentAccount();q.then(mxUtils.bind(this,function(v){window.clearTimeout(p);l&&(this.setUser(new DrawioUser(v.account_id,v.email,v.name.display_name)),e())}));q["catch"](mxUtils.bind(this,function(v){window.clearTimeout(p);l&&(null==v||401!==v.status||c?f({message:mxResources.get("accessDenied")}):(this.setUser(null),this.client.setAccessToken(null),b=null,this.authenticate(mxUtils.bind(this,function(){this.updateUser(e,f,!0)}),f)))}))};DropboxClient.prototype.authenticate=function(e,f){(new mxXmlRequest(this.redirectUri+"?getState=1",null,"GET")).send(mxUtils.bind(this,function(c){200<=c.getStatus()&&299>=c.getStatus()?this.authenticateStep2(c.getText(),e,f):null!=f&&f(c)}),f)};DropboxClient.prototype.authenticateStep2=function(e,f,c){if(null==window.onDropboxCallback){var l=mxUtils.bind(this,function(){var p=!0;null!=this.getPersistentToken(!0)?(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+e),null,"GET")).send(mxUtils.bind(this,function(q){if(200<=q.getStatus()&&299>=q.getStatus())try{b=JSON.parse(q.getText()).access_token,this.client.setAccessToken(b),this.setUser(null),f()}catch(v){c({message:mxResources.get("authFailed"),retry:l})}else this.clearPersistentToken(),this.setUser(null),b=null,this.client.setAccessToken(null),401==q.getStatus()?l():c({message:mxResources.get("accessDenied"),retry:l})}),c):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(q,v){null!=window.open("https://www.dropbox.com/oauth2/authorize?client_id="+this.clientId+-(q?"&token_access_type=offline":"")+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+e),"dbauth")?window.onDropboxCallback=mxUtils.bind(this,function(E,G){if(p){window.onDropboxCallback=null;p=!1;try{null==E?c({message:mxResources.get("accessDenied"),retry:l}):(null!=v&&v(),b=E.access_token,this.client.setAccessToken(b),this.setUser(null),q&&this.setPersistentToken("remembered"),f())}catch(B){c(B)}finally{null!=-G&&G.close()}}else null!=G&&G.close()}):c({message:mxResources.get("serviceUnavailableOrBlocked"),retry:l})}),mxUtils.bind(this,function(){p&&(window.onDropboxCallback=null,p=!1,c({message:mxResources.get("accessDenied"),retry:l}))}))});l()}else c({code:App.ERROR_BUSY})};DropboxClient.prototype.executePromise=function(e,f,c){var l=mxUtils.bind(this,function(q){var v=!0,E=window.setTimeout(mxUtils.bind(this,function(){v=!1;c({code:App.ERROR_TIMEOUT,retry:p})}),this.ui.timeout),G=e();G.then(mxUtils.bind(this,-function(B){window.clearTimeout(E);v&&null!=f&&f(B)}));G["catch"](mxUtils.bind(this,function(B){window.clearTimeout(E);v&&(null==B||500!=B.status&&400!=B.status&&401!=B.status?c({message:mxResources.get("error")+" "+B.status}):(this.setUser(null),this.client.setAccessToken(null),b=null,q?c({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){p(!0)},c)})}):this.authenticate(function(){l(!0)},c)))}))}),p=mxUtils.bind(this,function(q){null==this.user?+(q?"&token_access_type=offline":"")+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+e),"dbauth")?window.onDropboxCallback=mxUtils.bind(this,function(D,G){if(p){window.onDropboxCallback=null;p=!1;try{null==D?c({message:mxResources.get("accessDenied"),retry:l}):(null!=v&&v(),b=D.access_token,this.client.setAccessToken(b),this.setUser(null),q&&this.setPersistentToken("remembered"),f())}catch(B){c(B)}finally{null!=+G&&G.close()}}else null!=G&&G.close()}):c({message:mxResources.get("serviceUnavailableOrBlocked"),retry:l})}),mxUtils.bind(this,function(){p&&(window.onDropboxCallback=null,p=!1,c({message:mxResources.get("accessDenied"),retry:l}))}))});l()}else c({code:App.ERROR_BUSY})};DropboxClient.prototype.executePromise=function(e,f,c){var l=mxUtils.bind(this,function(q){var v=!0,D=window.setTimeout(mxUtils.bind(this,function(){v=!1;c({code:App.ERROR_TIMEOUT,retry:p})}),this.ui.timeout),G=e();G.then(mxUtils.bind(this,+function(B){window.clearTimeout(D);v&&null!=f&&f(B)}));G["catch"](mxUtils.bind(this,function(B){window.clearTimeout(D);v&&(null==B||500!=B.status&&400!=B.status&&401!=B.status?c({message:mxResources.get("error")+" "+B.status}):(this.setUser(null),this.client.setAccessToken(null),b=null,q?c({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){p(!0)},c)})}):this.authenticate(function(){l(!0)},c)))}))}),p=mxUtils.bind(this,function(q){null==this.user?this.updateUser(function(){p(!0)},c,q):l(q)});null==b?this.authenticate(function(){p(!0)},c):p(!1)};DropboxClient.prototype.getLibrary=function(e,f,c){this.getFile(e,f,c,!0)};DropboxClient.prototype.getFile=function(e,f,c,l){l=null!=l?l:!1;var p=/\.png$/i.test(e);if(/^https:\/\//i.test(e)||/\.v(dx|sdx?)$/i.test(e)||/\.gliffy$/i.test(e)||/\.pdf$/i.test(e)||!this.ui.useCanvasForExport&&p){var q=mxUtils.bind(this,function(){var v=e.split("/");this.ui.convertFile(e,0<v.length?v[v.length-1]:e,null,this.extension,-f,c)});null!=b?q():this.authenticate(q,c)}else q={path:"/"+e},null!=urlParams.rev&&(q.rev=urlParams.rev),this.readFile(q,mxUtils.bind(this,function(v,E){var G=null;if(0<(p?v.lastIndexOf(","):-1)){var B=this.ui.extractGraphModelFromPng(v);null!=B&&0<B.length?v=B:G=new LocalFile(this,v,e,!0)}f(null!=G?G:l?new DropboxLibrary(this.ui,v,E):new DropboxFile(this.ui,v,E))}),c,p)};DropboxClient.prototype.readFile=function(e,f,c,l){var p=mxUtils.bind(this,function(v){var E=!0,G=window.setTimeout(mxUtils.bind(this,-function(){E=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout),B=this.client.filesGetMetadata({path:"/"+e.path.substring(1),include_deleted:!1});B.then(mxUtils.bind(this,function(d){}));B["catch"](function(d){window.clearTimeout(G);E&&null!=d&&409==d.status&&(E=!1,c({message:mxResources.get("fileNotFound")}))});B=this.client.filesDownload(e);B.then(mxUtils.bind(this,function(d){window.clearTimeout(G);if(E){E=!1;try{var g=new FileReader;g.onload=mxUtils.bind(this,function(k){f(g.result,d)});l?g.readAsDataURL(d.fileBlob):-g.readAsText(d.fileBlob)}catch(k){c(k)}}}));B["catch"](mxUtils.bind(this,function(d){window.clearTimeout(G);E&&(E=!1,null==d||500!=d.status&&400!=d.status&&401!=d.status?c({message:mxResources.get("error")+" "+d.status}):(this.client.setAccessToken(null),this.setUser(null),b=null,v?c({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){q(!0)},c)})}):this.authenticate(function(){p(!0)},c)))}))}),q=mxUtils.bind(this,function(v){null==this.user?this.updateUser(function(){q(!0)},+f,c)});null!=b?q():this.authenticate(q,c)}else q={path:"/"+e},null!=urlParams.rev&&(q.rev=urlParams.rev),this.readFile(q,mxUtils.bind(this,function(v,D){var G=null;if(0<(p?v.lastIndexOf(","):-1)){var B=this.ui.extractGraphModelFromPng(v);null!=B&&0<B.length?v=B:G=new LocalFile(this,v,e,!0)}f(null!=G?G:l?new DropboxLibrary(this.ui,v,D):new DropboxFile(this.ui,v,D))}),c,p)};DropboxClient.prototype.readFile=function(e,f,c,l){var p=mxUtils.bind(this,function(v){var D=!0,G=window.setTimeout(mxUtils.bind(this,+function(){D=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout),B=this.client.filesGetMetadata({path:"/"+e.path.substring(1),include_deleted:!1});B.then(mxUtils.bind(this,function(d){}));B["catch"](function(d){window.clearTimeout(G);D&&null!=d&&409==d.status&&(D=!1,c({message:mxResources.get("fileNotFound")}))});B=this.client.filesDownload(e);B.then(mxUtils.bind(this,function(d){window.clearTimeout(G);if(D){D=!1;try{var g=new FileReader;g.onload=mxUtils.bind(this,function(k){f(g.result,d)});l?g.readAsDataURL(d.fileBlob):+g.readAsText(d.fileBlob)}catch(k){c(k)}}}));B["catch"](mxUtils.bind(this,function(d){window.clearTimeout(G);D&&(D=!1,null==d||500!=d.status&&400!=d.status&&401!=d.status?c({message:mxResources.get("error")+" "+d.status}):(this.client.setAccessToken(null),this.setUser(null),b=null,v?c({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){q(!0)},c)})}):this.authenticate(function(){p(!0)},c)))}))}),q=mxUtils.bind(this,function(v){null==this.user?this.updateUser(function(){q(!0)},c,v):p(v)});null==b?this.authenticate(function(){q(!0)},c):q(!1)};DropboxClient.prototype.checkExists=function(e,f,c){var l=mxUtils.bind(this,function(){return this.client.filesGetMetadata({path:"/"+e.toLowerCase(),include_deleted:!1})});this.executePromise(l,mxUtils.bind(this,function(p){c?f(!1,!0,p):this.ui.confirm(mxResources.get("replaceIt",[e]),function(){f(!0,!0,p)},function(){f(!1,!0,p)})}),function(p){f(!0,!1)})};DropboxClient.prototype.renameFile=function(e,f,c,l){if(/[\\\/:\?\*"\|]/.test(f))l({message:mxResources.get("dropboxCharsNotAllowed")});-else{if(null!=e&&null!=f){var p=e.stat.path_display.substring(1),q=p.lastIndexOf("/");0<q&&(f=p.substring(0,q+1)+f)}null!=e&&null!=f&&e.stat.path_lower.substring(1)!==f.toLowerCase()?this.checkExists(f,mxUtils.bind(this,function(v,E,G){v?(v=mxUtils.bind(this,function(B){B=mxUtils.bind(this,function(){return this.client.filesMove({from_path:e.stat.path_display,to_path:"/"+f,autorename:!1})});this.executePromise(B,c,l)}),E&&G.path_lower.substring(1)!==f.toLowerCase()?(E=mxUtils.bind(this,function(){return this.client.filesDelete({path:"/"+-f.toLowerCase()})}),this.executePromise(E,v,l)):v()):l()})):l({message:mxResources.get("invalidName")})}};DropboxClient.prototype.insertLibrary=function(e,f,c,l){this.insertFile(e,f,c,l,!0)};DropboxClient.prototype.insertFile=function(e,f,c,l,p){p=null!=p?p:!1;this.checkExists(e,mxUtils.bind(this,function(q){q?this.saveFile(e,f,mxUtils.bind(this,function(v){p?c(new DropboxLibrary(this.ui,f,v)):c(new DropboxFile(this.ui,f,v))}),l):l()}))};DropboxClient.prototype.saveFile=function(e,f,c,l,p){if(/[\\\/:\?\*"\|]/.test(e))l({message:mxResources.get("dropboxCharsNotAllowed")});+else{if(null!=e&&null!=f){var p=e.stat.path_display.substring(1),q=p.lastIndexOf("/");0<q&&(f=p.substring(0,q+1)+f)}null!=e&&null!=f&&e.stat.path_lower.substring(1)!==f.toLowerCase()?this.checkExists(f,mxUtils.bind(this,function(v,D,G){v?(v=mxUtils.bind(this,function(B){B=mxUtils.bind(this,function(){return this.client.filesMove({from_path:e.stat.path_display,to_path:"/"+f,autorename:!1})});this.executePromise(B,c,l)}),D&&G.path_lower.substring(1)!==f.toLowerCase()?(D=mxUtils.bind(this,function(){return this.client.filesDelete({path:"/"++f.toLowerCase()})}),this.executePromise(D,v,l)):v()):l()})):l({message:mxResources.get("invalidName")})}};DropboxClient.prototype.insertLibrary=function(e,f,c,l){this.insertFile(e,f,c,l,!0)};DropboxClient.prototype.insertFile=function(e,f,c,l,p){p=null!=p?p:!1;this.checkExists(e,mxUtils.bind(this,function(q){q?this.saveFile(e,f,mxUtils.bind(this,function(v){p?c(new DropboxLibrary(this.ui,f,v)):c(new DropboxFile(this.ui,f,v))}),l):l()}))};DropboxClient.prototype.saveFile=function(e,f,c,l,p){if(/[\\\/:\?\*"\|]/.test(e))l({message:mxResources.get("dropboxCharsNotAllowed")});else if(15E7<=f.length)l({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(f.length)+" / 150 MB)"});else{p=null!=p?p:"";var q=mxUtils.bind(this,function(){return this.client.filesUpload({path:"/"+p+e,mode:{".tag":"overwrite"},mute:!0,contents:new Blob([f],{type:"text/plain"})})});this.executePromise(q,c,l)}};DropboxClient.prototype.pickLibrary=function(e){Dropbox.choose({linkType:"direct",cancel:mxUtils.bind(this,function(){}),success:mxUtils.bind(this,function(f){if(this.ui.spinner.spin(document.body,-mxResources.get("loading"))){var c=mxUtils.bind(this,function(q){this.ui.spinner.stop();this.ui.handleError(q)}),l=null!=f[0].link?f[0].link.indexOf(this.appPath):-1;if(0<l){var p=decodeURIComponent(f[0].link.substring(l+this.appPath.length-1));this.readFile({path:p},mxUtils.bind(this,function(q,v){if(null!=v&&v.id==f[0].id)try{this.ui.spinner.stop(),e(p.substring(1),new DropboxLibrary(this.ui,q,v))}catch(E){this.ui.handleError(E)}else this.createLibrary(f[0],e,c)}),c)}else this.createLibrary(f[0],+mxResources.get("loading"))){var c=mxUtils.bind(this,function(q){this.ui.spinner.stop();this.ui.handleError(q)}),l=null!=f[0].link?f[0].link.indexOf(this.appPath):-1;if(0<l){var p=decodeURIComponent(f[0].link.substring(l+this.appPath.length-1));this.readFile({path:p},mxUtils.bind(this,function(q,v){if(null!=v&&v.id==f[0].id)try{this.ui.spinner.stop(),e(p.substring(1),new DropboxLibrary(this.ui,q,v))}catch(D){this.ui.handleError(D)}else this.createLibrary(f[0],e,c)}),c)}else this.createLibrary(f[0],e,c)}})})};DropboxClient.prototype.createLibrary=function(e,f,c){this.ui.confirm(mxResources.get("note")+": "+mxResources.get("fileWillBeSavedInAppFolder",[e.name]),mxUtils.bind(this,function(){this.ui.editor.loadUrl(e.link,mxUtils.bind(this,function(l){this.insertFile(e.name,l,mxUtils.bind(this,function(p){try{this.ui.spinner.stop(),f(p.getHash().substring(1),p)}catch(q){c(q)}}),c,!0)}),c)}),mxUtils.bind(this,function(){this.ui.spinner.stop()}))};DropboxClient.prototype.pickFile=function(e,f){null!=Dropbox.choose?(e=null!=e?e:mxUtils.bind(this,function(c,l){this.ui.loadFile(null!=c?"D"+encodeURIComponent(c):l.getHash(),null,l)}),Dropbox.choose({linkType:"direct",cancel:mxUtils.bind(this,function(){}),success:mxUtils.bind(this,function(c){if(this.ui.spinner.spin(document.body,mxResources.get("loading")))if(f)this.ui.spinner.stop(),e(c[0].link);else{var l=mxUtils.bind(this,function(G){this.ui.spinner.stop();this.ui.handleError(G)}),p=mxUtils.bind(this,function(G,B){this.ui.spinner.stop();e(G,-B)}),q=/\.png$/i.test(c[0].name);if(/\.vsdx$/i.test(c[0].name)||/\.gliffy$/i.test(c[0].name)||!this.ui.useCanvasForExport&&q)p(c[0].link);else{var v=null!=c[0].link?c[0].link.indexOf(this.appPath):-1;if(0<v){var E=decodeURIComponent(c[0].link.substring(v+this.appPath.length-1));this.readFile({path:E},mxUtils.bind(this,function(G,B){if(null!=B&&B.id==c[0].id){var d=q?G.lastIndexOf(","):-1;this.ui.spinner.stop();var g=null;0<d&&(d=this.ui.extractGraphModelFromPng(G),null!=d&&0<d.length?G=d:g=new LocalFile(this,-G,E,!0));e(E.substring(1),null!=g?g:new DropboxFile(this.ui,G,B))}else this.createFile(c[0],p,l)}),l,q)}else this.createFile(c[0],p,l)}}})})):this.ui.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})};DropboxClient.prototype.createFile=function(e,f,c){var l=/(\.png)$/i.test(e.name);this.ui.editor.loadUrl(e.link,mxUtils.bind(this,function(p){null!=p&&0<p.length?this.ui.confirm(mxResources.get("note")+": "+mxResources.get("fileWillBeSavedInAppFolder",[e.name]),mxUtils.bind(this,+B)}),q=/\.png$/i.test(c[0].name);if(/\.vsdx$/i.test(c[0].name)||/\.gliffy$/i.test(c[0].name)||!this.ui.useCanvasForExport&&q)p(c[0].link);else{var v=null!=c[0].link?c[0].link.indexOf(this.appPath):-1;if(0<v){var D=decodeURIComponent(c[0].link.substring(v+this.appPath.length-1));this.readFile({path:D},mxUtils.bind(this,function(G,B){if(null!=B&&B.id==c[0].id){var d=q?G.lastIndexOf(","):-1;this.ui.spinner.stop();var g=null;0<d&&(d=this.ui.extractGraphModelFromPng(G),null!=d&&0<d.length?G=d:g=new LocalFile(this,+G,D,!0));e(D.substring(1),null!=g?g:new DropboxFile(this.ui,G,B))}else this.createFile(c[0],p,l)}),l,q)}else this.createFile(c[0],p,l)}}})})):this.ui.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})};DropboxClient.prototype.createFile=function(e,f,c){var l=/(\.png)$/i.test(e.name);this.ui.editor.loadUrl(e.link,mxUtils.bind(this,function(p){null!=p&&0<p.length?this.ui.confirm(mxResources.get("note")+": "+mxResources.get("fileWillBeSavedInAppFolder",[e.name]),mxUtils.bind(this,function(){var q=l?p.lastIndexOf(","):-1;0<q&&(q=this.ui.extractGraphModelFromPng(p.substring(q+1)),null!=q&&0<q.length&&(p=q));this.insertFile(e.name,p,mxUtils.bind(this,function(v){f(e.name,v)}),c)}),mxUtils.bind(this,function(){this.ui.spinner.stop()})):(this.ui.spinner.stop(),c({message:mxResources.get("errorLoadingFile")}))}),c,l)}})();OneDriveFile=function(b,e,f){DrawioFile.call(this,b,e);this.meta=f};mxUtils.extend(OneDriveFile,DrawioFile);OneDriveFile.prototype.autosaveDelay=500;OneDriveFile.prototype.isRealtimeSupported=function(){return!0};OneDriveFile.prototype.getFileUrl=function(){var b=this.meta.webUrl;b=b.substring(0,b.lastIndexOf("/"));if(null!=this.meta.parentReference)try{if("personal"==this.meta.parentReference.driveType)b="https://onedrive.live.com/?cid="+encodeURIComponent(this.meta.parentReference.driveId)+"&id="+encodeURIComponent(this.meta.id);else if("documentLibrary"==this.meta.parentReference.driveType){var e=this.meta.parentReference.path;e=e.substring(e.indexOf("/root:")+6);var f=this.meta.webUrl;b=f.substring(0,f.length-e.length-encodeURIComponent(this.meta.name).length-1);f=f.substring(f.indexOf("/",8));b=b+"/Forms/AllItems.aspx?id="+f+"&parent="+f.substring(0,f.lastIndexOf("/"))}else if("business"==this.meta.parentReference.driveType){b=this.meta["@microsoft.graph.downloadUrl"];var c=b.indexOf("/_layouts/15/download.aspx?");e=f=this.meta.webUrl;f=f.substring(8);f=f.substring(f.indexOf("/"));e=e.substring(0,e.lastIndexOf("/"));e=e.substring(e.indexOf("/",8));b=b.substring(0,c)+"/_layouts/15/onedrive.aspx?id="+@@ -13783,8 +13787,8 @@ OneDriveFile.prototype.getCurrentUser=function(){return null!=this.ui.oneDrive?tOneDriveFile.prototype.setDescriptor=function(b){this.meta=b};OneDriveFile.prototype.getDescriptorEtag=function(b){return b.eTag};OneDriveFile.prototype.setDescriptorEtag=function(b,e){b.eTag=e};OneDriveFile.prototype.loadPatchDescriptor=function(b,e){var f=this.ui.oneDrive.getItemURL(this.getId());this.ui.oneDrive.executeRequest(f+"?select=etag,file",mxUtils.bind(this,function(c){200<=c.getStatus()&&299>=c.getStatus()?b(JSON.parse(c.getText())):e(this.ui.oneDrive.parseRequestText(c))}),e)};OneDriveFile.prototype.getChannelKey=function(){return"undefined"!==typeof CryptoJS?CryptoJS.MD5(this.meta.createdDateTime+(null!=this.meta.createdBy&&null!=this.meta.createdBy.user?this.meta.createdBy.user.id:"")).toString():null};OneDriveFile.prototype.getLastModifiedDate=function(){return new Date(this.meta.lastModifiedDateTime)};OneDriveFile.prototype.save=function(b,e,f,c,l){this.doSave(this.getTitle(),b,e,f,c,l)};OneDriveFile.prototype.saveAs=function(b,e,f){this.doSave(b,!1,e,f)};OneDriveFile.prototype.doSave=function(b,e,f,c,l,p){var q=this.meta.name;this.meta.name=b;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.meta.name=q;this.saveFile(b,e,f,c,l,p)}),c,l,p])};-OneDriveFile.prototype.saveFile=function(b,e,f,c,l,p){if(!this.isEditable())null!=f&&f();else if(!this.savingFile)if(this.getTitle()==b){var q=mxUtils.bind(this,function(){try{this.savingFileTime=new Date;this.setShadowModified(!1);this.savingFile=!0;var v=p||this.constructor!=OneDriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:this.getCurrentEtag(),E=this.meta;null!=this.sync&&this.sync.fileSaving();this.ui.oneDrive.saveFile(this,mxUtils.bind(this,function(G,B){this.setModified(this.getShadowModified());-this.savingFile=!1;this.meta=G;this.fileSaved(B,E,mxUtils.bind(this,function(){this.contentChanged();null!=f&&f()}),c)}),mxUtils.bind(this,function(G,B){try{this.savingFile=!1,this.isConflict(B)?(this.inConflictState=!0,null!=this.sync?(this.savingFile=!0,this.sync.fileConflict(null,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){this.updateFileData();q()}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=!1;null!=c&&c()}))):null!=c&&c()):null!=c&&+OneDriveFile.prototype.saveFile=function(b,e,f,c,l,p){if(!this.isEditable())null!=f&&f();else if(!this.savingFile)if(this.getTitle()==b){var q=mxUtils.bind(this,function(){try{this.savingFileTime=new Date;this.setShadowModified(!1);this.savingFile=!0;var v=p||this.constructor!=OneDriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:this.getCurrentEtag(),D=this.meta;null!=this.sync&&this.sync.fileSaving();this.ui.oneDrive.saveFile(this,mxUtils.bind(this,function(G,B){this.setModified(this.getShadowModified());+this.savingFile=!1;this.meta=G;this.fileSaved(B,D,mxUtils.bind(this,function(){this.contentChanged();null!=f&&f()}),c)}),mxUtils.bind(this,function(G,B){try{this.savingFile=!1,this.isConflict(B)?(this.inConflictState=!0,null!=this.sync?(this.savingFile=!0,this.sync.fileConflict(null,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){this.updateFileData();q()}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=!1;null!=c&&c()}))):null!=c&&c()):null!=c&&c(G)}catch(d){if(this.savingFile=!1,null!=c)c(d);else throw d;}}),v)}catch(G){if(this.savingFile=!1,null!=c)c(G);else throw G;}});q()}else this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,this.ui.oneDrive.insertFile(b,this.getData(),mxUtils.bind(this,function(v){this.setModified(this.getShadowModified());this.savingFile=!1;null!=f&&f();this.ui.fileLoaded(v)}),mxUtils.bind(this,function(){this.savingFile=!1;null!=c&&c()}))};OneDriveFile.prototype.rename=function(b,e,f){var c=this.getCurrentRevisionId();this.ui.oneDrive.renameFile(this,b,mxUtils.bind(this,function(l){this.hasSameExtension(b,this.getTitle())?(this.meta=l,this.descriptorChanged(),null!=this.sync&&this.sync.descriptorChanged(c),null!=e&&e(l)):(this.meta=l,null!=this.sync&&this.sync.descriptorChanged(c),this.save(!0,e,f))}),f)};OneDriveFile.prototype.move=function(b,e,f){this.ui.oneDrive.moveFile(this.getId(),b,mxUtils.bind(this,function(c){this.meta=c;this.descriptorChanged();null!=e&&e(c)}),f)};OneDriveLibrary=function(b,e,f){OneDriveFile.call(this,b,e,f)};mxUtils.extend(OneDriveLibrary,OneDriveFile);OneDriveLibrary.prototype.isAutosave=function(){return!0};OneDriveLibrary.prototype.save=function(b,e,f){this.ui.oneDrive.saveFile(this,mxUtils.bind(this,function(c){this.desc=c;null!=e&&e(c)}),f)};OneDriveLibrary.prototype.open=function(){};(function(){var b=null;window.OneDriveClient=function(e,f,c,l){null==f&&null!=window.urlParams&&"1"==window.urlParams.extAuth&&(f=!0);null==c&&(c=null!=window.Editor?Editor.oneDriveInlinePicker:!0);null==l&&null!=window.urlParams&&"1"==window.urlParams.noLogoutOD&&(l=!0);DrawioClient.call(this,e,f?"oneDriveExtAuthInfo":"oneDriveAuthInfo");this.isExtAuth=f;this.inlinePicker=c;this.noLogout=l;e=JSON.parse(this.token);null!=e&&(this.endpointHint=null!=e.endpointHint?e.endpointHint.replace("/Documents",@@ -13792,35 +13796,35 @@ OneDriveFile.prototype.move=function(b,e,f){this.ui.oneDrive.moveFile(this.getId"417a451a-a343-4788-b6c1-901e63182565":OneDriveClient.prototype.clientId;OneDriveClient.prototype.scopes="user.read files.readwrite.all sites.read.all";OneDriveClient.prototype.redirectUri=window.DRAWIO_SERVER_URL+"microsoft";OneDriveClient.prototype.pickerRedirectUri=window.DRAWIO_SERVER_URL+"onedrive3.html";OneDriveClient.prototype.defEndpointHint="api.onedrive.com";OneDriveClient.prototype.endpointHint=OneDriveClient.prototype.defEndpointHint;OneDriveClient.prototype.rootId={id:"root",name:"root",parentReference:{driveId:"me"}};OneDriveClient.prototype.extension=".drawio";OneDriveClient.prototype.baseUrl="https://graph.microsoft.com/v1.0";OneDriveClient.prototype.authUrl="https://login.microsoftonline.com/"+(window.DRAWIO_MSGRAPH_TENANT_ID||"common");OneDriveClient.prototype.emptyFn=function(){};OneDriveClient.prototype.invalidFilenameRegExs=[/[~"#%\*:<>\?\/\\{\|}]/,/^\.lock$/i,/^CON$/i,/^PRN$/i,/^AUX$/i,/^NUL$/i,/^COM\d$/i,/^LPT\d$/i,/^desktop\.ini$/i,/_vti_/i];OneDriveClient.prototype.isValidFilename=function(e){if(null==e||""===e)return!1;for(var f=0;f<this.invalidFilenameRegExs.length;f++)if(this.invalidFilenameRegExs[f].test(e))return!1;return!0};OneDriveClient.prototype.get=function(e,f,c){e=new mxXmlRequest(e,null,"GET");e.setRequestHeaders=mxUtils.bind(this,function(l,p){l.setRequestHeader("Authorization","Bearer "+b)});e.send(f,c);return e};OneDriveClient.prototype.updateUser=function(e,f,c){var l=!0,p=window.setTimeout(mxUtils.bind(this,function(){l=!1;f({code:App.ERROR_TIMEOUT})}),this.ui.timeout);-this.get(this.baseUrl+"/me",mxUtils.bind(this,function(q){window.clearTimeout(p);if(l)if(200>q.getStatus()||300<=q.getStatus())c?f({message:mxResources.get("accessDenied")}):(this.logout(),this.authenticate(mxUtils.bind(this,function(){this.updateUser(e,f,!0)}),f));else try{var v=JSON.parse(q.getText());this.setUser(new DrawioUser(v.id,v.mail,v.displayName));e()}catch(E){f(E)}}),mxUtils.bind(this,function(q){window.clearTimeout(p);l&&f(q)}))};OneDriveClient.prototype.resetTokenRefresh=function(e){null!=+this.get(this.baseUrl+"/me",mxUtils.bind(this,function(q){window.clearTimeout(p);if(l)if(200>q.getStatus()||300<=q.getStatus())c?f({message:mxResources.get("accessDenied")}):(this.logout(),this.authenticate(mxUtils.bind(this,function(){this.updateUser(e,f,!0)}),f));else try{var v=JSON.parse(q.getText());this.setUser(new DrawioUser(v.id,v.mail,v.displayName));e()}catch(D){f(D)}}),mxUtils.bind(this,function(q){window.clearTimeout(p);l&&f(q)}))};OneDriveClient.prototype.resetTokenRefresh=function(e){null!=this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null);0<e&&(this.tokenRefreshInterval=1E3*e,this.tokenRefreshThread=window.setTimeout(mxUtils.bind(this,function(){this.authenticate(this.emptyFn,this.emptyFn,!0)}),900*e))};OneDriveClient.prototype.authenticate=function(e,f,c){this.isExtAuth?(window.oneDriveAuth?window.oneDriveAuth:window.parent.oneDriveAuth)(mxUtils.bind(this,function(l){this.updateAuthInfo(l,!0,null==this.endpointHint,e,f)}),f,null!=window.urlParams&&"1"==urlParams.odAuthCancellable):(new mxXmlRequest(this.redirectUri+"?getState=1",null,"GET")).send(mxUtils.bind(this,function(l){200<=l.getStatus()&&299>=l.getStatus()?this.authenticateStep2(l.getText(),e,f,c):null!=f&&f(l)}),f)};OneDriveClient.prototype.updateAuthInfo=function(e,f,c,l,p){c&&this.setUser(null);b=e.access_token;delete e.access_token;e.expiresOn=Date.now()+1E3*e.expires_in;this.tokenExpiresOn=e.expiresOn;e.remember=f;this.setPersistentToken(JSON.stringify(e),!f);-this.resetTokenRefresh(e.expires_in);c?this.getAccountTypeAndEndpoint(mxUtils.bind(this,function(){l()}),p):l()};OneDriveClient.prototype.authenticateStep2=function(e,f,c,l){if(null==window.onOneDriveCallback){var p=mxUtils.bind(this,function(){var q=!0,v=JSON.parse(this.getPersistentToken(!0));null!=v?(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+e),null,"GET")).send(mxUtils.bind(this,function(E){if(200<=E.getStatus()&&-299>=E.getStatus())try{this.updateAuthInfo(JSON.parse(E.getText()),v.remember,!1,f,c)}catch(G){c({message:mxResources.get("authFailed"),retry:p})}else this.clearPersistentToken(),this.setUser(null),b=null,401!=E.getStatus()&&400!=E.getStatus()||l?c({message:mxResources.get("accessDenied"),retry:p}):p()}),c):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(E,G){var B=this.authUrl+"/oauth2/v2.0/authorize?client_id="+this.clientId+"&response_type=code&redirect_uri="+encodeURIComponent(this.redirectUri)+-"&scope="+encodeURIComponent(this.scopes+(E?" offline_access":""))+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+e);B=window.open(B,"odauth",["width=525,height=525","top="+(window.screenY+Math.max(window.outerHeight-525,0)/2),"left="+(window.screenX+Math.max(window.outerWidth-525,0)/2),"status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes"].join());null!=B&&(window.onOneDriveCallback=mxUtils.bind(this,function(d,g){if(q){window.onOneDriveCallback=-null;q=!1;try{null==d?c({message:mxResources.get("accessDenied"),retry:p}):(null!=G&&G(),this.updateAuthInfo(d,E,!0,f,c))}catch(k){c(k)}finally{null!=g&&g.close()}}else null!=g&&g.close()}),B.focus())}),mxUtils.bind(this,function(){q&&(window.onOneDriveCallback=null,q=!1,c({message:mxResources.get("accessDenied"),retry:p}))}))});p()}else c({code:App.ERROR_BUSY})};OneDriveClient.prototype.getAccountTypeAndEndpoint=function(e,f){this.get(this.baseUrl+"/me/drive/root",mxUtils.bind(this,function(c){try{if(200<=+this.resetTokenRefresh(e.expires_in);c?this.getAccountTypeAndEndpoint(mxUtils.bind(this,function(){l()}),p):l()};OneDriveClient.prototype.authenticateStep2=function(e,f,c,l){if(null==window.onOneDriveCallback){var p=mxUtils.bind(this,function(){var q=!0,v=JSON.parse(this.getPersistentToken(!0));null!=v?(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+e),null,"GET")).send(mxUtils.bind(this,function(D){if(200<=D.getStatus()&&+299>=D.getStatus())try{this.updateAuthInfo(JSON.parse(D.getText()),v.remember,!1,f,c)}catch(G){c({message:mxResources.get("authFailed"),retry:p})}else this.clearPersistentToken(),this.setUser(null),b=null,401!=D.getStatus()&&400!=D.getStatus()||l?c({message:mxResources.get("accessDenied"),retry:p}):p()}),c):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(D,G){var B=this.authUrl+"/oauth2/v2.0/authorize?client_id="+this.clientId+"&response_type=code&redirect_uri="+encodeURIComponent(this.redirectUri)++"&scope="+encodeURIComponent(this.scopes+(D?" offline_access":""))+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+e);B=window.open(B,"odauth",["width=525,height=525","top="+(window.screenY+Math.max(window.outerHeight-525,0)/2),"left="+(window.screenX+Math.max(window.outerWidth-525,0)/2),"status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes"].join());null!=B&&(window.onOneDriveCallback=mxUtils.bind(this,function(d,g){if(q){window.onOneDriveCallback=+null;q=!1;try{null==d?c({message:mxResources.get("accessDenied"),retry:p}):(null!=G&&G(),this.updateAuthInfo(d,D,!0,f,c))}catch(k){c(k)}finally{null!=g&&g.close()}}else null!=g&&g.close()}),B.focus())}),mxUtils.bind(this,function(){q&&(window.onOneDriveCallback=null,q=!1,c({message:mxResources.get("accessDenied"),retry:p}))}))});p()}else c({code:App.ERROR_BUSY})};OneDriveClient.prototype.getAccountTypeAndEndpoint=function(e,f){this.get(this.baseUrl+"/me/drive/root",mxUtils.bind(this,function(c){try{if(200<=c.getStatus()&&299>=c.getStatus()){var l=JSON.parse(c.getText());0<l.webUrl.indexOf(".sharepoint.com")?this.endpointHint=l.webUrl.replace("/Documents","/_layouts/15/onedrive.aspx"):this.endpointHint=this.defEndpointHint;var p=JSON.parse(this.getPersistentToken(!0));null!=p&&(p.endpointHint=this.endpointHint,this.setPersistentToken(JSON.stringify(p),!p.remember));e();return}}catch(q){}f({message:mxResources.get("unknownError")+" (Code: "+c.getStatus()+")"})}),f)};OneDriveClient.prototype.executeRequest=-function(e,f,c){var l=mxUtils.bind(this,function(p){var q=!0,v=window.setTimeout(mxUtils.bind(this,function(){q=!1;c({code:App.ERROR_TIMEOUT,retry:l})}),this.ui.timeout);this.get(e,mxUtils.bind(this,function(E){window.clearTimeout(v);q&&(200<=E.getStatus()&&299>=E.getStatus()||404==E.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),f(E)):p||401!==E.getStatus()&&400!==E.getStatus()?c(this.parseRequestText(E)):this.authenticate(function(){l(!0)},c,p))}),mxUtils.bind(this,-function(E){window.clearTimeout(v);q&&c(E)}))});null==b||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){l(!0)},c):l(!1)};OneDriveClient.prototype.checkToken=function(e,f){null==b||null==this.tokenRefreshThread||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(e,null!=f?f:this.emptyFn):e()};OneDriveClient.prototype.getItemRef=function(e){var f=e.split("/");return 1<f.length?{driveId:f[0],id:f[1]}:{id:e}};OneDriveClient.prototype.getItemURL=function(e,f){var c=e.split("/");return 1<+function(e,f,c){var l=mxUtils.bind(this,function(p){var q=!0,v=window.setTimeout(mxUtils.bind(this,function(){q=!1;c({code:App.ERROR_TIMEOUT,retry:l})}),this.ui.timeout);this.get(e,mxUtils.bind(this,function(D){window.clearTimeout(v);q&&(200<=D.getStatus()&&299>=D.getStatus()||404==D.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),f(D)):p||401!==D.getStatus()&&400!==D.getStatus()?c(this.parseRequestText(D)):this.authenticate(function(){l(!0)},c,p))}),mxUtils.bind(this,+function(D){window.clearTimeout(v);q&&c(D)}))});null==b||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){l(!0)},c):l(!1)};OneDriveClient.prototype.checkToken=function(e,f){null==b||null==this.tokenRefreshThread||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(e,null!=f?f:this.emptyFn):e()};OneDriveClient.prototype.getItemRef=function(e){var f=e.split("/");return 1<f.length?{driveId:f[0],id:f[1]}:{id:e}};OneDriveClient.prototype.getItemURL=function(e,f){var c=e.split("/");return 1<c.length?(e=c[1],(f?"":this.baseUrl)+"/drives/"+c[0]+("root"==e?"/root":"/items/"+e)):(f?"":this.baseUrl)+"/me/drive/items/"+e};OneDriveClient.prototype.getLibrary=function(e,f,c){this.getFile(e,f,c,!1,!0)};OneDriveClient.prototype.removeExtraHtmlContent=function(e){var f=e.lastIndexOf('<html><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"><meta name="Robots" ');0<f&&(e=e.substring(0,f));return e};OneDriveClient.prototype.getFile=function(e,f,c,l,p){p=null!=p?p:!1;this.executeRequest(this.getItemURL(e),-mxUtils.bind(this,function(q){if(200<=q.getStatus()&&299>=q.getStatus()){var v=JSON.parse(q.getText()),E=/\.png$/i.test(v.name);if(/\.v(dx|sdx?)$/i.test(v.name)||/\.gliffy$/i.test(v.name)||/\.pdf$/i.test(v.name)||!this.ui.useCanvasForExport&&E)this.ui.convertFile(v["@microsoft.graph.downloadUrl"],v.name,null!=v.file?v.file.mimeType:null,this.extension,f,c);else{var G=!0,B=window.setTimeout(mxUtils.bind(this,function(){G=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.ui.editor.loadUrl(v["@microsoft.graph.downloadUrl"],-mxUtils.bind(this,function(d){try{if(window.clearTimeout(B),G){/\.html$/i.test(v.name)&&(d=this.removeExtraHtmlContent(d));var g=null;if(0<(E?d.lastIndexOf(","):-1)){var k=this.ui.extractGraphModelFromPng(d);null!=k&&0<k.length?d=k:g=new LocalFile(this.ui,d,v.name,!0)}else if("data:image/png;base64,PG14ZmlsZS"==d.substring(0,32)){var m=d.substring(22);d=window.atob&&!mxClient.IS_SF?atob(m):Base64.decode(m)}Graph.fileSupport&&(new XMLHttpRequest).upload&&this.ui.isRemoteFileFormat(d,v["@microsoft.graph.downloadUrl"])?-this.ui.parseFileData(d,mxUtils.bind(this,function(t){try{4==t.readyState&&(200<=t.status&&299>=t.status?f(new LocalFile(this.ui,t.responseText,v.name+this.extension,!0)):null!=c&&c({message:mxResources.get("errorLoadingFile")}))}catch(y){if(null!=c)c(y);else throw y;}}),v.name):null!=g?f(g):p?f(new OneDriveLibrary(this.ui,d,v)):f(new OneDriveFile(this.ui,d,v))}}catch(t){if(null!=c)c(t);else throw t;}}),mxUtils.bind(this,function(d){window.clearTimeout(B);G&&c(this.parseRequestText(d))}),E||null!=+mxUtils.bind(this,function(q){if(200<=q.getStatus()&&299>=q.getStatus()){var v=JSON.parse(q.getText()),D=/\.png$/i.test(v.name);if(/\.v(dx|sdx?)$/i.test(v.name)||/\.gliffy$/i.test(v.name)||/\.pdf$/i.test(v.name)||!this.ui.useCanvasForExport&&D)this.ui.convertFile(v["@microsoft.graph.downloadUrl"],v.name,null!=v.file?v.file.mimeType:null,this.extension,f,c);else{var G=!0,B=window.setTimeout(mxUtils.bind(this,function(){G=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.ui.editor.loadUrl(v["@microsoft.graph.downloadUrl"],+mxUtils.bind(this,function(d){try{if(window.clearTimeout(B),G){/\.html$/i.test(v.name)&&(d=this.removeExtraHtmlContent(d));var g=null;if(0<(D?d.lastIndexOf(","):-1)){var k=this.ui.extractGraphModelFromPng(d);null!=k&&0<k.length?d=k:g=new LocalFile(this.ui,d,v.name,!0)}else if("data:image/png;base64,PG14ZmlsZS"==d.substring(0,32)){var m=d.substring(22);d=window.atob&&!mxClient.IS_SF?atob(m):Base64.decode(m)}Graph.fileSupport&&(new XMLHttpRequest).upload&&this.ui.isRemoteFileFormat(d,v["@microsoft.graph.downloadUrl"])?+this.ui.parseFileData(d,mxUtils.bind(this,function(t){try{4==t.readyState&&(200<=t.status&&299>=t.status?f(new LocalFile(this.ui,t.responseText,v.name+this.extension,!0)):null!=c&&c({message:mxResources.get("errorLoadingFile")}))}catch(y){if(null!=c)c(y);else throw y;}}),v.name):null!=g?f(g):p?f(new OneDriveLibrary(this.ui,d,v)):f(new OneDriveFile(this.ui,d,v))}}catch(t){if(null!=c)c(t);else throw t;}}),mxUtils.bind(this,function(d){window.clearTimeout(B);G&&c(this.parseRequestText(d))}),D||null!=v.file&&null!=v.file.mimeType&&("image/"==v.file.mimeType.substring(0,6)&&"image/svg"!=v.file.mimeType.substring(0,9)||"application/pdf"==v.file.mimeType))}}else this.isExtAuth?c({message:mxResources.get("fileNotFoundOrDenied"),ownerEmail:null!=window.urlParams?urlParams.ownerEml:null}):c(this.parseRequestText(q))}),function(q){null!=c&&(null!=q&&null!=q.error&&"ObjectHandle is Invalid"===q.error.message&&(q.error.message=mxResources.get("fileNotFoundOrDenied")),c(q))})};OneDriveClient.prototype.renameFile=function(e,f,c,l){null!=e&&null!=f&&(this.isValidFilename(f)?this.checkExists(e.getParentId(),f,!1,mxUtils.bind(this,function(p){p?this.writeFile(this.getItemURL(e.getId()),JSON.stringify({name:f}),"PATCH","application/json",c,l):l()})):l({message:this.invalidFilenameRegExs[0].test(f)?mxResources.get("oneDriveCharsNotAllowed"):mxResources.get("oneDriveInvalidDeviceName")}))};OneDriveClient.prototype.moveFile=function(e,f,c,l){f=this.getItemRef(f);var p=this.getItemRef(e);f.driveId!=p.driveId?l({message:mxResources.get("cannotMoveOneDrive",-null,"Moving a file between accounts is not supported yet.")}):this.writeFile(this.getItemURL(e),JSON.stringify({parentReference:f}),"PATCH","application/json",c,l)};OneDriveClient.prototype.insertLibrary=function(e,f,c,l,p){this.insertFile(e,f,c,l,!0,p)};OneDriveClient.prototype.insertFile=function(e,f,c,l,p,q){this.isValidFilename(e)?(p=null!=p?p:!1,this.checkExists(q,e,!0,mxUtils.bind(this,function(v){if(v){v="/me/drive/root";null!=q&&(v=this.getItemURL(q,!0));var E=mxUtils.bind(this,function(G){p?-c(new OneDriveLibrary(this.ui,f,G)):c(new OneDriveFile(this.ui,f,G))});v=this.baseUrl+v+"/children/"+encodeURIComponent(e)+"/content";4E6<=f.length?this.writeFile(v,"","PUT",null,mxUtils.bind(this,function(G){this.writeLargeFile(this.getItemURL(G.id),f,E,l)}),l):this.writeFile(v,f,"PUT",null,E,l)}else l()}))):l({message:this.invalidFilenameRegExs[0].test(e)?mxResources.get("oneDriveCharsNotAllowed"):mxResources.get("oneDriveInvalidDeviceName")})};OneDriveClient.prototype.checkExists=function(e,f,+null,"Moving a file between accounts is not supported yet.")}):this.writeFile(this.getItemURL(e),JSON.stringify({parentReference:f}),"PATCH","application/json",c,l)};OneDriveClient.prototype.insertLibrary=function(e,f,c,l,p){this.insertFile(e,f,c,l,!0,p)};OneDriveClient.prototype.insertFile=function(e,f,c,l,p,q){this.isValidFilename(e)?(p=null!=p?p:!1,this.checkExists(q,e,!0,mxUtils.bind(this,function(v){if(v){v="/me/drive/root";null!=q&&(v=this.getItemURL(q,!0));var D=mxUtils.bind(this,function(G){p?+c(new OneDriveLibrary(this.ui,f,G)):c(new OneDriveFile(this.ui,f,G))});v=this.baseUrl+v+"/children/"+encodeURIComponent(e)+"/content";4E6<=f.length?this.writeFile(v,"","PUT",null,mxUtils.bind(this,function(G){this.writeLargeFile(this.getItemURL(G.id),f,D,l)}),l):this.writeFile(v,f,"PUT",null,D,l)}else l()}))):l({message:this.invalidFilenameRegExs[0].test(e)?mxResources.get("oneDriveCharsNotAllowed"):mxResources.get("oneDriveInvalidDeviceName")})};OneDriveClient.prototype.checkExists=function(e,f,c,l){var p="/me/drive/root";null!=e&&(p=this.getItemURL(e,!0));this.executeRequest(this.baseUrl+p+"/children/"+encodeURIComponent(f),mxUtils.bind(this,function(q){404==q.getStatus()?l(!0):c?(this.ui.spinner.stop(),this.ui.confirm(mxResources.get("replaceIt",[f]),function(){l(!0)},function(){l(!1)})):(this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){l(!1)}))}),function(q){l(!1)},!0)};OneDriveClient.prototype.saveFile=function(e,-f,c,l){try{var p=e.getData(),q=mxUtils.bind(this,function(E){var G=mxUtils.bind(this,function(d){f(d,p)}),B=this.getItemURL(e.getId());4E6<=E.length?this.writeLargeFile(B,E,G,c,l):this.writeFile(B+"/content/",E,"PUT",null,G,c,l)});if(this.ui.useCanvasForExport&&/(\.png)$/i.test(e.meta.name)){var v=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(E){q(this.ui.base64ToBlob(E,"image/png"))}),c,this.ui.getCurrentFile()!=e?p:null,v.scale,v.border)}else q(p)}catch(E){c(E)}};-OneDriveClient.prototype.writeLargeFile=function(e,f,c,l,p){try{if(null!=f){var q=(new TextEncoder).encode(f).length,v=mxUtils.bind(this,function(G,B,d,g){try{g=g||0;var k=!0,m=null;m=window.setTimeout(mxUtils.bind(this,function(){k=!1;l({code:App.ERROR_TIMEOUT})}),this.ui.timeout);var t=f.substr(B,4194304),y=(new TextEncoder).encode(t).length,A=new mxXmlRequest(G,t,"PUT");A.setRequestHeaders=mxUtils.bind(this,function(I,F){I.setRequestHeader("Content-Range","bytes "+d+"-"+(d+y-1)+"/"+q)});A.send(mxUtils.bind(this,-function(I){window.clearTimeout(m);if(k){var F=I.getStatus();200<=F&&299>=F?(F=B+t.length,F==f.length?c(JSON.parse(I.getText())):v(G,F,d+y,g)):500<=F&&599>=F&&2>g?(g++,v(G,B,d,g)):l(this.parseRequestText(I),I)}}),mxUtils.bind(this,function(I){window.clearTimeout(m);k&&l(this.parseRequestText(I))}))}catch(I){l(I)}}),E=mxUtils.bind(this,function(G){try{var B=!0,d=null;try{d=window.setTimeout(mxUtils.bind(this,function(){B=!1;l({code:App.ERROR_TIMEOUT})}),this.ui.timeout)}catch(k){}var g=new mxXmlRequest(e+-"/createUploadSession","{}","POST");g.setRequestHeaders=mxUtils.bind(this,function(k,m){k.setRequestHeader("Content-Type","application/json");k.setRequestHeader("Authorization","Bearer "+b);null!=p&&k.setRequestHeader("If-Match",p)});g.send(mxUtils.bind(this,function(k){window.clearTimeout(d);B&&(200<=k.getStatus()&&299>=k.getStatus()?(k=JSON.parse(k.getText()),v(k.uploadUrl,0,0)):G||401!==k.getStatus()?l(this.parseRequestText(k),k):this.authenticate(function(){E(!0)},l,G))}),mxUtils.bind(this,function(k){window.clearTimeout(d);-B&&l(this.parseRequestText(k))}))}catch(k){l(k)}});null==b||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){E(!0)},l):E(!1)}else l({message:mxResources.get("unknownError")})}catch(G){l(G)}};OneDriveClient.prototype.writeFile=function(e,f,c,l,p,q,v){try{if(null!=e&&null!=f){var E=mxUtils.bind(this,function(G){try{var B=!0,d=null;try{d=window.setTimeout(mxUtils.bind(this,function(){B=!1;q({code:App.ERROR_TIMEOUT})}),this.ui.timeout)}catch(k){}var g=new mxXmlRequest(e,f,c);g.setRequestHeaders=-mxUtils.bind(this,function(k,m){k.setRequestHeader("Content-Type",l||" ");k.setRequestHeader("Authorization","Bearer "+b);null!=v&&k.setRequestHeader("If-Match",v)});g.send(mxUtils.bind(this,function(k){window.clearTimeout(d);B&&(200<=k.getStatus()&&299>=k.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),p(JSON.parse(k.getText()))):G||401!==k.getStatus()?q(this.parseRequestText(k),k):this.authenticate(function(){E(!0)},q,G))}),mxUtils.bind(this,function(k){window.clearTimeout(d);-B&&q(this.parseRequestText(k))}))}catch(k){q(k)}});null==b||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){E(!0)},q):E(!1)}else q({message:mxResources.get("unknownError")})}catch(G){q(G)}};OneDriveClient.prototype.parseRequestText=function(e){var f={message:mxResources.get("unknownError")};try{f=JSON.parse(e.getText()),f.status=e.getStatus(),f.error&&(f.error.status=f.status,f.error.code=f.status)}catch(c){}return f};OneDriveClient.prototype.pickLibrary=function(e){this.pickFile(function(f){e(f)})};-OneDriveClient.prototype.createInlinePicker=function(e,f,c){return mxUtils.bind(this,function(){var l=null,p=document.createElement("div");p.style.position="relative";var q=new CustomDialog(this.ui,p,mxUtils.bind(this,function(){var v=l.getSelectedItem();if(null!=v)if(f&&"object"==typeof v.folder)e({value:[v]});else{if(!v.folder&&this.ui.spinner.spin(document.body,mxResources.get("loading"))){var E=OneDriveFile.prototype.getIdOf(v);this.executeRequest(this.getItemURL(E),mxUtils.bind(this,function(G){this.ui.spinner.stop();-200<=G.getStatus()&&299>=G.getStatus()?(G=JSON.parse(G.getText()),e(E,{value:[G]})):this.ui.handleError({code:G.getStatus()})}),mxUtils.bind(this,function(G){this.ui.spinner.stop();this.ui.handleError(G)}))}}else return mxResources.get("invalidSel",null,"Invalid selection")}),null,mxResources.get(f?"select":"open"),null,null,null,null,!0);this.ui.showDialog(q.container,550,500,!0,!0);p.style.width=q.container.parentNode.style.width;p.style.height=parseInt(q.container.parentNode.style.height)-60+"px";-l=new mxODPicker(p,null,mxUtils.bind(this,function(v,E,G,B){this.executeRequest(B?v:this.baseUrl+v,function(d){E(JSON.parse(d.getText()))},G)}),mxUtils.bind(this,function(v,E,G,B){this.executeRequest(this.baseUrl+"/drives/"+E+"/items/"+v,function(d){G(JSON.parse(d.getText()))},B)}),null,null,function(v){f?e({value:[v]}):e(OneDriveFile.prototype.getIdOf(v))},mxUtils.bind(this,function(v){this.ui.showError(mxResources.get("error"),v)}),f,null,null,null,null,c)})};OneDriveClient.prototype.pickFolder=+f,c,l){try{var p=e.getData(),q=mxUtils.bind(this,function(D){var G=mxUtils.bind(this,function(d){f(d,p)}),B=this.getItemURL(e.getId());4E6<=D.length?this.writeLargeFile(B,D,G,c,l):this.writeFile(B+"/content/",D,"PUT",null,G,c,l)});if(this.ui.useCanvasForExport&&/(\.png)$/i.test(e.meta.name)){var v=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(D){q(this.ui.base64ToBlob(D,"image/png"))}),c,this.ui.getCurrentFile()!=e?p:null,v.scale,v.border)}else q(p)}catch(D){c(D)}};+OneDriveClient.prototype.writeLargeFile=function(e,f,c,l,p){try{if(null!=f){var q=(new TextEncoder).encode(f).length,v=mxUtils.bind(this,function(G,B,d,g){try{g=g||0;var k=!0,m=null;m=window.setTimeout(mxUtils.bind(this,function(){k=!1;l({code:App.ERROR_TIMEOUT})}),this.ui.timeout);var t=f.substr(B,4194304),y=(new TextEncoder).encode(t).length,z=new mxXmlRequest(G,t,"PUT");z.setRequestHeaders=mxUtils.bind(this,function(I,F){I.setRequestHeader("Content-Range","bytes "+d+"-"+(d+y-1)+"/"+q)});z.send(mxUtils.bind(this,+function(I){window.clearTimeout(m);if(k){var F=I.getStatus();200<=F&&299>=F?(F=B+t.length,F==f.length?c(JSON.parse(I.getText())):v(G,F,d+y,g)):500<=F&&599>=F&&2>g?(g++,v(G,B,d,g)):l(this.parseRequestText(I),I)}}),mxUtils.bind(this,function(I){window.clearTimeout(m);k&&l(this.parseRequestText(I))}))}catch(I){l(I)}}),D=mxUtils.bind(this,function(G){try{var B=!0,d=null;try{d=window.setTimeout(mxUtils.bind(this,function(){B=!1;l({code:App.ERROR_TIMEOUT})}),this.ui.timeout)}catch(k){}var g=new mxXmlRequest(e++"/createUploadSession","{}","POST");g.setRequestHeaders=mxUtils.bind(this,function(k,m){k.setRequestHeader("Content-Type","application/json");k.setRequestHeader("Authorization","Bearer "+b);null!=p&&k.setRequestHeader("If-Match",p)});g.send(mxUtils.bind(this,function(k){window.clearTimeout(d);B&&(200<=k.getStatus()&&299>=k.getStatus()?(k=JSON.parse(k.getText()),v(k.uploadUrl,0,0)):G||401!==k.getStatus()?l(this.parseRequestText(k),k):this.authenticate(function(){D(!0)},l,G))}),mxUtils.bind(this,function(k){window.clearTimeout(d);+B&&l(this.parseRequestText(k))}))}catch(k){l(k)}});null==b||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){D(!0)},l):D(!1)}else l({message:mxResources.get("unknownError")})}catch(G){l(G)}};OneDriveClient.prototype.writeFile=function(e,f,c,l,p,q,v){try{if(null!=e&&null!=f){var D=mxUtils.bind(this,function(G){try{var B=!0,d=null;try{d=window.setTimeout(mxUtils.bind(this,function(){B=!1;q({code:App.ERROR_TIMEOUT})}),this.ui.timeout)}catch(k){}var g=new mxXmlRequest(e,f,c);g.setRequestHeaders=+mxUtils.bind(this,function(k,m){k.setRequestHeader("Content-Type",l||" ");k.setRequestHeader("Authorization","Bearer "+b);null!=v&&k.setRequestHeader("If-Match",v)});g.send(mxUtils.bind(this,function(k){window.clearTimeout(d);B&&(200<=k.getStatus()&&299>=k.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),p(JSON.parse(k.getText()))):G||401!==k.getStatus()?q(this.parseRequestText(k),k):this.authenticate(function(){D(!0)},q,G))}),mxUtils.bind(this,function(k){window.clearTimeout(d);+B&&q(this.parseRequestText(k))}))}catch(k){q(k)}});null==b||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){D(!0)},q):D(!1)}else q({message:mxResources.get("unknownError")})}catch(G){q(G)}};OneDriveClient.prototype.parseRequestText=function(e){var f={message:mxResources.get("unknownError")};try{f=JSON.parse(e.getText()),f.status=e.getStatus(),f.error&&(f.error.status=f.status,f.error.code=f.status)}catch(c){}return f};OneDriveClient.prototype.pickLibrary=function(e){this.pickFile(function(f){e(f)})};+OneDriveClient.prototype.createInlinePicker=function(e,f,c){return mxUtils.bind(this,function(){var l=null,p=document.createElement("div");p.style.position="relative";var q=new CustomDialog(this.ui,p,mxUtils.bind(this,function(){var v=l.getSelectedItem();if(null!=v)if(f&&"object"==typeof v.folder)e({value:[v]});else{if(!v.folder&&this.ui.spinner.spin(document.body,mxResources.get("loading"))){var D=OneDriveFile.prototype.getIdOf(v);this.executeRequest(this.getItemURL(D),mxUtils.bind(this,function(G){this.ui.spinner.stop();+200<=G.getStatus()&&299>=G.getStatus()?(G=JSON.parse(G.getText()),e(D,{value:[G]})):this.ui.handleError({code:G.getStatus()})}),mxUtils.bind(this,function(G){this.ui.spinner.stop();this.ui.handleError(G)}))}}else return mxResources.get("invalidSel",null,"Invalid selection")}),null,mxResources.get(f?"select":"open"),null,null,null,null,!0);this.ui.showDialog(q.container,550,500,!0,!0);p.style.width=parseInt(q.container.parentNode.style.width)-60+"px";p.style.height=parseInt(q.container.parentNode.style.height)-+120+"px";l=new mxODPicker(p,null,mxUtils.bind(this,function(v,D,G,B){this.executeRequest(B?v:this.baseUrl+v,function(d){D(JSON.parse(d.getText()))},G)}),mxUtils.bind(this,function(v,D,G,B){this.executeRequest(this.baseUrl+"/drives/"+D+"/items/"+v,function(d){G(JSON.parse(d.getText()))},B)}),null,null,function(v){f?e({value:[v]}):e(OneDriveFile.prototype.getIdOf(v))},mxUtils.bind(this,function(v){this.ui.showError(mxResources.get("error"),v)}),f,null,null,null,null,c)})};OneDriveClient.prototype.pickFolder=function(e,f){var c=mxUtils.bind(this,function(p){this.ui.showError(mxResources.get("error"),p&&p.message?p.message:p)}),l=mxUtils.bind(this,function(p){var q=this.inlinePicker?this.createInlinePicker(e,!0):mxUtils.bind(this,function(){OneDrive.save({clientId:this.clientId,action:"query",openInNewWindow:!0,advanced:{endpointHint:mxClient.IS_IE11?null:this.endpointHint,redirectUri:this.pickerRedirectUri,queryParameters:"select=id,name,parentReference",accessToken:b,isConsumerAccount:!1},success:mxUtils.bind(this,function(v){e(v);mxClient.IS_IE11&&(b=v.accessToken)}),cancel:mxUtils.bind(this,function(){}),error:c})});p?q():this.ui.confirm(mxResources.get("useRootFolder"),mxUtils.bind(this,function(){e({value:[this.rootId]})}),q,mxResources.get("yes"),mxResources.get("noPickFolder")+"...",!0);null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0)});null==b||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(mxUtils.bind(this,function(){l(this.inlinePicker&&f)}),c):l(f)};OneDriveClient.prototype.pickFile=function(e,f){e=null!=e?e:mxUtils.bind(this,function(p){this.ui.loadFile("W"+encodeURIComponent(p))});var c=mxUtils.bind(this,function(p){this.ui.showError(mxResources.get("error"),p&&p.message?p.message:p)}),l=this.inlinePicker?this.createInlinePicker(e,null,f):mxUtils.bind(this,function(){OneDrive.open({clientId:this.clientId,action:"query",multiSelect:!1,advanced:{endpointHint:mxClient.IS_IE11?null:this.endpointHint,redirectUri:this.pickerRedirectUri,queryParameters:"select=id,name,parentReference,webUrl",@@ -13832,124 +13836,124 @@ GitHubFile.prototype.getFolderUrl=function(){return"https://github.com/"+encodeUGitHubFile.prototype.getPublicUrl=function(b){if(null!=this.meta.download_url)try{""!=(new URL(this.meta.download_url)).search?b(null):mxUtils.get(this.meta.download_url,mxUtils.bind(this,function(e){b(200<=e.getStatus()&&299>=e.getStatus()?this.meta.download_url:null)}),mxUtils.bind(this,function(){b(null)}))}catch(e){b(null)}else b(null)};GitHubFile.prototype.isConflict=function(b){return null!=b&&409==b.status};GitHubFile.prototype.getMode=function(){return App.MODE_GITHUB};GitHubFile.prototype.isAutosave=function(){return!1};GitHubFile.prototype.getTitle=function(){return this.meta.name};GitHubFile.prototype.isRenamable=function(){return!1};GitHubFile.prototype.getLatestVersion=function(b,e){this.peer.getFile(this.getId(),b,e)};GitHubFile.prototype.getDescriptor=function(){return this.meta};GitHubFile.prototype.setDescriptor=function(b){this.meta=b};GitHubFile.prototype.getDescriptorEtag=function(b){return b.sha};GitHubFile.prototype.setDescriptorEtag=function(b,e){b.sha=e};GitHubFile.prototype.save=function(b,e,f,c,l,p){this.doSave(this.getTitle(),e,f,c,l,p)};GitHubFile.prototype.saveAs=function(b,e,f){this.doSave(b,e,f)};GitHubFile.prototype.doSave=function(b,e,f,c,l,p){var q=this.meta.name;this.meta.name=b;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.meta.name=q;this.saveFile(b,!1,e,f,c,l,p)}),f,c,l])};-GitHubFile.prototype.saveFile=function(b,e,f,c,l,p,q){if(this.isEditable())if(this.savingFile)null!=c&&c({code:App.ERROR_BUSY});else{var v=mxUtils.bind(this,function(E){if(this.getTitle()==b)try{this.savingFileTime=new Date;this.setShadowModified(!1);this.savingFile=!0;var G=this.getCurrentEtag(),B=this.data;this.peer.saveFile(this,mxUtils.bind(this,function(d){this.setModified(this.getShadowModified());this.savingFile=!1;this.setDescriptorEtag(this.meta,d);this.fileSaved(B,G,mxUtils.bind(this,function(){this.contentChanged();-null!=f&&f()}),c)}),mxUtils.bind(this,function(d){this.savingFile=!1;this.isConflict(d)?(this.inConflictState=!0,null!=c&&(d.commitMessage=E,c(d))):null!=c&&c(d)}),p,E)}catch(d){if(this.savingFile=!1,null!=c)c(d);else throw d;}else this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,this.ui.pickFolder(this.getMode(),mxUtils.bind(this,function(d){this.peer.insertFile(b,this.getData(),mxUtils.bind(this,function(g){this.setModified(this.getShadowModified());this.savingFile=!1;-null!=f&&f();this.ui.fileLoaded(g)}),mxUtils.bind(this,function(){this.savingFile=!1;null!=c&&c()}),!1,d,E)}))});null!=q?v(q):this.peer.showCommitDialog(this.meta.name,null==this.getDescriptorEtag(this.meta)||this.meta.isNew,mxUtils.bind(this,function(E){v(E)}),c)}else null!=f&&f()};GitHubLibrary=function(b,e,f){GitHubFile.call(this,b,e,f)};mxUtils.extend(GitHubLibrary,GitHubFile);GitHubLibrary.prototype.doSave=function(b,e,f){this.saveFile(b,!1,e,f)};GitHubLibrary.prototype.open=function(){};(function(){var b=null;window.GitHubClient=function(e,f){DrawioClient.call(this,e,f||"ghauth")};mxUtils.extend(GitHubClient,DrawioClient);GitHubClient.prototype.clientId="test.draw.io"==window.location.hostname?"Iv1.1218f5567fbc258a":window.DRAWIO_GITHUB_ID;GitHubClient.prototype.extension=".drawio";GitHubClient.prototype.baseUrl=DRAWIO_GITHUB_API_URL;GitHubClient.prototype.baseHostUrl=DRAWIO_GITHUB_URL;GitHubClient.prototype.redirectUri=window.DRAWIO_SERVER_URL+"github2";GitHubClient.prototype.maxFileSize=-5E7;GitHubClient.prototype.authToken="token";GitHubClient.prototype.setToken=function(e){b=e};GitHubClient.prototype.updateUser=function(e,f,c){var l=!0,p=window.setTimeout(mxUtils.bind(this,function(){l=!1;f({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout),q=new mxXmlRequest(this.baseUrl+"/user",null,"GET"),v=this.authToken+" "+b;q.setRequestHeaders=function(E,G){E.setRequestHeader("Authorization",v)};q.send(mxUtils.bind(this,function(){window.clearTimeout(p);l&&(401===+GitHubFile.prototype.saveFile=function(b,e,f,c,l,p,q){if(this.isEditable())if(this.savingFile)null!=c&&c({code:App.ERROR_BUSY});else{var v=mxUtils.bind(this,function(D){if(this.getTitle()==b)try{this.savingFileTime=new Date;this.setShadowModified(!1);this.savingFile=!0;var G=this.getCurrentEtag(),B=this.data;this.peer.saveFile(this,mxUtils.bind(this,function(d){this.setModified(this.getShadowModified());this.savingFile=!1;this.setDescriptorEtag(this.meta,d);this.fileSaved(B,G,mxUtils.bind(this,function(){this.contentChanged();+null!=f&&f()}),c)}),mxUtils.bind(this,function(d){this.savingFile=!1;this.isConflict(d)?(this.inConflictState=!0,null!=c&&(d.commitMessage=D,c(d))):null!=c&&c(d)}),p,D)}catch(d){if(this.savingFile=!1,null!=c)c(d);else throw d;}else this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,this.ui.pickFolder(this.getMode(),mxUtils.bind(this,function(d){this.peer.insertFile(b,this.getData(),mxUtils.bind(this,function(g){this.setModified(this.getShadowModified());this.savingFile=!1;+null!=f&&f();this.ui.fileLoaded(g)}),mxUtils.bind(this,function(){this.savingFile=!1;null!=c&&c()}),!1,d,D)}))});null!=q?v(q):this.peer.showCommitDialog(this.meta.name,null==this.getDescriptorEtag(this.meta)||this.meta.isNew,mxUtils.bind(this,function(D){v(D)}),c)}else null!=f&&f()};GitHubLibrary=function(b,e,f){GitHubFile.call(this,b,e,f)};mxUtils.extend(GitHubLibrary,GitHubFile);GitHubLibrary.prototype.doSave=function(b,e,f){this.saveFile(b,!1,e,f)};GitHubLibrary.prototype.open=function(){};(function(){var b=null;window.GitHubClient=function(e,f){DrawioClient.call(this,e,f||"ghauth")};mxUtils.extend(GitHubClient,DrawioClient);GitHubClient.prototype.clientId="test.draw.io"==window.location.hostname?"Iv1.1218f5567fbc258a":window.DRAWIO_GITHUB_ID;GitHubClient.prototype.extension=".drawio";GitHubClient.prototype.baseUrl=DRAWIO_GITHUB_API_URL;GitHubClient.prototype.baseHostUrl=DRAWIO_GITHUB_URL;GitHubClient.prototype.redirectUri=window.DRAWIO_SERVER_URL+"github2";GitHubClient.prototype.maxFileSize=+5E7;GitHubClient.prototype.authToken="token";GitHubClient.prototype.setToken=function(e){b=e};GitHubClient.prototype.updateUser=function(e,f,c){var l=!0,p=window.setTimeout(mxUtils.bind(this,function(){l=!1;f({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout),q=new mxXmlRequest(this.baseUrl+"/user",null,"GET"),v=this.authToken+" "+b;q.setRequestHeaders=function(D,G){D.setRequestHeader("Authorization",v)};q.send(mxUtils.bind(this,function(){window.clearTimeout(p);l&&(401===q.getStatus()?c?f({code:q.getStatus(),message:this.getErrorMessage(q,mxResources.get("accessDenied"))}):(this.logout(),this.authenticate(mxUtils.bind(this,function(){this.updateUser(e,f,!0)}),f)):200>q.getStatus()||300<=q.getStatus()?f({message:mxResources.get("accessDenied")}):(this.setUser(this.createUser(JSON.parse(q.getText()))),e()))}),f)};GitHubClient.prototype.createUser=function(e){return new DrawioUser(e.id,e.email,e.name)};GitHubClient.prototype.authenticate=function(e,f){(new mxXmlRequest(this.redirectUri+"?getState=1",null,"GET")).send(mxUtils.bind(this,function(c){200<=c.getStatus()&&299>=c.getStatus()?this.authenticateStep2(c.getText(),e,f):null!=f&&f(c)}),f)};GitHubClient.prototype.authenticateStep2=function(e,f,c){if(null==window.onGitHubCallback){var l=mxUtils.bind(this,function(){var p=!0;null!=this.getPersistentToken(!0)?(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+e),null,"GET")).send(mxUtils.bind(this,function(q){if(200<=q.getStatus()&&299>=q.getStatus())try{b=JSON.parse(q.getText()).access_token,this.setUser(null),f()}catch(v){c({message:mxResources.get("authFailed"),retry:l})}else this.clearPersistentToken(),this.setUser(null),b=null,401==q.getStatus()?l():c({message:mxResources.get("accessDenied"),retry:l})}),c):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(q,v){null!=window.open(this.baseHostUrl+"/login/oauth/authorize?client_id="+this.clientId+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+-window.location.host+"&token="+e),"ghauth")?window.onGitHubCallback=mxUtils.bind(this,function(E,G){p?(window.onGitHubCallback=null,p=!1,null==E?c({message:mxResources.get("accessDenied"),retry:l}):(null!=v&&v(),b=E.access_token,this.setUser(null),q&&this.setPersistentToken("remembered"),f(),null!=G&&G.close())):null!=G&&G.close()}):c({message:mxResources.get("serviceUnavailableOrBlocked"),retry:l})}),mxUtils.bind(this,function(){p&&(window.onGitHubCallback=null,p=!1,c({message:mxResources.get("accessDenied"),+window.location.host+"&token="+e),"ghauth")?window.onGitHubCallback=mxUtils.bind(this,function(D,G){p?(window.onGitHubCallback=null,p=!1,null==D?c({message:mxResources.get("accessDenied"),retry:l}):(null!=v&&v(),b=D.access_token,this.setUser(null),q&&this.setPersistentToken("remembered"),f(),null!=G&&G.close())):null!=G&&G.close()}):c({message:mxResources.get("serviceUnavailableOrBlocked"),retry:l})}),mxUtils.bind(this,function(){p&&(window.onGitHubCallback=null,p=!1,c({message:mxResources.get("accessDenied"),retry:l}))}))});l()}else c({code:App.ERROR_BUSY})};GitHubClient.prototype.getErrorMessage=function(e,f){try{var c=JSON.parse(e.getText());null!=c&&null!=c.message&&(f=c.message)}catch(l){}return f};GitHubClient.prototype.showAuthorizeDialog=function(e,f){this.ui.showError(mxResources.get("accessDenied"),mxResources.get("authorizationRequired"),mxResources.get("help"),mxUtils.bind(this,function(){this.ui.openLink("https://www.drawio.com/blog/single-repository-diagrams")}),e,mxResources.get("authorize"),-mxUtils.bind(this,function(){this.ui.openLink("test.draw.io"==window.location.hostname?"https://github.com/apps/diagrams-net-app-test":"https://github.com/apps/draw-io-app")}),mxResources.get("cancel"),f,480,null,!1)};GitHubClient.prototype.executeRequest=function(e,f,c,l,p){var q=mxUtils.bind(this,function(E){var G=!0,B=window.setTimeout(mxUtils.bind(this,function(){G=!1;c({code:App.ERROR_TIMEOUT,retry:v})}),this.ui.timeout),d=this.authToken+" "+b;e.setRequestHeaders=function(g,k){g.setRequestHeader("Authorization",-d)};e.send(mxUtils.bind(this,function(){window.clearTimeout(B);var g=mxUtils.bind(this,function(){var t=this.ui.spinner.pause();this.showAuthorizeDialog(mxUtils.bind(this,function(){t();v()}),mxUtils.bind(this,function(){this.ui.hideDialog();c({name:"AbortError"})}))});if(G)if(200<=e.getStatus()&&299>=e.getStatus()||l&&404==e.getStatus())f(e);else if(401===e.getStatus())E?c({code:e.getStatus(),message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){v(!0)},+mxUtils.bind(this,function(){this.ui.openLink("test.draw.io"==window.location.hostname?"https://github.com/apps/diagrams-net-app-test":"https://github.com/apps/draw-io-app")}),mxResources.get("cancel"),f,480,null,!1)};GitHubClient.prototype.executeRequest=function(e,f,c,l,p){var q=mxUtils.bind(this,function(D){var G=!0,B=window.setTimeout(mxUtils.bind(this,function(){G=!1;c({code:App.ERROR_TIMEOUT,retry:v})}),this.ui.timeout),d=this.authToken+" "+b;e.setRequestHeaders=function(g,k){g.setRequestHeader("Authorization",+d)};e.send(mxUtils.bind(this,function(){window.clearTimeout(B);var g=mxUtils.bind(this,function(){var t=this.ui.spinner.pause();this.showAuthorizeDialog(mxUtils.bind(this,function(){t();v()}),mxUtils.bind(this,function(){this.ui.hideDialog();c({name:"AbortError"})}))});if(G)if(200<=e.getStatus()&&299>=e.getStatus()||l&&404==e.getStatus())f(e);else if(401===e.getStatus())D?c({code:e.getStatus(),message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){v(!0)},c)})}):this.authenticate(function(){q(!0)},c);else if(403===e.getStatus()){var k=!1;try{var m=JSON.parse(e.getText());null!=m&&"Resource not accessible by integration"==m.message?g():(null!=m&&null!=m.errors&&0<m.errors.length&&(k="too_large"==m.errors[0].code),c({message:mxResources.get(k?"drawingTooLarge":"forbidden")}))}catch(t){c({message:mxResources.get(k?"drawingTooLarge":"forbidden")})}}else 404===e.getStatus()?p?c({code:e.getStatus(),message:this.getErrorMessage(e,mxResources.get("fileNotFound"))}):-g():409===e.getStatus()?c({code:e.getStatus(),status:409}):c({code:e.getStatus(),message:this.getErrorMessage(e,mxResources.get("error")+" "+e.getStatus())})}),mxUtils.bind(this,function(g){window.clearTimeout(B);G&&c(g)}))}),v=mxUtils.bind(this,function(E){null==this.user?this.updateUser(function(){v(!0)},c,E):q(E)});null==b?this.authenticate(function(){v(!0)},c):v(!1)};GitHubClient.prototype.getLibrary=function(e,f,c){this.getFile(e,f,c,!0)};GitHubClient.prototype.getSha=function(e,f,c,l,p,q,v){var E=-"&t="+(new Date).getTime();e=new mxXmlRequest(this.baseUrl+"/repos/"+e+"/"+f+"/contents/"+c+"?ref="+l+E,null,"HEAD");this.executeRequest(e,mxUtils.bind(this,function(G){try{p(G.request.getResponseHeader("Etag").match(/"([^"]+)"/)[1])}catch(B){q(B)}}),q,null,v)};GitHubClient.prototype.getFile=function(e,f,c,l,p){l=null!=l?l:!1;var q=e.split("/"),v=q[0],E=q[1],G=q[2];e=q.slice(3,q.length).join("/");q=/\.png$/i.test(e);if(!p&&(/\.v(dx|sdx?)$/i.test(e)||/\.gliffy$/i.test(e)||/\.pdf$/i.test(e)||!this.ui.useCanvasForExport&&-q))if(null!=b){p=this.baseUrl+"/repos/"+v+"/"+E+"/contents/"+e+"?ref="+G;var B={Authorization:"token "+b};q=e.split("/");this.ui.convertFile(p,0<q.length?q[q.length-1]:e,null,this.extension,f,c,null,B)}else c({message:mxResources.get("accessDenied")});else q="&t="+(new Date).getTime(),e=new mxXmlRequest(this.baseUrl+"/repos/"+v+"/"+E+"/contents/"+e+"?ref="+G+q,null,"GET"),this.executeRequest(e,mxUtils.bind(this,function(d){try{var g=JSON.parse(d.getText());if(""==g.content&&null!=g.git_url){var k=-new mxXmlRequest(g.git_url,null,"GET");this.executeRequest(k,mxUtils.bind(this,function(m){m=JSON.parse(m.getText());""!=m.content?(g.content=m.content,g.encoding=m.encoding,f(this.createGitHubFile(v,E,G,g,l))):c({message:mxResources.get("errorLoadingFile")})}),c)}else f(this.createGitHubFile(v,E,G,g,l))}catch(m){c(m)}}),c)};GitHubClient.prototype.createGitHubFile=function(e,f,c,l,p){e={org:e,repo:f,ref:c,name:l.name,path:l.path,sha:l.sha,html_url:l.html_url,download_url:l.download_url};f=l.content;+g():409===e.getStatus()?c({code:e.getStatus(),status:409}):c({code:e.getStatus(),message:this.getErrorMessage(e,mxResources.get("error")+" "+e.getStatus())})}),mxUtils.bind(this,function(g){window.clearTimeout(B);G&&c(g)}))}),v=mxUtils.bind(this,function(D){null==this.user?this.updateUser(function(){v(!0)},c,D):q(D)});null==b?this.authenticate(function(){v(!0)},c):v(!1)};GitHubClient.prototype.getLibrary=function(e,f,c){this.getFile(e,f,c,!0)};GitHubClient.prototype.getSha=function(e,f,c,l,p,q,v){var D=+"&t="+(new Date).getTime();e=new mxXmlRequest(this.baseUrl+"/repos/"+e+"/"+f+"/contents/"+c+"?ref="+l+D,null,"HEAD");this.executeRequest(e,mxUtils.bind(this,function(G){try{p(G.request.getResponseHeader("Etag").match(/"([^"]+)"/)[1])}catch(B){q(B)}}),q,null,v)};GitHubClient.prototype.getFile=function(e,f,c,l,p){l=null!=l?l:!1;var q=e.split("/"),v=q[0],D=q[1],G=q[2];e=q.slice(3,q.length).join("/");q=/\.png$/i.test(e);if(!p&&(/\.v(dx|sdx?)$/i.test(e)||/\.gliffy$/i.test(e)||/\.pdf$/i.test(e)||!this.ui.useCanvasForExport&&+q))if(null!=b){p=this.baseUrl+"/repos/"+v+"/"+D+"/contents/"+e+"?ref="+G;var B={Authorization:"token "+b};q=e.split("/");this.ui.convertFile(p,0<q.length?q[q.length-1]:e,null,this.extension,f,c,null,B)}else c({message:mxResources.get("accessDenied")});else q="&t="+(new Date).getTime(),e=new mxXmlRequest(this.baseUrl+"/repos/"+v+"/"+D+"/contents/"+e+"?ref="+G+q,null,"GET"),this.executeRequest(e,mxUtils.bind(this,function(d){try{var g=JSON.parse(d.getText());if(""==g.content&&null!=g.git_url){var k=+new mxXmlRequest(g.git_url,null,"GET");this.executeRequest(k,mxUtils.bind(this,function(m){m=JSON.parse(m.getText());""!=m.content?(g.content=m.content,g.encoding=m.encoding,f(this.createGitHubFile(v,D,G,g,l))):c({message:mxResources.get("errorLoadingFile")})}),c)}else f(this.createGitHubFile(v,D,G,g,l))}catch(m){c(m)}}),c)};GitHubClient.prototype.createGitHubFile=function(e,f,c,l,p){e={org:e,repo:f,ref:c,name:l.name,path:l.path,sha:l.sha,html_url:l.html_url,download_url:l.download_url};f=l.content;"base64"===l.encoding&&(/\.jpe?g$/i.test(l.name)?f="data:image/jpeg;base64,"+f:/\.gif$/i.test(l.name)?f="data:image/gif;base64,"+f:/\.png$/i.test(l.name)?(l=this.ui.extractGraphModelFromPng(f),f=null!=l&&0<l.length?l:"data:image/png;base64,"+f):f=Base64.decode(f));return p?new GitHubLibrary(this.ui,f,e):new GitHubFile(this.ui,f,e)};GitHubClient.prototype.insertLibrary=function(e,f,c,l,p){this.insertFile(e,f,c,l,!0,p,!1)};GitHubClient.prototype.insertFile=function(e,f,c,l,p,q,v){p=null!=p?p:!1;q=q.split("/");-var E=q[0],G=q[1],B=q[2],d=q.slice(3,q.length).join("/");0<d.length&&(d+="/");d+=e;this.checkExists(E+"/"+G+"/"+B+"/"+d,!0,mxUtils.bind(this,function(g,k){g?p?(v||(f=Base64.encode(f)),this.showCommitDialog(e,!0,mxUtils.bind(this,function(m){this.writeFile(E,G,B,d,m,f,k,mxUtils.bind(this,function(t){try{var y=JSON.parse(t.getText());c(this.createGitHubFile(E,G,B,y.content,p))}catch(A){l(A)}}),l)}),l)):c(new GitHubFile(this.ui,f,{org:E,repo:G,ref:B,name:e,path:d,sha:k,isNew:!0})):l()}))};GitHubClient.prototype.showCommitDialog=-function(e,f,c,l){var p=this.ui.spinner.pause();e=new FilenameDialog(this.ui,mxResources.get(f?"addedFile":"updateFile",[e]),mxResources.get("ok"),mxUtils.bind(this,function(q){p(function(){c(q)})}),mxResources.get("commitMessage"),null,null,null,null,mxUtils.bind(this,function(){l()}));this.ui.showDialog(e.container,400,80,!0,!1);e.init()};GitHubClient.prototype.writeFile=function(e,f,c,l,p,q,v,E,G){q.length>=this.maxFileSize?G({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(q.length)+-" / 1 MB)"}):(c={path:l,branch:decodeURIComponent(c),message:p,content:q},null!=v&&(c.sha=v),e=new mxXmlRequest(this.baseUrl+"/repos/"+e+"/"+f+"/contents/"+l,JSON.stringify(c),"PUT"),this.executeRequest(e,mxUtils.bind(this,function(B){E(B)}),mxUtils.bind(this,function(B){404==B.code&&(B.helpLink=this.baseHostUrl+"/settings/connections/applications/"+this.clientId,B.code=null);G(B)})))};GitHubClient.prototype.checkExists=function(e,f,c){var l=e.split("/"),p=l[0],q=l[1],v=l[2];e=l.slice(3,l.length).join("/");-this.getSha(p,q,e,v,mxUtils.bind(this,function(E){if(f){var G=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[e]),function(){G();c(!0,E)},function(){G();c(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){c(!1)})}),mxUtils.bind(this,function(E){c(!0)}),!0)};GitHubClient.prototype.saveFile=function(e,f,c,l,p){var q=e.meta.org,v=e.meta.repo,E=e.meta.ref,G=e.meta.path,B=mxUtils.bind(this,function(g,-k){this.writeFile(q,v,E,G,p,k,g,mxUtils.bind(this,function(m){delete e.meta.isNew;f(JSON.parse(m.getText()).content.sha)}),mxUtils.bind(this,function(m){c(m)}))}),d=mxUtils.bind(this,function(){if(this.ui.useCanvasForExport&&/(\.png)$/i.test(G)){var g=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(k){B(e.meta.sha,k)}),c,this.ui.getCurrentFile()!=e?e.getData():null,g.scale,g.border)}else B(e.meta.sha,Base64.encode(e.getData()))});l?this.getSha(q,v,-G,E,mxUtils.bind(this,function(g){e.meta.sha=g;d()}),c):d()};GitHubClient.prototype.pickLibrary=function(e){this.pickFile(e)};GitHubClient.prototype.pickFolder=function(e){this.showGitHubDialog(!1,e,!0)};GitHubClient.prototype.pickFile=function(e){e=null!=e?e:mxUtils.bind(this,function(f){this.ui.loadFile("H"+encodeURIComponent(f))});this.showGitHubDialog(!0,e)};GitHubClient.prototype.showGitHubDialog=function(e,f,c){var l=null,p=null,q=null,v=null,E=document.createElement("div");E.style.whiteSpace=-"nowrap";E.style.overflow="hidden";E.style.height="320px";var G=document.createElement("h3");mxUtils.write(G,mxResources.get(e?"selectFile":"selectFolder"));G.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";E.appendChild(G);G=this.ui.createToolbarButton(Editor.refreshImage,mxResources.get("refresh"),mxUtils.bind(this,function(){C()}));G.style.position="absolute";G.style.right="40px";G.style.top="26px";E.appendChild(G);var B=document.createElement("div");B.style.whiteSpace=-"nowrap";B.style.border="1px solid lightgray";B.style.boxSizing="border-box";B.style.padding="4px";B.style.overflow="auto";B.style.lineHeight="1.2em";B.style.height="290px";E.appendChild(B);var d=document.createElement("div");d.style.textOverflow="ellipsis";d.style.boxSizing="border-box";d.style.overflow="hidden";d.style.padding="4px";d.style.width="100%";var g=new CustomDialog(this.ui,E,mxUtils.bind(this,function(){f(l+"/"+p+"/"+encodeURIComponent(q)+"/"+v)}),null,null,"https://www.drawio.com/blog/single-repository-diagrams",+var D=q[0],G=q[1],B=q[2],d=q.slice(3,q.length).join("/");0<d.length&&(d+="/");d+=e;this.checkExists(D+"/"+G+"/"+B+"/"+d,!0,mxUtils.bind(this,function(g,k){g?p?(v||(f=Base64.encode(f)),this.showCommitDialog(e,!0,mxUtils.bind(this,function(m){this.writeFile(D,G,B,d,m,f,k,mxUtils.bind(this,function(t){try{var y=JSON.parse(t.getText());c(this.createGitHubFile(D,G,B,y.content,p))}catch(z){l(z)}}),l)}),l)):c(new GitHubFile(this.ui,f,{org:D,repo:G,ref:B,name:e,path:d,sha:k,isNew:!0})):l()}))};GitHubClient.prototype.showCommitDialog=+function(e,f,c,l){var p=this.ui.spinner.pause();e=new FilenameDialog(this.ui,mxResources.get(f?"addedFile":"updateFile",[e]),mxResources.get("ok"),mxUtils.bind(this,function(q){p(function(){c(q)})}),mxResources.get("commitMessage"),null,null,null,null,mxUtils.bind(this,function(){l()}));this.ui.showDialog(e.container,400,80,!0,!1);e.init()};GitHubClient.prototype.writeFile=function(e,f,c,l,p,q,v,D,G){q.length>=this.maxFileSize?G({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(q.length)++" / 1 MB)"}):(c={path:l,branch:decodeURIComponent(c),message:p,content:q},null!=v&&(c.sha=v),e=new mxXmlRequest(this.baseUrl+"/repos/"+e+"/"+f+"/contents/"+l,JSON.stringify(c),"PUT"),this.executeRequest(e,mxUtils.bind(this,function(B){D(B)}),mxUtils.bind(this,function(B){404==B.code&&(B.helpLink=this.baseHostUrl+"/settings/connections/applications/"+this.clientId,B.code=null);G(B)})))};GitHubClient.prototype.checkExists=function(e,f,c){var l=e.split("/"),p=l[0],q=l[1],v=l[2];e=l.slice(3,l.length).join("/");+this.getSha(p,q,e,v,mxUtils.bind(this,function(D){if(f){var G=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[e]),function(){G();c(!0,D)},function(){G();c(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),function(){c(!1)})}),mxUtils.bind(this,function(D){c(!0)}),!0)};GitHubClient.prototype.saveFile=function(e,f,c,l,p){var q=e.meta.org,v=e.meta.repo,D=e.meta.ref,G=e.meta.path,B=mxUtils.bind(this,function(g,+k){this.writeFile(q,v,D,G,p,k,g,mxUtils.bind(this,function(m){delete e.meta.isNew;f(JSON.parse(m.getText()).content.sha)}),mxUtils.bind(this,function(m){c(m)}))}),d=mxUtils.bind(this,function(){if(this.ui.useCanvasForExport&&/(\.png)$/i.test(G)){var g=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(k){B(e.meta.sha,k)}),c,this.ui.getCurrentFile()!=e?e.getData():null,g.scale,g.border)}else B(e.meta.sha,Base64.encode(e.getData()))});l?this.getSha(q,v,+G,D,mxUtils.bind(this,function(g){e.meta.sha=g;d()}),c):d()};GitHubClient.prototype.pickLibrary=function(e){this.pickFile(e)};GitHubClient.prototype.pickFolder=function(e){this.showGitHubDialog(!1,e,!0)};GitHubClient.prototype.pickFile=function(e){e=null!=e?e:mxUtils.bind(this,function(f){this.ui.loadFile("H"+encodeURIComponent(f))});this.showGitHubDialog(!0,e)};GitHubClient.prototype.showGitHubDialog=function(e,f,c){var l=null,p=null,q=null,v=null,D=document.createElement("div");D.style.whiteSpace=+"nowrap";D.style.overflow="hidden";D.style.height="320px";var G=document.createElement("h3");mxUtils.write(G,mxResources.get(e?"selectFile":"selectFolder"));G.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";D.appendChild(G);G=this.ui.createToolbarButton(Editor.refreshImage,mxResources.get("refresh"),mxUtils.bind(this,function(){C()}));G.style.position="absolute";G.style.right="40px";G.style.top="26px";D.appendChild(G);var B=document.createElement("div");B.style.whiteSpace=+"nowrap";B.style.border="1px solid lightgray";B.style.boxSizing="border-box";B.style.padding="4px";B.style.overflow="auto";B.style.lineHeight="1.2em";B.style.height="290px";D.appendChild(B);var d=document.createElement("div");d.style.textOverflow="ellipsis";d.style.boxSizing="border-box";d.style.overflow="hidden";d.style.padding="4px";d.style.width="100%";var g=new CustomDialog(this.ui,D,mxUtils.bind(this,function(){f(l+"/"+p+"/"+encodeURIComponent(q)+"/"+v)}),null,null,"https://www.drawio.com/blog/single-repository-diagrams",null,null,null,null,[[mxResources.get("authorize"),mxUtils.bind(this,function(){this.ui.openLink("test.draw.io"==window.location.hostname?"https://github.com/apps/diagrams-net-app-test":"https://github.com/apps/draw-io-app")})]],"16px");this.ui.showDialog(g.container,420,370,!0,!0);e&&g.okButton.parentNode.removeChild(g.okButton);var k=mxUtils.bind(this,function(Q,S,V,P){var u=document.createElement("a");u.setAttribute("title",Q);u.style.cursor="pointer";mxUtils.write(u,Q);mxEvent.addListener(u,"click",S);P&&(u.style.textDecoration="underline");null!=V&&(Q=d.cloneNode(),Q.style.padding=V,Q.appendChild(u),u=Q);return u}),m=mxUtils.bind(this,function(Q){var S=document.createElement("div");S.style.marginBottom="8px";S.appendChild(k(l+"/"+p,mxUtils.bind(this,function(){v=null;C()}),null,!0));Q||(mxUtils.write(S," / "),S.appendChild(k(decodeURIComponent(q),mxUtils.bind(this,function(){v=null;F()}),null,!0)));if(null!=v&&0<v.length){var V=v.split("/");for(Q=0;Q<V.length;Q++)(function(P){mxUtils.write(S,-" / ");S.appendChild(k(V[P],mxUtils.bind(this,function(){v=V.slice(0,P+1).join("/");I()}),null,!0))})(Q)}B.appendChild(S)}),t=mxUtils.bind(this,function(Q){this.ui.handleError(Q,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(v=q=p=l=null,C()):this.ui.hideDialog()}),null,{})}),y=null,A=null,I=mxUtils.bind(this,function(Q){null==Q&&(B.innerText="",Q=1);var S=new mxXmlRequest(this.baseUrl+"/repos/"+l+"/"+p+"/contents/"+v+"?ref="+encodeURIComponent(q)+"&per_page=100&page="+-Q,null,"GET");this.ui.spinner.spin(B,mxResources.get("loading"));g.okButton.removeAttribute("disabled");null!=A&&(mxEvent.removeListener(B,"scroll",A),A=null);null!=y&&null!=y.parentNode&&y.parentNode.removeChild(y);y=document.createElement("a");y.style.display="block";y.style.cursor="pointer";mxUtils.write(y,mxResources.get("more")+"...");var V=mxUtils.bind(this,function(){I(Q+1)});mxEvent.addListener(y,"click",V);this.executeRequest(S,mxUtils.bind(this,function(P){this.ui.tryAndHandle(mxUtils.bind(this,-function(){this.ui.spinner.stop();1==Q&&(m(),B.appendChild(k("../ [Up]",mxUtils.bind(this,function(){if(""==v)v=null,C();else{var K=v.split("/");v=K.slice(0,K.length-1).join("/");I()}}),"4px")));var u=JSON.parse(P.getText());if(null==u||0==u.length)c||(mxUtils.br(B),mxUtils.write(B,mxResources.get("noFiles")));else{var x=!0,J=0,H=mxUtils.bind(this,function(K){for(var O=0;O<u.length;O++)mxUtils.bind(this,function(M,n){if(K==("dir"==M.type)){n=d.cloneNode();n.style.backgroundColor=x?Editor.isDarkMode()?-"#000000":"#eeeeee":"";x=!x;var z=document.createElement("img");z.src=IMAGE_PATH+"/"+("dir"==M.type?"folder.png":"file.png");z.setAttribute("align","absmiddle");z.style.marginRight="4px";z.style.marginTop="-4px";z.width=20;n.appendChild(z);n.appendChild(k(M.name+("dir"==M.type?"/":""),mxUtils.bind(this,function(){"dir"==M.type?(v=M.path,I()):e&&"file"==M.type&&(this.ui.hideDialog(),f(l+"/"+p+"/"+encodeURIComponent(q)+"/"+M.path))})));B.appendChild(n);J++}})(u[O],O)});H(!0);e&&H(!1)}}))}),t,!0)}),-F=mxUtils.bind(this,function(Q,S){null==Q&&(B.innerText="",Q=1);var V=new mxXmlRequest(this.baseUrl+"/repos/"+l+"/"+p+"/branches?per_page=100&page="+Q,null,"GET");g.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(B,mxResources.get("loading"));null!=A&&(mxEvent.removeListener(B,"scroll",A),A=null);null!=y&&null!=y.parentNode&&y.parentNode.removeChild(y);y=document.createElement("a");y.style.display="block";y.style.cursor="pointer";mxUtils.write(y,mxResources.get("more")+"...");var P=+" / ");S.appendChild(k(V[P],mxUtils.bind(this,function(){v=V.slice(0,P+1).join("/");I()}),null,!0))})(Q)}B.appendChild(S)}),t=mxUtils.bind(this,function(Q){this.ui.handleError(Q,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(v=q=p=l=null,C()):this.ui.hideDialog()}),null,{})}),y=null,z=null,I=mxUtils.bind(this,function(Q){null==Q&&(B.innerText="",Q=1);var S=new mxXmlRequest(this.baseUrl+"/repos/"+l+"/"+p+"/contents/"+v+"?ref="+encodeURIComponent(q)+"&per_page=100&page="++Q,null,"GET");this.ui.spinner.spin(B,mxResources.get("loading"));g.okButton.removeAttribute("disabled");null!=z&&(mxEvent.removeListener(B,"scroll",z),z=null);null!=y&&null!=y.parentNode&&y.parentNode.removeChild(y);y=document.createElement("a");y.style.display="block";y.style.cursor="pointer";mxUtils.write(y,mxResources.get("more")+"...");var V=mxUtils.bind(this,function(){I(Q+1)});mxEvent.addListener(y,"click",V);this.executeRequest(S,mxUtils.bind(this,function(P){this.ui.tryAndHandle(mxUtils.bind(this,+function(){this.ui.spinner.stop();1==Q&&(m(),B.appendChild(k("../ [Up]",mxUtils.bind(this,function(){if(""==v)v=null,C();else{var K=v.split("/");v=K.slice(0,K.length-1).join("/");I()}}),"4px")));var u=JSON.parse(P.getText());if(null==u||0==u.length)c||(mxUtils.br(B),mxUtils.write(B,mxResources.get("noFiles")));else{var x=!0,J=0,H=mxUtils.bind(this,function(K){for(var N=0;N<u.length;N++)mxUtils.bind(this,function(M,n){if(K==("dir"==M.type)){n=d.cloneNode();n.style.backgroundColor=x?Editor.isDarkMode()?+"#000000":"#eeeeee":"";x=!x;var A=document.createElement("img");A.src=IMAGE_PATH+"/"+("dir"==M.type?"folder.png":"file.png");A.setAttribute("align","absmiddle");A.style.marginRight="4px";A.style.marginTop="-4px";A.width=20;n.appendChild(A);n.appendChild(k(M.name+("dir"==M.type?"/":""),mxUtils.bind(this,function(){"dir"==M.type?(v=M.path,I()):e&&"file"==M.type&&(this.ui.hideDialog(),f(l+"/"+p+"/"+encodeURIComponent(q)+"/"+M.path))})));B.appendChild(n);J++}})(u[N],N)});H(!0);e&&H(!1)}}))}),t,!0)}),+F=mxUtils.bind(this,function(Q,S){null==Q&&(B.innerText="",Q=1);var V=new mxXmlRequest(this.baseUrl+"/repos/"+l+"/"+p+"/branches?per_page=100&page="+Q,null,"GET");g.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(B,mxResources.get("loading"));null!=z&&(mxEvent.removeListener(B,"scroll",z),z=null);null!=y&&null!=y.parentNode&&y.parentNode.removeChild(y);y=document.createElement("a");y.style.display="block";y.style.cursor="pointer";mxUtils.write(y,mxResources.get("more")+"...");var P=mxUtils.bind(this,function(){F(Q+1)});mxEvent.addListener(y,"click",P);this.executeRequest(V,mxUtils.bind(this,function(u){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();1==Q&&(m(!0),B.appendChild(k("../ [Up]",mxUtils.bind(this,function(){v=null;C()}),"4px")));var x=JSON.parse(u.getText());if(null==x||0==x.length)mxUtils.br(B),mxUtils.write(B,mxResources.get("repositoryNotFound"));else if(1==x.length&&S)q=x[0].name,v="",I();else{for(var J=0;J<x.length;J++)mxUtils.bind(this,-function(H,K){var O=d.cloneNode();O.style.backgroundColor=0==K%2?Editor.isDarkMode()?"#000000":"#eeeeee":"";O.appendChild(k(H.name,mxUtils.bind(this,function(){q=H.name;v="";I()})));B.appendChild(O)})(x[J],J);100==x.length&&(B.appendChild(y),A=function(){B.scrollTop>=B.scrollHeight-B.offsetHeight&&P()},mxEvent.addListener(B,"scroll",A))}}))}),t)}),C=mxUtils.bind(this,function(Q){null==Q&&(B.innerText="",Q=1);var S=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+Q,null,"GET");g.okButton.setAttribute("disabled",-"disabled");this.ui.spinner.spin(B,mxResources.get("loading"));null!=A&&mxEvent.removeListener(B,"scroll",A);null!=y&&null!=y.parentNode&&y.parentNode.removeChild(y);y=document.createElement("a");y.style.display="block";y.style.cursor="pointer";mxUtils.write(y,mxResources.get("more")+"...");var V=mxUtils.bind(this,function(){C(Q+1)});mxEvent.addListener(y,"click",V);this.executeRequest(S,mxUtils.bind(this,function(P){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();var u=JSON.parse(P.getText());-if(null==u||0==u.length)mxUtils.br(B),mxUtils.write(B,mxResources.get("repositoryNotFound"));else{1==Q&&(B.appendChild(k(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){var J=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,function(H){if(null!=H){var K=H.split("/");if(1<K.length){H=K[0];var O=K[1];3>K.length?(l=H,p=O,v=q=null,F()):this.ui.spinner.spin(B,mxResources.get("loading"))&&(K=encodeURIComponent(K.slice(2,K.length).join("/")),this.getFile(H+-"/"+O+"/"+K,mxUtils.bind(this,function(M){this.ui.spinner.stop();l=M.meta.org;p=M.meta.repo;q=decodeURIComponent(M.meta.ref);v="";I()}),mxUtils.bind(this,function(M){this.ui.spinner.stop();this.ui.handleError({message:mxResources.get("fileNotFound")})})))}else this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})}}),mxResources.get("enterValue"));this.ui.showDialog(J.container,300,80,!0,!1);J.init()}))),mxUtils.br(B),mxUtils.br(B));for(var x=0;x<u.length;x++)mxUtils.bind(this,-function(J,H){var K=d.cloneNode();K.style.backgroundColor=0==H%2?Editor.isDarkMode()?"#000000":"#eeeeee":"";K.appendChild(k(J.full_name,mxUtils.bind(this,function(){l=J.owner.login;p=J.name;v="";F(null,!0)})));B.appendChild(K)})(u[x],x)}100==u.length&&(B.appendChild(y),A=function(){B.scrollTop>=B.scrollHeight-B.offsetHeight&&V()},mxEvent.addListener(B,"scroll",A))}))}),t)});C()};GitHubClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);b=null}})();TrelloFile=function(b,e,f){DrawioFile.call(this,b,e);this.meta=f;this.saveNeededCounter=0};mxUtils.extend(TrelloFile,DrawioFile);TrelloFile.prototype.getHash=function(){return"T"+encodeURIComponent(this.meta.compoundId)};TrelloFile.prototype.getMode=function(){return App.MODE_TRELLO};TrelloFile.prototype.isAutosave=function(){return!0};TrelloFile.prototype.getTitle=function(){return this.meta.name};TrelloFile.prototype.isRenamable=function(){return!1};TrelloFile.prototype.getSize=function(){return this.meta.bytes};+function(H,K){var N=d.cloneNode();N.style.backgroundColor=0==K%2?Editor.isDarkMode()?"#000000":"#eeeeee":"";N.appendChild(k(H.name,mxUtils.bind(this,function(){q=H.name;v="";I()})));B.appendChild(N)})(x[J],J);100==x.length&&(B.appendChild(y),z=function(){B.scrollTop>=B.scrollHeight-B.offsetHeight&&P()},mxEvent.addListener(B,"scroll",z))}}))}),t)}),C=mxUtils.bind(this,function(Q){null==Q&&(B.innerText="",Q=1);var S=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+Q,null,"GET");g.okButton.setAttribute("disabled",+"disabled");this.ui.spinner.spin(B,mxResources.get("loading"));null!=z&&mxEvent.removeListener(B,"scroll",z);null!=y&&null!=y.parentNode&&y.parentNode.removeChild(y);y=document.createElement("a");y.style.display="block";y.style.cursor="pointer";mxUtils.write(y,mxResources.get("more")+"...");var V=mxUtils.bind(this,function(){C(Q+1)});mxEvent.addListener(y,"click",V);this.executeRequest(S,mxUtils.bind(this,function(P){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();var u=JSON.parse(P.getText());+if(null==u||0==u.length)mxUtils.br(B),mxUtils.write(B,mxResources.get("repositoryNotFound"));else{1==Q&&(B.appendChild(k(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){var J=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,function(H){if(null!=H){var K=H.split("/");if(1<K.length){H=K[0];var N=K[1];3>K.length?(l=H,p=N,v=q=null,F()):this.ui.spinner.spin(B,mxResources.get("loading"))&&(K=encodeURIComponent(K.slice(2,K.length).join("/")),this.getFile(H++"/"+N+"/"+K,mxUtils.bind(this,function(M){this.ui.spinner.stop();l=M.meta.org;p=M.meta.repo;q=decodeURIComponent(M.meta.ref);v="";I()}),mxUtils.bind(this,function(M){this.ui.spinner.stop();this.ui.handleError({message:mxResources.get("fileNotFound")})})))}else this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})}}),mxResources.get("enterValue"));this.ui.showDialog(J.container,300,80,!0,!1);J.init()}))),mxUtils.br(B),mxUtils.br(B));for(var x=0;x<u.length;x++)mxUtils.bind(this,+function(J,H){var K=d.cloneNode();K.style.backgroundColor=0==H%2?Editor.isDarkMode()?"#000000":"#eeeeee":"";K.appendChild(k(J.full_name,mxUtils.bind(this,function(){l=J.owner.login;p=J.name;v="";F(null,!0)})));B.appendChild(K)})(u[x],x)}100==u.length&&(B.appendChild(y),z=function(){B.scrollTop>=B.scrollHeight-B.offsetHeight&&V()},mxEvent.addListener(B,"scroll",z))}))}),t)});C()};GitHubClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);b=null}})();TrelloFile=function(b,e,f){DrawioFile.call(this,b,e);this.meta=f;this.saveNeededCounter=0};mxUtils.extend(TrelloFile,DrawioFile);TrelloFile.prototype.getHash=function(){return"T"+encodeURIComponent(this.meta.compoundId)};TrelloFile.prototype.getMode=function(){return App.MODE_TRELLO};TrelloFile.prototype.isAutosave=function(){return!0};TrelloFile.prototype.getTitle=function(){return this.meta.name};TrelloFile.prototype.isRenamable=function(){return!1};TrelloFile.prototype.getSize=function(){return this.meta.bytes};TrelloFile.prototype.save=function(b,e,f){this.doSave(this.getTitle(),e,f)};TrelloFile.prototype.saveAs=function(b,e,f){this.doSave(b,e,f)};TrelloFile.prototype.doSave=function(b,e,f){var c=this.meta.name;this.meta.name=b;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.meta.name=c;this.saveFile(b,!1,e,f)}),f])};TrelloFile.prototype.saveFile=function(b,e,f,c){this.isEditable()?this.savingFile?null!=c&&(this.saveNeededCounter++,c({code:App.ERROR_BUSY})):(this.savingFileTime=new Date,this.setShadowModified(!1),this.savingFile=!0,this.getTitle()==b?this.ui.trello.saveFile(this,mxUtils.bind(this,function(l){this.setModified(this.getShadowModified());this.savingFile=!1;this.meta=l;this.contentChanged();null!=f&&f();0<this.saveNeededCounter&&(this.saveNeededCounter--,this.saveFile(b,e,f,c))}),mxUtils.bind(this,function(l){this.savingFile=!1;null!=c&&c(l)})):this.ui.pickFolder(App.MODE_TRELLO,mxUtils.bind(this,function(l){this.ui.trello.insertFile(b,this.getData(),mxUtils.bind(this,function(p){this.savingFile=!1;null!=f&&f();this.ui.fileLoaded(p);0<this.saveNeededCounter&&(this.saveNeededCounter--,this.saveFile(b,e,f,c))}),mxUtils.bind(this,function(){this.savingFile=!1;null!=c&&c()}),!1,l)}))):null!=f&&f()};TrelloLibrary=function(b,e,f){TrelloFile.call(this,b,e,f)};mxUtils.extend(TrelloLibrary,TrelloFile);TrelloLibrary.prototype.doSave=function(b,e,f){this.saveFile(b,!1,e,f)};TrelloLibrary.prototype.open=function(){};TrelloClient=function(b){DrawioClient.call(this,b,"tauth");Trello.setKey(this.key)};mxUtils.extend(TrelloClient,DrawioClient);TrelloClient.prototype.key="e89d109082298ce91f6576f82f458551";TrelloClient.prototype.baseUrl="https://api.trello.com/1/";TrelloClient.prototype.SEPARATOR="|$|";TrelloClient.prototype.maxFileSize=1E7;TrelloClient.prototype.extension=".xml";TrelloClient.prototype.authenticate=function(b,e,f){f&&this.logout();f=mxUtils.bind(this,function(c,l){Trello.authorize({type:"popup",name:"draw.io",scope:{read:"true",write:"true"},expiration:c?"never":"1hour",success:function(){localStorage.setItem("drawio_trello_token",localStorage.trello_token);null!=l&&l();b()},error:function(){null!=l&&l();null!=e&&e(mxResources.get("loggedOut"))}})});this.isAuthorized()?f(!0):this.ui.showAuthDialog(this,!0,f)};TrelloClient.prototype.getLibrary=function(b,e,f){this.getFile(b,e,f,!1,!0)};-TrelloClient.prototype.getFile=function(b,e,f,c,l){l=null!=l?l:!1;var p=mxUtils.bind(this,function(){var q=b.split(this.SEPARATOR),v=!0,E=window.setTimeout(mxUtils.bind(this,function(){v=!1;f({code:App.ERROR_TIMEOUT,retry:p})}),this.ui.timeout);Trello.cards.get(q[0]+"/attachments/"+q[1],mxUtils.bind(this,function(G){window.clearTimeout(E);if(v){var B=/\.png$/i.test(G.name),d={Authorization:'OAuth oauth_consumer_key="'+Trello.key()+'", oauth_token="'+Trello.token()+'"'};/\.v(dx|sdx?)$/i.test(G.name)||-/\.gliffy$/i.test(G.name)||!this.ui.useCanvasForExport&&B?this.ui.convertFile(PROXY_URL+"?url="+encodeURIComponent(G.url),G.name,G.mimeType,this.extension,e,f,null,d):(v=!0,E=window.setTimeout(mxUtils.bind(this,function(){v=!1;f({code:App.ERROR_TIMEOUT})}),this.ui.timeout),this.ui.editor.loadUrl(PROXY_URL+"?url="+encodeURIComponent(G.url),mxUtils.bind(this,function(g){window.clearTimeout(E);if(v){G.compoundId=b;if(0<(B?g.lastIndexOf(","):-1)){var k=this.ui.extractGraphModelFromPng(g);null!=k&&0<k.length&&-(g=k)}l?e(new TrelloLibrary(this.ui,g,G)):e(new TrelloFile(this.ui,g,G))}}),mxUtils.bind(this,function(g,k){window.clearTimeout(E);v&&(401==k.status?this.authenticate(p,f,!0):f())}),B||null!=G.mimeType&&"image/"==G.mimeType.substring(0,6),null,null,null,d))}}),mxUtils.bind(this,function(G){window.clearTimeout(E);v&&(null!=G&&401==G.status?this.authenticate(p,f,!0):f())}))});this.authenticate(p,f)};TrelloClient.prototype.insertLibrary=function(b,e,f,c,l){this.insertFile(b,e,f,c,!0,l)};-TrelloClient.prototype.insertFile=function(b,e,f,c,l,p){l=null!=l?l:!1;var q=mxUtils.bind(this,function(){var v=mxUtils.bind(this,function(E){this.writeFile(b,E,p,mxUtils.bind(this,function(G){l?f(new TrelloLibrary(this.ui,e,G)):f(new TrelloFile(this.ui,e,G))}),c)});this.ui.useCanvasForExport&&/(\.png)$/i.test(b)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(E){v(this.ui.base64ToBlob(E,"image/png"))}),c,e):v(e)});this.authenticate(q,c)};-TrelloClient.prototype.saveFile=function(b,e,f){var c=b.meta.compoundId.split(this.SEPARATOR),l=mxUtils.bind(this,function(q){this.writeFile(b.meta.name,q,c[0],function(v){Trello.del("cards/"+c[0]+"/attachments/"+c[1],mxUtils.bind(this,function(){e(v)}),mxUtils.bind(this,function(E){null!=E&&401==E.status?this.authenticate(p,f,!0):f()}))},f)}),p=mxUtils.bind(this,function(){this.ui.useCanvasForExport&&/(\.png)$/i.test(b.meta.name)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(q){l(this.ui.base64ToBlob(q,+TrelloClient.prototype.getFile=function(b,e,f,c,l){l=null!=l?l:!1;var p=mxUtils.bind(this,function(){var q=b.split(this.SEPARATOR),v=!0,D=window.setTimeout(mxUtils.bind(this,function(){v=!1;f({code:App.ERROR_TIMEOUT,retry:p})}),this.ui.timeout);Trello.cards.get(q[0]+"/attachments/"+q[1],mxUtils.bind(this,function(G){window.clearTimeout(D);if(v){var B=/\.png$/i.test(G.name),d={Authorization:'OAuth oauth_consumer_key="'+Trello.key()+'", oauth_token="'+Trello.token()+'"'};/\.v(dx|sdx?)$/i.test(G.name)||+/\.gliffy$/i.test(G.name)||!this.ui.useCanvasForExport&&B?this.ui.convertFile(PROXY_URL+"?url="+encodeURIComponent(G.url),G.name,G.mimeType,this.extension,e,f,null,d):(v=!0,D=window.setTimeout(mxUtils.bind(this,function(){v=!1;f({code:App.ERROR_TIMEOUT})}),this.ui.timeout),this.ui.editor.loadUrl(PROXY_URL+"?url="+encodeURIComponent(G.url),mxUtils.bind(this,function(g){window.clearTimeout(D);if(v){G.compoundId=b;if(0<(B?g.lastIndexOf(","):-1)){var k=this.ui.extractGraphModelFromPng(g);null!=k&&0<k.length&&+(g=k)}l?e(new TrelloLibrary(this.ui,g,G)):e(new TrelloFile(this.ui,g,G))}}),mxUtils.bind(this,function(g,k){window.clearTimeout(D);v&&(401==k.status?this.authenticate(p,f,!0):f())}),B||null!=G.mimeType&&"image/"==G.mimeType.substring(0,6),null,null,null,d))}}),mxUtils.bind(this,function(G){window.clearTimeout(D);v&&(null!=G&&401==G.status?this.authenticate(p,f,!0):f())}))});this.authenticate(p,f)};TrelloClient.prototype.insertLibrary=function(b,e,f,c,l){this.insertFile(b,e,f,c,!0,l)};+TrelloClient.prototype.insertFile=function(b,e,f,c,l,p){l=null!=l?l:!1;var q=mxUtils.bind(this,function(){var v=mxUtils.bind(this,function(D){this.writeFile(b,D,p,mxUtils.bind(this,function(G){l?f(new TrelloLibrary(this.ui,e,G)):f(new TrelloFile(this.ui,e,G))}),c)});this.ui.useCanvasForExport&&/(\.png)$/i.test(b)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(D){v(this.ui.base64ToBlob(D,"image/png"))}),c,e):v(e)});this.authenticate(q,c)};+TrelloClient.prototype.saveFile=function(b,e,f){var c=b.meta.compoundId.split(this.SEPARATOR),l=mxUtils.bind(this,function(q){this.writeFile(b.meta.name,q,c[0],function(v){Trello.del("cards/"+c[0]+"/attachments/"+c[1],mxUtils.bind(this,function(){e(v)}),mxUtils.bind(this,function(D){null!=D&&401==D.status?this.authenticate(p,f,!0):f()}))},f)}),p=mxUtils.bind(this,function(){this.ui.useCanvasForExport&&/(\.png)$/i.test(b.meta.name)?this.ui.getEmbeddedPng(mxUtils.bind(this,function(q){l(this.ui.base64ToBlob(q,"image/png"))}),f,this.ui.getCurrentFile()!=b?b.getData():null):l(b.getData())});this.authenticate(p,f)};-TrelloClient.prototype.writeFile=function(b,e,f,c,l){if(null!=b&&null!=e)if(e.length>=this.maxFileSize)l({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(e.length)+" / 10 MB)"});else{var p=mxUtils.bind(this,function(){var q=!0,v=window.setTimeout(mxUtils.bind(this,function(){q=!1;l({code:App.ERROR_TIMEOUT,retry:p})}),this.ui.timeout),E=new FormData;E.append("key",Trello.key());E.append("token",Trello.token());E.append("file","string"===typeof e?new Blob([e]):e,b);E.append("name",-b);var G=new XMLHttpRequest;G.responseType="json";G.onreadystatechange=mxUtils.bind(this,function(){if(4===G.readyState&&(window.clearTimeout(v),q))if(200==G.status){var B=G.response;B.compoundId=f+this.SEPARATOR+B.id;c(B)}else 401==G.status?this.authenticate(p,l,!0):l()});G.open("POST",this.baseUrl+"cards/"+f+"/attachments");G.send(E)});this.authenticate(p,l)}else l({message:mxResources.get("unknownError")})};TrelloClient.prototype.pickLibrary=function(b){this.pickFile(b)};+TrelloClient.prototype.writeFile=function(b,e,f,c,l){if(null!=b&&null!=e)if(e.length>=this.maxFileSize)l({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(e.length)+" / 10 MB)"});else{var p=mxUtils.bind(this,function(){var q=!0,v=window.setTimeout(mxUtils.bind(this,function(){q=!1;l({code:App.ERROR_TIMEOUT,retry:p})}),this.ui.timeout),D=new FormData;D.append("key",Trello.key());D.append("token",Trello.token());D.append("file","string"===typeof e?new Blob([e]):e,b);D.append("name",+b);var G=new XMLHttpRequest;G.responseType="json";G.onreadystatechange=mxUtils.bind(this,function(){if(4===G.readyState&&(window.clearTimeout(v),q))if(200==G.status){var B=G.response;B.compoundId=f+this.SEPARATOR+B.id;c(B)}else 401==G.status?this.authenticate(p,l,!0):l()});G.open("POST",this.baseUrl+"cards/"+f+"/attachments");G.send(D)});this.authenticate(p,l)}else l({message:mxResources.get("unknownError")})};TrelloClient.prototype.pickLibrary=function(b){this.pickFile(b)};TrelloClient.prototype.pickFolder=function(b){this.authenticate(mxUtils.bind(this,function(){this.showTrelloDialog(!1,b)}),mxUtils.bind(this,function(e){this.ui.showError(mxResources.get("error"),e)}))};TrelloClient.prototype.pickFile=function(b,e){b=null!=b?b:mxUtils.bind(this,function(f){this.ui.loadFile("T"+encodeURIComponent(f))});this.authenticate(mxUtils.bind(this,function(){this.showTrelloDialog(!0,b)}),mxUtils.bind(this,function(f){this.ui.showError(mxResources.get("error"),f,mxResources.get("ok"))}))};TrelloClient.prototype.showTrelloDialog=function(b,e){var f=null,c="@me",l=0,p=document.createElement("div");p.style.whiteSpace="nowrap";p.style.overflow="hidden";p.style.height="224px";var q=document.createElement("h3");mxUtils.write(q,b?mxResources.get("selectFile"):mxResources.get("selectCard"));q.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";p.appendChild(q);var v=document.createElement("div");v.style.whiteSpace="nowrap";v.style.overflow="auto";v.style.height=-"194px";p.appendChild(v);p=new CustomDialog(this.ui,p);this.ui.showDialog(p.container,340,290,!0,!0);p.okButton.parentNode.removeChild(p.okButton);var E=mxUtils.bind(this,function(m,t,y){l++;var A=document.createElement("div");A.style="width:100%;text-overflow:ellipsis;overflow:hidden;vertical-align:middle;padding:2px 0 2px 0;background:"+(0==l%2?Editor.isDarkMode()?"#000":"#eee":Editor.isDarkMode()?"":"#fff");var I=document.createElement("a");I.style.cursor="pointer";if(null!=y){var F=document.createElement("img");-F.src=y.url;F.width=y.width;F.height=y.height;F.style="border: 1px solid black;margin:5px;vertical-align:middle";I.appendChild(F)}mxUtils.write(I,m);mxEvent.addListener(I,"click",t);A.appendChild(I);return A}),G=mxUtils.bind(this,function(m){this.ui.handleError(m,null,mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.hideDialog()}))}),B=mxUtils.bind(this,function(){l=0;v.innerText="";this.ui.spinner.spin(v,mxResources.get("loading"));var m=mxUtils.bind(this,function(){Trello.cards.get(f+-"/attachments",{fields:"id,name,previews"},mxUtils.bind(this,function(t){this.ui.spinner.stop();v.appendChild(E("../ [Up]",mxUtils.bind(this,function(){k()})));mxUtils.br(v);null==t||0==t.length?mxUtils.write(v,mxResources.get("noFiles")):mxUtils.bind(this,function(){for(var y=0;y<t.length;y++)mxUtils.bind(this,function(A){v.appendChild(E(A.name,mxUtils.bind(this,function(){this.ui.hideDialog();e(f+this.SEPARATOR+A.id)}),null!=A.previews?A.previews[0]:null))})(t[y])})()}),mxUtils.bind(this,function(t){401==+"194px";p.appendChild(v);p=new CustomDialog(this.ui,p);this.ui.showDialog(p.container,340,290,!0,!0);p.okButton.parentNode.removeChild(p.okButton);var D=mxUtils.bind(this,function(m,t,y){l++;var z=document.createElement("div");z.style="width:100%;text-overflow:ellipsis;overflow:hidden;vertical-align:middle;padding:2px 0 2px 0;background:"+(0==l%2?Editor.isDarkMode()?"#000":"#eee":Editor.isDarkMode()?"":"#fff");var I=document.createElement("a");I.style.cursor="pointer";if(null!=y){var F=document.createElement("img");+F.src=y.url;F.width=y.width;F.height=y.height;F.style="border: 1px solid black;margin:5px;vertical-align:middle";I.appendChild(F)}mxUtils.write(I,m);mxEvent.addListener(I,"click",t);z.appendChild(I);return z}),G=mxUtils.bind(this,function(m){this.ui.handleError(m,null,mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.hideDialog()}))}),B=mxUtils.bind(this,function(){l=0;v.innerText="";this.ui.spinner.spin(v,mxResources.get("loading"));var m=mxUtils.bind(this,function(){Trello.cards.get(f++"/attachments",{fields:"id,name,previews"},mxUtils.bind(this,function(t){this.ui.spinner.stop();v.appendChild(D("../ [Up]",mxUtils.bind(this,function(){k()})));mxUtils.br(v);null==t||0==t.length?mxUtils.write(v,mxResources.get("noFiles")):mxUtils.bind(this,function(){for(var y=0;y<t.length;y++)mxUtils.bind(this,function(z){v.appendChild(D(z.name,mxUtils.bind(this,function(){this.ui.hideDialog();e(f+this.SEPARATOR+z.id)}),null!=z.previews?z.previews[0]:null))})(t[y])})()}),mxUtils.bind(this,function(t){401==t.status?this.authenticate(m,G,!0):null!=G&&G(t)}))});m()}),d=null,g=null,k=mxUtils.bind(this,function(m){null==m&&(l=0,v.innerText="",m=1);this.ui.spinner.spin(v,mxResources.get("loading"));null!=d&&null!=d.parentNode&&d.parentNode.removeChild(d);d=document.createElement("a");d.style.display="block";d.style.cursor="pointer";mxUtils.write(d,mxResources.get("more")+"...");var t=mxUtils.bind(this,function(){mxEvent.removeListener(v,"scroll",g);k(m+1)});mxEvent.addListener(d,"click",t);var y=mxUtils.bind(this,-function(){Trello.get("search",{query:""==mxUtils.trim(c)?"is:open":c,cards_limit:100,cards_page:m-1},mxUtils.bind(this,function(A){this.ui.spinner.stop();A=null!=A?A.cards:null;if(null==A||0==A.length)mxUtils.write(v,mxResources.get("noFiles"));else{1==m&&(v.appendChild(E(mxResources.get("filterCards")+"...",mxUtils.bind(this,function(){var F=new FilenameDialog(this.ui,c,mxResources.get("ok"),mxUtils.bind(this,function(C){null!=C&&(c=C,k())}),mxResources.get("filterCards"),null,null,"http://help.trello.com/article/808-searching-for-cards-all-boards");-this.ui.showDialog(F.container,300,80,!0,!1);F.init()}))),mxUtils.br(v));for(var I=0;I<A.length;I++)mxUtils.bind(this,function(F){v.appendChild(E(F.name,mxUtils.bind(this,function(){b?(f=F.id,B()):(this.ui.hideDialog(),e(F.id))})))})(A[I]);100==A.length&&(v.appendChild(d),g=function(){v.scrollTop>=v.scrollHeight-v.offsetHeight&&t()},mxEvent.addListener(v,"scroll",g))}}),mxUtils.bind(this,function(A){401==A.status?this.authenticate(y,G,!0):null!=G&&G({message:A.responseText})}))});y()});k()};+function(){Trello.get("search",{query:""==mxUtils.trim(c)?"is:open":c,cards_limit:100,cards_page:m-1},mxUtils.bind(this,function(z){this.ui.spinner.stop();z=null!=z?z.cards:null;if(null==z||0==z.length)mxUtils.write(v,mxResources.get("noFiles"));else{1==m&&(v.appendChild(D(mxResources.get("filterCards")+"...",mxUtils.bind(this,function(){var F=new FilenameDialog(this.ui,c,mxResources.get("ok"),mxUtils.bind(this,function(C){null!=C&&(c=C,k())}),mxResources.get("filterCards"),null,null,"http://help.trello.com/article/808-searching-for-cards-all-boards");+this.ui.showDialog(F.container,300,80,!0,!1);F.init()}))),mxUtils.br(v));for(var I=0;I<z.length;I++)mxUtils.bind(this,function(F){v.appendChild(D(F.name,mxUtils.bind(this,function(){b?(f=F.id,B()):(this.ui.hideDialog(),e(F.id))})))})(z[I]);100==z.length&&(v.appendChild(d),g=function(){v.scrollTop>=v.scrollHeight-v.offsetHeight&&t()},mxEvent.addListener(v,"scroll",g))}}),mxUtils.bind(this,function(z){401==z.status?this.authenticate(y,G,!0):null!=G&&G({message:z.responseText})}))});y()});k()};TrelloClient.prototype.isAuthorized=function(){try{var b=localStorage.trello_token;null==b&&(b=localStorage.drawio_trello_token,null!=b&&localStorage.setItem("trello_token",b));return null!=b}catch(e){}return!1};TrelloClient.prototype.logout=function(){localStorage.removeItem("drawio_trello_token");Trello.deauthorize()};GitLabFile=function(b,e,f){GitHubFile.call(this,b,e,f);this.peer=this.ui.gitLab};mxUtils.extend(GitLabFile,GitHubFile);GitLabFile.prototype.getFileUrl=function(){return this.meta.html_url};GitLabFile.prototype.getFolderUrl=function(){var b=this.getFileUrl();return b.substring(0,b.lastIndexOf("/"))};GitLabFile.prototype.share=function(){this.ui.editor.graph.openLink(DRAWIO_GITLAB_URL+"/"+this.meta.org+"/"+encodeURIComponent(this.meta.repo)+"/-/project_members")};GitLabFile.prototype.getId=function(){return this.meta.org+"/"+(null!=this.meta.repo?encodeURIComponent(this.meta.repo)+"/"+(null!=this.meta.ref?this.meta.ref+(null!=this.meta.path?"/"+this.meta.path:""):""):"")};GitLabFile.prototype.getHash=function(){return encodeURIComponent("A"+this.getId())};GitLabFile.prototype.isConflict=function(b){return null!=b&&400==b.status};GitLabFile.prototype.getMode=function(){return App.MODE_GITLAB};GitLabFile.prototype.getDescriptorEtag=function(b){return b.last_commit_id};GitLabFile.prototype.setDescriptorEtag=function(b,e){b.last_commit_id=e};GitLabLibrary=function(b,e,f){GitLabFile.call(this,b,e,f)};mxUtils.extend(GitLabLibrary,GitLabFile);GitLabLibrary.prototype.doSave=function(b,e,f){this.saveFile(b,!1,e,f)};GitLabLibrary.prototype.open=function(){};(function(){var b=null;window.GitLabClient=function(e){GitHubClient.call(this,e,"gitlabauth")};mxUtils.extend(GitLabClient,GitHubClient);GitLabClient.prototype.clientId=DRAWIO_GITLAB_ID;GitLabClient.prototype.scope="api%20read_repository%20write_repository";GitLabClient.prototype.baseUrl=DRAWIO_GITLAB_URL+"/api/v4";GitLabClient.prototype.maxFileSize=1E7;GitLabClient.prototype.authToken="Bearer";GitLabClient.prototype.redirectUri=window.DRAWIO_SERVER_URL+"gitlab";GitLabClient.prototype.authenticate=function(e,f){(new mxXmlRequest(this.redirectUri+"?getState=1",null,"GET")).send(mxUtils.bind(this,function(c){200<=c.getStatus()&&299>=c.getStatus()?this.authenticateStep2(c.getText(),e,f):null!=f&&f(c)}),f)};GitLabClient.prototype.authenticateStep2=function(e,f,c){if(null==window.onGitLabCallback){var l=mxUtils.bind(this,function(){var p=!0;null!=this.getPersistentToken(!0)?(new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+e),null,"GET")).send(mxUtils.bind(this,function(q){if(200<=q.getStatus()&&299>=q.getStatus())try{b=JSON.parse(q.getText()).access_token,this.setToken(b),this.setUser(null),f()}catch(v){c({message:mxResources.get("authFailed"),retry:l})}else this.clearPersistentToken(),this.setUser(null),b=null,this.setToken(null),401==q.getStatus()?l():c({message:mxResources.get("accessDenied"),retry:l})}),c):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(q,v){null!=window.open(DRAWIO_GITLAB_URL+"/oauth/authorize?client_id="+-this.clientId+"&scope="+this.scope+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+e),"gitlabauth")?window.onGitLabCallback=mxUtils.bind(this,function(E,G){p?(window.onGitLabCallback=null,p=!1,null==E?c({message:mxResources.get("accessDenied"),retry:l}):(null!=v&&v(),b=E.access_token,this.setToken(b),this.setUser(null),q&&this.setPersistentToken("remembered"),f(),null!=G&&G.close())):-null!=G&&G.close()}):c({message:mxResources.get("serviceUnavailableOrBlocked"),retry:l})}),mxUtils.bind(this,function(){p&&(window.onGitLabCallback=null,p=!1,c({message:mxResources.get("accessDenied"),retry:l}))}))});l()}else c({code:App.ERROR_BUSY})};GitLabClient.prototype.executeRequest=function(e,f,c,l){var p=mxUtils.bind(this,function(v){var E=!0,G=window.setTimeout(mxUtils.bind(this,function(){E=!1;c({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout),B=this.authToken+-" "+b;e.setRequestHeaders=function(d,g){d.setRequestHeader("Authorization",B);d.setRequestHeader("PRIVATE_TOKEN",B);d.setRequestHeader("Content-Type","application/json")};e.send(mxUtils.bind(this,function(){window.clearTimeout(G);if(E)if(200<=e.getStatus()&&299>=e.getStatus()||l&&404==e.getStatus())f(e);else if(401===e.getStatus())v?c({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){q(!0)},c)})}):this.authenticate(function(){p(!0)},c);else if(403===-e.getStatus()){var d=!1;try{var g=JSON.parse(e.getText());null!=g&&null!=g.errors&&0<g.errors.length&&(d="too_large"==g.errors[0].code)}catch(k){}c({message:mxResources.get(d?"drawingTooLarge":"forbidden")})}else 404===e.getStatus()?c({message:this.getErrorMessage(e,mxResources.get("fileNotFound"))}):c({status:e.getStatus(),message:this.getErrorMessage(e,mxResources.get("error")+" "+e.getStatus())})}),mxUtils.bind(this,function(d){window.clearTimeout(G);E&&c(d)}))}),q=mxUtils.bind(this,function(v){null==-this.user?this.updateUser(function(){q(!0)},c,v):p(v)});null==b?this.authenticate(function(){q(!0)},c):q(!1)};GitLabClient.prototype.getRefIndex=function(e,f,c,l,p,q){if(null!=p)c(e,p);else{var v=e.length-2,E=mxUtils.bind(this,function(){if(2>v)l({message:mxResources.get("fileNotFound")});else{var G=Math.max(v-1,0),B=e.slice(0,G).join("/");G=e[G];var d=e[v],g=e.slice(v+1,e.length).join("/");B=this.baseUrl+"/projects/"+encodeURIComponent(B+"/"+G)+"/repository/"+(f?q?"branches?per_page=1&page=1&ref="+-d:"tree?path="+g+"&ref="+d:"files/"+encodeURIComponent(g)+"?ref="+d);var k=new mxXmlRequest(B,null,"HEAD");this.executeRequest(k,mxUtils.bind(this,function(){200==k.getStatus()?c(e,v):l({message:mxResources.get("fileNotFound")})}),mxUtils.bind(this,function(){404==k.getStatus()?(v--,E()):l({message:mxResources.get("fileNotFound")})}))}});E()}};GitLabClient.prototype.getFile=function(e,f,c,l,p,q){l=null!=l?l:!1;this.getRefIndex(e.split("/"),!1,mxUtils.bind(this,function(v,E){var G=Math.max(E-1,0),-B=v.slice(0,G).join("/"),d=v[G],g=v[E];e=v.slice(E+1,v.length).join("/");v=/\.png$/i.test(e);if(!p&&(/\.v(dx|sdx?)$/i.test(e)||/\.gliffy$/i.test(e)||/\.pdf$/i.test(e)||!this.ui.useCanvasForExport&&v))if(null!=b){G="&t="+(new Date).getTime();var k=this.baseUrl+"/projects/"+encodeURIComponent(B+"/"+d)+"/repository/files/"+encodeURIComponent(e)+"?ref="+g;v=e.split("/");this.ui.convertFile(k+G,0<v.length?v[v.length-1]:e,null,this.extension,f,c,mxUtils.bind(this,function(m,t,y){m=new mxXmlRequest(m,null,-"GET");this.executeRequest(m,mxUtils.bind(this,function(A){try{t(this.getFileContent(JSON.parse(A.getText())))}catch(I){y(I)}}),y)}))}else c({message:mxResources.get("accessDenied")});else G="&t="+(new Date).getTime(),k=this.baseUrl+"/projects/"+encodeURIComponent(B+"/"+d)+"/repository/files/"+encodeURIComponent(e)+"?ref="+g,v=new mxXmlRequest(k+G,null,"GET"),this.executeRequest(v,mxUtils.bind(this,function(m){try{f(this.createGitLabFile(B,d,g,JSON.parse(m.getText()),l,E))}catch(t){c(t)}}),c)}),c,+this.clientId+"&scope="+this.scope+"&redirect_uri="+encodeURIComponent(this.redirectUri)+"&response_type=code&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host+"&token="+e),"gitlabauth")?window.onGitLabCallback=mxUtils.bind(this,function(D,G){p?(window.onGitLabCallback=null,p=!1,null==D?c({message:mxResources.get("accessDenied"),retry:l}):(null!=v&&v(),b=D.access_token,this.setToken(b),this.setUser(null),q&&this.setPersistentToken("remembered"),f(),null!=G&&G.close())):+null!=G&&G.close()}):c({message:mxResources.get("serviceUnavailableOrBlocked"),retry:l})}),mxUtils.bind(this,function(){p&&(window.onGitLabCallback=null,p=!1,c({message:mxResources.get("accessDenied"),retry:l}))}))});l()}else c({code:App.ERROR_BUSY})};GitLabClient.prototype.executeRequest=function(e,f,c,l){var p=mxUtils.bind(this,function(v){var D=!0,G=window.setTimeout(mxUtils.bind(this,function(){D=!1;c({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout),B=this.authToken++" "+b;e.setRequestHeaders=function(d,g){d.setRequestHeader("Authorization",B);d.setRequestHeader("PRIVATE_TOKEN",B);d.setRequestHeader("Content-Type","application/json")};e.send(mxUtils.bind(this,function(){window.clearTimeout(G);if(D)if(200<=e.getStatus()&&299>=e.getStatus()||l&&404==e.getStatus())f(e);else if(401===e.getStatus())v?c({message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){q(!0)},c)})}):this.authenticate(function(){p(!0)},c);else if(403===+e.getStatus()){var d=!1;try{var g=JSON.parse(e.getText());null!=g&&null!=g.errors&&0<g.errors.length&&(d="too_large"==g.errors[0].code)}catch(k){}c({message:mxResources.get(d?"drawingTooLarge":"forbidden")})}else 404===e.getStatus()?c({message:this.getErrorMessage(e,mxResources.get("fileNotFound"))}):c({status:e.getStatus(),message:this.getErrorMessage(e,mxResources.get("error")+" "+e.getStatus())})}),mxUtils.bind(this,function(d){window.clearTimeout(G);D&&c(d)}))}),q=mxUtils.bind(this,function(v){null==+this.user?this.updateUser(function(){q(!0)},c,v):p(v)});null==b?this.authenticate(function(){q(!0)},c):q(!1)};GitLabClient.prototype.getRefIndex=function(e,f,c,l,p,q){if(null!=p)c(e,p);else{var v=e.length-2,D=mxUtils.bind(this,function(){if(2>v)l({message:mxResources.get("fileNotFound")});else{var G=Math.max(v-1,0),B=e.slice(0,G).join("/");G=e[G];var d=e[v],g=e.slice(v+1,e.length).join("/");B=this.baseUrl+"/projects/"+encodeURIComponent(B+"/"+G)+"/repository/"+(f?q?"branches?per_page=1&page=1&ref="++d:"tree?path="+g+"&ref="+d:"files/"+encodeURIComponent(g)+"?ref="+d);var k=new mxXmlRequest(B,null,"HEAD");this.executeRequest(k,mxUtils.bind(this,function(){200==k.getStatus()?c(e,v):l({message:mxResources.get("fileNotFound")})}),mxUtils.bind(this,function(){404==k.getStatus()?(v--,D()):l({message:mxResources.get("fileNotFound")})}))}});D()}};GitLabClient.prototype.getFile=function(e,f,c,l,p,q){l=null!=l?l:!1;this.getRefIndex(e.split("/"),!1,mxUtils.bind(this,function(v,D){var G=Math.max(D-1,0),+B=v.slice(0,G).join("/"),d=v[G],g=v[D];e=v.slice(D+1,v.length).join("/");v=/\.png$/i.test(e);if(!p&&(/\.v(dx|sdx?)$/i.test(e)||/\.gliffy$/i.test(e)||/\.pdf$/i.test(e)||!this.ui.useCanvasForExport&&v))if(null!=b){G="&t="+(new Date).getTime();var k=this.baseUrl+"/projects/"+encodeURIComponent(B+"/"+d)+"/repository/files/"+encodeURIComponent(e)+"?ref="+g;v=e.split("/");this.ui.convertFile(k+G,0<v.length?v[v.length-1]:e,null,this.extension,f,c,mxUtils.bind(this,function(m,t,y){m=new mxXmlRequest(m,null,+"GET");this.executeRequest(m,mxUtils.bind(this,function(z){try{t(this.getFileContent(JSON.parse(z.getText())))}catch(I){y(I)}}),y)}))}else c({message:mxResources.get("accessDenied")});else G="&t="+(new Date).getTime(),k=this.baseUrl+"/projects/"+encodeURIComponent(B+"/"+d)+"/repository/files/"+encodeURIComponent(e)+"?ref="+g,v=new mxXmlRequest(k+G,null,"GET"),this.executeRequest(v,mxUtils.bind(this,function(m){try{f(this.createGitLabFile(B,d,g,JSON.parse(m.getText()),l,D))}catch(t){c(t)}}),c)}),c,q)};GitLabClient.prototype.getFileContent=function(e){var f=e.file_name,c=e.content;"base64"===e.encoding&&(/\.jpe?g$/i.test(f)?c="data:image/jpeg;base64,"+c:/\.gif$/i.test(f)?c="data:image/gif;base64,"+c:/\.pdf$/i.test(f)?c="data:application/pdf;base64,"+c:/\.png$/i.test(f)?(e=this.ui.extractGraphModelFromPng(c),c=null!=e&&0<e.length?e:"data:image/png;base64,"+c):c=Base64.decode(c));return c};GitLabClient.prototype.createGitLabFile=function(e,f,c,l,p,q){var v=DRAWIO_GITLAB_URL+"/";e={org:e,repo:f,-ref:c,name:l.file_name,path:l.file_path,html_url:v+e+"/"+f+"/blob/"+c+"/"+l.file_path,download_url:v+e+"/"+f+"/raw/"+c+"/"+l.file_path+"?inline=false",last_commit_id:l.last_commit_id,refPos:q};l=this.getFileContent(l);return p?new GitLabLibrary(this.ui,l,e):new GitLabFile(this.ui,l,e)};GitLabClient.prototype.insertFile=function(e,f,c,l,p,q,v){p=null!=p?p:!1;q=q.split("/");this.getRefIndex(q,!0,mxUtils.bind(this,function(E,G){var B=Math.max(G-1,0),d=E.slice(0,B).join("/"),g=E[B],k=E[G];path=E.slice(G+-1,E.length).join("/");0<path.length&&(path+="/");path+=e;this.checkExists(d+"/"+g+"/"+k+"/"+path,!0,mxUtils.bind(this,function(m,t){m?p?(v||(f=Base64.encode(f)),this.showCommitDialog(e,!0,mxUtils.bind(this,function(y){this.writeFile(d,g,k,path,y,f,t,mxUtils.bind(this,function(A){try{var I=JSON.parse(A.getText());c(this.createGitLabFile(d,g,k,null!=I.content?I.content:I,p,G))}catch(F){l(F)}}),l)}),l)):(m=DRAWIO_GITLAB_URL+"/",c(new GitLabFile(this.ui,f,{org:d,repo:g,ref:k,name:e,path:path,html_url:m++ref:c,name:l.file_name,path:l.file_path,html_url:v+e+"/"+f+"/blob/"+c+"/"+l.file_path,download_url:v+e+"/"+f+"/raw/"+c+"/"+l.file_path+"?inline=false",last_commit_id:l.last_commit_id,refPos:q};l=this.getFileContent(l);return p?new GitLabLibrary(this.ui,l,e):new GitLabFile(this.ui,l,e)};GitLabClient.prototype.insertFile=function(e,f,c,l,p,q,v){p=null!=p?p:!1;q=q.split("/");this.getRefIndex(q,!0,mxUtils.bind(this,function(D,G){var B=Math.max(G-1,0),d=D.slice(0,B).join("/"),g=D[B],k=D[G];path=D.slice(G++1,D.length).join("/");0<path.length&&(path+="/");path+=e;this.checkExists(d+"/"+g+"/"+k+"/"+path,!0,mxUtils.bind(this,function(m,t){m?p?(v||(f=Base64.encode(f)),this.showCommitDialog(e,!0,mxUtils.bind(this,function(y){this.writeFile(d,g,k,path,y,f,t,mxUtils.bind(this,function(z){try{var I=JSON.parse(z.getText());c(this.createGitLabFile(d,g,k,null!=I.content?I.content:I,p,G))}catch(F){l(F)}}),l)}),l)):(m=DRAWIO_GITLAB_URL+"/",c(new GitLabFile(this.ui,f,{org:d,repo:g,ref:k,name:e,path:path,html_url:m+d+"/"+g+"/blob/"+k+"/"+path,download_url:m+d+"/"+g+"/raw/"+k+"/"+path+"?inline=false",refPos:G,last_commit_id:t,isNew:!0}))):l()}))}),l,null,4>=q.length)};GitLabClient.prototype.checkExists=function(e,f,c){this.getFile(e,mxUtils.bind(this,function(l){if(f){var p=this.ui.spinner.pause();this.ui.confirm(mxResources.get("replaceIt",[e]),function(){p();c(!0,l.getCurrentEtag())},function(){p();c(!1)})}else this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),-mxResources.get("ok"),function(){c(!1)})}),mxUtils.bind(this,function(l){c(!0)}),null,!0)};GitLabClient.prototype.writeFile=function(e,f,c,l,p,q,v,E,G){if(q.length>=this.maxFileSize)G({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(q.length)+" / 10 MB)"});else{var B="POST";c={path:encodeURIComponent(l),branch:decodeURIComponent(c),commit_message:p,content:q,encoding:"base64"};null!=v&&(c.last_commit_id=v,B="PUT");e=this.baseUrl+"/projects/"+encodeURIComponent(e+"/"+f)+"/repository/files/"+-encodeURIComponent(l);B=new mxXmlRequest(e,JSON.stringify(c),B);this.executeRequest(B,mxUtils.bind(this,function(d){E(d)}),G)}};GitLabClient.prototype.saveFile=function(e,f,c,l,p){var q=e.meta.org,v=e.meta.repo,E=e.meta.ref,G=e.meta.path,B=mxUtils.bind(this,function(g,k){this.writeFile(q,v,E,G,p,k,g,mxUtils.bind(this,function(m){delete e.meta.isNew;this.getFile(q+"/"+v+"/"+E+"/"+G,mxUtils.bind(this,function(t){t.getData()==e.getData()?f(t.getCurrentEtag()):f({content:e.getCurrentEtag()})}),c,null,-null,e.meta.refPos)}),c)}),d=mxUtils.bind(this,function(){if(this.ui.useCanvasForExport&&/(\.png)$/i.test(G)){var g=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(k){B(e.meta.last_commit_id,k)}),c,this.ui.getCurrentFile()!=e?e.getData():null,g.scale,g.border)}else B(e.meta.last_commit_id,Base64.encode(e.getData()))});l?this.getFile(q+"/"+v+"/"+E+"/"+G,mxUtils.bind(this,function(g){e.meta.last_commit_id=g.meta.last_commit_id;d()}),c):d()};GitLabClient.prototype.pickFolder=-function(e){this.showGitLabDialog(!1,e,!0)};GitLabClient.prototype.pickFile=function(e){e=null!=e?e:mxUtils.bind(this,function(f){this.ui.loadFile("A"+encodeURIComponent(f))});this.showGitLabDialog(!0,e)};GitLabClient.prototype.showGitLabDialog=function(e,f,c){var l=null,p=null,q=null,v=null,E=document.createElement("div");E.style.whiteSpace="nowrap";E.style.overflow="hidden";E.style.height="304px";var G=document.createElement("h3");mxUtils.write(G,mxResources.get(e?"selectFile":"selectFolder"));-G.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";E.appendChild(G);var B=document.createElement("div");B.style.whiteSpace="nowrap";B.style.border="1px solid lightgray";B.style.boxSizing="border-box";B.style.padding="4px";B.style.overflow="auto";B.style.lineHeight="1.2em";B.style.height="274px";E.appendChild(B);var d=document.createElement("div");d.style.textOverflow="ellipsis";d.style.boxSizing="border-box";d.style.overflow="hidden";d.style.padding="4px";d.style.width=-"100%";var g=new CustomDialog(this.ui,E,mxUtils.bind(this,function(){f(l+"/"+p+"/"+encodeURIComponent(q)+"/"+v)}));this.ui.showDialog(g.container,420,370,!0,!0);e&&g.okButton.parentNode.removeChild(g.okButton);var k=mxUtils.bind(this,function(Q,S,V,P){var u=document.createElement("a");u.setAttribute("title",Q);u.style.cursor="pointer";mxUtils.write(u,Q);mxEvent.addListener(u,"click",S);P&&(u.style.textDecoration="underline");null!=V&&(Q=d.cloneNode(),Q.style.padding=V,Q.appendChild(u),u=Q);return u}),+mxResources.get("ok"),function(){c(!1)})}),mxUtils.bind(this,function(l){c(!0)}),null,!0)};GitLabClient.prototype.writeFile=function(e,f,c,l,p,q,v,D,G){if(q.length>=this.maxFileSize)G({message:mxResources.get("drawingTooLarge")+" ("+this.ui.formatFileSize(q.length)+" / 10 MB)"});else{var B="POST";c={path:encodeURIComponent(l),branch:decodeURIComponent(c),commit_message:p,content:q,encoding:"base64"};null!=v&&(c.last_commit_id=v,B="PUT");e=this.baseUrl+"/projects/"+encodeURIComponent(e+"/"+f)+"/repository/files/"++encodeURIComponent(l);B=new mxXmlRequest(e,JSON.stringify(c),B);this.executeRequest(B,mxUtils.bind(this,function(d){D(d)}),G)}};GitLabClient.prototype.saveFile=function(e,f,c,l,p){var q=e.meta.org,v=e.meta.repo,D=e.meta.ref,G=e.meta.path,B=mxUtils.bind(this,function(g,k){this.writeFile(q,v,D,G,p,k,g,mxUtils.bind(this,function(m){delete e.meta.isNew;this.getFile(q+"/"+v+"/"+D+"/"+G,mxUtils.bind(this,function(t){t.getData()==e.getData()?f(t.getCurrentEtag()):f({content:e.getCurrentEtag()})}),c,null,+null,e.meta.refPos)}),c)}),d=mxUtils.bind(this,function(){if(this.ui.useCanvasForExport&&/(\.png)$/i.test(G)){var g=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(k){B(e.meta.last_commit_id,k)}),c,this.ui.getCurrentFile()!=e?e.getData():null,g.scale,g.border)}else B(e.meta.last_commit_id,Base64.encode(e.getData()))});l?this.getFile(q+"/"+v+"/"+D+"/"+G,mxUtils.bind(this,function(g){e.meta.last_commit_id=g.meta.last_commit_id;d()}),c):d()};GitLabClient.prototype.pickFolder=+function(e){this.showGitLabDialog(!1,e,!0)};GitLabClient.prototype.pickFile=function(e){e=null!=e?e:mxUtils.bind(this,function(f){this.ui.loadFile("A"+encodeURIComponent(f))});this.showGitLabDialog(!0,e)};GitLabClient.prototype.showGitLabDialog=function(e,f,c){var l=null,p=null,q=null,v=null,D=document.createElement("div");D.style.whiteSpace="nowrap";D.style.overflow="hidden";D.style.height="304px";var G=document.createElement("h3");mxUtils.write(G,mxResources.get(e?"selectFile":"selectFolder"));+G.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";D.appendChild(G);var B=document.createElement("div");B.style.whiteSpace="nowrap";B.style.border="1px solid lightgray";B.style.boxSizing="border-box";B.style.padding="4px";B.style.overflow="auto";B.style.lineHeight="1.2em";B.style.height="274px";D.appendChild(B);var d=document.createElement("div");d.style.textOverflow="ellipsis";d.style.boxSizing="border-box";d.style.overflow="hidden";d.style.padding="4px";d.style.width=+"100%";var g=new CustomDialog(this.ui,D,mxUtils.bind(this,function(){f(l+"/"+p+"/"+encodeURIComponent(q)+"/"+v)}));this.ui.showDialog(g.container,420,370,!0,!0);e&&g.okButton.parentNode.removeChild(g.okButton);var k=mxUtils.bind(this,function(Q,S,V,P){var u=document.createElement("a");u.setAttribute("title",Q);u.style.cursor="pointer";mxUtils.write(u,Q);mxEvent.addListener(u,"click",S);P&&(u.style.textDecoration="underline");null!=V&&(Q=d.cloneNode(),Q.style.padding=V,Q.appendChild(u),u=Q);return u}),m=mxUtils.bind(this,function(Q){var S=document.createElement("div");S.style.marginBottom="8px";S.appendChild(k(l+"/"+p,mxUtils.bind(this,function(){v=null;C()}),null,!0));Q||(mxUtils.write(S," / "),S.appendChild(k(decodeURIComponent(q),mxUtils.bind(this,function(){v=null;F()}),null,!0)));if(null!=v&&0<v.length){var V=v.split("/");for(Q=0;Q<V.length;Q++)(function(P){mxUtils.write(S," / ");S.appendChild(k(V[P],mxUtils.bind(this,function(){v=V.slice(0,P+1).join("/");I()}),null,!0))})(Q)}B.appendChild(S)}),-t=mxUtils.bind(this,function(Q){this.ui.handleError(Q,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(v=q=p=l=null,C()):this.ui.hideDialog()}))}),y=null,A=null,I=mxUtils.bind(this,function(Q){null==Q&&(B.innerText="",Q=1);var S=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(l+"/"+p)+"/repository/tree?path="+v+"&ref="+q+"&per_page=100&page="+Q,null,"GET");this.ui.spinner.spin(B,mxResources.get("loading"));g.okButton.removeAttribute("disabled");null!=A&&-(mxEvent.removeListener(B,"scroll",A),A=null);null!=y&&null!=y.parentNode&&y.parentNode.removeChild(y);y=document.createElement("a");y.style.display="block";y.style.cursor="pointer";mxUtils.write(y,mxResources.get("more")+"...");var V=mxUtils.bind(this,function(){I(Q+1)});mxEvent.addListener(y,"click",V);this.executeRequest(S,mxUtils.bind(this,function(P){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();1==Q&&(m(!q),B.appendChild(k("../ [Up]",mxUtils.bind(this,function(){if(""==-v||null==v)v=null,C();else{var K=v.split("/");v=K.slice(0,K.length-1).join("/");I()}}),"4px")));var u=JSON.parse(P.getText());if(null==u||0==u.length)c||(mxUtils.br(B),mxUtils.write(B,mxResources.get("noFiles")));else{var x=!0,J=0,H=mxUtils.bind(this,function(K){for(var O=0;O<u.length;O++)mxUtils.bind(this,function(M){if(K==("tree"==M.type)){var n=d.cloneNode();n.style.backgroundColor=x?Editor.isDarkMode()?"#000000":"#eeeeee":"";x=!x;var z=document.createElement("img");z.src=IMAGE_PATH+"/"+("tree"==-M.type?"folder.png":"file.png");z.setAttribute("align","absmiddle");z.style.marginRight="4px";z.style.marginTop="-4px";z.width=20;n.appendChild(z);n.appendChild(k(M.name+("tree"==M.type?"/":""),mxUtils.bind(this,function(){"tree"==M.type?(v=M.path,I()):e&&"blob"==M.type&&(this.ui.hideDialog(),f(l+"/"+p+"/"+q+"/"+M.path))})));B.appendChild(n);J++}})(u[O])});H(!0);e&&H(!1);100==J&&(B.appendChild(y),A=function(){B.scrollTop>=B.scrollHeight-B.offsetHeight&&V()},mxEvent.addListener(B,"scroll",A))}}))}),-t,!0)}),F=mxUtils.bind(this,function(Q,S){null==Q&&(B.innerText="",Q=1);var V=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(l+"/"+p)+"/repository/branches?per_page=100&page="+Q,null,"GET");g.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(B,mxResources.get("loading"));null!=A&&(mxEvent.removeListener(B,"scroll",A),A=null);null!=y&&null!=y.parentNode&&y.parentNode.removeChild(y);y=document.createElement("a");y.style.display="block";y.style.cursor="pointer";mxUtils.write(y,+t=mxUtils.bind(this,function(Q){this.ui.handleError(Q,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(v=q=p=l=null,C()):this.ui.hideDialog()}))}),y=null,z=null,I=mxUtils.bind(this,function(Q){null==Q&&(B.innerText="",Q=1);var S=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(l+"/"+p)+"/repository/tree?path="+v+"&ref="+q+"&per_page=100&page="+Q,null,"GET");this.ui.spinner.spin(B,mxResources.get("loading"));g.okButton.removeAttribute("disabled");null!=z&&+(mxEvent.removeListener(B,"scroll",z),z=null);null!=y&&null!=y.parentNode&&y.parentNode.removeChild(y);y=document.createElement("a");y.style.display="block";y.style.cursor="pointer";mxUtils.write(y,mxResources.get("more")+"...");var V=mxUtils.bind(this,function(){I(Q+1)});mxEvent.addListener(y,"click",V);this.executeRequest(S,mxUtils.bind(this,function(P){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();1==Q&&(m(!q),B.appendChild(k("../ [Up]",mxUtils.bind(this,function(){if(""==+v||null==v)v=null,C();else{var K=v.split("/");v=K.slice(0,K.length-1).join("/");I()}}),"4px")));var u=JSON.parse(P.getText());if(null==u||0==u.length)c||(mxUtils.br(B),mxUtils.write(B,mxResources.get("noFiles")));else{var x=!0,J=0,H=mxUtils.bind(this,function(K){for(var N=0;N<u.length;N++)mxUtils.bind(this,function(M){if(K==("tree"==M.type)){var n=d.cloneNode();n.style.backgroundColor=x?Editor.isDarkMode()?"#000000":"#eeeeee":"";x=!x;var A=document.createElement("img");A.src=IMAGE_PATH+"/"+("tree"==+M.type?"folder.png":"file.png");A.setAttribute("align","absmiddle");A.style.marginRight="4px";A.style.marginTop="-4px";A.width=20;n.appendChild(A);n.appendChild(k(M.name+("tree"==M.type?"/":""),mxUtils.bind(this,function(){"tree"==M.type?(v=M.path,I()):e&&"blob"==M.type&&(this.ui.hideDialog(),f(l+"/"+p+"/"+q+"/"+M.path))})));B.appendChild(n);J++}})(u[N])});H(!0);e&&H(!1);100==J&&(B.appendChild(y),z=function(){B.scrollTop>=B.scrollHeight-B.offsetHeight&&V()},mxEvent.addListener(B,"scroll",z))}}))}),+t,!0)}),F=mxUtils.bind(this,function(Q,S){null==Q&&(B.innerText="",Q=1);var V=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(l+"/"+p)+"/repository/branches?per_page=100&page="+Q,null,"GET");g.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(B,mxResources.get("loading"));null!=z&&(mxEvent.removeListener(B,"scroll",z),z=null);null!=y&&null!=y.parentNode&&y.parentNode.removeChild(y);y=document.createElement("a");y.style.display="block";y.style.cursor="pointer";mxUtils.write(y,mxResources.get("more")+"...");var P=mxUtils.bind(this,function(){F(Q+1)});mxEvent.addListener(y,"click",P);this.executeRequest(V,mxUtils.bind(this,function(u){this.ui.tryAndHandle(mxUtils.bind(this,function(){this.ui.spinner.stop();1==Q&&(m(!0),B.appendChild(k("../ [Up]",mxUtils.bind(this,function(){v=null;C()}),"4px")));var x=JSON.parse(u.getText());if(null==x||0==x.length)mxUtils.br(B),mxUtils.write(B,mxResources.get("repositoryNotFound"));else if(1==x.length&&S)q=x[0].name,v="",I();else{for(var J=-0;J<x.length;J++)mxUtils.bind(this,function(H,K){var O=d.cloneNode();O.style.backgroundColor=0==K%2?Editor.isDarkMode()?"#000000":"#eeeeee":"";O.appendChild(k(H.name,mxUtils.bind(this,function(){q=encodeURIComponent(H.name);v="";I()})));B.appendChild(O)})(x[J],J);100==x.length&&(B.appendChild(y),A=function(){B.scrollTop>=B.scrollHeight-B.offsetHeight&&P()},mxEvent.addListener(B,"scroll",A))}}))}),t)});g.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(B,mxResources.get("loading"));-var C=mxUtils.bind(this,function(Q){var S=this.ui.spinner,V=0;this.ui.spinner.stop();var P=function(){S.spin(B,mxResources.get("loading"));V+=1},u=function(){--V;0===V&&S.stop()};null==Q&&(B.innerText="",Q=1);null!=A&&(mxEvent.removeListener(B,"scroll",A),A=null);null!=y&&null!=y.parentNode&&y.parentNode.removeChild(y);y=document.createElement("a");y.style.display="block";y.style.cursor="pointer";mxUtils.write(y,mxResources.get("more")+"...");var x=mxUtils.bind(this,function(){0===V&&C(Q+1)});mxEvent.addListener(y,-"click",x);var J=mxUtils.bind(this,function(K){P();var O=new mxXmlRequest(this.baseUrl+"/groups?per_page=100",null,"GET");this.executeRequest(O,mxUtils.bind(this,function(M){this.ui.tryAndHandle(mxUtils.bind(this,function(){K(JSON.parse(M.getText()));u()}))}),t)}),H=mxUtils.bind(this,function(K,O){P();var M=new mxXmlRequest(this.baseUrl+"/groups/"+K.id+"/projects?per_page=100",null,"GET");this.executeRequest(M,mxUtils.bind(this,function(n){this.ui.tryAndHandle(mxUtils.bind(this,function(){O(K,JSON.parse(n.getText()));-u()}))}),t)});J(mxUtils.bind(this,function(K){if(null==this.user)mxUtils.write(B,mxResources.get("loggedOut"));else{P();var O=new mxXmlRequest(this.baseUrl+"/users/"+this.user.id+"/projects?per_page=100&page="+Q,null,"GET");this.executeRequest(O,mxUtils.bind(this,function(M){M=JSON.parse(M.getText());if(null!=M&&0!=M.length||null!=K&&0!=K.length){1==Q&&(B.appendChild(k(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){if(0===V){var D=new FilenameDialog(this.ui,"group/project",mxResources.get("ok"),-mxUtils.bind(this,function(L){null!=L&&(L=L.split("/"),1<L.length?(l=L.slice(0,L.length-1).join("/"),p=L[L.length-1],v="",F(null,!0)):(this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})))}),mxResources.get("enterValue"));this.ui.showDialog(D.container,300,80,!0,!1);D.init()}}))),mxUtils.br(B),mxUtils.br(B));for(var n=!0,z=0;z<M.length;z++)mxUtils.bind(this,function(D){var L=d.cloneNode();L.style.backgroundColor=n?Editor.isDarkMode()?"#000000":"#eeeeee":"";n=!n;L.appendChild(k(D.name_with_namespace,-mxUtils.bind(this,function(){0===V&&(l=D.owner.username,p=D.path,v="",F(null,!0))})));B.appendChild(L)})(M[z]);for(z=0;z<K.length;z++)P(),H(K[z],mxUtils.bind(this,function(D,L){u();for(var N=0;N<L.length;N++){var R=d.cloneNode();R.style.backgroundColor=n?Editor.isDarkMode()?"#000000":"#eeeeee":"";n=!n;mxUtils.bind(this,function(T){R.appendChild(k(T.name_with_namespace,mxUtils.bind(this,function(){0===V&&(l=D.full_path,p=T.path,v="",F(null,!0))})));B.appendChild(R)})(L[N])}}));u()}else u(),mxUtils.br(B),-mxUtils.write(B,mxResources.get("repositoryNotFound"));100==M.length&&(B.appendChild(y),A=function(){B.scrollTop>=B.scrollHeight-B.offsetHeight&&x()},mxEvent.addListener(B,"scroll",A))}),t)}}))});b?this.user?C():this.updateUser(function(){C()},t,!0):this.authenticate(mxUtils.bind(this,function(){this.updateUser(function(){C()},t,!0)}),t)};GitLabClient.prototype.logout=function(){this.ui.editor.loadUrl(this.redirectUri+"?doLogout=1&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host));+0;J<x.length;J++)mxUtils.bind(this,function(H,K){var N=d.cloneNode();N.style.backgroundColor=0==K%2?Editor.isDarkMode()?"#000000":"#eeeeee":"";N.appendChild(k(H.name,mxUtils.bind(this,function(){q=encodeURIComponent(H.name);v="";I()})));B.appendChild(N)})(x[J],J);100==x.length&&(B.appendChild(y),z=function(){B.scrollTop>=B.scrollHeight-B.offsetHeight&&P()},mxEvent.addListener(B,"scroll",z))}}))}),t)});g.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(B,mxResources.get("loading"));+var C=mxUtils.bind(this,function(Q){var S=this.ui.spinner,V=0;this.ui.spinner.stop();var P=function(){S.spin(B,mxResources.get("loading"));V+=1},u=function(){--V;0===V&&S.stop()};null==Q&&(B.innerText="",Q=1);null!=z&&(mxEvent.removeListener(B,"scroll",z),z=null);null!=y&&null!=y.parentNode&&y.parentNode.removeChild(y);y=document.createElement("a");y.style.display="block";y.style.cursor="pointer";mxUtils.write(y,mxResources.get("more")+"...");var x=mxUtils.bind(this,function(){0===V&&C(Q+1)});mxEvent.addListener(y,+"click",x);var J=mxUtils.bind(this,function(K){P();var N=new mxXmlRequest(this.baseUrl+"/groups?per_page=100",null,"GET");this.executeRequest(N,mxUtils.bind(this,function(M){this.ui.tryAndHandle(mxUtils.bind(this,function(){K(JSON.parse(M.getText()));u()}))}),t)}),H=mxUtils.bind(this,function(K,N){P();var M=new mxXmlRequest(this.baseUrl+"/groups/"+K.id+"/projects?per_page=100",null,"GET");this.executeRequest(M,mxUtils.bind(this,function(n){this.ui.tryAndHandle(mxUtils.bind(this,function(){N(K,JSON.parse(n.getText()));+u()}))}),t)});J(mxUtils.bind(this,function(K){if(null==this.user)mxUtils.write(B,mxResources.get("loggedOut"));else{P();var N=new mxXmlRequest(this.baseUrl+"/users/"+this.user.id+"/projects?per_page=100&page="+Q,null,"GET");this.executeRequest(N,mxUtils.bind(this,function(M){M=JSON.parse(M.getText());if(null!=M&&0!=M.length||null!=K&&0!=K.length){1==Q&&(B.appendChild(k(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){if(0===V){var E=new FilenameDialog(this.ui,"group/project",mxResources.get("ok"),+mxUtils.bind(this,function(L){null!=L&&(L=L.split("/"),1<L.length?(l=L.slice(0,L.length-1).join("/"),p=L[L.length-1],v="",F(null,!0)):(this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})))}),mxResources.get("enterValue"));this.ui.showDialog(E.container,300,80,!0,!1);E.init()}}))),mxUtils.br(B),mxUtils.br(B));for(var n=!0,A=0;A<M.length;A++)mxUtils.bind(this,function(E){var L=d.cloneNode();L.style.backgroundColor=n?Editor.isDarkMode()?"#000000":"#eeeeee":"";n=!n;L.appendChild(k(E.name_with_namespace,+mxUtils.bind(this,function(){0===V&&(l=E.owner.username,p=E.path,v="",F(null,!0))})));B.appendChild(L)})(M[A]);for(A=0;A<K.length;A++)P(),H(K[A],mxUtils.bind(this,function(E,L){u();for(var O=0;O<L.length;O++){var R=d.cloneNode();R.style.backgroundColor=n?Editor.isDarkMode()?"#000000":"#eeeeee":"";n=!n;mxUtils.bind(this,function(T){R.appendChild(k(T.name_with_namespace,mxUtils.bind(this,function(){0===V&&(l=E.full_path,p=T.path,v="",F(null,!0))})));B.appendChild(R)})(L[O])}}));u()}else u(),mxUtils.br(B),+mxUtils.write(B,mxResources.get("repositoryNotFound"));100==M.length&&(B.appendChild(y),z=function(){B.scrollTop>=B.scrollHeight-B.offsetHeight&&x()},mxEvent.addListener(B,"scroll",z))}),t)}}))});b?this.user?C():this.updateUser(function(){C()},t,!0):this.authenticate(mxUtils.bind(this,function(){this.updateUser(function(){C()},t,!0)}),t)};GitLabClient.prototype.logout=function(){this.ui.editor.loadUrl(this.redirectUri+"?doLogout=1&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.host));this.clearPersistentToken();this.setUser(null);b=null;this.setToken(null)}})();DrawioComment=function(b,e,f,c,l,p,q){this.file=b;this.id=e;this.content=f;this.modifiedDate=c;this.createdDate=l;this.isResolved=p;this.user=q;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,e,f,c,l){e()};DrawioComment.prototype.editComment=function(b,e,f){e()};DrawioComment.prototype.deleteComment=function(b,e){b()};DriveComment=function(b,e,f,c,l,p,q,v){DrawioComment.call(this,b,e,f,c,l,p,q);this.pCommentId=v};mxUtils.extend(DriveComment,DrawioComment);DriveComment.prototype.addReply=function(b,e,f,c,l){b={content:b.content};c?b.verb="resolve":l&&(b.verb="reopen");this.file.ui.drive.executeRequest({url:"/files/"+this.file.getId()+"/comments/"+this.id+"/replies",params:b,method:"POST"},mxUtils.bind(this,function(p){e(p.replyId)}),f)};DriveComment.prototype.editComment=function(b,e,f){this.content=b;b={content:b};this.file.ui.drive.executeRequest(this.pCommentId?{url:"/files/"+this.file.getId()+"/comments/"+this.pCommentId+"/replies/"+this.id,params:b,method:"PATCH"}:{url:"/files/"+this.file.getId()+"/comments/"+this.id,params:b,method:"PATCH"},e,f)};-DriveComment.prototype.deleteComment=function(b,e){this.file.ui.drive.executeRequest(this.pCommentId?{url:"/files/"+this.file.getId()+"/comments/"+this.pCommentId+"/replies/"+this.id,method:"DELETE"}:{url:"/files/"+this.file.getId()+"/comments/"+this.id,method:"DELETE"},b,e)};function mxODPicker(b,e,f,c,l,p,q,v,E,G,B,d,g,k){function m(U,W){W=W||document;return W.querySelector(U)}function t(U,W,X){if(null==U["@microsoft.graph.downloadUrl"])if(null==U.parentReference)X();else{c(U.id,U.parentReference.driveId,function(ca){t(ca,W,X)},X);return}var Y=new XMLHttpRequest;Y.open("GET",U["@microsoft.graph.downloadUrl"]);var Z=U.file?"image/png"==U.file.mimeType:!1;Y.onreadystatechange=function(){if(4==this.readyState){if(200<=this.status&&299>=this.status)try{var ca=Y.responseText;-Z?(ca="data:image/png;base64,"+Editor.base64Encode(ca),ca=Editor.extractGraphModelFromPng(ca)):/\.pdf$/.test(U.name)&&(ca="data:application/pdf;base64,"+Editor.base64Encode(ca),ca=Editor.extractGraphModelFromPdf(ca));var ea=mxUtils.parseXml(ca),ja="mxlibrary"==ea.documentElement.nodeName?ea.documentElement:Editor.extractGraphModel(ea.documentElement);if(null!=ja){W(ja.ownerDocument);return}}catch(ba){}X()}};(Z||/\.pdf$/.test(U.name))&&Y.overrideMimeType&&Y.overrideMimeType("text/plain; charset=x-user-defined");-Y.send()}function y(){d&&null!=J?x.exportToCanvas(function(U){U=EditorUi.prototype.createImageDataUri(U,null,"png");q(H,U);p(H)},400,null,null,function(U){console.log(U)},600,null,null,null,null,null,J):(q(H,void 0),p(H))}function A(U){function W(X){N.style.background="transparent";N.innerText="";var Y=document.createElement("div");Y.className="odPreviewStatus";mxUtils.write(Y,X);N.appendChild(Y);u.stop()}if(null!=N)if(N.style.background="transparent",N.innerText="",null==U||U.folder||/\.drawiolib$/.test(U.name))W(mxResources.get("noPreview"));-else try{null!=U.remoteItem&&(U=U.remoteItem),z=U,u.spin(N),t(U,function(X){u.stop();if(z==U)if("mxlibrary"==X.documentElement.nodeName)W(mxResources.get("noPreview"));else{var Y=X.getElementsByTagName("diagram");J=AspectDialog.prototype.createViewer(N,0==Y.length?X.documentElement:Y[0],null,"transparent")}},function(){H=null;W(mxResources.get("notADiagramFile"))})}catch(X){H=null,W(mxResources.get("notADiagramFile"))}}function I(){var U=m(".odFilesBreadcrumb");if(null!=U){U.innerText="";for(var W=-0;W<M.length-1;W++){var X=document.createElement("span");X.className="odBCFolder";X.innerHTML=mxUtils.htmlEntities(M[W].name||mxResources.get("home"));U.appendChild(X);(function(Z,ca){X.addEventListener("click",function(){e(null);M=M.slice(0,ca);C(Z.driveId,Z.folderId,Z.siteId,Z.name)})})(M[W],W);var Y=document.createElement("span");Y.innerHTML=" > ";U.appendChild(Y)}null!=M[M.length-1]&&(W=document.createElement("span"),W.innerHTML=mxUtils.htmlEntities(1==M.length?mxResources.get(E?"selectFolder":-"officeSelDiag"):M[M.length-1].name||mxResources.get("home")),U.appendChild(W))}}function F(){if(null!=H&&!O)if("sharepoint"==K)C("site",null,H.id,H.displayName);else if("site"==K)C("subsite",null,H.id,H.name);else{var U=H.folder;H=H.remoteItem?H.remoteItem:H;var W=(H.parentReference?H.parentReference.driveId:null)||K,X=H.id;U?C(W,X,null,H.name):y()}}function C(U,W,X,Y,Z){function ca(va){u.stop();var Aa=document.createElement("table");Aa.className="odFileListGrid";for(var ka=null,ta=0,pa=0;null!=-va&&pa<va.length;pa++){var ma=va[pa];if(1!=ba||!ma.webUrl||0<ma.webUrl.indexOf("sharepoint.com/sites/")||0>ma.webUrl.indexOf("sharepoint.com/")){var Da=ma.displayName||ma.name,wa=mxUtils.htmlEntities(ma.description||Da);ba&&(ma.folder=2==ba?{isRoot:!0}:!0);var ya=null!=ma.folder;if(!E||ya){var xa=document.createElement("tr");xa.className=ta++%2?"odOddRow":"odEvenRow";var Fa=document.createElement("td");Fa.style.width="36px";var Ca=document.createElement("img");Ca.src="/images/"+(ya?"folder.png":"file.png");+DriveComment.prototype.deleteComment=function(b,e){this.file.ui.drive.executeRequest(this.pCommentId?{url:"/files/"+this.file.getId()+"/comments/"+this.pCommentId+"/replies/"+this.id,method:"DELETE"}:{url:"/files/"+this.file.getId()+"/comments/"+this.id,method:"DELETE"},b,e)};function mxODPicker(b,e,f,c,l,p,q,v,D,G,B,d,g,k){function m(U,W){W=W||document;return W.querySelector(U)}function t(U,W,X){if(null==U["@microsoft.graph.downloadUrl"])if(null==U.parentReference)X();else{c(U.id,U.parentReference.driveId,function(ca){t(ca,W,X)},X);return}var Y=new XMLHttpRequest;Y.open("GET",U["@microsoft.graph.downloadUrl"]);var Z=U.file?"image/png"==U.file.mimeType:!1;Y.onreadystatechange=function(){if(4==this.readyState){if(200<=this.status&&299>=this.status)try{var ca=Y.responseText;+Z?(ca="data:image/png;base64,"+Editor.base64Encode(ca),ca=Editor.extractGraphModelFromPng(ca)):/\.pdf$/.test(U.name)&&(ca="data:application/pdf;base64,"+Editor.base64Encode(ca),ca=Editor.extractGraphModelFromPdf(ca));var ea=mxUtils.parseXml(ca),ia="mxlibrary"==ea.documentElement.nodeName?ea.documentElement:Editor.extractGraphModel(ea.documentElement);if(null!=ia){W(ia.ownerDocument);return}}catch(ba){}X()}};(Z||/\.pdf$/.test(U.name))&&Y.overrideMimeType&&Y.overrideMimeType("text/plain; charset=x-user-defined");+Y.send()}function y(){d&&null!=J?x.exportToCanvas(function(U){U=EditorUi.prototype.createImageDataUri(U,null,"png");q(H,U);p(H)},400,null,null,function(U){console.log(U)},600,null,null,null,null,null,J):(q(H,void 0),p(H))}function z(U){function W(X){O.style.background="transparent";O.innerText="";var Y=document.createElement("div");Y.className="odPreviewStatus";mxUtils.write(Y,X);O.appendChild(Y);u.stop()}if(null!=O)if(O.style.background="transparent",O.innerText="",null==U||U.folder||/\.drawiolib$/.test(U.name))W(mxResources.get("noPreview"));+else try{null!=U.remoteItem&&(U=U.remoteItem),A=U,u.spin(O),t(U,function(X){u.stop();if(A==U)if("mxlibrary"==X.documentElement.nodeName)W(mxResources.get("noPreview"));else{var Y=X.getElementsByTagName("diagram");J=AspectDialog.prototype.createViewer(O,0==Y.length?X.documentElement:Y[0],null,"transparent")}},function(){H=null;W(mxResources.get("notADiagramFile"))})}catch(X){H=null,W(mxResources.get("notADiagramFile"))}}function I(){var U=m(".odFilesBreadcrumb");if(null!=U){U.innerText="";for(var W=+0;W<M.length-1;W++){var X=document.createElement("span");X.className="odBCFolder";X.innerHTML=mxUtils.htmlEntities(M[W].name||mxResources.get("home"));U.appendChild(X);(function(Z,ca){X.addEventListener("click",function(){e(null);M=M.slice(0,ca);C(Z.driveId,Z.folderId,Z.siteId,Z.name)})})(M[W],W);var Y=document.createElement("span");Y.innerHTML=" > ";U.appendChild(Y)}null!=M[M.length-1]&&(W=document.createElement("span"),W.innerHTML=mxUtils.htmlEntities(1==M.length?mxResources.get(D?"selectFolder":+"officeSelDiag"):M[M.length-1].name||mxResources.get("home")),U.appendChild(W))}}function F(){if(null!=H&&!N)if("sharepoint"==K)C("site",null,H.id,H.displayName);else if("site"==K)C("subsite",null,H.id,H.name);else{var U=H.folder;H=H.remoteItem?H.remoteItem:H;var W=(H.parentReference?H.parentReference.driveId:null)||K,X=H.id;U?C(W,X,null,H.name):y()}}function C(U,W,X,Y,Z){function ca(va){u.stop();var Aa=document.createElement("table");Aa.className="odFileListGrid";for(var ka=null,ta=0,pa=0;null!=+va&&pa<va.length;pa++){var ma=va[pa];if(1!=ba||!ma.webUrl||0<ma.webUrl.indexOf("sharepoint.com/sites/")||0>ma.webUrl.indexOf("sharepoint.com/")){var Da=ma.displayName||ma.name,wa=mxUtils.htmlEntities(ma.description||Da);ba&&(ma.folder=2==ba?{isRoot:!0}:!0);var ya=null!=ma.folder;if(!D||ya){var xa=document.createElement("tr");xa.className=ta++%2?"odOddRow":"odEvenRow";var Fa=document.createElement("td");Fa.style.width="36px";var Ca=document.createElement("img");Ca.src="/images/"+(ya?"folder.png":"file.png");Ca.className="odFileImg";Fa.appendChild(Ca);xa.appendChild(Fa);Fa=document.createElement("td");ya=document.createElement("div");ya.className="odFileTitle";ya.innerHTML=mxUtils.htmlEntities(Da);ya.setAttribute("title",wa);Fa.appendChild(ya);xa.appendChild(Fa);Aa.appendChild(xa);null==ka&&(ka=xa,ka.className+=" odRowSelected",H=ma,K=U,k||e(H));(function(Ia,La){xa.addEventListener("dblclick",F);xa.addEventListener("click",function(){ka!=La&&(ka.className=ka.className.replace("odRowSelected",""),ka=La,-ka.className+=" odRowSelected",H=Ia,K=U,k||e(H))})})(ma,xa)}}}0==ta?(va=document.createElement("div"),va.className="odEmptyFolder",va.innerHTML=mxUtils.htmlEntities(mxResources.get("folderEmpty",null,"Folder is empty!")),aa.appendChild(va)):aa.appendChild(Aa);I();O=!1}function ea(va){f(va?va:Ba,function(Aa){if(ja){var ka=Aa.value||[];if(k||ba)Array.prototype.push.apply(na,ka);else{for(var ta=0;ta<ka.length;ta++){var pa=ka[ta],ma=pa.file?pa.file.mimeType:null;(pa.folder||"text/html"==ma||"text/xml"==-ma||"application/xml"==ma||"image/png"==ma||/\.svg$/.test(pa.name)||/\.html$/.test(pa.name)||/\.xml$/.test(pa.name)||/\.png$/.test(pa.name)||/\.drawio$/.test(pa.name)||/\.drawiolib$/.test(pa.name)||/\.pdf$/.test(pa.name))&&na.push(pa)}na.sort(function(Da,wa){var ya=Da.name.toLowerCase(),xa=wa.name.toLowerCase();return Da.folder&&!wa.folder?-1:!Da.folder&&wa.folder?1:ya<xa?-1:ya>xa?1:0})}Aa["@odata.nextLink"]&&1E3>na.length?ea(Aa["@odata.nextLink"]):(clearTimeout(fa),ca(na))}},function(Aa){if(ja){clearTimeout(fa);-var ka=null;try{ka=JSON.parse(Aa.responseText).error.message}catch(ta){}v(mxResources.get("errorFetchingFolder",null,"Error fetching folder items")+(null!=ka?" ("+ka+")":""));O=!1;u.stop()}},null!=va)}if(!O){m(".odCatsList").style.display="block";m(".odFilesSec").style.display="block";null!=N&&(N.innerText="",N.style.top="50%");var ja=O=!0,ba=0;n=arguments;var fa=setTimeout(function(){O=ja=!1;u.stop();v(mxResources.get("timeout"))},2E4),aa=m(".odFilesList");aa.innerText="";u.spin(aa);switch(U){case "recent":M=-[{name:mxResources.get("recent",null,"Recent"),driveId:U}];var ia=l()||{},ha=[],da;for(da in ia)ha.push(ia[da]);clearTimeout(fa);ca(ha);return;case "shared":var Ba="/me/drive/sharedWithMe";M=[{name:mxResources.get("sharedWithMe",null,"Shared With Me"),driveId:U}];break;case "sharepoint":Ba="/sites?search=";M=[{name:mxResources.get("sharepointSites",null,"Sharepoint Sites"),driveId:U}];ba=1;break;case "site":M.push({name:Y,driveId:U,folderId:W,siteId:X});Ba="/sites/"+X+"/drives";ba=2;break;case "subsite":M.push({name:Y,+ka.className+=" odRowSelected",H=Ia,K=U,k||e(H))})})(ma,xa)}}}0==ta?(va=document.createElement("div"),va.className="odEmptyFolder",va.innerHTML=mxUtils.htmlEntities(mxResources.get("folderEmpty",null,"Folder is empty!")),aa.appendChild(va)):aa.appendChild(Aa);I();N=!1}function ea(va){f(va?va:Ba,function(Aa){if(ia){var ka=Aa.value||[];if(k||ba)Array.prototype.push.apply(na,ka);else{for(var ta=0;ta<ka.length;ta++){var pa=ka[ta],ma=pa.file?pa.file.mimeType:null;(pa.folder||"text/html"==ma||"text/xml"==+ma||"application/xml"==ma||"image/png"==ma||/\.svg$/.test(pa.name)||/\.html$/.test(pa.name)||/\.xml$/.test(pa.name)||/\.png$/.test(pa.name)||/\.drawio$/.test(pa.name)||/\.drawiolib$/.test(pa.name)||/\.pdf$/.test(pa.name))&&na.push(pa)}na.sort(function(Da,wa){var ya=Da.name.toLowerCase(),xa=wa.name.toLowerCase();return Da.folder&&!wa.folder?-1:!Da.folder&&wa.folder?1:ya<xa?-1:ya>xa?1:0})}Aa["@odata.nextLink"]&&1E3>na.length?ea(Aa["@odata.nextLink"]):(clearTimeout(fa),ca(na))}},function(Aa){if(ia){clearTimeout(fa);+var ka=null;try{ka=JSON.parse(Aa.responseText).error.message}catch(ta){}v(mxResources.get("errorFetchingFolder",null,"Error fetching folder items")+(null!=ka?" ("+ka+")":""));N=!1;u.stop()}},null!=va)}if(!N){m(".odCatsList").style.display="block";m(".odFilesSec").style.display="block";null!=O&&(O.innerText="",O.style.top="50%");var ia=N=!0,ba=0;n=arguments;var fa=setTimeout(function(){N=ia=!1;u.stop();v(mxResources.get("timeout"))},2E4),aa=m(".odFilesList");aa.innerText="";u.spin(aa);switch(U){case "recent":M=+[{name:mxResources.get("recent",null,"Recent"),driveId:U}];var ja=l()||{},ha=[],da;for(da in ja)ha.push(ja[da]);clearTimeout(fa);ca(ha);return;case "shared":var Ba="/me/drive/sharedWithMe";M=[{name:mxResources.get("sharedWithMe",null,"Shared With Me"),driveId:U}];break;case "sharepoint":Ba="/sites?search=";M=[{name:mxResources.get("sharepointSites",null,"Sharepoint Sites"),driveId:U}];ba=1;break;case "site":M.push({name:Y,driveId:U,folderId:W,siteId:X});Ba="/sites/"+X+"/drives";ba=2;break;case "subsite":M.push({name:Y,driveId:U,folderId:W,siteId:X});Ba="/drives/"+X+(W?"/items/"+W:"/root")+"/children";break;case "search":U=K;M=[{driveId:U,name:mxResources.get("back",null,"Back")}];Z=encodeURIComponent(Z.replace(/'/g,"\\'"));Ba=U?"/drives/"+U+"/root/search(q='"+Z+"')":"/me/drive/root/search(q='"+Z+"')";break;default:null==W?M=[{driveId:U}]:M.push({name:Y,driveId:U,folderId:W}),Ba=(U?"/drives/"+U:"/me/drive")+(W?"/items/"+W:"/root")+"/children"}ba||(Ba+=(0<Ba.indexOf("?")?"&":"?")+"select=id,name,description,parentReference,file,createdBy,lastModifiedBy,lastModifiedDateTime,size,folder,remoteItem,@microsoft.graph.downloadUrl");-var na=[];ea()}}function Q(U){R.className=R.className.replace("odCatSelected","");R=U;R.className+=" odCatSelected"}function S(U){O||(T=null,C("search",null,null,null,U))}var V="";null==e&&(e=A,V='<div style="text-align: center;" class="odPreview"></div>');null==l&&(l=function(){var U=null;try{U=JSON.parse(localStorage.getItem("mxODPickerRecentList"))}catch(W){}return U});null==p&&(p=function(U){if(null!=U){var W=l()||{};delete U["@microsoft.graph.downloadUrl"];W[U.id]=U;localStorage.setItem("mxODPickerRecentList",+var na=[];ea()}}function Q(U){R.className=R.className.replace("odCatSelected","");R=U;R.className+=" odCatSelected"}function S(U){N||(T=null,C("search",null,null,null,U))}var V="";null==e&&(e=z,V='<div style="text-align: center;" class="odPreview"></div>');null==l&&(l=function(){var U=null;try{U=JSON.parse(localStorage.getItem("mxODPickerRecentList"))}catch(W){}return U});null==p&&(p=function(U){if(null!=U){var W=l()||{};delete U["@microsoft.graph.downloadUrl"];W[U.id]=U;localStorage.setItem("mxODPickerRecentList",JSON.stringify(W))}});V='<div class="odCatsList"><div class="odCatsListLbl">OneDrive</div><div id="odFiles" class="odCatListTitle odCatSelected">'+mxUtils.htmlEntities(mxResources.get("files"))+'</div><div id="odRecent" class="odCatListTitle">'+mxUtils.htmlEntities(mxResources.get("recent"))+'</div><div id="odShared" class="odCatListTitle">'+mxUtils.htmlEntities(mxResources.get("shared"))+'</div><div id="odSharepoint" class="odCatListTitle">'+mxUtils.htmlEntities(mxResources.get("sharepoint"))+'</div></div><div class="odFilesSec"><div class="searchBar" style="display:none"><input type="search" id="odSearchBox" placeholder="'+mxUtils.htmlEntities(mxResources.get("search"))+'"></div><div class="odFilesBreadcrumb"></div><div id="refreshOD" class="odRefreshButton"><img class="geAdaptiveAsset" src="/images/update32.png" width="16" height="16" title="'+mxUtils.htmlEntities(mxResources.get("refresh"))+'Refresh" border="0"/></div><div class="odFilesList"></div></div>'+V+(G?'<div id="odBackBtn" class="odLinkBtn">< '+mxUtils.htmlEntities(mxResources.get("back"))+"</div>":"")+(B?'<button id="odSubmitBtn" class="odSubmitBtn">'+-mxUtils.htmlEntities(mxResources.get(E?"select":"open"))+"</button>":"");var P=null!=window.Editor&&null!=Editor.isDarkMode&&Editor.isDarkMode();P=".odCatsList *, .odFilesSec * { user-select: none; }.odCatsList {\tbox-sizing: border-box;\tposition:absolute;\ttop:0px;\tbottom:50%;\twidth:30%;\tborder: 1px solid #CCCCCC;\tborder-bottom:none;\tdisplay: inline-block;\toverflow-x: hidden;\toverflow-y: auto;}.odCatsListLbl {\theight: 17px;\tcolor: #6D6D6D;\tfont-size: 14px;\tfont-weight: bold;\tline-height: 17px;\tmargin: 10px 0 3px 5px;}.odFilesSec {\tbox-sizing: border-box;\tposition:absolute;\tleft:30%;\ttop:0px;\tbottom:50%;\twidth: 70%;\tborder: 1px solid #CCCCCC;\tborder-left:none;\tborder-bottom:none;\tdisplay: inline-block;\toverflow: hidden;}.odFilesBreadcrumb {\tbox-sizing: border-box;\tposition:absolute;\tmin-height: 32px;\tleft:0px;\tright:20px;\ttext-overflow:ellipsis;\toverflow:hidden;\tfont-size: 13px;\tcolor: #6D6D6D;\tpadding: 5px;}.odRefreshButton {\tbox-sizing: border-box;\tposition:absolute;\tright:0px;\ttop:0px;\tpadding: 4px;\tmargin: 1px;\theight:24px;\tcursor:default;}.odRefreshButton>img {\topacity:0.5;}.odRefreshButton:hover {\tbackground-color:#ddd;\tborder-radius:50%;}.odRefreshButton:active {\topacity:0.7;}.odFilesList {\tbox-sizing: border-box;\tposition:absolute;\ttop:32px;\tbottom:0px;\twidth: 100%;\toverflow-x: hidden;\toverflow-y: auto;}.odFileImg {\twidth: 24px;\tpadding-left: 5px;\tpadding-right: 5px;}.odFileTitle {\tcursor: default;\tfont-weight: normal;\tcolor: #666666 !important;\twidth: calc(100% - 20px);\twhite-space: nowrap;\toverflow: hidden;\ttext-overflow: ellipsis;}.odFileListGrid {\twidth: 100%;\twhite-space: nowrap;\tfont-size: 13px; box-sizing: border-box; border-spacing: 0;}.odOddRow {"++mxUtils.htmlEntities(mxResources.get(D?"select":"open"))+"</button>":"");var P=null!=window.Editor&&null!=Editor.isDarkMode&&Editor.isDarkMode();P=".odCatsList *, .odFilesSec * { user-select: none; }.odCatsList {\tbox-sizing: border-box;\tposition:absolute;\ttop:0px;\tbottom:50%;\twidth:30%;\tborder: 1px solid #CCCCCC;\tborder-bottom:none;\tdisplay: inline-block;\toverflow-x: hidden;\toverflow-y: auto;}.odCatsListLbl {\theight: 17px;\tcolor: #6D6D6D;\tfont-size: 14px;\tfont-weight: bold;\tline-height: 17px;\tmargin: 10px 0 3px 5px;}.odFilesSec {\tbox-sizing: border-box;\tposition:absolute;\tleft:30%;\ttop:0px;\tbottom:50%;\twidth: 70%;\tborder: 1px solid #CCCCCC;\tborder-left:none;\tborder-bottom:none;\tdisplay: inline-block;\toverflow: hidden;}.odFilesBreadcrumb {\tbox-sizing: border-box;\tposition:absolute;\tmin-height: 32px;\tleft:0px;\tright:20px;\ttext-overflow:ellipsis;\toverflow:hidden;\tfont-size: 13px;\tcolor: #6D6D6D;\tpadding: 5px;}.odRefreshButton {\tbox-sizing: border-box;\tposition:absolute;\tright:0px;\ttop:0px;\tpadding: 4px;\tmargin: 1px;\theight:24px;\tcursor:default;}.odRefreshButton>img {\topacity:0.5;}.odRefreshButton:hover {\tbackground-color:#ddd;\tborder-radius:50%;}.odRefreshButton:active {\topacity:0.7;}.odFilesList {\tbox-sizing: border-box;\tposition:absolute;\ttop:32px;\tbottom:0px;\twidth: 100%;\toverflow-x: hidden;\toverflow-y: auto;}.odFileImg {\twidth: 24px;\tpadding-left: 5px;\tpadding-right: 5px;}.odFileTitle {\tcursor: default;\tfont-weight: normal;\tcolor: #666666 !important;\twidth: calc(100% - 20px);\twhite-space: nowrap;\toverflow: hidden;\ttext-overflow: ellipsis;}.odFileListGrid {\twidth: 100%;\twhite-space: nowrap;\tfont-size: 13px; box-sizing: border-box; border-spacing: 0;}.odOddRow {"+(P?"":"\tbackground-color: #eeeeee;")+"}.odEvenRow {"+(P?"":"\tbackground-color: #FFFFFF;")+"}.odRowSelected {\tbackground-color: #cadfff;}.odCatListTitle {\tbox-sizing: border-box;\theight: 17px;\tcursor: default;\tcolor: #666666;\tfont-size: 14px;\tline-height: 17px;\tmargin: 5px 0 5px 0px; padding-left: 10px;}.odCatSelected {\tfont-weight: bold;\tbackground-color: #cadfff;}.odEmptyFolder {\theight: 17px;\tcolor: #6D6D6D;\tfont-size: 14px;\tfont-weight: bold;\tline-height: 17px;\tmargin: 10px 0 3px 5px;\twidth: 100%; text-align: center;}.odBCFolder {\tcursor: pointer;\tcolor: #0432ff;}.odPreviewStatus {\tposition:absolute;\ttext-align:center;\twidth:100%;\ttop:50%;\ttransform: translateY(-50%);\tfont-size:13px;\topacity:0.5;}.odPreview { position:absolute;\t overflow:hidden;\t border: 1px solid #CCCCCC; bottom:0px; top: 50%; left:0px; right:0px;}.odLinkBtn { position: absolute;\tfont-size: 12px;\tcursor: pointer;\tcolor: #6D6D6D;\tleft: 5px;\tbottom: 3px;}.odSubmitBtn { position: absolute;\tcolor: #333;\tright: 5px;\tbottom: 5px;}";-var u=new Spinner({left:"50%",lines:12,length:8,width:3,radius:5,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9}),x=new Editor,J=null,H=null,K=null,O=!1,M=[],n=null,z=null;this.getSelectedItem=function(){null!=H&&p(H);return H};if(null==m("#mxODPickerCss")){var D=document.head||document.getElementsByTagName("head")[0],L=document.createElement("style");D.appendChild(L);L.type="text/css";L.id="mxODPickerCss";L.appendChild(document.createTextNode(P))}b.innerHTML=-V;var N=m(".odPreview"),R=m("#odFiles");b=function(U,W){W=W||document;return W.querySelectorAll(U)}(".odCatListTitle");for(V=0;V<b.length;V++)b[V].addEventListener("click",function(){H=z=null;if(!O)switch(Q(this),this.id){case "odFiles":C();break;case "odRecent":C("recent");break;case "odShared":C("shared");break;case "odSharepoint":C("sharepoint")}});var T=null;m("#odSearchBox").addEventListener("keyup",function(U){var W=this;null!=T&&clearTimeout(T);13==U.keyCode?S(W.value):T=setTimeout(function(){S(W.value)},+var u=new Spinner({left:"50%",lines:12,length:8,width:3,radius:5,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9}),x=new Editor,J=null,H=null,K=null,N=!1,M=[],n=null,A=null;this.getSelectedItem=function(){null!=H&&p(H);return H};if(null==m("#mxODPickerCss")){var E=document.head||document.getElementsByTagName("head")[0],L=document.createElement("style");E.appendChild(L);L.type="text/css";L.id="mxODPickerCss";L.appendChild(document.createTextNode(P))}b.innerHTML=+V;var O=m(".odPreview"),R=m("#odFiles");b=function(U,W){W=W||document;return W.querySelectorAll(U)}(".odCatListTitle");for(V=0;V<b.length;V++)b[V].addEventListener("click",function(){H=A=null;if(!N)switch(Q(this),this.id){case "odFiles":C();break;case "odRecent":C("recent");break;case "odShared":C("shared");break;case "odSharepoint":C("sharepoint")}});var T=null;m("#odSearchBox").addEventListener("keyup",function(U){var W=this;null!=T&&clearTimeout(T);13==U.keyCode?S(W.value):T=setTimeout(function(){S(W.value)},500)});m("#refreshOD").addEventListener("click",function(){if(null!=n){e(null);var U=M.slice();C.apply(this,n);M=U}});G&&m("#odBackBtn").addEventListener("click",G);B&&m("#odSubmitBtn").addEventListener("click",y);null!=g?(G=g.pop(),"sharepoint"==g[0].driveId&&Q(m("#odSharepoint")),M=g,C(G.driveId,G.folderId,G.siteId,G.name)):C()};App=function(b,e,f){EditorUi.call(this,b,e,null!=f?f:"1"==urlParams.lightbox||"min"==uiTheme&&"0"!=urlParams.chrome);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(window.onunload=mxUtils.bind(this,function(){var c=this.getCurrentFile();null!=c&&c.isModified()&&(c.getHash(),c.savingFile&&null!=c.savingFileTime&&(Date.now(),c.savingFileTime.getTime()),null!=c.ageStart&&(Date.now(),c.ageStart.getTime()),c.isAutosave(),null!=c.opened&&(Date.now(),c.opened.getTime()),null!=c.lastSaved&&(Date.now(),c.lastSaved.getTime()),null!=c.lastChanged&&(Date.now(),c.lastChanged.getTime()),Date.now(),App.startTime.getTime(),c.constructor==DriveFile&&null!=c.desc&&null!=this.drive&&c.getSize())}));this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(){var c=this.getCurrentFile();null!=c&&EditorUi.logEvent({category:(this.editor.autosave?"ON":"OFF")+"-AUTOSAVE-FILE-"+c.getHash(),action:"changed",label:"autosave_"+(this.editor.autosave?"on":"off")})}));mxClient.IS_SVG?mxGraph.prototype.warningImage.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAE7SURBVHjaYvz//z8DJQAggBjwGXDuHMP/tWuD/uPTCxBAOA0AaQRK/f/+XeJ/cbHlf1wGAAQQTgPu3QNLgfHSpZo4DQAIIKwGwGyH4e/fFbG6AiQJEEAs2Ew2NFzH8OOHBMO6dT/A/KCg7wxGRh+wuhQggDBcALMdFIAcHBxgDGJjcwVIIUAAYbhAUXEdVos4OO4DXcGBIQ4QQCguQPY7sgtgAYruCpAgQACx4LJdU1OCwctLEcyWlLwPJF+AXQE0EMUBAAEEdwF6yMOiD4RRY0QT7gqQAEAAseDzu6XldYYPH9DD4joQa8L5AAEENgWb7SBcXa0JDQMBrK4AcQACiAlfyOMCEFdAnAYQQEz4FLa0XGf4/v0H0IIPONUABBAjyBmMjIwMS5cK/L927QORbtBkaG29DtYLEGAAH6f7oq3Zc+kAAAAASUVORK5CYII=":(new Image).src=mxGraph.prototype.warningImage.src;window.geOpenWindow=mxUtils.bind(this,function(c,l,p){if("1"==urlParams.openInSameWin||navigator.standalone)null!=p&&p();else{var q=null;try{q=window.open(c)}catch(v){}null==q||void 0===q?this.showDialog((new PopupDialog(this,c,l,p)).container,340,140,!0,!0):null!=l&&l()}});this.updateDocumentTitle();this.updateUi();window.showOpenAlert=mxUtils.bind(this,function(c){null!=window.openFile&&window.openFile.cancel(!0);this.handleError(c)});this.editor.chromeless&&@@ -13973,21 +13977,21 @@ mxLanguage))}catch(t){document.body.innerHTML="",m=document.createElement("pre")("function"===typeof window.DropboxClient&&null==window.Dropbox&&null!=window.DrawDropboxClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&isSvgBrowser&&(null==document.documentMode||9<document.documentMode)?mxscript(App.DROPBOX_URL,function(){mxscript(App.DROPINS_URL,function(){DrawDropboxClientCallback()},"dropboxjs",App.DROPBOX_APPKEY)}):"undefined"===typeof window.Dropbox&&(window.DropboxClient=null),"function"===typeof window.OneDriveClient&&"undefined"===typeof OneDrive&&null!=window.DrawOneDriveClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&(null==navigator.userAgent||0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?mxscript(App.ONEDRIVE_URL,window.DrawOneDriveClientCallback):"undefined"===typeof window.OneDrive&&(window.OneDriveClient=null),"function"===typeof window.TrelloClient&&!mxClient.IS_IE11&&"undefined"===typeof window.Trello&&null!=window.DrawTrelloClientCallback&&"1"==urlParams.tr&&(null==navigator.userAgent||0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?mxscript(App.TRELLO_JQUERY_URL,function(){mxscript(App.TRELLO_URL,function(){DrawTrelloClientCallback()})}):"undefined"===typeof window.Trello&&(window.TrelloClient=null));null!=b&&b(C);"0"!=urlParams.chrome&&"1"==urlParams.test&&(EditorUi.debug("App.start",["v"+EditorUi.VERSION,C,(new Date).getTime()-t0.getTime()+"ms"]),null!=urlParams["export"]&&EditorUi.debug("Export:",EXPORT_URL))}catch(Q){EditorUi.isElectronApp?-(mxLog.show(),mxLog.debug(Q.stack)):(EditorUi.logError(Q.message,null,null,null,Q),window.setTimeout(function(){alert(Q.message)},1))}}mxResources.parse(m[0].getText());if(isLocalStorage&&null!=localStorage&&null!=window.location.hash&&"#_CONFIG_"==window.location.hash.substring(0,9))try{var y=JSON.parse(Graph.decompress(window.location.hash.substring(9)));if(null!=y){EditorUi.debug("Setting configuration",JSON.stringify(y));if(null!=y.merge){var A=localStorage.getItem(Editor.configurationKey);if(null!=-A)try{var I=JSON.parse(A),F;for(F in y.merge)I[F]=y.merge[F];y=I}catch(C){window.location.hash="",alert(C)}else y=y.merge}confirm(mxResources.get("configLinkWarn"))&&confirm(mxResources.get("configLinkConfirm"))&&(localStorage.setItem(Editor.configurationKey,JSON.stringify(y)),window.location.hash="",window.location.reload())}window.location.hash=""}catch(C){window.location.hash="",alert(C)}1<m.length&&(Graph.prototype.defaultThemes["default-style2"]=m[1].getDocumentElement(),Graph.prototype.defaultThemes.darkTheme=+(mxLog.show(),mxLog.debug(Q.stack)):(EditorUi.logError(Q.message,null,null,null,Q),window.setTimeout(function(){alert(Q.message)},1))}}mxResources.parse(m[0].getText());if(isLocalStorage&&null!=localStorage&&null!=window.location.hash&&"#_CONFIG_"==window.location.hash.substring(0,9))try{var y=JSON.parse(Graph.decompress(window.location.hash.substring(9)));if(null!=y){EditorUi.debug("Setting configuration",JSON.stringify(y));if(null!=y.merge){var z=localStorage.getItem(Editor.configurationKey);if(null!=+z)try{var I=JSON.parse(z),F;for(F in y.merge)I[F]=y.merge[F];y=I}catch(C){window.location.hash="",alert(C)}else y=y.merge}confirm(mxResources.get("configLinkWarn"))&&confirm(mxResources.get("configLinkConfirm"))&&(localStorage.setItem(Editor.configurationKey,JSON.stringify(y)),window.location.hash="",window.location.reload())}window.location.hash=""}catch(C){window.location.hash="",alert(C)}1<m.length&&(Graph.prototype.defaultThemes["default-style2"]=m[1].getDocumentElement(),Graph.prototype.defaultThemes.darkTheme=m[1].getDocumentElement());"1"==urlParams.dev||EditorUi.isElectronApp?t():(mxStencilRegistry.allowEval=!1,App.loadScripts(["js/shapes-14-6-5.min.js","js/stencils.min.js","js/extensions.min.js"],t,function(C){document.body.innerHTML="";var Q=document.createElement("pre");mxUtils.write(Q,C.stack);document.body.appendChild(Q)}))},function(m){m=document.getElementById("geStatus");null!=m&&(m.innerHTML="Error loading page. <a>Please try refreshing.</a>",m.getElementsByTagName("a")[0].onclick=function(){mxLanguage="en";c(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))})})};if(!App.isMainCalled)if(mxIsElectron&&"undefined"===typeof electron)alert("Runtime Environment not found."),document.body.innerHTML='<div style="margin-top:10%;text-align:center;"><img src="mxgraph/images/warning.png" align="top" style="padding-right:6px;"/>Runtime Environment not found.</div>';else if(mxUtils.lightDarkColorSupported||mxUtils.get("styles/grapheditor.css",mxUtils.bind(this,-function(k){if(200<=k.getStatus()&&299>=k.getStatus()){var m=document.createElement("style");m.type="text/css";m.appendChild(document.createTextNode(k.getText().replace(/light-dark\(\s*(var\([^\)]+\)|[^,]+)\s*,\s*(var\([^\)]+\)|[^)]+)\s*\)/g,"$1")));document.head.appendChild(m)}})),App.isMainCalled=!0,window.onerror=function(k,m,t,y,A){EditorUi.logError("Global: "+(null!=k?k:""),m,t,y,A,null,!0);null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug("Message:",k,"\nURL:",m,"\nLine:",-t,"\nColumn:",y,"\nError:",A)):console.error("Message:",k,"\nURL:",m,"\nLine:",t,"\nColumn:",y,"\nError:",A);window.setTimeout(function(){alert("Error: "+(null!=k?k:""))},100)},window.top!=window.self||"import.diagrams.net"!==window.location.hostname&&"ac.draw.io"!==window.location.hostname&&"aj.draw.io"!==window.location.hostname){if("1"==urlParams.embed||"1"==urlParams.lightbox){var l=document.getElementById("geInfo");null!=l&&l.parentNode.removeChild(l)}"1"==urlParams.embed&&document.body.classList.add("geEmbed");+function(k){if(200<=k.getStatus()&&299>=k.getStatus()){var m=document.createElement("style");m.type="text/css";m.appendChild(document.createTextNode(k.getText().replace(/light-dark\(\s*(var\([^\)]+\)|[^,]+)\s*,\s*(var\([^\)]+\)|[^)]+)\s*\)/g,"$1")));document.head.appendChild(m)}})),App.isMainCalled=!0,window.onerror=function(k,m,t,y,z){EditorUi.logError("Global: "+(null!=k?k:""),m,t,y,z,null,!0);null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug("Message:",k,"\nURL:",m,"\nLine:",+t,"\nColumn:",y,"\nError:",z)):console.error("Message:",k,"\nURL:",m,"\nLine:",t,"\nColumn:",y,"\nError:",z);window.setTimeout(function(){alert("Error: "+(null!=k?k:""))},100)},window.top!=window.self||"import.diagrams.net"!==window.location.hostname&&"ac.draw.io"!==window.location.hostname&&"aj.draw.io"!==window.location.hostname){if("1"==urlParams.embed||"1"==urlParams.lightbox){var l=document.getElementById("geInfo");null!=l&&l.parentNode.removeChild(l)}"1"==urlParams.embed&&document.body.classList.add("geEmbed");null!=document.referrer&&"aws3"==urlParams.libs&&"https://aws.amazon.com/architecture/icons/"==document.referrer.substring(0,42)&&(urlParams.libs="aws4");if(null!=window.mxscript){if("1"==urlParams.dev&&!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&null!=CryptoJS&&App.mode!=App.MODE_DROPBOX&&App.mode!=App.MODE_TRELLO){var p=document.getElementById("geBootstrap");if(null!=p){var q=mxUtils.getTextContent(p);"ff68e9badc5b6bcb8f482e0c64b103a7"!=CryptoJS.MD5(q).toString()&&(console.log("Change bootstrap script MD5 in the previous line:",CryptoJS.MD5(q).toString()),alert("[Dev] Bootstrap script change requires update of CSP"))}var v=document.getElementById("geMain");null!=v&&(q=mxUtils.getTextContent(v),"69c25556b6237c57cdb7d017147af34b"!=CryptoJS.MD5(q).toString()&&(console.log("Change main script MD5 in the previous line:",CryptoJS.MD5(q).toString()),alert("[Dev] Main script change requires update of CSP")))}try{Editor.enableServiceWorker&&("0"==urlParams.offline||/www\.draw\.io$/.test(window.location.hostname)||"1"!=urlParams.offline&&"1"==urlParams.dev)?App.clearServiceWorker(function(){"0"==urlParams.offline&&alert("Cache cleared")}):Editor.enableServiceWorker&&navigator.serviceWorker.register("service-worker.js")}catch(k){}!("ArrayBuffer"in window)||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"auto"!=DrawioFile.SYNC||"1"==urlParams.embed&&("1"!=urlParams.embedRT||"1"==urlParams.lockdown)||"1"==urlParams.local||"0"==urlParams.chrome&&"1"!=urlParams.rt||"1"==urlParams.stealth||"1"==urlParams.offline||(mxscript(App.PUSHER_URL),-"1"==urlParams["fast-sync"]&&mxscript(App.SIMPLE_PEER_URL));if("0"!=urlParams.plugins&&"1"!=urlParams.offline){var E=null!=mxSettings.settings?mxSettings.getPlugins():null;if(null==mxSettings.settings&&isLocalStorage&&"undefined"!==typeof JSON)try{var G=JSON.parse(localStorage.getItem(mxSettings.key));null!=G&&(E=G.plugins)}catch(k){}G=urlParams.p;App.initPluginCallback();null!=G&&App.loadPlugins(G.split(";"));if(null!=E&&0<E.length&&"0"!=urlParams.plugins)for(l=0;l<E.length;l++)try{("/"==E[l].charAt(0)&&-(E[l]=PLUGINS_BASE_PATH+E[l]),App.isSameDomain(E[l]))?ALLOW_CUSTOM_PLUGINS||App.isBuiltInPlugin(E[l])?null==App.pluginsLoaded[E[l]]&&(App.pluginsLoaded[E[l]]=!0,App.embedModePluginsCount++,mxscript(E[l])):null!=window.console&&console.log("Unknown plugin:",E[l]):null!=window.console&&console.log("Blocked plugin:",E[l])}catch(k){}}"function"===typeof window.DriveClient&&"undefined"===typeof gapi&&("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&isSvgBrowser&&+"1"==urlParams["fast-sync"]&&mxscript(App.SIMPLE_PEER_URL));if("0"!=urlParams.plugins&&"1"!=urlParams.offline){var D=null!=mxSettings.settings?mxSettings.getPlugins():null;if(null==mxSettings.settings&&isLocalStorage&&"undefined"!==typeof JSON)try{var G=JSON.parse(localStorage.getItem(mxSettings.key));null!=G&&(D=G.plugins)}catch(k){}G=urlParams.p;App.initPluginCallback();null!=G&&App.loadPlugins(G.split(";"));if(null!=D&&0<D.length&&"0"!=urlParams.plugins)for(l=0;l<D.length;l++)try{("/"==D[l].charAt(0)&&+(D[l]=PLUGINS_BASE_PATH+D[l]),App.isSameDomain(D[l]))?ALLOW_CUSTOM_PLUGINS||App.isBuiltInPlugin(D[l])?null==App.pluginsLoaded[D[l]]&&(App.pluginsLoaded[D[l]]=!0,App.embedModePluginsCount++,mxscript(D[l])):null!=window.console&&console.log("Unknown plugin:",D[l]):null!=window.console&&console.log("Blocked plugin:",D[l])}catch(k){}}"function"===typeof window.DriveClient&&"undefined"===typeof gapi&&("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&isSvgBrowser&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode)?mxscript("https://apis.google.com/js/api.js?onload=DrawGapiClientCallback",null,null,null,mxClient.IS_SVG):"undefined"===typeof window.gapi&&(window.DriveClient=null)}"0"!=urlParams.math&&Editor.initMath();if("1"==urlParams.configure){var B=window.opener||window.parent,d=function(k){if(k.source==B)try{var m=JSON.parse(k.data);null!=m&&"configure"==m.action&&(mxEvent.removeListener(window,"message",d),Editor.configure(m.config),mxSettings.load(),null!=m.config.darkColor&&document.body.style.setProperty("--dark-color",m.config.darkColor),m.colorSchemeMeta&&mxmeta("color-scheme","dark light"),f())}catch(t){null!=window.console&&console.log("Error in configure message: "+t,k.data)}};mxEvent.addListener(window,"message",d);B.postMessage(JSON.stringify({event:"configure"}),"*")}else{if(null==Editor.config){if(null!=window.DRAWIO_CONFIG)try{EditorUi.debug("Using global configuration",window.DRAWIO_CONFIG),Editor.configure(window.DRAWIO_CONFIG),mxSettings.load()}catch(k){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(k.stack)):console.error(k)}if(isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed){var g=localStorage.getItem(Editor.configurationKey);if(null!=g)try{g=JSON.parse(g),null!=g&&(EditorUi.debug("Using local configuration",g),Editor.configure(g),mxSettings.load())}catch(k){null==window.console||EditorUi.isElectronApp?(mxLog.show(),mxLog.debug(k.stack)):console.error(k)}}}f()}}else document.body.innerHTML=-'<div style="margin-top:10%;text-align:center;">Stand-alone mode not allowed for this domain.</div>'}catch(k){document.body.innerHTML="",E=document.createElement("pre"),mxUtils.write(E,k.stack),document.body.appendChild(E)}};mxUtils.extend(App,EditorUi);App.prototype.warnInterval=3E5;App.prototype.compactMode=!1;App.prototype.fullscreenMode=!1;App.initPluginCallback=function(){null==App.DrawPlugins&&(App.DrawPlugins=[],window.Draw={},window.Draw.loadPlugin=function(b){App.DrawPlugins.push(b)})};+'<div style="margin-top:10%;text-align:center;">Stand-alone mode not allowed for this domain.</div>'}catch(k){document.body.innerHTML="",D=document.createElement("pre"),mxUtils.write(D,k.stack),document.body.appendChild(D)}};mxUtils.extend(App,EditorUi);App.prototype.warnInterval=3E5;App.prototype.compactMode=!1;App.prototype.fullscreenMode=!1;App.initPluginCallback=function(){null==App.DrawPlugins&&(App.DrawPlugins=[],window.Draw={},window.Draw.loadPlugin=function(b){App.DrawPlugins.push(b)})};App.pluginsLoaded={};App.embedModePluginsCount=0;App.loadPlugins=function(b,e){EditorUi.debug("Loading plugins",b);for(var f=0;f<b.length;f++)if(null!=b[f]&&0<b[f].length)try{if(null!=App.pluginRegistry[b[f]]){var c=PLUGINS_BASE_PATH+App.pluginRegistry[b[f]];null==App.pluginsLoaded[c]&&(App.pluginsLoaded[c]=!0,App.embedModePluginsCount++,"undefined"===typeof window.drawDevUrl?e?mxinclude(c):mxscript(c):e?mxinclude(c):mxscript(drawDevUrl+c))}else null!=window.console&&console.log("Unknown plugin:",b[f])}catch(l){null!=window.console&&console.log("Error loading plugin:",b[f],l)}};App.prototype.initializeEmbedMode=function(){"1"==urlParams.embed&&("app.diagrams.net"==window.location.hostname&&this.showBanner("EmbedDeprecationFooter","app.diagrams.net will stop working for embed mode. Please use embed.diagrams.net."),0<App.embedModePluginsCount||this.initEmbedDone||(this.initEmbedDone=!0,EditorUi.prototype.initializeEmbedMode.apply(this,arguments)))};@@ -13998,12 +14002,12 @@ mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries(this.oneDrive))}catch(q){null!=window.console&&console.log("OneDriveClient disabled: "+q.message)}else null==window.DrawOneDriveClientCallback&&(window.DrawOneDriveClientCallback=b)});b()}if("1"!=urlParams.embed||"1"==urlParams.tr){var e=mxUtils.bind(this,function(){if("undefined"!==typeof window.Trello)try{this.trello=new TrelloClient(this),this.trello.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.trello))}catch(q){null!=window.console&&console.log("TrelloClient disabled: "+q.message)}else null==window.DrawTrelloClientCallback&&(window.DrawTrelloClientCallback=e)});e()}if("1"!=urlParams.embed||"1"==urlParams.gapi){var f=mxUtils.bind(this,function(){if("undefined"!==typeof gapi){var q=mxUtils.bind(this,function(){try{this.drive=new DriveClient(this),this.drive.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries();"1"!=urlParams.dev&&this.checkLicense()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.drive))}catch(v){null!=window.console&&console.log("DriveClient disabled: "+v.message)}});null!=window.DrawGapiClientCallback?(gapi.load(("0"!=urlParams.picker?"picker,":"")+App.GOOGLE_APIS,q),window.DrawGapiClientCallback=null):q()}else null==window.DrawGapiClientCallback&&(window.DrawGapiClientCallback=f)});f()}if("1"!=urlParams.embed||"1"==urlParams.db){var c=mxUtils.bind(this,function(){if("function"===typeof Dropbox){window.DrawDropboxClientCallback=-null;try{this.dropbox=new DropboxClient(this),this.dropbox.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.dropbox))}catch(q){null!=window.console&&console.log("DropboxClient disabled: "+q.message)}}else null==window.DrawDropboxClientCallback&&(window.DrawDropboxClientCallback=c)});c()}if("1"!=urlParams.embed){if(this.setGraphEnabled(!1),"1"==urlParams.local?this.setMode(App.MODE_DEVICE):+null;try{this.dropbox=new DropboxClient(this),this.dropbox.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.dropbox))}catch(q){null!=window.console&&console.log("DropboxClient disabled: "+q.message)}}else null==window.DrawDropboxClientCallback&&(window.DrawDropboxClientCallback=c)});c()}if("1"!=urlParams.embed&&(this.setGraphEnabled(!1),"1"==urlParams.local?this.setMode(App.MODE_DEVICE):this.mode=App.mode,"serviceWorker"in navigator&&!this.editor.isChromelessView()&&(mxClient.IS_ANDROID||mxClient.IS_IOS)&&window.addEventListener("beforeinstallprompt",mxUtils.bind(this,function(q){this.showBanner("AddToHomeScreenFooter",mxResources.get("installApp"),function(){q.prompt()})})),!this.isOwnDomain()||this.editor.chromeless&&!this.editor.editable||this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){var q=this.getCurrentFile();q=null!=q?q.getMode():null;mxClient.IS_CHROMEAPP||-mxClient.IS_ANDROID||mxClient.IS_IOS||EditorUi.isElectronApp||this.isOffline()||null!=urlParams.open||"1"==urlParams.extAuth||q!=App.MODE_DEVICE&&q!=App.MODE_BROWSER||this.showDownloadDesktopBanner()})),!(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"auto"!=DrawioFile.SYNC||"1"==urlParams.local||"1"==urlParams.stealth||this.isOffline()||!Editor.enableRealtimeCache||this.editor.chromeless&&!this.editor.editable)){var l=window.setTimeout(mxUtils.bind(this,function(){Editor.enableRealtimeCache=!1}),-Editor.cacheTimeout);mxUtils.get(EditorUi.cacheUrl+"?alive",mxUtils.bind(this,function(q){Editor.enableRealtimeCache=200<=q.getStatus()&&299>=q.getStatus();window.clearTimeout(l)}),function(){Editor.enableRealtimeCache=!1;window.clearTimeout(l)})}}else null!=this.menubar&&(this.menubar.container.style.paddingTop="0px");this.updateHeader();if(null!=this.menubar){if("sketch"!=Editor.currentTheme&&("simple"!=Editor.currentTheme||"1"!=urlParams.embed)){var p=mxUtils.bind(this,function(){"1"!=urlParams.embed?-this.menubar.container.appendChild(this.buttonContainer):this.toolbarContainer.appendChild(this.buttonContainer)});this.addListener("languageChanged",p);this.addListener("currentThemeChanged",p);p()}("kennedy"==Editor.currentTheme&&"1"==urlParams.embed||"atlas"==Editor.currentTheme&&"1"!=urlParams.embed)&&this.setCompactMode(!0);if("atlas"==Editor.currentTheme||"1"==urlParams.atlas)this.icon=document.createElement("img"),this.icon.setAttribute("src",IMAGE_PATH+"/logo-flat-small.png"),this.icon.setAttribute("title",-mxResources.get("draw.io")),this.icon.style.padding="0 4px 0 14px","1"!=urlParams.embed&&(this.icon.style.cursor="pointer",mxEvent.addListener(this.icon,"click",mxUtils.bind(this,function(q){this.appIconClicked(q)}))),this.menubar.container.insertBefore(this.icon,this.menubar.container.firstChild)}this.editor.graph.isViewer()&&this.initializeViewerMode()}};+mxClient.IS_ANDROID||mxClient.IS_IOS||EditorUi.isElectronApp||this.isOffline()||null!=urlParams.open||"1"==urlParams.extAuth||q!=App.MODE_DEVICE&&q!=App.MODE_BROWSER||this.showDownloadDesktopBanner()})),!(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"auto"!=DrawioFile.SYNC||"1"==urlParams.local||"1"==urlParams.stealth||this.isOffline()||!Editor.enableRealtimeCache||this.editor.chromeless&&!this.editor.editable))){var l=window.setTimeout(mxUtils.bind(this,function(){Editor.enableRealtimeCache=!1}),+Editor.cacheTimeout);mxUtils.get(EditorUi.cacheUrl+"?alive",mxUtils.bind(this,function(q){Editor.enableRealtimeCache=200<=q.getStatus()&&299>=q.getStatus();window.clearTimeout(l)}),function(){Editor.enableRealtimeCache=!1;window.clearTimeout(l)})}this.updateHeader();if(null!=this.menubar){if("sketch"!=Editor.currentTheme&&("simple"!=Editor.currentTheme||"1"!=urlParams.embed)){var p=mxUtils.bind(this,function(){"1"!=urlParams.embed?this.menubar.container.appendChild(this.buttonContainer):this.toolbarContainer.appendChild(this.buttonContainer)});+this.addListener("languageChanged",p);this.addListener("currentThemeChanged",p);p()}("kennedy"==Editor.currentTheme&&"1"==urlParams.embed||"atlas"==Editor.currentTheme&&"1"!=urlParams.embed)&&this.setCompactMode(!0);if("atlas"==Editor.currentTheme||"1"==urlParams.atlas)this.icon=document.createElement("img"),this.icon.setAttribute("src",IMAGE_PATH+"/logo-flat-small.png"),this.icon.setAttribute("title",mxResources.get("draw.io")),this.icon.className="geSmallAppIcon","1"!=urlParams.embed&&(this.icon.style.cursor=+"pointer",mxEvent.addListener(this.icon,"click",mxUtils.bind(this,function(q){this.appIconClicked(q)}))),this.menubar.container.insertBefore(this.icon,this.menubar.container.firstChild)}this.editor.graph.isViewer()&&this.initializeViewerMode()}};App.blockedAncestorFrames=function(){try{if(window.location.ancestorOrigins&&window.location.hostname&&window.location.ancestorOrigins.length&&0<window.location.ancestorOrigins.length){var b=window.location.hostname;b&&1<b.length&&"/"==b.charAt(b.length-1)&&b.substring(0,b.length-1);b="";for(var e=0;e<window.location.ancestorOrigins.length;e++)if(b+=" -> "+window.location.ancestorOrigins[e],b.endsWith("dan6v7pm1f1a1.cloudfront.net")||b.endsWith("confluence-cloud-excalidraw-ll3likebca-uc.a.run.app"))return!0}}catch(f){}return!1};App.prototype.scheduleSanityCheck=function(){mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=this.sanityCheckThread||(this.sanityCheckThread=window.setTimeout(mxUtils.bind(this,function(){this.sanityCheckThread=null;this.sanityCheck()}),this.warnInterval))};App.prototype.stopSanityCheck=function(){null!=this.sanityCheckThread&&(window.clearTimeout(this.sanityCheckThread),this.sanityCheckThread=null)};App.prototype.sanityCheck=function(){var b=this.getCurrentFile();if(null!=b&&b.isModified()&&b.isAutosave()&&b.isOverdue()){b.getHash();b.savingFile&&null!=b.savingFileTime&&(Date.now(),b.savingFileTime.getTime());null!=b.ageStart&&(Date.now(),b.ageStart.getTime());b.isAutosave();null!=b.opened&&(Date.now(),b.opened.getTime());null!=b.lastSaved&&(Date.now(),b.lastSaved.getTime());null!=b.lastChanged&&(Date.now(),b.lastChanged.getTime());Date.now();App.startTime.getTime();var e=null!=b.sync?"client_"+@@ -14027,10 +14031,10 @@ App.prototype.addRecent=function(b,e,f){if(isLocalStorage&&null!=localStorage){eApp.prototype.resetRecent=function(b){if(isLocalStorage&&null!=localStorage)try{localStorage.removeItem(".recent"+(null!=b?b:""))}catch(e){}};App.prototype.onBeforeUnload=function(){if("1"==urlParams.embed&&this.editor.modified)return mxResources.get("allChangesLost");this.unloading=!0;var b=this.getCurrentFile();if(null!=b)if(b.constructor!=LocalFile||""!=b.getHash()||b.isModified()||"1"==urlParams.nowarn||this.isDiagramEmpty()||null!=urlParams.url||this.editor.isChromelessView()||null!=b.fileHandle){if(b.isModified())return this.logIfModified(b),mxResources.get("allChangesLost");b.close(!0)}else return mxResources.get("ensureDataSaved")};App.prototype.updateDocumentTitle=function(){var b=this.editor.appName,e=this.getCurrentFile();null==e||!this.editor.graph.isLightboxView()&&"simple"!=Editor.currentTheme||null==this.pages||null==this.currentPage?this.isOfflineApp()&&(b+=" app"):b=this.getShortPageName(this.currentPage);null!=e&&(b=(null!=e.getTitle()?e.getTitle():this.defaultFilename)+" - "+b);document.title!=b&&(document.title=b)};-App.prototype.getThumbnail=function(b,e,f){f=null!=f?f:0;var c=!1;try{var l=!0,p=window.setTimeout(mxUtils.bind(this,function(){l=!1;e(null)}),this.timeout),q=mxUtils.bind(this,function(P){window.clearTimeout(p);l&&e(P)});null==this.thumbImageCache&&(this.thumbImageCache={});var v=this.editor.graph,E=v.backgroundImage;if(null!=this.pages&&this.currentPage!=this.pages[0]){var G=v.getGlobalVariable;v=this.createTemporaryGraph(v.getStylesheet());v.setBackgroundImage=this.editor.graph.setBackgroundImage;-var B=this.pages[0];this.currentPage==B?v.setBackgroundImage(E):null!=B.viewState&&null!=B.viewState&&(E=B.viewState.backgroundImage,v.setBackgroundImage(E));v.getGlobalVariable=function(P){return"page"==P?B.getName():"pagenumber"==P?1:G.apply(this,arguments)};v.getGlobalVariable=G;document.body.appendChild(v.container);v.model.setRoot(B.root)}if(mxClient.IS_CHROMEAPP||this.useCanvasForExport)this.editor.exportToCanvas(mxUtils.bind(this,function(P){try{v!=this.editor.graph&&null!=v.container.parentNode&&-v.container.parentNode.removeChild(v.container)}catch(u){P=null}q(P)}),b,this.thumbImageCache,"#ffffff",function(){q()},null,null,null,null,null,null,v,f,null,null,null,"diagram",null),c=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var d=document.createElement("canvas"),g=v.getGraphBounds(),k=v.view.translate,m=v.view.scale;null!=E&&(g=mxRectangle.fromRectangle(g),g.add(new mxRectangle((k.x+E.x)*m,(k.y+E.y)*m,E.width*m,E.height*m)));var t=b/g.width;t=Math.min(1,Math.min(3*b/(4*g.height),-t));var y=Math.floor(g.x),A=Math.floor(g.y);d.setAttribute("width",Math.ceil(t*(g.width+4)));d.setAttribute("height",Math.ceil(t*(g.height+4)));var I=d.getContext("2d");I.scale(t,t);I.translate(-y,-A);var F=v.background;if(null==F||""==F||F==mxConstants.NONE)F="#ffffff";I.save();I.fillStyle=F;I.fillRect(y,A,Math.ceil(g.width+4),Math.ceil(g.height+4));I.restore();if(null!=E){var C=new Image;C.src=E.src;I.drawImage(C,E.x*t,E.y*t,E.width*t,E.height*t)}var Q=new mxJsCanvas(d),S=new mxAsyncCanvas(this.thumbImageCache);+App.prototype.getThumbnail=function(b,e,f){f=null!=f?f:0;var c=!1;try{var l=!0,p=window.setTimeout(mxUtils.bind(this,function(){l=!1;e(null)}),this.timeout),q=mxUtils.bind(this,function(P){window.clearTimeout(p);l&&e(P)});null==this.thumbImageCache&&(this.thumbImageCache={});var v=this.editor.graph,D=v.backgroundImage;if(null!=this.pages&&this.currentPage!=this.pages[0]){var G=v.getGlobalVariable;v=this.createTemporaryGraph(v.getStylesheet());v.setBackgroundImage=this.editor.graph.setBackgroundImage;+var B=this.pages[0];this.currentPage==B?v.setBackgroundImage(D):null!=B.viewState&&null!=B.viewState&&(D=B.viewState.backgroundImage,v.setBackgroundImage(D));v.getGlobalVariable=function(P){return"page"==P?B.getName():"pagenumber"==P?1:G.apply(this,arguments)};v.getGlobalVariable=G;document.body.appendChild(v.container);v.model.setRoot(B.root)}if(mxClient.IS_CHROMEAPP||this.useCanvasForExport)this.editor.exportToCanvas(mxUtils.bind(this,function(P){try{v!=this.editor.graph&&null!=v.container.parentNode&&+v.container.parentNode.removeChild(v.container)}catch(u){P=null}q(P)}),b,this.thumbImageCache,"#ffffff",function(){q()},null,null,null,null,null,null,v,f,null,null,null,"diagram",null),c=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var d=document.createElement("canvas"),g=v.getGraphBounds(),k=v.view.translate,m=v.view.scale;null!=D&&(g=mxRectangle.fromRectangle(g),g.add(new mxRectangle((k.x+D.x)*m,(k.y+D.y)*m,D.width*m,D.height*m)));var t=b/g.width;t=Math.min(1,Math.min(3*b/(4*g.height),+t));var y=Math.floor(g.x),z=Math.floor(g.y);d.setAttribute("width",Math.ceil(t*(g.width+4)));d.setAttribute("height",Math.ceil(t*(g.height+4)));var I=d.getContext("2d");I.scale(t,t);I.translate(-y,-z);var F=v.background;if(null==F||""==F||F==mxConstants.NONE)F="#ffffff";I.save();I.fillStyle=F;I.fillRect(y,z,Math.ceil(g.width+4),Math.ceil(g.height+4));I.restore();if(null!=D){var C=new Image;C.src=D.src;I.drawImage(C,D.x*t,D.y*t,D.width*t,D.height*t)}var Q=new mxJsCanvas(d),S=new mxAsyncCanvas(this.thumbImageCache);Q.images=this.thumbImageCache.images;var V=new mxImageExport;V.drawShape=function(P,u){P.shape instanceof mxShape&&P.shape.checkBounds()&&(u.save(),u.translate(.5,.5),P.shape.paint(u),u.translate(-.5,-.5),u.restore())};V.drawText=function(P,u){};V.drawState(v.getView().getState(v.model.root),S);S.finish(mxUtils.bind(this,function(){try{V.drawState(v.getView().getState(v.model.root),Q),v!=this.editor.graph&&null!=v.container.parentNode&&v.container.parentNode.removeChild(v.container)}catch(P){d=null}q(d)}));c=!0}}catch(P){c=!1,null!=v&&v!=this.editor.graph&&null!=v.container.parentNode&&v.container.parentNode.removeChild(v.container)}c||window.clearTimeout(p);return c};(function(){var b=EditorUi.prototype.setMode;App.prototype.setMode=function(e,f){b.apply(this,arguments);null!=this.mode&&(Editor.useLocalStorage=this.mode==App.MODE_BROWSER);if(null!=this.appIcon){var c=this.getCurrentFile();e=null!=c?c.getMode():e;null==this.updateTitleListener&&(this.updateTitleListener=mxUtils.bind(this,function(){e==App.MODE_GOOGLE?this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("googleDrive")])):e==App.MODE_DROPBOX?this.appIcon.setAttribute("title",@@ -14047,110 +14051,110 @@ App.prototype.showRefreshDialog=function(b,e){this.showingRefreshDialog||(this.sApp.prototype.showAlert=function(b){if(null!=b&&0<b.length){var e=document.createElement("div");e.className="geAlert";e.style.zIndex=2E9;e.style.left="50%";e.style.top="-100%";e.style.maxWidth="80%";e.style.width="max-content";e.style.whiteSpace="pre-wrap";mxUtils.setPrefixedStyle(e.style,"transform","translate(-50%,0%)");mxUtils.setPrefixedStyle(e.style,"transition","all 1s ease");e.innerHTML=b;b=document.createElement("a");b.className="geAlertLink";b.style.textAlign="right";b.style.marginTop="20px";b.style.display="block";b.setAttribute("title",mxResources.get("close"));b.innerHTML=mxResources.get("close");e.appendChild(b);mxEvent.addListener(b,"click",function(f){null!=e.parentNode&&(e.parentNode.removeChild(e),mxEvent.consume(f))});document.body.appendChild(e);window.setTimeout(function(){e.style.top="30px"},10);window.setTimeout(function(){mxUtils.setPrefixedStyle(e.style,"transition","all 2s ease");e.style.opacity="0";window.setTimeout(function(){null!=e.parentNode&&e.parentNode.removeChild(e)},2E3)},15E3)}};-App.prototype.start=function(){try{this.restoreLibraries();this.spinner.stop();var b=this;window.onerror=function(q,v,E,G,B){"ResizeObserver loop limit exceeded"!=q&&(EditorUi.logError("Uncaught: "+(null!=q?q:""),v,E,G,B,null,!0),b.handleError({message:q},mxResources.get("unknownError"),null,null,null,null,!0))};if("1"!=urlParams.client&&"1"!=urlParams.embed){try{isLocalStorage&&window.addEventListener("storage",mxUtils.bind(this,function(q){var v=this.getCurrentFile();EditorUi.debug("storage event",[q],-[v]);null!=v&&".draft-alive-check"==q.key&&null!=q.newValue&&null!=v.draftId&&(this.draftAliveCheck=q.newValue,v.saveDraft())}))}catch(q){}var e=this.getDiagramId();mxEvent.addListener(window,"hashchange",mxUtils.bind(this,function(q){try{var v=this.getDiagramId();if(v!=e){e=v;var E=this.getCurrentFile();null!=E&&E.getHash()==v||this.loadFile(v,!0)}else{var G=this.getHashObject();if(null!=G&&null!=G.pageId&&null!=this.currentPage&&G.pageId!=this.currentPage.getId()){var B=this.getPageById(G.pageId);+App.prototype.start=function(){try{this.restoreLibraries();this.spinner.stop();var b=this;window.onerror=function(q,v,D,G,B){"ResizeObserver loop limit exceeded"!=q&&(EditorUi.logError("Uncaught: "+(null!=q?q:""),v,D,G,B,null,!0),b.handleError({message:q},mxResources.get("unknownError"),null,null,null,null,!0))};if("1"!=urlParams.client&&"1"!=urlParams.embed){try{isLocalStorage&&window.addEventListener("storage",mxUtils.bind(this,function(q){var v=this.getCurrentFile();EditorUi.debug("storage event",[q],+[v]);null!=v&&".draft-alive-check"==q.key&&null!=q.newValue&&null!=v.draftId&&(this.draftAliveCheck=q.newValue,v.saveDraft())}))}catch(q){}var e=this.getDiagramId();mxEvent.addListener(window,"hashchange",mxUtils.bind(this,function(q){try{var v=this.getDiagramId();if(v!=e){e=v;var D=this.getCurrentFile();null!=D&&D.getHash()==v||this.loadFile(v,!0)}else{var G=this.getHashObject();if(null!=G&&null!=G.pageId&&null!=this.currentPage&&G.pageId!=this.currentPage.getId()){var B=this.getPageById(G.pageId);null!=B&&this.selectPage(B)}}}catch(d){null!=document.body&&this.handleError(d,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var g=this.getCurrentFile();window.location.hash=null!=g?g.getHash():""}))}}))}if((null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.desc)try{this.loadDescriptor(JSON.parse(Graph.decompress(urlParams.desc)),null,mxUtils.bind(this,function(q){this.handleError(q,mxResources.get("errorLoadingFile"))}))}catch(q){this.handleError(q,mxResources.get("errorLoadingFile"))}else if((null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.url)this.loadFile("U"+urlParams.url,!0);else if(null==this.getCurrentFile()){var f=mxUtils.bind(this,function(){if("1"==urlParams.client&&(null==window.location.hash||0==window.location.hash.length||"#P"==window.location.hash.substring(0,2))){var q=mxUtils.bind(this,function(G){Editor.isPngDataUrl(G)&&(G=Editor.extractGraphModelFromPng(G));var B=urlParams.title;B=null!=B?decodeURIComponent(B):this.defaultFilename;G=new LocalFile(this,-G,B,!0);null!=window.location.hash&&"#P"==window.location.hash.substring(0,2)&&(G.getHash=function(){return window.location.hash.substring(1)});this.fileLoaded(G);this.editor.chromeless||(G.fileChanged(),window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0))}),v=window.opener||window.parent;if(v!=window){var E=urlParams.create;null!=E?q(v[decodeURIComponent(E)]):(E=urlParams.data,null!=E?q(decodeURIComponent(E)):this.installMessageHandler(mxUtils.bind(this,function(G,-B){B.source==v&&q(G)})))}}else if(null==this.dialog)if("1"==urlParams.demo)E=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),Editor.useLocalStorage=E;else if(null!=urlParams["smart-template"])this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),this.actions.get("insertTemplate").funct();else{E=!1;try{E=null!=window.opener&&null!=window.opener.openFile}catch(G){}E?this.spinner.spin(document.body,mxResources.get("loading")):(E=this.getDiagramId(),-!EditorUi.enableDrafts||null!=urlParams.mode||"draw.io"!=this.getServiceName()||null!=E&&0!=E.length||this.editor.isChromelessView()?null!=E&&0<E.length?this.loadFile(E,null,null,mxUtils.bind(this,function(){var G=decodeURIComponent(urlParams.viewbox||"");if(""!=G)try{var B=JSON.parse(G);this.editor.graph.fitWindow(B,B.border)}catch(d){console.error(d)}})):"0"!=urlParams.splash||null!=urlParams.mode&&!EditorUi.isElectronApp?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,+G,B,!0);null!=window.location.hash&&"#P"==window.location.hash.substring(0,2)&&(G.getHash=function(){return window.location.hash.substring(1)});this.fileLoaded(G);this.editor.chromeless||(G.fileChanged(),window.setTimeout(mxUtils.bind(this,function(){this.actions.get("resetView").funct()}),0))}),v=window.opener||window.parent;if(v!=window){var D=urlParams.create;null!=D?q(v[decodeURIComponent(D)]):(D=urlParams.data,null!=D?q(decodeURIComponent(D)):this.installMessageHandler(mxUtils.bind(this,function(G,+B){B.source==v&&q(G)})))}}else if(null==this.dialog)if("1"==urlParams.demo)D=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),Editor.useLocalStorage=D;else if(null!=urlParams["smart-template"])this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),this.actions.get("insertTemplate").funct();else{D=!1;try{D=null!=window.opener&&null!=window.opener.openFile}catch(G){}D?this.spinner.spin(document.body,mxResources.get("loading")):(D=this.getDiagramId(),+!EditorUi.enableDrafts||null!=urlParams.mode||"draw.io"!=this.getServiceName()||null!=D&&0!=D.length||this.editor.isChromelessView()?null!=D&&0<D.length?this.loadFile(D,null,null,mxUtils.bind(this,function(){var G=decodeURIComponent(urlParams.viewbox||"");if(""!=G)try{var B=JSON.parse(G);this.editor.graph.fitWindow(B,B.border)}catch(d){console.error(d)}})):"0"!=urlParams.splash||null!=urlParams.mode&&!EditorUi.isElectronApp?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0):this.checkDrafts())}}),c=decodeURIComponent(urlParams.create||"");if((null==window.location.hash||1>=window.location.hash.length)&&0<c.length&&this.spinner.spin(document.body,mxResources.get("loading"))){var l=mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("reconnecting"))&&(window.location.search=this.getSearch(["create","title"]))}),p=mxUtils.bind(this,function(q){this.spinner.stop();if("0"!=urlParams.splash){this.fileLoaded(new LocalFile(this,-q,null));this.editor.graph.setEnabled(!1);this.mode=urlParams.mode;var v=urlParams.title;v=null!=v?decodeURIComponent(v):this.defaultFilename;q=this.getServiceCount(!0);isLocalStorage&&q++;var E=4>=q?2:6<q?4:3;v=new CreateDialog(this,v,mxUtils.bind(this,function(G,B){if(null==B){this.hideDialog();var d=Editor.useLocalStorage;this.createFile(0<G.length?G:this.defaultFilename,this.getFileData(),null,null,null,!0,null,!0);Editor.useLocalStorage=d}else this.pickFolder(B,mxUtils.bind(this,function(g){this.createFile(G,-this.getFileData(!0),null,B,null,!0,g)}))}),null,null,null,null,"1"==urlParams.browser,null,null,!0,E,null,null,null,this.editor.fileExtensions);this.showDialog(v.container,420,q>E?390:280,!0,!1,mxUtils.bind(this,function(G){G&&null==this.getCurrentFile()&&this.showSplash()}));v.init()}});if("http://"!=c.substring(0,7)&&"https://"!=c.substring(0,8))if("{"==c.charAt(0))this.spinner.stop(),c=JSON.parse(c),window.isMermaidEnabled&&"mermaid"==c.type?(mxMermaidToDrawio.addListener(mxUtils.bind(this,function(q){q!=-this.emptyDiagramXml&&(window.history.replaceState(null,null,window.location.pathname+this.getSearch(["create"])),this.createFile(null!=q.filename?q.filename:this.defaultFilename,q,null,null,null,!0,null,!0),this.editor.chromeless&&!this.editor.editable||this.actions.get("fitWindow").funct())})),this.generateMermaidImage(c.data,null,function(){},mxUtils.bind(this,function(q){for(var v=document.querySelectorAll('div[id^="dgeMermaidOutput"]'),E=0;E<v.length;E++)v[E].parentNode.removeChild(v[E]);mxMermaidToDrawio.resetListeners();+q,null));this.editor.graph.setEnabled(!1);this.mode=urlParams.mode;var v=urlParams.title;v=null!=v?decodeURIComponent(v):this.defaultFilename;q=this.getServiceCount(!0);isLocalStorage&&q++;var D=4>=q?2:6<q?4:3;v=new CreateDialog(this,v,mxUtils.bind(this,function(G,B){if(null==B){this.hideDialog();var d=Editor.useLocalStorage;this.createFile(0<G.length?G:this.defaultFilename,this.getFileData(),null,null,null,!0,null,!0);Editor.useLocalStorage=d}else this.pickFolder(B,mxUtils.bind(this,function(g){this.createFile(G,+this.getFileData(!0),null,B,null,!0,g)}))}),null,null,null,null,"1"==urlParams.browser,null,null,!0,D,null,null,null,this.editor.fileExtensions);this.showDialog(v.container,420,q>D?390:280,!0,!1,mxUtils.bind(this,function(G){G&&null==this.getCurrentFile()&&this.showSplash()}));v.init()}});if("http://"!=c.substring(0,7)&&"https://"!=c.substring(0,8))if("{"==c.charAt(0))this.spinner.stop(),c=JSON.parse(c),window.isMermaidEnabled&&"mermaid"==c.type?(mxMermaidToDrawio.addListener(mxUtils.bind(this,function(q){q!=+this.emptyDiagramXml&&(window.history.replaceState(null,null,window.location.pathname+this.getSearch(["create"])),this.createFile(null!=q.filename?q.filename:this.defaultFilename,q,null,null,null,!0,null,!0),this.editor.chromeless&&!this.editor.editable||this.actions.get("fitWindow").funct())})),this.generateMermaidImage(c.data,null,function(){},mxUtils.bind(this,function(q){for(var v=document.querySelectorAll('div[id^="dgeMermaidOutput"]'),D=0;D<v.length;D++)v[D].parentNode.removeChild(v[D]);mxMermaidToDrawio.resetListeners();this.handleError(q)}))):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"));else try{null!=window.opener&&null!=window.opener[c]?p(window.opener[c]):this.handleError(null,mxResources.get("errorLoadingFile"))}catch(q){this.handleError(q,mxResources.get("errorLoadingFile"))}else this.loadTemplate(c,function(q){p(q)},mxUtils.bind(this,function(q){this.handleError(q,mxResources.get("errorLoadingFile"),l)}))}else(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.state&&null!=this.stateArg&&"open"==this.stateArg.action?null!=this.stateArg.ids&&(window.history&&window.history.replaceState&&window.history.replaceState(null,null,window.location.pathname+this.getSearch(["state"])),window.location.hash="G"+this.stateArg.ids[0]):(null==window.location.hash||1>=window.location.hash.length)&&null!=this.drive&&null!=this.stateArg&&"create"==this.stateArg.action?(window.history&&window.history.replaceState&&window.history.replaceState(null,null,window.location.pathname+this.getSearch(["state"])),this.setMode(App.MODE_GOOGLE),"0"==urlParams.splash?this.createFile(null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename):this.actions.get("new").funct()):(null!=urlParams.open&&window.history&&window.history.replaceState&&(window.history.replaceState(null,null,window.location.pathname+this.getSearch(["open","sketch"])),window.location.hash=urlParams.open),f())}}catch(q){this.handleError(q)}};App.prototype.loadDraft=function(b,e){this.createFile(this.defaultFilename,b,null,null,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){var f=this.getCurrentFile();null!=f&&(f.fileChanged(),null!=e&&e())}),0)}),null,null,!0)};-App.prototype.filterDrafts=function(b,e,f){function c(){f(l)}var l=[];try{this.getDatabaseItems(mxUtils.bind(this,function(p){EditorUi.debug("App.filterDrafts",[this],"items",p);for(var q=0;q<p.length;q++)try{var v=p[q].key;if(null!=v&&".draft_"==v.substring(0,7)){var E=JSON.parse(p[q].data);null!=E&&"draft"==E.type&&E.aliveCheck!=e&&(null==b&&null==E.fileObject||null!=E.fileObject&&E.fileObject.path==b)&&(E.key=v,l.push(E))}}catch(G){}c()}),c)}catch(p){c()}};+App.prototype.filterDrafts=function(b,e,f){function c(){f(l)}var l=[];try{this.getDatabaseItems(mxUtils.bind(this,function(p){EditorUi.debug("App.filterDrafts",[this],"items",p);for(var q=0;q<p.length;q++)try{var v=p[q].key;if(null!=v&&".draft_"==v.substring(0,7)){var D=JSON.parse(p[q].data);null!=D&&"draft"==D.type&&D.aliveCheck!=e&&(null==b&&null==D.fileObject||null!=D.fileObject&&D.fileObject.path==b)&&(D.key=v,l.push(D))}}catch(G){}c()}),c)}catch(p){c()}};App.prototype.checkDrafts=function(){try{var b=Editor.guid();localStorage.setItem(".draft-alive-check",b);window.setTimeout(mxUtils.bind(this,function(){localStorage.removeItem(".draft-alive-check");this.filterDrafts(null,b,mxUtils.bind(this,function(e){if(1==e.length)this.loadDraft(e[0].data,mxUtils.bind(this,function(){this.removeDatabaseItem(e[0].key)}));else if(1<e.length){var f=new Date(e[0].modified);f=new DraftDialog(this,1<e.length?mxResources.get("selectDraft"):mxResources.get("draftFound",-[f.toLocaleDateString()+" "+f.toLocaleTimeString()]),1<e.length?null:e[0].data,mxUtils.bind(this,function(c){this.hideDialog();c=""!=c?c:0;this.loadDraft(e[c].data,mxUtils.bind(this,function(){this.removeDatabaseItem(e[c].key)}))}),mxUtils.bind(this,function(c,l){this.removeDatabaseItem(e[""!=c?c:0].key);null!=l&&l()}),null,null,null,1<e.length?e:null);this.showDialog(f.container,640,480,!0,!1,mxUtils.bind(this,function(c){"0"!=urlParams.splash?this.loadFile():this.createFile(this.defaultFilename,+[f.toLocaleDateString()+" "+f.toLocaleTimeString()]),1<e.length?null:e[0].data,mxUtils.bind(this,function(c){this.hideDialog();c=""!=c&&null!=e[c]?c:0;this.loadDraft(e[c].data,mxUtils.bind(this,function(){this.removeDatabaseItem(e[c].key)}))}),mxUtils.bind(this,function(c,l){this.removeDatabaseItem(e[""!=c?c:0].key);null!=l&&l()}),null,null,null,1<e.length?e:null);this.showDialog(f.container,640,480,!0,!1,mxUtils.bind(this,function(c){"0"!=urlParams.splash?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0)}));f.init()}else"0"!=urlParams.splash?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0)}))}),0)}catch(e){}};App.prototype.showSplash=function(b){if("1"!=urlParams.noFileMenu){var e=this.getServiceCount(!0),f=mxUtils.bind(this,function(){var l=new SplashDialog(this);this.showDialog(l.container,340,mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?200:230,!0,!0,mxUtils.bind(this,function(p,q){!p&&!q||mxClient.IS_CHROMEAPP||(p=Editor.useLocalStorage,this.createFile(this.defaultFilename+(EditorUi.isElectronApp?".drawio":""),null,null,null,null,null,null,"1"!=urlParams.local),Editor.useLocalStorage=p)}),!0)});if(this.editor.isChromelessView())this.handleError({message:mxResources.get("noFileSelected")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){this.showSplash()}));else if(mxClient.IS_CHROMEAPP||null!=this.mode&&!b)null==urlParams.create&&f();else{b=4==e?2:3;var c=new StorageDialog(this,mxUtils.bind(this,function(){this.hideDialog();f()}),b);this.showDialog(c.container,3>b?200:300,3<e?320:210,!0,!1)}}};App.prototype.addLanguageMenu=function(b,e,f){var c=null;null!=this.menus.get("language")&&(c=document.createElement("div"),this.setElementTitle(c,"language"),c.className="geAdaptiveAsset",c.style.backgroundImage="url("+Editor.globeImage+")",c.style.backgroundPosition="right center",c.style.backgroundRepeat="no-repeat",c.style.backgroundSize="19px 19px",c.style.width="19px",c.style.height="19px",mxUtils.setOpacity(c,40),c.style.position="absolute",c.style.cursor="pointer",c.style.bottom="20px",c.style.right=null!=f?f:"22px",e&&(c.style.direction="rtl",c.style.textAlign="right",c.style.right=null!=f?f:"24px",e=document.createElement("span"),e.style.display="inline-block",e.style.fontSize="12px",e.style.margin="2px 24px 0 0",e.style.userSelect="none",mxUtils.write(e,mxResources.get("language")),c.appendChild(e),e.className="geAdaptiveAsset"),mxEvent.addListener(c,"click",mxUtils.bind(this,function(l){this.editor.graph.popupMenuHandler.hideMenu();var p=new mxPopupMenu(this.menus.get("language").funct);p.smartSeparators=!0;p.showDisabled=!0;p.autoExpand=!0;p.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(p,arguments);p.destroy()});var q=mxUtils.getOffset(c);p.popup(q.x,q.y+c.offsetHeight,null,l);this.setCurrentMenu(p)})),b.appendChild(c));return c};-App.prototype.loadFileSystemEntry=function(b,e,f){f=null!=f?f:mxUtils.bind(this,function(c){this.handleError(c)});try{b.getFile().then(mxUtils.bind(this,function(c){var l=new FileReader;l.onload=mxUtils.bind(this,function(p){var q=mxUtils.bind(this,function(v){try{if(null!=e){var E=p.target.result;"image/png"==c.type&&(E=this.extractGraphModelFromPng(E));e(new LocalFile(this,E,c.name,null,b,c,v))}else this.openFileHandle(p.target.result,c.name,c,!1,b,v)}catch(G){f(G)}});b.queryPermission?b.queryPermission({mode:"readwrite"}).then(mxUtils.bind(this,+App.prototype.loadFileSystemEntry=function(b,e,f){f=null!=f?f:mxUtils.bind(this,function(c){this.handleError(c)});try{b.getFile().then(mxUtils.bind(this,function(c){var l=new FileReader;l.onload=mxUtils.bind(this,function(p){var q=mxUtils.bind(this,function(v){try{if(null!=e){var D=p.target.result;"image/png"==c.type&&(D=this.extractGraphModelFromPng(D));e(new LocalFile(this,D,c.name,null,b,c,v))}else this.openFileHandle(p.target.result,c.name,c,!1,b,v)}catch(G){f(G)}});b.queryPermission?b.queryPermission({mode:"readwrite"}).then(mxUtils.bind(this,function(v){q("denied"!==v)})):b.createWritable().then(mxUtils.bind(this,function(){q(!0)}),mxUtils.bind(this,function(v){q(!1)}))});l.onerror=f;"image"!==c.type.substring(0,5)&&"application/pdf"!==c.type||"image/svg"===c.type.substring(0,9)?l.readAsText(c):l.readAsDataURL(c)}),f)}catch(c){f(c)}};App.prototype.createFileSystemOptions=function(b){var e=[],f=null;if(null!=b){var c=b.lastIndexOf(".");0<c&&(f=b.substring(c+1))}for(c=0;c<this.editor.diagramFileTypes.length;c++){var l={description:mxResources.get(this.editor.diagramFileTypes[c].description)+(mxClient.IS_MAC?" (."+this.editor.diagramFileTypes[c].extension+")":""),accept:{}};l.accept[this.editor.diagramFileTypes[c].mimeType]=["."+this.editor.diagramFileTypes[c].extension];this.editor.diagramFileTypes[c].extension==f?e.splice(0,0,l):this.editor.diagramFileTypes[c].extension==f?e.splice(0,0,l):e.push(l)}return{types:e,suggestedName:b}};App.prototype.showSaveFilePicker=function(b,e,f){e=null!=e?e:mxUtils.bind(this,function(c){"AbortError"!=c.name&&this.handleError(c)});f=null!=f?f:this.createFileSystemOptions();window.showSaveFilePicker(f).then(mxUtils.bind(this,function(c){null!=c&&c.getFile().then(mxUtils.bind(this,function(l){b(c,l)}),e)}),e)};App.prototype.pickFile=function(b){try{if(b=null!=b?b:this.mode,b==App.MODE_GOOGLE)null!=this.drive&&"undefined"!=typeof google&&"undefined"!=typeof google.picker?this.drive.pickFile():this.openLink("https://drive.google.com");else{var e=this.getServiceForName(b);if(null!=e)e.pickFile();else if(b==App.MODE_DEVICE&&EditorUi.nativeFileSupport)window.showOpenFilePicker().then(mxUtils.bind(this,function(q){null!=q&&0<q.length&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.loadFileSystemEntry(q[0])}),mxUtils.bind(this,function(q){"AbortError"!=q.name&&this.handleError(q)}));else if(b==App.MODE_DEVICE&&Graph.fileSupport){if(null==this.openFileInputElt){var f=document.createElement("input");f.setAttribute("type","file");mxEvent.addListener(f,"change",mxUtils.bind(this,function(){null!=f.files&&(this.openFiles(f.files),f.type="",f.type="file",f.value="")}));f.style.display="none";document.body.appendChild(f);this.openFileInputElt=f}this.openFileInputElt.click()}else{this.hideDialog();window.openNew=-null!=this.getCurrentFile()&&!this.isDiagramEmpty();window.baseUrl=this.getUrl();window.openKey="open";window.listBrowserFiles=mxUtils.bind(this,function(q,v){StorageFile.listFiles(this,"F",q,v)});window.openBrowserFile=mxUtils.bind(this,function(q,v,E){StorageFile.getFileContent(this,q,v,E)});window.deleteBrowserFile=mxUtils.bind(this,function(q,v,E){StorageFile.deleteFile(this,q,v,E)});var c=Editor.useLocalStorage;Editor.useLocalStorage=b==App.MODE_BROWSER;this.openFile();window.openFile.setConsumer(mxUtils.bind(this,-function(q,v){var E=mxUtils.bind(this,function(){this.useCanvasForExport||".png"!=v.substring(v.length-4)||(v=v.substring(0,v.length-4)+".drawio");this.fileLoaded(b==App.MODE_BROWSER?new StorageFile(this,q,v):new LocalFile(this,q,v))}),G=this.getCurrentFile();null!=G&&G.isModified()?this.confirm(mxResources.get("allChangesLost"),null,E,mxResources.get("cancel"),mxResources.get("discardChanges")):E()}));var l=this.dialog,p=l.close;this.dialog.close=mxUtils.bind(this,function(q){Editor.useLocalStorage=+null!=this.getCurrentFile()&&!this.isDiagramEmpty();window.baseUrl=this.getUrl();window.openKey="open";window.listBrowserFiles=mxUtils.bind(this,function(q,v){StorageFile.listFiles(this,"F",q,v)});window.openBrowserFile=mxUtils.bind(this,function(q,v,D){StorageFile.getFileContent(this,q,v,D)});window.deleteBrowserFile=mxUtils.bind(this,function(q,v,D){StorageFile.deleteFile(this,q,v,D)});var c=Editor.useLocalStorage;Editor.useLocalStorage=b==App.MODE_BROWSER;this.openFile();window.openFile.setConsumer(mxUtils.bind(this,+function(q,v){var D=mxUtils.bind(this,function(){this.useCanvasForExport||".png"!=v.substring(v.length-4)||(v=v.substring(0,v.length-4)+".drawio");this.fileLoaded(b==App.MODE_BROWSER?new StorageFile(this,q,v):new LocalFile(this,q,v))}),G=this.getCurrentFile();null!=G&&G.isModified()?this.confirm(mxResources.get("allChangesLost"),null,D,mxResources.get("cancel"),mxResources.get("discardChanges")):D()}));var l=this.dialog,p=l.close;this.dialog.close=mxUtils.bind(this,function(q){Editor.useLocalStorage=c;p.apply(l,arguments);null==this.getCurrentFile()&&this.showSplash()})}}}catch(q){this.handleError(q)}};App.prototype.pickLibrary=function(b){b=null!=b?b:this.mode;var e=mxUtils.bind(this,function(p){try{this.loadLibrary(p);this.showSidebar();try{this.sidebar.palettes[p.getHash()][0].scrollIntoView({behavior:"smooth"})}catch(q){}}catch(q){this.handleError(q,mxResources.get("errorLoadingFile"))}});if(b==App.MODE_GOOGLE||b==App.MODE_DROPBOX||b==App.MODE_ONEDRIVE||b==App.MODE_GITHUB||b==App.MODE_GITLAB||b==App.MODE_TRELLO){var f=b==App.MODE_GOOGLE?this.drive:b==App.MODE_ONEDRIVE?this.oneDrive:b==App.MODE_GITHUB?this.gitHub:b==App.MODE_GITLAB?this.gitLab:b==App.MODE_TRELLO?this.trello:this.dropbox;null!=f&&f.pickLibrary(mxUtils.bind(this,function(p,q){null!=q?e(q):this.spinner.spin(document.body,mxResources.get("loading"))&&f.getLibrary(p,mxUtils.bind(this,function(v){this.spinner.stop();e(v)}),mxUtils.bind(this,function(v){this.handleError(v,null!=v?mxResources.get("errorLoadingFile"):null)}))}))}else if(b==App.MODE_DEVICE&&Graph.fileSupport){if(null==this.libFileInputElt){var c=document.createElement("input");-c.setAttribute("type","file");mxEvent.addListener(c,"change",mxUtils.bind(this,function(){if(null!=c.files){for(var p=0;p<c.files.length;p++)mxUtils.bind(this,function(q){var v=new FileReader;v.onload=mxUtils.bind(this,function(E){e(new LocalLibrary(this,E.target.result,q.name))});v.readAsText(q)})(c.files[p]);c.type="";c.type="file";c.value=""}}));c.style.display="none";document.body.appendChild(c);this.libFileInputElt=c}this.libFileInputElt.click()}else{window.openNew=!1;window.openKey="open";window.listBrowserFiles=+c.setAttribute("type","file");mxEvent.addListener(c,"change",mxUtils.bind(this,function(){if(null!=c.files){for(var p=0;p<c.files.length;p++)mxUtils.bind(this,function(q){var v=new FileReader;v.onload=mxUtils.bind(this,function(D){e(new LocalLibrary(this,D.target.result,q.name))});v.readAsText(q)})(c.files[p]);c.type="";c.type="file";c.value=""}}));c.style.display="none";document.body.appendChild(c);this.libFileInputElt=c}this.libFileInputElt.click()}else{window.openNew=!1;window.openKey="open";window.listBrowserFiles=mxUtils.bind(this,function(p,q){StorageFile.listFiles(this,"L",p,q)});window.openBrowserFile=mxUtils.bind(this,function(p,q,v){StorageFile.getFileContent(this,p,q,v)});window.deleteBrowserFile=mxUtils.bind(this,function(p,q,v){StorageFile.deleteFile(this,p,q,v)});var l=Editor.useLocalStorage;Editor.useLocalStorage=b==App.MODE_BROWSER;window.openFile=new OpenFile(mxUtils.bind(this,function(p){this.hideDialog(p)}));window.openFile.setConsumer(mxUtils.bind(this,function(p,q){e(b==App.MODE_BROWSER?new StorageLibrary(this,p,q):new LocalLibrary(this,p,q))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){Editor.useLocalStorage=l;window.openFile=null})}};-App.prototype.saveLibrary=function(b,e,f,c,l,p,q){try{c=null!=c?c:this.mode;l=null!=l?l:!1;p=null!=p?p:!1;var v=this.createLibraryDataFromImages(e),E=mxUtils.bind(this,function(d){this.spinner.stop();null!=q&&q();this.handleError(d,null!=d?mxResources.get("errorSavingFile"):null)});null==f&&c==App.MODE_DEVICE&&(f=new LocalLibrary(this,v,b));if(null==f)this.pickFolder(c,mxUtils.bind(this,function(d){c==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?-this.drive.insertFile(b,v,d,mxUtils.bind(this,function(g){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(g,e)}),E,this.drive.libraryMimeType):c==App.MODE_GITHUB&&null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitHub.insertLibrary(b,v,mxUtils.bind(this,function(g){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(g,e)}),E,d):c==App.MODE_GITLAB&&null!=this.gitLab&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitLab.insertLibrary(b,-v,mxUtils.bind(this,function(g){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(g,e)}),E,d):c==App.MODE_TRELLO&&null!=this.trello&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.trello.insertLibrary(b,v,mxUtils.bind(this,function(g){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(g,e)}),E,d):c==App.MODE_DROPBOX&&null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.dropbox.insertLibrary(b,v,mxUtils.bind(this,function(g){this.spinner.stop();-this.hideDialog(!0);this.libraryLoaded(g,e)}),E,d):c==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(b,v,mxUtils.bind(this,function(g){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(g,e)}),E,d):c==App.MODE_BROWSER?StorageFile.doInsertFile(new StorageLibrary(this,v,b),mxUtils.bind(this,function(g){this.hideDialog(!0);this.libraryLoaded(g,e)}),E):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));-else if(l||this.spinner.spin(document.body,mxResources.get("saving"))){f.setData(v);var G=mxUtils.bind(this,function(){f.save(!0,mxUtils.bind(this,function(d){this.spinner.stop();this.hideDialog(!0);p||this.libraryLoaded(f,e);null!=q&&q()}),E)});if(b!=f.getTitle()){var B=f.getHash();f.rename(b,mxUtils.bind(this,function(d){f.constructor!=LocalLibrary&&B!=f.getHash()&&(mxSettings.removeCustomLibrary(B),mxSettings.addCustomLibrary(f.getHash()));this.removeLibrarySidebar(B);G()}),E)}else G()}}catch(d){this.handleError(d)}};+App.prototype.saveLibrary=function(b,e,f,c,l,p,q){try{c=null!=c?c:this.mode;l=null!=l?l:!1;p=null!=p?p:!1;var v=this.createLibraryDataFromImages(e),D=mxUtils.bind(this,function(d){this.spinner.stop();null!=q&&q();this.handleError(d,null!=d?mxResources.get("errorSavingFile"):null)});null==f&&c==App.MODE_DEVICE&&(f=new LocalLibrary(this,v,b));if(null==f)this.pickFolder(c,mxUtils.bind(this,function(d){c==App.MODE_GOOGLE&&null!=this.drive&&this.spinner.spin(document.body,mxResources.get("inserting"))?+this.drive.insertFile(b,v,d,mxUtils.bind(this,function(g){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(g,e)}),D,this.drive.libraryMimeType):c==App.MODE_GITHUB&&null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitHub.insertLibrary(b,v,mxUtils.bind(this,function(g){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(g,e)}),D,d):c==App.MODE_GITLAB&&null!=this.gitLab&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.gitLab.insertLibrary(b,+v,mxUtils.bind(this,function(g){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(g,e)}),D,d):c==App.MODE_TRELLO&&null!=this.trello&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.trello.insertLibrary(b,v,mxUtils.bind(this,function(g){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(g,e)}),D,d):c==App.MODE_DROPBOX&&null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.dropbox.insertLibrary(b,v,mxUtils.bind(this,function(g){this.spinner.stop();+this.hideDialog(!0);this.libraryLoaded(g,e)}),D,d):c==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(b,v,mxUtils.bind(this,function(g){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(g,e)}),D,d):c==App.MODE_BROWSER?StorageFile.doInsertFile(new StorageLibrary(this,v,b),mxUtils.bind(this,function(g){this.hideDialog(!0);this.libraryLoaded(g,e)}),D):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));+else if(l||this.spinner.spin(document.body,mxResources.get("saving"))){f.setData(v);var G=mxUtils.bind(this,function(){f.save(!0,mxUtils.bind(this,function(d){this.spinner.stop();this.hideDialog(!0);p||this.libraryLoaded(f,e);null!=q&&q()}),D)});if(b!=f.getTitle()){var B=f.getHash();f.rename(b,mxUtils.bind(this,function(d){f.constructor!=LocalLibrary&&B!=f.getHash()&&(mxSettings.removeCustomLibrary(B),mxSettings.addCustomLibrary(f.getHash()));this.removeLibrarySidebar(B);G()}),D)}else G()}}catch(d){this.handleError(d)}};App.prototype.saveFile=function(b,e){var f=this.getCurrentFile(),c=this.mode;if(null!=f){var l=mxUtils.bind(this,function(){EditorUi.enableDrafts&&f.removeDraft();this.getCurrentFile()==f||f.isModified()||(f.getMode()!=App.MODE_DEVICE?this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved")))})):this.clearStatus());null!=e&&e()});if(b||null==f.getTitle()||null!=f.invalidFileHandle||null==this.mode)if(null!=f&&f.constructor==LocalFile&&-null!=f.fileHandle)this.showSaveFilePicker(mxUtils.bind(this,function(v,E){f.invalidFileHandle=null;f.fileHandle=v;f.title=E.name;f.desc=E;f.editable=null;this.save(E.name,l)}),null,this.createFileSystemOptions(f.getTitle()));else{b=null!=f.getTitle()?f.getTitle():this.defaultFilename;var p=mxUtils.bind(this,function(v,E,G,B){if(null!=v&&0<v.length)if(/(\.pdf)$/i.test(v))this.confirm(mxResources.get("didYouMeanToExportToPdf"),mxUtils.bind(this,function(){this.hideDialog();this.actions.get("exportPdf").funct()}),-mxUtils.bind(this,function(){G.value=v.split(".").slice(0,-1).join(".");G.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?G.select():document.execCommand("selectAll",!1,null)}),mxResources.get("yes"),mxResources.get("no"));else if(this.hideDialog(),null==c&&E==App.MODE_DEVICE)null!=f&&EditorUi.nativeFileSupport?this.showSaveFilePicker(mxUtils.bind(this,function(g,k){f.fileHandle=g;f.mode=App.MODE_DEVICE;f.title=k.name;f.desc=k;this.setMode(App.MODE_DEVICE);this.save(k.name,l)}),mxUtils.bind(this,-function(g){"AbortError"!=g.name&&this.handleError(g)}),this.createFileSystemOptions(v)):(this.setMode(App.MODE_DEVICE),this.save(v,l));else if("download"==E)(new LocalFile(this,null,v)).save();else if("_blank"==E)window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(this.getFileData(!0)),this.openLink(this.getUrl(window.location.pathname),null,!0);else if(c!=E){var d=mxUtils.bind(this,function(g){var k=this.editor.graph,m=k.getSelectionCells(),t=k.getViewState(),-y=this.currentPage;this.createFile(v,this.getFileData(/(\.xml)$/i.test(v)||0>v.indexOf(".")||/(\.drawio)$/i.test(v),/(\.svg)$/i.test(v),/(\.html)$/i.test(v)),null,E,l,null==this.mode,g,null,null,mxUtils.bind(this,function(){this.restoreViewState(y,t,m)}))});null!=B?d(B):this.pickFolder(E,d)}else null!=E&&this.save(v,l)}),q=!mxClient.IS_IOS||!navigator.standalone;b=new SaveDialog(this,b,mxUtils.bind(this,function(v,E,G){p(v.value,E,v,G);this.hideDialog()}),q?null:["_blank"]);this.showDialog(b.container,+null!=f.fileHandle)this.showSaveFilePicker(mxUtils.bind(this,function(v,D){f.invalidFileHandle=null;f.fileHandle=v;f.title=D.name;f.desc=D;f.editable=null;this.save(D.name,l)}),null,this.createFileSystemOptions(f.getTitle()));else{b=null!=f.getTitle()?f.getTitle():this.defaultFilename;var p=mxUtils.bind(this,function(v,D,G,B){if(null!=v&&0<v.length)if(/(\.pdf)$/i.test(v))this.confirm(mxResources.get("didYouMeanToExportToPdf"),mxUtils.bind(this,function(){this.hideDialog();this.actions.get("exportPdf").funct()}),+mxUtils.bind(this,function(){G.value=v.split(".").slice(0,-1).join(".");G.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?G.select():document.execCommand("selectAll",!1,null)}),mxResources.get("yes"),mxResources.get("no"));else if(this.hideDialog(),null==c&&D==App.MODE_DEVICE)null!=f&&EditorUi.nativeFileSupport?this.showSaveFilePicker(mxUtils.bind(this,function(g,k){f.fileHandle=g;f.mode=App.MODE_DEVICE;f.title=k.name;f.desc=k;this.setMode(App.MODE_DEVICE);this.save(k.name,l)}),mxUtils.bind(this,+function(g){"AbortError"!=g.name&&this.handleError(g)}),this.createFileSystemOptions(v)):(this.setMode(App.MODE_DEVICE),this.save(v,l));else if("download"==D)(new LocalFile(this,null,v)).save();else if("_blank"==D)window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(this.getFileData(!0)),this.openLink(this.getUrl(window.location.pathname),null,!0);else if(c!=D){var d=mxUtils.bind(this,function(g){var k=this.editor.graph,m=k.getSelectionCells(),t=k.getViewState(),+y=this.currentPage;this.createFile(v,this.getFileData(/(\.xml)$/i.test(v)||0>v.indexOf(".")||/(\.drawio)$/i.test(v),/(\.svg)$/i.test(v),/(\.html)$/i.test(v)),null,D,l,null==this.mode,g,null,null,mxUtils.bind(this,function(){this.restoreViewState(y,t,m)}))});null!=B?d(B):this.pickFolder(D,d)}else null!=D&&this.save(v,l)}),q=!mxClient.IS_IOS||!navigator.standalone;b=new SaveDialog(this,b,mxUtils.bind(this,function(v,D,G){p(v.value,D,v,G);this.hideDialog()}),q?null:["_blank"]);this.showDialog(b.container,420,150,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));b.init()}else this.save(f.getTitle(),l)}};-App.prototype.loadTemplate=function(b,e,f,c,l){var p=!1,q=b,v=null!=c?c:b;c=/\.png$/i.test(v)||/\.pdf$/i.test(v);var E=EditorUi.isVisioFilename(v);this.editor.isCorsEnabledForUrl(q)||(p=c||E,q="t="+(new Date).getTime(),q=PROXY_URL+"?url="+encodeURIComponent(b)+"&"+q+(p?"&base64=1":""));this.editor.loadUrl(q,mxUtils.bind(this,function(G){try{var B=p?!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(G):atob(G):G;if(E||this.isVisioData(B))E||(v=l?this.isRemoteVisioData(B)?"raw.vss":"raw.vssx":+App.prototype.loadTemplate=function(b,e,f,c,l){var p=!1,q=b,v=null!=c?c:b;c=/\.png$/i.test(v)||/\.pdf$/i.test(v);var D=EditorUi.isVisioFilename(v);this.editor.isCorsEnabledForUrl(q)||(p=c||D,q="t="+(new Date).getTime(),q=PROXY_URL+"?url="+encodeURIComponent(b)+"&"+q+(p?"&base64=1":""));this.editor.loadUrl(q,mxUtils.bind(this,function(G){try{var B=p?!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(G):atob(G):G;if(D||this.isVisioData(B))D||(v=l?this.isRemoteVisioData(B)?"raw.vss":"raw.vssx":this.isRemoteVisioData(B)?"raw.vsd":"raw.vsdx"),this.importVisio(this.base64ToBlob(G.substring(G.indexOf(",")+1)),function(d){e(d)},f,v);else if((new XMLHttpRequest).upload&&this.isRemoteFileFormat(B,v))this.isExternalDataComms()?this.parseFileData(B,mxUtils.bind(this,function(d){4==d.readyState&&200<=d.status&&299>=d.status&&"<mxGraphModel"==d.responseText.substring(0,13)&&e(d.responseText)}),b):this.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,f);else if(this.isLucidChartData(B))this.convertLucidChart(B,-mxUtils.bind(this,function(d){e(d)}),mxUtils.bind(this,function(d){f(d)}));else{if(/(\.png)($|\?)/i.test(v)||Editor.isPngData(B))B=Editor.extractGraphModelFromPng(G);e(B)}}catch(d){f(d)}}),f,/(\.png)($|\?)/i.test(v)||E,null,null,p)};App.prototype.getModeForChar=function(b){return"G"==b?App.MODE_GOOGLE:"D"==b?App.MODE_DROPBOX:"W"==b?App.MODE_ONEDRIVE:"H"==b?App.MODE_GITHUB:"A"==b?App.MODE_GITLAB:"T"==b?App.MODE_TRELLO:null};+mxUtils.bind(this,function(d){e(d)}),mxUtils.bind(this,function(d){f(d)}));else{if(/(\.png)($|\?)/i.test(v)||Editor.isPngData(B))B=Editor.extractGraphModelFromPng(G);e(B)}}catch(d){f(d)}}),f,/(\.png)($|\?)/i.test(v)||D,null,null,p)};App.prototype.getModeForChar=function(b){return"G"==b?App.MODE_GOOGLE:"D"==b?App.MODE_DROPBOX:"W"==b?App.MODE_ONEDRIVE:"H"==b?App.MODE_GITHUB:"A"==b?App.MODE_GITLAB:"T"==b?App.MODE_TRELLO:null};App.prototype.isModeEnabled=function(b){return b==App.MODE_GOOGLE?"function"===typeof window.DriveClient&&("1"!=urlParams.embed&&"0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&mxClient.IS_SVG&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode):b==App.MODE_GITHUB?null!=this.gitHub:b==App.MODE_GITLAB?null!=this.gitLab:b==App.MODE_DROPBOX?"function"===typeof window.DropboxClient&&("1"!=urlParams.embed&&"0"!=urlParams.db||"1"==urlParams.embed&&"1"==urlParams.db)&&mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode):b==App.MODE_ONEDRIVE?"function"===typeof window.OneDriveClient&&("www.draw.io"==window.location.hostname||"test.draw.io"==window.location.hostname||"drive.draw.io"==window.location.hostname||"app.diagrams.net"==window.location.hostname)&&("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&!mxClient.IS_IOS&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode):b==App.MODE_TRELLO?"function"===typeof window.TrelloClient&&"1"==urlParams.tr&&mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode):!1};App.prototype.isModeReady=function(b){return null!=this.getServiceForName(b)&&(b!=App.MODE_DROPBOX||"undefined"!==typeof Dropbox.choose)};App.prototype.uncompressPages=function(b){if(null!=b)try{var e=mxUtils.parseXml(b);if("mxfile"==e.documentElement.nodeName){for(var f=e.documentElement.getElementsByTagName("diagram"),c=0;c<f.length;c++){var l=Editor.parseDiagramNode(f[c],!0);null!=l&&(mxUtils.setTextContent(f[c],""),f[c].appendChild(l))}b=mxUtils.getPrettyXml(e.documentElement)}}catch(p){}return b};-App.prototype.createFile=function(b,e,f,c,l,p,q,v,E,G){c=v?null:null!=c?c:this.mode;if(null!=b&&this.spinner.spin(document.body,mxResources.get("inserting"))){e=null!=e?e:this.emptyDiagramXml;null==e||Editor.defaultCompressed||(e=this.uncompressPages(e));var B=mxUtils.bind(this,function(){this.spinner.stop()}),d=mxUtils.bind(this,function(k){B();null==k&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():null!=k&&this.handleError(k)});try{var g=mxUtils.bind(this,function(k){B();this.fileCreated(k,-f,p,l,E,G)});c==App.MODE_GOOGLE&&null!=this.drive?(null==q&&null!=this.stateArg&&null!=this.stateArg.folderId&&(q=this.stateArg.folderId),this.drive.insertFile(b,e,q,g,d)):c==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.insertFile(b,e,g,d,!1,q):c==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.insertFile(b,e,g,d,!1,q):c==App.MODE_TRELLO&&null!=this.trello?this.trello.insertFile(b,e,g,d,!1,q):c==App.MODE_DROPBOX&&null!=this.dropbox?this.dropbox.insertFile(b,e,g,d):c==App.MODE_ONEDRIVE&&null!=this.oneDrive?-this.oneDrive.insertFile(b,e,g,d,!1,q):c==App.MODE_BROWSER?StorageFile.insertFile(this,b,e,g,d):!v&&c==App.MODE_DEVICE&&EditorUi.nativeFileSupport?(B(),this.showSaveFilePicker(mxUtils.bind(this,function(k,m){var t=new LocalFile(this,e,m.name,null,k,m);t.saveFile(m.name,!1,mxUtils.bind(this,function(){this.fileCreated(t,f,p,l,E,G)}),d,!0)}),mxUtils.bind(this,function(k){"AbortError"!=k.name&&d(k)}),this.createFileSystemOptions(b))):(B(),this.fileCreated(new LocalFile(this,e,b,null==c),f,p,l,E,G))}catch(k){B(),+App.prototype.createFile=function(b,e,f,c,l,p,q,v,D,G){c=v?null:null!=c?c:this.mode;if(null!=b&&this.spinner.spin(document.body,mxResources.get("inserting"))){e=null!=e?e:this.emptyDiagramXml;null==e||Editor.defaultCompressed||(e=this.uncompressPages(e));var B=mxUtils.bind(this,function(){this.spinner.stop()}),d=mxUtils.bind(this,function(k){B();null==k&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():null!=k&&this.handleError(k)});try{var g=mxUtils.bind(this,function(k){B();this.fileCreated(k,+f,p,l,D,G)});c==App.MODE_GOOGLE&&null!=this.drive?(null==q&&null!=this.stateArg&&null!=this.stateArg.folderId&&(q=this.stateArg.folderId),this.drive.insertFile(b,e,q,g,d)):c==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.insertFile(b,e,g,d,!1,q):c==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.insertFile(b,e,g,d,!1,q):c==App.MODE_TRELLO&&null!=this.trello?this.trello.insertFile(b,e,g,d,!1,q):c==App.MODE_DROPBOX&&null!=this.dropbox?this.dropbox.insertFile(b,e,g,d):c==App.MODE_ONEDRIVE&&null!=this.oneDrive?+this.oneDrive.insertFile(b,e,g,d,!1,q):c==App.MODE_BROWSER?StorageFile.insertFile(this,b,e,g,d):!v&&c==App.MODE_DEVICE&&EditorUi.nativeFileSupport?(B(),this.showSaveFilePicker(mxUtils.bind(this,function(k,m){var t=new LocalFile(this,e,m.name,null,k,m);t.saveFile(m.name,!1,mxUtils.bind(this,function(){this.fileCreated(t,f,p,l,D,G)}),d,!0)}),mxUtils.bind(this,function(k){"AbortError"!=k.name&&d(k)}),this.createFileSystemOptions(b))):(B(),this.fileCreated(new LocalFile(this,e,b,null==c),f,p,l,D,G))}catch(k){B(),this.handleError(k)}}};-App.prototype.fileCreated=function(b,e,f,c,l,p){var q=window.location.pathname;null!=e&&0<e.length&&(q+="?libs="+e);null!=l&&0<l.length&&(q+="?clibs="+l);q=this.getUrl(q);b.getMode()!=App.MODE_DEVICE&&(q+="#"+b.getHash());if(this.spinner.spin(document.body,mxResources.get("inserting"))){var v=b.getData();v=0<v.length?this.editor.extractGraphModel(mxUtils.parseXml(v).documentElement,!0):null;var E=window.location.protocol+"//"+window.location.hostname+q,G=v,B=null;null!=v&&/\.svg$/i.test(b.getTitle())&&(B=-this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(B.container),G=this.decodeNodeIntoGraph(G,B));b.setData(this.createFileData(v,B,b,E));null!=B&&B.container.parentNode.removeChild(B.container);var d=mxUtils.bind(this,function(){this.spinner.stop()}),g=mxUtils.bind(this,function(){d();var k=this.getCurrentFile();null==f&&null!=k&&(f=!k.isModified()&&null==k.getMode());var m=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(b,null,p);f&&this.updateStatus(mxUtils.bind(this,-function(){b.addAllSavedStatus()}));null!=e&&this.sidebar.showEntries(e);if(null!=l){for(var y=[],A=l.split(";"),I=0;I<A.length;I++)y.push(decodeURIComponent(A[I]));this.loadLibraries(y)}null!=c&&c()}),t=mxUtils.bind(this,function(){f||null==k||!k.isModified()?m():this.confirm(mxResources.get("allChangesLost"),null,m,mxResources.get("cancel"),mxResources.get("discardChanges"))});null==f||f?t():(b.constructor==LocalFile&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(b.getData(),+App.prototype.fileCreated=function(b,e,f,c,l,p){var q=window.location.pathname;null!=e&&0<e.length&&(q+="?libs="+e);null!=l&&0<l.length&&(q+="?clibs="+l);q=this.getUrl(q);b.getMode()!=App.MODE_DEVICE&&(q+="#"+b.getHash());if(this.spinner.spin(document.body,mxResources.get("inserting"))){var v=b.getData();v=0<v.length?this.editor.extractGraphModel(mxUtils.parseXml(v).documentElement,!0):null;var D=window.location.protocol+"//"+window.location.hostname+q,G=v,B=null;null!=v&&/\.svg$/i.test(b.getTitle())&&(B=+this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(B.container),G=this.decodeNodeIntoGraph(G,B));b.setData(this.createFileData(v,B,b,D));null!=B&&B.container.parentNode.removeChild(B.container);var d=mxUtils.bind(this,function(){this.spinner.stop()}),g=mxUtils.bind(this,function(){d();var k=this.getCurrentFile();null==f&&null!=k&&(f=!k.isModified()&&null==k.getMode());var m=mxUtils.bind(this,function(){window.openFile=null;this.fileLoaded(b,null,p);f&&this.updateStatus(mxUtils.bind(this,+function(){b.addAllSavedStatus()}));null!=e&&this.sidebar.showEntries(e);if(null!=l){for(var y=[],z=l.split(";"),I=0;I<z.length;I++)y.push(decodeURIComponent(z[I]));this.loadLibraries(y)}null!=c&&c()}),t=mxUtils.bind(this,function(){f||null==k||!k.isModified()?m():this.confirm(mxResources.get("allChangesLost"),null,m,mxResources.get("cancel"),mxResources.get("discardChanges"))});null==f||f?t():(b.constructor==LocalFile&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(b.getData(),b.getTitle(),null==b.getMode())),window.geOpenWindow(q,null,t))});b.constructor==LocalFile?g():b.saveFile(b.getTitle(),!1,mxUtils.bind(this,function(){g()}),mxUtils.bind(this,function(k){d();null!=k&&"AbortError"==k.name||this.handleError(k)}))}};-App.prototype.loadFile=function(b,e,f,c,l){if("1"==urlParams.openInSameWin||navigator.standalone)e=!0;this.hideDialog();var p=mxUtils.bind(this,function(){if(null==b||0==b.length)this.clearStatus(),this.fileLoaded(null);else if(this.spinner.spin(document.body,mxResources.get("loading")))if("L"==b.charAt(0))if(this.spinner.stop(),isLocalStorage){var E=mxUtils.bind(this,function(k){this.handleError(k,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var m=this.getCurrentFile();window.location.hash=-null!=m?m.getHash():""}))});b=decodeURIComponent(b.substring(1));StorageFile.getFileContent(this,b,mxUtils.bind(this,function(k){null!=k?(this.fileLoaded(new StorageFile(this,k,b)),null!=c&&c()):E({message:mxResources.get("fileNotFound")})}),E)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var k=this.getCurrentFile();window.location.hash=null!=k?k.getHash():""}));else if(null!=f)this.spinner.stop(),this.fileLoaded(f),+App.prototype.loadFile=function(b,e,f,c,l){if("1"==urlParams.openInSameWin||navigator.standalone)e=!0;this.hideDialog();var p=mxUtils.bind(this,function(){if(null==b||0==b.length)this.clearStatus(),this.fileLoaded(null);else if(this.spinner.spin(document.body,mxResources.get("loading")))if("L"==b.charAt(0))if(this.spinner.stop(),isLocalStorage){var D=mxUtils.bind(this,function(k){this.handleError(k,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var m=this.getCurrentFile();window.location.hash=+null!=m?m.getHash():""}))});b=decodeURIComponent(b.substring(1));StorageFile.getFileContent(this,b,mxUtils.bind(this,function(k){null!=k?(this.fileLoaded(new StorageFile(this,k,b)),null!=c&&c()):D({message:mxResources.get("fileNotFound")})}),D)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var k=this.getCurrentFile();window.location.hash=null!=k?k.getHash():""}));else if(null!=f)this.spinner.stop(),this.fileLoaded(f),null!=c&&c();else if("S"==b.charAt(0))this.spinner.stop(),this.alert("[Deprecation] #S is no longer supported, go to https://app.diagrams.net/?desc="+b.substring(1).substring(0,10),mxUtils.bind(this,function(){window.location.href="https://app.diagrams.net/?desc="+b.substring(1)}));else if("R"==b.charAt(0)){this.spinner.stop();var G=decodeURIComponent(b.substring(1));"<"!=G.charAt(0)&&(G=Graph.decompress(G));G=new LocalFile(this,G,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);G.getHash=function(){return b};this.fileLoaded(G);null!=c&&c()}else if("E"==b.charAt(0))null==this.getCurrentFile()?this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile")):this.remoteInvoke("getDraftFileContent",null,null,mxUtils.bind(this,function(k,m){this.spinner.stop();this.fileLoaded(new EmbedFile(this,k,m));null!=c&&c()}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"))}));else if("U"==b.charAt(0)){var B=decodeURIComponent(b.substring(1)),d=mxUtils.bind(this,function(){if("https://drive.google.com/uc?id="!=B.substring(0,31)||null==this.drive&&"function"!==typeof window.DriveClient)return!1;this.hideDialog();var k=mxUtils.bind(this,function(){this.spinner.stop();if(null!=this.drive){var m=B.substring(31,B.lastIndexOf("&ex"));this.loadFile("G"+m,e,null,mxUtils.bind(this,function(){var t=this.getCurrentFile();null!=t&&this.editor.chromeless&&!this.editor.editable&&(t.getHash=-function(){return"G"+m},window.location.hash="#"+t.getHash());null!=c&&c()}));return!0}return!1});!k()&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.addListener("clientLoaded",k);return!0});this.loadTemplate(B,mxUtils.bind(this,function(k){this.spinner.stop();if(null!=k&&0<k.length){var m=this.defaultFilename;if(null==urlParams.title&&"1"!=urlParams.notitle){var t=B,y=B.lastIndexOf("."),A=t.lastIndexOf("/");y>A&&0<A&&(t=t.substring(A+1,y),y=B.substring(y),this.useCanvasForExport||+function(){return"G"+m},window.location.hash="#"+t.getHash());null!=c&&c()}));return!0}return!1});!k()&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.addListener("clientLoaded",k);return!0});this.loadTemplate(B,mxUtils.bind(this,function(k){this.spinner.stop();if(null!=k&&0<k.length){var m=this.defaultFilename;if(null==urlParams.title&&"1"!=urlParams.notitle){var t=B,y=B.lastIndexOf("."),z=t.lastIndexOf("/");y>z&&0<z&&(t=t.substring(z+1,y),y=B.substring(y),this.useCanvasForExport||".png"!=y||(y=".drawio"),".svg"===y||".xml"===y||".html"===y||".png"===y||".drawio"===y)&&(m=t+y)}k=new LocalFile(this,k,null!=urlParams.title?decodeURIComponent(urlParams.title):m,!0);k.getHash=function(){return b};this.fileLoaded(k,!0)?null!=c&&c():d()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}else d()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}),mxUtils.bind(this,function(){d()||(this.spinner.stop(),this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile")))}),null!=urlParams["template-filename"]?decodeURIComponent(urlParams["template-filename"]):null)}else{var g=this.getModeForChar(b.charAt(0));mxUtils.bind(this,function(){var k=this.getServiceForName(g);if(null==k)this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var t=this.getCurrentFile();window.location.hash=null!=-t?t.getHash():""}));else{var m=b.charAt(0);b=decodeURIComponent(b.substring(1));k.getFile(b,mxUtils.bind(this,function(t){this.spinner.stop();this.fileLoaded(t);var y=this.getCurrentFile();if(null==y)window.location.hash="",this.showSplash();else if(this.editor.chromeless&&!this.editor.editable){y.getHash=function(){return m+b};t="#"+y.getHash();try{var A=this.getHashObject();null==A||mxUtils.isEmptyObject(A)||(t=t+"#"+encodeURIComponent(JSON.stringify(A)))}catch(I){}window.location.replace(t)}else t==-y&&null==t.getMode()&&this.updateStatus(mxUtils.bind(this,function(){var I=mxResources.get("copyCreated");this.editor.setStatus('<div title="'+I+'" class="geStatusAlert">'+I+"</div>")}));null!=c&&c()}),mxUtils.bind(this,function(t){null!=window.console&&null!=t&&console.log("error in loadFile:",b,t);var y=mxUtils.bind(this,function(){var A=this.getCurrentFile();null==A?(window.location.hash="",this.showSplash()):window.location.hash="#"+A.getHash()});null==t||"AbortError"!=t.name?this.handleError(t,+t?t.getHash():""}));else{var m=b.charAt(0);b=decodeURIComponent(b.substring(1));k.getFile(b,mxUtils.bind(this,function(t){this.spinner.stop();this.fileLoaded(t);var y=this.getCurrentFile();if(null==y)window.location.hash="",this.showSplash();else if(this.editor.chromeless&&!this.editor.editable){y.getHash=function(){return m+b};t="#"+y.getHash();try{var z=this.getHashObject();null==z||mxUtils.isEmptyObject(z)||(t=t+"#"+encodeURIComponent(JSON.stringify(z)))}catch(I){}window.location.replace(t)}else t==+y&&null==t.getMode()&&this.updateStatus(mxUtils.bind(this,function(){var I=mxResources.get("copyCreated");this.editor.setStatus('<div title="'+I+'" class="geStatusAlert">'+I+"</div>")}));null!=c&&c()}),mxUtils.bind(this,function(t){null!=window.console&&null!=t&&console.log("error in loadFile:",b,t);var y=mxUtils.bind(this,function(){var z=this.getCurrentFile();null==z?(window.location.hash="",this.showSplash()):window.location.hash="#"+z.getHash()});null==t||"AbortError"!=t.name?this.handleError(t,null!=t?mxResources.get("errorLoadingFile"):null,y,null,null,"#"+m+b):y()}))}})()}}),q=this.getCurrentFile(),v=mxUtils.bind(this,function(){l||null==q||!q.isModified()?p():this.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){null!=q&&(window.location.hash=q.getHash())}),p,mxResources.get("cancel"),mxResources.get("discardChanges"))});null==b||0==b.length?v():null==q||e?v():this.showDialog((new PopupDialog(this,this.getUrl()+"#"+b,null,v)).container,340,140,!0,!0)};App.prototype.getLibraryStorageHint=function(b){var e=b.getTitle();b.constructor!=LocalLibrary&&(e+="\n"+b.getHash());b.constructor==DriveLibrary?e+=" ("+mxResources.get("googleDrive")+")":b.constructor==GitHubLibrary?e+=" ("+mxResources.get("github")+")":b.constructor==TrelloLibrary?e+=" ("+mxResources.get("trello")+")":b.constructor==DropboxLibrary?e+=" ("+mxResources.get("dropbox")+")":b.constructor==OneDriveLibrary?e+=" ("+mxResources.get("oneDrive")+")":b.constructor==StorageLibrary?e+=" ("+mxResources.get("browser")+")":b.constructor==LocalLibrary&&(e+=" ("+mxResources.get("device")+")");return e};App.prototype.restoreLibraries=function(){function b(f){for(var c=0;c<f.length;c++)""!=f[c]&&0>mxUtils.indexOf(e,f[c])&&e.push(f[c])}var e=[];b(mxSettings.getCustomLibraries());b((urlParams.clibs||"").split(";"));this.loadLibraries(e)};-App.prototype.loadLibraries=function(b,e){if(null!=this.sidebar){null==this.loadedLibraries&&(this.loadedLibraries={});var f=mxUtils.bind(this,function(G,B){B||mxSettings.removeCustomLibrary(G);delete this.loadedLibraries[G]}),c=0,l=[],p=0<b.length&&"L.scratchpad"==b[0]?1:0,q=mxUtils.bind(this,function(){if(0==c){if(null!=b)for(var G=b.length-1;0<=G;G--)null!=l[G]&&this.loadLibrary(l[G],G<=p);null!=e&&e()}});if(null!=b)for(var v=0;v<b.length;v++){var E=encodeURIComponent(decodeURIComponent(b[v]));-mxUtils.bind(this,function(G,B){if(null!=G&&0<G.length&&null==this.loadedLibraries[G]&&null==this.sidebar.palettes[G]){this.loadedLibraries[G]=!0;c++;var d=mxUtils.bind(this,function(A){l[B]=A;c--;q()}),g=mxUtils.bind(this,function(A){f(G,A);c--;q()}),k=G.substring(0,1);if("L"==k)(isLocalStorage||mxClient.IS_CHROMEAPP)&&window.setTimeout(mxUtils.bind(this,function(){try{var A=decodeURIComponent(G.substring(1));StorageFile.getFileContent(this,A,mxUtils.bind(this,function(I){".scratchpad"==A&&null==-I&&(I=this.emptyLibraryXml);null!=I?d(new StorageLibrary(this,I,A)):g()}),g)}catch(I){g()}}),0);else if("U"==k){var m=decodeURIComponent(G.substring(1));this.isOffline()?g(!0):this.loadTemplate(m,mxUtils.bind(this,function(A){null!=A&&0<A.length?d(new UrlLibrary(this,A,m)):g()}),function(){g()},null,!0)}else if("R"==k){k=decodeURIComponent(G.substring(1));try{k=JSON.parse(k);var t={id:k[0],title:k[1],downloadUrl:k[2]};this.remoteInvoke("getFileContent",[t.downloadUrl],null,mxUtils.bind(this,function(A){try{d(new RemoteLibrary(this,-A,t))}catch(I){g()}}),function(){g()})}catch(A){g()}}else if("S"==k&&null!=this.loadDesktopLib)try{this.loadDesktopLib(decodeURIComponent(G.substring(1)),function(A){d(A)},g)}catch(A){g()}else{var y=null;"G"==k?null!=this.drive&&null!=this.drive.user&&(y=this.drive):"H"==k?null!=this.gitHub&&null!=this.gitHub.getUser()&&(y=this.gitHub):"T"==k?null!=this.trello&&this.trello.isAuthorized()&&(y=this.trello):"D"==k?null!=this.dropbox&&null!=this.dropbox.getUser()&&(y=this.dropbox):"W"==k&&null!=this.oneDrive&&-null!=this.oneDrive.getUser()&&(y=this.oneDrive);null!=y?y.getLibrary(decodeURIComponent(G.substring(1)),mxUtils.bind(this,function(A){try{d(A)}catch(I){g()}}),function(A){g()}):g(!0)}}})(E,v)}q()}};+App.prototype.loadLibraries=function(b,e){if(null!=this.sidebar){null==this.loadedLibraries&&(this.loadedLibraries={});var f=mxUtils.bind(this,function(G,B){B||mxSettings.removeCustomLibrary(G);delete this.loadedLibraries[G]}),c=0,l=[],p=0<b.length&&"L.scratchpad"==b[0]?1:0,q=mxUtils.bind(this,function(){if(0==c){if(null!=b)for(var G=b.length-1;0<=G;G--)null!=l[G]&&this.loadLibrary(l[G],G<=p);null!=e&&e()}});if(null!=b)for(var v=0;v<b.length;v++){var D=encodeURIComponent(decodeURIComponent(b[v]));+mxUtils.bind(this,function(G,B){if(null!=G&&0<G.length&&null==this.loadedLibraries[G]&&null==this.sidebar.palettes[G]){this.loadedLibraries[G]=!0;c++;var d=mxUtils.bind(this,function(z){l[B]=z;c--;q()}),g=mxUtils.bind(this,function(z){f(G,z);c--;q()}),k=G.substring(0,1);if("L"==k)(isLocalStorage||mxClient.IS_CHROMEAPP)&&window.setTimeout(mxUtils.bind(this,function(){try{var z=decodeURIComponent(G.substring(1));StorageFile.getFileContent(this,z,mxUtils.bind(this,function(I){".scratchpad"==z&&null==+I&&(I=this.emptyLibraryXml);null!=I?d(new StorageLibrary(this,I,z)):g()}),g)}catch(I){g()}}),0);else if("U"==k){var m=decodeURIComponent(G.substring(1));this.isOffline()?g(!0):this.loadTemplate(m,mxUtils.bind(this,function(z){null!=z&&0<z.length?d(new UrlLibrary(this,z,m)):g()}),function(){g()},null,!0)}else if("R"==k){k=decodeURIComponent(G.substring(1));try{k=JSON.parse(k);var t={id:k[0],title:k[1],downloadUrl:k[2]};this.remoteInvoke("getFileContent",[t.downloadUrl],null,mxUtils.bind(this,function(z){try{d(new RemoteLibrary(this,+z,t))}catch(I){g()}}),function(){g()})}catch(z){g()}}else if("S"==k&&null!=this.loadDesktopLib)try{this.loadDesktopLib(decodeURIComponent(G.substring(1)),function(z){d(z)},g)}catch(z){g()}else{var y=null;"G"==k?null!=this.drive&&null!=this.drive.user&&(y=this.drive):"H"==k?null!=this.gitHub&&null!=this.gitHub.getUser()&&(y=this.gitHub):"T"==k?null!=this.trello&&this.trello.isAuthorized()&&(y=this.trello):"D"==k?null!=this.dropbox&&null!=this.dropbox.getUser()&&(y=this.dropbox):"W"==k&&null!=this.oneDrive&&+null!=this.oneDrive.getUser()&&(y=this.oneDrive);null!=y?y.getLibrary(decodeURIComponent(G.substring(1)),mxUtils.bind(this,function(z){try{d(z)}catch(I){g()}}),function(z){g()}):g(!0)}}})(D,v)}q()}};App.prototype.updateButtonContainer=function(){if(null!=this.buttonContainer)if(null!=urlParams.notif?this.fetchAndShowNotification(urlParams.notif):"1"!=urlParams.extAuth&&"atlas"!=Editor.currentTheme&&this.fetchAndShowNotification("online",this.mode),this.isStandaloneApp()||"simple"==Editor.currentTheme&&"1"!=urlParams.embed)this.buttonContainer.style.display="none",null!=this.notificationBtn&&this.notificationBtn.parentNode!=this.sketchMenubarElt&&this.sketchMenubarElt.appendChild(this.notificationBtn);else{this.buttonContainer.style.display="";var b=this.getCurrentFile();null!=this.notificationBtn&&this.notificationBtn.parentNode!=this.buttonContainer&&this.buttonContainer.appendChild(this.notificationBtn);"sketch"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&(null==this.commentButton&&(this.commentButton=document.createElement("a"),this.setElementTitle(this.commentButton,"comments"),this.commentButton.className="geButton geRoundButton",this.commentButton.style.backgroundImage="url("+Editor.commentImage+")",mxEvent.addListener(this.commentButton,"click",mxUtils.bind(this,function(){this.actions.get("comments").funct()})),this.buttonContainer.appendChild(this.commentButton)),this.commentButton.style.display=this.commentsSupported()?"":"none");if(null==this.shareButton){this.shareButton=document.createElement("button");this.shareButton.className="geBtn gePrimaryBtn";var e=document.createElement("div");e.className="geButton";e.style.backgroundImage="url("+Editor.groupImage+")";this.shareButton.appendChild(e);this.dependsOnLanguage(mxUtils.bind(this,function(){e.innerHTML="";mxUtils.write(e,mxResources.get("share"));this.shareButton.setAttribute("title",mxResources.get("share"))}));mxEvent.addListener(this.shareButton,"click",mxUtils.bind(this,function(){this.actions.get("share").funct()}));this.buttonContainer.appendChild(this.shareButton)}this.shareButton.style.display=null!=b&&"kennedy"==Editor.currentTheme&&"1"!=urlParams.embed?"":"none";if("simple"!=Editor.currentTheme){if(null==this.userButton){this.userButton=-document.createElement("a");this.userButton.className="geButton geRoundButton";var f=document.createElement("img");this.userButton.appendChild(f);mxEvent.addListener(this.userButton,"click",mxUtils.bind(this,function(v){this.toggleUserPanel();var E=this.userButton.getBoundingClientRect(),G=window.innerWidth||document.documentElement.clientWidth;this.userPanel.style.top=E.bottom+"px";this.userPanel.style.right=G-E.right+"px";mxEvent.consume(v)}));var c=document.createElement("img");c.style.position=+document.createElement("a");this.userButton.className="geButton geRoundButton";var f=document.createElement("img");this.userButton.appendChild(f);mxEvent.addListener(this.userButton,"click",mxUtils.bind(this,function(v){this.toggleUserPanel();var D=this.userButton.getBoundingClientRect(),G=window.innerWidth||document.documentElement.clientWidth;this.userPanel.style.top=D.bottom+"px";this.userPanel.style.right=G-D.right+"px";mxEvent.consume(v)}));var c=document.createElement("img");c.style.position="absolute";c.style.width="10px";this.userButton.appendChild(c);this.buttonContainer.appendChild(this.userButton)}if(!this.unloading){f=this.userButton.getElementsByTagName("img")[0];c=this.userButton.getElementsByTagName("img")[1];var l=mxResources.get("changeUser"),p=this.getMainUser();null!=p&&null!=p.displayName&&(l=p.displayName);null!=p&&null!=p.pictureUrl?(f.classList.remove("geAdaptiveAsset"),f.src=p.pictureUrl,c.style.top="3px",c.style.right="0"):(f.classList.add("geAdaptiveAsset"),f.src=Editor.userImage,c.style.top="6px",c.style.right="4px");if(null!=b&&b.isRealtimeEnabled()&&b.isRealtimeSupported()){c.style.display="";f=b.getRealtimeError();var q=b.getRealtimeState();l+=" (";1==q?(c.src=Editor.syncImage,l+=mxResources.get("online")):(c.src=Editor.syncProblemImage,l=null!=f&&null!=f.message?l+f.message:l+mxResources.get("disconnected"));l+=")"}else c.style.display="none",c.src=Editor.cloudImage;this.userButton.setAttribute("title",l);this.userButton.style.display="draw.io"!=this.getServiceName()||null==p||"1"==urlParams.embed||this.isStandaloneApp()||null==b?"none":""}}}};-App.prototype.fetchAndShowNotification=function(b,e){if(!this.fetchingNotif){b=b||"online";var f=null,c=mxUtils.bind(this,function(l){l=l.filter(function(E){return!E.targets||-1<E.targets.indexOf(b)||null!=e&&-1<E.targets.indexOf(e)});for(var p=b+"NotifReadTS",q=isLocalStorage?parseInt(localStorage.getItem(p)):!0,v=0;v<l.length;v++)l[v].isNew=!q||l[v].timestamp>q;this.showNotification(l,p)});try{isLocalStorage&&(f=JSON.parse(localStorage.getItem(".notifCache")))}catch(l){}null==f||f.ts+864E5<Date.now()?+App.prototype.fetchAndShowNotification=function(b,e){if(!this.fetchingNotif){b=b||"online";var f=null,c=mxUtils.bind(this,function(l){l=l.filter(function(D){return!D.targets||-1<D.targets.indexOf(b)||null!=e&&-1<D.targets.indexOf(e)});for(var p=b+"NotifReadTS",q=isLocalStorage?parseInt(localStorage.getItem(p)):!0,v=0;v<l.length;v++)l[v].isNew=!q||l[v].timestamp>q;this.showNotification(l,p)});try{isLocalStorage&&(f=JSON.parse(localStorage.getItem(".notifCache")))}catch(l){}null==f||f.ts+864E5<Date.now()?(this.fetchingNotif=!0,mxUtils.get(NOTIFICATIONS_URL,mxUtils.bind(this,function(l){if(200<=l.getStatus()&&299>=l.getStatus())try{var p=JSON.parse(l.getText());p.sort(function(q,v){return v.timestamp-q.timestamp});isLocalStorage&&localStorage.setItem(".notifCache",JSON.stringify({ts:Date.now(),notifs:p}));this.fetchingNotif=!1;c(p)}catch(q){}}))):c(f.notifs)}};App.prototype.showNotification=function(b,e){function f(G){var B=document.querySelector(".geNotification-count");null!=B&&(B.innerHTML=G,B.style.display=0==G?"none":"",B=document.querySelector(".geNotification-bell"),B.style.animation=0==G?"none":"",B.className="geNotification-bell"+(0==G?" geNotification-bellOff":""),document.querySelector(".geBell-rad").style.animation=0==G?"none":"")}var c=b.length;if("min"==Editor.currentTheme||"simple"==Editor.currentTheme)for(var l=c=0;l<b.length;l++)b[l].isNew&&c++;if(0==c)null!=this.notificationBtn&&(this.notificationBtn.style.display="none",this.editor.fireEvent(new mxEventObject("statusChanged")));else{var p=mxUtils.bind(this,function(){this.notificationWin.style.display="none";for(var G=this.notificationWin.querySelectorAll(".circle.active"),B=0;B<G.length;B++)G[B].className="circle";isLocalStorage&&b[0]&&localStorage.setItem(e,b[0].timestamp)});if(null==this.notificationBtn){this.notificationBtn=document.createElement("div");this.notificationBtn.className="geNotification-box";c=document.createElement("span");c.className="geNotification-count";this.notificationBtn.appendChild(c);this.notifCount=c;c=document.createElement("div");c.className="geNotification-bell";l=document.createElement("span");l.className="geBell-top";c.appendChild(l);l=document.createElement("span");l.className="geBell-middle";c.appendChild(l);l=document.createElement("span");l.className="geBell-bottom";c.appendChild(l);l=document.createElement("span");l.className="geBell-rad";c.appendChild(l);this.notificationBtn.appendChild(c);this.notificationWin=document.createElement("div");this.notificationWin.className="geNotifPanel";this.notificationWin.style.display="none";document.body.appendChild(this.notificationWin);l=document.createElement("div");l.className="header";c=document.createElement("span");c.className="title";c.textContent=mxResources.get("notifications");l.appendChild(c);c=document.createElement("span");c.className="closeBtn";c.textContent="x";l.appendChild(c);this.notificationWin.appendChild(l);l=document.createElement("div");l.className="notifications clearfix";var q=document.createElement("div");q.setAttribute("id","geNotifList");q.style.position="relative";l.appendChild(q);this.notificationWin.appendChild(l);mxEvent.addListener(this.notificationBtn,"click",mxUtils.bind(this,function(){if("none"==this.notificationWin.style.display){this.notificationWin.style.display="";document.querySelector(".notifications").scrollTop=0;var G=this.notificationBtn.getBoundingClientRect();this.notificationWin.style.top=-G.top+this.notificationBtn.clientHeight+"px";this.notificationWin.style.left=G.right-this.notificationWin.clientWidth+"px";f(0)}else p()}));mxEvent.addListener(c,"click",p)}else this.notificationBtn.style.display="";var v=0,E=document.getElementById("geNotifList");if(null!=E){E.innerHTML='<div class="line"></div>';for(l=0;l<b.length;l++)(function(G,B){B.isNew&&v++;var d=document.createElement("div");d.className="notification";G=G.timeSince(new Date(B.timestamp));null==G&&(G=mxResources.get("lessThanAMinute"));-d.innerHTML='<div class="circle'+(B.isNew?" active":"")+'"></div><span class="time">'+mxUtils.htmlEntities(mxResources.get("timeAgo",[G],"{1} ago"))+"</span><p>"+mxUtils.htmlEntities(B.content)+"</p>";B.link&&mxEvent.addListener(d,"click",function(){window.open(B.link,"notifWin")});E.appendChild(d)})(this,b[l]);f(v)}}};-App.prototype.save=function(b,e){var f=this.getCurrentFile(),c=!0,l=mxUtils.bind(this,function(){c&&(c=!1,f.handleFileSuccess(!0),null!=e&&e())}),p=mxUtils.bind(this,function(q){if(c){c=!1;Editor.addRetryToError(q,mxUtils.bind(this,function(){this.save(b,e)}));if(null!=q&&null!=q.retry){var v=q.retry;q.retry=function(){c=!0;try{f.isModified()?v():l()}catch(E){p(E)}}}f.handleFileError(q,null==q||"AbortError"!=q.name)}});if(null!=f&&this.spinner.spin(document.body,mxResources.get("saving"),p,3*this.timeout))try{this.clearStatus(),+G.top+this.notificationBtn.clientHeight+"px";this.notificationWin.style.left=G.right-this.notificationWin.clientWidth+"px";f(0)}else p()}));mxEvent.addListener(c,"click",p)}else this.notificationBtn.style.display="";var v=0,D=document.getElementById("geNotifList");if(null!=D){D.innerHTML='<div class="line"></div>';for(l=0;l<b.length;l++)(function(G,B){B.isNew&&v++;var d=document.createElement("div");d.className="notification";G=G.timeSince(new Date(B.timestamp));null==G&&(G=mxResources.get("lessThanAMinute"));+d.innerHTML='<div class="circle'+(B.isNew?" active":"")+'"></div><span class="time">'+mxUtils.htmlEntities(mxResources.get("timeAgo",[G],"{1} ago"))+"</span><p>"+mxUtils.htmlEntities(B.content)+"</p>";B.link&&mxEvent.addListener(d,"click",function(){window.open(B.link,"notifWin")});D.appendChild(d)})(this,b[l]);f(v)}}};+App.prototype.save=function(b,e){var f=this.getCurrentFile(),c=!0,l=mxUtils.bind(this,function(){c&&(c=!1,f.handleFileSuccess(!0),null!=e&&e())}),p=mxUtils.bind(this,function(q){if(c){c=!1;Editor.addRetryToError(q,mxUtils.bind(this,function(){this.save(b,e)}));if(null!=q&&null!=q.retry){var v=q.retry;q.retry=function(){c=!0;try{f.isModified()?v():l()}catch(D){p(D)}}}f.handleFileError(q,null==q||"AbortError"!=q.name)}});if(null!=f&&this.spinner.spin(document.body,mxResources.get("saving"),p,3*this.timeout))try{this.clearStatus(),this.editor.graph.isEditing()&&this.editor.graph.stopEditing(),b==f.getTitle()?f.save(!0,l,p):f.saveAs(b,l,p)}catch(q){p(q)}};App.prototype.getExtensionForService=function(b){b=this.getServiceForName(b);return null!=b?b.extension:".drawio"};App.prototype.getServiceForName=function(b){return b==App.MODE_GOOGLE?this.drive:b==App.MODE_ONEDRIVE?this.oneDrive:b==App.MODE_DROPBOX?this.dropbox:b==App.MODE_GITHUB?this.gitHub:b==App.MODE_GITLAB?this.gitLab:b==App.MODE_TRELLO?this.trello:null};App.prototype.getTitleForService=function(b){return b==App.MODE_GOOGLE?mxResources.get("googleDrive"):b==App.MODE_ONEDRIVE?mxResources.get("oneDrive"):EditorUi.prototype.getTitleForService.apply(this,arguments)};-App.prototype.pickFolder=function(b,e,f,c,l,p){f=null!=f?f:!0;var q=this.spinner.pause();f&&b==App.MODE_GOOGLE&&null!=this.drive?this.drive.pickFolder(mxUtils.bind(this,function(v){q();if(v.action==google.picker.Action.PICKED){var E=null;null!=v.docs&&0<v.docs.length&&"folder"==v.docs[0].type&&(E=v.docs[0].id);e(p?v:E)}}),l):f&&b==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.pickFolder(mxUtils.bind(this,function(v){q();if(null!=v&&null!=v.value&&0<v.value.length){var E=OneDriveFile.prototype.getIdOf(v.value[0]);-e(p?v:E)}}),c):f&&b==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.pickFolder(mxUtils.bind(this,function(v){q();e(v)})):f&&b==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.pickFolder(mxUtils.bind(this,function(v){q();e(v)})):f&&b==App.MODE_TRELLO&&null!=this.trello?this.trello.pickFolder(mxUtils.bind(this,function(v){q();e(v)})):EditorUi.prototype.pickFolder.apply(this,arguments)};+App.prototype.pickFolder=function(b,e,f,c,l,p){f=null!=f?f:!0;this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);var q=this.spinner.pause();f&&b==App.MODE_GOOGLE&&null!=this.drive?this.drive.pickFolder(mxUtils.bind(this,function(v){q();if(v.action==google.picker.Action.PICKED){var D=null;null!=v.docs&&0<v.docs.length&&"folder"==v.docs[0].type&&(D=v.docs[0].id);e(p?v:D)}}),l):f&&b==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.pickFolder(mxUtils.bind(this,function(v){q();+if(null!=v&&null!=v.value&&0<v.value.length){var D=OneDriveFile.prototype.getIdOf(v.value[0]);e(p?v:D)}}),c):f&&b==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.pickFolder(mxUtils.bind(this,function(v){q();e(v)})):f&&b==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.pickFolder(mxUtils.bind(this,function(v){q();e(v)})):f&&b==App.MODE_TRELLO&&null!=this.trello?this.trello.pickFolder(mxUtils.bind(this,function(v){q();e(v)})):EditorUi.prototype.pickFolder.apply(this,arguments)};App.prototype.exportFile=function(b,e,f,c,l,p){l==App.MODE_DROPBOX?null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.dropbox.insertFile(e,c?this.base64ToBlob(b,f):b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(q){this.spinner.stop();this.handleError(q)})):l==App.MODE_GOOGLE?null!=this.drive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.drive.insertFile(e,b,p,mxUtils.bind(this,function(q){this.spinner.stop()}),mxUtils.bind(this,function(q){this.spinner.stop();this.handleError(q)}),f,c):l==App.MODE_ONEDRIVE?null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.oneDrive.insertFile(e,c?this.base64ToBlob(b,f):b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(q){this.spinner.stop();this.handleError(q)}),!1,p):l==App.MODE_GITHUB?null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.gitHub.insertFile(e,b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(q){this.spinner.stop();this.handleError(q)}),!0,p,c):l==App.MODE_GITLAB?null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.gitLab.insertFile(e,b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(q){this.spinner.stop();this.handleError(q)}),!0,p,c):l==App.MODE_TRELLO?null!=this.trello&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.trello.insertFile(e,c?this.base64ToBlob(b,@@ -14159,9 +14163,9 @@ function(){localStorage.setItem(e,b)}),null==localStorage.getItem(e)?f():this.coApp.prototype.descriptorChanged=function(){var b=this.getCurrentFile();if(null!=b){if(null!=this.fname){this.fname.innerText="";var e=null!=b.getTitle()?b.getTitle():this.defaultFilename;mxUtils.write(this.fname,e)}e=this.editor.graph;var f=b.isEditable();e.isEnabled()&&!f&&e.reset();e.setEnabled(f);null==urlParams.rev&&(this.updateDocumentTitle(),e=b.getHash(),0<e.length?(e!=this.getDiagramId()&&(window.location.hash=e),this.updateHashObject()):0<window.location.hash.length&&(window.location.hash=""))}this.updateUi();null==this.format||null!=b&&this.fileEditable==b.isEditable()||!this.editor.graph.isSelectionEmpty()||(this.format.refresh(),this.fileEditable=null!=b?b.isEditable():null);this.fireEvent(new mxEventObject("fileDescriptorChanged","file",b))};App.prototype.showAuthDialog=function(b,e,f,c){var l=this.spinner.pause();this.showDialog((new AuthDialog(this,b,e,mxUtils.bind(this,function(p){try{null!=f&&f(p,mxUtils.bind(this,function(){this.hideDialog();l()}))}catch(q){this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(q.message))}))}}))).container,300,e?180:140,!0,!0,mxUtils.bind(this,function(p){null!=c&&c(p);p&&null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))};-App.prototype.convertFile=function(b,e,f,c,l,p,q,v){var E=e;/\.svg$/i.test(E)||(E=E.substring(0,e.lastIndexOf("."))+c);var G=!1;null!=this.gitHub&&b.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(G=!0);if(/\.v(dx|sdx?)$/i.test(e)&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var B=new XMLHttpRequest;B.open("GET",b,!0);G||(B.responseType="blob");if(v)for(var d in v)B.setRequestHeader(d,v[d]);B.onload=mxUtils.bind(this,function(){if(200<=-B.status&&299>=B.status){var k=null;G?(k=JSON.parse(B.responseText),k=this.base64ToBlob(k.content,"application/octet-stream")):k=new Blob([B.response],{type:"application/octet-stream"});this.importVisio(k,mxUtils.bind(this,function(m){l(new LocalFile(this,m,E,!0))}),p,e)}else null!=p&&p({message:mxResources.get("errorLoadingFile")})});B.onerror=p;B.send()}else{var g=mxUtils.bind(this,function(k){try{if(/\.pdf$/i.test(e)){var m=Editor.extractGraphModelFromPdf(k);null!=m&&0<m.length&&l(new LocalFile(this,-m,E,!0))}else/\.png$/i.test(e)?(m=this.extractGraphModelFromPng(k),null!=m?l(new LocalFile(this,m,E,!0)):l(new LocalFile(this,k,e,!0))):Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(k,b)?this.parseFileData(k,mxUtils.bind(this,function(t){4==t.readyState&&(200<=t.status&&299>=t.status?l(new LocalFile(this,t.responseText,E,!0)):null!=p&&p({message:mxResources.get("errorLoadingFile")}))}),e):l(new LocalFile(this,k,E,!0))}catch(t){null!=p&&p(t)}});f=/\.png$/i.test(e)||/\.jpe?g$/i.test(e)||+App.prototype.convertFile=function(b,e,f,c,l,p,q,v){var D=e;/\.svg$/i.test(D)||(D=D.substring(0,e.lastIndexOf("."))+c);var G=!1;null!=this.gitHub&&b.substring(0,this.gitHub.baseUrl.length)==this.gitHub.baseUrl&&(G=!0);if(/\.v(dx|sdx?)$/i.test(e)&&Graph.fileSupport&&(new XMLHttpRequest).upload&&"string"===typeof(new XMLHttpRequest).responseType){var B=new XMLHttpRequest;B.open("GET",b,!0);G||(B.responseType="blob");if(v)for(var d in v)B.setRequestHeader(d,v[d]);B.onload=mxUtils.bind(this,function(){if(200<=+B.status&&299>=B.status){var k=null;G?(k=JSON.parse(B.responseText),k=this.base64ToBlob(k.content,"application/octet-stream")):k=new Blob([B.response],{type:"application/octet-stream"});this.importVisio(k,mxUtils.bind(this,function(m){l(new LocalFile(this,m,D,!0))}),p,e)}else null!=p&&p({message:mxResources.get("errorLoadingFile")})});B.onerror=p;B.send()}else{var g=mxUtils.bind(this,function(k){try{if(/\.pdf$/i.test(e)){var m=Editor.extractGraphModelFromPdf(k);null!=m&&0<m.length&&l(new LocalFile(this,+m,D,!0))}else/\.png$/i.test(e)?(m=this.extractGraphModelFromPng(k),null!=m?l(new LocalFile(this,m,D,!0)):l(new LocalFile(this,k,e,!0))):Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(k,b)?this.parseFileData(k,mxUtils.bind(this,function(t){4==t.readyState&&(200<=t.status&&299>=t.status?l(new LocalFile(this,t.responseText,D,!0)):null!=p&&p({message:mxResources.get("errorLoadingFile")}))}),e):l(new LocalFile(this,k,D,!0))}catch(t){null!=p&&p(t)}});f=/\.png$/i.test(e)||/\.jpe?g$/i.test(e)||/\.pdf$/i.test(e)||null!=f&&"image/"==f.substring(0,6);G?mxUtils.get(b,mxUtils.bind(this,function(k){if(200<=k.getStatus()&&299>=k.getStatus()){if(null!=l){k=JSON.parse(k.getText());var m=k.content;"base64"===k.encoding&&(m=/\.png$/i.test(e)?"data:image/png;base64,"+m:/\.pdf$/i.test(e)?"data:application/pdf;base64,"+m:!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(m):atob(m));g(m)}}else null!=p&&p({code:App.ERROR_UNKNOWN})}),function(){null!=p&&p({code:App.ERROR_UNKNOWN})},!1,this.timeout,function(){null!=p&&p({code:App.ERROR_TIMEOUT,retry:fn})},v):null!=q?q(b,g,p,f):this.editor.loadUrl(b,g,p,f,null,null,null,v)}};App.prototype.updateHeader=function(){if(null!=this.menubar){var b="url("+Editor.logoImage+")";this.appIcon=document.createElement("a");this.appIcon.className="geAppIcon";this.appIcon.style.backgroundImage=b;mxEvent.disableContextMenu(this.appIcon);mxEvent.addListener(this.appIcon,"click",mxUtils.bind(this,function(q){this.appIconClicked(q)}));mxEvent.addListener(this.appIcon,"mouseover",mxUtils.bind(this,function(){var q=this.getCurrentFile();null!=q&&(q=q.getMode(),q==App.MODE_GOOGLE?(this.appIcon.style.backgroundImage=@@ -14178,16 +14182,16 @@ function(){mxUtils.setPrefixedStyle(this.menubarContainer.style,"transition",nulApp.prototype.getMainUser=function(){var b=null;null!=this.drive&&null!=this.drive.getUser()?b=this.drive.getUser():null!=this.oneDrive&&null!=this.oneDrive.getUser()?b=this.oneDrive.getUser():null!=this.dropbox&&null!=this.dropbox.getUser()?b=this.dropbox.getUser():null!=this.gitHub&&null!=this.gitHub.getUser()?b=this.gitHub.getUser():null!=this.gitLab&&null!=this.gitLab.getUser()&&(b=this.gitLab.getUser());return b};App.prototype.hideUserPanel=function(){null!=this.userPanel&&null!=this.userPanel.parentNode&&this.userPanel.parentNode.removeChild(this.userPanel)};App.prototype.toggleUserPanel=function(){if(null==this.userPanel){var b=document.createElement("div");b.className="geDialog geInlineDialog";b.style.minWidth="300px";this.userPanel=b;mxEvent.addListener(document.body,"click",mxUtils.bind(this,function(q){mxEvent.isConsumed(q)||this.hideUserPanel()}))}if(null!=this.userPanel.parentNode)this.userPanel.parentNode.removeChild(this.userPanel);else{var e=!1;this.userPanel.innerText="";b=document.createElement("div");b.className="geButton";b.setAttribute("title",-mxResources.get("close"));b.style.backgroundImage="url("+Editor.crossImage+")";b.style.position="absolute";b.style.right="0px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideUserPanel()}));this.userPanel.appendChild(b);if(null!=this.drive){var f=this.drive.getUsersList();if(0<f.length){var c=mxUtils.bind(this,function(q,v){var E=this.getCurrentFile();null!=E&&E.constructor==DriveFile?(this.spinner.spin(document.body,v),this.fileLoaded(null),window.setTimeout(mxUtils.bind(this,-function(){this.spinner.stop();q()}),2E3)):q()});b=mxUtils.bind(this,function(q){var v=document.createElement("tr"),E=document.createElement("td");E.setAttribute("valig","middle");E.style.height="59px";E.style.width="66px";var G=document.createElement("img");G.setAttribute("width","50");G.setAttribute("height","50");G.setAttribute("border","0");G.setAttribute("src",null!=q.pictureUrl?q.pictureUrl:Editor.userImage);G.style.borderRadius="50%";G.style.margin="4px 8px 0 8px";E.appendChild(G);v.appendChild(E);-E=document.createElement("td");E.setAttribute("valign","middle");E.style.whiteSpace="nowrap";E.style.paddingTop="4px";E.style.maxWidth="0";E.style.overflow="hidden";E.style.textOverflow="ellipsis";mxUtils.write(E,q.displayName+(q.isCurrent&&1<f.length?" ("+mxResources.get("default")+")":""));null!=q.email&&(mxUtils.br(E),G=document.createElement("small"),G.style.color="gray",mxUtils.write(G,q.email),E.appendChild(G));G=document.createElement("div");G.style.marginTop="4px";var B=document.createElement("i");-mxUtils.write(B,mxResources.get("googleDrive"));G.appendChild(B);E.appendChild(G);v.appendChild(E);q.isCurrent?v.setAttribute("title","User ID: "+q.id):(v.setAttribute("title",mxResources.get("login")+" (User ID: "+q.id+")"),v.style.cursor="pointer",v.style.opacity="0.3",mxEvent.addListener(v,"mouseenter",mxUtils.bind(this,function(){v.style.opacity="1"})),mxEvent.addListener(v,"mouseleave",mxUtils.bind(this,function(){v.style.opacity="0.3"})),mxEvent.addListener(v,"click",mxUtils.bind(this,function(d){this.hideUserPanel();+mxResources.get("close"));b.style.backgroundImage="url("+Editor.crossImage+")";b.style.position="absolute";b.style.right="0px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideUserPanel()}));this.userPanel.appendChild(b);if(null!=this.drive){var f=this.drive.getUsersList();if(0<f.length){var c=mxUtils.bind(this,function(q,v){var D=this.getCurrentFile();null!=D&&D.constructor==DriveFile?(this.spinner.spin(document.body,v),this.fileLoaded(null),window.setTimeout(mxUtils.bind(this,+function(){this.spinner.stop();q()}),2E3)):q()});b=mxUtils.bind(this,function(q){var v=document.createElement("tr"),D=document.createElement("td");D.setAttribute("valig","middle");D.style.height="59px";D.style.width="66px";var G=document.createElement("img");G.setAttribute("width","50");G.setAttribute("height","50");G.setAttribute("border","0");G.setAttribute("src",null!=q.pictureUrl?q.pictureUrl:Editor.userImage);G.style.borderRadius="50%";G.style.margin="4px 8px 0 8px";D.appendChild(G);v.appendChild(D);+D=document.createElement("td");D.setAttribute("valign","middle");D.style.whiteSpace="nowrap";D.style.paddingTop="4px";D.style.maxWidth="0";D.style.overflow="hidden";D.style.textOverflow="ellipsis";mxUtils.write(D,q.displayName+(q.isCurrent&&1<f.length?" ("+mxResources.get("default")+")":""));null!=q.email&&(mxUtils.br(D),G=document.createElement("small"),G.style.color="gray",mxUtils.write(G,q.email),D.appendChild(G));G=document.createElement("div");G.style.marginTop="4px";var B=document.createElement("i");+mxUtils.write(B,mxResources.get("googleDrive"));G.appendChild(B);D.appendChild(G);v.appendChild(D);q.isCurrent?v.setAttribute("title","User ID: "+q.id):(v.setAttribute("title",mxResources.get("login")+" (User ID: "+q.id+")"),v.style.cursor="pointer",v.style.opacity="0.3",mxEvent.addListener(v,"mouseenter",mxUtils.bind(this,function(){v.style.opacity="1"})),mxEvent.addListener(v,"mouseleave",mxUtils.bind(this,function(){v.style.opacity="0.3"})),mxEvent.addListener(v,"click",mxUtils.bind(this,function(d){this.hideUserPanel();c(mxUtils.bind(this,function(){this.stateArg=null;this.drive.setUser(q);this.drive.authorize(!0,mxUtils.bind(this,function(){this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxUtils.bind(this,function(g){this.handleError(g)}),!0)}),mxResources.get("changeUser")+"...");mxEvent.consume(d)})));return v});e=!0;var l=document.createElement("table");l.style.borderSpacing="0";l.style.fontSize="10pt";l.style.width="100%";l.style.padding="10px";for(var p=0;p<f.length;p++)l.appendChild(b(f[p]));this.userPanel.appendChild(l);b=document.createElement("div");b.style.textAlign="left";b.style.padding="10px";b.style.whiteSpace="nowrap";b.style.borderTopStyle="solid";b.style.borderTopWidth="1px";l=mxUtils.button(mxResources.get("signOut"),mxUtils.bind(this,function(){this.confirm(mxResources.get("areYouSure"),mxUtils.bind(this,function(){c(mxUtils.bind(this,function(){this.stateArg=null;this.drive.logout();this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxResources.get("signOut"))}))}));l.className="geBtn";l.style.float="right";b.appendChild(l);l=mxUtils.button(mxResources.get("addAccount"),mxUtils.bind(this,function(){var q=this.drive.createAuthWin();q.blur();window.focus();c(mxUtils.bind(this,function(){this.stateArg=null;this.drive.authorize(!1,mxUtils.bind(this,function(){this.setMode(App.MODE_GOOGLE);this.hideDialog();this.showSplash()}),mxUtils.bind(this,function(v){this.handleError(v)}),!0,q)}),mxResources.get("closingFile")+"...")}));l.className="geBtn";l.style.margin="0px";-b.appendChild(l);this.userPanel.appendChild(b)}}b=mxUtils.bind(this,function(q,v,E,G){if(null!=q){e&&this.userPanel.appendChild(document.createElement("hr"));e=!0;var B=document.createElement("table");B.style.borderSpacing="0";B.style.fontSize="10pt";B.style.width="100%";B.style.padding="10px";var d=document.createElement("tbody"),g=document.createElement("tr"),k=document.createElement("td");k.setAttribute("valig","top");k.style.width="40px";if(null!=v){var m=document.createElement("img");m.setAttribute("width",+b.appendChild(l);this.userPanel.appendChild(b)}}b=mxUtils.bind(this,function(q,v,D,G){if(null!=q){e&&this.userPanel.appendChild(document.createElement("hr"));e=!0;var B=document.createElement("table");B.style.borderSpacing="0";B.style.fontSize="10pt";B.style.width="100%";B.style.padding="10px";var d=document.createElement("tbody"),g=document.createElement("tr"),k=document.createElement("td");k.setAttribute("valig","top");k.style.width="40px";if(null!=v){var m=document.createElement("img");m.setAttribute("width","40");m.setAttribute("height","40");m.setAttribute("border","0");m.setAttribute("src",v);m.style.marginRight="6px";k.appendChild(m)}g.appendChild(k);k=document.createElement("td");k.setAttribute("valign","middle");k.style.whiteSpace="nowrap";k.style.maxWidth="0";k.style.overflow="hidden";k.style.textOverflow="ellipsis";mxUtils.write(k,q.displayName);null!=q.email&&(mxUtils.br(k),v=document.createElement("small"),v.style.color="gray",mxUtils.write(v,q.email),k.appendChild(v));null!=G&&(q=document.createElement("div"),-q.style.marginTop="4px",v=document.createElement("i"),mxUtils.write(v,G),q.appendChild(v),k.appendChild(q));g.appendChild(k);d.appendChild(g);B.appendChild(d);this.userPanel.appendChild(B);q=document.createElement("div");q.style.textAlign="center";q.style.padding="10px";q.style.whiteSpace="nowrap";null!=E&&(E=mxUtils.button(mxResources.get("signOut"),E),E.className="geBtn",q.appendChild(E));this.userPanel.appendChild(q)}});null!=this.dropbox&&b(this.dropbox.getUser(),IMAGE_PATH+"/dropbox-logo.svg",+q.style.marginTop="4px",v=document.createElement("i"),mxUtils.write(v,G),q.appendChild(v),k.appendChild(q));g.appendChild(k);d.appendChild(g);B.appendChild(d);this.userPanel.appendChild(B);q=document.createElement("div");q.style.textAlign="center";q.style.padding="10px";q.style.whiteSpace="nowrap";null!=D&&(D=mxUtils.button(mxResources.get("signOut"),D),D.className="geBtn",q.appendChild(D));this.userPanel.appendChild(q)}});null!=this.dropbox&&b(this.dropbox.getUser(),IMAGE_PATH+"/dropbox-logo.svg",mxUtils.bind(this,function(){var q=this.getCurrentFile();if(null!=q&&q.constructor==DropboxFile){var v=mxUtils.bind(this,function(){this.dropbox.logout();window.location.hash=""});q.isModified()?this.confirm(mxResources.get("allChangesLost"),null,v,mxResources.get("cancel"),mxResources.get("discardChanges")):v()}else this.dropbox.logout()}),mxResources.get("dropbox"));null!=this.oneDrive&&b(this.oneDrive.getUser(),IMAGE_PATH+"/onedrive-logo.svg",this.oneDrive.noLogout?null:mxUtils.bind(this,function(){var q=this.getCurrentFile();if(null!=q&&q.constructor==OneDriveFile){var v=mxUtils.bind(this,function(){this.oneDrive.logout();window.location.hash=""});q.isModified()?this.confirm(mxResources.get("allChangesLost"),null,v,mxResources.get("cancel"),mxResources.get("discardChanges")):v()}else this.oneDrive.logout()}),mxResources.get("oneDrive"));null!=this.gitHub&&b(this.gitHub.getUser(),IMAGE_PATH+"/github-logo.svg",mxUtils.bind(this,function(){var q=this.getCurrentFile();if(null!=q&&q.constructor==GitHubFile){var v=mxUtils.bind(this,function(){this.gitHub.logout();window.location.hash=""});q.isModified()?this.confirm(mxResources.get("allChangesLost"),null,v,mxResources.get("cancel"),mxResources.get("discardChanges")):v()}else this.gitHub.logout()}),mxResources.get("github"));null!=this.gitLab&&b(this.gitLab.getUser(),IMAGE_PATH+"/gitlab-logo.svg",mxUtils.bind(this,function(){var q=this.getCurrentFile();if(null!=q&&q.constructor==GitLabFile){var v=mxUtils.bind(this,function(){this.gitLab.logout();window.location.hash=@@ -14198,19 +14202,19 @@ App.prototype.getCurrentUser=function(){var b=null;null!=this.drive&&null!=this.Editor.prototype.resetGraph=function(){editorResetGraph.apply(this,arguments);null==this.graph.defaultPageFormat&&(this.graph.pageFormat=mxSettings.getPageFormat())};(function(){var b=mxPopupMenu.prototype.showMenu;mxPopupMenu.prototype.showMenu=function(){this.div.style.overflowY="auto";this.div.style.overflowX="hidden";this.div.style.maxHeight=Math.max(document.body.clientHeight,document.documentElement.clientHeight)-(EditorUi.isElectronApp?50:10)+"px";b.apply(this,arguments)};Menus.prototype.createHelpLink=function(f){return this.editorUi.createHelpIcon(f)};Menus.prototype.addLinkToItem=function(f,c){null!=f&&f.firstChild.nextSibling.appendChild(this.createHelpLink(c))};Menus.prototype.removeCustomFont=function(f,c){for(var l=0;l<this.customFonts.length;l++)if(this.customFonts[l].name==f&&this.customFonts[l].url==c){this.customFonts.splice(l,1);this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts));break}};Menus.prototype.containsFont=function(f,c){for(var l=0;l<this.customFonts.length;l++)if(this.customFonts[l].name==f&&this.customFonts[l].url==c)return!0;for(l=0;l<this.defaultFonts.length;l++){var p=this.defaultFonts[l];if("string"!==typeof p&&p.fontFamily==f&&p.fontUrl==c||"string"===typeof p&&p==f&&null==c)return!0}return!1};Menus.prototype.addCustomFont=function(f,c){null==f||this.containsFont(f,c)||(this.customFonts.push({name:f,url:c}),this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts)))};var e=Menus.prototype.init;Menus.prototype.init=function(){function f(u,x,J){c.isExportToCanvas()?c.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",-mxUtils.bind(this,function(H,K,O,M,n,z,D,L,N,R,T,U,W){var X=parseInt(H);!isNaN(X)&&0<X&&(c.exportImage(X/100,K&&"png"==u,O,M,n&&"png"==u,D,!L,N,u,T,null,U,W),null!=J&&J(H,K,O,M,n,z,D,L,N,R,T,U,W))}),!0,x,u,!0):c.isOffline()||mxClient.IS_IOS&&navigator.standalone||c.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(H,K,O,M,n){c.downloadFile(K&&"png"==u?"xmlpng":u,null,null,H,null,null,O,M,n)}),!1,!0)}e.apply(this,arguments);var c=this.editorUi,l=c.editor.graph,p=mxUtils.bind(l,-l.isEnabled);"1"==urlParams.noFileMenu&&(this.defaultMenuItems=this.defaultMenuItems.filter(function(u){return"file"!=u}));c.actions.addAction("new...",function(){var u=c.isOffline(),x=new NewDialog(c,u,!(c.mode==App.MODE_DEVICE&&"chooseFileSystemEntries"in window));c.showDialog(x.container,u?350:620,u?70:460,!0,!0,function(J){c.sidebar.hideTooltip();J&&null==c.getCurrentFile()&&c.showSplash()});x.init()});c.actions.put("insertTemplate",new Action("template...",function(){if(l.isEnabled()&&!l.isCellLocked(l.getDefaultParent())){var u=-new NewDialog(c,null,!1,function(x){c.hideDialog();if(null!=x){var J=c.editor.graph.getFreeInsertPoint();l.setSelectionCells(c.importXml(x,Math.max(J.x,20),Math.max(J.y,20),!0,null,null,!0));l.scrollCellToVisible(l.getSelectionCell())}},null,null,null,null,null,null,null,null,null,null,!1,mxResources.get("insert"));c.showDialog(u.container,620,460,!0,!0,function(){c.sidebar.hideTooltip()});u.init()}})).isEnabled=p;var q=c.actions.addAction("shareCursor",function(){c.setShareCursorPosition(!c.isShareCursorPosition())});-q.setToggleAction(!0);q.setSelectedCallback(function(){return c.isShareCursorPosition()});q=c.actions.addAction("showRemoteCursors",function(){c.setShowRemoteCursors(!c.isShowRemoteCursors())});q.setToggleAction(!0);q.setSelectedCallback(function(){return c.isShowRemoteCursors()});q=c.actions.addAction("points",function(){c.editor.graph.view.setUnit(mxConstants.POINTS)});q.setToggleAction(!0);q.setSelectedCallback(function(){return c.editor.graph.view.unit==mxConstants.POINTS});q=c.actions.addAction("inches",-function(){c.editor.graph.view.setUnit(mxConstants.INCHES)});q.setToggleAction(!0);q.setSelectedCallback(function(){return c.editor.graph.view.unit==mxConstants.INCHES});q=c.actions.addAction("millimeters",function(){c.editor.graph.view.setUnit(mxConstants.MILLIMETERS)});q.setToggleAction(!0);q.setSelectedCallback(function(){return c.editor.graph.view.unit==mxConstants.MILLIMETERS});q=c.actions.addAction("meters",function(){c.editor.graph.view.setUnit(mxConstants.METERS)});q.setToggleAction(!0);q.setSelectedCallback(function(){return c.editor.graph.view.unit==-mxConstants.METERS});this.put("units",new Menu(mxUtils.bind(this,function(u,x){this.addMenuItems(u,["points","inches","millimeters","meters"],x);"min"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme||c.menus.addMenuItems(u,["-","pageScale"],x)})));q=c.actions.addAction("pageTabs",function(){c.setTabContainerVisible(!c.isTabContainerVisible(),!0)});q.setToggleAction(!0);q.setSelectedCallback(function(){return c.isTabContainerVisible()});q=c.actions.addAction("ruler",-function(){c.setRulerVisible(!c.isRulerVisible())});q.setEnabled(c.canvasSupported&&9!=document.documentMode);q.setToggleAction(!0);q.setSelectedCallback(function(){return c.isRulerVisible()});q=c.actions.addAction("fullscreen",function(){"1"==urlParams.embedInline?c.setInlineFullscreen(!Editor.inlineFullscreen):null==document.fullscreenElement?document.body.requestFullscreen():document.exitFullscreen()});q.visible="1"==urlParams.embedInline||window==window.top&&document.fullscreenEnabled&&null!=-document.body.requestFullscreen;q.setToggleAction(!0);q.setSelectedCallback(function(){return"1"==urlParams.embedInline?Editor.inlineFullscreen:null!=document.fullscreenElement});q=c.actions.put("lightMode",new Action("light",function(u){c.setAndPersistDarkMode(!1)}));q.setToggleAction(!0);q.setSelectedCallback(function(){return!c.isAutoDarkMode(!0)&&!Editor.isDarkMode()});q=c.actions.put("darkMode",new Action("dark",function(u){c.setAndPersistDarkMode(!0)}));q.setToggleAction(!0);q.setSelectedCallback(function(){return!c.isAutoDarkMode(!0)&&+mxUtils.bind(this,function(H,K,N,M,n,A,E,L,O,R,T,U,W){var X=parseInt(H);!isNaN(X)&&0<X&&(c.exportImage(X/100,K&&"png"==u,N,M,n&&"png"==u,E,!L,O,u,T,null,U,W),null!=J&&J(H,K,N,M,n,A,E,L,O,R,T,U,W))}),!0,x,u,!0):c.isOffline()||mxClient.IS_IOS&&navigator.standalone||c.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(H,K,N,M,n){c.downloadFile(K&&"png"==u?"xmlpng":u,null,null,H,null,null,N,M,n)}),!1,!0)}e.apply(this,arguments);var c=this.editorUi,l=c.editor.graph,p=mxUtils.bind(l,+l.isEnabled);"1"==urlParams.noFileMenu&&(this.defaultMenuItems=this.defaultMenuItems.filter(function(u){return"file"!=u}));c.actions.addAction("new...",function(){var u=c.isOffline(),x=new NewDialog(c,u,!(c.mode==App.MODE_DEVICE&&"chooseFileSystemEntries"in window));c.showDialog(x.container,u?350:620,u?70:460,!0,!0,function(J){null!=c.sidebar&&c.sidebar.hideTooltip();J&&null==c.getCurrentFile()&&c.showSplash()});x.init()});c.actions.put("insertTemplate",new Action("template...",function(){if(l.isEnabled()&&+!l.isCellLocked(l.getDefaultParent())){var u=new NewDialog(c,null,!1,function(x){c.hideDialog();if(null!=x){var J=c.editor.graph.getFreeInsertPoint();l.setSelectionCells(c.importXml(x,Math.max(J.x,20),Math.max(J.y,20),!0,null,null,!0));l.scrollCellToVisible(l.getSelectionCell())}},null,null,null,null,null,null,null,null,null,null,!1,mxResources.get("insert"));c.showDialog(u.container,620,460,!0,!0,function(){c.sidebar.hideTooltip()});u.init()}})).isEnabled=p;var q=c.actions.addAction("shareCursor",+function(){c.setShareCursorPosition(!c.isShareCursorPosition())});q.setToggleAction(!0);q.setSelectedCallback(function(){return c.isShareCursorPosition()});q=c.actions.addAction("showRemoteCursors",function(){c.setShowRemoteCursors(!c.isShowRemoteCursors())});q.setToggleAction(!0);q.setSelectedCallback(function(){return c.isShowRemoteCursors()});q=c.actions.addAction("points",function(){c.editor.graph.view.setUnit(mxConstants.POINTS)});q.setToggleAction(!0);q.setSelectedCallback(function(){return c.editor.graph.view.unit==+mxConstants.POINTS});q=c.actions.addAction("inches",function(){c.editor.graph.view.setUnit(mxConstants.INCHES)});q.setToggleAction(!0);q.setSelectedCallback(function(){return c.editor.graph.view.unit==mxConstants.INCHES});q=c.actions.addAction("millimeters",function(){c.editor.graph.view.setUnit(mxConstants.MILLIMETERS)});q.setToggleAction(!0);q.setSelectedCallback(function(){return c.editor.graph.view.unit==mxConstants.MILLIMETERS});q=c.actions.addAction("meters",function(){c.editor.graph.view.setUnit(mxConstants.METERS)});+q.setToggleAction(!0);q.setSelectedCallback(function(){return c.editor.graph.view.unit==mxConstants.METERS});this.put("units",new Menu(mxUtils.bind(this,function(u,x){this.addMenuItems(u,["points","inches","millimeters","meters"],x);"min"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme||c.menus.addMenuItems(u,["-","pageScale"],x)})));q=c.actions.addAction("pageTabs",function(){c.setTabContainerVisible(!c.isTabContainerVisible(),!0)});q.setToggleAction(!0);q.setSelectedCallback(function(){return c.isTabContainerVisible()});+q=c.actions.addAction("ruler",function(){c.setRulerVisible(!c.isRulerVisible())});q.setEnabled(c.canvasSupported&&9!=document.documentMode);q.setToggleAction(!0);q.setSelectedCallback(function(){return c.isRulerVisible()});q=c.actions.addAction("fullscreen",function(){"1"==urlParams.embedInline?c.setInlineFullscreen(!Editor.inlineFullscreen):null==document.fullscreenElement?document.body.requestFullscreen():document.exitFullscreen()});q.visible="1"==urlParams.embedInline||window==window.top&&document.fullscreenEnabled&&+null!=document.body.requestFullscreen;q.setToggleAction(!0);q.setSelectedCallback(function(){return"1"==urlParams.embedInline?Editor.inlineFullscreen:null!=document.fullscreenElement});q=c.actions.put("lightMode",new Action("light",function(u){c.setAndPersistDarkMode(!1)}));q.setToggleAction(!0);q.setSelectedCallback(function(){return!c.isAutoDarkMode(!0)&&!Editor.isDarkMode()});q=c.actions.put("darkMode",new Action("dark",function(u){c.setAndPersistDarkMode(!0)}));q.setToggleAction(!0);q.setSelectedCallback(function(){return!c.isAutoDarkMode(!0)&&Editor.isDarkMode()});q=c.actions.put("autoMode",new Action("automatic",function(u){c.setAndPersistDarkMode("auto")}));q.setToggleAction(!0);q.setSelectedCallback(function(){return c.isAutoDarkMode(!0)});c.actions.addAction("properties...",function(){c.getPublicUrl(c.getCurrentFile(),function(u){u=new FilePropertiesDialog(c,u);c.showDialog(u.container,340,200,!0,!0);u.init()})}).isEnabled=p;window.mxFreehand&&(c.actions.put("insertFreehand",new Action("freehand...",function(){if(l.isEnabled()){if(null==c.freehandWindow){var u=!mxClient.IS_IE&&!mxClient.IS_IE11;c.freehandWindow=new FreehandWindow(c,document.body.offsetWidth-420,102,176,u?126:90,u)}l.freehand.isDrawing()?l.freehand.stopDrawing():l.freehand.startDrawing();c.freehandWindow.window.setVisible(!0)}},null,null,"X")).isEnabled=function(){return p()&&mxClient.IS_SVG});c.actions.put("exportXml",new Action("formatXml...",function(){var u=document.createElement("div");u.style.whiteSpace="nowrap";var x=null==c.pages||1>=c.pages.length,J=document.createElement("h3");-mxUtils.write(J,mxResources.get("formatXml"));J.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";u.appendChild(J);var H=c.addCheckbox(u,mxResources.get("selectionOnly"),!1,l.isSelectionEmpty()),K=c.addCheckbox(u,mxResources.get("compressed"),Editor.defaultCompressed),O=c.addCheckbox(u,mxResources.get("allPages"),!x,x);O.style.marginBottom="16px";mxEvent.addListener(H,"change",function(){H.checked?O.setAttribute("disabled","disabled"):O.removeAttribute("disabled")});u=-new CustomDialog(c,u,mxUtils.bind(this,function(){c.downloadFile("xml",!K.checked,null,!H.checked,x||!O.checked)}),null,mxResources.get("export"));c.showDialog(u.container,300,200,!0,!0)}));Editor.enableExportUrl&&c.actions.put("exportUrl",new Action("url...",function(){c.showPublishLinkDialog(mxResources.get("url"),null,null,null,null,null,null,null,function(u,x,J,H,K,O,M,n,z,D,L,N){M=[];H&&z&&M.push("tags=%7B%7D");u=new EmbedDialog(c,c.createLink(u,x,!0,H,K,O,null,!0,M,null,J,null,N));c.showDialog(u.container,-450,240,!0,!0);u.init()},null,!0)}));c.actions.put("exportHtml",new Action("formatHtmlEmbedded...",function(){c.getPublicUrl(c.getCurrentFile(),function(u){c.showHtmlDialog(mxResources.get("export"),null,u,function(x,J,H,K,O,M,n,z,D,L,N,R){c.createHtml(x,J,H,K,O,M,n,z,D,L,N,mxUtils.bind(this,function(T,U){var W=c.getBaseFilename(n);T='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n<!DOCTYPE html>\n<html>\n<head>\n<title>'+mxUtils.htmlEntities(W)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'++mxUtils.write(J,mxResources.get("formatXml"));J.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";u.appendChild(J);var H=c.addCheckbox(u,mxResources.get("selectionOnly"),!1,l.isSelectionEmpty()),K=c.addCheckbox(u,mxResources.get("compressed"),Editor.defaultCompressed),N=c.addCheckbox(u,mxResources.get("allPages"),!x,x);N.style.marginBottom="16px";mxEvent.addListener(H,"change",function(){H.checked?N.setAttribute("disabled","disabled"):N.removeAttribute("disabled")});u=+new CustomDialog(c,u,mxUtils.bind(this,function(){c.downloadFile("xml",!K.checked,null,!H.checked,x||!N.checked)}),null,mxResources.get("export"));c.showDialog(u.container,300,200,!0,!0)}));Editor.enableExportUrl&&c.actions.put("exportUrl",new Action("url...",function(){c.showPublishLinkDialog(mxResources.get("url"),null,null,null,null,null,null,null,function(u,x,J,H,K,N,M,n,A,E,L,O){M=[];H&&A&&M.push("tags=%7B%7D");u=new EmbedDialog(c,c.createLink(u,x,!0,H,K,N,null,!0,M,null,J,null,O));c.showDialog(u.container,+450,240,!0,!0);u.init()},null,!0)}));c.actions.put("exportHtml",new Action("formatHtmlEmbedded...",function(){c.getPublicUrl(c.getCurrentFile(),function(u){c.showHtmlDialog(mxResources.get("export"),null,u,function(x,J,H,K,N,M,n,A,E,L,O,R){c.createHtml(x,J,H,K,N,M,n,A,E,L,O,mxUtils.bind(this,function(T,U){var W=c.getBaseFilename(n);T='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n<!DOCTYPE html>\n<html>\n<head>\n<title>'+mxUtils.htmlEntities(W)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'+T+"\n"+U+"\n</body>\n</html>";c.saveData(W+(".drawio"==W.substring(W.lenth-7)?"":".drawio")+".html","html",T,"text/html")}),R)})})}));c.actions.put("exportPdf",new Action("formatPdf...",function(){c.showPrintDialog(mxResources.get("formatPdf"),EditorUi.isElectronApp||!c.isOffline()&&!c.printPdfExport?mxUtils.bind(this,function(u,x){u=null!=c.pages?c.pages.length:1;var J=null==c.pages||1>=c.pages.length,H=c.getPageIndex(c.currentPage);H=null!=H?H+1:1;c.downloadFile("pdf",null,null,!x.selection,J||!x.allPages&&x.pagesFrom==H&&x.pagesTo==H,!x.crop,x.transparent,x.scale,null,x.grid,x.includeCopy,x.allPages||x.pagesFrom==H&&x.pagesTo==H?null:{from:Math.max(0,Math.min(u-1,x.pagesFrom-1)),to:Math.max(0,Math.min(u-1,x.pagesTo-1))},x.border,x.fit,x.sheetsAcross,x.sheetsDown)}):null,mxResources.get("export"))}));c.actions.addAction("open...",function(){c.pickFile()});c.actions.addAction("close",function(){function u(){null!=x&&x.removeDraft();c.fileLoaded(null)}var x=c.getCurrentFile();null!=x&&x.isModified()?c.confirm(mxResources.get("allChangesLost"),null,u,mxResources.get("cancel"),mxResources.get("discardChanges")):u()});c.actions.addAction("editShape...",mxUtils.bind(this,function(){l.getSelectionCells();if(1==l.getSelectionCount()){var u=l.getSelectionCell(),x=l.view.getState(u);null!=x&&null!=x.shape&&null!=x.shape.stencil&&(u=new EditShapeDialog(c,u,mxResources.get("editShape")+":",630,400),c.showDialog(u.container,640,480,!0,!1),u.init())}}));c.actions.addAction("revisionHistory...",function(){c.isRevisionHistorySupported()?@@ -14222,65 +14226,66 @@ u.ignoreColor=!0;u.ignoreImage=!0;u.adaptiveColors="simple";l.model.execute(u)})["defaultAdaptiveColors","-","automaticAdaptiveColors","simpleAdaptiveColors","noAdaptiveColors"],x)})));isLocalStorage&&(q=c.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());mxSettings.save()}),q.setToggleAction(!0),q.setSelectedCallback(function(){return mxSettings.getShowStartScreen()}));var v=c.actions.addAction("autosave",function(){c.editor.setAutosave(!c.editor.autosave)});v.setToggleAction(!0);v.setSelectedCallback(function(){return v.isEnabled()&&c.editor.autosave});c.actions.addAction("editGeometry...",function(){for(var u=l.getSelectionCells(),x=[],J=0;J<u.length;J++)l.getModel().isVertex(u[J])&&x.push(u[J]);0<x.length&&(u=new EditGeometryDialog(c,x),c.showDialog(u.container,200,270,!0,!0),u.init())},null,null,Editor.ctrlKey+"+Shift+M");c.actions.addAction("copyStyle",function(){if(l.isEnabled()&&1==l.getSelectionCount()){var u=l.getSelectionCell(),x=l.getCellStyle(u,!1);c.copiedStyle={};var J=[],H=[],K;for(K in x)J.push(x[K]),H.push(K);l.copyCellStyles([u],H,J,c.copiedStyle,c.copiedStyle,null,null,null,!0)}},null,null,"Alt+C");c.actions.addAction("pasteStyle",function(){l.isEnabled()&&!l.isSelectionEmpty()&&null!=c.copiedStyle&&l.pasteCellStyles(l.includeDescendants(l.getSelectionCells()),c.copiedStyle,c.copiedStyle,!0)},null,null,"Alt+V");c.actions.put("exportSvg",new Action("formatSvg...",function(){c.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,-function(u,x,J,H,K,O,M,n,z,D,L,N,R,T){u=parseInt(u);c.lastExportSvgEditable=K;!isNaN(u)&&0<u&&c.exportSvg(u/100,x,J,H,K,O,M,!n,z,D,N,R,T)}),!0,c.lastExportSvgEditable,"svg",!0)}));c.actions.put("exportPng",new Action("formatPng...",function(){f("png",c.lastExportPngEditable,function(u,x,J,H,K){c.lastExportPngEditable=K})}));c.actions.put("exportJpg",new Action("formatJpg...",function(){f("jpeg")}));c.actions.put("exportWebp",new Action("formatWebp...",function(){f("webp")}));q=c.actions.addAction("copyAsImage",+function(u,x,J,H,K,N,M,n,A,E,L,O,R,T){u=parseInt(u);c.lastExportSvgEditable=K;!isNaN(u)&&0<u&&c.exportSvg(u/100,x,J,H,K,N,M,!n,A,E,O,R,T)}),!0,c.lastExportSvgEditable,"svg",!0)}));c.actions.put("exportPng",new Action("formatPng...",function(){f("png",c.lastExportPngEditable,function(u,x,J,H,K){c.lastExportPngEditable=K})}));c.actions.put("exportJpg",new Action("formatJpg...",function(){f("jpeg")}));c.actions.put("exportWebp",new Action("formatWebp...",function(){f("webp")}));q=c.actions.addAction("copyAsImage",mxUtils.bind(this,function(){var u=mxUtils.sortCells(l.model.getTopmostCells(l.getSelectionCells())),x=mxUtils.getXml(0==u.length?c.editor.getGraphXml():l.encodeCells(u));c.copyImage(u,x)}),null,null,"Ctrl+Alt+X");q.visible=Editor.enableNativeCipboard&&c.isExportToCanvas()&&!mxClient.IS_SF;q=c.actions.put("shadowVisible",new Action("shadow",function(){l.setShadowVisible(!l.shadowVisible)}));q.setToggleAction(!0);q.setSelectedCallback(function(){return l.shadowVisible});c.actions.put("about",new Action("v"+-EditorUi.VERSION,function(u,x){}));c.actions.addAction("support...",function(){EditorUi.isElectronApp?c.openLink("https://github.com/jgraph/drawio-desktop/wiki/Getting-Support"):c.openLink("https://github.com/jgraph/drawio/wiki/Getting-Support")});c.actions.addAction("exportOptionsDisabled...",function(){c.handleError({message:mxResources.get("exportOptionsDisabledDetails")},mxResources.get("exportOptionsDisabled"))});c.actions.addAction("keyboardShortcuts...",function(){!mxClient.IS_SVG||mxClient.IS_CHROMEAPP||-EditorUi.isElectronApp?c.openLink("https://viewer.diagrams.net/#Uhttps%3A%2F%2Fviewer.diagrams.net%2Fshortcuts.svg"):c.openLink("shortcuts.svg")});c.actions.addAction("feedback...",function(){var u=new FeedbackDialog(c);c.showDialog(u.container,610,360,!0,!1);u.init()});c.actions.addAction("quickStart...",function(){"ac.draw.io"===window.location.hostname?c.openLink("https://www.youtube.com/watch?v=s5BG0705MHU"):c.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});q=c.actions.addAction("tags",-mxUtils.bind(this,function(){null==this.tagsWindow?(this.tagsWindow=new TagsWindow(c,document.body.offsetWidth-400,60,212,200),this.tagsWindow.window.addListener("show",mxUtils.bind(this,function(){c.fireEvent(new mxEventObject("tags"))})),this.tagsWindow.window.addListener("hide",function(){c.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.setVisible(!0),c.fireEvent(new mxEventObject("tags"))):this.tagsWindow.window.setVisible(!this.tagsWindow.window.isVisible())}),null,null,Editor.ctrlKey+-"+K");q.setToggleAction(!0);q.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&&this.tagsWindow.window.isVisible()}));null==Editor.gptApiKey||null==Editor.gptModel||null==Editor.gptUrl||c.isOffline()||EditorUi.isElectronApp||(q=c.actions.addAction("chatWindowTitle",mxUtils.bind(this,function(){null==this.chatWindow?(this.chatWindow=new ChatWindow(c,220,document.body.offsetHeight-380,250,320),this.chatWindow.window.addListener("show",mxUtils.bind(this,function(){c.fireEvent(new mxEventObject("chat"))})),-this.chatWindow.window.addListener("hide",function(){c.fireEvent(new mxEventObject("chat"))}),this.chatWindow.window.setVisible(!0),c.fireEvent(new mxEventObject("chat"))):this.chatWindow.window.setVisible(!this.chatWindow.window.isVisible())})),q.setToggleAction(!0),q.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.chatWindow&&this.chatWindow.window.isVisible()})));q=c.actions.addAction("findReplace",mxUtils.bind(this,function(u,x){var J=(u=l.isEnabled()&&(null==x||!mxEvent.isShiftDown(x)))?-"findReplace":"find";x=J+"Window";if(null==this[x]){var H="min"==Editor.currentTheme||"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,K=u?H?330:300:240;this[x]=new FindWindow(c,document.body.offsetWidth-(K+20),100,K,u?H?304:288:170,u);this[x].window.addListener("show",function(){c.fireEvent(new mxEventObject(J))});this[x].window.addListener("hide",function(){c.fireEvent(new mxEventObject(J))})}this[x].window.setVisible(!0);this[x].focus()}),null,null,Editor.ctrlKey+"+F");q=new Action("exportVsdx",-function(){var u=null==c.pages||1>=c.pages.length;if(u)c.exportVisio();else{var x=document.createElement("div");x.style.whiteSpace="nowrap";var J=document.createElement("h3");mxUtils.write(J,mxResources.get("formatVsdx"));J.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";x.appendChild(J);var H=c.addCheckbox(x,mxResources.get("allPages"),!u,u);H.style.marginBottom="16px";u=new CustomDialog(c,x,mxUtils.bind(this,function(){c.exportVisio(!H.checked)}),null,mxResources.get("export"));-c.showDialog(u.container,300,130,!0,!0)}});q.getTitle=function(){return mxResources.get("formatVsdx")+" (beta)..."};c.actions.put("exportVsdx",q);isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed&&c.actions.addAction("configuration...",function(){var u=document.createElement("input");u.setAttribute("type","checkbox");u.style.marginRight="8px";u.checked=mxSettings.getShowStartScreen();u.defaultChecked=u.checked;if(Editor.isSettingsEnabled()&&("sketch"==Editor.currentTheme||"simple"==Editor.currentTheme||-"min"==Editor.currentTheme)){var x=document.createElement("span");x.style.display="flex";x.style.alignItems="center";x.style.cssFloat="right";x.style.cursor="pointer";x.style.userSelect="none";x.style.marginTop="-3px";x.appendChild(u);mxUtils.write(x,mxResources.get("showStartScreen"));mxEvent.addListener(x,"click",function(H){mxEvent.getSource(H)!=u&&(u.checked=!u.checked)});header=x}x=[[mxResources.get("reset"),function(){c.confirm(mxResources.get("areYouSure"),function(){try{localStorage.removeItem(Editor.configurationKey),-c.hideDialog(),c.alert(mxResources.get("restartForChangeRequired"))}catch(H){c.handleError(H)}})}]];if(!c.isOfflineApp()&&isLocalStorage&&c.mode!=App.MODE_ATLAS){var J=c.actions.get("plugins");null==J||"sketch"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&"min"!=Editor.currentTheme||x.push([mxResources.get("plugins"),J.funct])}EditorUi.isElectronApp||x.push([mxResources.get("link"),function(H,K){if(0<K.value.length)try{var O=JSON.parse(K.value),M=window.location.protocol+"//"+window.location.host+-"/"+c.getSearch()+"#_CONFIG_"+Graph.compress(JSON.stringify(O)),n=new EmbedDialog(c,M);c.showDialog(n.container,450,240,!0);n.init()}catch(z){c.handleError(z)}else c.handleError({message:mxResources.get("invalidInput")})}]);"atlassian"!=c.getServiceName()&&"1"!=urlParams.embed&&x.push([mxResources.get("preferences"),function(){c.showLocalStorageDialog(mxResources.get("preferences")+":",Editor.settingsKey,[[mxResources.get("reset"),function(){c.confirm(mxResources.get("areYouSure"),function(){try{localStorage.removeItem(Editor.settingsKey),-localStorage.removeItem(".drawio-config"),c.hideDialog(),c.alert(mxResources.get("restartForChangeRequired"))}catch(H){c.handleError(H)}})}]])}]);c.showLocalStorageDialog(mxResources.get("configuration")+":",Editor.configurationKey,x,u.parentNode,"https://www.drawio.com/doc/faq/configure-diagram-editor",function(){null!=u.parentNode&&(mxSettings.setShowStartScreen(u.checked),mxSettings.save())})});(mxClient.IS_CHROMEAPP||isLocalStorage)&&this.put("language",new Menu(mxUtils.bind(this,function(u,x){var J=-mxLanguage;null==urlParams.lang&&isLocalStorage&&(J=mxSettings.settings.language);var H=mxUtils.bind(this,function(O){var M=""==O?mxResources.get("automatic"):mxLanguageMap[O],n=null;""!=M&&(n=u.addItem(M,null,mxUtils.bind(this,function(){c.setAndPersistLanguage(O)}),x),(O==J||""==O&&null==J)&&u.addCheckmark(n,Editor.checkmarkImage));return n});H("");u.addSeparator(x);for(var K in mxLanguageMap)H(K)})));c.customLayoutConfig=[{layout:"mxHierarchicalLayout",config:{orientation:"west",intraCellSpacing:30,-interRankCellSpacing:100,interHierarchySpacing:60,parallelEdgeSpacing:10}}];c.actions.addAction("runLayout",function(){c.showCustomLayoutDialog(JSON.stringify(c.customLayoutConfig,null,2))});c.actions.put("adaptiveColors",new Action("adaptiveColors",function(u){null==c.adaptiveColorsWindow&&(c.adaptiveColorsWindow=new AdaptiveColorsWindow(c,document.body.offsetWidth-520,80,200,160));c.adaptiveColorsWindow.window.setVisible(!0)}));q=this.get("viewZoom");var E=q.funct;q.funct=mxUtils.bind(this,function(u,-x){E.apply(this,arguments);"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||this.addMenuItems(u,["-","outline","fullscreen"],x)});q=this.get("layout");var G=q.funct;q.funct=function(u,x){G.apply(this,arguments);u.addItem(mxResources.get("orgChart"),null,function(){var J=null,H=20,K=20,O=function(){"undefined"!==typeof mxOrgChartLayout&&null!=J&&c.tryAndHandle(mxUtils.bind(this,function(){var T=c.editor.graph,U=new mxOrgChartLayout(T,J,H,K),W=T.getDefaultParent();1<T.model.getChildCount(T.getSelectionCell())&&-(W=T.getSelectionCell());U.execute(W)}))},M=document.createElement("div"),n=document.createElement("div");n.style.marginTop="6px";n.style.display="inline-block";n.style.width="180px";mxUtils.write(n,mxResources.get("orgChartType")+": ");M.appendChild(n);var z=document.createElement("select");z.style.width="160px";z.style.boxSizing="border-box";n=[mxResources.get("linear"),mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),-mxResources.get("1ColumnRight"),mxResources.get("smart")];for(var D=0;D<n.length;D++){var L=document.createElement("option");mxUtils.write(L,n[D]);L.value=D;2==D&&L.setAttribute("selected","selected");z.appendChild(L)}mxEvent.addListener(z,"change",function(){J=z.value});M.appendChild(z);n=document.createElement("div");n.style.marginTop="6px";n.style.display="inline-block";n.style.width="180px";mxUtils.write(n,mxResources.get("parentChildSpacing")+": ");M.appendChild(n);var N=document.createElement("input");-N.type="number";N.value=H;N.style.width="160px";N.style.boxSizing="border-box";M.appendChild(N);mxEvent.addListener(N,"change",function(){H=N.value});n=document.createElement("div");n.style.marginTop="6px";n.style.display="inline-block";n.style.width="180px";mxUtils.write(n,mxResources.get("siblingSpacing")+": ");M.appendChild(n);var R=document.createElement("input");R.type="number";R.value=K;R.style.width="160px";R.style.boxSizing="border-box";M.appendChild(R);mxEvent.addListener(R,"change",function(){K=-R.value});n=mxUtils.button(mxResources.get("custom")+"...",function(){var T=[{layout:"mxOrgChartLayout",config:{branchOptimizer:parseInt(z.value),parentChildSpacing:parseInt(N.value),siblingSpacing:parseInt(R.value)}}];c.hideDialog();c.showCustomLayoutDialog(JSON.stringify(T,null,2))});n.className="geBtn";M=new CustomDialog(c,M,function(){null==J&&(J=2);c.loadOrgChartLayouts(O)},null,null,null,n);c.showDialog(M.container,355,140,!0,!0)},x,null,p());u.addSeparator(x);u.addItem(mxResources.get("parallels"),-null,mxUtils.bind(this,function(){c.tryAndHandle(mxUtils.bind(this,function(){var J=new mxParallelEdgeLayout(l);J.checkOverlap=!0;c.prompt(mxResources.get("spacing"),J.spacing,mxUtils.bind(this,function(H){c.tryAndHandle(mxUtils.bind(this,function(){J.spacing=H;c.executeLayout(function(){J.execute(l.getDefaultParent(),l.isSelectionEmpty()?null:l.getSelectionCells())},!1)}))}))}))}),x);u.addSeparator(x);c.menus.addMenuItem(u,"runLayout",x,null,null,mxResources.get("custom")+"...")};this.put("help",-new Menu(mxUtils.bind(this,function(u,x){if(!mxClient.IS_CHROMEAPP&&c.isOffline())this.addMenuItems(u,["keyboardShortcuts","-","about"],x);else{var J=u.addItem("Search:",null,null,x,null,null,!1);J.style.cursor="default";var H=document.createElement("input");H.setAttribute("type","text");H.setAttribute("size","25");H.style.borderWidth="1px";H.style.marginLeft="8px";mxEvent.addListener(H,"keydown",mxUtils.bind(this,function(K){var O=mxUtils.trim(H.value);13==K.keyCode&&0<O.length?(this.editorUi.openLink("https://www.drawio.com/search?src="+-(EditorUi.isElectronApp?"DESKTOP":encodeURIComponent(location.host))+"&search="+encodeURIComponent(O)),H.value="",EditorUi.logEvent({category:"SEARCH-HELP",action:"search",label:O}),window.setTimeout(mxUtils.bind(this,function(){this.editorUi.hideCurrentMenu()}),0)):27==K.keyCode&&(H.value="")}));J.firstChild.nextSibling.appendChild(H);mxEvent.addGestureListeners(H,function(K){document.activeElement!=H&&H.focus();mxEvent.consume(K)},function(K){mxEvent.consume(K)},function(K){mxEvent.consume(K)});-window.setTimeout(function(){H.focus()},0);EditorUi.isElectronApp?(c.actions.addAction("website...",function(){c.openLink("https://www.drawio.com")}),c.actions.addAction("check4Updates",function(){c.checkForUpdates()}),c.actions.put("desktopZoomIn",new Action("zoomIn",function(){c.desktopZoomIn()})),c.actions.put("desktopZoomOut",new Action("zoomOut",function(){c.desktopZoomOut()})),c.actions.put("desktopResetZoom",new Action("actualSize",function(){c.desktopResetZoom()})),this.addMenuItems(u,"- keyboardShortcuts quickStart website support -".split(" "),-x),"1"!=urlParams.disableUpdate&&this.addMenuItems(u,["check4Updates","-"],x),this.addMenuItems(u,"desktopResetZoom desktopZoomIn desktopZoomOut - openDevTools - about".split(" "),x)):this.addMenuItems(u,"- keyboardShortcuts quickStart support - about".split(" "),x)}"1"==urlParams.test&&(u.addSeparator(x),this.addSubmenu("testDevelop",u,x))})));c.actions.addAction("languageCode...",function(){var u=new FilenameDialog(c,Graph.diagramLanguage||"",mxResources.get("ok"),mxUtils.bind(this,function(x){null!=-x&&(Graph.diagramLanguage=0<x.length?x:null,Graph.translateDiagram=!0,l.refresh())}),mxResources.get("languageCode"),null,null,"https://www.drawio.com/blog/translate-diagrams");c.showDialog(u.container,340,80,!0,!0);u.init()});this.put("diagramLanguage",new Menu(mxUtils.bind(this,function(u,x){this.addMenuItems(u,["languageCode","-"],x);x=u.addItem(mxResources.get("disabled"),null,function(){Graph.translateDiagram=!1;l.refresh()},x);Graph.translateDiagram||u.addCheckmark(x,Editor.checkmarkImage)})));-if("1"==urlParams.test){mxResources.parse("testDevelop=Develop");mxResources.parse("showBoundingBox=Show bounding box");mxResources.parse("createSidebarEntry=Create Sidebar Entry");mxResources.parse("testCheckFile=Check File");mxResources.parse("testDiff=Diff/Sync");mxResources.parse("testChecksum=Checksum");mxResources.parse("testCheckPages=Check Pages");mxResources.parse("testFixPages=Fix Pages");mxResources.parse("testInspect=Inspect");mxResources.parse("testShowConsole=Show Console");mxResources.parse("testXmlImageExport=XML Image Export");-mxResources.parse("testOptimize=Remove Inline Images");mxResources.parse("testPerformance=Performance");c.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){if(!l.isSelectionEmpty()){var u=l.cloneCells(l.getSelectionCells()),x=l.getBoundingBoxFromGeometry(u,!0);u=l.moveCells(u,-x.x,-x.y);c.showTextDialog("Create Sidebar Entry","this.addDataEntry('tag1 tag2', "+x.width+", "+x.height+", 'The Title', '"+Graph.compress(mxUtils.getXml(l.encodeCells(u)))+"'),")}}));c.actions.addAction("showBoundingBox",-mxUtils.bind(this,function(){function u(M){return null==M||null==M.boundingBox||!isNaN(M.boundingBox.x)&&!isNaN(M.boundingBox.y)&&!isNaN(M.boundingBox.width)&&!isNaN(M.boundingBox.height)}var x=l.getGraphBounds(),J=l.view.translate,H=l.view.scale;l.insertVertex(l.getDefaultParent(),null,"",x.x/H-J.x,x.y/H-J.y,x.width/H,x.height/H,"fillColor=none;strokeColor=red;");var K=0,O=0;l.view.states.visit(function(M,n){M=!0;u(n.shape)||(console.log("invalid shape",n.cell.id,n.shape),M=!1);u(n.text)||(console.log("invalid text",-n.cell.id,n.text),M=!1);M||K++;O++});console.log("states checked",O,"invalid",K)}));c.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var u=null!=c.pages&&null!=c.getCurrentFile()?c.getCurrentFile().getAnonymizedXmlForPages(c.pages):"";u=new TextareaDialog(c,"Paste Data:",u,function(x){if(0<x.length)try{var J=function(n){function z(Z){if(null==Y[Z]){if(Y[Z]=!0,null!=N[Z]){for(;0<N[Z].length;){var ca=N[Z].pop();z(ca)}delete N[Z]}}else mxLog.debug(D+": Visited: "+Z)}var D=n.parentNode.id,-L=n.childNodes;n={};for(var N={},R=null,T={},U=0;U<L.length;U++){var W=L[U];if(null!=W.id&&0<W.id.length)if(null==n[W.id]){n[W.id]=W.id;var X=W.getAttribute("parent");null==X?null!=R?mxLog.debug(D+": Multiple roots: "+W.id):R=W.id:(null==N[X]&&(N[X]=[]),N[X].push(W.id))}else T[W.id]=W.id}L=Object.keys(T);0<L.length?(L=D+": "+L.length+" Duplicates: "+L.join(", "),mxLog.debug(L+" (see console)")):mxLog.debug(D+": Checked");var Y={};null==R?mxLog.debug(D+": No root"):(z(R),Object.keys(Y).length!=Object.keys(n).length&&-(mxLog.debug(D+": Invalid tree: (see console)"),console.log(D+": Invalid tree",N)))};"<"!=x.charAt(0)&&(x=Graph.decompress(x),mxLog.debug("See console for uncompressed XML"),console.log("xml",x));var H=mxUtils.parseXml(x),K=c.getPagesForNode(H.documentElement,"mxGraphModel");if(null!=K&&0<K.length)try{var O=c.getHashValueForPages(K);mxLog.debug("Checksum: ",O)}catch(n){mxLog.debug("Error: ",n.message)}else mxLog.debug("No pages found for checksum");var M=H.getElementsByTagName("root");for(x=0;x<M.length;x++)J(M[x]);-mxLog.show()}catch(n){c.handleError(n),null!=window.console&&console.error(n)}});c.showDialog(u.container,620,460,!0,!0);u.init()}));var B=null;c.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=c.pages){var u=new TextareaDialog(c,"Diff/Sync:","",function(x){var J=c.getCurrentFile();if(0<x.length&&null!=J)try{var H=JSON.parse(x);J.patch([H],null,!0,!0);c.hideDialog()}catch(K){c.handleError(K)}},null,"Close",null,null,null,!0,null,"Patch",null,[["Snapshot",function(x,J){B=c.getPagesForXml(c.getFileData(!0));-u.textarea.value="Snapshot updated "+(new Date).toLocaleString()+" Checksum "+c.getHashValueForPages(B)}],["Diff",function(x,J){try{u.textarea.value=JSON.stringify(c.diffPages(B,c.pages),null,2)}catch(H){c.handleError(H)}}]]);null==B?(B=c.getPagesForXml(c.getFileData(!0)),u.textarea.value="Snapshot created "+(new Date).toLocaleString()+" Checksum "+c.getHashValueForPages(B)):u.textarea.value=JSON.stringify(c.diffPages(B,c.pages),null,2);c.showDialog(u.container,620,460,!0,!0);u.init()}else c.alert("No pages")}));-c.actions.addAction("testChecksum",mxUtils.bind(this,function(){var u=c.getCurrentFile();null!=c.pages&&null!=u?c.spinner.spin(document.body,mxResources.get("loading"))&&u.getLatestVersion(function(x){c.spinner.stop();var J=c.getHashValueForPages(c.pages),H=u.getCurrentRevisionId(),K=c.getHashValueForPages(x.getShadowPages()),O=x.getDescriptorChecksum(x.getDescriptor()),M=x.getCurrentRevisionId();console.log("Local File",[u],"modified",u.isModified(),"checksum",J);console.log("Remote File",[x],"rev",-M==H,"desc",O==K,"checksum",K);c.alert("Checksums "+(K==J?"match":"no not match"))},function(x){console.log("Error getLatestVersion",x);c.handleError(x)}):console.log("Checksum: no file or pages")}));c.actions.addAction("testCheckPages",mxUtils.bind(this,function(){var u=c.getCurrentFile();console.log("editorUi",c,"file",u);if(null!=u&&u.isRealtime()){console.log("Checksum ownPages",c.getHashValueForPages(u.ownPages));console.log("Checksum theirPages",c.getHashValueForPages(u.theirPages));console.log("diff ownPages/theirPages",-c.diffPages(u.ownPages,u.theirPages));var x=u.getShadowPages();null!=x&&(console.log("Checksum shadowPages",c.getHashValueForPages(x)),console.log("diff shadowPages/ownPages",c.diffPages(x,u.ownPages)),console.log("diff ownPages/shadowPages",c.diffPages(u.ownPages,x)),console.log("diff theirPages/shadowPages",c.diffPages(u.theirPages,x)));null!=u.sync&&null!=u.sync.snapshot&&(console.log("Checksum snapshot",c.getHashValueForPages(u.sync.snapshot)),console.log("diff ownPages/snapshot",c.diffPages(u.ownPages,-u.sync.snapshot)),console.log("diff theirPages/snapshot",c.diffPages(u.theirPages,u.sync.snapshot)),null!=c.pages&&console.log("diff snapshot/actualPages",c.diffPages(u.sync.snapshot,c.pages)));null!=c.pages&&(console.log("diff ownPages/actualPages",c.diffPages(u.ownPages,c.pages)),console.log("diff theirPages/actualPages",c.diffPages(u.theirPages,c.pages)))}null!=u&&console.log("Shadow pages",[c.getXmlForPages(u.getShadowPages())]);null!=c.pages&&console.log("Checksum actualPages",c.getHashValueForPages(c.pages))}));-c.actions.addAction("testFixPages",mxUtils.bind(this,function(){console.log("editorUi",c);var u=c.getCurrentFile();null!=u&&u.isRealtime()&&null!=u.shadowPages&&(console.log("patching actualPages to shadowPages",u.patch([c.diffPages(u.shadowPages,c.pages)])),u.ownPages=c.clonePages(c.pages),u.theirPages=c.clonePages(c.pages),u.shadowPages=c.clonePages(c.pages),null!=u.sync&&(u.sync.snapshot=c.clonePages(c.pages)))}));c.actions.addAction("testOptimize",mxUtils.bind(this,function(){l.model.beginUpdate();-try{var u=l.model.cells,x=0,J=[],H=[],K;for(K in u){var O=u[K],M=l.getCurrentCellStyle(O)[mxConstants.STYLE_IMAGE];null!=M&&"data:"==M.substring(0,5)&&(null==J[M]&&(J[M]=(J[M]||0)+1,x++),H.push(O))}l.setCellStyles(mxConstants.STYLE_IMAGE,null,H);console.log("Removed",x,"image(s) from",H.length,"cell(s): ",[H,J])}finally{l.model.endUpdate()}}));c.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(c,l.getModel())}));c.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var u=-new mxImageExport,x=l.getGraphBounds(),J=l.view.scale,H=mxUtils.createXmlDocument(),K=H.createElement("output");H.appendChild(K);H=new mxXmlCanvas2D(K);H.translate(Math.floor((1-x.x)/J),Math.floor((1-x.y)/J));H.scale(1/J);var O=0,M=H.save;H.save=function(){O++;M.apply(this,arguments)};var n=H.restore;H.restore=function(){O--;n.apply(this,arguments)};var z=u.drawShape;u.drawShape=function(D){mxLog.debug("entering shape",D,O);z.apply(this,arguments);mxLog.debug("leaving shape",D,O)};u.drawState(l.getView().getState(l.model.root),-H);mxLog.show();mxLog.debug(mxUtils.getXml(K));mxLog.debug("stateCounter",O)}));c.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-2});var d=null,g=null,k=null,m=null,t=null,y=null,A=null,I=null;c.actions.addAction("testPerformance",mxUtils.bind(this,function(){null!=d?(l.view.revalidate=d,d=null):(d=l.view.revalidate,l.view.revalidate=function(){var u=Date.now(),x=d.apply(this,arguments);EditorUi.debug("[Performance] mxGraphView.revalidate",-[this],"time",Date.now()-u+" ms","args",arguments);return x});null!=g?(c.selectPage=g,g=null):(g=c.selectPage,c.selectPage=function(){var u=Date.now(),x=g.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.selectPage",[this],"time",Date.now()-u+" ms","args",arguments);return x});null!=k?(c.diffPages=k,k=null):(k=c.diffPages,c.diffPages=function(){var u=Date.now(),x=k.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.diffPages",[this],"time",Date.now()-u+" ms","args",arguments);-return x});null!=m?(c.patchPages=m,m=null):(m=c.patchPages,c.patchPages=function(){var u=Date.now(),x=m.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.patchPages",[this],"time",Date.now()-u+" ms","args",arguments);return x});null!=t?(c.clonePages=t,t=null):(t=c.clonePages,c.clonePages=function(){var u=Date.now(),x=t.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.clonePages",[this],"time",Date.now()-u+" ms","args",arguments);return x});null!=A?(c.getHashValueForPages=A,-A=null):(A=c.getHashValueForPages,c.getHashValueForPages=function(){var u=Date.now(),x=A.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getHashValueForPages",[this],"time",Date.now()-u+" ms","args",arguments);return x});null!=I?(c.resolveCrossReferences=I,I=null):(I=c.resolveCrossReferences,c.resolveCrossReferences=function(){var u=Date.now(),x=I.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.resolveCrossReferences",[this],"time",Date.now()-u+" ms","args",arguments);return x});-null!=y?(c.getFileData=y,y=null):(y=c.getFileData,c.getFileData=function(){var u=Date.now(),x=y.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getFileData",[this],"time",Date.now()-u+" ms","args",arguments);return x});EditorUi.debug("[Performance]",null!=d?"Enabled":"Disabled")}));this.put("testDevelop",new Menu(mxUtils.bind(this,function(u,x){this.addMenuItems(u,"createSidebarEntry showBoundingBox - testCheckPages testChecksum testFixPages - testCheckFile testDiff - testInspect testOptimize - testXmlImageExport -".split(" "),-x);var J=u.addItem(mxResources.get("testPerformance"),null,function(){c.actions.get("testPerformance").funct()},x);null!=d&&u.addCheckmark(J,Editor.checkmarkImage);this.addMenuItems(u,["-","testShowConsole"],x)})))}c.actions.put("shapes",new Action("moreShapes...",function(u){mxClient.IS_CHROMEAPP||!c.isOffline()?c.showDialog((new MoreShapesDialog(c,!0)).container,640,isLocalStorage?mxClient.IS_IOS?480:460:440,!0,!0):c.showDialog((new MoreShapesDialog(c,!1)).container,360,isLocalStorage?mxClient.IS_IOS?-300:280:260,!0,!0)}));c.actions.put("createShape",new Action("shape...",function(u){l.isEnabled()&&(u=new mxCell("",new mxGeometry(0,0,120,120),c.defaultCustomShapeStyle),u.vertex=!0,u=new EditShapeDialog(c,u,mxResources.get("editShape")+":",630,400),c.showDialog(u.container,640,480,!0,!1),u.init())})).isEnabled=p;c.actions.put("embedHtml",new Action("html...",function(){c.getPublicUrl(c.getCurrentFile(),function(u){c.showHtmlDialog(mxResources.get("create"),"https://www.drawio.com/doc/faq/embed-html-options",-u,function(x,J,H,K,O,M,n,z,D,L,N,R){c.createHtml(x,J,H,K,O,M,n,z,D,L,N,mxUtils.bind(this,function(T,U){var W=new EmbedDialog(c,"\x3c!-- "+c.editor.appName+" diagram --\x3e\n"+T+"\n"+U+"\n",null,null,function(){var X=window.open(),Y=X.document;if(null!=Y){"CSS1Compat"===document.compatMode&&Y.writeln("<!DOCTYPE html>");Y.writeln("<html>");Y.writeln("<head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head>');Y.writeln("<body>");Y.writeln(T);var Z=mxClient.IS_IE||-mxClient.IS_EDGE||null!=document.documentMode;Z&&Y.writeln(U);Y.writeln("</body>");Y.writeln("</html>");Y.close();if(!Z){var ca=X.document.createElement("div");ca.marginLeft="26px";ca.marginTop="26px";mxUtils.write(ca,mxResources.get("updatingDocument"));Z=X.document.createElement("img");Z.setAttribute("src",window.location.protocol+"//"+window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");Z.style.marginLeft="6px";ca.appendChild(Z);X.document.body.insertBefore(ca,X.document.body.firstChild);window.setTimeout(function(){var ea=-document.createElement("script");ea.type="text/javascript";ea.src=/<script.*?src="(.*?)"/.exec(U)[1];Y.body.appendChild(ea);ca.parentNode.removeChild(ca)},20)}}else c.handleError({message:mxResources.get("errorUpdatingPreview")})});c.showDialog(W.container,450,240,!0,!0);W.init()}),R)})})}));c.actions.put("liveImage",new Action("Live image...",function(){var u=c.getCurrentFile();null!=u&&c.getPublicUrl(u,function(x){null!=x?(x=new EmbedDialog(c,'<img src="'+(u.constructor!=DriveFile?x:"https://drive.google.com/uc?id="+-u.getId())+'"/>'),c.showDialog(x.container,450,240,!0,!0),x.init()):c.handleError({message:mxResources.get("invalidPublicUrl")})})}));c.actions.put("embedImage",new Action("image...",function(){c.showEmbedImageDialog(function(u,x,J,H,K,O){c.spinner.spin(document.body,mxResources.get("loading"))&&c.createEmbedImage(u,x,J,H,K,O,function(M){c.spinner.stop();M=new EmbedDialog(c,M);c.showDialog(M.container,450,240,!0,!0);M.init()},function(M){c.spinner.stop();c.handleError(M)})},mxResources.get("image"),-mxResources.get("retina"),c.isExportToCanvas())}));c.actions.put("embedSvg",new Action("formatSvg...",function(){c.showEmbedImageDialog(function(u,x,J,H,K,O){c.spinner.spin(document.body,mxResources.get("loading"))&&c.createEmbedSvg(u,x,J,H,K,O,function(M){c.spinner.stop();M=new EmbedDialog(c,M);c.showDialog(M.container,450,240,!0,!0);M.init()},function(M){c.spinner.stop();c.handleError(M)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://www.drawio.com/doc/faq/embed-svg.html")}));-c.actions.put("embedIframe",new Action("iframe...",function(){c.getPublicUrl(c.getCurrentFile(),function(u){var x=l.getGraphBounds();c.showPublishLinkDialog(mxResources.get("iframe"),"100%",Math.ceil(Math.max(100,x.height/l.view.scale))+2,null,null,null,u,c.getCurrentFile(),function(J,H,K,O,M,n,z,D,L,N,R,T){var U=[];L&&U.push("tags=%7B%7D");J=new EmbedDialog(c,'<iframe frameborder="0" style="width:'+z+";height:"+D+';" src="'+c.createLink(J,H,!0,O,M,n,"public"==N?u:null,null,U,null,K,R,T)+'"'+(R?' allowtransparency="true"':-"")+"></iframe>");c.showDialog(J.container,450,240,!0,!0);J.init()},!0,!0)})}));c.actions.put("embedNotion",new Action("notion...",function(){var u=document.createElement("div");u.style.position="absolute";u.style.bottom="30px";u.style.textAlign="center";u.style.width="100%";u.style.left="0px";var x=document.createElement("a");x.setAttribute("href","javascript:void(0);");x.setAttribute("target","_blank");x.style.cursor="pointer";mxUtils.write(x,mxResources.get("getNotionChromeExtension"));u.appendChild(x);+EditorUi.VERSION,function(u,x){c.isOwnDomain()&&mxEvent.isShiftDown(x)&&("1"==urlParams.test?(EditorUi.debug("Debug output disabled"),urlParams.test="0"):(urlParams.test="1",EditorUi.debug("Debug output enabled")))}));c.actions.addAction("support...",function(){EditorUi.isElectronApp?c.openLink("https://github.com/jgraph/drawio-desktop/wiki/Getting-Support"):c.openLink("https://github.com/jgraph/drawio/wiki/Getting-Support")});c.actions.addAction("exportOptionsDisabled...",function(){c.handleError({message:mxResources.get("exportOptionsDisabledDetails")},+mxResources.get("exportOptionsDisabled"))});c.actions.addAction("keyboardShortcuts...",function(){!mxClient.IS_SVG||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?c.openLink("https://viewer.diagrams.net/#Uhttps%3A%2F%2Fviewer.diagrams.net%2Fshortcuts.svg"):c.openLink("shortcuts.svg")});c.actions.addAction("feedback...",function(){var u=new FeedbackDialog(c);c.showDialog(u.container,610,360,!0,!1);u.init()});c.actions.addAction("quickStart...",function(){"ac.draw.io"===window.location.hostname?c.openLink("https://www.youtube.com/watch?v=s5BG0705MHU"):+c.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});q=c.actions.addAction("tags",mxUtils.bind(this,function(){null==this.tagsWindow?(this.tagsWindow=new TagsWindow(c,document.body.offsetWidth-400,60,212,200),this.tagsWindow.window.addListener("show",mxUtils.bind(this,function(){c.fireEvent(new mxEventObject("tags"))})),this.tagsWindow.window.addListener("hide",function(){c.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.setVisible(!0),c.fireEvent(new mxEventObject("tags"))):+this.tagsWindow.window.setVisible(!this.tagsWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+K");q.setToggleAction(!0);q.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&&this.tagsWindow.window.isVisible()}));null==Editor.gptApiKey||null==Editor.gptModel||null==Editor.gptUrl||c.isOffline()||EditorUi.isElectronApp||(q=c.actions.addAction("chatWindowTitle",mxUtils.bind(this,function(){null==this.chatWindow?(this.chatWindow=new ChatWindow(c,220,document.body.offsetHeight-+380,250,320),this.chatWindow.window.addListener("show",mxUtils.bind(this,function(){c.fireEvent(new mxEventObject("chat"))})),this.chatWindow.window.addListener("hide",function(){c.fireEvent(new mxEventObject("chat"))}),this.chatWindow.window.setVisible(!0),c.fireEvent(new mxEventObject("chat"))):this.chatWindow.window.setVisible(!this.chatWindow.window.isVisible())})),q.setToggleAction(!0),q.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.chatWindow&&this.chatWindow.window.isVisible()})));+q=c.actions.addAction("findReplace",mxUtils.bind(this,function(u,x){var J=(u=l.isEnabled()&&(null==x||!mxEvent.isShiftDown(x)))?"findReplace":"find";x=J+"Window";if(null==this[x]){var H="min"==Editor.currentTheme||"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,K=u?H?330:300:240;this[x]=new FindWindow(c,document.body.offsetWidth-(K+20),100,K,u?H?304:288:170,u);this[x].window.addListener("show",function(){c.fireEvent(new mxEventObject(J))});this[x].window.addListener("hide",function(){c.fireEvent(new mxEventObject(J))})}this[x].window.setVisible(!0);+this[x].focus()}),null,null,Editor.ctrlKey+"+F");q=new Action("exportVsdx",function(){var u=null==c.pages||1>=c.pages.length;if(u)c.exportVisio();else{var x=document.createElement("div");x.style.whiteSpace="nowrap";var J=document.createElement("h3");mxUtils.write(J,mxResources.get("formatVsdx"));J.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";x.appendChild(J);var H=c.addCheckbox(x,mxResources.get("allPages"),!u,u);H.style.marginBottom="16px";u=new CustomDialog(c,x,+mxUtils.bind(this,function(){c.exportVisio(!H.checked)}),null,mxResources.get("export"));c.showDialog(u.container,300,130,!0,!0)}});q.getTitle=function(){return mxResources.get("formatVsdx")+" (beta)..."};c.actions.put("exportVsdx",q);isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed&&c.actions.addAction("configuration...",function(){var u=document.createElement("input");u.setAttribute("type","checkbox");u.style.marginRight="8px";u.checked=mxSettings.getShowStartScreen();u.defaultChecked=u.checked;+if(Editor.isSettingsEnabled()&&("sketch"==Editor.currentTheme||"simple"==Editor.currentTheme||"min"==Editor.currentTheme)){var x=document.createElement("span");x.style.display="flex";x.style.alignItems="center";x.style.cssFloat="right";x.style.cursor="pointer";x.style.userSelect="none";x.style.marginTop="-3px";x.appendChild(u);mxUtils.write(x,mxResources.get("showStartScreen"));mxEvent.addListener(x,"click",function(H){mxEvent.getSource(H)!=u&&(u.checked=!u.checked)});header=x}x=[[mxResources.get("reset"),+function(){c.confirm(mxResources.get("areYouSure"),function(){try{localStorage.removeItem(Editor.configurationKey),c.hideDialog(),c.alert(mxResources.get("restartForChangeRequired"))}catch(H){c.handleError(H)}})}]];if(!c.isOfflineApp()&&isLocalStorage&&c.mode!=App.MODE_ATLAS){var J=c.actions.get("plugins");null==J||"sketch"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&"min"!=Editor.currentTheme||x.push([mxResources.get("plugins"),J.funct])}EditorUi.isElectronApp||x.push([mxResources.get("link"),+function(H,K){if(0<K.value.length)try{var N=JSON.parse(K.value),M=window.location.protocol+"//"+window.location.host+"/"+c.getSearch()+"#_CONFIG_"+Graph.compress(JSON.stringify(N)),n=new EmbedDialog(c,M);c.showDialog(n.container,450,240,!0);n.init()}catch(A){c.handleError(A)}else c.handleError({message:mxResources.get("invalidInput")})}]);"atlassian"!=c.getServiceName()&&"1"!=urlParams.embed&&x.push([mxResources.get("preferences"),function(){c.showLocalStorageDialog(mxResources.get("preferences")++":",Editor.settingsKey,[[mxResources.get("reset"),function(){c.confirm(mxResources.get("areYouSure"),function(){try{localStorage.removeItem(Editor.settingsKey),localStorage.removeItem(".drawio-config"),c.hideDialog(),c.alert(mxResources.get("restartForChangeRequired"))}catch(H){c.handleError(H)}})}]])}]);c.showLocalStorageDialog(mxResources.get("configuration")+":",Editor.configurationKey,x,u.parentNode,"https://www.drawio.com/doc/faq/configure-diagram-editor",function(){null!=u.parentNode&&(mxSettings.setShowStartScreen(u.checked),+mxSettings.save())})});(mxClient.IS_CHROMEAPP||isLocalStorage)&&this.put("language",new Menu(mxUtils.bind(this,function(u,x){var J=mxLanguage;null==urlParams.lang&&isLocalStorage&&(J=mxSettings.settings.language);var H=mxUtils.bind(this,function(N){var M=""==N?mxResources.get("automatic"):mxLanguageMap[N],n=null;""!=M&&(n=u.addItem(M,null,mxUtils.bind(this,function(){c.setAndPersistLanguage(N)}),x),(N==J||""==N&&null==J)&&u.addCheckmark(n,Editor.checkmarkImage));return n});H("");u.addSeparator(x);+for(var K in mxLanguageMap)H(K)})));c.customLayoutConfig=[{layout:"mxHierarchicalLayout",config:{orientation:"west",intraCellSpacing:30,interRankCellSpacing:100,interHierarchySpacing:60,parallelEdgeSpacing:10}}];c.actions.addAction("runLayout",function(){c.showCustomLayoutDialog(JSON.stringify(c.customLayoutConfig,null,2))});c.actions.put("adaptiveColors",new Action("adaptiveColors",function(u){null==c.adaptiveColorsWindow&&(c.adaptiveColorsWindow=new AdaptiveColorsWindow(c,document.body.offsetWidth-+520,80,200,160));c.adaptiveColorsWindow.window.setVisible(!0)}));q=this.get("viewZoom");var D=q.funct;q.funct=mxUtils.bind(this,function(u,x){D.apply(this,arguments);"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||this.addMenuItems(u,["-","outline","fullscreen"],x)});q=this.get("layout");var G=q.funct;q.funct=function(u,x){G.apply(this,arguments);u.addItem(mxResources.get("orgChart"),null,function(){var J=null,H=20,K=20,N=function(){"undefined"!==typeof mxOrgChartLayout&&null!=J&&c.tryAndHandle(mxUtils.bind(this,+function(){var T=c.editor.graph,U=new mxOrgChartLayout(T,J,H,K),W=T.getDefaultParent();1<T.model.getChildCount(T.getSelectionCell())&&(W=T.getSelectionCell());U.execute(W)}))},M=document.createElement("div"),n=document.createElement("div");n.style.marginTop="6px";n.style.display="inline-block";n.style.width="180px";mxUtils.write(n,mxResources.get("orgChartType")+": ");M.appendChild(n);var A=document.createElement("select");A.style.width="160px";A.style.boxSizing="border-box";n=[mxResources.get("linear"),+mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")];for(var E=0;E<n.length;E++){var L=document.createElement("option");mxUtils.write(L,n[E]);L.value=E;2==E&&L.setAttribute("selected","selected");A.appendChild(L)}mxEvent.addListener(A,"change",function(){J=A.value});M.appendChild(A);n=document.createElement("div");n.style.marginTop="6px";n.style.display=+"inline-block";n.style.width="180px";mxUtils.write(n,mxResources.get("parentChildSpacing")+": ");M.appendChild(n);var O=document.createElement("input");O.type="number";O.value=H;O.style.width="160px";O.style.boxSizing="border-box";M.appendChild(O);mxEvent.addListener(O,"change",function(){H=O.value});n=document.createElement("div");n.style.marginTop="6px";n.style.display="inline-block";n.style.width="180px";mxUtils.write(n,mxResources.get("siblingSpacing")+": ");M.appendChild(n);var R=document.createElement("input");+R.type="number";R.value=K;R.style.width="160px";R.style.boxSizing="border-box";M.appendChild(R);mxEvent.addListener(R,"change",function(){K=R.value});n=mxUtils.button(mxResources.get("custom")+"...",function(){var T=[{layout:"mxOrgChartLayout",config:{branchOptimizer:parseInt(A.value),parentChildSpacing:parseInt(O.value),siblingSpacing:parseInt(R.value)}}];c.hideDialog();c.showCustomLayoutDialog(JSON.stringify(T,null,2))});n.className="geBtn";M=new CustomDialog(c,M,function(){null==J&&(J=2);c.loadOrgChartLayouts(N)},+null,null,null,n);c.showDialog(M.container,355,140,!0,!0)},x,null,p());u.addSeparator(x);u.addItem(mxResources.get("parallels"),null,mxUtils.bind(this,function(){c.tryAndHandle(mxUtils.bind(this,function(){var J=new mxParallelEdgeLayout(l);J.checkOverlap=!0;c.prompt(mxResources.get("spacing"),J.spacing,mxUtils.bind(this,function(H){c.tryAndHandle(mxUtils.bind(this,function(){J.spacing=H;c.executeLayout(function(){J.execute(l.getDefaultParent(),l.isSelectionEmpty()?null:l.getSelectionCells())},!1)}))}))}))}),+x);u.addSeparator(x);c.menus.addMenuItem(u,"runLayout",x,null,null,mxResources.get("custom")+"...")};this.put("help",new Menu(mxUtils.bind(this,function(u,x){if(!mxClient.IS_CHROMEAPP&&c.isOffline())this.addMenuItems(u,["keyboardShortcuts","-","about"],x);else{var J=u.addItem("Search:",null,null,x,null,null,!1);J.style.cursor="default";var H=document.createElement("input");H.setAttribute("type","text");H.setAttribute("size","25");H.style.borderWidth="1px";H.style.marginLeft="8px";mxEvent.addListener(H,+"keydown",mxUtils.bind(this,function(K){var N=mxUtils.trim(H.value);13==K.keyCode&&0<N.length?(this.editorUi.openLink("https://www.drawio.com/search?src="+(EditorUi.isElectronApp?"DESKTOP":encodeURIComponent(location.host))+"&search="+encodeURIComponent(N)),H.value="",EditorUi.logEvent({category:"SEARCH-HELP",action:"search",label:N}),window.setTimeout(mxUtils.bind(this,function(){this.editorUi.hideCurrentMenu()}),0)):27==K.keyCode&&(H.value="")}));J.firstChild.nextSibling.appendChild(H);mxEvent.addGestureListeners(H,+function(K){document.activeElement!=H&&H.focus();mxEvent.consume(K)},function(K){mxEvent.consume(K)},function(K){mxEvent.consume(K)});window.setTimeout(function(){H.focus()},0);EditorUi.isElectronApp?(c.actions.addAction("website...",function(){c.openLink("https://www.drawio.com")}),c.actions.addAction("check4Updates",function(){c.checkForUpdates()}),c.actions.put("desktopZoomIn",new Action("zoomIn",function(){c.desktopZoomIn()})),c.actions.put("desktopZoomOut",new Action("zoomOut",function(){c.desktopZoomOut()})),+c.actions.put("desktopResetZoom",new Action("actualSize",function(){c.desktopResetZoom()})),this.addMenuItems(u,"- keyboardShortcuts quickStart website support -".split(" "),x),"1"!=urlParams.disableUpdate&&this.addMenuItems(u,["check4Updates","-"],x),this.addMenuItems(u,"desktopResetZoom desktopZoomIn desktopZoomOut - openDevTools - about".split(" "),x)):this.addMenuItems(u,"- keyboardShortcuts quickStart support - about".split(" "),x)}"1"==urlParams.test&&(u.addSeparator(x),this.addSubmenu("testDevelop",+u,x))})));c.actions.addAction("languageCode...",function(){var u=new FilenameDialog(c,Graph.diagramLanguage||"",mxResources.get("ok"),mxUtils.bind(this,function(x){null!=x&&(Graph.diagramLanguage=0<x.length?x:null,Graph.translateDiagram=!0,l.refresh())}),mxResources.get("languageCode"),null,null,"https://www.drawio.com/blog/translate-diagrams");c.showDialog(u.container,340,80,!0,!0);u.init()});this.put("diagramLanguage",new Menu(mxUtils.bind(this,function(u,x){this.addMenuItems(u,["languageCode",+"-"],x);x=u.addItem(mxResources.get("disabled"),null,function(){Graph.translateDiagram=!1;l.refresh()},x);Graph.translateDiagram||u.addCheckmark(x,Editor.checkmarkImage)})));if("1"==urlParams.test){mxResources.parse("testDevelop=Develop");mxResources.parse("showBoundingBox=Show bounding box");mxResources.parse("createSidebarEntry=Create Sidebar Entry");mxResources.parse("testCheckFile=Check File");mxResources.parse("testDiff=Diff/Sync");mxResources.parse("testChecksum=Checksum");mxResources.parse("testCheckPages=Check Pages");+mxResources.parse("testFixPages=Fix Pages");mxResources.parse("testInspect=Inspect");mxResources.parse("testShowConsole=Show Console");mxResources.parse("testXmlImageExport=XML Image Export");mxResources.parse("testOptimize=Remove Inline Images");mxResources.parse("testPerformance=Performance");c.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){if(!l.isSelectionEmpty()){var u=l.cloneCells(l.getSelectionCells()),x=l.getBoundingBoxFromGeometry(u,!0);u=l.moveCells(u,-x.x,-x.y);c.showTextDialog("Create Sidebar Entry",+"this.addDataEntry('tag1 tag2', "+x.width+", "+x.height+", 'The Title', '"+Graph.compress(mxUtils.getXml(l.encodeCells(u)))+"'),")}}));c.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){function u(M){return null==M||null==M.boundingBox||!isNaN(M.boundingBox.x)&&!isNaN(M.boundingBox.y)&&!isNaN(M.boundingBox.width)&&!isNaN(M.boundingBox.height)}var x=l.isSelectionEmpty()?l.getGraphBounds():l.getBoundingBox(l.getSelectionCells()),J=l.view.translate,H=l.view.scale;l.insertVertex(l.getDefaultParent(),+null,"",x.x/H-J.x,x.y/H-J.y,x.width/H,x.height/H,"fillColor=none;strokeColor=red;");var K=0,N=0;l.view.states.visit(function(M,n){M=!0;u(n.shape)||(console.log("invalid shape",n.cell.id,n.shape),M=!1);u(n.text)||(console.log("invalid text",n.cell.id,n.text),M=!1);M||K++;N++});console.log("states checked",N,"invalid",K)}));c.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var u=null!=c.pages&&null!=c.getCurrentFile()?c.getCurrentFile().getAnonymizedXmlForPages(c.pages):"";u=new TextareaDialog(c,+"Paste Data:",u,function(x){if(0<x.length)try{var J=function(n){function A(Z){if(null==Y[Z]){if(Y[Z]=!0,null!=O[Z]){for(;0<O[Z].length;){var ca=O[Z].pop();A(ca)}delete O[Z]}}else mxLog.debug(E+": Visited: "+Z)}var E=n.parentNode.id,L=n.childNodes;n={};for(var O={},R=null,T={},U=0;U<L.length;U++){var W=L[U];if(null!=W.id&&0<W.id.length)if(null==n[W.id]){n[W.id]=W.id;var X=W.getAttribute("parent");null==X?null!=R?mxLog.debug(E+": Multiple roots: "+W.id):R=W.id:(null==O[X]&&(O[X]=[]),O[X].push(W.id))}else T[W.id]=+W.id}L=Object.keys(T);0<L.length?(L=E+": "+L.length+" Duplicates: "+L.join(", "),mxLog.debug(L+" (see console)")):mxLog.debug(E+": Checked");var Y={};null==R?mxLog.debug(E+": No root"):(A(R),Object.keys(Y).length!=Object.keys(n).length&&(mxLog.debug(E+": Invalid tree: (see console)"),console.log(E+": Invalid tree",O)))};"<"!=x.charAt(0)&&(x=Graph.decompress(x),mxLog.debug("See console for uncompressed XML"),console.log("xml",x));var H=mxUtils.parseXml(x),K=c.getPagesForNode(H.documentElement,"mxGraphModel");+if(null!=K&&0<K.length)try{var N=c.getHashValueForPages(K);mxLog.debug("Checksum: ",N)}catch(n){mxLog.debug("Error: ",n.message)}else mxLog.debug("No pages found for checksum");var M=H.getElementsByTagName("root");for(x=0;x<M.length;x++)J(M[x]);mxLog.show()}catch(n){c.handleError(n),null!=window.console&&console.error(n)}});c.showDialog(u.container,620,460,!0,!0);u.init()}));var B=null;c.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=c.pages){var u=new TextareaDialog(c,"Diff/Sync:",+"",function(x){var J=c.getCurrentFile();if(0<x.length&&null!=J)try{var H=JSON.parse(x);J.patch([H],null,!0,!0);c.hideDialog()}catch(K){c.handleError(K)}},null,"Close",null,null,null,!0,null,"Patch",null,[["Snapshot",function(x,J){B=c.getPagesForXml(c.getFileData(!0));u.textarea.value="Snapshot updated "+(new Date).toLocaleString()+" Checksum "+c.getHashValueForPages(B)}],["Diff",function(x,J){try{u.textarea.value=JSON.stringify(c.diffPages(B,c.pages),null,2)}catch(H){c.handleError(H)}}]]);null==B?+(B=c.getPagesForXml(c.getFileData(!0)),u.textarea.value="Snapshot created "+(new Date).toLocaleString()+" Checksum "+c.getHashValueForPages(B)):u.textarea.value=JSON.stringify(c.diffPages(B,c.pages),null,2);c.showDialog(u.container,620,460,!0,!0);u.init()}else c.alert("No pages")}));c.actions.addAction("testChecksum",mxUtils.bind(this,function(){var u=c.getCurrentFile();null!=c.pages&&null!=u?c.spinner.spin(document.body,mxResources.get("loading"))&&u.getLatestVersion(function(x){c.spinner.stop();+var J=c.getHashValueForPages(c.pages),H=u.getCurrentRevisionId(),K=c.getHashValueForPages(x.getShadowPages()),N=x.getDescriptorChecksum(x.getDescriptor()),M=x.getCurrentRevisionId();console.log("Local File",[u],"modified",u.isModified(),"checksum",J);console.log("Remote File",[x],"rev",M==H,"desc",N==K,"checksum",K);c.alert("Checksums "+(K==J?"match":"no not match"))},function(x){console.log("Error getLatestVersion",x);c.handleError(x)}):console.log("Checksum: no file or pages")}));c.actions.addAction("testCheckPages",+mxUtils.bind(this,function(){var u=c.getCurrentFile();console.log("editorUi",c,"file",u);if(null!=u&&u.isRealtime()){console.log("Checksum ownPages",c.getHashValueForPages(u.ownPages));console.log("Checksum theirPages",c.getHashValueForPages(u.theirPages));console.log("diff ownPages/theirPages",c.diffPages(u.ownPages,u.theirPages));var x=u.getShadowPages();null!=x&&(console.log("Checksum shadowPages",c.getHashValueForPages(x)),console.log("diff shadowPages/ownPages",c.diffPages(x,u.ownPages)),console.log("diff ownPages/shadowPages",+c.diffPages(u.ownPages,x)),console.log("diff theirPages/shadowPages",c.diffPages(u.theirPages,x)));null!=u.sync&&null!=u.sync.snapshot&&(console.log("Checksum snapshot",c.getHashValueForPages(u.sync.snapshot)),console.log("diff ownPages/snapshot",c.diffPages(u.ownPages,u.sync.snapshot)),console.log("diff theirPages/snapshot",c.diffPages(u.theirPages,u.sync.snapshot)),null!=c.pages&&console.log("diff snapshot/actualPages",c.diffPages(u.sync.snapshot,c.pages)));null!=c.pages&&(console.log("diff ownPages/actualPages",+c.diffPages(u.ownPages,c.pages)),console.log("diff theirPages/actualPages",c.diffPages(u.theirPages,c.pages)))}null!=u&&console.log("Shadow pages",[c.getXmlForPages(u.getShadowPages())]);null!=c.pages&&console.log("Checksum actualPages",c.getHashValueForPages(c.pages))}));c.actions.addAction("testFixPages",mxUtils.bind(this,function(){console.log("editorUi",c);var u=c.getCurrentFile();null!=u&&u.isRealtime()&&null!=u.shadowPages&&(console.log("patching actualPages to shadowPages",u.patch([c.diffPages(u.shadowPages,+c.pages)])),u.ownPages=c.clonePages(c.pages),u.theirPages=c.clonePages(c.pages),u.shadowPages=c.clonePages(c.pages),null!=u.sync&&(u.sync.snapshot=c.clonePages(c.pages)))}));c.actions.addAction("testOptimize",mxUtils.bind(this,function(){l.model.beginUpdate();try{var u=l.model.cells,x=0,J=[],H=[],K;for(K in u){var N=u[K],M=l.getCurrentCellStyle(N)[mxConstants.STYLE_IMAGE];null!=M&&"data:"==M.substring(0,5)&&(null==J[M]&&(J[M]=(J[M]||0)+1,x++),H.push(N))}l.setCellStyles(mxConstants.STYLE_IMAGE,null,+H);console.log("Removed",x,"image(s) from",H.length,"cell(s): ",[H,J])}finally{l.model.endUpdate()}}));c.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(c,l.getModel())}));c.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var u=new mxImageExport,x=l.getGraphBounds(),J=l.view.scale,H=mxUtils.createXmlDocument(),K=H.createElement("output");H.appendChild(K);H=new mxXmlCanvas2D(K);H.translate(Math.floor((1-x.x)/J),Math.floor((1-x.y)/J));H.scale(1/J);var N=+0,M=H.save;H.save=function(){N++;M.apply(this,arguments)};var n=H.restore;H.restore=function(){N--;n.apply(this,arguments)};var A=u.drawShape;u.drawShape=function(E){mxLog.debug("entering shape",E,N);A.apply(this,arguments);mxLog.debug("leaving shape",E,N)};u.drawState(l.getView().getState(l.model.root),H);mxLog.show();mxLog.debug(mxUtils.getXml(K));mxLog.debug("stateCounter",N)}));c.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=+mxPopupMenu.prototype.zIndex-2});var d=null,g=null,k=null,m=null,t=null,y=null,z=null,I=null;c.actions.addAction("testPerformance",mxUtils.bind(this,function(){null!=d?(l.view.revalidate=d,d=null):(d=l.view.revalidate,l.view.revalidate=function(){var u=Date.now(),x=d.apply(this,arguments);EditorUi.debug("[Performance] mxGraphView.revalidate",[this],"time",Date.now()-u+" ms","args",arguments);return x});null!=g?(c.selectPage=g,g=null):(g=c.selectPage,c.selectPage=function(){var u=Date.now(),x=g.apply(this,+arguments);EditorUi.debug("[Performance] EditorUi.selectPage",[this],"time",Date.now()-u+" ms","args",arguments);return x});null!=k?(c.diffPages=k,k=null):(k=c.diffPages,c.diffPages=function(){var u=Date.now(),x=k.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.diffPages",[this],"time",Date.now()-u+" ms","args",arguments);return x});null!=m?(c.patchPages=m,m=null):(m=c.patchPages,c.patchPages=function(){var u=Date.now(),x=m.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.patchPages",+[this],"time",Date.now()-u+" ms","args",arguments);return x});null!=t?(c.clonePages=t,t=null):(t=c.clonePages,c.clonePages=function(){var u=Date.now(),x=t.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.clonePages",[this],"time",Date.now()-u+" ms","args",arguments);return x});null!=z?(c.getHashValueForPages=z,z=null):(z=c.getHashValueForPages,c.getHashValueForPages=function(){var u=Date.now(),x=z.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getHashValueForPages",[this],+"time",Date.now()-u+" ms","args",arguments);return x});null!=I?(c.resolveCrossReferences=I,I=null):(I=c.resolveCrossReferences,c.resolveCrossReferences=function(){var u=Date.now(),x=I.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.resolveCrossReferences",[this],"time",Date.now()-u+" ms","args",arguments);return x});null!=y?(c.getFileData=y,y=null):(y=c.getFileData,c.getFileData=function(){var u=Date.now(),x=y.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getFileData",+[this],"time",Date.now()-u+" ms","args",arguments);return x});EditorUi.debug("[Performance]",null!=d?"Enabled":"Disabled")}));this.put("testDevelop",new Menu(mxUtils.bind(this,function(u,x){this.addMenuItems(u,"createSidebarEntry showBoundingBox - testCheckPages testChecksum testFixPages - testCheckFile testDiff - testInspect testOptimize - testXmlImageExport -".split(" "),x);var J=u.addItem(mxResources.get("testPerformance"),null,function(){c.actions.get("testPerformance").funct()},x);null!=d&&u.addCheckmark(J,+Editor.checkmarkImage);this.addMenuItems(u,["-","testShowConsole"],x)})))}c.actions.put("shapes",new Action("moreShapes...",function(u){mxClient.IS_CHROMEAPP||!c.isOffline()?c.showDialog((new MoreShapesDialog(c,!0)).container,640,isLocalStorage?mxClient.IS_IOS?480:460:440,!0,!0):c.showDialog((new MoreShapesDialog(c,!1)).container,360,isLocalStorage?mxClient.IS_IOS?300:280:260,!0,!0)}));c.actions.put("createShape",new Action("shape...",function(u){l.isEnabled()&&(u=new mxCell("",new mxGeometry(0,0,+120,120),c.defaultCustomShapeStyle),u.vertex=!0,u=new EditShapeDialog(c,u,mxResources.get("editShape")+":",630,400),c.showDialog(u.container,640,480,!0,!1),u.init())})).isEnabled=p;c.actions.put("embedHtml",new Action("html...",function(){c.getPublicUrl(c.getCurrentFile(),function(u){c.showHtmlDialog(mxResources.get("create"),"https://www.drawio.com/doc/faq/embed-html-options",u,function(x,J,H,K,N,M,n,A,E,L,O,R){c.createHtml(x,J,H,K,N,M,n,A,E,L,O,mxUtils.bind(this,function(T,U){var W=new EmbedDialog(c,+"\x3c!-- "+c.editor.appName+" diagram --\x3e\n"+T+"\n"+U+"\n",null,null,function(){try{var X=window.open();if(null!=X&&null!=X.document){var Y=X.document;"CSS1Compat"===document.compatMode&&Y.writeln("<!DOCTYPE html>");Y.writeln("<html>");Y.writeln("<head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head>');Y.writeln("<body>");Y.writeln(T);var Z=mxClient.IS_IE||mxClient.IS_EDGE||null!=document.documentMode;Z&&Y.writeln(U);Y.writeln("</body>");Y.writeln("</html>");+Y.close();if(!Z){var ca=X.document.createElement("div");ca.marginLeft="26px";ca.marginTop="26px";mxUtils.write(ca,mxResources.get("updatingDocument"));var ea=X.document.createElement("img");ea.setAttribute("src",window.location.protocol+"//"+window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");ea.style.marginLeft="6px";ca.appendChild(ea);X.document.body.insertBefore(ca,X.document.body.firstChild);window.setTimeout(function(){var ia=document.createElement("script");ia.type="text/javascript";ia.src=+/<script.*?src="(.*?)"/.exec(U)[1];Y.body.appendChild(ia);ca.parentNode.removeChild(ca)},20)}}else c.handleError({message:mxResources.get("errorUpdatingPreview")})}catch(ia){c.handleError(ia)}});c.showDialog(W.container,450,240,!0,!0);W.init()}),R)})})}));c.actions.put("liveImage",new Action("Live image...",function(){var u=c.getCurrentFile();null!=u&&c.getPublicUrl(u,function(x){null!=x?(x=new EmbedDialog(c,'<img src="'+(u.constructor!=DriveFile?x:"https://drive.google.com/uc?id="+u.getId())+'"/>'),+c.showDialog(x.container,450,240,!0,!0),x.init()):c.handleError({message:mxResources.get("invalidPublicUrl")})})}));c.actions.put("embedImage",new Action("image...",function(){c.showEmbedImageDialog(function(u,x,J,H,K,N){c.spinner.spin(document.body,mxResources.get("loading"))&&c.createEmbedImage(u,x,J,H,K,N,function(M){c.spinner.stop();M=new EmbedDialog(c,M);c.showDialog(M.container,450,240,!0,!0);M.init()},function(M){c.spinner.stop();c.handleError(M)})},mxResources.get("image"),mxResources.get("retina"),+c.isExportToCanvas())}));c.actions.put("embedSvg",new Action("formatSvg...",function(){c.showEmbedImageDialog(function(u,x,J,H,K,N){c.spinner.spin(document.body,mxResources.get("loading"))&&c.createEmbedSvg(u,x,J,H,K,N,function(M){c.spinner.stop();M=new EmbedDialog(c,M);c.showDialog(M.container,450,240,!0,!0);M.init()},function(M){c.spinner.stop();c.handleError(M)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://www.drawio.com/doc/faq/embed-svg.html")}));c.actions.put("embedIframe",+new Action("iframe...",function(){c.getPublicUrl(c.getCurrentFile(),function(u){var x=l.getGraphBounds();c.showPublishLinkDialog(mxResources.get("iframe"),"100%",Math.ceil(Math.max(100,x.height/l.view.scale))+2,null,null,null,u,c.getCurrentFile(),function(J,H,K,N,M,n,A,E,L,O,R,T){var U=[];L&&U.push("tags=%7B%7D");J=new EmbedDialog(c,'<iframe frameborder="0" style="width:'+A+";height:"+E+';" src="'+c.createLink(J,H,!0,N,M,n,"public"==O?u:null,null,U,null,K,R,T)+'"'+(R?' allowtransparency="true"':"")++"></iframe>");c.showDialog(J.container,450,240,!0,!0);J.init()},!0,!0)})}));c.actions.put("embedNotion",new Action("notion...",function(){var u=document.createElement("div");u.style.position="absolute";u.style.bottom="30px";u.style.textAlign="center";u.style.width="100%";u.style.left="0px";var x=document.createElement("a");x.setAttribute("href","javascript:void(0);");x.setAttribute("target","_blank");x.style.cursor="pointer";mxUtils.write(x,mxResources.get("getNotionChromeExtension"));u.appendChild(x);mxUtils.setPrefixedStyle(x.style,"transition","all 1s ease");mxUtils.setOpacity(x,0);window.setTimeout(function(){mxUtils.setOpacity(x,100)},300);mxEvent.addListener(x,"click",function(J){c.openLink("https://chrome.google.com/webstore/detail/drawio-for-notion/plhaalebpkihaccllnkdaokdoeaokmle");mxEvent.consume(J)});c.getPublicUrl(c.getCurrentFile(),function(J){c.showPublishLinkDialog(mxResources.get("notion"),null,null,!0,"https://www.drawio.com/blog/drawio-notion",u,J,c.getCurrentFile(),function(H,-K,O,M,n,z,D,L,N,R,T,U){D=["border=0"];N&&D.push("tags=%7B%7D");H=new EmbedDialog(c,c.createLink(H,K,!0,M,n,z,"public"==R?J:null,null,D,null,O,null,U));c.showDialog(H.container,450,240,!0,!0);H.init()},null,!0)})}));c.actions.put("publishLink",new Action("link...",function(){c.getPublicUrl(c.getCurrentFile(),function(u){c.showPublishLinkDialog(null,null,null,null,null,null,u,c.getCurrentFile(),function(x,J,H,K,O,M,n,z,D,L,N,R){n=[];K&&D&&n.push("tags=%7B%7D");x=new EmbedDialog(c,c.createLink(x,J,!0,-K,O,M,"public"==L?u:null,null,n,null,H,null,R));c.showDialog(x.container,450,240,!0,!0);x.init()},null,!0)})}));c.actions.addAction("microsoftOffice...",function(){c.openLink("https://office.draw.io")});c.actions.addAction("googleDocs...",function(){c.openLink("http://docsaddon.draw.io")});c.actions.addAction("googleSlides...",function(){c.openLink("https://slidesaddon.draw.io")});c.actions.addAction("googleSheets...",function(){c.openLink("https://sheetsaddon.draw.io")});c.actions.addAction("googleSites...",+K,N,M,n,A,E,L,O,R,T,U){E=["border=0"];O&&E.push("tags=%7B%7D");H=new EmbedDialog(c,c.createLink(H,K,!0,M,n,A,"public"==R?J:null,null,E,null,N,null,U));c.showDialog(H.container,450,240,!0,!0);H.init()},null,!0)})}));c.actions.put("publishLink",new Action("link...",function(){c.getPublicUrl(c.getCurrentFile(),function(u){c.showPublishLinkDialog(null,null,null,null,null,null,u,c.getCurrentFile(),function(x,J,H,K,N,M,n,A,E,L,O,R){n=[];K&&E&&n.push("tags=%7B%7D");x=new EmbedDialog(c,c.createLink(x,J,!0,+K,N,M,"public"==L?u:null,null,n,null,H,null,R));c.showDialog(x.container,450,240,!0,!0);x.init()},null,!0)})}));c.actions.addAction("microsoftOffice...",function(){c.openLink("https://office.draw.io")});c.actions.addAction("googleDocs...",function(){c.openLink("http://docsaddon.draw.io")});c.actions.addAction("googleSlides...",function(){c.openLink("https://slidesaddon.draw.io")});c.actions.addAction("googleSheets...",function(){c.openLink("https://sheetsaddon.draw.io")});c.actions.addAction("googleSites...",function(){c.getPublicUrl(c.getCurrentFile(),function(u){u=new GoogleSitesDialog(c,u);c.showDialog(u.container,420,256,!0,!0);u.init()})});if(isLocalStorage||mxClient.IS_CHROMEAPP)q=c.actions.addAction("scratchpad",function(){c.toggleScratchpad()}),q.setToggleAction(!0),q.setSelectedCallback(function(){return null!=c.scratchpad}),"0"!=urlParams.plugins&&c.actions.addAction("plugins...",function(){c.showDialog((new PluginsDialog(c)).container,380,240,!0,!1)});window.matchMedia&&null!=document.getElementById("high-contrast-stylesheet")&&(q=c.actions.addAction("highContrast",function(){c.setAndPersistHighContrast(!c.isHighContrast())}),q.setToggleAction(!0),q.setSelectedCallback(function(){return c.isHighContrast()}));q=c.actions.addAction("search",function(){if(null!=c.sidebar){var u=c.sidebar.isEntryVisible("search");c.sidebar.showPalette("search",!u);Editor.isSettingsEnabled()&&(mxSettings.settings.search=!u,mxSettings.save())}});q.label=mxResources.get("searchShapes");q.setToggleAction(!0);q.setSelectedCallback(function(){return null!=c.sidebar&&c.sidebar.isEntryVisible("search")});c.actions.get("clearDefaultStyle").funct=function(u){l.isEnabled()&&(c.clearDefaultStyle(),Editor.sketchMode&&c.setSketchMode(!1))};"1"==urlParams.embed&&(c.actions.get("saveAs").setEnabled(!1),c.actions.get("save").funct=function(u){l.isEditing()&&l.stopEditing();var x="0"!=urlParams.pages||null!=c.pages&&1<c.pages.length?c.getFileData(!0):mxUtils.getXml(c.editor.getGraphXml());if("json"==urlParams.proto){var J=c.createLoadMessage("save");J.xml=x;!0!==@@ -14288,26 +14293,26 @@ u||"1"!=urlParams.saveAndExit&&"1"!=urlParams.publishClose||(J.exit=!0);x=JSON.s"1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),c.actions.addAction("exit",function(){if("1"==urlParams.embedInline)c.sendEmbeddedSvgExport();else{var u=function(){c.editor.modified=!1;var x="json"==urlParams.proto?JSON.stringify({event:"exit",modified:c.editor.modified}):"";(window.opener||window.parent).postMessage(x,"*")};c.editor.modified?c.confirm(mxResources.get("allChangesLost"),null,u,mxResources.get("cancel"),mxResources.get("discardChanges")):u()}},null,null,"1"==urlParams.embedInline?"Escape":null));this.put("exportAs",new Menu(mxUtils.bind(this,function(u,x){c.isExportToCanvas()?(this.addMenuItems(u,["exportPng"],x),c.jpgSupported&&this.addMenuItems(u,["exportJpg"],x),c.webpSupported&&this.addMenuItems(u,["exportWebp"],x)):c.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(u,["exportPng","exportJpg"],x);this.addMenuItems(u,["exportSvg","-"],x);c.isOffline()||c.printPdfExport?this.addMenuItems(u,["exportPdf"],x):c.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(u,["exportPdf"],x);!c.vsdxExportEnabled()||mxClient.IS_IE||"undefined"===typeof VsdxExport&&c.isOffline()||this.addMenuItems(u,["exportVsdx"],x);this.addMenuItems(u,["-","exportHtml","exportXml","exportUrl"],x);c.isOffline()||(u.addSeparator(x),this.addMenuItem(u,"export",x).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...");mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"min"!=Editor.currentTheme||this.addMenuItems(u,["publishLink"],-x);c.mode==App.MODE_ATLAS||"1"==urlParams.extAuth||"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||(u.addSeparator(x),c.menus.addSubmenu("embed",u,x))})));this.put("importFrom",new Menu(mxUtils.bind(this,function(u,x){function J(O){O.pickFile(function(M){c.spinner.spin(document.body,mxResources.get("loading"))&&O.getFile(M,function(n){var z="data:image/"==n.getData().substring(0,11)?K(n.getTitle()):"text/xml";/\.svg$/i.test(n.getTitle())&&!c.editor.isDataSvg(n.getData())&&-(n.setData(Editor.createSvgDataUri(n.getData())),z="image/svg+xml");H(n.getData(),z,n.getTitle())},function(n){c.handleError(n,null!=n?mxResources.get("errorLoadingFile"):null)},O==c.drive)},!0)}var H=mxUtils.bind(this,function(O,M,n){var z=l.view,D=l.getGraphBounds(),L=l.snap(Math.ceil(Math.max(0,D.x/z.scale-z.translate.x)+4*l.gridSize)),N=l.snap(Math.ceil(Math.max(0,(D.y+D.height)/z.scale-z.translate.y)+4*l.gridSize));"data:image/"==O.substring(0,11)?c.loadImage(O,mxUtils.bind(this,function(R){var T=-!0,U=mxUtils.bind(this,function(){c.resizeImage(R,O,mxUtils.bind(this,function(W,X,Y){W=T?Math.min(1,Math.min(c.maxImageSize/X,c.maxImageSize/Y)):1;c.importFile(O,M,L,N,Math.round(X*W),Math.round(Y*W),n,function(Z){c.spinner.stop();l.setSelectionCells(Z);l.scrollCellToVisible(l.getSelectionCell())})}),T)});O.length>c.resampleThreshold?c.confirmImageResize(function(W){T=W;U()}):U()}),mxUtils.bind(this,function(){c.handleError({message:mxResources.get("cannotOpenFile")})})):c.importFile(O,M,L,N,0,0,-n,function(R){c.spinner.stop();l.setSelectionCells(R);l.scrollCellToVisible(l.getSelectionCell())})}),K=mxUtils.bind(this,function(O){var M="text/xml";/\.png$/i.test(O)?M="image/png":/\.jpe?g$/i.test(O)?M="image/jpg":/\.gif$/i.test(O)?M="image/gif":/\.pdf$/i.test(O)&&(M="application/pdf");return M});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=c.drive?u.addItem(mxResources.get("googleDrive")+"...",null,function(){J(c.drive)},x):c.isModeEnabled(App.MODE_GOOGLE)&&u.addItem(mxResources.get("googleDrive")++x);c.mode==App.MODE_ATLAS||"1"==urlParams.extAuth||"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||(u.addSeparator(x),c.menus.addSubmenu("embed",u,x))})));this.put("importFrom",new Menu(mxUtils.bind(this,function(u,x){function J(N){N.pickFile(function(M){c.spinner.spin(document.body,mxResources.get("loading"))&&N.getFile(M,function(n){var A="data:image/"==n.getData().substring(0,11)?K(n.getTitle()):"text/xml";/\.svg$/i.test(n.getTitle())&&!c.editor.isDataSvg(n.getData())&&+(n.setData(Editor.createSvgDataUri(n.getData())),A="image/svg+xml");H(n.getData(),A,n.getTitle())},function(n){c.handleError(n,null!=n?mxResources.get("errorLoadingFile"):null)},N==c.drive)},!0)}var H=mxUtils.bind(this,function(N,M,n){var A=l.view,E=l.getGraphBounds(),L=l.snap(Math.ceil(Math.max(0,E.x/A.scale-A.translate.x)+4*l.gridSize)),O=l.snap(Math.ceil(Math.max(0,(E.y+E.height)/A.scale-A.translate.y)+4*l.gridSize));"data:image/"==N.substring(0,11)?c.loadImage(N,mxUtils.bind(this,function(R){var T=+!0,U=mxUtils.bind(this,function(){c.resizeImage(R,N,mxUtils.bind(this,function(W,X,Y){W=T?Math.min(1,Math.min(c.maxImageSize/X,c.maxImageSize/Y)):1;c.importFile(N,M,L,O,Math.round(X*W),Math.round(Y*W),n,function(Z){c.spinner.stop();l.setSelectionCells(Z);l.scrollCellToVisible(l.getSelectionCell())})}),T)});N.length>c.resampleThreshold?c.confirmImageResize(function(W){T=W;U()}):U()}),mxUtils.bind(this,function(){c.handleError({message:mxResources.get("cannotOpenFile")})})):c.importFile(N,M,L,O,0,0,+n,function(R){c.spinner.stop();l.setSelectionCells(R);l.scrollCellToVisible(l.getSelectionCell())})}),K=mxUtils.bind(this,function(N){var M="text/xml";/\.png$/i.test(N)?M="image/png":/\.jpe?g$/i.test(N)?M="image/jpg":/\.gif$/i.test(N)?M="image/gif":/\.pdf$/i.test(N)&&(M="application/pdf");return M});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=c.drive?u.addItem(mxResources.get("googleDrive")+"...",null,function(){J(c.drive)},x):c.isModeEnabled(App.MODE_GOOGLE)&&u.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},x,null,!1));c.isModeReady(App.MODE_ONEDRIVE)?u.addItem(mxResources.get("oneDrive")+"...",null,function(){J(c.oneDrive)},x):c.isModeEnabled(App.MODE_ONEDRIVE)&&u.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},x,null,!1);c.isModeReady(App.MODE_DROPBOX)?u.addItem(mxResources.get("dropbox")+"...",null,function(){J(c.dropbox)},x):c.isModeEnabled(App.MODE_DROPBOX)&&u.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},x,null,!1);u.addSeparator(x);c.isModeReady(App.MODE_GITHUB)&&u.addItem(mxResources.get("github")+"...",null,function(){J(c.gitHub)},x);c.isModeReady(App.MODE_GITLAB)&&u.addItem(mxResources.get("gitlab")+"...",null,function(){J(c.gitLab)},x);c.isModeReady(App.MODE_TRELLO)?u.addItem(mxResources.get("trello")+"...",null,function(){J(c.trello)},x):c.isModeEnabled(App.MODE_TRELLO)&&u.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+-"...)",null,function(){},x,null,!1);u.addSeparator(x);isLocalStorage&&"0"!=urlParams.browser&&u.addItem(mxResources.get("browser")+"...",null,function(){c.importLocalFile(!1)},x);"1"!=urlParams.noDevice&&u.addItem(mxResources.get("device")+"...",null,function(){c.importLocalFile(!0)},x);c.isOffline()||(u.addSeparator(x),u.addItem(mxResources.get("url")+"...",null,function(){var O=new FilenameDialog(c,"",mxResources.get("import"),function(M){if(null!=M&&0<M.length&&c.spinner.spin(document.body,mxResources.get("loading"))){var n=-/(\.png)($|\?)/i.test(M)?"image/png":"text/xml";c.editor.loadUrl(PROXY_URL+"?url="+encodeURIComponent(M),function(z){H(z,n,M)},function(){c.spinner.stop();c.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==n)}},mxResources.get("url"));c.showDialog(O.container,300,80,!0,!0);O.init()},x))}))).isEnabled=p;this.put("dynamicAppearance",new Menu(mxUtils.bind(this,function(u,x){var J=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;"simple"==Editor.currentTheme&&+"...)",null,function(){},x,null,!1);u.addSeparator(x);isLocalStorage&&"0"!=urlParams.browser&&u.addItem(mxResources.get("browser")+"...",null,function(){c.importLocalFile(!1)},x);"1"!=urlParams.noDevice&&u.addItem(mxResources.get("device")+"...",null,function(){c.importLocalFile(!0)},x);c.isOffline()||(u.addSeparator(x),u.addItem(mxResources.get("url")+"...",null,function(){var N=new FilenameDialog(c,"",mxResources.get("import"),function(M){if(null!=M&&0<M.length&&c.spinner.spin(document.body,mxResources.get("loading"))){var n=+/(\.png)($|\?)/i.test(M)?"image/png":"text/xml";c.editor.loadUrl(PROXY_URL+"?url="+encodeURIComponent(M),function(A){H(A,n,M)},function(){c.spinner.stop();c.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==n)}},mxResources.get("url"));c.showDialog(N.container,300,80,!0,!0);N.init()},x))}))).isEnabled=p;this.put("dynamicAppearance",new Menu(mxUtils.bind(this,function(u,x){var J=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;"simple"==Editor.currentTheme&&(750>J&&this.addSubmenu("viewZoom",u,x,mxResources.get("zoom")),460>J&&c.isPageMenuVisible()&&this.addSubmenu("pages",u,x),320>J&&this.addSubmenu("insert",u,x),360>J&&"1"!=urlParams.embed&&"draw.io"==c.getServiceName()&&this.addSubmenu("share",u,x))})));this.put("appearance",new Menu(mxUtils.bind(this,function(u,x){if(c.isAutoDarkModeSupported()){var J=c.menus.addMenuItem(u,"autoMode",x);null!=J&&J.setAttribute("title",mxResources.get("automatic")+" ("+mxResources.get(Editor.isDarkMode()?"dark":"light")+")")}this.addMenuItems(u,["lightMode","darkMode","-"],x);J=c.menus.addMenuItem(u,"highContrast",x);(!c.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&c.menus.addLinkToItem(J,"https://github.com/jgraph/drawio/issues/4296")})));c.actions.addAction("addToScratchpad",function(u){l.isSelectionEmpty()||null==c.addSelectionToScratchpad||c.addSelectionToScratchpad(u)});c.actions.addAction("accounts...",function(){c.toggleUserPanel();c.userPanel.style.right="10px";c.userPanel.style.top="10px"});-this.put("theme",new Menu(mxUtils.bind(this,function(u,x){var J="1"==urlParams.sketch?"sketch":mxSettings.getUi(),H=u.addItem(mxResources.get("automatic"),null,function(){c.setCurrentTheme("")},x),K=u.addItem(mxResources.get("classic"),null,function(){c.setCurrentTheme("kennedy")},x),O=!1;if("kennedy"==J||"dark"==J)u.addCheckmark(K,Editor.checkmarkImage),O=!0;for(var M=0;M<Editor.themes.length;M++)mxUtils.bind(this,function(n){K=u.addItem(mxResources.get("min"==n?"minimal":n),null,function(){c.setCurrentTheme(n)},-x);J==n&&(u.addCheckmark(K,Editor.checkmarkImage),O=!0);"simple"==n&&u.addSeparator(x)})(Editor.themes[M]);O||u.addCheckmark(H,Editor.checkmarkImage)})));q=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var u=this.editorUi.getCurrentFile();if(null!=u)if(u.constructor==LocalFile&&null!=u.fileHandle)c.showSaveFilePicker(mxUtils.bind(c,function(J,H){u.invalidFileHandle=null;u.fileHandle=J;u.title=H.name;u.desc=H;c.save(H.name)}),null,c.createFileSystemOptions(u.getTitle()));+this.put("theme",new Menu(mxUtils.bind(this,function(u,x){var J="1"==urlParams.sketch?"sketch":mxSettings.getUi(),H=u.addItem(mxResources.get("automatic"),null,function(){c.setCurrentTheme("")},x),K=u.addItem(mxResources.get("classic"),null,function(){c.setCurrentTheme("kennedy")},x),N=!1;if("kennedy"==J||"dark"==J)u.addCheckmark(K,Editor.checkmarkImage),N=!0;for(var M=0;M<Editor.themes.length;M++)mxUtils.bind(this,function(n){K=u.addItem(mxResources.get("min"==n?"minimal":n),null,function(){c.setCurrentTheme(n)},+x);J==n&&(u.addCheckmark(K,Editor.checkmarkImage),N=!0);"simple"==n&&u.addSeparator(x)})(Editor.themes[M]);N||u.addCheckmark(H,Editor.checkmarkImage)})));q=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var u=this.editorUi.getCurrentFile();if(null!=u)if(u.constructor==LocalFile&&null!=u.fileHandle)c.showSaveFilePicker(mxUtils.bind(c,function(J,H){u.invalidFileHandle=null;u.fileHandle=J;u.title=H.name;u.desc=H;c.save(H.name)}),null,c.createFileSystemOptions(u.getTitle()));else{var x=null!=u.getTitle()?u.getTitle():this.editorUi.defaultFilename;x=new FilenameDialog(this.editorUi,x,mxResources.get("rename"),mxUtils.bind(this,function(J){null!=J&&0<J.length&&null!=u&&J!=u.getTitle()&&this.editorUi.spinner.spin(document.body,mxResources.get("renaming"))&&u.rename(J,mxUtils.bind(this,function(H){this.editorUi.spinner.stop()}),mxUtils.bind(this,function(H){this.editorUi.handleError(H,null!=H?mxResources.get("errorRenamingFile"):null)}))}),u.constructor==DriveFile||u.constructor==StorageFile?mxResources.get("diagramName"):null,function(J){if(null!=J&&0<J.length)return!0;c.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok"));return!1},null,FilenameDialog.filenameHelpLink,null,null,c.editor.fileExtensions);this.editorUi.showDialog(x.container,340,100,!0,!0);x.init()}}));q.isEnabled=function(){return this.enabled&&p.apply(this,arguments)};q.visible="1"!=urlParams.embed;c.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var u=c.getCurrentFile();if(null!=u){var x=c.getCopyFilename(u);u.constructor==DriveFile?(x=new CreateDialog(c,x,mxUtils.bind(this,function(J,H){"_blank"==H?c.editor.editAsNew(c.getFileData(),J):("download"==H&&(H=App.MODE_GOOGLE),null!=J&&0<J.length&&(H==App.MODE_GOOGLE?c.spinner.spin(document.body,mxResources.get("saving"))&&u.saveAs(J,mxUtils.bind(this,function(K){u.desc=K;u.save(!1,mxUtils.bind(this,function(){c.spinner.stop();u.setModified(!1);c.updateStatus(mxUtils.bind(this,function(){u.addAllSavedStatus()}))}),mxUtils.bind(this,-function(O){c.handleError(O)}))}),mxUtils.bind(this,function(K){c.handleError(K)})):c.createFile(J,c.getFileData(!0),null,H)))}),mxUtils.bind(this,function(){c.hideDialog()}),mxResources.get("makeCopy"),mxResources.get("create"),null,null,!0,null,!0,null,null,null,null,c.editor.fileExtensions),c.showDialog(x.container,420,380,!0,!0),x.init()):c.editor.editAsNew(this.editorUi.getFileData(!0),x)}}));q=new Action("openFolder",function(u,x){u=c.getCurrentFile();null!=u&&c.openLink(u.getFolderUrl())});+function(N){c.handleError(N)}))}),mxUtils.bind(this,function(K){c.handleError(K)})):c.createFile(J,c.getFileData(!0),null,H)))}),mxUtils.bind(this,function(){c.hideDialog()}),mxResources.get("makeCopy"),mxResources.get("create"),null,null,!0,null,!0,null,null,null,null,c.editor.fileExtensions),c.showDialog(x.container,420,380,!0,!0),x.init()):c.editor.editAsNew(this.editorUi.getFileData(!0),x)}}));q=new Action("openFolder",function(u,x){u=c.getCurrentFile();null!=u&&c.openLink(u.getFolderUrl())});q.getTitle=function(){return mxResources.get("openIt",[mxResources.get("folder")])+"..."};c.actions.put("openFolder",q);c.actions.addAction("openFile...",mxUtils.bind(this,function(){var u=c.getCurrentFile();null!=u&&c.openLink(u.getFileUrl())}));c.actions.addAction("moveToFolder...",mxUtils.bind(this,function(){var u=c.getCurrentFile();if(u.getMode()==App.MODE_GOOGLE||u.getMode()==App.MODE_ONEDRIVE){var x=!1;if(u.getMode()==App.MODE_GOOGLE&&null!=u.desc.parents)for(var J=0;J<u.desc.parents.length;J++)if(u.desc.parents[J].isRoot){x=!0;break}c.pickFolder(u.getMode(),mxUtils.bind(this,function(H){c.spinner.spin(document.body,mxResources.get("moving"))&&u.move(H,mxUtils.bind(this,function(K){c.spinner.stop()}),mxUtils.bind(this,function(K){c.handleError(K)}))}),null,!0,x)}}));this.put("publish",new Menu(mxUtils.bind(this,function(u,x){this.addMenuItems(u,["publishLink"],x)})));c.actions.put("useOffline",new Action("useOffline...",function(){c.openLink("https://app.draw.io/")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){try{var u=c.getCurrentFile();null!=u&&u.share()}catch(x){c.handleError(x)}})).isEnabled=p;this.put("embed",new Menu(mxUtils.bind(this,function(u,x){var J=c.getCurrentFile();null==J||J.getMode()!=App.MODE_GOOGLE&&J.getMode()!=App.MODE_GITHUB||!/(\.png)$/i.test(J.getTitle())||this.addMenuItems(u,["liveImage","-"],x);this.addMenuItems(u,["embedImage","embedSvg","-","embedHtml"],x);navigator.standalone||c.isOffline()||this.addMenuItems(u,["embedIframe"],x);"1"==urlParams.embed||c.isOffline()||-this.addMenuItems(u,"- googleDocs googleSlides googleSheets - microsoftOffice - embedNotion".split(" "),x)})));c.addInsertItem=function(u,x,J,H){("plantUml"!=H||EditorUi.enablePlantUml&&!c.isOffline())&&u.addItem(J,null,mxUtils.bind(this,function(){if("fromText"==H||"formatSql"==H||"plantUml"==H||"mermaid"==H){var K=new ParseDialog(c,J,H);c.showDialog(K.container,620,420,!0,!1);c.dialog.container.style.overflow="auto"}else K=new CreateGraphDialog(c,J,H),c.showDialog(K.container,620,420,!0,!1,function(O,+this.addMenuItems(u,"- googleDocs googleSlides googleSheets - microsoftOffice - embedNotion".split(" "),x)})));c.addInsertItem=function(u,x,J,H){("plantUml"!=H||EditorUi.enablePlantUml&&!c.isOffline())&&u.addItem(J,null,mxUtils.bind(this,function(){if("fromText"==H||"formatSql"==H||"plantUml"==H||"mermaid"==H){var K=new ParseDialog(c,J,H);c.showDialog(K.container,620,420,!0,!1);c.dialog.container.style.overflow="auto"}else K=new CreateGraphDialog(c,J,H),c.showDialog(K.container,620,420,!0,!1,function(N,M){if(M)return c.confirm(mxResources.get("areYouSure"),function(){c.hideDialog()}),!1;null!=K.graph&&(null!=K.graph.container.parentNode&&K.graph.container.parentNode.removeChild(K.graph.container),K.graph.destroy(),K.graph=null)});K.init()}),x,null,p())};var F=function(u){l.getModel().beginUpdate();try{u=l.addCell(u),l.fireEvent(new mxEventObject("cellsInserted","cells",[u])),l.model.isVertex(u)&&l.isAutoSizeCell(u)&&l.updateCellSize(u)}finally{l.getModel().endUpdate()}l.scrollCellToVisible(u);l.setSelectionCell(u);l.container.focus();l.editAfterInsert&&l.startEditing(u);window.setTimeout(function(){null!=c.hoverIcons&&c.hoverIcons.update(l.view.getState(u))},0);return u},C=function(u,x,J,H,K){u=new mxCell(u,new mxGeometry(0,0,x,J),H);u.vertex=!0;null==K&&(K=l.getCenterInsertPoint(l.getBoundingBoxFromGeometry([u],!0)));u.geometry.x=K.x;u.geometry.y=K.y;return F(u)};c.actions.put("insertText",new Action("text",function(u){l.isEnabled()&&!l.isCellLocked(l.getDefaultParent())&&l.startEditingAtCell(C("Text",60,30,l.appendFontSize("text;strokeColor=none;align=center;fillColor=none;html=1;verticalAlign=middle;whiteSpace=wrap;rounded=0;",l.vertexFontSize),null==u||mxEvent.isControlDown(u)||mxEvent.isMetaDown(u)||!l.isMouseInsertPoint()?null:l.getInsertPoint()))},null,null,"A")).isEnabled=p;c.actions.put("insertRectangle",new Action("rectangle",function(u){l.isEnabled()&&!l.isCellLocked(l.getDefaultParent())&&C("",120,60,"whiteSpace=wrap;html=1;",null==u||mxEvent.isControlDown(u)||mxEvent.isMetaDown(u)||!l.isMouseInsertPoint()?@@ -14319,7 +14324,7 @@ q.setSelectedCallback(mxUtils.bind(this,function(){return null!=c.sidebarWindow&c.insertTemplateEnabled&&!c.isOffline()&&c.menus.addMenuItems(u,["insertTemplate"],x),c.menus.addMenuItems(u,["insertImage","insertLink","-"],x),c.menus.addSubmenu("insertAdvanced",u,x,mxResources.get("advanced")),c.menus.addSubmenu("layout",u,x)):(this.addMenuItems(u,"insertRectangle insertEllipse insertRhombus - insertEdge insertNote - insertText insertLink - createShape insertFreehand - insertImage".split(" "),x),c.insertTemplateEnabled&&!c.isOffline()&&this.addMenuItems(u,["insertTemplate"],x),u.addSeparator(x),"min"==uiTheme||"simple"==Editor.currentTheme?(this.addSubmenu("layout",u,x),this.addSubmenu("insertLayout",u,x,mxResources.get("insert")),u.addSeparator(x),this.addSubmenu("table",u,x)):this.addSubmenu("insertLayout",u,x,mxResources.get("layout")),this.addSubmenu("insertAdvanced",u,x,mxResources.get("advanced")))})));this.put("table",new Menu(mxUtils.bind(this,function(u,x){c.menus.addInsertTableCellItem(u,x)})));this.put("insertLayout",new Menu(mxUtils.bind(this,function(u,x){c.addInsertMenuItems(u,x,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "))})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(u,x){var J=["fromText","plantUml"].concat(window.isMermaidEnabled?["mermaid"]:[]).concat(["-","formatSql"]);c.addInsertMenuItems(u,x,J);u.addItem(mxResources.get("csv")+"...",null,function(){l.popupMenuHandler.hideMenu();c.showImportCsvDialog()},x,null,p());"simple"!=Editor.currentTheme&&"min"!=Editor.currentTheme||this.addMenuItems(u,-["-","createShape","editDiagram"],x)})));this.put("openRecent",new Menu(function(u,x){var J=c.getRecent();if(null!=J){for(var H=0;H<J.length;H++)(function(K){var O=K.mode;O==App.MODE_GOOGLE?O="googleDrive":O==App.MODE_ONEDRIVE&&(O="oneDrive");u.addItem(K.title+" ("+mxResources.get(O)+")",null,function(){c.loadFile(K.id)},x)})(J[H]);u.addSeparator(x)}u.addItem(mxResources.get("reset"),null,function(){c.resetRecent()},x)}));this.put("openFrom",new Menu(function(u,x){null!=c.drive?u.addItem(mxResources.get("googleDrive")++["-","createShape","editDiagram"],x)})));this.put("openRecent",new Menu(function(u,x){var J=c.getRecent();if(null!=J){for(var H=0;H<J.length;H++)(function(K){var N=K.mode;N==App.MODE_GOOGLE?N="googleDrive":N==App.MODE_ONEDRIVE&&(N="oneDrive");u.addItem(K.title+" ("+mxResources.get(N)+")",null,function(){c.loadFile(K.id)},x)})(J[H]);u.addSeparator(x)}u.addItem(mxResources.get("reset"),null,function(){c.resetRecent()},x)}));this.put("openFrom",new Menu(function(u,x){null!=c.drive?u.addItem(mxResources.get("googleDrive")+"...",null,function(){c.pickFile(App.MODE_GOOGLE)},x):c.isModeEnabled(App.MODE_GOOGLE)&&u.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},x,null,!1);c.isModeReady(App.MODE_ONEDRIVE)?u.addItem(mxResources.get("oneDrive")+"...",null,function(){c.pickFile(App.MODE_ONEDRIVE)},x):c.isModeEnabled(App.MODE_ONEDRIVE)&&u.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},x,null,!1);c.isModeReady(App.MODE_DROPBOX)?u.addItem(mxResources.get("dropbox")+"...",null,function(){c.pickFile(App.MODE_DROPBOX)},x):c.isModeEnabled(App.MODE_DROPBOX)&&u.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},x,null,!1);u.addSeparator(x);c.isModeReady(App.MODE_GITHUB)&&u.addItem(mxResources.get("github")+"...",null,function(){c.pickFile(App.MODE_GITHUB)},x);c.isModeReady(App.MODE_GITLAB)&&u.addItem(mxResources.get("gitlab")+"...",null,function(){c.pickFile(App.MODE_GITLAB)},x);c.isModeReady(App.MODE_TRELLO)?u.addItem(mxResources.get("trello")+"...",null,function(){c.pickFile(App.MODE_TRELLO)},x):c.isModeEnabled(App.MODE_TRELLO)&&u.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},x,null,!1);u.addSeparator(x);isLocalStorage&&"0"!=urlParams.browser&&u.addItem(mxResources.get("browser")+"...",null,function(){c.pickFile(App.MODE_BROWSER)},x);"1"!=urlParams.noDevice&&u.addItem(mxResources.get("device")+"...",null,function(){c.pickFile(App.MODE_DEVICE)},x);c.isOffline()||(u.addSeparator(x),u.addItem(mxResources.get("url")+@@ -14331,8 +14336,8 @@ null,null,null,App.MODE_GITHUB)},x);c.isModeReady(App.MODE_GITLAB)&&u.addItem(mxtypeof google&&"undefined"!=typeof google.picker&&(null!=c.drive?u.addItem(mxResources.get("googleDrive")+"...",null,function(){c.pickLibrary(App.MODE_GOOGLE)},x):c.isModeEnabled(App.MODE_GOOGLE)&&u.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},x,null,!1));c.isModeReady(App.MODE_ONEDRIVE)?u.addItem(mxResources.get("oneDrive")+"...",null,function(){c.pickLibrary(App.MODE_ONEDRIVE)},x):c.isModeEnabled(App.MODE_ONEDRIVE)&&u.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},x,null,!1);c.isModeReady(App.MODE_DROPBOX)?u.addItem(mxResources.get("dropbox")+"...",null,function(){c.pickLibrary(App.MODE_DROPBOX)},x):c.isModeEnabled(App.MODE_DROPBOX)&&u.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},x,null,!1);u.addSeparator(x);c.isModeReady(App.MODE_GITHUB)&&u.addItem(mxResources.get("github")+"...",null,function(){c.pickLibrary(App.MODE_GITHUB)},x);c.isModeReady(App.MODE_GITLAB)&&u.addItem(mxResources.get("gitlab")+"...",null,function(){c.pickLibrary(App.MODE_GITLAB)},x);c.isModeReady(App.MODE_TRELLO)?u.addItem(mxResources.get("trello")+"...",null,function(){c.pickLibrary(App.MODE_TRELLO)},x):c.isModeEnabled(App.MODE_TRELLO)&&u.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},x,null,!1);u.addSeparator(x);isLocalStorage&&"0"!=urlParams.browser&&u.addItem(mxResources.get("browser")+"...",null,function(){c.pickLibrary(App.MODE_BROWSER)},-x);"1"!=urlParams.noDevice&&u.addItem(mxResources.get("device")+"...",null,function(){c.pickLibrary(App.MODE_DEVICE)},x);c.isOffline()||(u.addSeparator(x),u.addItem(mxResources.get("url")+"...",null,function(){var J=new FilenameDialog(c,"",mxResources.get("open"),function(H){if(null!=H&&0<H.length&&c.spinner.spin(document.body,mxResources.get("loading"))){var K=H;c.editor.isCorsEnabledForUrl(H)||(K=PROXY_URL+"?url="+encodeURIComponent(H));mxUtils.get(K,function(O){if(200<=O.getStatus()&&299>=O.getStatus()){c.spinner.stop();-try{c.loadLibrary(new UrlLibrary(c,O.getText(),H)),c.showSidebar()}catch(M){c.handleError(M,mxResources.get("errorLoadingFile"))}}else c.spinner.stop(),c.handleError(null,mxResources.get("errorLoadingFile"))},function(){c.spinner.stop();c.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));c.showDialog(J.container,300,80,!0,!0);J.init()},x));"1"==urlParams.confLib&&(u.addSeparator(x),u.addItem(mxResources.get("confluenceCloud")+"...",null,function(){c.showRemotelyStoredLibrary(mxResources.get("libraries"))},+x);"1"!=urlParams.noDevice&&u.addItem(mxResources.get("device")+"...",null,function(){c.pickLibrary(App.MODE_DEVICE)},x);c.isOffline()||(u.addSeparator(x),u.addItem(mxResources.get("url")+"...",null,function(){var J=new FilenameDialog(c,"",mxResources.get("open"),function(H){if(null!=H&&0<H.length&&c.spinner.spin(document.body,mxResources.get("loading"))){var K=H;c.editor.isCorsEnabledForUrl(H)||(K=PROXY_URL+"?url="+encodeURIComponent(H));mxUtils.get(K,function(N){if(200<=N.getStatus()&&299>=N.getStatus()){c.spinner.stop();+try{c.loadLibrary(new UrlLibrary(c,N.getText(),H)),c.showSidebar()}catch(M){c.handleError(M,mxResources.get("errorLoadingFile"))}}else c.spinner.stop(),c.handleError(null,mxResources.get("errorLoadingFile"))},function(){c.spinner.stop();c.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));c.showDialog(J.container,300,80,!0,!0);J.init()},x));"1"==urlParams.confLib&&(u.addSeparator(x),u.addItem(mxResources.get("confluenceCloud")+"...",null,function(){c.showRemotelyStoredLibrary(mxResources.get("libraries"))},x))})));this.put("edit",new Menu(mxUtils.bind(this,function(u,x){this.addMenuItems(u,"undo redo - cut copy copyAsImage paste delete - duplicate - findReplace - editData editTooltip - editStyle editGeometry - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))})));q=c.actions.addAction("comments",mxUtils.bind(this,function(){if(null==this.commentsWindow)this.commentsWindow=new CommentsWindow(c,document.body.offsetWidth-380,120,300,350),this.commentsWindow.window.addListener("show",function(){c.fireEvent(new mxEventObject("comments"))}),this.commentsWindow.window.addListener("hide",function(){c.fireEvent(new mxEventObject("comments"))}),this.commentsWindow.window.setVisible(!0),c.fireEvent(new mxEventObject("comments"));else{var u=!this.commentsWindow.window.isVisible();this.commentsWindow.window.setVisible(u);this.commentsWindow.refreshCommentsTime();u&&this.commentsWindow.hasError&&this.commentsWindow.refreshComments()}}));q.setToggleAction(!0);q.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.commentsWindow&&this.commentsWindow.window.isVisible()}));c.editor.addListener("fileLoaded",mxUtils.bind(this,function(){null!=this.commentsWindow&&(this.commentsWindow.destroy(),this.commentsWindow=null)}));this.get("viewPanels").funct=function(u,x){var J=c.getCurrentFile();c.menus.addMenuItems(u,"toggleShapes format ruler - findReplace layers tags chatWindowTitle outline -".split(" "),x);c.commentsSupported()&&c.menus.addMenuItems(u,["-","comments"],x);null!=J&&J.isRealtimeEnabled()&&@@ -14341,16 +14346,16 @@ J.isRealtimeSupported()&&c.menus.addMenuItems(u,["-","showRemoteCursors","shareC["comments","-"]:["-"]));this.addMenuItems(u,["-","search"],x);if(isLocalStorage||mxClient.IS_CHROMEAPP)H=this.addMenuItem(u,"scratchpad",x),(!c.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(H,"https://www.drawio.com/doc/faq/scratchpad");this.addMenuItems(u,["toggleShapes","-","pageView","pageScale"]);this.addSubmenu("units",u,x);u.addSeparator(x);c.isPageMenuVisible()&&c.menus.addMenuItems(u,["pageTabs"],x);this.addMenuItems(u,"ruler - tooltips animations - grid guides - connectionArrows connectionPoints - resetView zoomIn zoomOut".split(" "),x);"1"!=urlParams.sketch&&this.addMenuItems(u,["-","fullscreen"],x)}})));this.put("editCell",new Menu(mxUtils.bind(this,function(u,x){this.addMenuItems(u,"editLink editShape editImage crop - editData copyData pasteData - editConnectionPoints editGeometry - editTooltip editStyle - edit".split(" "),x)})));this.put("currentPage",new Menu(mxUtils.bind(this,function(u,x){var J=c.currentPage;null!=J&&(u.addItem(mxResources.get("rename")+"...",null,mxUtils.bind(this,function(){c.renamePage(J,J.getName())}),x),u.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){c.removePage(J)}),x),1<c.pages.length&&(c.menus.addSubmenu("movePage",u,x,mxResources.get("move")),u.addSeparator(x)),u.addSeparator(x),u.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){c.duplicatePage(J,mxResources.get("copyOf",[J.getName()]))}),x),1!=urlParams.embed&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=c.getServiceName()||u.addItem(mxResources.get("openInNewWindow"),null,mxUtils.bind(this,-function(){c.editor.editAsNew(c.getFileData(!0,null,null,null,!0,!0))}),x)))})));this.put("pages",new Menu(mxUtils.bind(this,function(u,x){var J=c.currentPage;c.editor.graph.isLightboxView()||(u.addItem(mxResources.get("insertPage"),null,mxUtils.bind(this,function(){try{c.insertPage()}catch(K){c.handleError(K)}}),x,null,c.editor.graph.isEnabled()),u.addSeparator(x));if(null!=c.pages)for(var H=0;H<c.pages.length;H++)mxUtils.bind(this,function(K){var O=null;O=c.pages[K]==J&&!c.editor.graph.isLightboxView()&&-c.editor.graph.isEnabled()?c.menus.addSubmenu("currentPage",u,x,c.getShortPageName(J)):u.addItem(c.getShortPageName(c.pages[K]),null,mxUtils.bind(this,function(){c.selectPage(c.pages[K])}),x);var M=c.pages[K].getId();O.setAttribute("title",c.pages[K].getName()+" ("+(K+1)+"/"+c.pages.length+")"+(null!=M?" ["+M+"]":""));c.pages[K]==J&&u.addCheckmark(O,Editor.checkmarkImage)})(H)})));if(EditorUi.isElectronApp){var Q="1"==urlParams.enableSpellCheck;q=c.actions.addAction("spellCheck",function(){c.toggleSpellCheck();+function(){c.editor.editAsNew(c.getFileData(!0,null,null,null,!0,!0))}),x)))})));this.put("pages",new Menu(mxUtils.bind(this,function(u,x){var J=c.currentPage;c.editor.graph.isLightboxView()||(u.addItem(mxResources.get("insertPage"),null,mxUtils.bind(this,function(){try{c.insertPage()}catch(K){c.handleError(K)}}),x,null,c.editor.graph.isEnabled()),u.addSeparator(x));if(null!=c.pages)for(var H=0;H<c.pages.length;H++)mxUtils.bind(this,function(K){var N=null;N=c.pages[K]==J&&!c.editor.graph.isLightboxView()&&+c.editor.graph.isEnabled()?c.menus.addSubmenu("currentPage",u,x,c.getShortPageName(J)):u.addItem(c.getShortPageName(c.pages[K]),null,mxUtils.bind(this,function(){c.selectPage(c.pages[K])}),x);var M=c.pages[K].getId();N.setAttribute("title",c.pages[K].getName()+" ("+(K+1)+"/"+c.pages.length+")"+(null!=M?" ["+M+"]":""));c.pages[K]==J&&u.addCheckmark(N,Editor.checkmarkImage)})(H)})));if(EditorUi.isElectronApp){var Q="1"==urlParams.enableSpellCheck;q=c.actions.addAction("spellCheck",function(){c.toggleSpellCheck();Q=!Q;c.alert(mxResources.get("restartForChangeRequired"))});q.setToggleAction(!0);q.setSelectedCallback(function(){return Q});var S="1"==urlParams.enableStoreBkp;q=c.actions.addAction("autoBkp",function(){c.toggleStoreBkp();S=!S});q.setToggleAction(!0);q.setSelectedCallback(function(){return S});var V="1"==urlParams.isGoogleFontsEnabled;q=c.actions.addAction("googleFonts",function(){c.toggleGoogleFonts();V=!V;c.alert(mxResources.get("restartForChangeRequired"))});q.setToggleAction(!0);q.setSelectedCallback(function(){return V});c.actions.addAction("openDevTools",function(){c.openDevTools()});c.actions.addAction("drafts...",function(){var u=new FilenameDialog(c,EditorUi.draftSaveDelay/1E3+"",mxResources.get("apply"),mxUtils.bind(this,function(x){x=parseInt(x);0<=x&&(EditorUi.draftSaveDelay=1E3*x,EditorUi.enableDrafts=0<x,mxSettings.setDraftSaveDelay(x),mxSettings.save())}),mxResources.get("draftSaveInt"));c.showDialog(u.container,320,80,!0,!0);u.init()})}var P=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(u,x){if("simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme){null==P||"1"==urlParams.embed&&null!=urlParams.lang||c.menus.addSubmenu("language",u,x);"1"==urlParams.embed&&"1"!=urlParams.atlas||"1"==urlParams.extAuth||"1"==urlParams.embedInline||c.menus.addSubmenu("appearance",u,x);"1"!=urlParams.embed&&"1"!=urlParams.extAuth&&c.mode!=App.MODE_ATLAS&&c.menus.addSubmenu("theme",u,x);u.addSeparator(x);c.menus.addSubmenu("units",u,x);c.menus.addMenuItems(u,"- copyConnect collapseExpand - tooltips animations -".split(" "),x);var J=c.getCurrentFile();"simple"!=Editor.currentTheme&&(null!=J&&J.isRealtimeEnabled()&&J.isRealtimeSupported()&&this.addMenuItems(u,["showRemoteCursors"],x),c.menus.addMenuItems(u,["ruler","-"],x));EditorUi.isElectronApp&&c.menus.addMenuItems(u,"- googleFonts spellCheck autoBkp drafts -".split(" "),x);this.addSubmenu("diagramLanguage",u,x);u.addSeparator(x);c.mode!=App.MODE_ATLAS&&c.menus.addMenuItem(u,"configuration",x);u.addSeparator(x)}else"1"==urlParams.embed&&null!=urlParams.lang||this.addSubmenu("language",u,x),"1"==urlParams.embed&&"1"!=urlParams.atlas||c.menus.addSubmenu("appearance",u,x),"1"!=urlParams.embed&&"1"!=urlParams.extAuth&&c.mode!=App.MODE_ATLAS&&this.addSubmenu("theme",u,x),EditorUi.isElectronApp&&this.addMenuItems(u,"- googleFonts spellCheck autoBkp drafts -".split(" "),x),u.addSeparator(x),J=this.addSubmenu("adaptiveColors",u,x),(!c.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&c.menus.addLinkToItem(J,"https://github.com/jgraph/drawio/discussions/4713"),"undefined"!==typeof MathJax&&(J=this.addMenuItem(u,"mathematicalTypesetting",x),(!c.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(J,"https://www.drawio.com/doc/faq/math-typesetting")),"1"!=urlParams.embed&&(J=c.getCurrentFile(),null!=J&&J.isRealtimeEnabled()&&J.isRealtimeSupported()&&this.addMenuItems(u,["-","showRemoteCursors","shareCursor"],x),u.addSeparator(x),(isLocalStorage||mxClient.IS_CHROMEAPP)&&this.addMenuItems(u,["showStartScreen"],x),this.addMenuItems(u,-["autosave"],x)),this.addMenuItems(u,["-","copyConnect","collapseExpand","-"],x),this.addSubmenu("diagramLanguage",u,x),this.addMenuItems(u,["editDiagram","-"],x),!c.isOfflineApp()&&isLocalStorage&&this.addMenuItem(u,"plugins",x),this.addMenuItems(u,["configuration"],x)})));this.put("movePage",new Menu(mxUtils.bind(this,function(u,x){var J=c.currentPage,H=c.getPageIndex(J);if(null!=c.pages)for(var K=0;K<c.pages.length;K++)K!=H&&function(O){u.addItem(c.getShortPageName(c.pages[O]),null,function(){c.movePage(H,-O);c.scrollToPage(J,!0)},x)}(K)})));this.put("share",new Menu(mxUtils.bind(this,function(u,x){if(!c.isStandaloneApp()){var J=c.isOffline(!0)?mxResources.get("offline"):c.getNetworkStatus();null!=J&&(u.addItem(J,null,null,x,null,!1),u.addSeparator(x));c.menus.addMenuItems(u,["share"],x)}this.addMenuItem(u,"publishLink",x,null,null,mxResources.get("publish")+"...");null!=c.getMainUser()&&this.addMenuItems(u,["accounts"],x)})));this.put("diagram",new Menu(mxUtils.bind(this,function(u,x){var J=c.getCurrentFile();+["autosave"],x)),this.addMenuItems(u,["-","copyConnect","collapseExpand","-"],x),this.addSubmenu("diagramLanguage",u,x),this.addMenuItems(u,["editDiagram","-"],x),!c.isOfflineApp()&&isLocalStorage&&this.addMenuItem(u,"plugins",x),this.addMenuItems(u,["configuration"],x)})));this.put("movePage",new Menu(mxUtils.bind(this,function(u,x){var J=c.currentPage,H=c.getPageIndex(J);if(null!=c.pages)for(var K=0;K<c.pages.length;K++)K!=H&&function(N){u.addItem(c.getShortPageName(c.pages[N]),null,function(){c.movePage(H,+N);c.scrollToPage(J,!0)},x)}(K)})));this.put("share",new Menu(mxUtils.bind(this,function(u,x){if(!c.isStandaloneApp()){var J=c.isOffline(!0)?mxResources.get("offline"):c.getNetworkStatus();null!=J&&(u.addItem(J,null,null,x,null,!1),u.addSeparator(x));c.menus.addMenuItems(u,["share"],x)}this.addMenuItem(u,"publishLink",x,null,null,mxResources.get("publish")+"...");null!=c.getMainUser()&&this.addMenuItems(u,["accounts"],x)})));this.put("diagram",new Menu(mxUtils.bind(this,function(u,x){var J=c.getCurrentFile();"simple"!=Editor.currentTheme&&(c.menus.addSubmenu("extras",u,x,mxResources.get("settings")),u.addSeparator(x));var H="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme;if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)c.menus.addMenuItems(u,"new open - synchronize properties - save saveAs -".split(" "),x);else if(c.mode==App.MODE_ATLAS){"1"!=urlParams.noSaveBtn&&"1"!=urlParams.embedInline&&c.menus.addMenuItems(u,["-","save"],x);if("1"==urlParams.saveAndExit||"1"==urlParams.noSaveBtn&&"0"!=urlParams.saveAndExit||c.mode==App.MODE_ATLAS)c.menus.addMenuItems(u,["saveAndExit"],x),null!=J&&J.isRevisionHistorySupported()&&c.menus.addMenuItems(u,["revisionHistory"],x);u.addSeparator(x)}else c.mode==App.MODE_ATLAS?c.menus.addMenuItems(u,["save","synchronize","-"],x):"1"!=urlParams.noFileMenu&&(c.menus.addSubmenu("file",u,x),u.addSeparator(x),"min"==Editor.currentTheme&&(c.menus.addMenuItems(u,"toggleShapes format layers tags chatWindowTitle - findReplace".split(" "),x),c.commentsSupported()&&c.menus.addMenuItems(u,["comments"],x),u.addSeparator(x)));c.menus.addSubmenu("exportAs",u,x);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"atlassian"==c.getServiceName()?c.menus.addMenuItems(u,["import"],x):"1"!=urlParams.noFileMenu&&c.menus.addSubmenu("importFrom",u,x);"simple"!=Editor.currentTheme&&"min"!=Editor.currentTheme?(c.menus.addMenuItems(u,["-","findReplace"],x),c.commentsSupported()&&c.menus.addMenuItems(u,["comments","-"],x),c.menus.addMenuItems(u,"toggleShapes format layers tags chatWindowTitle -".split(" "),@@ -14366,15 +14371,15 @@ c.defaultFilename;(J.constructor==DriveFile&&null!=J.sync&&J.sync.isConnected()|this.addLinkToItem(H,"https://www.drawio.com/doc/faq/synchronize"),u.addSeparator(x)):this.addMenuItems(u,["new"],x),this.addSubmenu("openFrom",u,x),isLocalStorage&&this.addSubmenu("openRecent",u,x),null!=J&&J.constructor==DriveFile?this.addMenuItems(u,"new - rename makeCopy openFolder moveToFolder".split(" "),x):(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null==J||J.constructor==LocalFile&&null==J.fileHandle||(u.addSeparator(x),H=this.addMenuItem(u,"synchronize",x),(!c.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(H,"https://www.drawio.com/doc/faq/synchronize")),this.addMenuItems(u,["-","save","saveAs","-"],x),mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=c.getServiceName()||c.isOfflineApp()||null==J||this.addMenuItems(u,["share","-"],x),null!=J&&J.isRenamable()&&this.addMenuItems(u,["rename"],x),c.isOfflineApp()?navigator.onLine&&"1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&this.addMenuItems(u,["upload"],x):(this.addMenuItems(u,["makeCopy"],x),null!=J&&(J.constructor==OneDriveFile&&this.addMenuItems(u,["moveToFolder"],x),null!=J.getFolderUrl()&&c.menus.addMenuItems(u,["openFolder"],x)))),u.addSeparator(x),this.addSubmenu("importFrom",u,x),this.addSubmenu("exportAs",u,x),u.addSeparator(x),this.addSubmenu("embed",u,x),this.addSubmenu("publish",u,x),u.addSeparator(x),this.addSubmenu("newLibrary",u,x),this.addSubmenu("openLibraryFrom",u,x),c.isRevisionHistorySupported()&&this.addMenuItems(u,["-","revisionHistory"],x),null!=J&&null!=c.fileNode&&"1"!=-urlParams.embedInline&&(H=null!=J.getTitle()?J.getTitle():c.defaultFilename,(J.constructor==DriveFile&&null!=J.sync&&J.sync.isConnected()||!/(\.html)$/i.test(H))&&this.addMenuItems(u,["-","properties"])),this.addMenuItems(u,["-","pageSetup"],x),mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(u,["print"],x),this.addMenuItems(u,["-","close"])})));this.put("fontFamily",new Menu(mxUtils.bind(this,function(u,x){function J(L){var N=encodeURIComponent(L.name)+(null==L.url?"":"@"+encodeURIComponent(L.url));-if(!K[N]){for(var R=L.name,T=0;null!=z[R.toLowerCase()];)R=L.name+" ("+ ++T+")";null==n[N]&&(D.push({name:L.name,url:L.url,label:R,title:L.url}),z[R.toLowerCase()]=L,n[N]=L)}}for(var H=mxUtils.bind(this,function(L,N,R,T,U){var W=c.editor.graph,X=this.styleChange(u,null!=T?T:L,[mxConstants.STYLE_FONTFAMILY,"fontSource","FType"],[L,null!=N?encodeURIComponent(N):null,null],null,x,function(){W.setFont(L,N);c.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_FONTFAMILY,"fontSource",-"FType"],"values",[L,null!=N?encodeURIComponent(N):null,null],"cells",[W.cellEditor.getEditingCell()]))},function(){W.updateLabelElements(W.getSelectionCells(),function(Y){Y.removeAttribute("face");Y.style.fontFamily=null;"PRE"==Y.nodeName&&W.replaceElement(Y,"div")})});R&&(R=document.createElement("img"),R.className="geAdaptiveAsset",R.setAttribute("src",Editor.crossImage),R.setAttribute("title",mxResources.get("delete")),R.setAttribute("valign","absmiddle"),R.setAttribute("border","0"),R.style.position=-"relative",R.style.top="2px",R.style.width="14px",R.style.cursor="default",R.style.margin="0 3px",X.firstChild.nextSibling.nextSibling.appendChild(R),mxEvent.addListener(R,mxClient.IS_POINTER?"pointerup":"mouseup",mxUtils.bind(this,function(Y){this.removeCustomFont(L,N);this.editorUi.hideCurrentMenu();mxEvent.consume(Y)})));Graph.addFont(L,N);X.firstChild.nextSibling.style.fontFamily=L;U=null!=T?T:L;null!=N&&(U+=" ("+N+")");X.setAttribute("title",U)}),K={},O=0;O<this.defaultFonts.length;O++){var M=-this.defaultFonts[O];"string"===typeof M?H(M):null!=M.fontFamily&&null!=M.fontUrl&&(K[encodeURIComponent(M.fontFamily)+"@"+encodeURIComponent(M.fontUrl)]=!0,H(M.fontFamily,M.fontUrl))}u.addSeparator(x);var n={},z={},D=[];for(O=0;O<this.customFonts.length;O++)J(this.customFonts[O]);D.sort(function(L,N){return L.label<N.label?-1:L.label>N.label?1:0});if(0<D.length){for(O=0;O<D.length;O++)H(D[O].name,D[O].url,!0,D[O].label);u.addSeparator(x)}u.addItem(mxResources.get("reset"),null,mxUtils.bind(this,-function(){this.customFonts=[];c.fireEvent(new mxEventObject("customFontsChanged"))}),x);u.addSeparator(x);u.addItem(mxResources.get("custom")+"...",null,mxUtils.bind(this,function(){var L=this.editorUi.editor.graph,N=L.getStylesheet().getDefaultVertexStyle()[mxConstants.STYLE_FONTFAMILY],R="s",T=null;if(L.isEditing()){var U=L.getSelectedEditingElement();if(null!=U){var W=mxUtils.getCurrentStyle(U);if(null!=W){N=mxUtils.getCssFontFamily(W.fontFamily);W=L.getView().getState(L.cellEditor.getEditingCell());-T=null!=W?W.style.fontSource:null;for(null!=T&&(T=decodeURIComponent(T));null!=U&&U!=L.cellEditor.textarea;){if(U.nodeType==mxConstants.NODETYPE_ELEMENT)if(null!=U.getAttribute("data-font-src")){T=U.getAttribute("data-font-src");break}else if(U.getAttribute("face")==N){T=null;break}U=U.parentNode}null!=T&&(Graph.isGoogleFontUrl(T)?(T=null,R="g"):R="w")}}}else W=L.getView().getState(L.getSelectionCell()),null!=W&&(N=W.style[mxConstants.STYLE_FONTFAMILY]||N,U=W.style.fontSource,null!=U&&(U=decodeURIComponent(U),-Graph.isGoogleFontUrl(U)?R="g":(R="w",T=U)));null!=T&&T.substring(0,PROXY_URL.length)==PROXY_URL&&(T=decodeURIComponent(T.substr((PROXY_URL+"?url=").length)));var X=null;document.activeElement==L.cellEditor.textarea&&(X=L.cellEditor.saveSelection());N=new FontDialog(this.editorUi,N,T,R,mxUtils.bind(this,function(Y,Z,ca){null!=X&&(L.cellEditor.restoreSelection(X),X=null);if(null!=Y&&0<Y.length)if(this.addCustomFont(Y,Z),L.isEditing())L.setFont(Y,Z);else{L.getModel().beginUpdate();try{L.stopEditing(!1),-L.setCellStyles(mxConstants.STYLE_FONTFAMILY,Y),L.setCellStyles("fontSource",null!=Z?encodeURIComponent(Z):null),L.setCellStyles("FType",null)}finally{L.getModel().endUpdate()}}}));this.editorUi.showDialog(N.container,380,130+(Editor.enableWebFonts?70:0)+("0"!=urlParams.isGoogleFontsEnabled?50:0),!0,!0);N.init()}),x,null,!0)})))}})();function DiagramPage(b,e){this.node=b;null!=e?this.node.setAttribute("id",e):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.diagramModified=!1;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};+urlParams.embedInline&&(H=null!=J.getTitle()?J.getTitle():c.defaultFilename,(J.constructor==DriveFile&&null!=J.sync&&J.sync.isConnected()||!/(\.html)$/i.test(H))&&this.addMenuItems(u,["-","properties"])),this.addMenuItems(u,["-","pageSetup"],x),mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(u,["print"],x),this.addMenuItems(u,["-","close"])})));this.put("fontFamily",new Menu(mxUtils.bind(this,function(u,x){function J(L){var O=encodeURIComponent(L.name)+(null==L.url?"":"@"+encodeURIComponent(L.url));+if(!K[O]){for(var R=L.name,T=0;null!=A[R.toLowerCase()];)R=L.name+" ("+ ++T+")";null==n[O]&&(E.push({name:L.name,url:L.url,label:R,title:L.url}),A[R.toLowerCase()]=L,n[O]=L)}}for(var H=mxUtils.bind(this,function(L,O,R,T,U){var W=c.editor.graph,X=this.styleChange(u,null!=T?T:L,[mxConstants.STYLE_FONTFAMILY,"fontSource","FType"],[L,null!=O?encodeURIComponent(O):null,null],null,x,function(){W.setFont(L,O);c.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_FONTFAMILY,"fontSource",+"FType"],"values",[L,null!=O?encodeURIComponent(O):null,null],"cells",[W.cellEditor.getEditingCell()]))},function(){W.updateLabelElements(W.getSelectionCells(),function(Y){Y.removeAttribute("face");Y.style.fontFamily=null;"PRE"==Y.nodeName&&W.replaceElement(Y,"div")})});R&&(R=document.createElement("img"),R.className="geAdaptiveAsset",R.setAttribute("src",Editor.crossImage),R.setAttribute("title",mxResources.get("delete")),R.setAttribute("valign","absmiddle"),R.setAttribute("border","0"),R.style.position=+"relative",R.style.top="2px",R.style.width="14px",R.style.cursor="default",R.style.margin="0 3px",X.firstChild.nextSibling.nextSibling.appendChild(R),mxEvent.addListener(R,mxClient.IS_POINTER?"pointerup":"mouseup",mxUtils.bind(this,function(Y){this.removeCustomFont(L,O);this.editorUi.hideCurrentMenu();mxEvent.consume(Y)})));Graph.addFont(L,O);X.firstChild.nextSibling.style.fontFamily=L;U=null!=T?T:L;null!=O&&(U+=" ("+O+")");X.setAttribute("title",U)}),K={},N=0;N<this.defaultFonts.length;N++){var M=+this.defaultFonts[N];"string"===typeof M?H(M):null!=M.fontFamily&&null!=M.fontUrl&&(K[encodeURIComponent(M.fontFamily)+"@"+encodeURIComponent(M.fontUrl)]=!0,H(M.fontFamily,M.fontUrl))}u.addSeparator(x);var n={},A={},E=[];for(N=0;N<this.customFonts.length;N++)J(this.customFonts[N]);E.sort(function(L,O){return L.label<O.label?-1:L.label>O.label?1:0});if(0<E.length){for(N=0;N<E.length;N++)H(E[N].name,E[N].url,!0,E[N].label);u.addSeparator(x)}u.addItem(mxResources.get("reset"),null,mxUtils.bind(this,+function(){this.customFonts=[];c.fireEvent(new mxEventObject("customFontsChanged"))}),x);u.addSeparator(x);u.addItem(mxResources.get("custom")+"...",null,mxUtils.bind(this,function(){var L=this.editorUi.editor.graph,O=L.getStylesheet().getDefaultVertexStyle()[mxConstants.STYLE_FONTFAMILY],R="s",T=null;if(L.isEditing()){var U=L.getSelectedEditingElement();if(null!=U){var W=mxUtils.getCurrentStyle(U);if(null!=W){O=mxUtils.getCssFontFamily(W.fontFamily);W=L.getView().getState(L.cellEditor.getEditingCell());+T=null!=W?W.style.fontSource:null;for(null!=T&&(T=decodeURIComponent(T));null!=U&&U!=L.cellEditor.textarea;){if(U.nodeType==mxConstants.NODETYPE_ELEMENT)if(null!=U.getAttribute("data-font-src")){T=U.getAttribute("data-font-src");break}else if(U.getAttribute("face")==O){T=null;break}U=U.parentNode}null!=T&&(Graph.isGoogleFontUrl(T)?(T=null,R="g"):R="w")}}}else W=L.getView().getState(L.getSelectionCell()),null!=W&&(O=W.style[mxConstants.STYLE_FONTFAMILY]||O,U=W.style.fontSource,null!=U&&(U=decodeURIComponent(U),+Graph.isGoogleFontUrl(U)?R="g":(R="w",T=U)));null!=T&&T.substring(0,PROXY_URL.length)==PROXY_URL&&(T=decodeURIComponent(T.substr((PROXY_URL+"?url=").length)));var X=null;document.activeElement==L.cellEditor.textarea&&(X=L.cellEditor.saveSelection());O=new FontDialog(this.editorUi,O,T,R,mxUtils.bind(this,function(Y,Z,ca){null!=X&&(L.cellEditor.restoreSelection(X),X=null);if(null!=Y&&0<Y.length)if(this.addCustomFont(Y,Z),L.isEditing())L.setFont(Y,Z);else{L.getModel().beginUpdate();try{L.stopEditing(!1),+L.setCellStyles(mxConstants.STYLE_FONTFAMILY,Y),L.setCellStyles("fontSource",null!=Z?encodeURIComponent(Z):null),L.setCellStyles("FType",null)}finally{L.getModel().endUpdate()}}}));this.editorUi.showDialog(O.container,380,130+(Editor.enableWebFonts?70:0)+("0"!=urlParams.isGoogleFontsEnabled?50:0),!0,!0);O.init()}),x,null,!0)})))}})();function DiagramPage(b,e){this.node=b;null!=e?this.node.setAttribute("id",e):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.diagramModified=!1;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(b){null==b?this.node.removeAttribute("name"):this.node.setAttribute("name",b)};DiagramPage.prototype.setDiagramModified=function(b){this.diagramModified=b};DiagramPage.prototype.isDiagramModified=function(){return this.diagramModified};function RenamePage(b,e,f){this.ui=b;this.page=e;this.previous=this.name=f}RenamePage.prototype.execute=function(){var b=this.page.getName();this.page.setName(this.previous);this.name=this.previous;this.previous=b;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};function MovePage(b,e,f){this.ui=b;this.oldIndex=e;this.newIndex=f}MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var b=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=b;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))};function SelectPage(b,e,f){this.ui=b;this.previousPage=this.page=e;null!=e&&(this.ui.updatePageRoot(e),null!=f&&(e.viewState=f))}@@ -14394,7 +14399,7 @@ function(){var q=f.apply(this,arguments);null!=l.currentPage&&c!=l.currentPage&&this.editor.addListener("pageSelected",mxUtils.bind(this,function(q,v){this.scrollToPage();this.updateHashObject();this.updateTabContainer();this.updateDocumentTitle()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(q,v){this.scrollToPage();this.updateHashObject()}));mxEvent.addListener(window,"resize",mxUtils.bind(this,function(){this.checkTabScrollerOverflow()}));this.addListener("languageChanged",mxUtils.bind(this,function(){this.updateTabContainer()}))}};EditorUi.prototype.scrollToPage=function(b,e){var f=null!=b?this.getPageIndex(b):this.getSelectedPageIndex(),c=null!=b?b:this.currentPage;null!=f&&null!=this.tabScroller&&this.tabScroller.children.length>f&&null!=this.tabScroller.children[f]&&(c!=this.lastScrollPage||e)&&(this.tabScroller.children[f].scrollIntoView({block:"nearest",inline:null!=b?"nearest":"center"}),this.tabScroller.children[f].className="geTab gePageTab geActivePage",this.lastScrollPage=c)};EditorUi.prototype.restoreViewState=function(b,e,f){b=null!=b?this.getPageById(b.getId()):null;var c=this.editor.graph;null!=b&&null!=this.currentPage&&null!=this.pages&&(b!=this.currentPage?this.selectPage(b,!0,e):(c.setViewState(e),this.editor.updateGraphComponents(),c.view.revalidate(),c.sizeDidChange()),c.container.scrollLeft=c.view.translate.x*c.view.scale+e.scrollLeft,c.container.scrollTop=c.view.translate.y*c.view.scale+e.scrollTop,c.restoreSelection(f))};-Graph.prototype.createViewState=function(b){var e=b.getAttribute("page"),f=parseFloat(b.getAttribute("pageScale")),c=parseFloat(b.getAttribute("pageWidth")),l=parseFloat(b.getAttribute("pageHeight")),p=b.getAttribute("background"),q=this.parseBackgroundImage(b.getAttribute("backgroundImage")),v=b.getAttribute("extFonts");if(v)try{v=v.split("|").map(function(E){E=E.split("^");return{name:E[0],url:E[1]}})}catch(E){console.log("ExtFonts format error: "+E.message)}return{gridEnabled:"0"!=b.getAttribute("grid"),+Graph.prototype.createViewState=function(b){var e=b.getAttribute("page"),f=parseFloat(b.getAttribute("pageScale")),c=parseFloat(b.getAttribute("pageWidth")),l=parseFloat(b.getAttribute("pageHeight")),p=b.getAttribute("background"),q=this.parseBackgroundImage(b.getAttribute("backgroundImage")),v=b.getAttribute("extFonts");if(v)try{v=v.split("|").map(function(D){D=D.split("^");return{name:D[0],url:D[1]}})}catch(D){console.log("ExtFonts format error: "+D.message)}return{gridEnabled:"0"!=b.getAttribute("grid"),gridSize:parseFloat(b.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=b.getAttribute("guides"),foldingEnabled:"0"!=b.getAttribute("fold"),shadowVisible:"1"==b.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=e?"0"!=e:this.defaultPageVisible,background:null!=p&&0<p.length?p:null,backgroundImage:q,pageScale:isNaN(f)?mxGraph.prototype.pageScale:f,pageFormat:isNaN(c)||isNaN(l)?"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat():new mxRectangle(0,0,c,l),tooltips:"0"!=b.getAttribute("tooltips"),connect:"0"!=b.getAttribute("connect"),arrows:"0"!=b.getAttribute("arrows"),mathEnabled:"1"==b.getAttribute("math"),adaptiveColors:b.getAttribute("adaptiveColors"),selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1,hiddenTags:[],extFonts:v||[]}};Graph.prototype.saveViewState=function(b,e,f,c){f||(e.setAttribute("grid",(null==b?this.defaultGridEnabled:b.gridEnabled)?"1":"0"),e.setAttribute("page",(null==b?this.defaultPageVisible:b.pageVisible)?"1":"0"),e.setAttribute("gridSize",null!=b?b.gridSize:mxGraph.prototype.gridSize),e.setAttribute("guides",null==b||b.guidesEnabled?"1":"0"),e.setAttribute("tooltips",null==b||b.tooltips?"1":"0"),e.setAttribute("connect",null==b||b.connect?"1":"0"),e.setAttribute("arrows",null==b||b.arrows?"1":"0"),e.setAttribute("fold",@@ -14418,7 +14423,7 @@ EditorUi.prototype.insertPage=function(b,e,f){this.editor.graph.isEnabled()&&(thEditorUi.prototype.createPage=function(b,e,f){e=new DiagramPage((null!=this.fileNode?this.fileNode.ownerDocument:document).createElement("diagram"),e);e.setName(null!=b?b:this.createPageName());this.initDiagramNode(e,f);return e};EditorUi.prototype.createPageName=function(){for(var b={},e=0;e<this.pages.length;e++){var f=this.pages[e].getName();null!=f&&0<f.length&&(b[f]=f)}e=this.pages.length;do f=mxResources.get("pageWithNumber",[++e]);while(null!=b[f]);return f};EditorUi.prototype.removePage=function(b){try{var e=this.editor.graph,f=mxUtils.indexOf(this.pages,b);if(e.isEnabled()&&0<=f){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);e.model.beginUpdate();try{var c=this.currentPage;c==b&&1<this.pages.length?(f==this.pages.length-1?f--:f++,c=this.pages[f]):1>=this.pages.length&&(c=this.insertPage(),e.model.execute(new RenamePage(this,c,mxResources.get("pageWithNumber",[1]))));e.model.execute(new ChangePage(this,b,c))}finally{e.model.endUpdate()}}}catch(l){this.handleError(l)}return b};EditorUi.prototype.duplicatePage=function(b,e){var f=null;try{var c=this.editor.graph;if(c.isEnabled()){c.isEditing()&&c.stopEditing();var l=b.node.cloneNode(!1);l.removeAttribute("id");var p={},q=c.createCellLookup([c.model.root]);f=new DiagramPage(l);f.root=c.cloneCell(c.model.root,null,p);var v=new mxGraphModel;v.prefix=Editor.guid()+"-";v.setRoot(f.root);c.updateCustomLinks(c.createCellMapping(p,q),[f.root]);f.viewState=b==this.currentPage?c.getViewState():b.viewState;this.initDiagramNode(f);-f.viewState.scale=1;delete f.viewState.scrollLeft;delete f.viewState.scrollTop;delete f.viewState.currentRoot;delete f.viewState.defaultParent;f.setName(e);f=this.insertPage(f,mxUtils.indexOf(this.pages,b)+1)}}catch(E){this.handleError(E)}return f};EditorUi.prototype.initDiagramNode=function(b,e){null==e&&(e=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b.root)));this.editor.graph.saveViewState(b.viewState,e);EditorUi.removeChildNodes(b.node);b.node.appendChild(e)};+f.viewState.scale=1;delete f.viewState.scrollLeft;delete f.viewState.scrollTop;delete f.viewState.currentRoot;delete f.viewState.defaultParent;f.setName(e);f=this.insertPage(f,mxUtils.indexOf(this.pages,b)+1)}}catch(D){this.handleError(D)}return f};EditorUi.prototype.initDiagramNode=function(b,e){null==e&&(e=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b.root)));this.editor.graph.saveViewState(b.viewState,e);EditorUi.removeChildNodes(b.node);b.node.appendChild(e)};EditorUi.prototype.clonePages=function(b){for(var e=[],f=[],c=0;c<b.length;c++)try{f.push(this.clonePage(b[c]))}catch(l){e.push(mxResources.get("pageWithNumber",[c+1])+": "+l.toString())}if(0<e.length){b=Error(e.join("\n"));try{0<f.length&&(b.fallbackFileData=this.getXmlForPages(f))}catch(l){}throw b;}return f};EditorUi.prototype.clonePage=function(b){this.updatePageRoot(b);var e=new DiagramPage(b.node.cloneNode(!0)),f=b==this.currentPage?this.editor.graph.getViewState():b.viewState;e.viewState=mxUtils.clone(f,EditorUi.transientViewStateProperties);e.root=this.editor.graph.model.cloneCell(b.root,null,!0);e.diagramModified=b.diagramModified;return e};EditorUi.prototype.renamePage=function(b){if(this.editor.graph.isEnabled()){var e=new FilenameDialog(this,b.getName(),mxResources.get("rename"),mxUtils.bind(this,function(f){null!=f&&0<f.length&&this.editor.graph.model.execute(new RenamePage(this,b,f))}),mxResources.get("rename"));this.showDialog(e.container,300,80,!0,!0);e.init()}return b};EditorUi.prototype.movePage=function(b,e){this.editor.graph.model.execute(new MovePage(this,b,e))};@@ -14435,63 +14440,63 @@ EditorUi.prototype.createLeftScrollTab=function(){return this.createControlTab(nEditorUi.prototype.createRightScrollTab=function(){return this.createControlTab(null,Editor.chevronRightImage,mxUtils.bind(this,function(b){var e=Math.max(60,this.tabScroller.clientWidth/2);null!=this.tabScroller.scrollBy?this.tabScroller.scrollBy({left:e,top:0,behavior:"smooth"}):this.tabScroller.scrollLeft+=e;mxEvent.consume(b)}))};EditorUi.prototype.createPageMenuTab=function(){return this.createControlTab(mxResources.get("pages"),Editor.menuImage,mxUtils.bind(this,function(b){this.editor.graph.popupMenuHandler.hideMenu();var e=new mxPopupMenu(mxUtils.bind(this,function(l,p){this.menus.get("pages").funct(l,p)}));e.smartSeparators=!0;e.showDisabled=!0;e.autoExpand=!0;e.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(e,arguments);e.destroy()});var f=mxEvent.getClientX(b),c=mxEvent.getClientY(b);e.popup(f,c,null,b);this.setCurrentMenu(e);mxEvent.consume(b)}))};EditorUi.prototype.createTabForPage=function(b,e){var f=this.createTab(),c=b.getName()||mxResources.get("untitled"),l=b.getId();f.setAttribute("title",c+(null!=l?" ("+l+")":"")+" ["+e+"]");e=document.createElement("span");e.style.maxWidth="160px";e.style.textOverflow="ellipsis";e.style.overflow="hidden";mxUtils.write(e,c);f.appendChild(e);this.addTabListeners(b,f);return f};-EditorUi.prototype.addTabListeners=function(b,e){mxEvent.disableContextMenu(e);var f=this.editor.graph;mxEvent.addListener(e,"dblclick",mxUtils.bind(this,function(E){this.renamePage(b);mxEvent.consume(E)}));var c=document.createElement("div");c.style.backgroundImage="url("+Editor.thinExpandImage+")";c.className="geButton";e.appendChild(c);var l=!1,p=!1,q=mxUtils.bind(this,function(E){l=null!=this.currentMenu;p=b==this.currentPage;this.scrollToPage(b);f.isMouseDown||p||this.selectPage(b)}),v=mxUtils.bind(this,-function(E){if(!f.isMouseDown&&(p&&(mxEvent.isTouchEvent(E)||mxEvent.getSource(E)==c)||mxEvent.isPopupTrigger(E))&&(f.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(E)||!l)){var G=new mxPopupMenu(this.createPageMenu(b));G.smartSeparators=!0;G.showDisabled=!0;G.autoExpand=!0;G.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(G,arguments);this.resetCurrentMenu();G.destroy()});var B=mxEvent.getClientX(E),d=mxEvent.getClientY(E);G.popup(B,d,null,E);-this.setCurrentMenu(G,e)}mxEvent.consume(E)});mxEvent.addGestureListeners(c,q,null,v);mxEvent.addGestureListeners(e,q,null,v)};+EditorUi.prototype.addTabListeners=function(b,e){mxEvent.disableContextMenu(e);var f=this.editor.graph;mxEvent.addListener(e,"dblclick",mxUtils.bind(this,function(D){this.renamePage(b);mxEvent.consume(D)}));var c=document.createElement("div");c.style.backgroundImage="url("+Editor.thinExpandImage+")";c.className="geButton";e.appendChild(c);var l=!1,p=!1,q=mxUtils.bind(this,function(D){l=null!=this.currentMenu;p=b==this.currentPage;this.scrollToPage(b);f.isMouseDown||p||this.selectPage(b)}),v=mxUtils.bind(this,+function(D){if(!f.isMouseDown&&(p&&(mxEvent.isTouchEvent(D)||mxEvent.getSource(D)==c)||mxEvent.isPopupTrigger(D))&&(f.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(D)||!l)){var G=new mxPopupMenu(this.createPageMenu(b));G.smartSeparators=!0;G.showDisabled=!0;G.autoExpand=!0;G.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(G,arguments);this.resetCurrentMenu();G.destroy()});var B=mxEvent.getClientX(D),d=mxEvent.getClientY(D);G.popup(B,d,null,D);+this.setCurrentMenu(G,e)}mxEvent.consume(D)});mxEvent.addGestureListeners(c,q,null,v);mxEvent.addGestureListeners(e,q,null,v)};EditorUi.prototype.createPageMenu=function(b,e){return mxUtils.bind(this,function(f,c){1!=urlParams.embed&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=this.getServiceName()||f.addItem(mxResources.get("openInNewWindow"),null,mxUtils.bind(this,function(){this.editor.editAsNew(this.getFileData(!0,null,null,null,!0,!0))}),c));this.editor.graph.isEnabled()&&(f.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(b,mxResources.get("copyOf",[b.getName()]))}),c),f.addSeparator(c),this.currentPage==b&&1<this.pages.length&&this.menus.addSubmenu("movePage",f,c,mxResources.get("move")),f.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(b)}),c),f.addItem(mxResources.get("rename")+"...",null,mxUtils.bind(this,function(){this.renamePage(b,e)}),c))})};(function(){mxCodecRegistry.getCodec(ChangePageSetup).exclude.push("page")})();(function(){var b=new mxObjectCodec(new MovePage,["ui"]);b.beforeDecode=function(e,f,c){c.ui=e.ui;return f};b.afterDecode=function(e,f,c){e=c.oldIndex;c.oldIndex=c.newIndex;c.newIndex=e;return c};mxCodecRegistry.register(b)})();(function(){var b=new mxObjectCodec(new RenamePage,["ui","page"]);b.beforeDecode=function(e,f,c){c.ui=e.ui;return f};b.afterDecode=function(e,f,c){e=c.previous;c.previous=c.name;c.name=e;return c};mxCodecRegistry.register(b)})();(function(){var b=new mxObjectCodec(new ChangePage,["ui","relatedPage","index","page","previousPage"]);b.afterEncode=function(e,f,c){c.setAttribute("relatedPage",f.relatedPage.getId());null==f.index&&(c.setAttribute("name",f.relatedPage.getName()),null!=f.relatedPage.viewState&&c.setAttribute("viewState",JSON.stringify(f.relatedPage.viewState,function(l,p){return 0>mxUtils.indexOf(EditorUi.transientViewStateProperties,l)?p:void 0})),null!=f.relatedPage.root&&e.encodeCell(f.relatedPage.root,c));return c};b.beforeDecode=function(e,f,c){c.ui=e.ui;c.relatedPage=c.ui.getPageById(f.getAttribute("relatedPage"));if(null==c.relatedPage){var l=f.ownerDocument.createElement("diagram");l.setAttribute("id",f.getAttribute("relatedPage"));l.setAttribute("name",f.getAttribute("name"));c.relatedPage=new DiagramPage(l);l=f.getAttribute("viewState");null!=l&&(c.relatedPage.viewState=JSON.parse(l),f.removeAttribute("viewState"));f=f.cloneNode(!0);l=f.firstChild;if(null!=l)for(c.relatedPage.root=e.decodeCell(l,!1),c=-l.nextSibling,l.parentNode.removeChild(l),l=c;null!=l;){c=l.nextSibling;if(l.nodeType==mxConstants.NODETYPE_ELEMENT){var p=l.getAttribute("id");null==e.lookup(p)&&e.decodeCell(l)}l.parentNode.removeChild(l);l=c}}return f};b.afterDecode=function(e,f,c){c.index=c.previousIndex;return c};mxCodecRegistry.register(b)})();(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(c,l,p,q,v){l=null!=l?l:!1;null==p&&(p=this.getFoldableCells(this.getSelectionCells(),c));this.stopEditing();this.model.beginUpdate();try{for(var E=p.slice(),G=0;G<p.length;G++)"1"==mxUtils.getValue(this.getCurrentCellStyle(p[G]),"treeFolding","0")&&this.foldTreeCell(c,p[G]);p=E;p=b.apply(this,arguments)}finally{this.model.endUpdate()}return p};Graph.prototype.foldTreeCell=function(c,l){this.model.beginUpdate();try{var p=-[];this.traverse(l,!0,mxUtils.bind(this,function(v,E){var G=null!=E&&this.isTreeEdge(E);G&&p.push(E);v==l||null!=E&&!G||p.push(v);return(null==E||G)&&(v==l||!this.model.isCollapsed(v))}));this.model.setCollapsed(l,c);for(var q=0;q<p.length;q++)this.model.setVisible(p[q],!c)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(c){return!this.isEdgeIgnored(c)};Graph.prototype.getTreeEdges=function(c,l,p,q,v,E){return this.model.filterCells(this.getEdges(c,l,p,q,v,E),mxUtils.bind(this,-function(G){return this.isTreeEdge(G)}))};Graph.prototype.getIncomingTreeEdges=function(c,l){return this.getTreeEdges(c,l,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(c,l){return this.getTreeEdges(c,l,!1,!0,!1)};var e=EditorUi.prototype.init;EditorUi.prototype.init=function(){e.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function c(K){return t.isVertex(K)&&p(K)}function l(K){var O=!1;null!=K&&(O="1"==-m.getCurrentCellStyle(K).treeMoving);return O}function p(K){var O=!1;null!=K&&(K=t.getParent(K),O=m.view.getState(K),O="tree"==(null!=O?O.style:m.getCellStyle(K)).containerType);return O}function q(K){var O=!1;null!=K&&(K=t.getParent(K),O=m.view.getState(K),m.view.getState(K),O=null!=(null!=O?O.style:m.getCellStyle(K)).childLayout);return O}function v(K){K=m.view.getState(K);if(null!=K){var O=m.getIncomingTreeEdges(K.cell);if(0<O.length&&(O=m.view.getState(O[0]),null!=O&&(O=O.absolutePoints,null!=-O&&0<O.length&&(O=O[O.length-1],null!=O)))){if(O.y==K.y&&Math.abs(O.x-K.getCenterX())<K.width/2)return mxConstants.DIRECTION_SOUTH;if(O.y==K.y+K.height&&Math.abs(O.x-K.getCenterX())<K.width/2)return mxConstants.DIRECTION_NORTH;if(O.x>K.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function E(K,O){O=null!=O?O:!0;m.model.beginUpdate();try{var M=m.model.getParent(K),n=m.getIncomingTreeEdges(K),z=m.cloneCells([n[0],K]);m.model.setTerminal(z[0],m.model.getTerminal(n[0],-!0),!0);var D=v(K),L=M.geometry;D==mxConstants.DIRECTION_SOUTH||D==mxConstants.DIRECTION_NORTH?z[1].geometry.x+=O?K.geometry.width+10:-z[1].geometry.width-10:z[1].geometry.y+=O?K.geometry.height+10:-z[1].geometry.height-10;m.view.currentRoot!=M&&(z[1].geometry.x-=L.x,z[1].geometry.y-=L.y);var N=m.view.getState(K),R=m.view.scale;if(null!=N){var T=mxRectangle.fromRectangle(N);D==mxConstants.DIRECTION_SOUTH||D==mxConstants.DIRECTION_NORTH?T.x+=(O?K.geometry.width+10:-z[1].geometry.width-10)*R:T.y+=(O?-K.geometry.height+10:-z[1].geometry.height-10)*R;var U=m.getOutgoingTreeEdges(m.model.getTerminal(n[0],!0));if(null!=U){for(var W=D==mxConstants.DIRECTION_SOUTH||D==mxConstants.DIRECTION_NORTH,X=L=n=0;X<U.length;X++){var Y=m.model.getTerminal(U[X],!1);if(D==v(Y)){var Z=m.view.getState(Y);Y!=K&&null!=Z&&(W&&O!=Z.getCenterX()<N.getCenterX()||!W&&O!=Z.getCenterY()<N.getCenterY())&&mxUtils.intersects(T,Z)&&(n=10+Math.max(n,(Math.min(T.x+T.width,Z.x+Z.width)-Math.max(T.x,Z.x))/R),L=10+Math.max(L,(Math.min(T.y+-T.height,Z.y+Z.height)-Math.max(T.y,Z.y))/R))}}W?L=0:n=0;for(X=0;X<U.length;X++)if(Y=m.model.getTerminal(U[X],!1),D==v(Y)&&(Z=m.view.getState(Y),Y!=K&&null!=Z&&(W&&O!=Z.getCenterX()<N.getCenterX()||!W&&O!=Z.getCenterY()<N.getCenterY()))){var ca=[];m.traverse(Z.cell,!0,function(ea,ja){var ba=null!=ja&&m.isTreeEdge(ja);ba&&ca.push(ja);(null==ja||ba)&&ca.push(ea);return null==ja||ba});m.moveCells(ca,(O?1:-1)*n,(O?1:-1)*L)}}}return m.addCells(z,M)}finally{m.model.endUpdate()}}function G(K){m.model.beginUpdate();-try{var O=v(K),M=m.getIncomingTreeEdges(K),n=m.cloneCells([M[0],K]);m.model.setTerminal(M[0],n[1],!1);m.model.setTerminal(n[0],n[1],!0);m.model.setTerminal(n[0],K,!1);var z=m.model.getParent(K),D=z.geometry,L=[];m.view.currentRoot!=z&&(n[1].geometry.x-=D.x,n[1].geometry.y-=D.y);m.traverse(K,!0,function(T,U){var W=null!=U&&m.isTreeEdge(U);W&&L.push(U);(null==U||W)&&L.push(T);return null==U||W});var N=K.geometry.width+40,R=K.geometry.height+40;O==mxConstants.DIRECTION_SOUTH?N=0:O==mxConstants.DIRECTION_NORTH?-(N=0,R=-R):O==mxConstants.DIRECTION_WEST?(N=-N,R=0):O==mxConstants.DIRECTION_EAST&&(R=0);m.moveCells(L,N,R);return m.addCells(n,z)}finally{m.model.endUpdate()}}function B(K,O){m.model.beginUpdate();try{var M=m.model.getParent(K),n=m.getIncomingTreeEdges(K),z=v(K);0==n.length&&(n=[m.createEdge(M,null,"",null,null,m.createCurrentEdgeStyle())],z=O);var D=m.cloneCells([n[0],K]);m.model.setTerminal(D[0],K,!0);null==m.model.getTerminal(D[0],!1)&&(m.model.setTerminal(D[0],D[1],!1),m.applyNewEdgeStyle(D[1],-[D[0]],z));n=m.getOutgoingTreeEdges(K);var L=M.geometry;O=[];m.view.currentRoot==M&&(L=new mxRectangle);for(var N=0;N<n.length;N++){var R=m.model.getTerminal(n[N],!1);null!=R&&O.push(R)}var T=m.view.getBounds(O),U=m.view.translate,W=m.view.scale;z==mxConstants.DIRECTION_SOUTH?(D[1].geometry.x=null==T?K.geometry.x+(K.geometry.width-D[1].geometry.width)/2:(T.x+T.width)/W-U.x-L.x+10,D[1].geometry.y+=D[1].geometry.height-L.y+40):z==mxConstants.DIRECTION_NORTH?(D[1].geometry.x=null==T?K.geometry.x+(K.geometry.width--D[1].geometry.width)/2:(T.x+T.width)/W-U.x+-L.x+10,D[1].geometry.y-=D[1].geometry.height+L.y+40):(D[1].geometry.x=z==mxConstants.DIRECTION_WEST?D[1].geometry.x-(D[1].geometry.width+L.x+40):D[1].geometry.x+(D[1].geometry.width-L.x+40),D[1].geometry.y=null==T?K.geometry.y+(K.geometry.height-D[1].geometry.height)/2:(T.y+T.height)/W-U.y+-L.y+10);return m.addCells(D,M)}finally{m.model.endUpdate()}}function d(K,O,M){K=m.getOutgoingTreeEdges(K);M=m.view.getState(M);var n=[];if(null!=M&&null!=K){for(var z=-0;z<K.length;z++){var D=m.view.getState(m.model.getTerminal(K[z],!1));null!=D&&(!O&&Math.min(D.x+D.width,M.x+M.width)>=Math.max(D.x,M.x)||O&&Math.min(D.y+D.height,M.y+M.height)>=Math.max(D.y,M.y))&&n.push(D)}n.sort(function(L,N){return O?L.x+L.width-N.x-N.width:L.y+L.height-N.y-N.height})}return n}function g(K,O){var M=v(K),n=O==mxConstants.DIRECTION_EAST||O==mxConstants.DIRECTION_WEST;(M==mxConstants.DIRECTION_EAST||M==mxConstants.DIRECTION_WEST)==n&&M!=O?k.actions.get("selectParent").funct():M==-O?(O=m.getOutgoingTreeEdges(K),null!=O&&0<O.length&&m.setSelectionCell(m.model.getTerminal(O[0],!1))):(M=m.getIncomingTreeEdges(K),null!=M&&0<M.length&&(n=d(m.model.getTerminal(M[0],!0),n,K),K=m.view.getState(K),null!=K&&(K=mxUtils.indexOf(n,K),0<=K&&(K+=O==mxConstants.DIRECTION_NORTH||O==mxConstants.DIRECTION_WEST?-1:1,0<=K&&K<=n.length-1&&m.setSelectionCell(n[K].cell)))))}var k=this,m=k.editor.graph,t=m.getModel(),y=k.menus.createPopupMenu;k.menus.createPopupMenu=function(K,O,M){y.apply(this,arguments);-if(1==m.getSelectionCount()){O=m.getSelectionCell();var n=m.getOutgoingTreeEdges(O);K.addSeparator();0<n.length&&(c(m.getSelectionCell())&&this.addMenuItems(K,["selectChildren"],null,M),this.addMenuItems(K,["selectDescendants"],null,M));c(m.getSelectionCell())?(K.addSeparator(),0<m.getIncomingTreeEdges(O).length&&this.addMenuItems(K,["selectSiblings","selectParent"],null,M)):0<m.model.getEdgeCount(O)&&this.addMenuItems(K,["selectConnections"],null,M)}};k.actions.addAction("selectChildren",function(K){if(m.isEnabled()&&-1==m.getSelectionCount()){var O=m.getSelectionCell();K=mxEvent.isControlDown(K)?null:m.getOutgoingTreeEdges(O);if(null!=K&&0<K.length){O=[];for(var M=0;M<K.length;M++)O.push(m.model.getTerminal(K[M],!1));m.setSelectionCells(O)}else m.setSelectionCells(m.model.getChildren(O))}},null,null,"Alt+Shift+C");k.actions.addAction("selectDescendants",function(K){var O=m.getSelectionCell();if(m.isEnabled()&&null!=O){var M=[];mxEvent.isControlDown(K)||m.traverse(O,!0,function(n,z){var D=null!=z&&m.isTreeEdge(z);-D&&mxEvent.isControlDown(K)&&M.push(z);(null==z||D)&&M.push(n);return null==z||D});if(0==M.length||1==M.length&&M[0]==O)M=m.model.getDescendants(O);m.setSelectionCells(M)}},null,null,"Alt+Shift+X");k.actions.addAction("selectParent",function(K){var O=m.getSelectionCell();m.isEnabled()&&null!=O&&(K=mxEvent.isControlDown(K)?null:m.getIncomingTreeEdges(O),null!=K&&0<K.length?m.setSelectionCell(m.model.getTerminal(K[0],!0)):m.selectParentCell())},null,null,"Alt+Shift+P");k.actions.addAction("selectSiblings",-function(K){if(m.isEnabled()&&1==m.getSelectionCount()){var O=m.getSelectionCell(),M=mxEvent.isControlDown(K)?null:m.getIncomingTreeEdges(O);K=[];if(null!=M&&0<M.length&&(M=m.getOutgoingTreeEdges(m.model.getTerminal(M[0],!0)),null!=M))for(var n=0;n<M.length;n++)K.push(m.model.getTerminal(M[n],!1));0==K.length&&(K=m.model.getChildren(m.model.getParent(O)));m.setSelectionCells(K)}},null,null,"Alt+Shift+S");var A=m.removeCells;m.removeCells=function(K,O){O=null!=O?O:!0;null==K&&(K=this.getDeletableCells(this.getSelectionCells()));-O&&(K=this.getDeletableCells(this.addAllEdges(K)));for(var M=[],n=0;n<K.length;n++){var z=K[n];t.isEdge(z)&&p(z)&&(M.push(z),z=t.getTerminal(z,!1));if(c(z)){var D=[];m.traverse(z,!0,function(L,N){var R=null!=N&&m.isTreeEdge(N);R&&D.push(N);(null==N||R)&&D.push(L);return null==N||R});0<D.length&&(M=M.concat(D),z=m.getIncomingTreeEdges(K[n]),K=K.concat(z))}else null!=z&&M.push(K[n])}K=M;return A.apply(this,arguments)};k.hoverIcons.getStateAt=function(K,O,M){return c(K.cell)?null:this.graph.view.getState(this.graph.getCellAt(O,-M))};var I=m.duplicateCells;m.duplicateCells=function(K,O){K=null!=K?K:this.getSelectionCells();for(var M=K.slice(0),n=0;n<M.length;n++){var z=m.view.getState(M[n]);if(null!=z&&c(z.cell)){var D=m.getIncomingTreeEdges(z.cell);for(z=0;z<D.length;z++)mxUtils.remove(D[z],K)}}this.model.beginUpdate();try{var L=I.call(this,K,O);if(L.length==K.length)for(n=0;n<K.length;n++)if(c(K[n])){var N=m.getIncomingTreeEdges(L[n]);D=m.getIncomingTreeEdges(K[n]);if(0==N.length&&0<D.length){var R=this.cloneCell(D[0]);-this.addEdge(R,m.getDefaultParent(),this.model.getTerminal(D[0],!0),L[n])}}}finally{this.model.endUpdate()}return L};var F=m.moveCells;m.moveCells=function(K,O,M,n,z,D,L){for(var N=null,R=[],T=0;T<K.length;T++)(l(K[T])||c(K[T]))&&!q(K[T])&&this.isCellCollapsed(K[T])?R=R.concat(this.getSubtree(K[T])):R.push(K[T]);K=mxUtils.removeDuplicates(R);this.model.beginUpdate();try{R=z;var U=this.getCurrentCellStyle(z);if(null!=K&&c(z)&&"1"==mxUtils.getValue(U,"treeFolding","0")){for(T=0;T<K.length;T++)if(c(K[T])||-m.model.isEdge(K[T])&&null==m.model.getTerminal(K[T],!0)){z=m.model.getParent(K[T]);break}if(null!=R&&z!=R&&null!=this.view.getState(K[0])){var W=m.getIncomingTreeEdges(K[0]);if(0<W.length){var X=m.view.getState(m.model.getTerminal(W[0],!0));if(null!=X){var Y=m.view.getState(R);null!=Y&&(O=(Y.getCenterX()-X.getCenterX())/m.view.scale,M=(Y.getCenterY()-X.getCenterY())/m.view.scale)}}}}N=F.apply(this,arguments);if(null!=N&&null!=K&&N.length==K.length)for(T=0;T<N.length;T++)if(this.model.isEdge(N[T]))c(R)&&-0>mxUtils.indexOf(N,this.model.getTerminal(N[T],!0))&&this.model.setTerminal(N[T],R,!0);else if(c(K[T])&&(W=m.getIncomingTreeEdges(K[T]),0<W.length))if(!n)c(R)&&0>mxUtils.indexOf(K,this.model.getTerminal(W[0],!0))&&this.model.setTerminal(W[0],R,!0);else if(0==m.getIncomingTreeEdges(N[T]).length){U=R;if(null==U||U==m.model.getParent(K[T]))U=m.model.getTerminal(W[0],!0);n=this.cloneCell(W[0]);this.addEdge(n,m.getDefaultParent(),U,N[T])}}finally{this.model.endUpdate()}return N};if(null!=k.sidebar){var C=-k.sidebar.dropAndConnect;k.sidebar.dropAndConnect=function(K,O,M,n){var z=m.model,D=null;z.beginUpdate();try{if(D=C.apply(this,arguments),c(K))for(var L=0;L<D.length;L++)if(z.isEdge(D[L])&&null==z.getTerminal(D[L],!0)){z.setTerminal(D[L],K,!0);var N=m.getCellGeometry(D[L]);N.points=null;null!=N.getTerminalPoint(!0)&&N.setTerminalPoint(null,!0)}}finally{z.endUpdate()}return D}}var Q={67:k.actions.get("selectChildren"),88:k.actions.get("selectDescendants"),80:k.actions.get("selectParent"),83:k.actions.get("selectSiblings")},-S={67:k.actions.get("copyStyle"),86:k.actions.get("pasteStyle")},V=k.onKeyDown;k.onKeyDown=function(K){try{var O=m.getSelectionCell();if(m.isEnabled()&&!m.isEditing()&&null!=O){var M=mxEvent.isAltDown(K)&&mxEvent.isShiftDown(K)?Q[K.keyCode]:mxEvent.isAltDown(K)?S[K.keyCode]:null;null!=M?(M.funct(K),mxEvent.consume(K)):c(O)&&(M=null,0<m.getIncomingTreeEdges(O).length&&(9==K.which?M=mxEvent.isShiftDown(K)?G(O):B(O):13==K.which&&(M=E(O,!mxEvent.isShiftDown(K)))),null!=M&&0<M.length?(1==M.length&&m.model.isEdge(M[0])?-m.setSelectionCell(m.model.getTerminal(M[0],!1)):m.setSelectionCell(M[M.length-1]),null!=k.hoverIcons&&k.hoverIcons.update(m.view.getState(O)),m.startEditingAtCell(O),mxEvent.consume(K)):37==K.keyCode?(g(O,mxConstants.DIRECTION_WEST),mxEvent.consume(K)):38==K.keyCode?(g(O,mxConstants.DIRECTION_NORTH),mxEvent.consume(K)):39==K.keyCode?(g(O,mxConstants.DIRECTION_EAST),mxEvent.consume(K)):40==K.keyCode&&(g(O,mxConstants.DIRECTION_SOUTH),mxEvent.consume(K)))}}catch(n){k.handleError(n)}mxEvent.isConsumed(K)||-V.apply(this,arguments)};var P=m.connectVertex;m.connectVertex=function(K,O,M,n,z,D,L){var N=m.getIncomingTreeEdges(K);if(c(K)){var R=v(K),T=R==mxConstants.DIRECTION_EAST||R==mxConstants.DIRECTION_WEST,U=O==mxConstants.DIRECTION_EAST||O==mxConstants.DIRECTION_WEST;return R==O||0==N.length?B(K,O):T==U?G(K):E(K,O!=mxConstants.DIRECTION_NORTH&&O!=mxConstants.DIRECTION_WEST)}return P.apply(this,arguments)};m.getSubtree=function(K){var O=[K];!l(K)&&!c(K)||q(K)||m.traverse(K,!0,function(M,n){var z=null!=-n&&m.isTreeEdge(n);z&&0>mxUtils.indexOf(O,n)&&O.push(n);(null==n||z)&&0>mxUtils.indexOf(O,M)&&O.push(M);return null==n||z});return O};var u=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){u.apply(this,arguments);(l(this.state.cell)||c(this.state.cell))&&!q(this.state.cell)&&0<this.graph.getOutgoingTreeEdges(this.state.cell).length&&!this.graph.isCellCollapsed(this.state.cell)?null==this.moveHandle&&(this.moveHandle=mxUtils.createImage(Editor.moveImage),this.moveHandle.setAttribute("title",+l.nextSibling,l.parentNode.removeChild(l),l=c;null!=l;){c=l.nextSibling;if(l.nodeType==mxConstants.NODETYPE_ELEMENT){var p=l.getAttribute("id");null==e.lookup(p)&&e.decodeCell(l)}l.parentNode.removeChild(l);l=c}}return f};b.afterDecode=function(e,f,c){c.index=c.previousIndex;return c};mxCodecRegistry.register(b)})();(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(c,l,p,q,v){l=null!=l?l:!1;null==p&&(p=this.getFoldableCells(this.getSelectionCells(),c));this.stopEditing();this.model.beginUpdate();try{for(var D=p.slice(),G=0;G<p.length;G++)"1"==mxUtils.getValue(this.getCurrentCellStyle(p[G]),"treeFolding","0")&&this.foldTreeCell(c,p[G]);p=D;p=b.apply(this,arguments)}finally{this.model.endUpdate()}return p};Graph.prototype.foldTreeCell=function(c,l){this.model.beginUpdate();try{var p=+[];this.traverse(l,!0,mxUtils.bind(this,function(v,D){var G=null!=D&&this.isTreeEdge(D);G&&p.push(D);v==l||null!=D&&!G||p.push(v);return(null==D||G)&&(v==l||!this.model.isCollapsed(v))}));this.model.setCollapsed(l,c);for(var q=0;q<p.length;q++)this.model.setVisible(p[q],!c)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(c){return!this.isEdgeIgnored(c)};Graph.prototype.getTreeEdges=function(c,l,p,q,v,D){return this.model.filterCells(this.getEdges(c,l,p,q,v,D),mxUtils.bind(this,+function(G){return this.isTreeEdge(G)}))};Graph.prototype.getIncomingTreeEdges=function(c,l){return this.getTreeEdges(c,l,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(c,l){return this.getTreeEdges(c,l,!1,!0,!1)};var e=EditorUi.prototype.init;EditorUi.prototype.init=function(){e.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function c(K){return t.isVertex(K)&&p(K)}function l(K){var N=!1;null!=K&&(N="1"==+m.getCurrentCellStyle(K).treeMoving);return N}function p(K){var N=!1;null!=K&&(K=t.getParent(K),N=m.view.getState(K),N="tree"==(null!=N?N.style:m.getCellStyle(K)).containerType);return N}function q(K){var N=!1;null!=K&&(K=t.getParent(K),N=m.view.getState(K),m.view.getState(K),N=null!=(null!=N?N.style:m.getCellStyle(K)).childLayout);return N}function v(K){K=m.view.getState(K);if(null!=K){var N=m.getIncomingTreeEdges(K.cell);if(0<N.length&&(N=m.view.getState(N[0]),null!=N&&(N=N.absolutePoints,null!=+N&&0<N.length&&(N=N[N.length-1],null!=N)))){if(N.y==K.y&&Math.abs(N.x-K.getCenterX())<K.width/2)return mxConstants.DIRECTION_SOUTH;if(N.y==K.y+K.height&&Math.abs(N.x-K.getCenterX())<K.width/2)return mxConstants.DIRECTION_NORTH;if(N.x>K.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function D(K,N){N=null!=N?N:!0;m.model.beginUpdate();try{var M=m.model.getParent(K),n=m.getIncomingTreeEdges(K),A=m.cloneCells([n[0],K]);m.model.setTerminal(A[0],m.model.getTerminal(n[0],+!0),!0);var E=v(K),L=M.geometry;E==mxConstants.DIRECTION_SOUTH||E==mxConstants.DIRECTION_NORTH?A[1].geometry.x+=N?K.geometry.width+10:-A[1].geometry.width-10:A[1].geometry.y+=N?K.geometry.height+10:-A[1].geometry.height-10;m.view.currentRoot!=M&&(A[1].geometry.x-=L.x,A[1].geometry.y-=L.y);var O=m.view.getState(K),R=m.view.scale;if(null!=O){var T=mxRectangle.fromRectangle(O);E==mxConstants.DIRECTION_SOUTH||E==mxConstants.DIRECTION_NORTH?T.x+=(N?K.geometry.width+10:-A[1].geometry.width-10)*R:T.y+=(N?+K.geometry.height+10:-A[1].geometry.height-10)*R;var U=m.getOutgoingTreeEdges(m.model.getTerminal(n[0],!0));if(null!=U){for(var W=E==mxConstants.DIRECTION_SOUTH||E==mxConstants.DIRECTION_NORTH,X=L=n=0;X<U.length;X++){var Y=m.model.getTerminal(U[X],!1);if(E==v(Y)){var Z=m.view.getState(Y);Y!=K&&null!=Z&&(W&&N!=Z.getCenterX()<O.getCenterX()||!W&&N!=Z.getCenterY()<O.getCenterY())&&mxUtils.intersects(T,Z)&&(n=10+Math.max(n,(Math.min(T.x+T.width,Z.x+Z.width)-Math.max(T.x,Z.x))/R),L=10+Math.max(L,(Math.min(T.y++T.height,Z.y+Z.height)-Math.max(T.y,Z.y))/R))}}W?L=0:n=0;for(X=0;X<U.length;X++)if(Y=m.model.getTerminal(U[X],!1),E==v(Y)&&(Z=m.view.getState(Y),Y!=K&&null!=Z&&(W&&N!=Z.getCenterX()<O.getCenterX()||!W&&N!=Z.getCenterY()<O.getCenterY()))){var ca=[];m.traverse(Z.cell,!0,function(ea,ia){var ba=null!=ia&&m.isTreeEdge(ia);ba&&ca.push(ia);(null==ia||ba)&&ca.push(ea);return null==ia||ba});m.moveCells(ca,(N?1:-1)*n,(N?1:-1)*L)}}}return m.addCells(A,M)}finally{m.model.endUpdate()}}function G(K){m.model.beginUpdate();+try{var N=v(K),M=m.getIncomingTreeEdges(K),n=m.cloneCells([M[0],K]);m.model.setTerminal(M[0],n[1],!1);m.model.setTerminal(n[0],n[1],!0);m.model.setTerminal(n[0],K,!1);var A=m.model.getParent(K),E=A.geometry,L=[];m.view.currentRoot!=A&&(n[1].geometry.x-=E.x,n[1].geometry.y-=E.y);m.traverse(K,!0,function(T,U){var W=null!=U&&m.isTreeEdge(U);W&&L.push(U);(null==U||W)&&L.push(T);return null==U||W});var O=K.geometry.width+40,R=K.geometry.height+40;N==mxConstants.DIRECTION_SOUTH?O=0:N==mxConstants.DIRECTION_NORTH?+(O=0,R=-R):N==mxConstants.DIRECTION_WEST?(O=-O,R=0):N==mxConstants.DIRECTION_EAST&&(R=0);m.moveCells(L,O,R);return m.addCells(n,A)}finally{m.model.endUpdate()}}function B(K,N){m.model.beginUpdate();try{var M=m.model.getParent(K),n=m.getIncomingTreeEdges(K),A=v(K);0==n.length&&(n=[m.createEdge(M,null,"",null,null,m.createCurrentEdgeStyle())],A=N);var E=m.cloneCells([n[0],K]);m.model.setTerminal(E[0],K,!0);null==m.model.getTerminal(E[0],!1)&&(m.model.setTerminal(E[0],E[1],!1),m.applyNewEdgeStyle(E[1],+[E[0]],A));n=m.getOutgoingTreeEdges(K);var L=M.geometry;N=[];m.view.currentRoot==M&&(L=new mxRectangle);for(var O=0;O<n.length;O++){var R=m.model.getTerminal(n[O],!1);null!=R&&N.push(R)}var T=m.view.getBounds(N),U=m.view.translate,W=m.view.scale;A==mxConstants.DIRECTION_SOUTH?(E[1].geometry.x=null==T?K.geometry.x+(K.geometry.width-E[1].geometry.width)/2:(T.x+T.width)/W-U.x-L.x+10,E[1].geometry.y+=E[1].geometry.height-L.y+40):A==mxConstants.DIRECTION_NORTH?(E[1].geometry.x=null==T?K.geometry.x+(K.geometry.width-+E[1].geometry.width)/2:(T.x+T.width)/W-U.x+-L.x+10,E[1].geometry.y-=E[1].geometry.height+L.y+40):(E[1].geometry.x=A==mxConstants.DIRECTION_WEST?E[1].geometry.x-(E[1].geometry.width+L.x+40):E[1].geometry.x+(E[1].geometry.width-L.x+40),E[1].geometry.y=null==T?K.geometry.y+(K.geometry.height-E[1].geometry.height)/2:(T.y+T.height)/W-U.y+-L.y+10);return m.addCells(E,M)}finally{m.model.endUpdate()}}function d(K,N,M){K=m.getOutgoingTreeEdges(K);M=m.view.getState(M);var n=[];if(null!=M&&null!=K){for(var A=+0;A<K.length;A++){var E=m.view.getState(m.model.getTerminal(K[A],!1));null!=E&&(!N&&Math.min(E.x+E.width,M.x+M.width)>=Math.max(E.x,M.x)||N&&Math.min(E.y+E.height,M.y+M.height)>=Math.max(E.y,M.y))&&n.push(E)}n.sort(function(L,O){return N?L.x+L.width-O.x-O.width:L.y+L.height-O.y-O.height})}return n}function g(K,N){var M=v(K),n=N==mxConstants.DIRECTION_EAST||N==mxConstants.DIRECTION_WEST;(M==mxConstants.DIRECTION_EAST||M==mxConstants.DIRECTION_WEST)==n&&M!=N?k.actions.get("selectParent").funct():M==+N?(N=m.getOutgoingTreeEdges(K),null!=N&&0<N.length&&m.setSelectionCell(m.model.getTerminal(N[0],!1))):(M=m.getIncomingTreeEdges(K),null!=M&&0<M.length&&(n=d(m.model.getTerminal(M[0],!0),n,K),K=m.view.getState(K),null!=K&&(K=mxUtils.indexOf(n,K),0<=K&&(K+=N==mxConstants.DIRECTION_NORTH||N==mxConstants.DIRECTION_WEST?-1:1,0<=K&&K<=n.length-1&&m.setSelectionCell(n[K].cell)))))}var k=this,m=k.editor.graph,t=m.getModel(),y=k.menus.createPopupMenu;k.menus.createPopupMenu=function(K,N,M){y.apply(this,arguments);+if(1==m.getSelectionCount()){N=m.getSelectionCell();var n=m.getOutgoingTreeEdges(N);K.addSeparator();0<n.length&&(c(m.getSelectionCell())&&this.addMenuItems(K,["selectChildren"],null,M),this.addMenuItems(K,["selectDescendants"],null,M));c(m.getSelectionCell())?(K.addSeparator(),0<m.getIncomingTreeEdges(N).length&&this.addMenuItems(K,["selectSiblings","selectParent"],null,M)):0<m.model.getEdgeCount(N)&&this.addMenuItems(K,["selectConnections"],null,M)}};k.actions.addAction("selectChildren",function(K){if(m.isEnabled()&&+1==m.getSelectionCount()){var N=m.getSelectionCell();K=mxEvent.isControlDown(K)?null:m.getOutgoingTreeEdges(N);if(null!=K&&0<K.length){N=[];for(var M=0;M<K.length;M++)N.push(m.model.getTerminal(K[M],!1));m.setSelectionCells(N)}else m.setSelectionCells(m.model.getChildren(N))}},null,null,"Alt+Shift+C");k.actions.addAction("selectDescendants",function(K){var N=m.getSelectionCell();if(m.isEnabled()&&null!=N){var M=[];mxEvent.isControlDown(K)||m.traverse(N,!0,function(n,A){var E=null!=A&&m.isTreeEdge(A);+E&&mxEvent.isControlDown(K)&&M.push(A);(null==A||E)&&M.push(n);return null==A||E});if(0==M.length||1==M.length&&M[0]==N)M=m.model.getDescendants(N);m.setSelectionCells(M)}},null,null,"Alt+Shift+X");k.actions.addAction("selectParent",function(K){var N=m.getSelectionCell();m.isEnabled()&&null!=N&&(K=mxEvent.isControlDown(K)?null:m.getIncomingTreeEdges(N),null!=K&&0<K.length?m.setSelectionCell(m.model.getTerminal(K[0],!0)):m.selectParentCell())},null,null,"Alt+Shift+P");k.actions.addAction("selectSiblings",+function(K){if(m.isEnabled()&&1==m.getSelectionCount()){var N=m.getSelectionCell(),M=mxEvent.isControlDown(K)?null:m.getIncomingTreeEdges(N);K=[];if(null!=M&&0<M.length&&(M=m.getOutgoingTreeEdges(m.model.getTerminal(M[0],!0)),null!=M))for(var n=0;n<M.length;n++)K.push(m.model.getTerminal(M[n],!1));0==K.length&&(K=m.model.getChildren(m.model.getParent(N)));m.setSelectionCells(K)}},null,null,"Alt+Shift+S");var z=m.removeCells;m.removeCells=function(K,N){N=null!=N?N:!0;null==K&&(K=this.getDeletableCells(this.getSelectionCells()));+N&&(K=this.getDeletableCells(this.addAllEdges(K)));for(var M=[],n=0;n<K.length;n++){var A=K[n];t.isEdge(A)&&p(A)&&(M.push(A),A=t.getTerminal(A,!1));if(c(A)){var E=[];m.traverse(A,!0,function(L,O){var R=null!=O&&m.isTreeEdge(O);R&&E.push(O);(null==O||R)&&E.push(L);return null==O||R});0<E.length&&(M=M.concat(E),A=m.getIncomingTreeEdges(K[n]),K=K.concat(A))}else null!=A&&M.push(K[n])}K=M;return z.apply(this,arguments)};k.hoverIcons.getStateAt=function(K,N,M){return c(K.cell)?null:this.graph.view.getState(this.graph.getCellAt(N,+M))};var I=m.duplicateCells;m.duplicateCells=function(K,N){K=null!=K?K:this.getSelectionCells();for(var M=K.slice(0),n=0;n<M.length;n++){var A=m.view.getState(M[n]);if(null!=A&&c(A.cell)){var E=m.getIncomingTreeEdges(A.cell);for(A=0;A<E.length;A++)mxUtils.remove(E[A],K)}}this.model.beginUpdate();try{var L=I.call(this,K,N);if(L.length==K.length)for(n=0;n<K.length;n++)if(c(K[n])){var O=m.getIncomingTreeEdges(L[n]);E=m.getIncomingTreeEdges(K[n]);if(0==O.length&&0<E.length){var R=this.cloneCell(E[0]);+this.addEdge(R,m.getDefaultParent(),this.model.getTerminal(E[0],!0),L[n])}}}finally{this.model.endUpdate()}return L};var F=m.moveCells;m.moveCells=function(K,N,M,n,A,E,L){for(var O=null,R=[],T=0;T<K.length;T++)(l(K[T])||c(K[T]))&&!q(K[T])&&this.isCellCollapsed(K[T])?R=R.concat(this.getSubtree(K[T])):R.push(K[T]);K=mxUtils.removeDuplicates(R);this.model.beginUpdate();try{R=A;var U=this.getCurrentCellStyle(A);if(null!=K&&c(A)&&"1"==mxUtils.getValue(U,"treeFolding","0")){for(T=0;T<K.length;T++)if(c(K[T])||+m.model.isEdge(K[T])&&null==m.model.getTerminal(K[T],!0)){A=m.model.getParent(K[T]);break}if(null!=R&&A!=R&&null!=this.view.getState(K[0])){var W=m.getIncomingTreeEdges(K[0]);if(0<W.length){var X=m.view.getState(m.model.getTerminal(W[0],!0));if(null!=X){var Y=m.view.getState(R);null!=Y&&(N=(Y.getCenterX()-X.getCenterX())/m.view.scale,M=(Y.getCenterY()-X.getCenterY())/m.view.scale)}}}}O=F.apply(this,arguments);if(null!=O&&null!=K&&O.length==K.length)for(T=0;T<O.length;T++)if(this.model.isEdge(O[T]))c(R)&&+0>mxUtils.indexOf(O,this.model.getTerminal(O[T],!0))&&this.model.setTerminal(O[T],R,!0);else if(c(K[T])&&(W=m.getIncomingTreeEdges(K[T]),0<W.length))if(!n)c(R)&&0>mxUtils.indexOf(K,this.model.getTerminal(W[0],!0))&&this.model.setTerminal(W[0],R,!0);else if(0==m.getIncomingTreeEdges(O[T]).length){U=R;if(null==U||U==m.model.getParent(K[T]))U=m.model.getTerminal(W[0],!0);n=this.cloneCell(W[0]);this.addEdge(n,m.getDefaultParent(),U,O[T])}}finally{this.model.endUpdate()}return O};if(null!=k.sidebar){var C=+k.sidebar.dropAndConnect;k.sidebar.dropAndConnect=function(K,N,M,n){var A=m.model,E=null;A.beginUpdate();try{if(E=C.apply(this,arguments),c(K))for(var L=0;L<E.length;L++)if(A.isEdge(E[L])&&null==A.getTerminal(E[L],!0)){A.setTerminal(E[L],K,!0);var O=m.getCellGeometry(E[L]);O.points=null;null!=O.getTerminalPoint(!0)&&O.setTerminalPoint(null,!0)}}finally{A.endUpdate()}return E}}var Q={67:k.actions.get("selectChildren"),88:k.actions.get("selectDescendants"),80:k.actions.get("selectParent"),83:k.actions.get("selectSiblings")},+S={67:k.actions.get("copyStyle"),86:k.actions.get("pasteStyle")},V=k.onKeyDown;k.onKeyDown=function(K){try{var N=m.getSelectionCell();if(m.isEnabled()&&!m.isEditing()&&null!=N){var M=mxEvent.isAltDown(K)&&mxEvent.isShiftDown(K)?Q[K.keyCode]:mxEvent.isAltDown(K)?S[K.keyCode]:null;null!=M?(M.funct(K),mxEvent.consume(K)):c(N)&&(M=null,0<m.getIncomingTreeEdges(N).length&&(9==K.which?M=mxEvent.isShiftDown(K)?G(N):B(N):13==K.which&&(M=D(N,!mxEvent.isShiftDown(K)))),null!=M&&0<M.length?(1==M.length&&m.model.isEdge(M[0])?+m.setSelectionCell(m.model.getTerminal(M[0],!1)):m.setSelectionCell(M[M.length-1]),null!=k.hoverIcons&&k.hoverIcons.update(m.view.getState(N)),m.startEditingAtCell(N),mxEvent.consume(K)):37==K.keyCode?(g(N,mxConstants.DIRECTION_WEST),mxEvent.consume(K)):38==K.keyCode?(g(N,mxConstants.DIRECTION_NORTH),mxEvent.consume(K)):39==K.keyCode?(g(N,mxConstants.DIRECTION_EAST),mxEvent.consume(K)):40==K.keyCode&&(g(N,mxConstants.DIRECTION_SOUTH),mxEvent.consume(K)))}}catch(n){k.handleError(n)}mxEvent.isConsumed(K)||+V.apply(this,arguments)};var P=m.connectVertex;m.connectVertex=function(K,N,M,n,A,E,L){var O=m.getIncomingTreeEdges(K);if(c(K)){var R=v(K),T=R==mxConstants.DIRECTION_EAST||R==mxConstants.DIRECTION_WEST,U=N==mxConstants.DIRECTION_EAST||N==mxConstants.DIRECTION_WEST;return R==N||0==O.length?B(K,N):T==U?G(K):D(K,N!=mxConstants.DIRECTION_NORTH&&N!=mxConstants.DIRECTION_WEST)}return P.apply(this,arguments)};m.getSubtree=function(K){var N=[K];!l(K)&&!c(K)||q(K)||m.traverse(K,!0,function(M,n){var A=null!=+n&&m.isTreeEdge(n);A&&0>mxUtils.indexOf(N,n)&&N.push(n);(null==n||A)&&0>mxUtils.indexOf(N,M)&&N.push(M);return null==n||A});return N};var u=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){u.apply(this,arguments);(l(this.state.cell)||c(this.state.cell))&&!q(this.state.cell)&&0<this.graph.getOutgoingTreeEdges(this.state.cell).length&&!this.graph.isCellCollapsed(this.state.cell)?null==this.moveHandle&&(this.moveHandle=mxUtils.createImage(Editor.moveImage),this.moveHandle.setAttribute("title","Move Subtree"),this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="24px",this.moveHandle.style.height="24px",this.graph.container.appendChild(this.moveHandle),this.redrawMoveHandle(),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(K){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(K),mxEvent.getClientY(K),this.graph.getSubtree(this.state.cell));this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(K);this.graph.isMouseDown=!0;k.hoverIcons.reset();mxEvent.consume(K)}))):null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)};var x=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){x.apply(this,arguments);this.redrawMoveHandle()};mxVertexHandler.prototype.redrawMoveHandle=function(){null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:-0)+2+"px",this.moveHandle.style.top=this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var J=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(K){J.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.display=K?"":"none")};var H=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(K,O){H.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=+0)+2+"px",this.moveHandle.style.top=this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var J=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(K){J.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.display=K?"":"none")};var H=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(K,N){H.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var f=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var c=f.apply(this,arguments),l=this.graph,p=this;return c.concat([this.addEntry("tree container",function(){var q=new mxCell("Tree Container",new mxGeometry(0,0,400,320),"swimlane;startSize=20;horizontal=1;containerType=tree;");q.vertex=!0;var v=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');-v.vertex=!0;var E=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');E.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");G.geometry.relative=!0;G.edge=!0;v.insertEdge(G,!0);E.insertEdge(G,!1);q.insert(G);q.insert(v);q.insert(E);+v.vertex=!0;var D=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');D.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");G.geometry.relative=!0;G.edge=!0;v.insertEdge(G,!0);D.insertEdge(G,!1);q.insert(G);q.insert(v);q.insert(D);return p.createVertexTemplateFromCells([q],q.geometry.width,q.geometry.height,q.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var q=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;startSize=20;horizontal=1;containerType=tree;");q.vertex=!0;var v=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-v.vertex=!0;var E=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');E.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");-G.geometry.relative=!0;G.edge=!0;v.insertEdge(G,!0);E.insertEdge(G,!1);var B=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+v.vertex=!0;var D=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');D.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");+G.geometry.relative=!0;G.edge=!0;v.insertEdge(G,!0);D.insertEdge(G,!1);var B=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');B.vertex=!0;var d=new mxCell("",new mxGeometry(0,0,0,0),G.style);d.geometry.relative=!0;d.edge=!0;v.insertEdge(d,!0);B.insertEdge(d,!1);var g=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');g.vertex=!0;var k=new mxCell("",new mxGeometry(0,0,0,0),G.style);k.geometry.relative=!0;k.edge=!0;v.insertEdge(k,!0);g.insertEdge(k,!1);var m=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-m.vertex=!0;var t=new mxCell("",new mxGeometry(0,0,0,0),G.style);t.geometry.relative=!0;t.edge=!0;v.insertEdge(t,!0);m.insertEdge(t,!1);q.insert(G);q.insert(d);q.insert(k);q.insert(t);q.insert(v);q.insert(E);q.insert(B);q.insert(g);q.insert(m);return p.createVertexTemplateFromCells([q],q.geometry.width,q.geometry.height,q.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var q=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};treeFolding=1;treeMoving=1;');+m.vertex=!0;var t=new mxCell("",new mxGeometry(0,0,0,0),G.style);t.geometry.relative=!0;t.edge=!0;v.insertEdge(t,!0);m.insertEdge(t,!1);q.insert(G);q.insert(d);q.insert(k);q.insert(t);q.insert(v);q.insert(D);q.insert(B);q.insert(g);q.insert(m);return p.createVertexTemplateFromCells([q],q.geometry.width,q.geometry.height,q.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var q=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};treeFolding=1;treeMoving=1;');q.vertex=!0;return p.createVertexTemplateFromCells([q],q.geometry.width,q.geometry.height,q.value)}),this.addEntry("tree mindmap mindmaps branch",function(){var q=new mxCell("Branch",new mxGeometry(0,0,80,20),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;recursiveResize=0;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');q.vertex=!0;var v=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");v.geometry.setTerminalPoint(new mxPoint(-40,40),!0);v.geometry.relative=!0;v.edge=!0;q.insertEdge(v,!1);return p.createVertexTemplateFromCells([q,v],q.geometry.width,q.geometry.height,q.value)}),this.addEntry("tree mindmap mindmaps sub topic",function(){var q=new mxCell("Sub Topic",new mxGeometry(0,0,80,26),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');q.vertex=!0;var v=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");v.geometry.setTerminalPoint(new mxPoint(-40,40),!0);v.geometry.relative=!0;v.edge=!0;q.insertEdge(v,!1);return p.createVertexTemplateFromCells([q,v],q.geometry.width,q.geometry.height,q.value)}),this.addEntry("tree orgchart organization division",function(){var q=new mxCell("Orgchart",new mxGeometry(0,0,280,220),'swimlane;startSize=20;horizontal=1;containerType=tree;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');q.vertex=!0;var v=new mxCell("Organization",new mxGeometry(80,-40,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');l.setAttributeForCell(v,"treeRoot","1");v.vertex=!0;var E=new mxCell("Division",new mxGeometry(20,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');E.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");-G.geometry.relative=!0;G.edge=!0;v.insertEdge(G,!0);E.insertEdge(G,!1);var B=new mxCell("Division",new mxGeometry(160,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');B.vertex=!0;var d=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");d.geometry.relative=-!0;d.edge=!0;v.insertEdge(d,!0);B.insertEdge(d,!1);q.insert(G);q.insert(d);q.insert(v);q.insert(E);q.insert(B);return p.createVertexTemplateFromCells([q],q.geometry.width,q.geometry.height,q.value)}),this.addEntry("tree root",function(){var q=new mxCell("Organization",new mxGeometry(0,0,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');l.setAttributeForCell(q,"treeRoot","1");q.vertex=!0;return p.createVertexTemplateFromCells([q],+40,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');l.setAttributeForCell(v,"treeRoot","1");v.vertex=!0;var D=new mxCell("Division",new mxGeometry(20,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');D.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");+G.geometry.relative=!0;G.edge=!0;v.insertEdge(G,!0);D.insertEdge(G,!1);var B=new mxCell("Division",new mxGeometry(160,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');B.vertex=!0;var d=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");d.geometry.relative=+!0;d.edge=!0;v.insertEdge(d,!0);B.insertEdge(d,!1);q.insert(G);q.insert(d);q.insert(v);q.insert(D);q.insert(B);return p.createVertexTemplateFromCells([q],q.geometry.width,q.geometry.height,q.value)}),this.addEntry("tree root",function(){var q=new mxCell("Organization",new mxGeometry(0,0,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');l.setAttributeForCell(q,"treeRoot","1");q.vertex=!0;return p.createVertexTemplateFromCells([q],q.geometry.width,q.geometry.height,q.value)}),this.addEntry("tree division",function(){var q=new mxCell("Division",new mxGeometry(20,40,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');q.vertex=!0;var v=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");v.geometry.setTerminalPoint(new mxPoint(0,0),!0);v.geometry.relative=!0;v.edge=!0;q.insertEdge(v,!1);return p.createVertexTemplateFromCells([q,v],q.geometry.width,q.geometry.height,q.value)}),this.addEntry("tree sub sections",function(){var q=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");q.vertex=!0;var v=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;curved=0;rounded=0;");-v.geometry.setTerminalPoint(new mxPoint(110,-40),!0);v.geometry.relative=!0;v.edge=!0;q.insertEdge(v,!1);var E=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");E.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),v.style);G.geometry.setTerminalPoint(new mxPoint(110,-40),!0);G.geometry.relative=!0;G.edge=!0;E.insertEdge(G,!1);return p.createVertexTemplateFromCells([v,G,q,E],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;+v.geometry.setTerminalPoint(new mxPoint(110,-40),!0);v.geometry.relative=!0;v.edge=!0;q.insertEdge(v,!1);var D=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");D.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),v.style);G.geometry.setTerminalPoint(new mxPoint(110,-40),!0);G.geometry.relative=!0;G.edge=!0;D.insertEdge(G,!1);return p.createVertexTemplateFromCells([v,G,q,D],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;EditorUi.initMinimalTheme=function(){function b(B,d){if(EditorUi.windowed){var g=B.editor.graph;g.popupMenuHandler.hideMenu();null==B.formatWindow?(B.formatWindow=new WrapperWindow(B,"",Math.max(10,B.diagramContainer.clientWidth-248),60,240,Math.min(566,g.container.clientHeight-10),function(k){k.className="geSidebarContainer geFormatContainer";B.createFormat(k).init()}),B.dependsOnLanguage(mxUtils.bind(this,function(){B.formatWindow.window.setTitle(mxResources.get("format"))})),B.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){B.formatWindow.window.fit()})),B.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80)):B.formatWindow.window.setVisible(null!=d?d:!B.formatWindow.window.isVisible())}else null==B.formatElt&&(B.formatElt=B.createSidebarContainer(),B.createFormat(B.formatElt).init(),B.formatElt.style.border="none",B.formatElt.style.width="240px",B.formatElt.style.borderLeftWidth="1px",B.formatElt.style.borderLeftStyle="solid",B.formatElt.style.right="0px"),d=B.diagramContainer.parentNode,null!=B.formatElt.parentNode?(B.formatElt.parentNode.removeChild(B.formatElt),d.style.right="0px"):(d.parentNode.appendChild(B.formatElt),d.style.right=B.formatElt.style.width)}function e(B,d){if(EditorUi.windowed){var g=B.editor.graph;g.popupMenuHandler.hideMenu();null==B.sidebarWindow?(B.sidebarWindow=new WrapperWindow(B,"",10,56,Math.min(g.container.clientWidth-10,218)-6,Math.min(g.container.clientHeight-40,650)-6,function(k){B.createShapesPanel(k)}),B.dependsOnLanguage(mxUtils.bind(this,function(){B.sidebarWindow.window.setTitle(mxResources.get("shapes"))})),@@ -14503,76 +14508,76 @@ function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var c=Efunction(B){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=B?B:!this.formatWindow.window.isVisible()):b(this)};EditorUi.prototype.isFormatPanelVisible=function(){return null!=this.formatWindow&&this.formatWindow.window.isVisible()||null==this.formatWindow&&0<this.formatWidth};var p=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.destroyWindows();p.apply(this,arguments)};var q=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(B){q.apply(this,arguments);if(B){var d=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=d&&null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=d&&this.formatWindow.window.setVisible(!0)}else null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1)};EditorUi.prototype.chromelessWindowResize=function(){};var v=Menus.prototype.init;Menus.prototype.init=function(){v.apply(this,arguments);var B=this.editorUi;EditorUi.enablePlantUml&&!B.isOffline()&&B.actions.put("plantUml",new Action("plantUml...",function(){var k=new ParseDialog(B,mxResources.get("plantUml")+"...","plantUml");B.showDialog(k.container,620,420,!0,!1);k.init()}));B.actions.put("mermaid",new Action("mermaid...",function(){var k=new ParseDialog(B,mxResources.get("mermaid")+"...","mermaid");B.showDialog(k.container,620,420,!0,!1);k.init()}));var d="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),-g=function(k,m,t,y){k.addItem(t,null,mxUtils.bind(this,function(){var A=new CreateGraphDialog(B,t,y);B.showDialog(A.container,620,420,!0,!1);A.init()}),m)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(k,m){for(var t=0;t<d.length;t++)"-"==d[t]?k.addSeparator(m):g(k,m,mxResources.get(d[t])+"...",d[t])})))};EditorUi.prototype.installFormatToolbar=function(B){var d=this.editor.graph,g=document.createElement("div");g.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";-d.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(k,m){0<d.getSelectionCount()?(B.appendChild(g),g.innerHTML="Selected: "+d.getSelectionCount()):null!=g.parentNode&&g.parentNode.removeChild(g)}))};var E=!1;EditorUi.prototype.initFormatWindow=function(){if(!E&&null!=this.formatWindow){E=!0;var B=this.formatWindow.window.toggleMinimized,d=240;this.formatWindow.window.toggleMinimized=function(){B.apply(this,arguments);this.minimized?(d=parseInt(this.div.style.width),this.div.style.width=+g=function(k,m,t,y){k.addItem(t,null,mxUtils.bind(this,function(){var z=new CreateGraphDialog(B,t,y);B.showDialog(z.container,620,420,!0,!1);z.init()}),m)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(k,m){for(var t=0;t<d.length;t++)"-"==d[t]?k.addSeparator(m):g(k,m,mxResources.get(d[t])+"...",d[t])})))};EditorUi.prototype.installFormatToolbar=function(B){var d=this.editor.graph,g=document.createElement("div");g.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";+d.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(k,m){0<d.getSelectionCount()?(B.appendChild(g),g.innerHTML="Selected: "+d.getSelectionCount()):null!=g.parentNode&&g.parentNode.removeChild(g)}))};var D=!1;EditorUi.prototype.initFormatWindow=function(){if(!D&&null!=this.formatWindow){D=!0;var B=this.formatWindow.window.toggleMinimized,d=240;this.formatWindow.window.toggleMinimized=function(){B.apply(this,arguments);this.minimized?(d=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+d-140+"px"):(this.div.style.width=d+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-d+140)+"px");this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(g){mxEvent.getSource(g)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var G=EditorUi.prototype.init;EditorUi.prototype.init=-function(){function B(z,D,L){var N=t.menus.get(z);D=I.addMenu(mxResources.get(z),mxUtils.bind(this,function(){N.funct.apply(this,arguments)}));D.className="geButton";D.setAttribute("title",mxResources.get(z));t.menus.menuCreated(N,D,"geButton");null!=L&&(D.style.backgroundImage="url("+L+")",D.innerText="");return D}function d(z,D,L,N,R,T){var U=document.createElement("a");U.className="geButton";A.appendChild(U);null!=T?U.style.backgroundImage="url("+T+")":mxUtils.write(U,z);mxEvent.addListener(U,-"click",function(W){"disabled"!=U.getAttribute("disabled")&&D(W);mxEvent.consume(W)});mxEvent.preventDefault(U);null!=N&&U.setAttribute("title",N);null!=R&&(z=function(){R.isEnabled()?U.removeAttribute("disabled"):U.setAttribute("disabled","disabled")},R.addListener("stateChanged",z),y.addListener("enabledChanged",z),z());return U}function g(z,D,L){D=document.createElement("div");D.className="geButtonGroup";for(L=0;L<z.length;L++)null!=z[L]&&D.appendChild(z[L]);A.appendChild(D);return D}function k(){f=-window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;A.innerHTML="";var z=1E3>f,D=B("diagram",null,z?Editor.menuImage:null);g([D,d(mxResources.get("shapes"),t.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),t.actions.get("image"),z?Editor.shapesImage:null),d(mxResources.get("format"),t.actions.get("format").funct,null,mxResources.get("format")+" ("+t.actions.get("format").shortcut+")",t.actions.get("image"),z?Editor.formatImage:null)]);D=B("insert",!0,-z?V:null);g([D,d(mxResources.get("delete"),t.actions.get("delete").funct,null,mxResources.get("delete"),t.actions.get("delete"),z?Editor.trashImage:null)]);y.isEnabled()||D.setAttribute("disabled","disabled");O.setAttribute("title",mxResources.get("undo")+" ("+H.shortcut+")");M.setAttribute("title",mxResources.get("redo")+" ("+K.shortcut+")");n.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");411<=f&&(g([O,M]),520<=f&&g([n,640<=f?d("",x.funct,!0,mxResources.get("zoomIn")+" ("+-Editor.ctrlKey+" +)",x,Editor.zoomInImage):null,640<=f?d("",J.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",J,Editor.zoomOutImage):null]));A.appendChild(t.statusContainer);A.appendChild(t.buttonContainer)}G.apply(this,arguments);var m=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=m&&(m.classList.add("geSimple"),m.classList.add("geMinimal"),m.classList.remove("geClassic"));this.sidebar=this.createSidebar(this.sidebarContainer);-if(1E3<=f||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])e(this,!0),null!=this.sidebar&&null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search"));EditorUi.windowed&&1E3<=f&&(b(this,!0),this.formatWindow.window.setVisible(!0));var t=this,y=t.editor.graph;t.toolbar=this.createToolbar(t.createDiv("geToolbar"));var A=document.createElement("div");A.className="geMenubarContainer";-var I=new Menubar(t,A),F=t.hideCurrentMenu;t.hideCurrentMenu=function(){F.apply(this,arguments);this.editor.graph.popupMenuHandler.hideMenu()};var C=t.descriptorChanged;t.descriptorChanged=function(){C.apply(this,arguments);var z=t.getCurrentFile();if(null!=z&&null!=z.getTitle()){var D=z.getMode();"google"==D?D="googleDrive":"github"==D?D="gitHub":"gitlab"==D?D="gitLab":"onedrive"==D&&(D="oneDrive");D=mxResources.get(D);A.setAttribute("title",z.getTitle()+(null!=D?" ("+D+")":""))}else A.removeAttribute("title")};-t.setStatusText(t.editor.getStatus());A.appendChild(t.statusContainer);t.buttonContainer=this.createButtonContainer();A.appendChild(t.buttonContainer);t.menubarContainer=t.buttonContainer;t.tabContainer=this.createTabContainer();var Q=this.createZoomInput(!0),S=t.updateTabContainer;t.updateTabContainer=function(){S.apply(this,arguments);t.tabContainer.appendChild(Q)};var V=Editor.addBoxImage;if(null!=t.hoverIcons){var P=t.hoverIcons.update;t.hoverIcons.update=function(){y.freehand.isDrawing()||P.apply(this,-arguments)}}if(null!=y.freehand){var u=y.freehand.createStyle;y.freehand.createStyle=function(z){return u.apply(this,arguments)+"sketch=0;"}}t.editor.addListener("statusChanged",mxUtils.bind(this,function(){t.setStatusText(t.editor.getStatus())}));t.setStatusText(t.editor.getStatus());var x=t.actions.get("zoomIn"),J=t.actions.get("zoomOut");m=t.actions.get("resetView");var H=t.actions.get("undo"),K=t.actions.get("redo"),O=d("",H.funct,null,"",H,Editor.undoImage),M=d("",K.funct,null,"",K,Editor.redoImage),-n=d("",function(z){mxEvent.isAltDown(z)?(t.hideCurrentMenu(),t.actions.get("customZoom").funct()):(t.hideCurrentMenu(),t.actions.get("smartFit").funct());mxEvent.consume(z)},!0,"",m,Editor.zoomFitImage);t.container.appendChild(t.tabContainer);t.container.appendChild(A);t.updateTabContainer();!EditorUi.windowed&&1E3<=f&&b(this,!0);k();t.addListener("lockedChanged",k);t.addListener("languageChanged",k);t.editor.graph.addListener("enabledChanged",k);mxEvent.addListener(window,"resize",function(){k();+function(){function B(A,E,L){var O=t.menus.get(A);E=I.addMenu(mxResources.get(A),mxUtils.bind(this,function(){O.funct.apply(this,arguments)}));E.className="geButton";E.setAttribute("title",mxResources.get(A));t.menus.menuCreated(O,E,"geButton");null!=L&&(E.style.backgroundImage="url("+L+")",E.innerText="");return E}function d(A,E,L,O,R,T){var U=document.createElement("a");U.className="geButton";z.appendChild(U);null!=T?U.style.backgroundImage="url("+T+")":mxUtils.write(U,A);mxEvent.addListener(U,+"click",function(W){"disabled"!=U.getAttribute("disabled")&&E(W);mxEvent.consume(W)});mxEvent.preventDefault(U);null!=O&&U.setAttribute("title",O);null!=R&&(A=function(){R.isEnabled()?U.removeAttribute("disabled"):U.setAttribute("disabled","disabled")},R.addListener("stateChanged",A),y.addListener("enabledChanged",A),A());return U}function g(A,E,L){E=document.createElement("div");E.className="geButtonGroup";for(L=0;L<A.length;L++)null!=A[L]&&E.appendChild(A[L]);z.appendChild(E);return E}function k(){f=+window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;z.innerHTML="";var A=1E3>f,E=B("diagram",null,A?Editor.menuImage:null);g([E,d(mxResources.get("shapes"),t.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),t.actions.get("image"),A?Editor.shapesImage:null),d(mxResources.get("format"),t.actions.get("format").funct,null,mxResources.get("format")+" ("+t.actions.get("format").shortcut+")",t.actions.get("image"),A?Editor.formatImage:null)]);E=B("insert",!0,+A?V:null);g([E,d(mxResources.get("delete"),t.actions.get("delete").funct,null,mxResources.get("delete"),t.actions.get("delete"),A?Editor.trashImage:null)]);y.isEnabled()||E.setAttribute("disabled","disabled");N.setAttribute("title",mxResources.get("undo")+" ("+H.shortcut+")");M.setAttribute("title",mxResources.get("redo")+" ("+K.shortcut+")");n.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");411<=f&&(g([N,M]),520<=f&&g([n,640<=f?d("",x.funct,!0,mxResources.get("zoomIn")+" ("++Editor.ctrlKey+" +)",x,Editor.zoomInImage):null,640<=f?d("",J.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",J,Editor.zoomOutImage):null]));z.appendChild(t.statusContainer);z.appendChild(t.buttonContainer)}G.apply(this,arguments);var m=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=m&&(m.classList.add("geSimple"),m.classList.add("geMinimal"),m.classList.remove("geClassic"));this.sidebar=this.createSidebar(this.sidebarContainer);+if(1E3<=f||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])e(this,!0),null!=this.sidebar&&null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search"));EditorUi.windowed&&1E3<=f&&(b(this,!0),this.formatWindow.window.setVisible(!0));var t=this,y=t.editor.graph;t.toolbar=this.createToolbar(t.createDiv("geToolbar"));var z=document.createElement("div");z.className="geMenubarContainer";+var I=new Menubar(t,z),F=t.hideCurrentMenu;t.hideCurrentMenu=function(){F.apply(this,arguments);this.editor.graph.popupMenuHandler.hideMenu()};var C=t.descriptorChanged;t.descriptorChanged=function(){C.apply(this,arguments);var A=t.getCurrentFile();if(null!=A&&null!=A.getTitle()){var E=A.getMode();"google"==E?E="googleDrive":"github"==E?E="gitHub":"gitlab"==E?E="gitLab":"onedrive"==E&&(E="oneDrive");E=mxResources.get(E);z.setAttribute("title",A.getTitle()+(null!=E?" ("+E+")":""))}else z.removeAttribute("title")};+t.setStatusText(t.editor.getStatus());z.appendChild(t.statusContainer);t.buttonContainer=this.createButtonContainer();z.appendChild(t.buttonContainer);t.menubarContainer=t.buttonContainer;t.tabContainer=this.createTabContainer();var Q=this.createZoomInput(!0),S=t.updateTabContainer;t.updateTabContainer=function(){S.apply(this,arguments);t.tabContainer.appendChild(Q)};var V=Editor.addBoxImage;if(null!=t.hoverIcons){var P=t.hoverIcons.update;t.hoverIcons.update=function(){y.freehand.isDrawing()||P.apply(this,+arguments)}}if(null!=y.freehand){var u=y.freehand.createStyle;y.freehand.createStyle=function(A){return u.apply(this,arguments)+"sketch=0;"}}t.editor.addListener("statusChanged",mxUtils.bind(this,function(){t.setStatusText(t.editor.getStatus())}));t.setStatusText(t.editor.getStatus());var x=t.actions.get("zoomIn"),J=t.actions.get("zoomOut");m=t.actions.get("resetView");var H=t.actions.get("undo"),K=t.actions.get("redo"),N=d("",H.funct,null,"",H,Editor.undoImage),M=d("",K.funct,null,"",K,Editor.redoImage),+n=d("",function(A){mxEvent.isAltDown(A)?(t.hideCurrentMenu(),t.actions.get("customZoom").funct()):(t.hideCurrentMenu(),t.actions.get("smartFit").funct());mxEvent.consume(A)},!0,"",m,Editor.zoomFitImage);t.container.appendChild(t.tabContainer);t.container.appendChild(z);t.updateTabContainer();!EditorUi.windowed&&1E3<=f&&b(this,!0);k();t.addListener("lockedChanged",k);t.addListener("languageChanged",k);t.editor.graph.addListener("enabledChanged",k);mxEvent.addListener(window,"resize",function(){k();null!=t.sidebarWindow&&t.sidebarWindow.window.fit();null!=t.formatWindow&&t.formatWindow.window.fit();null!=t.actions.outlineWindow&&t.actions.outlineWindow.window.fit();null!=t.actions.layersWindow&&t.actions.layersWindow.window.fit();null!=t.menus.chatWindow&&t.menus.chatWindow.window.fit();null!=t.menus.tagsWindow&&t.menus.tagsWindow.window.fit();null!=t.menus.findWindow&&t.menus.findWindow.window.fit();null!=t.menus.findReplaceWindow&&t.menus.findReplaceWindow.window.fit()})}}};-(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var e=EditorUi.initTheme;EditorUi.initTheme=function(){e.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();(function(){var b=mxGuide.prototype.move;mxGuide.prototype.move=function(c,l,p,q){var v=l.y,E=l.x,G=!1,B=!1;if(null!=this.states&&null!=c&&null!=l){var d=this,g=new mxCellState,k=this.graph.getView().scale,m=Math.max(2,this.getGuideTolerance()/2);g.x=c.x+E;g.y=c.y+v;g.width=c.width;g.height=c.height;for(var t=[],y=[],A=0;A<this.states.length;A++){var I=this.states[A];I instanceof mxCellState&&(q||!this.graph.isCellSelected(I.cell))&&((g.x>=I.x&&g.x<=I.x+I.width||I.x>=g.x&&I.x<=g.x+g.width)&&(g.y>-I.y+I.height+4||g.y+g.height+4<I.y)?t.push(I):(g.y>=I.y&&g.y<=I.y+I.height||I.y>=g.y&&I.y<=g.y+g.height)&&(g.x>I.x+I.width+4||g.x+g.width+4<I.x)&&y.push(I))}var F=0,C=0,Q=I=0,S=0,V=0,P=0,u=0,x=5*k;if(1<t.length){t.push(g);t.sort(function(O,M){return O.y-M.y});var J=!1;A=g==t[0];k=g==t[t.length-1];if(!A&&!k)for(A=1;A<t.length-1;A++)if(g==t[A]){k=t[A-1];A=t[A+1];I=C=Q=(A.y-k.y-k.height-g.height)/2;break}for(A=0;A<t.length-1;A++){k=t[A];var H=t[A+1],K=g==k||g==H;H=H.y-k.y-k.height;J|=g==k;if(0==C&&0==-F)C=H,F=1;else if(Math.abs(C-H)<=(K||1==A&&J?m:0))F+=1;else if(1<F&&J){t=t.slice(0,A+1);break}else if(3<=t.length-A&&!J)F=0,I=C=0!=Q?Q:0,t.splice(0,0==A?1:A),A=-1;else break;0!=I||K||(C=I=H)}3==t.length&&t[1]==g&&(I=0)}if(1<y.length){y.push(g);y.sort(function(O,M){return O.x-M.x});J=!1;A=g==y[0];k=g==y[y.length-1];if(!A&&!k)for(A=1;A<y.length-1;A++)if(g==y[A]){k=y[A-1];A=y[A+1];P=V=u=(A.x-k.x-k.width-g.width)/2;break}for(A=0;A<y.length-1;A++){k=y[A];H=y[A+1];K=g==k||g==H;H=H.x-k.x-k.width;J|=g==k;-if(0==V&&0==S)V=H,S=1;else if(Math.abs(V-H)<=(K||1==A&&J?m:0))S+=1;else if(1<S&&J){y=y.slice(0,A+1);break}else if(3<=y.length-A&&!J)S=0,P=V=0!=u?u:0,y.splice(0,0==A?1:A),A=-1;else break;0!=P||K||(V=P=H)}3==y.length&&y[1]==g&&(P=0)}m=function(O,M,n,z){var D=[];if(z){z=x;var L=0}else z=0,L=x;D.push(new mxPoint(O.x-z,O.y-L));D.push(new mxPoint(O.x+z,O.y+L));D.push(O);D.push(M);D.push(new mxPoint(M.x-z,M.y-L));D.push(new mxPoint(M.x+z,M.y+L));if(null!=n)return n.points=D,n;O=new mxPolyline(D,mxConstants.GUIDE_COLOR,-mxConstants.GUIDE_STROKEWIDTH);O.dialect=mxConstants.DIALECT_SVG;O.pointerEvents=!1;O.init(d.graph.getView().getOverlayPane());return O};V=function(O,M){if(O&&null!=d.guidesArrHor)for(O=0;O<d.guidesArrHor.length;O++)d.guidesArrHor[O].node.style.visibility="hidden";if(M&&null!=d.guidesArrVer)for(O=0;O<d.guidesArrVer.length;O++)d.guidesArrVer[O].node.style.visibility="hidden"};if(1<S&&S==y.length-1){S=[];u=d.guidesArrHor;G=[];E=0;A=y[0]==g?1:0;J=y[A].y+y[A].height;if(0<P)for(A=0;A<y.length-1;A++)k=-y[A],H=y[A+1],g==k?(E=H.x-k.width-P,G.push(new mxPoint(E+k.width+x,J)),G.push(new mxPoint(H.x-x,J))):g==H?(G.push(new mxPoint(k.x+k.width+x,J)),E=k.x+k.width+P,G.push(new mxPoint(E-x,J))):(G.push(new mxPoint(k.x+k.width+x,J)),G.push(new mxPoint(H.x-x,J)));else k=y[0],A=y[2],E=k.x+k.width+(A.x-k.x-k.width-g.width)/2,G.push(new mxPoint(k.x+k.width+x,J)),G.push(new mxPoint(E-x,J)),G.push(new mxPoint(E+g.width+x,J)),G.push(new mxPoint(A.x-x,J));for(A=0;A<G.length;A+=2)y=G[A],P=G[A+1],y=m(y,P,null!=u?-u[A/2]:null),y.node.style.visibility="visible",y.redraw(),S.push(y);for(A=G.length/2;null!=u&&A<u.length;A++)u[A].destroy();d.guidesArrHor=S;E-=c.x;G=!0}else V(!0);if(1<F&&F==t.length-1){S=[];u=d.guidesArrVer;B=[];v=0;A=t[0]==g?1:0;F=t[A].x+t[A].width;if(0<I)for(A=0;A<t.length-1;A++)k=t[A],H=t[A+1],g==k?(v=H.y-k.height-I,B.push(new mxPoint(F,v+k.height+x)),B.push(new mxPoint(F,H.y-x))):g==H?(B.push(new mxPoint(F,k.y+k.height+x)),v=k.y+k.height+I,B.push(new mxPoint(F,v-x))):(B.push(new mxPoint(F,k.y+-k.height+x)),B.push(new mxPoint(F,H.y-x)));else k=t[0],A=t[2],v=k.y+k.height+(A.y-k.y-k.height-g.height)/2,B.push(new mxPoint(F,k.y+k.height+x)),B.push(new mxPoint(F,v-x)),B.push(new mxPoint(F,v+g.height+x)),B.push(new mxPoint(F,A.y-x));for(A=0;A<B.length;A+=2)y=B[A],P=B[A+1],y=m(y,P,null!=u?u[A/2]:null,!0),y.node.style.visibility="visible",y.redraw(),S.push(y);for(A=B.length/2;null!=u&&A<u.length;A++)u[A].destroy();d.guidesArrVer=S;v-=c.y;B=!0}else V(!1,!0)}if(G||B)return g=new mxPoint(E,v),t=b.call(this,+(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var e=EditorUi.initTheme;EditorUi.initTheme=function(){e.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();(function(){var b=mxGuide.prototype.move;mxGuide.prototype.move=function(c,l,p,q){var v=l.y,D=l.x,G=!1,B=!1;if(null!=this.states&&null!=c&&null!=l){var d=this,g=new mxCellState,k=this.graph.getView().scale,m=Math.max(2,this.getGuideTolerance()/2);g.x=c.x+D;g.y=c.y+v;g.width=c.width;g.height=c.height;for(var t=[],y=[],z=0;z<this.states.length;z++){var I=this.states[z];I instanceof mxCellState&&(q||!this.graph.isCellSelected(I.cell))&&((g.x>=I.x&&g.x<=I.x+I.width||I.x>=g.x&&I.x<=g.x+g.width)&&(g.y>+I.y+I.height+4||g.y+g.height+4<I.y)?t.push(I):(g.y>=I.y&&g.y<=I.y+I.height||I.y>=g.y&&I.y<=g.y+g.height)&&(g.x>I.x+I.width+4||g.x+g.width+4<I.x)&&y.push(I))}var F=0,C=0,Q=I=0,S=0,V=0,P=0,u=0,x=5*k;if(1<t.length){t.push(g);t.sort(function(N,M){return N.y-M.y});var J=!1;z=g==t[0];k=g==t[t.length-1];if(!z&&!k)for(z=1;z<t.length-1;z++)if(g==t[z]){k=t[z-1];z=t[z+1];I=C=Q=(z.y-k.y-k.height-g.height)/2;break}for(z=0;z<t.length-1;z++){k=t[z];var H=t[z+1],K=g==k||g==H;H=H.y-k.y-k.height;J|=g==k;if(0==C&&0==+F)C=H,F=1;else if(Math.abs(C-H)<=(K||1==z&&J?m:0))F+=1;else if(1<F&&J){t=t.slice(0,z+1);break}else if(3<=t.length-z&&!J)F=0,I=C=0!=Q?Q:0,t.splice(0,0==z?1:z),z=-1;else break;0!=I||K||(C=I=H)}3==t.length&&t[1]==g&&(I=0)}if(1<y.length){y.push(g);y.sort(function(N,M){return N.x-M.x});J=!1;z=g==y[0];k=g==y[y.length-1];if(!z&&!k)for(z=1;z<y.length-1;z++)if(g==y[z]){k=y[z-1];z=y[z+1];P=V=u=(z.x-k.x-k.width-g.width)/2;break}for(z=0;z<y.length-1;z++){k=y[z];H=y[z+1];K=g==k||g==H;H=H.x-k.x-k.width;J|=g==k;+if(0==V&&0==S)V=H,S=1;else if(Math.abs(V-H)<=(K||1==z&&J?m:0))S+=1;else if(1<S&&J){y=y.slice(0,z+1);break}else if(3<=y.length-z&&!J)S=0,P=V=0!=u?u:0,y.splice(0,0==z?1:z),z=-1;else break;0!=P||K||(V=P=H)}3==y.length&&y[1]==g&&(P=0)}m=function(N,M,n,A){var E=[];if(A){A=x;var L=0}else A=0,L=x;E.push(new mxPoint(N.x-A,N.y-L));E.push(new mxPoint(N.x+A,N.y+L));E.push(N);E.push(M);E.push(new mxPoint(M.x-A,M.y-L));E.push(new mxPoint(M.x+A,M.y+L));if(null!=n)return n.points=E,n;N=new mxPolyline(E,mxConstants.GUIDE_COLOR,+mxConstants.GUIDE_STROKEWIDTH);N.dialect=mxConstants.DIALECT_SVG;N.pointerEvents=!1;N.init(d.graph.getView().getOverlayPane());return N};V=function(N,M){if(N&&null!=d.guidesArrHor)for(N=0;N<d.guidesArrHor.length;N++)d.guidesArrHor[N].node.style.visibility="hidden";if(M&&null!=d.guidesArrVer)for(N=0;N<d.guidesArrVer.length;N++)d.guidesArrVer[N].node.style.visibility="hidden"};if(1<S&&S==y.length-1){S=[];u=d.guidesArrHor;G=[];D=0;z=y[0]==g?1:0;J=y[z].y+y[z].height;if(0<P)for(z=0;z<y.length-1;z++)k=+y[z],H=y[z+1],g==k?(D=H.x-k.width-P,G.push(new mxPoint(D+k.width+x,J)),G.push(new mxPoint(H.x-x,J))):g==H?(G.push(new mxPoint(k.x+k.width+x,J)),D=k.x+k.width+P,G.push(new mxPoint(D-x,J))):(G.push(new mxPoint(k.x+k.width+x,J)),G.push(new mxPoint(H.x-x,J)));else k=y[0],z=y[2],D=k.x+k.width+(z.x-k.x-k.width-g.width)/2,G.push(new mxPoint(k.x+k.width+x,J)),G.push(new mxPoint(D-x,J)),G.push(new mxPoint(D+g.width+x,J)),G.push(new mxPoint(z.x-x,J));for(z=0;z<G.length;z+=2)y=G[z],P=G[z+1],y=m(y,P,null!=u?+u[z/2]:null),y.node.style.visibility="visible",y.redraw(),S.push(y);for(z=G.length/2;null!=u&&z<u.length;z++)u[z].destroy();d.guidesArrHor=S;D-=c.x;G=!0}else V(!0);if(1<F&&F==t.length-1){S=[];u=d.guidesArrVer;B=[];v=0;z=t[0]==g?1:0;F=t[z].x+t[z].width;if(0<I)for(z=0;z<t.length-1;z++)k=t[z],H=t[z+1],g==k?(v=H.y-k.height-I,B.push(new mxPoint(F,v+k.height+x)),B.push(new mxPoint(F,H.y-x))):g==H?(B.push(new mxPoint(F,k.y+k.height+x)),v=k.y+k.height+I,B.push(new mxPoint(F,v-x))):(B.push(new mxPoint(F,k.y++k.height+x)),B.push(new mxPoint(F,H.y-x)));else k=t[0],z=t[2],v=k.y+k.height+(z.y-k.y-k.height-g.height)/2,B.push(new mxPoint(F,k.y+k.height+x)),B.push(new mxPoint(F,v-x)),B.push(new mxPoint(F,v+g.height+x)),B.push(new mxPoint(F,z.y-x));for(z=0;z<B.length;z+=2)y=B[z],P=B[z+1],y=m(y,P,null!=u?u[z/2]:null,!0),y.node.style.visibility="visible",y.redraw(),S.push(y);for(z=B.length/2;null!=u&&z<u.length;z++)u[z].destroy();d.guidesArrVer=S;v-=c.y;B=!0}else V(!1,!0)}if(G||B)return g=new mxPoint(D,v),t=b.call(this,c,g,p,q),G&&!B?g.y=t.y:B&&!G&&(g.x=t.x),t.y!=g.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),t.x!=g.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),g;V(!0,!0);return b.apply(this,arguments)};var e=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(c){e.call(this,c);var l=this.guidesArrVer,p=this.guidesArrHor;if(null!=l)for(var q=0;q<l.length;q++)l[q].node.style.visibility=c?"visible":"hidden";if(null!=-p)for(q=0;q<p.length;q++)p[q].node.style.visibility=c?"visible":"hidden"};var f=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){f.call(this);var c=this.guidesArrVer,l=this.guidesArrHor;if(null!=c){for(var p=0;p<c.length;p++)c[p].destroy();this.guidesArrVer=null}if(null!=l){for(p=0;p<l.length;p++)l[p].destroy();this.guidesArrHor=null}}})();function mxRuler(b,e,f,c){function l(){var F=b.getDiagramContainerOffset(),C=b.diagramContainer;d.style.top=C.offsetTop-F.y+"px";d.style.left=C.offsetLeft-F.x+"px";d.style.width=(f?0:C.offsetWidth)+E+"px";d.style.height=(f?C.offsetHeight:0)+E+"px"}function p(F,C,Q){if(null!=q)return F;var S;return function(){var V=this,P=arguments,u=Q&&!S;clearTimeout(S);S=setTimeout(function(){S=null;Q||F.apply(V,P)},C);u&&F.apply(V,P)}}var q=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||-window.msRequestAnimationFrame,v=window.cancelAnimationFrame||window.mozCancelAnimationFrame,E=this.RULER_THICKNESS,G=this;this.unit=e;var B=Editor.isDarkMode()?{bkgClr:"#202020",outBkgClr:"#1B1D1E",cornerClr:"#1B1D1E",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{bkgClr:"#ffffff",outBkgClr:"#f1f3f4",cornerClr:"#f1f3f4",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"},d=document.createElement("div");d.className="geRuler";d.style.position="fixed";this.updateStyle=mxUtils.bind(this,+p)for(q=0;q<p.length;q++)p[q].node.style.visibility=c?"visible":"hidden"};var f=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){f.call(this);var c=this.guidesArrVer,l=this.guidesArrHor;if(null!=c){for(var p=0;p<c.length;p++)c[p].destroy();this.guidesArrVer=null}if(null!=l){for(p=0;p<l.length;p++)l[p].destroy();this.guidesArrHor=null}}})();function mxRuler(b,e,f,c){function l(){var F=b.getDiagramContainerOffset(),C=b.diagramContainer;d.style.top=C.offsetTop-F.y+"px";d.style.left=C.offsetLeft-F.x+"px";d.style.width=(f?0:C.offsetWidth)+D+"px";d.style.height=(f?C.offsetHeight:0)+D+"px"}function p(F,C,Q){if(null!=q)return F;var S;return function(){var V=this,P=arguments,u=Q&&!S;clearTimeout(S);S=setTimeout(function(){S=null;Q||F.apply(V,P)},C);u&&F.apply(V,P)}}var q=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||+window.msRequestAnimationFrame,v=window.cancelAnimationFrame||window.mozCancelAnimationFrame,D=this.RULER_THICKNESS,G=this;this.unit=e;var B=Editor.isDarkMode()?{bkgClr:"#202020",outBkgClr:"#1B1D1E",cornerClr:"#1B1D1E",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{bkgClr:"#ffffff",outBkgClr:"#f1f3f4",cornerClr:"#f1f3f4",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"},d=document.createElement("div");d.className="geRuler";d.style.position="fixed";this.updateStyle=mxUtils.bind(this,function(){B=Editor.isDarkMode()?{outBkgClr:"#1B1D1E",cornerClr:"#1B1D1E",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"}:{outBkgClr:"#f1f3f4",cornerClr:"#f1f3f4",strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"};d.style[f?"borderRight":"borderBottom"]="0.5px solid "+B.strokeClr;d.style.borderLeft="0.5px solid "+B.strokeClr});this.updateStyle();b.diagramContainer.appendChild(d);mxEvent.disableContextMenu(d);this.editorUiRefresh=b.refresh;b.refresh=function(F){G.editorUiRefresh.apply(b,arguments);l()};l();var g=document.createElement("canvas");g.width=d.offsetWidth;g.height=d.offsetHeight;d.style.overflow="hidden";g.style.position="relative";d.appendChild(g);var k=g.getContext("2d");this.ui=b;var m=b.editor.graph;this.graph=m;this.container=d;this.canvas=g;var t=function(F,C,Q,S,V){F=Math.round(F);C=Math.round(C);Q=Math.round(Q);S=Math.round(S);k.beginPath();k.moveTo(F+.5,C+.5);k.lineTo(Q+.5,S+.5);k.stroke();V&&(f?(k.save(),k.translate(F,C),k.rotate(-Math.PI/2),k.fillText(V,0,0),-k.restore()):k.fillText(V,F,C))},y=function(){k.clearRect(0,0,g.width,g.height);k.beginPath();k.lineWidth=.7;k.strokeStyle=B.strokeClr;k.setLineDash([]);k.font="9px Arial";k.textAlign="center";var F=m.view.scale,C=m.view.getBackgroundPageBounds(),Q=m.view.translate,S=m.pageVisible;Q=S?E+(f?C.y-m.container.scrollTop:C.x-m.container.scrollLeft):E+(f?Q.y*F-m.container.scrollTop:Q.x*F-m.container.scrollLeft);var V=0;S&&(V=m.getPageLayout(),V=f?V.y*m.pageFormat.height:V.x*m.pageFormat.width);var P;switch(G.unit){case mxConstants.POINTS:var u=+k.restore()):k.fillText(V,F,C))},y=function(){k.clearRect(0,0,g.width,g.height);k.beginPath();k.lineWidth=.7;k.strokeStyle=B.strokeClr;k.setLineDash([]);k.font="9px Arial";k.textAlign="center";var F=m.view.scale,C=m.view.getBackgroundPageBounds(),Q=m.view.translate,S=m.pageVisible;Q=S?D+(f?C.y-m.container.scrollTop:C.x-m.container.scrollLeft):D+(f?Q.y*F-m.container.scrollTop:Q.x*F-m.container.scrollLeft);var V=0;S&&(V=m.getPageLayout(),V=f?V.y*m.pageFormat.height:V.x*m.pageFormat.width);var P;switch(G.unit){case mxConstants.POINTS:var u=P=10;var x=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:P=10;u=mxConstants.PIXELS_PER_MM;x=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.METERS:P=20;u=mxConstants.PIXELS_PER_MM;x=[5,3,3,3,3,6,3,3,3,3,10,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:P=.5>=F||4<=F?8:16,u=mxConstants.PIXELS_PER_INCH/P,x=[5,3,5,3,7,3,5,3,7,3,5,3,7,3,5,3]}var J=u;2<=F?J=u/(2*Math.floor(F/2)):.5>=F&&(J=u*Math.floor(1/F/2)*(G.unit==mxConstants.MILLIMETERS?2:1));u=null;C=S?Math.min(Q+(f?C.height:C.width),f?-g.height:g.width):f?g.height:g.width;if(S)if(k.fillStyle=B.outBkgClr,f){var H=Q-E;0<H&&k.fillRect(0,E,E,H);C<g.height&&k.fillRect(0,C,E,g.height)}else H=Q-E,0<H&&k.fillRect(E,0,H,E),C<g.width&&k.fillRect(C,0,g.width,E);k.fillStyle=B.fontClr;for(S=S?Q:Q%(J*F);S<=C;S+=J*F)if(H=Math.round((S-Q)/F/J),!(S<E||H==u)){u=H;var K=null;0==H%P&&(K=G.formatText(V+H*J)+"");f?t(E-x[Math.abs(H)%P],S,E,S,K):t(S,E-x[Math.abs(H)%P],S,E,K)}k.lineWidth=1;t(f?0:E,f?E:0,E,E);k.fillStyle=B.cornerClr;k.fillRect(0,0,E,E)},-A=-1,I=function(){null!=q?(null!=v&&v(A),A=q(y)):y()};this.drawRuler=I;this.sizeListener=e=p(function(){var F=m.container;f?(F=F.offsetHeight+E,g.height!=F&&(g.height=F,d.style.height=F+"px",I())):(F=F.offsetWidth+E,g.width!=F&&(g.width=F,d.style.width=F+"px",I()))},10);this.pageListener=function(){I()};this.scrollListener=c=p(function(){var F=f?m.container.scrollTop:m.container.scrollLeft;G.lastScroll!=F&&(G.lastScroll=F,I())},10);this.unitListener=function(F,C){G.setUnit(C.getProperty("unit"))};+g.height:g.width):f?g.height:g.width;if(S)if(k.fillStyle=B.outBkgClr,f){var H=Q-D;0<H&&k.fillRect(0,D,D,H);C<g.height&&k.fillRect(0,C,D,g.height)}else H=Q-D,0<H&&k.fillRect(D,0,H,D),C<g.width&&k.fillRect(C,0,g.width,D);k.fillStyle=B.fontClr;for(S=S?Q:Q%(J*F);S<=C;S+=J*F)if(H=Math.round((S-Q)/F/J),!(S<D||H==u)){u=H;var K=null;0==H%P&&(K=G.formatText(V+H*J)+"");f?t(D-x[Math.abs(H)%P],S,D,S,K):t(S,D-x[Math.abs(H)%P],S,D,K)}k.lineWidth=1;t(f?0:D,f?D:0,D,D);k.fillStyle=B.cornerClr;k.fillRect(0,0,D,D)},+z=-1,I=function(){null!=q?(null!=v&&v(z),z=q(y)):y()};this.drawRuler=I;this.sizeListener=e=p(function(){var F=m.container;f?(F=F.offsetHeight+D,g.height!=F&&(g.height=F,d.style.height=F+"px",I())):(F=F.offsetWidth+D,g.width!=F&&(g.width=F,d.style.width=F+"px",I()))},10);this.pageListener=function(){I()};this.scrollListener=c=p(function(){var F=f?m.container.scrollTop:m.container.scrollLeft;G.lastScroll!=F&&(G.lastScroll=F,I())},10);this.unitListener=function(F,C){G.setUnit(C.getProperty("unit"))};m.addListener(mxEvent.SIZE,e);m.container.addEventListener("scroll",c);m.view.addListener("unitChanged",this.unitListener);b.addListener("pageViewChanged",this.pageListener);b.addListener("pageScaleChanged",this.pageListener);b.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(F){B=F;d.style.background=B.bkgClr;y()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(F,C,Q,S){if(f&&4<F.height||!f&&4<F.width){if(null!=G.guidePart)try{k.putImageData(G.guidePart.imgData1,-G.guidePart.x1,G.guidePart.y1),k.putImageData(G.guidePart.imgData2,G.guidePart.x2,G.guidePart.y2),k.putImageData(G.guidePart.imgData3,G.guidePart.x3,G.guidePart.y3)}catch(z){}var V=G.origGuideMove.apply(this,arguments);try{k.lineWidth=.5;k.strokeStyle=B.guideClr;k.setLineDash([2]);if(f){var P=F.y+V.y+E-this.graph.container.scrollTop;var u=0;var x=P+F.height/2;var J=E/2;var H=P+F.height;var K=0;var O=k.getImageData(u,P-1,E,3);t(u,P,E,P);P--;var M=k.getImageData(J,x-1,E,3);t(J,x,E,x);x--;var n=k.getImageData(K,-H-1,E,3);t(K,H,E,H);H--}else P=0,u=F.x+V.x+E-this.graph.container.scrollLeft,x=E/2,J=u+F.width/2,H=0,K=u+F.width,O=k.getImageData(u-1,P,3,E),t(u,P,u,E),u--,M=k.getImageData(J-1,x,3,E),t(J,x,J,E),J--,n=k.getImageData(K-1,H,3,E),t(K,H,K,E),K--;if(null==G.guidePart||G.guidePart.x1!=u||G.guidePart.y1!=P)G.guidePart={imgData1:O,x1:u,y1:P,imgData2:M,x2:J,y2:x,imgData3:n,x3:K,y3:H}}catch(z){}}else V=G.origGuideMove.apply(this,arguments);return V};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=+G.guidePart.x1,G.guidePart.y1),k.putImageData(G.guidePart.imgData2,G.guidePart.x2,G.guidePart.y2),k.putImageData(G.guidePart.imgData3,G.guidePart.x3,G.guidePart.y3)}catch(A){}var V=G.origGuideMove.apply(this,arguments);try{k.lineWidth=.5;k.strokeStyle=B.guideClr;k.setLineDash([2]);if(f){var P=F.y+V.y+D-this.graph.container.scrollTop;var u=0;var x=P+F.height/2;var J=D/2;var H=P+F.height;var K=0;var N=k.getImageData(u,P-1,D,3);t(u,P,D,P);P--;var M=k.getImageData(J,x-1,D,3);t(J,x,D,x);x--;var n=k.getImageData(K,+H-1,D,3);t(K,H,D,H);H--}else P=0,u=F.x+V.x+D-this.graph.container.scrollLeft,x=D/2,J=u+F.width/2,H=0,K=u+F.width,N=k.getImageData(u-1,P,3,D),t(u,P,u,D),u--,M=k.getImageData(J-1,x,3,D),t(J,x,J,D),J--,n=k.getImageData(K-1,H,3,D),t(K,H,K,D),K--;if(null==G.guidePart||G.guidePart.x1!=u||G.guidePart.y1!=P)G.guidePart={imgData1:N,x1:u,y1:P,imgData2:M,x2:J,y2:x,imgData3:n,x3:K,y3:H}}catch(A){}}else V=G.origGuideMove.apply(this,arguments);return V};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){var F=G.origGuideDestroy.apply(this,arguments);if(null!=G.guidePart)try{k.putImageData(G.guidePart.imgData1,G.guidePart.x1,G.guidePart.y1),k.putImageData(G.guidePart.imgData2,G.guidePart.x2,G.guidePart.y2),k.putImageData(G.guidePart.imgData3,G.guidePart.x3,G.guidePart.y3),G.guidePart=null}catch(C){}return F}}mxRuler.prototype.RULER_THICKNESS=14;mxRuler.prototype.unit=mxConstants.POINTS;mxRuler.prototype.setUnit=function(b){this.unit=b;this.drawRuler()};mxRuler.prototype.formatText=function(b){switch(this.unit){case mxConstants.POINTS:return Math.round(b);case mxConstants.MILLIMETERS:return(b/mxConstants.PIXELS_PER_MM).toFixed(1);case mxConstants.METERS:return(b/(1E3*mxConstants.PIXELS_PER_MM)).toFixed(4);case mxConstants.INCHES:return(b/mxConstants.PIXELS_PER_INCH).toFixed(2)}};mxRuler.prototype.destroy=function(){this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.graph.removeListener(this.sizeListener);this.graph.container.removeEventListener("scroll",this.scrollListener);this.graph.view.removeListener(this.unitListener);this.ui.removeListener(this.pageListener);null!=this.container&&this.container.parentNode.removeChild(this.container)};function mxDualRuler(b,e){var f=new mxPoint(mxRuler.prototype.RULER_THICKNESS,mxRuler.prototype.RULER_THICKNESS);this.editorUiGetDiagContOffset=b.getDiagramContainerOffset;b.getDiagramContainerOffset=function(){return f};this.editorUiRefresh=b.refresh;this.ui=b;this.origGuideMove=mxGuide.prototype.move;this.origGuideDestroy=mxGuide.prototype.destroy;this.vRuler=new mxRuler(b,e,!0);this.hRuler=new mxRuler(b,e,!1,!0);e=mxUtils.bind(this,function(c){var l=!1;mxEvent.addGestureListeners(c,mxUtils.bind(this,function(p){l=null!=b.currentMenu;mxEvent.consume(p)}),null,mxUtils.bind(this,function(p){if(b.editor.graph.isEnabled()&&!b.editor.graph.isMouseDown&&(mxEvent.isTouchEvent(p)||mxEvent.isPopupTrigger(p))){b.editor.graph.popupMenuHandler.hideMenu();b.hideCurrentMenu();if(!mxEvent.isTouchEvent(p)||!l){var q=new mxPopupMenu(mxUtils.bind(this,function(G,B){b.menus.addMenuItems(G,["points","inches","millimeters","meters"],B)}));q.smartSeparators=!0;q.showDisabled=!0;q.autoExpand=!0;q.hideMenu=mxUtils.bind(this,-function(){mxPopupMenu.prototype.hideMenu.apply(q,arguments);b.resetCurrentMenu();q.destroy()});var v=mxEvent.getClientX(p),E=mxEvent.getClientY(p);q.popup(v,E,null,p);b.setCurrentMenu(q,c)}mxEvent.consume(p)}}))});e(this.hRuler.container);e(this.vRuler.container);this.vRuler.drawRuler();this.hRuler.drawRuler()}mxDualRuler.prototype.updateStyle=function(){this.vRuler.updateStyle();this.hRuler.updateStyle();this.vRuler.drawRuler();this.hRuler.drawRuler()};-mxDualRuler.prototype.setUnit=function(b){this.vRuler.setUnit(b);this.hRuler.setUnit(b)};mxDualRuler.prototype.setStyle=function(b){this.vRuler.setStyle(b);this.hRuler.setStyle(b)};mxDualRuler.prototype.destroy=function(){this.vRuler.destroy();this.hRuler.destroy();this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.ui.getDiagramContainerOffset=this.editorUiGetDiagContOffset};function mxFreehand(b){var e=null!=b.view&&null!=b.view.canvas?b.view.canvas.ownerSVGElement:null;if(null!=b.container&&null!=e){b.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){this.stopDrawing()}));var f=mxFreehand.prototype.MILD_SMOOTHING,c=null,l=[],p,q=[],v,E=!1,G=!0,B=!0,d=!0,g=!0,k=[],m=!1,t=!1,y=!1,A="default",I={size:5,thinning:.5,smoothing:.5,streamline:.5,start:{taper:0,cap:!0},end:{taper:0,cap:!0}},F=!0;this.setClosedPath=function(x){E=x};this.setAutoClose=function(x){G=x};this.setAutoInsert=+function(){mxPopupMenu.prototype.hideMenu.apply(q,arguments);b.resetCurrentMenu();q.destroy()});var v=mxEvent.getClientX(p),D=mxEvent.getClientY(p);q.popup(v,D,null,p);b.setCurrentMenu(q,c)}mxEvent.consume(p)}}))});e(this.hRuler.container);e(this.vRuler.container);this.vRuler.drawRuler();this.hRuler.drawRuler()}mxDualRuler.prototype.updateStyle=function(){this.vRuler.updateStyle();this.hRuler.updateStyle();this.vRuler.drawRuler();this.hRuler.drawRuler()};+mxDualRuler.prototype.setUnit=function(b){this.vRuler.setUnit(b);this.hRuler.setUnit(b)};mxDualRuler.prototype.setStyle=function(b){this.vRuler.setStyle(b);this.hRuler.setStyle(b)};mxDualRuler.prototype.destroy=function(){this.vRuler.destroy();this.hRuler.destroy();this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.ui.getDiagramContainerOffset=this.editorUiGetDiagContOffset};function mxFreehand(b){var e=null!=b.view&&null!=b.view.canvas?b.view.canvas.ownerSVGElement:null;if(null!=b.container&&null!=e){b.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){this.stopDrawing()}));var f=mxFreehand.prototype.MILD_SMOOTHING,c=null,l=[],p,q=[],v,D=!1,G=!0,B=!0,d=!0,g=!0,k=[],m=!1,t=!1,y=!1,z="default",I={size:5,thinning:.5,smoothing:.5,streamline:.5,start:{taper:0,cap:!0},end:{taper:0,cap:!0}},F=!0;this.setClosedPath=function(x){D=x};this.setAutoClose=function(x){G=x};this.setAutoInsert=function(x){B=x};this.setAutoScroll=function(x){d=x};this.setOpenFill=function(x){g=x};this.setStopClickEnabled=function(x){t=x};this.setSelectInserted=function(x){y=x};this.setSmoothing=function(x){f=x};this.getSmoothing=function(){return f};this.setPerfectFreehandMode=function(x){F=x};this.isPerfectFreehandMode=function(){return F};this.setBrushSize=function(x){I.size=x};this.getBrushSize=function(){return I.size};var C=function(x){m=x;b.getRubberband().setEnabled(!x);b.graphHandler.setSelectEnabled(!x);b.graphHandler.setMoveEnabled(!x);b.container.style.cursor=x?"crosshair":"";b.fireEvent(new mxEventObject("freehandStateChanged"))};this.startDrawing=function(){C(!0)};this.isDrawing=function(){return m};var Q=mxUtils.bind(this,function(x){if(c){var J=v.length,H=t&&0<q.length&&null!=v&&2>v.length;H||q.push.apply(q,v);v=[];q.push(null);l.push(c);c=null;(H||B)&&this.stopDrawing();B&&(!H||2<=J)&&this.startDrawing();mxEvent.consume(x)}}),S=new mxCell;S.edge=!0;this.getStrokeColor=function(x){var J=null!=-A?A:mxUtils.getValue(b.currentVertexStyle,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(b.getCurrentCellStyle(S),mxConstants.STYLE_STROKECOLOR,"#000"));"default"!=J||x||(J=b.shapeForegroundColor);return J};this.setStrokeColor=function(x){A=x};this.createStyle=function(x){var J=";fillColor=none;";F&&(J=";lineShape=1;");J+="strokeColor="+this.getStrokeColor(!0)+";";return mxConstants.STYLE_SHAPE+"="+x+J};this.stopDrawing=function(){if(0<l.length){if(F){for(var x=[],J=0;J<q.length;J++)null!=q[J]&&x.push([q[J].x,-q[J].y]);x=PerfectFreehand.getStroke(x,I);q=[];for(J=0;J<x.length;J++)q.push({x:x[J][0],y:x[J][1]});q.push(null)}x=q[0].x;var H=q[0].x,K=q[0].y,O=q[0].y;for(J=1;J<q.length;J++)null!=q[J]&&(x=Math.max(x,q[J].x),H=Math.min(H,q[J].x),K=Math.max(K,q[J].y),O=Math.min(O,q[J].y));x-=H;K-=O;if(0<x&&0<K){var M=100/x,n=100/K;q.map(function(R){if(null==R)return R;R.x=(R.x-H)*M;R.y=(R.y-O)*n;return R});var z='<shape strokewidth="inherit"><foreground>',D=0;for(J=0;J<q.length;J++){var L=q[J];if(null==L){L=!1;D=-q[D];var N=q[J-1];!E&&G&&(L=D.x-N.x,N=D.y-N.y,L=Math.sqrt(L*L+N*N)<=b.tolerance);if(E||L)z+='<line x="'+D.x.toFixed(2)+'" y="'+D.y.toFixed(2)+'"/>';z+="</path>"+(g||E||L?"<fillstroke/>":"<stroke/>");D=J+1}else z=J==D?z+('<path><move x="'+L.x.toFixed(2)+'" y="'+L.y.toFixed(2)+'"/>'):z+('<line x="'+L.x.toFixed(2)+'" y="'+L.y.toFixed(2)+'"/>')}z+="</foreground></shape>";if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){J=this.createStyle("stencil("+Graph.compress(z)+")");z=b.view.scale;D=b.view.translate;-J=new mxCell("",new mxGeometry(H/z-D.x,O/z-D.y,x/z,K/z),J);J.vertex=1;b.model.beginUpdate();try{J=b.addCell(J),b.fireEvent(new mxEventObject("cellsInserted","cells",[J])),b.fireEvent(new mxEventObject("freehandInserted","cell",J))}finally{b.model.endUpdate()}y&&b.setSelectionCells([J])}}for(J=0;J<l.length;J++)l[J].parentNode.removeChild(l[J]);c=null;l=[];q=[]}C(!1)};b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(x,J){x=J.getProperty("eventName");J=J.getProperty("event");x==mxEvent.MOUSE_MOVE&&+z?z:mxUtils.getValue(b.currentVertexStyle,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(b.getCurrentCellStyle(S),mxConstants.STYLE_STROKECOLOR,"#000"));"default"!=J||x||(J=b.shapeForegroundColor);return J};this.setStrokeColor=function(x){z=x};this.createStyle=function(x){var J=";fillColor=none;";F&&(J=";lineShape=1;");J+="strokeColor="+this.getStrokeColor(!0)+";";return mxConstants.STYLE_SHAPE+"="+x+J};this.stopDrawing=function(){if(0<l.length){if(F){for(var x=[],J=0;J<q.length;J++)null!=q[J]&&x.push([q[J].x,+q[J].y]);x=PerfectFreehand.getStroke(x,I);q=[];for(J=0;J<x.length;J++)q.push({x:x[J][0],y:x[J][1]});q.push(null)}x=q[0].x;var H=q[0].x,K=q[0].y,N=q[0].y;for(J=1;J<q.length;J++)null!=q[J]&&(x=Math.max(x,q[J].x),H=Math.min(H,q[J].x),K=Math.max(K,q[J].y),N=Math.min(N,q[J].y));x-=H;K-=N;if(0<x&&0<K){var M=100/x,n=100/K;q.map(function(R){if(null==R)return R;R.x=(R.x-H)*M;R.y=(R.y-N)*n;return R});var A='<shape strokewidth="inherit"><foreground>',E=0;for(J=0;J<q.length;J++){var L=q[J];if(null==L){L=!1;E=+q[E];var O=q[J-1];!D&&G&&(L=E.x-O.x,O=E.y-O.y,L=Math.sqrt(L*L+O*O)<=b.tolerance);if(D||L)A+='<line x="'+E.x.toFixed(2)+'" y="'+E.y.toFixed(2)+'"/>';A+="</path>"+(g||D||L?"<fillstroke/>":"<stroke/>");E=J+1}else A=J==E?A+('<path><move x="'+L.x.toFixed(2)+'" y="'+L.y.toFixed(2)+'"/>'):A+('<line x="'+L.x.toFixed(2)+'" y="'+L.y.toFixed(2)+'"/>')}A+="</foreground></shape>";if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){J=this.createStyle("stencil("+Graph.compress(A)+")");A=b.view.scale;E=b.view.translate;+J=new mxCell("",new mxGeometry(H/A-E.x,N/A-E.y,x/A,K/A),J);J.vertex=1;b.model.beginUpdate();try{J=b.addCell(J),b.fireEvent(new mxEventObject("cellsInserted","cells",[J])),b.fireEvent(new mxEventObject("freehandInserted","cell",J))}finally{b.model.endUpdate()}y&&b.setSelectionCells([J])}}for(J=0;J<l.length;J++)l[J].parentNode.removeChild(l[J]);c=null;l=[];q=[]}C(!1)};b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(x,J){x=J.getProperty("eventName");J=J.getProperty("event");x==mxEvent.MOUSE_MOVE&&m&&(null!=J.sourceState&&J.sourceState.setCursor("crosshair"),J.consume())}));b.addMouseListener({mouseDown:mxUtils.bind(this,function(x,J){if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(x=J.getEvent(),m&&!mxEvent.isPopupTrigger(x)&&!mxEvent.isMiddleMouseButton(x)&&!mxEvent.isMultiTouchEvent(x))){var H=parseFloat(b.currentVertexStyle[mxConstants.STYLE_STROKEWIDTH]||1);H=Math.max(1,H*b.view.scale);var K=this.getStrokeColor();c=document.createElementNS("http://www.w3.org/2000/svg","path");-c.setAttribute("fill",F?K:"none");c.setAttribute("pointer-events","none");c.setAttribute("stroke",K);c.setAttribute("stroke-width",H);"1"==b.currentVertexStyle[mxConstants.STYLE_DASHED]&&(K=b.currentVertexStyle[mxConstants.STYLE_DASH_PATTERN]||"3 3",K=K.split(" ").map(function(O){return parseFloat(O)*H}).join(" "),c.setAttribute("stroke-dasharray",K));k=[];x=V(x);P(x);p="M"+x.x+" "+x.y;q.push(x);v=[];c.setAttribute("d",F?PerfectFreehand.getSvgPathFromStroke([[x.x,x.y]],I):p);e.appendChild(c);J.consume()}}),-mouseMove:mxUtils.bind(this,function(x,J){if(null!=c&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){x=J.getEvent();x=V(x);P(x);var H=u(0);if(H)if(q.push(H),F){var K=[];for(H=0;H<q.length;H++)K.push([q[H].x,q[H].y]);v=[];for(var O=2;O<k.length;O+=2)H=u(O),K.push([H.x,H.y]),v.push(H);c.setAttribute("d",PerfectFreehand.getSvgPathFromStroke(K,I))}else{p+=" L"+H.x+" "+H.y;K="";v=[];for(O=2;O<k.length;O+=2)H=u(O),K+=" L"+H.x+" "+H.y,v.push(H);c.setAttribute("d",p+K)}d&&(H=b.view.translate,b.scrollRectToVisible((new mxRectangle(x.x--H.x,x.y-H.y)).grow(20)));J.consume()}}),mouseUp:mxUtils.bind(this,function(x,J){null!=c&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(Q(J.getEvent()),J.consume())})});var V=function(x){return mxUtils.convertPoint(b.container,mxEvent.getClientX(x),mxEvent.getClientY(x))},P=function(x){for(k.push(x);k.length>f;)k.shift()},u=function(x){var J=k.length;if(1===J%2||J>=f){var H=0,K=0,O,M=0;for(O=x;O<J;O++)M++,x=k[O],H+=x.x,K+=x.y;return{x:H/M,y:K/M}}return null}}}-mxFreehand.prototype.NO_SMOOTHING=1;mxFreehand.prototype.MILD_SMOOTHING=4;mxFreehand.prototype.NORMAL_SMOOTHING=8;mxFreehand.prototype.VERY_SMOOTH_SMOOTHING=12;mxFreehand.prototype.SUPER_SMOOTH_SMOOTHING=16;mxFreehand.prototype.HYPER_SMOOTH_SMOOTHING=20;function P2PCollab(b,e,f){function c(D,L){try{if(!u){var N=e.file.getCurrentUser();if(P&&null!=N&&null!=N.displayName){var R={from:C,id:t,type:D,sessionId:e.clientId,userId:N.id,username:N.displayName,data:L,protocol:DrawioFileSync.PROTOCOL,editor:EditorUi.VERSION};R={bytes:e.objectToString(R),data:"aes"};R=JSON.stringify(R);x&&"cursor"!=D&&EditorUi.debug("P2PCollab: sending to socket server",[R]);t++;N=!x&&("cursor"==D||"selectionChange"==D);V&&!N&&O("message",R);if(N)for(p2pId in S)S[p2pId].send(R)}}}catch(T){null!=-window.console&&console.error(T,D,L)}}function l(D){if(b.shareCursorPosition&&!B.isMouseDown){var L=mxUtils.getOffset(B.container),N=B.view.translate,R=B.view.scale,T=null!=b.currentPage?b.currentPage.getId():null;c("cursor",{pageId:T,x:Math.round((D.getX()-L.x+B.container.scrollLeft)/R-N.x),y:Math.round((D.getY()-L.y+B.container.scrollTop)/R-N.y)})}}function p(D,L){var N=null!=b.currentPage?b.currentPage.getId():null;if(null!=D&&null!=D.cursor&&null!=D.lastCursor)if(null!=D.lastCursor.hide||!b.isShowRemoteCursors()||-null!=D.lastCursor.pageId&&D.lastCursor.pageId!=N)D.cursor.style.display="none";else{N=function(){var Y=Math.max(B.container.scrollLeft,Math.min(B.container.scrollLeft+B.container.clientWidth-D.cursor.clientWidth,U)),Z=Math.max(B.container.scrollTop-22,Math.min(B.container.scrollTop+B.container.clientHeight-D.cursor.clientHeight,W));X.style.opacity=Y!=U||Z!=W?0:1;D.cursor.style.left=Y+"px";D.cursor.style.top=Z+"px";D.cursor.style.display=""};var R=B.view.translate,T=B.view.scale,U=(R.x+D.lastCursor.x)*-T+8,W=(R.y+D.lastCursor.y)*T-12,X=D.cursor.getElementsByTagName("img")[0];L?(mxUtils.setPrefixedStyle(D.cursor.style,"transition","all 900ms ease-out"),mxUtils.setPrefixedStyle(X.style,"transition","all 900ms ease-out"),window.setTimeout(N,0)):(mxUtils.setPrefixedStyle(D.cursor.style,"transition",null),mxUtils.setPrefixedStyle(X.style,"transition",null),N())}}function q(D,L){try{var N=function(){if(null==m[T]){var ja=F[T];null==ja&&(ja=d%k.length,F[T]=ja,d++);var ba=k[ja];ja=11<ja?"black":"white";-m[T]={cursor:document.createElement("div"),color:ba,selection:{}};A[L]=T;U=m[T].cursor;U.style.pointerEvents="none";U.style.position="absolute";U.style.display="none";U.style.opacity="0.9";var fa=document.createElement("img");mxUtils.setPrefixedStyle(fa.style,"transform","rotate(-45deg)translateX(-14px)");fa.setAttribute("src",Graph.createSvgImage(8,12,'<path d="M 4 0 L 8 12 L 4 10 L 0 12 Z" stroke="'+ba+'" fill="'+ba+'"/>').src);fa.style.width="10px";U.appendChild(fa);fa=document.createElement("div");-fa.style.backgroundColor=ba;fa.style.color=ja;fa.style.fontSize="9pt";fa.style.padding="3px 7px";fa.style.marginTop="8px";fa.style.borderRadius="10px";fa.style.maxWidth="100px";fa.style.overflow="hidden";fa.style.textOverflow="ellipsis";fa.style.whiteSpace="nowrap";mxUtils.write(fa,R);U.appendChild(fa);b.diagramContainer.appendChild(U)}else U=m[T].cursor;W=m[T].selection};if(!u){D=JSON.parse(D);null!=D.bytes&&(D=e.stringToObject(D.bytes));x&&"cursor"!=D.type&&EditorUi.debug("P2PCollab: msg received",-[D]);if(null!=L){if(D.from==C||y[D.from]>=D.id){EditorUi.debug("P2PCollab: Dropped Message",D,C,y[D.from]);return}y[D.from]=D.id}var R=D.username?D.username:"Anonymous",T=D.sessionId,U,W;null!=m[T]&&(clearTimeout(m[T].inactiveTO),m[T].inactiveTO=setTimeout(function(){E(null,T)},12E4));var X=D.data;switch(D.type){case "cursor":N();m[T].lastCursor=X;p(m[T],!0);break;case "diff":try{D=null!=X.patch?e.stringToObject(decodeURIComponent(X.patch)):X.diff,e.receiveRemoteChanges(D.d)}catch(ja){EditorUi.debug("P2PCollab: Diff msg error",-ja)}break;case "selectionChange":if("0"!=urlParams["remote-selection"]){var Y=null!=b.currentPage?b.currentPage.getId():null;if(null==Y||null!=X.pageId&&X.pageId==Y){N();for(N=0;N<X.removed.length;N++){var Z=X.removed[N];if(null!=Z){var ca=W[Z];delete W[Z];null!=ca&&ca.destroy()}}for(N=0;N<X.added.length;N++)if(Z=X.added[N],null!=Z){var ea=B.model.getCell(Z);null!=ea&&(W[Z]=B.highlightCell(ea,m[T].color,6E4,70,3))}}}break;case "notify":D=null!=X.data?e.stringToObject(decodeURIComponent(X.data)):X.msg,-e.handleMessageData(D.d)}e.file.fireEvent(new mxEventObject("realtimeMessage","message",D))}}catch(ja){null!=window.console&&console.warn(ja,D,L)}}function v(D,L){if(!x&&SimplePeer.WEBRTC_SUPPORT){var N=new SimplePeer({initiator:L,config:{iceServers:[{urls:"stun:54.89.235.160:3478"}]}});N.on("signal",function(R){O("sendSignal",{to:D,from:C,signal:R})});N.on("error",function(R){delete Q[D];EditorUi.debug("P2PCollab: p2p socket error",R);!u&&L&&N.destroyed&&I[D]&&(EditorUi.debug("P2PCollab: p2p socket reconnecting",-D),v(D,!0))});N.on("connect",function(){delete Q[D];null==S[D]||S[D].destroyed?(S[D]=N,I[D]=!0,EditorUi.debug("P2PCollab: p2p socket connected",D)):(N.noP2PMapDel=!0,N.destroy(),EditorUi.debug("P2PCollab: p2p socket duplicate",D))});N.on("close",function(){N.noP2PMapDel||(EditorUi.debug("P2PCollab: p2p socket closed",D),G(A[D]),delete S[D])});N.on("data",q);return Q[D]=N}}function E(D,L){G(L||A[D]);null!=D&&(delete A[D],I[D]=!1)}function G(D){var L=m[D];if(null!=L){var N=L.selection,R;for(R in N)null!=-N[R]&&N[R].destroy();null!=L.cursor&&null!=L.cursor.parentNode&&L.cursor.parentNode.removeChild(L.cursor);clearTimeout(L.inactiveTO);delete m[D]}}var B=b.editor.graph,d=0,g=null,k="#e6194b #3cb44b #4363d8 #f58231 #911eb4 #f032e6 #469990 #9A6324 #800000 #808000 #000075 #a9a9a9 #ffe119 #42d4f4 #bfef45 #fabed4 #dcbeff #fffac8 #aaffc3 #ffd8b1".split(" "),m={},t=1,y={},A={},I={},F={},C,Q={},S={},V=!0,P=!1,u=!1,x="0"!=urlParams["no-p2p"],J=!1,H=0,K=null,O=mxUtils.bind(this,function(D,L){if(!u)try{null!=-g?(g.send(JSON.stringify({action:D,msg:L})),x||EditorUi.debug("P2PCollab: sending to socket server",[D],[L])):this.joinFile(!0)}catch(N){K=N,e.file.fireEvent(new mxEventObject("realtimeStateChanged")),EditorUi.debug("P2PCollab:","sendReply error",arguments,N)}});this.sendMessage=c;this.sendDiff=function(D){this.sendMessage("diff",{diff:D})};this.sendNotification=function(D){this.sendMessage("notify",{msg:D})};this.getState=function(){return null!=g?g.readyState:3};this.getLastError=function(){return K};-this.mouseListeners={startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(D,L){},mouseMove:function(D,L){var N,R=-1;return function(){clearTimeout(N);var T=this,U=arguments,W=function(){N=null;R=Date.now();D.apply(T,U)};Date.now()-R>L?W():N=setTimeout(W,L)}}(function(D,L){l(L)},300),mouseUp:function(D,L){l(L)}};B.addMouseListener(this.mouseListeners);this.shareCursorPositionListener=function(){b.isShareCursorPosition()||c("cursor",{hide:!0})};b.addListener("shareCursorPositionChanged",this.shareCursorPositionListener);-var M=mxGraphHandler.prototype.maxCells,n=null,z={};this.selectionChangeListener=function(D,L){var N=function(R){return null!=R?R.id:null};null!=n&&window.clearTimeout(n);n=window.setTimeout(function(){for(var R=B.getSelectionCount()>M?[]:B.getSelectionCells().map(N),T=null!=b.currentPage?b.currentPage.getId():null,U={},W=[],X=[],Y=0;Y<R.length;Y++){var Z=R[Y];null!=Z&&(U[Z]=!0,null==z[Z]&&X.push(Z))}for(Z in z)U[Z]||W.push(Z);z=U;c("selectionChange",{pageId:T,removed:W,added:X})},300)};B.getSelectionModel().addListener(mxEvent.CHANGE,-this.selectionChangeListener);this.cursorHandler=mxUtils.bind(this,function(){for(var D in m)p(m[D])});mxEvent.addListener(B.container,"scroll",this.cursorHandler);B.getView().addListener(mxEvent.SCALE,this.cursorHandler);B.getView().addListener(mxEvent.TRANSLATE,this.cursorHandler);B.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.cursorHandler);b.addListener("showRemoteCursorsChanged",this.cursorHandler);b.editor.addListener("pageSelected",this.cursorHandler);this.joinFile=function(D){if(!u)try{J&&+c.setAttribute("fill",F?K:"none");c.setAttribute("pointer-events","none");c.setAttribute("stroke",K);c.setAttribute("stroke-width",H);"1"==b.currentVertexStyle[mxConstants.STYLE_DASHED]&&(K=b.currentVertexStyle[mxConstants.STYLE_DASH_PATTERN]||"3 3",K=K.split(" ").map(function(N){return parseFloat(N)*H}).join(" "),c.setAttribute("stroke-dasharray",K));k=[];x=V(x);P(x);p="M"+x.x+" "+x.y;q.push(x);v=[];c.setAttribute("d",F?PerfectFreehand.getSvgPathFromStroke([[x.x,x.y]],I):p);e.appendChild(c);J.consume()}}),+mouseMove:mxUtils.bind(this,function(x,J){if(null!=c&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){x=J.getEvent();x=V(x);P(x);var H=u(0);if(H)if(q.push(H),F){var K=[];for(H=0;H<q.length;H++)K.push([q[H].x,q[H].y]);v=[];for(var N=2;N<k.length;N+=2)H=u(N),K.push([H.x,H.y]),v.push(H);c.setAttribute("d",PerfectFreehand.getSvgPathFromStroke(K,I))}else{p+=" L"+H.x+" "+H.y;K="";v=[];for(N=2;N<k.length;N+=2)H=u(N),K+=" L"+H.x+" "+H.y,v.push(H);c.setAttribute("d",p+K)}d&&(H=b.view.translate,b.scrollRectToVisible((new mxRectangle(x.x-+H.x,x.y-H.y)).grow(20)));J.consume()}}),mouseUp:mxUtils.bind(this,function(x,J){null!=c&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(Q(J.getEvent()),J.consume())})});var V=function(x){return mxUtils.convertPoint(b.container,mxEvent.getClientX(x),mxEvent.getClientY(x))},P=function(x){for(k.push(x);k.length>f;)k.shift()},u=function(x){var J=k.length;if(1===J%2||J>=f){var H=0,K=0,N,M=0;for(N=x;N<J;N++)M++,x=k[N],H+=x.x,K+=x.y;return{x:H/M,y:K/M}}return null}}}+mxFreehand.prototype.NO_SMOOTHING=1;mxFreehand.prototype.MILD_SMOOTHING=4;mxFreehand.prototype.NORMAL_SMOOTHING=8;mxFreehand.prototype.VERY_SMOOTH_SMOOTHING=12;mxFreehand.prototype.SUPER_SMOOTH_SMOOTHING=16;mxFreehand.prototype.HYPER_SMOOTH_SMOOTHING=20;function P2PCollab(b,e,f){function c(E,L){try{if(!u){var O=e.file.getCurrentUser();if(P&&null!=O&&null!=O.displayName){var R={from:C,id:t,type:E,sessionId:e.clientId,userId:O.id,username:O.displayName,data:L,protocol:DrawioFileSync.PROTOCOL,editor:EditorUi.VERSION};R={bytes:e.objectToString(R),data:"aes"};R=JSON.stringify(R);x&&"cursor"!=E&&EditorUi.debug("P2PCollab: sending to socket server",[R]);t++;O=!x&&("cursor"==E||"selectionChange"==E);V&&!O&&N("message",R);if(O)for(p2pId in S)S[p2pId].send(R)}}}catch(T){null!=+window.console&&console.error(T,E,L)}}function l(E){if(b.shareCursorPosition&&!B.isMouseDown){var L=mxUtils.getOffset(B.container),O=B.view.translate,R=B.view.scale,T=null!=b.currentPage?b.currentPage.getId():null;c("cursor",{pageId:T,x:Math.round((E.getX()-L.x+B.container.scrollLeft)/R-O.x),y:Math.round((E.getY()-L.y+B.container.scrollTop)/R-O.y)})}}function p(E,L){var O=null!=b.currentPage?b.currentPage.getId():null;if(null!=E&&null!=E.cursor&&null!=E.lastCursor)if(null!=E.lastCursor.hide||!b.isShowRemoteCursors()||+null!=E.lastCursor.pageId&&E.lastCursor.pageId!=O)E.cursor.style.display="none";else{O=function(){var Y=Math.max(B.container.scrollLeft,Math.min(B.container.scrollLeft+B.container.clientWidth-E.cursor.clientWidth,U)),Z=Math.max(B.container.scrollTop-22,Math.min(B.container.scrollTop+B.container.clientHeight-E.cursor.clientHeight,W));X.style.opacity=Y!=U||Z!=W?0:1;E.cursor.style.left=Y+"px";E.cursor.style.top=Z+"px";E.cursor.style.display=""};var R=B.view.translate,T=B.view.scale,U=(R.x+E.lastCursor.x)*+T+8,W=(R.y+E.lastCursor.y)*T-12,X=E.cursor.getElementsByTagName("img")[0];L?(mxUtils.setPrefixedStyle(E.cursor.style,"transition","all 900ms ease-out"),mxUtils.setPrefixedStyle(X.style,"transition","all 900ms ease-out"),window.setTimeout(O,0)):(mxUtils.setPrefixedStyle(E.cursor.style,"transition",null),mxUtils.setPrefixedStyle(X.style,"transition",null),O())}}function q(E,L){try{var O=function(){if(null==m[T]){var ia=F[T];null==ia&&(ia=d%k.length,F[T]=ia,d++);var ba=k[ia];ia=11<ia?"black":"white";+m[T]={cursor:document.createElement("div"),color:ba,selection:{}};z[L]=T;U=m[T].cursor;U.style.pointerEvents="none";U.style.position="absolute";U.style.display="none";U.style.opacity="0.9";var fa=document.createElement("img");mxUtils.setPrefixedStyle(fa.style,"transform","rotate(-45deg)translateX(-14px)");fa.setAttribute("src",Graph.createSvgImage(8,12,'<path d="M 4 0 L 8 12 L 4 10 L 0 12 Z" stroke="'+ba+'" fill="'+ba+'"/>').src);fa.style.width="10px";U.appendChild(fa);fa=document.createElement("div");+fa.style.backgroundColor=ba;fa.style.color=ia;fa.style.fontSize="9pt";fa.style.padding="3px 7px";fa.style.marginTop="8px";fa.style.borderRadius="10px";fa.style.maxWidth="100px";fa.style.overflow="hidden";fa.style.textOverflow="ellipsis";fa.style.whiteSpace="nowrap";mxUtils.write(fa,R);U.appendChild(fa);b.diagramContainer.appendChild(U)}else U=m[T].cursor;W=m[T].selection};if(!u){E=JSON.parse(E);null!=E.bytes&&(E=e.stringToObject(E.bytes));x&&"cursor"!=E.type&&EditorUi.debug("P2PCollab: msg received",+[E]);if(null!=L){if(E.from==C||y[E.from]>=E.id){EditorUi.debug("P2PCollab: Dropped Message",E,C,y[E.from]);return}y[E.from]=E.id}var R=E.username?E.username:"Anonymous",T=E.sessionId,U,W;null!=m[T]&&(clearTimeout(m[T].inactiveTO),m[T].inactiveTO=setTimeout(function(){D(null,T)},12E4));var X=E.data;switch(E.type){case "cursor":O();m[T].lastCursor=X;p(m[T],!0);break;case "diff":try{E=null!=X.patch?e.stringToObject(decodeURIComponent(X.patch)):X.diff,e.receiveRemoteChanges(E.d)}catch(ia){EditorUi.debug("P2PCollab: Diff msg error",+ia)}break;case "selectionChange":if("0"!=urlParams["remote-selection"]){var Y=null!=b.currentPage?b.currentPage.getId():null;if(null==Y||null!=X.pageId&&X.pageId==Y){O();for(O=0;O<X.removed.length;O++){var Z=X.removed[O];if(null!=Z){var ca=W[Z];delete W[Z];null!=ca&&ca.destroy()}}for(O=0;O<X.added.length;O++)if(Z=X.added[O],null!=Z){var ea=B.model.getCell(Z);null!=ea&&(W[Z]=B.highlightCell(ea,m[T].color,6E4,70,3))}}}break;case "notify":E=null!=X.data?e.stringToObject(decodeURIComponent(X.data)):X.msg,+e.handleMessageData(E.d)}e.file.fireEvent(new mxEventObject("realtimeMessage","message",E))}}catch(ia){null!=window.console&&console.warn(ia,E,L)}}function v(E,L){if(!x&&SimplePeer.WEBRTC_SUPPORT){var O=new SimplePeer({initiator:L,config:{iceServers:[{urls:"stun:54.89.235.160:3478"}]}});O.on("signal",function(R){N("sendSignal",{to:E,from:C,signal:R})});O.on("error",function(R){delete Q[E];EditorUi.debug("P2PCollab: p2p socket error",R);!u&&L&&O.destroyed&&I[E]&&(EditorUi.debug("P2PCollab: p2p socket reconnecting",+E),v(E,!0))});O.on("connect",function(){delete Q[E];null==S[E]||S[E].destroyed?(S[E]=O,I[E]=!0,EditorUi.debug("P2PCollab: p2p socket connected",E)):(O.noP2PMapDel=!0,O.destroy(),EditorUi.debug("P2PCollab: p2p socket duplicate",E))});O.on("close",function(){O.noP2PMapDel||(EditorUi.debug("P2PCollab: p2p socket closed",E),G(z[E]),delete S[E])});O.on("data",q);return Q[E]=O}}function D(E,L){G(L||z[E]);null!=E&&(delete z[E],I[E]=!1)}function G(E){var L=m[E];if(null!=L){var O=L.selection,R;for(R in O)null!=+O[R]&&O[R].destroy();null!=L.cursor&&null!=L.cursor.parentNode&&L.cursor.parentNode.removeChild(L.cursor);clearTimeout(L.inactiveTO);delete m[E]}}var B=b.editor.graph,d=0,g=null,k="#e6194b #3cb44b #4363d8 #f58231 #911eb4 #f032e6 #469990 #9A6324 #800000 #808000 #000075 #a9a9a9 #ffe119 #42d4f4 #bfef45 #fabed4 #dcbeff #fffac8 #aaffc3 #ffd8b1".split(" "),m={},t=1,y={},z={},I={},F={},C,Q={},S={},V=!0,P=!1,u=!1,x="0"!=urlParams["no-p2p"],J=!1,H=0,K=null,N=mxUtils.bind(this,function(E,L){if(!u)try{null!=+g?(g.send(JSON.stringify({action:E,msg:L})),x||EditorUi.debug("P2PCollab: sending to socket server",[E],[L])):this.joinFile(!0)}catch(O){K=O,e.file.fireEvent(new mxEventObject("realtimeStateChanged")),EditorUi.debug("P2PCollab:","sendReply error",arguments,O)}});this.sendMessage=c;this.sendDiff=function(E){this.sendMessage("diff",{diff:E})};this.sendNotification=function(E){this.sendMessage("notify",{msg:E})};this.getState=function(){return null!=g?g.readyState:3};this.getLastError=function(){return K};+this.mouseListeners={startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(E,L){},mouseMove:function(E,L){var O,R=-1;return function(){clearTimeout(O);var T=this,U=arguments,W=function(){O=null;R=Date.now();E.apply(T,U)};Date.now()-R>L?W():O=setTimeout(W,L)}}(function(E,L){l(L)},300),mouseUp:function(E,L){l(L)}};B.addMouseListener(this.mouseListeners);this.shareCursorPositionListener=function(){b.isShareCursorPosition()||c("cursor",{hide:!0})};b.addListener("shareCursorPositionChanged",this.shareCursorPositionListener);+var M=mxGraphHandler.prototype.maxCells,n=null,A={};this.selectionChangeListener=function(E,L){var O=function(R){return null!=R?R.id:null};null!=n&&window.clearTimeout(n);n=window.setTimeout(function(){for(var R=B.getSelectionCount()>M?[]:B.getSelectionCells().map(O),T=null!=b.currentPage?b.currentPage.getId():null,U={},W=[],X=[],Y=0;Y<R.length;Y++){var Z=R[Y];null!=Z&&(U[Z]=!0,null==A[Z]&&X.push(Z))}for(Z in A)U[Z]||W.push(Z);A=U;c("selectionChange",{pageId:T,removed:W,added:X})},300)};B.getSelectionModel().addListener(mxEvent.CHANGE,+this.selectionChangeListener);this.cursorHandler=mxUtils.bind(this,function(){for(var E in m)p(m[E])});mxEvent.addListener(B.container,"scroll",this.cursorHandler);B.getView().addListener(mxEvent.SCALE,this.cursorHandler);B.getView().addListener(mxEvent.TRANSLATE,this.cursorHandler);B.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.cursorHandler);b.addListener("showRemoteCursorsChanged",this.cursorHandler);b.editor.addListener("pageSelected",this.cursorHandler);this.joinFile=function(E){if(!u)try{J&&(EditorUi.debug("P2PCollab: joinInProgress on",J),K="busy");J=++H;try{null!=g&&1==g.readyState&&(EditorUi.debug("P2PCollab: force closing socket on",g.joinId),g.close(1E3),g=null)}catch(R){EditorUi.debug("P2PCollab: closing socket error",R)}var L=new WebSocket(window.RT_WEBSOCKET_URL+"?id="+f);null==g&&(g=L);L.addEventListener("open",function(R){g=L;g.joinId=J;J=!1;e.file.fireEvent(new mxEventObject("realtimeStateChanged"));EditorUi.debug("P2PCollab: open socket",g.joinId);Editor.enableRealtimeCache||-window.setTimeout(function(){e.sendJoinMessage()},0);D&&e.scheduleCleanup()});L.addEventListener("message",function(R){try{x||EditorUi.debug("P2PCollab: msg received",[R]);var T=JSON.parse(R.data);x&&"message"!=T.action&&EditorUi.debug("P2PCollab: msg received",[R]);switch(T.action){case "message":q(T.msg,T.from);break;case "clientsList":var U=T.msg;C=U.cId;P=!0;for(T=0;T<U.list.length;T++)v(U.list[T],!0);break;case "signal":var W=T.msg;if(!x){if(Q[W.from])var X=Q[W.from];else X=v(W.from,!1),V=!0;-X.signal(W.signal)}break;case "newClient":V=!0;break;case "clientLeft":E(T.msg);break;case "sendSignalFailed":var Y=T.msg;EditorUi.debug("P2PCollab: signal failed (socket not found on server)",Y);delete Q[Y.to];I[Y.to]=!1}}catch(Z){null!=window.console&&console.warn(Z,R)}});var N=!1;L.addEventListener("close",mxUtils.bind(this,function(R){EditorUi.debug("P2PCollab: WebSocket closed",L.joinId,"reconnecting",R.code,R.reason);EditorUi.debug("P2PCollab: closing socket on",L.joinId);u||1E3==R.code||H!=-L.joinId||(J==H&&(EditorUi.debug("P2PCollab: joinInProgress in close on",L.joinId),J=!1),N||(EditorUi.debug("P2PCollab: calling rejoin on",L.joinId),window.setTimeout(mxUtils.bind(this,function(){N=!0;this.joinFile(!0)}),500)));e.file.fireEvent(new mxEventObject("realtimeStateChanged"))}));L.addEventListener("error",mxUtils.bind(this,function(R){EditorUi.debug("P2PCollab: WebSocket error, reconnecting",R);EditorUi.debug("P2PCollab: error socket on",L.joinId);u||H!=L.joinId||(J==H&&(EditorUi.debug("P2PCollab: joinInProgress in error on",-L.joinId),J=!1),N||(EditorUi.debug("P2PCollab: calling rejoin on",L.joinId),N=!0,this.joinFile(!0)));e.file.fireEvent(new mxEventObject("realtimeStateChanged"))}));e.file.fireEvent(new mxEventObject("realtimeStateChanged"))}catch(R){K=R,e.file.fireEvent(new mxEventObject("realtimeStateChanged"))}};this.destroy=function(){if(!u){EditorUi.debug("P2PCollab: destroyed");u=!0;for(sessionId in m)G(sessionId);null!=this.mouseListeners&&B.removeMouseListener(this.mouseListeners);null!=this.selectionChangeListener&&-B.getSelectionModel().removeListener(this.selectionChangeListener);null!=this.shareCursorPositionListener&&b.removeListener(this.shareCursorPositionListener);null!=this.cursorHandler&&(mxEvent.removeListener(B.container,"scroll",this.cursorHandler),B.view.removeListener(this.cursorHandler),b.editor.removeListener(this.cursorHandler),b.removeListener(this.cursorHandler));null!=g&&1<=g.readyState&&(g.close(1E3),g=null);for(var D in S)null!=S[D]&&S[D].destroy();e.file.fireEvent(new mxEventObject("realtimeStateChanged"))}}}+window.setTimeout(function(){e.sendJoinMessage()},0);E&&e.scheduleCleanup()});L.addEventListener("message",function(R){try{x||EditorUi.debug("P2PCollab: msg received",[R]);var T=JSON.parse(R.data);x&&"message"!=T.action&&EditorUi.debug("P2PCollab: msg received",[R]);switch(T.action){case "message":q(T.msg,T.from);break;case "clientsList":var U=T.msg;C=U.cId;P=!0;for(T=0;T<U.list.length;T++)v(U.list[T],!0);break;case "signal":var W=T.msg;if(!x){if(Q[W.from])var X=Q[W.from];else X=v(W.from,!1),V=!0;+X.signal(W.signal)}break;case "newClient":V=!0;break;case "clientLeft":D(T.msg);break;case "sendSignalFailed":var Y=T.msg;EditorUi.debug("P2PCollab: signal failed (socket not found on server)",Y);delete Q[Y.to];I[Y.to]=!1}}catch(Z){null!=window.console&&console.warn(Z,R)}});var O=!1;L.addEventListener("close",mxUtils.bind(this,function(R){EditorUi.debug("P2PCollab: WebSocket closed",L.joinId,"reconnecting",R.code,R.reason);EditorUi.debug("P2PCollab: closing socket on",L.joinId);u||1E3==R.code||H!=+L.joinId||(J==H&&(EditorUi.debug("P2PCollab: joinInProgress in close on",L.joinId),J=!1),O||(EditorUi.debug("P2PCollab: calling rejoin on",L.joinId),window.setTimeout(mxUtils.bind(this,function(){O=!0;this.joinFile(!0)}),500)));e.file.fireEvent(new mxEventObject("realtimeStateChanged"))}));L.addEventListener("error",mxUtils.bind(this,function(R){EditorUi.debug("P2PCollab: WebSocket error, reconnecting",R);EditorUi.debug("P2PCollab: error socket on",L.joinId);u||H!=L.joinId||(J==H&&(EditorUi.debug("P2PCollab: joinInProgress in error on",+L.joinId),J=!1),O||(EditorUi.debug("P2PCollab: calling rejoin on",L.joinId),O=!0,this.joinFile(!0)));e.file.fireEvent(new mxEventObject("realtimeStateChanged"))}));e.file.fireEvent(new mxEventObject("realtimeStateChanged"))}catch(R){K=R,e.file.fireEvent(new mxEventObject("realtimeStateChanged"))}};this.destroy=function(){if(!u){EditorUi.debug("P2PCollab: destroyed");u=!0;for(sessionId in m)G(sessionId);null!=this.mouseListeners&&B.removeMouseListener(this.mouseListeners);null!=this.selectionChangeListener&&+B.getSelectionModel().removeListener(this.selectionChangeListener);null!=this.shareCursorPositionListener&&b.removeListener(this.shareCursorPositionListener);null!=this.cursorHandler&&(mxEvent.removeListener(B.container,"scroll",this.cursorHandler),B.view.removeListener(this.cursorHandler),b.editor.removeListener(this.cursorHandler),b.removeListener(this.cursorHandler));null!=g&&1<=g.readyState&&(g.close(1E3),g=null);for(var E in S)null!=S[E]&&S[E].destroy();e.file.fireEvent(new mxEventObject("realtimeStateChanged"))}}};diff --git a/src/main/webapp/js/integrate.min.js b/src/main/webapp/js/integrate.min.jsindex c42dcc412..9d52e5758 100644--- a/src/main/webapp/js/integrate.min.js+++ b/src/main/webapp/js/integrate.min.js@@ -1,7 +1,7 @@//fgnass.github.com/spin.js#v2.0.0!function(a,b){"object"==typeof exports?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Spinner=b()}(this,function(){"use strict";function a(a,b){var c,d=document.createElement(a||"div");for(c in b)d[c]=b[c];return d}function b(a){for(var b=1,c=arguments.length;c>b;b++)a.appendChild(arguments[b]);return a}function c(a,b,c,d){var e=["opacity",b,~~(100*a),c,d].join("-"),f=.01+c/d*100,g=Math.max(1-(1-a)/b*(100-f),a),h=j.substring(0,j.indexOf("Animation")).toLowerCase(),i=h&&"-"+h+"-"||"";return l[e]||(m.insertRule("@"+i+"keyframes "+e+"{0%{opacity:"+g+"}"+f+"%{opacity:"+a+"}"+(f+.01)+"%{opacity:1}"+(f+b)%100+"%{opacity:"+a+"}100%{opacity:"+g+"}}",m.cssRules.length),l[e]=1),e}function d(a,b){var c,d,e=a.style;for(b=b.charAt(0).toUpperCase()+b.slice(1),d=0;d<k.length;d++)if(c=k[d]+b,void 0!==e[c])return c;return void 0!==e[b]?b:void 0}function e(a,b){for(var c in b)a.style[d(a,c)||c]=b[c];return a}function f(a){for(var b=1;b<arguments.length;b++){var c=arguments[b];for(var d in c)void 0===a[d]&&(a[d]=c[d])}return a}function g(a,b){return"string"==typeof a?a:a[b%a.length]}function h(a){this.opts=f(a||{},h.defaults,n)}function i(){function c(b,c){return a("<"+b+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',c)}m.addRule(".spin-vml","behavior:url(#default#VML)"),h.prototype.lines=function(a,d){function f(){return e(c("group",{coordsize:k+" "+k,coordorigin:-j+" "+-j}),{width:k,height:k})}function h(a,h,i){b(m,b(e(f(),{rotation:360/d.lines*a+"deg",left:~~h}),b(e(c("roundrect",{arcsize:d.corners}),{width:j,height:d.width,left:d.radius,top:-d.width>>1,filter:i}),c("fill",{color:g(d.color,a),opacity:d.opacity}),c("stroke",{opacity:0}))))}var i,j=d.length+d.width,k=2*j,l=2*-(d.width+d.length)+"px",m=e(f(),{position:"absolute",top:l,left:l});if(d.shadow)for(i=1;i<=d.lines;i++)h(i,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(i=1;i<=d.lines;i++)h(i);return b(a,m)},h.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d<e.childNodes.length&&(e=e.childNodes[b+d],e=e&&e.firstChild,e=e&&e.firstChild,e&&(e.opacity=c))}}var j,k=["webkit","Moz","ms","O"],l={},m=function(){var c=a("style",{type:"text/css"});return b(document.getElementsByTagName("head")[0],c),c.sheet||c.styleSheet}(),n={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:"#000",direction:1,speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"50%",left:"50%",position:"absolute"};h.defaults={},f(h.prototype,{spin:function(b){this.stop();{var c=this,d=c.opts,f=c.el=e(a(0,{className:d.className}),{position:d.position,width:0,zIndex:d.zIndex});d.radius+d.length+d.width}if(b&&(b.insertBefore(f,b.firstChild||null),e(f,{left:d.left,top:d.top})),f.setAttribute("role","progressbar"),c.lines(f,c.opts),!j){var g,h=0,i=(d.lines-1)*(1-d.direction)/2,k=d.fps,l=k/d.speed,m=(1-d.opacity)/(l*d.trail/100),n=l/d.lines;!function o(){h++;for(var a=0;a<d.lines;a++)g=Math.max(1-(h+(d.lines-a)*n)%l*m,d.opacity),c.opacity(f,a*d.direction+i,g,d);c.timeout=c.el&&setTimeout(o,~~(1e3/k))}()}return c},stop:function(){var a=this.el;return a&&(clearTimeout(this.timeout),a.parentNode&&a.parentNode.removeChild(a),this.el=void 0),this},lines:function(d,f){function h(b,c){return e(a(),{position:"absolute",width:f.length+f.width+"px",height:f.width+"px",background:b,boxShadow:c,transformOrigin:"left",transform:"rotate("+~~(360/f.lines*k+f.rotate)+"deg) translate("+f.radius+"px,0)",borderRadius:(f.corners*f.width>>1)+"px"})}for(var i,k=0,l=(f.lines-1)*(1-f.direction)/2;k<f.lines;k++)i=e(a(),{position:"absolute",top:1+~(f.width/2)+"px",transform:f.hwaccel?"translate3d(0,0,0)":"",opacity:f.opacity,animation:j&&c(f.opacity,f.trail,l+k*f.direction,f.lines)+" "+1/f.speed+"s linear infinite"}),f.shadow&&b(i,e(h("#000","0 0 4px #000"),{top:"2px"})),b(d,b(i,h(g(f.color,k),"0 0 1px rgba(0,0,0,.1)")));return d},opacity:function(a,b,c){b<a.childNodes.length&&(a.childNodes[b].style.opacity=c)}});var o=e(a("group"),{behavior:"url(#default#VML)"});return!d(o,"transform")&&o.adj?i():j=d(o,"animation"),h});-/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */-!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DOMPurify=t()}(this,(function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:r}=Object;let{freeze:i,seal:a,create:l}=Object,{apply:c,construct:s}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),a||(a=function(e){return e}),c||(c=function(e,t,n){return e.apply(t,n)}),s||(s=function(e,t){return new e(...t)});const u=R(Array.prototype.forEach),m=R(Array.prototype.lastIndexOf),p=R(Array.prototype.pop),f=R(Array.prototype.push),d=R(Array.prototype.splice),h=R(String.prototype.toLowerCase),g=R(String.prototype.toString),T=R(String.prototype.match),y=R(String.prototype.replace),E=R(String.prototype.indexOf),A=R(String.prototype.trim),_=R(Object.prototype.hasOwnProperty),S=R(RegExp.prototype.test),b=(N=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(N,t)});var N;function R(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return c(e,t,o)}}function w(e,o){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;t&&t(e,null);let i=o.length;for(;i--;){let t=o[i];if("string"==typeof t){const e=r(t);e!==t&&(n(o)||(o[i]=e),t=e)}e[t]=!0}return e}function O(e){for(let t=0;t<e.length;t++){_(e,t)||(e[t]=null)}return e}function D(t){const n=l(null);for(const[o,r]of e(t)){_(t,o)&&(Array.isArray(r)?n[o]=O(r):r&&"object"==typeof r&&r.constructor===Object?n[o]=D(r):n[o]=r)}return n}function v(e,t){for(;null!==e;){const n=r(e,t);if(n){if(n.get)return R(n.get);if("function"==typeof n.value)return R(n.value)}e=o(e)}return function(){return null}}const L=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),C=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),x=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),M=i(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),k=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),I=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),U=i(["#text"]),z=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),P=i(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),H=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),F=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),W=a(/<%[\w\W]*|[\w\W]*%>/gm),G=a(/\$\{[\w\W]*/gm),Y=a(/^data-[\-\w.\u00B7-\uFFFF]+$/),j=a(/^aria-[\-\w]+$/),X=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),q=a(/^(?:\w+script|data):/i),$=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=a(/^html$/i),V=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var Z=Object.freeze({__proto__:null,ARIA_ATTR:j,ATTR_WHITESPACE:$,CUSTOM_ELEMENT:V,DATA_ATTR:Y,DOCTYPE_NAME:K,ERB_EXPR:W,IS_ALLOWED_URI:X,IS_SCRIPT_OR_DATA:q,MUSTACHE_EXPR:B,TMPLIT_EXPR:G});const J=1,Q=3,ee=7,te=8,ne=9,oe=function(){return"undefined"==typeof window?null:window};var re=function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oe();const o=e=>t(e);if(o.version="3.2.4",o.removed=[],!n||!n.document||n.document.nodeType!==ne||!n.Element)return o.isSupported=!1,o;let{document:r}=n;const a=r,c=a.currentScript,{DocumentFragment:s,HTMLTemplateElement:N,Node:R,Element:O,NodeFilter:B,NamedNodeMap:W=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:G,DOMParser:Y,trustedTypes:j}=n,q=O.prototype,$=v(q,"cloneNode"),V=v(q,"remove"),re=v(q,"nextSibling"),ie=v(q,"childNodes"),ae=v(q,"parentNode");if("function"==typeof N){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let le,ce="";const{implementation:se,createNodeIterator:ue,createDocumentFragment:me,getElementsByTagName:pe}=r,{importNode:fe}=a;let de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};o.isSupported="function"==typeof e&&"function"==typeof ae&&se&&void 0!==se.createHTMLDocument;const{MUSTACHE_EXPR:he,ERB_EXPR:ge,TMPLIT_EXPR:Te,DATA_ATTR:ye,ARIA_ATTR:Ee,IS_SCRIPT_OR_DATA:Ae,ATTR_WHITESPACE:_e,CUSTOM_ELEMENT:Se}=Z;let{IS_ALLOWED_URI:be}=Z,Ne=null;const Re=w({},[...L,...C,...x,...k,...U]);let we=null;const Oe=w({},[...z,...P,...H,...F]);let De=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ve=null,Le=null,Ce=!0,xe=!0,Me=!1,ke=!0,Ie=!1,Ue=!0,ze=!1,Pe=!1,He=!1,Fe=!1,Be=!1,We=!1,Ge=!0,Ye=!1,je=!0,Xe=!1,qe={},$e=null;const Ke=w({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ve=null;const Ze=w({},["audio","video","img","source","image","track"]);let Je=null;const Qe=w({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let ot=nt,rt=!1,it=null;const at=w({},[et,tt,nt],g);let lt=w({},["mi","mo","mn","ms","mtext"]),ct=w({},["annotation-xml"]);const st=w({},["title","style","font","a","script"]);let ut=null;const mt=["application/xhtml+xml","text/html"];let pt=null,ft=null;const dt=r.createElement("form"),ht=function(e){return e instanceof RegExp||e instanceof Function},gt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ft||ft!==e){if(e&&"object"==typeof e||(e={}),e=D(e),ut=-1===mt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,pt="application/xhtml+xml"===ut?g:h,Ne=_(e,"ALLOWED_TAGS")?w({},e.ALLOWED_TAGS,pt):Re,we=_(e,"ALLOWED_ATTR")?w({},e.ALLOWED_ATTR,pt):Oe,it=_(e,"ALLOWED_NAMESPACES")?w({},e.ALLOWED_NAMESPACES,g):at,Je=_(e,"ADD_URI_SAFE_ATTR")?w(D(Qe),e.ADD_URI_SAFE_ATTR,pt):Qe,Ve=_(e,"ADD_DATA_URI_TAGS")?w(D(Ze),e.ADD_DATA_URI_TAGS,pt):Ze,$e=_(e,"FORBID_CONTENTS")?w({},e.FORBID_CONTENTS,pt):Ke,ve=_(e,"FORBID_TAGS")?w({},e.FORBID_TAGS,pt):{},Le=_(e,"FORBID_ATTR")?w({},e.FORBID_ATTR,pt):{},qe=!!_(e,"USE_PROFILES")&&e.USE_PROFILES,Ce=!1!==e.ALLOW_ARIA_ATTR,xe=!1!==e.ALLOW_DATA_ATTR,Me=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ke=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Ie=e.SAFE_FOR_TEMPLATES||!1,Ue=!1!==e.SAFE_FOR_XML,ze=e.WHOLE_DOCUMENT||!1,Fe=e.RETURN_DOM||!1,Be=e.RETURN_DOM_FRAGMENT||!1,We=e.RETURN_TRUSTED_TYPE||!1,He=e.FORCE_BODY||!1,Ge=!1!==e.SANITIZE_DOM,Ye=e.SANITIZE_NAMED_PROPS||!1,je=!1!==e.KEEP_CONTENT,Xe=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||X,ot=e.NAMESPACE||nt,lt=e.MATHML_TEXT_INTEGRATION_POINTS||lt,ct=e.HTML_INTEGRATION_POINTS||ct,De=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(De.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(De.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(De.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ie&&(xe=!1),Be&&(Fe=!0),qe&&(Ne=w({},U),we=[],!0===qe.html&&(w(Ne,L),w(we,z)),!0===qe.svg&&(w(Ne,C),w(we,P),w(we,F)),!0===qe.svgFilters&&(w(Ne,x),w(we,P),w(we,F)),!0===qe.mathMl&&(w(Ne,k),w(we,H),w(we,F))),e.ADD_TAGS&&(Ne===Re&&(Ne=D(Ne)),w(Ne,e.ADD_TAGS,pt)),e.ADD_ATTR&&(we===Oe&&(we=D(we)),w(we,e.ADD_ATTR,pt)),e.ADD_URI_SAFE_ATTR&&w(Je,e.ADD_URI_SAFE_ATTR,pt),e.FORBID_CONTENTS&&($e===Ke&&($e=D($e)),w($e,e.FORBID_CONTENTS,pt)),je&&(Ne["#text"]=!0),ze&&w(Ne,["html","head","body"]),Ne.table&&(w(Ne,["tbody"]),delete ve.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');le=e.TRUSTED_TYPES_POLICY,ce=le.createHTML("")}else void 0===le&&(le=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(j,c)),null!==le&&"string"==typeof ce&&(ce=le.createHTML(""));i&&i(e),ft=e}},Tt=w({},[...C,...x,...M]),yt=w({},[...k,...I]),Et=function(e){f(o.removed,{element:e});try{ae(e).removeChild(e)}catch(t){V(e)}},At=function(e,t){try{f(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Fe||Be)try{Et(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},_t=function(e){let t=null,n=null;if(He)e="<remove></remove>"+e;else{const t=T(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ut&&ot===nt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=le?le.createHTML(e):e;if(ot===nt)try{t=(new Y).parseFromString(o,ut)}catch(e){}if(!t||!t.documentElement){t=se.createDocument(ot,"template",null);try{t.documentElement.innerHTML=rt?ce:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),ot===nt?pe.call(t,ze?"html":"body")[0]:ze?t.documentElement:i},St=function(e){return ue.call(e.ownerDocument||e,e,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT|B.SHOW_PROCESSING_INSTRUCTION|B.SHOW_CDATA_SECTION,null)},bt=function(e){return e instanceof G&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof W)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Nt=function(e){return"function"==typeof R&&e instanceof R};function Rt(e,t,n){u(e,(e=>{e.call(o,t,n,ft)}))}const wt=function(e){let t=null;if(Rt(de.beforeSanitizeElements,e,null),bt(e))return Et(e),!0;const n=pt(e.nodeName);if(Rt(de.uponSanitizeElement,e,{tagName:n,allowedTags:Ne}),e.hasChildNodes()&&!Nt(e.firstElementChild)&&S(/<[/\w]/g,e.innerHTML)&&S(/<[/\w]/g,e.textContent))return Et(e),!0;if(e.nodeType===ee)return Et(e),!0;if(Ue&&e.nodeType===te&&S(/<[/\w]/g,e.data))return Et(e),!0;if(!Ne[n]||ve[n]){if(!ve[n]&&Dt(n)){if(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n))return!1;if(De.tagNameCheck instanceof Function&&De.tagNameCheck(n))return!1}if(je&&!$e[n]){const t=ae(e)||e.parentNode,n=ie(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o){const r=$(n[o],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,re(e))}}}return Et(e),!0}return e instanceof O&&!function(e){let t=ae(e);t&&t.tagName||(t={namespaceURI:ot,tagName:"template"});const n=h(e.tagName),o=h(t.tagName);return!!it[e.namespaceURI]&&(e.namespaceURI===tt?t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===o||lt[o]):Boolean(Tt[n]):e.namespaceURI===et?t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&ct[o]:Boolean(yt[n]):e.namespaceURI===nt?!(t.namespaceURI===tt&&!ct[o])&&!(t.namespaceURI===et&&!lt[o])&&!yt[n]&&(st[n]||!Tt[n]):!("application/xhtml+xml"!==ut||!it[e.namespaceURI]))}(e)?(Et(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!S(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ie&&e.nodeType===Q&&(t=e.textContent,u([he,ge,Te],(e=>{t=y(t,e," ")})),e.textContent!==t&&(f(o.removed,{element:e.cloneNode()}),e.textContent=t)),Rt(de.afterSanitizeElements,e,null),!1):(Et(e),!0)},Ot=function(e,t,n){if(Ge&&("id"===t||"name"===t)&&(n in r||n in dt))return!1;if(xe&&!Le[t]&&S(ye,t));else if(Ce&&S(Ee,t));else if(!we[t]||Le[t]){if(!(Dt(e)&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,e)||De.tagNameCheck instanceof Function&&De.tagNameCheck(e))&&(De.attributeNameCheck instanceof RegExp&&S(De.attributeNameCheck,t)||De.attributeNameCheck instanceof Function&&De.attributeNameCheck(t))||"is"===t&&De.allowCustomizedBuiltInElements&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n)||De.tagNameCheck instanceof Function&&De.tagNameCheck(n))))return!1}else if(Je[t]);else if(S(be,y(n,_e,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==E(n,"data:")||!Ve[e]){if(Me&&!S(Ae,y(n,_e,"")));else if(n)return!1}else;return!0},Dt=function(e){return"annotation-xml"!==e&&T(e,Se)},vt=function(e){Rt(de.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||bt(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:we,forceKeepAttr:void 0};let r=t.length;for(;r--;){const i=t[r],{name:a,namespaceURI:l,value:c}=i,s=pt(a);let m="value"===a?c:A(c);if(n.attrName=s,n.attrValue=m,n.keepAttr=!0,n.forceKeepAttr=void 0,Rt(de.uponSanitizeAttribute,e,n),m=n.attrValue,!Ye||"id"!==s&&"name"!==s||(At(a,e),m="user-content-"+m),Ue&&S(/((--!?|])>)|<\/(style|title)/i,m)){At(a,e);continue}if(n.forceKeepAttr)continue;if(At(a,e),!n.keepAttr)continue;if(!ke&&S(/\/>/i,m)){At(a,e);continue}Ie&&u([he,ge,Te],(e=>{m=y(m,e," ")}));const f=pt(e.nodeName);if(Ot(f,s,m)){if(le&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(l);else switch(j.getAttributeType(f,s)){case"TrustedHTML":m=le.createHTML(m);break;case"TrustedScriptURL":m=le.createScriptURL(m)}try{l?e.setAttributeNS(l,a,m):e.setAttribute(a,m),bt(e)?Et(e):p(o.removed)}catch(e){}}}Rt(de.afterSanitizeAttributes,e,null)},Lt=function e(t){let n=null;const o=St(t);for(Rt(de.beforeSanitizeShadowDOM,t,null);n=o.nextNode();)Rt(de.uponSanitizeShadowNode,n,null),wt(n),vt(n),n.content instanceof s&&e(n.content);Rt(de.afterSanitizeShadowDOM,t,null)};return o.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=null,i=null,l=null;if(rt=!e,rt&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Nt(e)){if("function"!=typeof e.toString)throw b("toString is not a function");if("string"!=typeof(e=e.toString()))throw b("dirty is not a string, aborting")}if(!o.isSupported)return e;if(Pe||gt(t),o.removed=[],"string"==typeof e&&(Xe=!1),Xe){if(e.nodeName){const t=pt(e.nodeName);if(!Ne[t]||ve[t])throw b("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof R)n=_t("\x3c!----\x3e"),r=n.ownerDocument.importNode(e,!0),r.nodeType===J&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(!Fe&&!Ie&&!ze&&-1===e.indexOf("<"))return le&&We?le.createHTML(e):e;if(n=_t(e),!n)return Fe?null:We?ce:""}n&&He&&Et(n.firstChild);const c=St(Xe?e:n);for(;i=c.nextNode();)wt(i),vt(i),i.content instanceof s&&Lt(i.content);if(Xe)return e;if(Fe){if(Be)for(l=me.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(we.shadowroot||we.shadowrootmode)&&(l=fe.call(a,l,!0)),l}let m=ze?n.outerHTML:n.innerHTML;return ze&&Ne["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&S(K,n.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+m),Ie&&u([he,ge,Te],(e=>{m=y(m,e," ")})),le&&We?le.createHTML(m):m},o.setConfig=function(){gt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Pe=!0},o.clearConfig=function(){ft=null,Pe=!1},o.isValidAttribute=function(e,t,n){ft||gt({});const o=pt(e),r=pt(t);return Ot(o,r,n)},o.addHook=function(e,t){"function"==typeof t&&f(de[e],t)},o.removeHook=function(e,t){if(void 0!==t){const n=m(de[e],t);return-1===n?void 0:d(de[e],n,1)[0]}return p(de[e])},o.removeHooks=function(e){de[e]=[]},o.removeAllHooks=function(){de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},o}();return re}));+/*! @license DOMPurify 3.2.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.5/LICENSE */+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DOMPurify=t()}(this,(function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:r}=Object;let{freeze:i,seal:a,create:l}=Object,{apply:c,construct:s}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),a||(a=function(e){return e}),c||(c=function(e,t,n){return e.apply(t,n)}),s||(s=function(e,t){return new e(...t)});const u=R(Array.prototype.forEach),m=R(Array.prototype.lastIndexOf),p=R(Array.prototype.pop),f=R(Array.prototype.push),d=R(Array.prototype.splice),h=R(String.prototype.toLowerCase),g=R(String.prototype.toString),T=R(String.prototype.match),y=R(String.prototype.replace),E=R(String.prototype.indexOf),A=R(String.prototype.trim),_=R(Object.prototype.hasOwnProperty),S=R(RegExp.prototype.test),b=(N=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(N,t)});var N;function R(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return c(e,t,o)}}function w(e,o){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;t&&t(e,null);let i=o.length;for(;i--;){let t=o[i];if("string"==typeof t){const e=r(t);e!==t&&(n(o)||(o[i]=e),t=e)}e[t]=!0}return e}function O(e){for(let t=0;t<e.length;t++){_(e,t)||(e[t]=null)}return e}function D(t){const n=l(null);for(const[o,r]of e(t)){_(t,o)&&(Array.isArray(r)?n[o]=O(r):r&&"object"==typeof r&&r.constructor===Object?n[o]=D(r):n[o]=r)}return n}function v(e,t){for(;null!==e;){const n=r(e,t);if(n){if(n.get)return R(n.get);if("function"==typeof n.value)return R(n.value)}e=o(e)}return function(){return null}}const L=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),C=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),x=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=i(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),M=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),k=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),U=i(["#text"]),z=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),P=i(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),H=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),F=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),W=a(/<%[\w\W]*|[\w\W]*%>/gm),G=a(/\$\{[\w\W]*/gm),Y=a(/^data-[\-\w.\u00B7-\uFFFF]+$/),j=a(/^aria-[\-\w]+$/),X=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),q=a(/^(?:\w+script|data):/i),$=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=a(/^html$/i),V=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var Z=Object.freeze({__proto__:null,ARIA_ATTR:j,ATTR_WHITESPACE:$,CUSTOM_ELEMENT:V,DATA_ATTR:Y,DOCTYPE_NAME:K,ERB_EXPR:W,IS_ALLOWED_URI:X,IS_SCRIPT_OR_DATA:q,MUSTACHE_EXPR:B,TMPLIT_EXPR:G});const J=1,Q=3,ee=7,te=8,ne=9,oe=function(){return"undefined"==typeof window?null:window};var re=function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oe();const o=e=>t(e);if(o.version="3.2.5",o.removed=[],!n||!n.document||n.document.nodeType!==ne||!n.Element)return o.isSupported=!1,o;let{document:r}=n;const a=r,c=a.currentScript,{DocumentFragment:s,HTMLTemplateElement:N,Node:R,Element:O,NodeFilter:B,NamedNodeMap:W=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:G,DOMParser:Y,trustedTypes:j}=n,q=O.prototype,$=v(q,"cloneNode"),V=v(q,"remove"),re=v(q,"nextSibling"),ie=v(q,"childNodes"),ae=v(q,"parentNode");if("function"==typeof N){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let le,ce="";const{implementation:se,createNodeIterator:ue,createDocumentFragment:me,getElementsByTagName:pe}=r,{importNode:fe}=a;let de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};o.isSupported="function"==typeof e&&"function"==typeof ae&&se&&void 0!==se.createHTMLDocument;const{MUSTACHE_EXPR:he,ERB_EXPR:ge,TMPLIT_EXPR:Te,DATA_ATTR:ye,ARIA_ATTR:Ee,IS_SCRIPT_OR_DATA:Ae,ATTR_WHITESPACE:_e,CUSTOM_ELEMENT:Se}=Z;let{IS_ALLOWED_URI:be}=Z,Ne=null;const Re=w({},[...L,...C,...x,...M,...U]);let we=null;const Oe=w({},[...z,...P,...H,...F]);let De=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ve=null,Le=null,Ce=!0,xe=!0,Ie=!1,Me=!0,ke=!1,Ue=!0,ze=!1,Pe=!1,He=!1,Fe=!1,Be=!1,We=!1,Ge=!0,Ye=!1,je=!0,Xe=!1,qe={},$e=null;const Ke=w({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ve=null;const Ze=w({},["audio","video","img","source","image","track"]);let Je=null;const Qe=w({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let ot=nt,rt=!1,it=null;const at=w({},[et,tt,nt],g);let lt=w({},["mi","mo","mn","ms","mtext"]),ct=w({},["annotation-xml"]);const st=w({},["title","style","font","a","script"]);let ut=null;const mt=["application/xhtml+xml","text/html"];let pt=null,ft=null;const dt=r.createElement("form"),ht=function(e){return e instanceof RegExp||e instanceof Function},gt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ft||ft!==e){if(e&&"object"==typeof e||(e={}),e=D(e),ut=-1===mt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,pt="application/xhtml+xml"===ut?g:h,Ne=_(e,"ALLOWED_TAGS")?w({},e.ALLOWED_TAGS,pt):Re,we=_(e,"ALLOWED_ATTR")?w({},e.ALLOWED_ATTR,pt):Oe,it=_(e,"ALLOWED_NAMESPACES")?w({},e.ALLOWED_NAMESPACES,g):at,Je=_(e,"ADD_URI_SAFE_ATTR")?w(D(Qe),e.ADD_URI_SAFE_ATTR,pt):Qe,Ve=_(e,"ADD_DATA_URI_TAGS")?w(D(Ze),e.ADD_DATA_URI_TAGS,pt):Ze,$e=_(e,"FORBID_CONTENTS")?w({},e.FORBID_CONTENTS,pt):Ke,ve=_(e,"FORBID_TAGS")?w({},e.FORBID_TAGS,pt):{},Le=_(e,"FORBID_ATTR")?w({},e.FORBID_ATTR,pt):{},qe=!!_(e,"USE_PROFILES")&&e.USE_PROFILES,Ce=!1!==e.ALLOW_ARIA_ATTR,xe=!1!==e.ALLOW_DATA_ATTR,Ie=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,ke=e.SAFE_FOR_TEMPLATES||!1,Ue=!1!==e.SAFE_FOR_XML,ze=e.WHOLE_DOCUMENT||!1,Fe=e.RETURN_DOM||!1,Be=e.RETURN_DOM_FRAGMENT||!1,We=e.RETURN_TRUSTED_TYPE||!1,He=e.FORCE_BODY||!1,Ge=!1!==e.SANITIZE_DOM,Ye=e.SANITIZE_NAMED_PROPS||!1,je=!1!==e.KEEP_CONTENT,Xe=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||X,ot=e.NAMESPACE||nt,lt=e.MATHML_TEXT_INTEGRATION_POINTS||lt,ct=e.HTML_INTEGRATION_POINTS||ct,De=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(De.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(De.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(De.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ke&&(xe=!1),Be&&(Fe=!0),qe&&(Ne=w({},U),we=[],!0===qe.html&&(w(Ne,L),w(we,z)),!0===qe.svg&&(w(Ne,C),w(we,P),w(we,F)),!0===qe.svgFilters&&(w(Ne,x),w(we,P),w(we,F)),!0===qe.mathMl&&(w(Ne,M),w(we,H),w(we,F))),e.ADD_TAGS&&(Ne===Re&&(Ne=D(Ne)),w(Ne,e.ADD_TAGS,pt)),e.ADD_ATTR&&(we===Oe&&(we=D(we)),w(we,e.ADD_ATTR,pt)),e.ADD_URI_SAFE_ATTR&&w(Je,e.ADD_URI_SAFE_ATTR,pt),e.FORBID_CONTENTS&&($e===Ke&&($e=D($e)),w($e,e.FORBID_CONTENTS,pt)),je&&(Ne["#text"]=!0),ze&&w(Ne,["html","head","body"]),Ne.table&&(w(Ne,["tbody"]),delete ve.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');le=e.TRUSTED_TYPES_POLICY,ce=le.createHTML("")}else void 0===le&&(le=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(j,c)),null!==le&&"string"==typeof ce&&(ce=le.createHTML(""));i&&i(e),ft=e}},Tt=w({},[...C,...x,...I]),yt=w({},[...M,...k]),Et=function(e){f(o.removed,{element:e});try{ae(e).removeChild(e)}catch(t){V(e)}},At=function(e,t){try{f(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Fe||Be)try{Et(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},_t=function(e){let t=null,n=null;if(He)e="<remove></remove>"+e;else{const t=T(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ut&&ot===nt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=le?le.createHTML(e):e;if(ot===nt)try{t=(new Y).parseFromString(o,ut)}catch(e){}if(!t||!t.documentElement){t=se.createDocument(ot,"template",null);try{t.documentElement.innerHTML=rt?ce:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),ot===nt?pe.call(t,ze?"html":"body")[0]:ze?t.documentElement:i},St=function(e){return ue.call(e.ownerDocument||e,e,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT|B.SHOW_PROCESSING_INSTRUCTION|B.SHOW_CDATA_SECTION,null)},bt=function(e){return e instanceof G&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof W)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Nt=function(e){return"function"==typeof R&&e instanceof R};function Rt(e,t,n){u(e,(e=>{e.call(o,t,n,ft)}))}const wt=function(e){let t=null;if(Rt(de.beforeSanitizeElements,e,null),bt(e))return Et(e),!0;const n=pt(e.nodeName);if(Rt(de.uponSanitizeElement,e,{tagName:n,allowedTags:Ne}),e.hasChildNodes()&&!Nt(e.firstElementChild)&&S(/<[/\w!]/g,e.innerHTML)&&S(/<[/\w!]/g,e.textContent))return Et(e),!0;if(e.nodeType===ee)return Et(e),!0;if(Ue&&e.nodeType===te&&S(/<[/\w]/g,e.data))return Et(e),!0;if(!Ne[n]||ve[n]){if(!ve[n]&&Dt(n)){if(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n))return!1;if(De.tagNameCheck instanceof Function&&De.tagNameCheck(n))return!1}if(je&&!$e[n]){const t=ae(e)||e.parentNode,n=ie(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o){const r=$(n[o],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,re(e))}}}return Et(e),!0}return e instanceof O&&!function(e){let t=ae(e);t&&t.tagName||(t={namespaceURI:ot,tagName:"template"});const n=h(e.tagName),o=h(t.tagName);return!!it[e.namespaceURI]&&(e.namespaceURI===tt?t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===o||lt[o]):Boolean(Tt[n]):e.namespaceURI===et?t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&ct[o]:Boolean(yt[n]):e.namespaceURI===nt?!(t.namespaceURI===tt&&!ct[o])&&!(t.namespaceURI===et&&!lt[o])&&!yt[n]&&(st[n]||!Tt[n]):!("application/xhtml+xml"!==ut||!it[e.namespaceURI]))}(e)?(Et(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!S(/<\/no(script|embed|frames)/i,e.innerHTML)?(ke&&e.nodeType===Q&&(t=e.textContent,u([he,ge,Te],(e=>{t=y(t,e," ")})),e.textContent!==t&&(f(o.removed,{element:e.cloneNode()}),e.textContent=t)),Rt(de.afterSanitizeElements,e,null),!1):(Et(e),!0)},Ot=function(e,t,n){if(Ge&&("id"===t||"name"===t)&&(n in r||n in dt))return!1;if(xe&&!Le[t]&&S(ye,t));else if(Ce&&S(Ee,t));else if(!we[t]||Le[t]){if(!(Dt(e)&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,e)||De.tagNameCheck instanceof Function&&De.tagNameCheck(e))&&(De.attributeNameCheck instanceof RegExp&&S(De.attributeNameCheck,t)||De.attributeNameCheck instanceof Function&&De.attributeNameCheck(t))||"is"===t&&De.allowCustomizedBuiltInElements&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n)||De.tagNameCheck instanceof Function&&De.tagNameCheck(n))))return!1}else if(Je[t]);else if(S(be,y(n,_e,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==E(n,"data:")||!Ve[e]){if(Ie&&!S(Ae,y(n,_e,"")));else if(n)return!1}else;return!0},Dt=function(e){return"annotation-xml"!==e&&T(e,Se)},vt=function(e){Rt(de.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||bt(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:we,forceKeepAttr:void 0};let r=t.length;for(;r--;){const i=t[r],{name:a,namespaceURI:l,value:c}=i,s=pt(a);let m="value"===a?c:A(c);if(n.attrName=s,n.attrValue=m,n.keepAttr=!0,n.forceKeepAttr=void 0,Rt(de.uponSanitizeAttribute,e,n),m=n.attrValue,!Ye||"id"!==s&&"name"!==s||(At(a,e),m="user-content-"+m),Ue&&S(/((--!?|])>)|<\/(style|title)/i,m)){At(a,e);continue}if(n.forceKeepAttr)continue;if(At(a,e),!n.keepAttr)continue;if(!Me&&S(/\/>/i,m)){At(a,e);continue}ke&&u([he,ge,Te],(e=>{m=y(m,e," ")}));const f=pt(e.nodeName);if(Ot(f,s,m)){if(le&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(l);else switch(j.getAttributeType(f,s)){case"TrustedHTML":m=le.createHTML(m);break;case"TrustedScriptURL":m=le.createScriptURL(m)}try{l?e.setAttributeNS(l,a,m):e.setAttribute(a,m),bt(e)?Et(e):p(o.removed)}catch(e){}}}Rt(de.afterSanitizeAttributes,e,null)},Lt=function e(t){let n=null;const o=St(t);for(Rt(de.beforeSanitizeShadowDOM,t,null);n=o.nextNode();)Rt(de.uponSanitizeShadowNode,n,null),wt(n),vt(n),n.content instanceof s&&e(n.content);Rt(de.afterSanitizeShadowDOM,t,null)};return o.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=null,i=null,l=null;if(rt=!e,rt&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Nt(e)){if("function"!=typeof e.toString)throw b("toString is not a function");if("string"!=typeof(e=e.toString()))throw b("dirty is not a string, aborting")}if(!o.isSupported)return e;if(Pe||gt(t),o.removed=[],"string"==typeof e&&(Xe=!1),Xe){if(e.nodeName){const t=pt(e.nodeName);if(!Ne[t]||ve[t])throw b("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof R)n=_t("\x3c!----\x3e"),r=n.ownerDocument.importNode(e,!0),r.nodeType===J&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(!Fe&&!ke&&!ze&&-1===e.indexOf("<"))return le&&We?le.createHTML(e):e;if(n=_t(e),!n)return Fe?null:We?ce:""}n&&He&&Et(n.firstChild);const c=St(Xe?e:n);for(;i=c.nextNode();)wt(i),vt(i),i.content instanceof s&&Lt(i.content);if(Xe)return e;if(Fe){if(Be)for(l=me.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(we.shadowroot||we.shadowrootmode)&&(l=fe.call(a,l,!0)),l}let m=ze?n.outerHTML:n.innerHTML;return ze&&Ne["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&S(K,n.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+m),ke&&u([he,ge,Te],(e=>{m=y(m,e," ")})),le&&We?le.createHTML(m):m},o.setConfig=function(){gt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Pe=!0},o.clearConfig=function(){ft=null,Pe=!1},o.isValidAttribute=function(e,t,n){ft||gt({});const o=pt(e),r=pt(t);return Ot(o,r,n)},o.addHook=function(e,t){"function"==typeof t&&f(de[e],t)},o.removeHook=function(e,t){if(void 0!==t){const n=m(de[e],t);return-1===n?void 0:d(de[e],n,1)[0]}return p(de[e])},o.removeHooks=function(e){de[e]=[]},o.removeAllHooks=function(){de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},o}();return re}));/*CryptoJS v3.1.2code.google.com/p/crypto-js@@ -62,7 +62,7 @@ if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==url"se.diagrams.net"==window.location.hostname&&(urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.plugins="0",urlParams.mode="google",urlParams.lockdown="1",window.DRAWIO_GOOGLE_APP_ID=window.DRAWIO_GOOGLE_APP_ID||"184079235871",window.DRAWIO_GOOGLE_CLIENT_ID=window.DRAWIO_GOOGLE_CLIENT_ID||"184079235871-pjf5nn0lff27lk8qf0770gmffiv9gt61.apps.googleusercontent.com");"trello"==urlParams.mode&&(urlParams.tr="1");"embed.diagrams.net"==window.location.hostname&&(urlParams.embed="1");(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.open&&(window.location.hash=urlParams.open);"function"!==typeof window.structuredClone&&(window.structuredClone=function(a){return a});window.urlParams=window.urlParams||{};window.DOM_PURIFY_CONFIG=window.DOM_PURIFY_CONFIG||{ADD_TAGS:["use","foreignObject"],FORBID_TAGS:["form"],ALLOWED_URI_REGEXP:/^((?!javascript:).)*$/i,HTML_INTEGRATION_POINTS:{foreignobject:!0},ADD_ATTR:["target","content","pointer-events","requiredFeatures"]};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"mxgraph";-window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"26.2.2",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),+window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"26.2.7",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:0<=navigator.appVersion.indexOf("Android"),IS_IOS:/iP(hone|od|ad)/.test(navigator.platform)||navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&2<navigator.maxTouchPoints,IS_WEBVIEW:/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:-1<navigator.userAgent.toLowerCase().indexOf("firefox"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||@@ -117,73 +117,73 @@ mxUtils.write(c,a);mxEvent.addListener(c,"click",function(e){b(e)});null!=d&&(c.b,c,d,e,f){return mxUtils.link(a,b,function(){c[d](e)},f)},link:function(a,b,c,d){var e=document.createElement("span");e.style.color="blue";e.style.textDecoration="underline";e.style.cursor="pointer";null!=d&&(e.style.paddingLeft=d+"px");mxEvent.addListener(e,"click",c);mxUtils.write(e,b);null!=a&&a.appendChild(e);return e},getDocumentSize:function(){var a=document.body,b=document.documentElement;try{return new mxRectangle(0,0,a.clientWidth||b.clientWidth,Math.max(a.clientHeight||0,b.clientHeight))}catch(c){return new mxRectangle}},fit:function(a,b){b=b||0;var c=mxUtils.getDocumentSize(),d=parseInt(a.offsetLeft),e=parseInt(a.offsetWidth),f=mxUtils.getDocumentScrollOrigin(a.ownerDocument),g=f.x;f=f.y;var k=g+c.width-b;d+e>k&&(a.style.left=Math.max(g+b,k-e)+"px");d=parseInt(a.offsetTop);e=parseInt(a.offsetHeight);c=f+c.height-b;d+e>c&&(a.style.top=Math.max(f+b,c-e)+"px")},load:function(a){a=new mxXmlRequest(a,null,"GET",!1);a.send();return a},get:function(a,b,c,d,e,f,g){a=new mxXmlRequest(a,null,"GET");var k=a.setRequestHeaders;g&&(a.setRequestHeaders=function(l,m){k.apply(this,arguments);for(var n in g)l.setRequestHeader(n,g[n])});null!=d&&a.setBinary(d);a.send(b,c,e,f);return a},getAll:function(a,b,c){for(var d=a.length,e=[],f=0,g=function(){0==f&&null!=c&&c();f++},k=0;k<a.length;k++)(function(l,m){mxUtils.get(l,function(n){var p=n.getStatus();200>p||299<p?g():(e[m]=n,d--,0==d&&b(e))},g)})(a[k],k);0==d&&b(e)},post:function(a,b,c,d){return(new mxXmlRequest(a,b)).send(c,d)},submit:function(a,b,c,d){return(new mxXmlRequest(a,-b)).simulate(c,d)},loadInto:function(a,b,c){mxClient.IS_IE?b.onreadystatechange=function(){4==b.readyState&&c()}:b.addEventListener("load",c,!1);b.load(a)},getValue:function(a,b,c){a=null!=a?a[b]:null;null==a&&(a=c);return a},getNumber:function(a,b,c){a=null!=a?a[b]:null;null==a&&(a=c||0);return Number(a)},isLightDarkColor:function(a){return"string"===typeof a&&"light-dark"==mxUtils.ltrim(a).substring(0,10)},isVarColor:function(a){return mxUtils.varColorRegex.test(a)},isHexColor:function(a){return mxUtils.hexColorRegex.test(a)},-isRgbColor:function(a){return mxUtils.rgbaColorRegex.test(a)},isValidColor:function(a){if(null==a)return!1;a=String(a).replace(/\s/g,"");if(a.toLowerCase()==mxUtils.normalizedValidInvalidColor)return!0;mxUtils.canvasContext.fillStyle=mxUtils.validInvalidColor;mxUtils.canvasContext.fillStyle=a;return mxUtils.canvasContext.fillStyle!=mxUtils.validInvalidColor},isDarkColor:function(a){a=mxUtils.parseColor(a);return null!=a?128>.213*a.r+.715*a.g+.072*a.b:!1},parseLightDarkColor:function(a,b,c){var d=-a,e=null;null!=a&&(a=a.match(mxUtils.lightDarkColorRegex))&&3===a.length&&(d=mxUtils.trim(a[1]),e=mxUtils.trim(a[2]));null==e&&(c||mxUtils.isVarColor(d))&&(e=d);e=null!=e?e:null!=b?b:mxUtils.getInverseColor(d);return{light:d,dark:e}},getInverseColor:function(a,b,c){function d(m){return Math.round(b/100*(255-m)+m*(1-b/100))}function e(m){return Math.round(Math.max(0,Math.min(255,m)))}c=null!=c?c:180;b=null!=b?b:93;var f=0,g=0,k=0;if("transparent"==a.toLowerCase())return a;k=mxUtils.parseColor(a);if(null==-k)return a;f=k.r;g=k.g;k=k.b;f=d(f);g=d(g);k=d(k);a=[1,0,0,0,1,0,0,0,1];var l=Math.cos(c*Math.PI/180);c=Math.sin(c*Math.PI/180);a[0]=.2126+.7874*l-.2126*c;a[1]=.7152-.7152*l-.7152*c;a[2]=.0722-.0722*l+.9278*c;a[3]=.2126-.2126*l+.143*c;a[4]=.7152+(1-.7152)*l+.14*c;a[5]=.0722-.0722*l-.283*c;a[6]=.2126-.2126*l-.7874*c;a[7]=.7152-.7152*l+.7152*c;a[8]=.0722+.9278*l+.0722*c;c=e(a[0]*f+a[1]*g+a[2]*k);l=e(a[3]*f+a[4]*g+a[5]*k);f=e(a[6]*f+a[7]*g+a[8]*k);return"#"+(16777216|c<<16|l<<8|f).toString(16).slice(1)},-addAlphaToColor:function(a,b){null!=b&&null!=a&&"transparent"!=a&&(a=mxUtils.parseColor(a),a="rgba("+a.r+","+a.g+","+a.b+","+b+")");return a},getLightDarkColor:function(a,b,c,d){var e={light:"transparent",dark:"transparent",cssText:"transparent"};null!=a&&a!=mxConstants.NONE&&("string"===typeof a?(a=mxUtils.parseLightDarkColor(a,c,d),e.light=mxUtils.addAlphaToColor(a.light,b),e.dark=mxUtils.addAlphaToColor(a.dark,b),e.cssText=mxUtils.lightDarkColorSupported?e.light==e.dark?e.light:"light-dark("+e.light+-", "+e.dark+")":mxUtils.preferDarkColor?e.dark:e.light):(e.light=a,e.dark=a,e.cssText=a));return e},invertLightDarkColor:function(a){var b={};b.light=a.dark;b.dark=a.light;b.cssText=b.light==b.dark?b.light:"light-dark("+b.light+", "+b.dark+")";return b},getColor:function(a,b,c){a=null!=a?a[b]:null;null==a?a=c:a==mxConstants.NONE&&(a=null);return a},isEmptyObject:function(a){for(var b in a)return!1;return!0},clone:function(a,b,c){c=null!=c?c:!1;var d=null;if(null!=a&&"function"==typeof a.constructor)if(a.constructor===-Element)d=a.cloneNode(null!=c?!c:!1);else{d=new a.constructor;for(var e in a)e!=mxObjectIdentity.FIELD_NAME&&(null==b||0>mxUtils.indexOf(b,e))&&(d[e]=c||"object"!=typeof a[e]?a[e]:mxUtils.clone(a[e]))}return d},equalPoints:function(a,b){if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b)for(var c=0;c<a.length;c++)if(null!=a[c]&&null==b[c]||null==a[c]&&null!=b[c]||null!=a[c]&&null!=b[c]&&(a[c].x!=b[c].x||a[c].y!=b[c].y))return!1;return!0},equalEntries:function(a,-b){var c=0;if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b){for(var d in b)c++;for(d in a)if(c--,!(mxUtils.isNaN(a[d])&&mxUtils.isNaN(b[d])||a[d]==b[d]))return!1}return 0==c},removeDuplicates:function(a){for(var b=new mxDictionary,c=[],d=0;d<a.length;d++)b.get(a[d])||(c.push(a[d]),b.put(a[d],!0));return c},isNaN:function(a){return"number"==typeof a&&isNaN(a)},extend:function(a,b){var c=function(){};c.prototype=b.prototype;a.prototype=new c;-a.prototype.constructor=a},toString:function(a){var b="",c;for(c in a)try{if(null==a[c])b+=c+" = [null]\n";else if("function"==typeof a[c])b+=c+" => [Function]\n";else if("object"==typeof a[c]){var d=mxUtils.getFunctionName(a[c].constructor);b+=c+" => ["+d+"]\n"}else b+=c+" = "+a[c]+"\n"}catch(e){b+=c+"="+e.message}return b},toRadians:function(a){return Math.PI*a/180},toDegree:function(a){return 180*a/Math.PI},arcToCurves:function(a,b,c,d,e,f,g,k,l){k-=a;l-=b;if(0===c||0===d)return A;c=Math.abs(c);-d=Math.abs(d);var m=-k/2,n=-l/2,p=Math.cos(e*Math.PI/180);A=Math.sin(e*Math.PI/180);e=p*m+A*n;m=-1*A*m+p*n;n=e*e;var q=m*m,r=c*c,t=d*d,u=n/r+q/t;1<u?(c*=Math.sqrt(u),d*=Math.sqrt(u),f=0):(u=1,f===g&&(u=-1),f=u*Math.sqrt((r*t-r*q-t*n)/(r*q+t*n)));n=f*c*m/d;q=-1*f*d*e/c;k=p*n-A*q+k/2;l=A*n+p*q+l/2;r=Math.atan2((m-q)/d,(e-n)/c)-Math.atan2(0,1);f=0<=r?r:2*Math.PI+r;r=Math.atan2((-m-q)/d,(-e-n)/c)-Math.atan2((m-q)/d,(e-n)/c);e=0<=r?r:2*Math.PI+r;0==g&&0<e?e-=2*Math.PI:0!=g&&0>e&&(e+=2*Math.PI);g=2*e/Math.PI;-g=Math.ceil(0>g?-1*g:g);e/=g;m=8/3*Math.sin(e/4)*Math.sin(e/4)/Math.sin(e/2);n=p*c;p*=d;c*=A;d*=A;var x=Math.cos(f),y=Math.sin(f);q=-m*(n*y+d*x);r=-m*(c*y-p*x);for(var A=[],z=0;z<g;++z){f+=e;x=Math.cos(f);y=Math.sin(f);t=n*x-d*y+k;u=c*x+p*y+l;var C=-m*(n*y+d*x);x=-m*(c*y-p*x);y=6*z;A[y]=Number(q+a);A[y+1]=Number(r+b);A[y+2]=Number(t-C+a);A[y+3]=Number(u-x+b);A[y+4]=Number(t+a);A[y+5]=Number(u+b);q=t+C;r=u+x}return A},getBoundingBox:function(a,b,c){var d=null;if(null!=a&&null!=b&&0!=b){b=mxUtils.toRadians(b);-d=Math.cos(b);var e=Math.sin(b);c=null!=c?c:new mxPoint(a.x+a.width/2,a.y+a.height/2);var f=new mxPoint(a.x,a.y);b=new mxPoint(a.x+a.width,a.y);var g=new mxPoint(b.x,a.y+a.height);a=new mxPoint(a.x,g.y);f=mxUtils.getRotatedPoint(f,d,e,c);b=mxUtils.getRotatedPoint(b,d,e,c);g=mxUtils.getRotatedPoint(g,d,e,c);a=mxUtils.getRotatedPoint(a,d,e,c);d=new mxRectangle(f.x,f.y,0,0);d.add(new mxRectangle(b.x,b.y,0,0));d.add(new mxRectangle(g.x,g.y,0,0));d.add(new mxRectangle(a.x,a.y,0,0))}return d},getRotatedPoint:function(a,-b,c,d){d=null!=d?d:new mxPoint;var e=a.x-d.x;a=a.y-d.y;return new mxPoint(e*b-a*c+d.x,a*b+e*c+d.y)},getPortConstraints:function(a,b,c,d){b=mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT,mxUtils.getValue(b.style,c?mxConstants.STYLE_SOURCE_PORT_CONSTRAINT:mxConstants.STYLE_TARGET_PORT_CONSTRAINT,null));if(null==b)return d;d=b.toString();b=mxConstants.DIRECTION_MASK_NONE;c=0;1==mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT_ROTATION,0)&&(c=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,-0));a=0;45<c?(a=1,135<=c&&(a=2)):-45>c&&(a=3,-135>=c&&(a=2));if(0<=d.indexOf(mxConstants.DIRECTION_NORTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:b|=mxConstants.DIRECTION_MASK_EAST;break;case 2:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:b|=mxConstants.DIRECTION_MASK_WEST}if(0<=d.indexOf(mxConstants.DIRECTION_WEST))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_WEST;break;case 1:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:b|=mxConstants.DIRECTION_MASK_EAST;break;-case 3:b|=mxConstants.DIRECTION_MASK_SOUTH}if(0<=d.indexOf(mxConstants.DIRECTION_SOUTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:b|=mxConstants.DIRECTION_MASK_WEST;break;case 2:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:b|=mxConstants.DIRECTION_MASK_EAST}if(0<=d.indexOf(mxConstants.DIRECTION_EAST))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_EAST;break;case 1:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:b|=mxConstants.DIRECTION_MASK_WEST;break;case 3:b|=mxConstants.DIRECTION_MASK_NORTH}return b},-reversePortConstraints:function(a){var b=(a&mxConstants.DIRECTION_MASK_WEST)<<3;b|=(a&mxConstants.DIRECTION_MASK_NORTH)<<1;b|=(a&mxConstants.DIRECTION_MASK_SOUTH)>>1;return b|(a&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(a,b,c){var d=-1;if(0<a.absolutePoints.length)for(var e=a.absolutePoints[0],f=null,g=1;g<a.absolutePoints.length;g++){var k=a.absolutePoints[g];e=mxUtils.ptSegDistSq(e.x,e.y,k.x,k.y,b,c);if(null==f||e<f)f=e,d=g-1;e=k}return d},getDirectedBounds:function(a,b,c,-d,e){var f=mxUtils.getValue(c,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);d=null!=d?d:mxUtils.getValue(c,mxConstants.STYLE_FLIPH,!1);e=null!=e?e:mxUtils.getValue(c,mxConstants.STYLE_FLIPV,!1);b.x=Math.round(Math.max(0,Math.min(a.width,b.x)));b.y=Math.round(Math.max(0,Math.min(a.height,b.y)));b.width=Math.round(Math.max(0,Math.min(a.width,b.width)));b.height=Math.round(Math.max(0,Math.min(a.height,b.height)));if(e&&(f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH)||d&&(f==-mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST))c=b.x,b.x=b.width,b.width=c;if(d&&(f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH)||e&&(f==mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST))c=b.y,b.y=b.height,b.height=c;d=mxRectangle.fromRectangle(b);f==mxConstants.DIRECTION_SOUTH?(d.y=b.x,d.x=b.height,d.width=b.y,d.height=b.width):f==mxConstants.DIRECTION_WEST?(d.y=b.height,d.x=b.width,d.width=b.x,d.height=b.y):f==mxConstants.DIRECTION_NORTH&&(d.y=b.width,d.x=b.y,-d.width=b.height,d.height=b.x);return new mxRectangle(a.x+d.x,a.y+d.y,a.width-d.width-d.x,a.height-d.height-d.y)},getPerimeterPoint:function(a,b,c){for(var d=null,e=0;e<a.length-1;e++){var f=mxUtils.intersection(a[e].x,a[e].y,a[e+1].x,a[e+1].y,b.x,b.y,c.x,c.y);if(null!=f){var g=c.x-f.x,k=c.y-f.y;f={p:f,distSq:k*k+g*g};null!=f&&(null==d||d.distSq>f.distSq)&&(d=f)}}return null!=d?d.p:null},intersectsPoints:function(a,b){for(var c=0;c<b.length-1;c++)if(mxUtils.rectangleIntersectsSegment(a,b[c],b[c+1]))return!0;-return!1},rectangleIntersectsSegment:function(a,b,c){var d=a.y,e=a.x,f=d+a.height,g=e+a.width;a=b.x;var k=c.x;b.x>c.x&&(a=c.x,k=b.x);k>g&&(k=g);a<e&&(a=e);if(a>k)return!1;e=b.y;g=c.y;var l=c.x-b.x;1E-7<Math.abs(l)&&(c=(c.y-b.y)/l,b=b.y-c*b.x,e=c*a+b,g=c*k+b);e>g&&(b=g,g=e,e=b);g>f&&(g=f);e<d&&(e=d);return e>g?!1:!0},contains:function(a,b,c){return a.x<=b&&a.x+a.width>=b&&a.y<=c&&a.y+a.height>=c},intersects:function(a,b,c){var d=a.width,e=a.height,f=b.width,g=b.height;if(!c&&(0>=f||0>=g||0>=d||0>=-e))return!1;c=a.x;a=a.y;var k=b.x;b=b.y;f+=k;g+=b;d+=c;e+=a;return(f<k||f>c)&&(g<b||g>a)&&(d<c||d>k)&&(e<a||e>b)},intersectsHotspot:function(a,b,c,d,e,f){d=null!=d?d:1;e=null!=e?e:0;f=null!=f?f:0;if(0<d){var g=a.getCenterX(),k=a.getCenterY(),l=a.width,m=a.height,n=mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE)*a.view.scale;0<n&&(mxUtils.getValue(a.style,mxConstants.STYLE_HORIZONTAL,!0)?(k=a.y+n/2,m=n):(g=a.x+n/2,l=n));l=Math.max(e,l*d);m=Math.max(e,m*d);0<f&&(l=Math.min(l,f),m=Math.min(m,f));-d=new mxRectangle(g-l/2,k-m/2,l,m);g=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)||0);0!=g&&(e=Math.cos(-g),f=Math.sin(-g),g=new mxPoint(a.getCenterX(),a.getCenterY()),a=mxUtils.getRotatedPoint(new mxPoint(b,c),e,f,g),b=a.x,c=a.y);return mxUtils.contains(d,b,c)}return!0},getOffset:function(a,b){for(var c=0,d=0,e=!1,f=a,g=document.body,k=document.documentElement;null!=f&&f!=g&&f!=k&&!e;){var l=mxUtils.getCurrentStyle(f);null!=l&&(e=e||"fixed"==l.position);f=f.parentNode}b||-e||(b=mxUtils.getDocumentScrollOrigin(a.ownerDocument),c+=b.x,d+=b.y);a=a.getBoundingClientRect();null!=a&&(c+=a.left,d+=a.top);return new mxPoint(c,d)},getDocumentScrollOrigin:function(a){a=a.defaultView||a.parentWindow;return new mxPoint(null!=a&&void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,null!=a&&void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)},-getScrollOrigin:function(a,b,c){b=null!=b?b:!1;c=null!=c?c:!0;for(var d=null!=a?a.ownerDocument:document,e=d.body,f=d.documentElement,g=new mxPoint,k=!1;null!=a&&a!=e&&a!=f;){isNaN(a.scrollLeft)||isNaN(a.scrollTop)||(g.x+=a.scrollLeft,g.y+=a.scrollTop);var l=mxUtils.getCurrentStyle(a);null!=l&&(k=k||"fixed"==l.position);a=b?a.parentNode:null}!k&&c&&(a=mxUtils.getDocumentScrollOrigin(d),g.x+=a.x,g.y+=a.y);return g},convertPoint:function(a,b,c){var d=mxUtils.getScrollOrigin(a,!1);a=mxUtils.getOffset(a);-a.x-=d.x;a.y-=d.y;return new mxPoint(b-a.x,c-a.y)},removeJavascriptProtocol:function(a){for(a=null!=a?mxUtils.zapGremlins(a):null;null!=a&&"javascript:"===mxUtils.ltrim(a.toLowerCase()).substring(0,11);)a=a.substring(a.toLowerCase().indexOf(":")+1);return a},zapGremlins:function(a){for(var b=0,c=[],d=0;d<a.length;d++){var e=a.charCodeAt(d);(32<=e||9==e||10==e||13==e)&&65535!=e&&65534!=e||(c.push(a.substring(b,d)),b=d+1)}0<b&&b<a.length&&c.push(a.substring(b));return 0==c.length?a:c.join("")},ltrim:function(a,-b){return null!=a?a.replace(new RegExp("^["+(b||"\\s|\\0")+"]+","g"),""):null},rtrim:function(a,b){return null!=a?a.replace(new RegExp("["+(b||"\\s|\\0")+"]+$","g"),""):null},trim:function(a,b){return mxUtils.ltrim(mxUtils.rtrim(a,b),b)},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)&&("string"!=typeof a||0>a.toLowerCase().indexOf("0x"))},isInteger:function(a){return String(parseInt(a))===String(a)},mod:function(a,b){return(a%b+b)%b},intersection:function(a,b,c,d,e,f,g,k){var l=(k--f)*(c-a)-(g-e)*(d-b);g=((g-e)*(b-f)-(k-f)*(a-e))/l;e=((c-a)*(b-f)-(d-b)*(a-e))/l;return 0<=g&&1>=g&&0<=e&&1>=e?new mxPoint(a+g*(c-a),b+g*(d-b)):null},ptSegDistSq:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;0>=e*c+f*d?c=0:(e=c-e,f=d-f,a=e*c+f*d,c=0>=a?0:a*a/(c*c+d*d));e=e*e+f*f-c;0>e&&(e=0);return e},ptLineDist:function(a,b,c,d,e,f){return Math.abs((d-b)*e-(c-a)*f+c*b-d*a)/Math.sqrt((d-b)*(d-b)+(c-a)*(c-a))},relativeCcw:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;a=e*d-f*c;0==a&&(a=e*c+f*d,0<a&&(a=(e--c)*c+(f-d)*d,0>a&&(a=0)));return 0>a?-1:0<a?1:0},animateChanges:function(a,b){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(a,b,c){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(a,b,c,d,e,f){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(a,b){mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?a.style.filter=100<=b?"":"alpha(opacity="+b+")":a.style.opacity=b/100},createElementNs:function(a,b,c){if(null!=a.createElementNS)return a.createElementNS(b,-c);a=a.createElement(c);null!=namespace&&a.setAttribute("xmlns",b);return a},createImage:function(a){var b=document.createElement("img");b.setAttribute("src",a);b.setAttribute("border","0");return b},sortCells:function(a,b){b=null!=b?b:!0;var c=new mxDictionary;a.sort(function(d,e){var f=c.get(d);null==f&&(f=mxCellPath.create(d).split(mxCellPath.PATH_SEPARATOR),c.put(d,f));d=c.get(e);null==d&&(d=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),c.put(e,d));e=mxCellPath.compare(f,d);return 0==-e?0:0<e==b?1:-1});return a},getStylename:function(a){return null!=a&&(a=a.split(";")[0],0>a.indexOf("="))?a:""},getStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;c<a.length;c++)0>a[c].indexOf("=")&&b.push(a[c])}return b},indexOfStylename:function(a,b){if(null!=a&&null!=b){a=a.split(";");for(var c=0,d=0;d<a.length;d++){if(a[d]==b)return c;c+=a[d].length+1}}return-1},addStylename:function(a,b){0>mxUtils.indexOfStylename(a,b)&&(null==a?a="":0<a.length&&";"!=a.charAt(a.length--1)&&(a+=";"),a+=b);return a},removeStylename:function(a,b){var c=[];if(null!=a){a=a.split(";");for(var d=0;d<a.length;d++)a[d]!=b&&c.push(a[d])}return c.join(";")},removeAllStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;c<a.length;c++)0<=a[c].indexOf("=")&&b.push(a[c])}return b.join(";")},setCellStyles:function(a,b,c,d){if(null!=b&&0<b.length){a.beginUpdate();try{for(var e=0;e<b.length;e++)if(null!=b[e]){var f=mxUtils.setStyle(a.getStyle(b[e]),c,d);a.setStyle(b[e],f)}}finally{a.endUpdate()}}},-parseColor:function(a,b){b=null!=b?b:1;var c=null;if(null!=a&&a!=mxConstants.NONE){if(mxUtils.isRgbColor(a)){a=a.replace(/[^\d,]/g,"").split(",");c=parseInt(a[0]);var d=parseInt(a[1]),e=parseInt(a[2]);4==a.length&&(b=parseFloat(a[3]))}else mxUtils.isHexColor(a)||(a=mxUtils.color2hex(a)),a=a.substring(1),c=parseInt(a.substr(0,2),16),d=parseInt(a.substr(2,2),16),e=parseInt(a.substr(4,2),16),6<a.length&&(b=parseInt(a.substr(6,2),16)/255);c={r:c,g:d,b:e,a:b}}return c},hex2rgb:function(a){var b=mxUtils.parseColor(a);-null!=b&&(a="rgb("+b.r+", "+b.g+", "+b.b+")");return a},hex2rgba:function(a,b){b=mxUtils.parseColor(a,b);null!=b&&(a="rgba("+b.r+", "+b.g+", "+b.b+", "+b.a+")");return a},rgba2hex:function(a){var b=mxUtils.parseColor(a);return null!=b?"#"+("0"+b.r.toString(16)).slice(-2)+("0"+b.g.toString(16)).slice(-2)+("0"+b.b.toString(16)).slice(-2):a},color2hex:function(a,b){b=null!=b?b:"#000000";try{null!=a&&(a=String(a).replace(/\s/g,""),a.toLowerCase()==mxUtils.normalizedValidInvalidColor?b="#000000":(mxUtils.canvasContext.fillStyle=-mxUtils.validInvalidColor,mxUtils.canvasContext.fillStyle=a,mxUtils.canvasContext.fillStyle!=mxUtils.validInvalidColor&&(b=mxUtils.canvasContext.fillStyle)))}catch(c){}return b},setStyle:function(a,b,c){var d=null!=c&&("undefined"==typeof c.length||0<c.length);if(null==a||0==a.length)d&&(a=b+"="+c+";");else if(a.substring(0,b.length+1)==b+"="){var e=a.indexOf(";");a=d?b+"="+c+(0>e?";":a.substring(e)):0>e||e==a.length-1?"":a.substring(e+1)}else{var f=a.indexOf(";"+b+"=");0>f?d&&(d=";"==a.charAt(a.length--1)?"":";",a=a+d+b+"="+c+";"):(e=a.indexOf(";",f+1),a=d?a.substring(0,f+1)+b+"="+c+(0>e?";":a.substring(e)):a.substring(0,f)+(0>e?";":a.substring(e)))}return a},setCellStyleFlags:function(a,b,c,d,e){if(null!=b&&0<b.length){a.beginUpdate();try{for(var f=0;f<b.length;f++)if(null!=b[f]){var g=mxUtils.setStyleFlag(a.getStyle(b[f]),c,d,e);a.setStyle(b[f],g)}}finally{a.endUpdate()}}},setStyleFlag:function(a,b,c,d){if(null==a||0==a.length)a=d||null==d?b+"="+c:b+"=0";else{var e=a.indexOf(b+"=");if(0>e)e=";"==-a.charAt(a.length-1)?"":";",a=d||null==d?a+e+b+"="+c:a+e+b+"=0";else{var f=a.indexOf(";",e),g=0>f?a.substring(e+b.length+1):a.substring(e+b.length+1,f);g=null==d?parseInt(g)^c:d?parseInt(g)|c:parseInt(g)&~c;a=a.substring(0,e)+b+"="+g+(0<=f?a.substring(f):"")}}return a},getAlignmentAsPoint:function(a,b){var c=-.5,d=-.5;a==mxConstants.ALIGN_LEFT?c=0:a==mxConstants.ALIGN_RIGHT&&(c=-1);b==mxConstants.ALIGN_TOP?d=0:b==mxConstants.ALIGN_BOTTOM&&(d=-1);return new mxPoint(c,d)},getSizeForString:function(a,-b,c,d,e){b=null!=b?b:mxConstants.DEFAULT_FONTSIZE;c=null!=c?c:mxConstants.DEFAULT_FONTFAMILY;var f=document.createElement("div");f.style.fontFamily=c;f.style.fontSize=Math.round(b)+"px";f.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?b*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*mxSvgCanvas2D.prototype.lineHeightCorrection;null!=e&&((e&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(f.style.fontWeight="bold"),(e&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(f.style.fontStyle="italic"),-b=[],(e&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&b.push("underline"),(e&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&b.push("line-through"),0<b.length&&(f.style.textDecoration=b.join(" ")));f.style.position="absolute";f.style.visibility="hidden";f.style.display="inline-block";f.style.zoom="1";null!=d?(f.style.width=d+"px",f.style.whiteSpace="normal"):f.style.whiteSpace="nowrap";f.innerHTML=a;document.body.appendChild(f);a=new mxRectangle(0,0,f.offsetWidth,f.offsetHeight);-document.body.removeChild(f);return a},getViewXml:function(a,b,c,d,e){d=null!=d?d:0;e=null!=e?e:0;b=null!=b?b:1;null==c&&(c=[a.getModel().getRoot()]);var f=a.getView(),g=null,k=f.isEventsEnabled();f.setEventsEnabled(!1);var l=f.drawPane,m=f.overlayPane;a.dialect==mxConstants.DIALECT_SVG?(f.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),f.canvas.appendChild(f.drawPane),f.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g")):(f.drawPane=f.drawPane.cloneNode(!1),f.canvas.appendChild(f.drawPane),-f.overlayPane=f.overlayPane.cloneNode(!1));f.canvas.appendChild(f.overlayPane);var n=f.getTranslate();f.translate=new mxPoint(d,e);b=new mxTemporaryCellStates(a.getView(),b,c);try{g=(new mxCodec).encode(a.getView())}finally{b.destroy(),f.translate=n,f.canvas.removeChild(f.drawPane),f.canvas.removeChild(f.overlayPane),f.drawPane=l,f.overlayPane=m,f.setEventsEnabled(k)}return g},getScaleForPageCount:function(a,b,c,d){if(1>a)return 1;c=null!=c?c:mxConstants.PAGE_FORMAT_A4_PORTRAIT;d=null!=d?d:0;var e=-c.width-2*d;c=c.height-2*d;d=mxRectangle.fromRectangle(b.getGraphBounds());b=b.getView().getScale();d.width/=b;d.height/=b;b=d.width;var f=Math.sqrt(a);d=Math.sqrt(b/d.height/(e/c));c=f*d;d=f/d;if(1>c&&d>a){var g=d/a;d=a;c/=g}1>d&&c>a&&(g=c/a,c=a,d/=g);g=Math.ceil(c)*Math.ceil(d);for(f=0;g>a;){g=Math.floor(c)/c;var k=Math.floor(d)/d;1==g&&(g=Math.floor(c-1)/c);1==k&&(k=Math.floor(d-1)/d);g=g>k?g:k;c*=g;d*=g;g=Math.ceil(c)*Math.ceil(d);f++;if(10<f)break}return e*c/b*.99999},show:function(a,b,c,d,e,-f){c=null!=c?c:0;d=null!=d?d:0;null==b?b=window.open().document:b.open();9==document.documentMode&&b.writeln('\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=9"><![endif]--\x3e');var g=a.getGraphBounds(),k=Math.ceil(c-g.x),l=Math.ceil(d-g.y);null==e&&(e=Math.ceil(g.width+c)+Math.ceil(Math.ceil(g.x)-g.x));null==f&&(f=Math.ceil(g.height+d)+Math.ceil(Math.ceil(g.y)-g.y));if(mxClient.IS_IE||11==document.documentMode){d="<html><head>";g=document.getElementsByTagName("base");for(c=0;c<g.length;c++)d+=-g[c].outerHTML;d+="<style>";for(c=0;c<document.styleSheets.length;c++)try{d+=document.styleSheets[c].cssText}catch(m){}d=d+'</style></head><body style="margin:0px;"><div style="position:absolute;overflow:hidden;width:'+(e+"px;height:"+f+'px;"><div style="position:relative;left:'+k+"px;top:"+l+'px;">')+a.container.innerHTML;b.writeln(d+"</div></div></body><html>");b.close()}else{b.writeln("<html><head>");g=document.getElementsByTagName("base");for(c=0;c<g.length;c++)b.writeln(mxUtils.getOuterHtml(g[c]));-d=document.getElementsByTagName("link");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));d=document.getElementsByTagName("style");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));b.writeln('</head><body style="margin:0px;"></body></html>');b.close();c=b.createElement("div");c.position="absolute";c.overflow="hidden";c.style.width=e+"px";c.style.height=f+"px";e=b.createElement("div");e.style.position="absolute";e.style.left=k+"px";e.style.top=l+"px";f=a.container.firstChild;-for(d=null;null!=f;)g=f.cloneNode(!0),f==a.view.drawPane.ownerSVGElement?(c.appendChild(g),d=g):e.appendChild(g),f=f.nextSibling;b.body.appendChild(c);null!=e.firstChild&&b.body.appendChild(e);null!=d&&(d.style.minWidth="",d.style.minHeight="",d.firstChild.setAttribute("transform","translate("+k+","+l+")"))}mxUtils.removeCursors(b.body);return b},printScreen:function(a){var b=window.open();mxUtils.show(a,b.document);a=function(){b.focus();b.print();b.close()};mxClient.IS_GC?b.setTimeout(a,500):a()},-popup:function(a,b){if(b){var c=document.createElement("div");c.style.overflow="scroll";c.style.width="636px";c.style.height="460px";b=document.createElement("pre");b.innerHTML=mxUtils.htmlEntities(a,!1).replace(/\n/g,"<br>").replace(/ /g," ");c.appendChild(b);c=new mxWindow("Popup Window",c,document.body.clientWidth/2-320,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight)/2-240,640,480,!1,!0);c.setClosable(!0);c.setVisible(!0)}else mxClient.IS_NS?(c=window.open(),-c.document.writeln("<pre>"+mxUtils.htmlEntities(a)+"</pre"),c.document.close()):(c=window.open(),b=c.document.createElement("pre"),b.innerHTML=mxUtils.htmlEntities(a,!1).replace(/\n/g,"<br>").replace(/ /g," "),c.document.body.appendChild(b))},alert:function(a){alert(a)},prompt:function(a,b){return prompt(a,null!=b?b:"")},confirm:function(a){return confirm(a)},error:function(a,b,c,d){var e=document.createElement("div");e.style.padding="20px";var f=document.createElement("img");f.setAttribute("src",-d||mxUtils.errorImage);f.setAttribute("valign","bottom");f.style.verticalAlign="middle";e.appendChild(f);e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));mxUtils.write(e,a);a=document.body.clientWidth;d=document.body.clientHeight||document.documentElement.clientHeight;var g=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,e,(a-b)/2,d/4,b,null,!1,!0);c&&(mxUtils.br(e),b=document.createElement("p"),-c=document.createElement("button"),mxClient.IS_IE?c.style.cssText="float:right":c.setAttribute("style","float:right"),mxEvent.addListener(c,"click",function(k){g.destroy()}),mxUtils.write(c,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),b.appendChild(c),e.appendChild(b),mxUtils.br(e),g.setClosable(!0));g.setVisible(!0);return g},makeDraggable:function(a,b,c,d,e,f,g,k,l,m){a=new mxDragSource(a,c);a.dragOffset=new mxPoint(null!=e?e:0,null!=f?f:mxConstants.TOOLTIP_VERTICAL_OFFSET);a.autoscroll=-g;a.setGuidesEnabled(!1);null!=l&&(a.highlightDropTargets=l);null!=m&&(a.getDropTarget=m);a.getGraphForEvent=function(n){return"function"==typeof b?b(n):b};null!=d&&(a.createDragElement=function(){return d.cloneNode(!0)},k&&(a.createPreviewElement=function(n){var p=d.cloneNode(!0),q=parseInt(p.style.width),r=parseInt(p.style.height);p.style.width=Math.round(q*n.view.scale)+"px";p.style.height=Math.round(r*n.view.scale)+"px";return p}));return a},format:function(a){return parseFloat(parseFloat(a).toFixed(2))}},-mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"#808080",VML_SHADOWCOLOR:"#808080",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_BLUR:2,SHADOW_OPACITY:1,-NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",OUTLINE_HIGHLIGHT_COLOR:"#00FF00",OUTLINE_HIGHLIGHT_STROKEWIDTH:5,HIGHLIGHT_STROKEWIDTH:3,HIGHLIGHT_SIZE:2,HIGHLIGHT_OPACITY:100,CURSOR_MOVABLE_VERTEX:"move",-CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_TERMINAL_HANDLE:"pointer",CURSOR_BEND_HANDLE:"crosshair",CURSOR_VIRTUAL_BEND_HANDLE:"crosshair",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,-EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:6,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",DEFAULT_FONTSIZE:11,DEFAULT_TEXT_DIRECTION:"",LINE_HEIGHT:1.2,WORD_WRAP:"normal",-ABSOLUTE_LINE_HEIGHT:!1,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:0,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,827,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,827),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",-STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_PORT_CONSTRAINT_ROTATION:"portConstraintRotation",STYLE_SOURCE_PORT_CONSTRAINT:"sourcePortConstraint",STYLE_TARGET_PORT_CONSTRAINT:"targetPortConstraint",STYLE_OPACITY:"opacity",STYLE_FILL_OPACITY:"fillOpacity",STYLE_FILL_STYLE:"fillStyle",STYLE_STROKE_OPACITY:"strokeOpacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_TEXT_DIRECTION:"textDirection",STYLE_OVERFLOW:"overflow",STYLE_BLOCK_SPACING:"blockSpacing",STYLE_ORTHOGONAL:"orthogonal",-STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_DX:"exitDx",STYLE_EXIT_DY:"exitDy",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_DX:"entryDx",STYLE_ENTRY_DY:"entryDy",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_POINTER_EVENTS:"pointerEvents",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",STYLE_MARGIN:"margin",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",-STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_WIDTH:"labelWidth",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",-STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",-STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_TEXT_SHADOW:"textShadow",STYLE_SHADOW_OFFSET_X:"shadowOffsetX",STYLE_SHADOW_OFFSET_Y:"shadowOffsetY",STYLE_SHADOW_BLUR:"shadowBlur",STYLE_SHADOWCOLOR:"shadowColor",STYLE_SHADOW_OPACITY:"shadowOpacity",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",-STYLE_SWIMLANE_HEAD:"swimlaneHead",STYLE_SWIMLANE_BODY:"swimlaneBody",STYLE_ENDFILL:"endFill",STYLE_ENDFILLCOLOR:"endFillColor",STYLE_STARTFILL:"startFill",STYLE_STARTFILLCOLOR:"startFillColor",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_FIX_DASH:"fixDash",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_ABSOLUTE_ARCSIZE:"absoluteArcSize",STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",-STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ANCHOR_POINT_DIRECTION:"anchorPointDirection",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_ASPECT:"aspect",STYLE_AUTOSIZE:"autosize",STYLE_AUTOSIZE_GRID:"autosizeGrid",STYLE_FIXED_WIDTH:"fixedWidth",-STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BACKGROUND_OUTLINE:"backgroundOutline",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_RESIZE_WIDTH:"resizeWidth",STYLE_RESIZE_HEIGHT:"resizeHeight",STYLE_ROTATABLE:"rotatable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",STYLE_EDGE:"edgeStyle",STYLE_JETTY_SIZE:"jettySize",STYLE_SOURCE_JETTY_SIZE:"sourceJettySize",STYLE_TARGET_JETTY_SIZE:"targetJettySize",STYLE_LOOP:"loopStyle",-STYLE_ORTHOGONAL_LOOP:"orthogonalLoop",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",STYLE_CLIP_PATH:"clipPath",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_STRIKETHROUGH:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",SHAPE_ARROW:"arrow",SHAPE_ARROW_CONNECTOR:"arrowConnector",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",-SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_CLASSIC_THIN:"classicThin",ARROW_BLOCK:"block",ARROW_BLOCK_THIN:"blockThin",ARROW_OPEN:"open",ARROW_OPEN_THIN:"openThin",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",-DIRECTION_WEST:"west",DIRECTION_RADIAL:"radial",TEXT_DIRECTION_DEFAULT:"",TEXT_DIRECTION_AUTO:"auto",TEXT_DIRECTION_LTR:"ltr",TEXT_DIRECTION_RTL:"rtl",TEXT_DIRECTION_VERTICAL_LR:"vertical-lr",TEXT_DIRECTION_VERTICAL_RL:"vertical-rl",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",-EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_HEXAGON:"hexagonPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};+b)).simulate(c,d)},loadInto:function(a,b,c){mxClient.IS_IE?b.onreadystatechange=function(){4==b.readyState&&c()}:b.addEventListener("load",c,!1);b.load(a)},getValue:function(a,b,c){a=null!=a?a[b]:null;null==a&&(a=c);return a},getColorValue:function(a,b,c){a=null!=a?a[b]:null;if(null==a||"default"==a)a=c;return a},getNumber:function(a,b,c){a=null!=a?a[b]:null;null==a&&(a=c||0);return Number(a)},isLightDarkColor:function(a){return"string"===typeof a&&"light-dark"==mxUtils.ltrim(a).substring(0,10)},+isVarColor:function(a){return mxUtils.varColorRegex.test(a)},isHexColor:function(a){return mxUtils.hexColorRegex.test(a)},isRgbColor:function(a){return mxUtils.rgbaColorRegex.test(a)},isValidColor:function(a){if(null==a)return!1;a=String(a).replace(/\s/g,"");if(a.toLowerCase()==mxUtils.normalizedValidInvalidColor)return!0;mxUtils.canvasContext.fillStyle=mxUtils.validInvalidColor;mxUtils.canvasContext.fillStyle=a;return mxUtils.canvasContext.fillStyle!=mxUtils.validInvalidColor},isDarkColor:function(a){a=+mxUtils.parseColor(a);return null!=a?128>.213*a.r+.715*a.g+.072*a.b:!1},parseLightDarkColor:function(a,b,c){var d=a,e=null;null!=a&&(a=a.match(mxUtils.lightDarkColorRegex))&&3===a.length&&(d=mxUtils.trim(a[1]),e=mxUtils.trim(a[2]));null==e&&(c||mxUtils.isVarColor(d))&&(e=d);e=null!=e?e:null!=b?b:mxUtils.getInverseColor(d);return{light:d,dark:e}},getInverseColor:function(a,b,c){function d(m){return Math.round(b/100*(255-m)+m*(1-b/100))}function e(m){return Math.round(Math.max(0,Math.min(255,m)))}c=+null!=c?c:180;b=null!=b?b:93;var f=0,g=0,k=0;if("transparent"==a.toLowerCase())return a;k=mxUtils.parseColor(a);if(null==k)return a;f=k.r;g=k.g;k=k.b;f=d(f);g=d(g);k=d(k);a=[1,0,0,0,1,0,0,0,1];var l=Math.cos(c*Math.PI/180);c=Math.sin(c*Math.PI/180);a[0]=.2126+.7874*l-.2126*c;a[1]=.7152-.7152*l-.7152*c;a[2]=.0722-.0722*l+.9278*c;a[3]=.2126-.2126*l+.143*c;a[4]=.7152+(1-.7152)*l+.14*c;a[5]=.0722-.0722*l-.283*c;a[6]=.2126-.2126*l-.7874*c;a[7]=.7152-.7152*l+.7152*c;a[8]=.0722+.9278*l+.0722*c;c=e(a[0]*+f+a[1]*g+a[2]*k);l=e(a[3]*f+a[4]*g+a[5]*k);f=e(a[6]*f+a[7]*g+a[8]*k);return"#"+(16777216|c<<16|l<<8|f).toString(16).slice(1)},addAlphaToColor:function(a,b){null!=b&&null!=a&&"transparent"!=a&&(a=mxUtils.parseColor(a),a="rgba("+a.r+","+a.g+","+a.b+","+b+")");return a},getLightDarkColor:function(a,b,c,d){var e={light:"transparent",dark:"transparent",cssText:"transparent"};null!=a&&a!=mxConstants.NONE&&("string"===typeof a?(a=mxUtils.parseLightDarkColor(a,c,d),e.light=mxUtils.addAlphaToColor(a.light,+b),e.dark=mxUtils.addAlphaToColor(a.dark,b),e.cssText=mxUtils.lightDarkColorSupported?e.light==e.dark?e.light:"light-dark("+e.light+", "+e.dark+")":mxUtils.preferDarkColor?e.dark:e.light):(e.light=a,e.dark=a,e.cssText=a));return e},invertLightDarkColor:function(a){var b={};b.light=a.dark;b.dark=a.light;b.cssText=b.light==b.dark?b.light:"light-dark("+b.light+", "+b.dark+")";return b},getColor:function(a,b,c){a=null!=a?a[b]:null;null==a?a=c:a==mxConstants.NONE&&(a=null);return a},isEmptyObject:function(a){for(var b in a)return!1;+return!0},clone:function(a,b,c){c=null!=c?c:!1;var d=null;if(null!=a&&"function"==typeof a.constructor)if(a.constructor===Element)d=a.cloneNode(null!=c?!c:!1);else{d=new a.constructor;for(var e in a)e!=mxObjectIdentity.FIELD_NAME&&(null==b||0>mxUtils.indexOf(b,e))&&(d[e]=c||"object"!=typeof a[e]?a[e]:mxUtils.clone(a[e]))}return d},equalPoints:function(a,b){if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b)for(var c=0;c<a.length;c++)if(null!=a[c]&&+null==b[c]||null==a[c]&&null!=b[c]||null!=a[c]&&null!=b[c]&&(a[c].x!=b[c].x||a[c].y!=b[c].y))return!1;return!0},equalEntries:function(a,b){var c=0;if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b){for(var d in b)c++;for(d in a)if(c--,!(mxUtils.isNaN(a[d])&&mxUtils.isNaN(b[d])||a[d]==b[d]))return!1}return 0==c},removeDuplicates:function(a){for(var b=new mxDictionary,c=[],d=0;d<a.length;d++)b.get(a[d])||(c.push(a[d]),b.put(a[d],!0));return c},+isNaN:function(a){return"number"==typeof a&&isNaN(a)},extend:function(a,b){var c=function(){};c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a},toString:function(a){var b="",c;for(c in a)try{if(null==a[c])b+=c+" = [null]\n";else if("function"==typeof a[c])b+=c+" => [Function]\n";else if("object"==typeof a[c]){var d=mxUtils.getFunctionName(a[c].constructor);b+=c+" => ["+d+"]\n"}else b+=c+" = "+a[c]+"\n"}catch(e){b+=c+"="+e.message}return b},toRadians:function(a){return Math.PI*a/+180},toDegree:function(a){return 180*a/Math.PI},arcToCurves:function(a,b,c,d,e,f,g,k,l){k-=a;l-=b;if(0===c||0===d)return A;c=Math.abs(c);d=Math.abs(d);var m=-k/2,n=-l/2,p=Math.cos(e*Math.PI/180);A=Math.sin(e*Math.PI/180);e=p*m+A*n;m=-1*A*m+p*n;n=e*e;var q=m*m,r=c*c,t=d*d,u=n/r+q/t;1<u?(c*=Math.sqrt(u),d*=Math.sqrt(u),f=0):(u=1,f===g&&(u=-1),f=u*Math.sqrt((r*t-r*q-t*n)/(r*q+t*n)));n=f*c*m/d;q=-1*f*d*e/c;k=p*n-A*q+k/2;l=A*n+p*q+l/2;r=Math.atan2((m-q)/d,(e-n)/c)-Math.atan2(0,1);f=0<=r?r:2*Math.PI+r;+r=Math.atan2((-m-q)/d,(-e-n)/c)-Math.atan2((m-q)/d,(e-n)/c);e=0<=r?r:2*Math.PI+r;0==g&&0<e?e-=2*Math.PI:0!=g&&0>e&&(e+=2*Math.PI);g=2*e/Math.PI;g=Math.ceil(0>g?-1*g:g);e/=g;m=8/3*Math.sin(e/4)*Math.sin(e/4)/Math.sin(e/2);n=p*c;p*=d;c*=A;d*=A;var x=Math.cos(f),y=Math.sin(f);q=-m*(n*y+d*x);r=-m*(c*y-p*x);for(var A=[],z=0;z<g;++z){f+=e;x=Math.cos(f);y=Math.sin(f);t=n*x-d*y+k;u=c*x+p*y+l;var C=-m*(n*y+d*x);x=-m*(c*y-p*x);y=6*z;A[y]=Number(q+a);A[y+1]=Number(r+b);A[y+2]=Number(t-C+a);A[y+3]=Number(u-x++b);A[y+4]=Number(t+a);A[y+5]=Number(u+b);q=t+C;r=u+x}return A},getBoundingBox:function(a,b,c){var d=null;if(null!=a&&null!=b&&0!=b){b=mxUtils.toRadians(b);d=Math.cos(b);var e=Math.sin(b);c=null!=c?c:new mxPoint(a.x+a.width/2,a.y+a.height/2);var f=new mxPoint(a.x,a.y);b=new mxPoint(a.x+a.width,a.y);var g=new mxPoint(b.x,a.y+a.height);a=new mxPoint(a.x,g.y);f=mxUtils.getRotatedPoint(f,d,e,c);b=mxUtils.getRotatedPoint(b,d,e,c);g=mxUtils.getRotatedPoint(g,d,e,c);a=mxUtils.getRotatedPoint(a,d,e,c);d=new mxRectangle(f.x,+f.y,0,0);d.add(new mxRectangle(b.x,b.y,0,0));d.add(new mxRectangle(g.x,g.y,0,0));d.add(new mxRectangle(a.x,a.y,0,0))}return d},getRotatedPoint:function(a,b,c,d){d=null!=d?d:new mxPoint;var e=a.x-d.x;a=a.y-d.y;return new mxPoint(e*b-a*c+d.x,a*b+e*c+d.y)},getPortConstraints:function(a,b,c,d){b=mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT,mxUtils.getValue(b.style,c?mxConstants.STYLE_SOURCE_PORT_CONSTRAINT:mxConstants.STYLE_TARGET_PORT_CONSTRAINT,null));if(null==b)return d;d=b.toString();+b=mxConstants.DIRECTION_MASK_NONE;c=0;1==mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT_ROTATION,0)&&(c=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0));a=0;45<c?(a=1,135<=c&&(a=2)):-45>c&&(a=3,-135>=c&&(a=2));if(0<=d.indexOf(mxConstants.DIRECTION_NORTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:b|=mxConstants.DIRECTION_MASK_EAST;break;case 2:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:b|=mxConstants.DIRECTION_MASK_WEST}if(0<=d.indexOf(mxConstants.DIRECTION_WEST))switch(a){case 0:b|=+mxConstants.DIRECTION_MASK_WEST;break;case 1:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:b|=mxConstants.DIRECTION_MASK_EAST;break;case 3:b|=mxConstants.DIRECTION_MASK_SOUTH}if(0<=d.indexOf(mxConstants.DIRECTION_SOUTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:b|=mxConstants.DIRECTION_MASK_WEST;break;case 2:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:b|=mxConstants.DIRECTION_MASK_EAST}if(0<=d.indexOf(mxConstants.DIRECTION_EAST))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_EAST;+break;case 1:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:b|=mxConstants.DIRECTION_MASK_WEST;break;case 3:b|=mxConstants.DIRECTION_MASK_NORTH}return b},reversePortConstraints:function(a){var b=(a&mxConstants.DIRECTION_MASK_WEST)<<3;b|=(a&mxConstants.DIRECTION_MASK_NORTH)<<1;b|=(a&mxConstants.DIRECTION_MASK_SOUTH)>>1;return b|(a&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(a,b,c){var d=-1;if(0<a.absolutePoints.length)for(var e=a.absolutePoints[0],f=null,g=1;g<a.absolutePoints.length;g++){var k=+a.absolutePoints[g];e=mxUtils.ptSegDistSq(e.x,e.y,k.x,k.y,b,c);if(null==f||e<f)f=e,d=g-1;e=k}return d},getDirectedBounds:function(a,b,c,d,e){var f=mxUtils.getValue(c,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);d=null!=d?d:mxUtils.getValue(c,mxConstants.STYLE_FLIPH,!1);e=null!=e?e:mxUtils.getValue(c,mxConstants.STYLE_FLIPV,!1);b.x=Math.round(Math.max(0,Math.min(a.width,b.x)));b.y=Math.round(Math.max(0,Math.min(a.height,b.y)));b.width=Math.round(Math.max(0,Math.min(a.width,b.width)));b.height=+Math.round(Math.max(0,Math.min(a.height,b.height)));if(e&&(f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH)||d&&(f==mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST))c=b.x,b.x=b.width,b.width=c;if(d&&(f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH)||e&&(f==mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST))c=b.y,b.y=b.height,b.height=c;d=mxRectangle.fromRectangle(b);f==mxConstants.DIRECTION_SOUTH?(d.y=b.x,d.x=b.height,d.width=b.y,d.height=b.width):f==+mxConstants.DIRECTION_WEST?(d.y=b.height,d.x=b.width,d.width=b.x,d.height=b.y):f==mxConstants.DIRECTION_NORTH&&(d.y=b.width,d.x=b.y,d.width=b.height,d.height=b.x);return new mxRectangle(a.x+d.x,a.y+d.y,a.width-d.width-d.x,a.height-d.height-d.y)},getPerimeterPoint:function(a,b,c){for(var d=null,e=0;e<a.length-1;e++){var f=mxUtils.intersection(a[e].x,a[e].y,a[e+1].x,a[e+1].y,b.x,b.y,c.x,c.y);if(null!=f){var g=c.x-f.x,k=c.y-f.y;f={p:f,distSq:k*k+g*g};null!=f&&(null==d||d.distSq>f.distSq)&&(d=f)}}return null!=+d?d.p:null},intersectsPoints:function(a,b){for(var c=0;c<b.length-1;c++)if(mxUtils.rectangleIntersectsSegment(a,b[c],b[c+1]))return!0;return!1},rectangleIntersectsSegment:function(a,b,c){var d=a.y,e=a.x,f=d+a.height,g=e+a.width;a=b.x;var k=c.x;b.x>c.x&&(a=c.x,k=b.x);k>g&&(k=g);a<e&&(a=e);if(a>k)return!1;e=b.y;g=c.y;var l=c.x-b.x;1E-7<Math.abs(l)&&(c=(c.y-b.y)/l,b=b.y-c*b.x,e=c*a+b,g=c*k+b);e>g&&(b=g,g=e,e=b);g>f&&(g=f);e<d&&(e=d);return e>g?!1:!0},contains:function(a,b,c){return a.x<=b&&a.x+a.width>=+b&&a.y<=c&&a.y+a.height>=c},intersects:function(a,b,c){var d=a.width,e=a.height,f=b.width,g=b.height;if(!c&&(0>=f||0>=g||0>=d||0>=e))return!1;c=a.x;a=a.y;var k=b.x;b=b.y;f+=k;g+=b;d+=c;e+=a;return(f<k||f>c)&&(g<b||g>a)&&(d<c||d>k)&&(e<a||e>b)},intersectsHotspot:function(a,b,c,d,e,f){d=null!=d?d:1;e=null!=e?e:0;f=null!=f?f:0;if(0<d){var g=a.getCenterX(),k=a.getCenterY(),l=a.width,m=a.height,n=mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE)*a.view.scale;0<n&&(mxUtils.getValue(a.style,mxConstants.STYLE_HORIZONTAL,+!0)?(k=a.y+n/2,m=n):(g=a.x+n/2,l=n));l=Math.max(e,l*d);m=Math.max(e,m*d);0<f&&(l=Math.min(l,f),m=Math.min(m,f));d=new mxRectangle(g-l/2,k-m/2,l,m);g=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)||0);0!=g&&(e=Math.cos(-g),f=Math.sin(-g),g=new mxPoint(a.getCenterX(),a.getCenterY()),a=mxUtils.getRotatedPoint(new mxPoint(b,c),e,f,g),b=a.x,c=a.y);return mxUtils.contains(d,b,c)}return!0},getOffset:function(a,b){for(var c=0,d=0,e=!1,f=a,g=document.body,k=document.documentElement;null!=+f&&f!=g&&f!=k&&!e;){var l=mxUtils.getCurrentStyle(f);null!=l&&(e=e||"fixed"==l.position);f=f.parentNode}b||e||(b=mxUtils.getDocumentScrollOrigin(a.ownerDocument),c+=b.x,d+=b.y);a=a.getBoundingClientRect();null!=a&&(c+=a.left,d+=a.top);return new mxPoint(c,d)},getDocumentScrollOrigin:function(a){a=a.defaultView||a.parentWindow;return new mxPoint(null!=a&&void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,null!=a&&void 0!==window.pageYOffset?+window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)},getScrollOrigin:function(a,b,c){b=null!=b?b:!1;c=null!=c?c:!0;for(var d=null!=a?a.ownerDocument:document,e=d.body,f=d.documentElement,g=new mxPoint,k=!1;null!=a&&a!=e&&a!=f;){isNaN(a.scrollLeft)||isNaN(a.scrollTop)||(g.x+=a.scrollLeft,g.y+=a.scrollTop);var l=mxUtils.getCurrentStyle(a);null!=l&&(k=k||"fixed"==l.position);a=b?a.parentNode:null}!k&&c&&(a=mxUtils.getDocumentScrollOrigin(d),g.x+=a.x,g.y+=+a.y);return g},convertPoint:function(a,b,c){var d=mxUtils.getScrollOrigin(a,!1);a=mxUtils.getOffset(a);a.x-=d.x;a.y-=d.y;return new mxPoint(b-a.x,c-a.y)},removeJavascriptProtocol:function(a){for(a=null!=a?mxUtils.zapGremlins(a):null;null!=a&&"javascript:"===mxUtils.ltrim(a.toLowerCase()).substring(0,11);)a=a.substring(a.toLowerCase().indexOf(":")+1);return a},zapGremlins:function(a){for(var b=0,c=[],d=0;d<a.length;d++){var e=a.charCodeAt(d);(32<=e||9==e||10==e||13==e)&&65535!=e&&65534!=e||(c.push(a.substring(b,+d)),b=d+1)}0<b&&b<a.length&&c.push(a.substring(b));return 0==c.length?a:c.join("")},ltrim:function(a,b){return null!=a?a.replace(new RegExp("^["+(b||"\\s|\\0")+"]+","g"),""):null},rtrim:function(a,b){return null!=a?a.replace(new RegExp("["+(b||"\\s|\\0")+"]+$","g"),""):null},trim:function(a,b){return mxUtils.ltrim(mxUtils.rtrim(a,b),b)},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)&&("string"!=typeof a||0>a.toLowerCase().indexOf("0x"))},isInteger:function(a){return String(parseInt(a))===+String(a)},mod:function(a,b){return(a%b+b)%b},intersection:function(a,b,c,d,e,f,g,k){var l=(k-f)*(c-a)-(g-e)*(d-b);g=((g-e)*(b-f)-(k-f)*(a-e))/l;e=((c-a)*(b-f)-(d-b)*(a-e))/l;return 0<=g&&1>=g&&0<=e&&1>=e?new mxPoint(a+g*(c-a),b+g*(d-b)):null},ptSegDistSq:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;0>=e*c+f*d?c=0:(e=c-e,f=d-f,a=e*c+f*d,c=0>=a?0:a*a/(c*c+d*d));e=e*e+f*f-c;0>e&&(e=0);return e},ptLineDist:function(a,b,c,d,e,f){return Math.abs((d-b)*e-(c-a)*f+c*b-d*a)/Math.sqrt((d-b)*(d-b)+(c-a)*(c-a))},+relativeCcw:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;a=e*d-f*c;0==a&&(a=e*c+f*d,0<a&&(a=(e-c)*c+(f-d)*d,0>a&&(a=0)));return 0>a?-1:0<a?1:0},animateChanges:function(a,b){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(a,b,c){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(a,b,c,d,e,f){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(a,b){mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?a.style.filter=100<=b?+"":"alpha(opacity="+b+")":a.style.opacity=b/100},createElementNs:function(a,b,c){if(null!=a.createElementNS)return a.createElementNS(b,c);a=a.createElement(c);null!=namespace&&a.setAttribute("xmlns",b);return a},createImage:function(a){var b=document.createElement("img");b.setAttribute("src",a);b.setAttribute("border","0");return b},sortCells:function(a,b){b=null!=b?b:!0;var c=new mxDictionary;a.sort(function(d,e){var f=c.get(d);null==f&&(f=mxCellPath.create(d).split(mxCellPath.PATH_SEPARATOR),c.put(d,+f));d=c.get(e);null==d&&(d=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),c.put(e,d));e=mxCellPath.compare(f,d);return 0==e?0:0<e==b?1:-1});return a},getStylename:function(a){return null!=a&&(a=a.split(";")[0],0>a.indexOf("="))?a:""},getStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;c<a.length;c++)0>a[c].indexOf("=")&&b.push(a[c])}return b},indexOfStylename:function(a,b){if(null!=a&&null!=b){a=a.split(";");for(var c=0,d=0;d<a.length;d++){if(a[d]==b)return c;c+=a[d].length++1}}return-1},addStylename:function(a,b){0>mxUtils.indexOfStylename(a,b)&&(null==a?a="":0<a.length&&";"!=a.charAt(a.length-1)&&(a+=";"),a+=b);return a},removeStylename:function(a,b){var c=[];if(null!=a){a=a.split(";");for(var d=0;d<a.length;d++)a[d]!=b&&c.push(a[d])}return c.join(";")},removeAllStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;c<a.length;c++)0<=a[c].indexOf("=")&&b.push(a[c])}return b.join(";")},setCellStyles:function(a,b,c,d){if(null!=b&&0<b.length){a.beginUpdate();+try{for(var e=0;e<b.length;e++)if(null!=b[e]){var f=mxUtils.setStyle(a.getStyle(b[e]),c,d);a.setStyle(b[e],f)}}finally{a.endUpdate()}}},parseColor:function(a,b){b=null!=b?b:1;var c=null;if(null!=a&&a!=mxConstants.NONE){if(mxUtils.isRgbColor(a)){a=a.replace(/[^\d,]/g,"").split(",");c=parseInt(a[0]);var d=parseInt(a[1]),e=parseInt(a[2]);4==a.length&&(b=parseFloat(a[3]))}else mxUtils.isHexColor(a)||(a=mxUtils.color2hex(a)),a=a.substring(1),c=parseInt(a.substr(0,2),16),d=parseInt(a.substr(2,2),16),e=+parseInt(a.substr(4,2),16),6<a.length&&(b=parseInt(a.substr(6,2),16)/255);c={r:c,g:d,b:e,a:b}}return c},hex2rgb:function(a){var b=mxUtils.parseColor(a);null!=b&&(a="rgb("+b.r+", "+b.g+", "+b.b+")");return a},hex2rgba:function(a,b){b=mxUtils.parseColor(a,b);null!=b&&(a="rgba("+b.r+", "+b.g+", "+b.b+", "+b.a+")");return a},rgba2hex:function(a){var b=mxUtils.parseColor(a);return null!=b?"#"+("0"+b.r.toString(16)).slice(-2)+("0"+b.g.toString(16)).slice(-2)+("0"+b.b.toString(16)).slice(-2):a},color2hex:function(a,+b){b=null!=b?b:"#000000";try{null!=a&&(a=String(a).replace(/\s/g,""),a.toLowerCase()==mxUtils.normalizedValidInvalidColor?b="#000000":(mxUtils.canvasContext.fillStyle=mxUtils.validInvalidColor,mxUtils.canvasContext.fillStyle=a,mxUtils.canvasContext.fillStyle!=mxUtils.validInvalidColor&&(b=mxUtils.canvasContext.fillStyle)))}catch(c){}return b},setStyle:function(a,b,c){var d=null!=c&&("undefined"==typeof c.length||0<c.length);if(null==a||0==a.length)d&&(a=b+"="+c+";");else if(a.substring(0,b.length++1)==b+"="){var e=a.indexOf(";");a=d?b+"="+c+(0>e?";":a.substring(e)):0>e||e==a.length-1?"":a.substring(e+1)}else{var f=a.indexOf(";"+b+"=");0>f?d&&(d=";"==a.charAt(a.length-1)?"":";",a=a+d+b+"="+c+";"):(e=a.indexOf(";",f+1),a=d?a.substring(0,f+1)+b+"="+c+(0>e?";":a.substring(e)):a.substring(0,f)+(0>e?";":a.substring(e)))}return a},setCellStyleFlags:function(a,b,c,d,e){if(null!=b&&0<b.length){a.beginUpdate();try{for(var f=0;f<b.length;f++)if(null!=b[f]){var g=mxUtils.setStyleFlag(a.getStyle(b[f]),+c,d,e);a.setStyle(b[f],g)}}finally{a.endUpdate()}}},setStyleFlag:function(a,b,c,d){if(null==a||0==a.length)a=d||null==d?b+"="+c:b+"=0";else{var e=a.indexOf(b+"=");if(0>e)e=";"==a.charAt(a.length-1)?"":";",a=d||null==d?a+e+b+"="+c:a+e+b+"=0";else{var f=a.indexOf(";",e),g=0>f?a.substring(e+b.length+1):a.substring(e+b.length+1,f);g=null==d?parseInt(g)^c:d?parseInt(g)|c:parseInt(g)&~c;a=a.substring(0,e)+b+"="+g+(0<=f?a.substring(f):"")}}return a},getAlignmentAsPoint:function(a,b){var c=-.5,d=-.5;a==mxConstants.ALIGN_LEFT?+c=0:a==mxConstants.ALIGN_RIGHT&&(c=-1);b==mxConstants.ALIGN_TOP?d=0:b==mxConstants.ALIGN_BOTTOM&&(d=-1);return new mxPoint(c,d)},getSizeForString:function(a,b,c,d,e){b=null!=b?b:mxConstants.DEFAULT_FONTSIZE;c=null!=c?c:mxConstants.DEFAULT_FONTFAMILY;var f=document.createElement("div");f.style.fontFamily=c;f.style.fontSize=Math.round(b)+"px";f.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?b*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*mxSvgCanvas2D.prototype.lineHeightCorrection;null!=+e&&((e&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(f.style.fontWeight="bold"),(e&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(f.style.fontStyle="italic"),b=[],(e&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&b.push("underline"),(e&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&b.push("line-through"),0<b.length&&(f.style.textDecoration=b.join(" ")));f.style.position="absolute";f.style.visibility="hidden";f.style.display="inline-block";f.style.zoom="1";null!=+d?(f.style.width=d+"px",f.style.whiteSpace="normal"):f.style.whiteSpace="nowrap";f.innerHTML=a;document.body.appendChild(f);a=new mxRectangle(0,0,f.offsetWidth,f.offsetHeight);document.body.removeChild(f);return a},getViewXml:function(a,b,c,d,e){d=null!=d?d:0;e=null!=e?e:0;b=null!=b?b:1;null==c&&(c=[a.getModel().getRoot()]);var f=a.getView(),g=null,k=f.isEventsEnabled();f.setEventsEnabled(!1);var l=f.drawPane,m=f.overlayPane;a.dialect==mxConstants.DIALECT_SVG?(f.drawPane=document.createElementNS(mxConstants.NS_SVG,+"g"),f.canvas.appendChild(f.drawPane),f.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g")):(f.drawPane=f.drawPane.cloneNode(!1),f.canvas.appendChild(f.drawPane),f.overlayPane=f.overlayPane.cloneNode(!1));f.canvas.appendChild(f.overlayPane);var n=f.getTranslate();f.translate=new mxPoint(d,e);b=new mxTemporaryCellStates(a.getView(),b,c);try{g=(new mxCodec).encode(a.getView())}finally{b.destroy(),f.translate=n,f.canvas.removeChild(f.drawPane),f.canvas.removeChild(f.overlayPane),f.drawPane=+l,f.overlayPane=m,f.setEventsEnabled(k)}return g},getScaleForPageCount:function(a,b,c,d){if(1>a)return 1;c=null!=c?c:mxConstants.PAGE_FORMAT_A4_PORTRAIT;d=null!=d?d:0;var e=c.width-2*d;c=c.height-2*d;d=mxRectangle.fromRectangle(b.getGraphBounds());b=b.getView().getScale();d.width/=b;d.height/=b;b=d.width;var f=Math.sqrt(a);d=Math.sqrt(b/d.height/(e/c));c=f*d;d=f/d;if(1>c&&d>a){var g=d/a;d=a;c/=g}1>d&&c>a&&(g=c/a,c=a,d/=g);g=Math.ceil(c)*Math.ceil(d);for(f=0;g>a;){g=Math.floor(c)/c;var k=Math.floor(d)/+d;1==g&&(g=Math.floor(c-1)/c);1==k&&(k=Math.floor(d-1)/d);g=g>k?g:k;c*=g;d*=g;g=Math.ceil(c)*Math.ceil(d);f++;if(10<f)break}return e*c/b*.99999},show:function(a,b,c,d,e,f){c=null!=c?c:0;d=null!=d?d:0;null==b?b=window.open().document:b.open();9==document.documentMode&&b.writeln('\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=9"><![endif]--\x3e');var g=a.getGraphBounds(),k=Math.ceil(c-g.x),l=Math.ceil(d-g.y);null==e&&(e=Math.ceil(g.width+c)+Math.ceil(Math.ceil(g.x)-g.x));null==f&&(f=+Math.ceil(g.height+d)+Math.ceil(Math.ceil(g.y)-g.y));if(mxClient.IS_IE||11==document.documentMode){d="<html><head>";g=document.getElementsByTagName("base");for(c=0;c<g.length;c++)d+=g[c].outerHTML;d+="<style>";for(c=0;c<document.styleSheets.length;c++)try{d+=document.styleSheets[c].cssText}catch(m){}d=d+'</style></head><body style="margin:0px;"><div style="position:absolute;overflow:hidden;width:'+(e+"px;height:"+f+'px;"><div style="position:relative;left:'+k+"px;top:"+l+'px;">')+a.container.innerHTML;+b.writeln(d+"</div></div></body><html>");b.close()}else{b.writeln("<html><head>");g=document.getElementsByTagName("base");for(c=0;c<g.length;c++)b.writeln(mxUtils.getOuterHtml(g[c]));d=document.getElementsByTagName("link");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));d=document.getElementsByTagName("style");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));b.writeln('</head><body style="margin:0px;"></body></html>');b.close();c=b.createElement("div");c.position="absolute";+c.overflow="hidden";c.style.width=e+"px";c.style.height=f+"px";e=b.createElement("div");e.style.position="absolute";e.style.left=k+"px";e.style.top=l+"px";f=a.container.firstChild;for(d=null;null!=f;)g=f.cloneNode(!0),f==a.view.drawPane.ownerSVGElement?(c.appendChild(g),d=g):e.appendChild(g),f=f.nextSibling;b.body.appendChild(c);null!=e.firstChild&&b.body.appendChild(e);null!=d&&(d.style.minWidth="",d.style.minHeight="",d.firstChild.setAttribute("transform","translate("+k+","+l+")"))}mxUtils.removeCursors(b.body);+return b},printScreen:function(a){var b=window.open();mxUtils.show(a,b.document);a=function(){b.focus();b.print();b.close()};mxClient.IS_GC?b.setTimeout(a,500):a()},popup:function(a,b){if(b){var c=document.createElement("div");c.style.overflow="scroll";c.style.width="636px";c.style.height="460px";b=document.createElement("pre");b.innerHTML=mxUtils.htmlEntities(a,!1).replace(/\n/g,"<br>").replace(/ /g," ");c.appendChild(b);c=new mxWindow("Popup Window",c,document.body.clientWidth/2-320,Math.max(document.body.clientHeight||+0,document.documentElement.clientHeight)/2-240,640,480,!1,!0);c.setClosable(!0);c.setVisible(!0)}else mxClient.IS_NS?(c=window.open(),c.document.writeln("<pre>"+mxUtils.htmlEntities(a)+"</pre"),c.document.close()):(c=window.open(),b=c.document.createElement("pre"),b.innerHTML=mxUtils.htmlEntities(a,!1).replace(/\n/g,"<br>").replace(/ /g," "),c.document.body.appendChild(b))},alert:function(a){alert(a)},prompt:function(a,b){return prompt(a,null!=b?b:"")},confirm:function(a){return confirm(a)},+error:function(a,b,c,d){var e=document.createElement("div");e.style.padding="20px";var f=document.createElement("img");f.setAttribute("src",d||mxUtils.errorImage);f.setAttribute("valign","bottom");f.style.verticalAlign="middle";e.appendChild(f);e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));mxUtils.write(e,a);a=document.body.clientWidth;d=document.body.clientHeight||document.documentElement.clientHeight;var g=new mxWindow(mxResources.get(mxUtils.errorResource)||+mxUtils.errorResource,e,(a-b)/2,d/4,b,null,!1,!0);c&&(mxUtils.br(e),b=document.createElement("p"),c=document.createElement("button"),mxClient.IS_IE?c.style.cssText="float:right":c.setAttribute("style","float:right"),mxEvent.addListener(c,"click",function(k){g.destroy()}),mxUtils.write(c,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),b.appendChild(c),e.appendChild(b),mxUtils.br(e),g.setClosable(!0));g.setVisible(!0);return g},makeDraggable:function(a,b,c,d,e,f,g,k,l,m){a=new mxDragSource(a,+c);a.dragOffset=new mxPoint(null!=e?e:0,null!=f?f:mxConstants.TOOLTIP_VERTICAL_OFFSET);a.autoscroll=g;a.setGuidesEnabled(!1);null!=l&&(a.highlightDropTargets=l);null!=m&&(a.getDropTarget=m);a.getGraphForEvent=function(n){return"function"==typeof b?b(n):b};null!=d&&(a.createDragElement=function(){return d.cloneNode(!0)},k&&(a.createPreviewElement=function(n){var p=d.cloneNode(!0),q=parseInt(p.style.width),r=parseInt(p.style.height);p.style.width=Math.round(q*n.view.scale)+"px";p.style.height=Math.round(r*+n.view.scale)+"px";return p}));return a},format:function(a){return parseFloat(parseFloat(a).toFixed(2))}},mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"#808080",+VML_SHADOWCOLOR:"#808080",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_BLUR:2,SHADOW_OPACITY:1,NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",OUTLINE_HIGHLIGHT_COLOR:"#00FF00",OUTLINE_HIGHLIGHT_STROKEWIDTH:5,+HIGHLIGHT_STROKEWIDTH:3,HIGHLIGHT_SIZE:2,HIGHLIGHT_OPACITY:100,CURSOR_MOVABLE_VERTEX:"move",CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_TERMINAL_HANDLE:"pointer",CURSOR_BEND_HANDLE:"crosshair",CURSOR_VIRTUAL_BEND_HANDLE:"crosshair",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",+VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:6,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",+DEFAULT_FONTSIZE:11,DEFAULT_TEXT_DIRECTION:"",LINE_HEIGHT:1.2,WORD_WRAP:"normal",ABSOLUTE_LINE_HEIGHT:!1,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:0,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,827,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,827),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,+0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_PORT_CONSTRAINT_ROTATION:"portConstraintRotation",STYLE_SOURCE_PORT_CONSTRAINT:"sourcePortConstraint",STYLE_TARGET_PORT_CONSTRAINT:"targetPortConstraint",STYLE_OPACITY:"opacity",STYLE_FILL_OPACITY:"fillOpacity",STYLE_FILL_STYLE:"fillStyle",STYLE_STROKE_OPACITY:"strokeOpacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_TEXT_DIRECTION:"textDirection",+STYLE_OVERFLOW:"overflow",STYLE_BLOCK_SPACING:"blockSpacing",STYLE_ORTHOGONAL:"orthogonal",STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_DX:"exitDx",STYLE_EXIT_DY:"exitDy",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_DX:"entryDx",STYLE_ENTRY_DY:"entryDy",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_POINTER_EVENTS:"pointerEvents",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",+STYLE_MARGIN:"margin",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_WIDTH:"labelWidth",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",+STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",+STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_TEXT_SHADOW:"textShadow",STYLE_SHADOW_OFFSET_X:"shadowOffsetX",STYLE_SHADOW_OFFSET_Y:"shadowOffsetY",STYLE_SHADOW_BLUR:"shadowBlur",STYLE_SHADOWCOLOR:"shadowColor",STYLE_SHADOW_OPACITY:"shadowOpacity",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",+STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_SWIMLANE_HEAD:"swimlaneHead",STYLE_SWIMLANE_BODY:"swimlaneBody",STYLE_ENDFILL:"endFill",STYLE_ENDFILLCOLOR:"endFillColor",STYLE_STARTFILL:"startFill",STYLE_STARTFILLCOLOR:"startFillColor",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_FIX_DASH:"fixDash",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_ABSOLUTE_ARCSIZE:"absoluteArcSize",+STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ANCHOR_POINT_DIRECTION:"anchorPointDirection",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",+STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_ASPECT:"aspect",STYLE_AUTOSIZE:"autosize",STYLE_AUTOSIZE_GRID:"autosizeGrid",STYLE_FIXED_WIDTH:"fixedWidth",STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BACKGROUND_OUTLINE:"backgroundOutline",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_RESIZE_WIDTH:"resizeWidth",STYLE_RESIZE_HEIGHT:"resizeHeight",STYLE_ROTATABLE:"rotatable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",+STYLE_EDGE:"edgeStyle",STYLE_JETTY_SIZE:"jettySize",STYLE_SOURCE_JETTY_SIZE:"sourceJettySize",STYLE_TARGET_JETTY_SIZE:"targetJettySize",STYLE_LOOP:"loopStyle",STYLE_ORTHOGONAL_LOOP:"orthogonalLoop",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",STYLE_CLIP_PATH:"clipPath",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_STRIKETHROUGH:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",+SHAPE_ARROW:"arrow",SHAPE_ARROW_CONNECTOR:"arrowConnector",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_CLASSIC_THIN:"classicThin",ARROW_BLOCK:"block",ARROW_BLOCK_THIN:"blockThin",ARROW_OPEN:"open",ARROW_OPEN_THIN:"openThin",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",+ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",DIRECTION_WEST:"west",DIRECTION_RADIAL:"radial",TEXT_DIRECTION_DEFAULT:"",TEXT_DIRECTION_AUTO:"auto",TEXT_DIRECTION_LTR:"ltr",TEXT_DIRECTION_RTL:"rtl",TEXT_DIRECTION_VERTICAL_LR:"vertical-lr",TEXT_DIRECTION_VERTICAL_RL:"vertical-rl",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,+ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_HEXAGON:"hexagonPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};function mxEventObject(a){this.name=a;this.properties=[];for(var b=1;b<arguments.length;b+=2)null!=arguments[b+1]&&(this.properties[arguments[b]]=arguments[b+1])}mxEventObject.prototype.name=null;mxEventObject.prototype.properties=null;mxEventObject.prototype.consumed=!1;mxEventObject.prototype.getName=function(){return this.name};mxEventObject.prototype.getProperties=function(){return this.properties};mxEventObject.prototype.getProperty=function(a){return this.properties[a]};mxEventObject.prototype.isConsumed=function(){return this.consumed};mxEventObject.prototype.consume=function(){this.consumed=!0};function mxMouseEvent(a,b){this.evt=a;this.sourceState=this.state=b}mxMouseEvent.prototype.consumed=!1;mxMouseEvent.prototype.evt=null;mxMouseEvent.prototype.graphX=null;mxMouseEvent.prototype.graphY=null;mxMouseEvent.prototype.state=null;mxMouseEvent.prototype.sourceState=null;mxMouseEvent.prototype.getEvent=function(){return this.evt};mxMouseEvent.prototype.getSource=function(){return mxEvent.getSource(this.evt)};mxMouseEvent.prototype.isSource=function(a){return null!=a?mxUtils.isAncestorNode(a.node,this.getSource()):!1};mxMouseEvent.prototype.getX=function(){return mxEvent.getClientX(this.getEvent())};mxMouseEvent.prototype.getY=function(){return mxEvent.getClientY(this.getEvent())};mxMouseEvent.prototype.getGraphX=function(){return this.graphX};mxMouseEvent.prototype.getGraphY=function(){return this.graphY};@@ -476,7 +476,7 @@ mxShape.prototype.outline=!1;mxShape.prototype.visible=!0;mxShape.prototype.useSmxShape.prototype.getSvgScreenOffset=function(){return 1==mxUtils.mod(Math.max(1,Math.round((this.stencil&&"inherit"!=this.stencil.strokewidth?Number(this.stencil.strokewidth):this.strokewidth)*this.scale)),2)?.5:0};mxShape.prototype.create=function(a){return null!=a&&null!=a.ownerSVGElement?this.createSvg(a):this.createHtml(a)};mxShape.prototype.createSvg=function(){return document.createElementNS(mxConstants.NS_SVG,"g")};mxShape.prototype.createHtml=function(){var a=document.createElement("div");a.style.position="absolute";return a};mxShape.prototype.reconfigure=function(){this.redraw()};mxShape.prototype.redraw=function(){this.updateBoundsFromPoints();this.visible&&this.checkBounds()?(this.node.style.visibility="visible",this.clear(),"DIV"==this.node.nodeName?this.redrawHtmlShape():this.redrawShape()):(this.node.style.visibility="hidden",this.boundingBox=null)};mxShape.prototype.clear=function(){if(null!=this.node.ownerSVGElement)for(;null!=this.node.lastChild;)this.node.removeChild(this.node.lastChild);else this.node.style.cssText="position:absolute;"+(null!=this.cursor?"cursor:"+this.cursor+";":""),this.node.innerText=""};-mxShape.prototype.updateBoundsFromPoints=function(){var a=this.points;if(null!=a&&0<a.length&&null!=a[0]){this.bounds=new mxRectangle(Number(a[0].x),Number(a[0].y),this.scale,this.scale);for(var b=1;b<this.points.length;b++)null!=a[b]&&this.bounds.add(new mxRectangle(Number(a[b].x),Number(a[b].y),this.scale,this.scale))}};+mxShape.prototype.updateBoundsFromPoints=function(){var a=this.points;if(null!=a&&0<a.length&&null!=a[0]){this.bounds=new mxRectangle(Number(a[0].x),Number(a[0].y),this.scale,this.scale);for(var b=1;b<this.points.length;b++)null!=a[b]&&this.bounds.add(new mxRectangle(Number(a[b].x),Number(a[b].y),this.scale,this.scale))}};mxShape.prototype.styleChanged=function(a,b,c){};mxShape.prototype.getLabelBounds=function(a){var b=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),c=a;b!=mxConstants.DIRECTION_SOUTH&&b!=mxConstants.DIRECTION_NORTH&&null!=this.state&&null!=this.state.text&&this.state.text.isPaintBoundsInverted()&&(c=c.clone(),b=c.width,c.width=c.height,c.height=b);c=this.getLabelMargins(c);if(null!=c){var d="1"==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,!1),e="1"==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,!1);null!=this.state&&null!=this.state.text&&this.state.text.isPaintBoundsInverted()&&(b=c.x,c.x=c.height,c.height=c.width,c.width=c.y,c.y=b,b=d,d=e,e=b);return mxUtils.getDirectedBounds(a,c,this.style,d,e)}return a};mxShape.prototype.getLabelMargins=function(a){return null};mxShape.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&0<this.scale&&null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&0<this.bounds.width&&0<this.bounds.height};@@ -523,10 +523,10 @@ mxStencil.prototype.desc=null;mxStencil.prototype.constraints=null;mxStencil.promxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0];this.bgNode=this.desc.getElementsByTagName("background")[0];this.w0=Number(this.desc.getAttribute("w")||100);this.h0=Number(this.desc.getAttribute("h")||100);var a=this.desc.getAttribute("aspect");this.aspect=null!=a?a:"variable";a=this.desc.getAttribute("strokewidth");this.strokewidth=null!=a?a:"1"};mxStencil.prototype.parseConstraints=function(){var a=this.desc.getElementsByTagName("connections")[0];if(null!=a&&(a=mxUtils.getChildNodes(a),null!=a&&0<a.length)){this.constraints=[];for(var b=0;b<a.length;b++)this.constraints.push(this.parseConstraint(a[b]))}};mxStencil.prototype.parseConstraint=function(a){var b=Number(a.getAttribute("x")),c=Number(a.getAttribute("y")),d="1"==a.getAttribute("perimeter");a=a.getAttribute("name");return new mxConnectionConstraint(new mxPoint(b,c),d,a)};mxStencil.prototype.evaluateTextAttribute=function(a,b,c){b=this.evaluateAttribute(a,b,c);a=a.getAttribute("localized");if(mxStencil.defaultLocalized&&null==a||"1"==a)b=mxResources.get(b);return b};mxStencil.prototype.evaluateAttribute=function(a,b,c){b=a.getAttribute(b);null==b&&(a=mxUtils.getTextContent(a),null!=a&&mxStencil.allowEval&&(a=mxUtils.eval(a),"function"==typeof a&&(b=a(c))));return b};-mxStencil.prototype.drawShape=function(a,b,c,d,e,f,g){var k=a.states.slice(),l=mxUtils.getValue(b.style,mxConstants.STYLE_DIRECTION,null);l=this.computeAspect(b.style,c,d,e,f,l);var m=Math.min(l.width,l.height);m="inherit"==this.strokewidth?Number(mxUtils.getNumber(b.style,mxConstants.STYLE_STROKEWIDTH,1)):Number(this.strokewidth)*m;a.setStrokeWidth(m);null!=b.style&&"1"==mxUtils.getValue(b.style,mxConstants.STYLE_POINTER_EVENTS,"0")&&(a.setStrokeColor(mxConstants.NONE),a.rect(c,d,e,f),a.stroke(),-a.setStrokeColor(b.stroke));this.drawChildren(a,b,c,d,e,f,this.bgNode,l,!1,!0,g);this.drawChildren(a,b,c,d,e,f,this.fgNode,l,!0,!b.outline||null==b.style||0==mxUtils.getValue(b.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0),g);a.states.length!=k.length&&(a.states=k)};mxStencil.prototype.drawChildren=function(a,b,c,d,e,f,g,k,l,m,n){if(null!=g&&0<e&&0<f)for(c=g.firstChild;null!=c;)c.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(a,b,c,k,l,m,n),c=c.nextSibling};+mxStencil.prototype.drawShape=function(a,b,c,d,e,f,g){g=null!=g?g:null!=b&&null!=b.state?b.state.view.graph:null;var k=a.states.slice(),l=mxUtils.getValue(b.style,mxConstants.STYLE_DIRECTION,null);l=this.computeAspect(b.style,c,d,e,f,l);var m=Math.min(l.width,l.height);m="inherit"==this.strokewidth?Number(mxUtils.getNumber(b.style,mxConstants.STYLE_STROKEWIDTH,1)):Number(this.strokewidth)*m;a.setStrokeWidth(m);null!=b.style&&"1"==mxUtils.getValue(b.style,mxConstants.STYLE_POINTER_EVENTS,"0")&&(a.setStrokeColor(mxConstants.NONE),+a.rect(c,d,e,f),a.stroke(),a.setStrokeColor(b.stroke));this.drawChildren(a,b,c,d,e,f,this.bgNode,l,!1,!0,g);this.drawChildren(a,b,c,d,e,f,this.fgNode,l,!0,!b.outline||null==b.style||0==mxUtils.getValue(b.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0),g);a.states.length!=k.length&&(a.states=k)};mxStencil.prototype.drawChildren=function(a,b,c,d,e,f,g,k,l,m,n){if(null!=g&&0<e&&0<f)for(c=g.firstChild;null!=c;)c.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(a,b,c,k,l,m,n),c=c.nextSibling};mxStencil.prototype.computeAspect=function(a,b,c,d,e,f){a=b;b=d/this.w0;var g=e/this.h0;if(f=f==mxConstants.DIRECTION_NORTH||f==mxConstants.DIRECTION_SOUTH){g=d/this.h0;b=e/this.w0;var k=(d-e)/2;a+=k;c-=k}"fixed"==this.aspect&&(b=g=Math.min(b,g),f?(a+=(e-this.w0*b)/2,c+=(d-this.h0*g)/2):(a+=(d-this.w0*b)/2,c+=(e-this.h0*g)/2));return new mxRectangle(a,c,b,g)};-mxStencil.prototype.parseColor=function(a,b,c,d,e){"stroke"==d?d=b.stroke:"fill"==d?d=b.fill:"font"==d&&null!=b.style?d=mxUtils.getValue(b.style,mxConstants.STYLE_FONTCOLOR,"black"):null==b.style||mxUtils.isValidColor(d)||(a=mxUtils.getValue(b.style,d,mxConstants.NONE),"default"==a&&(a="fillcolor"==c.nodeName?e.shapeBackgroundColor:e.shapeForegroundColor),d=a);return d};+mxStencil.prototype.parseColor=function(a,b,c,d,e){"stroke"==d?d=b.stroke:"fill"==d?d=b.fill:"font"==d&&null!=b.style?d=mxUtils.getValue(b.style,mxConstants.STYLE_FONTCOLOR,"black"):null==b.style||mxUtils.isValidColor(d)||(a=mxUtils.getValue(b.style,d,mxConstants.NONE),"default"==a&&(a=null!=e?"fillcolor"==c.nodeName?e.shapeBackgroundColor:e.shapeForegroundColor:"#ffffff"),d=a);return d};mxStencil.prototype.drawNode=function(a,b,c,d,e,f,g){var k=c.nodeName,l=d.x,m=d.y,n=d.width,p=d.height,q=Math.min(n,p);if("save"==k)a.save();else if("restore"==k)a.restore();else if(f){if("path"==k){a.begin();q=!0;if("1"==c.getAttribute("rounded")){q=!1;for(var r=Number(c.getAttribute("arcSize")),t=0,u=[],x=c.firstChild;null!=x;){if(x.nodeType==mxConstants.NODETYPE_ELEMENT){var y=x.nodeName;if("move"==y||"line"==y)"move"!=y&&0!=u.length||u.push([]),u[u.length-1].push(new mxPoint(l+Number(x.getAttribute("x"))*n,m+Number(x.getAttribute("y"))*p)),t++;else{q=!0;break}}x=x.nextSibling}if(!q&&0<t)for(n=0;n<u.length;n++)p=!1,m=u[n][0],l=u[n][u[n].length-1],m.x==l.x&&m.y==l.y&&(u[n].pop(),p=!0),this.addPoints(a,u[n],!0,r,p);else q=!0}if(q)for(x=c.firstChild;null!=x;)x.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(a,b,x,d,e,f,g),x=x.nextSibling}else if("close"==k)a.close();else if("move"==k)a.moveTo(l+Number(c.getAttribute("x"))*n,m+Number(c.getAttribute("y"))*p);else if("line"==k)a.lineTo(l+Number(c.getAttribute("x"))*n,m+Number(c.getAttribute("y"))*p);else if("quad"==k)a.quadTo(l+Number(c.getAttribute("x1"))*n,m+Number(c.getAttribute("y1"))*p,l+Number(c.getAttribute("x2"))*n,m+Number(c.getAttribute("y2"))*p);else if("curve"==k)a.curveTo(l+Number(c.getAttribute("x1"))*n,m+Number(c.getAttribute("y1"))*p,l+Number(c.getAttribute("x2"))*n,m+Number(c.getAttribute("y2"))*p,l+Number(c.getAttribute("x3"))*n,m+Number(c.getAttribute("y3"))*p);else if("arc"==k)a.arcTo(Number(c.getAttribute("rx"))*n,Number(c.getAttribute("ry"))*@@ -1065,8 +1065,8 @@ this.initializeShape(a),this.createCellOverlays(a),this.installListeners(a),a.vinull!=a.shape.indicatorShape&&(a.shape.indicator=new a.shape.indicatorShape,a.shape.indicator.dialect=a.shape.dialect,a.shape.indicator.init(a.node),b=!0));null!=a.shape&&(this.createControl(a),b||this.isShapeInvalid(a,a.shape))&&(null!=a.absolutePoints?(a.shape.points=a.absolutePoints.slice(),a.shape.bounds=null):(a.shape.points=null,a.shape.bounds=new mxRectangle(a.x,a.y,a.width,a.height)),a.shape.scale=a.view.scale,(null==c||c)&&this.doRedrawShape(a),e=!0);return e};mxCellRenderer.prototype.doRedrawShape=function(a){a.shape.redraw()};mxCellRenderer.prototype.isShapeInvalid=function(a,b){return null==b.bounds||b.scale!=a.view.scale||null==a.absolutePoints&&!b.bounds.equals(a)||null!=a.absolutePoints&&!mxUtils.equalPoints(b.points,a.absolutePoints)};mxCellRenderer.prototype.destroy=function(a){null!=a.shape&&(null!=a.text&&(a.text.destroy(),a.text=null),null!=a.overlays&&(a.overlays.visit(function(b,c){c.destroy()}),a.overlays=null),null!=a.control&&(a.control.destroy(),a.control=null),a.shape.destroy(),a.shape=null)};-var mxEdgeStyle={EntityRelation:function(a,b,c,d,e){var f=a.view,g=f.graph;d=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*f.scale;var k=a.absolutePoints,l=k[0],m=k[k.length-1];k=!1;if(null!=b){var n=g.getCellGeometry(b.cell);n.relative?k=.5>=n.x:null!=c&&(k=(null!=m?m.x:c.x+c.width)<(null!=l?l.x:b.x))}if(null!=l)b=new mxCellState,b.x=l.x,b.y=l.y;else if(null!=b){var p=mxUtils.getPortConstraints(b,a,!0,mxConstants.DIRECTION_MASK_NONE);p!=mxConstants.DIRECTION_MASK_NONE&&-p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(k=p==mxConstants.DIRECTION_MASK_WEST)}else return;n=!0;null!=c&&(g=g.getCellGeometry(c.cell),g.relative?n=.5>=g.x:null!=b&&(n=(null!=l?l.x:b.x+b.width)<(null!=m?m.x:c.x)));null!=m?(c=new mxCellState,c.x=m.x,c.y=m.y):null!=c&&(p=mxUtils.getPortConstraints(c,a,!1,mxConstants.DIRECTION_MASK_NONE),p!=mxConstants.DIRECTION_MASK_NONE&&p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(n=p==mxConstants.DIRECTION_MASK_WEST));+var mxEdgeStyle={EntityRelation:function(a,b,c,d,e){var f=a.view,g=f.graph;d=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*f.scale;var k=a.absolutePoints,l=k[0],m=k[k.length-1];k=!1;if(null!=b){var n=g.getCellGeometry(b.cell);null!=n&&n.relative?k=.5>=n.x:null!=c&&(k=(null!=m?m.x:c.x+c.width)<(null!=l?l.x:b.x))}if(null!=l)b=new mxCellState,b.x=l.x,b.y=l.y;else if(null!=b){var p=mxUtils.getPortConstraints(b,a,!0,mxConstants.DIRECTION_MASK_NONE);p!=mxConstants.DIRECTION_MASK_NONE&&+p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(k=p==mxConstants.DIRECTION_MASK_WEST)}else return;n=!0;null!=c&&(g=g.getCellGeometry(c.cell),null!=g&&g.relative?n=.5>=g.x:null!=b&&(n=(null!=l?l.x:b.x+b.width)<(null!=m?m.x:c.x)));null!=m?(c=new mxCellState,c.x=m.x,c.y=m.y):null!=c&&(p=mxUtils.getPortConstraints(c,a,!1,mxConstants.DIRECTION_MASK_NONE),p!=mxConstants.DIRECTION_MASK_NONE&&p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(n=p==mxConstants.DIRECTION_MASK_WEST));null!=b&&null!=c&&(a=k?b.x:b.x+b.width,b=f.getRoutingCenterY(b),l=n?c.x:c.x+c.width,c=f.getRoutingCenterY(c),f=new mxPoint(a+(k?-d:d),b),g=new mxPoint(l+(n?-d:d),c),k==n?(d=k?Math.min(a,l)-d:Math.max(a,l)+d,e.push(new mxPoint(d,b)),e.push(new mxPoint(d,c))):(f.x<g.x==k?(d=b+(c-b)/2,e.push(f),e.push(new mxPoint(f.x,d)),e.push(new mxPoint(g.x,d))):e.push(f),e.push(g)))},Loop:function(a,b,c,d,e){c=a.absolutePoints;var f=c[c.length-1];if(null!=c[0]&&null!=f){if(null!=d&&0<d.length)for(b=0;b<d.length;b++)c=d[b],c=a.view.transformControlPoint(a,c),e.push(new mxPoint(c.x,c.y))}else if(null!=b){f=a.view;var g=f.graph;c=null!=d&&0<d.length?d[0]:null;null!=c&&(c=f.transformControlPoint(a,c),mxUtils.contains(b,c.x,c.y)&&(c=null));var k=d=0,l=0,m=0;g=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,g.gridSize)*f.scale;a=mxUtils.getValue(a.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST);a==mxConstants.DIRECTION_NORTH||a==mxConstants.DIRECTION_SOUTH?(d=f.getRoutingCenterX(b),k=g):(l=f.getRoutingCenterY(b),m=g);null==c||c.x<b.x||c.x>b.x+b.width?null!=c?(d=c.x,m=Math.max(Math.abs(l-c.y),m)):a==mxConstants.DIRECTION_NORTH?l=b.y-2*k:a==mxConstants.DIRECTION_SOUTH?l=b.y+b.height+2*k:d=a==mxConstants.DIRECTION_EAST?b.x-2*m:b.x+b.width+2*m:null!=c&&(d=f.getRoutingCenterX(b),k=Math.max(Math.abs(d-c.x),m),l=c.y,m=0);e.push(new mxPoint(d-k,l-m));e.push(new mxPoint(d+k,l+m))}},ElbowConnector:function(a,b,c,d,e){var f=null!=d&&0<d.length?d[0]:null,g=!1,k=!1;if(null!=b&&null!=c)if(null!=f){var l=Math.min(b.x,c.x),@@ -1133,8 +1133,8 @@ mxGraphView.prototype.stateValidated=function(a){var b=this.graph.getModel().isEmxGraphView.prototype.updateFixedTerminalPoints=function(a,b,c){this.updateFixedTerminalPoint(a,b,!0,this.graph.getConnectionConstraint(a,b,!0));this.updateFixedTerminalPoint(a,c,!1,this.graph.getConnectionConstraint(a,c,!1))};mxGraphView.prototype.updateFixedTerminalPoint=function(a,b,c,d){a.setAbsoluteTerminalPoint(this.getFixedTerminalPoint(a,b,c,d),c)};mxGraphView.prototype.getFixedTerminalPoint=function(a,b,c,d){var e=null;null!=d&&(e=this.graph.getConnectionPoint(b,d,!1));if(null==e&&null==b){b=this.scale;d=this.translate;var f=a.origin;e=this.graph.getCellGeometry(a.cell).getTerminalPoint(c);null!=e&&(e=new mxPoint(b*(d.x+e.x+f.x),b*(d.y+e.y+f.y)))}return e};mxGraphView.prototype.updateBoundsFromStencil=function(a){var b=null;if(null!=a&&null!=a.shape&&null!=a.shape.stencil&&"fixed"==a.shape.stencil.aspect){b=mxRectangle.fromRectangle(a);var c=a.shape.stencil.computeAspect(a.style,a.x,a.y,a.width,a.height);a.setRect(c.x,c.y,a.shape.stencil.w0*c.width,a.shape.stencil.h0*c.height)}return b};-mxGraphView.prototype.updatePoints=function(a,b,c,d){if(null!=a){var e=[];e.push(a.absolutePoints[0]);var f=this.getEdgeStyle(a,b,c,d);if(null!=f){c=this.getTerminalPort(a,c,!0);d=this.getTerminalPort(a,d,!1);var g=this.updateBoundsFromStencil(c),k=this.updateBoundsFromStencil(d);f(a,c,d,b,e);null!=g&&c.setRect(g.x,g.y,g.width,g.height);null!=k&&d.setRect(k.x,k.y,k.width,k.height)}else if(null!=b)for(f=0;f<b.length;f++)null!=b[f]&&(c=mxUtils.clone(b[f]),e.push(this.transformControlPoint(a,c)));b=-a.absolutePoints;e.push(b[b.length-1]);a.absolutePoints=e}};mxGraphView.prototype.transformControlPoint=function(a,b,c){return null!=a&&null!=b?(a=a.origin,c=c?1:this.scale,new mxPoint(c*(b.x+this.translate.x+a.x),c*(b.y+this.translate.y+a.y))):null};+mxGraphView.prototype.updatePoints=function(a,b,c,d){if(null!=a&&null!=a.absolutePoints&&0<a.absolutePoints.length){var e=[];e.push(a.absolutePoints[0]);var f=this.getEdgeStyle(a,b,c,d);if(null!=f){c=this.getTerminalPort(a,c,!0);d=this.getTerminalPort(a,d,!1);var g=this.updateBoundsFromStencil(c),k=this.updateBoundsFromStencil(d);f(a,c,d,b,e);null!=g&&c.setRect(g.x,g.y,g.width,g.height);null!=k&&d.setRect(k.x,k.y,k.width,k.height)}else if(null!=b)for(f=0;f<b.length;f++)null!=b[f]&&(c=mxUtils.clone(b[f]),+e.push(this.transformControlPoint(a,c)));b=a.absolutePoints;e.push(b[b.length-1]);a.absolutePoints=e}};mxGraphView.prototype.transformControlPoint=function(a,b,c){return null!=a&&null!=b?(a=a.origin,c=c?1:this.scale,new mxPoint(c*(b.x+this.translate.x+a.x),c*(b.y+this.translate.y+a.y))):null};mxGraphView.prototype.isLoopStyleEnabled=function(a,b,c,d){var e=this.graph.getConnectionConstraint(a,c,!0),f=this.graph.getConnectionConstraint(a,d,!1);return!(null==b||2>b.length)||mxUtils.getValue(a.style,mxConstants.STYLE_ORTHOGONAL_LOOP,!1)&&(null!=e&&null!=e.point||null!=f&&null!=f.point)?!1:null!=c&&c==d};mxGraphView.prototype.getEdgeStyle=function(a,b,c,d){a=this.isLoopStyleEnabled(a,b,c,d)?mxUtils.getValue(a.style,mxConstants.STYLE_LOOP,this.graph.defaultLoopStyle):mxUtils.getValue(a.style,mxConstants.STYLE_NOEDGESTYLE,!1)?null:a.style[mxConstants.STYLE_EDGE];"string"==typeof a&&(b=mxStyleRegistry.getValue(a),null==b&&this.isAllowEval()&&(b=mxUtils.eval(a)),a=b);return"function"==typeof a?a:null};mxGraphView.prototype.updateFloatingTerminalPoints=function(a,b,c){var d=a.absolutePoints,e=d[0];null==d[d.length-1]&&null!=c&&this.updateFloatingTerminalPoint(a,c,b,!1);null==e&&null!=b&&this.updateFloatingTerminalPoint(a,b,c,!0)};mxGraphView.prototype.updateFloatingTerminalPoint=function(a,b,c,d){a.setAbsoluteTerminalPoint(this.getFloatingTerminalPoint(a,b,c,d),d)};@@ -1222,7 +1222,8 @@ l),Math.round(f.y+q*f.height))]:[new mxPoint(Math.round(f.x+q*f.width),Math.rounmxGraph.prototype.getCurrentCellStyle=function(a,b){b=b?null:this.view.getState(a);return null!=b?b.style:this.getCellStyle(a)};mxGraph.prototype.getCellStyle=function(a,b){b=null!=b?b:!0;var c=this.model.getStyle(a),d=this.model.isEdge(a)?this.stylesheet.getDefaultEdgeStyle():this.stylesheet.getDefaultVertexStyle();null!=c&&0<c.length?d=this.stylesheet.getCellStyle(c,d,b):null!=d&&(d=mxUtils.clone(d));null==d?d={}:b&&(d=this.postProcessCellStyle(a,d));return d};mxGraph.prototype.postProcessCellStyle=function(a,b){if(null!=b){var c=b[mxConstants.STYLE_IMAGE];a=this.getImageFromBundles(c);null!=a?b[mxConstants.STYLE_IMAGE]=a:a=c;null!=a&&"function"===typeof a.substring&&"data:image/"==a.substring(0,11)&&("data:image/svg+xml,<"==a.substring(0,20)?a=a.substring(0,19)+encodeURIComponent(a.substring(19)):"data:image/svg+xml,%3C"!=a.substring(0,22)&&(c=a.indexOf(","),0<c&&";base64,"!=a.substring(c-7,c+1)&&(a=a.substring(0,c)+";base64,"+a.substring(c+1))),b[mxConstants.STYLE_IMAGE]=a)}return b};mxGraph.prototype.setCellStyle=function(a,b){b=b||this.getSelectionCells();if(null!=b){this.model.beginUpdate();try{for(var c=0;c<b.length;c++)this.model.setStyle(b[c],a)}finally{this.model.endUpdate()}}};mxGraph.prototype.toggleCellStyle=function(a,b,c){c=c||this.getSelectionCell();return this.toggleCellStyles(a,b,[c])};-mxGraph.prototype.toggleCellStyles=function(a,b,c){b=null!=b?b:!1;c=c||this.getEditableCells(this.getSelectionCells());var d=null;null!=c&&0<c.length&&(d=this.getCurrentCellStyle(c[0]),d=mxUtils.getValue(d,a,b)?0:1,this.setCellStyles(a,d,c));return d};mxGraph.prototype.setCellStyles=function(a,b,c){c=c||this.getEditableCells(this.getSelectionCells());mxUtils.setCellStyles(this.model,c,a,b)};mxGraph.prototype.toggleCellStyleFlags=function(a,b,c){this.setCellStyleFlags(a,b,null,c)};+mxGraph.prototype.toggleCellStyles=function(a,b,c){b=null!=b?b:!1;c=c||this.getEditableCells(this.getSelectionCells());var d=null;null!=c&&0<c.length&&(d=this.getCurrentCellStyle(c[0]),d=mxUtils.getValue(d,a,b)?0:1,this.setCellStyles(a,d,c));return d};+mxGraph.prototype.setCellStyles=function(a,b,c){c=c||this.getEditableCells(this.getSelectionCells());this.model.beginUpdate();try{mxUtils.setCellStyles(this.model,c,a,b);for(var d=0;d<c.length;d++){var e=this.view.getState(c[d]);null!=e&&null!=e.shape&&e.shape.styleChanged(a,b,e)}}finally{this.model.endUpdate()}};mxGraph.prototype.toggleCellStyleFlags=function(a,b,c){this.setCellStyleFlags(a,b,null,c)};mxGraph.prototype.setCellStyleFlags=function(a,b,c,d){d=d||this.getEditableCells(this.getSelectionCells());null!=d&&0<d.length&&(null==c&&(c=this.getCurrentCellStyle(d[0]),c=(parseInt(c[a]||0)&b)!=b),mxUtils.setCellStyleFlags(this.model,d,a,b,c))};mxGraph.prototype.getOriginForCell=function(a){a=this.model.getParent(a);for(var b=new mxPoint;null!=a;){var c=this.getCellGeometry(a);null==c||c.relative||(b.x+=c.x,b.y+=c.y);a=this.model.getParent(a)}return b};mxGraph.prototype.alignCells=function(a,b,c){null==b&&(b=this.getMovableCells(this.getSelectionCells()));if(null!=b&&1<b.length){if(null==c)for(var d=0;d<b.length;d++){var e=this.getOriginForCell(b[d]),f=this.getCellGeometry(b[d]);if(!this.model.isEdge(b[d])&&null!=f&&!f.relative)if(null==c)if(a==mxConstants.ALIGN_CENTER){c=e.x+f.x+f.width/2;break}else if(a==mxConstants.ALIGN_RIGHT)c=e.x+f.x+f.width;else if(a==mxConstants.ALIGN_TOP)c=e.y+f.y;else if(a==mxConstants.ALIGN_MIDDLE){c=e.y+f.y+f.height/2;break}else c=a==mxConstants.ALIGN_BOTTOM?e.y+f.y+f.height:e.x+f.x;else c=a==mxConstants.ALIGN_RIGHT?Math.max(c,e.x+f.x+f.width):a==mxConstants.ALIGN_TOP?Math.min(c,e.y+f.y):a==mxConstants.ALIGN_BOTTOM?Math.max(c,e.y+f.y+f.height):Math.min(c,e.x+f.x)}if(null!=c){b=mxUtils.sortCells(b);this.model.beginUpdate();try{for(d=0;d<b.length;d++)e=this.getOriginForCell(b[d]),f=this.getCellGeometry(b[d]),this.model.isEdge(b[d])||null==f||f.relative||(f=f.clone(),a==mxConstants.ALIGN_CENTER?f.x=c-e.x-f.width/@@ -1885,7 +1886,7 @@ mxObjectCodec.prototype.afterEncode=function(a,b,c){return c};mxObjectCodec.protmxObjectCodec.prototype.decodeAttributes=function(a,b,c){b=b.attributes;if(null!=b)for(var d=0;d<b.length;d++)this.decodeAttribute(a,b[d],c)};mxObjectCodec.prototype.isIgnoredAttribute=function(a,b,c){return"as"==b.nodeName||"id"==b.nodeName||"function"===typeof c[b.nodeName]};mxObjectCodec.prototype.decodeAttribute=function(a,b,c){if(!this.isIgnoredAttribute(a,b,c)){var d=b.nodeName;b=this.convertAttributeFromXml(a,b,c);var e=this.getFieldName(d);if(this.isReference(c,e,b,!1)){a=a.getObject(b);if(null==a){mxLog.warn("mxObjectCodec.decode: No object for "+this.getName()+"."+d+"="+b);return}b=a}this.isExcluded(c,d,b,!1)||(c[d]=b)}};mxObjectCodec.prototype.decodeChildren=function(a,b,c){for(b=b.firstChild;null!=b;){var d=b.nextSibling;b.nodeType!=mxConstants.NODETYPE_ELEMENT||this.processInclude(a,b,c)||this.decodeChild(a,b,c);b=d}};-mxObjectCodec.prototype.decodeChild=function(a,b,c){var d=this.getFieldName(b.getAttribute("as"));if(null==d||!this.isExcluded(c,d,b,!1)){var e=this.getFieldTemplate(c,d,b);"add"==b.nodeName?(a=b.getAttribute("value"),null==a&&mxObjectCodec.allowEval&&(a=mxUtils.eval(mxUtils.getTextContent(b)))):a=a.decode(b,e);try{this.addObjectValue(c,d,a,e)}catch(f){throw Error(f.message+" for "+b.nodeName);}}};+mxObjectCodec.prototype.decodeChild=function(a,b,c){var d=this.getFieldName(b.getAttribute("as"));if(null==d||!this.isExcluded(c,d,b,!1)){var e=this.getFieldTemplate(c,d,b);"add"==b.nodeName?(a=b.getAttribute("value"),null==a&&mxObjectCodec.allowEval&&(a=mxUtils.eval(mxUtils.getTextContent(b)))):a=a.decode(b,e);try{this.addObjectValue(c,d,a,e)}catch(f){throw Error(f.message+" "+b.nodeName+(null!=d?" as "+d:""));}}};mxObjectCodec.prototype.getFieldTemplate=function(a,b,c){a=a[b];a instanceof Array&&0<a.length&&(a=null);return a};mxObjectCodec.prototype.addObjectValue=function(a,b,c,d){if(null!=c&&c!=d)if(null!=b&&0<b.length)a[b]=c;else if(a.constructor===Array)a.push(c);else throw Error("Could not add object");};mxObjectCodec.prototype.processInclude=function(a,b,c){if("include"==b.nodeName){b=b.getAttribute("name");if(null!=b)try{var d=mxUtils.load(b).getDocumentElement();null!=d&&a.decode(d,c)}catch(e){}return!0}return!1};mxObjectCodec.prototype.beforeDecode=function(a,b,c){return b};mxObjectCodec.prototype.afterDecode=function(a,b,c){return c};mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]);a.isCellCodec=function(){return!0};a.isNumericAttribute=function(b,c,d){return"value"!==c.nodeName&&mxObjectCodec.prototype.isNumericAttribute.apply(this,arguments)};a.isExcluded=function(b,c,d,e){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||e&&"value"==c&&mxUtils.isNode(d)};a.afterEncode=function(b,c,d){if(null!=c.value&&mxUtils.isNode(c.value)){var e=@@ -2101,7 +2102,10 @@ EditorUi.prototype.hsplitClickEnabled=!1;EditorUi.prototype.updateDefaultStyle=!EditorUi.prototype.init=function(){var a=this.editor.graph;if(!a.standalone){"0"!=urlParams["shape-picker"]&&this.installShapePicker();mxEvent.addListener(a.container,"scroll",mxUtils.bind(this,function(){a.tooltipHandler.hide();null!=a.connectionHandler&&null!=a.connectionHandler.constraintHandler&&a.connectionHandler.constraintHandler.reset()}));a.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){a.tooltipHandler.hide();var f=a.getRubberband();null!=f&&f.cancel()}));mxEvent.addListener(a.container,"keydown",mxUtils.bind(this,function(f){this.onKeyDown(f)}));mxEvent.addListener(a.container,"keypress",mxUtils.bind(this,function(f){this.onKeyPress(f)}));this.addUndoListener();this.addBeforeUnloadListener();a.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()}));a.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()}));var b=a.setDefaultParent,e=this;this.editor.graph.setDefaultParent=function(){b.apply(this,arguments);e.updateActionStates()};a.showLinkDialog=mxUtils.bind(e,e.showLinkDialog);a.editLink=e.actions.get("editLink").funct;this.updateActionStates();this.initClipboard();this.initCanvas();null!=this.format&&this.format.init()}};EditorUi.prototype.clearSelectionState=function(){this.selectionState=null};EditorUi.prototype.getSelectionState=function(){null==this.selectionState&&(this.selectionState=this.createSelectionState());return this.selectionState};-EditorUi.prototype.createSelectionState=function(){for(var a=this.editor.graph,b=a.getSelectionCells(),e=this.initSelectionState(),f=!0,g=0;g<b.length;g++){var d=a.getCurrentCellStyle(b[g]);"0"!=mxUtils.getValue(d,mxConstants.STYLE_EDITABLE,"1")&&(this.updateSelectionStateForCell(e,b[g],b,f),f=!1)}this.updateSelectionStateForTableCells(e);return e};+EditorUi.prototype.createSelectionState=function(){for(var a=this.editor.graph,b=a.getSelectionCells(),e=this.initSelectionState(),f=!0,g=0;g<b.length;g++){var d=a.getCurrentCellStyle(b[g]);"0"!=mxUtils.getValue(d,mxConstants.STYLE_EDITABLE,"1")&&(this.updateSelectionStateForCell(e,b[g],b,f),f=!1)}this.updateSelectionStateForTableCells(e);if(Editor.enableCustomProperties&&null!=this.format){e.customProperties={};a=e.vertices;b=e.edges;for(g=0;g<a.length;g++)this.findCommonProperties(a[g],e.customProperties,+0==g,e);for(g=0;g<b.length;g++)this.findCommonProperties(b[g],e.customProperties,0==a.length&&0==g,e)}return e};+EditorUi.prototype.findCommonProperties=function(a,b,e,f){if(null!=b){var g=mxUtils.bind(this,function(h){if(null!=h)if(e)for(var m=0;m<h.length;m++){if("function"!==typeof h[m].isVisible||h[m].isVisible(f,this.format))b[h[m].name]=h[m]}else for(var q in b){var k=!1;for(m=0;m<h.length;m++)if(h[m].name==q&&h[m].type==b[q].type){k=!0;break}k||delete b[q]}}),d=this.editor.graph.view.getState(a);null!=d&&null!=d.shape&&(d.shape.commonCustomPropAdded||(d.shape.commonCustomPropAdded=!0,d.shape.customProperties=+d.shape.customProperties||[],d.cell.vertex?Array.prototype.push.apply(d.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(d.shape.customProperties,Editor.commonEdgeProperties)),g(d.shape.customProperties));a=a.getAttribute("customProperties");if(null!=a)try{g(JSON.parse(a))}catch(h){}}};EditorUi.prototype.initSelectionState=function(){return{vertices:[],edges:[],cells:[],x:null,y:null,width:null,height:null,style:{},containsImage:!1,containsLabel:!1,fill:!0,glass:!0,html:!0,rounded:!0,autoSize:!1,image:!1,shadow:!0,lineJumps:!0,resizable:!0,table:!1,cell:!1,row:!1,movable:!0,rotatable:!0,stroke:!0,swimlane:!1,unlocked:this.editor.graph.isEnabled(),connections:!1}};EditorUi.prototype.updateSelectionStateForTableCells=function(a){if(1<a.cells.length&&a.cell){var b=mxUtils.sortCells(a.cells),e=this.editor.graph.model,f=e.getParent(b[0]),g=e.getParent(f);if(null!=f&&null!=g){for(var d=f.getIndex(b[0]),h=g.getIndex(f),m=null,q=1,k=1,u=0,w=h<g.getChildCount()-1?e.getChildAt(e.getChildAt(g,h+1),d):null;u<b.length-1;){var z=b[++u];null==w||w!=z||null!=m&&q!=m||(m=q,q=0,k++,f=e.getParent(w),w=h+k<g.getChildCount()?e.getChildAt(e.getChildAt(g,h+k),d):null);var C=this.editor.graph.view.getState(z);if(z==e.getChildAt(f,d+q)&&null!=C&&1==mxUtils.getValue(C.style,"colspan",1)&&1==mxUtils.getValue(C.style,"rowspan",1))q++;else break}u==k*q-1&&(a.mergeCell=b[0],a.colspan=q,a.rowspan=k)}}};EditorUi.prototype.windowResized=function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor.graph&&this.editor.graph.sizeDidChange()}),0)};@@ -2374,10 +2378,10 @@ this.createVertexTemplateEntry("html=1;whiteSpace=wrap;shape=isoCube2;background120,20,"","Horizontal Crossbar",!1,null,"crossbar distance measure dimension unit"),this.createVertexTemplateEntry("shape=crossbar;whiteSpace=wrap;html=1;rounded=1;direction=south;",20,120,"","Vertical Crossbar",!1,null,"crossbar distance measure dimension unit"),this.createVertexTemplateEntry("shape=image;html=1;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=1;aspect=fixed;image="+this.gearImage,52,61,"","Image (Fixed Aspect)",!1,null,"fixed image icon symbol"),this.createVertexTemplateEntry("shape=image;html=1;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;image="+this.gearImage,50,60,"","Image (Variable Aspect)",!1,null,"strechted image icon symbol"),this.createVertexTemplateEntry("icon;html=1;image="+this.gearImage,60,60,"Icon","Icon",!1,null,"icon image symbol"),this.createVertexTemplateEntry("label;whiteSpace=wrap;html=1;image="+this.gearImage,140,60,"Label","Label 1",null,null,"label image icon symbol"),this.createVertexTemplateEntry("label;whiteSpace=wrap;html=1;align=center;verticalAlign=bottom;spacingLeft=0;spacingBottom=4;imageAlign=center;imageVerticalAlign=top;image="+this.gearImage,120,80,"Label","Label 2",null,null,"label image icon symbol"),this.addEntry("shape group container",function(){var f=new mxCell("Label",new mxGeometry(0,0,160,70),"html=1;whiteSpace=wrap;container=1;recursiveResize=0;collapsible=0;");f.vertex=!0;var g=new mxCell("",new mxGeometry(20,20,20,30),"triangle;html=1;whiteSpace=wrap;");g.vertex=!0;f.insert(g);return b.createVertexTemplateFromCells([f],f.geometry.width,f.geometry.height,"Shape Group")}),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;left=0;right=0;fillColor=none;",-120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;bottom=0;top=0;fillColor=none;",120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;bottom=0;right=0;fillColor=none;",120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;bottom=1;right=1;left=1;top=0;fillColor=none;routingCenterX=-0.5;",120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=waypoint;sketch=0;fillStyle=solid;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;rotatable=0;perimeter=centerPerimeter;snapToPoint=1;",-20,20,"","Waypoint"),this.createEdgeTemplateEntry("edgeStyle=segmentEdgeStyle;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;",50,50,"","Manual Line",null,"line lines connector connectors connection connections arrow arrows manual"),this.createEdgeTemplateEntry("shape=filledEdge;curved=0;rounded=0;fixDash=1;endArrow=none;strokeWidth=10;fillColor=#ffffff;edgeStyle=orthogonalEdgeStyle;html=1;",60,40,"","Filled Edge"),this.createEdgeTemplateEntry("edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;",-50,50,"","Horizontal Elbow",null,"line lines connector connectors connection connections arrow arrows elbow horizontal"),this.createEdgeTemplateEntry("edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;",50,50,"","Vertical Elbow",null,"line lines connector connectors connection connections arrow arrows elbow vertical")];this.addPaletteFunctions("misc",mxResources.get("misc"),null!=a?a:!0,e);this.setCurrentSearchEntryLibrary()};-Sidebar.prototype.addAdvancedPalette=function(a){this.setCurrentSearchEntryLibrary("general","advanced");this.addPaletteFunctions("advanced",mxResources.get("advanced"),null!=a?a:!1,this.createAdvancedShapes());this.setCurrentSearchEntryLibrary()};+120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;bottom=0;top=0;fillColor=none;",120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;bottom=0;right=0;fillColor=none;",120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;bottom=1;right=1;left=1;top=0;fillColor=none;routingCenterX=-0.5;",120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;fontColor=#000000;darkOpacity=0.05;fillColor=#FFF9B2;strokeColor=none;fillStyle=solid;direction=west;gradientDirection=north;gradientColor=#FFF2A1;shadow=1;size=20;pointerEvents=1;",+140,160,"",mxResources.get("note")),this.createVertexTemplateEntry("shape=waypoint;sketch=0;fillStyle=solid;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;rotatable=0;perimeter=centerPerimeter;snapToPoint=1;",20,20,"","Waypoint"),this.createEdgeTemplateEntry("edgeStyle=segmentEdgeStyle;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;",50,50,"","Manual Line",null,"line lines connector connectors connection connections arrow arrows manual"),this.createEdgeTemplateEntry("shape=filledEdge;curved=0;rounded=0;fixDash=1;endArrow=none;strokeWidth=10;fillColor=#ffffff;edgeStyle=orthogonalEdgeStyle;html=1;",+60,40,"","Filled Edge"),this.createEdgeTemplateEntry("edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;",50,50,"","Horizontal Elbow",null,"line lines connector connectors connection connections arrow arrows elbow horizontal"),this.createEdgeTemplateEntry("edgeStyle=elbowEdgeStyle;elbow=vertical;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;",50,50,"","Vertical Elbow",null,"line lines connector connectors connection connections arrow arrows elbow vertical")];+this.addPaletteFunctions("misc",mxResources.get("misc"),null!=a?a:!0,e);this.setCurrentSearchEntryLibrary()};Sidebar.prototype.addAdvancedPalette=function(a){this.setCurrentSearchEntryLibrary("general","advanced");this.addPaletteFunctions("advanced",mxResources.get("advanced"),null!=a?a:!1,this.createAdvancedShapes());this.setCurrentSearchEntryLibrary()};Sidebar.prototype.addBasicPalette=function(a){this.setCurrentSearchEntryLibrary("basic");this.addStencilPalette("basic",mxResources.get("basic"),a+"/basic.xml",";whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#000000;strokeWidth=2",null,null,null,null,[this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;top=0;bottom=0;fillColor=none;",120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;right=0;top=0;bottom=0;fillColor=none;routingCenterX=-0.5;",120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;bottom=0;right=0;fillColor=none;",120,60,"","Partial Rectangle"),this.createVertexTemplateEntry("shape=partialRectangle;whiteSpace=wrap;html=1;top=0;left=0;fillColor=none;",120,60,"","Partial Rectangle")]);this.setCurrentSearchEntryLibrary()};Sidebar.prototype.createAdvancedShapes=function(){var a=this,b=new mxCell("List Item",new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;");b.vertex=!0;return[this.createVertexTemplateEntry("shape=tapeData;whiteSpace=wrap;html=1;perimeter=ellipsePerimeter;",80,80,"","Tape Data"),this.createVertexTemplateEntry("shape=manualInput;whiteSpace=wrap;html=1;",@@ -2459,7 +2463,7 @@ q.x=(m.x-d.translate.x)/d.scale,q.y=(m.y-d.translate.y)/d.scale),d=g.defaultEdgef.width,f.y),!1)):e==mxConstants.DIRECTION_SOUTH?(f.height=d,f.y=q.y+q.height,f.setTerminalPoint(new mxPoint(f.x,f.y+f.height),!1)):e==mxConstants.DIRECTION_WEST&&(f.width=d,f.x=q.x-d,f.setTerminalPoint(new mxPoint(f.x,f.y),!1))):(!h&&45<f.width&&45<f.height&&45<q.width&&45<q.height&&(f.width*=q.height/f.height,f.height=q.height),f.x=q.x+q.width/2-f.width/2,f.y=q.y+q.height/2-f.height/2,e==mxConstants.DIRECTION_NORTH?f.y=f.y-q.height/2-f.height/2-d:e==mxConstants.DIRECTION_EAST?f.x=f.x+q.width/2+f.width/2+d:e==mxConstants.DIRECTION_SOUTH?f.y=f.y+q.height/2+f.height/2+d:e==mxConstants.DIRECTION_WEST&&(f.x=f.x-q.width/2-f.width/2-d),g.model.isEdge(b)&&null!=f.getTerminalPoint(!0)&&null!=b.getTerminal(!1)&&(q=g.getCellGeometry(b.getTerminal(!1)),null!=q&&(e==mxConstants.DIRECTION_NORTH?(f.x-=q.getCenterX(),f.y-=q.getCenterY()+q.height/2):e==mxConstants.DIRECTION_EAST?(f.x-=q.getCenterX()-q.width/2,f.y-=q.getCenterY()):e==mxConstants.DIRECTION_SOUTH?(f.x-=q.getCenterX(),f.y-=q.getCenterY()-q.height/2):e==mxConstants.DIRECTION_WEST&&(f.x-=q.getCenterX()+q.width/2,f.y-=q.getCenterY()))))));return f};Sidebar.prototype.isDropStyleEnabled=function(a,b){var e=!0;null!=b&&1==a.length&&(a=this.graph.getCellStyle(a[b]),null!=a&&(e=mxUtils.getValue(a,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!=mxConstants.NONE||mxUtils.getValue(a,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE)!=mxConstants.NONE));return e};-Sidebar.prototype.isDropStyleTargetIgnored=function(a){return this.graph.isSwimlane(a.cell)||this.graph.isTableCell(a.cell)||this.graph.isTableRow(a.cell)||this.graph.isTable(a.cell)};Sidebar.prototype.disablePointerEvents=function(a){mxUtils.visitNodes(a,mxUtils.bind(this,function(b){b.nodeType==mxConstants.NODETYPE_ELEMENT&&(b.style.pointerEvents="none",b.removeAttribute("pointer-events"))}))};+Sidebar.prototype.isDropStyleTargetIgnored=function(a){return this.graph.isSwimlane(a.cell)||this.graph.isTableCell(a.cell)||this.graph.isTableRow(a.cell)||this.graph.isTable(a.cell)};Sidebar.prototype.disablePointerEvents=function(a){mxUtils.visitNodes(a,mxUtils.bind(this,function(b){b.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=b.style&&(b.style.pointerEvents="none",b.removeAttribute("pointer-events"))}))};Sidebar.prototype.createDragSource=function(a,b,e,f,g,d){function h(ma,ya){var za=mxUtils.createImage(ma.src);za.style.width=ma.width+"px";za.style.height=ma.height+"px";null!=ya&&za.setAttribute("title",ya);mxUtils.setOpacity(za,ma==this.refreshTarget?30:20);za.style.position="absolute";za.style.cursor="crosshair";return za}function m(ma,ya,za,Ka){null!=Ka.parentNode&&(mxUtils.contains(za,ma,ya)?(mxUtils.setOpacity(Ka,100),M=Ka):mxUtils.setOpacity(Ka,Ka==O?30:20));return za}var q=this.editorUi,k=q.editor.graph,u=null,w=null,z=this;d=0;for(var C=this.livePreview,D=0;D<f.length&&C;D++)d+=k.model.getDescendants(f[D]).length,C=d<k.graphHandler.maxLivePreview;for(D=0;D<f.length&&(null==w&&k.model.isVertex(f[D])?w=D:null==u&&k.model.isEdge(f[D])&&null==k.model.getTerminal(f[D],!0)&&(u=D),null==w||null==u);D++);var E=this.isDropStyleEnabled(f,w),G=mxUtils.makeDraggable(a,k,mxUtils.bind(this,function(ma,ya,za,Ka,Pa){null!=this.updateThread&&window.clearTimeout(this.updateThread);if(null!=f&&null!=L&&M==O){var Ia=ma.isCellSelected(L.cell)?ma.getSelectionCells():[L.cell];ma.updateShapes(ma.model.isEdge(L.cell)?f[0]:f[w],Ia,!0);ma.setSelectionCells(Ia)}else null!=f&&null!=M&&null!=J&&M!=O?(Ia=ma.model.isEdge(J.cell)||null==u?w:u,ma.setSelectionCells(this.dropAndConnect(J.cell,f,ta,Ia,ya,w,u))):b.apply(this,arguments);null!=this.editorUi.hoverIcons&&this.editorUi.hoverIcons.update(ma.view.getState(ma.getSelectionCell()))}),e,0,0,k.autoscroll,!0,!0);C&&(G.createDragElement=mxUtils.bind(this,function(){return G.createPreviewElement(this.graph)}),@@ -3088,8 +3092,8 @@ U=Math.min(999,Math.max(1,isNaN(U)?1:U));if(U!=mxUtils.getValue(g.style,"width",this.addKeyHandler(u,E);this.addKeyHandler(w,E);var z=this.createPanel();z.style.paddingBottom="30px";h=document.createElement("div");h.style.position="absolute";h.style.width="70px";h.style.marginTop="4px";mxUtils.write(h,mxResources.get("lineend"));z.appendChild(h);var C=this.addUnitInput(z,this.getUnit(),87,52,function(){J.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit()),D=this.addUnitInput(z,this.getUnit(),16,52,function(){T.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());mxUtils.br(z);this.addLabel(z,mxResources.get("left"),87,64);this.addLabel(z,mxResources.get("top"),16,64);a.appendChild(z);this.addKeyHandler(C,E);this.addKeyHandler(D,E);var E=mxUtils.bind(this,function(L,U,V){g=e.getSelectionState();L=g.cells[0];if("link"==g.style.shape||"flexArrow"==g.style.shape){if(d.style.display="",V||document.activeElement!=m)V=mxUtils.getValue(g.style,"width",mxCellRenderer.defaultShapes.flexArrow.prototype.defaultWidth),m.value=V+" pt"}else d.style.display="none";1==g.cells.length&&f.model.isEdge(L)?(V=f.model.getGeometry(L),null!=V&&null!=V.sourcePoint&&null==f.model.getTerminal(L,!0)?(u.value=this.inUnit(V.sourcePoint.x)+" "+this.getUnit(),w.value=this.inUnit(V.sourcePoint.y)+" "+this.getUnit()):k.style.display="none",null!=V&&null!=V.targetPoint&&null==f.model.getTerminal(L,!1)?(C.value=this.inUnit(V.targetPoint.x)+" "+this.getUnit(),D.value=this.inUnit(V.targetPoint.y)+" "+this.getUnit()):z.style.display="none"):(k.style.display="none",z.style.display=-"none")});var G=this.addEdgeGeometryHandler(u,function(L,U){L.sourcePoint.x=b.fromUnit(U)});var I=this.addEdgeGeometryHandler(w,function(L,U){L.sourcePoint.y=b.fromUnit(U)});var J=this.addEdgeGeometryHandler(C,function(L,U){L.targetPoint.x=b.fromUnit(U)});var T=this.addEdgeGeometryHandler(D,function(L,U){L.targetPoint.y=b.fromUnit(U)});f.getModel().addListener(mxEvent.CHANGE,E);this.listeners.push({destroy:function(){f.getModel().removeListener(E)}});E()};-TextFormatPanel=function(a,b,e){BaseFormatPanel.call(this,a,b,e);this.init()};mxUtils.extend(TextFormatPanel,BaseFormatPanel);TextFormatPanel.prototype.init=function(){this.container.appendChild(this.addFont(this.createPanel()));this.container.appendChild(this.addFontOps(this.createPanel()))};TextFormatPanel.prototype.addFontOps=function(a){0==this.addActions(a,["removeFormat"])&&(a.style.display="none");return a};+"none")});var G=this.addEdgeGeometryHandler(u,function(L,U){null!=L.sourcePoint&&(L.sourcePoint.x=b.fromUnit(U))});var I=this.addEdgeGeometryHandler(w,function(L,U){null!=L.sourcePoint&&(L.sourcePoint.y=b.fromUnit(U))});var J=this.addEdgeGeometryHandler(C,function(L,U){null!=L.targetPoint&&(L.targetPoint.x=b.fromUnit(U))});var T=this.addEdgeGeometryHandler(D,function(L,U){null!=L.targetPoint&&(L.targetPoint.y=b.fromUnit(U))});f.getModel().addListener(mxEvent.CHANGE,E);this.listeners.push({destroy:function(){f.getModel().removeListener(E)}});+E()};TextFormatPanel=function(a,b,e){BaseFormatPanel.call(this,a,b,e);this.init()};mxUtils.extend(TextFormatPanel,BaseFormatPanel);TextFormatPanel.prototype.init=function(){this.container.appendChild(this.addFont(this.createPanel()));this.container.appendChild(this.addFontOps(this.createPanel()))};TextFormatPanel.prototype.addFontOps=function(a){0==this.addActions(a,["removeFormat"])&&(a.style.display="none");return a};TextFormatPanel.prototype.addFont=function(a){function b(p){p=null!=p?p.fontSize:null;return null!=p&&"px"==p.substring(p.length-2)?parseFloat(p):mxConstants.DEFAULT_FONTSIZE}function e(p,A){if(null!=p&&""!=p.textContent){p.style.lineHeight="";var B=mxUtils.getCurrentStyle(p);parseFloat(B.fontSize)*A/100!=parseFloat(B.lineHeight)?p.style.lineHeight=A+"%":""==p.getAttribute("style")&&p.removeAttribute("style")}}function f(p,A){A?p.classList.add("geActiveItem"):p.classList.remove("geActiveItem")}var g=this.editorUi,d=g.editor.graph,h=g.getSelectionState(),m=this.createTitle(mxResources.get("font"));a.appendChild(m);m=this.createPanel();m.className="geFormatEntry";if(d.cellEditor.isContentEditing()){var q=m.cloneNode(),k=g.toolbar.addMenu(g.menus.get("formatBlock"),mxResources.get("style"),null,q);this.addArrow(k);k.style.margin="0px";k.style.position="relative";k.classList.add("geFullWidthElement");a.appendChild(q)}a.appendChild(m);q=this.createPanel();var u=g.toolbar.addMenu(g.menus.get("fontFamily"),"Helvetica",null,m);this.addArrow(u);u.style.margin="0px";u.style.position="relative";u.classList.add("geFullWidthElement");k=m.cloneNode(!1);var w=g.toolbar.addItems(["bold","italic","underline"],k,!0,[Editor.boldImage,Editor.italicImage,Editor.underlineImage]);w[0].setAttribute("title",mxResources.get("bold")+" ("+g.actions.get("bold").shortcut+")");w[1].setAttribute("title",mxResources.get("italic")+" ("+g.actions.get("italic").shortcut+")");w[2].setAttribute("title",mxResources.get("underline")+@@ -3134,13 +3138,13 @@ za)p=parseFloat(mxUtils.getValue(h.style,mxConstants.STYLE_SPACING_TOP,0)),za.vamxConstants.STYLE_SPACING_LEFT,0)),Pa.value=isNaN(p)?"":this.inUnit(p)+" "+this.getUnit()});var cb=this.installInputHandler(Ka,mxConstants.STYLE_SPACING,2,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var fb=this.installInputHandler(za,mxConstants.STYLE_SPACING_TOP,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var pb=this.installInputHandler(Ha,mxConstants.STYLE_SPACING_RIGHT,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var gb=this.installInputHandler(Ia,mxConstants.STYLE_SPACING_BOTTOM,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var ab=this.installInputHandler(Pa,mxConstants.STYLE_SPACING_LEFT,0,-999,999,this.getUnit(" "),null,this.isFloatUnit(),!0);this.addKeyHandler(sa,Wa);this.addKeyHandler(Ka,Wa);this.addKeyHandler(za,Wa);this.addKeyHandler(Ha,Wa);this.addKeyHandler(Ia,Wa);this.addKeyHandler(Pa,Wa);d.getModel().addListener(mxEvent.CHANGE,Wa);this.listeners.push({destroy:function(){d.getModel().removeListener(Wa)}});Wa();if(d.cellEditor.isContentEditing()){var hb=null,eb=!1;m=mxUtils.bind(this,function(){eb||(eb=!0,window.setTimeout(mxUtils.bind(this,function(){var p=d.getSelectedEditingElement();if(null!=p&&null!=d.cellEditor.textarea){var A=function(Aa,Ga){if(null!=Aa&&null!=Ga){if(Aa==Ga)return!0;if(Aa.length>Ga.length+1)return Aa.substring(Aa.length-Ga.length-1,Aa.length)=="-"+Ga}return!1},B=function(Aa){if(null!=d.getParentByName(p,Aa,d.cellEditor.textarea))return!0;for(var Ga=p;null!=Ga&&1==Ga.childNodes.length;)if(Ga=Ga.childNodes[0],Ga.nodeName==Aa)return!0;-return!1},F=function(Aa){for(;null!=Aa&&Aa!=d.cellEditor.textarea;){if("block"==mxUtils.getCurrentStyle(Aa).display)return Aa;Aa=Aa.parentNode}return null},K=mxUtils.getCurrentStyle(p),R=p==d.cellEditor.textarea||""==p.style.lineHeight?null:p.style.lineHeight,Z=p==d.cellEditor.textarea||""==p.style.fontSize?null:b(K);if(window.getSelection)for(var ha=p.getElementsByTagName("*"),fa=window.getSelection(),ia=0;ia<ha.length&&(!fa.containsNode(ha[ia],!0)||(null==Z&&""!=ha[ia].style.fontSize&&(Z=parseFloat(ha[ia].style.fontSize)),-null==R&&""!=ha[ia].style.lineHeight&&(R=ha[ia].style.lineHeight),null==Z||null==R));ia++);null==Z&&(Z=b(K));if(null==R)for(ha=p;null!=ha&&ha!=d.cellEditor.textarea.parentNode;){if(null!=ha.style&&""!=ha.style.lineHeight){R=ha.style.lineHeight;break}ha=ha.parentNode}if(null!=K){f(w[0],"bold"==K.fontWeight||400<K.fontWeight||B("B")||B("STRONG"));f(w[1],"italic"==K.fontStyle||B("I")||B("EM"));f(w[2],"underline"==K.textDecorationLine||B("U"));f(U,"line-through"==K.textDecorationLine||B("STRIKE"));f(X,-B("SUP"));f(O,B("SUB"));var va=F(p);if(null!=va){B=function(Aa,Ga){Na.push({name:Aa,dispName:Ga,type:"string",getValue:function(){return Ma[Aa]},valueChanged:function(wa,ua){var Xa=va.style,Qa=wa;parseInt(Qa)==Qa&&(Qa+="px",null!=ua&&(ua.value=Qa));Xa[Aa]=Qa;""==wa&&null!=ua&&(ua.value=Ma[Aa])}})};var Ma=mxUtils.getCurrentStyle(va),Na=[];B("paddingTop","Padding Top");B("paddingRight","Padding Right");B("paddingLeft","Padding Left");B("paddingBottom","Padding Bottom");B("marginTop","Margin Top");B("marginRight",-"Margin Right");B("marginLeft","Margin Left");B("marginBottom","Margin Bottom");B=this.createPanel();this.addProperties(B,Na,h,!0);null!=hb?hb.parentNode.replaceChild(B,hb):a.appendChild(B);hb=B}d.cellEditor.isTableSelected()?(f(W,A(K.textAlign,"justify")),f(E,A(K.textAlign,"left")),f(G,A(K.textAlign,"center")),f(I,A(K.textAlign,"right"))):(B=d.cellEditor.align||mxUtils.getValue(h.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),A(K.textAlign,"justify")?(f(W,A(K.textAlign,"justify")),f(E,!1),-f(G,!1),f(I,!1)):(f(W,!1),f(E,B==mxConstants.ALIGN_LEFT),f(G,B==mxConstants.ALIGN_CENTER),f(I,B==mxConstants.ALIGN_RIGHT)));V=d.getParentByName(p,"TABLE",d.cellEditor.textarea);N=null==V?null:d.getParentByName(p,"TR",V);Q=null==V?null:d.getParentByNames(p,["TD","TH"],V);Va.style.display=null!=V?"":"none";document.activeElement!=sa&&(sa.value=isNaN(Z)?"":Z+" "+Editor.fontSizeUnit,"string"===typeof R&&0<R.indexOf("%")?Da.value=R.replace("%"," %"):(A=parseFloat(R),isNaN(A)?Da.value="120 %":Da.value=-Math.round(100*A)+" %"));null!=ba&&(la=d.getTextColor(p,!0),ba(la,!0));null!=Y&&(P=d.getTextColor(p,!1),Y(P,!0));g.toolbar.setMenuText(u,mxUtils.getCssFontFamily(K.fontFamily))}}eb=!1}),0))});(mxClient.IS_FF||mxClient.IS_EDGE||mxClient.IS_IE||mxClient.IS_IE11)&&mxEvent.addListener(d.cellEditor.textarea,"DOMSubtreeModified",m);mxEvent.addListener(d.cellEditor.textarea,"input",m);mxEvent.addListener(d.cellEditor.textarea,"touchend",m);mxEvent.addListener(d.cellEditor.textarea,"mouseup",m);mxEvent.addListener(d.cellEditor.textarea,-"keyup",m);this.listeners.push({destroy:function(){}});m()}return a};StyleFormatPanel=function(a,b,e){BaseFormatPanel.call(this,a,b,e);this.init()};mxUtils.extend(StyleFormatPanel,BaseFormatPanel);+return!1},F=function(Aa){for(;null!=Aa&&Aa!=d.cellEditor.textarea;){if("block"==mxUtils.getCurrentStyle(Aa).display)return Aa;Aa=Aa.parentNode}return null},K=mxUtils.getCurrentStyle(p),R=p==d.cellEditor.textarea||""==p.style.lineHeight?null:p.style.lineHeight,Z=p==d.cellEditor.textarea||""==p.style.fontSize?null:b(K);if(window.getSelection)for(var ha=p.getElementsByTagName("*"),fa=window.getSelection(),ia=0;ia<ha.length&&(!fa.containsNode(ha[ia],!0)||null==ha[ia].style||(null==Z&&""!=ha[ia].style.fontSize&&+(Z=parseFloat(ha[ia].style.fontSize)),null==R&&""!=ha[ia].style.lineHeight&&(R=ha[ia].style.lineHeight),null==Z||null==R));ia++);null==Z&&(Z=b(K));if(null==R)for(ha=p;null!=ha&&ha!=d.cellEditor.textarea.parentNode;){if(null!=ha.style&&""!=ha.style.lineHeight){R=ha.style.lineHeight;break}ha=ha.parentNode}if(null!=K){f(w[0],"bold"==K.fontWeight||400<K.fontWeight||B("B")||B("STRONG"));f(w[1],"italic"==K.fontStyle||B("I")||B("EM"));f(w[2],"underline"==K.textDecorationLine||B("U"));f(U,"line-through"==+K.textDecorationLine||B("STRIKE"));f(X,B("SUP"));f(O,B("SUB"));var va=F(p);if(null!=va){B=function(Aa,Ga){Na.push({name:Aa,dispName:Ga,type:"string",getValue:function(){return Ma[Aa]},valueChanged:function(wa,ua){var Xa=va.style,Qa=wa;parseInt(Qa)==Qa&&(Qa+="px",null!=ua&&(ua.value=Qa));Xa[Aa]=Qa;""==wa&&null!=ua&&(ua.value=Ma[Aa])}})};var Ma=mxUtils.getCurrentStyle(va),Na=[];B("paddingTop","Padding Top");B("paddingRight","Padding Right");B("paddingLeft","Padding Left");B("paddingBottom","Padding Bottom");+B("marginTop","Margin Top");B("marginRight","Margin Right");B("marginLeft","Margin Left");B("marginBottom","Margin Bottom");B=this.createPanel();this.addProperties(B,Na,h,!0);null!=hb?hb.parentNode.replaceChild(B,hb):a.appendChild(B);hb=B}d.cellEditor.isTableSelected()?(f(W,A(K.textAlign,"justify")),f(E,A(K.textAlign,"left")),f(G,A(K.textAlign,"center")),f(I,A(K.textAlign,"right"))):(B=d.cellEditor.align||mxUtils.getValue(h.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),A(K.textAlign,"justify")?+(f(W,A(K.textAlign,"justify")),f(E,!1),f(G,!1),f(I,!1)):(f(W,!1),f(E,B==mxConstants.ALIGN_LEFT),f(G,B==mxConstants.ALIGN_CENTER),f(I,B==mxConstants.ALIGN_RIGHT)));V=d.getParentByName(p,"TABLE",d.cellEditor.textarea);N=null==V?null:d.getParentByName(p,"TR",V);Q=null==V?null:d.getParentByNames(p,["TD","TH"],V);Va.style.display=null!=V?"":"none";document.activeElement!=sa&&(sa.value=isNaN(Z)?"":Z+" "+Editor.fontSizeUnit,"string"===typeof R&&0<R.indexOf("%")?Da.value=R.replace("%"," %"):(A=parseFloat(R),+isNaN(A)?Da.value="120 %":Da.value=Math.round(100*A)+" %"));null!=ba&&(la=d.getTextColor(p,!0),ba(la,!0));null!=Y&&(P=d.getTextColor(p,!1),Y(P,!0));g.toolbar.setMenuText(u,mxUtils.getCssFontFamily(K.fontFamily))}}eb=!1}),0))});(mxClient.IS_FF||mxClient.IS_EDGE||mxClient.IS_IE||mxClient.IS_IE11)&&mxEvent.addListener(d.cellEditor.textarea,"DOMSubtreeModified",m);mxEvent.addListener(d.cellEditor.textarea,"input",m);mxEvent.addListener(d.cellEditor.textarea,"touchend",m);mxEvent.addListener(d.cellEditor.textarea,+"mouseup",m);mxEvent.addListener(d.cellEditor.textarea,"keyup",m);this.listeners.push({destroy:function(){}});m()}return a};StyleFormatPanel=function(a,b,e){BaseFormatPanel.call(this,a,b,e);this.init()};mxUtils.extend(StyleFormatPanel,BaseFormatPanel);StyleFormatPanel.prototype.init=function(){var a=this.editorUi.getSelectionState();if(!a.containsLabel&&0<a.cells.length){a.containsImage&&1==a.vertices.length&&"image"==a.style.shape&&null!=a.style.image&&"data:image/svg+xml;"==String(a.style.image).substring(0,19)&&this.container.appendChild(this.addSvgStyles(this.createPanel()));a.fill&&this.container.appendChild(this.addFill(this.createPanel()));this.container.appendChild(this.addStroke(this.createPanel()));this.container.appendChild(this.addLineJumps(this.createPanel()));var b=this.createRelativeOption(mxResources.get("opacity"),mxConstants.STYLE_OPACITY);this.container.appendChild(b);this.container.appendChild(this.addEffects(this.createPanel()))}b=this.createPanel();1==a.cells.length&&(this.addEditOps(b),null!=b.firstChild&&mxUtils.br(b));1<=a.cells.length&&this.addStyleOps(b);null!=b.firstChild&&this.container.appendChild(b)};StyleFormatPanel.prototype.getCssRules=function(a){var b=document.implementation.createHTMLDocument(""),e=document.createElement("style");mxUtils.setTextContent(e,a);b.body.appendChild(e);return e.sheet.cssRules};@@ -3160,7 +3164,8 @@ mxConstants.DIRECTION_RADIAL];for(u=0;u<w.length;u++){var z=document.createElemeg.fill?"":"none";E=mxUtils.getValue(g.style,q,null);if(g.fill&&null!=E&&E!=mxConstants.NONE&&"filledEdge"!=g.style.shape){if("1"==g.style.sketch){if(2!=C){h.innerHTML="";C=2;for(E=0;E<Editor.roughFillStyles.length;E++){var I=document.createElement("option");I.setAttribute("value",Editor.roughFillStyles[E].val);mxUtils.write(I,Editor.roughFillStyles[E].dispName);h.appendChild(I)}h.value="auto"}}else 1!=C&&b();h.value=G;h.value||(G="auto",h.value=G);h.style.display="1"==g.style.sketch||"none"==d.style.display?"":"none";m.style.display=!g.gradient||g.containsImage||"1"==g.style.sketch&&"solid"!=G&&"auto"!=G?"none":""}else h.style.display="none",m.style.display="none"});f.getModel().addListener(mxEvent.CHANGE,D);this.listeners.push({destroy:function(){f.getModel().removeListener(D)}});D();mxEvent.addListener(d,"change",function(E){f.setCellStyles(mxConstants.STYLE_GRADIENT_DIRECTION,d.value,g.cells);e.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_GRADIENT_DIRECTION],"values",[d.value],"cells",g.cells));mxEvent.consume(E)});mxEvent.addListener(h,"change",function(E){f.setCellStyles("fillStyle",h.value,g.cells);e.fireEvent(new mxEventObject("styleChanged","keys",["fillStyle"],"values",[h.value],"cells",g.cells));mxEvent.consume(E)});a.appendChild(k);a.appendChild(m);k=this.getCustomColors();for(u=0;u<k.length;u++)a.appendChild(this.createCellColorOption(k[u].title,k[u].key,k[u].defaultValue));k=mxUtils.bind(this,function(E,G){if(null!=E){E=E.split(",");for(var I=0;I<E.length;I++){var J=-E[I].replace(/([a-z])([A-Z])/g,"$1 $2");a.appendChild(this.createCellColorOption(J.charAt(0).toUpperCase()+J.substring(1),E[I],"default",null,null,G))}}});k(g.style.fillColorStyles,f.shapeBackgroundColor);k(g.style.strokeColorStyles,f.shapeForegroundColor);return a};StyleFormatPanel.prototype.getCustomColors=function(){var a=[];this.editorUi.getSelectionState().swimlane&&a.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return a};+E[I].replace(/([a-z])([A-Z])/g,"$1 $2");a.appendChild(this.createCellColorOption(J.charAt(0).toUpperCase()+J.substring(1),E[I],"default",null,null,G))}}});k(g.style.fillColorStyles,f.shapeBackgroundColor);k(g.style.strokeColorStyles,f.shapeForegroundColor);return a};+StyleFormatPanel.prototype.getCustomColors=function(){var a=this.editorUi.getSelectionState(),b=[];if(null!=a.customProperties)for(var e in a.customProperties){var f=a.customProperties[e];null!=f&&"color"==f.type&&f.primary&&b.push({title:f.dispName,defaultValue:null==f.defVal?"#000000":f.defVal,key:f.name})}a.swimlane&&b.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return b};StyleFormatPanel.prototype.addStroke=function(a){function b(P){var ba=f.fromUnit(parseFloat(J.value));ba=Math.min(999,Math.max(0,isNaN(ba)?1:ba));ba!=mxUtils.getValue(h.style,mxConstants.STYLE_STROKEWIDTH,1)&&(d.setCellStyles(mxConstants.STYLE_STROKEWIDTH,ba,h.cells),g.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_STROKEWIDTH],"values",[ba],"cells",h.cells)));J.value=f.inUnit(ba)+" "+f.getUnit();mxEvent.consume(P)}function e(P){var ba=f.fromUnit(parseFloat(T.value));ba=Math.min(999,Math.max(0,isNaN(ba)?1:ba));ba!=mxUtils.getValue(h.style,mxConstants.STYLE_STROKEWIDTH,1)&&(d.setCellStyles(mxConstants.STYLE_STROKEWIDTH,ba,h.cells),g.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_STROKEWIDTH],"values",[ba],"cells",h.cells)));T.value=f.inUnit(ba)+" "+f.getUnit();mxEvent.consume(P)}var f=this,g=this.editorUi,d=g.editor.graph,h=g.getSelectionState(),m=document.createElement("div");m.className="geFormatEntry";h.stroke||(m.style.display="none");var q=document.createElement("select");q.style.position="absolute";q.style.left="72px";q.style.width="90px";for(var k=["sharp","rounded","curved"],u=0;u<k.length;u++){var w=document.createElement("option");w.setAttribute("value",k[u]);mxUtils.write(w,mxResources.get(k[u]));q.appendChild(w)}mxEvent.addListener(q,"change",function(P){d.getModel().beginUpdate();try{var ba=[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],la=["0","0"];"rounded"==q.value?la=["1","0"]:"curved"==q.value&&(la=["0","1"]);for(var Ja=0;Ja<ba.length;Ja++)d.setCellStyles(ba[Ja],@@ -3226,9 +3231,10 @@ d.style.left="72px";d.style.width="72px";g=["none","arc","gap","sharp","line"];fmxEvent.addListener(d,"click",function(w){mxEvent.consume(w)});a.appendChild(d);var q=this.addUnitInput(a,this.getUnit(),16,52,function(){k.apply(this,arguments)},this.getUnitStep(),null,null,this.isFloatUnit());var k=this.installInputHandler(q,"jumpSize",Graph.defaultJumpSize,0,999,this.getUnit(" "),null,this.isFloatUnit(),!0);var u=mxUtils.bind(this,function(w,z,C){f=b.getSelectionState();d.value=mxUtils.getValue(f.style,"jumpStyle","none");if(C||document.activeElement!=q)w=parseInt(mxUtils.getValue(f.style,"jumpSize",Graph.defaultJumpSize)),q.value=isNaN(w)?"":this.inUnit(w)+" "+this.getUnit()});this.addKeyHandler(q,u);e.getModel().addListener(mxEvent.CHANGE,u);this.listeners.push({destroy:function(){e.getModel().removeListener(u)}});u()}else a.style.display="none";return a};StyleFormatPanel.prototype.addEffects=function(a){var b=this.editorUi,e=b.editor.graph,f=b.getSelectionState(),g=document.createElement("table");g.className="geFullWidthElement";g.style.fontWeight="bold";g.style.tableLayout="fixed";var d=document.createElement("tbody"),h=document.createElement("tr");h.style.padding="0px";var m=document.createElement("td");m.style.padding="0px";m.style.width="50%";m.style.verticalAlign="top";var q=m.cloneNode(!0);q.style.paddingLeft="8px";h.appendChild(m);h.appendChild(q);-d.appendChild(h);g.appendChild(d);a.appendChild(g);var k=m,u=mxUtils.bind(this,function(z,C,D,E){z=this.createCellOption(z,C,D,null,null,E);z.style.alignItems="top";k.appendChild(z);k=k==m?q:m;return z}),w=mxUtils.bind(this,function(z,C,D){f=b.getSelectionState();m.innerText="";q.innerText="";k=m;f.rounded&&u(mxResources.get("rounded"),mxConstants.STYLE_ROUNDED,0);f.swimlane&&u(mxResources.get("divider"),"swimlaneLine",1);u(mxResources.get("sketch"),"sketch",0,function(E,G){e.updateCellStyles({sketch:G?-"1":null,curveFitting:G?Editor.sketchDefaultCurveFitting:null,jiggle:G?Editor.sketchDefaultJiggle:null},E)});f.glass&&u(mxResources.get("glass"),mxConstants.STYLE_GLASS,0);z=u(mxResources.get("shadow"),mxConstants.STYLE_SHADOW,0);Editor.enableShadowOption||(z.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),mxUtils.setOpacity(z,60));0<f.edges.length&&0==f.vertices.length&&u(mxResources.get("flowAnimation",null,"Flow Animation"),"flowAnimation",0)});e.getModel().addListener(mxEvent.CHANGE,-w);this.listeners.push({destroy:function(){e.getModel().removeListener(w)}});w();return a};StyleFormatPanel.prototype.addStyleOps=function(a){1==this.editorUi.getSelectionState().cells.length&&this.addActions(a,["setAsDefaultStyle"]);return a};DiagramStylePanel=function(a,b,e){BaseFormatPanel.call(this,a,b,e);this.init()};mxUtils.extend(DiagramStylePanel,BaseFormatPanel);DiagramStylePanel.prototype.init=function(){this.container.appendChild(this.addView(this.createPanel()))};+d.appendChild(h);g.appendChild(d);a.appendChild(g);var k=m,u=mxUtils.bind(this,function(z,C,D,E){z=this.createCellOption(z,C,D,null,null,E);z.style.alignItems="top";k.appendChild(z);k=k==m?q:m;return z}),w=mxUtils.bind(this,function(z,C,D){f=b.getSelectionState();m.innerText="";q.innerText="";k=m;f.rounded&&u(mxResources.get("rounded"),mxConstants.STYLE_ROUNDED,0);f.swimlane&&u(mxResources.get("divider"),"swimlaneLine",1);u(mxResources.get("sketch"),"sketch",0,function(G,I){e.updateCellStyles({sketch:I?+"1":null,curveFitting:I?Editor.sketchDefaultCurveFitting:null,jiggle:I?Editor.sketchDefaultJiggle:null},G)});f.glass&&u(mxResources.get("glass"),mxConstants.STYLE_GLASS,0);z=u(mxResources.get("shadow"),mxConstants.STYLE_SHADOW,0);Editor.enableShadowOption||(z.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),mxUtils.setOpacity(z,60));0<f.edges.length&&0==f.vertices.length&&u(mxResources.get("flowAnimation",null,"Flow Animation"),"flowAnimation",0);if(null!=f.customProperties)for(var E in f.customProperties)z=+f.customProperties[E],null!=z&&"bool"==z.type&&z.primary&&u(z.dispName,E,z.defVal?"1":"0")});e.getModel().addListener(mxEvent.CHANGE,w);this.listeners.push({destroy:function(){e.getModel().removeListener(w)}});w();return a};StyleFormatPanel.prototype.addStyleOps=function(a){1==this.editorUi.getSelectionState().cells.length&&this.addActions(a,["setAsDefaultStyle"]);return a};DiagramStylePanel=function(a,b,e){BaseFormatPanel.call(this,a,b,e);this.init()};mxUtils.extend(DiagramStylePanel,BaseFormatPanel);+DiagramStylePanel.prototype.init=function(){this.container.appendChild(this.addView(this.createPanel()))};DiagramStylePanel.prototype.getGlobalStyleButtons=function(){var a=this.editorUi,b=a.editor.graph,e=document.createElement("div");e.className="geFormatEntry";var f=document.createElement("input");f.setAttribute("type","checkbox");f.checked=Editor.sketchMode;e.appendChild(f);mxUtils.write(e,mxResources.get("sketch"));mxEvent.addListener(e,"click",function(d){if(b.isEnabled()){var h=!Editor.sketchMode;b.updateCellStyles({sketch:h?"1":null,curveFitting:h?Editor.sketchDefaultCurveFitting:null,jiggle:h?Editor.sketchDefaultJiggle:null},b.getVerticesAndEdges());a.setSketchMode(h);mxEvent.consume(d)}});e=[e,mxUtils.button(mxResources.get("rounded"),mxUtils.bind(this,function(d){var h=b.getVerticesAndEdges(),m=!0;if(0<h.length)for(var q=0;q<h.length;q++){var k=b.getCellStyle(h[q]);if(0==mxUtils.getValue(k,mxConstants.STYLE_ROUNDED,0)){m=!1;break}}m=!m;b.updateCellStyles({rounded:m?"1":"0"},h);m?(b.currentEdgeStyle.rounded="1",b.currentVertexStyle.rounded="1"):(delete b.currentEdgeStyle.rounded,delete b.currentVertexStyle.rounded);mxEvent.consume(d)}))];if(!b.isEnabled())for(f=0;f<e.length;f++)if("BUTTON"==e[f].nodeName)e[f].setAttribute("disabled","disabled");else{var g=e[f].getElementsByTagName("input");0<g.length&&g[0].setAttribute("disabled","disabled")}return e};@@ -3711,8 +3717,8 @@ Toolbar.prototype.destroy=function(){null!=this.gestureHandler&&(mxEvent.removeGJ=G*(1-E);D=G*(1-E*(I%2?D-I:1-(D-I)));switch(I){case 6:case 0:return[G,D,J];case 1:return[D,G,J];case 2:return[J,G,D];case 3:return[J,D,G];case 4:return[D,J,G];case 5:return[G,J,D]}}mxEventSource.call(this);var b=document.createElement("div");b.style.overflow="visible";b.style.position="relative";b.style.top="0px";b.style.left="0px";b.style.width="230px";b.style.height="114px";var e=document.createElement("div");e.style.border="1px solid light-dark(black, white)";e.style.backgroundImage="url("+this.hsImage+")";e.style.position="absolute";e.style.overflow="hidden";e.style.cursor="crosshair";e.style.width="181px";e.style.height="101px";e.style.left="6px";e.style.top="4px";var f=document.createElement("div");f.style.background="url("+this.crossImage+")";f.style.pointerEvents="none";f.style.position="absolute";f.style.width="15px";f.style.height="15px";f.style.left="-8px";f.style.top="-8px";var g=[0,0,1];e.appendChild(f);b.appendChild(e);sliderBox=document.createElement("div");sliderBox.style.position="absolute";sliderBox.style.cursor="pointer";sliderBox.style.width="38px";sliderBox.style.height="110px";sliderBox.style.left="199px";sliderBox.style.top="4px";var d=document.createElement("div");d.style.border="1px solid light-dark(black, white)";d.style.pointerEvents="none";d.style.overflow="hidden";d.style.position="absolute";d.style.width="16px";d.style.height="101px";d.style.left="9px";d.style.top="0px";var h=!1,m=!1,q=mxUtils.bind(this,function(D){var E=Math.round(100*(1-g[1]));f.style.left=-Math.round(g[0]/6*180)-8+"px";f.style.top=E-8+"px";E=d.childNodes;for(var G=a(g[0],g[1],1),I=0;I<E.length;I++)E[I].style.backgroundColor="rgb("+G[0]*(1-I/E.length)*255+", "+G[1]*(1-I/E.length)*255+", "+G[2]*(1-I/E.length)*255+")";C.style.top=Math.round(100*(1-g[2]))-4+"px";E=a(g[0],g[1],g[2]);E="#"+("0"+Math.round(255*E[0]).toString(16)).slice(-2)+("0"+Math.round(255*E[1]).toString(16)).slice(-2)+("0"+Math.round(255*E[2]).toString(16)).slice(-2);1!=D&&this.fireEvent(new mxEventObject("change","color",-mxUtils.rgba2hex(E)))}),k=mxUtils.bind(this,function(D){0==g[2]&&(g[2]=1);h=!0;w(D)}),u=mxUtils.bind(this,function(D){m=!0;w(D)}),w=mxUtils.bind(this,function(D){if(h){var E=e.getBoundingClientRect(),G=mxEvent.getClientX(D)-E.left;D=mxEvent.getClientY(D)-E.top;f.style.left=G-8+"px";f.style.top=D-8+"px";G*=6/180;D=1-D/100;E=void 0;0>G&&(G=0);6<G&&(G=6);0>D&&(D=0);1<D&&(D=1);0>E&&(E=0);1<E&&(E=1);G=a(null==G?g[0]:g[0]=G,null==D?g[1]:g[1]=D,null==E?g[2]:g[2]=E);this.fromString("#"+("0"+Math.floor(255*+Math.round(g[0]/6*180)-8+"px";f.style.top=E-8+"px";E=d.childNodes;var G=a(g[0],g[1],1);if(null!=G){for(var I=0;I<E.length;I++)E[I].style.backgroundColor="rgb("+G[0]*(1-I/E.length)*255+", "+G[1]*(1-I/E.length)*255+", "+G[2]*(1-I/E.length)*255+")";C.style.top=Math.round(100*(1-g[2]))-4+"px";E=a(g[0],g[1],g[2]);E="#"+("0"+Math.round(255*E[0]).toString(16)).slice(-2)+("0"+Math.round(255*E[1]).toString(16)).slice(-2)+("0"+Math.round(255*E[2]).toString(16)).slice(-2);1!=D&&this.fireEvent(new mxEventObject("change",+"color",mxUtils.rgba2hex(E)))}}),k=mxUtils.bind(this,function(D){0==g[2]&&(g[2]=1);h=!0;w(D)}),u=mxUtils.bind(this,function(D){m=!0;w(D)}),w=mxUtils.bind(this,function(D){if(h){var E=e.getBoundingClientRect(),G=mxEvent.getClientX(D)-E.left;D=mxEvent.getClientY(D)-E.top;f.style.left=G-8+"px";f.style.top=D-8+"px";G*=6/180;D=1-D/100;E=void 0;0>G&&(G=0);6<G&&(G=6);0>D&&(D=0);1<D&&(D=1);0>E&&(E=0);1<E&&(E=1);G=a(null==G?g[0]:g[0]=G,null==D?g[1]:g[1]=D,null==E?g[2]:g[2]=E);this.fromString("#"+("0"+Math.floor(255*G[0]).toString(16)).slice(-2)+("0"+Math.floor(255*G[1]).toString(16)).slice(-2)+("0"+Math.floor(255*G[2]).toString(16)).slice(-2))}else m&&(E=sliderBox.getBoundingClientRect(),D=mxEvent.getClientY(D)-E.top,g[2]=Math.max(Math.min(1,1-D/100),0),q())}),z=mxUtils.bind(this,function(){h=m=!1});mxEvent.addGestureListeners(e,k);mxEvent.addGestureListeners(sliderBox,u);mxEvent.addGestureListeners(b,null,w,z);mxEvent.addListener(b,"mouseleave",z);for(k=0;101>k;k+=4)u=document.createElement("div"),u.style.height="4px",u.style.pointerEvents="none",d.appendChild(u);b.appendChild(d);var C=document.createElement("div");C.style.background="url("+this.arrowImage+")";C.style.position="absolute";C.style.pointerEvents="none";C.style.width="7px";C.style.height="11px";C.style.left="2px";C.style.top="-3px";sliderBox.appendChild(C);sliderBox.appendChild(d);b.appendChild(sliderBox);this.fromString=function(D,E){E=null!=E?E:!1;if(null==D||""==D||mxUtils.isVarColor(D)||D==mxConstants.NONE)D="#ffffff",E=!0;var G=mxUtils.parseColor(D);D=G.r/255;var I=G.g/255,J=G.b/255,T=Math.min(Math.min(D,I),J);G=Math.max(Math.max(D,I),J);var L=G-T;0===L?D=[null,0,G]:(D=D===T?3+(J-I)/L:I===T?5+(D-J)/L:1+(I-D)/L,D=[6===D?0:D,L/G,G]);null!=D[0]&&(g[0]=D[0]);0!=D[2]&&(g[1]=D[1]);g[2]=D[2];q(E)};this.fromString("#ffffff");this.div=b};mxUtils.extend(ColorPicker,mxEventSource);ColorPicker.prototype.hsImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALUAAABlCAIAAACEDzXRAAAKQ0lEQVR42u2d23IjKwxFBeRh5v8/9uQlzXlI2gGELoCEm6pxubp6PI69WoV3C20uIQPAH4A/AH/p41/pDcTxP4BPGDtq3vYJGPpv8craeRdo/fyTI8ZhHnodOGgcV/3rnx8QI0SABO2xfAbiCfVR8Wj+CD8jenbRJNyGOxLoAaH1iLu4EUEHAv1+MsQ4zLE4AiIOcpibv4u9OET6+cP4ASnJ1JH4/G60A9km+GbBxLlpKAkADoR2JnaBrvWD/x1GCZn9EYLEHqVfI6Efx0D7E9tDF/rBSJ54l8FqTUse0J+EvxPrdK0fD4aOLXQi7zyGxMaRvvWjjH2U8o9I44OKnf+wyCpHoR/Phk6d/COq8481YrNI3/qR2B+kMl1Fl6J8o/JrU/GEA6HdiB2ha/0YBVx7rFwNHAj9JuIl6EI/qKyJug4Yvg7xA0QEpB8nQe8itoQu9EOT8M3mTsqUSUzykH6cBO1PbA9d91+ShDzV9xrtcgW21IT6L0yfcS90FKCdw+wS6Q9ISWjVfLTVVT2mdiPGGRduFKWm7dBStWlLmI0j/QExdgp7gT5qCu2BLKiLqtc94hI7PB8auQP4KuyIvSJ960fUqXWcd2F48Khr1bHSj2dDp/afmg7tMrFxpG/9mHMFuqrH3spFw0s0Bgr9OAzamdgFutaPpMuqo6WVEXWJdSL14xhof2J76MKfS2yXWGOVB1WXXGOVdxFSx587CXoLsTE0689RH7VW4RMLeKI9wPpzz4XeS2wDzdbXR52AWStjwiSAA6HdiB2h1f6cqT0whzzuzz0LejuxATTy90Xt40v7CzdGRvKS4O/zQ0AiXaRW5x/dv4vS4A/a308LYR5pFquRRvlHIrKWoCj5woCVId4eR/KPNDjURg2tdEC7rSQN5B9DYR70X5YivVxft7AyrOvrD4V2JnaBJurr+qpemLEywlRhT6qvPx16C7ExdK0fSjcj0maAzsqgBt7rfIxGP46B9iT2gi70I842bNj0U4wd/WAG/L5VP3p0W4iNoYv6Oh6eoJmSMW5laIzF8iT1TtgeV9RZoZ7QvdEUzsQu0CP+HOMKDFoZvDFg6s89CNqf2B5a4e8Hts84W0pgeohBtspBXYp8H3Tk/H23MBtHuvbn5mp7dlU9TUkP+XNJMabzHdCIbnuYDSItzZ+bdgUWrAwNPhwInRxw1/wXuYGj+4vo7flboRpjEQ6EjgojYK9/K04NFfNTauEBypXQWQLAfqQoHl9CfvpQ6C3ExtC9/q2YW2u6X1JWzfsYFPKX3L99LrQ/sT10XR+jKh+UN2AxlDOyXfLQaxxf/fkvT4d2JnaBZv258M6h4IFu2Em7/sezoLcQG0Mjfy6xrqLnVBLGWHw1i69WP5LCCn0TNEL3DLNXpCV/n5oo5jAVLY5Em6i8Pwm6uSNuCrNxpNX+nDira20qqyZriv384xhoZ2IX6Lr/wg8eiwpXYGQqPEgjsBrX+er3X46B9ie2h6bX/4i6IfcLS2mIY++7TfoCuLj6hwgN89CwBJ3Gx8rOVsn0kQ48tDS/4X1L8SzMb3BbkGdtwsD05AbP9YOU8xui+uljZei/P/3qx2HQbsSO0Ar/lveHLZYCVK4GeN1P5N+eAb2R2Aya9ueUY+8dlhLtdhWvgfEfz4AeGf9hR2wcaeTPpacvRdzLTx8J/Qq1Ij995PrJ3/mp0p8LO5YyF0s215g/9yxoZ2IXaLo+FiwtgTlvIAznp4+G3khsBk3Pf5mYvqOwMqZnNnw3i9cRDoT2JPaCZuvreskDuXkHxfQMvfbBgdBbiI2hC/3QLCg6lESZZkrfJ7nSj3gWNEMcRkYJsf5L0BXENBl1WV8/aquMLM9/eSJ0UtxZmFGGg4MigZ75ovHnvsOcUX09zRbzjCrU/K/Rev0gT2i2vu4cZrNI1+sH2e49Yb3lRC6e9fSS9ETohjj7hdkx0rQ/57/rxIrhBQdCv494Hlrtz1lo30Qjz1z+cRh02ndTNIMm1j8NxtmePs+76i+/esJHrH/6dGh/YntoRf9l2RtQWgJXzY4bdtbqx0OhnYldoHv7I79jf4+rOGGaRWr14yToLcTG0Ky/v32rjAsdX9S5vgI4ENqT2Asa7Z/9vq0yStiGNNVHkOe/RGmqwBQ0jEDHFpoJ85BLN+jPaRoHGWl2/2yx3msxVRHjZ0Td4GfV/Bf9bCM1dBiBfrHeJ1HR6dKEedDf5yPdBLilp/efC3Ribb1VxlUHGQe8iTb0598+Hdqf2B6a3b9SOerezsoIBWaJ3IBn1fp0j4PeQmwMzc5/idLK3UZWRkmKX2zA4Vc/DoPeSGwGrdvfY24RpKmVjrLuCQdCuxE7Qkv64TZ3Z44dVPrxUOh3EK9C1/lHGpz7ZzpVsYTF7K8Hyj+Ogd5FbAk9uL9H9LIyYg821sjo13gYtD+xPbRU/9Ds/b1sZTTIr5OStMGHA6GdiV2gUf2UmQcfJdUbXOoe6HoN1A0b2uQD4EBosXJqQTwKnXvXAEX+oZlfGaS9ewetDGCLeV1exH4e9Mr+2TDpv2iggYFW+LdBsTbngv/yUroGH0jleEX7MOgtxMbQ7PzKoMuajKyM8pYIiB194HnQzsQu0Gp/LvpulVHylsgK/TgG2p/YHrqXf6T3bJUBhfxFWUDPg95CbAytm/+ycasM9WOxWu0PnTniLWE2iLRi/4Z3bJXRvY76s0+Arl93I3aMNOHPBce2PdSkL7Kpnwe9l9gGutCPoFgkUtytXAGbex0vKCznSOs00o+ToLcQG0N/QErCrG6jrTIynVUDwo896vCzssPrNnAYtD+xPfR9fwmKeu/CVhm5OAn1STPkvhxBW1KXjeP60Y/DoJ2JXaAL/RCPy+PXc80L9d7OV294dVPbC/fb4EDoLcTG0IV+TCDrrIxMHIFg512BWj9OgvYk9oK+9SMoZG55q/JMiGS40/sLjacu28T3MVfd0Aha+u3QJXr+0Q//MBtHutaPQOzh3H0RBoZS5OJ/MjqJ9x2vQb7qgSuvX0StH0+FLptzrvTDh9gl0oV+iAbi2lAsqNmbK3yBAyLNdbRzW8Y6Btqf2B76A2IURE2zZY16KGfZlwqofJSL4feABka+xCNX+ekx0LuILaFr/Zit7s4ZA7y5Qg2sDr/t4zDodxCvQt/6occctDKGriMPzH85D9qN2BG61g/QwcLSVDSGl78C6LePY6A3EptBf0BKcjWWH/GqyJqoxKnMufEVBLJxAJwJ7U9sDH3fX0CxnIB4orMyuilTyRh6g+0bfDgQ2p/YHrrQD+jV6qb/SdRrMit8TRWwyEabxgFwJrQnsQt0rR+LR3VqFNiGHRBv73ge9EZiM+haPyicuRcVmIxzAMTMl9wfi3sGtBuxF3ShH92C29yJTteU+ohbRrZk3Qe9hdgY+tYPnOqanA+mTN33ZGKE06HQbsQu0LV+MF8+94rU5dK8B8/KyJaI+6D9ie2hC/3Q12QnSnYLn5p9P/6d0D7EltAh5wz/Hv8exON/LUjHOuz5CksAAAAASUVORK5CYII=";@@ -12281,10 +12287,10 @@ CreateGraphDialog.prototype.connectImage=new mxImage("data:image/png;base64,iVBOvar BackgroundImageDialog=function(b,f,m,d,t){function x(){null==q||q==mxConstants.NONE?(p.style.display="none",U.checked=!1):(p.style.backgroundColor=q,p.style.display="",U.checked=!0)}var v=b.editor.graph,B=document.createElement("div");B.style.whiteSpace="nowrap";var J=document.createElement("h2");mxUtils.write(J,mxResources.get("background"));J.style.marginTop="0px";B.appendChild(J);var N=null!=m&&null!=m.originalSrc;J=!1;var I=document.createElement("input");I.style.cssText="margin-right:8px;margin-bottom:8px;";I.setAttribute("value","url");I.setAttribute("type","radio");I.setAttribute("name","geBackgroundImageDialogOption");var c=document.createElement("input");c.style.cssText="margin-right:8px;margin-bottom:8px;";c.setAttribute("value","url");c.setAttribute("type","radio");c.setAttribute("name","geBackgroundImageDialogOption");var e=document.createElement("input");e.setAttribute("type","text");e.style.marginBottom="8px";e.style.width="360px";e.value=N||null==m?"":m.src;var g=document.createElement("select");g.style.width="360px";if(null!=b.pages)for(var l=0;l<b.pages.length;l++){var n=document.createElement("option");mxUtils.write(n,b.pages[l].getName()||mxResources.get("pageWithNumber",[l+1]));n.setAttribute("value","data:page/id,"+b.pages[l].getId());b.pages[l]==b.currentPage&&n.setAttribute("disabled","disabled");null!=m&&m.originalSrc==n.getAttribute("value")&&(n.setAttribute("selected","selected"),J=!0);g.appendChild(n)}N||null!=b.pages&&1!=b.pages.length||(I.style.display="none",c.style.display="none",g.style.display=-"none");var u=document.createElement("option"),z=!1,D=!1,C=function(E,H){z||null!=E&&D||(c.checked?null!=H&&H(u.selected?null:g.value):""==e.value||b.isOffline()?(Q.value="",S.value="",null!=H&&H("")):(e.value=mxUtils.trim(e.value),b.loadImage(e.value,function(M){Q.value=M.width;S.value=M.height;null!=H&&H(e.value)},function(){b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));Q.value="";S.value="";null!=H&&H(null)})))},A=mxUtils.bind(this,function(E){b.importFiles(E,-0,0,b.maxBackgroundSize,function(H,M,L,k,y,F){e.value=H;C();e.focus()},function(){},function(H){return"image/"==H.type.substring(0,6)},function(H){for(var M=0;M<H.length;M++)H[M]()},!0,b.maxBackgroundBytes,b.maxBackgroundBytes,!0)});this.init=function(){N?g.focus():e.focus();mxEvent.addListener(g,"focus",function(){I.removeAttribute("checked");c.setAttribute("checked","checked");c.checked=!0});mxEvent.addListener(e,"focus",function(){c.removeAttribute("checked");I.setAttribute("checked","checked");-I.checked=!0});if(Graph.fileSupport){e.setAttribute("placeholder",mxResources.get("dragImagesHere"));var E=B.parentNode,H=null;mxEvent.addListener(E,"dragleave",function(M){null!=H&&(H.parentNode.removeChild(H),H=null);M.stopPropagation();M.preventDefault()});mxEvent.addListener(E,"dragover",mxUtils.bind(this,function(M){null==H&&(!mxClient.IS_IE||10<document.documentMode)&&(H=b.highlightElement(E));M.stopPropagation();M.preventDefault()}));mxEvent.addListener(E,"drop",mxUtils.bind(this,function(M){null!=-H&&(H.parentNode.removeChild(H),H=null);if(0<M.dataTransfer.files.length)A(M.dataTransfer.files);else if(0<=mxUtils.indexOf(M.dataTransfer.types,"text/uri-list")){var L=M.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(L)&&(e.value=decodeURIComponent(L),C())}M.stopPropagation();M.preventDefault()}),!1)}};B.appendChild(I);B.appendChild(e);mxUtils.br(B);l=document.createElement("span");l.style.marginLeft="30px";mxUtils.write(l,mxResources.get("width")+":");B.appendChild(l);+"none");var u=document.createElement("option"),z=!1,D=!1,C=function(E,H){z||null!=E&&D||(c.checked?null!=H&&H(u.selected?null:g.value):""==e.value||b.isOffline()?(Q.value="",S.value="",null!=H&&H("")):(e.value=mxUtils.trim(e.value),b.loadImage(e.value,function(L){Q.value=L.width;S.value=L.height;null!=H&&H(e.value)},function(){b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));Q.value="";S.value="";null!=H&&H(null)})))},A=mxUtils.bind(this,function(E){b.importFiles(E,+0,0,b.maxBackgroundSize,function(H,L,K,k,y,F){e.value=H;C();e.focus()},function(){},function(H){return"image/"==H.type.substring(0,6)},function(H){for(var L=0;L<H.length;L++)H[L]()},!0,b.maxBackgroundBytes,b.maxBackgroundBytes,!0)});this.init=function(){N?g.focus():e.focus();mxEvent.addListener(g,"focus",function(){I.removeAttribute("checked");c.setAttribute("checked","checked");c.checked=!0});mxEvent.addListener(e,"focus",function(){c.removeAttribute("checked");I.setAttribute("checked","checked");+I.checked=!0});if(Graph.fileSupport){e.setAttribute("placeholder",mxResources.get("dragImagesHere"));var E=B.parentNode,H=null;mxEvent.addListener(E,"dragleave",function(L){null!=H&&(H.parentNode.removeChild(H),H=null);L.stopPropagation();L.preventDefault()});mxEvent.addListener(E,"dragover",mxUtils.bind(this,function(L){null==H&&(!mxClient.IS_IE||10<document.documentMode)&&(H=b.highlightElement(E));L.stopPropagation();L.preventDefault()}));mxEvent.addListener(E,"drop",mxUtils.bind(this,function(L){null!=+H&&(H.parentNode.removeChild(H),H=null);if(0<L.dataTransfer.files.length)A(L.dataTransfer.files);else if(0<=mxUtils.indexOf(L.dataTransfer.types,"text/uri-list")){var K=L.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(K)&&(e.value=decodeURIComponent(K),C())}L.stopPropagation();L.preventDefault()}),!1)}};B.appendChild(I);B.appendChild(e);mxUtils.br(B);l=document.createElement("span");l.style.marginLeft="30px";mxUtils.write(l,mxResources.get("width")+":");B.appendChild(l);var Q=document.createElement("input");Q.setAttribute("type","text");Q.style.width="60px";Q.style.marginLeft="8px";Q.style.marginRight="16px";Q.value=null==m||N?"":m.width;B.appendChild(Q);mxUtils.write(B,mxResources.get("height")+":");var S=document.createElement("input");S.setAttribute("type","text");S.style.width="60px";S.style.marginLeft="8px";S.style.marginRight="16px";S.value=null==m||N?"":m.height;B.appendChild(S);mxUtils.br(B);mxUtils.br(B);mxEvent.addListener(e,"change",C);ImageDialog.filePicked=function(E){E.action==google.picker.Action.PICKED&&null!=E.docs[0].thumbnails&&(E=E.docs[0].thumbnails[E.docs[0].thumbnails.length-1],null!=E&&(e.value=E.url,C()));e.focus()};B.appendChild(c);B.appendChild(g);mxUtils.br(B);mxUtils.br(B);N?(c.setAttribute("checked","checked"),c.checked=!0):(I.setAttribute("checked","checked"),I.checked=!0);!J&&c.checked&&(mxUtils.write(u,mxResources.get("pageNotFound")),u.setAttribute("disabled","disabled"),u.setAttribute("selected","selected"),u.setAttribute("value","pageNotFound"),g.appendChild(u),mxEvent.addListener(g,"change",function(){null==u.parentNode||u.selected||u.parentNode.removeChild(u)}));m=document.createElement("div");m.style.display=t?"inline-flex":"none";m.style.alignItems="center";m.style.cursor="default";m.style.minWidth="40%";m.style.height="20px";var U=document.createElement("input");U.setAttribute("type","checkbox");U.style.margin="0px 10px 0px 4px";U.style.verticalAlign="bottom";U.defaultChecked=d!=mxConstants.NONE&&null!=d;U.checked=U.defaultChecked;@@ -12292,12 +12298,12 @@ m.appendChild(U);mxUtils.write(m,mxResources.get("fillColor"));t=m.cloneNode(!1)var p=document.createElement("button");p.style.width="36px";p.style.height="18px";p.style.cursor="pointer";p.style.marginLeft="10px";p.style.backgroundPosition="center center";p.style.backgroundRepeat="no-repeat";p.style.verticalAlign="bottom";p.className="geColorBtn";var q=d;x();mxEvent.addListener(m,"click",function(E){mxEvent.getSource(E)!=U&&(U.checked=!U.checked);q=U.checked?"#ffffff":null;x()});mxEvent.addListener(p,"click",function(E){b.pickColor(q||"none",function(H){q=H;x()});mxEvent.consume(E)});m.appendChild(p);B.appendChild(m);B.appendChild(t);mxUtils.br(B);d=document.createElement("div");d.style.marginTop="30px";d.style.textAlign="right";v=mxUtils.button(mxResources.get("cancel"),function(){z=!0;b.hideDialog()});v.className="geBtn";b.editor.cancelFirst&&d.appendChild(v);t=mxUtils.button(mxResources.get("reset"),function(){e.value="";Q.value="";S.value="";I.checked=!0;q=mxConstants.NONE;x();z=!1});mxEvent.addGestureListeners(t,function(){z=!0});t.className="geBtn";t.width="100";d.appendChild(t);if(Graph.fileSupport){var G=document.createElement("input");G.setAttribute("multiple","multiple");G.setAttribute("type","file");mxEvent.addListener(G,"change",function(E){null!=G.files&&(A(G.files),G.type="",G.type="file",G.value="")});G.style.display="none";B.appendChild(G);t=mxUtils.button(mxResources.get("open"),function(){G.click()});t.className="geBtn";d.appendChild(t)}applyBtn=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();C(null,function(E){f(""!=E&&null!=E?new mxImage(E,-Q.value,S.value):null,null==E,q,!mxClient.IS_SVG||mxClient.IS_SF?null:O.checked)})});mxEvent.addGestureListeners(applyBtn,function(){D=!0});applyBtn.className="geBtn gePrimaryBtn";d.appendChild(applyBtn);b.editor.cancelFirst||d.appendChild(v);B.appendChild(d);this.container=B},ParseDialog=function(b,f,m){function d(g,l,n){var u=g.split("\n");if("plantUmlPng"==l||"plantUmlSvg"==l||"plantUmlTxt"==l){if(b.spinner.spin(document.body,mxResources.get("inserting"))){var z=function(L,k,y,F,K){x=mxEvent.isAltDown(n)?-x:D.getCenterInsertPoint(new mxRectangle(0,0,F,K));var P=null;D.getModel().beginUpdate();try{P="txt"==k?b.insertAsPreText(y,x.x,x.y):D.insertVertex(null,null,null,x.x,x.y,F,K,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+b.convertDataUri(y)+";"),D.setAttributeForCell(P,"plantUmlData",JSON.stringify({data:L,format:k},null,2))}finally{D.getModel().endUpdate()}null!=P&&(D.setSelectionCell(P),D.scrollCellToVisible(P))},D=b.editor.graph,C="plantUmlTxt"==l?"txt":"plantUmlPng"==+Q.value,S.value):null,null==E,q,!mxClient.IS_SVG||mxClient.IS_SF?null:O.checked)})});mxEvent.addGestureListeners(applyBtn,function(){D=!0});applyBtn.className="geBtn gePrimaryBtn";d.appendChild(applyBtn);b.editor.cancelFirst||d.appendChild(v);B.appendChild(d);this.container=B},ParseDialog=function(b,f,m){function d(g,l,n){var u=g.split("\n");if("plantUmlPng"==l||"plantUmlSvg"==l||"plantUmlTxt"==l){if(b.spinner.spin(document.body,mxResources.get("inserting"))){var z=function(K,k,y,F,M){x=mxEvent.isAltDown(n)?+x:D.getCenterInsertPoint(new mxRectangle(0,0,F,M));var P=null;D.getModel().beginUpdate();try{P="txt"==k?b.insertAsPreText(y,x.x,x.y):D.insertVertex(null,null,null,x.x,x.y,F,M,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+b.convertDataUri(y)+";"),D.setAttributeForCell(P,"plantUmlData",JSON.stringify({data:K,format:k},null,2))}finally{D.getModel().endUpdate()}null!=P&&(D.setSelectionCell(P),D.scrollCellToVisible(P))},D=b.editor.graph,C="plantUmlTxt"==l?"txt":"plantUmlPng"==l?"png":"svg";"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: Another authentication Response\n@enduml"==g&&"svg"==C?window.setTimeout(function(){b.spinner.stop();z(g,C,"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBjb250ZW50U2NyaXB0VHlwZT0iYXBwbGljYXRpb24vZWNtYXNjcmlwdCIgY29udGVudFN0eWxlVHlwZT0idGV4dC9jc3MiIGhlaWdodD0iMjEycHgiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiIHN0eWxlPSJ3aWR0aDoyOTVweDtoZWlnaHQ6MjEycHg7IiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAyOTUgMjEyIiB3aWR0aD0iMjk1cHgiIHpvb21BbmRQYW49Im1hZ25pZnkiPjxkZWZzLz48Zz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsgc3Ryb2tlLWRhc2hhcnJheTogNS4wLDUuMDsiIHgxPSIzMSIgeDI9IjMxIiB5MT0iMzQuNDg4MyIgeTI9IjE3MS43MzA1Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7IHN0cm9rZS1kYXNoYXJyYXk6IDUuMCw1LjA7IiB4MT0iMjY0LjUiIHgyPSIyNjQuNSIgeTE9IjM0LjQ4ODMiIHkyPSIxNzEuNzMwNSIvPjxyZWN0IGZpbGw9IiNGRUZFQ0UiIGhlaWdodD0iMzAuNDg4MyIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjU7IiB3aWR0aD0iNDciIHg9IjgiIHk9IjMiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIzMyIgeD0iMTUiIHk9IjIzLjUzNTIiPkFsaWNlPC90ZXh0PjxyZWN0IGZpbGw9IiNGRUZFQ0UiIGhlaWdodD0iMzAuNDg4MyIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjU7IiB3aWR0aD0iNDciIHg9IjgiIHk9IjE3MC43MzA1Ii8+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGxlbmd0aEFkanVzdD0ic3BhY2luZ0FuZEdseXBocyIgdGV4dExlbmd0aD0iMzMiIHg9IjE1IiB5PSIxOTEuMjY1NiI+QWxpY2U8L3RleHQ+PHJlY3QgZmlsbD0iI0ZFRkVDRSIgaGVpZ2h0PSIzMC40ODgzIiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuNTsiIHdpZHRoPSI0MCIgeD0iMjQ0LjUiIHk9IjMiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIyNiIgeD0iMjUxLjUiIHk9IjIzLjUzNTIiPkJvYjwvdGV4dD48cmVjdCBmaWxsPSIjRkVGRUNFIiBoZWlnaHQ9IjMwLjQ4ODMiIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS41OyIgd2lkdGg9IjQwIiB4PSIyNDQuNSIgeT0iMTcwLjczMDUiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIyNiIgeD0iMjUxLjUiIHk9IjE5MS4yNjU2Ij5Cb2I8L3RleHQ+PHBvbHlnb24gZmlsbD0iI0E4MDAzNiIgcG9pbnRzPSIyNTIuNSw2MS43OTg4LDI2Mi41LDY1Ljc5ODgsMjUyLjUsNjkuNzk4OCwyNTYuNSw2NS43OTg4IiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiLz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiIHgxPSIzMS41IiB4Mj0iMjU4LjUiIHkxPSI2NS43OTg4IiB5Mj0iNjUuNzk4OCIvPjx0ZXh0IGZpbGw9IiMwMDAwMDAiIGZvbnQtZmFtaWx5PSJzYW5zLXNlcmlmIiBmb250LXNpemU9IjEzIiBsZW5ndGhBZGp1c3Q9InNwYWNpbmdBbmRHbHlwaHMiIHRleHRMZW5ndGg9IjE0NyIgeD0iMzguNSIgeT0iNjEuMDU2NiI+QXV0aGVudGljYXRpb24gUmVxdWVzdDwvdGV4dD48cG9seWdvbiBmaWxsPSIjQTgwMDM2IiBwb2ludHM9IjQyLjUsOTEuMTA5NCwzMi41LDk1LjEwOTQsNDIuNSw5OS4xMDk0LDM4LjUsOTUuMTA5NCIgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7Ii8+PGxpbmUgc3R5bGU9InN0cm9rZTogI0E4MDAzNjsgc3Ryb2tlLXdpZHRoOiAxLjA7IHN0cm9rZS1kYXNoYXJyYXk6IDIuMCwyLjA7IiB4MT0iMzYuNSIgeDI9IjI2My41IiB5MT0iOTUuMTA5NCIgeTI9Ijk1LjEwOTQiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMyIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIxNTciIHg9IjQ4LjUiIHk9IjkwLjM2NzIiPkF1dGhlbnRpY2F0aW9uIFJlc3BvbnNlPC90ZXh0Pjxwb2x5Z29uIGZpbGw9IiNBODAwMzYiIHBvaW50cz0iMjUyLjUsMTIwLjQxOTksMjYyLjUsMTI0LjQxOTksMjUyLjUsMTI4LjQxOTksMjU2LjUsMTI0LjQxOTkiIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS4wOyIvPjxsaW5lIHN0eWxlPSJzdHJva2U6ICNBODAwMzY7IHN0cm9rZS13aWR0aDogMS4wOyIgeDE9IjMxLjUiIHgyPSIyNTguNSIgeTE9IjEyNC40MTk5IiB5Mj0iMTI0LjQxOTkiLz48dGV4dCBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0ic2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMyIgbGVuZ3RoQWRqdXN0PSJzcGFjaW5nQW5kR2x5cGhzIiB0ZXh0TGVuZ3RoPSIxOTkiIHg9IjM4LjUiIHk9IjExOS42Nzc3Ij5Bbm90aGVyIGF1dGhlbnRpY2F0aW9uIFJlcXVlc3Q8L3RleHQ+PHBvbHlnb24gZmlsbD0iI0E4MDAzNiIgcG9pbnRzPSI0Mi41LDE0OS43MzA1LDMyLjUsMTUzLjczMDUsNDIuNSwxNTcuNzMwNSwzOC41LDE1My43MzA1IiBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsiLz48bGluZSBzdHlsZT0ic3Ryb2tlOiAjQTgwMDM2OyBzdHJva2Utd2lkdGg6IDEuMDsgc3Ryb2tlLWRhc2hhcnJheTogMi4wLDIuMDsiIHgxPSIzNi41IiB4Mj0iMjYzLjUiIHkxPSIxNTMuNzMwNSIgeTI9IjE1My43MzA1Ii8+PHRleHQgZmlsbD0iIzAwMDAwMCIgZm9udC1mYW1pbHk9InNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTMiIGxlbmd0aEFkanVzdD0ic3BhY2luZ0FuZEdseXBocyIgdGV4dExlbmd0aD0iMjA5IiB4PSI0OC41IiB5PSIxNDguOTg4MyI+QW5vdGhlciBhdXRoZW50aWNhdGlvbiBSZXNwb25zZTwvdGV4dD48IS0tTUQ1PVs3ZjNlNGQwYzkwMWVmZGJjNTdlYjQ0MjQ5YTNiODE5N10KQHN0YXJ0dW1sDQpza2lucGFyYW0gc2hhZG93aW5nIGZhbHNlDQpBbGljZSAtPiBCb2I6IEF1dGhlbnRpY2F0aW9uIFJlcXVlc3QNCkJvYiAtIC0+IEFsaWNlOiBBdXRoZW50aWNhdGlvbiBSZXNwb25zZQ0KDQpBbGljZSAtPiBCb2I6IEFub3RoZXIgYXV0aGVudGljYXRpb24gUmVxdWVzdA0KQWxpY2UgPC0gLSBCb2I6IEFub3RoZXIgYXV0aGVudGljYXRpb24gUmVzcG9uc2UNCkBlbmR1bWwNCgpQbGFudFVNTCB2ZXJzaW9uIDEuMjAyMC4wMihTdW4gTWFyIDAxIDA0OjIyOjA3IENTVCAyMDIwKQooTUlUIHNvdXJjZSBkaXN0cmlidXRpb24pCkphdmEgUnVudGltZTogT3BlbkpESyBSdW50aW1lIEVudmlyb25tZW50CkpWTTogT3BlbkpESyA2NC1CaXQgU2VydmVyIFZNCkphdmEgVmVyc2lvbjogMTIrMzMKT3BlcmF0aW5nIFN5c3RlbTogTWFjIE9TIFgKRGVmYXVsdCBFbmNvZGluZzogVVRGLTgKTGFuZ3VhZ2U6IGVuCkNvdW50cnk6IFVTCi0tPjwvZz48L3N2Zz4=",-295,212)},200):b.generatePlantUmlImage(g,C,function(L,k,y){b.spinner.stop();z(g,C,L,k,y)},function(L){b.handleError(L)})}}else if("mermaid"==l||"mermaid2drawio"==l){if(b.spinner.spin(document.body,mxResources.get("inserting"))){for(var A=0;A<u.length&&(0==u[A].trim().length||"%%"==u[A].substring(0,2));)A++;if("---"==u[A].trim()){do A++;while(A<u.length&&"---"!=u[A].trim());A++}A=u[A].trim().toLowerCase();u=A.indexOf(" ");A=A.substring(0,0<u?u:A.length);var Q="undefined"!==typeof mxMermaidToDrawio&&-"mermaid2drawio"==l&&("graph"==A||"flowchart"==A||"sequencediagram"==A||"classdiagram"==A||"statediagram-v2"==A||"statediagram"==A||"erdiagram"==A||"requirementdiagram"==A||"gitgraph"==A||"mindmap"==A||"journey"==A);D=b.editor.graph;Q&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(L){b.spinner.stop();D.setSelectionCells(b.importXml(L,Math.max(x.x,20),Math.max(x.y,20),!0,null,null,!0));D.scrollCellToVisible(D.getSelectionCell())}));b.generateMermaidImage(g,null,function(L,k,y){if(!Q){x=-mxEvent.isAltDown(n)?x:D.getCenterInsertPoint(new mxRectangle(0,0,k,y));b.spinner.stop();var F=null;D.getModel().beginUpdate();try{F=D.insertVertex(null,null,null,x.x,x.y,k,y,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+L+";"),D.setAttributeForCell(F,"mermaidData",JSON.stringify({data:g},null,2))}finally{D.getModel().endUpdate()}null!=F&&(D.setSelectionCell(F),D.scrollCellToVisible(F))}},function(L){"undefined"!==typeof mxMermaidToDrawio&&mxMermaidToDrawio.resetListeners();b.handleError(L)})}}else if("table"==+295,212)},200):b.generatePlantUmlImage(g,C,function(K,k,y){b.spinner.stop();z(g,C,K,k,y)},function(K){b.handleError(K)})}}else if("mermaid"==l||"mermaid2drawio"==l){if(b.spinner.spin(document.body,mxResources.get("inserting"))){for(var A=0;A<u.length&&(0==u[A].trim().length||"%%"==u[A].substring(0,2));)A++;if("---"==u[A].trim()){do A++;while(A<u.length&&"---"!=u[A].trim());A++}A=u[A].trim().toLowerCase();u=A.indexOf(" ");A=A.substring(0,0<u?u:A.length);var Q="undefined"!==typeof mxMermaidToDrawio&&+"mermaid2drawio"==l&&("graph"==A||"flowchart"==A||"sequencediagram"==A||"classdiagram"==A||"statediagram-v2"==A||"statediagram"==A||"erdiagram"==A||"requirementdiagram"==A||"gitgraph"==A||"mindmap"==A||"journey"==A);D=b.editor.graph;Q&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(K){b.spinner.stop();D.setSelectionCells(b.importXml(K,Math.max(x.x,20),Math.max(x.y,20),!0,null,null,!0));D.scrollCellToVisible(D.getSelectionCell())}));b.generateMermaidImage(g,null,function(K,k,y){if(!Q){x=+mxEvent.isAltDown(n)?x:D.getCenterInsertPoint(new mxRectangle(0,0,k,y));b.spinner.stop();var F=null;D.getModel().beginUpdate();try{F=D.insertVertex(null,null,null,x.x,x.y,k,y,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+K+";"),D.setAttributeForCell(F,"mermaidData",JSON.stringify({data:g},null,2))}finally{D.getModel().endUpdate()}null!=F&&(D.setSelectionCell(F),D.scrollCellToVisible(F))}},function(K){"undefined"!==typeof mxMermaidToDrawio&&mxMermaidToDrawio.resetListeners();b.handleError(K)})}}else if("table"==l){l=null;var S=[],U=0,O={};for(A=0;A<u.length;A++){var p=mxUtils.trim(u[A]);if("primary key"==p.substring(0,11).toLowerCase()){var q=p.match(/\((.+)\)/);q&&q[1]&&(O[q[1]]=!0);u.splice(A,1)}else 0<p.toLowerCase().indexOf("primary key")&&(O[p.split(" ")[0]]=!0,u[A]=mxUtils.trim(p.replace(/primary key/i,"")))}for(A=0;A<u.length;A++)if(p=mxUtils.trim(u[A]),"create table"==p.substring(0,12).toLowerCase())p=mxUtils.trim(p.substring(12)),"("==p.charAt(p.length-1)&&(p=mxUtils.trim(p.substring(0,p.length-1))),l=new mxCell(p,new mxGeometry(U,0,160,30),"shape=table;startSize=30;container=1;collapsible=1;childLayout=tableLayout;fixedRows=1;rowLines=0;fontStyle=1;align=center;resizeLast=1;"),l.vertex=!0,S.push(l),p=b.editor.graph.getPreferredSizeForCell(G),null!=p&&(l.geometry.width=p.width+10);else if(null!=l&&")"==p.charAt(0))U+=l.geometry.width+40,l=null;else if("("!=p&&null!=l){p=p.substring(0,","==p.charAt(p.length-1)?p.length-1:p.length);q=O[p.split(" ")[0]];var G=new mxCell("",new mxGeometry(0,0,160,30),"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;fillColor=none;collapsible=0;dropTarget=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;strokeColor=inherit;top=0;left=0;right=0;bottom="+(q?"1":"0")+";");G.vertex=!0;var E=new mxCell(q?"PK":"",new mxGeometry(0,0,30,30),"shape=partialRectangle;overflow=hidden;connectable=0;fillColor=none;strokeColor=inherit;top=0;left=0;bottom=0;right=0;"+(q?"fontStyle=1;":""));E.vertex=!0;G.insert(E);p=new mxCell(p,new mxGeometry(30,@@ -12305,7 +12311,7 @@ l){l=null;var S=[],U=0,O={};for(A=0;A<u.length;A++){var p=mxUtils.trim(u[A]);if(!0)),D.setSelectionCells(D.importCells(S,x.x,x.y)),D.scrollCellToVisible(D.getSelectionCell()))}else if("list"==l){if(0<u.length){D=b.editor.graph;l=null;S=[];for(A=G=0;A<u.length;A++)";"!=u[A].charAt(0)&&(0==u[A].length?l=null:null==l?(l=new mxCell(u[A],new mxGeometry(G,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;"),l.vertex=!0,S.push(l),p=D.getPreferredSizeForCell(l),null!=p&&l.geometry.width<p.width+10&&(l.geometry.width=p.width+10),G+=l.geometry.width+40):"--"==u[A]?(p=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),p.vertex=!0,l.geometry.height+=p.geometry.height,l.insert(p)):0<u[A].length&&(U=new mxCell(u[A],new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"),U.vertex=!0,p=D.getPreferredSizeForCell(U),null!=p&&U.geometry.width<p.width&&(U.geometry.width=p.width),l.geometry.width=Math.max(l.geometry.width,U.geometry.width),l.geometry.height+=U.geometry.height,l.insert(U)));if(0<S.length){x=mxEvent.isAltDown(n)?x:D.getCenterInsertPoint(D.getBoundingBoxFromGeometry(S,!0));D.getModel().beginUpdate();try{S=D.importCells(S,x.x,x.y);p=[];for(A=0;A<S.length;A++)p.push(S[A]),p=p.concat(S[A].children);D.fireEvent(new mxEventObject("cellsInserted","cells",p))}finally{D.getModel().endUpdate()}D.setSelectionCells(S);-D.scrollCellToVisible(D.getSelectionCell())}}}else{G=function(L){var k=H[L];null==k&&(k=new mxCell(L,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),k.vertex=!0,H[L]=k,S.push(k));return k};var H={};S=[];for(A=0;A<u.length;A++)if(";"!=u[A].charAt(0)){var M=u[A].split("->");2<=M.length&&(q=G(M[0]),E=G(M[M.length-1]),M=new mxCell(2<M.length?M[1]:"",new mxGeometry),M.edge=!0,M.geometry.relative=!0,q.insertEdge(M,!0),E.insertEdge(M,!1),S.push(M))}if(0<S.length){u=document.createElement("div");u.style.visibility=+D.scrollCellToVisible(D.getSelectionCell())}}}else{G=function(K){var k=H[K];null==k&&(k=new mxCell(K,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),k.vertex=!0,H[K]=k,S.push(k));return k};var H={};S=[];for(A=0;A<u.length;A++)if(";"!=u[A].charAt(0)){var L=u[A].split("->");2<=L.length&&(q=G(L[0]),E=G(L[L.length-1]),L=new mxCell(2<L.length?L[1]:"",new mxGeometry),L.edge=!0,L.geometry.relative=!0,q.insertEdge(L,!0),E.insertEdge(L,!1),S.push(L))}if(0<S.length){u=document.createElement("div");u.style.visibility="hidden";document.body.appendChild(u);D=new Graph(u);D.getModel().beginUpdate();try{S=D.importCells(S);for(A=0;A<S.length;A++)D.getModel().isVertex(S[A])&&(p=D.getPreferredSizeForCell(S[A]),S[A].geometry.width=Math.max(S[A].geometry.width,p.width),S[A].geometry.height=Math.max(S[A].geometry.height,p.height));A=!0;"horizontalFlow"==l||"verticalFlow"==l?((new mxHierarchicalLayout(D,"horizontalFlow"==l?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH)).execute(D.getDefaultParent(),S),A=!1):"circle"==l?(new mxCircleLayout(D)).execute(D.getDefaultParent()):(U=new mxFastOrganicLayout(D),U.disableEdgeStyle=!1,U.forceConstant=180,U.execute(D.getDefaultParent()));A&&(O=new mxParallelEdgeLayout(D),O.spacing=30,O.execute(D.getDefaultParent()))}finally{D.getModel().endUpdate()}D.clearCellOverlays();p=[];b.editor.graph.getModel().beginUpdate();try{S=D.getModel().getChildren(D.getDefaultParent()),x=mxEvent.isAltDown(n)?x:b.editor.graph.getCenterInsertPoint(D.getBoundingBoxFromGeometry(S,!0)),p=b.editor.graph.importCells(S,x.x,x.y),b.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",p))}finally{b.editor.graph.getModel().endUpdate()}b.editor.graph.setSelectionCells(p);b.editor.graph.scrollCellToVisible(b.editor.graph.getSelectionCell());D.destroy();u.parentNode.removeChild(u)}}}function t(){return"list"==B.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean\n\nAddress\n-street: String\n-city: String\n-state: String":"mermaid"==B.value||@@ -12318,7 +12324,7 @@ J.setAttribute("value","table");mxUtils.write(J,mxResources.get("formatSql"));"f"plantUmlTxt");mxUtils.write(I,mxResources.get("plantUml")+" ("+mxResources.get("text")+")");EditorUi.enablePlantUml&&Graph.fileSupport&&!b.isOffline()&&"plantUml"==m&&(B.appendChild(J),B.appendChild(N),B.appendChild(I));var e=t();v.value=e;f.appendChild(v);this.init=function(){v.focus()};Graph.fileSupport&&(v.addEventListener("dragover",function(g){g.stopPropagation();g.preventDefault()},!1),v.addEventListener("drop",function(g){g.stopPropagation();g.preventDefault();if(0<g.dataTransfer.files.length){g=g.dataTransfer.files[0];var l=new FileReader;l.onload=function(n){v.value=n.target.result};l.readAsText(g)}},!1));f.appendChild(B);mxEvent.addListener(B,"change",function(){var g=t();if(0==v.value.length||v.value==e)e=g,v.value=e});b.isOffline()||"mermaid"!=m&&"plantUml"!=m||(J=mxUtils.button(mxResources.get("help"),function(){b.openLink("mermaid"==m?"https://mermaid-js.github.io/mermaid/#/":"https://plantuml.com/")}),J.className="geBtn",f.appendChild(J));J=mxUtils.button(mxResources.get("close"),function(){v.value==e?b.hideDialog():b.confirm(mxResources.get("areYouSure"),function(){b.hideDialog()})});J.className="geBtn";b.editor.cancelFirst&&f.appendChild(J);N=mxUtils.button(mxResources.get("insert"),function(g){try{b.hideDialog(),d(v.value,B.value,g)}catch(l){b.handleError(l)}});N.className="geBtn gePrimaryBtn";f.appendChild(N);b.editor.cancelFirst||f.appendChild(J);this.container=f},NewDialog=function(b,f,m,d,t,x,v,B,J,N,I,c,e,g,l,n,u,z){function D(ja){null!=ja&&(ra=oa=ja?135:140);ja=!0;-if(null!=Va)for(;L<Va.length&&(ja||0!=mxUtils.mod(L,30));){var sa=Va[L++];sa=q(sa.url,sa.libs,sa.title,sa.tooltip?sa.tooltip:sa.title,sa.select,sa.imgUrl,sa.info,sa.onClick,sa.preview,sa.noImg,sa.clibs,sa.type);ja&&sa.click();ja=!1}}function C(ja,sa,na,pa,qa,ta){if(null!=ja&&mxUtils.isAncestorNode(document.body,pa)){ja=mxUtils.parseXml(ja);ja=Editor.parseDiagramNode(ja.documentElement,null,!0);var Fa=new mxCodec(ja.ownerDocument),Ia=new mxGraphModel;Fa.decode(ja,Ia);b.sidebar.createTooltip(pa,Ia.root.children,+if(null!=Va)for(;K<Va.length&&(ja||0!=mxUtils.mod(K,30));){var sa=Va[K++];sa=q(sa.url,sa.libs,sa.title,sa.tooltip?sa.tooltip:sa.title,sa.select,sa.imgUrl,sa.info,sa.onClick,sa.preview,sa.noImg,sa.clibs,sa.type);ja&&sa.click();ja=!1}}function C(ja,sa,na,pa,qa,ta){if(null!=ja&&mxUtils.isAncestorNode(document.body,pa)){ja=mxUtils.parseXml(ja);ja=Editor.parseDiagramNode(ja.documentElement,null,!0);var Fa=new mxCodec(ja.ownerDocument),Ia=new mxGraphModel;Fa.decode(ja,Ia);b.sidebar.createTooltip(pa,Ia.root.children,Math.min((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-120,1E3),Math.min((window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-120,800),null!=qa?mxResources.get(qa):null,!0,new mxPoint(sa,na),!0,function(){R=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display;null!=ta&&S(pa,null,null,ta,infoObj,clibs)},!0,!1)}}function A(){var ja=document.createElement("div");ja.style.position="absolute";ja.style.overflow="visible";ja.style.left="8px";ja.style.right="8px";ja.style.bottom="8px";ja.style.top="8px";mxUtils.write(ja,mxResources.get("describeYourDiagram")+":");mxUtils.br(ja);var sa=document.createElement("input");sa.setAttribute("type","text");sa.setAttribute("placeholder",mxResources.get("processForHiringNewEmployee"));sa.style.width="100%";sa.style.marginTop="6px";sa.style.marginBottom="4px";sa.style.boxSizing="border-box";ja.appendChild(sa);ja.init=function(){sa.focus()};mxUtils.br(ja);var na=document.createElement("div");na.style.top="86px";na.style.left="2px";na.style.right="2px";na.style.bottom="2px";na.style.position="absolute";na.style.border="1px solid #424242";var pa=document.createElement("div");pa.style.boxSizing="border-box";pa.style.position="relative";pa.style.textAlign="center";pa.style.top="50%";mxUtils.write(pa,mxResources.get("blankDiagram"));na.appendChild(pa);var qa=document.createElement("select");qa.className="geBtn";qa.style.maxWidth="160px";qa.style.marginLeft="0px";pa=document.createElement("option");@@ -12328,55 +12334,55 @@ Ia);qa.appendChild(pa)}var Ja=mxUtils.button(mxResources.get("generate"),functio1);Ya.style.cursor="pointer";Ya.style.width="100%";Ya.style.height="100%";na.appendChild(Ya);Oa=b.createMermaidXml(Oa,EditorUi.defaultMermaidConfig,Ha,$a,Za,La);var gb="<mxfile><diagram>"+Graph.compress(Oa)+"</diagram></mxfile>";if(Xa||"undefined"===typeof mxMermaidToDrawio)ca=ba=Oa;Oa=F.cloneNode(!0);na.appendChild(Oa);Ha=function(eb){R=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display};$a=function(eb){R||C(gb,mxEvent.getClientX(eb),mxEvent.getClientY(eb),Ya,La)};mxEvent.addGestureListeners(Ya,Ha,null,$a);mxEvent.addGestureListeners(Oa,Ha,null,$a)},function(Oa){b.spinner.stop();null!=mxMermaidToDrawio.resetListeners&&mxMermaidToDrawio.resetListeners();b.handleError(Oa)})});Ja.setAttribute("disabled","disabled");Ja.className="geBtn gePrimaryBtn";pa=function(){window.setTimeout(function(){""!=sa.value?Ja.removeAttribute("disabled"):Ja.setAttribute("disabled","disabled")},0)};ta=urlParams["smart-template"];null!=ta&&"1"!=ta&&(sa.value=decodeURIComponent(ta),pa(),"1"==urlParams["smart-template-generate"]&&window.setTimeout(function(){Ja.click()},0));mxEvent.addListener(sa,"change",pa);mxEvent.addListener(sa,"keydown",pa);mxEvent.addListener(sa,"cut",pa);mxEvent.addListener(sa,"paste",pa);mxEvent.addListener(sa,"keydown",function(Na){13==Na.keyCode&&Ja.click()});pa=document.createElement("div");pa.style.height="40px";pa.style.marginTop="4px";pa.style.marginBottom="4px";pa.style.whiteSpace="nowrap";pa.style.overflowX="auto";pa.style.overflowY="hidden";pa.appendChild(qa);pa.appendChild(Ja);ja.appendChild(pa);-ja.appendChild(na);return ja}function Q(){null!=ba&&ba==ca&&EditorUi.logEvent({category:"OPENAI-DIAGRAM",action:"templateGenerated",label:Ba});if(aa&&null!=g)m||b.hideDialog(),g(aa,fa,M.value);else if(d)m||b.hideDialog(),d(ba,M.value,ia,ea);else{var ja=M.value;if(null!=ja&&0<ja.length){var sa=function(pa,qa,ta){b.createFile(ta,ba,null!=ea&&0<ea.length?ea:null,pa,function(){b.hideDialog()},null,qa,null,null!=ka&&0<ka.length?ka:null)};if(b.mode==App.MODE_GOOGLE||b.mode==App.MODE_ONEDRIVE){var na=new SaveDialog(b,+ja.appendChild(na);return ja}function Q(){null!=ba&&ba==ca&&EditorUi.logEvent({category:"OPENAI-DIAGRAM",action:"templateGenerated",label:Ba});if(aa&&null!=g)m||b.hideDialog(),g(aa,fa,L.value);else if(d)m||b.hideDialog(),d(ba,L.value,ia,ea);else{var ja=L.value;if(null!=ja&&0<ja.length){var sa=function(pa,qa,ta){b.createFile(ta,ba,null!=ea&&0<ea.length?ea:null,pa,function(){b.hideDialog()},null,qa,null,null!=ka&&0<ka.length?ka:null)};if(b.mode==App.MODE_GOOGLE||b.mode==App.MODE_ONEDRIVE){var na=new SaveDialog(b,ja,mxUtils.bind(this,function(pa,qa,ta){sa(qa,ta,pa.value)}),null,null,null,null,b.mode);b.showDialog(na.container,420,150,!0,!1);na.init()}else b.pickFolder(b.mode,function(pa){sa(b.mode,pa,ja)},b.mode!=App.MODE_GOOGLE||null==b.stateArg||null==b.stateArg.folderId)}}}function S(ja,sa,na,pa,qa,ta,Fa){return ha!=ja?(null!=ha&&(ha.classList.remove("geTemplateSelected"),ha==Ea&&(ya.style.display="none",za.style.display="",Da.style.visibility="hidden",Ka.style.visibility=null!=ca?"visible":"hidden")),ja==Ea&&(sa=ca,null!=sa?(Ka.style.visibility="visible",Ka.style.visibility=null!=ca?"visible":"hidden",Da.style.visibility="visible"):(ya.style.display="",Da.style.visibility="hidden",Ka.style.visibility="hidden")),y.removeAttribute("disabled"),ba=sa,ea=na,ka=ta,ha=ja,aa=pa,ia=Fa,fa=qa,ha.classList.add("geTemplateSelected"),!0):!1}function U(){ya.style.display="";za.style.display="none";Da.style.visibility="hidden";Ka.style.visibility="hidden";Ga.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?Ga.select():document.execCommand("selectAll",!1,null)}function O(){za.style.backgroundImage=va;za.style.backgroundSize="contain";ya.style.display="none";za.style.display="";Da.style.visibility="visible";Ka.style.visibility="visible"}function p(ja){var sa=mxUtils.trim(Ga.value);if(ja||""==sa)null!=Ba&&(Ga.value=Ba,O());else{var na=!1;ja='Write a detailed and complex MermaidJS declaration for "'+(""!=sa?sa:"something random")+'" using correct MermaidJS syntax and do not provide additional text in your response.';"undefined"!==typeof mxMermaidToDrawio&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(pa){pa!=b.emptyDiagramXml&&(na=!0,ba=pa)}));za.style.backgroundImage="url("+Editor.spinImage+")";za.style.backgroundSize="12px 12px";za.style.display="";ya.style.display="none";b.generateOpenAiMermaidDiagram(ja,function(pa,qa,ta,Fa){ha==Ea&&"none"==ya.style.display&&(va="url(data:image/svg+xml;base64,"+qa.substring(qa.indexOf(",")+1)+")",Ea.setAttribute("title",sa),Ka.style.display="",ca=ba=pa=na?ba:b.createMermaidXml(pa,EditorUi.defaultMermaidConfig,qa,ta,Fa,sa),Ba=sa,O())},function(pa){ha==Ea&&(ya.style.display="",Da.style.visibility="visible",Ka.style.visibility="hidden",b.handleError(pa))})}}function q(ja,sa,na,pa,qa,ta,Fa,Ia,Ja,Na,Pa,Xa){function La(Qa,bb){null==$a?(Za=Qa,Za=/^https?:\/\//.test(Za)?b.editor.isCorsEnabledForUrl(Za)?Za:PROXY_URL+"?url="+encodeURIComponent(Za):TEMPLATE_PATH+"/"+Za,mxUtils.get(Za,mxUtils.bind(this,function(cb){200<=cb.getStatus()&&299>=cb.getStatus()&&($a=cb.getText());bb($a,Za)}))):-bb($a,Za)}function Oa(Qa,bb){if(null==ja||K||b.sidebar.currentElt==Ha)b.sidebar.hideTooltip();else if(b.sidebar.hideTooltip(),null!=P){var cb="<mxfile><diagram>"+Graph.compress('<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="2" value="" style="shape=image;image='+P.src+';imageAspect=1;" parent="1" vertex="1"><mxGeometry width="'+P.naturalWidth+'" height="'+P.naturalHeight+'" as="geometry" /></mxCell></root></mxGraphModel>')+"</diagram></mxfile>";C(cb,mxEvent.getClientX(Qa),-mxEvent.getClientY(Qa),na,ja)}else b.sidebar.currentElt=Ha,K=!0,La(ja,function(ib){if(K&&b.sidebar.currentElt==Ha)try{C(ib,mxEvent.getClientX(Qa),mxEvent.getClientY(Qa),Ha,bb)}catch(jb){b.sidebar.currentElt=null,b.handleError(jb)}K=!1})}var Ha=null;if("generative"!=Xa||null==Ea){Ha=document.createElement("div");Ha.className="geTemplate";var $a=null,Za=ja;null!=na?Ha.setAttribute("title",mxResources.get(na,null,na)):null!=pa&&0<pa.length&&Ha.setAttribute("title",pa)}else Ha=Ea;var Ya=document.createElement("span");+bb($a,Za)}function Oa(Qa,bb){if(null==ja||M||b.sidebar.currentElt==Ha)b.sidebar.hideTooltip();else if(b.sidebar.hideTooltip(),null!=P){var cb="<mxfile><diagram>"+Graph.compress('<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="2" value="" style="shape=image;image='+P.src+';imageAspect=1;" parent="1" vertex="1"><mxGeometry width="'+P.naturalWidth+'" height="'+P.naturalHeight+'" as="geometry" /></mxCell></root></mxGraphModel>')+"</diagram></mxfile>";C(cb,mxEvent.getClientX(Qa),+mxEvent.getClientY(Qa),na,ja)}else b.sidebar.currentElt=Ha,M=!0,La(ja,function(ib){if(M&&b.sidebar.currentElt==Ha)try{C(ib,mxEvent.getClientX(Qa),mxEvent.getClientY(Qa),Ha,bb)}catch(jb){b.sidebar.currentElt=null,b.handleError(jb)}M=!1})}var Ha=null;if("generative"!=Xa||null==Ea){Ha=document.createElement("div");Ha.className="geTemplate";var $a=null,Za=ja;null!=na?Ha.setAttribute("title",mxResources.get(na,null,na)):null!=pa&&0<pa.length&&Ha.setAttribute("title",pa)}else Ha=Ea;var Ya=document.createElement("span");Ya.className="geAdaptiveAsset";mxUtils.write(Ya,mxResources.get(na,null,na));if(null!=ta){Ha.style.display="inline-flex";Ha.style.justifyContent="center";Ha.style.alignItems="center";Ja=document.createElement("img");Ja.setAttribute("src",ta);Ja.setAttribute("alt",pa);Ja.style.maxWidth=ra+"px";Ja.style.maxHeight=oa+"px";P=Ja;var gb=ta.replace(".drawio.xml","").replace(".drawio","").replace(".xml","");Ha.appendChild(Ja);Ja.onerror=function(){this.src!=gb?this.src=gb:(this.src=Editor.errorImage,this.onerror=null)};mxEvent.addGestureListeners(Ha,mxUtils.bind(this,function(Qa){S(Ha,null,null,ja,Fa,Pa)}),null,null);mxEvent.addListener(Ha,"dblclick",function(Qa){Q();mxEvent.consume(Qa)})}else if(!Na&&null!=ja&&0<ja.length){var eb=function(Qa){k.spin(la)&&La(ja,function(bb,cb){k.stop();null!=bb&&(S(Ha,bb,sa,null,null,Pa,cb),Qa&&Q())})};ta=Ja||TEMPLATE_PATH+"/"+ja.substring(0,ja.length-4)+".png";Ja=za.cloneNode(!1);Ja.style.backgroundImage="url("+ta+")";Ja.style.display="";Ha.appendChild(Ja);null!=na&&Ha.appendChild(Ya);mxEvent.addGestureListeners(Ha,mxUtils.bind(this,function(Qa){eb()}),null,null);mxEvent.addListener(Ha,"dblclick",function(Qa){eb(!0);mxEvent.consume(Qa)})}else Ha.appendChild(Ya),"generative"==Xa&&null==Ea&&(Ha.appendChild(za),Ha.appendChild(ya),Ha.appendChild(Ka),Ha.appendChild(Da),Ea=Ha),qa&&S(Ha),null!=Ia?(mxEvent.addGestureListeners(Ha,null,null,mxUtils.bind(this,function(Qa){S(Ha,null,null,ja,Fa)})),mxEvent.addListener(Ha,"click",Ia)):(mxEvent.addListener(Ha,"click",function(Qa){S(Ha,null,null,ja,Fa)&&"generative"==Xa&&null==ca&&U()}),mxEvent.addListener(Ha,"dblclick",function(Qa){"generative"!=Xa?Q():"none"==ya.style.display&&U();mxEvent.consume(Qa)}));null!=ja&&(ta=F.cloneNode(!0),Ha.appendChild(ta),mxEvent.addGestureListeners(ta,mxUtils.bind(this,function(Qa){R=b.sidebar.currentElt==Ha}),null,null),mxEvent.addListener(ta,"click",mxUtils.bind(this,function(Qa){R||Oa(Qa,null!=na?na:pa);mxEvent.consume(Qa)})));la.appendChild(Ha);return Ha}function G(){function ja(La,Oa){La=mxResources.get(La,-null,La.substring(0,1).toUpperCase()+La.substring(1));18<La.length&&(La=La.substring(0,18)+"…");return La+(null!=Oa?" ("+Oa.length+")":"")}function sa(La,Oa,Ha){mxEvent.addListener(Oa,"click",function(){Ra!=Oa&&(null!=Ra&&(Ra.style.backgroundColor=""),Ra=Oa,Ra.style.backgroundColor=v,la.scrollTop=0,la.innerText="",L=0,null!=wa[La].content?(la.appendChild(wa[La].content),ba=ca,Va=null,null!=wa[La].content.init&&wa[La].content.init()):(Va=Ha?Sa[La][Ha]:wa[La],V=null,D(!1)))});null!=urlParams["smart-template"]&&+null,La.substring(0,1).toUpperCase()+La.substring(1));18<La.length&&(La=La.substring(0,18)+"…");return La+(null!=Oa?" ("+Oa.length+")":"")}function sa(La,Oa,Ha){mxEvent.addListener(Oa,"click",function(){Ra!=Oa&&(null!=Ra&&(Ra.style.backgroundColor=""),Ra=Oa,Ra.style.backgroundColor=v,la.scrollTop=0,la.innerText="",K=0,null!=wa[La].content?(la.appendChild(wa[La].content),ba=ca,Va=null,null!=wa[La].content.init&&wa[La].content.init()):(Va=Ha?Sa[La][Ha]:wa[La],V=null,D(!1)))});null!=urlParams["smart-template"]&&"smartTemplate"==La&&Oa.click()}hb&&(hb=!1,mxEvent.addListener(la,"scroll",function(La){la.scrollTop+la.clientHeight>=la.scrollHeight&&(D(),mxEvent.consume(La))}));if(0<Ua){var na=document.createElement("div");na.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(na,mxResources.get("custom"));ua.appendChild(na);for(var pa in Ta){var qa=document.createElement("div");na=pa;var ta=Ta[pa];18<na.length&&(na=na.substring(0,18)+"…");qa.style.cssText=-"display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;";qa.setAttribute("title",na+" ("+ta.length+")");mxUtils.write(qa,qa.getAttribute("title"));null!=N&&(qa.style.padding=N);ua.appendChild(qa);(function(La,Oa){mxEvent.addListener(qa,"click",function(){Ra!=Oa&&(Ra.style.backgroundColor="",Ra=Oa,Ra.style.backgroundColor=v,la.scrollTop=0,la.innerText="",L=0,Va=Ta[La],V=null,D(!1))})})(pa,qa)}na=document.createElement("div");+"display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;";qa.setAttribute("title",na+" ("+ta.length+")");mxUtils.write(qa,qa.getAttribute("title"));null!=N&&(qa.style.padding=N);ua.appendChild(qa);(function(La,Oa){mxEvent.addListener(qa,"click",function(){Ra!=Oa&&(Ra.style.backgroundColor="",Ra=Oa,Ra.style.backgroundColor=v,la.scrollTop=0,la.innerText="",K=0,Va=Ta[La],V=null,D(!1))})})(pa,qa)}na=document.createElement("div");na.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(na,"draw.io");ua.appendChild(na)}for(pa in wa){na=ta=null;if(null!=wa[pa].content)qa=document.createElement(Fa?"ul":"div"),na=ja(pa),qa.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;transition: all 0.5s;",qa.setAttribute("title",na),mxUtils.write(qa,na),ua.appendChild(qa),na=qa;else{var Fa=Sa[pa];na=qa=document.createElement(Fa?"ul":"div");ta=wa[pa];var Ia=ja(pa,ta);if(null!=Fa){ta=document.createElement("li");var Ja=document.createElement("div");Ja.className="geTempTreeCaret";Ja.setAttribute("title",Ia);mxUtils.write(Ja,Ia);na=Ja;ta.appendChild(Ja);Ia=document.createElement("ul");Ia.className="geTempTreeNested";Ia.style.visibility="hidden";for(var Na in Fa){var Pa=document.createElement("li"),Xa=ja(Na,Fa[Na]);Pa.setAttribute("title",Xa);mxUtils.write(Pa,Xa);sa(pa,Pa,Na);Ia.appendChild(Pa)}ta.appendChild(Ia);qa.className="geTempTree";qa.appendChild(ta);(function(La,Oa){mxEvent.addListener(Oa,"click",function(){La.style.visibility="visible";La.classList.toggle("geTempTreeActive");La.classList.toggle("geTempTreeNested")&&setTimeout(function(){La.style.visibility="hidden"},550);Oa.classList.toggle("geTempTreeCaret-down")})})(Ia,Ja)}else qa.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;transition: all 0.5s;",qa.setAttribute("title",Ia),mxUtils.write(qa,Ia);null!=N&&(qa.style.padding=N);ua.appendChild(qa)}sa(pa,na);null==Ra&&na.click()}D(!1)}B=500>(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth);m=null!=m?m:!0;t=null!=t?t:!1;v=null!=v?v:"light-dark(#ebf2f9, "+Editor.darkColor+")";I=null!=I?I:EditorUi.templateFile;var E=document.createElement("div");E.style.userSelect="none";E.style.height="100%";J=document.createElement("div");J.style.whiteSpace="nowrap";J.style.height="46px";m&&E.appendChild(J);var H=document.createElement("img");H.setAttribute("border","0");H.setAttribute("align","absmiddle");H.style.width="40px";H.style.height="40px";H.style.marginRight="10px";H.style.paddingBottom="4px";H.src=b.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":b.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":b.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":b.mode==App.MODE_GITHUB?IMAGE_PATH+"/github-logo.svg":b.mode==App.MODE_GITLAB?IMAGE_PATH+"/gitlab-logo.svg":b.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":b.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";f||B||!m||J.appendChild(H);m&&mxUtils.write(J,(B?mxResources.get("name"):null==b.mode||b.mode==App.MODE_GOOGLE||b.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");H=".drawio";b.mode==App.MODE_GOOGLE&&null!=b.drive?H=b.drive.extension:b.mode==App.MODE_DROPBOX&&null!=b.dropbox?H=b.dropbox.extension:b.mode==App.MODE_ONEDRIVE&&-null!=b.oneDrive?H=b.oneDrive.extension:b.mode==App.MODE_GITHUB&&null!=b.gitHub?H=b.gitHub.extension:b.mode==App.MODE_GITLAB&&null!=b.gitLab?H=b.gitLab.extension:b.mode==App.MODE_TRELLO&&null!=b.trello&&(H=b.trello.extension);var M=document.createElement("input");M.setAttribute("value",b.defaultFilename+H);M.style.marginLeft="10px";M.style.width=f||B?"144px":"244px";this.init=function(){m&&Editor.selectFilename(M);null!=la.parentNode&&null!=la.parentNode.parentNode&&mxEvent.addGestureListeners(la.parentNode.parentNode,-mxUtils.bind(this,function(ja){null!=b.sidebar&&b.sidebar.hideTooltip()}),null,null)};m&&(J.appendChild(M),z?M.style.width=f||B?"350px":"450px":null!=b.editor.diagramFileTypes&&(z=FilenameDialog.createFileTypes(b,M,b.editor.diagramFileTypes),z.style.marginLeft="6px",z.style.width=f||B?"80px":"180px",J.appendChild(z)));z=!1;var L=0,k=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9}),y=mxUtils.button(n||-mxResources.get("create"),function(){y.setAttribute("disabled","disabled");Q();y.removeAttribute("disabled")});y.className="geBtn gePrimaryBtn";var F=document.createElement("img");F.setAttribute("src",Editor.magnifyImage);F.setAttribute("title",mxResources.get("preview"));F.className="geButton geRoundButton";var K=!1,P=null,R=!1;if(c||e){var T=[],V=null,W=null,X=null,Z=function(ja){y.setAttribute("disabled","disabled");for(var sa=0;sa<T.length;sa++)T[sa].className=sa==ja?"geBtn gePrimaryBtn":"geBtn"};-z=!0;n=document.createElement("div");n.style.whiteSpace="nowrap";n.style.height="30px";E.appendChild(n);B=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){ua.style.display="";xa.style.display="";la.style.left="160px";Z(0);la.scrollTop=0;la.innerText="";L=0;V!=Va&&(Va=V,wa=W,Ua=X,ua.innerText="",G(),V=null)});T.push(B);n.appendChild(B);var Y=function(ja){ua.style.display="none";xa.style.display="none";la.style.left="30px";Z(ja?-1:1);null==V&&(V=Va);la.scrollTop=0;la.innerText=-"";k.spin(la);var sa=function(na,pa,qa){L=0;k.stop();Va=na;qa=qa||{};var ta=0,Fa;for(Fa in qa)ta+=qa[Fa].length;if(pa)la.innerText=pa;else if(0==na.length&&0==ta)la.innerText=mxResources.get("noDiagrams",null,"No Diagrams Found");else if(la.innerText="",0<ta){ua.style.display="";la.style.left="160px";ua.innerText="";Ua=0;wa={"draw.io":na};for(Fa in qa)wa[Fa]=qa[Fa];G()}else D(!0)};ja?e(da.value,sa):c(sa)};c&&(B=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){Y()}),n.appendChild(B),-T.push(B));if(e){B=document.createElement("span");B.style.marginLeft="10px";B.innerText=mxResources.get("search")+":";n.appendChild(B);var da=document.createElement("input");da.style.marginRight="10px";da.style.marginLeft="10px";da.style.width="220px";mxEvent.addListener(da,"keypress",function(ja){13==ja.keyCode&&Y(!0)});n.appendChild(da);B=mxUtils.button(mxResources.get("search"),function(){Y(!0)});B.className="geBtn";n.appendChild(B)}Z(0)}var ea=null,ka=null,ba=null,ha=null,aa=null,ia=null,fa=null,+null!=b.oneDrive?H=b.oneDrive.extension:b.mode==App.MODE_GITHUB&&null!=b.gitHub?H=b.gitHub.extension:b.mode==App.MODE_GITLAB&&null!=b.gitLab?H=b.gitLab.extension:b.mode==App.MODE_TRELLO&&null!=b.trello&&(H=b.trello.extension);var L=document.createElement("input");L.setAttribute("value",b.defaultFilename+H);L.style.marginLeft="10px";L.style.width=f||B?"144px":"244px";this.init=function(){m&&Editor.selectFilename(L);null!=la.parentNode&&null!=la.parentNode.parentNode&&mxEvent.addGestureListeners(la.parentNode.parentNode,+mxUtils.bind(this,function(ja){null!=b.sidebar&&b.sidebar.hideTooltip()}),null,null)};m&&(J.appendChild(L),z?L.style.width=f||B?"350px":"450px":null!=b.editor.diagramFileTypes&&(z=FilenameDialog.createFileTypes(b,L,b.editor.diagramFileTypes),z.style.marginLeft="6px",z.style.width=f||B?"80px":"180px",J.appendChild(z)));z=!1;var K=0,k=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9}),y=mxUtils.button(n||+mxResources.get("create"),function(){y.setAttribute("disabled","disabled");Q();y.removeAttribute("disabled")});y.className="geBtn gePrimaryBtn";var F=document.createElement("img");F.setAttribute("src",Editor.magnifyImage);F.setAttribute("title",mxResources.get("preview"));F.className="geButton geRoundButton";var M=!1,P=null,R=!1;if(c||e){var T=[],V=null,W=null,X=null,Y=function(ja){y.setAttribute("disabled","disabled");for(var sa=0;sa<T.length;sa++)T[sa].className=sa==ja?"geBtn gePrimaryBtn":"geBtn"};+z=!0;n=document.createElement("div");n.style.whiteSpace="nowrap";n.style.height="30px";E.appendChild(n);B=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){ua.style.display="";xa.style.display="";la.style.left="160px";Y(0);la.scrollTop=0;la.innerText="";K=0;V!=Va&&(Va=V,wa=W,Ua=X,ua.innerText="",G(),V=null)});T.push(B);n.appendChild(B);var Z=function(ja){ua.style.display="none";xa.style.display="none";la.style.left="30px";Y(ja?-1:1);null==V&&(V=Va);la.scrollTop=0;la.innerText=+"";k.spin(la);var sa=function(na,pa,qa){K=0;k.stop();Va=na;qa=qa||{};var ta=0,Fa;for(Fa in qa)ta+=qa[Fa].length;if(pa)la.innerText=pa;else if(0==na.length&&0==ta)la.innerText=mxResources.get("noDiagrams",null,"No Diagrams Found");else if(la.innerText="",0<ta){ua.style.display="";la.style.left="160px";ua.innerText="";Ua=0;wa={"draw.io":na};for(Fa in qa)wa[Fa]=qa[Fa];G()}else D(!0)};ja?e(da.value,sa):c(sa)};c&&(B=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){Z()}),n.appendChild(B),+T.push(B));if(e){B=document.createElement("span");B.style.marginLeft="10px";B.innerText=mxResources.get("search")+":";n.appendChild(B);var da=document.createElement("input");da.style.marginRight="10px";da.style.marginLeft="10px";da.style.width="220px";mxEvent.addListener(da,"keypress",function(ja){13==ja.keyCode&&Z(!0)});n.appendChild(da);B=mxUtils.button(mxResources.get("search"),function(){Z(!0)});B.className="geBtn";n.appendChild(B)}Y(0)}var ea=null,ka=null,ba=null,ha=null,aa=null,ia=null,fa=null,ca=null,Ba=null,la=document.createElement("div");la.style.border="1px solid #d3d3d3";la.style.position="absolute";la.style.left="160px";la.style.right="34px";n=(m?72:40)+(z?30:0);la.style.top=n+"px";la.style.bottom="68px";la.style.margin="6px 0 0 -1px";la.style.padding="6px";la.style.overflow="auto";var xa=document.createElement("div");xa.style.cssText="position:absolute;left:30px;width:128px;top:"+n+"px;height:22px;margin-top: 6px;white-space: nowrap;";var Aa=document.createElement("input");Aa.style.cssText="width:105px;height:16px;border:1px solid #d3d3d3;padding: 3px 20px 3px 3px;font-size: 12px;border-radius:0px;";Aa.setAttribute("placeholder",mxResources.get("search"));Aa.setAttribute("type","text");xa.appendChild(Aa);var ma=document.createElement("img");ma.setAttribute("src",Editor.magnifyImage);ma.setAttribute("title",mxResources.get("search"));ma.className="geAdaptiveAsset";ma.style.position="relative";ma.style.cursor="pointer";ma.style.outline="none";ma.style.opacity="0.5";ma.style.height="16px";ma.style.left="-20px";ma.style.top="4px";xa.appendChild(ma);mxEvent.addListener(ma,"click",function(){ma.getAttribute("src")!=Editor.magnifyImage&&(ma.setAttribute("src",Editor.magnifyImage),ma.setAttribute("title",mxResources.get("search")),Aa.value="",null!=Wa&&(Wa.click(),Wa=null));Aa.focus()});mxEvent.addListener(Aa,"keydown",mxUtils.bind(this,function(ja){if(13==ja.keyCode){var sa=Aa.value;if(""==sa)null!=Wa&&(Wa.click(),Wa=null);else{if(null==NewDialog.tagsList[I]){var na={};for(Pa in wa)if(null==wa[Pa].content)for(var pa=wa[Pa],qa=0;qa<pa.length;qa++){var ta=pa[qa];if(null!=ta.tags)for(var Fa=ta.tags.toLowerCase().split(";"),Ia=0;Ia<Fa.length;Ia++)null==na[Fa[Ia]]&&(na[Fa[Ia]]=[]),na[Fa[Ia]].push(ta)}NewDialog.tagsList[I]=na}var Ja=sa.toLowerCase().split(" ");na=NewDialog.tagsList[I];if(0<Ua&&null==na.__tagsList__){for(Pa in Ta)for(pa=Ta[Pa],qa=0;qa<pa.length;qa++)for(ta=pa[qa],Fa=ta.title.split(" "),Fa.push(Pa),Ia=0;Ia<Fa.length;Ia++){var Na=Fa[Ia].toLowerCase();null==na[Na]&&(na[Na]=[]);-na[Na].push(ta)}na.__tagsList__=!0}var Pa=[];pa={};for(qa=Fa=0;qa<Ja.length;qa++)if(0<Ja[qa].length){Na=na[Ja[qa]];var Xa={};Pa=[];if(null!=Na)for(Ia=0;Ia<Na.length;Ia++)ta=Na[Ia],0==Fa==(null==pa[ta.url])&&(Xa[ta.url]=!0,Pa.push(ta));pa=Xa;Fa++}la.scrollTop=0;la.innerText="";L=0;na=document.createElement("div");na.style.padding="6px";na.style.whiteSpace="nowrap";na.style.overflow="hidden";na.style.textOverflow="ellipsis";ta=mxResources.get(0==Pa.length?"noResultsFor":"resultsFor",[sa]);na.setAttribute("title",+na[Na].push(ta)}na.__tagsList__=!0}var Pa=[];pa={};for(qa=Fa=0;qa<Ja.length;qa++)if(0<Ja[qa].length){Na=na[Ja[qa]];var Xa={};Pa=[];if(null!=Na)for(Ia=0;Ia<Na.length;Ia++)ta=Na[Ia],0==Fa==(null==pa[ta.url])&&(Xa[ta.url]=!0,Pa.push(ta));pa=Xa;Fa++}la.scrollTop=0;la.innerText="";K=0;na=document.createElement("div");na.style.padding="6px";na.style.whiteSpace="nowrap";na.style.overflow="hidden";na.style.textOverflow="ellipsis";ta=mxResources.get(0==Pa.length?"noResultsFor":"resultsFor",[sa]);na.setAttribute("title",ta);mxUtils.write(na,ta);la.appendChild(na);null!=Ra&&null==Wa&&(Ra.style.backgroundColor="",Wa=Ra,Ra=na);Va=Pa;V=null;D(!1)}mxEvent.consume(ja)}}));mxEvent.addListener(Aa,"keyup",mxUtils.bind(this,function(ja){""==Aa.value?(ma.setAttribute("src",Editor.magnifyImage),ma.setAttribute("title",mxResources.get("search"))):(ma.setAttribute("src",Editor.crossImage),ma.setAttribute("title",mxResources.get("reset")))}));n+=23;var ua=document.createElement("div");ua.style.cssText="position:absolute;left:30px;width:128px;top:"+-n+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";mxEvent.addListener(la,"scroll",function(){b.sidebar.hideTooltip()});var ra=140,oa=ra,Ea=null,va="url("+Editor.sparklesImage+")",ya=document.createElement("div");ya.className="geGenerateDiagramForm";ya.style.position="absolute";ya.style.width="100%";ya.style.height="100%";var za=document.createElement("div");za.className="geTemplatePreview geAdaptiveAsset";za.style.backgroundImage=va;var Ga=document.createElement("textarea");+n+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";mxEvent.addListener(la,"scroll",function(){null!=b.sidebar&&b.sidebar.hideTooltip()});var ra=140,oa=ra,Ea=null,va="url("+Editor.sparklesImage+")",ya=document.createElement("div");ya.className="geGenerateDiagramForm";ya.style.position="absolute";ya.style.width="100%";ya.style.height="100%";var za=document.createElement("div");za.className="geTemplatePreview geAdaptiveAsset";za.style.backgroundImage=va;var Ga=document.createElement("textarea");Ga.setAttribute("placeholder",mxResources.get("describeYourDiagram"));Ga.className="geGenerateDiagramDescription";var Ca=document.createElement("button");Ca.className="geBtn gePrimaryBtn geGenerateDiagramButton";Ca.setAttribute("disabled","disabled");Ca.setAttribute("title",mxResources.get("ok"));mxUtils.write(Ca,mxResources.get("ok"));var Ka=F.cloneNode(!0);Ka.style.display="none";var Ma=!1;mxEvent.addGestureListeners(Ka,function(ja){Ma=null!=b.sidebar.tooltip&&"none"!=b.sidebar.tooltip.style.display},null,function(ja){if(!Ma&&null!=ca){var sa="<mxfile><diagram>"+Graph.compress(ca)+"</diagram></mxfile>";C(sa,mxEvent.getClientX(ja),mxEvent.getClientY(ja),Ea,Ba)}});var Da=F.cloneNode(!0);Da.setAttribute("src",Editor.editImage);Da.setAttribute("title",mxResources.get("edit"));Da.style.visibility="hidden";Da.style.left="0px";n=F.cloneNode(!0);n.setAttribute("src",Editor.helpImage);n.setAttribute("title",mxResources.get("help"));mxEvent.addListener(n,"click",function(ja){b.openLink("https://www.drawio.com/blog/write-query-generate-diagram");mxEvent.consume(ja)});ya.appendChild(Ga);ya.appendChild(Ca);ya.appendChild(n);ya.style.display="none";mxEvent.addListener(Da,"click",U);mxEvent.addListener(Ga,"input",function(){""!=Ga.value?Ca.removeAttribute("disabled"):Ca.setAttribute("disabled","disabled")});mxEvent.addListener(Ca,"click",function(){p()});mxEvent.addListener(Ga,"keydown",function(ja){13!=ja.keyCode||mxEvent.isShiftDown(ja)?27==ja.keyCode&&(p(!0),mxEvent.consume(ja)):(p(),mxEvent.consume(ja))});var wa={},Sa={},Ta={},Ua=0,hb=!0,Ra=null,Wa=null;wa.basic=[{title:"blankDiagram"}];var Va=wa.basic;Editor.enableChatGpt&&b.isExternalDataComms()&&"draw.io"==b.getServiceName()&&"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&wa.basic.push({title:"generate",type:"generative"});Editor.enableChatGpt&&b.isExternalDataComms()&&"draw.io"==b.getServiceName()&&"undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled&&(wa.smartTemplate={content:A()});if(!f){var fb=function(){mxUtils.get(db,function(ja){if(!ab){ab=!0;ja=ja.getXml().documentElement.firstChild;for(var sa={};null!=ja;){if("undefined"!==typeof ja.getAttribute)if("parsererror"==ja.nodeName)null!=window.console&&console.log("Parser error in "+I+": "+ja.textContent);else if("clibs"==ja.nodeName){for(var na=ja.getAttribute("name"),pa=ja.getElementsByTagName("add"),qa=[],ta=0;ta<pa.length;ta++)qa.push(encodeURIComponent(mxUtils.getTextContent(pa[ta])));null!=na&&0<qa.length&&(sa[na]=qa.join(";"))}else if(qa=ja.getAttribute("url"),null!=qa){pa=ja.getAttribute("section");na=ja.getAttribute("subsection");if(null==pa&&(ta=qa.indexOf("/"),pa=qa.substring(0,ta),null==na)){var Fa=qa.indexOf("/",ta+1);-1<Fa&&(na=qa.substring(ta+1,Fa))}ta=wa[pa];null==ta&&(ta=[],wa[pa]=ta);qa=ja.getAttribute("clibs");null!=sa[qa]&&(qa=sa[qa]);qa={url:ja.getAttribute("url"),libs:ja.getAttribute("libs"),title:ja.getAttribute("title"),tooltip:ja.getAttribute("name")||ja.getAttribute("url"),preview:ja.getAttribute("preview"),clibs:qa,tags:ja.getAttribute("tags")};ta.push(qa);null!=na&&(ta=Sa[pa],-null==ta&&(ta={},Sa[pa]=ta),pa=ta[na],null==pa&&(pa=[],ta[na]=pa),pa.push(qa))}ja=ja.nextSibling}k.stop();G()}})};E.appendChild(xa);E.appendChild(ua);E.appendChild(la);var ab=!1,db=I;/^https?:\/\//.test(db)&&!b.editor.isCorsEnabledForUrl(db)&&(db=PROXY_URL+"?url="+encodeURIComponent(db));k.spin(la);null!=u?u(function(ja,sa){Ta=ja;X=Ua=sa;fb()},fb):fb();W=wa}mxEvent.addListener(M,"keypress",function(ja){b.dialog.container.firstChild==E&&13==ja.keyCode&&Q()});u=document.createElement("div");u.style.marginTop=+null==ta&&(ta={},Sa[pa]=ta),pa=ta[na],null==pa&&(pa=[],ta[na]=pa),pa.push(qa))}ja=ja.nextSibling}k.stop();G()}})};E.appendChild(xa);E.appendChild(ua);E.appendChild(la);var ab=!1,db=I;/^https?:\/\//.test(db)&&!b.editor.isCorsEnabledForUrl(db)&&(db=PROXY_URL+"?url="+encodeURIComponent(db));k.spin(la);null!=u?u(function(ja,sa){Ta=ja;X=Ua=sa;fb()},fb):fb();W=wa}mxEvent.addListener(L,"keypress",function(ja){b.dialog.container.firstChild==E&&13==ja.keyCode&&Q()});u=document.createElement("div");u.style.marginTop=f?"4px":"16px";u.style.textAlign="right";u.style.position="absolute";u.style.left="40px";u.style.bottom="24px";u.style.right="40px";n=mxUtils.button(mxResources.get("cancel"),function(){null!=x&&x();b.hideDialog(!0)});n.className="geBtn";!b.editor.cancelFirst||t&&null==x||u.appendChild(n);f||"1"==urlParams.embed||t||mxClient.IS_ANDROID||mxClient.IS_IOS||"1"==urlParams.noDevice||(f=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var ja=new FilenameDialog(b,"",mxResources.get("create"),function(sa){null!=sa&&0<sa.length&&b.editor.loadUrl(b.editor.getProxiedUrl(sa),function(na){ba=na;ea=null;templateRealURl=sa;b.hideDialog();Q()},function(na){b.handleError(na)})},mxResources.get("url"),null,null,null,!1);b.showDialog(ja.container,300,80,!0,!0);ja.init()}),f.className="geBtn",u.appendChild(f));Graph.fileSupport&&l&&(l=mxUtils.button(mxResources.get("import"),function(){if(null==b.newDlgFileInputElt){var ja=document.createElement("input");ja.setAttribute("multiple","multiple");ja.setAttribute("type","file");mxEvent.addListener(ja,"change",function(sa){b.openFiles(ja.files,!0);ja.value=""});ja.style.display="none";document.body.appendChild(ja);b.newDlgFileInputElt=ja}b.newDlgFileInputElt.click()}),l.className="geBtn",u.appendChild(l));u.appendChild(y);b.editor.cancelFirst||null!=d||t&&null==x||u.appendChild(n);E.appendChild(u);this.container=E};NewDialog.tagsList={};-var SaveDialog=function(b,f,m,d,t,x,v,B){function J(E,H,M,L,k,y){var F=null;if(null==d||0>mxUtils.indexOf(d,E))if(k=null!=k?k:b.getTitleForService(E),0<=mxUtils.indexOf(U,E)||null!=b.getServiceForName(E)){F=document.createElement("option");if("pick"==y)F.innerHTML=mxUtils.htmlEntities(k)+" – "+mxUtils.htmlEntities(mxResources.get("pickFolder"))+"...",F.setAttribute("value","pickFolder-"+E),F.setAttribute("title",k+" - "+mxResources.get("pickFolder")+"...");else{var K=E+-(null!=M?"-"+M:""),P=q[K];null!=P&&null!=P.option&&P.option.parentNode.removeChild(P.option);P=null;if(null!=H){"/"==H.charAt(H.length-1)&&(H=H.substring(0,H.length-1));"/"==H.charAt(0)&&(H=H.substring(1));P=H;if(E!=App.MODE_GITHUB&&E==App.MODE_GITLAB){var R=P.lastIndexOf("/");0<=R&&(P=P.substring(R+1))}40<P.length&&(P=P.substring(0,20)+"..."+P.substring(P.length-20))}F.innerHTML=mxUtils.htmlEntities(k)+(null!=P?" – "+mxUtils.htmlEntities(P):"");F.setAttribute("title",k+-(null!=H?" ("+H+")":"")+(null!=M&&decodeURIComponent(M)!=H?" ["+M+"]":""));F.setAttribute("value",K);q[K]={option:F,mode:E,path:H,id:M};SaveDialog.lastValue==K&&null==B?L=!0:null==L&&("root"==y?L=null==B&&b.mode==E||null!=E&&E==B:"pickFolder-"==Q.value.substring(0,11)&&(L=!0));L&&F.setAttribute("selected","selected")}Q.appendChild(F)}return F}function N(E){b.pickFolder(E,function(H){var M=null;E==App.MODE_GOOGLE&&null!=H.docs&&0<H.docs.length?M={mode:E,path:H.docs[0].name,id:H.docs[0].id}:E==App.MODE_ONEDRIVE&&-null!=H.value&&0<H.value.length?M={mode:E,path:H.value[0].name,id:OneDriveFile.prototype.getIdOf(H.value[0])}:(E==App.MODE_GITHUB||E==App.MODE_GITLAB)&&null!=H&&0<H.length&&(M={mode:E,path:decodeURIComponent(H),id:H});null!=M&&(S.style.display="",b.addRecent(M,"Folders",5),H=J(M.mode,M.path,M.id,!0),Q.innerHTML="",q={},I(),M=Q.selectedIndex,Q.value=H.value,0>Q.selectedIndex&&(Q.selectedIndex=M))},!0,!0,!0,!0)}function I(){var E=b.getRecent("Folders"),H=0;if(null!=E&&0<E.length){for(var M=0;M<E.length;M++)null!=-J(E[M].mode,E[M].path,E[M].id)&&H++;0<H&&Q.appendChild(O.cloneNode(!0))}J(App.MODE_GOOGLE,mxResources.get("myDrive"),"root",null,null,"root");J(App.MODE_GOOGLE,null,null,null,null,"pick");null!=b.oneDrive&&(J(App.MODE_ONEDRIVE,mxResources.get("myFiles"),OneDriveFile.prototype.getIdOf(b.oneDrive.rootId),null,null,"root"),J(App.MODE_ONEDRIVE,null,null,null,null,"pick"));null!=b.dropbox&&J(App.MODE_DROPBOX,"Apps"+b.dropbox.appPath);J(App.MODE_GITHUB,null,null,null,null,"pick");J(App.MODE_GITLAB,null,+var SaveDialog=function(b,f,m,d,t,x,v,B){function J(E,H,L,K,k,y){var F=null;if(null==d||0>mxUtils.indexOf(d,E))if(k=null!=k?k:b.getTitleForService(E),0<=mxUtils.indexOf(U,E)||null!=b.getServiceForName(E)){F=document.createElement("option");if("pick"==y)F.innerHTML=mxUtils.htmlEntities(k)+" – "+mxUtils.htmlEntities(mxResources.get("pickFolder"))+"...",F.setAttribute("value","pickFolder-"+E),F.setAttribute("title",k+" - "+mxResources.get("pickFolder")+"...");else{var M=E++(null!=L?"-"+L:""),P=q[M];null!=P&&null!=P.option&&P.option.parentNode.removeChild(P.option);P=null;if(null!=H){"/"==H.charAt(H.length-1)&&(H=H.substring(0,H.length-1));"/"==H.charAt(0)&&(H=H.substring(1));P=H;if(E!=App.MODE_GITHUB&&E==App.MODE_GITLAB){var R=P.lastIndexOf("/");0<=R&&(P=P.substring(R+1))}40<P.length&&(P=P.substring(0,20)+"..."+P.substring(P.length-20))}F.innerHTML=mxUtils.htmlEntities(k)+(null!=P?" – "+mxUtils.htmlEntities(P):"");F.setAttribute("title",k++(null!=H?" ("+H+")":"")+(null!=L&&decodeURIComponent(L)!=H?" ["+L+"]":""));F.setAttribute("value",M);q[M]={option:F,mode:E,path:H,id:L};SaveDialog.lastValue==M&&null==B?K=!0:null==K&&("root"==y?K=null==B&&b.mode==E||null!=E&&E==B:"pickFolder-"==Q.value.substring(0,11)&&(K=!0));K&&F.setAttribute("selected","selected")}Q.appendChild(F)}return F}function N(E){b.pickFolder(E,function(H){var L=null;E==App.MODE_GOOGLE&&null!=H.docs&&0<H.docs.length?L={mode:E,path:H.docs[0].name,id:H.docs[0].id}:E==App.MODE_ONEDRIVE&&+null!=H.value&&0<H.value.length?L={mode:E,path:H.value[0].name,id:OneDriveFile.prototype.getIdOf(H.value[0])}:(E==App.MODE_GITHUB||E==App.MODE_GITLAB)&&null!=H&&0<H.length&&(L={mode:E,path:decodeURIComponent(H),id:H});null!=L&&(S.style.display="",b.addRecent(L,"Folders",5),H=J(L.mode,L.path,L.id,!0),Q.innerHTML="",q={},I(),L=Q.selectedIndex,Q.value=H.value,0>Q.selectedIndex&&(Q.selectedIndex=L))},!0,!0,!0,!0)}function I(){var E=b.getRecent("Folders"),H=0;if(null!=E&&0<E.length){for(var L=0;L<E.length;L++)null!=+J(E[L].mode,E[L].path,E[L].id)&&H++;0<H&&Q.appendChild(O.cloneNode(!0))}J(App.MODE_GOOGLE,mxResources.get("myDrive"),"root",null,null,"root");J(App.MODE_GOOGLE,null,null,null,null,"pick");null!=b.oneDrive&&(J(App.MODE_ONEDRIVE,mxResources.get("myFiles"),OneDriveFile.prototype.getIdOf(b.oneDrive.rootId),null,null,"root"),J(App.MODE_ONEDRIVE,null,null,null,null,"pick"));null!=b.dropbox&&J(App.MODE_DROPBOX,"Apps"+b.dropbox.appPath);J(App.MODE_GITHUB,null,null,null,null,"pick");J(App.MODE_GITLAB,null,null,null,null,"pick");J(App.MODE_TRELLO);E=!Editor.useLocalStorage||"device"==urlParams.storage||null!=b.getCurrentFile()&&"1"!=urlParams.noDevice;EditorUi.nativeFileSupport&&E&&J(App.MODE_DEVICE,null,null,b.mode==App.MODE_DEVICE||null!=d&&0<=mxUtils.indexOf(d,App.MODE_BROWSER)?!0:null);isLocalStorage&&"0"!=urlParams.browser&&J(App.MODE_BROWSER);E&&J("download");Editor.popupsAllowed&&J("_blank",null,null,null,mxResources.get("openInNewWindow"));0<H&&(Q.appendChild(O.cloneNode(!0)),H=Q.value,Q.appendChild(S),Q.value=H);if("pickFolder-"==Q.value.substring(0,11)||"reset"==Q.value)H=document.createElement("option"),H.setAttribute("value",""),H.setAttribute("selected","selected"),mxUtils.write(H,mxResources.get("pickFolder")+"..."),Q.insertBefore(H,Q.firstChild);p=Q.value}function c(){if("reset"==Q.value)b.resetRecent("Folders"),Q.innerHTML="",Q.value="",pickFolderOption=null,q={},I();else if("pickFolder-"==Q.value.substring(0,11)){var E=Q.value.substring(11);Q.value=p;N(E)}else if(null!=A&&null!=q[Q.value]&&null!=b.editor.diagramFileTypes&&"drawio"==b.editor.diagramFileTypes[A.value].extension){E=b.getExtensionForService(q[Q.value].mode);var H=C.value;null!=E&&0>f.indexOf(".")&&0>H.indexOf(".")&&(C.value=H+E)}G.innerHTML="";mxUtils.write(G,mxResources.get("download"==Q.value||"_blank"==Q.value?"ok":"save"));""==Q.value?G.setAttribute("disabled","disabled"):G.removeAttribute("disabled")}var e=document.createElement("div");e.style.display="flex";e.style.flexWrap="wrap";e.style.whiteSpace="nowrap";var g=@@ -12387,10 +12393,10 @@ u.style.display="flex";u.style.padding="1px";u.style.alignItems="center";u.style"border-box";C.style.width="100%";D.appendChild(C);g.appendChild(u);g.appendChild(D);var A=null;null!=b.editor.diagramFileTypes&&null==x&&(u=u.cloneNode(!1),D=D.cloneNode(!1),mxUtils.write(u,mxResources.get("type")+":"),A=FilenameDialog.createFileTypes(b,C,b.editor.diagramFileTypes),A.style.boxSizing="border-box",A.style.width="100%",D.appendChild(A),g.appendChild(u),g.appendChild(D));u=u.cloneNode(!1);D=D.cloneNode(!1);mxUtils.write(u,mxResources.get("where")+":");var Q=document.createElement("select");Q.style.textOverflow="ellipsis";Q.style.gridColumn="1";var S=document.createElement("option");mxUtils.write(S,mxResources.get("reset"));S.setAttribute("value","reset");var U=["browser","device","download","_blank"],O=document.createElement("option");O.setAttribute("disabled","disabled");O.innerHTML="-----------------";var p=null,q={},G=mxUtils.button(mxResources.get("save"),function(){SaveDialog.lastValue=Q.value;var E=q[SaveDialog.lastValue];null!=E&&m(C,E.mode,E.id)},null,"geBtn gePrimaryBtn");mxEvent.addListener(C,"keypress",function(E){13==E.keyCode&&G.click()});mxEvent.addListener(Q,"change",c);I();c();D.appendChild(Q);null!=SaveDialog.lastValue&&null!=q[SaveDialog.lastValue]&&(Q.value=SaveDialog.lastValue);g.appendChild(u);g.appendChild(D);e.appendChild(g);null!=l&&e.appendChild(l);g=document.createElement("div");g.style.flexBasis="100%";g.style.textAlign="right";g.style.marginTop=null!=x?"16px":"8px";b.isOffline()&&!mxClient.IS_CHROMEAPP||g.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/save-file-formats"));-l=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()},null,"geBtn");b.editor.cancelFirst&&g.appendChild(l);null!=n&&g.appendChild(n);g.appendChild(G);b.editor.cancelFirst||g.appendChild(l);e.appendChild(g);this.init=function(){Editor.selectFilename(C)};this.container=e},CreateDialog=function(b,f,m,d,t,x,v,B,J,N,I,c,e,g,l,n,u){function z(p,q,G,E){function H(){mxEvent.addListener(M,"click",function(){var K=G;if(v){var P=A.value,R=P.lastIndexOf(".");if(0>f.lastIndexOf(".")&&0>R){K=null!=-K?K:O.value;var T="";K==App.MODE_GOOGLE?T=b.drive.extension:K==App.MODE_GITHUB?T=b.gitHub.extension:K==App.MODE_GITLAB?T=b.gitLab.extension:K==App.MODE_TRELLO?T=b.trello.extension:K==App.MODE_DROPBOX?T=b.dropbox.extension:K==App.MODE_ONEDRIVE?T=b.oneDrive.extension:K==App.MODE_DEVICE&&(T=".drawio");0<=R&&(P=P.substring(0,R));A.value=P+T}}D(G)})}var M=document.createElement("a");M.style.overflow="hidden";var L=document.createElement("img");L.src=p;L.setAttribute("border","0");L.setAttribute("align",-"absmiddle");L.style.width="60px";L.style.height="60px";L.style.paddingBottom="6px";M.style.display="inline-block";M.className="geBaseButton";M.style.position="relative";M.style.margin="4px";M.style.padding="8px 8px 10px 8px";M.style.whiteSpace="nowrap";M.appendChild(L);M.style.color="gray";M.style.fontSize="11px";var k=document.createElement("div");M.appendChild(k);mxUtils.write(k,q);if(null!=E&&null==b[E]){L.style.visibility="hidden";mxUtils.setOpacity(k,10);var y=new Spinner({lines:12,length:12,-width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});y.spin(M);var F=window.setTimeout(function(){null==b[E]&&(y.stop(),M.style.display="none")},3E4);b.addListener("clientLoaded",mxUtils.bind(this,function(){null!=b[E]&&(window.clearTimeout(F),mxUtils.setOpacity(k,100),L.style.visibility="",y.stop(),H())}))}else H();S.appendChild(M);++U==c&&(mxUtils.br(S),U=0)}function D(p){var q=A.value;if(null==p||null!=q&&0<q.length)u&&b.hideDialog(),+l=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()},null,"geBtn");b.editor.cancelFirst&&g.appendChild(l);null!=n&&g.appendChild(n);g.appendChild(G);b.editor.cancelFirst||g.appendChild(l);e.appendChild(g);this.init=function(){Editor.selectFilename(C)};this.container=e},CreateDialog=function(b,f,m,d,t,x,v,B,J,N,I,c,e,g,l,n,u){function z(p,q,G,E){function H(){mxEvent.addListener(L,"click",function(){var M=G;if(v){var P=A.value,R=P.lastIndexOf(".");if(0>f.lastIndexOf(".")&&0>R){M=null!=+M?M:O.value;var T="";M==App.MODE_GOOGLE?T=b.drive.extension:M==App.MODE_GITHUB?T=b.gitHub.extension:M==App.MODE_GITLAB?T=b.gitLab.extension:M==App.MODE_TRELLO?T=b.trello.extension:M==App.MODE_DROPBOX?T=b.dropbox.extension:M==App.MODE_ONEDRIVE?T=b.oneDrive.extension:M==App.MODE_DEVICE&&(T=".drawio");0<=R&&(P=P.substring(0,R));A.value=P+T}}D(G)})}var L=document.createElement("a");L.style.overflow="hidden";var K=document.createElement("img");K.src=p;K.setAttribute("border","0");K.setAttribute("align",+"absmiddle");K.style.width="60px";K.style.height="60px";K.style.paddingBottom="6px";L.style.display="inline-block";L.className="geBaseButton";L.style.position="relative";L.style.margin="4px";L.style.padding="8px 8px 10px 8px";L.style.whiteSpace="nowrap";L.appendChild(K);L.style.color="gray";L.style.fontSize="11px";var k=document.createElement("div");L.appendChild(k);mxUtils.write(k,q);if(null!=E&&null==b[E]){K.style.visibility="hidden";mxUtils.setOpacity(k,10);var y=new Spinner({lines:12,length:12,+width:5,radius:10,rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});y.spin(L);var F=window.setTimeout(function(){null==b[E]&&(y.stop(),L.style.display="none")},3E4);b.addListener("clientLoaded",mxUtils.bind(this,function(){null!=b[E]&&(window.clearTimeout(F),mxUtils.setOpacity(k,100),K.style.visibility="",y.stop(),H())}))}else H();S.appendChild(L);++U==c&&(mxUtils.br(S),U=0)}function D(p){var q=A.value;if(null==p||null!=q&&0<q.length)u&&b.hideDialog(),m(q,p,A)}I="1"==urlParams.noDevice?!1:I;v=null!=v?v:!0;B=null!=B?B:!0;c=null!=c?c:4;u=null!=u?u:!0;x=document.createElement("div");x.style.whiteSpace="nowrap";null==d&&b.addLanguageMenu(x);var C=document.createElement("h2");mxUtils.write(C,t||mxResources.get("create"));C.style.marginTop="0px";C.style.marginBottom="24px";x.appendChild(C);t=document.createElement("span");mxUtils.write(t,mxResources.get("filename")+":");t.style.maxWidth="106px";t.style.overflow="hidden";t.style.textOverflow="ellipsis";t.style.display="inline-block";x.appendChild(t);var A=document.createElement("input");A.setAttribute("value",f);A.style.width="180px";A.style.marginLeft="10px";A.style.marginBottom="20px";A.style.maxWidth="70%";this.init=function(){Editor.selectFilename(A)};x.appendChild(A);null!=n&&null!=b.editor.diagramFileTypes&&(n=FilenameDialog.createFileTypes(b,A,b.editor.diagramFileTypes),n.style.marginLeft="6px",n.style.width="90px",x.appendChild(n));n=null;if("1"!=urlParams.noDevice&&null!=e&&null!=g&&"image/"==g.substring(0,6)&&("image/svg"!=g.substring(0,9)||mxClient.IS_SVG)){A.style.width="160px";t=document.createElement("img");var Q=l?e:btoa(unescape(encodeURIComponent(e)));t.setAttribute("src","data:"+g+";base64,"+Q);t.style.position="absolute";t.style.top="70px";t.style.right="100px";t.style.maxWidth="120px";t.style.maxHeight="80px";mxUtils.setPrefixedStyle(t.style,"transform","translate(50%,-50%)");x.appendChild(t);mxClient.IS_FF||"image/png"!=g||null==navigator.clipboard||"function"!==typeof window.ClipboardItem||@@ -12410,7 +12416,7 @@ mxUtils.write(I,f);f=document.createElement("div");f.className="geTitle";f.style"')";mxEvent.addListener(m,"click",function(){c.value="";c.focus()});f.appendChild(c);f.appendChild(m);I.appendChild(f);var e=B,g,l,n=function(A,Q,S,U){var O="data:"==A.substring(0,5);!b.isOffline()||O&&"undefined"===typeof chrome?0<A.length&&b.spinner.spin(document.body,mxResources.get("inserting"))?b.loadImage(A,function(p){b.spinner.stop();b.hideDialog();var q=!1===U?1:null!=Q&&null!=S?Math.max(Q/p.width,S/p.height):Math.min(1,Math.min(520/p.width,520/p.height));x&&(A=b.convertDataUri(A));d(A,Math.round(Number(p.width)*q),Math.round(Number(p.height)*q),e,g,l)},function(){b.spinner.stop();d(null);b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"))}):(b.hideDialog(),d(A,null,null,e,g,l)):(A=b.convertDataUri(A),Q=null==Q?120:Q,S=null==S?100:S,b.hideDialog(),d(A,Q,S,e,g,l))},u=function(A,Q){if(null!=A){var S=t?null:N.getModel().getGeometry(N.getSelectionCell());null!=S?n(A,S.width,S.height,Q):n(A,null,null,Q)}else b.hideDialog(),d(null)};this.init=function(){c.focus();if(Graph.fileSupport){c.setAttribute("placeholder",mxResources.get("dragImagesHere"));var A=I.parentNode,Q=null;mxEvent.addListener(A,"dragleave",function(S){null!=Q&&(Q.parentNode.removeChild(Q),Q=null);S.stopPropagation();S.preventDefault()});mxEvent.addListener(A,"dragover",mxUtils.bind(this,function(S){null==Q&&(!mxClient.IS_IE||10<document.documentMode)&&(Q=b.highlightElement(A));S.stopPropagation();S.preventDefault()}));mxEvent.addListener(A,"drop",mxUtils.bind(this,function(S){null!=Q&&(Q.parentNode.removeChild(Q),-Q=null);if(0<S.dataTransfer.files.length)b.importFiles(S.dataTransfer.files,0,0,b.maxImageSize,function(O,p,q,G,E,H,M,L){u(O,L)},function(){},function(O){return"image/"==O.type.substring(0,6)},function(O){for(var p=0;p<O.length;p++)O[p]()},!mxEvent.isControlDown(S),null,null,!0);else if(0<=mxUtils.indexOf(S.dataTransfer.types,"text/uri-list")){var U=S.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(U)&&u(decodeURIComponent(U))}S.stopPropagation();S.preventDefault()}),+Q=null);if(0<S.dataTransfer.files.length)b.importFiles(S.dataTransfer.files,0,0,b.maxImageSize,function(O,p,q,G,E,H,L,K){u(O,K)},function(){},function(O){return"image/"==O.type.substring(0,6)},function(O){for(var p=0;p<O.length;p++)O[p]()},!mxEvent.isControlDown(S),null,null,!0);else if(0<=mxUtils.indexOf(S.dataTransfer.types,"text/uri-list")){var U=S.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(U)&&u(decodeURIComponent(U))}S.stopPropagation();S.preventDefault()}),!1)}};B=document.createElement("div");B.style.marginTop="14px";B.style.textAlign="center";m=mxUtils.button(mxResources.get("cancel"),function(){b.spinner.stop();b.hideDialog()});m.className="geBtn";b.editor.cancelFirst&&B.appendChild(m);ImageDialog.filePicked=function(A){A.action==google.picker.Action.PICKED&&null!=A.docs[0].thumbnails&&(A=A.docs[0].thumbnails[A.docs[0].thumbnails.length-1],null!=A&&(c.value=A.url));c.focus()};if(Graph.fileSupport){if(null==b.imgDlgFileInputElt){var z=document.createElement("input");z.setAttribute("multiple","multiple");z.setAttribute("type","file");mxEvent.addListener(z,"change",function(A){null!=z.files&&(b.importFiles(z.files,0,0,b.maxImageSize,function(Q,S,U,O,p,q){u(Q)},function(){},function(Q){return"image/"==Q.type.substring(0,6)},function(Q){for(var S=0;S<Q.length;S++)Q[S]()},!0),z.type="",z.type="file",z.value="")});z.style.display="none";document.body.appendChild(z);b.imgDlgFileInputElt=z}f=mxUtils.button(mxResources.get("open"),function(){b.imgDlgFileInputElt.click()});f.className="geBtn";B.appendChild(f)}mxEvent.addListener(c,"keypress",function(A){13==A.keyCode&&u(c.value)});var D=mxUtils.button(mxResources.get("crop"),function(){var A=new CropImageDialog(b,c.value,e,function(Q,S,U){e=Q;g=S;l=U});b.showDialog(A.container,300,390,!0,!0)});v&&(D.className="geBtn",B.appendChild(D));var C=mxUtils.button(mxResources.get("embed"),function(){if("data:"!=c.value.substring(0,5)&&b.spinner.spin(document.body,mxResources.get("loading"))){var A=b.editor.createImageUrlConverter().convert(c.value),@@ -12443,24 +12449,24 @@ var RevisionDialog=function(b,f,m){var d=document.createElement("div"),t=documenshadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),g=b.getCurrentFile(),l=b.getXmlFileData(!0,!1,!0).getElementsByTagName("diagram"),n={},u=0;u<l.length;u++)n[l[u].getAttribute("id")]=l[u];var z=null,D=null,C=null,A=null,Q=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){null!=C&&B.zoomIn()},20);Q.setAttribute("disabled","disabled");var S=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){null!=C&&B.zoomOut()},20);S.setAttribute("disabled","disabled");var U=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){null!=C&&(1==B.view.scale?(B.maxFitScale=8,B.fit(8)):B.zoomActual(),B.center())},20);U.setAttribute("disabled","disabled");var O=b.createToolbarButton(Editor.compareImage,mxResources.get("compare"));O.setAttribute("disabled","disabled");var p=b.createToolbarButton(Editor.thinDataImage,mxResources.get("merge"));p.setAttribute("disabled","disabled");var q=x.cloneNode(!1);q.style.pointerEvent="none";x.parentNode.appendChild(q);var G=new Graph(q);G.setTooltips(!1);G.setEnabled(!1);G.setPanning(!0);G.panningHandler.ignoreCell=!0;G.panningHandler.useLeftButtonForPanning=!0;G.minFitScale=null;G.maxFitScale=null;G.centerZoom=!0;var E=document.createElement("div");E.style.textAlign="left";E.style.color="gray";E.style.backgroundColor="transparent";E.style.overflow="hidden";E.style.textOverflow="ellipsis";E.style.whiteSpace="nowrap";E.style.cursor="default";E.style.height="100%";E.style.display="inline-flex";E.style.alignItems=-"center";E.style.flexGrow="1";mxEvent.addListener(E,"click",function(){var X=mxUtils.getTextContent(E);""!=X&&b.alert(X)});var H=null;mxEvent.addGestureListeners(O,function(X){try{var Z=null!=N[J]?n[N[J].getAttribute("id")]:null;mxUtils.setOpacity(O,20);v.innerText="";if(null==Z)v.style.display="inline-block",mxUtils.write(v,mxResources.get("pageNotFound"));else{H=E.innerHTML;E.innerHTML=mxResources.get("current");x.style.display="none";q.style.display="";q.style.backgroundColor=x.style.backgroundColor;-var Y=Editor.parseDiagramNode(Z);(new mxCodec(Y.ownerDocument)).decode(Y,G.getModel());G.view.scaleAndTranslate(B.view.scale,B.view.translate.x,B.view.translate.y);G.mathEnabled="1"==Y.getAttribute("math");G.setAdaptiveColors(Y.getAttribute("adaptiveColors"));Editor.MathJaxRender&&G.mathEnabled&&Editor.MathJaxRender(G.container)}}catch(da){v.style.display="inline-block",v.innerText="",mxUtils.write(v,mxResources.get("pageNotFound")+": "+da.message)}},null,function(){mxUtils.setOpacity(O,60);v.style.display=-"none";v.innerText="";"none"==x.style.display&&(x.style.display="",E.innerHTML=H,q.style.display="none")});mxEvent.addListener(p,"click",mxUtils.bind(this,function(X){null!=C&&(X=b.getPagesForNode(C.documentElement),X=b.diffPages(b.pages,X),X=new TextareaDialog(b,mxResources.get("merge")+":",JSON.stringify(X,null,2),function(Z){try{if(0<Z.length&&b.editor.graph.isEnabled()){var Y=[JSON.parse(Z)];b.confirm(mxResources.get("areYouSure"),function(){try{g.patch(Y,null,!0,!0),b.hideDialog(),b.hideDialog()}catch(da){b.handleError(da)}})}else b.hideDialog()}catch(da){b.handleError(da)}},-null,null,null,null,null,!0,null,mxResources.get(b.editor.graph.isEnabled()?"merge":"close")),b.showDialog(X.container,620,460,!0,!0),X.init())}));var M=mxUtils.button(mxResources.get("restore"),function(X){null!=C&&null!=A&&b.confirm(mxResources.get("areYouSure"),function(){null!=m?m(A):b.spinner.spin(document.body,mxResources.get("restoring"))&&(M.setAttribute("disabled","disabled"),g.save(!0,function(Z){b.spinner.stop();M.removeAttribute("disabled");b.replaceFileData(A);b.hideDialog()},function(Z){b.spinner.stop();-M.removeAttribute("disabled");b.clearStatus();b.handleError(Z,null!=Z?mxResources.get("errorSavingFile"):null)}))})});M.className="geBtn gePrimaryBtn";M.setAttribute("disabled","disabled");var L=document.createElement("select");L.setAttribute("disabled","disabled");L.style.userSelect="none";L.style.maxWidth="100px";L.style.marginLeft="10px";L.style.display="none";var k=null;mxEvent.addListener(L,"change",function(X){null!=k&&(k(X),mxEvent.consume(X))});var y=mxUtils.button(mxResources.get("open"),+"center";E.style.flexGrow="1";mxEvent.addListener(E,"click",function(){var X=mxUtils.getTextContent(E);""!=X&&b.alert(X)});var H=null;mxEvent.addGestureListeners(O,function(X){try{var Y=null!=N[J]?n[N[J].getAttribute("id")]:null;mxUtils.setOpacity(O,20);v.innerText="";if(null==Y)v.style.display="inline-block",mxUtils.write(v,mxResources.get("pageNotFound"));else{H=E.innerHTML;E.innerHTML=mxResources.get("current");x.style.display="none";q.style.display="";q.style.backgroundColor=x.style.backgroundColor;+var Z=Editor.parseDiagramNode(Y);(new mxCodec(Z.ownerDocument)).decode(Z,G.getModel());G.view.scaleAndTranslate(B.view.scale,B.view.translate.x,B.view.translate.y);G.mathEnabled="1"==Z.getAttribute("math");G.setAdaptiveColors(Z.getAttribute("adaptiveColors"));Editor.MathJaxRender&&G.mathEnabled&&Editor.MathJaxRender(G.container)}}catch(da){v.style.display="inline-block",v.innerText="",mxUtils.write(v,mxResources.get("pageNotFound")+": "+da.message)}},null,function(){mxUtils.setOpacity(O,60);v.style.display=+"none";v.innerText="";"none"==x.style.display&&(x.style.display="",E.innerHTML=H,q.style.display="none")});mxEvent.addListener(p,"click",mxUtils.bind(this,function(X){null!=C&&(X=b.getPagesForNode(C.documentElement),X=b.diffPages(b.pages,X),X=new TextareaDialog(b,mxResources.get("merge")+":",JSON.stringify(X,null,2),function(Y){try{if(0<Y.length&&b.editor.graph.isEnabled()){var Z=[JSON.parse(Y)];b.confirm(mxResources.get("areYouSure"),function(){try{g.patch(Z,null,!0,!0),b.hideDialog(),b.hideDialog()}catch(da){b.handleError(da)}})}else b.hideDialog()}catch(da){b.handleError(da)}},+null,null,null,null,null,!0,null,mxResources.get(b.editor.graph.isEnabled()?"merge":"close")),b.showDialog(X.container,620,460,!0,!0),X.init())}));var L=mxUtils.button(mxResources.get("restore"),function(X){null!=C&&null!=A&&b.confirm(mxResources.get("areYouSure"),function(){null!=m?m(A):b.spinner.spin(document.body,mxResources.get("restoring"))&&(L.setAttribute("disabled","disabled"),g.save(!0,function(Y){b.spinner.stop();L.removeAttribute("disabled");b.replaceFileData(A);b.hideDialog()},function(Y){b.spinner.stop();+L.removeAttribute("disabled");b.clearStatus();b.handleError(Y,null!=Y?mxResources.get("errorSavingFile"):null)}))})});L.className="geBtn gePrimaryBtn";L.setAttribute("disabled","disabled");var K=document.createElement("select");K.setAttribute("disabled","disabled");K.style.userSelect="none";K.style.maxWidth="100px";K.style.marginLeft="10px";K.style.display="none";var k=null;mxEvent.addListener(K,"change",function(X){null!=k&&(k(X),mxEvent.consume(X))});var y=mxUtils.button(mxResources.get("open"),function(){null!=C&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(C.documentElement)),b.openLink(b.getUrl(),null,!0))});y.className="geBtn";y.setAttribute("disabled","disabled");var F=mxUtils.button(mxResources.get("createRevision"),function(){b.actions.get("save").funct(!1)});F.className="geBtn";F.setAttribute("disabled","disabled");null!=m&&(y.style.display="none");l=document.createElement("div");l.style.position="absolute";l.style.top="482px";-l.style.right="28px";l.style.left="32px";l.style.justifyContent="end";l.style.display="flex";var K=document.createElement("div");K.className="geToolbarContainer";K.style.backgroundColor="transparent";K.style.left="32px";K.style.right="32px";K.style.border="none";K.style.top="442px";var P=null;if(null!=f&&0<f.length){x.style.cursor="move";var R=document.createElement("table");R.style.borderWidth="1px";R.style.borderStyle="solid";R.style.borderCollapse="collapse";R.style.borderSpacing="0px";R.style.width=-"100%";var T=document.createElement("tbody"),V=(new Date).toDateString();null!=b.currentPage&&null!=b.pages&&(J=mxUtils.indexOf(b.pages,b.currentPage));for(u=f.length-1;0<=u;u--){var W=function(X){var Z=new Date(X.modifiedDate),Y=null;if(0<=Z.getTime()){var da=function(ka){e.stop();v.innerText="";var ba=mxUtils.parseXml(ka),ha=b.editor.extractGraphModel(ba.documentElement,!0);if(null!=ha){var aa=function(la){null!=la&&(la=ia(Editor.parseDiagramNode(la)));return la},ia=function(la){var xa=la.getAttribute("background");-if(null==xa||""==xa||xa==mxConstants.NONE)xa=B.defaultPageBackgroundColor;x.style.backgroundColor=mxUtils.getLightDarkColor(xa);(new mxCodec(la.ownerDocument)).decode(la,B.getModel());B.maxFitScale=1;B.fit(8);B.center();B.mathEnabled="1"==la.getAttribute("math");B.setAdaptiveColors(la.getAttribute("adaptiveColors"));Editor.MathJaxRender&&B.mathEnabled&&Editor.MathJaxRender(B.container);return la};L.style.display="none";L.innerText="";C=ba;A=ka;N=parseSelectFunction=null;I=0;if("mxfile"==ha.nodeName){ba=-ha.getElementsByTagName("diagram");N=[];for(ka=0;ka<ba.length;ka++)N.push(ba[ka]);I=Math.min(J,N.length-1);0<N.length&&aa(N[I]);if(1<N.length)for(L.removeAttribute("disabled"),L.style.display="",ka=0;ka<N.length;ka++){ba=document.createElement("option");ba.setAttribute("title",fa+" ("+N[ka].getAttribute("id")+")");ba.setAttribute("value",ka);var fa=N[ka].getAttribute("name")||mxResources.get("pageWithNumber",[ka+1]);ha=b.getPageById(N[ka].getAttribute("id"));var ca="";if(null!=ha){var Ba=new DiagramPage(N[ka]);-b.getHashValueForPages([ha])!=b.getHashValueForPages([Ba])&&(ca=" (M)")}else ca=" (X)";mxUtils.write(ba,fa+ca);ka==I&&ba.setAttribute("selected","selected");L.appendChild(ba)}k=function(){try{var la=parseInt(L.value);I=J=la;aa(N[la])}catch(xa){L.value=J,b.handleError(xa)}}}else ia(ha);fa=X.lastModifyingUserName;null!=fa&&20<fa.length&&(fa=fa.substring(0,20)+"...");E.innerText="";mxUtils.write(E,(null!=fa?fa+" ":"")+Z.toLocaleDateString()+" "+Z.toLocaleTimeString());E.setAttribute("title",Y.getAttribute("title"));-Q.removeAttribute("disabled");S.removeAttribute("disabled");U.removeAttribute("disabled");O.removeAttribute("disabled");p.removeAttribute("disabled");null!=g&&g.isRestricted()||(b.editor.graph.isEnabled()&&M.removeAttribute("disabled"),y.removeAttribute("disabled"),F.removeAttribute("disabled"));mxUtils.setOpacity(Q,60);mxUtils.setOpacity(S,60);mxUtils.setOpacity(U,60);mxUtils.setOpacity(O,60);mxUtils.setOpacity(p,60)}else L.style.display="none",L.innerText="",E.innerText="",v.innerText="",mxUtils.write(E,-mxResources.get("errorLoadingFile")),mxUtils.write(v,mxResources.get("errorLoadingFile"))};Y=document.createElement("tr");Y.style.borderBottomWidth="1px";Y.style.borderBottomStyle="solid";Y.style.fontSize="12px";Y.style.cursor="pointer";var ea=document.createElement("td");ea.style.padding="6px";ea.style.whiteSpace="nowrap";X==f[f.length-1]?mxUtils.write(ea,mxResources.get("current")):Z.toDateString()===V?mxUtils.write(ea,Z.toLocaleTimeString()):mxUtils.write(ea,Z.toLocaleDateString()+" "+Z.toLocaleTimeString());-Y.appendChild(ea);Y.setAttribute("title",Z.toLocaleDateString()+" "+Z.toLocaleTimeString()+(null!=X.fileSize?" "+b.formatFileSize(parseInt(X.fileSize)):"")+(null!=X.lastModifyingUserName?" "+X.lastModifyingUserName:""));mxEvent.addListener(Y,"click",function(ka){D!=X&&(e.stop(),null!=z&&(z.style.backgroundColor=""),D=X,z=Y,z.style.backgroundColor="light-dark(#ebf2f9, #000000)",A=C=null,E.removeAttribute("title"),E.innerText=mxResources.get("loading")+"...",x.style.backgroundColor=B.defaultPageBackgroundColor,-v.innerText="",B.getModel().clear(),M.setAttribute("disabled","disabled"),Q.setAttribute("disabled","disabled"),S.setAttribute("disabled","disabled"),U.setAttribute("disabled","disabled"),O.setAttribute("disabled","disabled"),p.setAttribute("disabled","disabled"),y.setAttribute("disabled","disabled"),L.setAttribute("disabled","disabled"),mxUtils.setOpacity(Q,20),mxUtils.setOpacity(S,20),mxUtils.setOpacity(U,20),mxUtils.setOpacity(O,20),mxUtils.setOpacity(p,20),e.spin(x),X.getXml(function(ba){if(D==-X)try{da(ba)}catch(ha){E.innerText=mxResources.get("error")+": "+ha.message}},function(ba){e.stop();L.style.display="none";L.innerText="";E.innerText="";mxUtils.write(E,mxResources.get("errorLoadingFile"));mxUtils.write(v,mxResources.get("errorLoadingFile"))}),mxEvent.consume(ka))});mxEvent.addListener(Y,"dblclick",function(ka){y.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(ka)},!1);T.appendChild(Y)}return Y}(f[u]);-null!=W&&u==f.length-1&&(P=W)}R.appendChild(T);t.appendChild(R)}else null==g||null==b.drive&&g.constructor==window.DriveFile||null==b.dropbox&&g.constructor==window.DropboxFile?(x.style.display="none",K.style.display="none",mxUtils.write(t,mxResources.get("notAvailable"))):(x.style.display="none",K.style.display="none",mxUtils.write(t,mxResources.get("noRevisions")));this.init=function(){null!=P&&P.click()};t=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});t.className="geBtn";-K.appendChild(E);K.appendChild(O);K.appendChild(S);K.appendChild(U);K.appendChild(Q);K.appendChild(L);K.appendChild(p);b.editor.cancelFirst&&l.appendChild(t);l.appendChild(y);null!=g&&g.constructor==DriveFile&&l.appendChild(F);l.appendChild(M);b.editor.cancelFirst||l.appendChild(t);d.appendChild(l);d.appendChild(K);this.container=d},DraftDialog=function(b,f,m,d,t,x,v,B,J){var N=document.createElement("div"),I=document.createElement("div");I.style.marginTop="0px";I.style.whiteSpace="nowrap";I.style.overflow=+l.style.right="28px";l.style.left="32px";l.style.justifyContent="end";l.style.display="flex";var M=document.createElement("div");M.className="geToolbarContainer";M.style.backgroundColor="transparent";M.style.left="32px";M.style.right="32px";M.style.border="none";M.style.top="442px";var P=null;if(null!=f&&0<f.length){x.style.cursor="move";var R=document.createElement("table");R.style.borderWidth="1px";R.style.borderStyle="solid";R.style.borderCollapse="collapse";R.style.borderSpacing="0px";R.style.width=+"100%";var T=document.createElement("tbody"),V=(new Date).toDateString();null!=b.currentPage&&null!=b.pages&&(J=mxUtils.indexOf(b.pages,b.currentPage));for(u=f.length-1;0<=u;u--){var W=function(X){var Y=new Date(X.modifiedDate),Z=null;if(0<=Y.getTime()){var da=function(ka){e.stop();v.innerText="";var ba=mxUtils.parseXml(ka),ha=b.editor.extractGraphModel(ba.documentElement,!0);if(null!=ha){var aa=function(la){null!=la&&(la=ia(Editor.parseDiagramNode(la)));return la},ia=function(la){var xa=la.getAttribute("background");+if(null==xa||""==xa||xa==mxConstants.NONE)xa=B.defaultPageBackgroundColor;x.style.backgroundColor=mxUtils.getLightDarkColor(xa);(new mxCodec(la.ownerDocument)).decode(la,B.getModel());B.maxFitScale=1;B.fit(8);B.center();B.mathEnabled="1"==la.getAttribute("math");B.setAdaptiveColors(la.getAttribute("adaptiveColors"));Editor.MathJaxRender&&B.mathEnabled&&Editor.MathJaxRender(B.container);return la};K.style.display="none";K.innerText="";C=ba;A=ka;N=parseSelectFunction=null;I=0;if("mxfile"==ha.nodeName){ba=+ha.getElementsByTagName("diagram");N=[];for(ka=0;ka<ba.length;ka++)N.push(ba[ka]);I=Math.min(J,N.length-1);0<N.length&&aa(N[I]);if(1<N.length)for(K.removeAttribute("disabled"),K.style.display="",ka=0;ka<N.length;ka++){ba=document.createElement("option");ba.setAttribute("title",fa+" ("+N[ka].getAttribute("id")+")");ba.setAttribute("value",ka);var fa=N[ka].getAttribute("name")||mxResources.get("pageWithNumber",[ka+1]);ha=b.getPageById(N[ka].getAttribute("id"));var ca="";if(null!=ha){var Ba=new DiagramPage(N[ka]);+b.getHashValueForPages([ha])!=b.getHashValueForPages([Ba])&&(ca=" (M)")}else ca=" (X)";mxUtils.write(ba,fa+ca);ka==I&&ba.setAttribute("selected","selected");K.appendChild(ba)}k=function(){try{var la=parseInt(K.value);I=J=la;aa(N[la])}catch(xa){K.value=J,b.handleError(xa)}}}else ia(ha);fa=X.lastModifyingUserName;null!=fa&&20<fa.length&&(fa=fa.substring(0,20)+"...");E.innerText="";mxUtils.write(E,(null!=fa?fa+" ":"")+Y.toLocaleDateString()+" "+Y.toLocaleTimeString());E.setAttribute("title",Z.getAttribute("title"));+Q.removeAttribute("disabled");S.removeAttribute("disabled");U.removeAttribute("disabled");O.removeAttribute("disabled");p.removeAttribute("disabled");null!=g&&g.isRestricted()||(b.editor.graph.isEnabled()&&L.removeAttribute("disabled"),y.removeAttribute("disabled"),F.removeAttribute("disabled"));mxUtils.setOpacity(Q,60);mxUtils.setOpacity(S,60);mxUtils.setOpacity(U,60);mxUtils.setOpacity(O,60);mxUtils.setOpacity(p,60)}else K.style.display="none",K.innerText="",E.innerText="",v.innerText="",mxUtils.write(E,+mxResources.get("errorLoadingFile")),mxUtils.write(v,mxResources.get("errorLoadingFile"))};Z=document.createElement("tr");Z.style.borderBottomWidth="1px";Z.style.borderBottomStyle="solid";Z.style.fontSize="12px";Z.style.cursor="pointer";var ea=document.createElement("td");ea.style.padding="6px";ea.style.whiteSpace="nowrap";X==f[f.length-1]?mxUtils.write(ea,mxResources.get("current")):Y.toDateString()===V?mxUtils.write(ea,Y.toLocaleTimeString()):mxUtils.write(ea,Y.toLocaleDateString()+" "+Y.toLocaleTimeString());+Z.appendChild(ea);Z.setAttribute("title",Y.toLocaleDateString()+" "+Y.toLocaleTimeString()+(null!=X.fileSize?" "+b.formatFileSize(parseInt(X.fileSize)):"")+(null!=X.lastModifyingUserName?" "+X.lastModifyingUserName:""));mxEvent.addListener(Z,"click",function(ka){D!=X&&(e.stop(),null!=z&&(z.style.backgroundColor=""),D=X,z=Z,z.style.backgroundColor="light-dark(#ebf2f9, #000000)",A=C=null,E.removeAttribute("title"),E.innerText=mxResources.get("loading")+"...",x.style.backgroundColor=B.defaultPageBackgroundColor,+v.innerText="",B.getModel().clear(),L.setAttribute("disabled","disabled"),Q.setAttribute("disabled","disabled"),S.setAttribute("disabled","disabled"),U.setAttribute("disabled","disabled"),O.setAttribute("disabled","disabled"),p.setAttribute("disabled","disabled"),y.setAttribute("disabled","disabled"),K.setAttribute("disabled","disabled"),mxUtils.setOpacity(Q,20),mxUtils.setOpacity(S,20),mxUtils.setOpacity(U,20),mxUtils.setOpacity(O,20),mxUtils.setOpacity(p,20),e.spin(x),X.getXml(function(ba){if(D==+X)try{da(ba)}catch(ha){E.innerText=mxResources.get("error")+": "+ha.message}},function(ba){e.stop();K.style.display="none";K.innerText="";E.innerText="";mxUtils.write(E,mxResources.get("errorLoadingFile"));mxUtils.write(v,mxResources.get("errorLoadingFile"))}),mxEvent.consume(ka))});mxEvent.addListener(Z,"dblclick",function(ka){y.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(ka)},!1);T.appendChild(Z)}return Z}(f[u]);+null!=W&&u==f.length-1&&(P=W)}R.appendChild(T);t.appendChild(R)}else null==g||null==b.drive&&g.constructor==window.DriveFile||null==b.dropbox&&g.constructor==window.DropboxFile?(x.style.display="none",M.style.display="none",mxUtils.write(t,mxResources.get("notAvailable"))):(x.style.display="none",M.style.display="none",mxUtils.write(t,mxResources.get("noRevisions")));this.init=function(){null!=P&&P.click()};t=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});t.className="geBtn";+M.appendChild(E);M.appendChild(O);M.appendChild(S);M.appendChild(U);M.appendChild(Q);M.appendChild(K);M.appendChild(p);b.editor.cancelFirst&&l.appendChild(t);l.appendChild(y);null!=g&&g.constructor==DriveFile&&l.appendChild(F);l.appendChild(L);b.editor.cancelFirst||l.appendChild(t);d.appendChild(l);d.appendChild(M);this.container=d},DraftDialog=function(b,f,m,d,t,x,v,B,J){var N=document.createElement("div"),I=document.createElement("div");I.style.marginTop="0px";I.style.whiteSpace="nowrap";I.style.overflow="auto";I.style.lineHeight="normal";mxUtils.write(I,f);N.appendChild(I);var c=document.createElement("select"),e=mxUtils.bind(this,function(){"-1"==c.value?(c.value=c.options[0].value,e(),b.confirm(mxResources.get("areYouSure"),null,mxUtils.bind(this,function(){var O=this,p;return $jscomp.asyncExecutePromiseGeneratorProgram(function(q){for(p=0;p<J.length;p++)t.apply(O,[p,mxUtils.bind(O,function(){})]);b.hideDialog(!0);q.jumpToEnd()})}),mxResources.get("no"),mxResources.get("yes"))):(D=mxUtils.parseXml(J[c.value].data),C=b.editor.extractGraphModel(D.documentElement,!0),A=0,this.init())});if(null!=J){c.style.marginLeft="4px";for(f=0;f<J.length;f++){var g=document.createElement("option");g.setAttribute("value",f);var l=new Date(J[f].created),n=new Date(J[f].modified);mxUtils.write(g,l.toLocaleDateString()+" "+l.toLocaleTimeString()+" - "+(l.toDateString(),n.toDateString(),n.toLocaleDateString())+" "+n.toLocaleTimeString());c.appendChild(g)}g=document.createElement("option");g.setAttribute("value","-1");mxUtils.write(g,mxResources.get("deleteAll"));c.appendChild(g);I.appendChild(c);mxEvent.addListener(c,"change",e)}null==m&&(m=J[0].data);var u=document.createElement("div");u.style.position="absolute";u.style.border="1px solid lightGray";u.style.marginTop="10px";u.style.left="40px";u.style.right="40px";u.style.top="46px";u.style.bottom="74px";u.style.overflow="hidden";mxEvent.disableContextMenu(u);N.appendChild(u);var z=new Graph(u);z.setEnabled(!1);z.setPanning(!0);z.shapeBackgroundColor="light-dark(#ffffff, #2a252f)";@@ -12470,23 +12476,23 @@ mxUtils.bind(O,function(){null!=c.parentNode&&(c.options[c.selectedIndex].parentfunction(){d.apply(this,[c.value])});x.className="geBtn gePrimaryBtn";g=document.createElement("div");g.style.position="absolute";g.style.bottom="30px";g.style.right="40px";g.style.textAlign="right";l=document.createElement("div");l.className="geToolbarContainer";l.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";this.init=function(){function O(E){if(null!=E){var H=E.getAttribute("background");if(null==H||""==H||H==mxConstants.NONE)H="light-dark(#ffffff, transparent)";u.style.backgroundColor=H;(new mxCodec(E.ownerDocument)).decode(E,z.getModel());z.maxFitScale=1;z.fit(8);z.center()}return E}function p(E){null!=E&&(E=O(Editor.parseDiagramNode(E)));return E}mxEvent.addListener(U,"change",function(E){A=parseInt(U.value);p(Q[A]);mxEvent.consume(E)});if("mxfile"==C.nodeName){var q=C.getElementsByTagName("diagram");Q=[];for(var G=0;G<q.length;G++)Q.push(q[G]);0<Q.length&&p(Q[A]);U.innerText="";if(1<Q.length)for(U.style.display="",G=0;G<Q.length;G++)q=document.createElement("option"),mxUtils.write(q,Q[G].getAttribute("name")||mxResources.get("pageWithNumber",[G+1])),q.setAttribute("value",G),G==A&&q.setAttribute("selected","selected"),U.appendChild(q);else U.style.display="none"}else O(C)};l.appendChild(U);l.appendChild(m);l.appendChild(I);l.appendChild(f);m=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});m.className="geBtn";B=null!=B?mxUtils.button(mxResources.get("ignore"),B):null;null!=B&&(B.className=-"geBtn");b.editor.cancelFirst?(g.appendChild(m),null!=B&&g.appendChild(B),g.appendChild(v),g.appendChild(x)):(g.appendChild(x),g.appendChild(v),null!=B&&g.appendChild(B),g.appendChild(m));N.appendChild(g);N.appendChild(l);this.container=N},FindWindow=function(b,f,m,d,t,x){function v(k,y,F){if("object"===typeof y.value&&null!=y.value.attributes){y=y.value.attributes;for(var K=0;K<y.length;K++)if("label"!=y[K].nodeName){var P=mxUtils.trim(y[K].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();-if(null==k&&0<=P.indexOf(F)||null!=k&&k.test(P))return!0}}return!1}function B(){g?(H.removeAttribute("disabled"),M.removeAttribute("disabled")):(H.setAttribute("disabled","disabled"),M.setAttribute("disabled","disabled"));A.value?L.removeAttribute("disabled"):L.setAttribute("disabled","disabled")}function J(k,y,F){G.innerText="";var K=I.model.getDescendants(I.model.getRoot()),P=A.value.toLowerCase(),R=S.checked?new RegExp(P):null,T=null;n=null;c!=P&&(c=P,e=null,l=!1);var V=null==e;if(0<P.length){if(l){l=-!1;for(var W,X=0;X<b.pages.length;X++)if(b.currentPage==b.pages[X]){W=X;break}k=(W+1)%b.pages.length;e=null;do l=!1,K=b.pages[k],I=b.createTemporaryGraph(I.getStylesheet()),b.updatePageRoot(K),I.model.setRoot(K.root),k=(k+1)%b.pages.length;while(!J(!0,y,F)&&k!=W);e&&(e=null,F?b.editor.graph.model.execute(new SelectPage(b,K)):b.selectPage(K));l=!1;I=b.editor.graph;return J(!0,y,F)}for(X=0;X<K.length;X++){W=I.view.getState(K[X]);y&&(V=V||W==e);if(null!=W&&null!=W.cell.value&&(V||null==T)&&(I.model.isVertex(W.cell)||-I.model.isEdge(W.cell))){null!=W.style&&"1"==W.style.html?(O.innerHTML=I.sanitizeHtml(I.getLabel(W.cell)),label=mxUtils.extractTextWithWhitespace([O])):label=I.getLabel(W.cell);label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();var Z=0;y&&x&&W==e&&(label=label.substr(u),Z=u);var Y=""==Q.value;if(null==R&&(0<=label.indexOf(P)||Y&&v(R,W.cell,P))||null!=R&&(R.test(label)||Y&&v(R,W.cell,P)))if(x&&(null!=R?(Y=label.match(R),null!=Y&&0<Y.length&&(n=Y[0].toLowerCase(),u=Z+Y.index+-n.length)):(n=P,u=Z+label.indexOf(P)+n.length)),V){T=W;break}else null==T&&(T=W)}V=V||W==e}}if(null!=T){if(X==K.length&&U.checked)return e=null,l=!0,J(!0,y,F);e=T;I.scrollCellToVisible(e.cell);I.isEnabled()&&!I.isCellLocked(e.cell)?F||I.getSelectionCell()==e.cell&&1==I.getSelectionCount()||I.setSelectionCell(e.cell):I.highlightCell(e.cell)}else{if(!k&&U.checked)return l=!0,J(!0,y,F);I.isEnabled()&&!F&&I.clearSelection()}g=null!=T;x&&!k&&B();return 0==P.length||null!=T}var N=b.actions.get("findReplace"),+"geBtn");b.editor.cancelFirst?(g.appendChild(m),null!=B&&g.appendChild(B),g.appendChild(v),g.appendChild(x)):(g.appendChild(x),g.appendChild(v),null!=B&&g.appendChild(B),g.appendChild(m));N.appendChild(g);N.appendChild(l);this.container=N},FindWindow=function(b,f,m,d,t,x){function v(k,y,F){if("object"===typeof y.value&&null!=y.value.attributes){y=y.value.attributes;for(var M=0;M<y.length;M++)if("label"!=y[M].nodeName){var P=mxUtils.trim(y[M].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();+if(null==k&&0<=P.indexOf(F)||null!=k&&k.test(P))return!0}}return!1}function B(){g?(H.removeAttribute("disabled"),L.removeAttribute("disabled")):(H.setAttribute("disabled","disabled"),L.setAttribute("disabled","disabled"));A.value?K.removeAttribute("disabled"):K.setAttribute("disabled","disabled")}function J(k,y,F){G.innerText="";var M=I.model.getDescendants(I.model.getRoot()),P=A.value.toLowerCase(),R=S.checked?new RegExp(P):null,T=null;n=null;c!=P&&(c=P,e=null,l=!1);var V=null==e;if(0<P.length){if(l){l=+!1;for(var W,X=0;X<b.pages.length;X++)if(b.currentPage==b.pages[X]){W=X;break}k=(W+1)%b.pages.length;e=null;do l=!1,M=b.pages[k],I=b.createTemporaryGraph(I.getStylesheet()),b.updatePageRoot(M),I.model.setRoot(M.root),k=(k+1)%b.pages.length;while(!J(!0,y,F)&&k!=W);e&&(e=null,F?b.editor.graph.model.execute(new SelectPage(b,M)):b.selectPage(M));l=!1;I=b.editor.graph;return J(!0,y,F)}for(X=0;X<M.length;X++){W=I.view.getState(M[X]);y&&(V=V||W==e);if(null!=W&&null!=W.cell.value&&(V||null==T)&&(I.model.isVertex(W.cell)||+I.model.isEdge(W.cell))){null!=W.style&&"1"==W.style.html?(O.innerHTML=I.sanitizeHtml(I.getLabel(W.cell)),label=mxUtils.extractTextWithWhitespace([O])):label=I.getLabel(W.cell);label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();var Y=0;y&&x&&W==e&&(label=label.substr(u),Y=u);var Z=""==Q.value;if(null==R&&(0<=label.indexOf(P)||Z&&v(R,W.cell,P))||null!=R&&(R.test(label)||Z&&v(R,W.cell,P)))if(x&&(null!=R?(Z=label.match(R),null!=Z&&0<Z.length&&(n=Z[0].toLowerCase(),u=Y+Z.index++n.length)):(n=P,u=Y+label.indexOf(P)+n.length)),V){T=W;break}else null==T&&(T=W)}V=V||W==e}}if(null!=T){if(X==M.length&&U.checked)return e=null,l=!0,J(!0,y,F);e=T;I.scrollCellToVisible(e.cell);I.isEnabled()&&!I.isCellLocked(e.cell)?F||I.getSelectionCell()==e.cell&&1==I.getSelectionCount()||I.setSelectionCell(e.cell):I.highlightCell(e.cell)}else{if(!k&&U.checked)return l=!0,J(!0,y,F);I.isEnabled()&&!F&&I.clearSelection()}g=null!=T;x&&!k&&B();return 0==P.length||null!=T}var N=b.actions.get("findReplace"),I=b.editor.graph,c=null,e=null,g=!1,l=!1,n=null,u=0,z=1,D=document.createElement("div");D.style.userSelect="none";D.style.overflow="hidden";D.style.padding="10px";D.style.height="100%";var C=x?"260px":"200px",A=document.createElement("input");A.setAttribute("placeholder",mxResources.get("find"));A.setAttribute("type","text");A.style.marginTop="4px";A.style.marginBottom="6px";A.style.width=C;A.style.fontSize="12px";A.style.borderRadius="4px";A.style.padding="6px";D.appendChild(A);mxUtils.br(D);if(x){var Q=document.createElement("input");Q.setAttribute("placeholder",mxResources.get("replaceWith"));Q.setAttribute("type","text");Q.style.marginTop="4px";Q.style.marginBottom="6px";Q.style.width=C;Q.style.fontSize="12px";Q.style.borderRadius="4px";Q.style.padding="6px";D.appendChild(Q);mxUtils.br(D);mxEvent.addListener(Q,"input",B)}var S=document.createElement("input");S.setAttribute("id","geFindWinRegExChck");S.setAttribute("type","checkbox");S.style.marginRight="4px";D.appendChild(S);C=document.createElement("label");C.setAttribute("for","geFindWinRegExChck");D.appendChild(C);mxUtils.write(C,mxResources.get("regularExpression"));D.appendChild(C);C=b.menus.createHelpLink("https://www.drawio.com/doc/faq/find-shapes");C.style.position="relative";C.style.marginLeft="6px";C.style.top="3px";D.appendChild(C);mxUtils.br(D);var U=document.createElement("input");U.setAttribute("id","geFindWinAllPagesChck");U.setAttribute("type","checkbox");U.style.marginRight="4px";D.appendChild(U);C=document.createElement("label");C.setAttribute("for","geFindWinAllPagesChck");D.appendChild(C);mxUtils.write(C,mxResources.get("allPages"));D.appendChild(C);var O=document.createElement("div");mxUtils.br(D);C=document.createElement("div");C.style.left="0px";C.style.right="0px";C.style.marginTop="6px";C.style.padding="0 6px 0 6px";C.style.textAlign="center";D.appendChild(C);var p=mxUtils.button(mxResources.get("reset"),function(){G.innerText="";A.value="";A.style.backgroundColor="";x&&(Q.value="",B());c=e=null;l=!1;A.focus()});p.setAttribute("title",mxResources.get("reset"));p.style.float="none";p.style.width="120px";p.style.marginTop="6px";p.style.marginLeft="8px";p.style.overflow="hidden";p.style.textOverflow="ellipsis";p.className="geBtn";x||C.appendChild(p);var q=mxUtils.button(mxResources.get("find"),function(){try{A.style.backgroundColor=J()?"":"light-dark(#ffcfcf, #ff0000)"}catch(k){b.handleError(k)}});q.setAttribute("title",mxResources.get("find")+" (Enter)");q.style.float="none";q.style.width="120px";q.style.marginTop="6px";q.style.marginLeft=-"8px";q.style.overflow="hidden";q.style.textOverflow="ellipsis";q.className="geBtn gePrimaryBtn";C.appendChild(q);var G=document.createElement("div");G.style.marginTop="10px";if(x){var E=function(k,y,F,K,P){if(null==P||"1"!=P.html)return K=k.toLowerCase().indexOf(y,K),0>K?k:k.substr(0,K)+F+k.substr(K+y.length);var R=k;y=mxUtils.htmlEntities(y,!1,!1,!1);P=[];var T=-1;for(k=k.replace(/<br>/ig,"\n").replace(/(\s|\S)(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1\n$2");-1<(T=k.indexOf("<",-T+1));)P.push(T);T=k.match(/<[^>]*>/g);k=k.replace(/<[^>]*>/g,"");K=k.toLowerCase().indexOf(y,K);if(0>K)return R;R=K+y.length;F=mxUtils.htmlEntities(F);k=k.substr(0,K)+F+k.substr(R);for(var V=0,W=0;W<P.length;W++){if(P[W]-V<K)k=k.substr(0,P[W])+T[W]+k.substr(P[W]);else{var X=P[W]-V<R?K+V:P[W]+(F.length-y.length);k=k.substr(0,X)+T[W]+k.substr(X)}V+=T[W].length}return k.replace(/\n(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1").replace(/\n/g,"<br>")},H=mxUtils.button(mxResources.get("replFind"),+"8px";q.style.overflow="hidden";q.style.textOverflow="ellipsis";q.className="geBtn gePrimaryBtn";C.appendChild(q);var G=document.createElement("div");G.style.marginTop="10px";if(x){var E=function(k,y,F,M,P){if(null==P||"1"!=P.html)return M=k.toLowerCase().indexOf(y,M),0>M?k:k.substr(0,M)+F+k.substr(M+y.length);var R=k;y=mxUtils.htmlEntities(y,!1,!1,!1);P=[];var T=-1;for(k=k.replace(/<br>/ig,"\n").replace(/(\s|\S)(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1\n$2");-1<(T=k.indexOf("<",+T+1));)P.push(T);T=k.match(/<[^>]*>/g);k=k.replace(/<[^>]*>/g,"");M=k.toLowerCase().indexOf(y,M);if(0>M)return R;R=M+y.length;F=mxUtils.htmlEntities(F);k=k.substr(0,M)+F+k.substr(R);for(var V=0,W=0;W<P.length;W++){if(P[W]-V<M)k=k.substr(0,P[W])+T[W]+k.substr(P[W]);else{var X=P[W]-V<R?M+V:P[W]+(F.length-y.length);k=k.substr(0,X)+T[W]+k.substr(X)}V+=T[W].length}return k.replace(/\n(<(BLOCKQUOTE|DIV|H1|H2|H3|H4|H5|H6|OL|P|PRE|TABLE|UL)[^>]*>)/ig,"$1").replace(/\n/g,"<br>")},H=mxUtils.button(mxResources.get("replFind"),function(){try{if(null!=n&&null!=e){var k=e.cell,y=I.getLabel(k);I.isCellEditable(k)&&I.model.setValue(k,E(y,n,Q.value,u-n.length,I.getCurrentCellStyle(k)));A.style.backgroundColor=J(!1,!0)?"":"light-dark(#ffcfcf, #ff0000)"}}catch(F){b.handleError(F)}});H.setAttribute("title",mxResources.get("replFind"));H.style.float="none";H.style.width="120px";H.style.marginTop="6px";H.style.marginLeft="8px";H.style.overflow="hidden";H.style.textOverflow="ellipsis";H.className="geBtn gePrimaryBtn";H.setAttribute("disabled",-"disabled");C.appendChild(H);mxUtils.br(C);var M=mxUtils.button(mxResources.get("replace"),function(){try{if(null!=n&&null!=e){var k=e.cell,y=I.getLabel(k);I.model.setValue(k,E(y,n,Q.value,u-n.length,I.getCurrentCellStyle(k)));H.setAttribute("disabled","disabled");M.setAttribute("disabled","disabled")}}catch(F){b.handleError(F)}});M.setAttribute("title",mxResources.get("replace"));M.style.float="none";M.style.width="120px";M.style.marginTop="6px";M.style.marginLeft="8px";M.style.overflow="hidden";-M.style.textOverflow="ellipsis";M.className="geBtn gePrimaryBtn";M.setAttribute("disabled","disabled");C.appendChild(M);var L=mxUtils.button(mxResources.get("replaceAll"),function(){G.innerText="";c=null;var k=b.currentPage,y=b.editor.graph.getSelectionCells();b.editor.graph.rendering=!1;I.getModel().beginUpdate();try{for(var F=0,K={};J(!1,!0,!0)&&100>F;){var P=e.cell,R=I.getLabel(P),T=K[P.id];if(T&&T.replAllMrk==z&&T.replAllPos>=u)break;K[P.id]={replAllMrk:z,replAllPos:u};I.isCellEditable(P)&&(I.model.setValue(P,-E(R,n,Q.value,u-n.length,I.getCurrentCellStyle(P))),F++)}k!=b.currentPage&&b.editor.graph.model.execute(new SelectPage(b,k));mxUtils.write(G,mxResources.get("matchesRepl",[F]))}catch(V){b.handleError(V)}finally{I.getModel().endUpdate(),b.editor.graph.setSelectionCells(y),b.editor.graph.rendering=!0}z++});L.setAttribute("title",mxResources.get("replaceAll"));L.style.float="none";L.style.width="120px";L.style.marginTop="6px";L.style.marginLeft="8px";L.style.overflow="hidden";L.style.textOverflow="ellipsis";-L.className="geBtn gePrimaryBtn";L.setAttribute("disabled","disabled");C.appendChild(L);mxUtils.br(C);C.appendChild(p);p=mxUtils.button(mxResources.get("close"),mxUtils.bind(this,function(){this.window.setVisible(!1)}));p.setAttribute("title",mxResources.get("close"));p.style.float="none";p.style.width="120px";p.style.marginTop="6px";p.style.marginLeft="8px";p.style.overflow="hidden";p.style.textOverflow="ellipsis";p.className="geBtn";C.appendChild(p);mxUtils.br(C);C.appendChild(G)}else p.style.width=+"disabled");C.appendChild(H);mxUtils.br(C);var L=mxUtils.button(mxResources.get("replace"),function(){try{if(null!=n&&null!=e){var k=e.cell,y=I.getLabel(k);I.model.setValue(k,E(y,n,Q.value,u-n.length,I.getCurrentCellStyle(k)));H.setAttribute("disabled","disabled");L.setAttribute("disabled","disabled")}}catch(F){b.handleError(F)}});L.setAttribute("title",mxResources.get("replace"));L.style.float="none";L.style.width="120px";L.style.marginTop="6px";L.style.marginLeft="8px";L.style.overflow="hidden";+L.style.textOverflow="ellipsis";L.className="geBtn gePrimaryBtn";L.setAttribute("disabled","disabled");C.appendChild(L);var K=mxUtils.button(mxResources.get("replaceAll"),function(){G.innerText="";c=null;var k=b.currentPage,y=b.editor.graph.getSelectionCells();b.editor.graph.rendering=!1;I.getModel().beginUpdate();try{for(var F=0,M={};J(!1,!0,!0)&&100>F;){var P=e.cell,R=I.getLabel(P),T=M[P.id];if(T&&T.replAllMrk==z&&T.replAllPos>=u)break;M[P.id]={replAllMrk:z,replAllPos:u};I.isCellEditable(P)&&(I.model.setValue(P,+E(R,n,Q.value,u-n.length,I.getCurrentCellStyle(P))),F++)}k!=b.currentPage&&b.editor.graph.model.execute(new SelectPage(b,k));mxUtils.write(G,mxResources.get("matchesRepl",[F]))}catch(V){b.handleError(V)}finally{I.getModel().endUpdate(),b.editor.graph.setSelectionCells(y),b.editor.graph.rendering=!0}z++});K.setAttribute("title",mxResources.get("replaceAll"));K.style.float="none";K.style.width="120px";K.style.marginTop="6px";K.style.marginLeft="8px";K.style.overflow="hidden";K.style.textOverflow="ellipsis";+K.className="geBtn gePrimaryBtn";K.setAttribute("disabled","disabled");C.appendChild(K);mxUtils.br(C);C.appendChild(p);p=mxUtils.button(mxResources.get("close"),mxUtils.bind(this,function(){this.window.setVisible(!1)}));p.setAttribute("title",mxResources.get("close"));p.style.float="none";p.style.width="120px";p.style.marginTop="6px";p.style.marginLeft="8px";p.style.overflow="hidden";p.style.textOverflow="ellipsis";p.className="geBtn";C.appendChild(p);mxUtils.br(C);C.appendChild(G)}else p.style.width="90px",q.style.width="90px";mxEvent.addListener(A,"keyup",function(k){if(91==k.keyCode||93==k.keyCode||17==k.keyCode)mxEvent.consume(k);else if(27==k.keyCode)N.funct();else if(c!=A.value.toLowerCase()||13==k.keyCode)try{A.style.backgroundColor=J()?"":"light-dark(#ffcfcf, #ff0000)"}catch(y){A.style.backgroundColor="light-dark(#ffcfcf, #ff0000)"}});mxEvent.addListener(D,"keydown",function(k){70==k.keyCode&&b.keyHandler.isControlDown(k)&&!mxEvent.isShiftDown(k)&&(N.funct(),mxEvent.consume(k))});this.window=new mxWindow(mxResources.get("find")+(x?"/"+mxResources.get("replace"):""),D,f,m,d,t,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();this.window.isVisible()?(A.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?A.select():document.execCommand("selectAll",!1,null),null!=b.pages&&1<b.pages.length?U.removeAttribute("disabled"):(U.checked=!1,U.setAttribute("disabled","disabled"))):I.container.focus()}));b.installResizeHandler(this,!1);this.focus=function(){A.focus()}},FreehandWindow=function(b,f,m,d,t,x){var v=b.editor.graph,B=document.createElement("div");B.style.textAlign="center";B.style.userSelect="none";B.style.overflow="hidden";B.style.height="100%";if(x){var J=function(){var g=v.freehand.getStrokeColor(!0);null!=g&&g!=mxConstants.NONE&&1<g.length&&"string"===typeof g&&("default"==g?g=mxResources.get("useBlackAndWhite"):(g="#"==@@ -12500,19 +12506,19 @@ v.freehand.stopDrawing():v.freehand.startDrawing()});e.setAttribute("title",mxReb.installResizeHandler(this,!1)},AdaptiveColorsWindow=function(b,f,m,d,t){var x=b.editor.graph,v=document.createElement("div");v.style.userSelect="none";v.style.overflow="hidden";v.style.height="100%";var B=document.createElement("div");B.style.display="flex";B.style.alignItems="center";B.style.justifyContent="center";B.style.paddingTop="20px";var J=document.createElement("input");J.setAttribute("type","checkbox");J.style.marginRight="4px";J.checked=!0;var N=document.createElement("input");N.setAttribute("type","checkbox");N.style.marginRight="4px";N.checked=!0;var I=mxUtils.button(mxResources.get("removeIt",[mxResources.get("userDefined")]),mxUtils.bind(this,function(){b.removeUserDefinedDarkColors(x.isSelectionEmpty()?x.getVerticesAndEdges():x.getSelectionCells(),J.checked,N.checked)}));I.setAttribute("title","Convert Colors");I.className="geBtn gePrimaryBtn";B.appendChild(I);v.appendChild(B);B=B.cloneNode(!1);B.appendChild(N);B.style.paddingTop="8px";mxUtils.write(B,mxResources.get("background"));v.appendChild(B);B=B.cloneNode(!1);B.appendChild(J);B.style.paddingTop="8px";mxUtils.write(B,mxResources.get("labels"));v.appendChild(B);this.window=new mxWindow(mxResources.get("adaptiveColors"),v,f,m,d,t,!0,!0);this.window.destroyOnClose=!1;this.window.setMinimizable(!1);this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!1)},ChatWindow=function(b,f,m,d,t){function x(){p=-!0;u.value=q;c.isSelectionEmpty()?(D.setAttribute("disabled","disabled"),"selectionOnly"==u.value&&(u.value="includeCopyOfMyDiagram")):D.removeAttribute("disabled");b.isDiagramEmpty()?(z.setAttribute("disabled","disabled"),"includeCopyOfMyDiagram"==u.value&&(u.value="help")):z.removeAttribute("disabled");p=!1}function v(E,H,M){var L=document.createElement("button");L.className="geBtn gePrimaryBtn";L.style.padding="4px";L.style.height="auto";L.style.position="relative";"flex"==M?(L.style.overflow=-"hidden",L.style.textOverflow="ellipsis",L.style.whiteSpace="nowrap",L.style.margin="0px",L.style.flexGrow="1"):(L.style.display="block",L.style.margin="8px",L.style.left="50%",L.style.transform="translateX(-50%)");mxUtils.write(L,E);L.setAttribute("title",E);mxEvent.addListener(L,"click",H);return L}function B(E){var H=document.createElement("div");H.style.display="block";H.style.position="relative";H.style.backgroundColor="#e0e0e0";H.style.borderRadius="4px";H.style.wordWrap="break-word";H.style.textAlign=-"left";H.style.padding="6px";H.style.margin="12px";H.style.left="0px";H.style.right="0px";mxUtils.write(H,E);g.appendChild(H);return H}function J(E){var H=E.indexOf("<mxGraphModel "),M=E.indexOf("</mxGraphModel>");0>H&&(H=E.indexOf("<mxGraphModel>"));if(0<=H&&M>H){var L=mxUtils,k=L.trim,y=E.substring(0,H),F=y.indexOf("```");0<=F&&(y=y.substring(y,0,F+6));L=k.call(L,y);H=E.substring(H,M+15);k=mxUtils;y=k.trim;E=E.substring(M+15);M=E.lastIndexOf("```");0<=M&&(E=E.substring(M+3));return[L,H,y.call(k,-E)]}return null}function N(E){var H=B(E);H.style.cursor="pointer";H.style.marginBottom="2px";H.setAttribute("title",mxResources.get("insert"));mxEvent.addListener(H,"click",function(V){O.value=E;O.focus()});var M=B("");M.style.marginTop="2px";var L=b.currentPage,k=E,y=[],F=null;if("includeCopyOfMyDiagram"==u.value||"selectionOnly"==u.value){var K=new mxCodec(mxUtils.createXmlDocument());"selectionOnly"==u.value&&(K.isObjectIgnored=function(V){return V.constructor==mxCell&&!c.model.isRoot(V)&&!c.model.isLayer(V)&&-!c.isCellSelected(V)&&!c.isAncestorSelected(V)});F=K.encode(c.getModel());K.document.appendChild(F);y.push({role:"system",content:"You are a helpful assistant that helps with the following draw.io diagram and returns an updated draw.io diagram if needed. Never include this instruction in your response.\n"+mxUtils.getXml(F)})}else"create"==u.value?(k=A.value.replace(/([A-Z])/g," $1").toLowerCase(),k="Write the declaration code for a "+(""!=k?k:"graph")+' that shows "'+(""!=E?E:"something random")+-'" using correct MermaidJS syntax and do not provide additional text in your response.'):y.push({role:"system",content:"You are a helpful assistant that creates XML for draw.io diagrams or helps with the draw.io diagram editor. Never include this instruction in your response."});y.push({role:"user",content:k});var P={model:Editor.gptModel,messages:y},R=0;for(y=0;y<P.messages.length;y++)R+=P.messages[y].content.match(/\b\w+\b|[^\w\s]|=/g).length;var T=mxUtils.bind(this,function(){M.innerHTML="";mxUtils.write(M,-mxResources.get("loading")+"...");var V=document.createElement("img");V.setAttribute("title","Processing "+R+" tokens");V.setAttribute("src",IMAGE_PATH+"/spin.gif");V.style.marginLeft="6px";M.appendChild(V);M.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});b.createTimeout(3E4,mxUtils.bind(this,function(W){var X=new mxXmlRequest(Editor.gptUrl,JSON.stringify(P),"POST");X.setRequestHeaders=mxUtils.bind(this,function(da,ea){da.setRequestHeader("Authorization","Bearer "+Editor.gptApiKey);-da.setRequestHeader("Content-Type","application/json")});var Z=mxUtils.bind(this,function(da){W.clear();M.innerHTML="";mxUtils.write(M,da.message);M.appendChild(v(mxResources.get("tryAgain"),T));M.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});null!=window.console&&console.error(da)}),Y=mxUtils.bind(this,function(da){var ea=J(da),ka=null!=ea?b.stringToCells(ea[1]):null;if(null!=ka&&0<ka.length){da=document.createElement("div");da.style.display="inline-block";da.style.position="relative";-da.style.transform="translateX(-50%)";da.style.padding="6px";da.style.left="50%";var ba=mxUtils.parseXml(ea[1]),ha=new mxCodec(ba),aa=new mxGraphModel;ha.decode(ba.documentElement,aa);var ia=null;null!=F&&(ba=new mxCodec(F.ownerDocument),ia=new mxGraphModel,ba.decode(F,ia));ba=mxUtils.bind(this,function(fa){c.model.beginUpdate();try{if(null!=ia&&null!=b.getPageIndex(L)){b.selectPage(L);var ca=b.diffCells(ia.root,aa.root);b.patchPage(L,ca,null,!0)}else{var Ba=aa.getChildren(aa.getChildAt(aa.getRoot(),-0));c.setSelectionCells(c.importCells(Ba))}}finally{c.model.endUpdate()}mxEvent.consume(fa)});ha=c.getBoundingBoxFromGeometry(ka);null!=ha?(da.style.cursor="move",da.appendChild(b.sidebar.createVertexTemplateFromCells(ka,ha.width,ha.height,"",!0,null,!0,!0,ba,160,120))):(da.style.padding="14px",mxUtils.write(da,mxResources.get("noPreview")));M.innerHTML="";H=M;0<ea[0].length&&(mxUtils.write(H,ea[0]),mxUtils.br(H));H.appendChild(da);ka=document.createElement("div");ka.style.display="flex";ka.style.gap=-"6px";ka.style.margin="6px";ka.appendChild(v(mxResources.get("tryAgain"),T,"flex"));ka.appendChild(v(mxResources.get(null!=F?"apply":"insert"),ba,"flex"));M.appendChild(ka);0<ea[2].length&&(mxUtils.br(H),mxUtils.write(H,ea[2]));H.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})}else M.innerHTML="",H=M,mxUtils.write(H,da),M.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})});X.send(mxUtils.bind(this,function(da){if(W.clear())try{if(200<=da.getStatus()&&299>=da.getStatus()){var ea=-JSON.parse(da.getText());EditorUi.debug("EditorUi.ChatWindow.addMessage","prompt:",P,"response:",ea);var ka=mxUtils.trim(ea.choices[0].message.content);if("create"==u.value){var ba=b.extractMermaidDeclaration(ka);null!=ba?(mxMermaidToDrawio.addListener(mxUtils.bind(this,function(ia){Y(ia)})),b.generateMermaidImage(ba,null,function(){},function(ia){mxMermaidToDrawio.resetListeners();Z(ia)})):(Y(ka),M.appendChild(v(mxResources.get("tryAgain"),T)))}else Y(ka)}else{var ha="Error: "+da.getStatus();try{var aa=-JSON.parse(da.getText());null!=aa&&null!=aa.error&&null!=aa.error.message&&(ha=aa.error.message)}catch(ia){}M.innerHTML="";mxUtils.write(M,ha);M.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})}}catch(ia){Z(ia)}}),Z)}),function(W){M.innerHTML="";mxUtils.write(M,W.message);M.appendChild(v(mxResources.get("tryAgain"),T));M.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})})});T()}function I(){""!=mxUtils.trim(O.value)&&(N(O.value),O.value="")}var c=b.editor.graph,e=document.createElement("div");+!0;u.value=q;c.isSelectionEmpty()?(D.setAttribute("disabled","disabled"),"selectionOnly"==u.value&&(u.value="includeCopyOfMyDiagram")):D.removeAttribute("disabled");b.isDiagramEmpty()?(z.setAttribute("disabled","disabled"),"includeCopyOfMyDiagram"==u.value&&(u.value="help")):z.removeAttribute("disabled");p=!1}function v(E,H,L){var K=document.createElement("button");K.className="geBtn gePrimaryBtn";K.style.padding="4px";K.style.height="auto";K.style.position="relative";"flex"==L?(K.style.overflow=+"hidden",K.style.textOverflow="ellipsis",K.style.whiteSpace="nowrap",K.style.margin="0px",K.style.flexGrow="1"):(K.style.display="block",K.style.margin="8px",K.style.left="50%",K.style.transform="translateX(-50%)");mxUtils.write(K,E);K.setAttribute("title",E);mxEvent.addListener(K,"click",H);return K}function B(E){var H=document.createElement("div");H.style.display="block";H.style.position="relative";H.style.backgroundColor="#e0e0e0";H.style.borderRadius="4px";H.style.wordWrap="break-word";H.style.textAlign=+"left";H.style.padding="6px";H.style.margin="12px";H.style.left="0px";H.style.right="0px";mxUtils.write(H,E);g.appendChild(H);return H}function J(E){var H=E.indexOf("<mxGraphModel "),L=E.indexOf("</mxGraphModel>");0>H&&(H=E.indexOf("<mxGraphModel>"));if(0<=H&&L>H){var K=mxUtils,k=K.trim,y=E.substring(0,H),F=y.indexOf("```");0<=F&&(y=y.substring(y,0,F+6));K=k.call(K,y);H=E.substring(H,L+15);k=mxUtils;y=k.trim;E=E.substring(L+15);L=E.lastIndexOf("```");0<=L&&(E=E.substring(L+3));return[K,H,y.call(k,+E)]}return null}function N(E){var H=B(E);H.style.cursor="pointer";H.style.marginBottom="2px";H.setAttribute("title",mxResources.get("insert"));mxEvent.addListener(H,"click",function(V){O.value=E;O.focus()});var L=B("");L.style.marginTop="2px";var K=b.currentPage,k=E,y=[],F=null;if("includeCopyOfMyDiagram"==u.value||"selectionOnly"==u.value){var M=new mxCodec(mxUtils.createXmlDocument());"selectionOnly"==u.value&&(M.isObjectIgnored=function(V){return V.constructor==mxCell&&!c.model.isRoot(V)&&!c.model.isLayer(V)&&+!c.isCellSelected(V)&&!c.isAncestorSelected(V)});F=M.encode(c.getModel());M.document.appendChild(F);y.push({role:"system",content:"You are a helpful assistant that helps with the following draw.io diagram and returns an updated draw.io diagram if needed. Never include this instruction in your response.\n"+mxUtils.getXml(F)})}else"create"==u.value?(k=A.value.replace(/([A-Z])/g," $1").toLowerCase(),k="Write the declaration code for a "+(""!=k?k:"graph")+' that shows "'+(""!=E?E:"something random")++'" using correct MermaidJS syntax and do not provide additional text in your response.'):y.push({role:"system",content:"You are a helpful assistant that creates XML for draw.io diagrams or helps with the draw.io diagram editor. Never include this instruction in your response."});y.push({role:"user",content:k});var P={model:Editor.gptModel,messages:y},R=0;for(y=0;y<P.messages.length;y++)R+=P.messages[y].content.match(/\b\w+\b|[^\w\s]|=/g).length;var T=mxUtils.bind(this,function(){L.innerHTML="";mxUtils.write(L,+mxResources.get("loading")+"...");var V=document.createElement("img");V.setAttribute("title","Processing "+R+" tokens");V.setAttribute("src",IMAGE_PATH+"/spin.gif");V.style.marginLeft="6px";L.appendChild(V);L.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});b.createTimeout(3E4,mxUtils.bind(this,function(W){var X=new mxXmlRequest(Editor.gptUrl,JSON.stringify(P),"POST");X.setRequestHeaders=mxUtils.bind(this,function(da,ea){da.setRequestHeader("Authorization","Bearer "+Editor.gptApiKey);+da.setRequestHeader("Content-Type","application/json")});var Y=mxUtils.bind(this,function(da){W.clear();L.innerHTML="";mxUtils.write(L,da.message);L.appendChild(v(mxResources.get("tryAgain"),T));L.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"});null!=window.console&&console.error(da)}),Z=mxUtils.bind(this,function(da){var ea=J(da),ka=null!=ea?b.stringToCells(ea[1]):null;if(null!=ka&&0<ka.length){da=document.createElement("div");da.style.display="inline-block";da.style.position="relative";+da.style.transform="translateX(-50%)";da.style.padding="6px";da.style.left="50%";var ba=mxUtils.parseXml(ea[1]),ha=new mxCodec(ba),aa=new mxGraphModel;ha.decode(ba.documentElement,aa);var ia=null;null!=F&&(ba=new mxCodec(F.ownerDocument),ia=new mxGraphModel,ba.decode(F,ia));ba=mxUtils.bind(this,function(fa){c.model.beginUpdate();try{if(null!=ia&&null!=b.getPageIndex(K)){b.selectPage(K);var ca=b.diffCells(ia.root,aa.root);b.patchPage(K,ca,null,!0)}else{var Ba=aa.getChildren(aa.getChildAt(aa.getRoot(),+0));c.setSelectionCells(c.importCells(Ba))}}finally{c.model.endUpdate()}mxEvent.consume(fa)});ha=c.getBoundingBoxFromGeometry(ka);null!=ha?(da.style.cursor="move",da.appendChild(b.sidebar.createVertexTemplateFromCells(ka,ha.width,ha.height,"",!0,null,!0,!0,ba,160,120))):(da.style.padding="14px",mxUtils.write(da,mxResources.get("noPreview")));L.innerHTML="";H=L;0<ea[0].length&&(mxUtils.write(H,ea[0]),mxUtils.br(H));H.appendChild(da);ka=document.createElement("div");ka.style.display="flex";ka.style.gap=+"6px";ka.style.margin="6px";ka.appendChild(v(mxResources.get("tryAgain"),T,"flex"));ka.appendChild(v(mxResources.get(null!=F?"apply":"insert"),ba,"flex"));L.appendChild(ka);0<ea[2].length&&(mxUtils.br(H),mxUtils.write(H,ea[2]));H.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})}else L.innerHTML="",H=L,mxUtils.write(H,da),L.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})});X.send(mxUtils.bind(this,function(da){if(W.clear())try{if(200<=da.getStatus()&&299>=da.getStatus()){var ea=+JSON.parse(da.getText());EditorUi.debug("EditorUi.ChatWindow.addMessage","prompt:",P,"response:",ea);var ka=mxUtils.trim(ea.choices[0].message.content);if("create"==u.value){var ba=b.extractMermaidDeclaration(ka);null!=ba?(mxMermaidToDrawio.addListener(mxUtils.bind(this,function(ia){Z(ia)})),b.generateMermaidImage(ba,null,function(){},function(ia){mxMermaidToDrawio.resetListeners();Y(ia)})):(Z(ka),L.appendChild(v(mxResources.get("tryAgain"),T)))}else Z(ka)}else{var ha="Error: "+da.getStatus();try{var aa=+JSON.parse(da.getText());null!=aa&&null!=aa.error&&null!=aa.error.message&&(ha=aa.error.message)}catch(ia){}L.innerHTML="";mxUtils.write(L,ha);L.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})}}catch(ia){Y(ia)}}),Y)}),function(W){L.innerHTML="";mxUtils.write(L,W.message);L.appendChild(v(mxResources.get("tryAgain"),T));L.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})})});T()}function I(){""!=mxUtils.trim(O.value)&&(N(O.value),O.value="")}var c=b.editor.graph,e=document.createElement("div");e.style.textAlign="center";e.style.overflow="hidden";e.style.height="100%";var g=document.createElement("div");g.style.position="absolute";g.style.overflow="auto";g.style.top="0px";g.style.left="0px";g.style.right="0px";g.style.bottom="104px";e.appendChild(g);var l=document.createElement("div");l.style.position="absolute";l.style.boxSizing="border-box";l.style.borderRadius="4px";l.style.border="1px solid lightgray";l.style.margin="8px 8px 16px 8px";l.style.padding="8px";l.style.left="0px";l.style.right="0px";l.style.bottom="0px";l.style.padding="6px";l.style.height="80px";var n=document.createElement("div");n.style.display="flex";n.style.gap="6px";n.style.marginBottom="6px";var u=document.createElement("select");u.style.textOverflow="ellipsis";u.style.flexGrow="1";u.style.padding="4px";u.style.minWidth="0";l.appendChild(n);var z=document.createElement("option");z.setAttribute("value","includeCopyOfMyDiagram");mxUtils.write(z,mxResources.get("includeCopyOfMyDiagram"));u.appendChild(z);var D=document.createElement("option");D.setAttribute("value","selectionOnly");mxUtils.write(D,mxResources.get("selectionOnly"));u.appendChild(D);n.appendChild(u);if("undefined"!==typeof mxMermaidToDrawio&&window.isMermaidEnabled){var C=document.createElement("option");C.setAttribute("value","create");mxUtils.write(C,mxResources.get("create"));u.appendChild(C)}C=document.createElement("option");C.setAttribute("value","help");mxUtils.write(C,mxResources.get("help"));u.appendChild(C);C=document.createElement("option");C.setAttribute("value",@@ -12529,9 +12535,9 @@ f==b.dropbox?(v=mxResources.get("dropbox"),B.src=IMAGE_PATH+"/dropbox-logo-whitet.appendChild(m),J.checked=!0,J.defaultChecked=!0,mxEvent.addListener(x,"click",function(N){J.checked=!J.checked;mxEvent.consume(N)}));this.container=t},MoreShapesDialog=function(b,f,m){m=null!=m?m:b.sidebar.entries;var d=document.createElement("div"),t=[];if(null!=b.sidebar.customEntries)for(var x=0;x<b.sidebar.customEntries.length;x++){for(var v=b.sidebar.customEntries[x]||{},B={title:b.getResource(v.title),entries:[]},J=0;null!=v.entries&&J<v.entries.length;J++){var N=v.entries[J];B.entries.push({id:N.id,title:b.getResource(N.title),desc:b.getResource(N.desc),image:N.preview})}0<B.entries.length&&t.push(B)}for(x=0;x<m.length;x++)if(null==b.sidebar.enabledLibraries)t.push(m[x]);else{B={title:m[x].title,entries:[]};for(J=0;J<m[x].entries.length;J++)0<=mxUtils.indexOf(b.sidebar.enabledLibraries,m[x].entries[J].id)&&B.entries.push(m[x].entries[J]);0<B.entries.length&&t.push(B)}m=t;if(f){x=mxUtils.bind(this,function(S){for(var U=0;U<S.length;U++)(function(O){var p=l.cloneNode(!1);p.style.fontWeight="bold";p.style.backgroundColor="light-dark(#e5e5e5, #505759)";p.style.padding="6px 0px 6px 20px";mxUtils.write(p,O.title);I.appendChild(p);for(var q=0;q<O.entries.length;q++)(function(G){var E=l.cloneNode(!1);E.style.cursor="pointer";E.style.padding="4px 0px 4px 20px";E.style.whiteSpace="nowrap";E.style.overflow="hidden";E.style.textOverflow="ellipsis";E.setAttribute("title",G.title+" ("+G.id+")");var H=document.createElement("input");H.setAttribute("type","checkbox");H.checked=b.sidebar.isEntryVisible(G.id);-H.defaultChecked=H.checked;E.appendChild(H);mxUtils.write(E," "+G.title);I.appendChild(E);var M=function(L){if(null==L||"INPUT"!=mxEvent.getSource(L).nodeName){c.style.textAlign="center";c.style.padding="0px";c.style.color="";c.innerText="";if(null!=G.desc){var k=document.createElement("pre");k.style.boxSizing="border-box";k.style.fontFamily="inherit";k.style.margin="20px";k.style.right="0px";k.style.textAlign="left";mxUtils.write(k,G.desc);c.appendChild(k)}null!=G.imageCallback?G.imageCallback(c):-null!=G.image?(k=document.createElement("img"),k.setAttribute("border","0"),k.style.maxWidth="100%",k.setAttribute("src",G.image),c.appendChild(k)):null==G.desc&&(c.style.padding="20px",c.style.color="rgb(179, 179, 179)",mxUtils.write(c,mxResources.get("noPreview")));null!=e&&(e.style.backgroundColor="");e=E;e.style.backgroundColor="light-dark(#ebf2f9, #000000)";null!=L&&mxEvent.consume(L)}};mxEvent.addListener(E,"click",M);mxEvent.addListener(E,"dblclick",function(L){H.checked=!H.checked;mxEvent.consume(L)});-g.push(function(){return H.checked?G.id:null});0==U&&0==q&&M()})(O.entries[q])})(S[U])});J=document.createElement("div");J.className="geDialogTitle";mxUtils.write(J,mxResources.get("shapes"));J.style.position="absolute";J.style.top="0px";J.style.left="0px";J.style.lineHeight="40px";J.style.height="40px";J.style.right="0px";var I=document.createElement("div"),c=document.createElement("div");I.style.position="absolute";I.style.top="40px";I.style.left="0px";I.style.width="202px";I.style.bottom="60px";+H.defaultChecked=H.checked;E.appendChild(H);mxUtils.write(E," "+G.title);I.appendChild(E);var L=function(K){if(null==K||"INPUT"!=mxEvent.getSource(K).nodeName){c.style.textAlign="center";c.style.padding="0px";c.style.color="";c.innerText="";if(null!=G.desc){var k=document.createElement("pre");k.style.boxSizing="border-box";k.style.fontFamily="inherit";k.style.margin="20px";k.style.right="0px";k.style.textAlign="left";mxUtils.write(k,G.desc);c.appendChild(k)}null!=G.imageCallback?G.imageCallback(c):+null!=G.image?(k=document.createElement("img"),k.setAttribute("border","0"),k.style.maxWidth="100%",k.setAttribute("src",G.image),c.appendChild(k)):null==G.desc&&(c.style.padding="20px",c.style.color="rgb(179, 179, 179)",mxUtils.write(c,mxResources.get("noPreview")));null!=e&&(e.style.backgroundColor="");e=E;e.style.backgroundColor="light-dark(#ebf2f9, #000000)";null!=K&&mxEvent.consume(K)}};mxEvent.addListener(E,"click",L);mxEvent.addListener(E,"dblclick",function(K){H.checked=!H.checked;mxEvent.consume(K)});+g.push(function(){return H.checked?G.id:null});0==U&&0==q&&L()})(O.entries[q])})(S[U])});J=document.createElement("div");J.className="geDialogTitle";mxUtils.write(J,mxResources.get("shapes"));J.style.position="absolute";J.style.top="0px";J.style.left="0px";J.style.lineHeight="40px";J.style.height="40px";J.style.right="0px";var I=document.createElement("div"),c=document.createElement("div");I.style.position="absolute";I.style.top="40px";I.style.left="0px";I.style.width="202px";I.style.bottom="60px";I.style.overflow="auto";c.style.position="absolute";c.style.left="202px";c.style.right="0px";c.style.top="40px";c.style.bottom="60px";c.style.overflow="auto";c.style.borderLeftStyle="solid";c.style.borderLeftWidth="1px";c.style.textAlign="center";var e=null,g=[],l=document.createElement("div");l.style.position="relative";l.style.left="0px";l.style.right="0px";x(m);d.style.padding="30px";d.appendChild(J);d.appendChild(I);d.appendChild(c);m=document.createElement("div");m.className="geDialogFooter";m.style.position="absolute";m.style.paddingRight="16px";m.style.left="0px";m.style.right="0px";m.style.bottom="0px";m.style.height="60px";m.style.lineHeight="52px";var n=document.createElement("input");n.setAttribute("type","checkbox");n.style.position="relative";n.style.top="1px";n.checked=b.sidebar.sidebarTitles;n.defaultChecked=n.checked;m.appendChild(n);x=document.createElement("span");mxUtils.write(x," "+mxResources.get("labels"));x.style.paddingRight="20px";m.appendChild(x);mxEvent.addListener(x,"click",function(S){n.checked=!n.checked;mxEvent.consume(S)});var u=document.createElement("input");u.setAttribute("type","checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)x=document.createElement("span"),x.style.paddingRight="20px",x.appendChild(u),mxUtils.write(x," "+mxResources.get("rememberThisSetting")),u.style.position="relative",u.style.top="1px",u.checked=!0,u.defaultChecked=!0,mxEvent.addListener(x,"click",function(S){mxEvent.getSource(S)!=u&&(u.checked=!u.checked,mxEvent.consume(S))}),@@ -12549,8 +12555,8 @@ function(){b.hideDialog()});I.className="geBtn";var c=mxUtils.button(d?mxResource.appendChild(N),e.appendChild(c)):(e.appendChild(N),e.appendChild(c),d||e.appendChild(I));x.appendChild(e);this.container=x},CropImageDialog=function(b,f,m,d){function t(){var S=u.checked,U=z.checked,O=g.geometry,p=J.width,q=J.height,G=(300-p)/2,E=(300-q)/2;O.x<G?(O.width-=G-O.x,O.x=G):O.x+O.width>G+p&&(O.width=G+p-O.x,O.x=Math.min(O.x,G+p));O.y<E?(O.height-=E-O.y,O.y=E):O.y+O.height>E+q&&(O.height=E+q-O.y,O.y=Math.min(O.y,E+q));var H=(O.x-G)/p*100;p=100-(O.x+O.width-G)/p*100;G=(O.y-E)/q*100;O=100-(O.y+O.height-E)/q*100;return"inset("+mxUtils.format(G)+"% "+mxUtils.format(p)+"% "+mxUtils.format(O)+"% "+mxUtils.format(H)+"%"+(S?" round "+e+"%":U?" round 50%":"")+")"}function x(S){null!=I&&(!0!==S&&(I.model.setGeometry(g,c.clone()),e=5,C.value=e),I.model.setStyle(g,l+t()),I.selectAll(),D.style.visibility=u.checked?"visible":"hidden")}var v=document.createElement("div"),B=document.createElement("div");B.style.height="300px";B.style.width="300px";B.style.display="inline-flex";B.style.justifyContent="center";B.style.alignItems="center";B.style.position="absolute";var J=document.createElement("img");J.onload=function(){function S(){I.model.setStyle(g,l+t())}I=new Graph(N);I.autoExtend=!1;I.autoScroll=!1;I.setGridEnabled(!1);I.setEnabled(!0);I.setPanning(!1);I.setConnectable(!1);I.getRubberband().setEnabled(!1);I.graphHandler.allowLivePreview=!1;var U=I.createVertexHandler;I.createVertexHandler=function(){var R=U.apply(this,arguments);R.livePreview=!1;return R};if(null!=m)try{if("inset"==m.substring(0,-5)){var O=g.geometry,p=J.width,q=J.height,G=(300-p)/2,E=(300-q)/2,H=m.match(/\(([^)]+)\)/)[1].split(/[ ,]+/),M=parseFloat(H[0]),L=parseFloat(H[1]),k=parseFloat(H[2]),y=parseFloat(H[3]);isFinite(M)&&isFinite(L)&&isFinite(k)&&isFinite(y)?(O.x=y/100*p+G,O.y=M/100*q+E,O.width=(100-L)/100*p+G-O.x,O.height=(100-k)/100*q+E-O.y,"round"==H[4]?"50%"==H[5]?z.setAttribute("checked","checked"):(e=parseInt(H[5]),C.value=e,u.setAttribute("checked","checked"),D.style.visibility="visible"):n.setAttribute("checked",-"checked")):m=null}else m=null}catch(R){}g.style=l+(m?m:t());g.vertex=!0;I.addCell(g,null,null,null,null);I.selectAll();I.addListener(mxEvent.CELLS_MOVED,S);I.addListener(mxEvent.CELLS_RESIZED,S);var F=I.graphHandler.mouseUp,K=I.graphHandler.mouseDown;I.graphHandler.mouseUp=function(){F.apply(this,arguments);N.style.backgroundColor="#fff9"};I.graphHandler.mouseDown=function(){K.apply(this,arguments);N.style.backgroundColor=""};I.dblClick=function(){};var P=I.getSelectionModel().changeSelection;I.getSelectionModel().changeSelection=+5)){var O=g.geometry,p=J.width,q=J.height,G=(300-p)/2,E=(300-q)/2,H=m.match(/\(([^)]+)\)/)[1].split(/[ ,]+/),L=parseFloat(H[0]),K=parseFloat(H[1]),k=parseFloat(H[2]),y=parseFloat(H[3]);isFinite(L)&&isFinite(K)&&isFinite(k)&&isFinite(y)?(O.x=y/100*p+G,O.y=L/100*q+E,O.width=(100-K)/100*p+G-O.x,O.height=(100-k)/100*q+E-O.y,"round"==H[4]?"50%"==H[5]?z.setAttribute("checked","checked"):(e=parseInt(H[5]),C.value=e,u.setAttribute("checked","checked"),D.style.visibility="visible"):n.setAttribute("checked",+"checked")):m=null}else m=null}catch(R){}g.style=l+(m?m:t());g.vertex=!0;I.addCell(g,null,null,null,null);I.selectAll();I.addListener(mxEvent.CELLS_MOVED,S);I.addListener(mxEvent.CELLS_RESIZED,S);var F=I.graphHandler.mouseUp,M=I.graphHandler.mouseDown;I.graphHandler.mouseUp=function(){F.apply(this,arguments);N.style.backgroundColor="#fff9"};I.graphHandler.mouseDown=function(){M.apply(this,arguments);N.style.backgroundColor=""};I.dblClick=function(){};var P=I.getSelectionModel().changeSelection;I.getSelectionModel().changeSelection=function(){P.call(this,[g],[g])}};J.onerror=function(){J.onload=null;J.src=Editor.errorImage};J.setAttribute("src",f);J.style.maxWidth="300px";J.style.maxHeight="300px";B.appendChild(J);v.appendChild(B);var N=document.createElement("div");N.style.width="300px";N.style.height="300px";N.style.overflow="hidden";N.style.backgroundColor="#fff9";v.appendChild(N);var I=null,c=new mxGeometry(100,100,100,100),e=5,g=new mxCell("",c.clone(),""),l="shape=image;fillColor=none;rotatable=0;cloneable=0;deletable=0;image="+f.replace(";base64","")+";clipPath=",n=document.createElement("input");n.setAttribute("type","radio");n.setAttribute("id","croppingRect");n.setAttribute("name","croppingShape");n.setAttribute("checked","checked");n.style.margin="5px";v.appendChild(n);f=document.createElement("label");f.setAttribute("for","croppingRect");mxUtils.write(f,mxResources.get("rectangle"));v.appendChild(f);var u=document.createElement("input");u.setAttribute("type","radio");u.setAttribute("id","croppingRounded");u.setAttribute("name","croppingShape");u.style.margin="5px";v.appendChild(u);f=document.createElement("label");f.setAttribute("for","croppingRounded");mxUtils.write(f,mxResources.get("rounded"));v.appendChild(f);var z=document.createElement("input");z.setAttribute("type","radio");z.setAttribute("id","croppingEllipse");z.setAttribute("name","croppingShape");z.style.margin="5px";v.appendChild(z);f=document.createElement("label");f.setAttribute("for","croppingEllipse");mxUtils.write(f,mxResources.get("ellipse"));v.appendChild(f);@@ -12564,29 +12570,29 @@ N=document.createElement("td");mxUtils.write(J,mxResources.get("width")+":");vard?d.height:"";N.appendChild(u);B.appendChild(J);B.appendChild(N);v.appendChild(B);B=document.createElement("tr");J=document.createElement("td");N=document.createElement("td");mxUtils.write(J,mxResources.get("rotation")+":");var z=document.createElement("input");z.setAttribute("type","text");z.style.width="100px";z.value=1==f.length?mxUtils.getValue(m.getCellStyle(f[0]),mxConstants.STYLE_ROTATION,0):"";N.appendChild(z);B.appendChild(J);B.appendChild(N);v.appendChild(B);x.appendChild(v);t.appendChild(x);d=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});d.className="geBtn";var D=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();m.getModel().beginUpdate();try{for(var C=0;C<f.length;C++){var A=m.getCellGeometry(f[C]);null!=A&&(A=A.clone(),m.isCellMovable(f[C])&&(A.relative=I.checked,0<mxUtils.trim(c.value).length&&(A.x=Number(c.value)),0<mxUtils.trim(e.value).length&&(A.y=Number(e.value)),0<mxUtils.trim(g.value).length&&(null==A.offset&&(A.offset=new mxPoint),A.offset.x=Number(g.value)),0<mxUtils.trim(l.value).length&&(null==A.offset&&(A.offset=new mxPoint),A.offset.y=Number(l.value))),m.isCellResizable(f[C])&&(0<mxUtils.trim(n.value).length&&(A.width=Number(n.value)),0<mxUtils.trim(u.value).length&&(A.height=Number(u.value))),m.getModel().setGeometry(f[C],A));0<mxUtils.trim(z.value).length&&m.setCellStyles(mxConstants.STYLE_ROTATION,Number(z.value),[f[C]])}}finally{m.getModel().endUpdate()}});D.className="geBtn gePrimaryBtn";mxEvent.addListener(t,"keypress",function(C){13==-C.keyCode&&D.click()});x=document.createElement("div");x.style.marginTop="20px";x.style.textAlign="right";b.editor.cancelFirst?(x.appendChild(d),x.appendChild(D)):(x.appendChild(D),x.appendChild(d));t.appendChild(x);this.container=t},LibraryDialog=function(b,f,m,d,t,x,v){function B(O){for(O=document.elementFromPoint(O.clientX,O.clientY);null!=O&&O.parentNode!=l;)O=O.parentNode;var p=null;if(null!=O){var q=l.firstChild;for(p=0;null!=q&&q!=O;)q=q.nextSibling,p++}return p}function J(O,p,q,G,E,H,M,L,-k){try{if(b.spinner.stop(),null==p||"image/"==p.substring(0,6))if(null==O&&null!=M||null==u[O]){var y=function(){X.innerText="";X.style.cursor="pointer";X.style.whiteSpace="nowrap";X.style.textOverflow="ellipsis";mxUtils.write(X,null!=Z.title&&0<Z.title.length?Z.title:mxResources.get("untitled"));X.style.color=null==Z.title||0==Z.title.length?"#d0d0d0":""};l.style.backgroundImage="";n.style.display="none";var F=E,K=H;if(E>b.maxImageSize||H>b.maxImageSize){var P=Math.min(1,Math.min(b.maxImageSize/-Math.max(1,E)),b.maxImageSize/Math.max(1,H));E*=P;H*=P}F>K?(K=Math.round(100*K/F),F=100):(F=Math.round(100*F/K),K=100);var R=document.createElement("div");R.setAttribute("draggable","true");R.style.display="inline-block";R.style.position="relative";R.style.padding="0 12px";R.style.cursor="move";mxUtils.setPrefixedStyle(R.style,"transition","transform .1s ease-in-out");if(null!=O){var T=document.createElement("img");T.setAttribute("src",A.convert(O));T.style.width=F+"px";T.style.height=K+"px";T.style.margin=-"10px";T.style.paddingBottom=Math.floor((100-K)/2)+"px";T.style.paddingLeft=Math.floor((100-F)/2)+"px";R.appendChild(T)}else if(null!=M){var V=b.stringToCells("<"==M.xml.charAt(0)?M.xml:Graph.decompress(M.xml));0<V.length&&(b.sidebar.createThumb(V,100,100,R,null,!0,!1,null,null,Editor.isDarkMode()?"#2a252f":"#ffffff"),R.firstChild.style.display="inline-block",R.firstChild.style.cursor="")}var W=document.createElement("img");W.setAttribute("src",Editor.closeBlackImage);W.setAttribute("border","0");+C.keyCode&&D.click()});x=document.createElement("div");x.style.marginTop="20px";x.style.textAlign="right";b.editor.cancelFirst?(x.appendChild(d),x.appendChild(D)):(x.appendChild(D),x.appendChild(d));t.appendChild(x);this.container=t},LibraryDialog=function(b,f,m,d,t,x,v){function B(O){for(O=document.elementFromPoint(O.clientX,O.clientY);null!=O&&O.parentNode!=l;)O=O.parentNode;var p=null;if(null!=O){var q=l.firstChild;for(p=0;null!=q&&q!=O;)q=q.nextSibling,p++}return p}function J(O,p,q,G,E,H,L,K,+k){try{if(b.spinner.stop(),null==p||"image/"==p.substring(0,6))if(null==O&&null!=L||null==u[O]){var y=function(){X.innerText="";X.style.cursor="pointer";X.style.whiteSpace="nowrap";X.style.textOverflow="ellipsis";mxUtils.write(X,null!=Y.title&&0<Y.title.length?Y.title:mxResources.get("untitled"));X.style.color=null==Y.title||0==Y.title.length?"#d0d0d0":""};l.style.backgroundImage="";n.style.display="none";var F=E,M=H;if(E>b.maxImageSize||H>b.maxImageSize){var P=Math.min(1,Math.min(b.maxImageSize/+Math.max(1,E)),b.maxImageSize/Math.max(1,H));E*=P;H*=P}F>M?(M=Math.round(100*M/F),F=100):(F=Math.round(100*F/M),M=100);var R=document.createElement("div");R.setAttribute("draggable","true");R.style.display="inline-block";R.style.position="relative";R.style.padding="0 12px";R.style.cursor="move";mxUtils.setPrefixedStyle(R.style,"transition","transform .1s ease-in-out");if(null!=O){var T=document.createElement("img");T.setAttribute("src",A.convert(O));T.style.width=F+"px";T.style.height=M+"px";T.style.margin=+"10px";T.style.paddingBottom=Math.floor((100-M)/2)+"px";T.style.paddingLeft=Math.floor((100-F)/2)+"px";R.appendChild(T)}else if(null!=L){var V=b.stringToCells("<"==L.xml.charAt(0)?L.xml:Graph.decompress(L.xml));0<V.length&&(b.sidebar.createThumb(V,100,100,R,null,!0,!1,null,null,Editor.isDarkMode()?"#2a252f":"#ffffff"),R.firstChild.style.display="inline-block",R.firstChild.style.cursor="")}var W=document.createElement("img");W.setAttribute("src",Editor.closeBlackImage);W.setAttribute("border","0");W.setAttribute("title",mxResources.get("delete"));W.setAttribute("align","top");W.style.paddingTop="4px";W.style.position="absolute";W.style.marginLeft="-12px";W.style.zIndex="1";W.style.cursor="pointer";mxEvent.addListener(W,"dragstart",function(ba){mxEvent.consume(ba)});(function(ba,ha,aa){mxEvent.addListener(W,"click",function(ia){u[ha]=null;for(var fa=0;fa<c.length;fa++)if(null!=c[fa].data&&c[fa].data==ha||null!=c[fa].xml&&null!=aa&&c[fa].xml==aa.xml){c.splice(fa,1);break}R.parentNode.removeChild(ba);-0==c.length&&(l.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",n.style.display="");mxEvent.consume(ia)});mxEvent.addListener(W,"dblclick",function(ia){mxEvent.consume(ia)})})(R,O,M);R.appendChild(W);R.style.marginBottom="30px";var X=document.createElement("div");X.style.position="absolute";X.style.boxSizing="border-box";X.style.bottom="-18px";X.style.left="10px";X.style.right="10px";X.style.backgroundColor="light-dark(#ffffff, transparent)";X.style.overflow="hidden";X.style.textAlign=-"center";X.setAttribute("title",mxResources.get("rename"));var Z=null;null!=O?(Z={data:O,w:E,h:H,title:k},null!=L&&(Z.aspect=L),u[O]=T,c.push(Z)):null!=M&&(M.aspect="fixed",c.push(M),Z=M);mxEvent.addListener(X,"keydown",function(ba){13==ba.keyCode&&null!=C&&(C(),C=null,mxEvent.consume(ba))});y();R.appendChild(X);mxEvent.addListener(X,"mousedown",function(ba){"true"!=X.getAttribute("contentEditable")&&mxEvent.consume(ba)});V=function(ba){if(mxClient.IS_IOS||mxClient.IS_FF||!(null==document.documentMode||-9<document.documentMode)){var ha=new FilenameDialog(b,Z.title||"",mxResources.get("ok"),function(aa){null!=aa&&(Z.title=aa,y())},mxResources.get("enterValue"));b.showDialog(ha.container,300,80,!0,!0);ha.init();mxEvent.consume(ba)}else if("true"!=X.getAttribute("contentEditable")){null!=C&&(C(),C=null);if(null==Z.title||0==Z.title.length)X.innerText="";X.style.textOverflow="";X.style.whiteSpace="";X.style.cursor="text";X.style.color="";X.setAttribute("contentEditable","true");mxUtils.setPrefixedStyle(X.style,-"user-select","text");X.focus();document.execCommand("selectAll",!1,null);C=function(){X.removeAttribute("contentEditable");X.style.cursor="pointer";Z.title=mxUtils.getTextContent(X);y()};mxEvent.consume(ba)}};mxEvent.addListener(X,"click",V);mxEvent.addListener(R,"dblclick",V);l.appendChild(R);mxEvent.addListener(R,"dragstart",function(ba){null==C&&(null==O&&null!=M&&(W.style.visibility="hidden",X.style.visibility="hidden"),mxClient.IS_FF&&null!=M.xml&&ba.dataTransfer.setData("Text",M.xml),z=B(ba),+0==c.length&&(l.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",n.style.display="");mxEvent.consume(ia)});mxEvent.addListener(W,"dblclick",function(ia){mxEvent.consume(ia)})})(R,O,L);R.appendChild(W);R.style.marginBottom="30px";var X=document.createElement("div");X.style.position="absolute";X.style.boxSizing="border-box";X.style.bottom="-18px";X.style.left="10px";X.style.right="10px";X.style.backgroundColor="light-dark(#ffffff, transparent)";X.style.overflow="hidden";X.style.textAlign=+"center";X.setAttribute("title",mxResources.get("rename"));var Y=null;null!=O?(Y={data:O,w:E,h:H,title:k},null!=K&&(Y.aspect=K),u[O]=T,c.push(Y)):null!=L&&(L.aspect="fixed",c.push(L),Y=L);mxEvent.addListener(X,"keydown",function(ba){13==ba.keyCode&&null!=C&&(C(),C=null,mxEvent.consume(ba))});y();R.appendChild(X);mxEvent.addListener(X,"mousedown",function(ba){"true"!=X.getAttribute("contentEditable")&&mxEvent.consume(ba)});V=function(ba){if(mxClient.IS_IOS||mxClient.IS_FF||!(null==document.documentMode||+9<document.documentMode)){var ha=new FilenameDialog(b,Y.title||"",mxResources.get("ok"),function(aa){null!=aa&&(Y.title=aa,y())},mxResources.get("enterValue"));b.showDialog(ha.container,300,80,!0,!0);ha.init();mxEvent.consume(ba)}else if("true"!=X.getAttribute("contentEditable")){null!=C&&(C(),C=null);if(null==Y.title||0==Y.title.length)X.innerText="";X.style.textOverflow="";X.style.whiteSpace="";X.style.cursor="text";X.style.color="";X.setAttribute("contentEditable","true");mxUtils.setPrefixedStyle(X.style,+"user-select","text");X.focus();document.execCommand("selectAll",!1,null);C=function(){X.removeAttribute("contentEditable");X.style.cursor="pointer";Y.title=mxUtils.getTextContent(X);y()};mxEvent.consume(ba)}};mxEvent.addListener(X,"click",V);mxEvent.addListener(R,"dblclick",V);l.appendChild(R);mxEvent.addListener(R,"dragstart",function(ba){null==C&&(null==O&&null!=L&&(W.style.visibility="hidden",X.style.visibility="hidden"),mxClient.IS_FF&&null!=L.xml&&ba.dataTransfer.setData("Text",L.xml),z=B(ba),mxClient.IS_GC&&(R.style.opacity="0.9"),window.setTimeout(function(){mxUtils.setPrefixedStyle(R.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(R,30);W.style.visibility="";X.style.visibility=""},0))});mxEvent.addListener(R,"dragend",function(ba){"hidden"==W.style.visibility&&(W.style.visibility="",X.style.visibility="");z=null;mxUtils.setOpacity(R,100);mxUtils.setPrefixedStyle(R.style,"transform",null)})}else Q||(Q=!0,b.handleError({message:mxResources.get("fileExists")}));else{E=!1;try{if(F=-mxUtils.parseXml(O),"mxlibrary"==F.documentElement.nodeName){K=JSON.parse(mxUtils.getTextContent(F.documentElement));if(null!=K&&0<K.length)for(var Y=0;Y<K.length;Y++)null!=K[Y].xml?J(null,null,0,0,0,0,K[Y]):J(K[Y].data,null,0,0,K[Y].w,K[Y].h,null,"fixed",K[Y].title);E=!0}else if("mxfile"==F.documentElement.nodeName){var da=F.documentElement.getElementsByTagName("diagram");for(Y=0;Y<da.length;Y++){var ea=Editor.getDiagramNodeXml(da[Y]);V=b.stringToCells(ea);if(0<V.length){var ka=b.editor.graph.getBoundingBoxFromGeometry(V);+mxUtils.parseXml(O),"mxlibrary"==F.documentElement.nodeName){M=JSON.parse(mxUtils.getTextContent(F.documentElement));if(null!=M&&0<M.length)for(var Z=0;Z<M.length;Z++)null!=M[Z].xml?J(null,null,0,0,0,0,M[Z]):J(M[Z].data,null,0,0,M[Z].w,M[Z].h,null,"fixed",M[Z].title);E=!0}else if("mxfile"==F.documentElement.nodeName){var da=F.documentElement.getElementsByTagName("diagram");for(Z=0;Z<da.length;Z++){var ea=Editor.getDiagramNodeXml(da[Z]);V=b.stringToCells(ea);if(0<V.length){var ka=b.editor.graph.getBoundingBoxFromGeometry(V);null!=ka&&J(null,null,0,0,0,0,{xml:ea,w:ka.width,h:ka.height})}}E=!0}}catch(ba){null!=window.console&&console.error("Error in library dialog: "+ba)}E||(b.spinner.stop(),b.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(ba){null!=window.console&&console.log("Error in library dialog: "+ba)}return null}function N(O){O.dataTransfer.dropEffect=null!=z?"move":"copy";O.stopPropagation();O.preventDefault()}function I(O){O.stopPropagation();O.preventDefault();Q=!1;D=B(O);if(null!=z)null!=D&&D<l.children.length?(c.splice(D>z?D-1:D,0,c.splice(z,1)[0]),l.insertBefore(l.children[z],l.children[D])):(c.push(c.splice(z,1)[0]),l.appendChild(l.children[z]));else if(0<O.dataTransfer.files.length)b.importFiles(O.dataTransfer.files,0,0,b.maxImageSize,S(O));else if(0<=mxUtils.indexOf(O.dataTransfer.types,"text/uri-list")){var p=decodeURIComponent(O.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(p)||/(\.png)($|\?)/i.test(p)||/(\.gif)($|\?)/i.test(p)||/(\.svg)($|\?)/i.test(p))&&b.loadImage(p,function(q){J(p,null,0,0,q.width,q.height);l.scrollTop=l.scrollHeight})}O.stopPropagation();O.preventDefault()}var c=[];m=document.createElement("div");m.style.height="100%";var e=document.createElement("div");e.style.whiteSpace="nowrap";e.style.height="40px";m.appendChild(e);mxUtils.write(e,mxResources.get("filename")+":");null==f&&(f=b.defaultLibraryName+".xml");var g=document.createElement("input");g.setAttribute("value",f);g.style.marginRight="20px";g.style.marginLeft="10px";g.style.width="500px";null==t||t.isRenamable()||g.setAttribute("disabled","true");this.init=function(){if(null==t||t.isRenamable())g.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?g.select():document.execCommand("selectAll",!1,null)};e.appendChild(g);Editor.enableUncompressedLibraries&&(g.style.width="420px",f=document.createElement("input"),f.setAttribute("type","checkbox"),f.style.marginRight="10px",e.appendChild(f),mxUtils.write(e,mxResources.get("compressed")));var l=document.createElement("div");l.style.borderWidth="1px 0px 1px 0px";l.style.borderColor="#d3d3d3";l.style.borderStyle="solid";l.style.marginTop="6px";l.style.overflow="auto";l.style.height="340px";l.style.backgroundPosition="center center";l.style.backgroundRepeat="no-repeat";0==c.length&&Graph.fileSupport&&(l.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var n=document.createElement("div");n.style.position="absolute";n.style.width="640px";n.style.top="260px";n.style.textAlign="center";n.style.fontSize="22px";n.style.color="#a0c3ff";mxUtils.write(n,mxResources.get("dragImagesHere"));m.appendChild(n);var u={},z=null,D=null,C=null;e=function(O){"true"!=mxEvent.getSource(O).getAttribute("contentEditable")&&null!=C&&(C(),C=null,mxEvent.consume(O))};mxEvent.addListener(l,"mousedown",e);mxEvent.addListener(l,"pointerdown",e);mxEvent.addListener(l,"touchstart",e);var A=new mxUrlConverter,Q=!1;if(null!=d)for(e=0;e<d.length;e++)f=d[e],J(f.data,null,0,0,f.w,f.h,f,f.aspect,f.title);mxEvent.addListener(l,"dragleave",-function(O){n.style.cursor="";for(var p=mxEvent.getSource(O);null!=p;){if(p==l||p==n){O.stopPropagation();O.preventDefault();break}p=p.parentNode}});var S=function(O){return function(p,q,G,E,H,M,L,k,y){null!=y&&EditorUi.isVisioFilename(y.name)?b.importVisio(y,mxUtils.bind(this,function(F){J(F,q,G,E,H,M,L,"fixed",mxEvent.isAltDown(O)?null:L.substring(0,L.lastIndexOf(".")).replace(/_/g," "))})):null!=y&&(new XMLHttpRequest).upload&&b.isRemoteFileFormat(p,y.name)?b.isExternalDataComms()?b.parseFile(y,-mxUtils.bind(this,function(F){4==F.readyState&&(b.spinner.stop(),200<=F.status&&299>=F.status&&(J(F.responseText,q,G,E,H,M,L,"fixed",mxEvent.isAltDown(O)?null:L.substring(0,L.lastIndexOf(".")).replace(/_/g," ")),l.scrollTop=l.scrollHeight))})):(b.spinner.stop(),b.showError(mxResources.get("error"),mxResources.get("notInOffline"))):(J(p,q,G,E,H,M,L,"fixed",mxEvent.isAltDown(O)?null:L.substring(0,L.lastIndexOf(".")).replace(/_/g," ")),l.scrollTop=l.scrollHeight)}};mxEvent.addListener(l,"dragover",N);+function(O){n.style.cursor="";for(var p=mxEvent.getSource(O);null!=p;){if(p==l||p==n){O.stopPropagation();O.preventDefault();break}p=p.parentNode}});var S=function(O){return function(p,q,G,E,H,L,K,k,y){null!=y&&EditorUi.isVisioFilename(y.name)?b.importVisio(y,mxUtils.bind(this,function(F){J(F,q,G,E,H,L,K,"fixed",mxEvent.isAltDown(O)?null:K.substring(0,K.lastIndexOf(".")).replace(/_/g," "))})):null!=y&&(new XMLHttpRequest).upload&&b.isRemoteFileFormat(p,y.name)?b.isExternalDataComms()?b.parseFile(y,+mxUtils.bind(this,function(F){4==F.readyState&&(b.spinner.stop(),200<=F.status&&299>=F.status&&(J(F.responseText,q,G,E,H,L,K,"fixed",mxEvent.isAltDown(O)?null:K.substring(0,K.lastIndexOf(".")).replace(/_/g," ")),l.scrollTop=l.scrollHeight))})):(b.spinner.stop(),b.showError(mxResources.get("error"),mxResources.get("notInOffline"))):(J(p,q,G,E,H,L,K,"fixed",mxEvent.isAltDown(O)?null:K.substring(0,K.lastIndexOf(".")).replace(/_/g," ")),l.scrollTop=l.scrollHeight)}};mxEvent.addListener(l,"dragover",N);mxEvent.addListener(l,"drop",I);mxEvent.addListener(n,"dragover",N);mxEvent.addListener(n,"drop",I);m.appendChild(l);d=document.createElement("div");d.style.textAlign="right";d.style.marginTop="20px";e=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog(!0)});e.setAttribute("id","btnCancel");e.className="geBtn";b.editor.cancelFirst&&d.appendChild(e);"draw.io"!=b.getServiceName()||null==t||t.constructor!=DriveLibrary&&t.constructor!=GitHubLibrary||(f=mxUtils.button(mxResources.get("link"),function(){b.getPublicUrl(t,function(O){if(null!=O){var p=b.getSearch("create title mode url drive splash state clibs ui".split(" "));p+=(0==p.length?"?":"&")+"splash=0&clibs=U"+encodeURIComponent(O);O=new EmbedDialog(b,window.location.protocol+"//"+window.location.host+"/"+p,null,null,null,null,"Check out the library I made using @drawio");b.showDialog(O.container,450,240,!0);O.init()}else t.constructor==DriveLibrary?b.showError(mxResources.get("error"),mxResources.get("diagramIsNotPublic"),mxResources.get("share"),mxUtils.bind(this,function(){b.drive.showPermissions(t.getId(),t)}),null,mxResources.get("ok"),mxUtils.bind(this,function(){})):b.handleError({message:mxResources.get("diagramIsNotPublic")})})}),f.className="geBtn",d.appendChild(f));f=mxUtils.button(mxResources.get("export"),function(){var O=b.createLibraryDataFromImages(c),p=g.value;/(\.xml)$/i.test(p)||(p+=".xml");b.isLocalFileSave()?b.saveLocalFile(O,p,"text/xml",null,null,null!=v?v:!0,null,"xml"):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(p)+-"&format=xml&xml="+encodeURIComponent(O))).simulate(document,"_blank")});f.setAttribute("id","btnDownload");f.className="geBtn";d.appendChild(f);if(Graph.fileSupport){if(null==b.libDlgFileInputElt){var U=document.createElement("input");U.setAttribute("multiple","multiple");U.setAttribute("type","file");mxEvent.addListener(U,"change",function(O){Q=!1;b.importFiles(U.files,0,0,b.maxImageSize,function(p,q,G,E,H,M,L,k,y){null!=U.files&&(S(O)(p,q,G,E,H,M,L,k,y),U.type="",U.type="file",U.value="")});l.scrollTop=+"&format=xml&xml="+encodeURIComponent(O))).simulate(document,"_blank")});f.setAttribute("id","btnDownload");f.className="geBtn";d.appendChild(f);if(Graph.fileSupport){if(null==b.libDlgFileInputElt){var U=document.createElement("input");U.setAttribute("multiple","multiple");U.setAttribute("type","file");mxEvent.addListener(U,"change",function(O){Q=!1;b.importFiles(U.files,0,0,b.maxImageSize,function(p,q,G,E,H,L,K,k,y){null!=U.files&&(S(O)(p,q,G,E,H,L,K,k,y),U.type="",U.type="file",U.value="")});l.scrollTop=l.scrollHeight});U.style.display="none";document.body.appendChild(U);b.libDlgFileInputElt=U}f=mxUtils.button(mxResources.get("import"),function(){null!=C&&(C(),C=null);b.libDlgFileInputElt.click()});f.setAttribute("id","btnAddImage");f.className="geBtn";d.appendChild(f)}f=mxUtils.button(mxResources.get("addImages"),function(){null!=C&&(C(),C=null);b.showImageDialog(mxResources.get("addImageUrl"),"",function(O,p,q){Q=!1;if(null!=O){if("data:image/"==O.substring(0,11)){var G=O.indexOf(",");0<G&&(O=O.substring(0,G)+";base64,"+O.substring(G+1))}J(O,null,0,0,p,q);l.scrollTop=l.scrollHeight}})});f.setAttribute("id","btnAddImageUrl");f.className="geBtn";d.appendChild(f);this.saveBtnClickHandler=function(O,p,q,G){b.saveLibrary(O,p,q,G)};f=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=C&&(C(),C=null);this.saveBtnClickHandler(g.value,c,t,x)}));f.setAttribute("id","btnSave");f.className="geBtn gePrimaryBtn";d.appendChild(f);b.editor.cancelFirst||d.appendChild(e);m.appendChild(d);this.container=m},EditShapeDialog=function(b,f,m,d,t){d=null!=d?d:300;t=null!=t?t:120;var x=document.createElement("table"),v=document.createElement("tbody");x.style.cellPadding="4px";var B=document.createElement("tr");var J=document.createElement("td");J.setAttribute("colspan","2");J.style.fontSize="10pt";mxUtils.write(J,m);B.appendChild(J);v.appendChild(B);B=document.createElement("tr");J=document.createElement("td");var N=document.createElement("textarea");N.style.outline="none";N.style.resize=@@ -12633,20 +12639,20 @@ e=document.createElement("td"),e.style.whiteSpace="nowrap",e.appendChild(v),c.apv.style.textOverflow="ellipsis",v.style.display="block",v.style.margin="2px 0px 2px 8px",v.style.fontSize="10pt",mxUtils.write(v,f),mxEvent.addListener(v,"click",function(A){b.openLink(f);mxEvent.consume(A)}),e=document.createElement("td"),e.appendChild(v),c.appendChild(e),t.appendChild(c));null!=x&&null!=x.fileObject&&null!=x.fileObject.path&&(c=document.createElement("tr"),e=document.createElement("td"),e.style.whiteSpace="nowrap",e.style.overflow="hidden",e.style.textOverflow="ellipsis",e.style.fontSize="10pt",mxUtils.write(e,mxResources.get("pathFilename")+":"),c.appendChild(e),v=document.createElement("input"),v.setAttribute("title",x.fileObject.path),v.setAttribute("value",x.fileObject.path),v.setAttribute("disabled","disabled"),v.style.marginLeft="4px",v.style.width="100%",e=document.createElement("td"),e.appendChild(v),c.appendChild(e),t.appendChild(c));this.init=null!=this.init?this.init:function(){};v=mxUtils.button(mxResources.get("apply"),function(){b.spinner.spin(document.body,mxResources.get("updatingDocument"))&&N(function(){b.spinner.stop();b.hideDialog()},function(A){b.spinner.stop();b.handleError(A,mxResources.get("error"))})});v.className="geBtn gePrimaryBtn";c=document.createElement("tr");e=document.createElement("td");e.colSpan=2;e.style.paddingTop="20px";e.style.whiteSpace="nowrap";e.setAttribute("align","right");B=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});B.className="geBtn";b.editor.cancelFirst&&e.appendChild(B);e.appendChild(v);b.editor.cancelFirst||e.appendChild(B);c.appendChild(e);-t.appendChild(c);d.appendChild(t);this.container=d},ConnectionPointsDialog=function(b,f){function m(){null!=t&&t.destroy()}var d=document.createElement("div");d.style.userSelect="none";var t=null;this.init=function(){function x(E,H,M){E=new mxCell("",new mxGeometry(E,H,6,6),"shape=mxgraph.basic.x;fillColor=#29b6f2;strokeColor=#29b6f2;points=[];rotatable=0;resizable=0;connectable=0;editable=0;");E.vertex=!0;E.cp=!0;E.constObj=M;return c.addCell(E)}function v(E){E=c.getSelectionCells();c.deleteCells(E)}-function B(){var E=parseInt(O.value)||0;E=0>E?0:100<E?100:E;O.value=E;var H=parseInt(q.value)||0;H=0>H?0:100<H?100:H;q.value=H;var M=parseInt(p.value)||0,L=parseInt(G.value)||0;M=new mxConnectionConstraint(new mxPoint(E/100,H/100),!1,null,M,L);E=c.getConnectionPoint(l,M);H=c.getSelectionCell();if(null!=H){H.constObj=M;M=H.geometry.clone();L=c.view.scale;var k=c.view.translate;M.x=(E.x-3*L)/L-k.x;M.y=(E.y-3*L)/L-k.y;c.model.setGeometry(H,M)}}function J(E){if(E.constObj)return{x:E.constObj.point.x,-y:E.constObj.point.y,dx:E.constObj.dx,dy:E.constObj.dy};var H=0,M=0,L=e.geometry,k=mxUtils.format((E.geometry.x+3-L.x)/L.width);E=mxUtils.format((E.geometry.y+3-L.y)/L.height);0>k?(H=k*L.width,k=0):1<k&&(H=(k-1)*L.width,k=1);0>E?(M=E*L.height,E=0):1<E&&(M=(E-1)*L.height,E=1);return{x:k,y:E,dx:parseInt(H),dy:parseInt(M)}}function N(E){if(1==c.getSelectionCount()){var H=c.getSelectionCell();E&&(H.constObj=null);E=J(H);O.value=100*E.x;q.value=100*E.y;p.value=E.dx;G.value=E.dy;U.style.visibility=""}else U.style.visibility=+t.appendChild(c);d.appendChild(t);this.container=d},ConnectionPointsDialog=function(b,f){function m(){null!=t&&t.destroy()}var d=document.createElement("div");d.style.userSelect="none";var t=null;this.init=function(){function x(E,H,L){E=new mxCell("",new mxGeometry(E,H,6,6),"shape=mxgraph.basic.x;fillColor=#29b6f2;strokeColor=#29b6f2;points=[];rotatable=0;resizable=0;connectable=0;editable=0;");E.vertex=!0;E.cp=!0;E.constObj=L;return c.addCell(E)}function v(E){E=c.getSelectionCells();c.deleteCells(E)}+function B(){var E=parseInt(O.value)||0;E=0>E?0:100<E?100:E;O.value=E;var H=parseInt(q.value)||0;H=0>H?0:100<H?100:H;q.value=H;var L=parseInt(p.value)||0,K=parseInt(G.value)||0;L=new mxConnectionConstraint(new mxPoint(E/100,H/100),!1,null,L,K);E=c.getConnectionPoint(l,L);H=c.getSelectionCell();if(null!=H){H.constObj=L;L=H.geometry.clone();K=c.view.scale;var k=c.view.translate;L.x=(E.x-3*K)/K-k.x;L.y=(E.y-3*K)/K-k.y;c.model.setGeometry(H,L)}}function J(E){if(E.constObj)return{x:E.constObj.point.x,+y:E.constObj.point.y,dx:E.constObj.dx,dy:E.constObj.dy};var H=0,L=0,K=e.geometry,k=mxUtils.format((E.geometry.x+3-K.x)/K.width);E=mxUtils.format((E.geometry.y+3-K.y)/K.height);0>k?(H=k*K.width,k=0):1<k&&(H=(k-1)*K.width,k=1);0>E?(L=E*K.height,E=0):1<E&&(L=(E-1)*K.height,E=1);return{x:k,y:E,dx:parseInt(H),dy:parseInt(L)}}function N(E){if(1==c.getSelectionCount()){var H=c.getSelectionCell();E&&(H.constObj=null);E=J(H);O.value=100*E.x;q.value=100*E.y;p.value=E.dx;G.value=E.dy;U.style.visibility=""}else U.style.visibility="hidden"}var I=document.createElement("div");I.style.width="350px";I.style.height="350px";I.style.overflow="hidden";I.style.border="1px solid lightGray";I.style.boxSizing="border-box";mxEvent.disableContextMenu(I);d.appendChild(I);var c=new Graph(I);c.transparentBackground=!1;c.autoExtend=!1;c.autoScroll=!1;c.setGridEnabled(!1);c.setEnabled(!0);c.setPanning(!0);c.setConnectable(!1);c.setTooltips(!1);c.minFitScale=null;c.maxFitScale=null;c.centerZoom=!0;c.maxFitScale=2;I=f.geometry;var e=new mxCell(f.value,-new mxGeometry(0,0,I.width,I.height),f.style+";rotatable=0;resizable=0;connectable=0;editable=0;movable=0;fillColor=none;");e.vertex=!0;c.addCell(e);c.dblClick=function(E,H){if(null!=H&&H!=e)c.setSelectionCell(H);else{H=mxUtils.convertPoint(c.container,mxEvent.getClientX(E),mxEvent.getClientY(E));mxEvent.consume(E);E=c.view.scale;var M=c.view.translate;c.setSelectionCell(x((H.x-3*E)/E-M.x,(H.y-3*E)/E-M.y))}};t=new mxKeyHandler(c);t.bindKey(46,v);t.bindKey(8,v);c.getRubberband().isForceRubberbandEvent=+new mxGeometry(0,0,I.width,I.height),f.style+";rotatable=0;resizable=0;connectable=0;editable=0;movable=0;fillColor=none;");e.vertex=!0;c.addCell(e);c.dblClick=function(E,H){if(null!=H&&H!=e)c.setSelectionCell(H);else{H=mxUtils.convertPoint(c.container,mxEvent.getClientX(E),mxEvent.getClientY(E));mxEvent.consume(E);E=c.view.scale;var L=c.view.translate;c.setSelectionCell(x((H.x-3*E)/E-L.x,(H.y-3*E)/E-L.y))}};t=new mxKeyHandler(c);t.bindKey(46,v);t.bindKey(8,v);c.getRubberband().isForceRubberbandEvent=function(E){return 0==E.evt.button&&(null==E.getCell()||E.getCell()==e)};c.panningHandler.isForcePanningEvent=function(E){return 2==E.evt.button};var g=c.isCellSelectable;c.isCellSelectable=function(E){return E==e?!1:g.apply(this,arguments)};c.getLinkForCell=function(){return null};var l=c.view.getState(e);I=c.getAllConnectionConstraints(l);for(var n=0;null!=I&&n<I.length;n++){var u=c.getConnectionPoint(l,I[n]);x(u.x-3,u.y-3,I[n])}c.fit(8);c.center();n=b.createToolbarButton(Editor.zoomInImage,mxResources.get("zoomIn"),function(){c.zoomIn()});u=b.createToolbarButton(Editor.zoomOutImage,mxResources.get("zoomOut"),function(){c.zoomOut()});var z=b.createToolbarButton(Editor.zoomFitImage,mxResources.get("fit"),function(){1==c.view.scale?(c.maxFitScale=8,c.fit(8)):c.zoomActual();c.center()}),D=function(){b.prompt(mxResources.get("gridSize"),c.gridSize,function(E){!isNaN(E)&&0<E&&(c.setGridSize(E),c.setGridEnabled(!0),c.refresh())})},C=b.createToolbarButton(Editor.thinGridImage,mxResources.get("grid"),function(E){mxEvent.isShiftDown(E)?D():(c.setGridEnabled(!c.isGridEnabled()),c.refresh())});mxEvent.addListener(C,"dblclick",D);var A=b.createToolbarButton(Editor.trashImage,mxResources.get("delete"),v);mxUtils.setOpacity(A,10);I=document.createElement("div");I.style.display="flex";I.style.alignItems="center";I.style.paddingTop="6px";I.appendChild(n);I.appendChild(u);I.appendChild(z);I.appendChild(C);I.appendChild(A);d.appendChild(I);var Q=document.createElement("input");Q.setAttribute("type","number");Q.setAttribute("min","1");Q.setAttribute("value",-"1");Q.style.width="45px";Q.style.position="relative";Q.style.margin="0 4px 0 4px";var S=document.createElement("select");S.style.position="relative";u=["left","right","top","bottom"];for(n=0;n<u.length;n++)z=u[n],C=document.createElement("option"),mxUtils.write(C,mxResources.get(z)),C.value=z,S.appendChild(C);n=mxUtils.button(mxResources.get("add"),function(){var E=parseInt(Q.value);E=1>E?1:100<E?100:E;Q.value=E;for(var H=S.value,M=e.geometry,L=[],k=0;k<E;k++){switch(H){case "left":var y=M.x;var F=-M.y+(k+1)*M.height/(E+1);break;case "right":y=M.x+M.width;F=M.y+(k+1)*M.height/(E+1);break;case "top":y=M.x+(k+1)*M.width/(E+1);F=M.y;break;case "bottom":y=M.x+(k+1)*M.width/(E+1),F=M.y+M.height}L.push(x(y-3,F-3))}c.setSelectionCells(L)});n.style.marginLeft="auto";I.appendChild(n);I.appendChild(Q);I.appendChild(S);var U=document.createElement("div");U.style.margin="4px 0px 8px 0px";U.style.whiteSpace="nowrap";U.style.height="24px";I=document.createElement("span");mxUtils.write(I,mxResources.get("dx"));+"1");Q.style.width="45px";Q.style.position="relative";Q.style.margin="0 4px 0 4px";var S=document.createElement("select");S.style.position="relative";u=["left","right","top","bottom"];for(n=0;n<u.length;n++)z=u[n],C=document.createElement("option"),mxUtils.write(C,mxResources.get(z)),C.value=z,S.appendChild(C);n=mxUtils.button(mxResources.get("add"),function(){var E=parseInt(Q.value);E=1>E?1:100<E?100:E;Q.value=E;for(var H=S.value,L=e.geometry,K=[],k=0;k<E;k++){switch(H){case "left":var y=L.x;var F=+L.y+(k+1)*L.height/(E+1);break;case "right":y=L.x+L.width;F=L.y+(k+1)*L.height/(E+1);break;case "top":y=L.x+(k+1)*L.width/(E+1);F=L.y;break;case "bottom":y=L.x+(k+1)*L.width/(E+1),F=L.y+L.height}K.push(x(y-3,F-3))}c.setSelectionCells(K)});n.style.marginLeft="auto";I.appendChild(n);I.appendChild(Q);I.appendChild(S);var U=document.createElement("div");U.style.margin="4px 0px 8px 0px";U.style.whiteSpace="nowrap";U.style.height="24px";I=document.createElement("span");mxUtils.write(I,mxResources.get("dx"));U.appendChild(I);var O=document.createElement("input");O.setAttribute("type","number");O.setAttribute("min","0");O.setAttribute("max","100");O.style.width="45px";O.style.margin="0 4px 0 4px";U.appendChild(O);mxUtils.write(U,"%");var p=document.createElement("input");p.setAttribute("type","number");p.style.width="45px";p.style.margin="0 4px 0 4px";U.appendChild(p);mxUtils.write(U,"pt");I=document.createElement("span");mxUtils.write(I,mxResources.get("dy"));I.style.marginLeft="12px";U.appendChild(I);var q=document.createElement("input");q.setAttribute("type","number");q.setAttribute("min","0");q.setAttribute("max","100");q.style.width="45px";q.style.margin="0 4px 0 4px";U.appendChild(q);mxUtils.write(U,"%");var G=document.createElement("input");G.setAttribute("type","number");G.style.width="45px";G.style.margin="0 4px 0 4px";U.appendChild(G);mxUtils.write(U,"pt");d.appendChild(U);N();c.getSelectionModel().addListener(mxEvent.CHANGE,function(){0<c.getSelectionCount()?mxUtils.setOpacity(A,60):-mxUtils.setOpacity(A,10);N()});c.addListener(mxEvent.CELLS_MOVED,N);mxEvent.addListener(O,"change",B);mxEvent.addListener(q,"change",B);mxEvent.addListener(p,"change",B);mxEvent.addListener(G,"change",B);I=mxUtils.button(mxResources.get("cancel"),function(){m();b.hideDialog()});I.className="geBtn";n=mxUtils.button(mxResources.get("apply"),function(){var E=c.model.cells,H=[],M=[],L;for(L in E){var k=E[L];k.cp&&M.push(J(k))}M.sort(function(y,F){return y.x!=F.x?y.x-F.x:y.y!=F.y?y.y-F.y:y.dx!=F.dx?y.dx--F.dx:y.dy-F.dy});for(E=0;E<M.length;E++)0<E&&M[E].x==M[E-1].x&&M[E].y==M[E-1].y&&M[E].dx==M[E-1].dx&&M[E].dy==M[E-1].dy||H.push("["+M[E].x+","+M[E].y+",0,"+M[E].dx+","+M[E].dy+"]");b.editor.graph.setCellStyles("points","["+H.join(",")+"]",[f]);m();b.hideDialog()});n.className="geBtn gePrimaryBtn";u=mxUtils.button(mxResources.get("reset"),function(){b.editor.graph.setCellStyles("points",null,[f]);m();b.hideDialog()});u.className="geBtn";z=document.createElement("div");z.style.marginTop="10px";z.style.textAlign=+mxUtils.setOpacity(A,10);N()});c.addListener(mxEvent.CELLS_MOVED,N);mxEvent.addListener(O,"change",B);mxEvent.addListener(q,"change",B);mxEvent.addListener(p,"change",B);mxEvent.addListener(G,"change",B);I=mxUtils.button(mxResources.get("cancel"),function(){m();b.hideDialog()});I.className="geBtn";n=mxUtils.button(mxResources.get("apply"),function(){var E=c.model.cells,H=[],L=[],K;for(K in E){var k=E[K];k.cp&&L.push(J(k))}L.sort(function(y,F){return y.x!=F.x?y.x-F.x:y.y!=F.y?y.y-F.y:y.dx!=F.dx?y.dx-+F.dx:y.dy-F.dy});for(E=0;E<L.length;E++)0<E&&L[E].x==L[E-1].x&&L[E].y==L[E-1].y&&L[E].dx==L[E-1].dx&&L[E].dy==L[E-1].dy||H.push("["+L[E].x+","+L[E].y+",0,"+L[E].dx+","+L[E].dy+"]");b.editor.graph.setCellStyles("points","["+H.join(",")+"]",[f]);m();b.hideDialog()});n.className="geBtn gePrimaryBtn";u=mxUtils.button(mxResources.get("reset"),function(){b.editor.graph.setCellStyles("points",null,[f]);m();b.hideDialog()});u.className="geBtn";z=document.createElement("div");z.style.marginTop="10px";z.style.textAlign="right";b.isOffline()||z.appendChild(b.createHelpIcon("https://www.drawio.com/doc/faq/shape-connection-points-customise"));b.editor.cancelFirst&&z.appendChild(I);z.appendChild(u);z.appendChild(n);b.editor.cancelFirst||z.appendChild(I);d.appendChild(z)};this.destroy=m;this.container=d};(function(){"undefined"!==typeof html4&&(html4.ATTRIBS["span::data-lucid-content"]=0,html4.ATTRIBS["span::data-lucid-type"]=0,html4.ATTRIBS["font::data-font-src"]=0);Editor.sketchFontFamily="Architects Daughter";Editor.sketchFontSource="https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter";Editor.sketchFonts=[{fontFamily:Editor.sketchFontFamily,fontUrl:decodeURIComponent(Editor.sketchFontSource)}];Editor.sketchDefaultCurveFitting="1";Editor.sketchDefaultJiggle="2";Editor.thinFormatImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0ibTM2LjUgMTguMzUtNi44NS02Ljg1IDMuMjUtMy4ycS44NS0uODUgMi4wMjUtLjg1IDEuMTc1IDAgMi4wMjUuODVsMi43NSAyLjhxLjg1LjguODUgMnQtLjg1IDJaTTYuODUgNDEuMXYtNi45bDkuNTUtOS41NUw1LjUgMTMuN2w3LjgtNy44NSAxMSAxMSA1LjM1LTUuMzUgNi44NSA2Ljg1LTUuMzUgNS4zNSAxMSAxMS03Ljg1IDcuNzUtMTAuOTUtMTAuOS05LjYgOS41NVptMTEuMi0xOC4wNSA0LjY1LTQuNi00LjA1LTQuMDUtMi4zNSAyLjQtMS42LTEuNiAyLjM1LTIuNC0zLjc1LTMuNzUtNC42IDQuNjVabTE2LjIgMTYuMjUgNC42NS00LjY1LTMuNzUtMy43NS0yLjQgMi40LTEuNi0xLjYgMi40LTIuNC00LjA1LTQtNC42IDQuNjVabS0yNS4xLS40NWgzLjZsMjAuNS0yMC40NS0zLjY1LTMuNjVMOS4xNSAzNS4yWiIvPjwvc3ZnPg==";Editor.thinGestureImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI4IDQxLjZxLTIuNSAwLTQuMDc1LTEuNjUtMS41NzUtMS42NS0xLjU3NS00LjM1IDAtMi4zNSAxLjEtNC4xIDEuMS0xLjc1IDIuODI1LTIuOTUgMS43MjUtMS4yIDMuNy0xLjgyNVQzMy42NSAyNnEtLjE1LTMuMDUtMS4yNS00LjQyNVQyOS4yNSAyMC4ycS0yLjMgMC00LjE3NSAxLjV0LTQuNDI1IDQuOTVxLTIuNjUgMy40NS00LjYgNS4xLTEuOTUgMS42NS00LjM1IDEuNjUtMi4xIDAtMy42NS0xLjM3NVE2LjUgMzAuNjUgNi41IDI3LjQ1cTAtMiAxLjItNC41MjUgMS4yLTIuNTI1IDMuNS02LjE3NSAxLjMtMS44NSAxLjk3NS0zLjIyNXQuNjc1LTIuMzc1cTAtLjctLjM1LTEuMDUtLjM1LS4zNS0xLjA1LS4zNS0uNzUgMC0xLjYuNDc1UTEwIDEwLjcgOSAxMS45TDcgOS44cTEuMzUtMS41NSAyLjcyNS0yLjI3NVExMS4xIDYuOCAxMi41IDYuOHExLjkgMCAzLjEgMS4yNSAxLjIgMS4yNSAxLjIgMy4yIDAgMS44LS45NzUgMy41NzVRMTQuODUgMTYuNiAxMy4wNSAxOS4zcS0xLjk1IDIuOTUtMi43NzUgNC43dC0uODI1IDMuNjVxMCAxLjYuNzUgMi4yLjc1LjYgMS43NS42IDEuNDUgMCAyLjgyNS0xLjMgMS4zNzUtMS4zIDMuNTc1LTQuMTUgMi45NS0zLjggNS41MjUtNS43NzUgMi41NzUtMS45NzUgNS42NzUtMS45NzUgMy4xNSAwIDUgMi4zMjVUMzYuNiAyNS45aDQuOXYyLjk1aC00LjlxLS40NSA3LjM1LTMuMiAxMC4wNS0yLjc1IDIuNy01LjQgMi43Wm0uMS0yLjk1cTEuODUgMCAzLjY1LTIuMjUgMS44LTIuMjUgMi03LjUtMi44LjE1LTUuNjI1IDIuMDI1VDI1LjMgMzUuOXEwIDEuMy43NSAyLjAyNS43NS43MjUgMi4wNS43MjVaIi8+PC9zdmc+";@@ -12727,8 +12733,8 @@ type:"bool",defVal:!1,isVisible:function(k,y){k=0<k.vertices.length?y.editorUi.edispName:"Fixed Width",type:"bool",defVal:!1},{name:"resizable",dispName:"Resizable",type:"bool",defVal:!0},{name:"resizeWidth",dispName:"Resize Width",type:"bool",defVal:!1},{name:"resizeHeight",dispName:"Resize Height",type:"bool",defVal:!1},{name:"rotatable",dispName:"Rotatable",type:"bool",defVal:!0},{name:"cloneable",dispName:"Cloneable",type:"bool",defVal:!0},{name:"deletable",dispName:"Deletable",type:"bool",defVal:!0},{name:"treeFolding",dispName:"Tree Folding",type:"bool",defVal:!1},{name:"treeMoving",dispName:"Tree Moving",type:"bool",defVal:!1},{name:"pointerEvents",dispName:"Pointer Events",type:"bool",defVal:!0,isVisible:function(k,y){var F=mxUtils.getValue(k.style,mxConstants.STYLE_FILLCOLOR,null);return!mxShape.forceFilledPointerEvents||y.editorUi.editor.graph.isSwimlane(k.vertices[0])||null==F||F==mxConstants.NONE||0==mxUtils.getValue(k.style,mxConstants.STYLE_FILL_OPACITY,100)||0==mxUtils.getValue(k.style,mxConstants.STYLE_OPACITY,100)||null!=k.style.pointerEvents}},{name:"moveCells",dispName:"Move Cells on Fold",type:"bool",defVal:!1,isVisible:function(k,y){return 0<k.vertices.length&&y.editorUi.editor.graph.isContainer(k.vertices[0])}}].concat(Editor.commonProperties);Editor.defaultCsvValue='##\n## Example CSV import. Use ## for comments and # for configuration. Paste CSV below.\n## The following names are reserved and should not be used (or ignored):\n## id, tooltip, placeholder(s), link and label (see below)\n##\n#\n## Node label with placeholders and HTML.\n## Default is \'%name_of_first_column%\'.\n#\n# label: %name%<br><i style="color:gray;">%position%</i><br><a href="mailto:%email%">Email</a>\n#\n## Node style (placeholders are replaced once).\n## Default is the current style for nodes.\n#\n# style: label;image=%image%;whiteSpace=wrap;html=1;rounded=1;fillColor=%fill%;strokeColor=%stroke%;\n#\n## Parent style for nodes with child nodes (placeholders are replaced once).\n#\n# parentstyle: swimlane;whiteSpace=wrap;html=1;childLayout=stackLayout;horizontal=1;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;\n#\n## Style to be used for objects not in the CSV. If this is - then such objects are ignored,\n## else they are created using this as their style, eg. whiteSpace=wrap;html=1;\n#\n# unknownStyle: -\n#\n## Optional column name that contains a reference to a named style in styles.\n## Default is the current style for nodes.\n#\n# stylename: -\n#\n## JSON for named styles of the form {"name": "style", "name": "style"} where style is a cell style with\n## placeholders that are replaced once.\n#\n# styles: -\n#\n## JSON for variables in styles of the form {"name": "value", "name": "value"} where name is a string\n## that will replace a placeholder in a style.\n#\n# vars: -\n#\n## Optional column name that contains a reference to a named label in labels.\n## Default is the current label.\n#\n# labelname: -\n#\n## JSON for named labels of the form {"name": "label", "name": "label"} where label is a cell label with\n## placeholders.\n#\n# labels: -\n#\n## Uses the given column name as the identity for cells (updates existing cells).\n## Default is no identity (empty value or -).\n#\n# identity: -\n#\n## Uses the given column name as the parent reference for cells. Default is no parent (empty or -).\n## The identity above is used for resolving the reference so it must be specified.\n#\n# parent: -\n#\n## Adds a prefix to the identity of cells to make sure they do not collide with existing cells (whose\n## IDs are numbers from 0..n, sometimes with a GUID prefix in the context of realtime collaboration).\n## Default is csvimport-.\n#\n# namespace: csvimport-\n#\n## Connections between rows ("from": source colum, "to": target column).\n## Label, style and invert are optional. Defaults are \'\', current style and false.\n## If placeholders are used in the style, they are replaced with data from the source.\n## An optional placeholders can be set to target to use data from the target instead.\n## In addition to label, an optional fromlabel and tolabel can be used to name the column\n## that contains the text for the label in the edges source or target (invert ignored).\n## In addition to those, an optional source and targetlabel can be used to specify a label\n## that contains placeholders referencing the respective columns in the source or target row.\n## The label is created in the form fromlabel + sourcelabel + label + tolabel + targetlabel.\n## Additional labels can be added by using an optional labels array with entries of the\n## form {"label": string, "x": number, "y": number, "dx": number, "dy": number} where\n## x is from -1 to 1 along the edge, y is orthogonal, and dx/dy are offsets in pixels.\n## An optional placeholders with the string value "source" or "target" can be specified\n## to replace placeholders in the additional label with data from the source or target.\n## An optional data object can be specified to define the metadata for the connector.\n## The target column may contain a comma-separated list of values.\n## Multiple connect entries are allowed.\n#\n# connect: {"from": "manager", "to": "name", "invert": true, "label": "manages", \\\n# "style": "curved=1;endArrow=blockThin;endFill=1;fontSize=11;"}\n# connect: {"from": "refs", "to": "id", "style": "curved=1;fontSize=11;"}\n#\n## Node x-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# left: \n#\n## Node y-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# top: \n#\n## Node width. Possible value is a number (in px), auto or an @ sign followed by a column\n## name that contains the value for the width. Default is auto.\n#\n# width: auto\n#\n## Node height. Possible value is a number (in px), auto, width or an @ sign followed by a column\n## name that contains the value for the height. Default is auto.\n#\n# height: auto\n#\n## Collapsed state for vertices. Possible values are true or false. Default is false.\n#\n# collapsed: false\n#\n## Padding for autosize. Default is 0.\n#\n# padding: -12\n#\n## Comma-separated list of ignored columns for metadata. (These can be\n## used for connections and styles but will not be added as metadata.)\n#\n# ignore: id,image,fill,stroke,refs,manager\n#\n## Column to be renamed to link attribute (used as link).\n#\n# link: url\n#\n## Spacing between nodes. Default is 40.\n#\n# nodespacing: 40\n#\n## Spacing between levels of hierarchical layouts. Default is 100.\n#\n# levelspacing: 100\n#\n## Spacing between parallel edges. Default is 40. Use 0 to disable.\n#\n# edgespacing: 40\n#\n## Name or JSON of layout. Possible values are auto, none, verticaltree, horizontaltree,\n## verticalflow, horizontalflow, organic, circle, orgchart or a JSON string as used in\n## Layout, Apply. Default is auto.\n#\n# layout: auto\n#\n## ---- CSV below this line. First line are column names. ----\nname,position,id,location,manager,email,fill,stroke,refs,url,image\nTessa Miller,CFO,emi,Office 1,,[email protected],default,#6c8ebf,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png\nEdward Morrison,Brand Manager,emo,Office 2,Tessa Miller,[email protected],default,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-10-3-128.png\nAlison Donovan,System Admin,rdo,Office 3,Tessa Miller,[email protected],default,#82b366,"emo,tva",https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-2-128.png\nEvan Valet,HR Director,tva,Office 4,Tessa Miller,[email protected],default,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png\n';-Editor.createRoughCanvas=function(k){var y=rough.canvas({getContext:function(){return k}});y.draw=function(F){var K=F.sets||[];F=F.options||this.getDefaultOptions();for(var P=0;P<K.length;P++){var R=K[P];switch(R.type){case "path":null!=F.stroke&&this._drawToContext(k,R,F);break;case "fillPath":this._drawToContext(k,R,F);break;case "fillSketch":this.fillSketch(k,R,F)}}};y.fillSketch=function(F,K,P){var R=k.state.strokeColor,T=k.state.strokeWidth,V=k.state.strokeAlpha,W=k.state.dashed,X=P.fillWeight;-0>X&&(X=P.strokeWidth/2);k.setStrokeAlpha(k.state.fillAlpha);k.setStrokeColor(P.fill||"");k.setStrokeWidth(X);k.setDashed(!1);this._drawToContext(F,K,P);k.setDashed(W);k.setStrokeWidth(T);k.setStrokeColor(R);k.setStrokeAlpha(V)};y._drawToContext=function(F,K,P){F.begin();for(var R=0;R<K.ops.length;R++){var T=K.ops[R],V=T.data;switch(T.op){case "move":F.moveTo(V[0],V[1]);break;case "bcurveTo":F.curveTo(V[0],V[1],V[2],V[3],V[4],V[5]);break;case "lineTo":F.lineTo(V[0],V[1])}}F.end();"fillPath"===K.type&&+Editor.createRoughCanvas=function(k){var y=rough.canvas({getContext:function(){return k}});y.draw=function(F){var M=F.sets||[];F=F.options||this.getDefaultOptions();for(var P=0;P<M.length;P++){var R=M[P];switch(R.type){case "path":null!=F.stroke&&this._drawToContext(k,R,F);break;case "fillPath":this._drawToContext(k,R,F);break;case "fillSketch":this.fillSketch(k,R,F)}}};y.fillSketch=function(F,M,P){var R=k.state.strokeColor,T=k.state.strokeWidth,V=k.state.strokeAlpha,W=k.state.dashed,X=P.fillWeight;+0>X&&(X=P.strokeWidth/2);k.setStrokeAlpha(k.state.fillAlpha);k.setStrokeColor(P.fill||"");k.setStrokeWidth(X);k.setDashed(!1);this._drawToContext(F,M,P);k.setDashed(W);k.setStrokeWidth(T);k.setStrokeColor(R);k.setStrokeAlpha(V)};y._drawToContext=function(F,M,P){F.begin();for(var R=0;R<M.ops.length;R++){var T=M.ops[R],V=T.data;switch(T.op){case "move":F.moveTo(V[0],V[1]);break;case "bcurveTo":F.curveTo(V[0],V[1],V[2],V[3],V[4],V[5]);break;case "lineTo":F.lineTo(V[0],V[1])}}F.end();"fillPath"===M.type&&P.filled?F.fill():F.stroke()};return y};(function(){function k(R,T,V){this.canvas=R;this.rc=T;this.shape=V;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=mxUtils.bind(this,k.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,k.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,k.prototype.rect);this.originalRoundrect=this.canvas.roundrect;this.canvas.roundrect=mxUtils.bind(this,k.prototype.roundrect);this.originalEllipse=this.canvas.ellipse;this.canvas.ellipse=mxUtils.bind(this,k.prototype.ellipse);this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,k.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,k.prototype.moveTo);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,k.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,k.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,k.prototype.arcTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,k.prototype.close);this.originalFill=this.canvas.fill;this.canvas.fill=mxUtils.bind(this,k.prototype.fill);this.originalStroke=this.canvas.stroke;this.canvas.stroke=mxUtils.bind(this,k.prototype.stroke);this.originalFillAndStroke=this.canvas.fillAndStroke;this.canvas.fillAndStroke=mxUtils.bind(this,k.prototype.fillAndStroke);@@ -12738,22 +12744,22 @@ W.roughness);V.simplification=mxUtils.getValue(this.shape.style,"simplification"T);V.zigzagOffset=mxUtils.getValue(this.shape.style,"zigzagOffset",T);T=mxUtils.getValue(this.shape.style,"fillWeight",-1);V.fillWeight="auto"==T?-1:T;T=mxUtils.getValue(this.shape.style,"fillStyle","auto");"dots"==T&&(T="auto");"auto"==T&&(T=[mxUtils.hex2rgb("#ffffff")],null!=this.shape.state&&T.push(mxUtils.hex2rgb(this.shape.state.view.graph.shapeBackgroundColor)),Editor.isDarkMode()&&T.push(mxUtils.hex2rgb(Editor.darkColor)),T=null!=V.fill&&(null!=R||0<=mxUtils.indexOf(T,mxUtils.hex2rgb(V.fill)))?"solid":W.fillStyle);V.fillStyle=T;return V};k.prototype.begin=function(){this.passThrough?this.originalBegin.apply(this.canvas,arguments):this.path=[]};k.prototype.end=function(){this.passThrough&&this.originalEnd.apply(this.canvas,arguments)};k.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var R=2;R<arguments.length;R+=2)this.lastX=arguments[R-1],this.lastY=arguments[R],this.path.push(this.canvas.format(this.lastX)),this.path.push(this.canvas.format(this.lastY))};k.prototype.lineTo=function(R,T){this.passThrough?this.originalLineTo.apply(this.canvas,arguments):(this.addOp(this.lineOp,R,T),this.lastX=R,this.lastY=T)};k.prototype.moveTo=function(R,T){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,R,T),this.lastX=R,this.lastY=T,this.firstX=R,this.firstY=T)};k.prototype.close=function(){this.passThrough?this.originalClose.apply(this.canvas,arguments):this.addOp(this.closeOp)};k.prototype.quadTo=function(R,T,V,W){this.passThrough?-this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,R,T,V,W),this.lastX=V,this.lastY=W)};k.prototype.curveTo=function(R,T,V,W,X,Z){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,R,T,V,W,X,Z),this.lastX=X,this.lastY=Z)};k.prototype.arcTo=function(R,T,V,W,X,Z,Y){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var da=mxUtils.arcToCurves(this.lastX,this.lastY,R,T,V,W,X,Z,Y);if(null!=da)for(var ea=0;ea<da.length;ea+=-6)this.curveTo(da[ea],da[ea+1],da[ea+2],da[ea+3],da[ea+4],da[ea+5]);this.lastX=Z;this.lastY=Y}};k.prototype.rect=function(R,T,V,W){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(R,T,V,W,this.getStyle(!0,!0)))};k.prototype.ellipse=function(R,T,V,W){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(R+V/2,T+W/2,V,W,this.getStyle(!0,!0)))};k.prototype.roundrect=-function(R,T,V,W,X,Z){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(R+X,T),this.lineTo(R+V-X,T),this.quadTo(R+V,T,R+V,T+Z),this.lineTo(R+V,T+W-Z),this.quadTo(R+V,T+W,R+V-X,T+W),this.lineTo(R+X,T+W),this.quadTo(R,T+W,R,T+W-Z),this.lineTo(R,T+Z),this.quadTo(R,T,R+X,T))};k.prototype.drawPath=function(R){if(0<this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),R)}catch(V){}this.passThrough=!1}else if(null!=this.nextShape){for(var T in R)this.nextShape.options[T]=+this.originalQuadTo.apply(this.canvas,arguments):(this.addOp(this.quadOp,R,T,V,W),this.lastX=V,this.lastY=W)};k.prototype.curveTo=function(R,T,V,W,X,Y){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,R,T,V,W,X,Y),this.lastX=X,this.lastY=Y)};k.prototype.arcTo=function(R,T,V,W,X,Y,Z){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var da=mxUtils.arcToCurves(this.lastX,this.lastY,R,T,V,W,X,Y,Z);if(null!=da)for(var ea=0;ea<da.length;ea+=+6)this.curveTo(da[ea],da[ea+1],da[ea+2],da[ea+3],da[ea+4],da[ea+5]);this.lastX=Y;this.lastY=Z}};k.prototype.rect=function(R,T,V,W){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(R,T,V,W,this.getStyle(!0,!0)))};k.prototype.ellipse=function(R,T,V,W){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(R+V/2,T+W/2,V,W,this.getStyle(!0,!0)))};k.prototype.roundrect=+function(R,T,V,W,X,Y){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(R+X,T),this.lineTo(R+V-X,T),this.quadTo(R+V,T,R+V,T+Y),this.lineTo(R+V,T+W-Y),this.quadTo(R+V,T+W,R+V-X,T+W),this.lineTo(R+X,T+W),this.quadTo(R,T+W,R,T+W-Y),this.lineTo(R,T+Y),this.quadTo(R,T,R+X,T))};k.prototype.drawPath=function(R){if(0<this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),R)}catch(V){}this.passThrough=!1}else if(null!=this.nextShape){for(var T in R)this.nextShape.options[T]=R[T];R.stroke!=mxConstants.NONE&&null!=R.stroke||delete this.nextShape.options.stroke;R.filled||delete this.nextShape.options.fill;this.passThrough=!0;this.rc.draw(this.nextShape);this.passThrough=!1}};k.prototype.stroke=function(){this.passThrough?this.originalStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!1))};k.prototype.fill=function(){this.passThrough?this.originalFill.apply(this.canvas,arguments):this.drawPath(this.getStyle(!1,!0))};k.prototype.fillAndStroke=function(){this.passThrough?this.originalFillAndStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!0))};k.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo;this.canvas.close=this.originalClose;this.canvas.fill=this.originalFill;this.canvas.stroke=this.originalStroke;this.canvas.fillAndStroke=this.originalFillAndStroke;this.canvas.begin=this.originalBegin;this.canvas.end=this.originalEnd;this.canvas.rect=this.originalRect;this.canvas.ellipse=this.originalEllipse;this.canvas.roundrect=this.originalRoundrect};mxShape.prototype.createRoughCanvas=function(R){return new k(R,Editor.createRoughCanvas(R),this)};var y=mxShape.prototype.createHandJiggle;mxShape.prototype.createHandJiggle=function(R){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?y.apply(this,arguments):"comic"==mxUtils.getValue(this.style,-"sketchStyle","rough")?this.createComicCanvas(R):this.createRoughCanvas(R)};var F=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(R,T,V,W,X){null!=R.handJiggle&&R.handJiggle.passThrough||F.apply(this,arguments)};var K=mxShape.prototype.paint;mxShape.prototype.paint=function(R){var T=R.addTolerance,V=!0;null!=this.style&&(V="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=R.handJiggle&&R.handJiggle.constructor==k&&!this.outline){R.save();-var W=this.fill,X=this.stroke;this.stroke=this.fill=null;var Z=this.configurePointerEvents,Y=R.setStrokeColor;R.setStrokeColor=function(){};var da=R.setFillColor;R.setFillColor=function(){};V||null==W||(this.configurePointerEvents=function(){});R.handJiggle.passThrough=!0;K.apply(this,arguments);R.handJiggle.passThrough=!1;R.setFillColor=da;R.setStrokeColor=Y;this.configurePointerEvents=Z;this.stroke=X;this.fill=W;R.restore();V&&null!=W&&(R.addTolerance=function(){})}K.apply(this,arguments);R.addTolerance=-T};var P=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(R,T,V,W,X,Z){null!=R.handJiggle&&R.handJiggle.constructor==k?(R.handJiggle.passThrough=!0,P.apply(this,arguments),R.handJiggle.passThrough=!1):P.apply(this,arguments)}})();Editor.fastCompress=function(k){return null==k||0==k.length||"undefined"===typeof pako?k:Graph.arrayBufferToString(pako.deflateRaw(k))};Editor.fastDecompress=function(k){return null==k||0==k.length||"undefined"===typeof pako?k:pako.inflateRaw(Graph.stringToArrayBuffer(atob(k)),-{to:"string"})};Editor.extractGraphModel=function(k,y,F){if(null!=k&&"undefined"!==typeof pako){var K=k.ownerDocument.getElementsByTagName("div"),P=[];if(null!=K&&0<K.length)for(var R=0;R<K.length;R++)if("mxgraph"==K[R].getAttribute("class")){P.push(K[R]);break}0<P.length&&(K=P[0].getAttribute("data-mxgraph"),null!=K?(P=JSON.parse(K),null!=P&&null!=P.xml&&(k=mxUtils.parseXml(P.xml),k=k.documentElement)):(P=P[0].getElementsByTagName("div"),0<P.length&&(K=mxUtils.getTextContent(P[0]),K=Graph.decompress(K,-null,F),0<K.length&&(k=mxUtils.parseXml(K),k=k.documentElement))))}if(null!=k&&"svg"==k.nodeName)if(K=k.getAttribute("content"),null!=K&&"<"!=K.charAt(0)&&"%"!=K.charAt(0)&&(K=unescape(window.atob?atob(K):Base64.decode(cont,K))),null!=K&&"%"==K.charAt(0)&&(K=decodeURIComponent(K)),null!=K&&0<K.length)k=mxUtils.parseXml(K).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==k||y||(P=null,"diagram"==k.nodeName?P=k:"mxfile"==k.nodeName&&(K=k.getElementsByTagName("diagram"),0<-K.length&&(P=K[Math.max(0,Math.min(K.length-1,urlParams.page||0))])),null!=P&&(k=Editor.parseDiagramNode(P,F)));null==k||"mxGraphModel"==k.nodeName||y&&"mxfile"==k.nodeName||(k=null);return k};Editor.parseDiagramNode=function(k,y,F){Editor.validateDiagramNode(k);var K=mxUtils.trim(mxUtils.getTextContent(k)),P=null;0<K.length?(y=Graph.decompress(K,null,y),null!=y&&0<y.length&&(P=mxUtils.parseXml(y).documentElement)):(k=mxUtils.getChildNodes(k),0<k.length&&(P=k[0],F&&(P=Editor.parseDiagramNode(P,y,+"sketchStyle","rough")?this.createComicCanvas(R):this.createRoughCanvas(R)};var F=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(R,T,V,W,X){null!=R.handJiggle&&R.handJiggle.passThrough||F.apply(this,arguments)};var M=mxShape.prototype.paint;mxShape.prototype.paint=function(R){var T=R.addTolerance,V=!0;null!=this.style&&(V="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=R.handJiggle&&R.handJiggle.constructor==k&&!this.outline){R.save();+var W=this.fill,X=this.stroke;this.stroke=this.fill=null;var Y=this.configurePointerEvents,Z=R.setStrokeColor;R.setStrokeColor=function(){};var da=R.setFillColor;R.setFillColor=function(){};V||null==W||(this.configurePointerEvents=function(){});R.handJiggle.passThrough=!0;M.apply(this,arguments);R.handJiggle.passThrough=!1;R.setFillColor=da;R.setStrokeColor=Z;this.configurePointerEvents=Y;this.stroke=X;this.fill=W;R.restore();V&&null!=W&&(R.addTolerance=function(){})}M.apply(this,arguments);R.addTolerance=+T};var P=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(R,T,V,W,X,Y){null!=R.handJiggle&&R.handJiggle.constructor==k?(R.handJiggle.passThrough=!0,P.apply(this,arguments),R.handJiggle.passThrough=!1):P.apply(this,arguments)}})();Editor.fastCompress=function(k){return null==k||0==k.length||"undefined"===typeof pako?k:Graph.arrayBufferToString(pako.deflateRaw(k))};Editor.fastDecompress=function(k){return null==k||0==k.length||"undefined"===typeof pako?k:pako.inflateRaw(Graph.stringToArrayBuffer(atob(k)),+{to:"string"})};Editor.extractGraphModel=function(k,y,F){if(null!=k&&"undefined"!==typeof pako){var M=k.ownerDocument.getElementsByTagName("div"),P=[];if(null!=M&&0<M.length)for(var R=0;R<M.length;R++)if("mxgraph"==M[R].getAttribute("class")){P.push(M[R]);break}0<P.length&&(M=P[0].getAttribute("data-mxgraph"),null!=M?(P=JSON.parse(M),null!=P&&null!=P.xml&&(k=mxUtils.parseXml(P.xml),k=k.documentElement)):(P=P[0].getElementsByTagName("div"),0<P.length&&(M=mxUtils.getTextContent(P[0]),M=Graph.decompress(M,+null,F),0<M.length&&(k=mxUtils.parseXml(M),k=k.documentElement))))}if(null!=k&&"svg"==k.nodeName)if(M=k.getAttribute("content"),null!=M&&"<"!=M.charAt(0)&&"%"!=M.charAt(0)&&(M=unescape(window.atob?atob(M):Base64.decode(cont,M))),null!=M&&"%"==M.charAt(0)&&(M=decodeURIComponent(M)),null!=M&&0<M.length)k=mxUtils.parseXml(M).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==k||y||(P=null,"diagram"==k.nodeName?P=k:"mxfile"==k.nodeName&&(M=k.getElementsByTagName("diagram"),0<+M.length&&(P=M[Math.max(0,Math.min(M.length-1,urlParams.page||0))])),null!=P&&(k=Editor.parseDiagramNode(P,F)));null==k||"mxGraphModel"==k.nodeName||y&&"mxfile"==k.nodeName||(k=null);return k};Editor.parseDiagramNode=function(k,y,F){Editor.validateDiagramNode(k);var M=mxUtils.trim(mxUtils.getTextContent(k)),P=null;0<M.length?(y=Graph.decompress(M,null,y),null!=y&&0<y.length&&(P=mxUtils.parseXml(y).documentElement)):(k=mxUtils.getChildNodes(k),0<k.length&&(P=k[0],F&&(P=Editor.parseDiagramNode(P,y,!1)),y=mxUtils.createXmlDocument(),y.appendChild(y.importNode(P,!0)),P=y.documentElement));return P};Editor.getDiagramNodeXml=function(k){Editor.validateDiagramNode(k);var y=mxUtils.getNodeValue(k),F=null;0<y.length?F=Graph.decompress(y):(k=k.getElementsByTagName("mxGraphModel"),null!=k&&0<k.length&&(F=mxUtils.getXml(k[0])));return F};Editor.validateDiagramNode=function(k){if(0==mxUtils.trim(mxUtils.getTextContent(k)).length&&0==mxUtils.getChildNodes(k).length){var y=new mxCodec,F=new mxGraphModel;-k.appendChild(y.encode(F))}return k};Editor.extractGraphModelFromPdf=function(k){var y=null;k=k.substring(k.indexOf(",")+1);k=window.atob&&!mxClient.IS_SF?atob(k):Base64.decode(k,!0);if("%PDF-1.7"==k.substring(0,8)){var F=k.indexOf("EmbeddedFile");if(-1<F){var K=k.indexOf("stream",F)+9;if(0<k.substring(F,K).indexOf("application#2Fvnd.jgraph.mxfile")){var P=k.indexOf("endstream",K-1);return pako.inflateRaw(Graph.stringToArrayBuffer(k.substring(K,P)),{to:"string"})}}for(F=k.indexOf("/ObjStm");0<F;){K=-k.indexOf("stream",F)+9;P=k.indexOf("endstream",K-1);K=pako.inflateRaw(Graph.stringToArrayBuffer(k.substring(K,P)),{to:"string"});P=K.indexOf("/Subject <");if(0<P){F=K.substring(P+14,K.indexOf(">",P));if(null!=F){y=F;F=[];for(K=0;K<y.length;K+=2)P=y.substr(K,2),"00"!=P&&F.push(String.fromCharCode(parseInt(P,16)));y=F.join("")}break}F=k.indexOf("/ObjStm",F+1)}}if(null==y&&"%PDF-1.4"==k.substring(0,8)){F="";P=K=0;for(var R=[],T=null;P<k.length;){var V=k.charCodeAt(P);P+=1;10!=V&&(F+=String.fromCharCode(V));-V=="/Subject (%3Cmxfile".charCodeAt(K)?K++:K=0;if(19==K){var W=k.indexOf("%3C%2Fmxfile%3E",P)+15;P-=9;if(W>P){y=k.substring(P,W);break}}10==V&&("endobj"==F?T=null:"obj"==F.substring(F.length-3,F.length)||"xref"==F||"trailer"==F?(T=[],R[F.split(" ")[0]]=T):null!=T&&T.push(F),F="")}}null==y&&null!=R&&(y=Editor.extractGraphModelFromXref(R));null!=y&&(y=decodeURIComponent(y.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return y};Editor.extractGraphModelFromXref=function(k){var y=k.trailer,F=null;null!=+k.appendChild(y.encode(F))}return k};Editor.extractGraphModelFromPdf=function(k){var y=null;k=k.substring(k.indexOf(",")+1);k=window.atob&&!mxClient.IS_SF?atob(k):Base64.decode(k,!0);if("%PDF-1.7"==k.substring(0,8)){var F=k.indexOf("EmbeddedFile");if(-1<F){var M=k.indexOf("stream",F)+9;if(0<k.substring(F,M).indexOf("application#2Fvnd.jgraph.mxfile")){var P=k.indexOf("endstream",M-1);return pako.inflateRaw(Graph.stringToArrayBuffer(k.substring(M,P)),{to:"string"})}}for(F=k.indexOf("/ObjStm");0<F;){M=+k.indexOf("stream",F)+9;P=k.indexOf("endstream",M-1);M=pako.inflateRaw(Graph.stringToArrayBuffer(k.substring(M,P)),{to:"string"});P=M.indexOf("/Subject <");if(0<P){F=M.substring(P+14,M.indexOf(">",P));if(null!=F){y=F;F=[];for(M=0;M<y.length;M+=2)P=y.substr(M,2),"00"!=P&&F.push(String.fromCharCode(parseInt(P,16)));y=F.join("")}break}F=k.indexOf("/ObjStm",F+1)}}if(null==y&&"%PDF-1.4"==k.substring(0,8)){F="";P=M=0;for(var R=[],T=null;P<k.length;){var V=k.charCodeAt(P);P+=1;10!=V&&(F+=String.fromCharCode(V));+V=="/Subject (%3Cmxfile".charCodeAt(M)?M++:M=0;if(19==M){var W=k.indexOf("%3C%2Fmxfile%3E",P)+15;P-=9;if(W>P){y=k.substring(P,W);break}}10==V&&("endobj"==F?T=null:"obj"==F.substring(F.length-3,F.length)||"xref"==F||"trailer"==F?(T=[],R[F.split(" ")[0]]=T):null!=T&&T.push(F),F="")}}null==y&&null!=R&&(y=Editor.extractGraphModelFromXref(R));null!=y&&(y=decodeURIComponent(y.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return y};Editor.extractGraphModelFromXref=function(k){var y=k.trailer,F=null;null!=y&&(y=/.* \/Info (\d+) (\d+) R/g.exec(y.join("\n")),null!=y&&0<y.length&&(y=k[y[1]],null!=y&&(y=/.* \/Subject (\d+) (\d+) R/g.exec(y.join("\n")),null!=y&&0<y.length&&(k=k[y[1]],null!=k&&(k=k.join("\n"),F=k.substring(1,k.length-1))))));return F};Editor.extractParserError=function(k,y){var F=null;k=null!=k?k.getElementsByTagName("parsererror"):null;null!=k&&0<k.length&&(F=y||mxResources.get("invalidChars"),y=k[0].getElementsByTagName("div"),0<y.length&&(F=mxUtils.getTextContent(y[0])));return null!=F?mxUtils.trim(F):F};Editor.addRetryToError=function(k,y){null!=k&&(k=null!=k.error?k.error:k,null==k.retry&&(k.retry=y))};Editor.mermaidToDrawio=function(k,y,F){if("function"===typeof mxMermaidToDrawio)return mxMermaidToDrawio(k,y,F)};Editor.configure=function(k){if(null!=k){Editor.config=k;Editor.configVersion=k.version;k.debug&&(urlParams.test="1");null!=k.defaultFonts&&(Menus.prototype.defaultFonts=k.defaultFonts);null!=k.presetColors&&(ColorDialog.prototype.presetColors=k.presetColors);null!=k.defaultColors&&(ColorDialog.prototype.defaultColors=k.defaultColors);null!=k.colorNames&&(ColorDialog.prototype.colorNames=k.colorNames);null!=k.defaultColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=k.defaultColorSchemes);null!=k.defaultEdgeLength&&(Graph.prototype.defaultEdgeLength=k.defaultEdgeLength);null!=k.selectParentLayer&&(Graph.selectParentLayer=k.selectParentLayer);null!=k.autosaveDelay&&(DrawioFile.prototype.autosaveDelay=k.autosaveDelay);null!=k.templateFile&&(EditorUi.templateFile=@@ -12769,50 +12775,50 @@ mxGraph.prototype.defaultPageFormat):EditorUi.debug("Configuration Error: {width!isNaN(y)&&0<y?DrawioFile.prototype.autosaveDelay=y:EditorUi.debug("Configuration Error: Int > 0 expected for autosaveDelay"));null!=k.maxImageBytes&&(EditorUi.prototype.maxImageBytes=k.maxImageBytes);null!=k.maxImageSize&&(EditorUi.prototype.maxImageSize=k.maxImageSize);null!=k.shareCursorPosition&&(EditorUi.prototype.shareCursorPosition=k.shareCursorPosition);null!=k.showRemoteCursors&&(EditorUi.prototype.showRemoteCursors=k.showRemoteCursors);null!=k.restrictExport&&(DrawioFile.RESTRICT_EXPORT=k.restrictExport);null!=k.replaceSvgDataUris&&(Editor.replaceSvgDataUris=k.replaceSvgDataUris);null!=k.foreignObjectImages&&(Editor.foreignObjectImages=k.foreignObjectImages);null!=k.shadowColor&&(mxConstants.SHADOW_COLOR=k.shadowColor);null!=k.shadowOpacity&&(mxConstants.SHADOW_OPACITY=k.shadowOpacity);null!=k.shadowOffsetX&&(mxConstants.SHADOW_OFFSET_X=k.shadowOffsetX);null!=k.shadowOffsetY&&(mxConstants.SHADOW_OFFSET_Y=k.shadowOffsetY);null!=k.shadowBlur&&(mxConstants.SHADOW_BLUR=k.shadowBlur);null!=k.enableAnimations&&(Editor.enableAnimations=k.enableAnimations);null!=k.enableChatGpt&&(Editor.enableChatGpt=k.enableChatGpt);null!=k.gptApiKey&&(Editor.gptApiKey=k.gptApiKey);null!=k.gptModel&&(Editor.gptModel=k.gptModel);null!=k.gptUrl&&(Editor.gptUrl=k.gptUrl)}};Editor.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.configureFontCss=function(k){if(null!=k){Editor.prototype.fontCss=k;var y=document.getElementsByTagName("script")[0];-if(null!=y&&null!=y.parentNode){var F=document.createElement("style");F.setAttribute("type","text/css");F.appendChild(document.createTextNode(k));y.parentNode.insertBefore(F,y);k=k.split("url(");for(F=1;F<k.length;F++){var K=k[F].indexOf(")");K=Editor.trimCssUrl(k[F].substring(0,K));var P=document.createElement("link");P.setAttribute("rel","preload");P.setAttribute("href",K);P.setAttribute("as","font");P.setAttribute("crossorigin","");y.parentNode.insertBefore(P,y)}}}};Editor.trimCssUrl=function(k){return k.replace(RegExp("^[\\s\"']+",+if(null!=y&&null!=y.parentNode){var F=document.createElement("style");F.setAttribute("type","text/css");F.appendChild(document.createTextNode(k));y.parentNode.insertBefore(F,y);k=k.split("url(");for(F=1;F<k.length;F++){var M=k[F].indexOf(")");M=Editor.trimCssUrl(k[F].substring(0,M));var P=document.createElement("link");P.setAttribute("rel","preload");P.setAttribute("href",M);P.setAttribute("as","font");P.setAttribute("crossorigin","");y.parentNode.insertBefore(P,y)}}}};Editor.trimCssUrl=function(k){return k.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")};Editor.GOOGLE_FONTS="https://fonts.googleapis.com/css?family=";Editor.GOOGLE_FONTS_CSS2="https://fonts.googleapis.com/css2?family=";Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";Editor.GUID_LENGTH=20;Editor.guid=function(k){k=null!=k?k:Editor.GUID_LENGTH;for(var y=[],F=0;F<k;F++)y.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*Editor.GUID_ALPHABET.length)));return y.join("")};Editor.updateStatusInterval=1E4;Editor.prototype.appName="draw.io";Editor.prototype.diagramFileTypes=[{description:"diagramXmlDesc",extension:"drawio",mimeType:"text/xml"},{description:"diagramPngDesc",extension:"png",mimeType:"image/png"},{description:"diagramSvgDesc",extension:"svg",mimeType:"image/svg"},{description:"diagramHtmlDesc",extension:"html",mimeType:"text/html"}];Editor.prototype.libraryFileTypes=[{description:"Library (.drawiolib, .xml)",extensions:["drawiolib","xml"]}];Editor.prototype.fileExtensions=[{ext:"html",title:"filetypeHtml"},{ext:"png",title:"filetypePng"},{ext:"svg",title:"filetypeSvg"}];Editor.prototype.timeout=25E3;Editor.prototype.editButtonLink=null!=urlParams.edit?decodeURIComponent(urlParams.edit):null;Editor.prototype.crossOriginImages=!mxClient.IS_IE;var b=Editor.prototype.setGraphXml;Editor.prototype.setGraphXml=function(k){k=null!=k&&"mxlibrary"!=k.nodeName?this.extractGraphModel(k):null;if(null!=k){var y=Editor.extractParserError(k,mxResources.get("invalidOrMissingFile"));if(y)throw EditorUi.debug("Editor.setGraphXml ParserError",-[this],"node",[k],"cause",[y]),Error(mxResources.get("notADiagramFile")+" ("+y+")");if("mxGraphModel"==k.nodeName){y=k.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=y&&""!=y)y!=this.graph.currentStyle&&(F=null!=this.graph.themes?this.graph.themes[y]:mxUtils.load(STYLE_PATH+"/"+y+".xml").getDocumentElement(),null!=F&&(K=new mxCodec(F.ownerDocument),K.decode(F,this.graph.getStylesheet())));else{var F=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+-"/default-old.xml").getDocumentElement();if(null!=F){var K=new mxCodec(F.ownerDocument);K.decode(F,this.graph.getStylesheet())}}this.graph.currentStyle=y;this.graph.mathEnabled="1"==urlParams.math||"1"==k.getAttribute("math");this.graph.setAdaptiveColors(k.getAttribute("adaptiveColors"));y=k.getAttribute("backgroundImage");null!=y?this.graph.setBackgroundImage(this.graph.parseBackgroundImage(y)):this.graph.setBackgroundImage(null);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&+[this],"node",[k],"cause",[y]),Error(mxResources.get("notADiagramFile")+" ("+y+")");if("mxGraphModel"==k.nodeName){y=k.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=y&&""!=y)y!=this.graph.currentStyle&&(F=null!=this.graph.themes?this.graph.themes[y]:mxUtils.load(STYLE_PATH+"/"+y+".xml").getDocumentElement(),null!=F&&(M=new mxCodec(F.ownerDocument),M.decode(F,this.graph.getStylesheet())));else{var F=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH++"/default-old.xml").getDocumentElement();if(null!=F){var M=new mxCodec(F.ownerDocument);M.decode(F,this.graph.getStylesheet())}}this.graph.currentStyle=y;this.graph.mathEnabled="1"==urlParams.math||"1"==k.getAttribute("math");this.graph.setAdaptiveColors(k.getAttribute("adaptiveColors"));y=k.getAttribute("backgroundImage");null!=y?this.graph.setBackgroundImage(this.graph.parseBackgroundImage(y)):this.graph.setBackgroundImage(null);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==k.getAttribute("shadow"),!1);if(y=k.getAttribute("extFonts"))try{for(y=y.split("|").map(function(P){P=P.split("^");return{name:P[0],url:P[1]}}),F=0;F<y.length;F++)this.graph.addExtFont(y[F].name,y[F].url)}catch(P){console.log("ExtFonts format error: "+P.message)}else null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(this.graph.extFonts=[])}b.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||-"Invalid data",toString:function(){return this.message}};};var f=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(k,y){k=null!=k?k:!0;var F=f.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&F.setAttribute("style",this.graph.currentStyle);var K=this.graph.getBackgroundImageObject(this.graph.backgroundImage,y);null!=K&&F.setAttribute("backgroundImage",JSON.stringify(K));F.setAttribute("math",this.graph.mathEnabled?"1":"0");F.setAttribute("shadow",-this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?F.setAttribute("adaptiveColors",this.graph.adaptiveColors):F.removeAttribute("adaptiveColors");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(K=this.graph.extFonts.map(function(P){return P.name+"^"+P.url}),F.setAttribute("extFonts",K.join("|")));return F};Editor.prototype.isDataSvg=function(k){try{var y=mxUtils.parseXml(k).documentElement.getAttribute("content");if(null!=y&&(null!=y&&"<"!=y.charAt(0)&&"%"!=y.charAt(0)&&(y=-unescape(window.atob?atob(y):Base64.decode(cont,y))),null!=y&&"%"==y.charAt(0)&&(y=decodeURIComponent(y)),null!=y&&0<y.length)){var F=mxUtils.parseXml(y).documentElement;return"mxfile"==F.nodeName||"mxGraphModel"==F.nodeName}}catch(K){}return!1};Editor.prototype.extractGraphModel=function(k,y,F){return Editor.extractGraphModel.apply(this,arguments)};var m=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.setAdaptiveColors(null);+"Invalid data",toString:function(){return this.message}};};var f=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(k,y){k=null!=k?k:!0;var F=f.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&F.setAttribute("style",this.graph.currentStyle);var M=this.graph.getBackgroundImageObject(this.graph.backgroundImage,y);null!=M&&F.setAttribute("backgroundImage",JSON.stringify(M));F.setAttribute("math",this.graph.mathEnabled?"1":"0");F.setAttribute("shadow",+this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?F.setAttribute("adaptiveColors",this.graph.adaptiveColors):F.removeAttribute("adaptiveColors");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(M=this.graph.extFonts.map(function(P){return P.name+"^"+P.url}),F.setAttribute("extFonts",M.join("|")));return F};Editor.prototype.isDataSvg=function(k){try{var y=mxUtils.parseXml(k).documentElement.getAttribute("content");if(null!=y&&(null!=y&&"<"!=y.charAt(0)&&"%"!=y.charAt(0)&&(y=+unescape(window.atob?atob(y):Base64.decode(cont,y))),null!=y&&"%"==y.charAt(0)&&(y=decodeURIComponent(y)),null!=y&&0<y.length)){var F=mxUtils.parseXml(y).documentElement;return"mxfile"==F.nodeName||"mxGraphModel"==F.nodeName}}catch(M){}return!1};Editor.prototype.extractGraphModel=function(k,y,F){return Editor.extractGraphModel.apply(this,arguments)};var m=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.setAdaptiveColors(null);this.graph.view.x0=null;this.graph.view.y0=null;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();m.apply(this,arguments)};var d=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=function(){d.apply(this,arguments);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.initMath=function(k,y){if("undefined"===-typeof window.MathJax&&!mxClient.IS_IE&&!mxClient.IS_IE11){var F=function(){K=null;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};k=null!=k?k:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var K=null;Editor.doMathJaxRender=function(T){try{null==K?(MathJax.typesetClear([T]),MathJax.typeset([T]),F()):K!=T&&Editor.mathJaxQueue.push(T)}catch(V){MathJax.typesetClear([T]),null!=V.retry?(K=T,V.retry.then(function(){MathJax.typesetPromise([T]).then(F)["catch"](function(W){console.log("Error in MathJax.typesetPromise: "++typeof window.MathJax&&!mxClient.IS_IE&&!mxClient.IS_IE11){var F=function(){M=null;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};k=null!=k?k:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var M=null;Editor.doMathJaxRender=function(T){try{null==M?(MathJax.typesetClear([T]),MathJax.typeset([T]),F()):M!=T&&Editor.mathJaxQueue.push(T)}catch(V){MathJax.typesetClear([T]),null!=V.retry?(M=T,V.retry.then(function(){MathJax.typesetPromise([T]).then(F)["catch"](function(W){console.log("Error in MathJax.typesetPromise: "+W.toString());F()})})["catch"](function(W){console.log("Error in MathJax.retry: "+W.toString());F()})):null!=window.console&&console.log("Error in MathJax.typeset: "+V.toString())}};window.MathJax=null!=y?y:{options:{skipHtmlTags:{"[+]":["text"]},ignoreHtmlClass:"geDisableMathJax"},loader:{load:["html"==urlParams["math-output"]?"output/chtml":"output/svg","input/tex","input/asciimath","ui/safe"]},startup:{pageReady:function(){for(var T=0;T<Editor.mathJaxQueue.length;T++)Editor.doMathJaxRender(Editor.mathJaxQueue[T])}}};Editor.MathJaxRender=function(T){"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset?Editor.doMathJaxRender(T):Editor.mathJaxQueue.push(T)};Editor.onMathJaxDone=function(){};var P=Editor.prototype.init;Editor.prototype.init=function(){P.apply(this,arguments);var T=mxUtils.bind(this,function(V,W){null!=this.graph.container&&this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)});this.graph.model.addListener(mxEvent.CHANGE,T);this.graph.addListener(mxEvent.REFRESH,T)};y=document.getElementsByTagName("script");-if(null!=y&&0<y.length){var R=document.createElement("script");R.setAttribute("type","text/javascript");R.setAttribute("src",k);y[0].parentNode.appendChild(R)}}};Editor.prototype.csvToArray=function(k){if(0<k.length){var y="",F=[""],K=0,P=!0,R;k=$jscomp.makeIterator(k);for(R=k.next();!R.done;R=k.next())R=R.value,'"'===R?(P&&R===y&&(F[K]+=R),P=!P):","===R&&P?R=F[++K]="":F[K]+=R,y=R;return F}return[]};Editor.prototype.getProxiedUrl=function(k){if((/test\.draw\.io$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname))&&+if(null!=y&&0<y.length){var R=document.createElement("script");R.setAttribute("type","text/javascript");R.setAttribute("src",k);y[0].parentNode.appendChild(R)}}};Editor.prototype.csvToArray=function(k){if(0<k.length){var y="",F=[""],M=0,P=!0,R;k=$jscomp.makeIterator(k);for(R=k.next();!R.done;R=k.next())R=R.value,'"'===R?(P&&R===y&&(F[M]+=R),P=!P):","===R&&P?R=F[++M]="":F[M]+=R,y=R;return F}return[]};Editor.prototype.getProxiedUrl=function(k){if((/test\.draw\.io$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname))&&!this.isCorsEnabledForUrl(k)){var y=EditorUi.isVisioFilename(k);y=/\.png$/i.test(k)||/\.pdf$/i.test(k)||y;var F="t="+(new Date).getTime();k=PROXY_URL+"?url="+encodeURIComponent(k)+"&"+F+(y?"&base64=1":"")}return k};Editor.prototype.isCorsEnabledForUrl=function(k){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||k.substring(0,window.location.origin.length)==window.location.origin)return!0;null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));-return null!=this.corsRegExp&&this.corsRegExp.test(k)||"https://raw.githubusercontent.com/"===k.substring(0,34)||"https://fonts.googleapis.com/"===k.substring(0,29)||"https://fonts.gstatic.com/"===k.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var k=new mxUrlConverter;k.updateBaseUrl();var y=k.convert,F=this;k.convert=function(K){null!=K&&navigator.onLine&&("http://"!=K.substring(0,7)&&"https://"!=K.substring(0,8)||K.substring(0,k.baseUrl.length)==k.baseUrl||F.crossOriginImages&&-F.isCorsEnabledForUrl(K)?"chrome-extension://"!=K.substring(0,19)&&(K=y.apply(this,arguments)):K=PROXY_URL+"?url="+encodeURIComponent(K));return K};return k};Editor.createSvgDataUri=function(k){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(k)))};Editor.prototype.convertImageToDataUri=function(k,y,F,K,P){try{var R=!0,T=window.setTimeout(mxUtils.bind(this,function(){R=!1;y(k)}),this.timeout),V=mxUtils.bind(this,function(){null!=K?this.convertImageToDataUri(k,y,F,K,!0):y(k)});if(/(\.svg)$/i.test(k)&&-!P)mxUtils.get(k,mxUtils.bind(this,function(X){window.clearTimeout(T);R&&(200>X.getStatus()||299<X.getStatus()?V():y(Editor.createSvgDataUri(X.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(T);R&&V()}));else{var W=new Image;this.crossOriginImages&&(W.crossOrigin="anonymous");W.onload=function(){window.clearTimeout(T);if(R)try{K=null!=K&&P?K:1;var X=document.createElement("canvas"),Z=X.getContext("2d");Z.scale(K,K);X.height=W.height*K;X.width=W.width*K;Z.drawImage(W,0,0);y(X.toDataURL())}catch(Y){y(k)}};-W.onerror=function(){window.clearTimeout(T);R&&(null!=F?F():y(k))};W.src=k}}catch(X){null!=F?F():y(k)}};Editor.prototype.convertImages=function(k,y,F,K){function P(){0<R.length?R.shift()():y(k)}null==K&&(K=this.createImageUrlConverter());var R=[],T=F||{};F=mxUtils.bind(this,function(V,W){V=k.getElementsByTagName(V);for(var X=0;X<V.length;X++)mxUtils.bind(this,function(Z){R.push(mxUtils.bind(this,function(){try{if(null!=Z){var Y=K.convert(Z.getAttribute(W));if(null!=Y&&"data:"!=Y.substring(0,5)){var da=-T[Y];null==da?this.convertImageToDataUri(Y,function(ea){null!=ea&&(T[Y]=ea,Z.setAttribute(W,ea));P()},null,Editor.svgRasterScale):(Z.setAttribute(W,da),P())}else null!=Y&&Z.setAttribute(W,Y),P()}}catch(ea){P()}}))})(V[X])});F("image","xlink:href");F("img","src");P()};Editor.base64Encode=function(k){for(var y="",F=0,K=k.length,P,R,T;F<K;){P=k.charCodeAt(F++)&255;if(F==K){y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(P>>2);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((P&-3)<<4);y+="==";break}R=k.charCodeAt(F++);if(F==K){y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(P>>2);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((P&3)<<4|(R&240)>>4);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((R&15)<<2);y+="=";break}T=k.charCodeAt(F++);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(P>>2);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((P&-3)<<4|(R&240)>>4);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((R&15)<<2|(T&192)>>6);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(T&63)}return y};Editor.prototype.loadUrl=function(k,y,F,K,P,R,T,V){try{var W=!T&&(K||/(\.png)($|\?)/i.test(k)||/(\.jpe?g)($|\?)/i.test(k)||/(\.gif)($|\?)/i.test(k)||/(\.pdf)($|\?)/i.test(k));P=null!=P?P:!0;var X=mxUtils.bind(this,function(){mxUtils.get(k,mxUtils.bind(this,function(Z){200<=Z.getStatus()&&299>=-Z.getStatus()?null!=y&&(Z=Z.getText(),W&&(R=null!=R?R:"data:image/png;base64,",Z=R+Editor.base64Encode(Z)),y(Z)):null!=F&&(0==Z.getStatus()?F({message:mxResources.get("accessDenied")},Z):404==Z.getStatus()?F({message:mxResources.get("fileNotFound"),code:Z.getStatus()},Z):F({message:this.getErrorMessage(Z)},Z))}),function(Z){null!=F&&F({message:mxResources.get("error")+" "+Z.getStatus()})},W,this.timeout,function(){P&&null!=F&&F({code:App.ERROR_TIMEOUT,retry:X})},V)});X()}catch(Z){null!=F&&F(Z)}};-Editor.prototype.getErrorMessage=function(k){var y=mxResources.get("error")+" "+k.getStatus();try{var F=k.getText(),K=JSON.parse(F);null!=K&&null!=K.error&&null!=K.error.message&&(y=K.error.message+" ("+y+")")}catch(P){}return y};Editor.prototype.absoluteCssFonts=function(k){var y=null;if(null!=k){var F=k.split("url(");if(0<F.length){y=[F[0]];k=window.location.pathname;var K=null!=k?k.lastIndexOf("/"):-1;0<=K&&(k=k.substring(0,K+1));K=document.getElementsByTagName("base");var P=null;null!=K&&0<K.length&&-(P=K[0].getAttribute("href"));for(var R=1;R<F.length;R++)if(K=F[R].indexOf(")"),0<K){var T=Editor.trimCssUrl(F[R].substring(0,K));this.graph.isRelativeUrl(T)&&(T=null!=P?P+T:window.location.protocol+"//"+window.location.hostname+("/"==T.charAt(0)?"":k)+T);y.push('url("'+T+'"'+F[R].substring(K))}else y.push(F[R])}else y=[k]}return null!=y?y.join(""):null};Editor.prototype.mapFontUrl=function(k,y,F){/^https?:\/\//.test(y)&&!this.isCorsEnabledForUrl(y)&&(y=PROXY_URL+"?url="+encodeURIComponent(y));F(k,-y)};Editor.prototype.embedCssFonts=function(k,y){var F=k.split("url("),K=0;null==this.cachedFonts&&(this.cachedFonts={});var P=mxUtils.bind(this,function(){if(0==K){for(var W=[F[0]],X=1;X<F.length;X++){var Z=F[X].indexOf(")");W.push('url("');W.push(this.cachedFonts[Editor.trimCssUrl(F[X].substring(0,Z))]);W.push('"'+F[X].substring(Z))}y(W.join(""))}});if(0<F.length){for(k=1;k<F.length;k++){var R=F[k].indexOf(")"),T=null,V=F[k].indexOf("format(",R);0<V&&(T=Editor.trimCssUrl(F[k].substring(V+7,F[k].indexOf(")",-V))));mxUtils.bind(this,function(W){if(null==this.cachedFonts[W]){this.cachedFonts[W]=W;K++;var X="application/x-font-ttf";if("svg"==T||/(\.svg)($|\?)/i.test(W))X="image/svg+xml";else if("otf"==T||"embedded-opentype"==T||/(\.otf)($|\?)/i.test(W))X="application/x-font-opentype";else if("woff"==T||/(\.woff)($|\?)/i.test(W))X="application/font-woff";else if("woff2"==T||/(\.woff2)($|\?)/i.test(W))X="application/font-woff2";else if("eot"==T||/(\.eot)($|\?)/i.test(W))X="application/vnd.ms-fontobject";else if("sfnt"==-T||/(\.sfnt)($|\?)/i.test(W))X="application/font-sfnt";this.mapFontUrl(X,W,mxUtils.bind(this,function(Z,Y){this.loadUrl(Y,mxUtils.bind(this,function(da){this.cachedFonts[W]=da;K--;P()}),mxUtils.bind(this,function(da){K--;P()}),!0,null,"data:"+Z+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(F[k].substring(0,R)),T)}P()}else y(k)};Editor.prototype.loadFonts=function(k){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(y){this.resolvedFontCss=-y;null!=k&&k()})):null!=k&&k()};Editor.prototype.createGoogleFontCache=function(){var k={},y;for(y in Graph.fontMapping)Graph.isCssFontUrl(y)&&(k[y]=Graph.fontMapping[y]);return k};Editor.prototype.embedExtFonts=function(k){var y=this.graph.getCustomFonts();if(0<y.length){var F=[],K=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var P=mxUtils.bind(this,function(){0==K&&this.embedCssFonts(F.join(""),k)}),R=0;R<y.length;R++)mxUtils.bind(this,function(T,V){Graph.isCssFontUrl(V)?-null==this.cachedGoogleFonts[V]?(K++,this.loadUrl(Graph.rewriteGoogleFontUrl(V),mxUtils.bind(this,function(W){this.cachedGoogleFonts[V]=W;F.push(W+"\n");K--;P()}),mxUtils.bind(this,function(W){K--;F.push("@import url("+V+");\n");P()}))):F.push(this.cachedGoogleFonts[V]+"\n"):F.push('@font-face {font-family: "'+T+'";src: url("'+V+'")}\n')})(y[R].name,y[R].url);P()}else k()};Editor.prototype.addMathCss=function(k){k=k.getElementsByTagName("defs");if(null!=k&&0<k.length)for(var y=document.getElementsByTagName("style"),-F=0;F<y.length;F++){var K=mxUtils.getTextContent(y[F]);0>K.indexOf("mxPageSelector")&&0<K.indexOf("MathJax")&&k[0].appendChild(y[F].cloneNode(!0))}};Editor.prototype.addFontCss=function(k,y){y=null!=y?y:this.absoluteCssFonts(this.fontCss);if(null!=y){var F=mxUtils.getSvgDefs(k),K=y.split("\n");y=[];for(var P=[],R=0;R<K.length;R++)"@import"==K[R].substring(0,7)?y.push(K[R]):P.push(K[R]);k=k.ownerDocument;k=null!=k.createElementNS?k.createElementNS(mxConstants.NS_SVG,"style"):k.createElement("style");-k.setAttribute("type","text/css");0<y.length&&(mxUtils.setTextContent(k,y.join("\n")),F.appendChild(k));0<P.length&&(k=k.cloneNode(!1),mxUtils.setTextContent(k,P.join("\n")),F.appendChild(k))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||this.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(k,y,F){var K=mxClient.IS_FF?8192:16384;return Math.min(F,Math.min(K/k,K/y))};Editor.prototype.exportToCanvas=function(k,y,F,K,P,R,T,V,W,X,Z,Y,da,ea,ka,ba,ha,aa){try{R=-null!=R?R:!0;T=null!=T?T:!0;Y=null!=Y?Y:this.graph;da=null!=da?da:0;var ia=W?null:Y.background;ia==mxConstants.NONE&&(ia=null);null==ia&&(ia=K);null==ia&&0==W&&(ia="dark"==ba&&"none"!=Y.getAdaptiveColors()?Editor.darkColor:"#ffffff");this.convertImages(Y.getSvg(null,null,da,ea,null,T,null,null,null,X,null,ba,ha,aa),mxUtils.bind(this,function(fa){try{var ca=new Image;ca.onload=mxUtils.bind(this,function(){try{var la=function(){mxClient.IS_SF?window.setTimeout(function(){ua.drawImage(ca,0,0);k(xa,fa)},-0):(ua.drawImage(ca,0,0),k(xa,fa))},xa=document.createElement("canvas"),Aa=parseInt(fa.getAttribute("width")),ma=parseInt(fa.getAttribute("height"));V=null!=V?V:1;null!=y&&(V=R?Math.min(1,Math.min(3*y/(4*ma),y/Aa)):y/Aa);V=this.getMaxCanvasScale(Aa,ma,V);Aa=Math.ceil(V*Aa);ma=Math.ceil(V*ma);xa.setAttribute("width",Aa);xa.setAttribute("height",ma);var ua=xa.getContext("2d");if(null!=ia){var ra=mxUtils.getLightDarkColor(ia);ua.beginPath();ua.rect(0,0,Aa,ma);ua.fillStyle="dark"==ba&&"none"!=Y.getAdaptiveColors()?-ra.dark:ra.light;ua.fill()}1!=V&&ua.scale(V,V);if(ka){var oa=Y.view,Ea=oa.scale;oa.scale=1;var va=btoa(unescape(encodeURIComponent(oa.createSvgGrid(oa.gridColor))));oa.scale=Ea;va="data:image/svg+xml;base64,"+va;var ya=Y.gridSize*oa.gridSteps*V,za=Y.getGraphBounds(),Ga=oa.translate.x*Ea,Ca=oa.translate.y*Ea,Ka=Ga+(za.x-Ga)/Ea-da,Ma=Ca+(za.y-Ca)/Ea-da,Da=new Image;Da.onload=function(){try{for(var wa=-Math.round(ya-mxUtils.mod((Ga-Ka)*V,ya)),Sa=-Math.round(ya-mxUtils.mod((Ca-Ma)*V,ya));wa<Aa;wa+=ya)for(var Ta=+return null!=this.corsRegExp&&this.corsRegExp.test(k)||"https://raw.githubusercontent.com/"===k.substring(0,34)||"https://fonts.googleapis.com/"===k.substring(0,29)||"https://fonts.gstatic.com/"===k.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var k=new mxUrlConverter;k.updateBaseUrl();var y=k.convert,F=this;k.convert=function(M){null!=M&&navigator.onLine&&("http://"!=M.substring(0,7)&&"https://"!=M.substring(0,8)||M.substring(0,k.baseUrl.length)==k.baseUrl||F.crossOriginImages&&+F.isCorsEnabledForUrl(M)?"chrome-extension://"!=M.substring(0,19)&&(M=y.apply(this,arguments)):M=PROXY_URL+"?url="+encodeURIComponent(M));return M};return k};Editor.createSvgDataUri=function(k){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(k)))};Editor.prototype.convertImageToDataUri=function(k,y,F,M,P){try{var R=!0,T=window.setTimeout(mxUtils.bind(this,function(){R=!1;y(k)}),this.timeout),V=mxUtils.bind(this,function(){null!=M?this.convertImageToDataUri(k,y,F,M,!0):y(k)});if(/(\.svg)$/i.test(k)&&+!P)mxUtils.get(k,mxUtils.bind(this,function(X){window.clearTimeout(T);R&&(200>X.getStatus()||299<X.getStatus()?V():y(Editor.createSvgDataUri(X.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(T);R&&V()}));else{var W=new Image;this.crossOriginImages&&(W.crossOrigin="anonymous");W.onload=function(){window.clearTimeout(T);if(R)try{M=null!=M&&P?M:1;var X=document.createElement("canvas"),Y=X.getContext("2d");Y.scale(M,M);X.height=W.height*M;X.width=W.width*M;Y.drawImage(W,0,0);y(X.toDataURL())}catch(Z){y(k)}};+W.onerror=function(){window.clearTimeout(T);R&&(null!=F?F():y(k))};W.src=k}}catch(X){null!=F?F():y(k)}};Editor.prototype.convertImages=function(k,y,F,M){function P(){0<R.length?R.shift()():y(k)}null==M&&(M=this.createImageUrlConverter());var R=[],T=F||{};F=mxUtils.bind(this,function(V,W){V=k.getElementsByTagName(V);for(var X=0;X<V.length;X++)mxUtils.bind(this,function(Y){R.push(mxUtils.bind(this,function(){try{if(null!=Y){var Z=M.convert(Y.getAttribute(W));if(null!=Z&&"data:"!=Z.substring(0,5)){var da=+T[Z];null==da?this.convertImageToDataUri(Z,function(ea){null!=ea&&(T[Z]=ea,Y.setAttribute(W,ea));P()},null,Editor.svgRasterScale):(Y.setAttribute(W,da),P())}else null!=Z&&Y.setAttribute(W,Z),P()}}catch(ea){P()}}))})(V[X])});F("image","xlink:href");F("img","src");P()};Editor.base64Encode=function(k){for(var y="",F=0,M=k.length,P,R,T;F<M;){P=k.charCodeAt(F++)&255;if(F==M){y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(P>>2);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((P&+3)<<4);y+="==";break}R=k.charCodeAt(F++);if(F==M){y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(P>>2);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((P&3)<<4|(R&240)>>4);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((R&15)<<2);y+="=";break}T=k.charCodeAt(F++);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(P>>2);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((P&+3)<<4|(R&240)>>4);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((R&15)<<2|(T&192)>>6);y+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(T&63)}return y};Editor.prototype.loadUrl=function(k,y,F,M,P,R,T,V){try{var W=!T&&(M||/(\.png)($|\?)/i.test(k)||/(\.jpe?g)($|\?)/i.test(k)||/(\.gif)($|\?)/i.test(k)||/(\.pdf)($|\?)/i.test(k));P=null!=P?P:!0;var X=mxUtils.bind(this,function(){mxUtils.get(k,mxUtils.bind(this,function(Y){200<=Y.getStatus()&&299>=+Y.getStatus()?null!=y&&(Y=Y.getText(),W&&(R=null!=R?R:"data:image/png;base64,",Y=R+Editor.base64Encode(Y)),y(Y)):null!=F&&(0==Y.getStatus()?F({message:mxResources.get("accessDenied")},Y):404==Y.getStatus()?F({message:mxResources.get("fileNotFound"),code:Y.getStatus()},Y):F({message:this.getErrorMessage(Y)},Y))}),function(Y){null!=F&&F({message:mxResources.get("error")+" "+Y.getStatus()})},W,this.timeout,function(){P&&null!=F&&F({code:App.ERROR_TIMEOUT,retry:X})},V)});X()}catch(Y){null!=F&&F(Y)}};+Editor.prototype.getErrorMessage=function(k){var y=mxResources.get("error")+" "+k.getStatus();try{var F=k.getText(),M=JSON.parse(F);null!=M&&null!=M.error&&null!=M.error.message&&(y=M.error.message+" ("+y+")")}catch(P){}return y};Editor.prototype.absoluteCssFonts=function(k){var y=null;if(null!=k){var F=k.split("url(");if(0<F.length){y=[F[0]];k=window.location.pathname;var M=null!=k?k.lastIndexOf("/"):-1;0<=M&&(k=k.substring(0,M+1));M=document.getElementsByTagName("base");var P=null;null!=M&&0<M.length&&+(P=M[0].getAttribute("href"));for(var R=1;R<F.length;R++)if(M=F[R].indexOf(")"),0<M){var T=Editor.trimCssUrl(F[R].substring(0,M));this.graph.isRelativeUrl(T)&&(T=null!=P?P+T:window.location.protocol+"//"+window.location.hostname+("/"==T.charAt(0)?"":k)+T);y.push('url("'+T+'"'+F[R].substring(M))}else y.push(F[R])}else y=[k]}return null!=y?y.join(""):null};Editor.prototype.mapFontUrl=function(k,y,F){/^https?:\/\//.test(y)&&!this.isCorsEnabledForUrl(y)&&(y=PROXY_URL+"?url="+encodeURIComponent(y));F(k,+y)};Editor.prototype.embedCssFonts=function(k,y){var F=k.split("url("),M=0;null==this.cachedFonts&&(this.cachedFonts={});var P=mxUtils.bind(this,function(){if(0==M){for(var W=[F[0]],X=1;X<F.length;X++){var Y=F[X].indexOf(")");W.push('url("');W.push(this.cachedFonts[Editor.trimCssUrl(F[X].substring(0,Y))]);W.push('"'+F[X].substring(Y))}y(W.join(""))}});if(0<F.length){for(k=1;k<F.length;k++){var R=F[k].indexOf(")"),T=null,V=F[k].indexOf("format(",R);0<V&&(T=Editor.trimCssUrl(F[k].substring(V+7,F[k].indexOf(")",+V))));mxUtils.bind(this,function(W){if(null==this.cachedFonts[W]){this.cachedFonts[W]=W;M++;var X="application/x-font-ttf";if("svg"==T||/(\.svg)($|\?)/i.test(W))X="image/svg+xml";else if("otf"==T||"embedded-opentype"==T||/(\.otf)($|\?)/i.test(W))X="application/x-font-opentype";else if("woff"==T||/(\.woff)($|\?)/i.test(W))X="application/font-woff";else if("woff2"==T||/(\.woff2)($|\?)/i.test(W))X="application/font-woff2";else if("eot"==T||/(\.eot)($|\?)/i.test(W))X="application/vnd.ms-fontobject";else if("sfnt"==+T||/(\.sfnt)($|\?)/i.test(W))X="application/font-sfnt";this.mapFontUrl(X,W,mxUtils.bind(this,function(Y,Z){this.loadUrl(Z,mxUtils.bind(this,function(da){this.cachedFonts[W]=da;M--;P()}),mxUtils.bind(this,function(da){M--;P()}),!0,null,"data:"+Y+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(F[k].substring(0,R)),T)}P()}else y(k)};Editor.prototype.loadFonts=function(k){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(y){this.resolvedFontCss=+y;null!=k&&k()})):null!=k&&k()};Editor.prototype.createGoogleFontCache=function(){var k={},y;for(y in Graph.fontMapping)Graph.isCssFontUrl(y)&&(k[y]=Graph.fontMapping[y]);return k};Editor.prototype.embedExtFonts=function(k){var y=this.graph.getCustomFonts();if(0<y.length){var F=[],M=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var P=mxUtils.bind(this,function(){0==M&&this.embedCssFonts(F.join(""),k)}),R=0;R<y.length;R++)mxUtils.bind(this,function(T,V){Graph.isCssFontUrl(V)?+null==this.cachedGoogleFonts[V]?(M++,this.loadUrl(Graph.rewriteGoogleFontUrl(V),mxUtils.bind(this,function(W){this.cachedGoogleFonts[V]=W;F.push(W+"\n");M--;P()}),mxUtils.bind(this,function(W){M--;F.push("@import url("+V+");\n");P()}))):F.push(this.cachedGoogleFonts[V]+"\n"):F.push('@font-face {font-family: "'+T+'";src: url("'+V+'")}\n')})(y[R].name,y[R].url);P()}else k()};Editor.prototype.addMathCss=function(k){k=k.getElementsByTagName("defs");if(null!=k&&0<k.length)for(var y=document.getElementsByTagName("style"),+F=0;F<y.length;F++){var M=mxUtils.getTextContent(y[F]);0>M.indexOf("mxPageSelector")&&0<M.indexOf("MathJax")&&k[0].appendChild(y[F].cloneNode(!0))}};Editor.prototype.addFontCss=function(k,y){y=null!=y?y:this.absoluteCssFonts(this.fontCss);if(null!=y){var F=mxUtils.getSvgDefs(k),M=y.split("\n");y=[];for(var P=[],R=0;R<M.length;R++)"@import"==M[R].substring(0,7)?y.push(M[R]):P.push(M[R]);k=k.ownerDocument;k=null!=k.createElementNS?k.createElementNS(mxConstants.NS_SVG,"style"):k.createElement("style");+k.setAttribute("type","text/css");0<y.length&&(mxUtils.setTextContent(k,y.join("\n")),F.appendChild(k));0<P.length&&(k=k.cloneNode(!1),mxUtils.setTextContent(k,P.join("\n")),F.appendChild(k))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||this.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(k,y,F){var M=mxClient.IS_FF?8192:16384;return Math.min(F,Math.min(M/k,M/y))};Editor.prototype.exportToCanvas=function(k,y,F,M,P,R,T,V,W,X,Y,Z,da,ea,ka,ba,ha,aa){try{R=+null!=R?R:!0;T=null!=T?T:!0;Z=null!=Z?Z:this.graph;da=null!=da?da:0;var ia=W?null:Z.background;ia==mxConstants.NONE&&(ia=null);null==ia&&(ia=M);null==ia&&0==W&&(ia="dark"==ba&&"none"!=Z.getAdaptiveColors()?Editor.darkColor:"#ffffff");this.convertImages(Z.getSvg(null,null,da,ea,null,T,null,null,null,X,null,ba,ha,aa),mxUtils.bind(this,function(fa){try{var ca=new Image;ca.onload=mxUtils.bind(this,function(){try{var la=function(){mxClient.IS_SF?window.setTimeout(function(){ua.drawImage(ca,0,0);k(xa,fa)},+0):(ua.drawImage(ca,0,0),k(xa,fa))},xa=document.createElement("canvas"),Aa=parseInt(fa.getAttribute("width")),ma=parseInt(fa.getAttribute("height"));V=null!=V?V:1;null!=y&&(V=R?Math.min(1,Math.min(3*y/(4*ma),y/Aa)):y/Aa);V=this.getMaxCanvasScale(Aa,ma,V);Aa=Math.ceil(V*Aa);ma=Math.ceil(V*ma);xa.setAttribute("width",Aa);xa.setAttribute("height",ma);var ua=xa.getContext("2d");if(null!=ia){var ra=mxUtils.getLightDarkColor(ia);ua.beginPath();ua.rect(0,0,Aa,ma);ua.fillStyle="dark"==ba&&"none"!=Z.getAdaptiveColors()?+ra.dark:ra.light;ua.fill()}1!=V&&ua.scale(V,V);if(ka){var oa=Z.view,Ea=oa.scale;oa.scale=1;var va=btoa(unescape(encodeURIComponent(oa.createSvgGrid(oa.gridColor))));oa.scale=Ea;va="data:image/svg+xml;base64,"+va;var ya=Z.gridSize*oa.gridSteps*V,za=Z.getGraphBounds(),Ga=oa.translate.x*Ea,Ca=oa.translate.y*Ea,Ka=Ga+(za.x-Ga)/Ea-da,Ma=Ca+(za.y-Ca)/Ea-da,Da=new Image;Da.onload=function(){try{for(var wa=-Math.round(ya-mxUtils.mod((Ga-Ka)*V,ya)),Sa=-Math.round(ya-mxUtils.mod((Ca-Ma)*V,ya));wa<Aa;wa+=ya)for(var Ta=Sa;Ta<ma;Ta+=ya)ua.drawImage(Da,wa/V,Ta/V);la()}catch(Ua){null!=P&&P(Ua)}};Da.onerror=function(wa){null!=P&&P(wa)};Da.src=va}else la()}catch(wa){null!=P&&P(wa)}});ca.onerror=function(la){null!=P&&P(la)};X&&this.graph.addSvgShadow(fa);this.graph.mathEnabled&&this.addMathCss(fa);var Ba=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(fa,this.resolvedFontCss),ca.src=Editor.createSvgDataUri(mxUtils.getXml(fa))}catch(la){null!=P&&P(la)}});this.embedExtFonts(mxUtils.bind(this,-function(la){try{null!=la&&this.addFontCss(fa,la),this.loadFonts(Ba)}catch(xa){null!=P&&P(xa)}}))}catch(la){null!=P&&P(la)}}),F,Z)}catch(fa){null!=P&&P(fa)}};Editor.crcTable=[];for(var t=0;256>t;t++)for(var x=t,v=0;8>v;v++)x=1==(x&1)?3988292384^x>>>1:x>>>1,Editor.crcTable[t]=x;Editor.updateCRC=function(k,y,F,K){for(var P=0;P<K;P++)k=Editor.crcTable[(k^y.charCodeAt(F+P))&255]^k>>>8;return k};Editor.crc32=function(k){for(var y=-1,F=0;F<k.length;F++)y=y>>>8^Editor.crcTable[(y^k.charCodeAt(F))&255];return(y^--1)>>>0};Editor.writeGraphModelToPng=function(k,y,F,K,P){function R(Z,Y){var da=W;W+=Y;return Z.substring(da,W)}function T(Z){Z=R(Z,4);return Z.charCodeAt(3)+(Z.charCodeAt(2)<<8)+(Z.charCodeAt(1)<<16)+(Z.charCodeAt(0)<<24)}function V(Z){return String.fromCharCode(Z>>24&255,Z>>16&255,Z>>8&255,Z&255)}k=k.substring(k.indexOf(",")+1);k=window.atob?atob(k):Base64.decode(k,!0);var W=0;if(R(k,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=P&&P();else if(R(k,4),"IHDR"!=R(k,4))null!=-P&&P();else{R(k,17);P=k.substring(0,W);do{var X=T(k);if("IDAT"==R(k,4)){P=k.substring(0,W-8);"pHYs"==y&&"dpi"==F?(F=Math.round(K/.0254),F=V(F)+V(F)+String.fromCharCode(1)):F=F+String.fromCharCode(0)+("zTXt"==y?String.fromCharCode(0):"")+K;K=4294967295;K=Editor.updateCRC(K,y,0,4);K=Editor.updateCRC(K,F,0,F.length);P+=V(F.length)+y+F+V(K^4294967295);P+=k.substring(W-8,k.length);break}P+=k.substring(W-8,W-4+X);R(k,X);R(k,4)}while(X);return"data:image/png;base64,"+(window.btoa?btoa(P):Base64.encode(P,+function(la){try{null!=la&&this.addFontCss(fa,la),this.loadFonts(Ba)}catch(xa){null!=P&&P(xa)}}))}catch(la){null!=P&&P(la)}}),F,Y)}catch(fa){null!=P&&P(fa)}};Editor.crcTable=[];for(var t=0;256>t;t++)for(var x=t,v=0;8>v;v++)x=1==(x&1)?3988292384^x>>>1:x>>>1,Editor.crcTable[t]=x;Editor.updateCRC=function(k,y,F,M){for(var P=0;P<M;P++)k=Editor.crcTable[(k^y.charCodeAt(F+P))&255]^k>>>8;return k};Editor.crc32=function(k){for(var y=-1,F=0;F<k.length;F++)y=y>>>8^Editor.crcTable[(y^k.charCodeAt(F))&255];return(y^+-1)>>>0};Editor.writeGraphModelToPng=function(k,y,F,M,P){function R(Y,Z){var da=W;W+=Z;return Y.substring(da,W)}function T(Y){Y=R(Y,4);return Y.charCodeAt(3)+(Y.charCodeAt(2)<<8)+(Y.charCodeAt(1)<<16)+(Y.charCodeAt(0)<<24)}function V(Y){return String.fromCharCode(Y>>24&255,Y>>16&255,Y>>8&255,Y&255)}k=k.substring(k.indexOf(",")+1);k=window.atob?atob(k):Base64.decode(k,!0);var W=0;if(R(k,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=P&&P();else if(R(k,4),"IHDR"!=R(k,4))null!=+P&&P();else{R(k,17);P=k.substring(0,W);do{var X=T(k);if("IDAT"==R(k,4)){P=k.substring(0,W-8);"pHYs"==y&&"dpi"==F?(F=Math.round(M/.0254),F=V(F)+V(F)+String.fromCharCode(1)):F=F+String.fromCharCode(0)+("zTXt"==y?String.fromCharCode(0):"")+M;M=4294967295;M=Editor.updateCRC(M,y,0,4);M=Editor.updateCRC(M,F,0,F.length);P+=V(F.length)+y+F+V(M^4294967295);P+=k.substring(W-8,k.length);break}P+=k.substring(W-8,W-4+X);R(k,X);R(k,4)}while(X);return"data:image/png;base64,"+(window.btoa?btoa(P):Base64.encode(P,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var B=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(k,y){B.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var J=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){J.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(k,y){var F=null;null!=k.editor.graph.getModel().getParent(y)?F=y.getId():null!=k.currentPage&&(F=k.currentPage.getId());return F});if(null!=window.StyleFormatPanel){var N=Format.prototype.init;Format.prototype.init=function(){N.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var I=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?I.apply(this,arguments):-this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(k){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var c=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(k){k=c.apply(this,arguments);var y=this.editorUi,F=y.editor.graph;if(F.isEnabled()){var K=y.getCurrentFile();null!=K&&K.isAutosaveOptional()&&k.appendChild(this.createOption(mxResources.get("autosave"),function(){return y.editor.autosave},-function(R){y.editor.setAutosave(R);y.editor.autosave&&K.isModified()&&K.fileChanged()},{install:function(R){this.listener=function(){R(y.editor.autosave)};y.editor.addListener("autosaveChanged",this.listener)},destroy:function(){y.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&F.isEnabled()&&"undefined"!==typeof MathJax){var P=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return F.mathEnabled},function(R){y.actions.get("mathematicalTypesetting").funct()},+this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(k){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var c=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(k){k=c.apply(this,arguments);var y=this.editorUi,F=y.editor.graph;if(F.isEnabled()){var M=y.getCurrentFile();null!=M&&M.isAutosaveOptional()&&k.appendChild(this.createOption(mxResources.get("autosave"),function(){return y.editor.autosave},+function(R){y.editor.setAutosave(R);y.editor.autosave&&M.isModified()&&M.fileChanged()},{install:function(R){this.listener=function(){R(y.editor.autosave)};y.editor.addListener("autosaveChanged",this.listener)},destroy:function(){y.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&F.isEnabled()&&"undefined"!==typeof MathJax){var P=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return F.mathEnabled},function(R){y.actions.get("mathematicalTypesetting").funct()},{install:function(R){this.listener=function(){R(F.mathEnabled)};y.addListener("mathEnabledChanged",this.listener)},destroy:function(){y.removeListener(this.listener)}});k.appendChild(P);(!y.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&P.appendChild(y.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}return k};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:10},{name:"startWidth",dispName:"Start Width",type:"float",min:0,defVal:20},{name:"endWidth",dispName:"End Width",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.process.prototype.customProperties=[{name:"size",dispName:"Indent",type:"float",min:0,max:.5,defVal:.1}];mxCellRenderer.defaultShapes.rhombus.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,max:50,defVal:mxConstants.LINE_ARCSIZE},{name:"double",dispName:"Double",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties=[{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left Line",@@ -12836,91 +12842,89 @@ defVal:"none",enumList:[{val:"none",dispName:"Default"},{val:"umlActor",dispName[[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",font:"#333333"},{fill:"#dae8fc",stroke:"#6c8ebf"},{fill:"#d5e8d4",stroke:"#82b366"},{fill:"#ffe6cc",stroke:"#d79b00"},{fill:"#fff2cc",stroke:"#d6b656"},{fill:"#f8cecc",stroke:"#b85450"},{fill:"#e1d5e7",stroke:"#9673a6"}],[{fill:"",stroke:""},{fill:"#60a917",stroke:"#2D7600",font:"#ffffff"},{fill:"#008a00",stroke:"#005700",font:"#ffffff"},{fill:"#1ba1e2",stroke:"#006EAF",font:"#ffffff"},{fill:"#0050ef",stroke:"#001DBC",font:"#ffffff"},{fill:"#6a00ff",stroke:"#3700CC",font:"#ffffff"},{fill:"#d80073",stroke:"#A50040",font:"#ffffff"},{fill:"#a20025",stroke:"#6F0000",font:"#ffffff"}],[{fill:"#e51400",stroke:"#B20000",font:"#ffffff"},{fill:"#fa6800",stroke:"#C73500",font:"#000000"},{fill:"#f0a30a",stroke:"#BD7000",font:"#000000"},{fill:"#e3c800",stroke:"#B09500",font:"#000000"},{fill:"#6d8764",stroke:"#3A5431",font:"#ffffff"},{fill:"#647687",stroke:"#314354",font:"#ffffff"},{fill:"#76608a",stroke:"#432D57",font:"#ffffff"},{fill:"#a0522d",stroke:"#6D1F00",font:"#ffffff"}],[{fill:"",stroke:""},{fill:mxConstants.NONE,stroke:""},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",stroke:"#23445d"}],[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},-{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[{fill:"",stroke:""},{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;StyleFormatPanel.prototype.findCommonProperties=-function(k,y,F,K){if(null!=y){var P=mxUtils.bind(this,function(T){if(null!=T)if(F)for(var V=0;V<T.length;V++){if("function"!==typeof T[V].isVisible||T[V].isVisible(K,this))y[T[V].name]=T[V]}else for(var W in y){var X=!1;for(V=0;V<T.length;V++)if(T[V].name==W&&T[V].type==y[W].type){X=!0;break}X||delete y[W]}}),R=this.editorUi.editor.graph.view.getState(k);null!=R&&null!=R.shape&&(R.shape.commonCustomPropAdded||(R.shape.commonCustomPropAdded=!0,R.shape.customProperties=R.shape.customProperties||[],-R.cell.vertex?Array.prototype.push.apply(R.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(R.shape.customProperties,Editor.commonEdgeProperties)),P(R.shape.customProperties));k=k.getAttribute("customProperties");if(null!=k)try{P(JSON.parse(k))}catch(T){}}};var e=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var k=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&"image"!=k.style.shape&&-!k.containsLabel&&0<k.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));e.apply(this,arguments);if(Editor.enableCustomProperties){for(var y={},F=k.vertices,K=k.edges,P=0;P<F.length;P++)this.findCommonProperties(F[P],y,0==P,k);for(P=0;P<K.length;P++)this.findCommonProperties(K[P],y,0==F.length&&0==P,k);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(y).length&&this.container.appendChild(this.addProperties(this.createPanel(),y,k))}};var g=StyleFormatPanel.prototype.addStyleOps;-StyleFormatPanel.prototype.addStyleOps=function(k){var y=this.editorUi.getSelectionState();1==y.cells.length?this.addActions(k,["copyStyle","pasteStyle"]):1<=y.cells.length&&this.addActions(k,["pasteStyle","pasteData"]);g.apply(this,arguments);return k};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(k,y,F,K){function P(ua,ra,oa,Ea,va){if(null!=oa.valueChanged)oa.valueChanged(ra,va);else{da.getModel().beginUpdate();try{va=[];var ya=[];if(null!=oa.index){for(var za=-[],Ga=oa.parentRow.nextSibling;Ga&&Ga.getAttribute("data-pName")==ua;)za.push(Ga.getAttribute("data-pValue")),Ga=Ga.nextSibling;oa.index<za.length?null!=Ea?za.splice(Ea,1):za[oa.index]=ra:za.push(ra);null!=oa.size&&za.length>oa.size&&(za=za.slice(0,oa.size));ra=za.join(",");null!=oa.countProperty&&(da.setCellStyles(oa.countProperty,za.length,da.getSelectionCells()),va.push(oa.countProperty),ya.push(za.length))}da.setCellStyles(ua,ra,da.getSelectionCells());va.push(ua);ya.push(ra);if(null!=oa.dependentProps)for(ua=-0;ua<oa.dependentProps.length;ua++){var Ca=oa.dependentPropsDefVal[ua],Ka=oa.dependentPropsVals[ua];if(Ka.length>ra)Ka=Ka.slice(0,ra);else for(var Ma=Ka.length;Ma<ra;Ma++)Ka.push(Ca);Ka=Ka.join(",");da.setCellStyles(oa.dependentProps[ua],Ka,da.getSelectionCells());va.push(oa.dependentProps[ua]);ya.push(Ka)}if("function"==typeof oa.onChange)oa.onChange(da,ra);Y.editorUi.fireEvent(new mxEventObject("styleChanged","keys",va,"values",ya,"cells",da.getSelectionCells()))}finally{da.getModel().endUpdate()}}}-function R(ua,ra,oa){var Ea=mxUtils.getOffset(k,!0),va=mxUtils.getOffset(ua,!0);ra.style.position="absolute";ra.style.left=va.x-Ea.x+"px";ra.style.top=va.y-Ea.y+"px";ra.style.width=ua.offsetWidth+"px";ra.style.height=ua.offsetHeight-(oa?4:0)+"px";ra.style.zIndex=5}function T(ua,ra,oa){function Ea(ya){if(null==ya||ya==mxConstants.NONE)va.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==ya)va.style.background="";else{var za=mxUtils.getLightDarkColor(ya);mxUtils.isLightDarkColor(ya)&&-za.light!=za.dark?va.style.background="linear-gradient(to right bottom, "+za.cssText+" 50%, "+mxUtils.invertLightDarkColor(za).cssText+" 50.3%)":va.style.background=ya}}var va=document.createElement("div");va.style.width="32px";va.style.height="8px";va.style.margin="2px";va.style.borderStyle="solid";va.style.borderWidth="1px";Ea(ra);btn=mxUtils.button("",mxUtils.bind(Y,function(ya){this.editorUi.pickColor(ra,function(za){P(ua,za,oa);Ea(za)});mxEvent.consume(ya)}));btn.style.height="18px";btn.style.width=-"40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(va);return btn}function V(ua,ra,oa,Ea,va,ya,za){null!=ra&&(ra=ra.split(","),ea.push({name:ua,values:ra,type:oa,defVal:Ea,countProperty:va,parentRow:ya,isDeletable:!0,flipBkg:za}));btn=mxUtils.button("+",mxUtils.bind(Y,function(Ga){for(var Ca=ya,Ka=0;null!=Ca.nextSibling;)if(Ca.nextSibling.getAttribute("data-pName")==ua)Ca=Ca.nextSibling,Ka++;else break;var Ma={type:oa,parentRow:ya,index:Ka,isDeletable:!0,-defVal:Ea,countProperty:va};Ka=Z(ua,"",Ma,0==Ka%2,za);P(ua,Ea,Ma);Ca.parentNode.insertBefore(Ka,Ca.nextSibling);mxEvent.consume(Ga)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function W(ua,ra,oa,Ea,va,ya,za){if(0<va){var Ga=Array(va);ra=null!=ra?ra.split(","):[];for(var Ca=0;Ca<va;Ca++)Ga[Ca]=null!=ra[Ca]?ra[Ca]:null!=Ea?Ea:"";ea.push({name:ua,values:Ga,type:oa,defVal:Ea,parentRow:ya,flipBkg:za,size:va})}return document.createElement("div")}function X(ua,-ra,oa){var Ea=document.createElement("input");Ea.type="checkbox";Ea.checked="1"==ra;mxEvent.addListener(Ea,"change",function(){P(ua,Ea.checked?"1":"0",oa)});return Ea}function Z(ua,ra,oa,Ea,va){var ya=oa.dispName,za=oa.type,Ga=document.createElement("tr");Ga.className="gePropRow"+(va?"Dark":"")+(Ea?"Alt":"")+" gePropNonHeaderRow";Ga.setAttribute("data-pName",ua);Ga.setAttribute("data-pValue",ra);Ea=!1;null!=oa.index&&(Ga.setAttribute("data-index",oa.index),ya=(null!=ya?ya:"")+"["+oa.index+"]",Ea=-!0);var Ca=document.createElement("td");Ca.className="gePropRowCell";ya=mxResources.get(ya,null,ya);mxUtils.write(Ca,ya);Ca.setAttribute("title",ya);Ea&&(Ca.style.textAlign="right");Ga.appendChild(Ca);Ca=document.createElement("td");Ca.className="gePropRowCell";Ca.setAttribute("title",null!=ra?ra:mxResources.get("none"));if("color"==za)Ca.appendChild(T(ua,ra,oa));else if("bool"==za||"boolean"==za)Ca.appendChild(X(ua,ra,oa));else if("enum"==za){var Ka=oa.enumList;for(va=0;va<Ka.length;va++)if(ya=Ka[va],-ya.val==ra){mxUtils.write(Ca,mxResources.get(ya.dispName,null,ya.dispName));break}mxEvent.addListener(Ca,"click",mxUtils.bind(Y,function(){var Ma=document.createElement("select"),Da=null;R(Ca,Ma);for(var wa=0;wa<Ka.length;wa++){var Sa=Ka[wa],Ta=document.createElement("option");Ta.value=mxUtils.htmlEntities(Sa.val);mxUtils.write(Ta,mxResources.get(Sa.dispName,null,Sa.dispName));Ma.appendChild(Ta);null==Sa.val&&(Ta.value="null",Da=Ta)}Ma.value=null==ra&&null!=Da?"null":ra;k.appendChild(Ma);mxEvent.addListener(Ma,-"change",function(){var Ua=mxUtils.htmlEntities(Ma.value);if(Ma[Ma.selectedIndex]==Da||"null"==Ua.value)Ua=null;P(ua,Ua,oa)});Ma.focus();mxEvent.addListener(Ma,"blur",function(){k.removeChild(Ma)})}))}else"dynamicArr"==za?Ca.appendChild(V(ua,ra,oa.subType,oa.subDefVal,oa.countProperty,Ga,va)):"staticArr"==za?Ca.appendChild(W(ua,ra,oa.subType,oa.subDefVal,oa.size,Ga,va)):"readOnly"==za?(va=document.createElement("input"),va.setAttribute("readonly",""),va.value=ra,va.style.borderWidth="0px","id"==ua?-(va.style.width="190px",va.style.position="relative",va.style.right="6px",va.style.float="right",va.style.background="none",va.style.textAlign="right",Ga.firstChild.setAttribute("colspan","2"),va.setAttribute("title",ra),Ga.firstChild.appendChild(va)):(va.style.width="96px",Ca.appendChild(va))):(Ca.innerHTML=mxUtils.htmlEntities(decodeURIComponent(ra)),mxEvent.addListener(Ca,"click",mxUtils.bind(Y,function(){function Ma(){var wa=Da.value;wa=0==wa.length&&"string"!=za&&"numbers"!=za?0:wa;oa.allowAuto&&-(null!=wa.trim&&"auto"==wa.trim().toLowerCase()?(wa="auto",za="string"):(wa=parseFloat(wa),wa=isNaN(wa)?0:wa));null!=oa.min&&wa<oa.min?wa=oa.min:null!=oa.max&&wa>oa.max&&(wa=oa.max);var Sa=null;try{Sa="numbers"==za?wa.match(/\d+/g).map(Number).join(" "):encodeURIComponent(("int"==za?parseInt(wa):wa)+"")}catch(Ta){}P(ua,Sa,oa,null,Da)}var Da=document.createElement("input");R(Ca,Da,!0);Da.value=decodeURIComponent(ra);Da.className="gePropEditor";"int"!=za&&"float"!=za||oa.allowAuto||(Da.type="number",-Da.step="int"==za?"1":"any",null!=oa.min&&(Da.min=parseFloat(oa.min)),null!=oa.max&&(Da.max=parseFloat(oa.max)));k.appendChild(Da);mxEvent.addListener(Da,"keypress",function(wa){13==wa.keyCode&&Ma()});Da.focus();mxEvent.addListener(Da,"blur",function(){Ma()})})));oa.isDeletable&&(va=mxUtils.button("-",mxUtils.bind(Y,function(Ma){P(ua,"",oa,oa.index);mxEvent.consume(Ma)})),va.style.height="16px",va.style.width="25px",va.style.float="right",va.className="geColorBtn",Ca.appendChild(va));Ga.appendChild(Ca);-return Ga}var Y=this,da=this.editorUi.editor.graph,ea=[],ka=document.createElement("table");ka.className="geProperties geFullWidthElement";var ba=document.createElement("tr");ba.className="gePropHeader";var ha=document.createElement("th");ha.className="gePropHeaderCell";ha.style.paddingLeft="16px";ha.style.backgroundRepeat="no-repeat";ha.style.backgroundPosition="-2px 50%";ha.style.backgroundSize="20px";mxUtils.write(ha,mxResources.get("property"));ba.style.cursor="pointer";var aa=function(){var ua=-ka.querySelectorAll(".gePropNonHeaderRow");if(Y.editorUi.propertiesCollapsed){ha.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var ra="none";for(var oa=k.childNodes.length-1;0<=oa;oa--)try{var Ea=k.childNodes[oa],va=Ea.nodeName.toUpperCase();"INPUT"!=va&&"SELECT"!=va||k.removeChild(Ea)}catch(ya){}}else ha.style.backgroundImage="url('"+Editor.arrowDownImage+"')",ra="";for(oa=0;oa<ua.length;oa++)ua[oa].style.display=ra};mxEvent.addListener(ba,"click",function(){Y.editorUi.propertiesCollapsed=-!Y.editorUi.propertiesCollapsed;aa()});ba.appendChild(ha);var ia=document.createElement("th");ia.className="gePropHeaderCell";ia.style.paddingLeft="4px";mxUtils.write(ia,mxResources.get("value"));ba.appendChild(ia);ka.appendChild(ba);var fa=ia=!1;ba=null;1==F.vertices.length&&0==F.edges.length?ba=F.vertices[0].id:0==F.vertices.length&&1==F.edges.length&&(ba=F.edges[0].id);null==ba||K||ka.appendChild(Z("id",mxUtils.htmlEntities(ba),{dispName:"id",type:"readOnly"},!0,!1));for(var ca in y)if(K=y[ca],-"function"!=typeof K.isVisible||K.isVisible(F,this)){var Ba=null!=K.getValue?K.getValue():null!=F.style[ca]?mxUtils.htmlEntities(F.style[ca]+""):null!=K.getDefaultValue?K.getDefaultValue(F,this):K.defVal;if("separator"==K.type)fa=!fa;else{if("staticArr"==K.type)K.size=parseInt(F.style[K.sizeProperty]||y[K.sizeProperty].defVal)||0;else if(null!=K.dependentProps){var la=K.dependentProps,xa=[],Aa=[];for(ba=0;ba<la.length;ba++){var ma=F.style[la[ba]];Aa.push(y[la[ba]].subDefVal);xa.push(null!=ma?ma.split(","):-[])}K.dependentPropsDefVal=Aa;K.dependentPropsVals=xa}ka.appendChild(Z(ca,Ba,K,ia,fa));ia=!ia}}for(ba=0;ba<ea.length;ba++)for(K=ea[ba],y=K.parentRow,F=0;F<K.values.length;F++)ca=Z(K.name,K.values[F],{type:K.type,parentRow:K.parentRow,isDeletable:K.isDeletable,index:F,defVal:K.defVal,countProperty:K.countProperty,size:K.size},0==F%2,K.flipBkg),y.parentNode.insertBefore(ca,y.nextSibling),y=ca;k.appendChild(ka);aa();return k};StyleFormatPanel.prototype.addStyles=function(k){if(null!=this.defaultColorSchemes){var y=-this.editorUi,F=y.editor.graph,K=document.createElement("div");K.style.padding="6px 20px 0 24px";k.appendChild(K);var P=document.createElement("div");P.className="geSwitcher";P.style.padding="4px 18px 6px 0px";for(var R=[],T=0;T<this.defaultColorSchemes.length;T++){var V=document.createElement("div");V.className="geSwitcherDot";mxUtils.bind(this,function(da){mxEvent.addListener(V,"click",mxUtils.bind(this,function(){W(da)}))})(T);R.push(V);P.appendChild(V)}var W=mxUtils.bind(this,function(da){null!=-R[da]&&(null!=this.format.currentScheme&&null!=R[this.format.currentScheme]&&(R[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=da,X(this.defaultColorSchemes[this.format.currentScheme]),R[this.format.currentScheme].style.background="#84d7ff")}),X=mxUtils.bind(this,function(da){var ea=mxUtils.clone(F.defaultVertexStyle);ea[mxConstants.STYLE_STROKECOLOR]=null!=ea[mxConstants.STYLE_STROKECOLOR]?ea[mxConstants.STYLE_STROKECOLOR]:"default";ea[mxConstants.STYLE_FILLCOLOR]=-null!=ea[mxConstants.STYLE_FILLCOLOR]?ea[mxConstants.STYLE_FILLCOLOR]:"default";ea[mxConstants.STYLE_FONTCOLOR]=null!=ea[mxConstants.STYLE_FONTCOLOR]?ea[mxConstants.STYLE_FONTCOLOR]:"default";F.replaceDefaultColors(new mxCell,ea);var ka=mxUtils.bind(this,function(ha){var aa=mxUtils.button("",mxUtils.bind(this,function(ca){F.getModel().beginUpdate();try{for(var Ba=y.getSelectionState().cells,la=0;la<Ba.length;la++){var xa=F.getModel().getStyle(Ba[la]);null!=ha?(mxEvent.isShiftDown(ca)||(xa=""==ha.fill||-null==ha.fill?mxUtils.setStyle(xa,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(xa,mxConstants.STYLE_FILLCOLOR,ha.fill),xa=""==ha.gradient||null==ha.gradient?mxUtils.setStyle(xa,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(xa,mxConstants.STYLE_GRADIENTCOLOR,ha.gradient),mxEvent.isControlDown(ca)||mxClient.IS_MAC&&mxEvent.isMetaDown(ca)||!F.getModel().isVertex(Ba[la])||(xa=""==ha.font||null==ha.font?mxUtils.setStyle(xa,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(xa,mxConstants.STYLE_FONTCOLOR,-ha.font))),mxEvent.isAltDown(ca)||(xa=""==ha.stroke||null==ha.fill?mxUtils.setStyle(xa,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(xa,mxConstants.STYLE_STROKECOLOR,ha.stroke))):(xa=mxUtils.setStyle(xa,mxConstants.STYLE_FILLCOLOR,null),xa=mxUtils.setStyle(xa,mxConstants.STYLE_STROKECOLOR,null),xa=mxUtils.setStyle(xa,mxConstants.STYLE_GRADIENTCOLOR,null),F.getModel().isVertex(Ba[la])&&(xa=mxUtils.setStyle(xa,mxConstants.STYLE_FONTCOLOR,null)));F.getModel().setStyle(Ba[la],xa)}}finally{F.getModel().endUpdate()}}));-aa.className="geStyleButton";aa.style.width="36px";aa.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";aa.style.margin="0px 6px 6px 0px";if(null!=ha){var ia="1px solid";null!=ha.border&&(ia=ha.border);if(null!=ha.gradient)aa.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(ha.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(ha.gradient).cssText+" 100%)";else if(ha.fill==mxConstants.NONE)aa.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==ha.fill||-""==ha.fill)aa.style.backgroundColor=mxUtils.getLightDarkColor(mxUtils.getValue(ea,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var fa=mxUtils.getLightDarkColor(ha.fill);aa.style.backgroundImage="linear-gradient(to right bottom, "+fa.cssText+" 50%, "+fa.light+" 50.3%)"}null==ha.stroke||ha.stroke==mxConstants.NONE?aa.style.border=ia+" transparent":""==ha.stroke?aa.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(ea,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(fa=mxUtils.getLightDarkColor(ha.stroke),-aa.style.border=ia+" "+fa.cssText,aa.style.borderRightColor=fa.light,aa.style.borderBottomColor=aa.style.borderRightColor);null!=ha.title&&aa.setAttribute("title",ha.title)}else ia=mxUtils.getValue(ea,mxConstants.STYLE_FILLCOLOR,"#ffffff"),fa=mxUtils.getValue(ea,mxConstants.STYLE_STROKECOLOR,"#000000"),aa.style.backgroundColor=ia,aa.style.border="1px solid "+fa;aa.style.borderRadius="0";K.appendChild(aa);null!=ha&&null!=ha.gradient&&(ia=aa.cloneNode(!1),ia.style.backgroundImage="linear-gradient(light-dark(transparent, "+-mxUtils.getLightDarkColor(ha.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(ha.gradient).light+") 100%)",ia.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",ia.style.backgroundColor="transparent",K.appendChild(ia),ia.style.marginLeft="-42px",mxEvent.addListener(ia,"click",function(){aa.click()}))});K.innerText="";if(null!=da)for(var ba=0;ba<da.length;ba++)0<ba&&0==mxUtils.mod(ba,4)&&mxUtils.br(K),ka(da[ba])});null==this.format.currentScheme?W(Math.min(R.length-1,Editor.isDarkMode()?-1:"1"==urlParams.sketch?5:0)):W(this.format.currentScheme);T=10>=this.defaultColorSchemes.length?43:23;var Z=document.createElement("div");Z.className="geButton";Z.style.cssText="position:absolute;left:0px;bottom:"+T+"px;width:20px;background-image:url("+Editor.chevronLeftImage+");";mxEvent.addListener(Z,"click",mxUtils.bind(this,function(){W(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var Y=document.createElement("div");Y.className="geButton";Y.style.cssText="position:absolute;left:186px;bottom:"+-T+"px;width:20px;background-image:url("+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(k.appendChild(Z),k.appendChild(Y));mxEvent.addListener(Y,"click",mxUtils.bind(this,function(){W(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));X(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&k.appendChild(P)}return k}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('++{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[{fill:"",stroke:""},{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;var e=StyleFormatPanel.prototype.init;+StyleFormatPanel.prototype.init=function(){var k=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&"image"!=k.style.shape&&!k.containsLabel&&0<k.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));e.apply(this,arguments);null!=k.customProperties&&this.container.appendChild(this.addProperties(this.createPanel(),k.customProperties,k))};var g=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(k){var y=+this.editorUi.getSelectionState();1==y.cells.length?this.addActions(k,["copyStyle","pasteStyle"]):1<=y.cells.length&&this.addActions(k,["pasteStyle","pasteData"]);g.apply(this,arguments);return k};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(k,y,F,M){function P(ua,ra,oa,Ea,va){if(null!=oa.valueChanged)oa.valueChanged(ra,va);else{da.getModel().beginUpdate();try{va=[];var ya=[];if(null!=oa.index){for(var za=[],Ga=oa.parentRow.nextSibling;Ga&&Ga.getAttribute("data-pName")==+ua;)za.push(Ga.getAttribute("data-pValue")),Ga=Ga.nextSibling;oa.index<za.length?null!=Ea?za.splice(Ea,1):za[oa.index]=ra:za.push(ra);null!=oa.size&&za.length>oa.size&&(za=za.slice(0,oa.size));ra=za.join(",");null!=oa.countProperty&&(da.setCellStyles(oa.countProperty,za.length,da.getSelectionCells()),va.push(oa.countProperty),ya.push(za.length))}da.setCellStyles(ua,ra,da.getSelectionCells());va.push(ua);ya.push(ra);if(null!=oa.dependentProps)for(ua=0;ua<oa.dependentProps.length;ua++){var Ca=oa.dependentPropsDefVal[ua],+Ka=oa.dependentPropsVals[ua];if(Ka.length>ra)Ka=Ka.slice(0,ra);else for(var Ma=Ka.length;Ma<ra;Ma++)Ka.push(Ca);Ka=Ka.join(",");da.setCellStyles(oa.dependentProps[ua],Ka,da.getSelectionCells());va.push(oa.dependentProps[ua]);ya.push(Ka)}if("function"==typeof oa.onChange)oa.onChange(da,ra);Z.editorUi.fireEvent(new mxEventObject("styleChanged","keys",va,"values",ya,"cells",da.getSelectionCells()))}finally{da.getModel().endUpdate()}}}function R(ua,ra,oa){var Ea=mxUtils.getOffset(k,!0),va=mxUtils.getOffset(ua,+!0);ra.style.position="absolute";ra.style.left=va.x-Ea.x+"px";ra.style.top=va.y-Ea.y+"px";ra.style.width=ua.offsetWidth+"px";ra.style.height=ua.offsetHeight-(oa?4:0)+"px";ra.style.zIndex=5}function T(ua,ra,oa){function Ea(ya){if(null==ya||ya==mxConstants.NONE)va.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==ya)va.style.background="";else{var za=mxUtils.getLightDarkColor(ya);mxUtils.isLightDarkColor(ya)&&za.light!=za.dark?va.style.background="linear-gradient(to right bottom, "++za.cssText+" 50%, "+mxUtils.invertLightDarkColor(za).cssText+" 50.3%)":va.style.background=ya}}var va=document.createElement("div");va.style.width="32px";va.style.height="8px";va.style.margin="2px";va.style.borderStyle="solid";va.style.borderWidth="1px";Ea(ra);btn=mxUtils.button("",mxUtils.bind(Z,function(ya){this.editorUi.pickColor(ra,function(za){P(ua,za,oa);Ea(za)});mxEvent.consume(ya)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className=+"geColorBtn";btn.appendChild(va);return btn}function V(ua,ra,oa,Ea,va,ya,za){null!=ra&&(ra=ra.split(","),ea.push({name:ua,values:ra,type:oa,defVal:Ea,countProperty:va,parentRow:ya,isDeletable:!0,flipBkg:za}));btn=mxUtils.button("+",mxUtils.bind(Z,function(Ga){for(var Ca=ya,Ka=0;null!=Ca.nextSibling;)if(Ca.nextSibling.getAttribute("data-pName")==ua)Ca=Ca.nextSibling,Ka++;else break;var Ma={type:oa,parentRow:ya,index:Ka,isDeletable:!0,defVal:Ea,countProperty:va};Ka=Y(ua,"",Ma,0==Ka%2,za);P(ua,Ea,Ma);+Ca.parentNode.insertBefore(Ka,Ca.nextSibling);mxEvent.consume(Ga)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function W(ua,ra,oa,Ea,va,ya,za){if(0<va){var Ga=Array(va);ra=null!=ra?ra.split(","):[];for(var Ca=0;Ca<va;Ca++)Ga[Ca]=null!=ra[Ca]?ra[Ca]:null!=Ea?Ea:"";ea.push({name:ua,values:Ga,type:oa,defVal:Ea,parentRow:ya,flipBkg:za,size:va})}return document.createElement("div")}function X(ua,ra,oa){var Ea=document.createElement("input");Ea.type="checkbox";+Ea.checked="1"==ra;mxEvent.addListener(Ea,"change",function(){P(ua,Ea.checked?"1":"0",oa)});return Ea}function Y(ua,ra,oa,Ea,va){var ya=oa.dispName,za=oa.type,Ga=document.createElement("tr");Ga.className="gePropRow"+(va?"Dark":"")+(Ea?"Alt":"")+" gePropNonHeaderRow";Ga.setAttribute("data-pName",ua);Ga.setAttribute("data-pValue",ra);Ea=!1;null!=oa.index&&(Ga.setAttribute("data-index",oa.index),ya=(null!=ya?ya:"")+"["+oa.index+"]",Ea=!0);var Ca=document.createElement("td");Ca.className="gePropRowCell";+ya=mxResources.get(ya,null,ya);mxUtils.write(Ca,ya);Ca.setAttribute("title",ya);Ea&&(Ca.style.textAlign="right");Ga.appendChild(Ca);Ca=document.createElement("td");Ca.className="gePropRowCell";Ca.setAttribute("title",null!=ra?ra:mxResources.get("none"));if("color"==za)Ca.appendChild(T(ua,ra,oa));else if("bool"==za||"boolean"==za)Ca.appendChild(X(ua,ra,oa));else if("enum"==za){var Ka=oa.enumList;for(va=0;va<Ka.length;va++)if(ya=Ka[va],ya.val==ra){mxUtils.write(Ca,mxResources.get(ya.dispName,null,ya.dispName));+break}mxEvent.addListener(Ca,"click",mxUtils.bind(Z,function(){var Ma=document.createElement("select"),Da=null;R(Ca,Ma);for(var wa=0;wa<Ka.length;wa++){var Sa=Ka[wa],Ta=document.createElement("option");Ta.value=mxUtils.htmlEntities(Sa.val);mxUtils.write(Ta,mxResources.get(Sa.dispName,null,Sa.dispName));Ma.appendChild(Ta);null==Sa.val&&(Ta.value="null",Da=Ta)}Ma.value=null==ra&&null!=Da?"null":ra;k.appendChild(Ma);mxEvent.addListener(Ma,"change",function(){var Ua=mxUtils.htmlEntities(Ma.value);if(Ma[Ma.selectedIndex]==+Da||"null"==Ua.value)Ua=null;P(ua,Ua,oa)});Ma.focus();mxEvent.addListener(Ma,"blur",function(){k.removeChild(Ma)})}))}else"dynamicArr"==za?Ca.appendChild(V(ua,ra,oa.subType,oa.subDefVal,oa.countProperty,Ga,va)):"staticArr"==za?Ca.appendChild(W(ua,ra,oa.subType,oa.subDefVal,oa.size,Ga,va)):"readOnly"==za?(va=document.createElement("input"),va.setAttribute("readonly",""),va.value=ra,va.style.borderWidth="0px","id"==ua?(va.style.width="190px",va.style.position="relative",va.style.right="6px",va.style.float=+"right",va.style.background="none",va.style.textAlign="right",Ga.firstChild.setAttribute("colspan","2"),va.setAttribute("title",ra),Ga.firstChild.appendChild(va)):(va.style.width="96px",Ca.appendChild(va))):(Ca.innerHTML=mxUtils.htmlEntities(decodeURIComponent(ra)),mxEvent.addListener(Ca,"click",mxUtils.bind(Z,function(){function Ma(){var wa=Da.value;wa=0==wa.length&&"string"!=za&&"numbers"!=za?0:wa;oa.allowAuto&&(null!=wa.trim&&"auto"==wa.trim().toLowerCase()?(wa="auto",za="string"):(wa=parseFloat(wa),+wa=isNaN(wa)?0:wa));null!=oa.min&&wa<oa.min?wa=oa.min:null!=oa.max&&wa>oa.max&&(wa=oa.max);var Sa=null;try{Sa="numbers"==za?wa.match(/\d+/g).map(Number).join(" "):encodeURIComponent(("int"==za?parseInt(wa):wa)+"")}catch(Ta){}P(ua,Sa,oa,null,Da)}var Da=document.createElement("input");R(Ca,Da,!0);Da.value=decodeURIComponent(ra);Da.className="gePropEditor";"int"!=za&&"float"!=za||oa.allowAuto||(Da.type="number",Da.step="int"==za?"1":"any",null!=oa.min&&(Da.min=parseFloat(oa.min)),null!=oa.max&&(Da.max=+parseFloat(oa.max)));k.appendChild(Da);mxEvent.addListener(Da,"keypress",function(wa){13==wa.keyCode&&Ma()});Da.focus();mxEvent.addListener(Da,"blur",function(){Ma()})})));oa.isDeletable&&(va=mxUtils.button("-",mxUtils.bind(Z,function(Ma){P(ua,"",oa,oa.index);mxEvent.consume(Ma)})),va.style.height="16px",va.style.width="25px",va.style.float="right",va.className="geColorBtn",Ca.appendChild(va));Ga.appendChild(Ca);return Ga}var Z=this,da=this.editorUi.editor.graph,ea=[],ka=document.createElement("table");+ka.className="geProperties geFullWidthElement";var ba=document.createElement("tr");ba.className="gePropHeader";var ha=document.createElement("th");ha.className="gePropHeaderCell";ha.style.paddingLeft="16px";ha.style.backgroundRepeat="no-repeat";ha.style.backgroundPosition="-2px 50%";ha.style.backgroundSize="20px";mxUtils.write(ha,mxResources.get("property"));ba.style.cursor="pointer";var aa=function(){var ua=ka.querySelectorAll(".gePropNonHeaderRow");if(Z.editorUi.propertiesCollapsed){ha.style.backgroundImage=+"url('"+Editor.arrowRightImage+"')";var ra="none";for(var oa=k.childNodes.length-1;0<=oa;oa--)try{var Ea=k.childNodes[oa],va=Ea.nodeName.toUpperCase();"INPUT"!=va&&"SELECT"!=va||k.removeChild(Ea)}catch(ya){}}else ha.style.backgroundImage="url('"+Editor.arrowDownImage+"')",ra="";for(oa=0;oa<ua.length;oa++)ua[oa].style.display=ra};mxEvent.addListener(ba,"click",function(){Z.editorUi.propertiesCollapsed=!Z.editorUi.propertiesCollapsed;aa()});ba.appendChild(ha);var ia=document.createElement("th");ia.className=+"gePropHeaderCell";ia.style.paddingLeft="4px";mxUtils.write(ia,mxResources.get("value"));ba.appendChild(ia);ka.appendChild(ba);var fa=ia=!1;ba=null;1==F.vertices.length&&0==F.edges.length?ba=F.vertices[0].id:0==F.vertices.length&&1==F.edges.length&&(ba=F.edges[0].id);null==ba||M||ka.appendChild(Y("id",mxUtils.htmlEntities(ba),{dispName:"id",type:"readOnly"},!0,!1));for(var ca in y)if(M=y[ca],!M.primary&&("function"!=typeof M.isVisible||M.isVisible(F,this))){var Ba=null!=M.getValue?M.getValue():null!=+F.style[ca]?mxUtils.htmlEntities(F.style[ca]+""):null!=M.getDefaultValue?M.getDefaultValue(F,this):M.defVal;if("separator"==M.type)fa=!fa;else{if("staticArr"==M.type)M.size=parseInt(F.style[M.sizeProperty]||y[M.sizeProperty].defVal)||0;else if(null!=M.dependentProps){var la=M.dependentProps,xa=[],Aa=[];for(ba=0;ba<la.length;ba++){var ma=F.style[la[ba]];Aa.push(y[la[ba]].subDefVal);xa.push(null!=ma?ma.split(","):[])}M.dependentPropsDefVal=Aa;M.dependentPropsVals=xa}ka.appendChild(Y(ca,Ba,M,ia,fa));+ia=!ia}}for(ba=0;ba<ea.length;ba++)for(M=ea[ba],y=M.parentRow,F=0;F<M.values.length;F++)ca=Y(M.name,M.values[F],{type:M.type,parentRow:M.parentRow,isDeletable:M.isDeletable,index:F,defVal:M.defVal,countProperty:M.countProperty,size:M.size},0==F%2,M.flipBkg),y.parentNode.insertBefore(ca,y.nextSibling),y=ca;k.appendChild(ka);aa();return k};StyleFormatPanel.prototype.addStyles=function(k){if(null!=this.defaultColorSchemes){var y=this.editorUi,F=y.editor.graph,M=document.createElement("div");M.style.padding=+"6px 20px 0 24px";k.appendChild(M);var P=document.createElement("div");P.className="geSwitcher";P.style.padding="4px 18px 6px 0px";for(var R=[],T=0;T<this.defaultColorSchemes.length;T++){var V=document.createElement("div");V.className="geSwitcherDot";mxUtils.bind(this,function(da){mxEvent.addListener(V,"click",mxUtils.bind(this,function(){W(da)}))})(T);R.push(V);P.appendChild(V)}var W=mxUtils.bind(this,function(da){null!=R[da]&&(null!=this.format.currentScheme&&null!=R[this.format.currentScheme]&&+(R[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=da,X(this.defaultColorSchemes[this.format.currentScheme]),R[this.format.currentScheme].style.background="#84d7ff")}),X=mxUtils.bind(this,function(da){var ea=mxUtils.clone(F.defaultVertexStyle);ea[mxConstants.STYLE_STROKECOLOR]=null!=ea[mxConstants.STYLE_STROKECOLOR]?ea[mxConstants.STYLE_STROKECOLOR]:"default";ea[mxConstants.STYLE_FILLCOLOR]=null!=ea[mxConstants.STYLE_FILLCOLOR]?ea[mxConstants.STYLE_FILLCOLOR]:+"default";ea[mxConstants.STYLE_FONTCOLOR]=null!=ea[mxConstants.STYLE_FONTCOLOR]?ea[mxConstants.STYLE_FONTCOLOR]:"default";F.replaceDefaultColors(new mxCell,ea);var ka=mxUtils.bind(this,function(ha){var aa=mxUtils.button("",mxUtils.bind(this,function(ca){F.getModel().beginUpdate();try{for(var Ba=y.getSelectionState().cells,la=0;la<Ba.length;la++){var xa=F.getModel().getStyle(Ba[la]);null!=ha?(mxEvent.isShiftDown(ca)||(xa=""==ha.fill||null==ha.fill?mxUtils.setStyle(xa,mxConstants.STYLE_FILLCOLOR,null):+mxUtils.setStyle(xa,mxConstants.STYLE_FILLCOLOR,ha.fill),xa=""==ha.gradient||null==ha.gradient?mxUtils.setStyle(xa,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(xa,mxConstants.STYLE_GRADIENTCOLOR,ha.gradient),mxEvent.isControlDown(ca)||mxClient.IS_MAC&&mxEvent.isMetaDown(ca)||!F.getModel().isVertex(Ba[la])||(xa=""==ha.font||null==ha.font?mxUtils.setStyle(xa,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(xa,mxConstants.STYLE_FONTCOLOR,ha.font))),mxEvent.isAltDown(ca)||(xa=""==ha.stroke||+null==ha.fill?mxUtils.setStyle(xa,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(xa,mxConstants.STYLE_STROKECOLOR,ha.stroke))):(xa=mxUtils.setStyle(xa,mxConstants.STYLE_FILLCOLOR,null),xa=mxUtils.setStyle(xa,mxConstants.STYLE_STROKECOLOR,null),xa=mxUtils.setStyle(xa,mxConstants.STYLE_GRADIENTCOLOR,null),F.getModel().isVertex(Ba[la])&&(xa=mxUtils.setStyle(xa,mxConstants.STYLE_FONTCOLOR,null)));F.getModel().setStyle(Ba[la],xa)}}finally{F.getModel().endUpdate()}}));aa.className="geStyleButton";+aa.style.width="36px";aa.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";aa.style.margin="0px 6px 6px 0px";if(null!=ha){var ia="1px solid";null!=ha.border&&(ia=ha.border);if(null!=ha.gradient)aa.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(ha.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(ha.gradient).cssText+" 100%)";else if(ha.fill==mxConstants.NONE)aa.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==ha.fill||""==ha.fill)aa.style.backgroundColor=+mxUtils.getLightDarkColor(mxUtils.getValue(ea,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var fa=mxUtils.getLightDarkColor(ha.fill);aa.style.backgroundImage="linear-gradient(to right bottom, "+fa.cssText+" 50%, "+fa.light+" 50.3%)"}null==ha.stroke||ha.stroke==mxConstants.NONE?aa.style.border=ia+" transparent":""==ha.stroke?aa.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(ea,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(fa=mxUtils.getLightDarkColor(ha.stroke),aa.style.border=+ia+" "+fa.cssText,aa.style.borderRightColor=fa.light,aa.style.borderBottomColor=aa.style.borderRightColor);null!=ha.title&&aa.setAttribute("title",ha.title)}else ia=mxUtils.getValue(ea,mxConstants.STYLE_FILLCOLOR,"#ffffff"),fa=mxUtils.getValue(ea,mxConstants.STYLE_STROKECOLOR,"#000000"),aa.style.backgroundColor=ia,aa.style.border="1px solid "+fa;aa.style.borderRadius="0";M.appendChild(aa);null!=ha&&null!=ha.gradient&&(ia=aa.cloneNode(!1),ia.style.backgroundImage="linear-gradient(light-dark(transparent, "++mxUtils.getLightDarkColor(ha.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(ha.gradient).light+") 100%)",ia.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",ia.style.backgroundColor="transparent",M.appendChild(ia),ia.style.marginLeft="-42px",mxEvent.addListener(ia,"click",function(){aa.click()}))});M.innerText="";if(null!=da)for(var ba=0;ba<da.length;ba++)0<ba&&0==mxUtils.mod(ba,4)&&mxUtils.br(M),ka(da[ba])});null==this.format.currentScheme?W(Math.min(R.length-1,Editor.isDarkMode()?+1:"1"==urlParams.sketch?5:0)):W(this.format.currentScheme);T=10>=this.defaultColorSchemes.length?43:23;var Y=document.createElement("div");Y.className="geButton";Y.style.cssText="position:absolute;left:0px;bottom:"+T+"px;width:20px;background-image:url("+Editor.chevronLeftImage+");";mxEvent.addListener(Y,"click",mxUtils.bind(this,function(){W(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var Z=document.createElement("div");Z.className="geButton";Z.style.cssText="position:absolute;left:186px;bottom:"++T+"px;width:20px;background-image:url("+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(k.appendChild(Y),k.appendChild(Z));mxEvent.addListener(Z,"click",mxUtils.bind(this,function(){W(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));X(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&k.appendChild(P)}return k}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements={};Graph.isGoogleFontUrl=function(k){return k.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||k.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=function(k){return Graph.isGoogleFontUrl(k)};Graph.rewriteGoogleFontUrl=function(k){null!=k&&k.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(k=Editor.GOOGLE_FONTS_CSS2+k.substring(Editor.GOOGLE_FONTS.length)+":wght@400;500");return k};Graph.createFontElement=function(k,y){var F=Graph.fontMapping[y];null==F&&Graph.isCssFontUrl(y)?(k=document.createElement("link"),k.setAttribute("rel","stylesheet"),k.setAttribute("type","text/css"),k.setAttribute("charset","UTF-8"),k.setAttribute("href",Graph.rewriteGoogleFontUrl(y))):(null==F&&(F='@font-face {\nfont-family: "'+k+'";\nsrc: url("'+y+'");\n}'),k=document.createElement("style"),mxUtils.write(k,F));return k};Graph.addRecentCustomFont=function(k,y){};Graph.addFont=-function(k,y,F){if(null!=k&&0<k.length&&null!=y&&0<y.length){var K=k.toLowerCase();if("helvetica"!=K&&"arial"!=k&&"sans-serif"!=K){var P=Graph.customFontElements[K];null!=P&&P.url!=y&&(P.elt.parentNode.removeChild(P.elt),P=null);null==P?(P=y,"http:"==y.substring(0,5)&&(P=PROXY_URL+"?url="+encodeURIComponent(y)),P={name:k,url:y,elt:Graph.createFontElement(k,P)},Graph.customFontElements[K]=P,y=document.getElementsByTagName("head")[0],null!=F&&("link"==P.elt.nodeName.toLowerCase()?(P.elt.onload=F,P.elt.onerror=-F):F()),null!=y&&y.appendChild(P.elt)):null!=F&&F()}else null!=F&&F()}else null!=F&&F();return k};Graph.getFontUrl=function(k,y){k=Graph.customFontElements[k.toLowerCase()];null!=k&&(y=k.url);return y};Graph.processFontAttributes=function(k){k=k.getElementsByTagName("*");for(var y=0;y<k.length;y++){var F=k[y].getAttribute("data-font-src");if(null!=F){var K="FONT"==k[y].nodeName?k[y].getAttribute("face"):k[y].style.fontFamily;null!=K&&Graph.addFont(K,F)}}};Graph.processFontStyle=function(k){if(null!=-k){var y=mxUtils.getValue(k,"fontSource",null);if(null!=y){var F=mxUtils.getValue(k,mxConstants.STYLE_FONTFAMILY,null);if(null!=F)try{Graph.addFont(F,decodeURIComponent(y))}catch(K){}}}return k};Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;Graph.prototype.shadowId="drawio-drop-shadow";Graph.prototype.svgShadowColor="#3D4574";+function(k,y,F){if(null!=k&&0<k.length&&null!=y&&0<y.length){var M=k.toLowerCase();if("helvetica"!=M&&"arial"!=k&&"sans-serif"!=M){var P=Graph.customFontElements[M];null!=P&&P.url!=y&&(P.elt.parentNode.removeChild(P.elt),P=null);null==P?(P=y,"http:"==y.substring(0,5)&&(P=PROXY_URL+"?url="+encodeURIComponent(y)),P={name:k,url:y,elt:Graph.createFontElement(k,P)},Graph.customFontElements[M]=P,y=document.getElementsByTagName("head")[0],null!=F&&("link"==P.elt.nodeName.toLowerCase()?(P.elt.onload=F,P.elt.onerror=+F):F()),null!=y&&y.appendChild(P.elt)):null!=F&&F()}else null!=F&&F()}else null!=F&&F();return k};Graph.getFontUrl=function(k,y){k=Graph.customFontElements[k.toLowerCase()];null!=k&&(y=k.url);return y};Graph.processFontAttributes=function(k){k=k.getElementsByTagName("*");for(var y=0;y<k.length;y++){var F=k[y].getAttribute("data-font-src");if(null!=F){var M="FONT"==k[y].nodeName?k[y].getAttribute("face"):k[y].style.fontFamily;null!=M&&Graph.addFont(M,F)}}};Graph.processFontStyle=function(k){if(null!=+k){var y=mxUtils.getValue(k,"fontSource",null);if(null!=y){var F=mxUtils.getValue(k,mxConstants.STYLE_FONTFAMILY,null);if(null!=F)try{Graph.addFont(F,decodeURIComponent(y))}catch(M){}}}return k};Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;Graph.prototype.shadowId="drawio-drop-shadow";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var l=Graph.prototype.init;Graph.prototype.init=function(){function k(P){y=P}l.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var y=null;mxEvent.addListener(this.container,"mouseenter",k);mxEvent.addListener(this.container,"mousemove",k);mxEvent.addListener(this.container,"mouseleave",-function(P){y=null});this.isMouseInsertPoint=function(){return null!=y};var F=this.getInsertPoint;this.getInsertPoint=function(){return null!=y?this.getPointForEvent(y):F.apply(this,arguments)};var K=this.layoutManager.getLayout;this.layoutManager.getLayout=function(P){var R=this.graph.getCellStyle(P);if(null!=R&&"rack"==R.childLayout){var T=new mxStackLayout(this.graph,!1);T.gridSize=null!=R.rackUnitSize?parseFloat(R.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;-T.marginLeft=R.marginLeft||0;T.marginRight=R.marginRight||0;T.marginTop=R.marginTop||0;T.marginBottom=R.marginBottom||0;T.allowGaps=R.allowGaps||0;T.horizontal="1"==mxUtils.getValue(R,"horizontalRack","0");T.resizeParent=!1;T.fill=!0;return T}return K.apply(this,arguments)};this.updateGlobalUrlVariables()};var n=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(k,y){return Graph.processFontStyle(n.apply(this,arguments))};var u=mxSvgCanvas2D.prototype.updateTextNodes;-mxSvgCanvas2D.prototype.updateTextNodes=function(k,y,F,K,P,R,T,V,W,X,Z,Y){u.apply(this,arguments);Graph.processFontAttributes(Y)};var z=mxText.prototype.redraw;mxText.prototype.redraw=function(){z.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(k,y,F,K){function P(){for(var ba=V.getSelectionCells(),ha=[],aa=0;aa<ba.length;aa++)V.isCellVisible(ba[aa])&&ha.push(ba[aa]);V.setSelectionCells(ha)}function R(ba){V.setHiddenTags(ba?-[]:W.slice());P();V.refresh()}function T(ba,ha){Z.innerText="";if(0<ba.length){var aa=document.createElement("table");aa.setAttribute("cellpadding","2");aa.style.boxSizing="border-box";aa.style.tableLayout="fixed";aa.style.width="100%";var ia=document.createElement("tbody");if(null!=ba&&0<ba.length)for(var fa=0;fa<ba.length;fa++)(function(ca){function Ba(){var ra=V.getCellsForTags([ca],null,null,!0);V.isEnabled()?V.setSelectionCells(ra):V.highlightCells(ra,null,null,70)}var la=0>mxUtils.indexOf(V.hiddenTags,+function(P){y=null});this.isMouseInsertPoint=function(){return null!=y};var F=this.getInsertPoint;this.getInsertPoint=function(){return null!=y?this.getPointForEvent(y):F.apply(this,arguments)};var M=this.layoutManager.getLayout;this.layoutManager.getLayout=function(P){var R=this.graph.getCellStyle(P);if(null!=R&&"rack"==R.childLayout){var T=new mxStackLayout(this.graph,!1);T.gridSize=null!=R.rackUnitSize?parseFloat(R.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;+T.marginLeft=R.marginLeft||0;T.marginRight=R.marginRight||0;T.marginTop=R.marginTop||0;T.marginBottom=R.marginBottom||0;T.allowGaps=R.allowGaps||0;T.horizontal="1"==mxUtils.getValue(R,"horizontalRack","0");T.resizeParent=!1;T.fill=!0;return T}return M.apply(this,arguments)};this.updateGlobalUrlVariables()};var n=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(k,y){return Graph.processFontStyle(n.apply(this,arguments))};var u=mxSvgCanvas2D.prototype.updateTextNodes;+mxSvgCanvas2D.prototype.updateTextNodes=function(k,y,F,M,P,R,T,V,W,X,Y,Z){u.apply(this,arguments);Graph.processFontAttributes(Z)};var z=mxText.prototype.redraw;mxText.prototype.redraw=function(){z.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(k,y,F,M){function P(){for(var ba=V.getSelectionCells(),ha=[],aa=0;aa<ba.length;aa++)V.isCellVisible(ba[aa])&&ha.push(ba[aa]);V.setSelectionCells(ha)}function R(ba){V.setHiddenTags(ba?+[]:W.slice());P();V.refresh()}function T(ba,ha){Y.innerText="";if(0<ba.length){var aa=document.createElement("table");aa.setAttribute("cellpadding","2");aa.style.boxSizing="border-box";aa.style.tableLayout="fixed";aa.style.width="100%";var ia=document.createElement("tbody");if(null!=ba&&0<ba.length)for(var fa=0;fa<ba.length;fa++)(function(ca){function Ba(){var ra=V.getCellsForTags([ca],null,null,!0);V.isEnabled()?V.setSelectionCells(ra):V.highlightCells(ra,null,null,70)}var la=0>mxUtils.indexOf(V.hiddenTags,ca),xa=document.createElement("tr"),Aa=document.createElement("td");Aa.style.align="center";Aa.style.width="16px";var ma=document.createElement("img");ma.setAttribute("src",la?Editor.visibleImage:Editor.hiddenImage);ma.setAttribute("title",mxResources.get(la?"hideIt":"show",[ca]));mxUtils.setOpacity(ma,la?75:25);ma.className="geAdaptiveAsset";ma.style.verticalAlign="middle";ma.style.cursor="pointer";ma.style.width="16px";if(y||Editor.isDarkMode())ma.style.filter="invert(100%)";Aa.appendChild(ma);mxEvent.addListener(ma,"click",function(ra){mxEvent.isShiftDown(ra)?R(0<=mxUtils.indexOf(V.hiddenTags,ca)):(V.toggleHiddenTag(ca),P(),V.refresh());mxEvent.consume(ra)});xa.appendChild(Aa);Aa=document.createElement("td");Aa.style.align="center";Aa.style.width="16px";ma=document.createElement("img");ma.setAttribute("src",Editor.selectImage);ma.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(ma,la?75:25);ma.className="geAdaptiveAsset";ma.style.verticalAlign="middle";ma.style.cursor="pointer";ma.style.width="16px";if(y||Editor.isDarkMode())ma.style.filter="invert(100%)";mxEvent.addListener(ma,"click",function(ra){R(!0);Ba();mxEvent.consume(ra)});Aa.appendChild(ma);xa.appendChild(Aa);Aa=document.createElement("td");Aa.style.overflow="hidden";Aa.style.whiteSpace="nowrap";Aa.style.textOverflow="ellipsis";Aa.style.verticalAlign="middle";Aa.style.cursor="pointer";Aa.setAttribute("title",ca);a=document.createElement("a");mxUtils.write(a,ca);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,la?100:40);Aa.appendChild(a);mxEvent.addListener(Aa,"click",function(ra){if(mxEvent.isShiftDown(ra))R(!0),Ba();else if(la&&0<V.hiddenTags.length)R(!0);else{var oa=W.slice(),Ea=mxUtils.indexOf(oa,ca);oa.splice(Ea,1);V.setHiddenTags(oa);P();V.refresh()}mxEvent.consume(ra)});xa.appendChild(Aa);if(V.isEnabled()){Aa=document.createElement("td");Aa.style.verticalAlign="middle";Aa.style.textAlign="center";Aa.style.width="18px";if(null==ha){Aa.style.align="center";Aa.style.width="16px";ma=document.createElement("img");ma.setAttribute("src",Editor.trashImage);ma.setAttribute("title",mxResources.get("removeIt",[ca]));mxUtils.setOpacity(ma,la?75:25);ma.className="geAdaptiveAsset";ma.style.verticalAlign="middle";ma.style.cursor="pointer";ma.style.width="16px";if(y||Editor.isDarkMode())ma.style.filter="invert(100%)";mxEvent.addListener(ma,"click",function(ra){var oa=mxUtils.indexOf(W,ca);0<=oa&&W.splice(oa,1);V.removeTagsForCells(V.model.getDescendants(V.model.getRoot()),[ca]);V.refresh();mxEvent.consume(ra)});Aa.appendChild(ma)}else{var ua=document.createElement("input");ua.setAttribute("type","checkbox");ua.style.margin="0px";ua.defaultChecked=null!=ha&&0<=mxUtils.indexOf(ha,ca);ua.checked=ua.defaultChecked;ua.style.background="transparent";ua.setAttribute("title",mxResources.get(ua.defaultChecked?"removeIt":"add",[ca]));mxEvent.addListener(ua,"change",function(ra){ua.checked?V.addTagsForCells(V.getSelectionCells(),[ca]):V.removeTagsForCells(V.getSelectionCells(),[ca]);-mxEvent.consume(ra)});Aa.appendChild(ua)}xa.appendChild(Aa)}ia.appendChild(xa)})(ba[fa]);aa.appendChild(ia);Z.appendChild(aa)}}var V=this,W=V.hiddenTags.slice(),X=document.createElement("div");X.style.userSelect="none";X.style.overflow="hidden";X.style.padding="10px";X.style.height="100%";var Z=document.createElement("div");Z.style.position="absolute";Z.style.boxSizing="border-box";Z.style.userSelect="none";Z.style.overflow="auto";Z.style.padding="3px";Z.style.left="0px";Z.style.right="0px";Z.style.top=-"0px";Z.style.bottom="0px";X.appendChild(Z);V.addListener(mxEvent.ROOT,function(){W=V.hiddenTags.slice()});var Y=mxUtils.bind(this,function(ba,ha){if(k()){ba=V.getAllTags();for(ha=0;ha<ba.length;ha++)0>mxUtils.indexOf(W,ba[ha])&&W.push(ba[ha]);W.sort();V.isSelectionEmpty()?T(W):T(W,V.getCommonTagsForCells(V.getSelectionCells()))}});V.selectionModel.addListener(mxEvent.CHANGE,Y);V.model.addListener(mxEvent.CHANGE,Y);V.addListener(mxEvent.REFRESH,Y);var da=document.createElement("div");da.className=-"geToolbarContainer geDialogToolbar";da.style.position="absolute";da.style.display="flex";da.style.bottom="0px";da.style.left="0px";da.style.right="0px";da.style.height="32px";da.style.overflow="hidden";da.style.padding="3px 4px 4px 4px";da.style.borderWidth="1px 0px 0px 0px";da.style.borderStyle="solid";da.style.whiteSpace="nowrap";if(V.isEnabled()){Z.style.bottom="32px";var ea=document.createElement("a");ea.className="geButton";var ka=ea.cloneNode(!1);ka.style.backgroundImage="url("+Editor.visibleImage+-")";ka.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(ka,"click",function(ba){V.setHiddenTags([]);mxEvent.isShiftDown(ba)||(W=V.hiddenTags.slice());P();V.refresh();mxEvent.consume(ba)});da.appendChild(ka);null!=F&&(ea=ea.cloneNode(!1),ea.style.backgroundImage="url("+Editor.plusImage+")",ea.setAttribute("title",mxResources.get("add")),mxEvent.addListener(ea,"click",function(ba){F(W,function(ha){W=ha;Y()});mxEvent.consume(ba)}),da.appendChild(ea));X.appendChild(da)}null!=K&&da.appendChild(K);-return{div:X,refresh:Y}};Graph.prototype.getCustomFonts=function(){var k=this.extFonts;k=null!=k?k.slice():[];for(var y in Graph.customFontElements){var F=Graph.customFontElements[y];k.push({name:F.name,url:F.url})}return k};Graph.prototype.setFont=function(k,y){Graph.addFont(k,y);var F=Editor.guid();document.execCommand("fontname",!1,F);for(var K=this.cellEditor.textarea.getElementsByTagName("font"),P=!1,R=0;R<K.length;R++)K[R].getAttribute("face")==F&&(P=!0,K[R].setAttribute("face",k),null!=y?K[R].setAttribute("data-font-src",-y):K[R].removeAttribute("data-font-src"));P||document.execCommand("fontname",!1,k)};var D=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return D.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var k=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=k)for(var y in k)this.globalVars[y]=+mxEvent.consume(ra)});Aa.appendChild(ua)}xa.appendChild(Aa)}ia.appendChild(xa)})(ba[fa]);aa.appendChild(ia);Y.appendChild(aa)}}var V=this,W=V.hiddenTags.slice(),X=document.createElement("div");X.style.userSelect="none";X.style.overflow="hidden";X.style.padding="10px";X.style.height="100%";var Y=document.createElement("div");Y.style.position="absolute";Y.style.boxSizing="border-box";Y.style.userSelect="none";Y.style.overflow="auto";Y.style.padding="3px";Y.style.left="0px";Y.style.right="0px";Y.style.top=+"0px";Y.style.bottom="0px";X.appendChild(Y);V.addListener(mxEvent.ROOT,function(){W=V.hiddenTags.slice()});var Z=mxUtils.bind(this,function(ba,ha){if(k()){ba=V.getAllTags();for(ha=0;ha<ba.length;ha++)0>mxUtils.indexOf(W,ba[ha])&&W.push(ba[ha]);W.sort();V.isSelectionEmpty()?T(W):T(W,V.getCommonTagsForCells(V.getSelectionCells()))}});V.selectionModel.addListener(mxEvent.CHANGE,Z);V.model.addListener(mxEvent.CHANGE,Z);V.addListener(mxEvent.REFRESH,Z);var da=document.createElement("div");da.className=+"geToolbarContainer geDialogToolbar";da.style.position="absolute";da.style.display="flex";da.style.bottom="0px";da.style.left="0px";da.style.right="0px";da.style.height="32px";da.style.overflow="hidden";da.style.padding="3px 4px 4px 4px";da.style.borderWidth="1px 0px 0px 0px";da.style.borderStyle="solid";da.style.whiteSpace="nowrap";if(V.isEnabled()){Y.style.bottom="32px";var ea=document.createElement("a");ea.className="geButton";var ka=ea.cloneNode(!1);ka.style.backgroundImage="url("+Editor.visibleImage++")";ka.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(ka,"click",function(ba){V.setHiddenTags([]);mxEvent.isShiftDown(ba)||(W=V.hiddenTags.slice());P();V.refresh();mxEvent.consume(ba)});da.appendChild(ka);null!=F&&(ea=ea.cloneNode(!1),ea.style.backgroundImage="url("+Editor.plusImage+")",ea.setAttribute("title",mxResources.get("add")),mxEvent.addListener(ea,"click",function(ba){F(W,function(ha){W=ha;Z()});mxEvent.consume(ba)}),da.appendChild(ea));X.appendChild(da)}null!=M&&da.appendChild(M);+return{div:X,refresh:Z}};Graph.prototype.getCustomFonts=function(){var k=this.extFonts;k=null!=k?k.slice():[];for(var y in Graph.customFontElements){var F=Graph.customFontElements[y];k.push({name:F.name,url:F.url})}return k};Graph.prototype.setFont=function(k,y){Graph.addFont(k,y);var F=Editor.guid();document.execCommand("fontname",!1,F);for(var M=this.cellEditor.textarea.getElementsByTagName("font"),P=!1,R=0;R<M.length;R++)M[R].getAttribute("face")==F&&(P=!0,M[R].setAttribute("face",k),null!=y?M[R].setAttribute("data-font-src",+y):M[R].removeAttribute("data-font-src"));P||document.execCommand("fontname",!1,k)};var D=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return D.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var k=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=k)for(var y in k)this.globalVars[y]=k[y]}catch(F){null!=window.console&&console.log("Error in vars URL parameter: "+F)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var C=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(k){var y=C.apply(this,arguments);null==y&&null!=this.globalVars&&(y=this.globalVars[k]);return y};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var k=this.themes["default-style2"];this.defaultStylesheet=-(new mxCodec(k.ownerDocument)).decode(k)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var A=Graph.prototype.getSvg;Graph.prototype.getSvg=function(k,y,F,K,P,R,T,V,W,X,Z,Y,da,ea,ka,ba){var ha=A.apply(this,arguments);if(null!=Y){var aa=ha.getAttribute("style");null==aa&&(aa="");Y="auto"==Y||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":Y;ha.setAttribute("style",aa+(" color-scheme: "+Y+";"))}var ia=this.getCustomFonts();-if(Z&&0<ia.length){var fa=ha.ownerDocument;aa=null!=fa.createElementNS?fa.createElementNS(mxConstants.NS_SVG,"style"):fa.createElement("style");null!=fa.setAttributeNS?aa.setAttributeNS("type","text/css"):aa.setAttribute("type","text/css");for(var ca="",Ba="",la=0;la<ia.length;la++){var xa=ia[la].name,Aa=ia[la].url;Graph.isCssFontUrl(Aa)?ca+="@import url("+Graph.rewriteGoogleFontUrl(Aa)+");\n":Ba+='@font-face {\nfont-family: "'+xa+'";\nsrc: url("'+Aa+'");\n}\n'}aa.appendChild(fa.createTextNode(ca++(new mxCodec(k.ownerDocument)).decode(k)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var A=Graph.prototype.getSvg;Graph.prototype.getSvg=function(k,y,F,M,P,R,T,V,W,X,Y,Z,da,ea,ka,ba){var ha=A.apply(this,arguments);if(null!=Z){var aa=ha.getAttribute("style");null==aa&&(aa="");Z="auto"==Z||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":Z;ha.setAttribute("style",aa+(" color-scheme: "+Z+";"))}var ia=this.getCustomFonts();+if(Y&&0<ia.length){var fa=ha.ownerDocument;aa=null!=fa.createElementNS?fa.createElementNS(mxConstants.NS_SVG,"style"):fa.createElement("style");null!=fa.setAttributeNS?aa.setAttributeNS("type","text/css"):aa.setAttribute("type","text/css");for(var ca="",Ba="",la=0;la<ia.length;la++){var xa=ia[la].name,Aa=ia[la].url;Graph.isCssFontUrl(Aa)?ca+="@import url("+Graph.rewriteGoogleFontUrl(Aa)+");\n":Ba+='@font-face {\nfont-family: "'+xa+'";\nsrc: url("'+Aa+'");\n}\n'}aa.appendChild(fa.createTextNode(ca+Ba));ha.getElementsByTagName("defs")[0].appendChild(aa)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(ha);this.mathEnabled&&(document.body.appendChild(ha),Editor.MathJaxRender(ha),ha.parentNode.removeChild(ha),aa=ha.ownerDocument.getElementById("MJX-SVG-styles"),null!=aa&&ha.getElementsByTagName("defs")[0].appendChild(aa.cloneNode(!0)));return ha};var Q=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(k){Q.apply(this,arguments);null!=k.secondLabel&&(k.secondLabel.destroy(),k.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(k){return[k.shape,k.text,k.secondLabel,k.control]};var S=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){S.apply(this,arguments);this.enumerationState=0};var U=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(k){null!=k.shape&&this.redrawEnumerationState(k);return U.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(k){k=decodeURIComponent(mxUtils.getValue(k.style,"enumerateValue",""));""==k&&(k=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(k)+"</div>"};mxGraphView.prototype.redrawEnumerationState=function(k){var y="1"==mxUtils.getValue(k.style,"enumerate",0);y&&null==k.secondLabel?(k.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),-k.secondLabel.size=12,k.secondLabel.state=k,k.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(k,k.secondLabel)):y||null==k.secondLabel||(k.secondLabel.destroy(),k.secondLabel=null);y=k.secondLabel;if(null!=y){var F=k.view.scale,K=this.createEnumerationValue(k);k=this.graph.model.isVertex(k.cell)?new mxRectangle(k.x+k.width-4*F,k.y+4*F,0,0):mxRectangle.fromPoint(k.view.getPoint(k));y.bounds.equals(k)&&y.value==K&&y.scale==F||(y.bounds=k,y.value=K,y.scale=+k.secondLabel.size=12,k.secondLabel.state=k,k.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(k,k.secondLabel)):y||null==k.secondLabel||(k.secondLabel.destroy(),k.secondLabel=null);y=k.secondLabel;if(null!=y){var F=k.view.scale,M=this.createEnumerationValue(k);k=this.graph.model.isVertex(k.cell)?new mxRectangle(k.x+k.width-4*F,k.y+4*F,0,0):mxRectangle.fromPoint(k.view.getPoint(k));y.bounds.equals(k)&&y.value==M&&y.scale==F||(y.bounds=k,y.value=M,y.scale=F,y.redraw())}};var O=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();O.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),this.view.validateBackgroundImage())};var p=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){p.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(k,y){"data:action/json,"==k.substring(0,17)&&(k=JSON.parse(k.substring(17)),null!=k.actions&&this.executeCustomActions(k.actions,null,y))};Graph.prototype.executeCustomActions=function(k,y,F){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=-!0;var K=!1,P=0,R=0,T=mxUtils.bind(this,function(){K||(K=!0,this.model.beginUpdate())}),V=mxUtils.bind(this,function(){K&&(K=!1,this.model.endUpdate())}),W=mxUtils.bind(this,function(){0<P&&P--;0==P&&X()}),X=mxUtils.bind(this,function(){if(R<k.length){var Z=this.stoppingCustomActions,Y=k[R++],da=[];if(null!=Y.open)if(V(),this.isCustomLink(Y.open)){if(!this.customLinkClicked(Y.open,F))return}else this.openLink(Y.open);null==Y.wait||Z||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=-this.pendingExecuteNextAction=null;W()}),P++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=Y.wait?parseInt(Y.wait):1E3),V());null!=Y.opacity&&null!=Y.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(Y.opacity,!0)),Y.opacity.value);null!=Y.fadeIn&&(P++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Y.fadeIn,!0)),0,1,W,Z?0:Y.fadeIn.delay));null!=Y.fadeOut&&(P++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Y.fadeOut,-!0)),1,0,W,Z?0:Y.fadeOut.delay));null!=Y.wipeIn&&(da=da.concat(this.createWipeAnimations(this.getCellsForAction(Y.wipeIn,!0),!0)));null!=Y.wipeOut&&(da=da.concat(this.createWipeAnimations(this.getCellsForAction(Y.wipeOut,!0),!1)));null!=Y.toggle&&(T(),this.toggleCells(this.getCellsForAction(Y.toggle,!0)));if(null!=Y.show){T();var ea=this.getCellsForAction(Y.show,!0);Graph.setOpacityForNodes(this.getNodesForCells(ea),1);this.setCellsVisible(ea,!0)}null!=Y.hide&&(T(),ea=this.getCellsForAction(Y.hide,-!0),Graph.setOpacityForNodes(this.getNodesForCells(ea),0),this.setCellsVisible(ea,!1));null!=Y.toggleStyle&&null!=Y.toggleStyle.key&&(T(),this.toggleCellStyles(Y.toggleStyle.key,null!=Y.toggleStyle.defaultValue?Y.toggleStyle.defaultValue:"0",this.getCellsForAction(Y.toggleStyle,!0)));null!=Y.style&&null!=Y.style.key&&(T(),this.setCellStyles(Y.style.key,Y.style.value,this.getCellsForAction(Y.style,!0)));ea=[];null!=Y.select&&this.isEnabled()&&(ea=this.getCellsForAction(Y.select),this.setSelectionCells(ea));-null!=Y.highlight&&(ea=this.getCellsForAction(Y.highlight),this.highlightCells(ea,Y.highlight.color,Y.highlight.duration,Y.highlight.opacity));null!=Y.scroll&&(ea=this.getCellsForAction(Y.scroll));null!=Y.viewbox&&this.fitWindow(Y.viewbox,Y.viewbox.border);0<ea.length&&this.scrollCellToVisible(ea[0]);null!=F&&null!=Y.explore&&Graph.exploreFromCell(this,F,Y.explore);if(null!=Y.tags){if(null!=Y.tags.toggle){var ka=Y.tags.toggle;0==ka.length&&(ka=this.getAllTags());for(ea=0;ea<ka.length;ea++)this.toggleHiddenTag(ka[ea])}ka=-null;null!=Y.tags.hidden&&(null==ka&&(ka=[]),ka=ka.concat(Y.tags.hidden));if(null!=Y.tags.visible){null==ka&&(ka=[]);var ba=this.getAllTags();for(ea=0;ea<ba.length;ea++)0>mxUtils.indexOf(Y.tags.visible,ba[ea])&&0>mxUtils.indexOf(ka,ba[ea])&&ka.push(ba[ea])}null!=ka&&this.setHiddenTags(ka);this.refresh()}0<da.length&&(P++,this.executeAnimations(da,W,Z?1:Y.steps,Z?0:Y.delay));0==P?X():V()}else this.stoppingCustomActions=this.executingCustomActions=!1,V(),null!=y&&y()});X()}};Graph.prototype.doUpdateCustomLinksForCell=-function(k,y){var F=this.getLinkForCell(y);null!=F&&"data:action/json,"==F.substring(0,17)&&this.setLinkForCell(y,this.updateCustomLink(k,F));if(this.isHtmlLabel(y)){var K=document.createElement("div");K.innerHTML=Graph.sanitizeHtml(this.getLabel(y));for(var P=K.getElementsByTagName("a"),R=!1,T=0;T<P.length;T++)F=P[T].getAttribute("href"),null!=F&&"data:action/json,"==F.substring(0,17)&&(P[T].setAttribute("href",this.updateCustomLink(k,F)),R=!0);R&&this.labelChanged(y,K.innerHTML)}};Graph.prototype.updateCustomLink=-function(k,y){if("data:action/json,"==y.substring(0,17))try{var F=JSON.parse(y.substring(17));null!=F.actions&&(this.updateCustomLinkActions(k,F.actions),y="data:action/json,"+JSON.stringify(F))}catch(K){}return y};Graph.prototype.updateCustomLinkActions=function(k,y){for(var F=0;F<y.length;F++){var K=y[F],P;for(P in K)this.updateCustomLinkAction(k,K[P],"cells"),this.updateCustomLinkAction(k,K[P],"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(k,y,F){if(null!=y&&null!=y[F]){for(var K=-[],P=0;P<y[F].length;P++)if("*"==y[F][P])K.push(y[F][P]);else{var R=k[y[F][P]];null!=R?""!=R&&K.push(R):K.push(y[F][P])}y[F]=K}};Graph.prototype.getCellsForAction=function(k,y){y=this.getCellsById(k.cells).concat(this.getCellsForTags(k.tags,null,y));if(null!=k.excludeCells){for(var F=[],K=0;K<y.length;K++)0>k.excludeCells.indexOf(y[K].id)&&F.push(y[K]);y=F}return y};Graph.prototype.getCellsById=function(k){var y=[];if(null!=k)for(var F=0;F<k.length;F++)if("*"==k[F]){var K=this.model.getRoot();y=y.concat(this.model.filterDescendants(function(R){return R!=-K},K))}else{var P=this.model.getCell(k[F]);null!=P&&y.push(P)}return y};var q=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(k){return q.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(k))};Graph.prototype.setHiddenTags=function(k){this.hiddenTags=k;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(k){var y=mxUtils.indexOf(this.hiddenTags,k);0>y?this.hiddenTags.push(k):0<=y&&this.hiddenTags.splice(y,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};-Graph.prototype.isAllTagsHidden=function(k){if(null==k||0==k.length||0==this.hiddenTags.length)return!1;k=k.split(" ");if(k.length>this.hiddenTags.length)return!1;for(var y=0;y<k.length;y++)if(0>mxUtils.indexOf(this.hiddenTags,k[y]))return!1;return!0};Graph.prototype.getCellsForTags=function(k,y,F,K){var P=[];if(null!=k){y=null!=y?y:this.model.getDescendants(this.model.getRoot());for(var R=0,T={},V=0;V<k.length;V++)0<k[V].length&&(T[k[V]]=!0,R++);for(V=0;V<y.length;V++)if(F&&this.model.getParent(y[V])==-this.model.root||this.model.isVertex(y[V])||this.model.isEdge(y[V])){var W=this.getTagsForCell(y[V]),X=!1;if(0<W.length&&(W=W.split(" "),W.length>=k.length)){for(var Z=X=0;Z<W.length&&X<R;Z++)null!=T[W[Z]]&&X++;X=X==R}X&&(1!=K||this.isCellVisible(y[V]))&&P.push(y[V])}}return P};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(k){for(var y=null,F=[],K=0;K<k.length;K++){var P=this.getTagsForCell(k[K]);-F=[];if(0<P.length){P=P.split(" ");for(var R={},T=0;T<P.length;T++)if(null==y||null!=y[P[T]])R[P[T]]=!0,F.push(P[T]);y=R}else return[]}return F};Graph.prototype.getTagsForCells=function(k){for(var y=[],F={},K=0;K<k.length;K++){var P=this.getTagsForCell(k[K]);if(0<P.length){P=P.split(" ");for(var R=0;R<P.length;R++)null==F[P[R]]&&(F[P[R]]=!0,y.push(P[R]))}}return y};Graph.prototype.getTagsForCell=function(k){return this.getAttributeForCell(k,"tags","")};Graph.prototype.addTagsForCells=function(k,y){if(0<-k.length&&0<y.length){this.model.beginUpdate();try{for(var F=0;F<k.length;F++){for(var K=this.getTagsForCell(k[F]),P=K.split(" "),R=!1,T=0;T<y.length;T++){var V=mxUtils.trim(y[T]);""!=V&&0>mxUtils.indexOf(P,V)&&(K=0<K.length?K+" "+V:V,R=!0)}R&&this.setAttributeForCell(k[F],"tags",K)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(k,y){if(0<k.length&&0<y.length){this.model.beginUpdate();try{for(var F=0;F<k.length;F++){var K=this.getTagsForCell(k[F]);if(0<K.length){for(var P=-K.split(" "),R=!1,T=0;T<y.length;T++){var V=mxUtils.indexOf(P,y[T]);0<=V&&(P.splice(V,1),R=!0)}R&&this.setAttributeForCell(k[F],"tags",P.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(k){this.model.beginUpdate();try{for(var y=0;y<k.length;y++)this.model.setVisible(k[y],!this.model.isVisible(k[y]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(k,y){this.model.beginUpdate();try{for(var F=0;F<k.length;F++)this.model.setVisible(k[F],y)}finally{this.model.endUpdate()}};-Graph.prototype.highlightCells=function(k,y,F,K){for(var P=0;P<k.length;P++)this.highlightCell(k[P],y,F,K)};Graph.prototype.highlightCell=function(k,y,F,K,P){y=null!=y?y:mxConstants.DEFAULT_VALID_COLOR;F=null!=F?F:1E3;k=this.view.getState(k);var R=null;null!=k&&(P=null!=P?P:4,P=Math.max(P+1,mxUtils.getValue(k.style,mxConstants.STYLE_STROKEWIDTH,1)+P),R=new mxCellHighlight(this,y,P,!1),null!=K&&(R.opacity=K),R.highlight(k),window.setTimeout(function(){null!=R.shape&&(mxUtils.setPrefixedStyle(R.shape.node.style,-"transition","all 1200ms ease-in-out"),R.shape.node.style.opacity=0);window.setTimeout(function(){R.destroy()},1200)},F));return R};Graph.prototype.addSvgShadow=function(k,y,F,K){F=null!=F?F:!1;K=null!=K?K:!0;var P=k.ownerDocument,R=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"filter"):P.createElement("filter");R.setAttribute("id",this.shadowId);var T=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):P.createElement("feGaussianBlur");T.setAttribute("in",+!0;var M=!1,P=0,R=0,T=mxUtils.bind(this,function(){M||(M=!0,this.model.beginUpdate())}),V=mxUtils.bind(this,function(){M&&(M=!1,this.model.endUpdate())}),W=mxUtils.bind(this,function(){0<P&&P--;0==P&&X()}),X=mxUtils.bind(this,function(){if(R<k.length){var Y=this.stoppingCustomActions,Z=k[R++],da=[];if(null!=Z.open)if(V(),this.isCustomLink(Z.open)){if(!this.customLinkClicked(Z.open,F))return}else this.openLink(Z.open);null==Z.wait||Y||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=+this.pendingExecuteNextAction=null;W()}),P++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=Z.wait?parseInt(Z.wait):1E3),V());null!=Z.opacity&&null!=Z.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(Z.opacity,!0)),Z.opacity.value);null!=Z.fadeIn&&(P++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Z.fadeIn,!0)),0,1,W,Y?0:Z.fadeIn.delay));null!=Z.fadeOut&&(P++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(Z.fadeOut,+!0)),1,0,W,Y?0:Z.fadeOut.delay));null!=Z.wipeIn&&(da=da.concat(this.createWipeAnimations(this.getCellsForAction(Z.wipeIn,!0),!0)));null!=Z.wipeOut&&(da=da.concat(this.createWipeAnimations(this.getCellsForAction(Z.wipeOut,!0),!1)));null!=Z.toggle&&(T(),this.toggleCells(this.getCellsForAction(Z.toggle,!0)));if(null!=Z.show){T();var ea=this.getCellsForAction(Z.show,!0);Graph.setOpacityForNodes(this.getNodesForCells(ea),1);this.setCellsVisible(ea,!0)}null!=Z.hide&&(T(),ea=this.getCellsForAction(Z.hide,+!0),Graph.setOpacityForNodes(this.getNodesForCells(ea),0),this.setCellsVisible(ea,!1));null!=Z.toggleStyle&&null!=Z.toggleStyle.key&&(T(),this.toggleCellStyles(Z.toggleStyle.key,null!=Z.toggleStyle.defaultValue?Z.toggleStyle.defaultValue:"0",this.getCellsForAction(Z.toggleStyle,!0)));null!=Z.style&&null!=Z.style.key&&(T(),this.setCellStyles(Z.style.key,Z.style.value,this.getCellsForAction(Z.style,!0)));ea=[];null!=Z.select&&this.isEnabled()&&(ea=this.getCellsForAction(Z.select),this.setSelectionCells(ea));+null!=Z.highlight&&(ea=this.getCellsForAction(Z.highlight),this.highlightCells(ea,Z.highlight.color,Z.highlight.duration,Z.highlight.opacity));null!=Z.scroll&&(ea=this.getCellsForAction(Z.scroll));null!=Z.viewbox&&this.fitWindow(Z.viewbox,Z.viewbox.border);0<ea.length&&this.scrollCellToVisible(ea[0]);null!=F&&null!=Z.explore&&Graph.exploreFromCell(this,F,Z.explore);if(null!=Z.tags){if(null!=Z.tags.toggle){var ka=Z.tags.toggle;0==ka.length&&(ka=this.getAllTags());for(ea=0;ea<ka.length;ea++)this.toggleHiddenTag(ka[ea])}ka=+null;null!=Z.tags.hidden&&(null==ka&&(ka=[]),ka=ka.concat(Z.tags.hidden));if(null!=Z.tags.visible){null==ka&&(ka=[]);var ba=this.getAllTags();for(ea=0;ea<ba.length;ea++)0>mxUtils.indexOf(Z.tags.visible,ba[ea])&&0>mxUtils.indexOf(ka,ba[ea])&&ka.push(ba[ea])}null!=ka&&this.setHiddenTags(ka);this.refresh()}0<da.length&&(P++,this.executeAnimations(da,W,Y?1:Z.steps,Y?0:Z.delay));0==P?X():V()}else this.stoppingCustomActions=this.executingCustomActions=!1,V(),null!=y&&y()});X()}};Graph.prototype.doUpdateCustomLinksForCell=+function(k,y){var F=this.getLinkForCell(y);null!=F&&"data:action/json,"==F.substring(0,17)&&this.setLinkForCell(y,this.updateCustomLink(k,F));if(this.isHtmlLabel(y)){var M=document.createElement("div");M.innerHTML=Graph.sanitizeHtml(this.getLabel(y));for(var P=M.getElementsByTagName("a"),R=!1,T=0;T<P.length;T++)F=P[T].getAttribute("href"),null!=F&&"data:action/json,"==F.substring(0,17)&&(P[T].setAttribute("href",this.updateCustomLink(k,F)),R=!0);R&&this.labelChanged(y,M.innerHTML)}};Graph.prototype.updateCustomLink=+function(k,y){if("data:action/json,"==y.substring(0,17))try{var F=JSON.parse(y.substring(17));null!=F.actions&&(this.updateCustomLinkActions(k,F.actions),y="data:action/json,"+JSON.stringify(F))}catch(M){}return y};Graph.prototype.updateCustomLinkActions=function(k,y){for(var F=0;F<y.length;F++){var M=y[F],P;for(P in M)this.updateCustomLinkAction(k,M[P],"cells"),this.updateCustomLinkAction(k,M[P],"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(k,y,F){if(null!=y&&null!=y[F]){for(var M=+[],P=0;P<y[F].length;P++)if("*"==y[F][P])M.push(y[F][P]);else{var R=k[y[F][P]];null!=R?""!=R&&M.push(R):M.push(y[F][P])}y[F]=M}};Graph.prototype.getCellsForAction=function(k,y){y=this.getCellsById(k.cells).concat(this.getCellsForTags(k.tags,null,y));if(null!=k.excludeCells){for(var F=[],M=0;M<y.length;M++)0>k.excludeCells.indexOf(y[M].id)&&F.push(y[M]);y=F}return y};Graph.prototype.getCellsById=function(k){var y=[];if(null!=k)for(var F=0;F<k.length;F++)if("*"==k[F]){var M=this.model.getRoot();y=y.concat(this.model.filterDescendants(function(R){return R!=+M},M))}else{var P=this.model.getCell(k[F]);null!=P&&y.push(P)}return y};var q=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(k){return q.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(k))};Graph.prototype.setHiddenTags=function(k){this.hiddenTags=k;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(k){var y=mxUtils.indexOf(this.hiddenTags,k);0>y?this.hiddenTags.push(k):0<=y&&this.hiddenTags.splice(y,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};+Graph.prototype.isAllTagsHidden=function(k){if(null==k||0==k.length||0==this.hiddenTags.length)return!1;k=k.split(" ");if(k.length>this.hiddenTags.length)return!1;for(var y=0;y<k.length;y++)if(0>mxUtils.indexOf(this.hiddenTags,k[y]))return!1;return!0};Graph.prototype.getCellsForTags=function(k,y,F,M){var P=[];if(null!=k){y=null!=y?y:this.model.getDescendants(this.model.getRoot());for(var R=0,T={},V=0;V<k.length;V++)0<k[V].length&&(T[k[V]]=!0,R++);for(V=0;V<y.length;V++)if(F&&this.model.getParent(y[V])==+this.model.root||this.model.isVertex(y[V])||this.model.isEdge(y[V])){var W=this.getTagsForCell(y[V]),X=!1;if(0<W.length&&(W=W.split(" "),W.length>=k.length)){for(var Y=X=0;Y<W.length&&X<R;Y++)null!=T[W[Y]]&&X++;X=X==R}X&&(1!=M||this.isCellVisible(y[V]))&&P.push(y[V])}}return P};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(k){for(var y=null,F=[],M=0;M<k.length;M++){var P=this.getTagsForCell(k[M]);+F=[];if(0<P.length){P=P.split(" ");for(var R={},T=0;T<P.length;T++)if(null==y||null!=y[P[T]])R[P[T]]=!0,F.push(P[T]);y=R}else return[]}return F};Graph.prototype.getTagsForCells=function(k){for(var y=[],F={},M=0;M<k.length;M++){var P=this.getTagsForCell(k[M]);if(0<P.length){P=P.split(" ");for(var R=0;R<P.length;R++)null==F[P[R]]&&(F[P[R]]=!0,y.push(P[R]))}}return y};Graph.prototype.getTagsForCell=function(k){return this.getAttributeForCell(k,"tags","")};Graph.prototype.addTagsForCells=function(k,y){if(0<+k.length&&0<y.length){this.model.beginUpdate();try{for(var F=0;F<k.length;F++){for(var M=this.getTagsForCell(k[F]),P=M.split(" "),R=!1,T=0;T<y.length;T++){var V=mxUtils.trim(y[T]);""!=V&&0>mxUtils.indexOf(P,V)&&(M=0<M.length?M+" "+V:V,R=!0)}R&&this.setAttributeForCell(k[F],"tags",M)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(k,y){if(0<k.length&&0<y.length){this.model.beginUpdate();try{for(var F=0;F<k.length;F++){var M=this.getTagsForCell(k[F]);if(0<M.length){for(var P=+M.split(" "),R=!1,T=0;T<y.length;T++){var V=mxUtils.indexOf(P,y[T]);0<=V&&(P.splice(V,1),R=!0)}R&&this.setAttributeForCell(k[F],"tags",P.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(k){this.model.beginUpdate();try{for(var y=0;y<k.length;y++)this.model.setVisible(k[y],!this.model.isVisible(k[y]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(k,y){this.model.beginUpdate();try{for(var F=0;F<k.length;F++)this.model.setVisible(k[F],y)}finally{this.model.endUpdate()}};+Graph.prototype.highlightCells=function(k,y,F,M){for(var P=0;P<k.length;P++)this.highlightCell(k[P],y,F,M)};Graph.prototype.highlightCell=function(k,y,F,M,P){y=null!=y?y:mxConstants.DEFAULT_VALID_COLOR;F=null!=F?F:1E3;k=this.view.getState(k);var R=null;null!=k&&(P=null!=P?P:4,P=Math.max(P+1,mxUtils.getValue(k.style,mxConstants.STYLE_STROKEWIDTH,1)+P),R=new mxCellHighlight(this,y,P,!1),null!=M&&(R.opacity=M),R.highlight(k),window.setTimeout(function(){null!=R.shape&&(mxUtils.setPrefixedStyle(R.shape.node.style,+"transition","all 1200ms ease-in-out"),R.shape.node.style.opacity=0);window.setTimeout(function(){R.destroy()},1200)},F));return R};Graph.prototype.addSvgShadow=function(k,y,F,M){F=null!=F?F:!1;M=null!=M?M:!0;var P=k.ownerDocument,R=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"filter"):P.createElement("filter");R.setAttribute("id",this.shadowId);var T=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):P.createElement("feGaussianBlur");T.setAttribute("in","SourceAlpha");T.setAttribute("stdDeviation",this.svgShadowBlur);T.setAttribute("result","blur");R.appendChild(T);T=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feOffset"):P.createElement("feOffset");T.setAttribute("in","blur");T.setAttribute("dx",this.svgShadowSize);T.setAttribute("dy",this.svgShadowSize);T.setAttribute("result","offsetBlur");R.appendChild(T);T=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feFlood"):P.createElement("feFlood");T.setAttribute("flood-color",this.svgShadowColor);T.setAttribute("flood-opacity",this.svgShadowOpacity);T.setAttribute("result","offsetColor");R.appendChild(T);T=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feComposite"):P.createElement("feComposite");T.setAttribute("in","offsetColor");T.setAttribute("in2","offsetBlur");T.setAttribute("operator","in");T.setAttribute("result","offsetBlur");R.appendChild(T);T=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feBlend"):P.createElement("feBlend");T.setAttribute("in",-"SourceGraphic");T.setAttribute("in2","offsetBlur");R.appendChild(T);T=k.getElementsByTagName("defs");0==T.length?(P=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"defs"):P.createElement("defs"),null!=k.firstChild?k.insertBefore(P,k.firstChild):k.appendChild(P)):P=T[0];P.appendChild(R);F||(y=null!=y?y:k.getElementsByTagName("g")[0],null!=y&&(y.setAttribute("filter","url(#"+this.shadowId+")"),!isNaN(parseInt(k.getAttribute("width")))&&K&&(k.setAttribute("width",parseInt(k.getAttribute("width"))++"SourceGraphic");T.setAttribute("in2","offsetBlur");R.appendChild(T);T=k.getElementsByTagName("defs");0==T.length?(P=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"defs"):P.createElement("defs"),null!=k.firstChild?k.insertBefore(P,k.firstChild):k.appendChild(P)):P=T[0];P.appendChild(R);F||(y=null!=y?y:k.getElementsByTagName("g")[0],null!=y&&(y.setAttribute("filter","url(#"+this.shadowId+")"),!isNaN(parseInt(k.getAttribute("width")))&&M&&(k.setAttribute("width",parseInt(k.getAttribute("width"))+6),k.setAttribute("height",parseInt(k.getAttribute("height"))+6),y=k.getAttribute("viewBox"),null!=y&&0<y.length&&(y=y.split(" "),3<y.length&&(w=parseFloat(y[2])+6,h=parseFloat(y[3])+6,k.setAttribute("viewBox",y[0]+" "+y[1]+" "+w+" "+h))))));return R};Graph.prototype.setShadowVisible=function(k,y){mxClient.IS_SVG&&!mxClient.IS_SF&&(y=null!=y?y:!0,(this.shadowVisible=k)?this.view.getDrawPane().setAttribute("filter","url(#"+this.shadowId+")"):this.view.getDrawPane().removeAttribute("filter"),y&&this.fireEvent(new mxEventObject("shadowVisibleChanged")))};Graph.prototype.checkDefaultParent=function(){null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var k=this.model.getChildCount(this.model.root),y=0;do var F=this.model.getChildAt(this.model.root,y);while(y++<k&&"1"==mxUtils.getValue(this.getCellStyle(F),"locked","0"));null!=F&&this.setDefaultParent(F)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=@@ -12935,15 +12939,15 @@ mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupN[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=[SHAPES_PATH+"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=[STENCIL_PATH+"/salesforce.xml"];mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(k){var y=null;null!=k&&0<k.length&&("ER"==k.substring(0,2)?y="mxgraph.er":"sysML"==k.substring(0,5)&&(y="mxgraph.sysml"));return y};var G=-mxMarker.createMarker;mxMarker.createMarker=function(k,y,F,K,P,R,T,V,W,X){if(null!=F&&null==mxMarker.markers[F]){var Z=this.getPackageForType(F);null!=Z&&mxStencilRegistry.getStencil(Z)}return G.apply(this,arguments)};var E=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(k,y,F,K,P,R){"1"==mxUtils.getValue(y.style,"lineShape",null)&&k.setFillColor(mxUtils.getValue(y.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return E.apply(this,arguments)};PrintDialog.prototype.create=function(k,-y,F,K){function P(){ka.value=Math.max(1,Math.min(Z,Math.max(parseInt(ka.value),parseInt(ea.value))));ea.value=Math.max(1,Math.min(Z,Math.min(parseInt(ka.value),parseInt(ea.value))))}function R(Da){k.lastPrintPagesRadioChecked=da.checked;k.lastPrintSelectionOnlyChecked=ha.checked;k.lastPrintCropRadioChecked=ia.checked;k.lastPrintFitRadioChecked=fa.checked;da.checked&&ea.value<ka.value?(k.lastPrintPagesFromInput=ea.value,k.lastPrintPagesToInput=ka.value):(k.lastPrintPagesFromInput=null,k.lastPrintPagesToInput=+mxMarker.createMarker;mxMarker.createMarker=function(k,y,F,M,P,R,T,V,W,X){if(null!=F&&null==mxMarker.markers[F]){var Y=this.getPackageForType(F);null!=Y&&mxStencilRegistry.getStencil(Y)}return G.apply(this,arguments)};var E=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(k,y,F,M,P,R){"1"==mxUtils.getValue(y.style,"lineShape",null)&&k.setFillColor(mxUtils.getValue(y.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return E.apply(this,arguments)};PrintDialog.prototype.create=function(k,+y,F,M){function P(){ka.value=Math.max(1,Math.min(Y,Math.max(parseInt(ka.value),parseInt(ea.value))));ea.value=Math.max(1,Math.min(Y,Math.min(parseInt(ka.value),parseInt(ea.value))))}function R(Da){k.lastPrintPagesRadioChecked=da.checked;k.lastPrintSelectionOnlyChecked=ha.checked;k.lastPrintCropRadioChecked=ia.checked;k.lastPrintFitRadioChecked=fa.checked;da.checked&&ea.value<ka.value?(k.lastPrintPagesFromInput=ea.value,k.lastPrintPagesToInput=ka.value):(k.lastPrintPagesFromInput=null,k.lastPrintPagesToInput=null);ya.value=Math.max(1,Math.min(1600,parseInt(ya.value)))+"%";k.lastPrintZoom=ya.value;k.lastPrintBorder=va.value;k.lastPrintGrid=za.checked;k.lastPrintTransparent=Ga.checked;k.lastPrintInclude=Ca.checked;k.lastPrintSheetsAcross=oa.value;k.lastPrintSheetsDown=Ea.value;var wa={};wa.border=parseInt(va.value);wa.scale=parseInt(ya.value)/100;wa.grid=za.checked;wa.transparent=Ga.checked;wa.includeCopy=Ca.checked;wa.sheetsAcross=parseInt(oa.value);wa.sheetsDown=parseInt(Ea.value);wa.pagesFrom=parseInt(ea.value);-wa.pagesTo=parseInt(ka.value);wa.allPages=Y.checked;wa.selection=ha.checked;wa.pageView=aa.checked;wa.crop=ia.checked;wa.fit=fa.checked;return null!=F?F(!Da,wa):k.print(!Da,wa)}var T=k.editor.graph,V=document.createElement("div"),W=document.createElement("h3");W.style.width="100%";W.style.textAlign="center";W.style.marginTop="0px";mxUtils.write(W,y||mxResources.get("print"));V.appendChild(W);var X=1,Z=1;W=document.createElement("div");W.style.whiteSpace="nowrap";var Y=document.createElement("input");-Y.style.marginRight="8px";Y.style.marginBottom="8px";Y.setAttribute("type","radio");Y.setAttribute("name","pages-printdialog");W.appendChild(Y);y=document.createElement("span");mxUtils.write(y,mxResources.get("allPages"));mxEvent.addListener(y,"click",function(){Y.checked=!0});W.appendChild(y);mxUtils.br(W);var da=Y.cloneNode(!0);W.appendChild(da);y=document.createElement("span");mxUtils.write(y,mxResources.get("pages")+":");W.appendChild(y);mxEvent.addListener(y,"click",function(){da.checked=!0});+wa.pagesTo=parseInt(ka.value);wa.allPages=Z.checked;wa.selection=ha.checked;wa.pageView=aa.checked;wa.crop=ia.checked;wa.fit=fa.checked;return null!=F?F(!Da,wa):k.print(!Da,wa)}var T=k.editor.graph,V=document.createElement("div"),W=document.createElement("h3");W.style.width="100%";W.style.textAlign="center";W.style.marginTop="0px";mxUtils.write(W,y||mxResources.get("print"));V.appendChild(W);var X=1,Y=1;W=document.createElement("div");W.style.whiteSpace="nowrap";var Z=document.createElement("input");+Z.style.marginRight="8px";Z.style.marginBottom="8px";Z.setAttribute("type","radio");Z.setAttribute("name","pages-printdialog");W.appendChild(Z);y=document.createElement("span");mxUtils.write(y,mxResources.get("allPages"));mxEvent.addListener(y,"click",function(){Z.checked=!0});W.appendChild(y);mxUtils.br(W);var da=Z.cloneNode(!0);W.appendChild(da);y=document.createElement("span");mxUtils.write(y,mxResources.get("pages")+":");W.appendChild(y);mxEvent.addListener(y,"click",function(){da.checked=!0});var ea=document.createElement("input");ea.style.margin="0 4px";ea.setAttribute("value","1");ea.setAttribute("type","number");ea.setAttribute("min","1");ea.style.width="40px";W.appendChild(ea);y=document.createElement("span");mxUtils.write(y,mxResources.get("to"));W.appendChild(y);var ka=ea.cloneNode(!0);W.appendChild(ka);mxEvent.addListener(ea,"focus",function(){da.checked=!0});mxEvent.addListener(ka,"focus",function(){da.checked=!0});mxEvent.addListener(ea,"change",P);mxEvent.addListener(ka,"change",-P);if(null!=k.pages&&(Z=k.pages.length,null!=k.currentPage))for(var ba=0;ba<Z;ba++)if(k.currentPage==k.pages[ba]){X=ba+1;break}null!=k.lastPrintPagesFromInput&&null!=k.lastPrintPagesToInput?(ea.value=Math.min(Z,Math.max(1,k.lastPrintPagesFromInput)),ka.value=Math.min(Z,Math.max(1,k.lastPrintPagesToInput))):(ea.value=X,ka.value=X);ea.setAttribute("max",Z);ka.setAttribute("max",Z);ba=mxUtils.button(mxResources.get("currentPage"),function(Da){ea.value=X;ka.value=X;da.checked=!0});ba.setAttribute("title",-mxResources.get("currentPage"));ba.style.marginLeft="4px";ba.style.maxWidth="100px";ba.style.overflow="hidden";ba.style.textOverflow="ellipsis";ba.style.whiteSpace="nowrap";W.appendChild(ba);1<Z&&V.appendChild(W);W=document.createElement("div");W.style.borderBottom="1px solid lightGray";W.style.paddingBottom="12px";W.style.marginBottom="12px";W.style.whiteSpace="nowrap";var ha=document.createElement("input");ha.setAttribute("name","pages-printdialog");ha.setAttribute("type",1==Z?"checkbox":"radio");-ha.style.marginRight="8px";T.isSelectionEmpty()&&ha.setAttribute("disabled","disabled");T.isEnabled()&&(W.appendChild(ha),y=document.createElement("span"),mxUtils.write(y,mxResources.get("selectionOnly")),W.appendChild(y));(T.isEnabled()||1<Z)&&V.appendChild(W);!k.isPagesEnabled()||k.lastPrintPagesRadioChecked?da.checked=!0:!T.isSelectionEmpty()&&k.lastPrintSelectionOnlyChecked?ha.checked=!0:Y.checked=!0;T.isSelectionEmpty()||mxEvent.addListener(y,"click",function(){ha.checked=!ha.checked});T=document.createElement("div");+P);if(null!=k.pages&&(Y=k.pages.length,null!=k.currentPage))for(var ba=0;ba<Y;ba++)if(k.currentPage==k.pages[ba]){X=ba+1;break}null!=k.lastPrintPagesFromInput&&null!=k.lastPrintPagesToInput?(ea.value=Math.min(Y,Math.max(1,k.lastPrintPagesFromInput)),ka.value=Math.min(Y,Math.max(1,k.lastPrintPagesToInput))):(ea.value=X,ka.value=X);ea.setAttribute("max",Y);ka.setAttribute("max",Y);ba=mxUtils.button(mxResources.get("currentPage"),function(Da){ea.value=X;ka.value=X;da.checked=!0});ba.setAttribute("title",+mxResources.get("currentPage"));ba.style.marginLeft="4px";ba.style.maxWidth="100px";ba.style.overflow="hidden";ba.style.textOverflow="ellipsis";ba.style.whiteSpace="nowrap";W.appendChild(ba);1<Y&&V.appendChild(W);W=document.createElement("div");W.style.borderBottom="1px solid lightGray";W.style.paddingBottom="12px";W.style.marginBottom="12px";W.style.whiteSpace="nowrap";var ha=document.createElement("input");ha.setAttribute("name","pages-printdialog");ha.setAttribute("type",1==Y?"checkbox":"radio");+ha.style.marginRight="8px";T.isSelectionEmpty()&&ha.setAttribute("disabled","disabled");T.isEnabled()&&(W.appendChild(ha),y=document.createElement("span"),mxUtils.write(y,mxResources.get("selectionOnly")),W.appendChild(y));(T.isEnabled()||1<Y)&&V.appendChild(W);!k.isPagesEnabled()||k.lastPrintPagesRadioChecked?da.checked=!0:!T.isSelectionEmpty()&&k.lastPrintSelectionOnlyChecked?ha.checked=!0:Z.checked=!0;T.isSelectionEmpty()||mxEvent.addListener(y,"click",function(){ha.checked=!ha.checked});T=document.createElement("div");T.style.whiteSpace="nowrap";var aa=document.createElement("input");aa.style.marginBottom="8px";aa.style.marginRight="8px";aa.setAttribute("type","radio");aa.setAttribute("name","printSize");T.appendChild(aa);y=document.createElement("span");mxUtils.write(y,mxResources.get("pageView"));T.appendChild(y);mxEvent.addListener(T,"click",function(){aa.checked=!0});V.appendChild(T);T=document.createElement("div");T.style.whiteSpace="nowrap";var ia=document.createElement("input");ia.style.marginBottom="8px";ia.style.marginRight="8px";ia.setAttribute("type","radio");ia.setAttribute("name","printSize");T.appendChild(ia);y=document.createElement("span");mxUtils.write(y,mxResources.get("crop"));T.appendChild(y);mxEvent.addListener(T,"click",function(){ia.checked=!0});V.appendChild(T);T=document.createElement("div");T.style.whiteSpace="nowrap";var fa=document.createElement("input");fa.style.marginBottom="8px";fa.style.marginRight="8px";fa.setAttribute("type","radio");fa.setAttribute("name","printSize");y=document.createElement("div");y.style.display="inline-block";y.style.verticalAlign="top";y.style.paddingTop="2px";y.appendChild(fa);T.appendChild(y);W=document.createElement("table");W.style.display="inline-block";W.style.borderSpacing="0";ba=document.createElement("tbody");var ca=document.createElement("tr"),Ba=ca.cloneNode(!0),la=document.createElement("td"),xa=la.cloneNode(!0),Aa=la.cloneNode(!0),ma=la.cloneNode(!0),ua=la.cloneNode(!0),ra=la.cloneNode(!0);la.style.textAlign="right";ma.style.textAlign=@@ -12954,13 +12958,13 @@ ca.appendChild(xa);ca.appendChild(Aa);Ba.appendChild(ma);Ba.appendChild(ua);Ba.a"checkbox");za.style.marginTop="12px";za.checked=null!=k.lastPrintGrid?k.lastPrintGrid:!1;T.appendChild(za);y=document.createElement("span");y.style.marginLeft="4px";y.style.marginRight="8px";mxUtils.write(y,mxResources.get("grid"));T.appendChild(y);mxEvent.addListener(y,"click",function(Da){za.checked=!0;mxEvent.consume(Da)});var Ga=document.createElement("input");Ga.setAttribute("type","checkbox");Ga.style.marginTop="10px";Ga.checked=null!=k.lastPrintTransparent?k.lastPrintTransparent:!1;null!=F&&(T.appendChild(Ga),y=document.createElement("span"),y.style.marginLeft="4px",mxUtils.write(y,mxResources.get("transparentBackground")),T.appendChild(y),mxEvent.addListener(y,"click",function(Da){Ga.checked=!0;mxEvent.consume(Da)}));var Ca=document.createElement("input");Ca.setAttribute("type","checkbox");Ca.style.marginTop="10px";Ca.checked=null!=k.lastPrintInclude?k.lastPrintInclude:Editor.defaultIncludeDiagram;null==F||mxClient.IS_CHROMEAPP||"draw.io"!=k.getServiceName()||(mxUtils.br(T),T.appendChild(Ca),y=document.createElement("span"),y.style.marginLeft="4px",mxUtils.write(y,mxResources.get("includeCopyOfMyDiagram")),T.appendChild(y),mxEvent.addListener(y,"click",function(Da){Ca.checked=!0;mxEvent.consume(Da)}));V.appendChild(T);y=document.createElement("div");y.style.marginTop="40px";y.style.textAlign="right";y.style.whiteSpace="nowrap";k.isOffline()||null!=F||y.appendChild(k.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));T=mxUtils.button(mxResources.get("cancel"),function(){k.hideDialog()});-T.className="geBtn";k.editor.cancelFirst&&y.appendChild(T);PrintDialog.previewEnabled&&null==F&&(W=mxUtils.button(mxResources.get("preview"),function(){try{k.hideDialog(),R(!1)}catch(Da){k.handleError(Da)}}),W.className="geBtn",y.appendChild(W));K=null!=K?K:null!=F?"export":PrintDialog.previewEnabled?"print":"ok";K=mxUtils.button(mxResources.get(K),function(){try{k.hideDialog(),R(!0)}catch(Da){k.handleError(Da)}});K.className="geBtn gePrimaryBtn";y.appendChild(K);k.editor.cancelFirst||y.appendChild(T);+T.className="geBtn";k.editor.cancelFirst&&y.appendChild(T);PrintDialog.previewEnabled&&null==F&&(W=mxUtils.button(mxResources.get("preview"),function(){try{k.hideDialog(),R(!1)}catch(Da){k.handleError(Da)}}),W.className="geBtn",y.appendChild(W));M=null!=M?M:null!=F?"export":PrintDialog.previewEnabled?"print":"ok";M=mxUtils.button(mxResources.get(M),function(){try{k.hideDialog(),R(!0)}catch(Da){k.handleError(Da)}});M.className="geBtn gePrimaryBtn";y.appendChild(M);k.editor.cancelFirst||y.appendChild(T);V.appendChild(y);if(k.editor.isChromelessView()){var Ka=function(){Editor.isDarkMode()?(V.classList.add("geDarkMode"),V.style.colorScheme="dark"):(V.classList.remove("geDarkMode"),V.style.colorScheme="light")};k.addListener("darkModeChanged",Ka);Ka();var Ma=function(Da,wa){Da=wa.getProperty("dialog");V.parentNode==Da.container&&(k.editor.removeListener(Ma),k.removeListener(Ka))};k.editor.addListener("hideDialog",Ma)}this.container=V};var H=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);if(this.page!=this.ui.currentPage){if(null!=this.page.viewState){this.ignoreColor||(this.page.viewState.background=this.color);if(!this.ignoreImage){var k=this.image;null!=k&&null!=k.src&&Graph.isPageLink(k.src)&&(k={originalSrc:k.src});this.page.viewState.backgroundImage=k}null!=this.format&&(this.page.viewState.pageFormat=this.format);null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled);null!=this.adaptiveColors&&(this.page.viewState.adaptiveColors=this.adaptiveColors);null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)}}else H.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.adaptiveColors&&this.adaptiveColors!=this.ui.editor.graph.adaptiveColors&&(k=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=-null!=k?k:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible)};Editor.prototype.useCanvasForExport=!1;try{var M=document.createElement("canvas"),L=new Image;L.onload=function(){try{M.getContext("2d").drawImage(L,0,0);var k=M.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=k&&6<k.length}catch(y){}};L.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(k){}Editor.prototype.useCanvasForExport=+null!=k?k:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible)};Editor.prototype.useCanvasForExport=!1;try{var L=document.createElement("canvas"),K=new Image;K.onload=function(){try{L.getContext("2d").drawImage(K,0,0);var k=L.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=k&&6<k.length}catch(y){}};K.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(k){}Editor.prototype.useCanvasForExport=!1})();(function(){var b=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);b.beforeDecode=function(f,m,d){d.ui=f.ui;return m};b.afterDecode=function(f,m,d){d.previousColor=d.color;d.previousImage=d.image;d.previousFormat=d.format;d.previousAdaptiveColors=d.adaptiveColors;null!=d.foldingEnabled&&(d.foldingEnabled=!d.foldingEnabled);null!=d.mathEnabled&&(d.mathEnabled=!d.mathEnabled);null!=d.shadowVisible&&(d.shadowVisible=!d.shadowVisible);return d};mxCodecRegistry.register(b)})();-(function(){var b=new mxObjectCodec(new ChangeGridColor,["ui"]);b.beforeDecode=function(f,m,d){d.ui=f.ui;return m};mxCodecRegistry.register(b)})();(function(){EditorUi.VERSION="26.2.2";EditorUi.compactUi="atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&"support.draw.io"!=window.location.hostname&&+(function(){var b=new mxObjectCodec(new ChangeGridColor,["ui"]);b.beforeDecode=function(f,m,d){d.ui=f.ui;return m};mxCodecRegistry.register(b)})();(function(){EditorUi.VERSION="26.2.7";EditorUi.compactUi="atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&"support.draw.io"!=window.location.hostname&&"test.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl=window.REALTIME_URL;null==EditorUi.cacheUrl&&"undefined"!==typeof DrawioFile&&(DrawioFile.SYNC="none");Editor.cacheTimeout=1E4;EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.nativeFileSupport=!mxClient.IS_OP&&!EditorUi.isElectronApp&&"1"!=urlParams.extAuth&&"showSaveFilePicker"in window&&"showOpenFilePicker"in window;EditorUi.enableDrafts=!mxClient.IS_CHROMEAPP&&isLocalStorage&&"0"!=urlParams.drafts;EditorUi.scratchpadHelpLink="https://www.drawio.com/doc/faq/scratchpad";EditorUi.enableHtmlEditOption=!0;EditorUi.mermaidDiagramTypes="flowchart classDiagram sequenceDiagram stateDiagram mindmap graph erDiagram requirementDiagram journey gantt pie gitGraph".split(" ");EditorUi.defaultMermaidConfig={theme:"neutral",arrowMarkerAbsolute:!1,flowchart:{htmlLabels:!1},sequence:{diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!0,bottomMarginAdj:1,useMaxWidth:!0,rightAngles:!1,showSequenceNumbers:!1},gantt:{titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,leftPadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:4,axisFormat:"%Y-%m-%d"}};@@ -12983,7 +12987,7 @@ EditorUi.prototype.isOffline=function(c){return this.isOfflineApp()||!navigator.hwaccel:!1,zIndex:2E9}),u=this.timeout,z=n.spin,D=null,C=null,A=mxUtils.bind(this,function(U){null!=U&&U()}),Q=this;n.spin=function(U,O,p,q){q=null!=q?q:u;var G=!1;if(!this.active){var E=Date.now();null!=p&&(D=window.setTimeout(function(){n.stop();D=null;p({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:C})},q));l&&(e=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,c=document.body.clientWidth/2-2);U==document.body&&"1"==urlParams.embedInline&&(U=Q.diagramContainer,c=U.scrollLeft+U.clientWidth/2,e=U.scrollTop+U.clientHeight/2);z.call(this,U);"1"==urlParams.embedInline&&null!=n.el&&(n.el.style.marginTop=U.scrollTop+"px",n.el.style.marginLeft=U.scrollLeft+"px");this.active=!0;null!=O&&(G=document.createElement("div"),G.className="geSpinnerStatus",G.style.position="absolute",G.style.whiteSpace="nowrap",G.style.background="#4B4243",G.style.color="white",G.style.fontFamily=Editor.defaultHtmlFont,G.style.fontSize="9pt",G.style.padding="6px",G.style.paddingLeft="10px",G.style.paddingRight="10px",G.style.zIndex=2E9,G.style.left=Math.max(0,c)+"px",G.style.top=Math.max(0,e+70)+"px",mxUtils.setPrefixedStyle(G.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(G.style,"transform","translate(-50%,-50%)"),Editor.isDarkMode()||mxUtils.setPrefixedStyle(G.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=O.substring(O.length-3,O.length)&&"!"!=O.charAt(O.length-1)&&(O+="..."),G.innerText=O,U.appendChild(G),n.status=G);this.pause=mxUtils.bind(this,function(){var H=-A;this.active&&(q=Math.max(0,q-(Date.now()-E)),H=mxUtils.bind(this,function(M){this.spin(U,O,p,q);if(null!=M)try{M(),C=mxUtils.bind(this,function(){this.spin(U,O,p,q);try{M()}catch(L){null!=p&&p(L)}})}catch(L){null!=p&&p(L)}}));this.stop();return H});G=!0}return G};var S=n.stop;n.stop=function(){S.call(this);this.active&&(this.active=!1,null!=D&&(window.clearTimeout(D),D=null),null!=n.status&&null!=n.status.parentNode&&n.status.parentNode.removeChild(n.status),n.status=null)};n.pause=function(){return A};+A;this.active&&(q=Math.max(0,q-(Date.now()-E)),H=mxUtils.bind(this,function(L){this.spin(U,O,p,q);if(null!=L)try{L(),C=mxUtils.bind(this,function(){this.spin(U,O,p,q);try{L()}catch(K){null!=p&&p(K)}})}catch(K){null!=p&&p(K)}}));this.stop();return H});G=!0}return G};var S=n.stop;n.stop=function(){S.call(this);this.active&&(this.active=!1,null!=D&&(window.clearTimeout(D),D=null),null!=n.status&&null!=n.status.parentNode&&n.status.parentNode.removeChild(n.status),n.status=null)};n.pause=function(){return A};return n};EditorUi.prototype.isCompatibleString=function(c){try{var e=mxUtils.parseXml(c),g=this.editor.extractGraphModel(e.documentElement,!0);return null!=g&&0==g.getElementsByTagName("parsererror").length}catch(l){}return!1};EditorUi.isVisioFilename=function(c){return/(\.v(dx|sdx?))($|\?)/i.test(c)||/(\.vs(x|sx?))($|\?)/i.test(c)};EditorUi.prototype.isVisioData=function(c){return 8<c.length&&(208==c.charCodeAt(0)&&207==c.charCodeAt(1)&&17==c.charCodeAt(2)&&224==c.charCodeAt(3)&&161==c.charCodeAt(4)&&177==c.charCodeAt(5)&&26==c.charCodeAt(6)&&225==c.charCodeAt(7)||80==c.charCodeAt(0)&&75==c.charCodeAt(1)&&3==c.charCodeAt(2)&&4==c.charCodeAt(3)||80==c.charCodeAt(0)&&75==c.charCodeAt(1)&&3==c.charCodeAt(2)&&6==c.charCodeAt(3))};EditorUi.prototype.isRemoteVisioData=function(c){return 8<c.length&&(208==c.charCodeAt(0)&&207==c.charCodeAt(1)&&17==c.charCodeAt(2)&&224==c.charCodeAt(3)&&161==c.charCodeAt(4)&&177==c.charCodeAt(5)&&26==c.charCodeAt(6)&&225==c.charCodeAt(7)||60==c.charCodeAt(0)&&63==c.charCodeAt(1)&&120==c.charCodeAt(2)&&109==c.charCodeAt(3)&&108==c.charCodeAt(3))};var b=EditorUi.prototype.createKeyHandler;EditorUi.prototype.createKeyHandler=function(c){var e=b.apply(this,arguments);if(!this.editor.chromeless||this.editor.editable){var g=e.getFunction,l=this.editor.graph,n=this;e.getFunction=function(u){if(l.isSelectionEmpty()&&null!=n.pages&&0<n.pages.length){var z=n.getSelectedPageIndex();if(mxEvent.isShiftDown(u)){if(37==u.keyCode)return function(){0<z&&n.movePage(z,z-1)};if(38==u.keyCode)return function(){0<@@ -13020,19 +13024,19 @@ if(null==l.pageId&&null!=urlParams["page-id"]&&e.getId()==urlParams["page-id"]||[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(e);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,this.currentPage.setDiagramModified(!1),this.scrollToPage());if(null!=urlParams["layer-ids"])try{var z=decodeURIComponent(urlParams["layer-ids"]).split(" ");e={};for(u=0;u<z.length;u++)e[z[u]]=!0;var D=this.editor.graph.getModel(),C=D.getChildren(D.root);for(u=0;u<C.length;u++){var A=C[u];D.setVisible(A,e[A.id]||!1)}}catch(Q){}};EditorUi.prototype.getBaseFilename=function(c){var e=this.getCurrentFile();e=null!=e&&null!=e.getTitle()?e.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(e)||/(\.html)$/i.test(e)||/(\.svg)$/i.test(e)||/(\.png)$/i.test(e))e=e.substring(0,e.lastIndexOf("."));/(\.drawio)$/i.test(e)&&(e=e.substring(0,e.lastIndexOf(".")));!c&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(e=e+"-"+this.currentPage.getName());return e};EditorUi.prototype.downloadFile=function(c,e,g,l,n,u,z,D,C,A,Q,S,U,O,p,q){try{l=null!=l?l:this.editor.graph.isSelectionEmpty();var G=this.getBaseFilename(!n),E=G+("xml"==c||"pdf"==c&&Q?".drawio":"")+"."+c;if("xml"==c){var H=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,l,n,null,null,null,e);this.saveData(E,c,H,"text/xml")}else if("html"==c)H=this.getHtml2(this.getFileData(!0),this.editor.graph,G),this.saveData(E,c,H,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==-c?E=G+".png":"jpeg"==c&&(E=G+".jpg"),this.saveRequest(E,c,mxUtils.bind(this,function(F,K){try{return this.createDownloadRequest(F,c,l,K,z,n,D,C,A,Q,S,void 0,void 0,!u,U,O,p,q)}catch(P){this.handleError(P)}}));else{var M=null,L=mxUtils.bind(this,function(F){F.length<=MAX_REQUEST_SIZE?this.saveData(E,"svg",F,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(M)}))});if("svg"==c){var k=this.editor.graph.background;-if(z||k==mxConstants.NONE)k=null;var y=this.editor.graph.getSvg(k,null,null,null,null,l);g&&this.editor.graph.addSvgShadow(y);this.editor.convertImages(y,mxUtils.bind(this,mxUtils.bind(this,function(F){this.spinner.stop();L(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(F))})))}else E=G+".svg",M=this.getFileData(!1,!0,null,mxUtils.bind(this,function(F){this.spinner.stop();L(F)}),l)}}catch(F){this.handleError(F)}};EditorUi.prototype.createDownloadRequest=function(c,e,g,l,n,u,z,D,C,-A,Q,S,U,O,p,q,G,E){c=this.downloadRequestBuilder(c,e,g,l,n,u,z,D,C,A,Q,S,U,O,p,q,G,E);e="";for(var H in c)g=c[H],null!=g&&(e+=H+"="+encodeURIComponent(g)+"&");return new mxXmlRequest(EXPORT_URL,e)};EditorUi.prototype.downloadRequestBuilder=function(c,e,g,l,n,u,z,D,C,A,Q,S,U,O,p,q,G,E){var H=this.editor.graph,M=H.getGraphBounds();g=this.getFileData(!0,null,null,null,g,0==u?!1:"xmlpng"!=e,null,null,null,!Editor.defaultCompressed,"pdf"==e);var L=null,k=null,y=null;if(!EditorUi.isElectronApp&&(M.width*-M.height>MAX_AREA||g.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};A=A?"1":"0";"pdf"==e&&(null!=Q?(L=Q.from,k=Q.to):0==u&&(y="1"));"xmlpng"==e&&(A="1",e="png");if(("xmlpng"==e||"svg"==e)&&null!=this.pages&&null!=this.currentPage)for(u=0;u<this.pages.length;u++)if(this.pages[u]==this.currentPage){L=u;break}u=H.background;"png"!=e&&"pdf"!=e&&"svg"!=e||!n?n||null!=u&&u!=mxConstants.NONE||(u="#ffffff"):u=mxConstants.NONE;n={globalVars:H.getExportVariables()};C&&(n.grid={size:H.gridSize,-steps:H.view.gridSteps,color:Editor.isDarkMode()&&"pdf"==e?mxGraphView.prototype.defaultGridColor:H.view.gridColor});Graph.translateDiagram&&(n.diagramLanguage=Graph.diagramLanguage);return{format:e,from:L,to:k,allPages:y,bg:null!=u?u:mxConstants.NONE,base64:l,embedXml:A,xml:g,filename:null!=c?c:"",extras:JSON.stringify(n),scale:z,border:D,pageMargin:p,w:S&&isFinite(S)?S:null,h:U&&isFinite(U)?U:null,crop:null!=O&&O?"1":"0",fit:null!=q&&q?"1":"0",sheetsAcross:G,sheetsDown:E}};EditorUi.prototype.setMode=+c?E=G+".png":"jpeg"==c&&(E=G+".jpg"),this.saveRequest(E,c,mxUtils.bind(this,function(F,M){try{return this.createDownloadRequest(F,c,l,M,z,n,D,C,A,Q,S,void 0,void 0,!u,U,O,p,q)}catch(P){this.handleError(P)}}));else{var L=null,K=mxUtils.bind(this,function(F){F.length<=MAX_REQUEST_SIZE?this.saveData(E,"svg",F,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(L)}))});if("svg"==c){var k=this.editor.graph.background;+if(z||k==mxConstants.NONE)k=null;var y=this.editor.graph.getSvg(k,null,null,null,null,l);g&&this.editor.graph.addSvgShadow(y);this.editor.convertImages(y,mxUtils.bind(this,mxUtils.bind(this,function(F){this.spinner.stop();K(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(F))})))}else E=G+".svg",L=this.getFileData(!1,!0,null,mxUtils.bind(this,function(F){this.spinner.stop();K(F)}),l)}}catch(F){this.handleError(F)}};EditorUi.prototype.createDownloadRequest=function(c,e,g,l,n,u,z,D,C,+A,Q,S,U,O,p,q,G,E){c=this.downloadRequestBuilder(c,e,g,l,n,u,z,D,C,A,Q,S,U,O,p,q,G,E);e="";for(var H in c)g=c[H],null!=g&&(e+=H+"="+encodeURIComponent(g)+"&");return new mxXmlRequest(EXPORT_URL,e)};EditorUi.prototype.downloadRequestBuilder=function(c,e,g,l,n,u,z,D,C,A,Q,S,U,O,p,q,G,E){var H=this.editor.graph,L=H.getGraphBounds();g=this.getFileData(!0,null,null,null,g,0==u?!1:"xmlpng"!=e,null,null,null,!Editor.defaultCompressed,"pdf"==e);var K=null,k=null,y=null;if(!EditorUi.isElectronApp&&(L.width*+L.height>MAX_AREA||g.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};A=A?"1":"0";"pdf"==e&&(null!=Q?(K=Q.from,k=Q.to):0==u&&(y="1"));"xmlpng"==e&&(A="1",e="png");if(("xmlpng"==e||"svg"==e)&&null!=this.pages&&null!=this.currentPage)for(u=0;u<this.pages.length;u++)if(this.pages[u]==this.currentPage){K=u;break}u=H.background;"png"!=e&&"pdf"!=e&&"svg"!=e||!n?n||null!=u&&u!=mxConstants.NONE||(u="#ffffff"):u=mxConstants.NONE;n={globalVars:H.getExportVariables()};C&&(n.grid={size:H.gridSize,+steps:H.view.gridSteps,color:Editor.isDarkMode()&&"pdf"==e?mxGraphView.prototype.defaultGridColor:H.view.gridColor});Graph.translateDiagram&&(n.diagramLanguage=Graph.diagramLanguage);return{format:e,from:K,to:k,allPages:y,bg:null!=u?u:mxConstants.NONE,base64:l,embedXml:A,xml:g,filename:null!=c?c:"",extras:JSON.stringify(n),scale:z,border:D,pageMargin:p,w:S&&isFinite(S)?S:null,h:U&&isFinite(U)?U:null,crop:null!=O&&O?"1":"0",fit:null!=q&&q?"1":"0",sheetsAcross:G,sheetsDown:E}};EditorUi.prototype.setMode=function(c,e){this.mode=c};EditorUi.prototype.getDiagramId=function(){var c=window.location.hash;null!=c&&0<c.length&&(c=c.substring(1));if(null!=c&&1<c.length){var e=c.indexOf("#");0<=e&&(c=c.substring(0,e))}return c};EditorUi.prototype.getHashObject=function(){var c=window.location.hash,e={};if(null!=c&&0<c.length){var g=c.lastIndexOf("#");if(0<g){c=decodeURIComponent(c.substring(g+1));try{e=JSON.parse(c)}catch(l){}}}return e};EditorUi.prototype.updateHashObject=function(){if(null!=this.currentFile&&null!=this.currentPage&&""!=this.currentFile.getHash()){var c=this.getHashObject();c.pageId=this.currentPage.getId();this.setHashObject(c)}else this.setHashObject(null)};EditorUi.prototype.setHashObject=function(c){if(Editor.enableHashObjects){var e=window.location.hash;if(null==e||""==e)e="#";var g=e.lastIndexOf("#");0<g&&(e=e.substring(0,g));try{null==c||mxUtils.isEmptyObject(c)||(e=e+"#"+encodeURIComponent(JSON.stringify(c)))}catch(l){}0<g&&0<e.lastIndexOf("#")?window.location.hash=e:window.location.replace(e)}};EditorUi.prototype.loadDescriptor=function(c,e,g){var l=window.location.hash,n=mxUtils.bind(this,function(z){var D=null!=c.data?c.data:"";null!=z&&0<z.length&&(0<D.length&&(D+="\n"),D+=z);z=new LocalFile(this,"csv"!=c.format&&0<D.length?D:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);z.getHash=function(){return l};this.fileLoaded(z);"csv"==c.format&&this.importCsv(D,mxUtils.bind(this,function(U){this.editor.undoManager.clear();this.editor.setModified(!1);this.clearStatus()}));if(null!=c.update){var C=null!=c.interval?parseInt(c.interval):6E4,A=null,Q=mxUtils.bind(this,function(){var U=this.currentPage;mxUtils.post(c.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(O){U===this.currentPage&&(200<=O.getStatus()&&300>=O.getStatus()?(this.updateDiagram(O.getText()),S()):this.handleError({message:mxResources.get("error")+" "+O.getStatus()}))}),mxUtils.bind(this,function(O){this.handleError(O)}))}),S=-mxUtils.bind(this,function(){window.clearTimeout(A);A=window.setTimeout(Q,C)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){S();Q()}));S();Q()}null!=e&&e()});if(null!=c.url&&0<c.url.length){var u=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(u,mxUtils.bind(this,function(z){n(z)}),mxUtils.bind(this,function(z){null!=g&&g(z)}))}else n("")};EditorUi.prototype.updateDiagram=function(c){function e(M){var L=new mxCellOverlay(M.image||n.warningImage,M.tooltip,M.align,M.valign,-M.offset);L.addListener(mxEvent.CLICK,function(k,y){l.alert(M.tooltip)});return L}var g=null,l=this;if(null!=c&&0<c.length&&(g=mxUtils.parseXml(c),c=null!=g?g.documentElement:null,null!=c&&"updates"==c.nodeName)){var n=this.editor.graph,u=n.getModel();u.beginUpdate();var z=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var D=u.getCell(c.getAttribute("id"));if(null!=D){try{var C=c.getAttribute("value");if(null!=C){var A=mxUtils.parseXml(C).documentElement;if(null!=A)if("1"==A.getAttribute("replace-value"))u.setValue(D,-A);else for(var Q=A.attributes,S=0;S<Q.length;S++)n.setAttributeForCell(D,Q[S].nodeName,0<Q[S].nodeValue.length?Q[S].nodeValue:null)}}catch(M){null!=window.console&&console.log("Error in value for "+D.id+": "+M)}try{var U=c.getAttribute("style");null!=U&&n.model.setStyle(D,U)}catch(M){null!=window.console&&console.log("Error in style for "+D.id+": "+M)}try{var O=c.getAttribute("icon");if(null!=O){var p=0<O.length?JSON.parse(O):null;null!=p&&p.append||n.removeCellOverlays(D);null!=p&&n.addCellOverlay(D,-e(p))}}catch(M){null!=window.console&&console.log("Error in icon for "+D.id+": "+M)}try{var q=c.getAttribute("geometry");if(null!=q){q=JSON.parse(q);var G=n.getCellGeometry(D);if(null!=G){G=G.clone();for(key in q){var E=parseFloat(q[key]);"dx"==key?G.x+=E:"dy"==key?G.y+=E:"dw"==key?G.width+=E:"dh"==key?G.height+=E:G[key]=parseFloat(q[key])}n.model.setGeometry(D,G)}}}catch(M){null!=window.console&&console.log("Error in icon for "+D.id+": "+M)}}}else if("model"==c.nodeName){for(var H=c.firstChild;null!=+mxUtils.bind(this,function(){window.clearTimeout(A);A=window.setTimeout(Q,C)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){S();Q()}));S();Q()}null!=e&&e()});if(null!=c.url&&0<c.url.length){var u=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(u,mxUtils.bind(this,function(z){n(z)}),mxUtils.bind(this,function(z){null!=g&&g(z)}))}else n("")};EditorUi.prototype.updateDiagram=function(c){function e(L){var K=new mxCellOverlay(L.image||n.warningImage,L.tooltip,L.align,L.valign,+L.offset);K.addListener(mxEvent.CLICK,function(k,y){l.alert(L.tooltip)});return K}var g=null,l=this;if(null!=c&&0<c.length&&(g=mxUtils.parseXml(c),c=null!=g?g.documentElement:null,null!=c&&"updates"==c.nodeName)){var n=this.editor.graph,u=n.getModel();u.beginUpdate();var z=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var D=u.getCell(c.getAttribute("id"));if(null!=D){try{var C=c.getAttribute("value");if(null!=C){var A=mxUtils.parseXml(C).documentElement;if(null!=A)if("1"==A.getAttribute("replace-value"))u.setValue(D,+A);else for(var Q=A.attributes,S=0;S<Q.length;S++)n.setAttributeForCell(D,Q[S].nodeName,0<Q[S].nodeValue.length?Q[S].nodeValue:null)}}catch(L){null!=window.console&&console.log("Error in value for "+D.id+": "+L)}try{var U=c.getAttribute("style");null!=U&&n.model.setStyle(D,U)}catch(L){null!=window.console&&console.log("Error in style for "+D.id+": "+L)}try{var O=c.getAttribute("icon");if(null!=O){var p=0<O.length?JSON.parse(O):null;null!=p&&p.append||n.removeCellOverlays(D);null!=p&&n.addCellOverlay(D,+e(p))}}catch(L){null!=window.console&&console.log("Error in icon for "+D.id+": "+L)}try{var q=c.getAttribute("geometry");if(null!=q){q=JSON.parse(q);var G=n.getCellGeometry(D);if(null!=G){G=G.clone();for(key in q){var E=parseFloat(q[key]);"dx"==key?G.x+=E:"dy"==key?G.y+=E:"dw"==key?G.width+=E:"dh"==key?G.height+=E:G[key]=parseFloat(q[key])}n.model.setGeometry(D,G)}}}catch(L){null!=window.console&&console.log("Error in icon for "+D.id+": "+L)}}}else if("model"==c.nodeName){for(var H=c.firstChild;null!=H&&H.nodeType!=mxConstants.NODETYPE_ELEMENT;)H=H.nextSibling;null!=H&&(new mxCodec(c.firstChild)).decode(H,u)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(n.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))n.view.translate=new mxPoint(parseFloat(c.getAttribute("dx")||0),parseFloat(c.getAttribute("dy")||0))}else"fit"==c.nodeName&&(z=c.hasAttribute("max-scale")?parseFloat(c.getAttribute("max-scale")):1);c=c.nextSibling}}finally{u.endUpdate()}null!=z&&this.chromelessResize&&this.chromelessResize(!0,z)}return g};EditorUi.prototype.getCopyFilename=function(c,e){var g=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var l=g.lastIndexOf(".");0<=l&&(c=g.substring(l),g=g.substring(0,l));if(e){e=g;var n=new Date;g=n.getFullYear();l=n.getMonth()+1;var u=n.getDate(),z=n.getHours(),D=n.getMinutes();n=n.getSeconds();g=e+(" "+(g+"-"+l+"-"+u+"-"+z+"-"+D+"-"+n))}return g=mxResources.get("copyOf",[g])+c};EditorUi.prototype.logIfModified=function(c,e){try{null!=c&&e&&EditorUi.debug("File.closed",[c])}catch(g){}};EditorUi.prototype.fileLoaded=function(c,e,g){var l=this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrentFile(null);var n=!1;this.hideDialog();null!=l&&(l.removeListener(this.descriptorChangedListener),this.logIfModified(l,!0),l.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var u=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=l&&@@ -13054,15 +13058,15 @@ e&&this.sidebar.addEntries(e);null==g&&(g=c.getTitle(),null!=g&&/(\.xml)$/i.test"inherit";l.style.position="relative";var Q=document.createElement("img");Q.className="geLibraryButton";Q.setAttribute("src",Editor.crossImage);Q.setAttribute("title",mxResources.get("close"));var S=null;if(".scratchpad"!=c.title||this.closableScratchpad)A.appendChild(Q),mxEvent.addListener(Q,"click",mxUtils.bind(this,function(E){if(!mxEvent.isConsumed(E)){var H=mxUtils.bind(this,function(){null!=n&&mxUtils.remove(n,this.openLibraries);this.closeLibrary(c)});null!=S?this.confirm(mxResources.get("allChangesLost"),null,H,mxResources.get("cancel"),mxResources.get("discardChanges")):H();mxEvent.consume(E)}}));if(c.isEditable()){var U=this.editor.graph,O=null;g=mxUtils.bind(this,function(E){this.showLibraryDialog(c.getTitle(),C,e,c,c.getMode());mxEvent.consume(E)});var p=mxUtils.bind(this,function(E){c.setModified(!0);c.isAutosave()?(null!=O&&null!=O.parentNode&&O.parentNode.removeChild(O),O=Q.cloneNode(!1),O.setAttribute("src",Editor.spinImage),O.setAttribute("title",mxResources.get("saving")),O.style.cursor="default",O.style.marginRight="2px",O.style.marginTop="-2px",A.insertBefore(O,A.firstChild),this.saveLibrary(c.getTitle(),e,c,c.getMode(),!0,!0,function(){null!=O&&null!=O.parentNode&&O.parentNode.removeChild(O)})):null==S&&(S=Q.cloneNode(!1),S.setAttribute("src",Editor.saveImage),S.setAttribute("title",mxResources.get("save")),A.insertBefore(S,A.firstChild),mxEvent.addListener(S,"click",mxUtils.bind(this,function(H){this.saveLibrary(c.getTitle(),e,c,c.getMode(),c.constructor==LocalLibrary,!0,function(){null==-S||c.isModified()||(S.parentNode.removeChild(S),S=null)});mxEvent.consume(H)})))}),q=mxUtils.bind(this,function(E,H,M,L){E=U.cloneCells(mxUtils.sortCells(U.model.getTopmostCells(E)));for(var k=0;k<E.length;k++){var y=U.getCellGeometry(E[k]);null!=y&&y.translate(-H.x,-H.y)}C.appendChild(this.sidebar.createVertexTemplateFromCells(E,H.width,H.height,L||"",!0,null,!1));E=mxUtils.getXml(this.editor.graph.encodeCells(E));Editor.defaultCompressed&&(E=Graph.compress(E));H={xml:E,w:H.width,h:H.height};null!=-L&&(H.title=L);e.push(H);p(M);null!=z&&null!=z.parentNode&&0<e.length&&(z.parentNode.removeChild(z),z=null)}),G=mxUtils.bind(this,function(E){if(U.isSelectionEmpty())U.getRubberband().isActive()?(U.getRubberband().execute(E),U.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var H=U.getSelectionCells(),M=U.view.getBounds(H);if(null!=M&&0<M.width&&0<M.height){var L=U.view.scale;M.x/=L;M.y/=L;M.width/=L;M.height/=L;M.x-=-U.view.translate.x;M.y-=U.view.translate.y;q(H,M)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(E)});mxEvent.addGestureListeners(C,function(){},mxUtils.bind(this,function(E){U.isMouseDown&&null!=U.panningManager&&null!=U.graphHandler.first&&(U.graphHandler.suspend(),null!=U.graphHandler.hint&&(U.graphHandler.hint.style.visibility="hidden"),C.style.backgroundColor="light-dark(#fefefe, #000000)",C.style.cursor="copy",U.panningManager.stop(),+S||c.isModified()||(S.parentNode.removeChild(S),S=null)});mxEvent.consume(H)})))}),q=mxUtils.bind(this,function(E,H,L,K){E=U.cloneCells(mxUtils.sortCells(U.model.getTopmostCells(E)));for(var k=0;k<E.length;k++){var y=U.getCellGeometry(E[k]);null!=y&&y.translate(-H.x,-H.y)}C.appendChild(this.sidebar.createVertexTemplateFromCells(E,H.width,H.height,K||"",!0,null,!1));E=mxUtils.getXml(this.editor.graph.encodeCells(E));Editor.defaultCompressed&&(E=Graph.compress(E));H={xml:E,w:H.width,h:H.height};null!=+K&&(H.title=K);e.push(H);p(L);null!=z&&null!=z.parentNode&&0<e.length&&(z.parentNode.removeChild(z),z=null)}),G=mxUtils.bind(this,function(E){if(U.isSelectionEmpty())U.getRubberband().isActive()?(U.getRubberband().execute(E),U.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var H=U.getSelectionCells(),L=U.view.getBounds(H);if(null!=L&&0<L.width&&0<L.height){var K=U.view.scale;L.x/=K;L.y/=K;L.width/=K;L.height/=K;L.x-=+U.view.translate.x;L.y-=U.view.translate.y;q(H,L)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(E)});mxEvent.addGestureListeners(C,function(){},mxUtils.bind(this,function(E){U.isMouseDown&&null!=U.panningManager&&null!=U.graphHandler.first&&(U.graphHandler.suspend(),null!=U.graphHandler.hint&&(U.graphHandler.hint.style.visibility="hidden"),C.style.backgroundColor="light-dark(#fefefe, #000000)",C.style.cursor="copy",U.panningManager.stop(),U.autoScroll=!1,mxEvent.consume(E))}),mxUtils.bind(this,function(E){U.isMouseDown&&null!=U.panningManager&&null!=U.graphHandler&&(C.style.backgroundColor="",C.style.cursor="default",this.sidebar.showTooltips=!0,U.panningManager.stop(),U.graphHandler.reset(),U.isMouseDown=!1,U.autoScroll=!0,G(E),mxEvent.consume(E))}));mxEvent.addListener(C,"mouseleave",mxUtils.bind(this,function(E){U.isMouseDown&&null!=U.graphHandler.first&&(U.graphHandler.resume(),null!=U.graphHandler.hint&&(U.graphHandler.hint.style.visibility="visible"),C.style.backgroundColor="",C.style.cursor="",U.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(C,"dragover",mxUtils.bind(this,function(E){C.style.backgroundColor="light-dark(#fefefe, #000000)";E.dataTransfer.dropEffect="copy";C.style.cursor="copy";this.sidebar.hideTooltip();E.stopPropagation();E.preventDefault()})),mxEvent.addListener(C,"drop",mxUtils.bind(this,function(E){C.style.cursor="";C.style.backgroundColor="";0<E.dataTransfer.files.length&&this.importFiles(E.dataTransfer.files,-0,0,this.maxImageSize,mxUtils.bind(this,function(H,M,L,k,y,F,K,P,R){if(null!=H&&"image/"==M.substring(0,6))H="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(H),H=[new mxCell("",new mxGeometry(0,0,y,F),H)],H[0].vertex=!0,q(H,new mxRectangle(0,0,y,F),E,mxEvent.isAltDown(E)?null:K.substring(0,K.lastIndexOf(".")).replace(/_/g," ")),null!=z&&null!=z.parentNode&&0<e.length&&(z.parentNode.removeChild(z),z=null);else{var T=!1,V=mxUtils.bind(this,-function(W,X){null!=W&&"application/pdf"==X&&(X=Editor.extractGraphModelFromPdf(W),null!=X&&0<X.length&&(W=X));if(null!=W)if(W=mxUtils.parseXml(W),"mxlibrary"==W.documentElement.nodeName)try{var Z=JSON.parse(mxUtils.getTextContent(W.documentElement));D(Z,C);e=e.concat(Z);p(E);this.spinner.stop();T=!0}catch(ka){}else if("mxfile"==W.documentElement.nodeName)try{var Y=W.documentElement.getElementsByTagName("diagram");for(Z=0;Z<Y.length;Z++){var da=this.stringToCells(Editor.getDiagramNodeXml(Y[Z])),ea=-this.editor.graph.getBoundingBoxFromGeometry(da);null!=ea&&q(da,new mxRectangle(0,0,ea.width,ea.height),E)}T=!0}catch(ka){null!=window.console&&console.log("error in drop handler:",ka)}T||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=z&&null!=z.parentNode&&0<e.length&&(z.parentNode.removeChild(z),z=null)});null!=R&&null!=K&&EditorUi.isVisioFilename(K)?this.importVisio(R,function(W){V(W,"text/xml")},null,K):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(H,-K)&&null!=R?this.isExternalDataComms()?this.parseFile(R,mxUtils.bind(this,function(W){4==W.readyState&&(this.spinner.stop(),200<=W.status&&299>=W.status?V(W.responseText,"text/xml"):this.handleError({message:mxResources.get(413==W.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):V(H,M)}}));E.stopPropagation();E.preventDefault()})),mxEvent.addListener(C,"dragleave",+0,0,this.maxImageSize,mxUtils.bind(this,function(H,L,K,k,y,F,M,P,R){if(null!=H&&"image/"==L.substring(0,6))H="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(H),H=[new mxCell("",new mxGeometry(0,0,y,F),H)],H[0].vertex=!0,q(H,new mxRectangle(0,0,y,F),E,mxEvent.isAltDown(E)?null:M.substring(0,M.lastIndexOf(".")).replace(/_/g," ")),null!=z&&null!=z.parentNode&&0<e.length&&(z.parentNode.removeChild(z),z=null);else{var T=!1,V=mxUtils.bind(this,+function(W,X){null!=W&&"application/pdf"==X&&(X=Editor.extractGraphModelFromPdf(W),null!=X&&0<X.length&&(W=X));if(null!=W)if(W=mxUtils.parseXml(W),"mxlibrary"==W.documentElement.nodeName)try{var Y=JSON.parse(mxUtils.getTextContent(W.documentElement));D(Y,C);e=e.concat(Y);p(E);this.spinner.stop();T=!0}catch(ka){}else if("mxfile"==W.documentElement.nodeName)try{var Z=W.documentElement.getElementsByTagName("diagram");for(Y=0;Y<Z.length;Y++){var da=this.stringToCells(Editor.getDiagramNodeXml(Z[Y])),ea=+this.editor.graph.getBoundingBoxFromGeometry(da);null!=ea&&q(da,new mxRectangle(0,0,ea.width,ea.height),E)}T=!0}catch(ka){null!=window.console&&console.log("error in drop handler:",ka)}T||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=z&&null!=z.parentNode&&0<e.length&&(z.parentNode.removeChild(z),z=null)});null!=R&&null!=M&&EditorUi.isVisioFilename(M)?this.importVisio(R,function(W){V(W,"text/xml")},null,M):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(H,+M)&&null!=R?this.isExternalDataComms()?this.parseFile(R,mxUtils.bind(this,function(W){4==W.readyState&&(this.spinner.stop(),200<=W.status&&299>=W.status?V(W.responseText,"text/xml"):this.handleError({message:mxResources.get(413==W.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):V(H,L)}}));E.stopPropagation();E.preventDefault()})),mxEvent.addListener(C,"dragleave",function(E){C.style.cursor="";C.style.backgroundColor="";E.stopPropagation();E.preventDefault()}));Q=Q.cloneNode(!1);Q.setAttribute("src",Editor.editImage);Q.setAttribute("title",mxResources.get("edit"));A.insertBefore(Q,A.firstChild);mxEvent.addListener(Q,"click",g);g=Q.cloneNode(!1);g.setAttribute("src",Editor.plusImage);g.setAttribute("title",mxResources.get("add"));A.insertBefore(g,A.firstChild);mxEvent.addListener(g,"click",G);".scratchpad"==c.title&&(this.addSelectionToScratchpad=G);this.isOffline()||".scratchpad"!=c.title||null==EditorUi.scratchpadHelpLink||(g=this.createHelpIcon(EditorUi.scratchpadHelpLink,!0),g.className="geLibraryButton",A.insertBefore(g,A.firstChild))}l.appendChild(A);this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(c,e){for(var g=0;g<c.length;g++)try{var l=c[g],n=l.data;if(null!=n){n="data:"==n.substring(0,5)?this.convertDataUri(n):n;var u="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==l.aspect&&(u+="aspect=fixed;");u=u+"image="+n+";";null!=l.style&&(u+=l.style);e.appendChild(this.sidebar.createVertexTemplate(u,l.w,l.h,"",l.title||"",!1,null,!0))}else if(null!=l.xml){var z=this.stringToCells("<"==l.xml.charAt(0)?l.xml:Graph.decompress(l.xml)),D=0==z.length?mxResources.get("drawingEmpty"):null!=l.title?l.title:"";e.appendChild(this.sidebar.createVertexTemplateFromCells(z,l.w,l.h,D,!0,null,!0))}}catch(C){D=null!=C.message?mxResources.get("error")+": "+C.message:String(C),@@ -13075,7 +13079,7 @@ C||null!=e){z=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var A=mxR" ("+this.drive.user.email+")":""),!1);var S=null!=n?null:null!=u?u:window.location.hash;if(null!=S&&("#G"==S.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==S.substring(0,45))&&(null!=c&&null!=c.error&&(null!=c.error.errors&&0<c.error.errors.length&&"fileAccess"==c.error.errors[0].reason||null!=c.error.data&&0<c.error.data.length&&"fileAccess"==c.error.data[0].reason)||404==C.code||404==C.status)){S="#U"==S.substring(0,2)?S.substring(45,S.lastIndexOf("%26ex")):S.substring(2);this.showError(e,z,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+S);null!=l&&l()}),Q,mxResources.get("changeUser"),mxUtils.bind(this,function(){function U(){G.innerText="";for(var E=0;E<O.length;E++){var H=document.createElement("option");mxUtils.write(H,O[E].displayName);H.value=E;G.appendChild(H);H=document.createElement("option");H.innerHTML=" ";mxUtils.write(H,"<"+O[E].email+">");H.setAttribute("disabled","disabled");G.appendChild(H)}H=document.createElement("option");mxUtils.write(H,mxResources.get("addAccount"));H.value=O.length;G.appendChild(H)}var O=this.drive.getUsersList(),p=document.createElement("div"),q=document.createElement("div");q.style.marginBottom="6px";mxUtils.write(q,mxResources.get("changeUser")+": ");p.appendChild(q);var G=document.createElement("select");G.style.width="100%";U();mxEvent.addListener(G,"change",mxUtils.bind(this,function(){var E=G.value,H=O.length!=E;H&&this.drive.setUser(O[E]);-this.drive.authorize(H,mxUtils.bind(this,function(){H||(O=this.drive.getUsersList(),U())}),mxUtils.bind(this,function(M){this.handleError(M)}),!0)}));p.appendChild(G);p=new CustomDialog(this,p,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(p.container,300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=g&&g()}),520,150);return}}null!=C.message?z=""==C.message&&null!=C.name?mxUtils.htmlEntities(C.name,!1):+this.drive.authorize(H,mxUtils.bind(this,function(){H||(O=this.drive.getUsersList(),U())}),mxUtils.bind(this,function(L){this.handleError(L)}),!0)}));p.appendChild(G);p=new CustomDialog(this,p,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(p.container,300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=g&&g()}),520,150);return}}null!=C.message?z=""==C.message&&null!=C.name?mxUtils.htmlEntities(C.name,!1):mxUtils.htmlEntities(C.message,!1):null!=C.response&&null!=C.response.error?z=mxUtils.htmlEntities(C.response.error,!1):"undefined"!==typeof window.App&&(C.code==App.ERROR_TIMEOUT?z=mxUtils.htmlEntities(mxResources.get("timeout"),!1):C.code==App.ERROR_BUSY?z=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof C&&0<C.length&&(z=mxUtils.htmlEntities(C,!1)))}n=c=null;null!=C&&null!=C.helpLink?(c=mxResources.get("help"),n=mxUtils.bind(this,function(){return this.editor.graph.openLink(C.helpLink)})):null!=C&&null!=C.ownerEmail?(c=mxResources.get("contactOwner"),z+=mxUtils.htmlEntities(" ("+c+": "+C.ownerEmail+")",!1),n=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(C.ownerEmail))})):null!=C&&null!=C.alternateAction&&(c=C.alternateAction.label,n=C.alternateAction.funct);this.showError(e,z,A,g,Q,null,null,c,n,null,null,null,l?g:null)}else null!=g&&g()};EditorUi.prototype.alert=function(c,e,g){c=new ErrorDialog(this,null,c,mxResources.get("ok"),e);this.showDialog(c.container,g||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,e,g,l,n,u){c=null!=c?c:"";var z=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},D=Math.min(220,28*Math.ceil(Math.max(1,c.length)/50));c=new ConfirmDialog(this,c,function(){z();null!=e&&e()},function(){z();null!=g&&g()},l,n,null,null,null,null,D);this.showDialog(c.container,340,46+D,!0,u);c.init()};EditorUi.prototype.showBanner=function(c,e,g,l,n,u,z,D,C){u=!1;if(!(this.bannerShowing||this["hideBanner"+@@ -13108,14 +13112,14 @@ c,l,n,e):this.saveRequest(c,e,mxUtils.bind(this,function(u,z){return this.createfunction(p){u=null!=u?u:"pdf"==e?"application/pdf":"image/"+e;if(null!=l)try{this.exportFile(l,A,u,!0,Q,p)}catch(q){this.handleError(q)}else this.spinner.spin(document.body,mxResources.get("saving"))&&O.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=O.getStatus()&&299>=O.getStatus())try{this.exportFile(O.getText(),A,u,!0,Q,p)}catch(q){this.handleError(q)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(q){this.spinner.stop();this.handleError(q)}))}),null!=U?S(U):this.pickFolder(Q,S)))}});n=[App.MODE_BROWSER];z||n.push("_blank");var C=new SaveDialog(this,c,mxUtils.bind(this,function(A,Q,S){D(A.value,Q,A,S);this.hideDialog(null,null,C.container)}),n,null,"application/pdf");this.showDialog(C.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));C.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,e,g,l,n,u){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,e,g){e(null)};EditorUi.prototype.exportSvg=function(c,e,g,l,n,u,z,D,C,A,Q,S,U,O){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(P){Editor.addRetryToError(P,mxUtils.bind(this,function(){this.exportSvg(c,e,g,l,n,u,z,D,C,A,Q,S,U,O)}));this.handleError(P)})))try{var p=this.editor.graph.isSelectionEmpty();-g=null!=g?g:p;var q=e?null:this.editor.graph.background;q==mxConstants.NONE&&(q=null);null==q&&0==e&&(q=this.editor.graph.shapeBackgroundColor);var G=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var E=mxUtils.lightDarkColorSupported,H=mxUtils.preferDarkColor;if("light"==Q||"dark"==Q)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==Q;var M=this.editor.graph.createSvgImageExport(n),L=this.editor.graph.getSvg(q,-c,z,D,null,g,null,M,"blank"==A?"_blank":"self"==A?"_top":null,null,!U,Q,S);mxUtils.lightDarkColorSupported=E;mxUtils.preferDarkColor=H;this.editor.graph.addForeignObjectWarning=G;l&&this.editor.graph.addSvgShadow(L);var k=this.getBaseFilename()+(n?".drawio":"")+".svg";O=null!=O?O:mxUtils.bind(this,function(P){this.isLocalFileSave()||P.length<=MAX_REQUEST_SIZE?this.saveData(k,"svg",P,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,-function(){mxUtils.popup(P)}))});var y=mxUtils.bind(this,function(P){this.spinner.stop();n&&P.setAttribute("content",this.getFileData(!0,null,null,null,g,C,null,null,null,null,null,c,z));O(Graph.xmlDeclaration+"\n"+(n?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(P))});this.editor.graph.mathEnabled&&this.editor.addMathCss(L);var F=mxUtils.bind(this,function(P){Editor.replaceSvgDataUris&&u&&EditorUi.embedSvgImages(P);Editor.foreignObjectImages&&U?this.replaceAlternateContent(P,-Q,y):y(P)}),K=mxUtils.bind(this,function(P){u&&!this.isOffline()&&this.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(P,F,this.thumbImageCache)):F(P)});U?this.embedFonts(L,K):(this.editor.addFontCss(L),K(L))}catch(P){this.handleError(P)}};EditorUi.prototype.replaceAlternateContent=function(c,e,g){function l(S,U,O,p,q){var G=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");G.setAttribute("x",U);G.setAttribute("y",O+.5);G.setAttribute("width",+g=null!=g?g:p;var q=e?null:this.editor.graph.background;q==mxConstants.NONE&&(q=null);null==q&&0==e&&(q=this.editor.graph.shapeBackgroundColor);var G=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var E=mxUtils.lightDarkColorSupported,H=mxUtils.preferDarkColor;if("light"==Q||"dark"==Q)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==Q;var L=this.editor.graph.createSvgImageExport(n),K=this.editor.graph.getSvg(q,+c,z,D,null,g,null,L,"blank"==A?"_blank":"self"==A?"_top":null,null,!U,Q,S);mxUtils.lightDarkColorSupported=E;mxUtils.preferDarkColor=H;this.editor.graph.addForeignObjectWarning=G;l&&this.editor.graph.addSvgShadow(K);var k=this.getBaseFilename()+(n?".drawio":"")+".svg";O=null!=O?O:mxUtils.bind(this,function(P){this.isLocalFileSave()||P.length<=MAX_REQUEST_SIZE?this.saveData(k,"svg",P,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,+function(){mxUtils.popup(P)}))});var y=mxUtils.bind(this,function(P){this.spinner.stop();n&&P.setAttribute("content",this.getFileData(!0,null,null,null,g,C,null,null,null,null,null,c,z));O(Graph.xmlDeclaration+"\n"+(n?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(P))});this.editor.graph.mathEnabled&&this.editor.addMathCss(K);var F=mxUtils.bind(this,function(P){Editor.replaceSvgDataUris&&u&&EditorUi.embedSvgImages(P);Editor.foreignObjectImages&&U?this.replaceAlternateContent(P,+Q,y):y(P)}),M=mxUtils.bind(this,function(P){u&&!this.isOffline()&&this.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(P,F,this.thumbImageCache)):F(P)});U?this.embedFonts(K,M):(this.editor.addFontCss(K),M(K))}catch(P){this.handleError(P)}};EditorUi.prototype.replaceAlternateContent=function(c,e,g){function l(S,U,O,p,q){var G=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");G.setAttribute("x",U);G.setAttribute("y",O+.5);G.setAttribute("width",p.width);G.setAttribute("height",p.height);null==G.setAttributeNS?G.setAttribute("xlink:href",q):G.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",q);S.replaceChild(G,S.lastChild);D()}function n(){if(z<Q.length)Q[z++](n)}var u="";e=c.getElementsByTagName("style");for(var z=0;z<e.length;z++)u+=e[z].innerHTML;e=c.getElementsByTagName("switch");counter=e.length;var D=mxUtils.bind(this,function(){counter--;0==counter&&g(c)}),C={},A={},Q=[];for(z=0;z<e.length;z++)mxUtils.bind(this,function(S){var U=S.getElementsByTagName("div");-if(0<U.length)try{var O=U[0].cloneNode(!0),p=parseInt(O.style.marginLeft),q=parseInt(O.style.paddingTop),G=O.getElementsByTagName("div")[1],E=U=!1,H=O.style.alignItems,M=O.style.justifyContent;if(null!=O.style.writingMode){var L=O.style.writingMode;E="vertical-"==L.substring(0,9);U="-rl"==L.substring(L.length-3)}var k=!E&&"1px"==O.style.width||E&&"1px"==O.style.height;if(!E&&"1px"==O.style.height||E&&"1px"==O.style.width)O.style.alignItems=E&&U?"unsafe flex-end":"unsafe flex-start";k&&(O.style.justifyContent=-"unsafe flex-start");O.style.paddingTop="";O.style.marginLeft="";var y=O.outerHTML,F=C[y];null==F&&(O.style.position="absolute",O.style.visibility="hidden",document.body.appendChild(O),L=1,L="1px"==O.style.width?G.offsetWidth:parseInt(O.style.width),k=1,k="1px"==O.style.height?G.offsetHeight:parseInt(O.style.height),document.body.removeChild(O),F=new mxRectangle(p,q,L,k),C[y]=F);"1px"==O.style.height&&("unsafe center"==H?q-=F.height/2:"unsafe flex-end"==H&&(q-=F.height));if("1px"==O.style.width)if(!E&&-"unsafe center"==M||E&&"unsafe center"==H)p-=F.width/2;else if(!E&&"unsafe flex-end"==M||E&&(!U&&"unsafe flex-end"==H||U&&"unsafe flex-start"==H))p-=F.width;F=new mxRectangle(p,q,F.width,F.height+parseInt(G.style.fontSize)/4);Q.push(mxUtils.bind(this,function(K){var P=A[y];null==P?Graph.htmlToPng(y,F.width,F.height,mxUtils.bind(this,function(R){l(S,p,q,F,R);A[y]=R;K()}),u):(l(S,p,q,F,P),K())}))}catch(K){D()}else D()})(e[z]);0==counter&&g(c);z=0;n()};EditorUi.prototype.addRadiobox=function(c,e,g,l,+if(0<U.length)try{var O=U[0].cloneNode(!0),p=parseInt(O.style.marginLeft),q=parseInt(O.style.paddingTop),G=O.getElementsByTagName("div")[1],E=U=!1,H=O.style.alignItems,L=O.style.justifyContent;if(null!=O.style.writingMode){var K=O.style.writingMode;E="vertical-"==K.substring(0,9);U="-rl"==K.substring(K.length-3)}var k=!E&&"1px"==O.style.width||E&&"1px"==O.style.height;if(!E&&"1px"==O.style.height||E&&"1px"==O.style.width)O.style.alignItems=E&&U?"unsafe flex-end":"unsafe flex-start";k&&(O.style.justifyContent=+"unsafe flex-start");O.style.paddingTop="";O.style.marginLeft="";var y=O.outerHTML,F=C[y];null==F&&(O.style.position="absolute",O.style.visibility="hidden",document.body.appendChild(O),K=1,K="1px"==O.style.width?G.offsetWidth:parseInt(O.style.width),k=1,k="1px"==O.style.height?G.offsetHeight:parseInt(O.style.height),document.body.removeChild(O),F=new mxRectangle(p,q,K,k),C[y]=F);"1px"==O.style.height&&("unsafe center"==H?q-=F.height/2:"unsafe flex-end"==H&&(q-=F.height));if("1px"==O.style.width)if(!E&&+"unsafe center"==L||E&&"unsafe center"==H)p-=F.width/2;else if(!E&&"unsafe flex-end"==L||E&&(!U&&"unsafe flex-end"==H||U&&"unsafe flex-start"==H))p-=F.width;F=new mxRectangle(p,q,F.width,F.height+parseInt(G.style.fontSize)/4);Q.push(mxUtils.bind(this,function(M){var P=A[y];null==P?Graph.htmlToPng(y,F.width,F.height,mxUtils.bind(this,function(R){l(S,p,q,F,R);A[y]=R;M()}),u):(l(S,p,q,F,P),M())}))}catch(M){D()}else D()})(e[z]);0==counter&&g(c);z=0;n()};EditorUi.prototype.addRadiobox=function(c,e,g,l,n,u,z){return this.addCheckbox(c,g,l,n,u,z,!0,e)};EditorUi.prototype.addCheckbox=function(c,e,g,l,n,u,z,D){u=null!=u?u:!0;var C=document.createElement("input");C.style.marginRight="8px";C.style.marginTop="16px";C.setAttribute("type",z?"radio":"checkbox");z="geCheckbox-"+Editor.guid();C.id=z;null!=D&&C.setAttribute("name",D);g&&(C.setAttribute("checked","checked"),C.defaultChecked=!0);l&&C.setAttribute("disabled","disabled");u&&(c.appendChild(C),g=document.createElement("label"),mxUtils.write(g,e),g.setAttribute("for",z),c.appendChild(g),n||mxUtils.br(c));return C};EditorUi.prototype.addEditButton=function(c,e){var g=this.addCheckbox(c,mxResources.get("edit")+":",!0,null,!0);g.style.marginLeft="24px";var l=this.getCurrentFile(),n="";null!=l&&l.getMode()!=App.MODE_DEVICE&&l.getMode()!=App.MODE_BROWSER&&(n=window.location.href);var u=document.createElement("select");u.style.maxWidth="200px";u.style.width="auto";u.style.marginLeft="8px";u.style.marginRight="10px";u.className="geBtn";l=document.createElement("option");l.setAttribute("value","blank");mxUtils.write(l,mxResources.get("makeCopy"));u.appendChild(l);var z=document.createElement("option");z.setAttribute("value","custom");mxUtils.write(z,mxResources.get("custom")+"...");u.appendChild(z);c.appendChild(u);mxEvent.addListener(u,"change",mxUtils.bind(this,function(){if("custom"==u.value){var D=new FilenameDialog(this,n,mxResources.get("ok"),function(C){null!=C?(n=C,z.setAttribute("title",C)):(u.value="blank",z.removeAttribute("title"))},mxResources.get("url"),@@ -13133,16 +13137,16 @@ O.toolbar=g.join(" "));null!=Q&&0<Q.length&&(O.edit=Q);null!=c?O.url=c:O.xml=thidocument.createElement("span");mxUtils.write(C,mxResources.get("publicDiagramUrl"));z.appendChild(C);var A=this.getCurrentFile();null==g&&null!=A&&A.constructor==window.DriveFile&&(C=document.createElement("a"),C.style.paddingLeft="12px",C.style.color="gray",C.style.cursor="pointer",mxUtils.write(C,mxResources.get("share")),z.appendChild(C),mxEvent.addListener(C,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(A.getId(),A)})));u.setAttribute("checked","checked");null==g&&D.setAttribute("disabled","disabled");n.appendChild(z);z=380;var Q=this.addLinkSection(n),S=document.createElement("select");S.style.maxWidth="260px";S.style.marginLeft="8px";S.style.marginTop="16px";C=document.createElement("option");C.setAttribute("value","light");mxUtils.write(C,mxResources.get("light"));S.appendChild(C);C=document.createElement("option");C.setAttribute("value","dark");mxUtils.write(C,mxResources.get("dark"));S.appendChild(C);C=document.createElement("option");C.setAttribute("value","auto");mxUtils.write(C,mxResources.get("automatic"));C.setAttribute("selected","selected");S.appendChild(C);C.setAttribute("selected","selected");mxUtils.write(n,mxResources.get("appearance")+":");n.appendChild(S);mxUtils.br(n);z+=26;var U=this.addCheckbox(n,mxResources.get("zoom"),!0,null,!0);mxUtils.write(n,":");var O=document.createElement("input");O.setAttribute("type","text");O.style.marginRight="16px";O.style.width="60px";O.style.marginLeft="4px";O.style.marginRight="12px";O.value="100%";n.appendChild(O);-var p=this.addCheckbox(n,mxResources.get("fit"),!0);C=null!=this.pages&&1<this.pages.length;var q=q=this.addCheckbox(n,mxResources.get("allPages"),C,!C),G=this.addCheckbox(n,mxResources.get("layers"),!0),E=this.addCheckbox(n,mxResources.get("tags"),!0),H=this.addCheckbox(n,mxResources.get("lightbox"),!0),M=null;if(EditorUi.enableHtmlEditOption){M=this.addEditButton(n,H);var L=M.getEditInput();L.style.marginBottom="16px";z+=50;mxEvent.addListener(H,"change",function(){H.checked?L.removeAttribute("disabled"):-L.setAttribute("disabled","disabled");L.checked&&H.checked?M.getEditSelect().removeAttribute("disabled"):M.getEditSelect().setAttribute("disabled","disabled")})}c=new CustomDialog(this,n,mxUtils.bind(this,function(){l(D.checked?g:null,U.checked,O.value,Q.getTarget(),Q.getColor(),p.checked,q.checked,G.checked,E.checked,H.checked,null!=M?M.getLink():null,null!=S?S.value:null)}),null,c,e);this.showDialog(c.container,340,z,!0,!0);u.focus()};EditorUi.prototype.showPublishLinkDialog=function(c,e,g,l,n,+var p=this.addCheckbox(n,mxResources.get("fit"),!0);C=null!=this.pages&&1<this.pages.length;var q=q=this.addCheckbox(n,mxResources.get("allPages"),C,!C),G=this.addCheckbox(n,mxResources.get("layers"),!0),E=this.addCheckbox(n,mxResources.get("tags"),!0),H=this.addCheckbox(n,mxResources.get("lightbox"),!0),L=null;if(EditorUi.enableHtmlEditOption){L=this.addEditButton(n,H);var K=L.getEditInput();K.style.marginBottom="16px";z+=50;mxEvent.addListener(H,"change",function(){H.checked?K.removeAttribute("disabled"):+K.setAttribute("disabled","disabled");K.checked&&H.checked?L.getEditSelect().removeAttribute("disabled"):L.getEditSelect().setAttribute("disabled","disabled")})}c=new CustomDialog(this,n,mxUtils.bind(this,function(){l(D.checked?g:null,U.checked,O.value,Q.getTarget(),Q.getColor(),p.checked,q.checked,G.checked,E.checked,H.checked,null!=L?L.getLink():null,null!=S?S.value:null)}),null,c,e);this.showDialog(c.container,340,z,!0,!0);u.focus()};EditorUi.prototype.showPublishLinkDialog=function(c,e,g,l,n,u,z,D,C,A,Q){var S=document.createElement("div");S.style.whiteSpace="nowrap";var U=document.createElement("h3");mxUtils.write(U,c||mxResources.get("publish"));U.style.width="100%";U.style.textAlign="center";U.style.marginTop="2px";U.style.marginBottom="20px";S.appendChild(U);var O=document.createElement("select");c=30;O.className="geBtn";O.style.marginBottom="8px";O.style.marginLeft="0px";O.style.width="100%";O.style.boxSizing="border-box";if(null==D||""==D.getHash())n=null!=n?n:"https://www.drawio.com/doc/faq/publish-diagram-as-link",U=document.createElement("option"),mxUtils.write(U,mxResources.get("makeCopy")),U.setAttribute("value","copy"),O.appendChild(U);U=document.createElement("option");mxUtils.write(U,mxResources.get("authorizationRequired"));U.setAttribute("value","auth");O.appendChild(U);null!=D&&""!=D.getHash()||U.setAttribute("disabled","disabled");D=document.createElement("option");D.setAttribute("value","public");O.appendChild(D);null!=z?(mxUtils.write(D,mxResources.get("publicDiagramUrl")),D.setAttribute("title",z),O.value="public"):(mxUtils.write(D,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),D.setAttribute("disabled","disabled"));S.appendChild(O);mxUtils.br(S);O.focus();var p=null,q=null;if(null!=e||null!=g)c+=30,mxUtils.write(S,mxResources.get("width")+":"),p=document.createElement("input"),p.setAttribute("type","text"),p.style.marginRight="16px",p.style.width="50px",p.style.marginLeft="6px",p.style.marginRight="16px",p.style.marginBottom="10px",p.value="100%",S.appendChild(p),mxUtils.write(S,mxResources.get("height")+":"),q=document.createElement("input"),q.setAttribute("type","text"),q.style.width="50px",q.style.marginLeft="6px",q.style.marginBottom="10px",q.value=g+"px",S.appendChild(q),mxUtils.br(S);var G=this.addLinkSection(S,l),E=A?this.addCheckbox(S,mxResources.get("transparentBackground"),!1):null;null!=E&&(c+=20);var H=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(c+=30,e=null!=this.currentPage?this.currentPage.getName():-"",16<e.length&&(e=e.substring(0,16)+"..."),H=this.addCheckbox(S,mxResources.get("selectedPage")+": "+e));var M=document.createElement("select");M.style.maxWidth="260px";M.style.marginLeft="8px";M.style.marginTop="16px";e=document.createElement("option");e.setAttribute("value","0");mxUtils.write(e,mxResources.get("light"));M.appendChild(e);e=document.createElement("option");e.setAttribute("value","1");mxUtils.write(e,mxResources.get("dark"));M.appendChild(e);e=document.createElement("option");e.setAttribute("value",-"auto");mxUtils.write(e,mxResources.get("automatic"));e.setAttribute("selected","selected");M.appendChild(e);Q&&(mxUtils.write(S,mxResources.get("appearance")+":"),S.appendChild(M),mxUtils.br(S),c+=30);var L=this.addCheckbox(S,mxResources.get("lightbox"),!0,null,null,!l),k=this.addEditButton(S,L),y=k.getEditInput();l&&(y.style.marginLeft=L.style.marginLeft,L.style.display="none",c-=20);var F=this.addCheckbox(S,mxResources.get("layers"),!0);F.style.marginLeft=y.style.marginLeft;F.style.marginTop="8px";-var K=this.addCheckbox(S,mxResources.get("tags"),!0);K.style.marginLeft=y.style.marginLeft;K.style.marginBottom="16px";K.style.marginTop="16px";mxEvent.addListener(L,"change",function(){L.checked?(F.removeAttribute("disabled"),y.removeAttribute("disabled"),K.removeAttribute("disabled")):(F.setAttribute("disabled","disabled"),y.setAttribute("disabled","disabled"),K.setAttribute("disabled","disabled"));y.checked&&L.checked?k.getEditSelect().removeAttribute("disabled"):k.getEditSelect().setAttribute("disabled",-"disabled")});l=new CustomDialog(this,S,mxUtils.bind(this,function(){C(G.getTarget(),G.getColor(),null==H?!1:H.checked,L.checked,k.getLink(),F.checked,null!=p?p.value:null,null!=q?q.value:null,K.checked,O.value,null!=E?E.checked:!1,M.value)}),null,mxResources.get("create"),n,u);this.showDialog(l.container,340,296+c,!0,!0);null!=p?(p.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?p.select():document.execCommand("selectAll",!1,null)):null==O.parentNode;G.focus()};EditorUi.prototype.showRemoteExportDialog=+"",16<e.length&&(e=e.substring(0,16)+"..."),H=this.addCheckbox(S,mxResources.get("selectedPage")+": "+e));var L=document.createElement("select");L.style.maxWidth="260px";L.style.marginLeft="8px";L.style.marginTop="16px";e=document.createElement("option");e.setAttribute("value","0");mxUtils.write(e,mxResources.get("light"));L.appendChild(e);e=document.createElement("option");e.setAttribute("value","1");mxUtils.write(e,mxResources.get("dark"));L.appendChild(e);e=document.createElement("option");e.setAttribute("value",+"auto");mxUtils.write(e,mxResources.get("automatic"));e.setAttribute("selected","selected");L.appendChild(e);Q&&(mxUtils.write(S,mxResources.get("appearance")+":"),S.appendChild(L),mxUtils.br(S),c+=30);var K=this.addCheckbox(S,mxResources.get("lightbox"),!0,null,null,!l),k=this.addEditButton(S,K),y=k.getEditInput();l&&(y.style.marginLeft=K.style.marginLeft,K.style.display="none",c-=20);var F=this.addCheckbox(S,mxResources.get("layers"),!0);F.style.marginLeft=y.style.marginLeft;F.style.marginTop="8px";+var M=this.addCheckbox(S,mxResources.get("tags"),!0);M.style.marginLeft=y.style.marginLeft;M.style.marginBottom="16px";M.style.marginTop="16px";mxEvent.addListener(K,"change",function(){K.checked?(F.removeAttribute("disabled"),y.removeAttribute("disabled"),M.removeAttribute("disabled")):(F.setAttribute("disabled","disabled"),y.setAttribute("disabled","disabled"),M.setAttribute("disabled","disabled"));y.checked&&K.checked?k.getEditSelect().removeAttribute("disabled"):k.getEditSelect().setAttribute("disabled",+"disabled")});l=new CustomDialog(this,S,mxUtils.bind(this,function(){C(G.getTarget(),G.getColor(),null==H?!1:H.checked,K.checked,k.getLink(),F.checked,null!=p?p.value:null,null!=q?q.value:null,M.checked,O.value,null!=E?E.checked:!1,L.value)}),null,mxResources.get("create"),n,u);this.showDialog(l.container,340,296+c,!0,!0);null!=p?(p.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?p.select():document.execCommand("selectAll",!1,null)):null==O.parentNode;G.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,e,g,l,n){var u=document.createElement("div");u.style.whiteSpace="nowrap";var z=document.createElement("h3");mxUtils.write(z,mxResources.get("image"));z.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(n?"10":"4")+"px";u.appendChild(z);if(n){mxUtils.write(u,mxResources.get("zoom")+":");var D=document.createElement("input");D.setAttribute("type","text");D.style.marginRight="16px";D.style.width="60px";D.style.marginLeft="4px";D.style.marginRight="12px";D.value=this.lastExportZoom||"100%";u.appendChild(D);mxUtils.write(u,mxResources.get("borderWidth")+":");var C=document.createElement("input");C.setAttribute("type","text");C.style.marginRight="16px";C.style.width="60px";C.style.marginLeft="4px";C.value=this.lastExportBorder||"0";u.appendChild(C);mxUtils.br(u)}var A=this.addCheckbox(u,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),Q=l?null:this.addCheckbox(u,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);z=this.editor.graph;var S=l?null:this.addCheckbox(u,mxResources.get("transparentBackground"),z.background==mxConstants.NONE||null==z.background);null!=S&&(S.style.marginBottom="16px");c=new CustomDialog(this,u,mxUtils.bind(this,function(){var U=parseInt(D.value)/100||1,O=parseInt(C.value)||0;g(!A.checked,null!=Q?Q.checked:!1,null!=S?S.checked:!1,U,O)}),null,c,e);this.showDialog(c.container,300,(n?25:0)+(l?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(c,e,g,l,n,u,z,D,C){z=null!=z?z:Editor.defaultIncludeDiagram;@@ -13150,13 +13154,13 @@ var A=document.createElement("div");A.style.whiteSpace="nowrap";var Q=this.edito"100%";A.appendChild(O);mxUtils.write(A,mxResources.get("borderWidth")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.marginRight="16px";p.style.width="60px";p.style.marginLeft="4px";p.value=this.lastExportBorder||"0";A.appendChild(p);mxUtils.br(A);var q=this.addCheckbox(A,mxResources.get("selectionOnly"),!1,Q.isSelectionEmpty()),G=document.createElement("input");G.style.marginTop="16px";G.style.marginRight="8px";G.style.marginLeft="24px";G.setAttribute("disabled","disabled");G.setAttribute("type","checkbox");var E=document.createElement("select");E.style.marginTop="16px";E.style.marginLeft="8px";c=["selectionOnly","diagram","page"];for(U=0;U<c.length;U++)if(!Q.isSelectionEmpty()||"selectionOnly"!=c[U]){var H=document.createElement("option");mxUtils.write(H,mxResources.get(c[U]));H.setAttribute("value",c[U]);E.appendChild(H)}C?(mxUtils.write(A,mxResources.get("size")+":"),A.appendChild(E),mxUtils.br(A),S+=26,mxEvent.addListener(E,"change",function(){"selectionOnly"==E.value&&(q.checked=!0)})):u&&(A.appendChild(G),mxUtils.write(A,mxResources.get("crop")),mxUtils.br(A),S+=30,mxEvent.addListener(q,"change",function(){q.checked?G.removeAttribute("disabled"):G.setAttribute("disabled","disabled")}));Q.isSelectionEmpty()?C&&(q.style.display="none",q.nextSibling.style.display="none",q.nextSibling.nextSibling.style.display="none",S-=30):(E.value="diagram",G.setAttribute("checked","checked"),G.defaultChecked=!0,mxEvent.addListener(q,"change",function(){E.value=q.checked?-"selectionOnly":"diagram"}));var M=this.addCheckbox(A,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=D&&"webp"!=D),L=document.createElement("select");L.style.maxWidth="260px";L.style.marginLeft="8px";L.style.marginTop="16px";u=document.createElement("option");u.setAttribute("value","light");mxUtils.write(u,mxResources.get("light"));L.appendChild(u);C=document.createElement("option");C.setAttribute("value","dark");mxUtils.write(C,mxResources.get("dark"));L.appendChild(C);"svg"==D&&mxUtils.lightDarkColorSupported?-(u=document.createElement("option"),u.setAttribute("value","auto"),mxUtils.write(u,mxResources.get("automatic")),u.setAttribute("selected","selected"),L.appendChild(u)):Editor.isDarkMode()?C.setAttribute("selected","selected"):u.setAttribute("selected","selected");mxUtils.write(A,mxResources.get("appearance")+":");A.appendChild(L);mxUtils.br(A);S+=26;var k=this.addCheckbox(A,mxResources.get("shadow"),Q.shadowVisible),y=null;if("png"==D||"jpeg"==D||"webp"==D)y=this.addCheckbox(A,mxResources.get("grid"),-!1,this.isOffline()||!this.canvasSupported,!1,!0),S+=30;var F=this.addCheckbox(A,mxResources.get("includeCopyOfMyDiagram")+":",z,null,null,"jpeg"!=D&&"webp"!=D),K=document.createElement("select");K.style.maxWidth="260px";K.style.marginLeft="28px";"png"==D||"svg"==D?(z=function(){F.checked?K.removeAttribute("disabled"):K.setAttribute("disabled","disabled")},Q=document.createElement("option"),Q.setAttribute("value","allPages"),mxUtils.write(Q,mxResources.get("allPages")),K.appendChild(Q),Q=document.createElement("option"),-Q.setAttribute("value","currentPage"),mxUtils.write(Q,mxResources.get("currentPage")),K.appendChild(Q),F.style.marginBottom="12px",K.style.marginBottom="16px",A.appendChild(K),mxUtils.br(A),S+=20,null!=this.lastEmbedInclude&&(K.value=this.lastEmbedInclude),mxEvent.addListener(F,"change",z),z()):F.style.marginBottom="16px";var P=document.createElement("input");P.style.marginBottom="16px";P.style.marginRight="8px";P.setAttribute("type","checkbox");var R=document.createElement("input");R.style.marginBottom=+"selectionOnly":"diagram"}));var L=this.addCheckbox(A,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=D&&"webp"!=D),K=document.createElement("select");K.style.maxWidth="260px";K.style.marginLeft="8px";K.style.marginTop="16px";u=document.createElement("option");u.setAttribute("value","light");mxUtils.write(u,mxResources.get("light"));K.appendChild(u);C=document.createElement("option");C.setAttribute("value","dark");mxUtils.write(C,mxResources.get("dark"));K.appendChild(C);"svg"==D&&mxUtils.lightDarkColorSupported?+(u=document.createElement("option"),u.setAttribute("value","auto"),mxUtils.write(u,mxResources.get("automatic")),u.setAttribute("selected","selected"),K.appendChild(u)):Editor.isDarkMode()?C.setAttribute("selected","selected"):u.setAttribute("selected","selected");mxUtils.write(A,mxResources.get("appearance")+":");A.appendChild(K);mxUtils.br(A);S+=26;var k=this.addCheckbox(A,mxResources.get("shadow"),Q.shadowVisible),y=null;if("png"==D||"jpeg"==D||"webp"==D)y=this.addCheckbox(A,mxResources.get("grid"),+!1,this.isOffline()||!this.canvasSupported,!1,!0),S+=30;var F=this.addCheckbox(A,mxResources.get("includeCopyOfMyDiagram")+":",z,null,null,"jpeg"!=D&&"webp"!=D),M=document.createElement("select");M.style.maxWidth="260px";M.style.marginLeft="28px";"png"==D||"svg"==D?(z=function(){F.checked?M.removeAttribute("disabled"):M.setAttribute("disabled","disabled")},Q=document.createElement("option"),Q.setAttribute("value","allPages"),mxUtils.write(Q,mxResources.get("allPages")),M.appendChild(Q),Q=document.createElement("option"),+Q.setAttribute("value","currentPage"),mxUtils.write(Q,mxResources.get("currentPage")),M.appendChild(Q),F.style.marginBottom="12px",M.style.marginBottom="16px",A.appendChild(M),mxUtils.br(A),S+=20,null!=this.lastEmbedInclude&&(M.value=this.lastEmbedInclude),mxEvent.addListener(F,"change",z),z()):F.style.marginBottom="16px";var P=document.createElement("input");P.style.marginBottom="16px";P.style.marginRight="8px";P.setAttribute("type","checkbox");var R=document.createElement("input");R.style.marginBottom="16px";R.style.marginRight="8px";R.setAttribute("type","checkbox");e&&(P.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,A.appendChild(P),mxUtils.write(A,mxResources.get("embedImages")),mxUtils.br(A),R.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,A.appendChild(R),mxUtils.write(A,mxResources.get("embedFonts")),mxUtils.br(A),S+=50);var T=document.createElement("select");T.style.maxWidth="260px";T.style.marginLeft="8px";u=document.createElement("option");u.setAttribute("value","auto");mxUtils.write(u,mxResources.get("automatic"));T.appendChild(u);z=document.createElement("option");z.setAttribute("value","blank");mxUtils.write(z,mxResources.get("openInNewWindow"));T.appendChild(z);z=document.createElement("option");z.setAttribute("value","self");mxUtils.write(z,mxResources.get("openInThisWindow"));T.appendChild(z);z=document.createElement("div");mxUtils.write(z,mxResources.get("LinksLost"));z.style.margin="7px";z.style.display="none";"svg"==D&&(mxUtils.write(A,mxResources.get("links")+-":"),A.appendChild(T),A.appendChild(z),mxUtils.br(A),mxUtils.br(A),S+=50);g=new CustomDialog(this,A,mxUtils.bind(this,function(){this.lastExportBorder=p.value;this.lastExportZoom=O.value;this.lastEmbedImages=P.checked;this.lastEmbedFonts=R.checked;this.lastEmbedInclude=K.value;n(O.value,M.checked,!q.checked,k.checked,F.checked,P.checked&&e,p.value,G.checked,("png"==D||"svg"==D)&&"currentPage"==K.value,T.value,null!=y?y.checked:null,null!=L?L.value:null,E.value,R.checked)}),null,g,l);this.showDialog(g.container,+":"),A.appendChild(T),A.appendChild(z),mxUtils.br(A),mxUtils.br(A),S+=50);g=new CustomDialog(this,A,mxUtils.bind(this,function(){this.lastExportBorder=p.value;this.lastExportZoom=O.value;this.lastEmbedImages=P.checked;this.lastEmbedFonts=R.checked;this.lastEmbedInclude=M.value;n(O.value,L.checked,!q.checked,k.checked,F.checked,P.checked&&e,p.value,G.checked,("png"==D||"svg"==D)&&"currentPage"==M.value,T.value,null!=y?y.checked:null,null!=K?K.value:null,E.value,R.checked)}),null,g,l);this.showDialog(g.container,340,S,!0,!0,null,null,null,null,!0);O.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?O.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,e,g,l,n){var u=document.createElement("div");u.style.whiteSpace="nowrap";var z=this.editor.graph;if(null!=e){var D=document.createElement("h3");mxUtils.write(D,e);D.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";u.appendChild(D)}var C=this.addCheckbox(u,mxResources.get("fit"),!0),A=this.addCheckbox(u,mxResources.get("shadow"),z.shadowVisible&&l,!l),Q=this.addCheckbox(u,g),S=this.addCheckbox(u,mxResources.get("lightbox"),!0),U=this.addEditButton(u,S),O=U.getEditInput(),p=1<z.model.getChildCount(z.model.getRoot()),q=this.addCheckbox(u,mxResources.get("layers"),p,!p);q.style.marginLeft=O.style.marginLeft;q.style.marginBottom="12px";q.style.marginTop="8px";mxEvent.addListener(S,"change",function(){S.checked?(p&&q.removeAttribute("disabled"),O.removeAttribute("disabled")):(q.setAttribute("disabled","disabled"),O.setAttribute("disabled","disabled"));O.checked&&S.checked?U.getEditSelect().removeAttribute("disabled"):U.getEditSelect().setAttribute("disabled","disabled")});e=new CustomDialog(this,u,mxUtils.bind(this,function(){c(C.checked,A.checked,Q.checked,S.checked,U.getLink(),q.checked)}),null,mxResources.get("embed"),n);this.showDialog(e.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,e,g,l,n,u,z,D){function C(O){var p=" ",q="";l&&(p=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+@@ -13178,8 +13182,8 @@ g=null!=g?g:O;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.ediEditorUi.prototype.isCorsEnabledForUrl=function(c){return this.editor.isCorsEnabledForUrl(c)};EditorUi.prototype.addLocalPagesToMapping=function(c){c=null!=c?c:{};if(null!=this.pages)for(var e=0;e<this.pages.length;e++)c[this.pages[e].getId()]=this.pages[e].getId();return c};EditorUi.prototype.importXml=function(c,e,g,l,n,u,z){e=null!=e?e:0;g=null!=g?g:0;var D=[];try{var C=this.editor.graph;if(null!=c&&0<c.length){C.model.beginUpdate();try{var A=mxUtils.parseXml(c);c={};var Q=this.editor.extractGraphModel(A.documentElement,null!=this.pages);if(null!=Q&&"mxfile"==Q.nodeName&&null!=this.pages){var S=Q.getElementsByTagName("diagram");if(1==S.length&&!u){if(Q=Editor.parseDiagramNode(S[0]),null!=this.currentPage&&(c[S[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var U=S[0].getAttribute("name");null!=U&&""!=U&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,U))}}else if(0<S.length){u=[];var O=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(c[S[0].getAttribute("id")]=this.pages[0].getId(),U=S[0].getAttribute("name"),null!=U&&""!=U&&this.editor.graph.model.execute(new RenamePage(this,this.pages[0],U)),Q=Editor.parseDiagramNode(S[0]),l=!1,O=1);for(;O<S.length;O++){var p=S[O].getAttribute("id");S[O].removeAttribute("id");var q=this.updatePageRoot(new DiagramPage(S[O]));c[p]=S[O].getAttribute("id");var G=this.pages.length;null==q.getName()&&q.setName(mxResources.get("pageWithNumber",[G+1]));C.model.execute(new ChangePage(this,q,q,G,!0));u.push(q)}this.updatePageLinks(c,-u)}}if(null!=Q&&"mxGraphModel"===Q.nodeName){D=C.importGraphModel(Q,e,g,l);if(null!=D)for(this.addLocalPagesToMapping(c),O=0;O<D.length;O++)this.updatePageLinksForCell(c,D[O]);var E=C.parseBackgroundImage(Q.getAttribute("backgroundImage"));if(null!=E&&null!=E.originalSrc){this.updateBackgroundPageLink(c,E);var H=new ChangePageSetup(this,null,E);H.ignoreColor=!0;C.model.execute(H)}}z&&C.pasteCellStyles(C.includeDescendants(D),C.defaultVertexStyle,C.defaultEdgeStyle)}finally{C.model.endUpdate()}}}catch(M){if(n)throw M;-this.handleError(M)}return D};EditorUi.prototype.updatePageLinks=function(c,e){for(var g=0;g<e.length;g++)this.updatePageLinksForCell(c,e[g].root),null!=e[g].viewState&&this.updateBackgroundPageLink(c,e[g].viewState.backgroundImage)};EditorUi.prototype.updateBackgroundPageLink=function(c,e){try{if(null!=e&&Graph.isPageLink(e.originalSrc)){var g=c[e.originalSrc.substring(e.originalSrc.indexOf(",")+1)];null!=g&&(e.originalSrc="data:page/id,"+g)}}catch(l){}};EditorUi.prototype.updatePageLinksForCell=+u)}}if(null!=Q&&"mxGraphModel"===Q.nodeName){D=C.importGraphModel(Q,e,g,l);if(null!=D)for(this.addLocalPagesToMapping(c),O=0;O<D.length;O++)this.updatePageLinksForCell(c,D[O]);var E=C.parseBackgroundImage(Q.getAttribute("backgroundImage"));if(null!=E&&null!=E.originalSrc){this.updateBackgroundPageLink(c,E);var H=new ChangePageSetup(this,null,E);H.ignoreColor=!0;C.model.execute(H)}}z&&C.pasteCellStyles(C.includeDescendants(D),C.defaultVertexStyle,C.defaultEdgeStyle)}finally{C.model.endUpdate()}}}catch(L){if(n)throw L;+this.handleError(L)}return D};EditorUi.prototype.updatePageLinks=function(c,e){for(var g=0;g<e.length;g++)this.updatePageLinksForCell(c,e[g].root),null!=e[g].viewState&&this.updateBackgroundPageLink(c,e[g].viewState.backgroundImage)};EditorUi.prototype.updateBackgroundPageLink=function(c,e){try{if(null!=e&&Graph.isPageLink(e.originalSrc)){var g=c[e.originalSrc.substring(e.originalSrc.indexOf(",")+1)];null!=g&&(e.originalSrc="data:page/id,"+g)}}catch(l){}};EditorUi.prototype.updatePageLinksForCell=function(c,e){var g=document.createElement("div"),l=this.editor.graph,n=l.getLinkForCell(e);null!=n&&l.setLinkForCell(e,this.updatePageLink(c,n));if(l.isHtmlLabel(e)){g.innerHTML=Graph.sanitizeHtml(l.getLabel(e));for(var u=g.getElementsByTagName("a"),z=!1,D=0;D<u.length;D++)n=u[D].getAttribute("href"),null!=n&&(u[D].setAttribute("href",this.updatePageLink(c,n)),z=!0);z&&l.labelChanged(e,g.innerHTML)}for(D=0;D<l.model.getChildCount(e);D++)this.updatePageLinksForCell(c,l.model.getChildAt(e,D))};EditorUi.prototype.updatePageLink=function(c,e){if(Graph.isPageLink(e)){var g=c[e.substring(e.indexOf(",")+1)];e=null!=g?"data:page/id,"+g:null}else if("data:action/json,"==e.substring(0,17))try{var l=JSON.parse(e.substring(17));if(null!=l.actions){for(var n=0;n<l.actions.length;n++){var u=l.actions[n];if(null!=u.open&&Graph.isPageLink(u.open)){var z=u.open.substring(u.open.indexOf(",")+1);g=c[z];null!=g?u.open="data:page/id,"+g:null==this.getPageById(z)&&delete u.open}}e="data:action/json,"+JSON.stringify(l)}}catch(D){}return e};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,e,g,l,n){var u=mxUtils.bind(this,function(z){this.loadingExtensions=!1;null!=g?g(z):this.handleError(z)});this.createTimeout(null,mxUtils.bind(this,function(z){l=null!=l?l:c.name;var D=mxUtils.bind(this,function(A){z.clear()&&u(A)}),C=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var A=this.isRemoteVisioFormat(l);@@ -13219,58 +13223,58 @@ mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",n,null,null,null,g))};Enull!=Q&&0<Q.length&&(O=this.importXml(Q,g,l,A,null,null!=S?mxEvent.isControlDown(S):null),C=!0)),C||(C=this.editor.graph,Q=c.indexOf(";"),0<Q&&(c=c.substring(0,Q)+c.substring(c.indexOf(",",Q+1))),A&&C.isGridEnabled()&&(g=C.snap(g),l=C.snap(l)),Q="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;","image/svg"==e.substring(0,9)&&(Q+="editableCssRules=.*;"),O=[C.insertVertex(null,null,"",g,l,n,u,Q+"image="+c+";")])):/(\.*<graphml )/.test(c)?(U=!0,this.importGraphML(c,p)):null!=C&&null!=z&&EditorUi.isVisioFilename(z)?(U=!0,this.importVisio(C,p)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,z)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(U=!0,e=mxUtils.bind(this,function(q){4==q.readyState&&(200<=q.status&&299>=q.status?p(q.responseText):null!=D&&(D(null),this.showError(mxResources.get("error"),413==q.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),null!=c?this.parseFileData(c,e,z):this.parseFile(C,e,z)):0==c.indexOf("PK")&&null!=C?(U=!0,this.importZipFile(C,p,mxUtils.bind(this,function(){O=this.insertTextAt(this.validateFileData(c),g,l,!0,null,A);D(O)}))):/(\.v(sd|dx))($|\?)/i.test(z)||/(\.vs(s|x))($|\?)/i.test(z)||(O=this.insertTextAt(this.validateFileData(c),g,l,!0,null,A,null,null!=S?mxEvent.isControlDown(S):null));U||null==D||D(O);return O};EditorUi.prototype.importFiles=function(c,e,g,l,n,u,z,D,C,A,Q,S,U){l=null!=l?l:this.maxImageSize;-A=null!=A?A:this.maxImageBytes;var O=null!=e&&null!=g,p=!0;e=null!=e?e:0;g=null!=g?g:0;var q=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var G=Q||this.resampleThreshold,E=0;E<c.length;E++)if("image/svg"!==c[E].type.substring(0,9)&&"image/"===c[E].type.substring(0,6)&&c[E].size>G){q=!0;break}var H=mxUtils.bind(this,function(){var M=this.editor.graph,L=M.gridSize;n=null!=n?n:mxUtils.bind(this,function(R,T,V,W,X,Z,Y,da,ea){try{if(null!=R&&"<mxlibrary"==R.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,-R,Y)),this.showSidebar(),null;this.isCompatibleString(R)&&1==c.length&&null!=U&&"drop"==U.type&&this.isBlankFile()&&!this.canUndo()&&(O=!1,W=V=0);return this.importFile(R,T,V,W,X,Z,Y,da,ea,O,S,U)}catch(ka){return this.handleError(ka),null}});u=null!=u?u:mxUtils.bind(this,function(R){M.setSelectionCells(R)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var k=c.length,y=k,F=[],K=mxUtils.bind(this,function(R,T){F[R]=T;if(0==--y){this.spinner.stop();if(null!=D)D(F);else{var V=[];-M.getModel().beginUpdate();try{for(R=0;R<F.length;R++){var W=F[R]();null!=W&&(V=V.concat(W))}}finally{M.getModel().endUpdate()}}u(V)}}),P=0;P<k;P++)mxUtils.bind(this,function(R){var T=c[R];if(null!=T){var V=new FileReader;V.onload=mxUtils.bind(this,function(W){if(null==z||z(T))try{if("image/"==T.type.substring(0,6))if("image/svg"==T.type.substring(0,9)){var X=Graph.clipSvgDataUri(W.target.result),Z=X.indexOf(","),Y=decodeURIComponent(escape(atob(X.substring(Z+1)))),da=mxUtils.parseXml(Y),ea=da.getElementsByTagName("svg");-if(0<ea.length){var ka=ea[0],ba=S?null:ka.getAttribute("content");null!=ba&&"<"!=ba.charAt(0)&&"%"!=ba.charAt(0)&&(ba=unescape(window.atob?atob(ba):Base64.decode(ba,!0)));null!=ba&&"%"==ba.charAt(0)&&(ba=decodeURIComponent(ba));null==ba||"<mxfile "!==ba.substring(0,8)&&"<mxGraphModel "!==ba.substring(0,14)?K(R,mxUtils.bind(this,function(){try{if(null!=da){var ia=da.getElementsByTagName("svg");if(0<ia.length){var fa=ia[0],ca=fa.getAttribute("width"),Ba=fa.getAttribute("height");ca=null!=ca&&"%"!=ca.charAt(ca.length--1)?parseFloat(ca):NaN;Ba=null!=Ba&&"%"!=Ba.charAt(Ba.length-1)?parseFloat(Ba):NaN;var la=fa.getAttribute("viewBox");if(null==la||0==la.length)fa.setAttribute("viewBox","0 0 "+ca+" "+Ba);else if(isNaN(ca)||isNaN(Ba)){var xa=la.split(" ");3<xa.length&&(ca=parseFloat(xa[2]),Ba=parseFloat(xa[3]))}X=Editor.createSvgDataUri(mxUtils.getXml(fa));var Aa=Math.min(1,Math.min(l/Math.max(1,ca)),l/Math.max(1,Ba)),ma=n(X,T.type,e+R*L,g+R*L,Math.max(1,Math.round(ca*Aa)),Math.max(1,Math.round(Ba*Aa)),T.name);if(null!=-ma&&(isNaN(ca)||isNaN(Ba))){var ua=new Image;ua.onload=mxUtils.bind(this,function(){ca=Math.max(1,ua.width);Ba=Math.max(1,ua.height);ma[0].geometry.width=ca;ma[0].geometry.height=Ba;fa.setAttribute("viewBox","0 0 "+ca+" "+Ba);X=Editor.createSvgDataUri(mxUtils.getXml(fa));var ra=X.indexOf(";");0<ra&&(X=X.substring(0,ra)+X.substring(X.indexOf(",",ra+1)));M.setCellStyles("image",X,[ma[0]])});ua.src=Editor.createSvgDataUri(mxUtils.getXml(fa))}return ma}}}catch(ra){}return null})):K(R,mxUtils.bind(this,-function(){return n(ba,"text/xml",e+R*L,g+R*L,0,0,T.name)}))}else K(R,mxUtils.bind(this,function(){return null}))}else{Z=!1;if("image/png"==T.type){var ha=S?null:this.extractGraphModelFromPng(W.target.result);if(null!=ha&&0<ha.length){var aa=new Image;aa.src=W.target.result;K(R,mxUtils.bind(this,function(){return n(ha,"text/xml",e+R*L,g+R*L,aa.width,aa.height,T.name)}));Z=!0}}Z||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),-mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(W.target.result,mxUtils.bind(this,function(ia){this.resizeImage(ia,W.target.result,mxUtils.bind(this,function(fa,ca,Ba){K(R,mxUtils.bind(this,function(){if(null!=fa&&fa.length<A){var la=p&&this.isResampleImageSize(T.size,Q)?Math.min(1,Math.min(l/ca,l/Ba)):1;return n(fa,T.type,e+R*L,g+R*L,Math.round(ca*la),Math.round(Ba*la),T.name)}this.handleError({message:mxResources.get("imageTooBig")});-return null}))}),p,l,Q,T.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else X=W.target.result,n(X,T.type,e+R*L,g+R*L,240,160,T.name,function(ia){K(R,function(){return ia})},T)}catch(ia){K(R,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(ia,T)}else K(R,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(T.name)?n(null,T.type,e+R*L,g+R*L,240,160,T.name,function(W){K(R,function(){return W})},-T):"image"==T.type.substring(0,5)||"application/pdf"==T.type?V.readAsDataURL(T):V.readAsText(T)}})(P)});if(q){q=[];for(E=0;E<c.length;E++)q.push(c[E]);c=q;this.confirmImageResize(function(M){p=M;H()},C)}else H()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=function(c,e){e=null!=e?e:!1;var g=null!=this.spinner&&null!=this.spinner.pause?+A=null!=A?A:this.maxImageBytes;var O=null!=e&&null!=g,p=!0;e=null!=e?e:0;g=null!=g?g:0;var q=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var G=Q||this.resampleThreshold,E=0;E<c.length;E++)if("image/svg"!==c[E].type.substring(0,9)&&"image/"===c[E].type.substring(0,6)&&c[E].size>G){q=!0;break}var H=mxUtils.bind(this,function(){var L=this.editor.graph,K=L.gridSize;n=null!=n?n:mxUtils.bind(this,function(R,T,V,W,X,Y,Z,da,ea){try{if(null!=R&&"<mxlibrary"==R.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,+R,Z)),this.showSidebar(),null;this.isCompatibleString(R)&&1==c.length&&null!=U&&"drop"==U.type&&this.isBlankFile()&&!this.canUndo()&&(O=!1,W=V=0);return this.importFile(R,T,V,W,X,Y,Z,da,ea,O,S,U)}catch(ka){return this.handleError(ka),null}});u=null!=u?u:mxUtils.bind(this,function(R){L.setSelectionCells(R)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var k=c.length,y=k,F=[],M=mxUtils.bind(this,function(R,T){F[R]=T;if(0==--y){this.spinner.stop();if(null!=D)D(F);else{var V=[];+L.getModel().beginUpdate();try{for(R=0;R<F.length;R++){var W=F[R]();null!=W&&(V=V.concat(W))}}finally{L.getModel().endUpdate()}}u(V)}}),P=0;P<k;P++)mxUtils.bind(this,function(R){var T=c[R];if(null!=T){var V=new FileReader;V.onload=mxUtils.bind(this,function(W){if(null==z||z(T))try{if("image/"==T.type.substring(0,6))if("image/svg"==T.type.substring(0,9)){var X=Graph.clipSvgDataUri(W.target.result),Y=X.indexOf(","),Z=decodeURIComponent(escape(atob(X.substring(Y+1)))),da=mxUtils.parseXml(Z),ea=da.getElementsByTagName("svg");+if(0<ea.length){var ka=ea[0],ba=S?null:ka.getAttribute("content");null!=ba&&"<"!=ba.charAt(0)&&"%"!=ba.charAt(0)&&(ba=unescape(window.atob?atob(ba):Base64.decode(ba,!0)));null!=ba&&"%"==ba.charAt(0)&&(ba=decodeURIComponent(ba));null==ba||"<mxfile "!==ba.substring(0,8)&&"<mxGraphModel "!==ba.substring(0,14)?M(R,mxUtils.bind(this,function(){try{if(null!=da){var ia=da.getElementsByTagName("svg");if(0<ia.length){var fa=ia[0],ca=fa.getAttribute("width"),Ba=fa.getAttribute("height");ca=null!=ca&&"%"!=ca.charAt(ca.length-+1)?parseFloat(ca):NaN;Ba=null!=Ba&&"%"!=Ba.charAt(Ba.length-1)?parseFloat(Ba):NaN;var la=fa.getAttribute("viewBox");if(null==la||0==la.length)fa.setAttribute("viewBox","0 0 "+ca+" "+Ba);else if(isNaN(ca)||isNaN(Ba)){var xa=la.split(" ");3<xa.length&&(ca=parseFloat(xa[2]),Ba=parseFloat(xa[3]))}X=Editor.createSvgDataUri(mxUtils.getXml(fa));var Aa=Math.min(1,Math.min(l/Math.max(1,ca)),l/Math.max(1,Ba)),ma=n(X,T.type,e+R*K,g+R*K,Math.max(1,Math.round(ca*Aa)),Math.max(1,Math.round(Ba*Aa)),T.name);if(null!=+ma&&(isNaN(ca)||isNaN(Ba))){var ua=new Image;ua.onload=mxUtils.bind(this,function(){ca=Math.max(1,ua.width);Ba=Math.max(1,ua.height);ma[0].geometry.width=ca;ma[0].geometry.height=Ba;fa.setAttribute("viewBox","0 0 "+ca+" "+Ba);X=Editor.createSvgDataUri(mxUtils.getXml(fa));var ra=X.indexOf(";");0<ra&&(X=X.substring(0,ra)+X.substring(X.indexOf(",",ra+1)));L.setCellStyles("image",X,[ma[0]])});ua.src=Editor.createSvgDataUri(mxUtils.getXml(fa))}return ma}}}catch(ra){}return null})):M(R,mxUtils.bind(this,+function(){return n(ba,"text/xml",e+R*K,g+R*K,0,0,T.name)}))}else M(R,mxUtils.bind(this,function(){return null}))}else{Y=!1;if("image/png"==T.type){var ha=S?null:this.extractGraphModelFromPng(W.target.result);if(null!=ha&&0<ha.length){var aa=new Image;aa.src=W.target.result;M(R,mxUtils.bind(this,function(){return n(ha,"text/xml",e+R*K,g+R*K,aa.width,aa.height,T.name)}));Y=!0}}Y||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),+mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(W.target.result,mxUtils.bind(this,function(ia){this.resizeImage(ia,W.target.result,mxUtils.bind(this,function(fa,ca,Ba){M(R,mxUtils.bind(this,function(){if(null!=fa&&fa.length<A){var la=p&&this.isResampleImageSize(T.size,Q)?Math.min(1,Math.min(l/ca,l/Ba)):1;return n(fa,T.type,e+R*K,g+R*K,Math.round(ca*la),Math.round(Ba*la),T.name)}this.handleError({message:mxResources.get("imageTooBig")});+return null}))}),p,l,Q,T.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else X=W.target.result,n(X,T.type,e+R*K,g+R*K,240,160,T.name,function(ia){M(R,function(){return ia})},T)}catch(ia){M(R,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(ia,T)}else M(R,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(T.name)?n(null,T.type,e+R*K,g+R*K,240,160,T.name,function(W){M(R,function(){return W})},+T):"image"==T.type.substring(0,5)||"application/pdf"==T.type?V.readAsDataURL(T):V.readAsText(T)}})(P)});if(q){q=[];for(E=0;E<c.length;E++)q.push(c[E]);c=q;this.confirmImageResize(function(L){p=L;H()},C)}else H()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=function(c,e){e=null!=e?e:!1;var g=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},l=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,n=function(u,z){if(u||e)mxSettings.setResizeImages(u?z:null),mxSettings.save();g();c(z)};null==l||e?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(u){n(u,!0)},function(u){n(u,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?226:200,!0,!0):n(!1,l)};EditorUi.prototype.parseFile=function(c,e,g){g=null!=g?g:c.name;var l=new FileReader;l.onload=mxUtils.bind(this,function(){this.parseFileData(l.result,e,g)});l.readAsText(c)};EditorUi.prototype.parseFileData=function(c,e,g){var l=new XMLHttpRequest;l.open("POST",OPEN_URL);l.setRequestHeader("Content-Type","application/x-www-form-urlencoded");l.onreadystatechange=function(){e(l)};l.send("format=xml&filename="+encodeURIComponent(g)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(n){}};EditorUi.prototype.isResampleImageSize=function(c,e){e=null!=e?e:this.resampleThreshold;return c>e};EditorUi.prototype.resizeImage=function(c,e,g,l,n,u,z){n=null!=n?n:this.maxImageSize;var D=Math.max(1,c.width),C=Math.max(1,c.height),A=e;if(l&&this.isResampleImageSize(null!=z?z:e.length,u))try{var Q=Math.max(D/n,C/n);if(1<Q){var S=Math.round(D/Q),U=Math.round(C/Q),O=document.createElement("canvas");O.width=S;O.height=U;O.getContext("2d").drawImage(c,0,0,S,U);var p=O.toDataURL();if(p.length<e.length){var q=document.createElement("canvas");q.width=S;q.height=U;var G=q.toDataURL();p!==G&&(e=p,D=S,C=U)}}}catch(E){}l&&A!=e&&n>this.maxImageSize/2&&e.length>this.maxImageBytes?this.resizeImage(c,e,g,l,n/1.5,u,z):g(e,D,C)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,e,g){try{var l=new Image;l.onload=function(){l.width=0<l.width?l.width:120;l.height=0<l.height?l.height:120;e(l)};null!=g&&(l.onerror=g);l.src=c}catch(n){if(null!=g)g(n);else throw n;}};EditorUi.prototype.getDefaultSketchMode=function(){var c="1"==urlParams.sketch;return"0"!=(null!=urlParams.rough?urlParams.rough:c)};var t=EditorUi.prototype.createUi;EditorUi.prototype.createUi=function(){Editor.isSettingsEnabled()&&(null!=mxSettings.settings.sidebarTitles&&(Sidebar.prototype.sidebarTitles=mxSettings.settings.sidebarTitles),this.formatWidth=mxSettings.getFormatWidth());t.apply(this,arguments);Editor.isSettingsEnabled()&&this.doSetSketchMode(null!=mxSettings.settings.sketchMode&&null==urlParams.rough&&null==urlParams.sketch?mxSettings.settings.sketchMode:this.getDefaultSketchMode())};var x=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();var c=this,e=this.editor.graph,g=e.isEnabled;e.isEnabled=function(){return g.apply(this,arguments)&&-!c.isLocked()};Graph.touchStyle&&(e.panningHandler.isPanningTrigger=function(L){var k=L.getEvent();return null==L.getState()&&!mxEvent.isMouseEvent(k)&&!e.freehand.isDrawing()||mxEvent.isPopupTrigger(k)&&(null==L.getState()||mxEvent.isControlDown(k)||mxEvent.isShiftDown(k))});e.cellEditor.editPlantUmlData=function(L,k,y){var F=JSON.parse(y);k=new TextareaDialog(c,mxResources.get("plantUml")+":",F.data,function(K){null!=K&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generatePlantUmlImage(K,-F.format,function(P,R,T){c.spinner.stop();e.getModel().beginUpdate();try{if("txt"==F.format)e.labelChanged(L,"<pre>"+P+"</pre>"),e.updateCellSize(L,!0);else{e.setCellStyles("image",c.convertDataUri(P),[L]);var V=e.model.getGeometry(L);null!=V&&(V=V.clone(),V.width=R,V.height=T,e.cellsResized([L],[V],!1))}e.setAttributeForCell(L,"plantUmlData",JSON.stringify({data:K,format:F.format}))}finally{e.getModel().endUpdate()}},function(P){c.handleError(P)})},null,null,400,220);c.showDialog(k.container,420,-300,!0,!0);k.init()};e.cellEditor.editMermaidData=function(L,k,y){var F=JSON.parse(y);k=new TextareaDialog(c,mxResources.get("mermaid")+":",F.data,function(K){null!=K&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generateMermaidImage(K,F.config,function(P,R,T){c.spinner.stop();e.getModel().beginUpdate();try{e.setCellStyles("image",P,[L]);var V=e.model.getGeometry(L);null!=V&&(V=V.clone(),V.width=Math.max(V.width,R),V.height=Math.max(V.height,T),e.cellsResized([L],[V],!1));e.setAttributeForCell(L,-"mermaidData",JSON.stringify({data:K,config:F.config},null,2))}finally{e.getModel().endUpdate()}},function(P){c.handleError(P)})},null,null,400,220);c.showDialog(k.container,420,300,!0,!0);k.init()};var l=e.cellEditor.startEditing;e.cellEditor.startEditing=function(L,k){try{var y=this.graph.getAttributeForCell(L,"plantUmlData");if(null!=y)this.editPlantUmlData(L,k,y);else if(y=this.graph.getAttributeForCell(L,"mermaidData"),null!=y&&window.isMermaidEnabled)this.editMermaidData(L,k,y);else{var F=e.getCellStyle(L);-"1"==mxUtils.getValue(F,"metaEdit","0")?c.showDataDialog(L):l.apply(this,arguments)}}catch(K){c.handleError(K)}};e.getLinkTitle=function(L){return c.getLinkTitle(L)};e.customLinkClicked=function(L,k){var y=!1;try{var F=this.getGraphBounds();c.handleCustomLink(L,k);y=!0;c.chromelessResize&&!F.equals(this.getGraphBounds())&&(c.chromelessResize(),this.scrollCellToVisible(k))}catch(K){c.handleError(K)}return y};var n=e.parseBackgroundImage;e.parseBackgroundImage=function(L){var k=n.apply(this,arguments);-null!=k&&null!=k.src&&Graph.isPageLink(k.src)&&(k={originalSrc:k.src});return k};var u=e.setBackgroundImage;e.setBackgroundImage=function(L){null!=L&&null!=L.originalSrc&&(L=c.createImageForPageLink(L.originalSrc,c.currentPage,this));u.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){e.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(){e.refreshBackgroundImage()}));this.editor.addListener("pagesPatched",mxUtils.bind(this,-function(L,k){L=null!=e.backgroundImage?e.backgroundImage.originalSrc:null;if(null!=L){var y=L.indexOf(",");if(0<y)for(L=L.substring(y+1),k=k.getProperty("patches"),y=0;y<k.length;y++)if(null!=k[y][EditorUi.DIFF_UPDATE]&&null!=k[y][EditorUi.DIFF_UPDATE][L]||null!=k[y][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(k[y][EditorUi.DIFF_REMOVE],L)){e.refreshBackgroundImage();break}}}));var z=e.getBackgroundImageObject;e.getBackgroundImageObject=function(L,k){var y=z.apply(this,arguments);null!=y&&null!=y.originalSrc&&-(y=k?c.createImageForPageLink(y.originalSrc,null,null,!0):{src:y.originalSrc});return y};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var D=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(L){L=null!=L?L:"";"1"==-urlParams.dev&&(L+=(0<L.length?"&":"?")+"dev=1");return D.apply(this,arguments)};var C=e.addClickHandler;e.addClickHandler=function(L,k,y){var F=k;k=function(K,P,R){if(null==P){var T=mxEvent.getSource(K);"a"==T.nodeName.toLowerCase()&&(P=T.getAttribute("href"))}null!=P&&e.isCustomLink(P)&&(mxEvent.isTouchEvent(K)||!mxEvent.isPopupTrigger(K))&&e.customLinkClicked(P,R)&&mxEvent.consume(K);null!=F&&F(K,P,R)};C.call(this,L,k,y)};x.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(e.view.canvas.ownerSVGElement,-null,!0);if(null!=this.menus){var A=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(L,k,y){e.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(L,["zoomIn","zoomOut","-"],null,y);A.apply(this,arguments);e.isSelectionEmpty()||null==c.addSelectionToScratchpad||this.addMenuItems(L,["-","addToScratchpad"],null,y);e.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(L,["-","exitGroup","home"],null,y)};var Q=Menus.prototype.addPopupMenuEditItems;-this.menus.addPopupMenuEditItems=function(L,k,y){if(c.editor.graph.isSelectionEmpty())Q.apply(this,arguments),c.menus.addMenuItems(L,["copyAsImage"],null,y);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(L,k,y):this.addPopupMenuArrangeItems(L,k,y),this.addMenuItems(L,"- cut copy copyAsImage duplicate -".split(" "),null,y),this.isShowCellEditItems()||this.addPopupDeleteItem(L,k,y),this.addMenuItems(L,["lockUnlock","-"],null,y),!this.isShowStyleItems()){if(1==e.getSelectionCount()&&!e.isCellLocked(k)&&-e.isCellEditable(k)&&(this.addSubmenu("editCell",L,null,mxResources.get("edit")),L.addSeparator(),e.getModel().isEdge(k))){this.addSubmenu("line",L);var F=e.getModel().getGeometry(k);null!=F&&null!=F.points&&0<F.points.length&&this.addMenuItems(L,["clearWaypoints"],null,y)}1==e.getSelectionCount()&&this.addMenuItems(L,["enterGroup"],null,y);F=c.getSelectionState();null!=F.mergeCell?this.addMenuItem(L,"mergeCells"):(1<F.style.colspan||1<F.style.rowspan)&&this.addMenuItem(L,"unmergeCells")}};this.menus.isShowStyleItems=+!c.isLocked()};Graph.touchStyle&&(e.panningHandler.isPanningTrigger=function(K){var k=K.getEvent();return null==K.getState()&&!mxEvent.isMouseEvent(k)&&!e.freehand.isDrawing()||mxEvent.isPopupTrigger(k)&&(null==K.getState()||mxEvent.isControlDown(k)||mxEvent.isShiftDown(k))});e.cellEditor.editPlantUmlData=function(K,k,y){var F=JSON.parse(y);k=new TextareaDialog(c,mxResources.get("plantUml")+":",F.data,function(M){null!=M&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generatePlantUmlImage(M,+F.format,function(P,R,T){c.spinner.stop();e.getModel().beginUpdate();try{if("txt"==F.format)e.labelChanged(K,"<pre>"+P+"</pre>"),e.updateCellSize(K,!0);else{e.setCellStyles("image",c.convertDataUri(P),[K]);var V=e.model.getGeometry(K);null!=V&&(V=V.clone(),V.width=R,V.height=T,e.cellsResized([K],[V],!1))}e.setAttributeForCell(K,"plantUmlData",JSON.stringify({data:M,format:F.format}))}finally{e.getModel().endUpdate()}},function(P){c.handleError(P)})},null,null,400,220);c.showDialog(k.container,420,+300,!0,!0);k.init()};e.cellEditor.editMermaidData=function(K,k,y){var F=JSON.parse(y);k=new TextareaDialog(c,mxResources.get("mermaid")+":",F.data,function(M){null!=M&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generateMermaidImage(M,F.config,function(P,R,T){c.spinner.stop();e.getModel().beginUpdate();try{e.setCellStyles("image",P,[K]);var V=e.model.getGeometry(K);null!=V&&(V=V.clone(),V.width=Math.max(V.width,R),V.height=Math.max(V.height,T),e.cellsResized([K],[V],!1));e.setAttributeForCell(K,+"mermaidData",JSON.stringify({data:M,config:F.config},null,2))}finally{e.getModel().endUpdate()}},function(P){c.handleError(P)})},null,null,400,220);c.showDialog(k.container,420,300,!0,!0);k.init()};var l=e.cellEditor.startEditing;e.cellEditor.startEditing=function(K,k){try{var y=this.graph.getAttributeForCell(K,"plantUmlData");if(null!=y)this.editPlantUmlData(K,k,y);else if(y=this.graph.getAttributeForCell(K,"mermaidData"),null!=y&&window.isMermaidEnabled)this.editMermaidData(K,k,y);else{var F=e.getCellStyle(K);+"1"==mxUtils.getValue(F,"metaEdit","0")?c.showDataDialog(K):l.apply(this,arguments)}}catch(M){c.handleError(M)}};e.getLinkTitle=function(K){return c.getLinkTitle(K)};e.customLinkClicked=function(K,k){var y=!1;try{var F=this.getGraphBounds();c.handleCustomLink(K,k);y=!0;c.chromelessResize&&!F.equals(this.getGraphBounds())&&(c.chromelessResize(),this.scrollCellToVisible(k))}catch(M){c.handleError(M)}return y};var n=e.parseBackgroundImage;e.parseBackgroundImage=function(K){var k=n.apply(this,arguments);+null!=k&&null!=k.src&&Graph.isPageLink(k.src)&&(k={originalSrc:k.src});return k};var u=e.setBackgroundImage;e.setBackgroundImage=function(K){null!=K&&null!=K.originalSrc&&(K=c.createImageForPageLink(K.originalSrc,c.currentPage,this));u.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){e.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(){e.refreshBackgroundImage()}));this.editor.addListener("pagesPatched",mxUtils.bind(this,+function(K,k){K=null!=e.backgroundImage?e.backgroundImage.originalSrc:null;if(null!=K){var y=K.indexOf(",");if(0<y)for(K=K.substring(y+1),k=k.getProperty("patches"),y=0;y<k.length;y++)if(null!=k[y][EditorUi.DIFF_UPDATE]&&null!=k[y][EditorUi.DIFF_UPDATE][K]||null!=k[y][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(k[y][EditorUi.DIFF_REMOVE],K)){e.refreshBackgroundImage();break}}}));var z=e.getBackgroundImageObject;e.getBackgroundImageObject=function(K,k){var y=z.apply(this,arguments);null!=y&&null!=y.originalSrc&&+(y=k?c.createImageForPageLink(y.originalSrc,null,null,!0):{src:y.originalSrc});return y};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var D=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(K){K=null!=K?K:"";"1"==+urlParams.dev&&(K+=(0<K.length?"&":"?")+"dev=1");return D.apply(this,arguments)};var C=e.addClickHandler;e.addClickHandler=function(K,k,y){var F=k;k=function(M,P,R){if(null==P){var T=mxEvent.getSource(M);"a"==T.nodeName.toLowerCase()&&(P=T.getAttribute("href"))}null!=P&&e.isCustomLink(P)&&(mxEvent.isTouchEvent(M)||!mxEvent.isPopupTrigger(M))&&e.customLinkClicked(P,R)&&mxEvent.consume(M);null!=F&&F(M,P,R)};C.call(this,K,k,y)};x.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(e.view.canvas.ownerSVGElement,+null,!0);if(null!=this.menus){var A=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(K,k,y){e.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(K,["zoomIn","zoomOut","-"],null,y);A.apply(this,arguments);e.isSelectionEmpty()||null==c.addSelectionToScratchpad||this.addMenuItems(K,["-","addToScratchpad"],null,y);e.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(K,["-","exitGroup","home"],null,y)};var Q=Menus.prototype.addPopupMenuEditItems;+this.menus.addPopupMenuEditItems=function(K,k,y){if(c.editor.graph.isSelectionEmpty())Q.apply(this,arguments),c.menus.addMenuItems(K,["copyAsImage"],null,y);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(K,k,y):this.addPopupMenuArrangeItems(K,k,y),this.addMenuItems(K,"- cut copy copyAsImage duplicate -".split(" "),null,y),this.isShowCellEditItems()||this.addPopupDeleteItem(K,k,y),this.addMenuItems(K,["lockUnlock","-"],null,y),!this.isShowStyleItems()){if(1==e.getSelectionCount()&&!e.isCellLocked(k)&&+e.isCellEditable(k)&&(this.addSubmenu("editCell",K,null,mxResources.get("edit")),K.addSeparator(),e.getModel().isEdge(k))){this.addSubmenu("line",K);var F=e.getModel().getGeometry(k);null!=F&&null!=F.points&&0<F.points.length&&this.addMenuItems(K,["clearWaypoints"],null,y)}1==e.getSelectionCount()&&this.addMenuItems(K,["enterGroup"],null,y);F=c.getSelectionState();null!=F.mergeCell?this.addMenuItem(K,"mergeCells"):(1<F.style.colspan||1<F.style.rowspan)&&this.addMenuItem(K,"unmergeCells")}};this.menus.isShowStyleItems=function(){return"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme};this.menus.isShowHistoryItems=function(){return"simple"!=Editor.currentTheme};this.menus.isShowArrangeItems=this.menus.isShowStyleItems;this.menus.isShowCellEditItems=this.menus.isShowStyleItems}this.dependsOnLanguage(mxUtils.bind(this,function(){this.defaultFilename=mxResources.get("untitledDiagram");this.defaultLibraryName=mxResources.get("untitledLibrary")}));var S=e.getExportVariables;e.getExportVariables=-function(){var L=S.apply(this,arguments),k=c.getCurrentFile();null!=k&&(L.filename=k.getTitle());L.pagecount=null!=c.pages?c.pages.length:1;L.page=null!=c.currentPage?c.currentPage.getName():"";L.pagenumber=null!=c.pages&&null!=c.currentPage?mxUtils.indexOf(c.pages,c.currentPage)+1:1;return L};var U=e.getGlobalVariable;e.getGlobalVariable=function(L){var k=c.getCurrentFile();return"filename"==L&&null!=k?k.getTitle():"page"==L&&null!=c.currentPage?c.currentPage.getName():"pagenumber"==L?null!=c.currentPage&&-null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+1:1:"pagecount"==L?null!=c.pages?c.pages.length:1:U.apply(this,arguments)};var O=null,p=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var L=this.getCurrentFile(),k=null!=L&&null!=L.getTitle()?L.getTitle():this.defaultFilename;O!=k&&L==p&&(e.invalidateDescendantsWithPlaceholders(e.model.getRoot()),e.view.validate());O=k;p=L}));var q=e.labelLinkClicked;e.labelLinkClicked=function(L,k,y){var F=k.getAttribute("href");if(null==-F||!e.isCustomLink(F)||!mxEvent.isTouchEvent(y)&&mxEvent.isPopupTrigger(y))q.apply(this,arguments);else{if(!e.isEnabled()||null!=L&&e.isCellLocked(L.cell))e.customLinkClicked(F),e.getRubberband().reset();mxEvent.consume(y)}};this.editor.getOrCreateFilename=function(){var L=c.defaultFilename,k=c.getCurrentFile();null!=k&&(L=null!=k.getTitle()?k.getTitle():L);return L};var G=this.actions.get("print");G.setEnabled(!mxClient.IS_IOS||!navigator.standalone);G.visible=G.isEnabled();if(!this.editor.chromeless||+function(){var K=S.apply(this,arguments),k=c.getCurrentFile();null!=k&&(K.filename=k.getTitle());K.pagecount=null!=c.pages?c.pages.length:1;K.page=null!=c.currentPage?c.currentPage.getName():"";K.pagenumber=null!=c.pages&&null!=c.currentPage?mxUtils.indexOf(c.pages,c.currentPage)+1:1;return K};var U=e.getGlobalVariable;e.getGlobalVariable=function(K){var k=c.getCurrentFile();return"filename"==K&&null!=k?k.getTitle():"page"==K&&null!=c.currentPage?c.currentPage.getName():"pagenumber"==K?null!=c.currentPage&&+null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+1:1:"pagecount"==K?null!=c.pages?c.pages.length:1:U.apply(this,arguments)};var O=null,p=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var K=this.getCurrentFile(),k=null!=K&&null!=K.getTitle()?K.getTitle():this.defaultFilename;O!=k&&K==p&&(e.invalidateDescendantsWithPlaceholders(e.model.getRoot()),e.view.validate());O=k;p=K}));var q=e.labelLinkClicked;e.labelLinkClicked=function(K,k,y){var F=k.getAttribute("href");if(null==+F||!e.isCustomLink(F)||!mxEvent.isTouchEvent(y)&&mxEvent.isPopupTrigger(y))q.apply(this,arguments);else{if(!e.isEnabled()||null!=K&&e.isCellLocked(K.cell))e.customLinkClicked(F),e.getRubberband().reset();mxEvent.consume(y)}};this.editor.getOrCreateFilename=function(){var K=c.defaultFilename,k=c.getCurrentFile();null!=k&&(K=null!=k.getTitle()?k.getTitle():K);return K};var G=this.actions.get("print");G.setEnabled(!mxClient.IS_IOS||!navigator.standalone);G.visible=G.isEnabled();if(!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(70,!0,"findReplace"),this.keyHandler.bindAction(77,!0,"editGeometry",!0),this.keyHandler.bindAction(75,!0,"tags"),this.keyHandler.bindAction(65,!1,"insertText"),this.keyHandler.bindAction(83,!1,"insertNote"),this.keyHandler.bindAction(68,!1,"insertRectangle"),this.keyHandler.bindAction(70,!1,"insertEllipse"),this.keyHandler.bindAction(76,!1,"insertLink"),this.keyHandler.bindAction(82,!1,"insertRhombus"),this.keyHandler.bindAction(67,!1,"insertEdge"),-this.keyHandler.bindAction(88,!1,"insertFreehand"),this.keyHandler.bindAction(75,!0,"toggleShapes",!0),this.keyHandler.bindAction(54,!0,"adaptiveColors",!0),this.altShiftActions[81]="copyStyle",this.altShiftActions[87]="pasteStyle",this.altShiftActions[83]="synchronize","1"==urlParams.embedInline&&(document.body.classList.add("geEmbedInline"),e.addListener(mxEvent.ESCAPE,function(L,k){null!=k&&e.isEnabled()&&!e.isEditing()&&null!=k.getProperty("event")&&c.actions.get("exit").funct()})),this.installImagePasteHandler(),-this.installNativeClipboardHandler();this.spinner=this.createSpinner(null,null,24);Graph.fileSupport&&e.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(L){var k=e.cellEditor.text2,y=null;null!=k&&(mxEvent.addListener(k,"dragleave",function(F){null!=y&&(y.parentNode.removeChild(y),y=null);F.stopPropagation();F.preventDefault()}),mxEvent.addListener(k,"dragover",mxUtils.bind(this,function(F){null==y&&(!mxClient.IS_IE||10<document.documentMode)&&(y=this.highlightElement(k));F.stopPropagation();-F.preventDefault()})),mxEvent.addListener(k,"drop",mxUtils.bind(this,function(F){null!=y&&(y.parentNode.removeChild(y),y=null);if(0<F.dataTransfer.files.length)this.importFiles(F.dataTransfer.files,0,0,this.maxImageSize,function(P,R,T,V,W,X){e.insertImage(P,W,X)},function(){},function(P){return"image/"==P.type.substring(0,6)},function(P){for(var R=0;R<P.length;R++)P[R]()},mxEvent.isControlDown(F));else if(0<=mxUtils.indexOf(F.dataTransfer.types,"text/uri-list")){var K=F.dataTransfer.getData("text/uri-list");-/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(K)?this.loadImage(decodeURIComponent(K),mxUtils.bind(this,function(P){var R=Math.max(1,P.width);P=Math.max(1,P.height);var T=this.maxImageSize;T=Math.min(1,Math.min(T/Math.max(1,R)),T/Math.max(1,P));e.insertImage(decodeURIComponent(K),R*T,P*T)})):document.execCommand("insertHTML",!1,F.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(F.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,F.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(F.dataTransfer.types,-"text/plain")&&document.execCommand("insertHTML",!1,F.dataTransfer.getData("text/plain"));F.stopPropagation();F.preventDefault()})))}));if(Editor.isSettingsEnabled()){G=this.editor.graph.view;var E=mxSettings.getUnit();G.setUnit(E);Editor.pageSizeUnit=E==mxConstants.METERS?mxConstants.MILLIMETERS:E;G.addListener("unitChanged",function(L,k){L=k.getProperty("unit");mxSettings.setUnit(L);mxSettings.save();Editor.pageSizeUnit=L==mxConstants.METERS?mxConstants.MILLIMETERS:L});this.ruler=!this.canvasSupported||+this.keyHandler.bindAction(88,!1,"insertFreehand"),this.keyHandler.bindAction(75,!0,"toggleShapes",!0),this.keyHandler.bindAction(54,!0,"adaptiveColors",!0),this.altShiftActions[81]="copyStyle",this.altShiftActions[87]="pasteStyle",this.altShiftActions[83]="synchronize","1"==urlParams.embedInline&&(document.body.classList.add("geEmbedInline"),e.addListener(mxEvent.ESCAPE,function(K,k){null!=k&&e.isEnabled()&&!e.isEditing()&&null!=k.getProperty("event")&&c.actions.get("exit").funct()})),this.installImagePasteHandler(),+this.installNativeClipboardHandler();this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);Graph.fileSupport&&e.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(K){var k=e.cellEditor.text2,y=null;null!=k&&(mxEvent.addListener(k,"dragleave",function(F){null!=y&&(y.parentNode.removeChild(y),y=null);F.stopPropagation();F.preventDefault()}),mxEvent.addListener(k,"dragover",mxUtils.bind(this,function(F){null==y&&(!mxClient.IS_IE||10<document.documentMode)&&(y=this.highlightElement(k));+F.stopPropagation();F.preventDefault()})),mxEvent.addListener(k,"drop",mxUtils.bind(this,function(F){null!=y&&(y.parentNode.removeChild(y),y=null);if(0<F.dataTransfer.files.length)this.importFiles(F.dataTransfer.files,0,0,this.maxImageSize,function(P,R,T,V,W,X){e.insertImage(P,W,X)},function(){},function(P){return"image/"==P.type.substring(0,6)},function(P){for(var R=0;R<P.length;R++)P[R]()},mxEvent.isControlDown(F));else if(0<=mxUtils.indexOf(F.dataTransfer.types,"text/uri-list")){var M=F.dataTransfer.getData("text/uri-list");+/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(M)?this.loadImage(decodeURIComponent(M),mxUtils.bind(this,function(P){var R=Math.max(1,P.width);P=Math.max(1,P.height);var T=this.maxImageSize;T=Math.min(1,Math.min(T/Math.max(1,R)),T/Math.max(1,P));e.insertImage(decodeURIComponent(M),R*T,P*T)})):document.execCommand("insertHTML",!1,F.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(F.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,F.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(F.dataTransfer.types,+"text/plain")&&document.execCommand("insertHTML",!1,F.dataTransfer.getData("text/plain"));F.stopPropagation();F.preventDefault()})))}));if(Editor.isSettingsEnabled()){G=this.editor.graph.view;var E=mxSettings.getUnit();G.setUnit(E);Editor.pageSizeUnit=E==mxConstants.METERS?mxConstants.MILLIMETERS:E;G.addListener("unitChanged",function(K,k){K=k.getProperty("unit");mxSettings.setUnit(K);mxSettings.save();Editor.pageSizeUnit=K==mxConstants.METERS?mxConstants.MILLIMETERS:K});this.ruler=!this.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,G.unit);this.refresh()}if("1"==urlParams.styledev){G=document.getElementById("geFooter");null!=G&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility=-"hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),G.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(L,k){0<this.editor.graph.getSelectionCount()?(L=this.editor.graph.getSelectionCell(),L=this.editor.graph.getModel().getStyle(L),this.styleInput.value=L||"",this.styleInput.style.visibility=-"visible"):this.styleInput.style.visibility="hidden"})));var H=this.isSelectionAllowed;this.isSelectionAllowed=function(L){return mxEvent.getSource(L)==this.styleInput?!0:H.apply(this,arguments)}}G=document.getElementById("geInfo");null!=G&&G.parentNode.removeChild(G);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var M=null;mxEvent.addListener(e.container,"dragleave",function(L){e.isEnabled()&&(null!=M&&(M.parentNode.removeChild(M),M=null),L.stopPropagation(),L.preventDefault())});-mxEvent.addListener(e.container,"dragover",mxUtils.bind(this,function(L){null==M&&(!mxClient.IS_IE||10<document.documentMode)&&(M=this.highlightElement(e.container));null!=this.sidebar&&this.sidebar.hideTooltip();L.stopPropagation();L.preventDefault()}));mxEvent.addListener(e.container,"drop",mxUtils.bind(this,function(L){null!=M&&(M.parentNode.removeChild(M),M=null);if(e.isEnabled()){var k=mxUtils.convertPoint(e.container,mxEvent.getClientX(L),mxEvent.getClientY(L)),y=L.dataTransfer.files,F=e.view.translate,-K=e.view.scale,P=k.x/K-F.x,R=k.y/K-F.y;if(0<y.length)"1"!=urlParams.embed&&mxEvent.isShiftDown(L)?(this.isBlankFile()&&!this.canUndo()&&null!=this.getCurrentFile()&&this.fileLoaded(null),this.openFiles(y,!0)):(mxEvent.isAltDown(L)&&(R=P=null),this.importFiles(y,P,R,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(L),null,null,mxEvent.isShiftDown(L),L));else{mxEvent.isAltDown(L)&&(R=P=0);var T=0<=mxUtils.indexOf(L.dataTransfer.types,"text/uri-list")?L.dataTransfer.getData("text/uri-list"):-null;k=this.extractGraphModelFromEvent(L,null!=this.pages);if(null!=k)e.setSelectionCells(this.importXml(k,P,R,!0));else if(0<=mxUtils.indexOf(L.dataTransfer.types,"text/html")){var V=L.dataTransfer.getData("text/html");k=document.createElement("div");k.innerHTML=Graph.sanitizeHtml(V);var W=null;y=k.getElementsByTagName("img");null!=y&&1==y.length?(V=y[0].getAttribute("src"),null==V&&(V=y[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(V)||(W=!0)):(y=k.getElementsByTagName("a"),-null!=y&&1==y.length?V=y[0].getAttribute("href"):(k=k.getElementsByTagName("pre"),null!=k&&1==k.length&&(V=mxUtils.getTextContent(k[0]))));var X=!0,Z=mxUtils.bind(this,function(){e.setSelectionCells(this.insertTextAt(V,P,R,!0,W,null,X,mxEvent.isControlDown(L)))});W&&null!=V&&V.length>this.resampleThreshold?this.confirmImageResize(function(Y){X=Y;Z()},mxEvent.isControlDown(L)):Z()}else null!=T&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(T)?this.loadImage(decodeURIComponent(T),mxUtils.bind(this,function(Y){var da=-Math.max(1,Y.width);Y=Math.max(1,Y.height);var ea=this.maxImageSize;ea=Math.min(1,Math.min(ea/Math.max(1,da)),ea/Math.max(1,Y));e.setSelectionCell(e.insertVertex(null,null,"",P,R,da*ea,Y*ea,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+T+";"))}),mxUtils.bind(this,function(Y){e.setSelectionCells(this.insertTextAt(T,P,R,!0))})):0<=mxUtils.indexOf(L.dataTransfer.types,"text/plain")&&e.setSelectionCells(this.insertTextAt(L.dataTransfer.getData("text/plain"),-P,R,!0))}}L.stopPropagation();L.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.addListener("currentThemeChanged",mxUtils.bind(this,function(){null!=this.sidebar&&this.sidebar.updateEntries();this.updateButtonContainer();this.updateDocumentTitle();this.refresh(!0)}));this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateButtonContainer()}));this.addListener("darkModeChanged",function(){mxClient.IS_SF&&e.view.validateBackground()});-e.addListener("enabledChanged",mxUtils.bind(this,function(){e.isEnabled()||this.hideShapePicker();this.refresh()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==c.embedViewport)mxUtils.fit(this.div);else{var L=parseInt(this.div.offsetLeft),k=parseInt(this.div.offsetWidth),y=c.embedViewport.x+c.embedViewport.width,F=parseInt(this.div.offsetTop),K=parseInt(this.div.offsetHeight),P=c.embedViewport.y+c.embedViewport.height;this.div.style.left=Math.max(c.embedViewport.x,Math.min(L,-y-k))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(F,P-K))+"px";this.div.style.height=Math.min(c.embedViewport.height,parseInt(this.div.style.height))+"px";this.div.style.width=Math.min(c.embedViewport.width,parseInt(this.div.style.width))+"px"}};if(!this.editor.chromeless||this.editor.editable)if(G=Editor.currentTheme,"simple"==G||"sketch"==G)this.doSetCurrentTheme(G,!0),"1"==urlParams.embedInline?this.initializeInlineEmbedMode():(window.innerWidth||document.documentElement.clientWidth||+"hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),G.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(K,k){0<this.editor.graph.getSelectionCount()?(K=this.editor.graph.getSelectionCell(),K=this.editor.graph.getModel().getStyle(K),this.styleInput.value=K||"",this.styleInput.style.visibility=+"visible"):this.styleInput.style.visibility="hidden"})));var H=this.isSelectionAllowed;this.isSelectionAllowed=function(K){return mxEvent.getSource(K)==this.styleInput?!0:H.apply(this,arguments)}}G=document.getElementById("geInfo");null!=G&&G.parentNode.removeChild(G);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var L=null;mxEvent.addListener(e.container,"dragleave",function(K){e.isEnabled()&&(null!=L&&(L.parentNode.removeChild(L),L=null),K.stopPropagation(),K.preventDefault())});+mxEvent.addListener(e.container,"dragover",mxUtils.bind(this,function(K){null==L&&(!mxClient.IS_IE||10<document.documentMode)&&(L=this.highlightElement(e.container));null!=this.sidebar&&this.sidebar.hideTooltip();K.stopPropagation();K.preventDefault()}));mxEvent.addListener(e.container,"drop",mxUtils.bind(this,function(K){null!=L&&(L.parentNode.removeChild(L),L=null);if(e.isEnabled()){var k=mxUtils.convertPoint(e.container,mxEvent.getClientX(K),mxEvent.getClientY(K)),y=K.dataTransfer.files,F=e.view.translate,+M=e.view.scale,P=k.x/M-F.x,R=k.y/M-F.y;if(0<y.length)"1"!=urlParams.embed&&mxEvent.isShiftDown(K)?(this.isBlankFile()&&!this.canUndo()&&null!=this.getCurrentFile()&&this.fileLoaded(null),this.openFiles(y,!0)):(mxEvent.isAltDown(K)&&(R=P=null),this.importFiles(y,P,R,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(K),null,null,mxEvent.isShiftDown(K),K));else{mxEvent.isAltDown(K)&&(R=P=0);var T=0<=mxUtils.indexOf(K.dataTransfer.types,"text/uri-list")?K.dataTransfer.getData("text/uri-list"):+null;k=this.extractGraphModelFromEvent(K,null!=this.pages);if(null!=k)e.setSelectionCells(this.importXml(k,P,R,!0));else if(0<=mxUtils.indexOf(K.dataTransfer.types,"text/html")){var V=K.dataTransfer.getData("text/html");k=document.createElement("div");k.innerHTML=Graph.sanitizeHtml(V);var W=null;y=k.getElementsByTagName("img");null!=y&&1==y.length?(V=y[0].getAttribute("src"),null==V&&(V=y[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(V)||(W=!0)):(y=k.getElementsByTagName("a"),+null!=y&&1==y.length?V=y[0].getAttribute("href"):(k=k.getElementsByTagName("pre"),null!=k&&1==k.length&&(V=mxUtils.getTextContent(k[0]))));var X=!0,Y=mxUtils.bind(this,function(){e.setSelectionCells(this.insertTextAt(V,P,R,!0,W,null,X,mxEvent.isControlDown(K)))});W&&null!=V&&V.length>this.resampleThreshold?this.confirmImageResize(function(Z){X=Z;Y()},mxEvent.isControlDown(K)):Y()}else null!=T&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(T)?this.loadImage(decodeURIComponent(T),mxUtils.bind(this,function(Z){var da=+Math.max(1,Z.width);Z=Math.max(1,Z.height);var ea=this.maxImageSize;ea=Math.min(1,Math.min(ea/Math.max(1,da)),ea/Math.max(1,Z));e.setSelectionCell(e.insertVertex(null,null,"",P,R,da*ea,Z*ea,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+T+";"))}),mxUtils.bind(this,function(Z){e.setSelectionCells(this.insertTextAt(T,P,R,!0))})):0<=mxUtils.indexOf(K.dataTransfer.types,"text/plain")&&e.setSelectionCells(this.insertTextAt(K.dataTransfer.getData("text/plain"),+P,R,!0))}}K.stopPropagation();K.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.addListener("currentThemeChanged",mxUtils.bind(this,function(){null!=this.sidebar&&this.sidebar.updateEntries();this.updateButtonContainer();this.updateDocumentTitle();this.refresh(!0)}));this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateButtonContainer()}));this.addListener("darkModeChanged",function(){mxClient.IS_SF&&e.view.validateBackground()});+e.addListener("enabledChanged",mxUtils.bind(this,function(){e.isEnabled()||this.hideShapePicker();this.refresh()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==c.embedViewport)mxUtils.fit(this.div);else{var K=parseInt(this.div.offsetLeft),k=parseInt(this.div.offsetWidth),y=c.embedViewport.x+c.embedViewport.width,F=parseInt(this.div.offsetTop),M=parseInt(this.div.offsetHeight),P=c.embedViewport.y+c.embedViewport.height;this.div.style.left=Math.max(c.embedViewport.x,Math.min(K,+y-k))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(F,P-M))+"px";this.div.style.height=Math.min(c.embedViewport.height,parseInt(this.div.style.height))+"px";this.div.style.width=Math.min(c.embedViewport.width,parseInt(this.div.style.width))+"px"}};if(!this.editor.chromeless||this.editor.editable)if(G=Editor.currentTheme,"simple"==G||"sketch"==G)this.doSetCurrentTheme(G,!0),"1"==urlParams.embedInline?this.initializeInlineEmbedMode():(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<Editor.smallScreenWidth&&this.toggleFormatPanel(!1),this.fireEvent(new mxEventObject("themeInitialized"));G=!1;if(null!=urlParams.dark)G=urlParams.dark;else if(!this.editor.chromeless||this.editor.editable)G="dark"==Editor.currentTheme,!Editor.isSettingsEnabled()||"1"==urlParams.embed||G&&"auto"!=mxSettings.settings.darkMode||(G=mxSettings.settings.darkMode);"auto"==G&&this.isAutoDarkModeSupported()&&(G=window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode("string"===-typeof G?"1"==G:G);if(this.isAutoDarkModeSupported())try{window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",mxUtils.bind(this,function(L){this.isAutoDarkMode()&&this.setDarkMode(L.matches)}))}catch(L){this.actions.get("autoMode").setEnabled(!1)}"1"==urlParams["high-contrast"]?this.setHighContrast(!0):Editor.isSettingsEnabled()&&!this.editor.graph.isLightboxView()&&null!=mxSettings.settings.highContrast&&this.setHighContrast(mxSettings.settings.highContrast);Editor.isSettingsEnabled()&&-(null!=mxSettings.settings.pages&&this.setTabContainerVisible(mxSettings.settings.pages),null!=mxSettings.settings.compactMode&&this.isDefaultTheme(Editor.currentTheme)&&this.setCompactMode(mxSettings.settings.compactMode));this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(L,k){e.enableFlowAnimation=Editor.enableAnimations;e.refresh()}));e.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&+typeof G?"1"==G:G);if(this.isAutoDarkModeSupported())try{window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",mxUtils.bind(this,function(K){this.isAutoDarkMode()&&this.setDarkMode(K.matches)}))}catch(K){this.actions.get("autoMode").setEnabled(!1)}"1"==urlParams["high-contrast"]?this.setHighContrast(!0):Editor.isSettingsEnabled()&&!this.editor.graph.isLightboxView()&&null!=mxSettings.settings.highContrast&&this.setHighContrast(mxSettings.settings.highContrast);Editor.isSettingsEnabled()&&+(null!=mxSettings.settings.pages&&this.setTabContainerVisible(mxSettings.settings.pages),null!=mxSettings.settings.compactMode&&this.isDefaultTheme(Editor.currentTheme)&&this.setCompactMode(mxSettings.settings.compactMode));this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(K,k){e.enableFlowAnimation=Editor.enableAnimations;e.refresh()}));e.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts();"atlas"==Editor.currentTheme&&document.body.classList.add("geAtlas")};var v=EditorUi.prototype.windowResized;EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,e=Editor.smallScreenWidth;null!=this.lastWindowWidth&&this.lastWindowWidth>=e&&c<e?this.isFormatPanelVisible()&&this.toggleFormatPanel(!1):null!=this.lastWindowWidth&&this.lastWindowWidth<e&&c>=e&&(this.isFormatPanelVisible()||this.toggleFormatPanel(!0));this.lastWindowWidth=c}v.apply(this,arguments)};EditorUi.prototype.initializeInlineEmbedMode=function(){var c=this.sketchFooterMenuElt,e=this.sketchMainMenuElt,g=this.sketchPickerMenuElt,l=this.editor.graph;g.style.transform="";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,function(A){mxEvent.getSource(A)==this.diagramContainer.parentNode&&(this.embedExitPoint=new mxPoint(mxEvent.getClientX(A),mxEvent.getClientY(A)),this.sendEmbeddedSvgExport())}));document.body.style.cursor="text";var n=document.createElement("div");n.style.position="absolute";n.style.width="10px";n.style.height="10px";n.style.borderRadius="5px";n.style.border="1px solid gray";n.style.background="#ffffff";n.style.cursor="row-resize";this.diagramContainer.parentNode.appendChild(n);this.bottomResizer=n;var u=null,z=null,D=null,C=null;mxEvent.addGestureListeners(n,mxUtils.bind(this,function(A){C=parseInt(this.diagramContainer.style.height);z=mxEvent.getClientY(A);l.popupMenuHandler.hideMenu();@@ -13298,47 +13302,47 @@ this.menus.commentsWindow=null))};EditorUi.prototype.switchThemeConstants=functi120;null==urlParams.grid&&(e.defaultGridEnabled=!1);null==urlParams.pv&&(e.defaultPageVisible=!1)}else Editor.fitWindowBorders=null};EditorUi.prototype.isPageMenuVisible=function(){return null!=this.pages&&("0"!=urlParams.pages||1<this.pages.length||Editor.pagesVisible)};EditorUi.prototype.switchCssForTheme=function(c){};EditorUi.prototype.createMainMenuForTheme=function(c){};EditorUi.prototype.createFooterMenuForTheme=function(c){};EditorUi.prototype.createPickerMenuForTheme=function(c){};EditorUi.prototype.getNetworkStatus=function(){var c=null;if(this.isOffline(!0))c=mxResources.get("offline");else{var e=this.getCurrentFile();null!=e&&(e.invalidChecksum?c=mxResources.get("error")+": "+mxResources.get("checksum"):null==e.sync||e.sync.enabled&&e.sync.isRealtimeActive()||"atlassian"==this.getServiceName()?null==e.sync||e.sync.isConnected()?e.isRealtimeEnabled()&&e.isRealtimeSupported()&&1<e.getRealtimeState()&&(c=e.getRealtimeError(),c=mxResources.get("realtimeCollaboration")+": "+(null!=c&&null!=c.message?c.message:mxResources.get("error"))):c=mxResources.get("notConnected"):c=mxResources.get("realtimeCollaboration")+": "+mxResources.get("disabled"))}return c};EditorUi.prototype.createMenubarForTheme=function(c){null!=this.statusContainer&&(this.statusContainer.style.flexGrow="",this.statusContainer.style.flexShrink="",this.statusContainer.style.width="",this.statusContainer.style.marginTop="",this.statusContainer.style.justifyContent="",this.statusContainer.style.opacity="");null!=this.userElement&&this.menubarContainer.appendChild(this.userElement);-null!=this.buttonContainer&&(this.buttonContainer.style.display="",this.menubar.container.appendChild(this.buttonContainer))};EditorUi.prototype.createMenu=function(c,e,g,l){g=null!=g?g:"geButton";var n=this.menus.get(c);l=this.menubar.addMenu(mxResources.get(c),n.funct,null,l);l.className=g;l.setAttribute("title",mxResources.get(c));this.menus.menuCreated(n,l,g);null!=e&&(l.style.backgroundImage="url("+e+")",l.innerText="");return l};EditorUi.prototype.addButton=function(c,e,g,l){c=this.createToolbarButton(c,-e,g);l=null!=l?l:this.container;l.appendChild(c);return c};EditorUi.prototype.createToolbarButton=function(c,e,g){var l=document.createElement("a");l.className="geButton";null!=c&&"data:"==c.substring(0,5)&&(l.style.backgroundImage="url("+c+")");null!=e&&l.setAttribute("title",e);null!=g&&mxEvent.addListener(l,"click",function(n){"disabled"!=l.getAttribute("disabled")&&g(n);mxEvent.consume(n)});mxEvent.preventDefault(l);return l};EditorUi.prototype.createMenuItem=function(c,e,g){var l=this.actions.get(c),-n=null!=l?l.funct:null,u=this.createToolbarButton(e,mxResources.get(c)+(null!=l&&null!=l.shortcut?" ("+l.shortcut+")":""),n);null==l||g||(c=function(){l.isEnabled()?u.removeAttribute("disabled"):u.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",c),l.addListener("stateChanged",c),c());return u};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var c=Math.max(10,this.diagramContainer.parentNode.clientWidth-256),e="1"==urlParams.embedInline?-580:"1"==urlParams.sketch?580:Math.min(566,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,mxResources.get("format"),c,60,240,e,mxUtils.bind(this,function(n){n.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.formatWindow.window.fit()}));var g=this.formatWindow.window.toggleMinimized,l=240;this.formatWindow.window.toggleMinimized=function(){g.apply(this,arguments);this.minimized?(l=parseInt(this.div.style.width),-this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+l-140+"px"):(this.div.style.width=l+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-l+140)+"px");this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(n){mxEvent.getSource(n)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));this.formatWindow.window.minimumSize=-new mxRectangle(0,0,240,80);"sketch"==Editor.currentTheme?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,u=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>n||690>u)&&this.formatWindow.window.toggleMinimized()}),0)):this.formatWindow.window.setVisible(!1)}};var B=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=-function(c){var e=this.formatWindow;null!=e?e.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):B.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c){if(this.isShapesPanelVisible()!=c){var e=EditorUi.prototype.hsplitPosition;0==e&&(e=this.defaultSidebarWidth);var g=this.hsplitPosition,l=mxUtils.bind(this,function(){this.hsplitPosition=n;this.refresh();this.diagramContainer.scrollLeft-=g-this.hsplitPosition}),n=c?e:0,u=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.sidebarContainer.style,-"transform",0==n?"translateX(0)":"translateX(-100%)");0!=n&&l();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==n?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+u+"s ease-in-out");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin","top left");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition",-null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin",null);0==n&&l()}),1E3*u)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var J=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;return null!=c?c.window.isVisible():J.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(c){var e=mxUtils.bind(this,-function(z,D){var C=this.menus.get(z);z=this.createMenuElement(D,mxUtils.bind(this,function(){C.funct.apply(this,arguments)}));z.setAttribute("title",D);z.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";z.className="geButton";c.parentNode.appendChild(z);return z});if(Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries))if(null!=this.actions.get("newLibrary"))e=document.createElement("div"),e.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;",-e.className="geButton",e.style.left="0px",e.style.right="50%",mxUtils.write(e,mxResources.get("newLibrary")),c.appendChild(e),mxEvent.addListener(e,"click",this.actions.get("newLibrary").funct),e=e.cloneNode(!1),e.style.left="50%",e.style.right="0px",mxUtils.write(e,mxResources.get("openLibrary")),c.appendChild(e),mxEvent.addListener(e,"click",this.actions.get("openLibrary").funct);else{var g=e("newLibrary","");g.style.left="0px";g.style.right="50%";var l=document.createElement("span");g.appendChild(l);-var n=e("openLibraryFrom","");n.style.borderLeftWidth="1px";n.style.left="50%";n.style.right="0px";var u=document.createElement("span");n.appendChild(u);this.dependsOnLanguage(mxUtils.bind(this,function(){l.innerHTML="";mxUtils.write(l,mxResources.get("newLibrary"));g.setAttribute("title",mxResources.get("newLibrary"));u.innerHTML="";mxUtils.write(u,mxResources.get("openLibraryFrom"));n.setAttribute("title",mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow=-"hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=Math.min(this.diagramContainer.parentNode.clientWidth-10,218),e="1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,650),g="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme;this.sidebarWindow=new WrapperWindow(this,mxResources.get("shapes"),g&&"1"!=urlParams.embedInline?66:10,g&&"1"!=urlParams.embedInline?Math.max(30,(this.diagramContainer.parentNode.clientHeight--e)/2):56,c-6,e-6,mxUtils.bind(this,function(l){this.createShapesPanel(l)}));this.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.sidebarWindow.window.fit()}));this.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90);this.sidebarWindow.window.setVisible(!1)}};EditorUi.prototype.setSketchMode=function(c){this.doSetSketchMode(c);null==urlParams.rough&&(mxSettings.settings.sketchMode=c,mxSettings.save());this.fireEvent(new mxEventObject("sketchModeChanged"))};EditorUi.prototype.setAndPersistDarkMode=-function(c){var e=c;"auto"==c&&(e=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode(e);mxSettings.settings.darkMode=c;mxSettings.save();c=mxSettings.getUi();null==urlParams.ui&&"dark"==c&&this.setCurrentTheme("kennedy",!0)};EditorUi.prototype.setAndPersistLanguage=function(c){this.spinner.spin(document.body,mxResources.get("working"))&&(mxSettings.setLanguage(c),mxSettings.save(),mxClient.language=c,mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE,-null,mxUtils.bind(this,function(){this.spinner.stop();this.fireEvent(new mxEventObject("languageChanged"))})))};EditorUi.prototype.setElementTitle=function(c,e){this.dependsOnLanguage(mxUtils.bind(this,function(){c.setAttribute("title",mxResources.get(e))}))};EditorUi.prototype.dependsOnLanguage=function(c){c();this.addListener("languageChanged",c)};EditorUi.prototype.setAndPersistHighContrast=function(c){this.setHighContrast(c);Editor.isSettingsEnabled()&&(mxSettings.settings.highContrast=c,mxSettings.save())};-EditorUi.prototype.isHighContrast=function(){var c=document.getElementById("high-contrast-stylesheet");return null!=c&&window.matchMedia?(c=c.getAttribute("media"),"all"==c||"not all"!=c&&window.matchMedia("(forced-colors: active)").matches):!1};EditorUi.prototype.setHighContrast=function(c){var e=document.getElementById("high-contrast-stylesheet");if(null!=e&&window.matchMedia){var g=window.matchMedia("(forced-colors: active)").matches,l=e.getAttribute("media");(l="all"==l||"not all"!=l&&g)&&!c?-e.setAttribute("media",g?"not all":"(forced-colors: active)"):!l&&c&&e.setAttribute("media",g?"(forced-colors: active)":"all")}};EditorUi.prototype.isRulerVisible=function(){return null!=this.ruler};EditorUi.prototype.setRulerVisible=function(c){var e=this.getDiagramContainerOffset();mxSettings.setRulerOn(c);mxSettings.save();c||null==this.ruler?c&&null==this.ruler&&(this.ruler=new mxDualRuler(this,this.editor.graph.view.unit)):(this.ruler.destroy(),this.ruler=null);this.fireEvent(new mxEventObject("rulerVisibleChanged"));-c=this.getDiagramContainerOffset();this.diagramContainer.scrollLeft+=c.x-e.x;this.diagramContainer.scrollTop+=c.x-e.x};EditorUi.prototype.isAutoDarkModeSupported=function(){return null!=window.matchMedia};EditorUi.prototype.isAutoDarkMode=function(c){return!c&&"auto"==urlParams.dark||Editor.isSettingsEnabled()&&"auto"==mxSettings.settings.darkMode};EditorUi.prototype.setDarkMode=function(c){mxUtils.lightDarkColorSupported&&(Editor.darkMode=c,c=mxUtils.isAncestorNode(document.body,this.container)||-null==this.editor?this.container:this.editor.graph.container,mxConstants.DROP_TARGET_COLOR=Editor.isDarkMode()?"#00ff00":"#0000ff",null!=c&&(Editor.isDarkMode()?(c.classList.add("geDarkMode"),c.style.colorScheme="dark"):(c.classList.remove("geDarkMode"),c.style.colorScheme="light")),null!=this.ruler&&this.ruler.updateStyle(),this.fireEvent(new mxEventObject("darkModeChanged")))};EditorUi.prototype.setPagesVisible=function(c){Editor.pagesVisible!=c&&(Editor.pagesVisible=c,mxSettings.settings.pagesVisible=-c,mxSettings.save(),this.fireEvent(new mxEventObject("pagesVisibleChanged")))};EditorUi.prototype.setSidebarTitles=function(c,e){this.sidebar.sidebarTitles!=c&&(this.sidebar.sidebarTitles=c,Editor.isSettingsEnabled()&&e&&(mxSettings.settings.sidebarTitles=c,mxSettings.save()),this.fireEvent(new mxEventObject("sidebarTitlesChanged")))};EditorUi.prototype.setInlineFullscreen=function(c){Editor.inlineFullscreen!=c&&(this.diagramContainer.setAttribute("data-scrollState",JSON.stringify(this.saveScrollState(!0))),-(window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:c,rect:this.diagramContainer.getBoundingClientRect()}),"*"))};EditorUi.prototype.inlineSizeChanged=function(){var c=this.sketchFooterMenuElt,e=this.sketchMainMenuElt,g=this.sketchPickerMenuElt;if(Editor.inlineFullscreen)e.style.left="10px",e.style.top="10px",g.style.left="10px",g.style.top="60px",c.style.top="10px",c.style.right="12px",c.style.left="",null==this.diagramContainer.getAttribute("data-bounds")&&(this.diagramContainer.setAttribute("data-bounds",-this.diagramContainer.style.top+" "+this.diagramContainer.style.left+" "+this.diagramContainer.style.width+" "+this.diagramContainer.style.height),this.diagramContainer.style.top="0px",this.diagramContainer.style.left="0px",this.diagramContainer.style.bottom="0px",this.diagramContainer.style.right="0px",this.diagramContainer.style.width="",this.diagramContainer.style.height="");else{var l=this.diagramContainer.getAttribute("data-bounds");if(null!=l){this.diagramContainer.removeAttribute("data-bounds");-var n=l.split(" ");l=mxUtils.getDocumentSize();this.diagramContainer.style.top=n[0];this.diagramContainer.style.left=n[1];var u=parseInt(n[2]);n=parseInt(n[3]);u=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,u):u,l.width-80);n=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,n):n,l.height-80);this.diagramContainer.style.width=u+"px";this.diagramContainer.style.height=n+"px";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";(window.opener||-window.parent).postMessage(JSON.stringify({event:"resize",rect:this.diagramContainer.getBoundingClientRect()}),"*")}e.style.left=this.diagramContainer.offsetLeft+"px";e.style.top=this.diagramContainer.offsetTop-e.offsetHeight-4+"px";g.style.display="";g.style.left=this.diagramContainer.offsetLeft-g.offsetWidth-4+"px";g.style.top=this.diagramContainer.offsetTop+"px";c.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-c.offsetWidth+"px";c.style.top=e.style.top;c.style.right=-"";this.bottomResizer.style.left=this.diagramContainer.offsetLeft+(this.diagramContainer.offsetWidth-this.bottomResizer.offsetWidth)/2+"px";this.bottomResizer.style.top=this.diagramContainer.offsetTop+this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight/2-1+"px";this.rightResizer.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-this.rightResizer.offsetWidth/2-1+"px";this.rightResizer.style.top=this.diagramContainer.offsetTop+(this.diagramContainer.offsetHeight--this.bottomResizer.offsetHeight)/2+"px"}this.bottomResizer.style.visibility=Editor.inlineFullscreen?"hidden":"";this.rightResizer.style.visibility=this.bottomResizer.style.visibility;e.style.visibility="";c.style.visibility=""};EditorUi.prototype.doSetSketchMode=function(c){Editor.sketchMode!=c&&(Editor.sketchMode=c,this.updateDefaultStyles())};EditorUi.prototype.updateDefaultStyles=function(){var c=this.editor.graph;c.defaultVertexStyle=mxUtils.clone(Graph.prototype.defaultVertexStyle);c.defaultEdgeStyle=-mxUtils.clone(Graph.prototype.defaultEdgeStyle);if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.vertexFontSize=16,c.edgeFontSize=c.vertexFontSize-4):"sketch"==Editor.currentTheme?(c.vertexFontSize=20,c.edgeFontSize=c.vertexFontSize-4):(c.vertexFontSize=Graph.prototype.vertexFontSize,c.edgeFontSize=Graph.prototype.edgeFontSize),c.defaultEdgeStyle.fontSize=c.edgeFontSize;if(null==Editor.config||-null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.endSize="8",c.defaultEdgeStyle.startSize="8"):"sketch"==Editor.currentTheme&&(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.jettySize="auto",c.defaultEdgeStyle.orthogonalLoop="1",c.defaultEdgeStyle.endArrow="open",c.defaultEdgeStyle.endSize=-"14",c.defaultEdgeStyle.startSize="14",c.defaultEdgeStyle.sourcePerimeterSpacing="8",c.defaultEdgeStyle.targetPerimeterSpacing="8");if(null==Editor.config||null==Editor.config.defaultFonts){if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle){if("sketch"==Editor.currentTheme&&"1"!=urlParams.embedInline||Editor.sketchMode)c.defaultVertexStyle.fontFamily=Editor.sketchFontFamily,c.defaultVertexStyle.fontSource=Editor.sketchFontSource,c.defaultEdgeStyle.fontFamily=-Editor.sketchFontFamily,c.defaultEdgeStyle.fontSource=Editor.sketchFontSource;Editor.sketchMode&&(c.defaultVertexStyle.sketch="1",c.defaultVertexStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultVertexStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultVertexStyle.hachureGap="4",c.defaultEdgeStyle.sketch="1",c.defaultEdgeStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultEdgeStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultEdgeStyle.hachureGap="4")}this.menus.defaultFonts="sketch"==-Editor.currentTheme?Menus.prototype.defaultFonts.concat(Editor.sketchFonts):Menus.prototype.defaultFonts}c.currentVertexStyle=mxUtils.clone(c.defaultVertexStyle);c.currentEdgeStyle=mxUtils.clone(c.defaultEdgeStyle);this.clearDefaultStyle()};EditorUi.prototype.getLinkTitle=function(c){var e=Graph.prototype.getLinkTitle.apply(this,arguments);if(Graph.isPageLink(c)){var g=c.indexOf(",");0<g&&(e=this.getPageById(c.substring(g+1)),e=null!=e?e.getName():mxResources.get("pageNotFound"))}else"data:"==c.substring(0,-5)&&(e=this.getCustomLinkTitle(c));return e};EditorUi.prototype.getCustomLinkTitle=function(c){var e=mxResources.get("action");if("data:action/json,"==c.substring(0,17))try{var g=JSON.parse(c.substring(17));null!=g&&null!=g.title&&(e=g.title)}catch(l){}return e};EditorUi.prototype.handleCustomLink=function(c,e){if(Graph.isPageLink(c))if(e=c.indexOf(","),c=this.getPageById(c.substring(e+1)))this.selectPage(c);else throw Error(mxResources.get("pageNotFound")||"Page not found");else this.editor.graph.handleCustomLink(c,-e)};EditorUi.prototype.installSettings=function(){if(Editor.isSettingsEnabled()){var c=this.editor.graph;Editor.pagesVisible=mxSettings.settings.pagesVisible;ColorDialog.recentColors=mxSettings.getRecentColors();if(isLocalStorage)try{window.addEventListener("storage",mxUtils.bind(this,function(e){e.key==mxSettings.key&&(mxSettings.load(),ColorDialog.recentColors=mxSettings.getRecentColors(),this.menus.customFonts=mxSettings.getCustomFonts())}),!1)}catch(e){}this.fireEvent(new mxEventObject("styleChanged",-"keys",[],"values",[],"cells",[]));this.menus.customFonts=mxSettings.getCustomFonts();this.addListener("customFontsChanged",mxUtils.bind(this,function(e,g){mxSettings.setCustomFonts(this.menus.customFonts);mxSettings.save()}));c.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(e,g){mxSettings.setCreateTarget(c.connectionHandler.isCreateTarget());mxSettings.save()}));-c.pageFormat=null!=c.defaultPageFormat?c.defaultPageFormat:mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(e,g){mxSettings.setPageFormat(c.pageFormat);mxSettings.save()}));c.view.defaultDarkGridColor=mxSettings.getGridColor(!0);c.view.defaultGridColor=mxSettings.getGridColor(!1);c.view.gridColor="light-dark("+c.view.defaultGridColor+", "+c.view.defaultDarkGridColor+")";this.addListener("gridColorChanged",mxUtils.bind(this,function(e,g){mxSettings.setGridColor(c.view.defaultGridColor,-!1);mxSettings.setGridColor(c.view.defaultDarkGridColor,!0);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(e,g){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();if(!this.editor.chromeless||this.editor.editable)null!=mxSettings.settings.enableAnimations&&(Editor.enableAnimations=mxSettings.settings.enableAnimations),this.addListener("enableAnimationsChanged",-mxUtils.bind(this,function(e,g){mxSettings.settings.enableAnimations=Editor.enableAnimations;mxSettings.save()}));null!=this.sidebar&&(null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes?(this.sidebar.searchShapes(decodeURIComponent(urlParams["search-shapes"])),this.sidebar.showEntries("search")):(this.sidebar.showPalette("search",mxSettings.settings.search),this.editor.chromeless&&!this.editor.editable||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),-mxSettings.save())));this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyImage=function(c,e,g){try{null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(l,n){try{this.spinner.stop();var u=this.createImageDataUri(l,e,"png"),z=parseInt(n.getAttribute("width")),D=parseInt(n.getAttribute("height"));-this.writeImageToClipboard(u,z,D,mxUtils.bind(this,function(C){this.handleError(C)}))}catch(C){this.handleError(C)}}),null,null,null,mxUtils.bind(this,function(l){this.spinner.stop();this.handleError(l)}),null,null,null!=g?g:4,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,null,null,null,10,null,null,!1,null,0<c.length?c:null)}catch(l){this.handleError(l)}};EditorUi.prototype.copyCells=function(c,e){var g=this.editor.graph;if(g.isSelectionEmpty())c.innerText="";-else{var l=mxUtils.sortCells(g.model.getTopmostCells(g.getSelectionCells())),n=mxUtils.getXml(g.encodeCells(l));mxUtils.setTextContent(c,encodeURIComponent(n));e?(g.removeCells(l,!1),g.lastPasteXml=null):(g.lastPasteXml=n,g.pasteCounter=0);c.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var c=null;if(Editor.enableNativeCipboard){var e=this.editor.graph;e.isSelectionEmpty()||(c=mxUtils.sortCells(e.getExportableCells(e.model.getTopmostCells(e.getSelectionCells()))),+null!=this.buttonContainer&&null!=this.menubar&&(this.buttonContainer.style.display="",this.menubar.container.appendChild(this.buttonContainer))};EditorUi.prototype.createMenu=function(c,e,g,l){g=null!=g?g:"geButton";var n=this.menus.get(c);l=this.menubar.addMenu(mxResources.get(c),n.funct,null,l);l.className=g;l.setAttribute("title",mxResources.get(c));this.menus.menuCreated(n,l,g);null!=e&&(l.style.backgroundImage="url("+e+")",l.innerText="");return l};EditorUi.prototype.addButton=function(c,e,+g,l){c=this.createToolbarButton(c,e,g);l=null!=l?l:this.container;l.appendChild(c);return c};EditorUi.prototype.createToolbarButton=function(c,e,g){var l=document.createElement("a");l.className="geButton";null!=c&&"data:"==c.substring(0,5)&&(l.style.backgroundImage="url("+c+")");null!=e&&l.setAttribute("title",e);null!=g&&mxEvent.addListener(l,"click",function(n){"disabled"!=l.getAttribute("disabled")&&g(n);mxEvent.consume(n)});mxEvent.preventDefault(l);return l};EditorUi.prototype.createMenuItem=+function(c,e,g){var l=this.actions.get(c),n=null!=l?l.funct:null,u=this.createToolbarButton(e,mxResources.get(c)+(null!=l&&null!=l.shortcut?" ("+l.shortcut+")":""),n);null==l||g||(c=function(){l.isEnabled()?u.removeAttribute("disabled"):u.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",c),l.addListener("stateChanged",c),c());return u};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var c=Math.max(10,this.diagramContainer.parentNode.clientWidth-+256),e="1"==urlParams.embedInline?580:"1"==urlParams.sketch?580:Math.min(566,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,mxResources.get("format"),c,60,240,e,mxUtils.bind(this,function(n){n.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.formatWindow.window.fit()}));var g=this.formatWindow.window.toggleMinimized,l=240;this.formatWindow.window.toggleMinimized=function(){g.apply(this,arguments);+this.minimized?(l=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+l-140+"px"):(this.div.style.width=l+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-l+140)+"px");this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(n){mxEvent.getSource(n)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));+this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80);"sketch"==Editor.currentTheme?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,u=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>n||690>u)&&this.formatWindow.window.toggleMinimized()}),0)):this.formatWindow.window.setVisible(!1)}};var B=EditorUi.prototype.toggleFormatPanel;+EditorUi.prototype.toggleFormatPanel=function(c){var e=this.formatWindow;null!=e?e.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):B.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c){if(this.isShapesPanelVisible()!=c){var e=EditorUi.prototype.hsplitPosition;0==e&&(e=this.defaultSidebarWidth);var g=this.hsplitPosition,l=mxUtils.bind(this,function(){this.hsplitPosition=n;this.refresh();this.diagramContainer.scrollLeft-=g-this.hsplitPosition}),n=c?e:0,u=Editor.transitionDelay;+mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==n?"translateX(0)":"translateX(-100%)");0!=n&&l();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==n?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+u+"s ease-in-out");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin","top left");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,+"transition",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin",null);0==n&&l()}),1E3*u)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var J=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;return null!=c?c.window.isVisible():J.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(c){var e=+mxUtils.bind(this,function(z,D){var C=this.menus.get(z);z=this.createMenuElement(D,mxUtils.bind(this,function(){C.funct.apply(this,arguments)}));z.setAttribute("title",D);z.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";z.className="geButton";c.parentNode.appendChild(z);return z});if(Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries))if(null!=this.actions.get("newLibrary"))e=document.createElement("div"),+e.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;",e.className="geButton",e.style.left="0px",e.style.right="50%",mxUtils.write(e,mxResources.get("newLibrary")),c.appendChild(e),mxEvent.addListener(e,"click",this.actions.get("newLibrary").funct),e=e.cloneNode(!1),e.style.left="50%",e.style.right="0px",mxUtils.write(e,mxResources.get("openLibrary")),c.appendChild(e),mxEvent.addListener(e,"click",this.actions.get("openLibrary").funct);else{var g=+e("newLibrary","");g.style.left="0px";g.style.right="50%";var l=document.createElement("span");g.appendChild(l);var n=e("openLibraryFrom","");n.style.borderLeftWidth="1px";n.style.left="50%";n.style.right="0px";var u=document.createElement("span");n.appendChild(u);this.dependsOnLanguage(mxUtils.bind(this,function(){l.innerHTML="";mxUtils.write(l,mxResources.get("newLibrary"));g.setAttribute("title",mxResources.get("newLibrary"));u.innerHTML="";mxUtils.write(u,mxResources.get("openLibraryFrom"));n.setAttribute("title",+mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow="hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=Math.min(this.diagramContainer.parentNode.clientWidth-10,218),e="1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,650),g="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme;this.sidebarWindow=new WrapperWindow(this,mxResources.get("shapes"),g&&"1"!=urlParams.embedInline?+66:10,g&&"1"!=urlParams.embedInline?Math.max(30,(this.diagramContainer.parentNode.clientHeight-e)/2):56,c-6,e-6,mxUtils.bind(this,function(l){this.createShapesPanel(l)}));this.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.sidebarWindow.window.fit()}));this.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90);this.sidebarWindow.window.setVisible(!1)}};EditorUi.prototype.setSketchMode=function(c){this.doSetSketchMode(c);null==urlParams.rough&&(mxSettings.settings.sketchMode=+c,mxSettings.save());this.fireEvent(new mxEventObject("sketchModeChanged"))};EditorUi.prototype.setAndPersistDarkMode=function(c){var e=c;"auto"==c&&(e=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode(e);mxSettings.settings.darkMode=c;mxSettings.save();c=mxSettings.getUi();null==urlParams.ui&&"dark"==c&&this.setCurrentTheme("kennedy",!0)};EditorUi.prototype.setAndPersistLanguage=function(c){this.spinner.spin(document.body,mxResources.get("working"))&&+(mxSettings.setLanguage(c),mxSettings.save(),mxClient.language=c,mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE,null,mxUtils.bind(this,function(){this.spinner.stop();this.fireEvent(new mxEventObject("languageChanged"))})))};EditorUi.prototype.setElementTitle=function(c,e){this.dependsOnLanguage(mxUtils.bind(this,function(){c.setAttribute("title",mxResources.get(e))}))};EditorUi.prototype.dependsOnLanguage=function(c){c();this.addListener("languageChanged",c)};EditorUi.prototype.setAndPersistHighContrast=+function(c){this.setHighContrast(c);Editor.isSettingsEnabled()&&(mxSettings.settings.highContrast=c,mxSettings.save())};EditorUi.prototype.isHighContrast=function(){var c=document.getElementById("high-contrast-stylesheet");return null!=c&&window.matchMedia?(c=c.getAttribute("media"),"all"==c||"not all"!=c&&window.matchMedia("(forced-colors: active)").matches):!1};EditorUi.prototype.setHighContrast=function(c){var e=document.getElementById("high-contrast-stylesheet");if(null!=e&&window.matchMedia){var g=+window.matchMedia("(forced-colors: active)").matches,l=e.getAttribute("media");(l="all"==l||"not all"!=l&&g)&&!c?e.setAttribute("media",g?"not all":"(forced-colors: active)"):!l&&c&&e.setAttribute("media",g?"(forced-colors: active)":"all")}};EditorUi.prototype.isRulerVisible=function(){return null!=this.ruler};EditorUi.prototype.setRulerVisible=function(c){var e=this.getDiagramContainerOffset();mxSettings.setRulerOn(c);mxSettings.save();c||null==this.ruler?c&&null==this.ruler&&(this.ruler=new mxDualRuler(this,+this.editor.graph.view.unit)):(this.ruler.destroy(),this.ruler=null);this.fireEvent(new mxEventObject("rulerVisibleChanged"));c=this.getDiagramContainerOffset();this.diagramContainer.scrollLeft+=c.x-e.x;this.diagramContainer.scrollTop+=c.x-e.x};EditorUi.prototype.isAutoDarkModeSupported=function(){return null!=window.matchMedia};EditorUi.prototype.isAutoDarkMode=function(c){return!c&&"auto"==urlParams.dark||Editor.isSettingsEnabled()&&"auto"==mxSettings.settings.darkMode};EditorUi.prototype.setDarkMode=+function(c){mxUtils.lightDarkColorSupported&&(Editor.darkMode=c,c=mxUtils.isAncestorNode(document.body,this.container)||null==this.editor?this.container:this.editor.graph.container,mxConstants.DROP_TARGET_COLOR=Editor.isDarkMode()?"#00ff00":"#0000ff",null!=c&&(Editor.isDarkMode()?(c.classList.add("geDarkMode"),c.style.colorScheme="dark"):(c.classList.remove("geDarkMode"),c.style.colorScheme="light")),null!=this.ruler&&this.ruler.updateStyle(),this.fireEvent(new mxEventObject("darkModeChanged")))};+EditorUi.prototype.setPagesVisible=function(c){Editor.pagesVisible!=c&&(Editor.pagesVisible=c,mxSettings.settings.pagesVisible=c,mxSettings.save(),this.fireEvent(new mxEventObject("pagesVisibleChanged")))};EditorUi.prototype.setSidebarTitles=function(c,e){this.sidebar.sidebarTitles!=c&&(this.sidebar.sidebarTitles=c,Editor.isSettingsEnabled()&&e&&(mxSettings.settings.sidebarTitles=c,mxSettings.save()),this.fireEvent(new mxEventObject("sidebarTitlesChanged")))};EditorUi.prototype.setInlineFullscreen=+function(c){Editor.inlineFullscreen!=c&&(this.diagramContainer.setAttribute("data-scrollState",JSON.stringify(this.saveScrollState(!0))),(window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:c,rect:this.diagramContainer.getBoundingClientRect()}),"*"))};EditorUi.prototype.inlineSizeChanged=function(){var c=this.sketchFooterMenuElt,e=this.sketchMainMenuElt,g=this.sketchPickerMenuElt;if(Editor.inlineFullscreen)e.style.left="10px",e.style.top="10px",g.style.left="10px",+g.style.top="60px",c.style.top="10px",c.style.right="12px",c.style.left="",null==this.diagramContainer.getAttribute("data-bounds")&&(this.diagramContainer.setAttribute("data-bounds",this.diagramContainer.style.top+" "+this.diagramContainer.style.left+" "+this.diagramContainer.style.width+" "+this.diagramContainer.style.height),this.diagramContainer.style.top="0px",this.diagramContainer.style.left="0px",this.diagramContainer.style.bottom="0px",this.diagramContainer.style.right="0px",this.diagramContainer.style.width=+"",this.diagramContainer.style.height="");else{var l=this.diagramContainer.getAttribute("data-bounds");if(null!=l){this.diagramContainer.removeAttribute("data-bounds");var n=l.split(" ");l=mxUtils.getDocumentSize();this.diagramContainer.style.top=n[0];this.diagramContainer.style.left=n[1];var u=parseInt(n[2]);n=parseInt(n[3]);u=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,u):u,l.width-80);n=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,n):n,l.height-80);this.diagramContainer.style.width=+u+"px";this.diagramContainer.style.height=n+"px";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";(window.opener||window.parent).postMessage(JSON.stringify({event:"resize",rect:this.diagramContainer.getBoundingClientRect()}),"*")}e.style.left=this.diagramContainer.offsetLeft+"px";e.style.top=this.diagramContainer.offsetTop-e.offsetHeight-4+"px";g.style.display="";g.style.left=this.diagramContainer.offsetLeft-g.offsetWidth-4+"px";g.style.top=this.diagramContainer.offsetTop++"px";c.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-c.offsetWidth+"px";c.style.top=e.style.top;c.style.right="";this.bottomResizer.style.left=this.diagramContainer.offsetLeft+(this.diagramContainer.offsetWidth-this.bottomResizer.offsetWidth)/2+"px";this.bottomResizer.style.top=this.diagramContainer.offsetTop+this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight/2-1+"px";this.rightResizer.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-+this.rightResizer.offsetWidth/2-1+"px";this.rightResizer.style.top=this.diagramContainer.offsetTop+(this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight)/2+"px"}this.bottomResizer.style.visibility=Editor.inlineFullscreen?"hidden":"";this.rightResizer.style.visibility=this.bottomResizer.style.visibility;e.style.visibility="";c.style.visibility=""};EditorUi.prototype.doSetSketchMode=function(c){Editor.sketchMode!=c&&(Editor.sketchMode=c,this.updateDefaultStyles())};EditorUi.prototype.updateDefaultStyles=+function(){var c=this.editor.graph;c.defaultVertexStyle=mxUtils.clone(Graph.prototype.defaultVertexStyle);c.defaultEdgeStyle=mxUtils.clone(Graph.prototype.defaultEdgeStyle);if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.vertexFontSize=16,c.edgeFontSize=c.vertexFontSize-4):"sketch"==Editor.currentTheme?(c.vertexFontSize=20,c.edgeFontSize=c.vertexFontSize-4):(c.vertexFontSize=Graph.prototype.vertexFontSize,+c.edgeFontSize=Graph.prototype.edgeFontSize),c.defaultEdgeStyle.fontSize=c.edgeFontSize;if(null==Editor.config||null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.endSize="8",c.defaultEdgeStyle.startSize="8"):"sketch"==Editor.currentTheme&&(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.jettySize=+"auto",c.defaultEdgeStyle.orthogonalLoop="1",c.defaultEdgeStyle.endArrow="open",c.defaultEdgeStyle.endSize="14",c.defaultEdgeStyle.startSize="14",c.defaultEdgeStyle.sourcePerimeterSpacing="8",c.defaultEdgeStyle.targetPerimeterSpacing="8");if(null==Editor.config||null==Editor.config.defaultFonts){if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle){if("sketch"==Editor.currentTheme&&"1"!=urlParams.embedInline||Editor.sketchMode)c.defaultVertexStyle.fontFamily=+Editor.sketchFontFamily,c.defaultVertexStyle.fontSource=Editor.sketchFontSource,c.defaultEdgeStyle.fontFamily=Editor.sketchFontFamily,c.defaultEdgeStyle.fontSource=Editor.sketchFontSource;Editor.sketchMode&&(c.defaultVertexStyle.sketch="1",c.defaultVertexStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultVertexStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultVertexStyle.hachureGap="4",c.defaultEdgeStyle.sketch="1",c.defaultEdgeStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultEdgeStyle.jiggle=+Editor.sketchDefaultJiggle,c.defaultEdgeStyle.hachureGap="4")}this.menus.defaultFonts="sketch"==Editor.currentTheme?Menus.prototype.defaultFonts.concat(Editor.sketchFonts):Menus.prototype.defaultFonts}c.currentVertexStyle=mxUtils.clone(c.defaultVertexStyle);c.currentEdgeStyle=mxUtils.clone(c.defaultEdgeStyle);this.clearDefaultStyle()};EditorUi.prototype.getLinkTitle=function(c){var e=Graph.prototype.getLinkTitle.apply(this,arguments);if(Graph.isPageLink(c)){var g=c.indexOf(",");0<g&&(e=this.getPageById(c.substring(g++1)),e=null!=e?e.getName():mxResources.get("pageNotFound"))}else"data:"==c.substring(0,5)&&(e=this.getCustomLinkTitle(c));return e};EditorUi.prototype.getCustomLinkTitle=function(c){var e=mxResources.get("action");if("data:action/json,"==c.substring(0,17))try{var g=JSON.parse(c.substring(17));null!=g&&null!=g.title&&(e=g.title)}catch(l){}return e};EditorUi.prototype.handleCustomLink=function(c,e){if(Graph.isPageLink(c))if(e=c.indexOf(","),c=this.getPageById(c.substring(e+1)))this.selectPage(c);else throw Error(mxResources.get("pageNotFound")||+"Page not found");else this.editor.graph.handleCustomLink(c,e)};EditorUi.prototype.installSettings=function(){if(Editor.isSettingsEnabled()){var c=this.editor.graph;Editor.pagesVisible=mxSettings.settings.pagesVisible;ColorDialog.recentColors=mxSettings.getRecentColors();if(isLocalStorage)try{window.addEventListener("storage",mxUtils.bind(this,function(e){e.key==mxSettings.key&&(mxSettings.load(),ColorDialog.recentColors=mxSettings.getRecentColors(),this.menus.customFonts=mxSettings.getCustomFonts())}),+!1)}catch(e){}this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.menus.customFonts=mxSettings.getCustomFonts();this.addListener("customFontsChanged",mxUtils.bind(this,function(e,g){mxSettings.setCustomFonts(this.menus.customFonts);mxSettings.save()}));c.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(e,g){mxSettings.setCreateTarget(c.connectionHandler.isCreateTarget());+mxSettings.save()}));c.pageFormat=null!=c.defaultPageFormat?c.defaultPageFormat:mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(e,g){mxSettings.setPageFormat(c.pageFormat);mxSettings.save()}));c.view.defaultDarkGridColor=mxSettings.getGridColor(!0);c.view.defaultGridColor=mxSettings.getGridColor(!1);c.view.gridColor="light-dark("+c.view.defaultGridColor+", "+c.view.defaultDarkGridColor+")";this.addListener("gridColorChanged",mxUtils.bind(this,function(e,+g){mxSettings.setGridColor(c.view.defaultGridColor,!1);mxSettings.setGridColor(c.view.defaultDarkGridColor,!0);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(e,g){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();if(!this.editor.chromeless||this.editor.editable)null!=mxSettings.settings.enableAnimations&&(Editor.enableAnimations=mxSettings.settings.enableAnimations),+this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(e,g){mxSettings.settings.enableAnimations=Editor.enableAnimations;mxSettings.save()}));null!=this.sidebar&&(null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes?(this.sidebar.searchShapes(decodeURIComponent(urlParams["search-shapes"])),this.sidebar.showEntries("search")):(this.sidebar.showPalette("search",mxSettings.settings.search),this.editor.chromeless&&!this.editor.editable||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||+0))||(this.toggleScratchpad(),mxSettings.save())));this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyImage=function(c,e,g){try{null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(l,n){try{this.spinner.stop();var u=this.createImageDataUri(l,e,"png"),z=parseInt(n.getAttribute("width")),+D=parseInt(n.getAttribute("height"));this.writeImageToClipboard(u,z,D,mxUtils.bind(this,function(C){this.handleError(C)}))}catch(C){this.handleError(C)}}),null,null,null,mxUtils.bind(this,function(l){this.spinner.stop();this.handleError(l)}),null,null,null!=g?g:4,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,null,null,null,10,null,null,!1,null,0<c.length?c:null)}catch(l){this.handleError(l)}};EditorUi.prototype.copyCells=function(c,e){var g=this.editor.graph;if(g.isSelectionEmpty())c.innerText=+"";else{var l=mxUtils.sortCells(g.model.getTopmostCells(g.getSelectionCells())),n=mxUtils.getXml(g.encodeCells(l));mxUtils.setTextContent(c,encodeURIComponent(n));e?(g.removeCells(l,!1),g.lastPasteXml=null):(g.lastPasteXml=n,g.pasteCounter=0);c.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var c=null;if(Editor.enableNativeCipboard){var e=this.editor.graph;e.isSelectionEmpty()||(c=mxUtils.sortCells(e.getExportableCells(e.model.getTopmostCells(e.getSelectionCells()))),e=mxUtils.getXml(e.encodeCells(c)),navigator.clipboard.writeText(e))}return c};EditorUi.prototype.pasteXml=function(c,e,g,l,n){n=null!=n?n:!0;var u=this.editor.graph,z=null;u.lastPasteXml==c?u.pasteCounter++:(u.lastPasteXml=c,u.pasteCounter=0);var D=u.pasteCounter*u.gridSize;if(g||this.isCompatibleString(c))z=this.importXml(c,D,D),u.setSelectionCells(z);else if(e&&1==u.getSelectionCount()){n=u.getStartEditingCell(u.getSelectionCell(),l);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&"image"==u.getCurrentCellStyle(n)[mxConstants.STYLE_SHAPE])u.setCellStyles(mxConstants.STYLE_IMAGE,c,[n]);else{u.model.beginUpdate();try{u.labelChanged(n,c),Graph.isLink(c)&&u.setLinkForCell(n,c)}finally{u.model.endUpdate()}}u.setSelectionCell(n)}else z=u.getInsertPoint(),u.isMouseInsertPoint()&&(D=0,u.lastPasteXml==c&&0<u.pasteCounter&&u.pasteCounter--),z=this.insertTextAt(c,z.x+D,z.y+D,n),u.setSelectionCells(z);u.isSelectionEmpty()||(u.scrollCellToVisible(u.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(u.view.getState(u.getSelectionCell())));return z};EditorUi.prototype.pasteCells=function(c,e,g,l){if(!mxEvent.isConsumed(c)){var n=e,u=!1;if(g&&null!=c.clipboardData&&c.clipboardData.getData){var z=c.clipboardData.getData("text/plain"),D=!1;if(null!=z&&0<z.length&&"%3CmxGraphModel%3E"==z.substring(0,18))try{var C=decodeURIComponent(z);this.isCompatibleString(C)&&(D=!0,z=C)}catch(p){}D=D?null:c.clipboardData.getData("text/html");null!=D&&0<D.length?(n=this.parseHtmlData(D),u="text/plain"!=n.getAttribute("data-type")):null!=z&&0<z.length&&(n=document.createElement("div"),mxUtils.setTextContent(n,@@ -13346,16 +13350,16 @@ D))}z=n.getElementsByTagName("span");if(null!=z&&0<z.length&&"application/vnd.lumxEvent.consume(c));else{var A=!1,Q="";Q=u?null!=n.textContent&&"<mxfile"==n.textContent.substring(0,7)&&"</mxfile>"==n.textContent.substring(n.textContent.length-9)||"<mxGraphModel"==n.textContent.substring(0,13)&&"</mxGraphModel>"==n.textContent.substring(n.textContent.length-15)?n.textContent.replace(/\u00a0/g," "):n.innerHTML:mxUtils.trim(null==n.innerText?mxUtils.getTextContent(n):n.innerText);try{var S=Q.lastIndexOf("%3E");0<=S&&S<Q.length-3&&(Q=Q.substring(0,S+3))}catch(p){}try{z=n.getElementsByTagName("span"),(C=null!=z&&0<z.length?mxUtils.trim(decodeURIComponent(z[0].textContent)):decodeURIComponent(Q))&&(this.isCompatibleString(C)||0==C.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(A=!0,Q=C)}catch(p){}try{if(null!=Q&&0<Q.length){if(0==Q.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var U=mxUtils.bind(this,function(){try{Q=(new MiroImporter).importMiroJson(JSON.parse(Q)),this.pasteXml(Q,l,A,c)}catch(p){console.log("Miro import error:",p)}});"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",U):U()}else this.pasteXml(Q,l,A,c,u);try{mxEvent.consume(c)}catch(p){}}else if(!g){var O=this.editor.graph;O.lastPasteXml=null;O.pasteCounter=0}}catch(p){this.handleError(p)}}}e.innerHTML=" "};EditorUi.prototype.showPrintDialog=function(c,e,g){var l=320;this.editor.graph.isEnabled()&&(l+=40);null!=this.pages&&1<this.pages.length&&(l+=40,this.editor.graph.isEnabled()||(l+=10));null==e||mxClient.IS_CHROMEAPP||"draw.io"!=this.getServiceName()||(l+=20);-this.showDialog((new PrintDialog(this,c,e,g)).container,320,l,!0,!0)};EditorUi.prototype.print=function(c,e){var g=this.editor,l=g.graph,n=this.getPageIndex(this.currentPage),u=null!=n?n+1:1,z=mxUtils.bind(this,function(G,E,H,M){var L=G.useCssTransforms,k=G.currentTranslate,y=G.currentScale,F=G.view.translate,K=G.view.scale;G.useCssTransforms&&(G.useCssTransforms=!1,G.currentTranslate=new mxPoint(0,0),G.currentScale=1,G.view.translate=new mxPoint(0,0),G.view.scale=1);var P=G.getGraphBounds(),R=0,-T=0,V=mxRectangle.fromRectangle(G.pageFormat),W=e.fit||e.crop||!G.pageVisible,X=e.scale;V.width=Math.ceil(V.width*G.pageScale);V.height=Math.ceil(V.height*G.pageScale);var Z=1;if(e.fit){Z=e.sheetsAcross;var Y=e.sheetsDown;isNaN(X)||(V.width=Math.ceil(V.width*X),V.height=Math.ceil(V.height*X));Z=Math.min(V.height*Y/(P.height/G.view.scale),V.width*Z/(P.width/G.view.scale))}else Z=isNaN(X)?1:X;Z*=1;!W&&G.pageVisible?(X=G.getPageLayout(),R-=X.x*V.width,T-=X.y*V.height):W=!0;e.crop&&(e.selection&&(P=l.getBoundingBox(l.getSelectionCells())),-V.width=(P.width+1)*Z/G.view.scale,V.height=(P.height+1)*Z/G.view.scale);V.width=Math.ceil(1*V.width);V.height=Math.ceil(1*V.height);M=null!=M?"page/id,"+M:null;if(null==E){E=PrintDialog.createPrintPreview(G,Z,null,0,R,T,W);E.title=this.getBaseFilename(!0);E.pageSelector=!1;E.mathEnabled=!1;R=e.border;isNaN(R)||(E.pageMargin=R);e.selection&&(E.isCellVisible=function(ba){return G.isCellSelected(ba)});var da=E.writeHead;E.writeHead=function(ba){da.apply(this,arguments);mxClient.IS_GC&&(ba.writeln('<style type="text/css">'),+this.showDialog((new PrintDialog(this,c,e,g)).container,320,l,!0,!0)};EditorUi.prototype.print=function(c,e){var g=this.editor,l=g.graph,n=this.getPageIndex(this.currentPage),u=null!=n?n+1:1,z=mxUtils.bind(this,function(G,E,H,L){var K=G.useCssTransforms,k=G.currentTranslate,y=G.currentScale,F=G.view.translate,M=G.view.scale;G.useCssTransforms&&(G.useCssTransforms=!1,G.currentTranslate=new mxPoint(0,0),G.currentScale=1,G.view.translate=new mxPoint(0,0),G.view.scale=1);var P=G.getGraphBounds(),R=0,+T=0,V=mxRectangle.fromRectangle(G.pageFormat),W=e.fit||e.crop||!G.pageVisible,X=e.scale;V.width=Math.ceil(V.width*G.pageScale);V.height=Math.ceil(V.height*G.pageScale);var Y=1;if(e.fit){Y=e.sheetsAcross;var Z=e.sheetsDown;isNaN(X)||(V.width=Math.ceil(V.width*X),V.height=Math.ceil(V.height*X));Y=Math.min(V.height*Z/(P.height/G.view.scale),V.width*Y/(P.width/G.view.scale))}else Y=isNaN(X)?1:X;Y*=1;!W&&G.pageVisible?(X=G.getPageLayout(),R-=X.x*V.width,T-=X.y*V.height):W=!0;e.crop&&(e.selection&&(P=l.getBoundingBox(l.getSelectionCells())),+V.width=(P.width+1)*Y/G.view.scale,V.height=(P.height+1)*Y/G.view.scale);V.width=Math.ceil(1*V.width);V.height=Math.ceil(1*V.height);L=null!=L?"page/id,"+L:null;if(null==E){E=PrintDialog.createPrintPreview(G,Y,null,0,R,T,W);E.title=this.getBaseFilename(!0);E.pageSelector=!1;E.mathEnabled=!1;R=e.border;isNaN(R)||(E.pageMargin=R);e.selection&&(E.isCellVisible=function(ba){return G.isCellSelected(ba)});var da=E.writeHead;E.writeHead=function(ba){da.apply(this,arguments);mxClient.IS_GC&&(ba.writeln('<style type="text/css">'),ba.writeln("@media print {"),ba.writeln(".MathJax svg { shape-rendering: crispEdges; }"),ba.writeln("}"),ba.writeln("</style>"));null!=g.fontCss&&(ba.writeln('<style type="text/css">'),ba.writeln(mxUtils.htmlEntities(g.fontCss,!1,!1,!1)),ba.writeln("</style>"));for(var ha=G.getCustomFonts(),aa=0;aa<ha.length;aa++){var ia=ha[aa].name,fa=ha[aa].url;Graph.isCssFontUrl(fa)?ba.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(fa))+'" charset="UTF-8" type="text/css">'):(ba.writeln('<style type="text/css">'),ba.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(ia)+'";\nsrc: url("'+mxUtils.htmlEntities(fa)+'");\n}'),ba.writeln("</style>"))}};if(Editor.replaceSvgDataUris){var ea=E.drawBackgroundImage;E.drawBackgroundImage=function(ba){ea.apply(this,arguments);null!=ba.node&&(EditorUi.embedSvgImages(ba.node),l.disableSvgLinks(ba.node,function(ha){ha.setAttribute("href","javascript:void(0)")}))}}var ka=E.addGraphFragment;E.addGraphFragment=function(ba,ha,aa,-ia,fa,ca){ka.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:fa.classList.add("geDisableMathJax")};e.grid&&(E.gridSize=G.gridSize,E.gridSteps=G.view.gridSteps,E.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:G.view.gridColor);E.open(null,null,H,!0,M,V,e.selection?G.getSelectionCells():null)}else{P=G.background;if(null==P||""==P||P==mxConstants.NONE)P="#ffffff";E.backgroundColor=P;E.autoOrigin=W;e.grid&&(E.gridSize=G.gridSize,E.gridSteps=G.view.gridSteps,-E.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:G.view.gridColor);E.appendGraph(G,Z,R,T,H,!0,M,V,e.selection?G.getSelectionCells():null);H=G.getCustomFonts();if(null!=E.wnd)for(V=0;V<H.length;V++)R=H[V].name,T=H[V].url,Graph.isCssFontUrl(T)?E.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(T)+'" charset="UTF-8" type="text/css">'):(E.wnd.document.writeln('<style type="text/css">'),E.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(R)+-'";\nsrc: url("'+mxUtils.htmlEntities(T)+'");\n}'),E.wnd.document.writeln("</style>"))}L&&(G.useCssTransforms=L,G.currentTranslate=k,G.currentScale=y,G.view.translate=F,G.view.scale=K);return E}),D=e.pagesFrom,C=e.pagesTo,A=!e.allPages;n=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,e);else{A&&(A=e.selection||D==u&&C==u);if(!A&&null!=this.pages&&this.pages.length){A=0;u=this.pages.length-1;e.allPages||(A=parseInt(D)-1,u=parseInt(C)-1);for(var Q=A;Q<=u;Q++){var S=this.pages[Q];D=S==+ia,fa,ca){ka.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:fa.classList.add("geDisableMathJax")};e.grid&&(E.gridSize=G.gridSize,E.gridSteps=G.view.gridSteps,E.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:G.view.gridColor);E.open(null,null,H,!0,L,V,e.selection?G.getSelectionCells():null)}else{P=G.background;if(null==P||""==P||P==mxConstants.NONE)P="#ffffff";E.backgroundColor=P;E.autoOrigin=W;e.grid&&(E.gridSize=G.gridSize,E.gridSteps=G.view.gridSteps,+E.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:G.view.gridColor);E.appendGraph(G,Y,R,T,H,!0,L,V,e.selection?G.getSelectionCells():null);H=G.getCustomFonts();if(null!=E.wnd)for(V=0;V<H.length;V++)R=H[V].name,T=H[V].url,Graph.isCssFontUrl(T)?E.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(T)+'" charset="UTF-8" type="text/css">'):(E.wnd.document.writeln('<style type="text/css">'),E.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(R)++'";\nsrc: url("'+mxUtils.htmlEntities(T)+'");\n}'),E.wnd.document.writeln("</style>"))}K&&(G.useCssTransforms=K,G.currentTranslate=k,G.currentScale=y,G.view.translate=F,G.view.scale=M);return E}),D=e.pagesFrom,C=e.pagesTo,A=!e.allPages;n=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,e);else{A&&(A=e.selection||D==u&&C==u);if(!A&&null!=this.pages&&this.pages.length){A=0;u=this.pages.length-1;e.allPages||(A=parseInt(D)-1,u=parseInt(C)-1);for(var Q=A;Q<=u;Q++){var S=this.pages[Q];D=S==this.currentPage?l:null;if(null==D){D=this.createTemporaryGraph(l.stylesheet);D.shapeForegroundColor=l.shapeForegroundColor;D.shapeBackgroundColor=l.shapeBackgroundColor;C=!0;A=!1;var U=null,O=null;null==S.viewState&&null==S.root&&this.updatePageRoot(S);null!=S.viewState&&(C=S.viewState.pageVisible,A=S.viewState.mathEnabled,U=S.viewState.background,O=S.viewState.backgroundImage,D.pageFormat=S.viewState.pageFormat,D.gridSize=S.viewState.gridSize);null!=O&&null!=O.originalSrc&&(O=this.createImageForPageLink(O.originalSrc,-S));D.background=U;D.backgroundImage=null!=O?new mxImage(O.src,O.width,O.height,O.x,O.y):null;D.pageVisible=C;D.mathEnabled=A;var p=D.getGraphBounds;D.getGraphBounds=function(){var G=p.apply(this,arguments),E=this.backgroundImage;if(null!=E&&null!=E.width&&null!=E.height){var H=this.view.translate,M=this.view.scale;G=mxRectangle.fromRectangle(G);G.add(new mxRectangle((H.x+E.x)*M,(H.y+E.y)*M,E.width*M,E.height*M))}return G};var q=D.getGlobalVariable;D.getGlobalVariable=function(G){return"page"==G?+S));D.background=U;D.backgroundImage=null!=O?new mxImage(O.src,O.width,O.height,O.x,O.y):null;D.pageVisible=C;D.mathEnabled=A;var p=D.getGraphBounds;D.getGraphBounds=function(){var G=p.apply(this,arguments),E=this.backgroundImage;if(null!=E&&null!=E.width&&null!=E.height){var H=this.view.translate,L=this.view.scale;G=mxRectangle.fromRectangle(G);G.add(new mxRectangle((H.x+E.x)*L,(H.y+E.y)*L,E.width*L,E.height*L))}return G};var q=D.getGlobalVariable;D.getGlobalVariable=function(G){return"page"==G?S.getName():"pagenumber"==G?Q+1:"pagecount"==G?null!=this.pages?this.pages.length:1:q.apply(this,arguments)};document.body.appendChild(D.container);this.updatePageRoot(S);D.model.setRoot(S.root)}n=z(D,n,Q!=u,S.getId());D!=l&&D.container.parentNode.removeChild(D.container)}}else n=z(l);null==n||null==n.wnd?this.handleError({message:mxResources.get("errorUpdatingPreview")}):(n.mathEnabled&&(z=n.wnd.document,c||(n.wnd.IMMEDIATE_PRINT=!0),z.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>')),n.closeDocument(),Graph.rewritePageLinks(n.wnd.document,!0),n.mathEnabled||c||PrintDialog.printPreview(n));return n}};EditorUi.prototype.addFileDropHandler=function(c){if(Graph.fileSupport)for(var e=null,g=0;g<c.length;g++)mxEvent.addListener(c[g],"dragleave",function(l){null!=e&&(e.parentNode.removeChild(e),e=null);l.stopPropagation();l.preventDefault()}),mxEvent.addListener(c[g],"dragover",mxUtils.bind(this,function(l){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==e&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(e=this.highlightElement());l.stopPropagation();l.preventDefault()})),mxEvent.addListener(c[g],"drop",mxUtils.bind(this,function(l){null!=e&&(e.parentNode.removeChild(e),e=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<l.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(l.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(l)&&!mxEvent.isShiftDown(l)):this.openFiles(l.dataTransfer.files,@@ -13388,55 +13392,55 @@ result:"edit",message:A}),"*")}),mxUtils.bind(this,function(){this.hideDialog();try{O.init()}catch(aa){z.postMessage(JSON.stringify({event:"draft",error:aa.toString(),message:A}),"*")}return}if("template"==A.action){this.spinner.stop();var q=1==A.enableRecent,G=1==A.enableSearch,E=1==A.enableCustomTemp;O=new NewDialog(this,!1,A.templatesOnly?!1:null!=A.callback,mxUtils.bind(this,function(aa,ia,fa,ca){aa=aa||this.emptyDiagramXml;null!=A.callback?z.postMessage(JSON.stringify({event:"template",xml:aa,blank:aa==this.emptyDiagramXml,name:ia,tempUrl:fa,libs:ca,builtIn:!0,message:A}),"*"):(c(aa,C,aa!=this.emptyDiagramXml,A.toSketch),this.editor.modified||this.clearStatus())}),null,null,null,null,null,null,null,q?mxUtils.bind(this,function(aa){this.remoteInvoke("getRecentDiagrams",[null],null,aa,function(){aa(null,"Network Error!")})}):null,G?mxUtils.bind(this,function(aa,ia){this.remoteInvoke("searchDiagrams",[aa,null],null,ia,function(){ia(null,"Network Error!")})}):null,mxUtils.bind(this,function(aa,ia,fa){z.postMessage(JSON.stringify({event:"template",docUrl:aa,info:ia,name:fa}),"*")}),null,null,E?mxUtils.bind(this,function(aa){this.remoteInvoke("getCustomTemplates",null,null,aa,function(){aa({},0)})}):null,1==A.withoutType);this.showDialog(O.container,620,460,!0,!1,mxUtils.bind(this,function(aa){null!=this.sidebar&&this.sidebar.hideTooltip();aa&&this.actions.get("exit").funct()}));O.init();return}if("textContent"==A.action){var H=this.getDiagramTextContent();z.postMessage(JSON.stringify({event:"textContent",data:H,message:A}),"*");return}if("status"==A.action){this.updateStatus(mxUtils.bind(this,-function(){null!=A.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(A.messageKey))):null!=A.message&&this.editor.setStatus(mxUtils.htmlEntities(A.message))}));null!=A.modified&&(this.editor.modified=A.modified);return}if("spinner"==A.action){var M=null!=A.messageKey?mxResources.get(A.messageKey):A.message;null==A.show||A.show?this.spinner.spin(document.body,M):this.spinner.stop();return}if("exit"==A.action){this.actions.get("exit").funct();return}if("viewport"==A.action){if(null!=-A.viewport){var L=this.editor.graph,k=L.view.translate.x,y=L.view.translate.y;this.embedViewport=A.viewport;L.refresh();this.diagramContainer.scrollTop-=(y-L.view.translate.y)*L.view.scale;this.diagramContainer.scrollLeft-=(k-L.view.translate.x)*L.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("fullscreenChanged"==A.action){O=null;try{var F=this.diagramContainer.getAttribute("data-scrollState");null!=F&&(this.diagramContainer.removeAttribute("data-scrollState"),O=JSON.parse(F))}catch(aa){}Editor.inlineFullscreen=-A.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=O&&this.restoreScrollState(O);return}if("snapshot"==A.action){this.sendEmbeddedSvgExport(!0);return}if("export"==A.action){if("png"==A.format||"xmlpng"==A.format){if(null==A.spin&&null==A.spinKey||this.spinner.spin(document.body,null!=A.spinKey?mxResources.get(A.spinKey):A.spin)){var K=null!=A.xml?A.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);L=this.editor.graph;var P=mxUtils.bind(this,function(aa,ia){if(A.withSvg)A.withSvg=-!1,this.getEmbeddedSvg(K,this.editor.graph,null,!0,function(ca){P(aa,ca)},null,null,A.embedImages,this.editor.graph.background,A.scale,A.border,A.shadow,"auto");else{this.editor.graph.setEnabled(!0);this.spinner.stop();var fa=this.createLoadMessage("export");fa.format=A.format;fa.message=A;fa.data=aa;fa.svg=ia;fa.xml=K;z.postMessage(JSON.stringify(fa),"*")}}),R=mxUtils.bind(this,function(aa){null==aa&&(aa=Editor.blankImage);"xmlpng"==A.format&&(aa=Editor.writeGraphModelToPng(aa,"tEXt","mxfile",encodeURIComponent(K)));-L!=this.editor.graph&&L.container.parentNode.removeChild(L.container);P(aa)}),T=A.pageId||(null!=this.pages?A.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.isExportToCanvas()){var V=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=T){var aa=L.getGlobalVariable;L=this.createTemporaryGraph(L.getStylesheet());for(var ia,fa=0;fa<this.pages.length;fa++)if(this.pages[fa].getId()==T){ia=this.updatePageRoot(this.pages[fa]);break}null==ia&&(ia=this.currentPage);-L.getGlobalVariable=function(xa){return"page"==xa?ia.getName():"pagenumber"==xa?1:aa.apply(this,arguments)};document.body.appendChild(L.container);L.model.setRoot(ia.root)}if(null!=A.layerIds){var ca=L.model,Ba=ca.getChildCells(ca.getRoot()),la={};for(fa=0;fa<A.layerIds.length;fa++)la[A.layerIds[fa]]=!0;for(fa=0;fa<Ba.length;fa++)ca.setVisible(Ba[fa],la[Ba[fa].id]||!1)}fa=null;A.keepTheme&&(fa=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,function(xa){R(xa.toDataURL("image/png"))}),-A.width,null,A.background,mxUtils.bind(this,function(){R(null)}),null,null,A.scale,A.transparent,A.shadow,null,L,A.border,null,A.grid,fa)});null!=A.xml&&0<A.xml.length&&(g=!0,this.setFileData(K),g=!1);V()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==A.format?"1":"0")+(null!=T?"&pageId="+T:"")+(null!=A.layerIds&&0<A.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:A.layerIds})):"")+(null!=A.scale?"&scale="+A.scale:"")+"&base64=1&xml="+encodeURIComponent(K))).send(mxUtils.bind(this,+function(){null!=A.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(A.messageKey))):null!=A.message&&this.editor.setStatus(mxUtils.htmlEntities(A.message))}));null!=A.modified&&(this.editor.modified=A.modified);return}if("spinner"==A.action){var L=null!=A.messageKey?mxResources.get(A.messageKey):A.message;null==A.show||A.show?this.spinner.spin(document.body,L):this.spinner.stop();return}if("exit"==A.action){this.actions.get("exit").funct();return}if("viewport"==A.action){if(null!=+A.viewport){var K=this.editor.graph,k=K.view.translate.x,y=K.view.translate.y;this.embedViewport=A.viewport;K.refresh();this.diagramContainer.scrollTop-=(y-K.view.translate.y)*K.view.scale;this.diagramContainer.scrollLeft-=(k-K.view.translate.x)*K.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("fullscreenChanged"==A.action){O=null;try{var F=this.diagramContainer.getAttribute("data-scrollState");null!=F&&(this.diagramContainer.removeAttribute("data-scrollState"),O=JSON.parse(F))}catch(aa){}Editor.inlineFullscreen=+A.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=O&&this.restoreScrollState(O);return}if("snapshot"==A.action){this.sendEmbeddedSvgExport(!0);return}if("export"==A.action){if("png"==A.format||"xmlpng"==A.format){if(null==A.spin&&null==A.spinKey||this.spinner.spin(document.body,null!=A.spinKey?mxResources.get(A.spinKey):A.spin)){var M=null!=A.xml?A.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);K=this.editor.graph;var P=mxUtils.bind(this,function(aa,ia){if(A.withSvg)A.withSvg=+!1,this.getEmbeddedSvg(M,this.editor.graph,null,!0,function(ca){P(aa,ca)},null,null,A.embedImages,this.editor.graph.background,A.scale,A.border,A.shadow,"auto");else{this.editor.graph.setEnabled(!0);this.spinner.stop();var fa=this.createLoadMessage("export");fa.format=A.format;fa.message=A;fa.data=aa;fa.svg=ia;fa.xml=M;z.postMessage(JSON.stringify(fa),"*")}}),R=mxUtils.bind(this,function(aa){null==aa&&(aa=Editor.blankImage);"xmlpng"==A.format&&(aa=Editor.writeGraphModelToPng(aa,"tEXt","mxfile",encodeURIComponent(M)));+K!=this.editor.graph&&K.container.parentNode.removeChild(K.container);P(aa)}),T=A.pageId||(null!=this.pages?A.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.isExportToCanvas()){var V=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=T){var aa=K.getGlobalVariable;K=this.createTemporaryGraph(K.getStylesheet());for(var ia,fa=0;fa<this.pages.length;fa++)if(this.pages[fa].getId()==T){ia=this.updatePageRoot(this.pages[fa]);break}null==ia&&(ia=this.currentPage);+K.getGlobalVariable=function(xa){return"page"==xa?ia.getName():"pagenumber"==xa?1:aa.apply(this,arguments)};document.body.appendChild(K.container);K.model.setRoot(ia.root)}if(null!=A.layerIds){var ca=K.model,Ba=ca.getChildCells(ca.getRoot()),la={};for(fa=0;fa<A.layerIds.length;fa++)la[A.layerIds[fa]]=!0;for(fa=0;fa<Ba.length;fa++)ca.setVisible(Ba[fa],la[Ba[fa].id]||!1)}fa=null;A.keepTheme&&(fa=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,function(xa){R(xa.toDataURL("image/png"))}),+A.width,null,A.background,mxUtils.bind(this,function(){R(null)}),null,null,A.scale,A.transparent,A.shadow,null,K,A.border,null,A.grid,fa)});null!=A.xml&&0<A.xml.length&&(g=!0,this.setFileData(M),g=!1);V()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==A.format?"1":"0")+(null!=T?"&pageId="+T:"")+(null!=A.layerIds&&0<A.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:A.layerIds})):"")+(null!=A.scale?"&scale="+A.scale:"")+"&base64=1&xml="+encodeURIComponent(M))).send(mxUtils.bind(this,function(aa){200<=aa.getStatus()&&299>=aa.getStatus()?P("data:image/png;base64,"+aa.getText()):R(null)}),mxUtils.bind(this,function(){R(null)}))}}else if(V=mxUtils.bind(this,function(){var aa=this.createLoadMessage("export");aa.message=A;if("html2"==A.format||"html"==A.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var ia=this.getXmlFileData();aa.xml=mxUtils.getXml(ia);aa.data=this.getFileData(null,null,!0,null,null,null,ia);aa.format=A.format}else if("html"==A.format)ia=this.editor.getGraphXml(),aa.data=this.getHtml(ia,this.editor.graph),aa.xml=mxUtils.getXml(ia),aa.format=A.format;else{mxSvgCanvas2D.prototype.foAltText=null;ia=null!=A.background?A.background:this.editor.graph.background;ia==mxConstants.NONE&&(ia=null);aa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);aa.format="svg";var fa=mxUtils.bind(this,function(Ba){this.editor.graph.setEnabled(!0);this.spinner.stop();aa.data=Editor.createSvgDataUri(Ba);z.postMessage(JSON.stringify(aa),"*")}),ca="auto";A.keepTheme&&(ca=Editor.isDarkMode()?"dark":"light");null!=A.theme&&(ca=A.theme);if("xmlsvg"==A.format){if(null==A.spin&&null==A.spinKey||this.spinner.spin(document.body,null!=A.spinKey?mxResources.get(A.spinKey):A.spin)){ca=null;if(this.isAutoDarkMode()||Editor.isDarkMode())ca="auto";null!=A.theme&&(ca=A.theme);this.getEmbeddedSvg(aa.xml,this.editor.graph,null,!0,fa,null,null,A.embedImages,ia,A.scale,A.border,A.shadow,ca)}}else if(null==A.spin&&null==A.spinKey||this.spinner.spin(document.body,null!=A.spinKey?mxResources.get(A.spinKey):A.spin))this.editor.graph.setEnabled(!1),ia=this.editor.graph.getSvg(ia,A.scale,A.border,null,null,null,null,null,null,this.editor.graph.shadowVisible||A.shadow,null,ca),(this.editor.graph.shadowVisible||A.shadow)&&this.editor.graph.addSvgShadow(ia),this.embedFonts(ia,mxUtils.bind(this,function(Ba){A.embedImages||null==A.embedImages?this.editor.convertImages(Ba,mxUtils.bind(this,function(la){fa(mxUtils.getXml(la))})):fa(mxUtils.getXml(Ba))}));return}z.postMessage(JSON.stringify(aa),"*")}),null!=A.xml&&0<A.xml.length){if(this.editor.graph.mathEnabled){var W=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){W.apply(this,arguments);V()}}g=!0;this.setFileData(A.xml);g=!1;this.editor.graph.mathEnabled||V()}else V();return}if("load"==A.action){U=A.toSketch;l=1==A.autosave;this.hideDialog();null!=A.modified&&null==urlParams.modified&&(urlParams.modified=A.modified);null!=A.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=A.saveAndExit);if("1"==urlParams.saveAndExit||"1"==urlParams.publishClose)if(this.actions.get("save").shortcut=null,!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(83,!0,"saveAndExit"),"1"!=urlParams.noSaveBtn&&(this.actions.get("save").shortcut=Editor.ctrlKey+"+Shift+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=A.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=A.noSaveBtn);if(null!=A.rough){var X=Editor.sketchMode;this.doSetSketchMode(A.rough);X!=Editor.sketchMode&&this.fireEvent(new mxEventObject("sketchModeChanged"))}null!=-A.dark&&this.setDarkMode(A.dark);null!=A.border&&(this.embedExportBorder=A.border);null!=A.theme&&(this.embedExportTheme=A.theme);null!=A.background&&(this.embedExportBackground=A.background);null!=A.viewport&&(this.embedViewport=A.viewport);this.embedExitPoint=null;if(null!=A.rect){var Z=this.embedExportBorder;this.diagramContainer.style.left=Math.max(60,A.rect.left)+"px";this.diagramContainer.style.top=Math.max(40,A.rect.top)+"px";this.minInlineWidth=A.minWidth;this.minInlineHeight=A.minHeight;-this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";var Y=A.maxFitScale,da=A.rect.width+2*Z,ea=A.rect.height+2*Z;Q=mxUtils.bind(this,function(){var aa=mxUtils.getDocumentSize();da=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,da):da,aa.width-80);aa=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,ea):ea,aa.height-80);this.diagramContainer.style.width=da+"px";this.diagramContainer.style.height=-aa+"px";var ia=this.editor.graph;aa=ia.maxFitScale;ia.maxFitScale=Y;ia.fit(2*Z,null,null,null,null,null,ea);this.setPageVisible(!1);if(null!=this.minInlineWidth&&ia.getGraphBounds().width<this.minInlineWidth){var fa=ia.container.scrollTop;this.resetScrollbars();ia.container.scrollTop=fa}ia.maxFitScale=aa;ia.container.scrollTop-=Z;ia.container.scrollLeft-=Z;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[A]));ia.container.focus();null!=this.formatWindow&&-null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=ia.container.style.top);var ca=ia.getGraphBounds();ia.container.clientWidth>ca.width+2*Z&&(ia.container.scrollLeft=ca.x+(ca.width+Z-ia.container.clientWidth)/2)}),10)})}null!=A.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=A.noExitBtn);null!=A.title&&null!=this.buttonContainer&&(p=this.createStatusDiv(A.title),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),-"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?this.menubarContainer.appendChild(p):this.buttonContainer.appendChild(p),this.embedFilenameSpan=p);try{A.libs&&this.sidebar.showEntries(A.libs)}catch(aa){}A=null!=A.xmlpng?this.extractGraphModelFromPng(A.xmlpng):null!=A.descriptor?A.descriptor:A.xml}else{if("merge"==A.action){var ka=this.getCurrentFile();null!=ka&&(p=S(A.xml),null!=p&&""!=p&&ka.mergeFile(new LocalFile(this,p),function(){z.postMessage(JSON.stringify({event:"merge",message:A}),-"*")},function(aa){z.postMessage(JSON.stringify({event:"merge",message:A,error:aa}),"*")}))}else"remoteInvokeReady"==A.action?this.handleRemoteInvokeReady(z):"remoteInvoke"==A.action?this.handleRemoteInvoke(A,C.origin):"remoteInvokeResponse"==A.action?this.handleRemoteInvokeResponse(A):z.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(A)}),"*");return}}catch(aa){this.handleError(aa)}}var ba=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?-this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),ha=mxUtils.bind(this,function(aa,ia){g=!0;try{c(aa,ia,null,U)}catch(fa){this.handleError(fa)}g=!1;null!=urlParams.modified&&this.clearStatus();n=ba();l&&null==e&&(e=mxUtils.bind(this,function(fa,ca){fa=ba();fa==n||g||(ca=this.createLoadMessage("autosave"),ca.xml=fa,(window.opener||window.parent).postMessage(JSON.stringify(ca),"*"));n=fa}),this.editor.graph.model.addListener(mxEvent.CHANGE,e),this.editor.graph.addListener("gridSizeChanged",-e),this.editor.graph.addListener("shadowVisibleChanged",e),this.addListener("pageFormatChanged",e),this.addListener("pageScaleChanged",e),this.addListener("backgroundColorChanged",e),this.addListener("backgroundImageChanged",e),this.addListener("foldingEnabledChanged",e),this.addListener("mathEnabledChanged",e),this.addListener("gridEnabledChanged",e),this.addListener("guidesEnabledChanged",e),this.addListener("pageViewChanged",e));if("1"==urlParams.returnbounds||"json"==urlParams.proto)ia=this.createLoadMessage("load"),-ia.xml=aa,z.postMessage(JSON.stringify(ia),"*");null!=Q&&Q()});null!=A&&"function"===typeof A.substring&&"data:application/vnd.visio;base64,"==A.substring(0,34)?(S="0M8R4KGxGuE"==A.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(A.substring(A.indexOf(",")+1)),function(aa){ha(aa,C)},mxUtils.bind(this,function(aa){this.handleError(aa)}),S)):null!=A&&"function"===typeof A.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(A,"")?this.isOffline()?this.showError(mxResources.get("error"),-mxResources.get("notInOffline")):this.parseFileData(A,mxUtils.bind(this,function(aa){4==aa.readyState&&(200<=aa.status&&299>=aa.status&&"<mxGraphModel"==aa.responseText.substring(0,13)?ha(aa.responseText,C):this.handleError({message:413==aa.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")}))}),""):null!=A&&"function"===typeof A.substring&&this.isLucidChartData(A)?this.convertLucidChart(A,mxUtils.bind(this,function(aa){ha(aa)}),mxUtils.bind(this,function(aa){this.handleError(aa)})):-null==A||"object"!==typeof A||null==A.format||null==A.data&&null==A.url?(A=S(A),ha(A,C)):this.loadDescriptor(A,mxUtils.bind(this,function(aa){ha(ba(),C)}),mxUtils.bind(this,function(aa){this.handleError(aa,mxResources.get("errorLoadingFile"))}))}}));var z=window.opener||window.parent;u="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";z.postMessage(u,"*");if("json"==urlParams.proto){var D=this.editor.graph.openLink;this.editor.graph.openLink=function(C,A,Q){D.apply(this,-arguments);z.postMessage(JSON.stringify({event:"openLink",href:C,target:A,allowOpener:Q}),"*")}}};EditorUi.prototype.createEmbedButton=function(c,e,g,l){var n=document.createElement("button");n.className="geEmbedBtn geBtn";n.setAttribute("title",c+(null!=g?" ("+g+")":""));mxUtils.write(n,c);l&&n.classList.add("gePrimaryBtn");mxEvent.addListener(n,"click",e);return n};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,function(){var c=null!=this.embedFilenameSpan&&-this.embedFilenameSpan.parentNode==this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),mxUtils.bind(this,-function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+Shift+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct))}))};EditorUi.prototype.showImportCsvDialog=-function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(c){this.importCsv(c)}),null,null,620,430,null,!0,!0,mxResources.get("import"),this.isOffline()?null:"https://drawio-app.com/import-from-csv-to-drawio/"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,-function(){var e=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(g){if(0<g.length)try{var l=JSON.parse(g);this.executeLayouts(this.editor.graph.createLayouts(l));this.customLayoutConfig=l;this.hideDialog()}catch(n){this.handleError(n)}}),null,null,null,null,mxUtils.bind(this,function(g,l){var n=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var u=l.value;l.value=JSON.stringify(JSON.parse(u));l.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?-l.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));l.value=u}catch(z){this.handleError(z)}}));n.setAttribute("title","copy");n.className="geBtn";g.appendChild(n)}),!0,null,null,"https://www.drawio.com/doc/faq/apply-layouts");this.showDialog(e.container,620,460,!0,!0);e.init()}))};EditorUi.prototype.loadOrgChartLayouts=function(c){this.createTimeout(null,mxUtils.bind(this,function(e){var g=mxUtils.bind(this,function(){this.loadingOrgChart=-!1;e.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),l=mxUtils.bind(this,function(n){this.loadingOrgChart=!1;e.clear()&&this.handleError(n)});"undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0)?g():this.spinner.spin(document.body,mxResources.get("loading"))&&(this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",-function(){mxscript("js/orgchart/mxOrgChartLayout.js",g,null,null,null,l)},null,null,null,l)},null,null,null,l)},null,null,null,l):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",g,null,null,null,l))}),onerror)};EditorUi.prototype.importCsv=function(c,e){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,e)}))};EditorUi.prototype.doImportCsv=function(c,e){try{var g=c.split("\n"),l=[],n=[],u=[],z={};if(0<g.length){var D={},C=this.editor.graph,A=null,Q=null,S=null,U=null,-O=null,p=null,q=null,G="whiteSpace=wrap;html=1;",E=null,H=null,M="",L="auto",k="auto",y=!1,F=null,K=null,P=40,R=40,T=100,V=0,W=mxUtils.bind(this,function(){null!=e?e(Ka):(C.setSelectionCells(Ka),C.scrollCellToVisible(C.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),X=C.getFreeInsertPoint(),Z=X.x,Y=X.y;X=Y;var da=null,ea="auto";H=null;for(var ka=[],ba=null,ha=null,aa=0;aa<g.length&&"#"==g[aa].charAt(0);){c=g[aa].replace(/\r$/,-"");for(aa++;aa<g.length&&"\\"==c.charAt(c.length-1)&&"#"==g[aa].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(g[aa].substring(1)),aa++;if("#"!=c.charAt(1)){var ia=c.indexOf(":");if(0<ia){var fa=mxUtils.trim(c.substring(1,ia)),ca=mxUtils.trim(c.substring(ia+1));"label"==fa?da=Graph.sanitizeHtml(ca):"labelname"==fa&&0<ca.length&&"-"!=ca?O=ca:"labels"==fa&&0<ca.length&&"-"!=ca?q=JSON.parse(ca):"style"==fa?Q=ca:"parentstyle"==fa?G=ca:"unknownStyle"==fa&&"-"!=ca?p=ca:"stylename"==fa&&0<ca.length&&-"-"!=ca?U=ca:"styles"==fa&&0<ca.length&&"-"!=ca?S=JSON.parse(ca):"vars"==fa&&0<ca.length&&"-"!=ca?A=JSON.parse(ca):"identity"==fa&&0<ca.length&&"-"!=ca?E=ca:"parent"==fa&&0<ca.length&&"-"!=ca?H=ca:"namespace"==fa&&0<ca.length&&"-"!=ca?M=ca:"width"==fa?L=ca:"height"==fa?k=ca:"collapsed"==fa&&"-"!=ca?y="true"==ca:"left"==fa&&0<ca.length?F=ca:"top"==fa&&0<ca.length?K=ca:"ignore"==fa?ha=ca.split(","):"connect"==fa?ka.push(JSON.parse(ca)):"link"==fa?ba=ca:"padding"==fa?V=parseFloat(ca):"edgespacing"==-fa?P=parseFloat(ca):"nodespacing"==fa?R=parseFloat(ca):"levelspacing"==fa?T=parseFloat(ca):"layout"==fa&&(ea=ca)}}}if(null==g[aa])throw Error(mxResources.get("invalidOrMissingFile"));var Ba=this.editor.csvToArray(g[aa].replace(/\r$/,""));ia=c=null;fa=[];for(ca=0;ca<Ba.length;ca++)E==Ba[ca]&&(c=ca),H==Ba[ca]&&(ia=ca),fa.push(mxUtils.trim(Ba[ca]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==da&&(da="%"+fa[0]+"%");if(null!=ka)for(var la=0;la<ka.length;la++)null==D[ka[la].to]&&-(D[ka[la].to]={});E=[];for(ca=aa+1;ca<g.length;ca++){var xa=this.editor.csvToArray(g[ca].replace(/\r$/,""));if(null==xa){var Aa=40<g[ca].length?g[ca].substring(0,40)+"...":g[ca];throw Error(Aa+" ("+ca+"):\n"+mxResources.get("containsValidationErrors"));}0<xa.length&&E.push(xa)}C.model.beginUpdate();try{for(ca=0;ca<E.length;ca++){xa=E[ca];var ma=null,ua=null!=c?M+xa[c]:null;g=!1;null!=ua&&(ma=C.model.getCell(ua),g=null==ma||0<=mxUtils.indexOf(l,ma));var ra=new mxCell(da,new mxGeometry(Z,X,0,0),Q||-"whiteSpace=wrap;html=1;");ra.collapsed=y;ra.vertex=!0;ra.id=ua;null==ma||g||C.model.setCollapsed(ma,y);for(var oa=0;oa<xa.length;oa++)C.setAttributeForCell(ra,fa[oa],xa[oa]),null==ma||g||C.setAttributeForCell(ma,fa[oa],xa[oa]);if(null!=O&&null!=q){var Ea=q[ra.getAttribute(O)];null!=Ea&&(C.labelChanged(ra,Ea),null==ma||g||C.cellLabelChanged(ma,Ea))}if(null!=U&&null!=S){var va=S[ra.getAttribute(U)];null!=va&&(ra.style=va)}C.setAttributeForCell(ra,"placeholders","1");ra.style=C.replacePlaceholders(ra,-ra.style,A);null==ma||g?C.fireEvent(new mxEventObject("cellsInserted","cells",[ra])):(C.model.setStyle(ma,ra.style),0>mxUtils.indexOf(u,ma)&&u.push(ma),C.fireEvent(new mxEventObject("cellsInserted","cells",[ma])));g=null!=ma;ma=ra;if(!g)for(la=0;la<ka.length;la++)D[ka[la].to][ma.getAttribute(ka[la].to)]=ma;null!=ba&&"link"!=ba&&(C.setLinkForCell(ma,ma.getAttribute(ba)),C.setAttributeForCell(ma,ba,null));var ya=this.editor.graph.getPreferredSizeForCell(ma);H=null!=ia?C.model.getCell(M+xa[ia]):null;-if(ma.vertex){Aa=null!=H?0:Z;aa=null!=H?0:Y;null!=F&&null!=ma.getAttribute(F)&&(ma.geometry.x=Aa+parseFloat(ma.getAttribute(F)));null!=K&&null!=ma.getAttribute(K)&&(ma.geometry.y=aa+parseFloat(ma.getAttribute(K)));var za="@"==L.charAt(0)?ma.getAttribute(L.substring(1)):null;ma.geometry.width=null!=za&&"auto"!=za?parseFloat(ma.getAttribute(L.substring(1))):"auto"==L||"auto"==za?ya.width+V:parseFloat(L);var Ga="@"==k.charAt(0)?ma.getAttribute(k.substring(1)):null;ma.geometry.height=null!=Ga&&"auto"!=-Ga&&"width"!=k?parseFloat(Ga):"auto"==k||"auto"==Ga?ya.height+V:"width"==k?ma.geometry.width:parseFloat(k);X+=ma.geometry.height+R}g?(null==z[ua]&&(z[ua]=[]),z[ua].push(ma)):(l.push(ma),null!=H?(H.style=C.replacePlaceholders(H,G,A),C.addCell(ma,H),n.push(H)):u.push(C.addCell(ma)))}for(ca=0;ca<n.length;ca++)za="@"==L.charAt(0)?n[ca].getAttribute(L.substring(1)):null,Ga="@"==k.charAt(0)?n[ca].getAttribute(k.substring(1)):null,"auto"!=L&&"auto"!=za||"auto"!=k&&"auto"!=Ga||C.updateGroupBounds([n[ca]],-V,!0);var Ca=u.slice(),Ka=u.slice();for(la=0;la<ka.length;la++){var Ma=ka[la];for(ca=0;ca<l.length;ca++){ma=l[ca];var Da=mxUtils.bind(this,function(ja,sa,na){var pa=sa.getAttribute(na.from);if(null!=pa&&""!=pa){pa=pa.split(",");for(var qa=0;qa<pa.length;qa++){var ta=D[na.to][pa[qa]];if(null==ta&&null!=p){ta=new mxCell(pa[qa],new mxGeometry(Z,Y,0,0),p);ta.style=C.replacePlaceholders(sa,ta.style,A);var Fa=this.editor.graph.getPreferredSizeForCell(ta);ta.geometry.width=Fa.width+V;ta.geometry.height=-Fa.height+V;D[na.to][pa[qa]]=ta;ta.vertex=!0;ta.id=pa[qa];u.push(C.addCell(ta))}if(null!=ta){Fa=na.label;null!=na.fromlabel&&(Fa=(sa.getAttribute(na.fromlabel)||"")+(Fa||""));null!=na.sourcelabel&&(Fa=C.replacePlaceholders(sa,na.sourcelabel,A)+(Fa||""));null!=na.tolabel&&(Fa=(Fa||"")+(ta.getAttribute(na.tolabel)||""));null!=na.targetlabel&&(Fa=(Fa||"")+C.replacePlaceholders(ta,na.targetlabel,A));var Ia="target"==na.placeholders==!na.invert?ta:ja;Ia=null!=na.style?C.replacePlaceholders(Ia,na.style,-A):C.createCurrentEdgeStyle();Fa=C.insertEdge(null,null,Fa||"",na.invert?ta:ja,na.invert?ja:ta,Ia);if(null!=na.labels)for(Ia=0;Ia<na.labels.length;Ia++){var Ja=na.labels[Ia],Na=new mxCell(Ja.label||Ia,new mxGeometry(null!=Ja.x?Ja.x:0,null!=Ja.y?Ja.y:0,0,0),"resizable=0;html=1;");Na.vertex=!0;Na.connectable=!1;Na.geometry.relative=!0;null!=Ja.placeholders&&(Na.value=C.replacePlaceholders("target"==Ja.placeholders==!na.invert?ta:ja,Na.value,A));if(null!=Ja.dx||null!=Ja.dy)Na.geometry.offset=new mxPoint(null!=-Ja.dx?Ja.dx:0,null!=Ja.dy?Ja.dy:0);Fa.insert(Na)}if(null!=na.data)for(var Pa in na.data)C.setAttributeForCell(Fa,Pa,na.data[Pa]);Ka.push(Fa);mxUtils.remove(na.invert?ja:ta,Ca)}}}});Da(ma,ma,Ma);if(null!=z[ma.id])for(oa=0;oa<z[ma.id].length;oa++)Da(ma,z[ma.id][oa],Ma)}}if(null!=ha)for(ca=0;ca<l.length;ca++)for(ma=l[ca],oa=0;oa<ha.length;oa++)C.setAttributeForCell(ma,mxUtils.trim(ha[oa]),null);if(0<u.length){var wa=new mxParallelEdgeLayout(C);wa.spacing=P;wa.checkOverlap=!0;var Sa=function(){0<wa.spacing&&-wa.execute(C.getDefaultParent());for(var ja=0;ja<u.length;ja++){var sa=C.getCellGeometry(u[ja]);sa.x=Math.round(C.snap(sa.x));sa.y=Math.round(C.snap(sa.y));"auto"==L&&(sa.width=Math.round(C.snap(sa.width)));"auto"==k&&(sa.height=Math.round(C.snap(sa.height)))}};if("["==ea.charAt(0)){var Ta=W;C.view.validate();this.executeLayouts(C.createLayouts(JSON.parse(ea)),function(){Sa();Ta()});W=null}else if("circle"==ea){var Ua=new mxCircleLayout(C);Ua.disableEdgeStyle=!1;Ua.resetEdges=!1;var hb=Ua.isVertexIgnored;-Ua.isVertexIgnored=function(ja){return hb.apply(this,arguments)||0>mxUtils.indexOf(u,ja)};this.executeLayout(function(){Ua.execute(C.getDefaultParent());Sa()},!0,W);W=null}else if("horizontaltree"==ea||"verticaltree"==ea||"auto"==ea&&Ka.length==2*u.length-1&&1==Ca.length){C.view.validate();var Ra=new mxCompactTreeLayout(C,"horizontaltree"==ea);Ra.levelDistance=R;Ra.edgeRouting=!1;Ra.resetEdges=!1;Ra.sortEdges=!0;this.executeLayout(function(){Ra.execute(C.getDefaultParent(),0<Ca.length?Ca[0]:null)},-!0,W);W=null}else if("horizontalflow"==ea||"verticalflow"==ea||"auto"==ea&&1==Ca.length){C.view.validate();var Wa=new mxHierarchicalLayout(C,"horizontalflow"==ea?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);Wa.intraCellSpacing=R;Wa.parallelEdgeSpacing=P;Wa.interRankCellSpacing=T;Wa.disableEdgeStyle=!1;this.executeLayout(function(){Wa.execute(C.getDefaultParent(),Ka);C.moveCells(Ka,Z,Y)},!0,W);W=null}else if("orgchart"==ea){C.view.validate();var Va=new mxOrgChartLayout(C,2,T,R),fb=Va.isVertexIgnored;-Va.isVertexIgnored=function(ja){return fb.apply(this,arguments)||0>mxUtils.indexOf(u,ja)};this.executeLayout(function(){Va.execute(C.getDefaultParent());Sa()},!0,W);W=null}else if("organic"==ea||"auto"==ea&&Ka.length>u.length){C.view.validate();var ab=new mxFastOrganicLayout(C);ab.forceConstant=3*R;ab.disableEdgeStyle=!1;ab.resetEdges=!1;var db=ab.isVertexIgnored;ab.isVertexIgnored=function(ja){return db.apply(this,arguments)||0>mxUtils.indexOf(u,ja)};this.executeLayout(function(){ab.execute(C.getDefaultParent());+A.dark&&this.setDarkMode(A.dark);null!=A.border&&(this.embedExportBorder=A.border);null!=A.theme&&(this.embedExportTheme=A.theme);null!=A.background&&(this.embedExportBackground=A.background);null!=A.viewport&&(this.embedViewport=A.viewport);this.embedExitPoint=null;if(null!=A.rect){var Y=this.embedExportBorder;this.diagramContainer.style.left=Math.max(60,A.rect.left)+"px";this.diagramContainer.style.top=Math.max(40,A.rect.top)+"px";this.minInlineWidth=A.minWidth;this.minInlineHeight=A.minHeight;+this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";var Z=A.maxFitScale,da=A.rect.width+2*Y,ea=A.rect.height+2*Y;Q=mxUtils.bind(this,function(){var aa=mxUtils.getDocumentSize();da=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,da):da,aa.width-80);aa=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,ea):ea,aa.height-80);this.diagramContainer.style.width=da+"px";this.diagramContainer.style.height=+aa+"px";var ia=this.editor.graph;aa=ia.maxFitScale;ia.maxFitScale=Z;ia.fit(2*Y,null,null,null,null,null,ea);this.setPageVisible(!1);if(null!=this.minInlineWidth&&ia.getGraphBounds().width<this.minInlineWidth){var fa=ia.container.scrollTop;this.resetScrollbars();ia.container.scrollTop=fa}ia.maxFitScale=aa;ia.container.scrollTop-=Y;ia.container.scrollLeft-=Y;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[A]));ia.container.focus();null!=this.formatWindow&&+null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=ia.container.style.top);var ca=ia.getGraphBounds();ia.container.clientWidth>ca.width+2*Y&&(ia.container.scrollLeft=ca.x+(ca.width+Y-ia.container.clientWidth)/2)}),10)})}null!=A.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=A.noExitBtn);null!=A.title&&null!=this.buttonContainer&&this.setEmbedTitle(A.title);try{A.libs&&this.sidebar.showEntries(A.libs)}catch(aa){}A=null!=A.xmlpng?+this.extractGraphModelFromPng(A.xmlpng):null!=A.descriptor?A.descriptor:A.xml}else{if("merge"==A.action){var ka=this.getCurrentFile();null!=ka&&(p=S(A.xml),null!=p&&""!=p&&ka.mergeFile(new LocalFile(this,p),function(){z.postMessage(JSON.stringify({event:"merge",message:A}),"*")},function(aa){z.postMessage(JSON.stringify({event:"merge",message:A,error:aa}),"*")}))}else"remoteInvokeReady"==A.action?this.handleRemoteInvokeReady(z):"remoteInvoke"==A.action?this.handleRemoteInvoke(A,C.origin):"remoteInvokeResponse"==+A.action?this.handleRemoteInvokeResponse(A):z.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(A)}),"*");return}}catch(aa){this.handleError(aa)}}var ba=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),ha=mxUtils.bind(this,function(aa,ia){g=!0;try{c(aa,ia,null,U)}catch(fa){this.handleError(fa)}g=!1;null!=urlParams.modified&&this.clearStatus();n=ba();l&&null==e&&(e=mxUtils.bind(this,+function(fa,ca){fa=ba();fa==n||g||(ca=this.createLoadMessage("autosave"),ca.xml=fa,(window.opener||window.parent).postMessage(JSON.stringify(ca),"*"));n=fa}),this.editor.graph.model.addListener(mxEvent.CHANGE,e),this.editor.graph.addListener("gridSizeChanged",e),this.editor.graph.addListener("shadowVisibleChanged",e),this.addListener("pageFormatChanged",e),this.addListener("pageScaleChanged",e),this.addListener("backgroundColorChanged",e),this.addListener("backgroundImageChanged",e),this.addListener("foldingEnabledChanged",+e),this.addListener("mathEnabledChanged",e),this.addListener("gridEnabledChanged",e),this.addListener("guidesEnabledChanged",e),this.addListener("pageViewChanged",e));if("1"==urlParams.returnbounds||"json"==urlParams.proto)ia=this.createLoadMessage("load"),ia.xml=aa,z.postMessage(JSON.stringify(ia),"*");null!=Q&&Q()});null!=A&&"function"===typeof A.substring&&"data:application/vnd.visio;base64,"==A.substring(0,34)?(S="0M8R4KGxGuE"==A.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(A.substring(A.indexOf(",")++1)),function(aa){ha(aa,C)},mxUtils.bind(this,function(aa){this.handleError(aa)}),S)):null!=A&&"function"===typeof A.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(A,"")?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(A,mxUtils.bind(this,function(aa){4==aa.readyState&&(200<=aa.status&&299>=aa.status&&"<mxGraphModel"==aa.responseText.substring(0,13)?ha(aa.responseText,C):this.handleError({message:413==aa.status?mxResources.get("diagramTooLarge"):+mxResources.get("unknownError")}))}),""):null!=A&&"function"===typeof A.substring&&this.isLucidChartData(A)?this.convertLucidChart(A,mxUtils.bind(this,function(aa){ha(aa)}),mxUtils.bind(this,function(aa){this.handleError(aa)})):null==A||"object"!==typeof A||null==A.format||null==A.data&&null==A.url?(A=S(A),ha(A,C)):this.loadDescriptor(A,mxUtils.bind(this,function(aa){ha(ba(),C)}),mxUtils.bind(this,function(aa){this.handleError(aa,mxResources.get("errorLoadingFile"))}))}}));var z=window.opener||window.parent;+u="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";z.postMessage(u,"*");if("json"==urlParams.proto){var D=this.editor.graph.openLink;this.editor.graph.openLink=function(C,A,Q){D.apply(this,arguments);z.postMessage(JSON.stringify({event:"openLink",href:C,target:A,allowOpener:Q}),"*")}}};EditorUi.prototype.createEmbedButton=function(c,e,g,l){var n=document.createElement("button");n.className="geEmbedBtn geBtn";n.setAttribute("title",c+(null!=g?" ("+g+")":""));mxUtils.write(n,+c);l&&n.classList.add("gePrimaryBtn");mxEvent.addListener(n,"click",e);return n};EditorUi.prototype.setEmbedTitle=function(c){c=this.createStatusDiv(c);null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan);"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?this.menubarContainer.appendChild(c):this.buttonContainer.appendChild(c);this.embedFilenameSpan=c};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,function(){var c=+null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode==this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);this.commentsSupported()&&null!=this.commentButton&&this.buttonContainer.appendChild(this.commentButton);"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,+Editor.ctrlKey+"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+Shift+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==+urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct))}))};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(c){this.importCsv(c)}),null,null,620,430,null,!0,!0,mxResources.get("import"),this.isOffline()?null:"https://drawio-app.com/import-from-csv-to-drawio/"));this.showDialog(this.importCsvDialog.container,+640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,function(){var e=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(g){if(0<g.length)try{var l=JSON.parse(g);this.executeLayouts(this.editor.graph.createLayouts(l));this.customLayoutConfig=l;this.hideDialog()}catch(n){this.handleError(n)}}),null,null,null,null,mxUtils.bind(this,function(g,l){var n=mxUtils.button(mxResources.get("copy"),+mxUtils.bind(this,function(){try{var u=l.value;l.value=JSON.stringify(JSON.parse(u));l.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?l.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));l.value=u}catch(z){this.handleError(z)}}));n.setAttribute("title","copy");n.className="geBtn";g.appendChild(n)}),!0,null,null,"https://www.drawio.com/doc/faq/apply-layouts");this.showDialog(e.container,620,460,!0,!0);e.init()}))};+EditorUi.prototype.loadOrgChartLayouts=function(c){this.createTimeout(null,mxUtils.bind(this,function(e){var g=mxUtils.bind(this,function(){this.loadingOrgChart=!1;e.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),l=mxUtils.bind(this,function(n){this.loadingOrgChart=!1;e.clear()&&this.handleError(n)});"undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0)?g():this.spinner.spin(document.body,mxResources.get("loading"))&&(this.loadingOrgChart=+!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",g,null,null,null,l)},null,null,null,l)},null,null,null,l)},null,null,null,l):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",g,null,null,null,l))}),onerror)};EditorUi.prototype.importCsv=function(c,e){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,+e)}))};EditorUi.prototype.doImportCsv=function(c,e){try{var g=c.split("\n"),l=[],n=[],u=[],z={};if(0<g.length){var D={},C=this.editor.graph,A=null,Q=null,S=null,U=null,O=null,p=null,q=null,G="whiteSpace=wrap;html=1;",E=null,H=null,L="",K="auto",k="auto",y=!1,F=null,M=null,P=40,R=40,T=100,V=0,W=mxUtils.bind(this,function(){null!=e?e(Ka):(C.setSelectionCells(Ka),C.scrollCellToVisible(C.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),+0)}),X=C.getFreeInsertPoint(),Y=X.x,Z=X.y;X=Z;var da=null,ea="auto";H=null;for(var ka=[],ba=null,ha=null,aa=0;aa<g.length&&"#"==g[aa].charAt(0);){c=g[aa].replace(/\r$/,"");for(aa++;aa<g.length&&"\\"==c.charAt(c.length-1)&&"#"==g[aa].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(g[aa].substring(1)),aa++;if("#"!=c.charAt(1)){var ia=c.indexOf(":");if(0<ia){var fa=mxUtils.trim(c.substring(1,ia)),ca=mxUtils.trim(c.substring(ia+1));"label"==fa?da=Graph.sanitizeHtml(ca):"labelname"==fa&&0<ca.length&&+"-"!=ca?O=ca:"labels"==fa&&0<ca.length&&"-"!=ca?q=JSON.parse(ca):"style"==fa?Q=ca:"parentstyle"==fa?G=ca:"unknownStyle"==fa&&"-"!=ca?p=ca:"stylename"==fa&&0<ca.length&&"-"!=ca?U=ca:"styles"==fa&&0<ca.length&&"-"!=ca?S=JSON.parse(ca):"vars"==fa&&0<ca.length&&"-"!=ca?A=JSON.parse(ca):"identity"==fa&&0<ca.length&&"-"!=ca?E=ca:"parent"==fa&&0<ca.length&&"-"!=ca?H=ca:"namespace"==fa&&0<ca.length&&"-"!=ca?L=ca:"width"==fa?K=ca:"height"==fa?k=ca:"collapsed"==fa&&"-"!=ca?y="true"==ca:"left"==fa&&0<ca.length?+F=ca:"top"==fa&&0<ca.length?M=ca:"ignore"==fa?ha=ca.split(","):"connect"==fa?ka.push(JSON.parse(ca)):"link"==fa?ba=ca:"padding"==fa?V=parseFloat(ca):"edgespacing"==fa?P=parseFloat(ca):"nodespacing"==fa?R=parseFloat(ca):"levelspacing"==fa?T=parseFloat(ca):"layout"==fa&&(ea=ca)}}}if(null==g[aa])throw Error(mxResources.get("invalidOrMissingFile"));var Ba=this.editor.csvToArray(g[aa].replace(/\r$/,""));ia=c=null;fa=[];for(ca=0;ca<Ba.length;ca++)E==Ba[ca]&&(c=ca),H==Ba[ca]&&(ia=ca),fa.push(mxUtils.trim(Ba[ca]).replace(/[^a-z0-9]+/ig,+"_").replace(/^\d+/,"").replace(/_+$/,""));null==da&&(da="%"+fa[0]+"%");if(null!=ka)for(var la=0;la<ka.length;la++)null==D[ka[la].to]&&(D[ka[la].to]={});E=[];for(ca=aa+1;ca<g.length;ca++){var xa=this.editor.csvToArray(g[ca].replace(/\r$/,""));if(null==xa){var Aa=40<g[ca].length?g[ca].substring(0,40)+"...":g[ca];throw Error(Aa+" ("+ca+"):\n"+mxResources.get("containsValidationErrors"));}0<xa.length&&E.push(xa)}C.model.beginUpdate();try{for(ca=0;ca<E.length;ca++){xa=E[ca];var ma=null,ua=null!=c?L+xa[c]:+null;g=!1;null!=ua&&(ma=C.model.getCell(ua),g=null==ma||0<=mxUtils.indexOf(l,ma));var ra=new mxCell(da,new mxGeometry(Y,X,0,0),Q||"whiteSpace=wrap;html=1;");ra.collapsed=y;ra.vertex=!0;ra.id=ua;null==ma||g||C.model.setCollapsed(ma,y);for(var oa=0;oa<xa.length;oa++)C.setAttributeForCell(ra,fa[oa],xa[oa]),null==ma||g||C.setAttributeForCell(ma,fa[oa],xa[oa]);if(null!=O&&null!=q){var Ea=q[ra.getAttribute(O)];null!=Ea&&(C.labelChanged(ra,Ea),null==ma||g||C.cellLabelChanged(ma,Ea))}if(null!=U&&null!=S){var va=+S[ra.getAttribute(U)];null!=va&&(ra.style=va)}C.setAttributeForCell(ra,"placeholders","1");ra.style=C.replacePlaceholders(ra,ra.style,A);null==ma||g?C.fireEvent(new mxEventObject("cellsInserted","cells",[ra])):(C.model.setStyle(ma,ra.style),0>mxUtils.indexOf(u,ma)&&u.push(ma),C.fireEvent(new mxEventObject("cellsInserted","cells",[ma])));g=null!=ma;ma=ra;if(!g)for(la=0;la<ka.length;la++)D[ka[la].to][ma.getAttribute(ka[la].to)]=ma;null!=ba&&"link"!=ba&&(C.setLinkForCell(ma,ma.getAttribute(ba)),C.setAttributeForCell(ma,+ba,null));var ya=this.editor.graph.getPreferredSizeForCell(ma);H=null!=ia?C.model.getCell(L+xa[ia]):null;if(ma.vertex){Aa=null!=H?0:Y;aa=null!=H?0:Z;null!=F&&null!=ma.getAttribute(F)&&(ma.geometry.x=Aa+parseFloat(ma.getAttribute(F)));null!=M&&null!=ma.getAttribute(M)&&(ma.geometry.y=aa+parseFloat(ma.getAttribute(M)));var za="@"==K.charAt(0)?ma.getAttribute(K.substring(1)):null;ma.geometry.width=null!=za&&"auto"!=za?parseFloat(ma.getAttribute(K.substring(1))):"auto"==K||"auto"==za?ya.width+V:parseFloat(K);+var Ga="@"==k.charAt(0)?ma.getAttribute(k.substring(1)):null;ma.geometry.height=null!=Ga&&"auto"!=Ga&&"width"!=k?parseFloat(Ga):"auto"==k||"auto"==Ga?ya.height+V:"width"==k?ma.geometry.width:parseFloat(k);X+=ma.geometry.height+R}g?(null==z[ua]&&(z[ua]=[]),z[ua].push(ma)):(l.push(ma),null!=H?(H.style=C.replacePlaceholders(H,G,A),C.addCell(ma,H),n.push(H)):u.push(C.addCell(ma)))}for(ca=0;ca<n.length;ca++)za="@"==K.charAt(0)?n[ca].getAttribute(K.substring(1)):null,Ga="@"==k.charAt(0)?n[ca].getAttribute(k.substring(1)):+null,"auto"!=K&&"auto"!=za||"auto"!=k&&"auto"!=Ga||C.updateGroupBounds([n[ca]],V,!0);var Ca=u.slice(),Ka=u.slice();for(la=0;la<ka.length;la++){var Ma=ka[la];for(ca=0;ca<l.length;ca++){ma=l[ca];var Da=mxUtils.bind(this,function(ja,sa,na){var pa=sa.getAttribute(na.from);if(null!=pa&&""!=pa){pa=pa.split(",");for(var qa=0;qa<pa.length;qa++){var ta=D[na.to][pa[qa]];if(null==ta&&null!=p){ta=new mxCell(pa[qa],new mxGeometry(Y,Z,0,0),p);ta.style=C.replacePlaceholders(sa,ta.style,A);var Fa=this.editor.graph.getPreferredSizeForCell(ta);+ta.geometry.width=Fa.width+V;ta.geometry.height=Fa.height+V;D[na.to][pa[qa]]=ta;ta.vertex=!0;ta.id=pa[qa];u.push(C.addCell(ta))}if(null!=ta){Fa=na.label;null!=na.fromlabel&&(Fa=(sa.getAttribute(na.fromlabel)||"")+(Fa||""));null!=na.sourcelabel&&(Fa=C.replacePlaceholders(sa,na.sourcelabel,A)+(Fa||""));null!=na.tolabel&&(Fa=(Fa||"")+(ta.getAttribute(na.tolabel)||""));null!=na.targetlabel&&(Fa=(Fa||"")+C.replacePlaceholders(ta,na.targetlabel,A));var Ia="target"==na.placeholders==!na.invert?ta:ja;Ia=+null!=na.style?C.replacePlaceholders(Ia,na.style,A):C.createCurrentEdgeStyle();Fa=C.insertEdge(null,null,Fa||"",na.invert?ta:ja,na.invert?ja:ta,Ia);if(null!=na.labels)for(Ia=0;Ia<na.labels.length;Ia++){var Ja=na.labels[Ia],Na=new mxCell(Ja.label||Ia,new mxGeometry(null!=Ja.x?Ja.x:0,null!=Ja.y?Ja.y:0,0,0),"resizable=0;html=1;");Na.vertex=!0;Na.connectable=!1;Na.geometry.relative=!0;null!=Ja.placeholders&&(Na.value=C.replacePlaceholders("target"==Ja.placeholders==!na.invert?ta:ja,Na.value,A));if(null!=+Ja.dx||null!=Ja.dy)Na.geometry.offset=new mxPoint(null!=Ja.dx?Ja.dx:0,null!=Ja.dy?Ja.dy:0);Fa.insert(Na)}if(null!=na.data)for(var Pa in na.data)C.setAttributeForCell(Fa,Pa,na.data[Pa]);Ka.push(Fa);mxUtils.remove(na.invert?ja:ta,Ca)}}}});Da(ma,ma,Ma);if(null!=z[ma.id])for(oa=0;oa<z[ma.id].length;oa++)Da(ma,z[ma.id][oa],Ma)}}if(null!=ha)for(ca=0;ca<l.length;ca++)for(ma=l[ca],oa=0;oa<ha.length;oa++)C.setAttributeForCell(ma,mxUtils.trim(ha[oa]),null);if(0<u.length){var wa=new mxParallelEdgeLayout(C);+wa.spacing=P;wa.checkOverlap=!0;var Sa=function(){0<wa.spacing&&wa.execute(C.getDefaultParent());for(var ja=0;ja<u.length;ja++){var sa=C.getCellGeometry(u[ja]);sa.x=Math.round(C.snap(sa.x));sa.y=Math.round(C.snap(sa.y));"auto"==K&&(sa.width=Math.round(C.snap(sa.width)));"auto"==k&&(sa.height=Math.round(C.snap(sa.height)))}};if("["==ea.charAt(0)){var Ta=W;C.view.validate();this.executeLayouts(C.createLayouts(JSON.parse(ea)),function(){Sa();Ta()});W=null}else if("circle"==ea){var Ua=new mxCircleLayout(C);+Ua.disableEdgeStyle=!1;Ua.resetEdges=!1;var hb=Ua.isVertexIgnored;Ua.isVertexIgnored=function(ja){return hb.apply(this,arguments)||0>mxUtils.indexOf(u,ja)};this.executeLayout(function(){Ua.execute(C.getDefaultParent());Sa()},!0,W);W=null}else if("horizontaltree"==ea||"verticaltree"==ea||"auto"==ea&&Ka.length==2*u.length-1&&1==Ca.length){C.view.validate();var Ra=new mxCompactTreeLayout(C,"horizontaltree"==ea);Ra.levelDistance=R;Ra.edgeRouting=!1;Ra.resetEdges=!1;Ra.sortEdges=!0;this.executeLayout(function(){Ra.execute(C.getDefaultParent(),+0<Ca.length?Ca[0]:null)},!0,W);W=null}else if("horizontalflow"==ea||"verticalflow"==ea||"auto"==ea&&1==Ca.length){C.view.validate();var Wa=new mxHierarchicalLayout(C,"horizontalflow"==ea?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);Wa.intraCellSpacing=R;Wa.parallelEdgeSpacing=P;Wa.interRankCellSpacing=T;Wa.disableEdgeStyle=!1;this.executeLayout(function(){Wa.execute(C.getDefaultParent(),Ka);C.moveCells(Ka,Y,Z)},!0,W);W=null}else if("orgchart"==ea){C.view.validate();var Va=new mxOrgChartLayout(C,+2,T,R),fb=Va.isVertexIgnored;Va.isVertexIgnored=function(ja){return fb.apply(this,arguments)||0>mxUtils.indexOf(u,ja)};this.executeLayout(function(){Va.execute(C.getDefaultParent());Sa()},!0,W);W=null}else if("organic"==ea||"auto"==ea&&Ka.length>u.length){C.view.validate();var ab=new mxFastOrganicLayout(C);ab.forceConstant=3*R;ab.disableEdgeStyle=!1;ab.resetEdges=!1;var db=ab.isVertexIgnored;ab.isVertexIgnored=function(ja){return db.apply(this,arguments)||0>mxUtils.indexOf(u,ja)};this.executeLayout(function(){ab.execute(C.getDefaultParent());Sa()},!0,W);W=null}}this.hideDialog()}finally{C.model.endUpdate()}null!=W&&W()}}catch(ja){this.handleError(ja)}};EditorUi.prototype.getSearch=function(c){var e="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var g="?",l;for(l in urlParams)0>mxUtils.indexOf(c,l)&&null!=urlParams[l]&&(e+=g+l+"="+urlParams[l],g="&")}else e=window.location.search;return e};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var e=0<c.indexOf("?")?1:0;if("1"==urlParams.offline)c+=window.location.search;else{var g="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),l;for(l in urlParams)0>mxUtils.indexOf(g,l)&&(c=0==e?c+"?":c+"&",null!=urlParams[l]&&(c+=l+"="+urlParams[l],e++))}return c};EditorUi.prototype.showLinkDialog=function(c,e,g,l,n){c=new LinkDialog(this,c,e,g,!0,l,n);this.showDialog(c.container,440,120,!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);@@ -13478,26 +13482,26 @@ C,A,Q,S,U,O,p,q)};EditorUi.prototype.createImageUrlConverter=function(){EditorUiEditorUi.prototype.base64Encode=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(c)};EditorUi.prototype.updateCRC=function(c,e,g,l){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,e,g,l)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(c)};EditorUi.prototype.writeGraphModelToPng=function(c,e,g,l,n){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(c,e,g,l,n)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;for(var c=[],e=0;e<localStorage.length;e++){var g=localStorage.key(e),l=localStorage.getItem(g);if(0<g.length&&(".scratchpad"==g||"."!=g.charAt(0))&&0<l.length){var n="<mxfile "===l.substring(0,8)||"<?xml"===l.substring(0,5)||"\x3c!--[if IE]>"===l.substring(0,12);l="<mxlibrary>"===l.substring(0,11);(n||l)&&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:"<mxlibrary>"===e.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();-var CommentsWindow=function(b,f,m,d,t,x){function v(){for(var q=D.getElementsByTagName("div"),G=0,E=0;E<q.length;E++)"none"!=q[E].style.display&&q[E].parentNode==D&&G++;C.style.display=0==G?"block":"none"}function B(q,G,E,H){function M(){G.removeChild(y);G.removeChild(F);k.style.display="block";L.style.display="block"}n={div:G,comment:q,saveCallback:E,deleteOnCancel:H};var L=G.querySelector(".geCommentTxt"),k=G.querySelector(".geCommentActionsList"),y=document.createElement("textarea");y.className=-"geCommentEditTxtArea";y.style.minHeight=L.offsetHeight+"px";y.value=q.content;G.insertBefore(y,L);var F=document.createElement("div");F.className="geCommentEditBtns";var K=mxUtils.button(mxResources.get("cancel"),function(){H?(G.parentNode.removeChild(G),v()):M();n=null});K.className="geCommentEditBtn";F.appendChild(K);var P=mxUtils.button(mxResources.get("save"),function(){L.innerText="";q.content=y.value;mxUtils.write(L,q.content);M();E(q);n=null});mxEvent.addListener(y,"keydown",mxUtils.bind(this,-function(R){mxEvent.isConsumed(R)||((mxEvent.isControlDown(R)||mxClient.IS_MAC&&mxEvent.isMetaDown(R))&&13==R.keyCode?(P.click(),mxEvent.consume(R)):27==R.keyCode&&(K.click(),mxEvent.consume(R)))}));P.focus();P.className="geCommentEditBtn gePrimaryBtn";F.appendChild(P);G.insertBefore(F,L);k.style.display="none";L.style.display="none";y.focus()}function J(q,G){G.innerText="";q=new Date(q.modifiedDate);var E=b.timeSince(q);null==E&&(E=mxResources.get("lessThanAMinute"));mxUtils.write(G,mxResources.get("timeAgo",-[E],"{1} ago"));G.setAttribute("title",q.toLocaleDateString()+" "+q.toLocaleTimeString())}function N(q){var G=document.createElement("img");G.className="geCommentBusyImg";G.src=IMAGE_PATH+"/spin.gif";q.appendChild(G);q.busyImg=G}function I(q){q.style.border="1px solid red";q.busyImg.parentNode==q&&q.removeChild(q.busyImg)}function c(q){q.style.border="";q.busyImg.parentNode==q&&q.removeChild(q.busyImg)}function e(q,G,E,H,M){function L(V,W,X){var Z=document.createElement("li");Z.className="geCommentAction";-var Y=document.createElement("a");Y.className="geCommentActionLnk";mxUtils.write(Y,V);Z.appendChild(Y);mxEvent.addListener(Y,"click",function(da){W(da,q);da.preventDefault();mxEvent.consume(da)});T.appendChild(Z);X&&(Z.style.display="none")}function k(){function V(Z){W.push(X);if(null!=Z.replies)for(var Y=0;Y<Z.replies.length;Y++)X=X.nextSibling,V(Z.replies[Y])}var W=[],X=F;V(q);return{pdiv:X,replies:W}}function y(V,W,X,Z,Y){function da(){N(ha);q.addReply(ba,function(aa){ba.id=aa;q.replies.push(ba);-c(ha);X&&X()},function(aa){ea();I(ha);b.handleError(aa,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},Z,Y)}function ea(){B(ba,ha,function(aa){da()},!0)}var ka=k().pdiv,ba=b.newComment(V,b.getCurrentUser());ba.pCommentId=q.id;null==q.replies&&(q.replies=[]);var ha=e(ba,q.replies,ka,H+1);W?ea():da()}if(M||!q.isResolved){C.style.display="none";var F=document.createElement("div");F.className="geCommentContainer";F.setAttribute("data-commentId",q.id);F.style.marginLeft=20*H+5+-"px";q.isResolved&&(u.style.opacity="0.7");var K=document.createElement("div");K.className="geCommentHeader";var P=document.createElement("img");P.className="geCommentUserImg";P.src=null!=q.user&&null!=q.user.pictureUrl?q.user.pictureUrl:Editor.userImage;K.appendChild(P);P=document.createElement("div");P.className="geCommentHeaderTxt";K.appendChild(P);var R=document.createElement("div");R.className="geCommentUsername";mxUtils.write(R,null!=q.user?q.user.displayName:mxResources.get("unknownUser"));-P.appendChild(R);R=document.createElement("div");R.className="geCommentDate";R.setAttribute("data-commentId",q.id);J(q,R);P.appendChild(R);F.appendChild(K);K=document.createElement("div");K.className="geCommentTxt";mxUtils.write(K,q.content||"");F.appendChild(K);q.isLocked&&(F.style.opacity="0.5");K=document.createElement("div");K.className="geCommentActions";var T=document.createElement("ul");T.className="geCommentActionsList";K.appendChild(T);g||q.isLocked||0!=H&&!l||L(mxResources.get("reply"),-function(){y("",!0)},q.isResolved);P=b.getCurrentUser();null==P||null==q.user||P.id!=q.user.id||g||q.isLocked||(L(mxResources.get("edit"),function(){function V(){B(q,F,function(){N(F);q.editComment(q.content,function(){c(F)},function(W){I(F);V();b.handleError(W,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}V()},q.isResolved),L(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){N(F);q.deleteComment(function(V){if(!0===V){V=F.querySelector(".geCommentTxt");+var CommentsWindow=function(b,f,m,d,t,x){function v(){for(var q=D.getElementsByTagName("div"),G=0,E=0;E<q.length;E++)"none"!=q[E].style.display&&q[E].parentNode==D&&G++;C.style.display=0==G?"block":"none"}function B(q,G,E,H){function L(){G.removeChild(y);G.removeChild(F);k.style.display="block";K.style.display="block"}n={div:G,comment:q,saveCallback:E,deleteOnCancel:H};var K=G.querySelector(".geCommentTxt"),k=G.querySelector(".geCommentActionsList"),y=document.createElement("textarea");y.className=+"geCommentEditTxtArea";y.style.minHeight=K.offsetHeight+"px";y.value=q.content;G.insertBefore(y,K);var F=document.createElement("div");F.className="geCommentEditBtns";var M=mxUtils.button(mxResources.get("cancel"),function(){H?(G.parentNode.removeChild(G),v()):L();n=null});M.className="geCommentEditBtn";F.appendChild(M);var P=mxUtils.button(mxResources.get("save"),function(){K.innerText="";q.content=y.value;mxUtils.write(K,q.content);L();E(q);n=null});mxEvent.addListener(y,"keydown",mxUtils.bind(this,+function(R){mxEvent.isConsumed(R)||((mxEvent.isControlDown(R)||mxClient.IS_MAC&&mxEvent.isMetaDown(R))&&13==R.keyCode?(P.click(),mxEvent.consume(R)):27==R.keyCode&&(M.click(),mxEvent.consume(R)))}));P.focus();P.className="geCommentEditBtn gePrimaryBtn";F.appendChild(P);G.insertBefore(F,K);k.style.display="none";K.style.display="none";y.focus()}function J(q,G){G.innerText="";q=new Date(q.modifiedDate);var E=b.timeSince(q);null==E&&(E=mxResources.get("lessThanAMinute"));mxUtils.write(G,mxResources.get("timeAgo",+[E],"{1} ago"));G.setAttribute("title",q.toLocaleDateString()+" "+q.toLocaleTimeString())}function N(q){var G=document.createElement("img");G.className="geCommentBusyImg";G.src=IMAGE_PATH+"/spin.gif";q.appendChild(G);q.busyImg=G}function I(q){q.style.border="1px solid red";q.busyImg.parentNode==q&&q.removeChild(q.busyImg)}function c(q){q.style.border="";q.busyImg.parentNode==q&&q.removeChild(q.busyImg)}function e(q,G,E,H,L){function K(V,W,X){var Y=document.createElement("li");Y.className="geCommentAction";+var Z=document.createElement("a");Z.className="geCommentActionLnk";mxUtils.write(Z,V);Y.appendChild(Z);mxEvent.addListener(Z,"click",function(da){W(da,q);da.preventDefault();mxEvent.consume(da)});T.appendChild(Y);X&&(Y.style.display="none")}function k(){function V(Y){W.push(X);if(null!=Y.replies)for(var Z=0;Z<Y.replies.length;Z++)X=X.nextSibling,V(Y.replies[Z])}var W=[],X=F;V(q);return{pdiv:X,replies:W}}function y(V,W,X,Y,Z){function da(){N(ha);q.addReply(ba,function(aa){ba.id=aa;q.replies.push(ba);+c(ha);X&&X()},function(aa){ea();I(ha);b.handleError(aa,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},Y,Z)}function ea(){B(ba,ha,function(aa){da()},!0)}var ka=k().pdiv,ba=b.newComment(V,b.getCurrentUser());ba.pCommentId=q.id;null==q.replies&&(q.replies=[]);var ha=e(ba,q.replies,ka,H+1);W?ea():da()}if(L||!q.isResolved){C.style.display="none";var F=document.createElement("div");F.className="geCommentContainer";F.setAttribute("data-commentId",q.id);F.style.marginLeft=20*H+5++"px";q.isResolved&&(u.style.opacity="0.7");var M=document.createElement("div");M.className="geCommentHeader";var P=document.createElement("img");P.className="geCommentUserImg";P.src=null!=q.user&&null!=q.user.pictureUrl?q.user.pictureUrl:Editor.userImage;M.appendChild(P);P=document.createElement("div");P.className="geCommentHeaderTxt";M.appendChild(P);var R=document.createElement("div");R.className="geCommentUsername";mxUtils.write(R,null!=q.user?q.user.displayName:mxResources.get("unknownUser"));+P.appendChild(R);R=document.createElement("div");R.className="geCommentDate";R.setAttribute("data-commentId",q.id);J(q,R);P.appendChild(R);F.appendChild(M);M=document.createElement("div");M.className="geCommentTxt";mxUtils.write(M,q.content||"");F.appendChild(M);q.isLocked&&(F.style.opacity="0.5");M=document.createElement("div");M.className="geCommentActions";var T=document.createElement("ul");T.className="geCommentActionsList";M.appendChild(T);g||q.isLocked||0!=H&&!l||K(mxResources.get("reply"),+function(){y("",!0)},q.isResolved);P=b.getCurrentUser();null==P||null==q.user||P.id!=q.user.id||g||q.isLocked||(K(mxResources.get("edit"),function(){function V(){B(q,F,function(){N(F);q.editComment(q.content,function(){c(F)},function(W){I(F);V();b.handleError(W,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}V()},q.isResolved),K(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){N(F);q.deleteComment(function(V){if(!0===V){V=F.querySelector(".geCommentTxt");V.innerText="";mxUtils.write(V,mxResources.get("msgDeleted"));var W=F.querySelectorAll(".geCommentAction");for(V=0;V<W.length;V++)W[V].parentNode.removeChild(W[V]);c(F);F.style.opacity="0.5"}else{W=k(q).replies;for(V=0;V<W.length;V++)D.removeChild(W[V]);for(V=0;V<G.length;V++)if(G[V]==q){G.splice(V,1);break}C.style.display=0==D.getElementsByTagName("div").length?"block":"none"}},function(V){I(F);b.handleError(V,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},q.isResolved));-g||q.isLocked||0!=H||L(q.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(V){function W(){var X=V.target;X.innerText="";q.isResolved=!q.isResolved;mxUtils.write(X,q.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var Z=q.isResolved?"none":"",Y=k(q).replies,da="light-dark("+(q.isResolved?"ghostWhite":"white")+", transparent)",ea=0;ea<Y.length;ea++){Y[ea].style.backgroundColor=da;for(var ka=Y[ea].querySelectorAll(".geCommentAction"),ba=0;ba<ka.length;ba++)ka[ba]!=-X.parentNode&&(ka[ba].style.display=Z);U||(Y[ea].style.display="none")}v()}q.isResolved?y(mxResources.get("reOpened")+": ",!0,W,!1,!0):y(mxResources.get("markedAsResolved"),!1,W,!0)});F.appendChild(K);null!=E?D.insertBefore(F,E.nextSibling):D.appendChild(F);for(E=0;null!=q.replies&&E<q.replies.length;E++)K=q.replies[E],K.isResolved=q.isResolved,e(K,q.replies,null,H+1,M);null!=n&&(n.comment.id==q.id?(M=q.content,q.content=n.comment.content,B(q,F,n.saveCallback,n.deleteOnCancel),q.content=M):null==+g||q.isLocked||0!=H||K(q.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(V){function W(){var X=V.target;X.innerText="";q.isResolved=!q.isResolved;mxUtils.write(X,q.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var Y=q.isResolved?"none":"",Z=k(q).replies,da="light-dark("+(q.isResolved?"ghostWhite":"white")+", transparent)",ea=0;ea<Z.length;ea++){Z[ea].style.backgroundColor=da;for(var ka=Z[ea].querySelectorAll(".geCommentAction"),ba=0;ba<ka.length;ba++)ka[ba]!=+X.parentNode&&(ka[ba].style.display=Y);U||(Z[ea].style.display="none")}v()}q.isResolved?y(mxResources.get("reOpened")+": ",!0,W,!1,!0):y(mxResources.get("markedAsResolved"),!1,W,!0)});F.appendChild(M);null!=E?D.insertBefore(F,E.nextSibling):D.appendChild(F);for(E=0;null!=q.replies&&E<q.replies.length;E++)M=q.replies[E],M.isResolved=q.isResolved,e(M,q.replies,null,H+1,L);null!=n&&(n.comment.id==q.id?(L=q.content,q.content=n.comment.content,B(q,F,n.saveCallback,n.deleteOnCancel),q.content=L):null==n.comment.id&&n.comment.pCommentId==q.id&&(D.appendChild(n.div),B(n.comment,n.div,n.saveCallback,n.deleteOnCancel)));return F}}var g=!b.canComment(),l=b.canReplyToReplies(),n=null,u=document.createElement("div");u.className="geCommentsWin";var z=EditorUi.compactUi?"26px":"30px",D=document.createElement("div");D.className="geCommentsList";D.style.bottom=parseInt(z)+7+"px";u.appendChild(D);var C=document.createElement("span");C.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(C,-mxResources.get("noCommentsFound"));var A=document.createElement("div");A.className="geToolbarContainer geCommentsToolbar";A.style.height=z;A.style.padding="3px 4px 4px 4px";z=document.createElement("a");z.className="geButton";if(!g){var Q=z.cloneNode();Q.style.backgroundImage="url("+Editor.plusImage+")";Q.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(Q,"click",function(q){function G(){B(E,H,function(M){N(H);b.addComment(M,function(L){M.id=L;O.push(M);c(H)},function(L){I(H);-G();b.handleError(L,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var E=b.newComment("",b.getCurrentUser()),H=e(E,O,null,0);G();q.preventDefault();mxEvent.consume(q)});A.appendChild(Q)}var S=z.cloneNode();S.style.backgroundImage="url("+Editor.checkImage+")";S.setAttribute("title",mxResources.get("showResolved"));var U=!1;mxEvent.addListener(S,"click",function(q){(U=!U)?S.classList.add("geActiveItem"):S.classList.remove("geActiveItem");p();q.preventDefault();mxEvent.consume(q)});+mxResources.get("noCommentsFound"));var A=document.createElement("div");A.className="geToolbarContainer geCommentsToolbar";A.style.height=z;A.style.padding="3px 4px 4px 4px";z=document.createElement("a");z.className="geButton";if(!g){var Q=z.cloneNode();Q.style.backgroundImage="url("+Editor.plusImage+")";Q.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(Q,"click",function(q){function G(){B(E,H,function(L){N(H);b.addComment(L,function(K){L.id=K;O.push(L);c(H)},function(K){I(H);+G();b.handleError(K,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var E=b.newComment("",b.getCurrentUser()),H=e(E,O,null,0);G();q.preventDefault();mxEvent.consume(q)});A.appendChild(Q)}var S=z.cloneNode();S.style.backgroundImage="url("+Editor.checkImage+")";S.setAttribute("title",mxResources.get("showResolved"));var U=!1;mxEvent.addListener(S,"click",function(q){(U=!U)?S.classList.add("geActiveItem"):S.classList.remove("geActiveItem");p();q.preventDefault();mxEvent.consume(q)});A.appendChild(S);b.commentsRefreshNeeded()&&(Q=z.cloneNode(),Q.style.backgroundImage="url("+Editor.refreshImage+")",Q.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(Q,"click",function(q){p();q.preventDefault();mxEvent.consume(q)}),A.appendChild(Q));b.commentsSaveNeeded()&&(z=z.cloneNode(),z.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',z.setAttribute("title",mxResources.get("save")),z.className="geButton geAdaptiveAsset",mxEvent.addListener(z,"click",function(q){x();q.preventDefault();mxEvent.consume(q)}),A.appendChild(z));u.appendChild(A);var O=[],p=mxUtils.bind(this,function(){this.hasError=!1;if(null!=n)try{n.div=n.div.cloneNode(!0);var q=n.div.querySelector(".geCommentEditTxtArea"),G=n.div.querySelector(".geCommentEditBtns");n.comment.content=q.value;q.parentNode.removeChild(q);G.parentNode.removeChild(G)}catch(E){b.handleError(E)}D.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+-mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";l=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(E){function H(M){if(null!=M){M.sort(function(k,y){return new Date(k.modifiedDate)-new Date(y.modifiedDate)});for(var L=0;L<M.length;L++)H(M[L].replies)}}E.sort(function(M,L){return new Date(M.modifiedDate)-new Date(L.modifiedDate)});D.innerText="";D.appendChild(C);C.style.display="block";O=E;for(E=0;E<O.length;E++)H(O[E].replies),e(O[E],O,null,0,U);null!=n&&null==n.comment.id&&-null==n.comment.pCommentId&&(D.appendChild(n.div),B(n.comment,n.div,n.saveCallback,n.deleteOnCancel))},mxUtils.bind(this,function(E){D.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(E&&E.message?": "+E.message:""));this.hasError=!0})):D.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});p();this.refreshComments=p;A=mxUtils.bind(this,function(){function q(L){var k=E[L.id];if(null!=k)for(J(L,k),k=0;null!=L.replies&&k<L.replies.length;k++)q(L.replies[k])}if(this.window.isVisible()){for(var G=-D.querySelectorAll(".geCommentDate"),E={},H=0;H<G.length;H++){var M=G[H];E[M.getAttribute("data-commentId")]=M}for(H=0;H<O.length;H++)q(O[H])}});setInterval(A,6E4);this.refreshCommentsTime=A;this.window=new mxWindow(mxResources.get("comments"),u,f,m,d,t,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";l=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(E){function H(L){if(null!=L){L.sort(function(k,y){return new Date(k.modifiedDate)-new Date(y.modifiedDate)});for(var K=0;K<L.length;K++)H(L[K].replies)}}E.sort(function(L,K){return new Date(L.modifiedDate)-new Date(K.modifiedDate)});D.innerText="";D.appendChild(C);C.style.display="block";O=E;for(E=0;E<O.length;E++)H(O[E].replies),e(O[E],O,null,0,U);null!=n&&null==n.comment.id&&+null==n.comment.pCommentId&&(D.appendChild(n.div),B(n.comment,n.div,n.saveCallback,n.deleteOnCancel))},mxUtils.bind(this,function(E){D.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(E&&E.message?": "+E.message:""));this.hasError=!0})):D.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});p();this.refreshComments=p;A=mxUtils.bind(this,function(){function q(K){var k=E[K.id];if(null!=k)for(J(K,k),k=0;null!=K.replies&&k<K.replies.length;k++)q(K.replies[k])}if(this.window.isVisible()){for(var G=+D.querySelectorAll(".geCommentDate"),E={},H=0;H<G.length;H++){var L=G[H];E[L.getAttribute("data-commentId")]=L}for(H=0;H<O.length;H++)q(O[H])}});setInterval(A,6E4);this.refreshCommentsTime=A;this.window=new mxWindow(mxResources.get("comments"),u,f,m,d,t,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!0)},ConfirmDialog=function(b,f,m,d,t,x,v,B,J,N,I){var c=document.createElement("div");c.style.textAlign="center";I=null!=I?I:44;var e=document.createElement("div");e.style.padding="6px";e.style.overflow="auto";e.style.maxHeight=I+"px";e.style.lineHeight="1.2em";mxUtils.write(e,f);c.appendChild(e);null!=N&&(e=document.createElement("div"),e.style.padding="6px 0 6px 0",f=document.createElement("img"),f.setAttribute("src",N),e.appendChild(f),c.appendChild(e));N=document.createElement("div");N.style.textAlign="center";N.style.whiteSpace="nowrap";var g=document.createElement("input");g.setAttribute("type","checkbox");x=mxUtils.button(x||mxResources.get("cancel"),function(){b.hideDialog();null!=d&&d(g.checked)});x.className="geBtn";null!=B&&(x.innerHTML=B+"<br>"+x.innerHTML,x.style.display="inline-block",x.style.paddingBottom="8px",x.style.paddingTop="8px",x.style.height="auto",x.style.width="40%");b.editor.cancelFirst&&N.appendChild(x);var l=mxUtils.button(t||mxResources.get("ok"),function(){b.hideDialog();null!=m&&m(g.checked)});N.appendChild(l);null!=v?(l.innerHTML=v+"<br>"+l.innerHTML+"<br>",l.style.display="inline-block",l.style.paddingBottom="8px",l.style.paddingTop="8px",l.style.height="auto",l.className="geBtn",l.style.width="40%"):l.className="geBtn gePrimaryBtn";b.editor.cancelFirst||N.appendChild(x);c.appendChild(N);J?(N.style.marginTop="10px",e=document.createElement("p"),e.style.marginTop="20px",e.style.marginBottom=@@ -13678,12 +13682,12 @@ mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries(this.oneDrive))}catch(v){null!=window.console&&console.log("OneDriveClient disabled: "+v.message)}else null==window.DrawOneDriveClientCallback&&(window.DrawOneDriveClientCallback=b)});b()}if("1"!=urlParams.embed||"1"==urlParams.tr){var f=mxUtils.bind(this,function(){if("undefined"!==typeof window.Trello)try{this.trello=new TrelloClient(this),this.trello.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.trello))}catch(v){null!=window.console&&console.log("TrelloClient disabled: "+v.message)}else null==window.DrawTrelloClientCallback&&(window.DrawTrelloClientCallback=f)});f()}if("1"!=urlParams.embed||"1"==urlParams.gapi){var m=mxUtils.bind(this,function(){if("undefined"!==typeof gapi){var v=mxUtils.bind(this,function(){try{this.drive=new DriveClient(this),this.drive.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries();"1"!=urlParams.dev&&this.checkLicense()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.drive))}catch(B){null!=window.console&&console.log("DriveClient disabled: "+B.message)}});null!=window.DrawGapiClientCallback?(gapi.load(("0"!=urlParams.picker?"picker,":"")+App.GOOGLE_APIS,v),window.DrawGapiClientCallback=null):v()}else null==window.DrawGapiClientCallback&&(window.DrawGapiClientCallback=m)});m()}if("1"!=urlParams.embed||"1"==urlParams.db){var d=mxUtils.bind(this,function(){if("function"===typeof Dropbox){window.DrawDropboxClientCallback=-null;try{this.dropbox=new DropboxClient(this),this.dropbox.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.dropbox))}catch(v){null!=window.console&&console.log("DropboxClient disabled: "+v.message)}}else null==window.DrawDropboxClientCallback&&(window.DrawDropboxClientCallback=d)});d()}if("1"!=urlParams.embed){if(this.setGraphEnabled(!1),"1"==urlParams.local?this.setMode(App.MODE_DEVICE):+null;try{this.dropbox=new DropboxClient(this),this.dropbox.addListener("userChanged",mxUtils.bind(this,function(){this.updateButtonContainer();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.dropbox))}catch(v){null!=window.console&&console.log("DropboxClient disabled: "+v.message)}}else null==window.DrawDropboxClientCallback&&(window.DrawDropboxClientCallback=d)});d()}if("1"!=urlParams.embed&&(this.setGraphEnabled(!1),"1"==urlParams.local?this.setMode(App.MODE_DEVICE):this.mode=App.mode,"serviceWorker"in navigator&&!this.editor.isChromelessView()&&(mxClient.IS_ANDROID||mxClient.IS_IOS)&&window.addEventListener("beforeinstallprompt",mxUtils.bind(this,function(v){this.showBanner("AddToHomeScreenFooter",mxResources.get("installApp"),function(){v.prompt()})})),!this.isOwnDomain()||this.editor.chromeless&&!this.editor.editable||this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){var v=this.getCurrentFile();v=null!=v?v.getMode():null;mxClient.IS_CHROMEAPP||-mxClient.IS_ANDROID||mxClient.IS_IOS||EditorUi.isElectronApp||this.isOffline()||null!=urlParams.open||"1"==urlParams.extAuth||v!=App.MODE_DEVICE&&v!=App.MODE_BROWSER||this.showDownloadDesktopBanner()})),!(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"auto"!=DrawioFile.SYNC||"1"==urlParams.local||"1"==urlParams.stealth||this.isOffline()||!Editor.enableRealtimeCache||this.editor.chromeless&&!this.editor.editable)){var t=window.setTimeout(mxUtils.bind(this,function(){Editor.enableRealtimeCache=!1}),-Editor.cacheTimeout);mxUtils.get(EditorUi.cacheUrl+"?alive",mxUtils.bind(this,function(v){Editor.enableRealtimeCache=200<=v.getStatus()&&299>=v.getStatus();window.clearTimeout(t)}),function(){Editor.enableRealtimeCache=!1;window.clearTimeout(t)})}}else null!=this.menubar&&(this.menubar.container.style.paddingTop="0px");this.updateHeader();if(null!=this.menubar){if("sketch"!=Editor.currentTheme&&("simple"!=Editor.currentTheme||"1"!=urlParams.embed)){var x=mxUtils.bind(this,function(){"1"!=urlParams.embed?-this.menubar.container.appendChild(this.buttonContainer):this.toolbarContainer.appendChild(this.buttonContainer)});this.addListener("languageChanged",x);this.addListener("currentThemeChanged",x);x()}("kennedy"==Editor.currentTheme&&"1"==urlParams.embed||"atlas"==Editor.currentTheme&&"1"!=urlParams.embed)&&this.setCompactMode(!0);if("atlas"==Editor.currentTheme||"1"==urlParams.atlas)this.icon=document.createElement("img"),this.icon.setAttribute("src",IMAGE_PATH+"/logo-flat-small.png"),this.icon.setAttribute("title",-mxResources.get("draw.io")),this.icon.style.padding="0 4px 0 14px","1"!=urlParams.embed&&(this.icon.style.cursor="pointer",mxEvent.addListener(this.icon,"click",mxUtils.bind(this,function(v){this.appIconClicked(v)}))),this.menubar.container.insertBefore(this.icon,this.menubar.container.firstChild)}this.editor.graph.isViewer()&&this.initializeViewerMode()}};+mxClient.IS_ANDROID||mxClient.IS_IOS||EditorUi.isElectronApp||this.isOffline()||null!=urlParams.open||"1"==urlParams.extAuth||v!=App.MODE_DEVICE&&v!=App.MODE_BROWSER||this.showDownloadDesktopBanner()})),!(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"auto"!=DrawioFile.SYNC||"1"==urlParams.local||"1"==urlParams.stealth||this.isOffline()||!Editor.enableRealtimeCache||this.editor.chromeless&&!this.editor.editable))){var t=window.setTimeout(mxUtils.bind(this,function(){Editor.enableRealtimeCache=!1}),+Editor.cacheTimeout);mxUtils.get(EditorUi.cacheUrl+"?alive",mxUtils.bind(this,function(v){Editor.enableRealtimeCache=200<=v.getStatus()&&299>=v.getStatus();window.clearTimeout(t)}),function(){Editor.enableRealtimeCache=!1;window.clearTimeout(t)})}this.updateHeader();if(null!=this.menubar){if("sketch"!=Editor.currentTheme&&("simple"!=Editor.currentTheme||"1"!=urlParams.embed)){var x=mxUtils.bind(this,function(){"1"!=urlParams.embed?this.menubar.container.appendChild(this.buttonContainer):this.toolbarContainer.appendChild(this.buttonContainer)});+this.addListener("languageChanged",x);this.addListener("currentThemeChanged",x);x()}("kennedy"==Editor.currentTheme&&"1"==urlParams.embed||"atlas"==Editor.currentTheme&&"1"!=urlParams.embed)&&this.setCompactMode(!0);if("atlas"==Editor.currentTheme||"1"==urlParams.atlas)this.icon=document.createElement("img"),this.icon.setAttribute("src",IMAGE_PATH+"/logo-flat-small.png"),this.icon.setAttribute("title",mxResources.get("draw.io")),this.icon.className="geSmallAppIcon","1"!=urlParams.embed&&(this.icon.style.cursor=+"pointer",mxEvent.addListener(this.icon,"click",mxUtils.bind(this,function(v){this.appIconClicked(v)}))),this.menubar.container.insertBefore(this.icon,this.menubar.container.firstChild)}this.editor.graph.isViewer()&&this.initializeViewerMode()}};App.blockedAncestorFrames=function(){try{if(window.location.ancestorOrigins&&window.location.hostname&&window.location.ancestorOrigins.length&&0<window.location.ancestorOrigins.length){var b=window.location.hostname;b&&1<b.length&&"/"==b.charAt(b.length-1)&&b.substring(0,b.length-1);b="";for(var f=0;f<window.location.ancestorOrigins.length;f++)if(b+=" -> "+window.location.ancestorOrigins[f],b.endsWith("dan6v7pm1f1a1.cloudfront.net")||b.endsWith("confluence-cloud-excalidraw-ll3likebca-uc.a.run.app"))return!0}}catch(m){}return!1};App.prototype.scheduleSanityCheck=function(){mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=this.sanityCheckThread||(this.sanityCheckThread=window.setTimeout(mxUtils.bind(this,function(){this.sanityCheckThread=null;this.sanityCheck()}),this.warnInterval))};App.prototype.stopSanityCheck=function(){null!=this.sanityCheckThread&&(window.clearTimeout(this.sanityCheckThread),this.sanityCheckThread=null)};App.prototype.sanityCheck=function(){var b=this.getCurrentFile();if(null!=b&&b.isModified()&&b.isAutosave()&&b.isOverdue()){b.getHash();b.savingFile&&null!=b.savingFileTime&&(Date.now(),b.savingFileTime.getTime());null!=b.ageStart&&(Date.now(),b.ageStart.getTime());b.isAutosave();null!=b.opened&&(Date.now(),b.opened.getTime());null!=b.lastSaved&&(Date.now(),b.lastSaved.getTime());null!=b.lastChanged&&(Date.now(),b.lastChanged.getTime());Date.now();App.startTime.getTime();var f=null!=b.sync?"client_"+@@ -13744,7 +13748,7 @@ null,window.location.pathname+this.getSearch(["state"])),this.setMode(App.MODE_GApp.prototype.loadDraft=function(b,f){this.createFile(this.defaultFilename,b,null,null,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){var m=this.getCurrentFile();null!=m&&(m.fileChanged(),null!=f&&f())}),0)}),null,null,!0)};App.prototype.filterDrafts=function(b,f,m){function d(){m(t)}var t=[];try{this.getDatabaseItems(mxUtils.bind(this,function(x){EditorUi.debug("App.filterDrafts",[this],"items",x);for(var v=0;v<x.length;v++)try{var B=x[v].key;if(null!=B&&".draft_"==B.substring(0,7)){var J=JSON.parse(x[v].data);null!=J&&"draft"==J.type&&J.aliveCheck!=f&&(null==b&&null==J.fileObject||null!=J.fileObject&&J.fileObject.path==b)&&(J.key=B,t.push(J))}}catch(N){}d()}),d)}catch(x){d()}};App.prototype.checkDrafts=function(){try{var b=Editor.guid();localStorage.setItem(".draft-alive-check",b);window.setTimeout(mxUtils.bind(this,function(){localStorage.removeItem(".draft-alive-check");this.filterDrafts(null,b,mxUtils.bind(this,function(f){if(1==f.length)this.loadDraft(f[0].data,mxUtils.bind(this,function(){this.removeDatabaseItem(f[0].key)}));else if(1<f.length){var m=new Date(f[0].modified);m=new DraftDialog(this,1<f.length?mxResources.get("selectDraft"):mxResources.get("draftFound",-[m.toLocaleDateString()+" "+m.toLocaleTimeString()]),1<f.length?null:f[0].data,mxUtils.bind(this,function(d){this.hideDialog();d=""!=d?d:0;this.loadDraft(f[d].data,mxUtils.bind(this,function(){this.removeDatabaseItem(f[d].key)}))}),mxUtils.bind(this,function(d,t){this.removeDatabaseItem(f[""!=d?d:0].key);null!=t&&t()}),null,null,null,1<f.length?f:null);this.showDialog(m.container,640,480,!0,!1,mxUtils.bind(this,function(d){"0"!=urlParams.splash?this.loadFile():this.createFile(this.defaultFilename,+[m.toLocaleDateString()+" "+m.toLocaleTimeString()]),1<f.length?null:f[0].data,mxUtils.bind(this,function(d){this.hideDialog();d=""!=d&&null!=f[d]?d:0;this.loadDraft(f[d].data,mxUtils.bind(this,function(){this.removeDatabaseItem(f[d].key)}))}),mxUtils.bind(this,function(d,t){this.removeDatabaseItem(f[""!=d?d:0].key);null!=t&&t()}),null,null,null,1<f.length?f:null);this.showDialog(m.container,640,480,!0,!1,mxUtils.bind(this,function(d){"0"!=urlParams.splash?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0)}));m.init()}else"0"!=urlParams.splash?this.loadFile():this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0)}))}),0)}catch(f){}};App.prototype.showSplash=function(b){if("1"!=urlParams.noFileMenu){var f=this.getServiceCount(!0),m=mxUtils.bind(this,function(){var t=new SplashDialog(this);this.showDialog(t.container,340,mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?200:230,!0,!0,mxUtils.bind(this,function(x,v){!x&&!v||mxClient.IS_CHROMEAPP||(x=Editor.useLocalStorage,this.createFile(this.defaultFilename+(EditorUi.isElectronApp?".drawio":""),null,null,null,null,null,null,"1"!=urlParams.local),Editor.useLocalStorage=x)}),!0)});if(this.editor.isChromelessView())this.handleError({message:mxResources.get("noFileSelected")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){this.showSplash()}));else if(mxClient.IS_CHROMEAPP||null!=this.mode&&!b)null==urlParams.create&&m();else{b=4==f?2:3;var d=new StorageDialog(this,mxUtils.bind(this,function(){this.hideDialog();m()}),b);this.showDialog(d.container,3>b?200:300,3<f?320:210,!0,!1)}}};@@ -13829,8 +13833,8 @@ c.innerHTML='<div class="circle'+(I.isNew?" active":"")+'"></div><span class="tiApp.prototype.save=function(b,f){var m=this.getCurrentFile(),d=!0,t=mxUtils.bind(this,function(){d&&(d=!1,m.handleFileSuccess(!0),null!=f&&f())}),x=mxUtils.bind(this,function(v){if(d){d=!1;Editor.addRetryToError(v,mxUtils.bind(this,function(){this.save(b,f)}));if(null!=v&&null!=v.retry){var B=v.retry;v.retry=function(){d=!0;try{m.isModified()?B():t()}catch(J){x(J)}}}m.handleFileError(v,null==v||"AbortError"!=v.name)}});if(null!=m&&this.spinner.spin(document.body,mxResources.get("saving"),x,3*this.timeout))try{this.clearStatus(),this.editor.graph.isEditing()&&this.editor.graph.stopEditing(),b==m.getTitle()?m.save(!0,t,x):m.saveAs(b,t,x)}catch(v){x(v)}};App.prototype.getExtensionForService=function(b){b=this.getServiceForName(b);return null!=b?b.extension:".drawio"};App.prototype.getServiceForName=function(b){return b==App.MODE_GOOGLE?this.drive:b==App.MODE_ONEDRIVE?this.oneDrive:b==App.MODE_DROPBOX?this.dropbox:b==App.MODE_GITHUB?this.gitHub:b==App.MODE_GITLAB?this.gitLab:b==App.MODE_TRELLO?this.trello:null};App.prototype.getTitleForService=function(b){return b==App.MODE_GOOGLE?mxResources.get("googleDrive"):b==App.MODE_ONEDRIVE?mxResources.get("oneDrive"):EditorUi.prototype.getTitleForService.apply(this,arguments)};-App.prototype.pickFolder=function(b,f,m,d,t,x){m=null!=m?m:!0;var v=this.spinner.pause();m&&b==App.MODE_GOOGLE&&null!=this.drive?this.drive.pickFolder(mxUtils.bind(this,function(B){v();if(B.action==google.picker.Action.PICKED){var J=null;null!=B.docs&&0<B.docs.length&&"folder"==B.docs[0].type&&(J=B.docs[0].id);f(x?B:J)}}),t):m&&b==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.pickFolder(mxUtils.bind(this,function(B){v();if(null!=B&&null!=B.value&&0<B.value.length){var J=OneDriveFile.prototype.getIdOf(B.value[0]);-f(x?B:J)}}),d):m&&b==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.pickFolder(mxUtils.bind(this,function(B){v();f(B)})):m&&b==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.pickFolder(mxUtils.bind(this,function(B){v();f(B)})):m&&b==App.MODE_TRELLO&&null!=this.trello?this.trello.pickFolder(mxUtils.bind(this,function(B){v();f(B)})):EditorUi.prototype.pickFolder.apply(this,arguments)};+App.prototype.pickFolder=function(b,f,m,d,t,x){m=null!=m?m:!0;this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);var v=this.spinner.pause();m&&b==App.MODE_GOOGLE&&null!=this.drive?this.drive.pickFolder(mxUtils.bind(this,function(B){v();if(B.action==google.picker.Action.PICKED){var J=null;null!=B.docs&&0<B.docs.length&&"folder"==B.docs[0].type&&(J=B.docs[0].id);f(x?B:J)}}),t):m&&b==App.MODE_ONEDRIVE&&null!=this.oneDrive?this.oneDrive.pickFolder(mxUtils.bind(this,function(B){v();+if(null!=B&&null!=B.value&&0<B.value.length){var J=OneDriveFile.prototype.getIdOf(B.value[0]);f(x?B:J)}}),d):m&&b==App.MODE_GITHUB&&null!=this.gitHub?this.gitHub.pickFolder(mxUtils.bind(this,function(B){v();f(B)})):m&&b==App.MODE_GITLAB&&null!=this.gitLab?this.gitLab.pickFolder(mxUtils.bind(this,function(B){v();f(B)})):m&&b==App.MODE_TRELLO&&null!=this.trello?this.trello.pickFolder(mxUtils.bind(this,function(B){v();f(B)})):EditorUi.prototype.pickFolder.apply(this,arguments)};App.prototype.exportFile=function(b,f,m,d,t,x){t==App.MODE_DROPBOX?null!=this.dropbox&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.dropbox.insertFile(f,d?this.base64ToBlob(b,m):b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(v){this.spinner.stop();this.handleError(v)})):t==App.MODE_GOOGLE?null!=this.drive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.drive.insertFile(f,b,x,mxUtils.bind(this,function(v){this.spinner.stop()}),mxUtils.bind(this,function(v){this.spinner.stop();this.handleError(v)}),m,d):t==App.MODE_ONEDRIVE?null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.oneDrive.insertFile(f,d?this.base64ToBlob(b,m):b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(v){this.spinner.stop();this.handleError(v)}),!1,x):t==App.MODE_GITHUB?null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.gitHub.insertFile(f,b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(v){this.spinner.stop();this.handleError(v)}),!0,x,d):t==App.MODE_GITLAB?null!=this.gitHub&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.gitLab.insertFile(f,b,mxUtils.bind(this,function(){this.spinner.stop()}),mxUtils.bind(this,function(v){this.spinner.stop();this.handleError(v)}),!0,x,d):t==App.MODE_TRELLO?null!=this.trello&&this.spinner.spin(document.body,mxResources.get("saving"))&&this.trello.insertFile(f,d?this.base64ToBlob(b,@@ -13878,19 +13882,19 @@ App.prototype.getCurrentUser=function(){var b=null;null!=this.drive&&null!=this.Editor.prototype.resetGraph=function(){editorResetGraph.apply(this,arguments);null==this.graph.defaultPageFormat&&(this.graph.pageFormat=mxSettings.getPageFormat())};(function(){var b=mxPopupMenu.prototype.showMenu;mxPopupMenu.prototype.showMenu=function(){this.div.style.overflowY="auto";this.div.style.overflowX="hidden";this.div.style.maxHeight=Math.max(document.body.clientHeight,document.documentElement.clientHeight)-(EditorUi.isElectronApp?50:10)+"px";b.apply(this,arguments)};Menus.prototype.createHelpLink=function(m){return this.editorUi.createHelpIcon(m)};Menus.prototype.addLinkToItem=function(m,d){null!=m&&m.firstChild.nextSibling.appendChild(this.createHelpLink(d))};Menus.prototype.removeCustomFont=function(m,d){for(var t=0;t<this.customFonts.length;t++)if(this.customFonts[t].name==m&&this.customFonts[t].url==d){this.customFonts.splice(t,1);this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts));break}};Menus.prototype.containsFont=function(m,d){for(var t=0;t<this.customFonts.length;t++)if(this.customFonts[t].name==m&&this.customFonts[t].url==d)return!0;for(t=0;t<this.defaultFonts.length;t++){var x=this.defaultFonts[t];if("string"!==typeof x&&x.fontFamily==m&&x.fontUrl==d||"string"===typeof x&&x==m&&null==d)return!0}return!1};Menus.prototype.addCustomFont=function(m,d){null==m||this.containsFont(m,d)||(this.customFonts.push({name:m,url:d}),this.editorUi.fireEvent(new mxEventObject("customFontsChanged","customFonts",this.customFonts)))};var f=Menus.prototype.init;Menus.prototype.init=function(){function m(p,q,G){d.isExportToCanvas()?d.showExportDialog(mxResources.get("image"),!1,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",-mxUtils.bind(this,function(E,H,M,L,k,y,F,K,P,R,T,V,W){var X=parseInt(E);!isNaN(X)&&0<X&&(d.exportImage(X/100,H&&"png"==p,M,L,k&&"png"==p,F,!K,P,p,T,null,V,W),null!=G&&G(E,H,M,L,k,y,F,K,P,R,T,V,W))}),!0,q,p,!0):d.isOffline()||mxClient.IS_IOS&&navigator.standalone||d.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(E,H,M,L,k){d.downloadFile(H&&"png"==p?"xmlpng":p,null,null,E,null,null,M,L,k)}),!1,!0)}f.apply(this,arguments);var d=this.editorUi,t=d.editor.graph,x=mxUtils.bind(t,-t.isEnabled);"1"==urlParams.noFileMenu&&(this.defaultMenuItems=this.defaultMenuItems.filter(function(p){return"file"!=p}));d.actions.addAction("new...",function(){var p=d.isOffline(),q=new NewDialog(d,p,!(d.mode==App.MODE_DEVICE&&"chooseFileSystemEntries"in window));d.showDialog(q.container,p?350:620,p?70:460,!0,!0,function(G){d.sidebar.hideTooltip();G&&null==d.getCurrentFile()&&d.showSplash()});q.init()});d.actions.put("insertTemplate",new Action("template...",function(){if(t.isEnabled()&&!t.isCellLocked(t.getDefaultParent())){var p=-new NewDialog(d,null,!1,function(q){d.hideDialog();if(null!=q){var G=d.editor.graph.getFreeInsertPoint();t.setSelectionCells(d.importXml(q,Math.max(G.x,20),Math.max(G.y,20),!0,null,null,!0));t.scrollCellToVisible(t.getSelectionCell())}},null,null,null,null,null,null,null,null,null,null,!1,mxResources.get("insert"));d.showDialog(p.container,620,460,!0,!0,function(){d.sidebar.hideTooltip()});p.init()}})).isEnabled=x;var v=d.actions.addAction("shareCursor",function(){d.setShareCursorPosition(!d.isShareCursorPosition())});-v.setToggleAction(!0);v.setSelectedCallback(function(){return d.isShareCursorPosition()});v=d.actions.addAction("showRemoteCursors",function(){d.setShowRemoteCursors(!d.isShowRemoteCursors())});v.setToggleAction(!0);v.setSelectedCallback(function(){return d.isShowRemoteCursors()});v=d.actions.addAction("points",function(){d.editor.graph.view.setUnit(mxConstants.POINTS)});v.setToggleAction(!0);v.setSelectedCallback(function(){return d.editor.graph.view.unit==mxConstants.POINTS});v=d.actions.addAction("inches",-function(){d.editor.graph.view.setUnit(mxConstants.INCHES)});v.setToggleAction(!0);v.setSelectedCallback(function(){return d.editor.graph.view.unit==mxConstants.INCHES});v=d.actions.addAction("millimeters",function(){d.editor.graph.view.setUnit(mxConstants.MILLIMETERS)});v.setToggleAction(!0);v.setSelectedCallback(function(){return d.editor.graph.view.unit==mxConstants.MILLIMETERS});v=d.actions.addAction("meters",function(){d.editor.graph.view.setUnit(mxConstants.METERS)});v.setToggleAction(!0);v.setSelectedCallback(function(){return d.editor.graph.view.unit==-mxConstants.METERS});this.put("units",new Menu(mxUtils.bind(this,function(p,q){this.addMenuItems(p,["points","inches","millimeters","meters"],q);"min"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme||d.menus.addMenuItems(p,["-","pageScale"],q)})));v=d.actions.addAction("pageTabs",function(){d.setTabContainerVisible(!d.isTabContainerVisible(),!0)});v.setToggleAction(!0);v.setSelectedCallback(function(){return d.isTabContainerVisible()});v=d.actions.addAction("ruler",-function(){d.setRulerVisible(!d.isRulerVisible())});v.setEnabled(d.canvasSupported&&9!=document.documentMode);v.setToggleAction(!0);v.setSelectedCallback(function(){return d.isRulerVisible()});v=d.actions.addAction("fullscreen",function(){"1"==urlParams.embedInline?d.setInlineFullscreen(!Editor.inlineFullscreen):null==document.fullscreenElement?document.body.requestFullscreen():document.exitFullscreen()});v.visible="1"==urlParams.embedInline||window==window.top&&document.fullscreenEnabled&&null!=-document.body.requestFullscreen;v.setToggleAction(!0);v.setSelectedCallback(function(){return"1"==urlParams.embedInline?Editor.inlineFullscreen:null!=document.fullscreenElement});v=d.actions.put("lightMode",new Action("light",function(p){d.setAndPersistDarkMode(!1)}));v.setToggleAction(!0);v.setSelectedCallback(function(){return!d.isAutoDarkMode(!0)&&!Editor.isDarkMode()});v=d.actions.put("darkMode",new Action("dark",function(p){d.setAndPersistDarkMode(!0)}));v.setToggleAction(!0);v.setSelectedCallback(function(){return!d.isAutoDarkMode(!0)&&+mxUtils.bind(this,function(E,H,L,K,k,y,F,M,P,R,T,V,W){var X=parseInt(E);!isNaN(X)&&0<X&&(d.exportImage(X/100,H&&"png"==p,L,K,k&&"png"==p,F,!M,P,p,T,null,V,W),null!=G&&G(E,H,L,K,k,y,F,M,P,R,T,V,W))}),!0,q,p,!0):d.isOffline()||mxClient.IS_IOS&&navigator.standalone||d.showRemoteExportDialog(mxResources.get("export"),null,mxUtils.bind(this,function(E,H,L,K,k){d.downloadFile(H&&"png"==p?"xmlpng":p,null,null,E,null,null,L,K,k)}),!1,!0)}f.apply(this,arguments);var d=this.editorUi,t=d.editor.graph,x=mxUtils.bind(t,+t.isEnabled);"1"==urlParams.noFileMenu&&(this.defaultMenuItems=this.defaultMenuItems.filter(function(p){return"file"!=p}));d.actions.addAction("new...",function(){var p=d.isOffline(),q=new NewDialog(d,p,!(d.mode==App.MODE_DEVICE&&"chooseFileSystemEntries"in window));d.showDialog(q.container,p?350:620,p?70:460,!0,!0,function(G){null!=d.sidebar&&d.sidebar.hideTooltip();G&&null==d.getCurrentFile()&&d.showSplash()});q.init()});d.actions.put("insertTemplate",new Action("template...",function(){if(t.isEnabled()&&+!t.isCellLocked(t.getDefaultParent())){var p=new NewDialog(d,null,!1,function(q){d.hideDialog();if(null!=q){var G=d.editor.graph.getFreeInsertPoint();t.setSelectionCells(d.importXml(q,Math.max(G.x,20),Math.max(G.y,20),!0,null,null,!0));t.scrollCellToVisible(t.getSelectionCell())}},null,null,null,null,null,null,null,null,null,null,!1,mxResources.get("insert"));d.showDialog(p.container,620,460,!0,!0,function(){d.sidebar.hideTooltip()});p.init()}})).isEnabled=x;var v=d.actions.addAction("shareCursor",+function(){d.setShareCursorPosition(!d.isShareCursorPosition())});v.setToggleAction(!0);v.setSelectedCallback(function(){return d.isShareCursorPosition()});v=d.actions.addAction("showRemoteCursors",function(){d.setShowRemoteCursors(!d.isShowRemoteCursors())});v.setToggleAction(!0);v.setSelectedCallback(function(){return d.isShowRemoteCursors()});v=d.actions.addAction("points",function(){d.editor.graph.view.setUnit(mxConstants.POINTS)});v.setToggleAction(!0);v.setSelectedCallback(function(){return d.editor.graph.view.unit==+mxConstants.POINTS});v=d.actions.addAction("inches",function(){d.editor.graph.view.setUnit(mxConstants.INCHES)});v.setToggleAction(!0);v.setSelectedCallback(function(){return d.editor.graph.view.unit==mxConstants.INCHES});v=d.actions.addAction("millimeters",function(){d.editor.graph.view.setUnit(mxConstants.MILLIMETERS)});v.setToggleAction(!0);v.setSelectedCallback(function(){return d.editor.graph.view.unit==mxConstants.MILLIMETERS});v=d.actions.addAction("meters",function(){d.editor.graph.view.setUnit(mxConstants.METERS)});+v.setToggleAction(!0);v.setSelectedCallback(function(){return d.editor.graph.view.unit==mxConstants.METERS});this.put("units",new Menu(mxUtils.bind(this,function(p,q){this.addMenuItems(p,["points","inches","millimeters","meters"],q);"min"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme||d.menus.addMenuItems(p,["-","pageScale"],q)})));v=d.actions.addAction("pageTabs",function(){d.setTabContainerVisible(!d.isTabContainerVisible(),!0)});v.setToggleAction(!0);v.setSelectedCallback(function(){return d.isTabContainerVisible()});+v=d.actions.addAction("ruler",function(){d.setRulerVisible(!d.isRulerVisible())});v.setEnabled(d.canvasSupported&&9!=document.documentMode);v.setToggleAction(!0);v.setSelectedCallback(function(){return d.isRulerVisible()});v=d.actions.addAction("fullscreen",function(){"1"==urlParams.embedInline?d.setInlineFullscreen(!Editor.inlineFullscreen):null==document.fullscreenElement?document.body.requestFullscreen():document.exitFullscreen()});v.visible="1"==urlParams.embedInline||window==window.top&&document.fullscreenEnabled&&+null!=document.body.requestFullscreen;v.setToggleAction(!0);v.setSelectedCallback(function(){return"1"==urlParams.embedInline?Editor.inlineFullscreen:null!=document.fullscreenElement});v=d.actions.put("lightMode",new Action("light",function(p){d.setAndPersistDarkMode(!1)}));v.setToggleAction(!0);v.setSelectedCallback(function(){return!d.isAutoDarkMode(!0)&&!Editor.isDarkMode()});v=d.actions.put("darkMode",new Action("dark",function(p){d.setAndPersistDarkMode(!0)}));v.setToggleAction(!0);v.setSelectedCallback(function(){return!d.isAutoDarkMode(!0)&&Editor.isDarkMode()});v=d.actions.put("autoMode",new Action("automatic",function(p){d.setAndPersistDarkMode("auto")}));v.setToggleAction(!0);v.setSelectedCallback(function(){return d.isAutoDarkMode(!0)});d.actions.addAction("properties...",function(){d.getPublicUrl(d.getCurrentFile(),function(p){p=new FilePropertiesDialog(d,p);d.showDialog(p.container,340,200,!0,!0);p.init()})}).isEnabled=x;window.mxFreehand&&(d.actions.put("insertFreehand",new Action("freehand...",function(){if(t.isEnabled()){if(null==d.freehandWindow){var p=!mxClient.IS_IE&&!mxClient.IS_IE11;d.freehandWindow=new FreehandWindow(d,document.body.offsetWidth-420,102,176,p?126:90,p)}t.freehand.isDrawing()?t.freehand.stopDrawing():t.freehand.startDrawing();d.freehandWindow.window.setVisible(!0)}},null,null,"X")).isEnabled=function(){return x()&&mxClient.IS_SVG});d.actions.put("exportXml",new Action("formatXml...",function(){var p=document.createElement("div");p.style.whiteSpace="nowrap";var q=null==d.pages||1>=d.pages.length,G=document.createElement("h3");-mxUtils.write(G,mxResources.get("formatXml"));G.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";p.appendChild(G);var E=d.addCheckbox(p,mxResources.get("selectionOnly"),!1,t.isSelectionEmpty()),H=d.addCheckbox(p,mxResources.get("compressed"),Editor.defaultCompressed),M=d.addCheckbox(p,mxResources.get("allPages"),!q,q);M.style.marginBottom="16px";mxEvent.addListener(E,"change",function(){E.checked?M.setAttribute("disabled","disabled"):M.removeAttribute("disabled")});p=-new CustomDialog(d,p,mxUtils.bind(this,function(){d.downloadFile("xml",!H.checked,null,!E.checked,q||!M.checked)}),null,mxResources.get("export"));d.showDialog(p.container,300,200,!0,!0)}));Editor.enableExportUrl&&d.actions.put("exportUrl",new Action("url...",function(){d.showPublishLinkDialog(mxResources.get("url"),null,null,null,null,null,null,null,function(p,q,G,E,H,M,L,k,y,F,K,P){L=[];E&&y&&L.push("tags=%7B%7D");p=new EmbedDialog(d,d.createLink(p,q,!0,E,H,M,null,!0,L,null,G,null,P));d.showDialog(p.container,-450,240,!0,!0);p.init()},null,!0)}));d.actions.put("exportHtml",new Action("formatHtmlEmbedded...",function(){d.getPublicUrl(d.getCurrentFile(),function(p){d.showHtmlDialog(mxResources.get("export"),null,p,function(q,G,E,H,M,L,k,y,F,K,P,R){d.createHtml(q,G,E,H,M,L,k,y,F,K,P,mxUtils.bind(this,function(T,V){var W=d.getBaseFilename(k);T='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n<!DOCTYPE html>\n<html>\n<head>\n<title>'+mxUtils.htmlEntities(W)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'++mxUtils.write(G,mxResources.get("formatXml"));G.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";p.appendChild(G);var E=d.addCheckbox(p,mxResources.get("selectionOnly"),!1,t.isSelectionEmpty()),H=d.addCheckbox(p,mxResources.get("compressed"),Editor.defaultCompressed),L=d.addCheckbox(p,mxResources.get("allPages"),!q,q);L.style.marginBottom="16px";mxEvent.addListener(E,"change",function(){E.checked?L.setAttribute("disabled","disabled"):L.removeAttribute("disabled")});p=+new CustomDialog(d,p,mxUtils.bind(this,function(){d.downloadFile("xml",!H.checked,null,!E.checked,q||!L.checked)}),null,mxResources.get("export"));d.showDialog(p.container,300,200,!0,!0)}));Editor.enableExportUrl&&d.actions.put("exportUrl",new Action("url...",function(){d.showPublishLinkDialog(mxResources.get("url"),null,null,null,null,null,null,null,function(p,q,G,E,H,L,K,k,y,F,M,P){K=[];E&&y&&K.push("tags=%7B%7D");p=new EmbedDialog(d,d.createLink(p,q,!0,E,H,L,null,!0,K,null,G,null,P));d.showDialog(p.container,+450,240,!0,!0);p.init()},null,!0)}));d.actions.put("exportHtml",new Action("formatHtmlEmbedded...",function(){d.getPublicUrl(d.getCurrentFile(),function(p){d.showHtmlDialog(mxResources.get("export"),null,p,function(q,G,E,H,L,K,k,y,F,M,P,R){d.createHtml(q,G,E,H,L,K,k,y,F,M,P,mxUtils.bind(this,function(T,V){var W=d.getBaseFilename(k);T='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n<!DOCTYPE html>\n<html>\n<head>\n<title>'+mxUtils.htmlEntities(W)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'+T+"\n"+V+"\n</body>\n</html>";d.saveData(W+(".drawio"==W.substring(W.lenth-7)?"":".drawio")+".html","html",T,"text/html")}),R)})})}));d.actions.put("exportPdf",new Action("formatPdf...",function(){d.showPrintDialog(mxResources.get("formatPdf"),EditorUi.isElectronApp||!d.isOffline()&&!d.printPdfExport?mxUtils.bind(this,function(p,q){p=null!=d.pages?d.pages.length:1;var G=null==d.pages||1>=d.pages.length,E=d.getPageIndex(d.currentPage);E=null!=E?E+1:1;d.downloadFile("pdf",null,null,!q.selection,G||!q.allPages&&q.pagesFrom==E&&q.pagesTo==E,!q.crop,q.transparent,q.scale,null,q.grid,q.includeCopy,q.allPages||q.pagesFrom==E&&q.pagesTo==E?null:{from:Math.max(0,Math.min(p-1,q.pagesFrom-1)),to:Math.max(0,Math.min(p-1,q.pagesTo-1))},q.border,q.fit,q.sheetsAcross,q.sheetsDown)}):null,mxResources.get("export"))}));d.actions.addAction("open...",function(){d.pickFile()});d.actions.addAction("close",function(){function p(){null!=q&&q.removeDraft();d.fileLoaded(null)}var q=d.getCurrentFile();null!=q&&q.isModified()?d.confirm(mxResources.get("allChangesLost"),null,p,mxResources.get("cancel"),mxResources.get("discardChanges")):p()});d.actions.addAction("editShape...",mxUtils.bind(this,function(){t.getSelectionCells();if(1==t.getSelectionCount()){var p=t.getSelectionCell(),q=t.view.getState(p);null!=q&&null!=q.shape&&null!=q.shape.stencil&&(p=new EditShapeDialog(d,p,mxResources.get("editShape")+":",630,400),d.showDialog(p.container,640,480,!0,!1),p.init())}}));d.actions.addAction("revisionHistory...",function(){d.isRevisionHistorySupported()?@@ -13902,65 +13906,66 @@ p.ignoreColor=!0;p.ignoreImage=!0;p.adaptiveColors="simple";t.model.execute(p)})["defaultAdaptiveColors","-","automaticAdaptiveColors","simpleAdaptiveColors","noAdaptiveColors"],q)})));isLocalStorage&&(v=d.actions.addAction("showStartScreen",function(){mxSettings.setShowStartScreen(!mxSettings.getShowStartScreen());mxSettings.save()}),v.setToggleAction(!0),v.setSelectedCallback(function(){return mxSettings.getShowStartScreen()}));var B=d.actions.addAction("autosave",function(){d.editor.setAutosave(!d.editor.autosave)});B.setToggleAction(!0);B.setSelectedCallback(function(){return B.isEnabled()&&d.editor.autosave});d.actions.addAction("editGeometry...",function(){for(var p=t.getSelectionCells(),q=[],G=0;G<p.length;G++)t.getModel().isVertex(p[G])&&q.push(p[G]);0<q.length&&(p=new EditGeometryDialog(d,q),d.showDialog(p.container,200,270,!0,!0),p.init())},null,null,Editor.ctrlKey+"+Shift+M");d.actions.addAction("copyStyle",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var p=t.getSelectionCell(),q=t.getCellStyle(p,!1);d.copiedStyle={};var G=[],E=[],H;for(H in q)G.push(q[H]),E.push(H);t.copyCellStyles([p],E,G,d.copiedStyle,d.copiedStyle,null,null,null,!0)}},null,null,"Alt+C");d.actions.addAction("pasteStyle",function(){t.isEnabled()&&!t.isSelectionEmpty()&&null!=d.copiedStyle&&t.pasteCellStyles(t.includeDescendants(t.getSelectionCells()),d.copiedStyle,d.copiedStyle,!0)},null,null,"Alt+V");d.actions.put("exportSvg",new Action("formatSvg...",function(){d.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://www.drawio.com/doc/faq/export-diagram",mxUtils.bind(this,-function(p,q,G,E,H,M,L,k,y,F,K,P,R,T){p=parseInt(p);d.lastExportSvgEditable=H;!isNaN(p)&&0<p&&d.exportSvg(p/100,q,G,E,H,M,L,!k,y,F,P,R,T)}),!0,d.lastExportSvgEditable,"svg",!0)}));d.actions.put("exportPng",new Action("formatPng...",function(){m("png",d.lastExportPngEditable,function(p,q,G,E,H){d.lastExportPngEditable=H})}));d.actions.put("exportJpg",new Action("formatJpg...",function(){m("jpeg")}));d.actions.put("exportWebp",new Action("formatWebp...",function(){m("webp")}));v=d.actions.addAction("copyAsImage",+function(p,q,G,E,H,L,K,k,y,F,M,P,R,T){p=parseInt(p);d.lastExportSvgEditable=H;!isNaN(p)&&0<p&&d.exportSvg(p/100,q,G,E,H,L,K,!k,y,F,P,R,T)}),!0,d.lastExportSvgEditable,"svg",!0)}));d.actions.put("exportPng",new Action("formatPng...",function(){m("png",d.lastExportPngEditable,function(p,q,G,E,H){d.lastExportPngEditable=H})}));d.actions.put("exportJpg",new Action("formatJpg...",function(){m("jpeg")}));d.actions.put("exportWebp",new Action("formatWebp...",function(){m("webp")}));v=d.actions.addAction("copyAsImage",mxUtils.bind(this,function(){var p=mxUtils.sortCells(t.model.getTopmostCells(t.getSelectionCells())),q=mxUtils.getXml(0==p.length?d.editor.getGraphXml():t.encodeCells(p));d.copyImage(p,q)}),null,null,"Ctrl+Alt+X");v.visible=Editor.enableNativeCipboard&&d.isExportToCanvas()&&!mxClient.IS_SF;v=d.actions.put("shadowVisible",new Action("shadow",function(){t.setShadowVisible(!t.shadowVisible)}));v.setToggleAction(!0);v.setSelectedCallback(function(){return t.shadowVisible});d.actions.put("about",new Action("v"+-EditorUi.VERSION,function(p,q){}));d.actions.addAction("support...",function(){EditorUi.isElectronApp?d.openLink("https://github.com/jgraph/drawio-desktop/wiki/Getting-Support"):d.openLink("https://github.com/jgraph/drawio/wiki/Getting-Support")});d.actions.addAction("exportOptionsDisabled...",function(){d.handleError({message:mxResources.get("exportOptionsDisabledDetails")},mxResources.get("exportOptionsDisabled"))});d.actions.addAction("keyboardShortcuts...",function(){!mxClient.IS_SVG||mxClient.IS_CHROMEAPP||-EditorUi.isElectronApp?d.openLink("https://viewer.diagrams.net/#Uhttps%3A%2F%2Fviewer.diagrams.net%2Fshortcuts.svg"):d.openLink("shortcuts.svg")});d.actions.addAction("feedback...",function(){var p=new FeedbackDialog(d);d.showDialog(p.container,610,360,!0,!1);p.init()});d.actions.addAction("quickStart...",function(){"ac.draw.io"===window.location.hostname?d.openLink("https://www.youtube.com/watch?v=s5BG0705MHU"):d.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});v=d.actions.addAction("tags",-mxUtils.bind(this,function(){null==this.tagsWindow?(this.tagsWindow=new TagsWindow(d,document.body.offsetWidth-400,60,212,200),this.tagsWindow.window.addListener("show",mxUtils.bind(this,function(){d.fireEvent(new mxEventObject("tags"))})),this.tagsWindow.window.addListener("hide",function(){d.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.setVisible(!0),d.fireEvent(new mxEventObject("tags"))):this.tagsWindow.window.setVisible(!this.tagsWindow.window.isVisible())}),null,null,Editor.ctrlKey+-"+K");v.setToggleAction(!0);v.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&&this.tagsWindow.window.isVisible()}));null==Editor.gptApiKey||null==Editor.gptModel||null==Editor.gptUrl||d.isOffline()||EditorUi.isElectronApp||(v=d.actions.addAction("chatWindowTitle",mxUtils.bind(this,function(){null==this.chatWindow?(this.chatWindow=new ChatWindow(d,220,document.body.offsetHeight-380,250,320),this.chatWindow.window.addListener("show",mxUtils.bind(this,function(){d.fireEvent(new mxEventObject("chat"))})),-this.chatWindow.window.addListener("hide",function(){d.fireEvent(new mxEventObject("chat"))}),this.chatWindow.window.setVisible(!0),d.fireEvent(new mxEventObject("chat"))):this.chatWindow.window.setVisible(!this.chatWindow.window.isVisible())})),v.setToggleAction(!0),v.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.chatWindow&&this.chatWindow.window.isVisible()})));v=d.actions.addAction("findReplace",mxUtils.bind(this,function(p,q){var G=(p=t.isEnabled()&&(null==q||!mxEvent.isShiftDown(q)))?-"findReplace":"find";q=G+"Window";if(null==this[q]){var E="min"==Editor.currentTheme||"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,H=p?E?330:300:240;this[q]=new FindWindow(d,document.body.offsetWidth-(H+20),100,H,p?E?304:288:170,p);this[q].window.addListener("show",function(){d.fireEvent(new mxEventObject(G))});this[q].window.addListener("hide",function(){d.fireEvent(new mxEventObject(G))})}this[q].window.setVisible(!0);this[q].focus()}),null,null,Editor.ctrlKey+"+F");v=new Action("exportVsdx",-function(){var p=null==d.pages||1>=d.pages.length;if(p)d.exportVisio();else{var q=document.createElement("div");q.style.whiteSpace="nowrap";var G=document.createElement("h3");mxUtils.write(G,mxResources.get("formatVsdx"));G.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";q.appendChild(G);var E=d.addCheckbox(q,mxResources.get("allPages"),!p,p);E.style.marginBottom="16px";p=new CustomDialog(d,q,mxUtils.bind(this,function(){d.exportVisio(!E.checked)}),null,mxResources.get("export"));-d.showDialog(p.container,300,130,!0,!0)}});v.getTitle=function(){return mxResources.get("formatVsdx")+" (beta)..."};d.actions.put("exportVsdx",v);isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed&&d.actions.addAction("configuration...",function(){var p=document.createElement("input");p.setAttribute("type","checkbox");p.style.marginRight="8px";p.checked=mxSettings.getShowStartScreen();p.defaultChecked=p.checked;if(Editor.isSettingsEnabled()&&("sketch"==Editor.currentTheme||"simple"==Editor.currentTheme||-"min"==Editor.currentTheme)){var q=document.createElement("span");q.style.display="flex";q.style.alignItems="center";q.style.cssFloat="right";q.style.cursor="pointer";q.style.userSelect="none";q.style.marginTop="-3px";q.appendChild(p);mxUtils.write(q,mxResources.get("showStartScreen"));mxEvent.addListener(q,"click",function(E){mxEvent.getSource(E)!=p&&(p.checked=!p.checked)});header=q}q=[[mxResources.get("reset"),function(){d.confirm(mxResources.get("areYouSure"),function(){try{localStorage.removeItem(Editor.configurationKey),-d.hideDialog(),d.alert(mxResources.get("restartForChangeRequired"))}catch(E){d.handleError(E)}})}]];if(!d.isOfflineApp()&&isLocalStorage&&d.mode!=App.MODE_ATLAS){var G=d.actions.get("plugins");null==G||"sketch"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&"min"!=Editor.currentTheme||q.push([mxResources.get("plugins"),G.funct])}EditorUi.isElectronApp||q.push([mxResources.get("link"),function(E,H){if(0<H.value.length)try{var M=JSON.parse(H.value),L=window.location.protocol+"//"+window.location.host+-"/"+d.getSearch()+"#_CONFIG_"+Graph.compress(JSON.stringify(M)),k=new EmbedDialog(d,L);d.showDialog(k.container,450,240,!0);k.init()}catch(y){d.handleError(y)}else d.handleError({message:mxResources.get("invalidInput")})}]);"atlassian"!=d.getServiceName()&&"1"!=urlParams.embed&&q.push([mxResources.get("preferences"),function(){d.showLocalStorageDialog(mxResources.get("preferences")+":",Editor.settingsKey,[[mxResources.get("reset"),function(){d.confirm(mxResources.get("areYouSure"),function(){try{localStorage.removeItem(Editor.settingsKey),-localStorage.removeItem(".drawio-config"),d.hideDialog(),d.alert(mxResources.get("restartForChangeRequired"))}catch(E){d.handleError(E)}})}]])}]);d.showLocalStorageDialog(mxResources.get("configuration")+":",Editor.configurationKey,q,p.parentNode,"https://www.drawio.com/doc/faq/configure-diagram-editor",function(){null!=p.parentNode&&(mxSettings.setShowStartScreen(p.checked),mxSettings.save())})});(mxClient.IS_CHROMEAPP||isLocalStorage)&&this.put("language",new Menu(mxUtils.bind(this,function(p,q){var G=-mxLanguage;null==urlParams.lang&&isLocalStorage&&(G=mxSettings.settings.language);var E=mxUtils.bind(this,function(M){var L=""==M?mxResources.get("automatic"):mxLanguageMap[M],k=null;""!=L&&(k=p.addItem(L,null,mxUtils.bind(this,function(){d.setAndPersistLanguage(M)}),q),(M==G||""==M&&null==G)&&p.addCheckmark(k,Editor.checkmarkImage));return k});E("");p.addSeparator(q);for(var H in mxLanguageMap)E(H)})));d.customLayoutConfig=[{layout:"mxHierarchicalLayout",config:{orientation:"west",intraCellSpacing:30,-interRankCellSpacing:100,interHierarchySpacing:60,parallelEdgeSpacing:10}}];d.actions.addAction("runLayout",function(){d.showCustomLayoutDialog(JSON.stringify(d.customLayoutConfig,null,2))});d.actions.put("adaptiveColors",new Action("adaptiveColors",function(p){null==d.adaptiveColorsWindow&&(d.adaptiveColorsWindow=new AdaptiveColorsWindow(d,document.body.offsetWidth-520,80,200,160));d.adaptiveColorsWindow.window.setVisible(!0)}));v=this.get("viewZoom");var J=v.funct;v.funct=mxUtils.bind(this,function(p,-q){J.apply(this,arguments);"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||this.addMenuItems(p,["-","outline","fullscreen"],q)});v=this.get("layout");var N=v.funct;v.funct=function(p,q){N.apply(this,arguments);p.addItem(mxResources.get("orgChart"),null,function(){var G=null,E=20,H=20,M=function(){"undefined"!==typeof mxOrgChartLayout&&null!=G&&d.tryAndHandle(mxUtils.bind(this,function(){var T=d.editor.graph,V=new mxOrgChartLayout(T,G,E,H),W=T.getDefaultParent();1<T.model.getChildCount(T.getSelectionCell())&&-(W=T.getSelectionCell());V.execute(W)}))},L=document.createElement("div"),k=document.createElement("div");k.style.marginTop="6px";k.style.display="inline-block";k.style.width="180px";mxUtils.write(k,mxResources.get("orgChartType")+": ");L.appendChild(k);var y=document.createElement("select");y.style.width="160px";y.style.boxSizing="border-box";k=[mxResources.get("linear"),mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),-mxResources.get("1ColumnRight"),mxResources.get("smart")];for(var F=0;F<k.length;F++){var K=document.createElement("option");mxUtils.write(K,k[F]);K.value=F;2==F&&K.setAttribute("selected","selected");y.appendChild(K)}mxEvent.addListener(y,"change",function(){G=y.value});L.appendChild(y);k=document.createElement("div");k.style.marginTop="6px";k.style.display="inline-block";k.style.width="180px";mxUtils.write(k,mxResources.get("parentChildSpacing")+": ");L.appendChild(k);var P=document.createElement("input");-P.type="number";P.value=E;P.style.width="160px";P.style.boxSizing="border-box";L.appendChild(P);mxEvent.addListener(P,"change",function(){E=P.value});k=document.createElement("div");k.style.marginTop="6px";k.style.display="inline-block";k.style.width="180px";mxUtils.write(k,mxResources.get("siblingSpacing")+": ");L.appendChild(k);var R=document.createElement("input");R.type="number";R.value=H;R.style.width="160px";R.style.boxSizing="border-box";L.appendChild(R);mxEvent.addListener(R,"change",function(){H=-R.value});k=mxUtils.button(mxResources.get("custom")+"...",function(){var T=[{layout:"mxOrgChartLayout",config:{branchOptimizer:parseInt(y.value),parentChildSpacing:parseInt(P.value),siblingSpacing:parseInt(R.value)}}];d.hideDialog();d.showCustomLayoutDialog(JSON.stringify(T,null,2))});k.className="geBtn";L=new CustomDialog(d,L,function(){null==G&&(G=2);d.loadOrgChartLayouts(M)},null,null,null,k);d.showDialog(L.container,355,140,!0,!0)},q,null,x());p.addSeparator(q);p.addItem(mxResources.get("parallels"),-null,mxUtils.bind(this,function(){d.tryAndHandle(mxUtils.bind(this,function(){var G=new mxParallelEdgeLayout(t);G.checkOverlap=!0;d.prompt(mxResources.get("spacing"),G.spacing,mxUtils.bind(this,function(E){d.tryAndHandle(mxUtils.bind(this,function(){G.spacing=E;d.executeLayout(function(){G.execute(t.getDefaultParent(),t.isSelectionEmpty()?null:t.getSelectionCells())},!1)}))}))}))}),q);p.addSeparator(q);d.menus.addMenuItem(p,"runLayout",q,null,null,mxResources.get("custom")+"...")};this.put("help",-new Menu(mxUtils.bind(this,function(p,q){if(!mxClient.IS_CHROMEAPP&&d.isOffline())this.addMenuItems(p,["keyboardShortcuts","-","about"],q);else{var G=p.addItem("Search:",null,null,q,null,null,!1);G.style.cursor="default";var E=document.createElement("input");E.setAttribute("type","text");E.setAttribute("size","25");E.style.borderWidth="1px";E.style.marginLeft="8px";mxEvent.addListener(E,"keydown",mxUtils.bind(this,function(H){var M=mxUtils.trim(E.value);13==H.keyCode&&0<M.length?(this.editorUi.openLink("https://www.drawio.com/search?src="+-(EditorUi.isElectronApp?"DESKTOP":encodeURIComponent(location.host))+"&search="+encodeURIComponent(M)),E.value="",EditorUi.logEvent({category:"SEARCH-HELP",action:"search",label:M}),window.setTimeout(mxUtils.bind(this,function(){this.editorUi.hideCurrentMenu()}),0)):27==H.keyCode&&(E.value="")}));G.firstChild.nextSibling.appendChild(E);mxEvent.addGestureListeners(E,function(H){document.activeElement!=E&&E.focus();mxEvent.consume(H)},function(H){mxEvent.consume(H)},function(H){mxEvent.consume(H)});-window.setTimeout(function(){E.focus()},0);EditorUi.isElectronApp?(d.actions.addAction("website...",function(){d.openLink("https://www.drawio.com")}),d.actions.addAction("check4Updates",function(){d.checkForUpdates()}),d.actions.put("desktopZoomIn",new Action("zoomIn",function(){d.desktopZoomIn()})),d.actions.put("desktopZoomOut",new Action("zoomOut",function(){d.desktopZoomOut()})),d.actions.put("desktopResetZoom",new Action("actualSize",function(){d.desktopResetZoom()})),this.addMenuItems(p,"- keyboardShortcuts quickStart website support -".split(" "),-q),"1"!=urlParams.disableUpdate&&this.addMenuItems(p,["check4Updates","-"],q),this.addMenuItems(p,"desktopResetZoom desktopZoomIn desktopZoomOut - openDevTools - about".split(" "),q)):this.addMenuItems(p,"- keyboardShortcuts quickStart support - about".split(" "),q)}"1"==urlParams.test&&(p.addSeparator(q),this.addSubmenu("testDevelop",p,q))})));d.actions.addAction("languageCode...",function(){var p=new FilenameDialog(d,Graph.diagramLanguage||"",mxResources.get("ok"),mxUtils.bind(this,function(q){null!=-q&&(Graph.diagramLanguage=0<q.length?q:null,Graph.translateDiagram=!0,t.refresh())}),mxResources.get("languageCode"),null,null,"https://www.drawio.com/blog/translate-diagrams");d.showDialog(p.container,340,80,!0,!0);p.init()});this.put("diagramLanguage",new Menu(mxUtils.bind(this,function(p,q){this.addMenuItems(p,["languageCode","-"],q);q=p.addItem(mxResources.get("disabled"),null,function(){Graph.translateDiagram=!1;t.refresh()},q);Graph.translateDiagram||p.addCheckmark(q,Editor.checkmarkImage)})));-if("1"==urlParams.test){mxResources.parse("testDevelop=Develop");mxResources.parse("showBoundingBox=Show bounding box");mxResources.parse("createSidebarEntry=Create Sidebar Entry");mxResources.parse("testCheckFile=Check File");mxResources.parse("testDiff=Diff/Sync");mxResources.parse("testChecksum=Checksum");mxResources.parse("testCheckPages=Check Pages");mxResources.parse("testFixPages=Fix Pages");mxResources.parse("testInspect=Inspect");mxResources.parse("testShowConsole=Show Console");mxResources.parse("testXmlImageExport=XML Image Export");-mxResources.parse("testOptimize=Remove Inline Images");mxResources.parse("testPerformance=Performance");d.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){if(!t.isSelectionEmpty()){var p=t.cloneCells(t.getSelectionCells()),q=t.getBoundingBoxFromGeometry(p,!0);p=t.moveCells(p,-q.x,-q.y);d.showTextDialog("Create Sidebar Entry","this.addDataEntry('tag1 tag2', "+q.width+", "+q.height+", 'The Title', '"+Graph.compress(mxUtils.getXml(t.encodeCells(p)))+"'),")}}));d.actions.addAction("showBoundingBox",-mxUtils.bind(this,function(){function p(L){return null==L||null==L.boundingBox||!isNaN(L.boundingBox.x)&&!isNaN(L.boundingBox.y)&&!isNaN(L.boundingBox.width)&&!isNaN(L.boundingBox.height)}var q=t.getGraphBounds(),G=t.view.translate,E=t.view.scale;t.insertVertex(t.getDefaultParent(),null,"",q.x/E-G.x,q.y/E-G.y,q.width/E,q.height/E,"fillColor=none;strokeColor=red;");var H=0,M=0;t.view.states.visit(function(L,k){L=!0;p(k.shape)||(console.log("invalid shape",k.cell.id,k.shape),L=!1);p(k.text)||(console.log("invalid text",-k.cell.id,k.text),L=!1);L||H++;M++});console.log("states checked",M,"invalid",H)}));d.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var p=null!=d.pages&&null!=d.getCurrentFile()?d.getCurrentFile().getAnonymizedXmlForPages(d.pages):"";p=new TextareaDialog(d,"Paste Data:",p,function(q){if(0<q.length)try{var G=function(k){function y(Y){if(null==Z[Y]){if(Z[Y]=!0,null!=P[Y]){for(;0<P[Y].length;){var da=P[Y].pop();y(da)}delete P[Y]}}else mxLog.debug(F+": Visited: "+Y)}var F=k.parentNode.id,-K=k.childNodes;k={};for(var P={},R=null,T={},V=0;V<K.length;V++){var W=K[V];if(null!=W.id&&0<W.id.length)if(null==k[W.id]){k[W.id]=W.id;var X=W.getAttribute("parent");null==X?null!=R?mxLog.debug(F+": Multiple roots: "+W.id):R=W.id:(null==P[X]&&(P[X]=[]),P[X].push(W.id))}else T[W.id]=W.id}K=Object.keys(T);0<K.length?(K=F+": "+K.length+" Duplicates: "+K.join(", "),mxLog.debug(K+" (see console)")):mxLog.debug(F+": Checked");var Z={};null==R?mxLog.debug(F+": No root"):(y(R),Object.keys(Z).length!=Object.keys(k).length&&-(mxLog.debug(F+": Invalid tree: (see console)"),console.log(F+": Invalid tree",P)))};"<"!=q.charAt(0)&&(q=Graph.decompress(q),mxLog.debug("See console for uncompressed XML"),console.log("xml",q));var E=mxUtils.parseXml(q),H=d.getPagesForNode(E.documentElement,"mxGraphModel");if(null!=H&&0<H.length)try{var M=d.getHashValueForPages(H);mxLog.debug("Checksum: ",M)}catch(k){mxLog.debug("Error: ",k.message)}else mxLog.debug("No pages found for checksum");var L=E.getElementsByTagName("root");for(q=0;q<L.length;q++)G(L[q]);-mxLog.show()}catch(k){d.handleError(k),null!=window.console&&console.error(k)}});d.showDialog(p.container,620,460,!0,!0);p.init()}));var I=null;d.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=d.pages){var p=new TextareaDialog(d,"Diff/Sync:","",function(q){var G=d.getCurrentFile();if(0<q.length&&null!=G)try{var E=JSON.parse(q);G.patch([E],null,!0,!0);d.hideDialog()}catch(H){d.handleError(H)}},null,"Close",null,null,null,!0,null,"Patch",null,[["Snapshot",function(q,G){I=d.getPagesForXml(d.getFileData(!0));-p.textarea.value="Snapshot updated "+(new Date).toLocaleString()+" Checksum "+d.getHashValueForPages(I)}],["Diff",function(q,G){try{p.textarea.value=JSON.stringify(d.diffPages(I,d.pages),null,2)}catch(E){d.handleError(E)}}]]);null==I?(I=d.getPagesForXml(d.getFileData(!0)),p.textarea.value="Snapshot created "+(new Date).toLocaleString()+" Checksum "+d.getHashValueForPages(I)):p.textarea.value=JSON.stringify(d.diffPages(I,d.pages),null,2);d.showDialog(p.container,620,460,!0,!0);p.init()}else d.alert("No pages")}));-d.actions.addAction("testChecksum",mxUtils.bind(this,function(){var p=d.getCurrentFile();null!=d.pages&&null!=p?d.spinner.spin(document.body,mxResources.get("loading"))&&p.getLatestVersion(function(q){d.spinner.stop();var G=d.getHashValueForPages(d.pages),E=p.getCurrentRevisionId(),H=d.getHashValueForPages(q.getShadowPages()),M=q.getDescriptorChecksum(q.getDescriptor()),L=q.getCurrentRevisionId();console.log("Local File",[p],"modified",p.isModified(),"checksum",G);console.log("Remote File",[q],"rev",-L==E,"desc",M==H,"checksum",H);d.alert("Checksums "+(H==G?"match":"no not match"))},function(q){console.log("Error getLatestVersion",q);d.handleError(q)}):console.log("Checksum: no file or pages")}));d.actions.addAction("testCheckPages",mxUtils.bind(this,function(){var p=d.getCurrentFile();console.log("editorUi",d,"file",p);if(null!=p&&p.isRealtime()){console.log("Checksum ownPages",d.getHashValueForPages(p.ownPages));console.log("Checksum theirPages",d.getHashValueForPages(p.theirPages));console.log("diff ownPages/theirPages",-d.diffPages(p.ownPages,p.theirPages));var q=p.getShadowPages();null!=q&&(console.log("Checksum shadowPages",d.getHashValueForPages(q)),console.log("diff shadowPages/ownPages",d.diffPages(q,p.ownPages)),console.log("diff ownPages/shadowPages",d.diffPages(p.ownPages,q)),console.log("diff theirPages/shadowPages",d.diffPages(p.theirPages,q)));null!=p.sync&&null!=p.sync.snapshot&&(console.log("Checksum snapshot",d.getHashValueForPages(p.sync.snapshot)),console.log("diff ownPages/snapshot",d.diffPages(p.ownPages,-p.sync.snapshot)),console.log("diff theirPages/snapshot",d.diffPages(p.theirPages,p.sync.snapshot)),null!=d.pages&&console.log("diff snapshot/actualPages",d.diffPages(p.sync.snapshot,d.pages)));null!=d.pages&&(console.log("diff ownPages/actualPages",d.diffPages(p.ownPages,d.pages)),console.log("diff theirPages/actualPages",d.diffPages(p.theirPages,d.pages)))}null!=p&&console.log("Shadow pages",[d.getXmlForPages(p.getShadowPages())]);null!=d.pages&&console.log("Checksum actualPages",d.getHashValueForPages(d.pages))}));-d.actions.addAction("testFixPages",mxUtils.bind(this,function(){console.log("editorUi",d);var p=d.getCurrentFile();null!=p&&p.isRealtime()&&null!=p.shadowPages&&(console.log("patching actualPages to shadowPages",p.patch([d.diffPages(p.shadowPages,d.pages)])),p.ownPages=d.clonePages(d.pages),p.theirPages=d.clonePages(d.pages),p.shadowPages=d.clonePages(d.pages),null!=p.sync&&(p.sync.snapshot=d.clonePages(d.pages)))}));d.actions.addAction("testOptimize",mxUtils.bind(this,function(){t.model.beginUpdate();-try{var p=t.model.cells,q=0,G=[],E=[],H;for(H in p){var M=p[H],L=t.getCurrentCellStyle(M)[mxConstants.STYLE_IMAGE];null!=L&&"data:"==L.substring(0,5)&&(null==G[L]&&(G[L]=(G[L]||0)+1,q++),E.push(M))}t.setCellStyles(mxConstants.STYLE_IMAGE,null,E);console.log("Removed",q,"image(s) from",E.length,"cell(s): ",[E,G])}finally{t.model.endUpdate()}}));d.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(d,t.getModel())}));d.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var p=-new mxImageExport,q=t.getGraphBounds(),G=t.view.scale,E=mxUtils.createXmlDocument(),H=E.createElement("output");E.appendChild(H);E=new mxXmlCanvas2D(H);E.translate(Math.floor((1-q.x)/G),Math.floor((1-q.y)/G));E.scale(1/G);var M=0,L=E.save;E.save=function(){M++;L.apply(this,arguments)};var k=E.restore;E.restore=function(){M--;k.apply(this,arguments)};var y=p.drawShape;p.drawShape=function(F){mxLog.debug("entering shape",F,M);y.apply(this,arguments);mxLog.debug("leaving shape",F,M)};p.drawState(t.getView().getState(t.model.root),-E);mxLog.show();mxLog.debug(mxUtils.getXml(H));mxLog.debug("stateCounter",M)}));d.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-2});var c=null,e=null,g=null,l=null,n=null,u=null,z=null,D=null;d.actions.addAction("testPerformance",mxUtils.bind(this,function(){null!=c?(t.view.revalidate=c,c=null):(c=t.view.revalidate,t.view.revalidate=function(){var p=Date.now(),q=c.apply(this,arguments);EditorUi.debug("[Performance] mxGraphView.revalidate",-[this],"time",Date.now()-p+" ms","args",arguments);return q});null!=e?(d.selectPage=e,e=null):(e=d.selectPage,d.selectPage=function(){var p=Date.now(),q=e.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.selectPage",[this],"time",Date.now()-p+" ms","args",arguments);return q});null!=g?(d.diffPages=g,g=null):(g=d.diffPages,d.diffPages=function(){var p=Date.now(),q=g.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.diffPages",[this],"time",Date.now()-p+" ms","args",arguments);-return q});null!=l?(d.patchPages=l,l=null):(l=d.patchPages,d.patchPages=function(){var p=Date.now(),q=l.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.patchPages",[this],"time",Date.now()-p+" ms","args",arguments);return q});null!=n?(d.clonePages=n,n=null):(n=d.clonePages,d.clonePages=function(){var p=Date.now(),q=n.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.clonePages",[this],"time",Date.now()-p+" ms","args",arguments);return q});null!=z?(d.getHashValueForPages=z,-z=null):(z=d.getHashValueForPages,d.getHashValueForPages=function(){var p=Date.now(),q=z.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getHashValueForPages",[this],"time",Date.now()-p+" ms","args",arguments);return q});null!=D?(d.resolveCrossReferences=D,D=null):(D=d.resolveCrossReferences,d.resolveCrossReferences=function(){var p=Date.now(),q=D.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.resolveCrossReferences",[this],"time",Date.now()-p+" ms","args",arguments);return q});-null!=u?(d.getFileData=u,u=null):(u=d.getFileData,d.getFileData=function(){var p=Date.now(),q=u.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getFileData",[this],"time",Date.now()-p+" ms","args",arguments);return q});EditorUi.debug("[Performance]",null!=c?"Enabled":"Disabled")}));this.put("testDevelop",new Menu(mxUtils.bind(this,function(p,q){this.addMenuItems(p,"createSidebarEntry showBoundingBox - testCheckPages testChecksum testFixPages - testCheckFile testDiff - testInspect testOptimize - testXmlImageExport -".split(" "),-q);var G=p.addItem(mxResources.get("testPerformance"),null,function(){d.actions.get("testPerformance").funct()},q);null!=c&&p.addCheckmark(G,Editor.checkmarkImage);this.addMenuItems(p,["-","testShowConsole"],q)})))}d.actions.put("shapes",new Action("moreShapes...",function(p){mxClient.IS_CHROMEAPP||!d.isOffline()?d.showDialog((new MoreShapesDialog(d,!0)).container,640,isLocalStorage?mxClient.IS_IOS?480:460:440,!0,!0):d.showDialog((new MoreShapesDialog(d,!1)).container,360,isLocalStorage?mxClient.IS_IOS?-300:280:260,!0,!0)}));d.actions.put("createShape",new Action("shape...",function(p){t.isEnabled()&&(p=new mxCell("",new mxGeometry(0,0,120,120),d.defaultCustomShapeStyle),p.vertex=!0,p=new EditShapeDialog(d,p,mxResources.get("editShape")+":",630,400),d.showDialog(p.container,640,480,!0,!1),p.init())})).isEnabled=x;d.actions.put("embedHtml",new Action("html...",function(){d.getPublicUrl(d.getCurrentFile(),function(p){d.showHtmlDialog(mxResources.get("create"),"https://www.drawio.com/doc/faq/embed-html-options",-p,function(q,G,E,H,M,L,k,y,F,K,P,R){d.createHtml(q,G,E,H,M,L,k,y,F,K,P,mxUtils.bind(this,function(T,V){var W=new EmbedDialog(d,"\x3c!-- "+d.editor.appName+" diagram --\x3e\n"+T+"\n"+V+"\n",null,null,function(){var X=window.open(),Z=X.document;if(null!=Z){"CSS1Compat"===document.compatMode&&Z.writeln("<!DOCTYPE html>");Z.writeln("<html>");Z.writeln("<head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head>');Z.writeln("<body>");Z.writeln(T);var Y=mxClient.IS_IE||-mxClient.IS_EDGE||null!=document.documentMode;Y&&Z.writeln(V);Z.writeln("</body>");Z.writeln("</html>");Z.close();if(!Y){var da=X.document.createElement("div");da.marginLeft="26px";da.marginTop="26px";mxUtils.write(da,mxResources.get("updatingDocument"));Y=X.document.createElement("img");Y.setAttribute("src",window.location.protocol+"//"+window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");Y.style.marginLeft="6px";da.appendChild(Y);X.document.body.insertBefore(da,X.document.body.firstChild);window.setTimeout(function(){var ea=-document.createElement("script");ea.type="text/javascript";ea.src=/<script.*?src="(.*?)"/.exec(V)[1];Z.body.appendChild(ea);da.parentNode.removeChild(da)},20)}}else d.handleError({message:mxResources.get("errorUpdatingPreview")})});d.showDialog(W.container,450,240,!0,!0);W.init()}),R)})})}));d.actions.put("liveImage",new Action("Live image...",function(){var p=d.getCurrentFile();null!=p&&d.getPublicUrl(p,function(q){null!=q?(q=new EmbedDialog(d,'<img src="'+(p.constructor!=DriveFile?q:"https://drive.google.com/uc?id="+-p.getId())+'"/>'),d.showDialog(q.container,450,240,!0,!0),q.init()):d.handleError({message:mxResources.get("invalidPublicUrl")})})}));d.actions.put("embedImage",new Action("image...",function(){d.showEmbedImageDialog(function(p,q,G,E,H,M){d.spinner.spin(document.body,mxResources.get("loading"))&&d.createEmbedImage(p,q,G,E,H,M,function(L){d.spinner.stop();L=new EmbedDialog(d,L);d.showDialog(L.container,450,240,!0,!0);L.init()},function(L){d.spinner.stop();d.handleError(L)})},mxResources.get("image"),-mxResources.get("retina"),d.isExportToCanvas())}));d.actions.put("embedSvg",new Action("formatSvg...",function(){d.showEmbedImageDialog(function(p,q,G,E,H,M){d.spinner.spin(document.body,mxResources.get("loading"))&&d.createEmbedSvg(p,q,G,E,H,M,function(L){d.spinner.stop();L=new EmbedDialog(d,L);d.showDialog(L.container,450,240,!0,!0);L.init()},function(L){d.spinner.stop();d.handleError(L)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://www.drawio.com/doc/faq/embed-svg.html")}));-d.actions.put("embedIframe",new Action("iframe...",function(){d.getPublicUrl(d.getCurrentFile(),function(p){var q=t.getGraphBounds();d.showPublishLinkDialog(mxResources.get("iframe"),"100%",Math.ceil(Math.max(100,q.height/t.view.scale))+2,null,null,null,p,d.getCurrentFile(),function(G,E,H,M,L,k,y,F,K,P,R,T){var V=[];K&&V.push("tags=%7B%7D");G=new EmbedDialog(d,'<iframe frameborder="0" style="width:'+y+";height:"+F+';" src="'+d.createLink(G,E,!0,M,L,k,"public"==P?p:null,null,V,null,H,R,T)+'"'+(R?' allowtransparency="true"':-"")+"></iframe>");d.showDialog(G.container,450,240,!0,!0);G.init()},!0,!0)})}));d.actions.put("embedNotion",new Action("notion...",function(){var p=document.createElement("div");p.style.position="absolute";p.style.bottom="30px";p.style.textAlign="center";p.style.width="100%";p.style.left="0px";var q=document.createElement("a");q.setAttribute("href","javascript:void(0);");q.setAttribute("target","_blank");q.style.cursor="pointer";mxUtils.write(q,mxResources.get("getNotionChromeExtension"));p.appendChild(q);+EditorUi.VERSION,function(p,q){d.isOwnDomain()&&mxEvent.isShiftDown(q)&&("1"==urlParams.test?(EditorUi.debug("Debug output disabled"),urlParams.test="0"):(urlParams.test="1",EditorUi.debug("Debug output enabled")))}));d.actions.addAction("support...",function(){EditorUi.isElectronApp?d.openLink("https://github.com/jgraph/drawio-desktop/wiki/Getting-Support"):d.openLink("https://github.com/jgraph/drawio/wiki/Getting-Support")});d.actions.addAction("exportOptionsDisabled...",function(){d.handleError({message:mxResources.get("exportOptionsDisabledDetails")},+mxResources.get("exportOptionsDisabled"))});d.actions.addAction("keyboardShortcuts...",function(){!mxClient.IS_SVG||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?d.openLink("https://viewer.diagrams.net/#Uhttps%3A%2F%2Fviewer.diagrams.net%2Fshortcuts.svg"):d.openLink("shortcuts.svg")});d.actions.addAction("feedback...",function(){var p=new FeedbackDialog(d);d.showDialog(p.container,610,360,!0,!1);p.init()});d.actions.addAction("quickStart...",function(){"ac.draw.io"===window.location.hostname?d.openLink("https://www.youtube.com/watch?v=s5BG0705MHU"):+d.openLink("https://www.youtube.com/watch?v=Z0D96ZikMkc")});v=d.actions.addAction("tags",mxUtils.bind(this,function(){null==this.tagsWindow?(this.tagsWindow=new TagsWindow(d,document.body.offsetWidth-400,60,212,200),this.tagsWindow.window.addListener("show",mxUtils.bind(this,function(){d.fireEvent(new mxEventObject("tags"))})),this.tagsWindow.window.addListener("hide",function(){d.fireEvent(new mxEventObject("tags"))}),this.tagsWindow.window.setVisible(!0),d.fireEvent(new mxEventObject("tags"))):+this.tagsWindow.window.setVisible(!this.tagsWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+K");v.setToggleAction(!0);v.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&&this.tagsWindow.window.isVisible()}));null==Editor.gptApiKey||null==Editor.gptModel||null==Editor.gptUrl||d.isOffline()||EditorUi.isElectronApp||(v=d.actions.addAction("chatWindowTitle",mxUtils.bind(this,function(){null==this.chatWindow?(this.chatWindow=new ChatWindow(d,220,document.body.offsetHeight-+380,250,320),this.chatWindow.window.addListener("show",mxUtils.bind(this,function(){d.fireEvent(new mxEventObject("chat"))})),this.chatWindow.window.addListener("hide",function(){d.fireEvent(new mxEventObject("chat"))}),this.chatWindow.window.setVisible(!0),d.fireEvent(new mxEventObject("chat"))):this.chatWindow.window.setVisible(!this.chatWindow.window.isVisible())})),v.setToggleAction(!0),v.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.chatWindow&&this.chatWindow.window.isVisible()})));+v=d.actions.addAction("findReplace",mxUtils.bind(this,function(p,q){var G=(p=t.isEnabled()&&(null==q||!mxEvent.isShiftDown(q)))?"findReplace":"find";q=G+"Window";if(null==this[q]){var E="min"==Editor.currentTheme||"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,H=p?E?330:300:240;this[q]=new FindWindow(d,document.body.offsetWidth-(H+20),100,H,p?E?304:288:170,p);this[q].window.addListener("show",function(){d.fireEvent(new mxEventObject(G))});this[q].window.addListener("hide",function(){d.fireEvent(new mxEventObject(G))})}this[q].window.setVisible(!0);+this[q].focus()}),null,null,Editor.ctrlKey+"+F");v=new Action("exportVsdx",function(){var p=null==d.pages||1>=d.pages.length;if(p)d.exportVisio();else{var q=document.createElement("div");q.style.whiteSpace="nowrap";var G=document.createElement("h3");mxUtils.write(G,mxResources.get("formatVsdx"));G.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";q.appendChild(G);var E=d.addCheckbox(q,mxResources.get("allPages"),!p,p);E.style.marginBottom="16px";p=new CustomDialog(d,q,+mxUtils.bind(this,function(){d.exportVisio(!E.checked)}),null,mxResources.get("export"));d.showDialog(p.container,300,130,!0,!0)}});v.getTitle=function(){return mxResources.get("formatVsdx")+" (beta)..."};d.actions.put("exportVsdx",v);isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed&&d.actions.addAction("configuration...",function(){var p=document.createElement("input");p.setAttribute("type","checkbox");p.style.marginRight="8px";p.checked=mxSettings.getShowStartScreen();p.defaultChecked=p.checked;+if(Editor.isSettingsEnabled()&&("sketch"==Editor.currentTheme||"simple"==Editor.currentTheme||"min"==Editor.currentTheme)){var q=document.createElement("span");q.style.display="flex";q.style.alignItems="center";q.style.cssFloat="right";q.style.cursor="pointer";q.style.userSelect="none";q.style.marginTop="-3px";q.appendChild(p);mxUtils.write(q,mxResources.get("showStartScreen"));mxEvent.addListener(q,"click",function(E){mxEvent.getSource(E)!=p&&(p.checked=!p.checked)});header=q}q=[[mxResources.get("reset"),+function(){d.confirm(mxResources.get("areYouSure"),function(){try{localStorage.removeItem(Editor.configurationKey),d.hideDialog(),d.alert(mxResources.get("restartForChangeRequired"))}catch(E){d.handleError(E)}})}]];if(!d.isOfflineApp()&&isLocalStorage&&d.mode!=App.MODE_ATLAS){var G=d.actions.get("plugins");null==G||"sketch"!=Editor.currentTheme&&"simple"!=Editor.currentTheme&&"min"!=Editor.currentTheme||q.push([mxResources.get("plugins"),G.funct])}EditorUi.isElectronApp||q.push([mxResources.get("link"),+function(E,H){if(0<H.value.length)try{var L=JSON.parse(H.value),K=window.location.protocol+"//"+window.location.host+"/"+d.getSearch()+"#_CONFIG_"+Graph.compress(JSON.stringify(L)),k=new EmbedDialog(d,K);d.showDialog(k.container,450,240,!0);k.init()}catch(y){d.handleError(y)}else d.handleError({message:mxResources.get("invalidInput")})}]);"atlassian"!=d.getServiceName()&&"1"!=urlParams.embed&&q.push([mxResources.get("preferences"),function(){d.showLocalStorageDialog(mxResources.get("preferences")++":",Editor.settingsKey,[[mxResources.get("reset"),function(){d.confirm(mxResources.get("areYouSure"),function(){try{localStorage.removeItem(Editor.settingsKey),localStorage.removeItem(".drawio-config"),d.hideDialog(),d.alert(mxResources.get("restartForChangeRequired"))}catch(E){d.handleError(E)}})}]])}]);d.showLocalStorageDialog(mxResources.get("configuration")+":",Editor.configurationKey,q,p.parentNode,"https://www.drawio.com/doc/faq/configure-diagram-editor",function(){null!=p.parentNode&&(mxSettings.setShowStartScreen(p.checked),+mxSettings.save())})});(mxClient.IS_CHROMEAPP||isLocalStorage)&&this.put("language",new Menu(mxUtils.bind(this,function(p,q){var G=mxLanguage;null==urlParams.lang&&isLocalStorage&&(G=mxSettings.settings.language);var E=mxUtils.bind(this,function(L){var K=""==L?mxResources.get("automatic"):mxLanguageMap[L],k=null;""!=K&&(k=p.addItem(K,null,mxUtils.bind(this,function(){d.setAndPersistLanguage(L)}),q),(L==G||""==L&&null==G)&&p.addCheckmark(k,Editor.checkmarkImage));return k});E("");p.addSeparator(q);+for(var H in mxLanguageMap)E(H)})));d.customLayoutConfig=[{layout:"mxHierarchicalLayout",config:{orientation:"west",intraCellSpacing:30,interRankCellSpacing:100,interHierarchySpacing:60,parallelEdgeSpacing:10}}];d.actions.addAction("runLayout",function(){d.showCustomLayoutDialog(JSON.stringify(d.customLayoutConfig,null,2))});d.actions.put("adaptiveColors",new Action("adaptiveColors",function(p){null==d.adaptiveColorsWindow&&(d.adaptiveColorsWindow=new AdaptiveColorsWindow(d,document.body.offsetWidth-+520,80,200,160));d.adaptiveColorsWindow.window.setVisible(!0)}));v=this.get("viewZoom");var J=v.funct;v.funct=mxUtils.bind(this,function(p,q){J.apply(this,arguments);"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||this.addMenuItems(p,["-","outline","fullscreen"],q)});v=this.get("layout");var N=v.funct;v.funct=function(p,q){N.apply(this,arguments);p.addItem(mxResources.get("orgChart"),null,function(){var G=null,E=20,H=20,L=function(){"undefined"!==typeof mxOrgChartLayout&&null!=G&&d.tryAndHandle(mxUtils.bind(this,+function(){var T=d.editor.graph,V=new mxOrgChartLayout(T,G,E,H),W=T.getDefaultParent();1<T.model.getChildCount(T.getSelectionCell())&&(W=T.getSelectionCell());V.execute(W)}))},K=document.createElement("div"),k=document.createElement("div");k.style.marginTop="6px";k.style.display="inline-block";k.style.width="180px";mxUtils.write(k,mxResources.get("orgChartType")+": ");K.appendChild(k);var y=document.createElement("select");y.style.width="160px";y.style.boxSizing="border-box";k=[mxResources.get("linear"),+mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")];for(var F=0;F<k.length;F++){var M=document.createElement("option");mxUtils.write(M,k[F]);M.value=F;2==F&&M.setAttribute("selected","selected");y.appendChild(M)}mxEvent.addListener(y,"change",function(){G=y.value});K.appendChild(y);k=document.createElement("div");k.style.marginTop="6px";k.style.display=+"inline-block";k.style.width="180px";mxUtils.write(k,mxResources.get("parentChildSpacing")+": ");K.appendChild(k);var P=document.createElement("input");P.type="number";P.value=E;P.style.width="160px";P.style.boxSizing="border-box";K.appendChild(P);mxEvent.addListener(P,"change",function(){E=P.value});k=document.createElement("div");k.style.marginTop="6px";k.style.display="inline-block";k.style.width="180px";mxUtils.write(k,mxResources.get("siblingSpacing")+": ");K.appendChild(k);var R=document.createElement("input");+R.type="number";R.value=H;R.style.width="160px";R.style.boxSizing="border-box";K.appendChild(R);mxEvent.addListener(R,"change",function(){H=R.value});k=mxUtils.button(mxResources.get("custom")+"...",function(){var T=[{layout:"mxOrgChartLayout",config:{branchOptimizer:parseInt(y.value),parentChildSpacing:parseInt(P.value),siblingSpacing:parseInt(R.value)}}];d.hideDialog();d.showCustomLayoutDialog(JSON.stringify(T,null,2))});k.className="geBtn";K=new CustomDialog(d,K,function(){null==G&&(G=2);d.loadOrgChartLayouts(L)},+null,null,null,k);d.showDialog(K.container,355,140,!0,!0)},q,null,x());p.addSeparator(q);p.addItem(mxResources.get("parallels"),null,mxUtils.bind(this,function(){d.tryAndHandle(mxUtils.bind(this,function(){var G=new mxParallelEdgeLayout(t);G.checkOverlap=!0;d.prompt(mxResources.get("spacing"),G.spacing,mxUtils.bind(this,function(E){d.tryAndHandle(mxUtils.bind(this,function(){G.spacing=E;d.executeLayout(function(){G.execute(t.getDefaultParent(),t.isSelectionEmpty()?null:t.getSelectionCells())},!1)}))}))}))}),+q);p.addSeparator(q);d.menus.addMenuItem(p,"runLayout",q,null,null,mxResources.get("custom")+"...")};this.put("help",new Menu(mxUtils.bind(this,function(p,q){if(!mxClient.IS_CHROMEAPP&&d.isOffline())this.addMenuItems(p,["keyboardShortcuts","-","about"],q);else{var G=p.addItem("Search:",null,null,q,null,null,!1);G.style.cursor="default";var E=document.createElement("input");E.setAttribute("type","text");E.setAttribute("size","25");E.style.borderWidth="1px";E.style.marginLeft="8px";mxEvent.addListener(E,+"keydown",mxUtils.bind(this,function(H){var L=mxUtils.trim(E.value);13==H.keyCode&&0<L.length?(this.editorUi.openLink("https://www.drawio.com/search?src="+(EditorUi.isElectronApp?"DESKTOP":encodeURIComponent(location.host))+"&search="+encodeURIComponent(L)),E.value="",EditorUi.logEvent({category:"SEARCH-HELP",action:"search",label:L}),window.setTimeout(mxUtils.bind(this,function(){this.editorUi.hideCurrentMenu()}),0)):27==H.keyCode&&(E.value="")}));G.firstChild.nextSibling.appendChild(E);mxEvent.addGestureListeners(E,+function(H){document.activeElement!=E&&E.focus();mxEvent.consume(H)},function(H){mxEvent.consume(H)},function(H){mxEvent.consume(H)});window.setTimeout(function(){E.focus()},0);EditorUi.isElectronApp?(d.actions.addAction("website...",function(){d.openLink("https://www.drawio.com")}),d.actions.addAction("check4Updates",function(){d.checkForUpdates()}),d.actions.put("desktopZoomIn",new Action("zoomIn",function(){d.desktopZoomIn()})),d.actions.put("desktopZoomOut",new Action("zoomOut",function(){d.desktopZoomOut()})),+d.actions.put("desktopResetZoom",new Action("actualSize",function(){d.desktopResetZoom()})),this.addMenuItems(p,"- keyboardShortcuts quickStart website support -".split(" "),q),"1"!=urlParams.disableUpdate&&this.addMenuItems(p,["check4Updates","-"],q),this.addMenuItems(p,"desktopResetZoom desktopZoomIn desktopZoomOut - openDevTools - about".split(" "),q)):this.addMenuItems(p,"- keyboardShortcuts quickStart support - about".split(" "),q)}"1"==urlParams.test&&(p.addSeparator(q),this.addSubmenu("testDevelop",+p,q))})));d.actions.addAction("languageCode...",function(){var p=new FilenameDialog(d,Graph.diagramLanguage||"",mxResources.get("ok"),mxUtils.bind(this,function(q){null!=q&&(Graph.diagramLanguage=0<q.length?q:null,Graph.translateDiagram=!0,t.refresh())}),mxResources.get("languageCode"),null,null,"https://www.drawio.com/blog/translate-diagrams");d.showDialog(p.container,340,80,!0,!0);p.init()});this.put("diagramLanguage",new Menu(mxUtils.bind(this,function(p,q){this.addMenuItems(p,["languageCode",+"-"],q);q=p.addItem(mxResources.get("disabled"),null,function(){Graph.translateDiagram=!1;t.refresh()},q);Graph.translateDiagram||p.addCheckmark(q,Editor.checkmarkImage)})));if("1"==urlParams.test){mxResources.parse("testDevelop=Develop");mxResources.parse("showBoundingBox=Show bounding box");mxResources.parse("createSidebarEntry=Create Sidebar Entry");mxResources.parse("testCheckFile=Check File");mxResources.parse("testDiff=Diff/Sync");mxResources.parse("testChecksum=Checksum");mxResources.parse("testCheckPages=Check Pages");+mxResources.parse("testFixPages=Fix Pages");mxResources.parse("testInspect=Inspect");mxResources.parse("testShowConsole=Show Console");mxResources.parse("testXmlImageExport=XML Image Export");mxResources.parse("testOptimize=Remove Inline Images");mxResources.parse("testPerformance=Performance");d.actions.addAction("createSidebarEntry",mxUtils.bind(this,function(){if(!t.isSelectionEmpty()){var p=t.cloneCells(t.getSelectionCells()),q=t.getBoundingBoxFromGeometry(p,!0);p=t.moveCells(p,-q.x,-q.y);d.showTextDialog("Create Sidebar Entry",+"this.addDataEntry('tag1 tag2', "+q.width+", "+q.height+", 'The Title', '"+Graph.compress(mxUtils.getXml(t.encodeCells(p)))+"'),")}}));d.actions.addAction("showBoundingBox",mxUtils.bind(this,function(){function p(K){return null==K||null==K.boundingBox||!isNaN(K.boundingBox.x)&&!isNaN(K.boundingBox.y)&&!isNaN(K.boundingBox.width)&&!isNaN(K.boundingBox.height)}var q=t.isSelectionEmpty()?t.getGraphBounds():t.getBoundingBox(t.getSelectionCells()),G=t.view.translate,E=t.view.scale;t.insertVertex(t.getDefaultParent(),+null,"",q.x/E-G.x,q.y/E-G.y,q.width/E,q.height/E,"fillColor=none;strokeColor=red;");var H=0,L=0;t.view.states.visit(function(K,k){K=!0;p(k.shape)||(console.log("invalid shape",k.cell.id,k.shape),K=!1);p(k.text)||(console.log("invalid text",k.cell.id,k.text),K=!1);K||H++;L++});console.log("states checked",L,"invalid",H)}));d.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var p=null!=d.pages&&null!=d.getCurrentFile()?d.getCurrentFile().getAnonymizedXmlForPages(d.pages):"";p=new TextareaDialog(d,+"Paste Data:",p,function(q){if(0<q.length)try{var G=function(k){function y(Z){if(null==Y[Z]){if(Y[Z]=!0,null!=P[Z]){for(;0<P[Z].length;){var da=P[Z].pop();y(da)}delete P[Z]}}else mxLog.debug(F+": Visited: "+Z)}var F=k.parentNode.id,M=k.childNodes;k={};for(var P={},R=null,T={},V=0;V<M.length;V++){var W=M[V];if(null!=W.id&&0<W.id.length)if(null==k[W.id]){k[W.id]=W.id;var X=W.getAttribute("parent");null==X?null!=R?mxLog.debug(F+": Multiple roots: "+W.id):R=W.id:(null==P[X]&&(P[X]=[]),P[X].push(W.id))}else T[W.id]=+W.id}M=Object.keys(T);0<M.length?(M=F+": "+M.length+" Duplicates: "+M.join(", "),mxLog.debug(M+" (see console)")):mxLog.debug(F+": Checked");var Y={};null==R?mxLog.debug(F+": No root"):(y(R),Object.keys(Y).length!=Object.keys(k).length&&(mxLog.debug(F+": Invalid tree: (see console)"),console.log(F+": Invalid tree",P)))};"<"!=q.charAt(0)&&(q=Graph.decompress(q),mxLog.debug("See console for uncompressed XML"),console.log("xml",q));var E=mxUtils.parseXml(q),H=d.getPagesForNode(E.documentElement,"mxGraphModel");+if(null!=H&&0<H.length)try{var L=d.getHashValueForPages(H);mxLog.debug("Checksum: ",L)}catch(k){mxLog.debug("Error: ",k.message)}else mxLog.debug("No pages found for checksum");var K=E.getElementsByTagName("root");for(q=0;q<K.length;q++)G(K[q]);mxLog.show()}catch(k){d.handleError(k),null!=window.console&&console.error(k)}});d.showDialog(p.container,620,460,!0,!0);p.init()}));var I=null;d.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=d.pages){var p=new TextareaDialog(d,"Diff/Sync:",+"",function(q){var G=d.getCurrentFile();if(0<q.length&&null!=G)try{var E=JSON.parse(q);G.patch([E],null,!0,!0);d.hideDialog()}catch(H){d.handleError(H)}},null,"Close",null,null,null,!0,null,"Patch",null,[["Snapshot",function(q,G){I=d.getPagesForXml(d.getFileData(!0));p.textarea.value="Snapshot updated "+(new Date).toLocaleString()+" Checksum "+d.getHashValueForPages(I)}],["Diff",function(q,G){try{p.textarea.value=JSON.stringify(d.diffPages(I,d.pages),null,2)}catch(E){d.handleError(E)}}]]);null==I?+(I=d.getPagesForXml(d.getFileData(!0)),p.textarea.value="Snapshot created "+(new Date).toLocaleString()+" Checksum "+d.getHashValueForPages(I)):p.textarea.value=JSON.stringify(d.diffPages(I,d.pages),null,2);d.showDialog(p.container,620,460,!0,!0);p.init()}else d.alert("No pages")}));d.actions.addAction("testChecksum",mxUtils.bind(this,function(){var p=d.getCurrentFile();null!=d.pages&&null!=p?d.spinner.spin(document.body,mxResources.get("loading"))&&p.getLatestVersion(function(q){d.spinner.stop();+var G=d.getHashValueForPages(d.pages),E=p.getCurrentRevisionId(),H=d.getHashValueForPages(q.getShadowPages()),L=q.getDescriptorChecksum(q.getDescriptor()),K=q.getCurrentRevisionId();console.log("Local File",[p],"modified",p.isModified(),"checksum",G);console.log("Remote File",[q],"rev",K==E,"desc",L==H,"checksum",H);d.alert("Checksums "+(H==G?"match":"no not match"))},function(q){console.log("Error getLatestVersion",q);d.handleError(q)}):console.log("Checksum: no file or pages")}));d.actions.addAction("testCheckPages",+mxUtils.bind(this,function(){var p=d.getCurrentFile();console.log("editorUi",d,"file",p);if(null!=p&&p.isRealtime()){console.log("Checksum ownPages",d.getHashValueForPages(p.ownPages));console.log("Checksum theirPages",d.getHashValueForPages(p.theirPages));console.log("diff ownPages/theirPages",d.diffPages(p.ownPages,p.theirPages));var q=p.getShadowPages();null!=q&&(console.log("Checksum shadowPages",d.getHashValueForPages(q)),console.log("diff shadowPages/ownPages",d.diffPages(q,p.ownPages)),console.log("diff ownPages/shadowPages",+d.diffPages(p.ownPages,q)),console.log("diff theirPages/shadowPages",d.diffPages(p.theirPages,q)));null!=p.sync&&null!=p.sync.snapshot&&(console.log("Checksum snapshot",d.getHashValueForPages(p.sync.snapshot)),console.log("diff ownPages/snapshot",d.diffPages(p.ownPages,p.sync.snapshot)),console.log("diff theirPages/snapshot",d.diffPages(p.theirPages,p.sync.snapshot)),null!=d.pages&&console.log("diff snapshot/actualPages",d.diffPages(p.sync.snapshot,d.pages)));null!=d.pages&&(console.log("diff ownPages/actualPages",+d.diffPages(p.ownPages,d.pages)),console.log("diff theirPages/actualPages",d.diffPages(p.theirPages,d.pages)))}null!=p&&console.log("Shadow pages",[d.getXmlForPages(p.getShadowPages())]);null!=d.pages&&console.log("Checksum actualPages",d.getHashValueForPages(d.pages))}));d.actions.addAction("testFixPages",mxUtils.bind(this,function(){console.log("editorUi",d);var p=d.getCurrentFile();null!=p&&p.isRealtime()&&null!=p.shadowPages&&(console.log("patching actualPages to shadowPages",p.patch([d.diffPages(p.shadowPages,+d.pages)])),p.ownPages=d.clonePages(d.pages),p.theirPages=d.clonePages(d.pages),p.shadowPages=d.clonePages(d.pages),null!=p.sync&&(p.sync.snapshot=d.clonePages(d.pages)))}));d.actions.addAction("testOptimize",mxUtils.bind(this,function(){t.model.beginUpdate();try{var p=t.model.cells,q=0,G=[],E=[],H;for(H in p){var L=p[H],K=t.getCurrentCellStyle(L)[mxConstants.STYLE_IMAGE];null!=K&&"data:"==K.substring(0,5)&&(null==G[K]&&(G[K]=(G[K]||0)+1,q++),E.push(L))}t.setCellStyles(mxConstants.STYLE_IMAGE,null,+E);console.log("Removed",q,"image(s) from",E.length,"cell(s): ",[E,G])}finally{t.model.endUpdate()}}));d.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(d,t.getModel())}));d.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var p=new mxImageExport,q=t.getGraphBounds(),G=t.view.scale,E=mxUtils.createXmlDocument(),H=E.createElement("output");E.appendChild(H);E=new mxXmlCanvas2D(H);E.translate(Math.floor((1-q.x)/G),Math.floor((1-q.y)/G));E.scale(1/G);var L=+0,K=E.save;E.save=function(){L++;K.apply(this,arguments)};var k=E.restore;E.restore=function(){L--;k.apply(this,arguments)};var y=p.drawShape;p.drawShape=function(F){mxLog.debug("entering shape",F,L);y.apply(this,arguments);mxLog.debug("leaving shape",F,L)};p.drawState(t.getView().getState(t.model.root),E);mxLog.show();mxLog.debug(mxUtils.getXml(H));mxLog.debug("stateCounter",L)}));d.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=+mxPopupMenu.prototype.zIndex-2});var c=null,e=null,g=null,l=null,n=null,u=null,z=null,D=null;d.actions.addAction("testPerformance",mxUtils.bind(this,function(){null!=c?(t.view.revalidate=c,c=null):(c=t.view.revalidate,t.view.revalidate=function(){var p=Date.now(),q=c.apply(this,arguments);EditorUi.debug("[Performance] mxGraphView.revalidate",[this],"time",Date.now()-p+" ms","args",arguments);return q});null!=e?(d.selectPage=e,e=null):(e=d.selectPage,d.selectPage=function(){var p=Date.now(),q=e.apply(this,+arguments);EditorUi.debug("[Performance] EditorUi.selectPage",[this],"time",Date.now()-p+" ms","args",arguments);return q});null!=g?(d.diffPages=g,g=null):(g=d.diffPages,d.diffPages=function(){var p=Date.now(),q=g.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.diffPages",[this],"time",Date.now()-p+" ms","args",arguments);return q});null!=l?(d.patchPages=l,l=null):(l=d.patchPages,d.patchPages=function(){var p=Date.now(),q=l.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.patchPages",+[this],"time",Date.now()-p+" ms","args",arguments);return q});null!=n?(d.clonePages=n,n=null):(n=d.clonePages,d.clonePages=function(){var p=Date.now(),q=n.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.clonePages",[this],"time",Date.now()-p+" ms","args",arguments);return q});null!=z?(d.getHashValueForPages=z,z=null):(z=d.getHashValueForPages,d.getHashValueForPages=function(){var p=Date.now(),q=z.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getHashValueForPages",[this],+"time",Date.now()-p+" ms","args",arguments);return q});null!=D?(d.resolveCrossReferences=D,D=null):(D=d.resolveCrossReferences,d.resolveCrossReferences=function(){var p=Date.now(),q=D.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.resolveCrossReferences",[this],"time",Date.now()-p+" ms","args",arguments);return q});null!=u?(d.getFileData=u,u=null):(u=d.getFileData,d.getFileData=function(){var p=Date.now(),q=u.apply(this,arguments);EditorUi.debug("[Performance] EditorUi.getFileData",+[this],"time",Date.now()-p+" ms","args",arguments);return q});EditorUi.debug("[Performance]",null!=c?"Enabled":"Disabled")}));this.put("testDevelop",new Menu(mxUtils.bind(this,function(p,q){this.addMenuItems(p,"createSidebarEntry showBoundingBox - testCheckPages testChecksum testFixPages - testCheckFile testDiff - testInspect testOptimize - testXmlImageExport -".split(" "),q);var G=p.addItem(mxResources.get("testPerformance"),null,function(){d.actions.get("testPerformance").funct()},q);null!=c&&p.addCheckmark(G,+Editor.checkmarkImage);this.addMenuItems(p,["-","testShowConsole"],q)})))}d.actions.put("shapes",new Action("moreShapes...",function(p){mxClient.IS_CHROMEAPP||!d.isOffline()?d.showDialog((new MoreShapesDialog(d,!0)).container,640,isLocalStorage?mxClient.IS_IOS?480:460:440,!0,!0):d.showDialog((new MoreShapesDialog(d,!1)).container,360,isLocalStorage?mxClient.IS_IOS?300:280:260,!0,!0)}));d.actions.put("createShape",new Action("shape...",function(p){t.isEnabled()&&(p=new mxCell("",new mxGeometry(0,0,+120,120),d.defaultCustomShapeStyle),p.vertex=!0,p=new EditShapeDialog(d,p,mxResources.get("editShape")+":",630,400),d.showDialog(p.container,640,480,!0,!1),p.init())})).isEnabled=x;d.actions.put("embedHtml",new Action("html...",function(){d.getPublicUrl(d.getCurrentFile(),function(p){d.showHtmlDialog(mxResources.get("create"),"https://www.drawio.com/doc/faq/embed-html-options",p,function(q,G,E,H,L,K,k,y,F,M,P,R){d.createHtml(q,G,E,H,L,K,k,y,F,M,P,mxUtils.bind(this,function(T,V){var W=new EmbedDialog(d,+"\x3c!-- "+d.editor.appName+" diagram --\x3e\n"+T+"\n"+V+"\n",null,null,function(){try{var X=window.open();if(null!=X&&null!=X.document){var Y=X.document;"CSS1Compat"===document.compatMode&&Y.writeln("<!DOCTYPE html>");Y.writeln("<html>");Y.writeln("<head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head>');Y.writeln("<body>");Y.writeln(T);var Z=mxClient.IS_IE||mxClient.IS_EDGE||null!=document.documentMode;Z&&Y.writeln(V);Y.writeln("</body>");Y.writeln("</html>");+Y.close();if(!Z){var da=X.document.createElement("div");da.marginLeft="26px";da.marginTop="26px";mxUtils.write(da,mxResources.get("updatingDocument"));var ea=X.document.createElement("img");ea.setAttribute("src",window.location.protocol+"//"+window.location.hostname+"/"+IMAGE_PATH+"/spin.gif");ea.style.marginLeft="6px";da.appendChild(ea);X.document.body.insertBefore(da,X.document.body.firstChild);window.setTimeout(function(){var ka=document.createElement("script");ka.type="text/javascript";ka.src=+/<script.*?src="(.*?)"/.exec(V)[1];Y.body.appendChild(ka);da.parentNode.removeChild(da)},20)}}else d.handleError({message:mxResources.get("errorUpdatingPreview")})}catch(ka){d.handleError(ka)}});d.showDialog(W.container,450,240,!0,!0);W.init()}),R)})})}));d.actions.put("liveImage",new Action("Live image...",function(){var p=d.getCurrentFile();null!=p&&d.getPublicUrl(p,function(q){null!=q?(q=new EmbedDialog(d,'<img src="'+(p.constructor!=DriveFile?q:"https://drive.google.com/uc?id="+p.getId())+'"/>'),+d.showDialog(q.container,450,240,!0,!0),q.init()):d.handleError({message:mxResources.get("invalidPublicUrl")})})}));d.actions.put("embedImage",new Action("image...",function(){d.showEmbedImageDialog(function(p,q,G,E,H,L){d.spinner.spin(document.body,mxResources.get("loading"))&&d.createEmbedImage(p,q,G,E,H,L,function(K){d.spinner.stop();K=new EmbedDialog(d,K);d.showDialog(K.container,450,240,!0,!0);K.init()},function(K){d.spinner.stop();d.handleError(K)})},mxResources.get("image"),mxResources.get("retina"),+d.isExportToCanvas())}));d.actions.put("embedSvg",new Action("formatSvg...",function(){d.showEmbedImageDialog(function(p,q,G,E,H,L){d.spinner.spin(document.body,mxResources.get("loading"))&&d.createEmbedSvg(p,q,G,E,H,L,function(K){d.spinner.stop();K=new EmbedDialog(d,K);d.showDialog(K.container,450,240,!0,!0);K.init()},function(K){d.spinner.stop();d.handleError(K)})},mxResources.get("formatSvg"),mxResources.get("image"),!0,"https://www.drawio.com/doc/faq/embed-svg.html")}));d.actions.put("embedIframe",+new Action("iframe...",function(){d.getPublicUrl(d.getCurrentFile(),function(p){var q=t.getGraphBounds();d.showPublishLinkDialog(mxResources.get("iframe"),"100%",Math.ceil(Math.max(100,q.height/t.view.scale))+2,null,null,null,p,d.getCurrentFile(),function(G,E,H,L,K,k,y,F,M,P,R,T){var V=[];M&&V.push("tags=%7B%7D");G=new EmbedDialog(d,'<iframe frameborder="0" style="width:'+y+";height:"+F+';" src="'+d.createLink(G,E,!0,L,K,k,"public"==P?p:null,null,V,null,H,R,T)+'"'+(R?' allowtransparency="true"':"")++"></iframe>");d.showDialog(G.container,450,240,!0,!0);G.init()},!0,!0)})}));d.actions.put("embedNotion",new Action("notion...",function(){var p=document.createElement("div");p.style.position="absolute";p.style.bottom="30px";p.style.textAlign="center";p.style.width="100%";p.style.left="0px";var q=document.createElement("a");q.setAttribute("href","javascript:void(0);");q.setAttribute("target","_blank");q.style.cursor="pointer";mxUtils.write(q,mxResources.get("getNotionChromeExtension"));p.appendChild(q);mxUtils.setPrefixedStyle(q.style,"transition","all 1s ease");mxUtils.setOpacity(q,0);window.setTimeout(function(){mxUtils.setOpacity(q,100)},300);mxEvent.addListener(q,"click",function(G){d.openLink("https://chrome.google.com/webstore/detail/drawio-for-notion/plhaalebpkihaccllnkdaokdoeaokmle");mxEvent.consume(G)});d.getPublicUrl(d.getCurrentFile(),function(G){d.showPublishLinkDialog(mxResources.get("notion"),null,null,!0,"https://www.drawio.com/blog/drawio-notion",p,G,d.getCurrentFile(),function(E,-H,M,L,k,y,F,K,P,R,T,V){F=["border=0"];P&&F.push("tags=%7B%7D");E=new EmbedDialog(d,d.createLink(E,H,!0,L,k,y,"public"==R?G:null,null,F,null,M,null,V));d.showDialog(E.container,450,240,!0,!0);E.init()},null,!0)})}));d.actions.put("publishLink",new Action("link...",function(){d.getPublicUrl(d.getCurrentFile(),function(p){d.showPublishLinkDialog(null,null,null,null,null,null,p,d.getCurrentFile(),function(q,G,E,H,M,L,k,y,F,K,P,R){k=[];H&&F&&k.push("tags=%7B%7D");q=new EmbedDialog(d,d.createLink(q,G,!0,-H,M,L,"public"==K?p:null,null,k,null,E,null,R));d.showDialog(q.container,450,240,!0,!0);q.init()},null,!0)})}));d.actions.addAction("microsoftOffice...",function(){d.openLink("https://office.draw.io")});d.actions.addAction("googleDocs...",function(){d.openLink("http://docsaddon.draw.io")});d.actions.addAction("googleSlides...",function(){d.openLink("https://slidesaddon.draw.io")});d.actions.addAction("googleSheets...",function(){d.openLink("https://sheetsaddon.draw.io")});d.actions.addAction("googleSites...",+H,L,K,k,y,F,M,P,R,T,V){F=["border=0"];P&&F.push("tags=%7B%7D");E=new EmbedDialog(d,d.createLink(E,H,!0,K,k,y,"public"==R?G:null,null,F,null,L,null,V));d.showDialog(E.container,450,240,!0,!0);E.init()},null,!0)})}));d.actions.put("publishLink",new Action("link...",function(){d.getPublicUrl(d.getCurrentFile(),function(p){d.showPublishLinkDialog(null,null,null,null,null,null,p,d.getCurrentFile(),function(q,G,E,H,L,K,k,y,F,M,P,R){k=[];H&&F&&k.push("tags=%7B%7D");q=new EmbedDialog(d,d.createLink(q,G,!0,+H,L,K,"public"==M?p:null,null,k,null,E,null,R));d.showDialog(q.container,450,240,!0,!0);q.init()},null,!0)})}));d.actions.addAction("microsoftOffice...",function(){d.openLink("https://office.draw.io")});d.actions.addAction("googleDocs...",function(){d.openLink("http://docsaddon.draw.io")});d.actions.addAction("googleSlides...",function(){d.openLink("https://slidesaddon.draw.io")});d.actions.addAction("googleSheets...",function(){d.openLink("https://sheetsaddon.draw.io")});d.actions.addAction("googleSites...",function(){d.getPublicUrl(d.getCurrentFile(),function(p){p=new GoogleSitesDialog(d,p);d.showDialog(p.container,420,256,!0,!0);p.init()})});if(isLocalStorage||mxClient.IS_CHROMEAPP)v=d.actions.addAction("scratchpad",function(){d.toggleScratchpad()}),v.setToggleAction(!0),v.setSelectedCallback(function(){return null!=d.scratchpad}),"0"!=urlParams.plugins&&d.actions.addAction("plugins...",function(){d.showDialog((new PluginsDialog(d)).container,380,240,!0,!1)});window.matchMedia&&null!=document.getElementById("high-contrast-stylesheet")&&(v=d.actions.addAction("highContrast",function(){d.setAndPersistHighContrast(!d.isHighContrast())}),v.setToggleAction(!0),v.setSelectedCallback(function(){return d.isHighContrast()}));v=d.actions.addAction("search",function(){if(null!=d.sidebar){var p=d.sidebar.isEntryVisible("search");d.sidebar.showPalette("search",!p);Editor.isSettingsEnabled()&&(mxSettings.settings.search=!p,mxSettings.save())}});v.label=mxResources.get("searchShapes");v.setToggleAction(!0);v.setSelectedCallback(function(){return null!=d.sidebar&&d.sidebar.isEntryVisible("search")});d.actions.get("clearDefaultStyle").funct=function(p){t.isEnabled()&&(d.clearDefaultStyle(),Editor.sketchMode&&d.setSketchMode(!1))};"1"==urlParams.embed&&(d.actions.get("saveAs").setEnabled(!1),d.actions.get("save").funct=function(p){t.isEditing()&&t.stopEditing();var q="0"!=urlParams.pages||null!=d.pages&&1<d.pages.length?d.getFileData(!0):mxUtils.getXml(d.editor.getGraphXml());if("json"==urlParams.proto){var G=d.createLoadMessage("save");G.xml=q;!0!==@@ -13968,27 +13973,27 @@ p||"1"!=urlParams.saveAndExit&&"1"!=urlParams.publishClose||(G.exit=!0);q=JSON.s"1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),d.actions.addAction("exit",function(){if("1"==urlParams.embedInline)d.sendEmbeddedSvgExport();else{var p=function(){d.editor.modified=!1;var q="json"==urlParams.proto?JSON.stringify({event:"exit",modified:d.editor.modified}):"";(window.opener||window.parent).postMessage(q,"*")};d.editor.modified?d.confirm(mxResources.get("allChangesLost"),null,p,mxResources.get("cancel"),mxResources.get("discardChanges")):p()}},null,null,"1"==urlParams.embedInline?"Escape":null));this.put("exportAs",new Menu(mxUtils.bind(this,function(p,q){d.isExportToCanvas()?(this.addMenuItems(p,["exportPng"],q),d.jpgSupported&&this.addMenuItems(p,["exportJpg"],q),d.webpSupported&&this.addMenuItems(p,["exportWebp"],q)):d.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(p,["exportPng","exportJpg"],q);this.addMenuItems(p,["exportSvg","-"],q);d.isOffline()||d.printPdfExport?this.addMenuItems(p,["exportPdf"],q):d.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(p,["exportPdf"],q);!d.vsdxExportEnabled()||mxClient.IS_IE||"undefined"===typeof VsdxExport&&d.isOffline()||this.addMenuItems(p,["exportVsdx"],q);this.addMenuItems(p,["-","exportHtml","exportXml","exportUrl"],q);d.isOffline()||(p.addSeparator(q),this.addMenuItem(p,"export",q).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...");mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"min"!=Editor.currentTheme||this.addMenuItems(p,["publishLink"],-q);d.mode==App.MODE_ATLAS||"1"==urlParams.extAuth||"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||(p.addSeparator(q),d.menus.addSubmenu("embed",p,q))})));this.put("importFrom",new Menu(mxUtils.bind(this,function(p,q){function G(M){M.pickFile(function(L){d.spinner.spin(document.body,mxResources.get("loading"))&&M.getFile(L,function(k){var y="data:image/"==k.getData().substring(0,11)?H(k.getTitle()):"text/xml";/\.svg$/i.test(k.getTitle())&&!d.editor.isDataSvg(k.getData())&&-(k.setData(Editor.createSvgDataUri(k.getData())),y="image/svg+xml");E(k.getData(),y,k.getTitle())},function(k){d.handleError(k,null!=k?mxResources.get("errorLoadingFile"):null)},M==d.drive)},!0)}var E=mxUtils.bind(this,function(M,L,k){var y=t.view,F=t.getGraphBounds(),K=t.snap(Math.ceil(Math.max(0,F.x/y.scale-y.translate.x)+4*t.gridSize)),P=t.snap(Math.ceil(Math.max(0,(F.y+F.height)/y.scale-y.translate.y)+4*t.gridSize));"data:image/"==M.substring(0,11)?d.loadImage(M,mxUtils.bind(this,function(R){var T=-!0,V=mxUtils.bind(this,function(){d.resizeImage(R,M,mxUtils.bind(this,function(W,X,Z){W=T?Math.min(1,Math.min(d.maxImageSize/X,d.maxImageSize/Z)):1;d.importFile(M,L,K,P,Math.round(X*W),Math.round(Z*W),k,function(Y){d.spinner.stop();t.setSelectionCells(Y);t.scrollCellToVisible(t.getSelectionCell())})}),T)});M.length>d.resampleThreshold?d.confirmImageResize(function(W){T=W;V()}):V()}),mxUtils.bind(this,function(){d.handleError({message:mxResources.get("cannotOpenFile")})})):d.importFile(M,L,K,P,0,0,-k,function(R){d.spinner.stop();t.setSelectionCells(R);t.scrollCellToVisible(t.getSelectionCell())})}),H=mxUtils.bind(this,function(M){var L="text/xml";/\.png$/i.test(M)?L="image/png":/\.jpe?g$/i.test(M)?L="image/jpg":/\.gif$/i.test(M)?L="image/gif":/\.pdf$/i.test(M)&&(L="application/pdf");return L});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=d.drive?p.addItem(mxResources.get("googleDrive")+"...",null,function(){G(d.drive)},q):d.isModeEnabled(App.MODE_GOOGLE)&&p.addItem(mxResources.get("googleDrive")++q);d.mode==App.MODE_ATLAS||"1"==urlParams.extAuth||"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme||(p.addSeparator(q),d.menus.addSubmenu("embed",p,q))})));this.put("importFrom",new Menu(mxUtils.bind(this,function(p,q){function G(L){L.pickFile(function(K){d.spinner.spin(document.body,mxResources.get("loading"))&&L.getFile(K,function(k){var y="data:image/"==k.getData().substring(0,11)?H(k.getTitle()):"text/xml";/\.svg$/i.test(k.getTitle())&&!d.editor.isDataSvg(k.getData())&&+(k.setData(Editor.createSvgDataUri(k.getData())),y="image/svg+xml");E(k.getData(),y,k.getTitle())},function(k){d.handleError(k,null!=k?mxResources.get("errorLoadingFile"):null)},L==d.drive)},!0)}var E=mxUtils.bind(this,function(L,K,k){var y=t.view,F=t.getGraphBounds(),M=t.snap(Math.ceil(Math.max(0,F.x/y.scale-y.translate.x)+4*t.gridSize)),P=t.snap(Math.ceil(Math.max(0,(F.y+F.height)/y.scale-y.translate.y)+4*t.gridSize));"data:image/"==L.substring(0,11)?d.loadImage(L,mxUtils.bind(this,function(R){var T=+!0,V=mxUtils.bind(this,function(){d.resizeImage(R,L,mxUtils.bind(this,function(W,X,Y){W=T?Math.min(1,Math.min(d.maxImageSize/X,d.maxImageSize/Y)):1;d.importFile(L,K,M,P,Math.round(X*W),Math.round(Y*W),k,function(Z){d.spinner.stop();t.setSelectionCells(Z);t.scrollCellToVisible(t.getSelectionCell())})}),T)});L.length>d.resampleThreshold?d.confirmImageResize(function(W){T=W;V()}):V()}),mxUtils.bind(this,function(){d.handleError({message:mxResources.get("cannotOpenFile")})})):d.importFile(L,K,M,P,0,0,+k,function(R){d.spinner.stop();t.setSelectionCells(R);t.scrollCellToVisible(t.getSelectionCell())})}),H=mxUtils.bind(this,function(L){var K="text/xml";/\.png$/i.test(L)?K="image/png":/\.jpe?g$/i.test(L)?K="image/jpg":/\.gif$/i.test(L)?K="image/gif":/\.pdf$/i.test(L)&&(K="application/pdf");return K});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=d.drive?p.addItem(mxResources.get("googleDrive")+"...",null,function(){G(d.drive)},q):d.isModeEnabled(App.MODE_GOOGLE)&&p.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},q,null,!1));d.isModeReady(App.MODE_ONEDRIVE)?p.addItem(mxResources.get("oneDrive")+"...",null,function(){G(d.oneDrive)},q):d.isModeEnabled(App.MODE_ONEDRIVE)&&p.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},q,null,!1);d.isModeReady(App.MODE_DROPBOX)?p.addItem(mxResources.get("dropbox")+"...",null,function(){G(d.dropbox)},q):d.isModeEnabled(App.MODE_DROPBOX)&&p.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},q,null,!1);p.addSeparator(q);d.isModeReady(App.MODE_GITHUB)&&p.addItem(mxResources.get("github")+"...",null,function(){G(d.gitHub)},q);d.isModeReady(App.MODE_GITLAB)&&p.addItem(mxResources.get("gitlab")+"...",null,function(){G(d.gitLab)},q);d.isModeReady(App.MODE_TRELLO)?p.addItem(mxResources.get("trello")+"...",null,function(){G(d.trello)},q):d.isModeEnabled(App.MODE_TRELLO)&&p.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+-"...)",null,function(){},q,null,!1);p.addSeparator(q);isLocalStorage&&"0"!=urlParams.browser&&p.addItem(mxResources.get("browser")+"...",null,function(){d.importLocalFile(!1)},q);"1"!=urlParams.noDevice&&p.addItem(mxResources.get("device")+"...",null,function(){d.importLocalFile(!0)},q);d.isOffline()||(p.addSeparator(q),p.addItem(mxResources.get("url")+"...",null,function(){var M=new FilenameDialog(d,"",mxResources.get("import"),function(L){if(null!=L&&0<L.length&&d.spinner.spin(document.body,mxResources.get("loading"))){var k=-/(\.png)($|\?)/i.test(L)?"image/png":"text/xml";d.editor.loadUrl(PROXY_URL+"?url="+encodeURIComponent(L),function(y){E(y,k,L)},function(){d.spinner.stop();d.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==k)}},mxResources.get("url"));d.showDialog(M.container,300,80,!0,!0);M.init()},q))}))).isEnabled=x;this.put("dynamicAppearance",new Menu(mxUtils.bind(this,function(p,q){var G=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;"simple"==Editor.currentTheme&&+"...)",null,function(){},q,null,!1);p.addSeparator(q);isLocalStorage&&"0"!=urlParams.browser&&p.addItem(mxResources.get("browser")+"...",null,function(){d.importLocalFile(!1)},q);"1"!=urlParams.noDevice&&p.addItem(mxResources.get("device")+"...",null,function(){d.importLocalFile(!0)},q);d.isOffline()||(p.addSeparator(q),p.addItem(mxResources.get("url")+"...",null,function(){var L=new FilenameDialog(d,"",mxResources.get("import"),function(K){if(null!=K&&0<K.length&&d.spinner.spin(document.body,mxResources.get("loading"))){var k=+/(\.png)($|\?)/i.test(K)?"image/png":"text/xml";d.editor.loadUrl(PROXY_URL+"?url="+encodeURIComponent(K),function(y){E(y,k,K)},function(){d.spinner.stop();d.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==k)}},mxResources.get("url"));d.showDialog(L.container,300,80,!0,!0);L.init()},q))}))).isEnabled=x;this.put("dynamicAppearance",new Menu(mxUtils.bind(this,function(p,q){var G=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;"simple"==Editor.currentTheme&&(750>G&&this.addSubmenu("viewZoom",p,q,mxResources.get("zoom")),460>G&&d.isPageMenuVisible()&&this.addSubmenu("pages",p,q),320>G&&this.addSubmenu("insert",p,q),360>G&&"1"!=urlParams.embed&&"draw.io"==d.getServiceName()&&this.addSubmenu("share",p,q))})));this.put("appearance",new Menu(mxUtils.bind(this,function(p,q){if(d.isAutoDarkModeSupported()){var G=d.menus.addMenuItem(p,"autoMode",q);null!=G&&G.setAttribute("title",mxResources.get("automatic")+" ("+mxResources.get(Editor.isDarkMode()?"dark":"light")+")")}this.addMenuItems(p,["lightMode","darkMode","-"],q);G=d.menus.addMenuItem(p,"highContrast",q);(!d.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&d.menus.addLinkToItem(G,"https://github.com/jgraph/drawio/issues/4296")})));d.actions.addAction("addToScratchpad",function(p){t.isSelectionEmpty()||null==d.addSelectionToScratchpad||d.addSelectionToScratchpad(p)});d.actions.addAction("accounts...",function(){d.toggleUserPanel();d.userPanel.style.right="10px";d.userPanel.style.top="10px"});-this.put("theme",new Menu(mxUtils.bind(this,function(p,q){var G="1"==urlParams.sketch?"sketch":mxSettings.getUi(),E=p.addItem(mxResources.get("automatic"),null,function(){d.setCurrentTheme("")},q),H=p.addItem(mxResources.get("classic"),null,function(){d.setCurrentTheme("kennedy")},q),M=!1;if("kennedy"==G||"dark"==G)p.addCheckmark(H,Editor.checkmarkImage),M=!0;for(var L=0;L<Editor.themes.length;L++)mxUtils.bind(this,function(k){H=p.addItem(mxResources.get("min"==k?"minimal":k),null,function(){d.setCurrentTheme(k)},-q);G==k&&(p.addCheckmark(H,Editor.checkmarkImage),M=!0);"simple"==k&&p.addSeparator(q)})(Editor.themes[L]);M||p.addCheckmark(E,Editor.checkmarkImage)})));v=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var p=this.editorUi.getCurrentFile();if(null!=p)if(p.constructor==LocalFile&&null!=p.fileHandle)d.showSaveFilePicker(mxUtils.bind(d,function(G,E){p.invalidFileHandle=null;p.fileHandle=G;p.title=E.name;p.desc=E;d.save(E.name)}),null,d.createFileSystemOptions(p.getTitle()));+this.put("theme",new Menu(mxUtils.bind(this,function(p,q){var G="1"==urlParams.sketch?"sketch":mxSettings.getUi(),E=p.addItem(mxResources.get("automatic"),null,function(){d.setCurrentTheme("")},q),H=p.addItem(mxResources.get("classic"),null,function(){d.setCurrentTheme("kennedy")},q),L=!1;if("kennedy"==G||"dark"==G)p.addCheckmark(H,Editor.checkmarkImage),L=!0;for(var K=0;K<Editor.themes.length;K++)mxUtils.bind(this,function(k){H=p.addItem(mxResources.get("min"==k?"minimal":k),null,function(){d.setCurrentTheme(k)},+q);G==k&&(p.addCheckmark(H,Editor.checkmarkImage),L=!0);"simple"==k&&p.addSeparator(q)})(Editor.themes[K]);L||p.addCheckmark(E,Editor.checkmarkImage)})));v=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var p=this.editorUi.getCurrentFile();if(null!=p)if(p.constructor==LocalFile&&null!=p.fileHandle)d.showSaveFilePicker(mxUtils.bind(d,function(G,E){p.invalidFileHandle=null;p.fileHandle=G;p.title=E.name;p.desc=E;d.save(E.name)}),null,d.createFileSystemOptions(p.getTitle()));else{var q=null!=p.getTitle()?p.getTitle():this.editorUi.defaultFilename;q=new FilenameDialog(this.editorUi,q,mxResources.get("rename"),mxUtils.bind(this,function(G){null!=G&&0<G.length&&null!=p&&G!=p.getTitle()&&this.editorUi.spinner.spin(document.body,mxResources.get("renaming"))&&p.rename(G,mxUtils.bind(this,function(E){this.editorUi.spinner.stop()}),mxUtils.bind(this,function(E){this.editorUi.handleError(E,null!=E?mxResources.get("errorRenamingFile"):null)}))}),p.constructor==DriveFile||p.constructor==StorageFile?mxResources.get("diagramName"):null,function(G){if(null!=G&&0<G.length)return!0;d.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok"));return!1},null,FilenameDialog.filenameHelpLink,null,null,d.editor.fileExtensions);this.editorUi.showDialog(q.container,340,100,!0,!0);q.init()}}));v.isEnabled=function(){return this.enabled&&x.apply(this,arguments)};v.visible="1"!=urlParams.embed;d.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var p=d.getCurrentFile();if(null!=p){var q=d.getCopyFilename(p);p.constructor==DriveFile?(q=new CreateDialog(d,q,mxUtils.bind(this,function(G,E){"_blank"==E?d.editor.editAsNew(d.getFileData(),G):("download"==E&&(E=App.MODE_GOOGLE),null!=G&&0<G.length&&(E==App.MODE_GOOGLE?d.spinner.spin(document.body,mxResources.get("saving"))&&p.saveAs(G,mxUtils.bind(this,function(H){p.desc=H;p.save(!1,mxUtils.bind(this,function(){d.spinner.stop();p.setModified(!1);d.updateStatus(mxUtils.bind(this,function(){p.addAllSavedStatus()}))}),mxUtils.bind(this,-function(M){d.handleError(M)}))}),mxUtils.bind(this,function(H){d.handleError(H)})):d.createFile(G,d.getFileData(!0),null,E)))}),mxUtils.bind(this,function(){d.hideDialog()}),mxResources.get("makeCopy"),mxResources.get("create"),null,null,!0,null,!0,null,null,null,null,d.editor.fileExtensions),d.showDialog(q.container,420,380,!0,!0),q.init()):d.editor.editAsNew(this.editorUi.getFileData(!0),q)}}));v=new Action("openFolder",function(p,q){p=d.getCurrentFile();null!=p&&d.openLink(p.getFolderUrl())});+function(L){d.handleError(L)}))}),mxUtils.bind(this,function(H){d.handleError(H)})):d.createFile(G,d.getFileData(!0),null,E)))}),mxUtils.bind(this,function(){d.hideDialog()}),mxResources.get("makeCopy"),mxResources.get("create"),null,null,!0,null,!0,null,null,null,null,d.editor.fileExtensions),d.showDialog(q.container,420,380,!0,!0),q.init()):d.editor.editAsNew(this.editorUi.getFileData(!0),q)}}));v=new Action("openFolder",function(p,q){p=d.getCurrentFile();null!=p&&d.openLink(p.getFolderUrl())});v.getTitle=function(){return mxResources.get("openIt",[mxResources.get("folder")])+"..."};d.actions.put("openFolder",v);d.actions.addAction("openFile...",mxUtils.bind(this,function(){var p=d.getCurrentFile();null!=p&&d.openLink(p.getFileUrl())}));d.actions.addAction("moveToFolder...",mxUtils.bind(this,function(){var p=d.getCurrentFile();if(p.getMode()==App.MODE_GOOGLE||p.getMode()==App.MODE_ONEDRIVE){var q=!1;if(p.getMode()==App.MODE_GOOGLE&&null!=p.desc.parents)for(var G=0;G<p.desc.parents.length;G++)if(p.desc.parents[G].isRoot){q=!0;break}d.pickFolder(p.getMode(),mxUtils.bind(this,function(E){d.spinner.spin(document.body,mxResources.get("moving"))&&p.move(E,mxUtils.bind(this,function(H){d.spinner.stop()}),mxUtils.bind(this,function(H){d.handleError(H)}))}),null,!0,q)}}));this.put("publish",new Menu(mxUtils.bind(this,function(p,q){this.addMenuItems(p,["publishLink"],q)})));d.actions.put("useOffline",new Action("useOffline...",function(){d.openLink("https://app.draw.io/")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){try{var p=d.getCurrentFile();null!=p&&p.share()}catch(q){d.handleError(q)}})).isEnabled=x;this.put("embed",new Menu(mxUtils.bind(this,function(p,q){var G=d.getCurrentFile();null==G||G.getMode()!=App.MODE_GOOGLE&&G.getMode()!=App.MODE_GITHUB||!/(\.png)$/i.test(G.getTitle())||this.addMenuItems(p,["liveImage","-"],q);this.addMenuItems(p,["embedImage","embedSvg","-","embedHtml"],q);navigator.standalone||d.isOffline()||this.addMenuItems(p,["embedIframe"],q);"1"==urlParams.embed||d.isOffline()||-this.addMenuItems(p,"- googleDocs googleSlides googleSheets - microsoftOffice - embedNotion".split(" "),q)})));d.addInsertItem=function(p,q,G,E){("plantUml"!=E||EditorUi.enablePlantUml&&!d.isOffline())&&p.addItem(G,null,mxUtils.bind(this,function(){if("fromText"==E||"formatSql"==E||"plantUml"==E||"mermaid"==E){var H=new ParseDialog(d,G,E);d.showDialog(H.container,620,420,!0,!1);d.dialog.container.style.overflow="auto"}else H=new CreateGraphDialog(d,G,E),d.showDialog(H.container,620,420,!0,!1,function(M,-L){if(L)return d.confirm(mxResources.get("areYouSure"),function(){d.hideDialog()}),!1;null!=H.graph&&(null!=H.graph.container.parentNode&&H.graph.container.parentNode.removeChild(H.graph.container),H.graph.destroy(),H.graph=null)});H.init()}),q,null,x())};var C=function(p){t.getModel().beginUpdate();try{p=t.addCell(p),t.fireEvent(new mxEventObject("cellsInserted","cells",[p])),t.model.isVertex(p)&&t.isAutoSizeCell(p)&&t.updateCellSize(p)}finally{t.getModel().endUpdate()}t.scrollCellToVisible(p);t.setSelectionCell(p);+this.addMenuItems(p,"- googleDocs googleSlides googleSheets - microsoftOffice - embedNotion".split(" "),q)})));d.addInsertItem=function(p,q,G,E){("plantUml"!=E||EditorUi.enablePlantUml&&!d.isOffline())&&p.addItem(G,null,mxUtils.bind(this,function(){if("fromText"==E||"formatSql"==E||"plantUml"==E||"mermaid"==E){var H=new ParseDialog(d,G,E);d.showDialog(H.container,620,420,!0,!1);d.dialog.container.style.overflow="auto"}else H=new CreateGraphDialog(d,G,E),d.showDialog(H.container,620,420,!0,!1,function(L,+K){if(K)return d.confirm(mxResources.get("areYouSure"),function(){d.hideDialog()}),!1;null!=H.graph&&(null!=H.graph.container.parentNode&&H.graph.container.parentNode.removeChild(H.graph.container),H.graph.destroy(),H.graph=null)});H.init()}),q,null,x())};var C=function(p){t.getModel().beginUpdate();try{p=t.addCell(p),t.fireEvent(new mxEventObject("cellsInserted","cells",[p])),t.model.isVertex(p)&&t.isAutoSizeCell(p)&&t.updateCellSize(p)}finally{t.getModel().endUpdate()}t.scrollCellToVisible(p);t.setSelectionCell(p);t.container.focus();t.editAfterInsert&&t.startEditing(p);window.setTimeout(function(){null!=d.hoverIcons&&d.hoverIcons.update(t.view.getState(p))},0);return p},A=function(p,q,G,E,H){p=new mxCell(p,new mxGeometry(0,0,q,G),E);p.vertex=!0;null==H&&(H=t.getCenterInsertPoint(t.getBoundingBoxFromGeometry([p],!0)));p.geometry.x=H.x;p.geometry.y=H.y;return C(p)};d.actions.put("insertText",new Action("text",function(p){t.isEnabled()&&!t.isCellLocked(t.getDefaultParent())&&t.startEditingAtCell(A("Text",60,30,t.appendFontSize("text;strokeColor=none;align=center;fillColor=none;html=1;verticalAlign=middle;whiteSpace=wrap;rounded=0;",t.vertexFontSize),null==p||mxEvent.isControlDown(p)||mxEvent.isMetaDown(p)||!t.isMouseInsertPoint()?null:t.getInsertPoint()))},null,null,"A")).isEnabled=x;d.actions.put("insertRectangle",new Action("rectangle",function(p){t.isEnabled()&&!t.isCellLocked(t.getDefaultParent())&&A("",120,60,"whiteSpace=wrap;html=1;",null==p||mxEvent.isControlDown(p)||mxEvent.isMetaDown(p)||!t.isMouseInsertPoint()?null:t.getInsertPoint())},null,null,"D")).isEnabled=x;d.actions.put("insertNote",new Action("note",function(p){t.isEnabled()&&!t.isCellLocked(t.getDefaultParent())&&A("",140,160,"shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;fontColor=#000000;darkOpacity=0.05;fillColor=#FFF9B2;strokeColor=none;fillStyle=solid;direction=west;gradientDirection=north;gradientColor=#FFF2A1;shadow=1;size=20;pointerEvents=1;",null==p||mxEvent.isControlDown(p)||mxEvent.isMetaDown(p)||!t.isMouseInsertPoint()?null:@@ -13999,7 +14004,7 @@ v.setSelectedCallback(mxUtils.bind(this,function(){return null!=d.sidebarWindow&d.insertTemplateEnabled&&!d.isOffline()&&d.menus.addMenuItems(p,["insertTemplate"],q),d.menus.addMenuItems(p,["insertImage","insertLink","-"],q),d.menus.addSubmenu("insertAdvanced",p,q,mxResources.get("advanced")),d.menus.addSubmenu("layout",p,q)):(this.addMenuItems(p,"insertRectangle insertEllipse insertRhombus - insertEdge insertNote - insertText insertLink - createShape insertFreehand - insertImage".split(" "),q),d.insertTemplateEnabled&&!d.isOffline()&&this.addMenuItems(p,["insertTemplate"],q),p.addSeparator(q),"min"==uiTheme||"simple"==Editor.currentTheme?(this.addSubmenu("layout",p,q),this.addSubmenu("insertLayout",p,q,mxResources.get("insert")),p.addSeparator(q),this.addSubmenu("table",p,q)):this.addSubmenu("insertLayout",p,q,mxResources.get("layout")),this.addSubmenu("insertAdvanced",p,q,mxResources.get("advanced")))})));this.put("table",new Menu(mxUtils.bind(this,function(p,q){d.menus.addInsertTableCellItem(p,q)})));this.put("insertLayout",new Menu(mxUtils.bind(this,function(p,q){d.addInsertMenuItems(p,q,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "))})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(p,q){var G=["fromText","plantUml"].concat(window.isMermaidEnabled?["mermaid"]:[]).concat(["-","formatSql"]);d.addInsertMenuItems(p,q,G);p.addItem(mxResources.get("csv")+"...",null,function(){t.popupMenuHandler.hideMenu();d.showImportCsvDialog()},q,null,x());"simple"!=Editor.currentTheme&&"min"!=Editor.currentTheme||this.addMenuItems(p,-["-","createShape","editDiagram"],q)})));this.put("openRecent",new Menu(function(p,q){var G=d.getRecent();if(null!=G){for(var E=0;E<G.length;E++)(function(H){var M=H.mode;M==App.MODE_GOOGLE?M="googleDrive":M==App.MODE_ONEDRIVE&&(M="oneDrive");p.addItem(H.title+" ("+mxResources.get(M)+")",null,function(){d.loadFile(H.id)},q)})(G[E]);p.addSeparator(q)}p.addItem(mxResources.get("reset"),null,function(){d.resetRecent()},q)}));this.put("openFrom",new Menu(function(p,q){null!=d.drive?p.addItem(mxResources.get("googleDrive")++["-","createShape","editDiagram"],q)})));this.put("openRecent",new Menu(function(p,q){var G=d.getRecent();if(null!=G){for(var E=0;E<G.length;E++)(function(H){var L=H.mode;L==App.MODE_GOOGLE?L="googleDrive":L==App.MODE_ONEDRIVE&&(L="oneDrive");p.addItem(H.title+" ("+mxResources.get(L)+")",null,function(){d.loadFile(H.id)},q)})(G[E]);p.addSeparator(q)}p.addItem(mxResources.get("reset"),null,function(){d.resetRecent()},q)}));this.put("openFrom",new Menu(function(p,q){null!=d.drive?p.addItem(mxResources.get("googleDrive")+"...",null,function(){d.pickFile(App.MODE_GOOGLE)},q):d.isModeEnabled(App.MODE_GOOGLE)&&p.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},q,null,!1);d.isModeReady(App.MODE_ONEDRIVE)?p.addItem(mxResources.get("oneDrive")+"...",null,function(){d.pickFile(App.MODE_ONEDRIVE)},q):d.isModeEnabled(App.MODE_ONEDRIVE)&&p.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},q,null,!1);d.isModeReady(App.MODE_DROPBOX)?p.addItem(mxResources.get("dropbox")+"...",null,function(){d.pickFile(App.MODE_DROPBOX)},q):d.isModeEnabled(App.MODE_DROPBOX)&&p.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},q,null,!1);p.addSeparator(q);d.isModeReady(App.MODE_GITHUB)&&p.addItem(mxResources.get("github")+"...",null,function(){d.pickFile(App.MODE_GITHUB)},q);d.isModeReady(App.MODE_GITLAB)&&p.addItem(mxResources.get("gitlab")+"...",null,function(){d.pickFile(App.MODE_GITLAB)},q);d.isModeReady(App.MODE_TRELLO)?p.addItem(mxResources.get("trello")+"...",null,function(){d.pickFile(App.MODE_TRELLO)},q):d.isModeEnabled(App.MODE_TRELLO)&&p.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},q,null,!1);p.addSeparator(q);isLocalStorage&&"0"!=urlParams.browser&&p.addItem(mxResources.get("browser")+"...",null,function(){d.pickFile(App.MODE_BROWSER)},q);"1"!=urlParams.noDevice&&p.addItem(mxResources.get("device")+"...",null,function(){d.pickFile(App.MODE_DEVICE)},q);d.isOffline()||(p.addSeparator(q),p.addItem(mxResources.get("url")+@@ -14011,8 +14016,8 @@ null,null,null,App.MODE_GITHUB)},q);d.isModeReady(App.MODE_GITLAB)&&p.addItem(mxtypeof google&&"undefined"!=typeof google.picker&&(null!=d.drive?p.addItem(mxResources.get("googleDrive")+"...",null,function(){d.pickLibrary(App.MODE_GOOGLE)},q):d.isModeEnabled(App.MODE_GOOGLE)&&p.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},q,null,!1));d.isModeReady(App.MODE_ONEDRIVE)?p.addItem(mxResources.get("oneDrive")+"...",null,function(){d.pickLibrary(App.MODE_ONEDRIVE)},q):d.isModeEnabled(App.MODE_ONEDRIVE)&&p.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},q,null,!1);d.isModeReady(App.MODE_DROPBOX)?p.addItem(mxResources.get("dropbox")+"...",null,function(){d.pickLibrary(App.MODE_DROPBOX)},q):d.isModeEnabled(App.MODE_DROPBOX)&&p.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},q,null,!1);p.addSeparator(q);d.isModeReady(App.MODE_GITHUB)&&p.addItem(mxResources.get("github")+"...",null,function(){d.pickLibrary(App.MODE_GITHUB)},q);d.isModeReady(App.MODE_GITLAB)&&p.addItem(mxResources.get("gitlab")+"...",null,function(){d.pickLibrary(App.MODE_GITLAB)},q);d.isModeReady(App.MODE_TRELLO)?p.addItem(mxResources.get("trello")+"...",null,function(){d.pickLibrary(App.MODE_TRELLO)},q):d.isModeEnabled(App.MODE_TRELLO)&&p.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},q,null,!1);p.addSeparator(q);isLocalStorage&&"0"!=urlParams.browser&&p.addItem(mxResources.get("browser")+"...",null,function(){d.pickLibrary(App.MODE_BROWSER)},-q);"1"!=urlParams.noDevice&&p.addItem(mxResources.get("device")+"...",null,function(){d.pickLibrary(App.MODE_DEVICE)},q);d.isOffline()||(p.addSeparator(q),p.addItem(mxResources.get("url")+"...",null,function(){var G=new FilenameDialog(d,"",mxResources.get("open"),function(E){if(null!=E&&0<E.length&&d.spinner.spin(document.body,mxResources.get("loading"))){var H=E;d.editor.isCorsEnabledForUrl(E)||(H=PROXY_URL+"?url="+encodeURIComponent(E));mxUtils.get(H,function(M){if(200<=M.getStatus()&&299>=M.getStatus()){d.spinner.stop();-try{d.loadLibrary(new UrlLibrary(d,M.getText(),E)),d.showSidebar()}catch(L){d.handleError(L,mxResources.get("errorLoadingFile"))}}else d.spinner.stop(),d.handleError(null,mxResources.get("errorLoadingFile"))},function(){d.spinner.stop();d.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));d.showDialog(G.container,300,80,!0,!0);G.init()},q));"1"==urlParams.confLib&&(p.addSeparator(q),p.addItem(mxResources.get("confluenceCloud")+"...",null,function(){d.showRemotelyStoredLibrary(mxResources.get("libraries"))},+q);"1"!=urlParams.noDevice&&p.addItem(mxResources.get("device")+"...",null,function(){d.pickLibrary(App.MODE_DEVICE)},q);d.isOffline()||(p.addSeparator(q),p.addItem(mxResources.get("url")+"...",null,function(){var G=new FilenameDialog(d,"",mxResources.get("open"),function(E){if(null!=E&&0<E.length&&d.spinner.spin(document.body,mxResources.get("loading"))){var H=E;d.editor.isCorsEnabledForUrl(E)||(H=PROXY_URL+"?url="+encodeURIComponent(E));mxUtils.get(H,function(L){if(200<=L.getStatus()&&299>=L.getStatus()){d.spinner.stop();+try{d.loadLibrary(new UrlLibrary(d,L.getText(),E)),d.showSidebar()}catch(K){d.handleError(K,mxResources.get("errorLoadingFile"))}}else d.spinner.stop(),d.handleError(null,mxResources.get("errorLoadingFile"))},function(){d.spinner.stop();d.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));d.showDialog(G.container,300,80,!0,!0);G.init()},q));"1"==urlParams.confLib&&(p.addSeparator(q),p.addItem(mxResources.get("confluenceCloud")+"...",null,function(){d.showRemotelyStoredLibrary(mxResources.get("libraries"))},q))})));this.put("edit",new Menu(mxUtils.bind(this,function(p,q){this.addMenuItems(p,"undo redo - cut copy copyAsImage paste delete - duplicate - findReplace - editData editTooltip - editStyle editGeometry - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))})));v=d.actions.addAction("comments",mxUtils.bind(this,function(){if(null==this.commentsWindow)this.commentsWindow=new CommentsWindow(d,document.body.offsetWidth-380,120,300,350),this.commentsWindow.window.addListener("show",function(){d.fireEvent(new mxEventObject("comments"))}),this.commentsWindow.window.addListener("hide",function(){d.fireEvent(new mxEventObject("comments"))}),this.commentsWindow.window.setVisible(!0),d.fireEvent(new mxEventObject("comments"));else{var p=!this.commentsWindow.window.isVisible();this.commentsWindow.window.setVisible(p);this.commentsWindow.refreshCommentsTime();p&&this.commentsWindow.hasError&&this.commentsWindow.refreshComments()}}));v.setToggleAction(!0);v.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.commentsWindow&&this.commentsWindow.window.isVisible()}));d.editor.addListener("fileLoaded",mxUtils.bind(this,function(){null!=this.commentsWindow&&(this.commentsWindow.destroy(),this.commentsWindow=null)}));this.get("viewPanels").funct=function(p,q){var G=d.getCurrentFile();d.menus.addMenuItems(p,"toggleShapes format ruler - findReplace layers tags chatWindowTitle outline -".split(" "),q);d.commentsSupported()&&d.menus.addMenuItems(p,["-","comments"],q);null!=G&&G.isRealtimeEnabled()&&@@ -14021,16 +14026,16 @@ G.isRealtimeSupported()&&d.menus.addMenuItems(p,["-","showRemoteCursors","shareC["comments","-"]:["-"]));this.addMenuItems(p,["-","search"],q);if(isLocalStorage||mxClient.IS_CHROMEAPP)E=this.addMenuItem(p,"scratchpad",q),(!d.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(E,"https://www.drawio.com/doc/faq/scratchpad");this.addMenuItems(p,["toggleShapes","-","pageView","pageScale"]);this.addSubmenu("units",p,q);p.addSeparator(q);d.isPageMenuVisible()&&d.menus.addMenuItems(p,["pageTabs"],q);this.addMenuItems(p,"ruler - tooltips animations - grid guides - connectionArrows connectionPoints - resetView zoomIn zoomOut".split(" "),q);"1"!=urlParams.sketch&&this.addMenuItems(p,["-","fullscreen"],q)}})));this.put("editCell",new Menu(mxUtils.bind(this,function(p,q){this.addMenuItems(p,"editLink editShape editImage crop - editData copyData pasteData - editConnectionPoints editGeometry - editTooltip editStyle - edit".split(" "),q)})));this.put("currentPage",new Menu(mxUtils.bind(this,function(p,q){var G=d.currentPage;null!=G&&(p.addItem(mxResources.get("rename")+"...",null,mxUtils.bind(this,function(){d.renamePage(G,G.getName())}),q),p.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){d.removePage(G)}),q),1<d.pages.length&&(d.menus.addSubmenu("movePage",p,q,mxResources.get("move")),p.addSeparator(q)),p.addSeparator(q),p.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){d.duplicatePage(G,mxResources.get("copyOf",[G.getName()]))}),q),1!=urlParams.embed&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=d.getServiceName()||p.addItem(mxResources.get("openInNewWindow"),null,mxUtils.bind(this,-function(){d.editor.editAsNew(d.getFileData(!0,null,null,null,!0,!0))}),q)))})));this.put("pages",new Menu(mxUtils.bind(this,function(p,q){var G=d.currentPage;d.editor.graph.isLightboxView()||(p.addItem(mxResources.get("insertPage"),null,mxUtils.bind(this,function(){try{d.insertPage()}catch(H){d.handleError(H)}}),q,null,d.editor.graph.isEnabled()),p.addSeparator(q));if(null!=d.pages)for(var E=0;E<d.pages.length;E++)mxUtils.bind(this,function(H){var M=null;M=d.pages[H]==G&&!d.editor.graph.isLightboxView()&&-d.editor.graph.isEnabled()?d.menus.addSubmenu("currentPage",p,q,d.getShortPageName(G)):p.addItem(d.getShortPageName(d.pages[H]),null,mxUtils.bind(this,function(){d.selectPage(d.pages[H])}),q);var L=d.pages[H].getId();M.setAttribute("title",d.pages[H].getName()+" ("+(H+1)+"/"+d.pages.length+")"+(null!=L?" ["+L+"]":""));d.pages[H]==G&&p.addCheckmark(M,Editor.checkmarkImage)})(E)})));if(EditorUi.isElectronApp){var Q="1"==urlParams.enableSpellCheck;v=d.actions.addAction("spellCheck",function(){d.toggleSpellCheck();+function(){d.editor.editAsNew(d.getFileData(!0,null,null,null,!0,!0))}),q)))})));this.put("pages",new Menu(mxUtils.bind(this,function(p,q){var G=d.currentPage;d.editor.graph.isLightboxView()||(p.addItem(mxResources.get("insertPage"),null,mxUtils.bind(this,function(){try{d.insertPage()}catch(H){d.handleError(H)}}),q,null,d.editor.graph.isEnabled()),p.addSeparator(q));if(null!=d.pages)for(var E=0;E<d.pages.length;E++)mxUtils.bind(this,function(H){var L=null;L=d.pages[H]==G&&!d.editor.graph.isLightboxView()&&+d.editor.graph.isEnabled()?d.menus.addSubmenu("currentPage",p,q,d.getShortPageName(G)):p.addItem(d.getShortPageName(d.pages[H]),null,mxUtils.bind(this,function(){d.selectPage(d.pages[H])}),q);var K=d.pages[H].getId();L.setAttribute("title",d.pages[H].getName()+" ("+(H+1)+"/"+d.pages.length+")"+(null!=K?" ["+K+"]":""));d.pages[H]==G&&p.addCheckmark(L,Editor.checkmarkImage)})(E)})));if(EditorUi.isElectronApp){var Q="1"==urlParams.enableSpellCheck;v=d.actions.addAction("spellCheck",function(){d.toggleSpellCheck();Q=!Q;d.alert(mxResources.get("restartForChangeRequired"))});v.setToggleAction(!0);v.setSelectedCallback(function(){return Q});var S="1"==urlParams.enableStoreBkp;v=d.actions.addAction("autoBkp",function(){d.toggleStoreBkp();S=!S});v.setToggleAction(!0);v.setSelectedCallback(function(){return S});var U="1"==urlParams.isGoogleFontsEnabled;v=d.actions.addAction("googleFonts",function(){d.toggleGoogleFonts();U=!U;d.alert(mxResources.get("restartForChangeRequired"))});v.setToggleAction(!0);v.setSelectedCallback(function(){return U});d.actions.addAction("openDevTools",function(){d.openDevTools()});d.actions.addAction("drafts...",function(){var p=new FilenameDialog(d,EditorUi.draftSaveDelay/1E3+"",mxResources.get("apply"),mxUtils.bind(this,function(q){q=parseInt(q);0<=q&&(EditorUi.draftSaveDelay=1E3*q,EditorUi.enableDrafts=0<q,mxSettings.setDraftSaveDelay(q),mxSettings.save())}),mxResources.get("draftSaveInt"));d.showDialog(p.container,320,80,!0,!0);p.init()})}var O=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(p,q){if("simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme){null==O||"1"==urlParams.embed&&null!=urlParams.lang||d.menus.addSubmenu("language",p,q);"1"==urlParams.embed&&"1"!=urlParams.atlas||"1"==urlParams.extAuth||"1"==urlParams.embedInline||d.menus.addSubmenu("appearance",p,q);"1"!=urlParams.embed&&"1"!=urlParams.extAuth&&d.mode!=App.MODE_ATLAS&&d.menus.addSubmenu("theme",p,q);p.addSeparator(q);d.menus.addSubmenu("units",p,q);d.menus.addMenuItems(p,"- copyConnect collapseExpand - tooltips animations -".split(" "),q);var G=d.getCurrentFile();"simple"!=Editor.currentTheme&&(null!=G&&G.isRealtimeEnabled()&&G.isRealtimeSupported()&&this.addMenuItems(p,["showRemoteCursors"],q),d.menus.addMenuItems(p,["ruler","-"],q));EditorUi.isElectronApp&&d.menus.addMenuItems(p,"- googleFonts spellCheck autoBkp drafts -".split(" "),q);this.addSubmenu("diagramLanguage",p,q);p.addSeparator(q);d.mode!=App.MODE_ATLAS&&d.menus.addMenuItem(p,"configuration",q);p.addSeparator(q)}else"1"==urlParams.embed&&null!=urlParams.lang||this.addSubmenu("language",p,q),"1"==urlParams.embed&&"1"!=urlParams.atlas||d.menus.addSubmenu("appearance",p,q),"1"!=urlParams.embed&&"1"!=urlParams.extAuth&&d.mode!=App.MODE_ATLAS&&this.addSubmenu("theme",p,q),EditorUi.isElectronApp&&this.addMenuItems(p,"- googleFonts spellCheck autoBkp drafts -".split(" "),q),p.addSeparator(q),G=this.addSubmenu("adaptiveColors",p,q),(!d.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&d.menus.addLinkToItem(G,"https://github.com/jgraph/drawio/discussions/4713"),"undefined"!==typeof MathJax&&(G=this.addMenuItem(p,"mathematicalTypesetting",q),(!d.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(G,"https://www.drawio.com/doc/faq/math-typesetting")),"1"!=urlParams.embed&&(G=d.getCurrentFile(),null!=G&&G.isRealtimeEnabled()&&G.isRealtimeSupported()&&this.addMenuItems(p,["-","showRemoteCursors","shareCursor"],q),p.addSeparator(q),(isLocalStorage||mxClient.IS_CHROMEAPP)&&this.addMenuItems(p,["showStartScreen"],q),this.addMenuItems(p,-["autosave"],q)),this.addMenuItems(p,["-","copyConnect","collapseExpand","-"],q),this.addSubmenu("diagramLanguage",p,q),this.addMenuItems(p,["editDiagram","-"],q),!d.isOfflineApp()&&isLocalStorage&&this.addMenuItem(p,"plugins",q),this.addMenuItems(p,["configuration"],q)})));this.put("movePage",new Menu(mxUtils.bind(this,function(p,q){var G=d.currentPage,E=d.getPageIndex(G);if(null!=d.pages)for(var H=0;H<d.pages.length;H++)H!=E&&function(M){p.addItem(d.getShortPageName(d.pages[M]),null,function(){d.movePage(E,-M);d.scrollToPage(G,!0)},q)}(H)})));this.put("share",new Menu(mxUtils.bind(this,function(p,q){if(!d.isStandaloneApp()){var G=d.isOffline(!0)?mxResources.get("offline"):d.getNetworkStatus();null!=G&&(p.addItem(G,null,null,q,null,!1),p.addSeparator(q));d.menus.addMenuItems(p,["share"],q)}this.addMenuItem(p,"publishLink",q,null,null,mxResources.get("publish")+"...");null!=d.getMainUser()&&this.addMenuItems(p,["accounts"],q)})));this.put("diagram",new Menu(mxUtils.bind(this,function(p,q){var G=d.getCurrentFile();+["autosave"],q)),this.addMenuItems(p,["-","copyConnect","collapseExpand","-"],q),this.addSubmenu("diagramLanguage",p,q),this.addMenuItems(p,["editDiagram","-"],q),!d.isOfflineApp()&&isLocalStorage&&this.addMenuItem(p,"plugins",q),this.addMenuItems(p,["configuration"],q)})));this.put("movePage",new Menu(mxUtils.bind(this,function(p,q){var G=d.currentPage,E=d.getPageIndex(G);if(null!=d.pages)for(var H=0;H<d.pages.length;H++)H!=E&&function(L){p.addItem(d.getShortPageName(d.pages[L]),null,function(){d.movePage(E,+L);d.scrollToPage(G,!0)},q)}(H)})));this.put("share",new Menu(mxUtils.bind(this,function(p,q){if(!d.isStandaloneApp()){var G=d.isOffline(!0)?mxResources.get("offline"):d.getNetworkStatus();null!=G&&(p.addItem(G,null,null,q,null,!1),p.addSeparator(q));d.menus.addMenuItems(p,["share"],q)}this.addMenuItem(p,"publishLink",q,null,null,mxResources.get("publish")+"...");null!=d.getMainUser()&&this.addMenuItems(p,["accounts"],q)})));this.put("diagram",new Menu(mxUtils.bind(this,function(p,q){var G=d.getCurrentFile();"simple"!=Editor.currentTheme&&(d.menus.addSubmenu("extras",p,q,mxResources.get("settings")),p.addSeparator(q));var E="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme;if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)d.menus.addMenuItems(p,"new open - synchronize properties - save saveAs -".split(" "),q);else if(d.mode==App.MODE_ATLAS){"1"!=urlParams.noSaveBtn&&"1"!=urlParams.embedInline&&d.menus.addMenuItems(p,["-","save"],q);if("1"==urlParams.saveAndExit||"1"==urlParams.noSaveBtn&&"0"!=urlParams.saveAndExit||d.mode==App.MODE_ATLAS)d.menus.addMenuItems(p,["saveAndExit"],q),null!=G&&G.isRevisionHistorySupported()&&d.menus.addMenuItems(p,["revisionHistory"],q);p.addSeparator(q)}else d.mode==App.MODE_ATLAS?d.menus.addMenuItems(p,["save","synchronize","-"],q):"1"!=urlParams.noFileMenu&&(d.menus.addSubmenu("file",p,q),p.addSeparator(q),"min"==Editor.currentTheme&&(d.menus.addMenuItems(p,"toggleShapes format layers tags chatWindowTitle - findReplace".split(" "),q),d.commentsSupported()&&d.menus.addMenuItems(p,["comments"],q),p.addSeparator(q)));d.menus.addSubmenu("exportAs",p,q);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"atlassian"==d.getServiceName()?d.menus.addMenuItems(p,["import"],q):"1"!=urlParams.noFileMenu&&d.menus.addSubmenu("importFrom",p,q);"simple"!=Editor.currentTheme&&"min"!=Editor.currentTheme?(d.menus.addMenuItems(p,["-","findReplace"],q),d.commentsSupported()&&d.menus.addMenuItems(p,["comments","-"],q),d.menus.addMenuItems(p,"toggleShapes format layers tags chatWindowTitle -".split(" "),@@ -14046,15 +14051,15 @@ d.defaultFilename;(G.constructor==DriveFile&&null!=G.sync&&G.sync.isConnected()|this.addLinkToItem(E,"https://www.drawio.com/doc/faq/synchronize"),p.addSeparator(q)):this.addMenuItems(p,["new"],q),this.addSubmenu("openFrom",p,q),isLocalStorage&&this.addSubmenu("openRecent",p,q),null!=G&&G.constructor==DriveFile?this.addMenuItems(p,"new - rename makeCopy openFolder moveToFolder".split(" "),q):(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null==G||G.constructor==LocalFile&&null==G.fileHandle||(p.addSeparator(q),E=this.addMenuItem(p,"synchronize",q),(!d.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(E,"https://www.drawio.com/doc/faq/synchronize")),this.addMenuItems(p,["-","save","saveAs","-"],q),mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=d.getServiceName()||d.isOfflineApp()||null==G||this.addMenuItems(p,["share","-"],q),null!=G&&G.isRenamable()&&this.addMenuItems(p,["rename"],q),d.isOfflineApp()?navigator.onLine&&"1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&this.addMenuItems(p,["upload"],q):(this.addMenuItems(p,["makeCopy"],q),null!=G&&(G.constructor==OneDriveFile&&this.addMenuItems(p,["moveToFolder"],q),null!=G.getFolderUrl()&&d.menus.addMenuItems(p,["openFolder"],q)))),p.addSeparator(q),this.addSubmenu("importFrom",p,q),this.addSubmenu("exportAs",p,q),p.addSeparator(q),this.addSubmenu("embed",p,q),this.addSubmenu("publish",p,q),p.addSeparator(q),this.addSubmenu("newLibrary",p,q),this.addSubmenu("openLibraryFrom",p,q),d.isRevisionHistorySupported()&&this.addMenuItems(p,["-","revisionHistory"],q),null!=G&&null!=d.fileNode&&"1"!=-urlParams.embedInline&&(E=null!=G.getTitle()?G.getTitle():d.defaultFilename,(G.constructor==DriveFile&&null!=G.sync&&G.sync.isConnected()||!/(\.html)$/i.test(E))&&this.addMenuItems(p,["-","properties"])),this.addMenuItems(p,["-","pageSetup"],q),mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(p,["print"],q),this.addMenuItems(p,["-","close"])})));this.put("fontFamily",new Menu(mxUtils.bind(this,function(p,q){function G(K){var P=encodeURIComponent(K.name)+(null==K.url?"":"@"+encodeURIComponent(K.url));-if(!H[P]){for(var R=K.name,T=0;null!=y[R.toLowerCase()];)R=K.name+" ("+ ++T+")";null==k[P]&&(F.push({name:K.name,url:K.url,label:R,title:K.url}),y[R.toLowerCase()]=K,k[P]=K)}}for(var E=mxUtils.bind(this,function(K,P,R,T,V){var W=d.editor.graph,X=this.styleChange(p,null!=T?T:K,[mxConstants.STYLE_FONTFAMILY,"fontSource","FType"],[K,null!=P?encodeURIComponent(P):null,null],null,q,function(){W.setFont(K,P);d.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_FONTFAMILY,"fontSource",-"FType"],"values",[K,null!=P?encodeURIComponent(P):null,null],"cells",[W.cellEditor.getEditingCell()]))},function(){W.updateLabelElements(W.getSelectionCells(),function(Z){Z.removeAttribute("face");Z.style.fontFamily=null;"PRE"==Z.nodeName&&W.replaceElement(Z,"div")})});R&&(R=document.createElement("img"),R.className="geAdaptiveAsset",R.setAttribute("src",Editor.crossImage),R.setAttribute("title",mxResources.get("delete")),R.setAttribute("valign","absmiddle"),R.setAttribute("border","0"),R.style.position=-"relative",R.style.top="2px",R.style.width="14px",R.style.cursor="default",R.style.margin="0 3px",X.firstChild.nextSibling.nextSibling.appendChild(R),mxEvent.addListener(R,mxClient.IS_POINTER?"pointerup":"mouseup",mxUtils.bind(this,function(Z){this.removeCustomFont(K,P);this.editorUi.hideCurrentMenu();mxEvent.consume(Z)})));Graph.addFont(K,P);X.firstChild.nextSibling.style.fontFamily=K;V=null!=T?T:K;null!=P&&(V+=" ("+P+")");X.setAttribute("title",V)}),H={},M=0;M<this.defaultFonts.length;M++){var L=-this.defaultFonts[M];"string"===typeof L?E(L):null!=L.fontFamily&&null!=L.fontUrl&&(H[encodeURIComponent(L.fontFamily)+"@"+encodeURIComponent(L.fontUrl)]=!0,E(L.fontFamily,L.fontUrl))}p.addSeparator(q);var k={},y={},F=[];for(M=0;M<this.customFonts.length;M++)G(this.customFonts[M]);F.sort(function(K,P){return K.label<P.label?-1:K.label>P.label?1:0});if(0<F.length){for(M=0;M<F.length;M++)E(F[M].name,F[M].url,!0,F[M].label);p.addSeparator(q)}p.addItem(mxResources.get("reset"),null,mxUtils.bind(this,-function(){this.customFonts=[];d.fireEvent(new mxEventObject("customFontsChanged"))}),q);p.addSeparator(q);p.addItem(mxResources.get("custom")+"...",null,mxUtils.bind(this,function(){var K=this.editorUi.editor.graph,P=K.getStylesheet().getDefaultVertexStyle()[mxConstants.STYLE_FONTFAMILY],R="s",T=null;if(K.isEditing()){var V=K.getSelectedEditingElement();if(null!=V){var W=mxUtils.getCurrentStyle(V);if(null!=W){P=mxUtils.getCssFontFamily(W.fontFamily);W=K.getView().getState(K.cellEditor.getEditingCell());-T=null!=W?W.style.fontSource:null;for(null!=T&&(T=decodeURIComponent(T));null!=V&&V!=K.cellEditor.textarea;){if(V.nodeType==mxConstants.NODETYPE_ELEMENT)if(null!=V.getAttribute("data-font-src")){T=V.getAttribute("data-font-src");break}else if(V.getAttribute("face")==P){T=null;break}V=V.parentNode}null!=T&&(Graph.isGoogleFontUrl(T)?(T=null,R="g"):R="w")}}}else W=K.getView().getState(K.getSelectionCell()),null!=W&&(P=W.style[mxConstants.STYLE_FONTFAMILY]||P,V=W.style.fontSource,null!=V&&(V=decodeURIComponent(V),-Graph.isGoogleFontUrl(V)?R="g":(R="w",T=V)));null!=T&&T.substring(0,PROXY_URL.length)==PROXY_URL&&(T=decodeURIComponent(T.substr((PROXY_URL+"?url=").length)));var X=null;document.activeElement==K.cellEditor.textarea&&(X=K.cellEditor.saveSelection());P=new FontDialog(this.editorUi,P,T,R,mxUtils.bind(this,function(Z,Y,da){null!=X&&(K.cellEditor.restoreSelection(X),X=null);if(null!=Z&&0<Z.length)if(this.addCustomFont(Z,Y),K.isEditing())K.setFont(Z,Y);else{K.getModel().beginUpdate();try{K.stopEditing(!1),-K.setCellStyles(mxConstants.STYLE_FONTFAMILY,Z),K.setCellStyles("fontSource",null!=Y?encodeURIComponent(Y):null),K.setCellStyles("FType",null)}finally{K.getModel().endUpdate()}}}));this.editorUi.showDialog(P.container,380,130+(Editor.enableWebFonts?70:0)+("0"!=urlParams.isGoogleFontsEnabled?50:0),!0,!0);P.init()}),q,null,!0)})))}})();function DiagramPage(b,f){this.node=b;null!=f?this.node.setAttribute("id",f):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.diagramModified=!1;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};+urlParams.embedInline&&(E=null!=G.getTitle()?G.getTitle():d.defaultFilename,(G.constructor==DriveFile&&null!=G.sync&&G.sync.isConnected()||!/(\.html)$/i.test(E))&&this.addMenuItems(p,["-","properties"])),this.addMenuItems(p,["-","pageSetup"],q),mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(p,["print"],q),this.addMenuItems(p,["-","close"])})));this.put("fontFamily",new Menu(mxUtils.bind(this,function(p,q){function G(M){var P=encodeURIComponent(M.name)+(null==M.url?"":"@"+encodeURIComponent(M.url));+if(!H[P]){for(var R=M.name,T=0;null!=y[R.toLowerCase()];)R=M.name+" ("+ ++T+")";null==k[P]&&(F.push({name:M.name,url:M.url,label:R,title:M.url}),y[R.toLowerCase()]=M,k[P]=M)}}for(var E=mxUtils.bind(this,function(M,P,R,T,V){var W=d.editor.graph,X=this.styleChange(p,null!=T?T:M,[mxConstants.STYLE_FONTFAMILY,"fontSource","FType"],[M,null!=P?encodeURIComponent(P):null,null],null,q,function(){W.setFont(M,P);d.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_FONTFAMILY,"fontSource",+"FType"],"values",[M,null!=P?encodeURIComponent(P):null,null],"cells",[W.cellEditor.getEditingCell()]))},function(){W.updateLabelElements(W.getSelectionCells(),function(Y){Y.removeAttribute("face");Y.style.fontFamily=null;"PRE"==Y.nodeName&&W.replaceElement(Y,"div")})});R&&(R=document.createElement("img"),R.className="geAdaptiveAsset",R.setAttribute("src",Editor.crossImage),R.setAttribute("title",mxResources.get("delete")),R.setAttribute("valign","absmiddle"),R.setAttribute("border","0"),R.style.position=+"relative",R.style.top="2px",R.style.width="14px",R.style.cursor="default",R.style.margin="0 3px",X.firstChild.nextSibling.nextSibling.appendChild(R),mxEvent.addListener(R,mxClient.IS_POINTER?"pointerup":"mouseup",mxUtils.bind(this,function(Y){this.removeCustomFont(M,P);this.editorUi.hideCurrentMenu();mxEvent.consume(Y)})));Graph.addFont(M,P);X.firstChild.nextSibling.style.fontFamily=M;V=null!=T?T:M;null!=P&&(V+=" ("+P+")");X.setAttribute("title",V)}),H={},L=0;L<this.defaultFonts.length;L++){var K=+this.defaultFonts[L];"string"===typeof K?E(K):null!=K.fontFamily&&null!=K.fontUrl&&(H[encodeURIComponent(K.fontFamily)+"@"+encodeURIComponent(K.fontUrl)]=!0,E(K.fontFamily,K.fontUrl))}p.addSeparator(q);var k={},y={},F=[];for(L=0;L<this.customFonts.length;L++)G(this.customFonts[L]);F.sort(function(M,P){return M.label<P.label?-1:M.label>P.label?1:0});if(0<F.length){for(L=0;L<F.length;L++)E(F[L].name,F[L].url,!0,F[L].label);p.addSeparator(q)}p.addItem(mxResources.get("reset"),null,mxUtils.bind(this,+function(){this.customFonts=[];d.fireEvent(new mxEventObject("customFontsChanged"))}),q);p.addSeparator(q);p.addItem(mxResources.get("custom")+"...",null,mxUtils.bind(this,function(){var M=this.editorUi.editor.graph,P=M.getStylesheet().getDefaultVertexStyle()[mxConstants.STYLE_FONTFAMILY],R="s",T=null;if(M.isEditing()){var V=M.getSelectedEditingElement();if(null!=V){var W=mxUtils.getCurrentStyle(V);if(null!=W){P=mxUtils.getCssFontFamily(W.fontFamily);W=M.getView().getState(M.cellEditor.getEditingCell());+T=null!=W?W.style.fontSource:null;for(null!=T&&(T=decodeURIComponent(T));null!=V&&V!=M.cellEditor.textarea;){if(V.nodeType==mxConstants.NODETYPE_ELEMENT)if(null!=V.getAttribute("data-font-src")){T=V.getAttribute("data-font-src");break}else if(V.getAttribute("face")==P){T=null;break}V=V.parentNode}null!=T&&(Graph.isGoogleFontUrl(T)?(T=null,R="g"):R="w")}}}else W=M.getView().getState(M.getSelectionCell()),null!=W&&(P=W.style[mxConstants.STYLE_FONTFAMILY]||P,V=W.style.fontSource,null!=V&&(V=decodeURIComponent(V),+Graph.isGoogleFontUrl(V)?R="g":(R="w",T=V)));null!=T&&T.substring(0,PROXY_URL.length)==PROXY_URL&&(T=decodeURIComponent(T.substr((PROXY_URL+"?url=").length)));var X=null;document.activeElement==M.cellEditor.textarea&&(X=M.cellEditor.saveSelection());P=new FontDialog(this.editorUi,P,T,R,mxUtils.bind(this,function(Y,Z,da){null!=X&&(M.cellEditor.restoreSelection(X),X=null);if(null!=Y&&0<Y.length)if(this.addCustomFont(Y,Z),M.isEditing())M.setFont(Y,Z);else{M.getModel().beginUpdate();try{M.stopEditing(!1),+M.setCellStyles(mxConstants.STYLE_FONTFAMILY,Y),M.setCellStyles("fontSource",null!=Z?encodeURIComponent(Z):null),M.setCellStyles("FType",null)}finally{M.getModel().endUpdate()}}}));this.editorUi.showDialog(P.container,380,130+(Editor.enableWebFonts?70:0)+("0"!=urlParams.isGoogleFontsEnabled?50:0),!0,!0);P.init()}),q,null,!0)})))}})();function DiagramPage(b,f){this.node=b;null!=f?this.node.setAttribute("id",f):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.diagramModified=!1;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(b){null==b?this.node.removeAttribute("name"):this.node.setAttribute("name",b)};DiagramPage.prototype.setDiagramModified=function(b){this.diagramModified=b};DiagramPage.prototype.isDiagramModified=function(){return this.diagramModified};function RenamePage(b,f,m){this.ui=b;this.page=f;this.previous=this.name=m}RenamePage.prototype.execute=function(){var b=this.page.getName();this.page.setName(this.previous);this.name=this.previous;this.previous=b;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};function MovePage(b,f,m){this.ui=b;this.oldIndex=f;this.newIndex=m}MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var b=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=b;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))};function SelectPage(b,f,m){this.ui=b;this.previousPage=this.page=f;null!=f&&(this.ui.updatePageRoot(f),null!=m&&(f.viewState=m))}@@ -14125,35 +14130,35 @@ d),m.addSeparator(d),this.currentPage==b&&1<this.pages.length&&this.menus.addSubb.beforeDecode=function(f,m,d){d.ui=f.ui;d.relatedPage=d.ui.getPageById(m.getAttribute("relatedPage"));if(null==d.relatedPage){var t=m.ownerDocument.createElement("diagram");t.setAttribute("id",m.getAttribute("relatedPage"));t.setAttribute("name",m.getAttribute("name"));d.relatedPage=new DiagramPage(t);t=m.getAttribute("viewState");null!=t&&(d.relatedPage.viewState=JSON.parse(t),m.removeAttribute("viewState"));m=m.cloneNode(!0);t=m.firstChild;if(null!=t)for(d.relatedPage.root=f.decodeCell(t,!1),d=t.nextSibling,t.parentNode.removeChild(t),t=d;null!=t;){d=t.nextSibling;if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var x=t.getAttribute("id");null==f.lookup(x)&&f.decodeCell(t)}t.parentNode.removeChild(t);t=d}}return m};b.afterDecode=function(f,m,d){d.index=d.previousIndex;return d};mxCodecRegistry.register(b)})();(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(d,t,x,v,B){t=null!=t?t:!1;null==x&&(x=this.getFoldableCells(this.getSelectionCells(),d));this.stopEditing();this.model.beginUpdate();try{for(var J=x.slice(),N=0;N<x.length;N++)"1"==mxUtils.getValue(this.getCurrentCellStyle(x[N]),"treeFolding","0")&&this.foldTreeCell(d,x[N]);x=J;x=b.apply(this,arguments)}finally{this.model.endUpdate()}return x};Graph.prototype.foldTreeCell=function(d,t){this.model.beginUpdate();try{var x=[];this.traverse(t,!0,mxUtils.bind(this,function(B,J){var N=null!=J&&this.isTreeEdge(J);N&&x.push(J);B==t||null!=J&&!N||x.push(B);return(null==J||N)&&(B==t||!this.model.isCollapsed(B))}));this.model.setCollapsed(t,d);for(var v=0;v<x.length;v++)this.model.setVisible(x[v],!d)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(d){return!this.isEdgeIgnored(d)};Graph.prototype.getTreeEdges=function(d,t,x,v,B,J){return this.model.filterCells(this.getEdges(d,t,x,v,B,J),mxUtils.bind(this,-function(N){return this.isTreeEdge(N)}))};Graph.prototype.getIncomingTreeEdges=function(d,t){return this.getTreeEdges(d,t,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(d,t){return this.getTreeEdges(d,t,!1,!0,!1)};var f=EditorUi.prototype.init;EditorUi.prototype.init=function(){f.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function d(H){return n.isVertex(H)&&x(H)}function t(H){var M=!1;null!=H&&(M="1"==-l.getCurrentCellStyle(H).treeMoving);return M}function x(H){var M=!1;null!=H&&(H=n.getParent(H),M=l.view.getState(H),M="tree"==(null!=M?M.style:l.getCellStyle(H)).containerType);return M}function v(H){var M=!1;null!=H&&(H=n.getParent(H),M=l.view.getState(H),l.view.getState(H),M=null!=(null!=M?M.style:l.getCellStyle(H)).childLayout);return M}function B(H){H=l.view.getState(H);if(null!=H){var M=l.getIncomingTreeEdges(H.cell);if(0<M.length&&(M=l.view.getState(M[0]),null!=M&&(M=M.absolutePoints,null!=-M&&0<M.length&&(M=M[M.length-1],null!=M)))){if(M.y==H.y&&Math.abs(M.x-H.getCenterX())<H.width/2)return mxConstants.DIRECTION_SOUTH;if(M.y==H.y+H.height&&Math.abs(M.x-H.getCenterX())<H.width/2)return mxConstants.DIRECTION_NORTH;if(M.x>H.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function J(H,M){M=null!=M?M:!0;l.model.beginUpdate();try{var L=l.model.getParent(H),k=l.getIncomingTreeEdges(H),y=l.cloneCells([k[0],H]);l.model.setTerminal(y[0],l.model.getTerminal(k[0],-!0),!0);var F=B(H),K=L.geometry;F==mxConstants.DIRECTION_SOUTH||F==mxConstants.DIRECTION_NORTH?y[1].geometry.x+=M?H.geometry.width+10:-y[1].geometry.width-10:y[1].geometry.y+=M?H.geometry.height+10:-y[1].geometry.height-10;l.view.currentRoot!=L&&(y[1].geometry.x-=K.x,y[1].geometry.y-=K.y);var P=l.view.getState(H),R=l.view.scale;if(null!=P){var T=mxRectangle.fromRectangle(P);F==mxConstants.DIRECTION_SOUTH||F==mxConstants.DIRECTION_NORTH?T.x+=(M?H.geometry.width+10:-y[1].geometry.width-10)*R:T.y+=(M?-H.geometry.height+10:-y[1].geometry.height-10)*R;var V=l.getOutgoingTreeEdges(l.model.getTerminal(k[0],!0));if(null!=V){for(var W=F==mxConstants.DIRECTION_SOUTH||F==mxConstants.DIRECTION_NORTH,X=K=k=0;X<V.length;X++){var Z=l.model.getTerminal(V[X],!1);if(F==B(Z)){var Y=l.view.getState(Z);Z!=H&&null!=Y&&(W&&M!=Y.getCenterX()<P.getCenterX()||!W&&M!=Y.getCenterY()<P.getCenterY())&&mxUtils.intersects(T,Y)&&(k=10+Math.max(k,(Math.min(T.x+T.width,Y.x+Y.width)-Math.max(T.x,Y.x))/R),K=10+Math.max(K,(Math.min(T.y+-T.height,Y.y+Y.height)-Math.max(T.y,Y.y))/R))}}W?K=0:k=0;for(X=0;X<V.length;X++)if(Z=l.model.getTerminal(V[X],!1),F==B(Z)&&(Y=l.view.getState(Z),Z!=H&&null!=Y&&(W&&M!=Y.getCenterX()<P.getCenterX()||!W&&M!=Y.getCenterY()<P.getCenterY()))){var da=[];l.traverse(Y.cell,!0,function(ea,ka){var ba=null!=ka&&l.isTreeEdge(ka);ba&&da.push(ka);(null==ka||ba)&&da.push(ea);return null==ka||ba});l.moveCells(da,(M?1:-1)*k,(M?1:-1)*K)}}}return l.addCells(y,L)}finally{l.model.endUpdate()}}function N(H){l.model.beginUpdate();-try{var M=B(H),L=l.getIncomingTreeEdges(H),k=l.cloneCells([L[0],H]);l.model.setTerminal(L[0],k[1],!1);l.model.setTerminal(k[0],k[1],!0);l.model.setTerminal(k[0],H,!1);var y=l.model.getParent(H),F=y.geometry,K=[];l.view.currentRoot!=y&&(k[1].geometry.x-=F.x,k[1].geometry.y-=F.y);l.traverse(H,!0,function(T,V){var W=null!=V&&l.isTreeEdge(V);W&&K.push(V);(null==V||W)&&K.push(T);return null==V||W});var P=H.geometry.width+40,R=H.geometry.height+40;M==mxConstants.DIRECTION_SOUTH?P=0:M==mxConstants.DIRECTION_NORTH?-(P=0,R=-R):M==mxConstants.DIRECTION_WEST?(P=-P,R=0):M==mxConstants.DIRECTION_EAST&&(R=0);l.moveCells(K,P,R);return l.addCells(k,y)}finally{l.model.endUpdate()}}function I(H,M){l.model.beginUpdate();try{var L=l.model.getParent(H),k=l.getIncomingTreeEdges(H),y=B(H);0==k.length&&(k=[l.createEdge(L,null,"",null,null,l.createCurrentEdgeStyle())],y=M);var F=l.cloneCells([k[0],H]);l.model.setTerminal(F[0],H,!0);null==l.model.getTerminal(F[0],!1)&&(l.model.setTerminal(F[0],F[1],!1),l.applyNewEdgeStyle(F[1],-[F[0]],y));k=l.getOutgoingTreeEdges(H);var K=L.geometry;M=[];l.view.currentRoot==L&&(K=new mxRectangle);for(var P=0;P<k.length;P++){var R=l.model.getTerminal(k[P],!1);null!=R&&M.push(R)}var T=l.view.getBounds(M),V=l.view.translate,W=l.view.scale;y==mxConstants.DIRECTION_SOUTH?(F[1].geometry.x=null==T?H.geometry.x+(H.geometry.width-F[1].geometry.width)/2:(T.x+T.width)/W-V.x-K.x+10,F[1].geometry.y+=F[1].geometry.height-K.y+40):y==mxConstants.DIRECTION_NORTH?(F[1].geometry.x=null==T?H.geometry.x+(H.geometry.width--F[1].geometry.width)/2:(T.x+T.width)/W-V.x+-K.x+10,F[1].geometry.y-=F[1].geometry.height+K.y+40):(F[1].geometry.x=y==mxConstants.DIRECTION_WEST?F[1].geometry.x-(F[1].geometry.width+K.x+40):F[1].geometry.x+(F[1].geometry.width-K.x+40),F[1].geometry.y=null==T?H.geometry.y+(H.geometry.height-F[1].geometry.height)/2:(T.y+T.height)/W-V.y+-K.y+10);return l.addCells(F,L)}finally{l.model.endUpdate()}}function c(H,M,L){H=l.getOutgoingTreeEdges(H);L=l.view.getState(L);var k=[];if(null!=L&&null!=H){for(var y=-0;y<H.length;y++){var F=l.view.getState(l.model.getTerminal(H[y],!1));null!=F&&(!M&&Math.min(F.x+F.width,L.x+L.width)>=Math.max(F.x,L.x)||M&&Math.min(F.y+F.height,L.y+L.height)>=Math.max(F.y,L.y))&&k.push(F)}k.sort(function(K,P){return M?K.x+K.width-P.x-P.width:K.y+K.height-P.y-P.height})}return k}function e(H,M){var L=B(H),k=M==mxConstants.DIRECTION_EAST||M==mxConstants.DIRECTION_WEST;(L==mxConstants.DIRECTION_EAST||L==mxConstants.DIRECTION_WEST)==k&&L!=M?g.actions.get("selectParent").funct():L==-M?(M=l.getOutgoingTreeEdges(H),null!=M&&0<M.length&&l.setSelectionCell(l.model.getTerminal(M[0],!1))):(L=l.getIncomingTreeEdges(H),null!=L&&0<L.length&&(k=c(l.model.getTerminal(L[0],!0),k,H),H=l.view.getState(H),null!=H&&(H=mxUtils.indexOf(k,H),0<=H&&(H+=M==mxConstants.DIRECTION_NORTH||M==mxConstants.DIRECTION_WEST?-1:1,0<=H&&H<=k.length-1&&l.setSelectionCell(k[H].cell)))))}var g=this,l=g.editor.graph,n=l.getModel(),u=g.menus.createPopupMenu;g.menus.createPopupMenu=function(H,M,L){u.apply(this,arguments);-if(1==l.getSelectionCount()){M=l.getSelectionCell();var k=l.getOutgoingTreeEdges(M);H.addSeparator();0<k.length&&(d(l.getSelectionCell())&&this.addMenuItems(H,["selectChildren"],null,L),this.addMenuItems(H,["selectDescendants"],null,L));d(l.getSelectionCell())?(H.addSeparator(),0<l.getIncomingTreeEdges(M).length&&this.addMenuItems(H,["selectSiblings","selectParent"],null,L)):0<l.model.getEdgeCount(M)&&this.addMenuItems(H,["selectConnections"],null,L)}};g.actions.addAction("selectChildren",function(H){if(l.isEnabled()&&-1==l.getSelectionCount()){var M=l.getSelectionCell();H=mxEvent.isControlDown(H)?null:l.getOutgoingTreeEdges(M);if(null!=H&&0<H.length){M=[];for(var L=0;L<H.length;L++)M.push(l.model.getTerminal(H[L],!1));l.setSelectionCells(M)}else l.setSelectionCells(l.model.getChildren(M))}},null,null,"Alt+Shift+C");g.actions.addAction("selectDescendants",function(H){var M=l.getSelectionCell();if(l.isEnabled()&&null!=M){var L=[];mxEvent.isControlDown(H)||l.traverse(M,!0,function(k,y){var F=null!=y&&l.isTreeEdge(y);-F&&mxEvent.isControlDown(H)&&L.push(y);(null==y||F)&&L.push(k);return null==y||F});if(0==L.length||1==L.length&&L[0]==M)L=l.model.getDescendants(M);l.setSelectionCells(L)}},null,null,"Alt+Shift+X");g.actions.addAction("selectParent",function(H){var M=l.getSelectionCell();l.isEnabled()&&null!=M&&(H=mxEvent.isControlDown(H)?null:l.getIncomingTreeEdges(M),null!=H&&0<H.length?l.setSelectionCell(l.model.getTerminal(H[0],!0)):l.selectParentCell())},null,null,"Alt+Shift+P");g.actions.addAction("selectSiblings",-function(H){if(l.isEnabled()&&1==l.getSelectionCount()){var M=l.getSelectionCell(),L=mxEvent.isControlDown(H)?null:l.getIncomingTreeEdges(M);H=[];if(null!=L&&0<L.length&&(L=l.getOutgoingTreeEdges(l.model.getTerminal(L[0],!0)),null!=L))for(var k=0;k<L.length;k++)H.push(l.model.getTerminal(L[k],!1));0==H.length&&(H=l.model.getChildren(l.model.getParent(M)));l.setSelectionCells(H)}},null,null,"Alt+Shift+S");var z=l.removeCells;l.removeCells=function(H,M){M=null!=M?M:!0;null==H&&(H=this.getDeletableCells(this.getSelectionCells()));-M&&(H=this.getDeletableCells(this.addAllEdges(H)));for(var L=[],k=0;k<H.length;k++){var y=H[k];n.isEdge(y)&&x(y)&&(L.push(y),y=n.getTerminal(y,!1));if(d(y)){var F=[];l.traverse(y,!0,function(K,P){var R=null!=P&&l.isTreeEdge(P);R&&F.push(P);(null==P||R)&&F.push(K);return null==P||R});0<F.length&&(L=L.concat(F),y=l.getIncomingTreeEdges(H[k]),H=H.concat(y))}else null!=y&&L.push(H[k])}H=L;return z.apply(this,arguments)};g.hoverIcons.getStateAt=function(H,M,L){return d(H.cell)?null:this.graph.view.getState(this.graph.getCellAt(M,-L))};var D=l.duplicateCells;l.duplicateCells=function(H,M){H=null!=H?H:this.getSelectionCells();for(var L=H.slice(0),k=0;k<L.length;k++){var y=l.view.getState(L[k]);if(null!=y&&d(y.cell)){var F=l.getIncomingTreeEdges(y.cell);for(y=0;y<F.length;y++)mxUtils.remove(F[y],H)}}this.model.beginUpdate();try{var K=D.call(this,H,M);if(K.length==H.length)for(k=0;k<H.length;k++)if(d(H[k])){var P=l.getIncomingTreeEdges(K[k]);F=l.getIncomingTreeEdges(H[k]);if(0==P.length&&0<F.length){var R=this.cloneCell(F[0]);-this.addEdge(R,l.getDefaultParent(),this.model.getTerminal(F[0],!0),K[k])}}}finally{this.model.endUpdate()}return K};var C=l.moveCells;l.moveCells=function(H,M,L,k,y,F,K){for(var P=null,R=[],T=0;T<H.length;T++)(t(H[T])||d(H[T]))&&!v(H[T])&&this.isCellCollapsed(H[T])?R=R.concat(this.getSubtree(H[T])):R.push(H[T]);H=mxUtils.removeDuplicates(R);this.model.beginUpdate();try{R=y;var V=this.getCurrentCellStyle(y);if(null!=H&&d(y)&&"1"==mxUtils.getValue(V,"treeFolding","0")){for(T=0;T<H.length;T++)if(d(H[T])||-l.model.isEdge(H[T])&&null==l.model.getTerminal(H[T],!0)){y=l.model.getParent(H[T]);break}if(null!=R&&y!=R&&null!=this.view.getState(H[0])){var W=l.getIncomingTreeEdges(H[0]);if(0<W.length){var X=l.view.getState(l.model.getTerminal(W[0],!0));if(null!=X){var Z=l.view.getState(R);null!=Z&&(M=(Z.getCenterX()-X.getCenterX())/l.view.scale,L=(Z.getCenterY()-X.getCenterY())/l.view.scale)}}}}P=C.apply(this,arguments);if(null!=P&&null!=H&&P.length==H.length)for(T=0;T<P.length;T++)if(this.model.isEdge(P[T]))d(R)&&+function(N){return this.isTreeEdge(N)}))};Graph.prototype.getIncomingTreeEdges=function(d,t){return this.getTreeEdges(d,t,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(d,t){return this.getTreeEdges(d,t,!1,!0,!1)};var f=EditorUi.prototype.init;EditorUi.prototype.init=function(){f.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function d(H){return n.isVertex(H)&&x(H)}function t(H){var L=!1;null!=H&&(L="1"==+l.getCurrentCellStyle(H).treeMoving);return L}function x(H){var L=!1;null!=H&&(H=n.getParent(H),L=l.view.getState(H),L="tree"==(null!=L?L.style:l.getCellStyle(H)).containerType);return L}function v(H){var L=!1;null!=H&&(H=n.getParent(H),L=l.view.getState(H),l.view.getState(H),L=null!=(null!=L?L.style:l.getCellStyle(H)).childLayout);return L}function B(H){H=l.view.getState(H);if(null!=H){var L=l.getIncomingTreeEdges(H.cell);if(0<L.length&&(L=l.view.getState(L[0]),null!=L&&(L=L.absolutePoints,null!=+L&&0<L.length&&(L=L[L.length-1],null!=L)))){if(L.y==H.y&&Math.abs(L.x-H.getCenterX())<H.width/2)return mxConstants.DIRECTION_SOUTH;if(L.y==H.y+H.height&&Math.abs(L.x-H.getCenterX())<H.width/2)return mxConstants.DIRECTION_NORTH;if(L.x>H.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function J(H,L){L=null!=L?L:!0;l.model.beginUpdate();try{var K=l.model.getParent(H),k=l.getIncomingTreeEdges(H),y=l.cloneCells([k[0],H]);l.model.setTerminal(y[0],l.model.getTerminal(k[0],+!0),!0);var F=B(H),M=K.geometry;F==mxConstants.DIRECTION_SOUTH||F==mxConstants.DIRECTION_NORTH?y[1].geometry.x+=L?H.geometry.width+10:-y[1].geometry.width-10:y[1].geometry.y+=L?H.geometry.height+10:-y[1].geometry.height-10;l.view.currentRoot!=K&&(y[1].geometry.x-=M.x,y[1].geometry.y-=M.y);var P=l.view.getState(H),R=l.view.scale;if(null!=P){var T=mxRectangle.fromRectangle(P);F==mxConstants.DIRECTION_SOUTH||F==mxConstants.DIRECTION_NORTH?T.x+=(L?H.geometry.width+10:-y[1].geometry.width-10)*R:T.y+=(L?+H.geometry.height+10:-y[1].geometry.height-10)*R;var V=l.getOutgoingTreeEdges(l.model.getTerminal(k[0],!0));if(null!=V){for(var W=F==mxConstants.DIRECTION_SOUTH||F==mxConstants.DIRECTION_NORTH,X=M=k=0;X<V.length;X++){var Y=l.model.getTerminal(V[X],!1);if(F==B(Y)){var Z=l.view.getState(Y);Y!=H&&null!=Z&&(W&&L!=Z.getCenterX()<P.getCenterX()||!W&&L!=Z.getCenterY()<P.getCenterY())&&mxUtils.intersects(T,Z)&&(k=10+Math.max(k,(Math.min(T.x+T.width,Z.x+Z.width)-Math.max(T.x,Z.x))/R),M=10+Math.max(M,(Math.min(T.y++T.height,Z.y+Z.height)-Math.max(T.y,Z.y))/R))}}W?M=0:k=0;for(X=0;X<V.length;X++)if(Y=l.model.getTerminal(V[X],!1),F==B(Y)&&(Z=l.view.getState(Y),Y!=H&&null!=Z&&(W&&L!=Z.getCenterX()<P.getCenterX()||!W&&L!=Z.getCenterY()<P.getCenterY()))){var da=[];l.traverse(Z.cell,!0,function(ea,ka){var ba=null!=ka&&l.isTreeEdge(ka);ba&&da.push(ka);(null==ka||ba)&&da.push(ea);return null==ka||ba});l.moveCells(da,(L?1:-1)*k,(L?1:-1)*M)}}}return l.addCells(y,K)}finally{l.model.endUpdate()}}function N(H){l.model.beginUpdate();+try{var L=B(H),K=l.getIncomingTreeEdges(H),k=l.cloneCells([K[0],H]);l.model.setTerminal(K[0],k[1],!1);l.model.setTerminal(k[0],k[1],!0);l.model.setTerminal(k[0],H,!1);var y=l.model.getParent(H),F=y.geometry,M=[];l.view.currentRoot!=y&&(k[1].geometry.x-=F.x,k[1].geometry.y-=F.y);l.traverse(H,!0,function(T,V){var W=null!=V&&l.isTreeEdge(V);W&&M.push(V);(null==V||W)&&M.push(T);return null==V||W});var P=H.geometry.width+40,R=H.geometry.height+40;L==mxConstants.DIRECTION_SOUTH?P=0:L==mxConstants.DIRECTION_NORTH?+(P=0,R=-R):L==mxConstants.DIRECTION_WEST?(P=-P,R=0):L==mxConstants.DIRECTION_EAST&&(R=0);l.moveCells(M,P,R);return l.addCells(k,y)}finally{l.model.endUpdate()}}function I(H,L){l.model.beginUpdate();try{var K=l.model.getParent(H),k=l.getIncomingTreeEdges(H),y=B(H);0==k.length&&(k=[l.createEdge(K,null,"",null,null,l.createCurrentEdgeStyle())],y=L);var F=l.cloneCells([k[0],H]);l.model.setTerminal(F[0],H,!0);null==l.model.getTerminal(F[0],!1)&&(l.model.setTerminal(F[0],F[1],!1),l.applyNewEdgeStyle(F[1],+[F[0]],y));k=l.getOutgoingTreeEdges(H);var M=K.geometry;L=[];l.view.currentRoot==K&&(M=new mxRectangle);for(var P=0;P<k.length;P++){var R=l.model.getTerminal(k[P],!1);null!=R&&L.push(R)}var T=l.view.getBounds(L),V=l.view.translate,W=l.view.scale;y==mxConstants.DIRECTION_SOUTH?(F[1].geometry.x=null==T?H.geometry.x+(H.geometry.width-F[1].geometry.width)/2:(T.x+T.width)/W-V.x-M.x+10,F[1].geometry.y+=F[1].geometry.height-M.y+40):y==mxConstants.DIRECTION_NORTH?(F[1].geometry.x=null==T?H.geometry.x+(H.geometry.width-+F[1].geometry.width)/2:(T.x+T.width)/W-V.x+-M.x+10,F[1].geometry.y-=F[1].geometry.height+M.y+40):(F[1].geometry.x=y==mxConstants.DIRECTION_WEST?F[1].geometry.x-(F[1].geometry.width+M.x+40):F[1].geometry.x+(F[1].geometry.width-M.x+40),F[1].geometry.y=null==T?H.geometry.y+(H.geometry.height-F[1].geometry.height)/2:(T.y+T.height)/W-V.y+-M.y+10);return l.addCells(F,K)}finally{l.model.endUpdate()}}function c(H,L,K){H=l.getOutgoingTreeEdges(H);K=l.view.getState(K);var k=[];if(null!=K&&null!=H){for(var y=+0;y<H.length;y++){var F=l.view.getState(l.model.getTerminal(H[y],!1));null!=F&&(!L&&Math.min(F.x+F.width,K.x+K.width)>=Math.max(F.x,K.x)||L&&Math.min(F.y+F.height,K.y+K.height)>=Math.max(F.y,K.y))&&k.push(F)}k.sort(function(M,P){return L?M.x+M.width-P.x-P.width:M.y+M.height-P.y-P.height})}return k}function e(H,L){var K=B(H),k=L==mxConstants.DIRECTION_EAST||L==mxConstants.DIRECTION_WEST;(K==mxConstants.DIRECTION_EAST||K==mxConstants.DIRECTION_WEST)==k&&K!=L?g.actions.get("selectParent").funct():K==+L?(L=l.getOutgoingTreeEdges(H),null!=L&&0<L.length&&l.setSelectionCell(l.model.getTerminal(L[0],!1))):(K=l.getIncomingTreeEdges(H),null!=K&&0<K.length&&(k=c(l.model.getTerminal(K[0],!0),k,H),H=l.view.getState(H),null!=H&&(H=mxUtils.indexOf(k,H),0<=H&&(H+=L==mxConstants.DIRECTION_NORTH||L==mxConstants.DIRECTION_WEST?-1:1,0<=H&&H<=k.length-1&&l.setSelectionCell(k[H].cell)))))}var g=this,l=g.editor.graph,n=l.getModel(),u=g.menus.createPopupMenu;g.menus.createPopupMenu=function(H,L,K){u.apply(this,arguments);+if(1==l.getSelectionCount()){L=l.getSelectionCell();var k=l.getOutgoingTreeEdges(L);H.addSeparator();0<k.length&&(d(l.getSelectionCell())&&this.addMenuItems(H,["selectChildren"],null,K),this.addMenuItems(H,["selectDescendants"],null,K));d(l.getSelectionCell())?(H.addSeparator(),0<l.getIncomingTreeEdges(L).length&&this.addMenuItems(H,["selectSiblings","selectParent"],null,K)):0<l.model.getEdgeCount(L)&&this.addMenuItems(H,["selectConnections"],null,K)}};g.actions.addAction("selectChildren",function(H){if(l.isEnabled()&&+1==l.getSelectionCount()){var L=l.getSelectionCell();H=mxEvent.isControlDown(H)?null:l.getOutgoingTreeEdges(L);if(null!=H&&0<H.length){L=[];for(var K=0;K<H.length;K++)L.push(l.model.getTerminal(H[K],!1));l.setSelectionCells(L)}else l.setSelectionCells(l.model.getChildren(L))}},null,null,"Alt+Shift+C");g.actions.addAction("selectDescendants",function(H){var L=l.getSelectionCell();if(l.isEnabled()&&null!=L){var K=[];mxEvent.isControlDown(H)||l.traverse(L,!0,function(k,y){var F=null!=y&&l.isTreeEdge(y);+F&&mxEvent.isControlDown(H)&&K.push(y);(null==y||F)&&K.push(k);return null==y||F});if(0==K.length||1==K.length&&K[0]==L)K=l.model.getDescendants(L);l.setSelectionCells(K)}},null,null,"Alt+Shift+X");g.actions.addAction("selectParent",function(H){var L=l.getSelectionCell();l.isEnabled()&&null!=L&&(H=mxEvent.isControlDown(H)?null:l.getIncomingTreeEdges(L),null!=H&&0<H.length?l.setSelectionCell(l.model.getTerminal(H[0],!0)):l.selectParentCell())},null,null,"Alt+Shift+P");g.actions.addAction("selectSiblings",+function(H){if(l.isEnabled()&&1==l.getSelectionCount()){var L=l.getSelectionCell(),K=mxEvent.isControlDown(H)?null:l.getIncomingTreeEdges(L);H=[];if(null!=K&&0<K.length&&(K=l.getOutgoingTreeEdges(l.model.getTerminal(K[0],!0)),null!=K))for(var k=0;k<K.length;k++)H.push(l.model.getTerminal(K[k],!1));0==H.length&&(H=l.model.getChildren(l.model.getParent(L)));l.setSelectionCells(H)}},null,null,"Alt+Shift+S");var z=l.removeCells;l.removeCells=function(H,L){L=null!=L?L:!0;null==H&&(H=this.getDeletableCells(this.getSelectionCells()));+L&&(H=this.getDeletableCells(this.addAllEdges(H)));for(var K=[],k=0;k<H.length;k++){var y=H[k];n.isEdge(y)&&x(y)&&(K.push(y),y=n.getTerminal(y,!1));if(d(y)){var F=[];l.traverse(y,!0,function(M,P){var R=null!=P&&l.isTreeEdge(P);R&&F.push(P);(null==P||R)&&F.push(M);return null==P||R});0<F.length&&(K=K.concat(F),y=l.getIncomingTreeEdges(H[k]),H=H.concat(y))}else null!=y&&K.push(H[k])}H=K;return z.apply(this,arguments)};g.hoverIcons.getStateAt=function(H,L,K){return d(H.cell)?null:this.graph.view.getState(this.graph.getCellAt(L,+K))};var D=l.duplicateCells;l.duplicateCells=function(H,L){H=null!=H?H:this.getSelectionCells();for(var K=H.slice(0),k=0;k<K.length;k++){var y=l.view.getState(K[k]);if(null!=y&&d(y.cell)){var F=l.getIncomingTreeEdges(y.cell);for(y=0;y<F.length;y++)mxUtils.remove(F[y],H)}}this.model.beginUpdate();try{var M=D.call(this,H,L);if(M.length==H.length)for(k=0;k<H.length;k++)if(d(H[k])){var P=l.getIncomingTreeEdges(M[k]);F=l.getIncomingTreeEdges(H[k]);if(0==P.length&&0<F.length){var R=this.cloneCell(F[0]);+this.addEdge(R,l.getDefaultParent(),this.model.getTerminal(F[0],!0),M[k])}}}finally{this.model.endUpdate()}return M};var C=l.moveCells;l.moveCells=function(H,L,K,k,y,F,M){for(var P=null,R=[],T=0;T<H.length;T++)(t(H[T])||d(H[T]))&&!v(H[T])&&this.isCellCollapsed(H[T])?R=R.concat(this.getSubtree(H[T])):R.push(H[T]);H=mxUtils.removeDuplicates(R);this.model.beginUpdate();try{R=y;var V=this.getCurrentCellStyle(y);if(null!=H&&d(y)&&"1"==mxUtils.getValue(V,"treeFolding","0")){for(T=0;T<H.length;T++)if(d(H[T])||+l.model.isEdge(H[T])&&null==l.model.getTerminal(H[T],!0)){y=l.model.getParent(H[T]);break}if(null!=R&&y!=R&&null!=this.view.getState(H[0])){var W=l.getIncomingTreeEdges(H[0]);if(0<W.length){var X=l.view.getState(l.model.getTerminal(W[0],!0));if(null!=X){var Y=l.view.getState(R);null!=Y&&(L=(Y.getCenterX()-X.getCenterX())/l.view.scale,K=(Y.getCenterY()-X.getCenterY())/l.view.scale)}}}}P=C.apply(this,arguments);if(null!=P&&null!=H&&P.length==H.length)for(T=0;T<P.length;T++)if(this.model.isEdge(P[T]))d(R)&&0>mxUtils.indexOf(P,this.model.getTerminal(P[T],!0))&&this.model.setTerminal(P[T],R,!0);else if(d(H[T])&&(W=l.getIncomingTreeEdges(H[T]),0<W.length))if(!k)d(R)&&0>mxUtils.indexOf(H,this.model.getTerminal(W[0],!0))&&this.model.setTerminal(W[0],R,!0);else if(0==l.getIncomingTreeEdges(P[T]).length){V=R;if(null==V||V==l.model.getParent(H[T]))V=l.model.getTerminal(W[0],!0);k=this.cloneCell(W[0]);this.addEdge(k,l.getDefaultParent(),V,P[T])}}finally{this.model.endUpdate()}return P};if(null!=g.sidebar){var A=-g.sidebar.dropAndConnect;g.sidebar.dropAndConnect=function(H,M,L,k){var y=l.model,F=null;y.beginUpdate();try{if(F=A.apply(this,arguments),d(H))for(var K=0;K<F.length;K++)if(y.isEdge(F[K])&&null==y.getTerminal(F[K],!0)){y.setTerminal(F[K],H,!0);var P=l.getCellGeometry(F[K]);P.points=null;null!=P.getTerminalPoint(!0)&&P.setTerminalPoint(null,!0)}}finally{y.endUpdate()}return F}}var Q={67:g.actions.get("selectChildren"),88:g.actions.get("selectDescendants"),80:g.actions.get("selectParent"),83:g.actions.get("selectSiblings")},-S={67:g.actions.get("copyStyle"),86:g.actions.get("pasteStyle")},U=g.onKeyDown;g.onKeyDown=function(H){try{var M=l.getSelectionCell();if(l.isEnabled()&&!l.isEditing()&&null!=M){var L=mxEvent.isAltDown(H)&&mxEvent.isShiftDown(H)?Q[H.keyCode]:mxEvent.isAltDown(H)?S[H.keyCode]:null;null!=L?(L.funct(H),mxEvent.consume(H)):d(M)&&(L=null,0<l.getIncomingTreeEdges(M).length&&(9==H.which?L=mxEvent.isShiftDown(H)?N(M):I(M):13==H.which&&(L=J(M,!mxEvent.isShiftDown(H)))),null!=L&&0<L.length?(1==L.length&&l.model.isEdge(L[0])?-l.setSelectionCell(l.model.getTerminal(L[0],!1)):l.setSelectionCell(L[L.length-1]),null!=g.hoverIcons&&g.hoverIcons.update(l.view.getState(M)),l.startEditingAtCell(M),mxEvent.consume(H)):37==H.keyCode?(e(M,mxConstants.DIRECTION_WEST),mxEvent.consume(H)):38==H.keyCode?(e(M,mxConstants.DIRECTION_NORTH),mxEvent.consume(H)):39==H.keyCode?(e(M,mxConstants.DIRECTION_EAST),mxEvent.consume(H)):40==H.keyCode&&(e(M,mxConstants.DIRECTION_SOUTH),mxEvent.consume(H)))}}catch(k){g.handleError(k)}mxEvent.isConsumed(H)||-U.apply(this,arguments)};var O=l.connectVertex;l.connectVertex=function(H,M,L,k,y,F,K){var P=l.getIncomingTreeEdges(H);if(d(H)){var R=B(H),T=R==mxConstants.DIRECTION_EAST||R==mxConstants.DIRECTION_WEST,V=M==mxConstants.DIRECTION_EAST||M==mxConstants.DIRECTION_WEST;return R==M||0==P.length?I(H,M):T==V?N(H):J(H,M!=mxConstants.DIRECTION_NORTH&&M!=mxConstants.DIRECTION_WEST)}return O.apply(this,arguments)};l.getSubtree=function(H){var M=[H];!t(H)&&!d(H)||v(H)||l.traverse(H,!0,function(L,k){var y=null!=-k&&l.isTreeEdge(k);y&&0>mxUtils.indexOf(M,k)&&M.push(k);(null==k||y)&&0>mxUtils.indexOf(M,L)&&M.push(L);return null==k||y});return M};var p=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){p.apply(this,arguments);(t(this.state.cell)||d(this.state.cell))&&!v(this.state.cell)&&0<this.graph.getOutgoingTreeEdges(this.state.cell).length&&!this.graph.isCellCollapsed(this.state.cell)?null==this.moveHandle&&(this.moveHandle=mxUtils.createImage(Editor.moveImage),this.moveHandle.setAttribute("title",+g.sidebar.dropAndConnect;g.sidebar.dropAndConnect=function(H,L,K,k){var y=l.model,F=null;y.beginUpdate();try{if(F=A.apply(this,arguments),d(H))for(var M=0;M<F.length;M++)if(y.isEdge(F[M])&&null==y.getTerminal(F[M],!0)){y.setTerminal(F[M],H,!0);var P=l.getCellGeometry(F[M]);P.points=null;null!=P.getTerminalPoint(!0)&&P.setTerminalPoint(null,!0)}}finally{y.endUpdate()}return F}}var Q={67:g.actions.get("selectChildren"),88:g.actions.get("selectDescendants"),80:g.actions.get("selectParent"),83:g.actions.get("selectSiblings")},+S={67:g.actions.get("copyStyle"),86:g.actions.get("pasteStyle")},U=g.onKeyDown;g.onKeyDown=function(H){try{var L=l.getSelectionCell();if(l.isEnabled()&&!l.isEditing()&&null!=L){var K=mxEvent.isAltDown(H)&&mxEvent.isShiftDown(H)?Q[H.keyCode]:mxEvent.isAltDown(H)?S[H.keyCode]:null;null!=K?(K.funct(H),mxEvent.consume(H)):d(L)&&(K=null,0<l.getIncomingTreeEdges(L).length&&(9==H.which?K=mxEvent.isShiftDown(H)?N(L):I(L):13==H.which&&(K=J(L,!mxEvent.isShiftDown(H)))),null!=K&&0<K.length?(1==K.length&&l.model.isEdge(K[0])?+l.setSelectionCell(l.model.getTerminal(K[0],!1)):l.setSelectionCell(K[K.length-1]),null!=g.hoverIcons&&g.hoverIcons.update(l.view.getState(L)),l.startEditingAtCell(L),mxEvent.consume(H)):37==H.keyCode?(e(L,mxConstants.DIRECTION_WEST),mxEvent.consume(H)):38==H.keyCode?(e(L,mxConstants.DIRECTION_NORTH),mxEvent.consume(H)):39==H.keyCode?(e(L,mxConstants.DIRECTION_EAST),mxEvent.consume(H)):40==H.keyCode&&(e(L,mxConstants.DIRECTION_SOUTH),mxEvent.consume(H)))}}catch(k){g.handleError(k)}mxEvent.isConsumed(H)||+U.apply(this,arguments)};var O=l.connectVertex;l.connectVertex=function(H,L,K,k,y,F,M){var P=l.getIncomingTreeEdges(H);if(d(H)){var R=B(H),T=R==mxConstants.DIRECTION_EAST||R==mxConstants.DIRECTION_WEST,V=L==mxConstants.DIRECTION_EAST||L==mxConstants.DIRECTION_WEST;return R==L||0==P.length?I(H,L):T==V?N(H):J(H,L!=mxConstants.DIRECTION_NORTH&&L!=mxConstants.DIRECTION_WEST)}return O.apply(this,arguments)};l.getSubtree=function(H){var L=[H];!t(H)&&!d(H)||v(H)||l.traverse(H,!0,function(K,k){var y=null!=+k&&l.isTreeEdge(k);y&&0>mxUtils.indexOf(L,k)&&L.push(k);(null==k||y)&&0>mxUtils.indexOf(L,K)&&L.push(K);return null==k||y});return L};var p=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){p.apply(this,arguments);(t(this.state.cell)||d(this.state.cell))&&!v(this.state.cell)&&0<this.graph.getOutgoingTreeEdges(this.state.cell).length&&!this.graph.isCellCollapsed(this.state.cell)?null==this.moveHandle&&(this.moveHandle=mxUtils.createImage(Editor.moveImage),this.moveHandle.setAttribute("title","Move Subtree"),this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="24px",this.moveHandle.style.height="24px",this.graph.container.appendChild(this.moveHandle),this.redrawMoveHandle(),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(H){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(H),mxEvent.getClientY(H),this.graph.getSubtree(this.state.cell));this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(H);this.graph.isMouseDown=!0;g.hoverIcons.reset();mxEvent.consume(H)}))):null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)};var q=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){q.apply(this,arguments);this.redrawMoveHandle()};mxVertexHandler.prototype.redrawMoveHandle=function(){null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:-0)+2+"px",this.moveHandle.style.top=this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var G=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(H){G.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.display=H?"":"none")};var E=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(H,M){E.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=+0)+2+"px",this.moveHandle.style.top=this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var G=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(H){G.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.display=H?"":"none")};var E=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(H,L){E.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var m=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var d=m.apply(this,arguments),t=this.graph,x=this;return d.concat([this.addEntry("tree container",function(){var v=new mxCell("Tree Container",new mxGeometry(0,0,400,320),"swimlane;startSize=20;horizontal=1;containerType=tree;");v.vertex=!0;var B=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');B.vertex=!0;var J=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');J.vertex=!0;var N=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");N.geometry.relative=!0;N.edge=!0;B.insertEdge(N,!0);J.insertEdge(N,!1);v.insert(N);v.insert(B);v.insert(J);return x.createVertexTemplateFromCells([v],v.geometry.width,v.geometry.height,v.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var v=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;startSize=20;horizontal=1;containerType=tree;");v.vertex=!0;var B=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');@@ -14186,22 +14191,22 @@ arguments);var I=this.editorUi;EditorUi.enablePlantUml&&!I.isOffline()&&I.actione=function(g,l,n,u){g.addItem(n,null,mxUtils.bind(this,function(){var z=new CreateGraphDialog(I,n,u);I.showDialog(z.container,620,420,!0,!1);z.init()}),l)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(g,l){for(var n=0;n<c.length;n++)"-"==c[n]?g.addSeparator(l):e(g,l,mxResources.get(c[n])+"...",c[n])})))};EditorUi.prototype.installFormatToolbar=function(I){var c=this.editor.graph,e=document.createElement("div");e.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";c.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(g,l){0<c.getSelectionCount()?(I.appendChild(e),e.innerHTML="Selected: "+c.getSelectionCount()):null!=e.parentNode&&e.parentNode.removeChild(e)}))};var J=!1;EditorUi.prototype.initFormatWindow=function(){if(!J&&null!=this.formatWindow){J=!0;var I=this.formatWindow.window.toggleMinimized,c=240;this.formatWindow.window.toggleMinimized=function(){I.apply(this,arguments);this.minimized?(c=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+c-140+"px"):(this.div.style.width=c+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-c+140)+"px");this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(e){mxEvent.getSource(e)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var N=EditorUi.prototype.init;EditorUi.prototype.init=-function(){function I(y,F,K){var P=n.menus.get(y);F=D.addMenu(mxResources.get(y),mxUtils.bind(this,function(){P.funct.apply(this,arguments)}));F.className="geButton";F.setAttribute("title",mxResources.get(y));n.menus.menuCreated(P,F,"geButton");null!=K&&(F.style.backgroundImage="url("+K+")",F.innerText="");return F}function c(y,F,K,P,R,T){var V=document.createElement("a");V.className="geButton";z.appendChild(V);null!=T?V.style.backgroundImage="url("+T+")":mxUtils.write(V,y);mxEvent.addListener(V,-"click",function(W){"disabled"!=V.getAttribute("disabled")&&F(W);mxEvent.consume(W)});mxEvent.preventDefault(V);null!=P&&V.setAttribute("title",P);null!=R&&(y=function(){R.isEnabled()?V.removeAttribute("disabled"):V.setAttribute("disabled","disabled")},R.addListener("stateChanged",y),u.addListener("enabledChanged",y),y());return V}function e(y,F,K){F=document.createElement("div");F.className="geButtonGroup";for(K=0;K<y.length;K++)null!=y[K]&&F.appendChild(y[K]);z.appendChild(F);return F}function g(){m=+function(){function I(y,F,M){var P=n.menus.get(y);F=D.addMenu(mxResources.get(y),mxUtils.bind(this,function(){P.funct.apply(this,arguments)}));F.className="geButton";F.setAttribute("title",mxResources.get(y));n.menus.menuCreated(P,F,"geButton");null!=M&&(F.style.backgroundImage="url("+M+")",F.innerText="");return F}function c(y,F,M,P,R,T){var V=document.createElement("a");V.className="geButton";z.appendChild(V);null!=T?V.style.backgroundImage="url("+T+")":mxUtils.write(V,y);mxEvent.addListener(V,+"click",function(W){"disabled"!=V.getAttribute("disabled")&&F(W);mxEvent.consume(W)});mxEvent.preventDefault(V);null!=P&&V.setAttribute("title",P);null!=R&&(y=function(){R.isEnabled()?V.removeAttribute("disabled"):V.setAttribute("disabled","disabled")},R.addListener("stateChanged",y),u.addListener("enabledChanged",y),y());return V}function e(y,F,M){F=document.createElement("div");F.className="geButtonGroup";for(M=0;M<y.length;M++)null!=y[M]&&F.appendChild(y[M]);z.appendChild(F);return F}function g(){m=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;z.innerHTML="";var y=1E3>m,F=I("diagram",null,y?Editor.menuImage:null);e([F,c(mxResources.get("shapes"),n.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),n.actions.get("image"),y?Editor.shapesImage:null),c(mxResources.get("format"),n.actions.get("format").funct,null,mxResources.get("format")+" ("+n.actions.get("format").shortcut+")",n.actions.get("image"),y?Editor.formatImage:null)]);F=I("insert",!0,-y?U:null);e([F,c(mxResources.get("delete"),n.actions.get("delete").funct,null,mxResources.get("delete"),n.actions.get("delete"),y?Editor.trashImage:null)]);u.isEnabled()||F.setAttribute("disabled","disabled");M.setAttribute("title",mxResources.get("undo")+" ("+E.shortcut+")");L.setAttribute("title",mxResources.get("redo")+" ("+H.shortcut+")");k.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");411<=m&&(e([M,L]),520<=m&&e([k,640<=m?c("",q.funct,!0,mxResources.get("zoomIn")+" ("++y?U:null);e([F,c(mxResources.get("delete"),n.actions.get("delete").funct,null,mxResources.get("delete"),n.actions.get("delete"),y?Editor.trashImage:null)]);u.isEnabled()||F.setAttribute("disabled","disabled");L.setAttribute("title",mxResources.get("undo")+" ("+E.shortcut+")");K.setAttribute("title",mxResources.get("redo")+" ("+H.shortcut+")");k.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");411<=m&&(e([L,K]),520<=m&&e([k,640<=m?c("",q.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",q,Editor.zoomInImage):null,640<=m?c("",G.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",G,Editor.zoomOutImage):null]));z.appendChild(n.statusContainer);z.appendChild(n.buttonContainer)}N.apply(this,arguments);var l=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=l&&(l.classList.add("geSimple"),l.classList.add("geMinimal"),l.classList.remove("geClassic"));this.sidebar=this.createSidebar(this.sidebarContainer);if(1E3<=m||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])f(this,!0),null!=this.sidebar&&null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search"));EditorUi.windowed&&1E3<=m&&(b(this,!0),this.formatWindow.window.setVisible(!0));var n=this,u=n.editor.graph;n.toolbar=this.createToolbar(n.createDiv("geToolbar"));var z=document.createElement("div");z.className="geMenubarContainer";var D=new Menubar(n,z),C=n.hideCurrentMenu;n.hideCurrentMenu=function(){C.apply(this,arguments);this.editor.graph.popupMenuHandler.hideMenu()};var A=n.descriptorChanged;n.descriptorChanged=function(){A.apply(this,arguments);var y=n.getCurrentFile();if(null!=y&&null!=y.getTitle()){var F=y.getMode();"google"==F?F="googleDrive":"github"==F?F="gitHub":"gitlab"==F?F="gitLab":"onedrive"==F&&(F="oneDrive");F=mxResources.get(F);z.setAttribute("title",y.getTitle()+(null!=F?" ("+F+")":""))}else z.removeAttribute("title")};n.setStatusText(n.editor.getStatus());z.appendChild(n.statusContainer);n.buttonContainer=this.createButtonContainer();z.appendChild(n.buttonContainer);n.menubarContainer=n.buttonContainer;n.tabContainer=this.createTabContainer();var Q=this.createZoomInput(!0),S=n.updateTabContainer;n.updateTabContainer=function(){S.apply(this,arguments);n.tabContainer.appendChild(Q)};var U=Editor.addBoxImage;if(null!=n.hoverIcons){var O=n.hoverIcons.update;n.hoverIcons.update=function(){u.freehand.isDrawing()||O.apply(this,-arguments)}}if(null!=u.freehand){var p=u.freehand.createStyle;u.freehand.createStyle=function(y){return p.apply(this,arguments)+"sketch=0;"}}n.editor.addListener("statusChanged",mxUtils.bind(this,function(){n.setStatusText(n.editor.getStatus())}));n.setStatusText(n.editor.getStatus());var q=n.actions.get("zoomIn"),G=n.actions.get("zoomOut");l=n.actions.get("resetView");var E=n.actions.get("undo"),H=n.actions.get("redo"),M=c("",E.funct,null,"",E,Editor.undoImage),L=c("",H.funct,null,"",H,Editor.redoImage),+arguments)}}if(null!=u.freehand){var p=u.freehand.createStyle;u.freehand.createStyle=function(y){return p.apply(this,arguments)+"sketch=0;"}}n.editor.addListener("statusChanged",mxUtils.bind(this,function(){n.setStatusText(n.editor.getStatus())}));n.setStatusText(n.editor.getStatus());var q=n.actions.get("zoomIn"),G=n.actions.get("zoomOut");l=n.actions.get("resetView");var E=n.actions.get("undo"),H=n.actions.get("redo"),L=c("",E.funct,null,"",E,Editor.undoImage),K=c("",H.funct,null,"",H,Editor.redoImage),k=c("",function(y){mxEvent.isAltDown(y)?(n.hideCurrentMenu(),n.actions.get("customZoom").funct()):(n.hideCurrentMenu(),n.actions.get("smartFit").funct());mxEvent.consume(y)},!0,"",l,Editor.zoomFitImage);n.container.appendChild(n.tabContainer);n.container.appendChild(z);n.updateTabContainer();!EditorUi.windowed&&1E3<=m&&b(this,!0);g();n.addListener("lockedChanged",g);n.addListener("languageChanged",g);n.editor.graph.addListener("enabledChanged",g);mxEvent.addListener(window,"resize",function(){g();null!=n.sidebarWindow&&n.sidebarWindow.window.fit();null!=n.formatWindow&&n.formatWindow.window.fit();null!=n.actions.outlineWindow&&n.actions.outlineWindow.window.fit();null!=n.actions.layersWindow&&n.actions.layersWindow.window.fit();null!=n.menus.chatWindow&&n.menus.chatWindow.window.fit();null!=n.menus.tagsWindow&&n.menus.tagsWindow.window.fit();null!=n.menus.findWindow&&n.menus.findWindow.window.fit();null!=n.menus.findReplaceWindow&&n.menus.findReplaceWindow.window.fit()})}}};(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var f=EditorUi.initTheme;EditorUi.initTheme=function(){f.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();(function(){var b=mxGuide.prototype.move;mxGuide.prototype.move=function(d,t,x,v){var B=t.y,J=t.x,N=!1,I=!1;if(null!=this.states&&null!=d&&null!=t){var c=this,e=new mxCellState,g=this.graph.getView().scale,l=Math.max(2,this.getGuideTolerance()/2);e.x=d.x+J;e.y=d.y+B;e.width=d.width;e.height=d.height;for(var n=[],u=[],z=0;z<this.states.length;z++){var D=this.states[z];D instanceof mxCellState&&(v||!this.graph.isCellSelected(D.cell))&&((e.x>=D.x&&e.x<=D.x+D.width||D.x>=e.x&&D.x<=e.x+e.width)&&(e.y>-D.y+D.height+4||e.y+e.height+4<D.y)?n.push(D):(e.y>=D.y&&e.y<=D.y+D.height||D.y>=e.y&&D.y<=e.y+e.height)&&(e.x>D.x+D.width+4||e.x+e.width+4<D.x)&&u.push(D))}var C=0,A=0,Q=D=0,S=0,U=0,O=0,p=0,q=5*g;if(1<n.length){n.push(e);n.sort(function(M,L){return M.y-L.y});var G=!1;z=e==n[0];g=e==n[n.length-1];if(!z&&!g)for(z=1;z<n.length-1;z++)if(e==n[z]){g=n[z-1];z=n[z+1];D=A=Q=(z.y-g.y-g.height-e.height)/2;break}for(z=0;z<n.length-1;z++){g=n[z];var E=n[z+1],H=e==g||e==E;E=E.y-g.y-g.height;G|=e==g;if(0==A&&0==-C)A=E,C=1;else if(Math.abs(A-E)<=(H||1==z&&G?l:0))C+=1;else if(1<C&&G){n=n.slice(0,z+1);break}else if(3<=n.length-z&&!G)C=0,D=A=0!=Q?Q:0,n.splice(0,0==z?1:z),z=-1;else break;0!=D||H||(A=D=E)}3==n.length&&n[1]==e&&(D=0)}if(1<u.length){u.push(e);u.sort(function(M,L){return M.x-L.x});G=!1;z=e==u[0];g=e==u[u.length-1];if(!z&&!g)for(z=1;z<u.length-1;z++)if(e==u[z]){g=u[z-1];z=u[z+1];O=U=p=(z.x-g.x-g.width-e.width)/2;break}for(z=0;z<u.length-1;z++){g=u[z];E=u[z+1];H=e==g||e==E;E=E.x-g.x-g.width;G|=e==g;-if(0==U&&0==S)U=E,S=1;else if(Math.abs(U-E)<=(H||1==z&&G?l:0))S+=1;else if(1<S&&G){u=u.slice(0,z+1);break}else if(3<=u.length-z&&!G)S=0,O=U=0!=p?p:0,u.splice(0,0==z?1:z),z=-1;else break;0!=O||H||(U=O=E)}3==u.length&&u[1]==e&&(O=0)}l=function(M,L,k,y){var F=[];if(y){y=q;var K=0}else y=0,K=q;F.push(new mxPoint(M.x-y,M.y-K));F.push(new mxPoint(M.x+y,M.y+K));F.push(M);F.push(L);F.push(new mxPoint(L.x-y,L.y-K));F.push(new mxPoint(L.x+y,L.y+K));if(null!=k)return k.points=F,k;M=new mxPolyline(F,mxConstants.GUIDE_COLOR,-mxConstants.GUIDE_STROKEWIDTH);M.dialect=mxConstants.DIALECT_SVG;M.pointerEvents=!1;M.init(c.graph.getView().getOverlayPane());return M};U=function(M,L){if(M&&null!=c.guidesArrHor)for(M=0;M<c.guidesArrHor.length;M++)c.guidesArrHor[M].node.style.visibility="hidden";if(L&&null!=c.guidesArrVer)for(M=0;M<c.guidesArrVer.length;M++)c.guidesArrVer[M].node.style.visibility="hidden"};if(1<S&&S==u.length-1){S=[];p=c.guidesArrHor;N=[];J=0;z=u[0]==e?1:0;G=u[z].y+u[z].height;if(0<O)for(z=0;z<u.length-1;z++)g=+D.y+D.height+4||e.y+e.height+4<D.y)?n.push(D):(e.y>=D.y&&e.y<=D.y+D.height||D.y>=e.y&&D.y<=e.y+e.height)&&(e.x>D.x+D.width+4||e.x+e.width+4<D.x)&&u.push(D))}var C=0,A=0,Q=D=0,S=0,U=0,O=0,p=0,q=5*g;if(1<n.length){n.push(e);n.sort(function(L,K){return L.y-K.y});var G=!1;z=e==n[0];g=e==n[n.length-1];if(!z&&!g)for(z=1;z<n.length-1;z++)if(e==n[z]){g=n[z-1];z=n[z+1];D=A=Q=(z.y-g.y-g.height-e.height)/2;break}for(z=0;z<n.length-1;z++){g=n[z];var E=n[z+1],H=e==g||e==E;E=E.y-g.y-g.height;G|=e==g;if(0==A&&0==+C)A=E,C=1;else if(Math.abs(A-E)<=(H||1==z&&G?l:0))C+=1;else if(1<C&&G){n=n.slice(0,z+1);break}else if(3<=n.length-z&&!G)C=0,D=A=0!=Q?Q:0,n.splice(0,0==z?1:z),z=-1;else break;0!=D||H||(A=D=E)}3==n.length&&n[1]==e&&(D=0)}if(1<u.length){u.push(e);u.sort(function(L,K){return L.x-K.x});G=!1;z=e==u[0];g=e==u[u.length-1];if(!z&&!g)for(z=1;z<u.length-1;z++)if(e==u[z]){g=u[z-1];z=u[z+1];O=U=p=(z.x-g.x-g.width-e.width)/2;break}for(z=0;z<u.length-1;z++){g=u[z];E=u[z+1];H=e==g||e==E;E=E.x-g.x-g.width;G|=e==g;+if(0==U&&0==S)U=E,S=1;else if(Math.abs(U-E)<=(H||1==z&&G?l:0))S+=1;else if(1<S&&G){u=u.slice(0,z+1);break}else if(3<=u.length-z&&!G)S=0,O=U=0!=p?p:0,u.splice(0,0==z?1:z),z=-1;else break;0!=O||H||(U=O=E)}3==u.length&&u[1]==e&&(O=0)}l=function(L,K,k,y){var F=[];if(y){y=q;var M=0}else y=0,M=q;F.push(new mxPoint(L.x-y,L.y-M));F.push(new mxPoint(L.x+y,L.y+M));F.push(L);F.push(K);F.push(new mxPoint(K.x-y,K.y-M));F.push(new mxPoint(K.x+y,K.y+M));if(null!=k)return k.points=F,k;L=new mxPolyline(F,mxConstants.GUIDE_COLOR,+mxConstants.GUIDE_STROKEWIDTH);L.dialect=mxConstants.DIALECT_SVG;L.pointerEvents=!1;L.init(c.graph.getView().getOverlayPane());return L};U=function(L,K){if(L&&null!=c.guidesArrHor)for(L=0;L<c.guidesArrHor.length;L++)c.guidesArrHor[L].node.style.visibility="hidden";if(K&&null!=c.guidesArrVer)for(L=0;L<c.guidesArrVer.length;L++)c.guidesArrVer[L].node.style.visibility="hidden"};if(1<S&&S==u.length-1){S=[];p=c.guidesArrHor;N=[];J=0;z=u[0]==e?1:0;G=u[z].y+u[z].height;if(0<O)for(z=0;z<u.length-1;z++)g=u[z],E=u[z+1],e==g?(J=E.x-g.width-O,N.push(new mxPoint(J+g.width+q,G)),N.push(new mxPoint(E.x-q,G))):e==E?(N.push(new mxPoint(g.x+g.width+q,G)),J=g.x+g.width+O,N.push(new mxPoint(J-q,G))):(N.push(new mxPoint(g.x+g.width+q,G)),N.push(new mxPoint(E.x-q,G)));else g=u[0],z=u[2],J=g.x+g.width+(z.x-g.x-g.width-e.width)/2,N.push(new mxPoint(g.x+g.width+q,G)),N.push(new mxPoint(J-q,G)),N.push(new mxPoint(J+e.width+q,G)),N.push(new mxPoint(z.x-q,G));for(z=0;z<N.length;z+=2)u=N[z],O=N[z+1],u=l(u,O,null!=p?p[z/2]:null),u.node.style.visibility="visible",u.redraw(),S.push(u);for(z=N.length/2;null!=p&&z<p.length;z++)p[z].destroy();c.guidesArrHor=S;J-=d.x;N=!0}else U(!0);if(1<C&&C==n.length-1){S=[];p=c.guidesArrVer;I=[];B=0;z=n[0]==e?1:0;C=n[z].x+n[z].width;if(0<D)for(z=0;z<n.length-1;z++)g=n[z],E=n[z+1],e==g?(B=E.y-g.height-D,I.push(new mxPoint(C,B+g.height+q)),I.push(new mxPoint(C,E.y-q))):e==E?(I.push(new mxPoint(C,g.y+g.height+q)),B=g.y+g.height+D,I.push(new mxPoint(C,B-q))):(I.push(new mxPoint(C,g.y+g.height+q)),I.push(new mxPoint(C,E.y-q)));else g=n[0],z=n[2],B=g.y+g.height+(z.y-g.y-g.height-e.height)/2,I.push(new mxPoint(C,g.y+g.height+q)),I.push(new mxPoint(C,B-q)),I.push(new mxPoint(C,B+e.height+q)),I.push(new mxPoint(C,z.y-q));for(z=0;z<I.length;z+=2)u=I[z],O=I[z+1],u=l(u,O,null!=p?p[z/2]:null,!0),u.node.style.visibility="visible",u.redraw(),S.push(u);for(z=I.length/2;null!=p&&z<p.length;z++)p[z].destroy();c.guidesArrVer=S;B-=d.y;I=!0}else U(!1,!0)}if(N||I)return e=new mxPoint(J,B),n=b.call(this,@@ -14215,8 +14220,8 @@ O=10;var q=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:O=10;p=mxCoe.height:e.width):m?e.height:e.width;if(S)if(g.fillStyle=I.outBkgClr,m){var E=Q-J;0<E&&g.fillRect(0,J,J,E);A<e.height&&g.fillRect(0,A,J,e.height)}else E=Q-J,0<E&&g.fillRect(J,0,E,J),A<e.width&&g.fillRect(A,0,e.width,J);g.fillStyle=I.fontClr;for(S=S?Q:Q%(G*C);S<=A;S+=G*C)if(E=Math.round((S-Q)/C/G),!(S<J||E==p)){p=E;var H=null;0==E%O&&(H=N.formatText(U+E*G)+"");m?n(J-q[Math.abs(E)%O],S,J,S,H):n(S,J-q[Math.abs(E)%O],S,J,H)}g.lineWidth=1;n(m?0:J,m?J:0,J,J);g.fillStyle=I.cornerClr;g.fillRect(0,0,J,J)},z=-1,D=function(){null!=v?(null!=B&&B(z),z=v(u)):u()};this.drawRuler=D;this.sizeListener=f=x(function(){var C=l.container;m?(C=C.offsetHeight+J,e.height!=C&&(e.height=C,c.style.height=C+"px",D())):(C=C.offsetWidth+J,e.width!=C&&(e.width=C,c.style.width=C+"px",D()))},10);this.pageListener=function(){D()};this.scrollListener=d=x(function(){var C=m?l.container.scrollTop:l.container.scrollLeft;N.lastScroll!=C&&(N.lastScroll=C,D())},10);this.unitListener=function(C,A){N.setUnit(A.getProperty("unit"))};l.addListener(mxEvent.SIZE,f);l.container.addEventListener("scroll",d);l.view.addListener("unitChanged",this.unitListener);b.addListener("pageViewChanged",this.pageListener);b.addListener("pageScaleChanged",this.pageListener);b.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(C){I=C;c.style.background=I.bkgClr;u()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(C,A,Q,S){if(m&&4<C.height||!m&&4<C.width){if(null!=N.guidePart)try{g.putImageData(N.guidePart.imgData1,-N.guidePart.x1,N.guidePart.y1),g.putImageData(N.guidePart.imgData2,N.guidePart.x2,N.guidePart.y2),g.putImageData(N.guidePart.imgData3,N.guidePart.x3,N.guidePart.y3)}catch(y){}var U=N.origGuideMove.apply(this,arguments);try{g.lineWidth=.5;g.strokeStyle=I.guideClr;g.setLineDash([2]);if(m){var O=C.y+U.y+J-this.graph.container.scrollTop;var p=0;var q=O+C.height/2;var G=J/2;var E=O+C.height;var H=0;var M=g.getImageData(p,O-1,J,3);n(p,O,J,O);O--;var L=g.getImageData(G,q-1,J,3);n(G,q,J,q);q--;var k=g.getImageData(H,-E-1,J,3);n(H,E,J,E);E--}else O=0,p=C.x+U.x+J-this.graph.container.scrollLeft,q=J/2,G=p+C.width/2,E=0,H=p+C.width,M=g.getImageData(p-1,O,3,J),n(p,O,p,J),p--,L=g.getImageData(G-1,q,3,J),n(G,q,G,J),G--,k=g.getImageData(H-1,E,3,J),n(H,E,H,J),H--;if(null==N.guidePart||N.guidePart.x1!=p||N.guidePart.y1!=O)N.guidePart={imgData1:M,x1:p,y1:O,imgData2:L,x2:G,y2:q,imgData3:k,x3:H,y3:E}}catch(y){}}else U=N.origGuideMove.apply(this,arguments);return U};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=+N.guidePart.x1,N.guidePart.y1),g.putImageData(N.guidePart.imgData2,N.guidePart.x2,N.guidePart.y2),g.putImageData(N.guidePart.imgData3,N.guidePart.x3,N.guidePart.y3)}catch(y){}var U=N.origGuideMove.apply(this,arguments);try{g.lineWidth=.5;g.strokeStyle=I.guideClr;g.setLineDash([2]);if(m){var O=C.y+U.y+J-this.graph.container.scrollTop;var p=0;var q=O+C.height/2;var G=J/2;var E=O+C.height;var H=0;var L=g.getImageData(p,O-1,J,3);n(p,O,J,O);O--;var K=g.getImageData(G,q-1,J,3);n(G,q,J,q);q--;var k=g.getImageData(H,+E-1,J,3);n(H,E,J,E);E--}else O=0,p=C.x+U.x+J-this.graph.container.scrollLeft,q=J/2,G=p+C.width/2,E=0,H=p+C.width,L=g.getImageData(p-1,O,3,J),n(p,O,p,J),p--,K=g.getImageData(G-1,q,3,J),n(G,q,G,J),G--,k=g.getImageData(H-1,E,3,J),n(H,E,H,J),H--;if(null==N.guidePart||N.guidePart.x1!=p||N.guidePart.y1!=O)N.guidePart={imgData1:L,x1:p,y1:O,imgData2:K,x2:G,y2:q,imgData3:k,x3:H,y3:E}}catch(y){}}else U=N.origGuideMove.apply(this,arguments);return U};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){var C=N.origGuideDestroy.apply(this,arguments);if(null!=N.guidePart)try{g.putImageData(N.guidePart.imgData1,N.guidePart.x1,N.guidePart.y1),g.putImageData(N.guidePart.imgData2,N.guidePart.x2,N.guidePart.y2),g.putImageData(N.guidePart.imgData3,N.guidePart.x3,N.guidePart.y3),N.guidePart=null}catch(A){}return C}}mxRuler.prototype.RULER_THICKNESS=14;mxRuler.prototype.unit=mxConstants.POINTS;mxRuler.prototype.setUnit=function(b){this.unit=b;this.drawRuler()};mxRuler.prototype.formatText=function(b){switch(this.unit){case mxConstants.POINTS:return Math.round(b);case mxConstants.MILLIMETERS:return(b/mxConstants.PIXELS_PER_MM).toFixed(1);case mxConstants.METERS:return(b/(1E3*mxConstants.PIXELS_PER_MM)).toFixed(4);case mxConstants.INCHES:return(b/mxConstants.PIXELS_PER_INCH).toFixed(2)}};mxRuler.prototype.destroy=function(){this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.graph.removeListener(this.sizeListener);this.graph.container.removeEventListener("scroll",this.scrollListener);this.graph.view.removeListener(this.unitListener);this.ui.removeListener(this.pageListener);null!=this.container&&this.container.parentNode.removeChild(this.container)};@@ -14227,13 +14232,13 @@ mxDualRuler.prototype.setUnit=function(b){this.vRuler.setUnit(b);this.hRuler.setfunction(q){I=q};this.setAutoScroll=function(q){c=q};this.setOpenFill=function(q){e=q};this.setStopClickEnabled=function(q){n=q};this.setSelectInserted=function(q){u=q};this.setSmoothing=function(q){m=q};this.getSmoothing=function(){return m};this.setPerfectFreehandMode=function(q){C=q};this.isPerfectFreehandMode=function(){return C};this.setBrushSize=function(q){D.size=q};this.getBrushSize=function(){return D.size};var A=function(q){l=q;b.getRubberband().setEnabled(!q);b.graphHandler.setSelectEnabled(!q);b.graphHandler.setMoveEnabled(!q);b.container.style.cursor=q?"crosshair":"";b.fireEvent(new mxEventObject("freehandStateChanged"))};this.startDrawing=function(){A(!0)};this.isDrawing=function(){return l};var Q=mxUtils.bind(this,function(q){if(d){var G=B.length,E=n&&0<v.length&&null!=B&&2>B.length;E||v.push.apply(v,B);B=[];v.push(null);t.push(d);d=null;(E||I)&&this.stopDrawing();I&&(!E||2<=G)&&this.startDrawing();mxEvent.consume(q)}}),S=new mxCell;S.edge=!0;this.getStrokeColor=function(q){var G=null!=z?z:mxUtils.getValue(b.currentVertexStyle,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(b.getCurrentCellStyle(S),mxConstants.STYLE_STROKECOLOR,"#000"));"default"!=G||q||(G=b.shapeForegroundColor);return G};this.setStrokeColor=function(q){z=q};this.createStyle=function(q){var G=";fillColor=none;";C&&(G=";lineShape=1;");G+="strokeColor="+this.getStrokeColor(!0)+";";return mxConstants.STYLE_SHAPE+"="+q+G};this.stopDrawing=function(){if(0<t.length){if(C){for(var q=[],G=0;G<v.length;G++)null!=v[G]&&q.push([v[G].x,-v[G].y]);q=PerfectFreehand.getStroke(q,D);v=[];for(G=0;G<q.length;G++)v.push({x:q[G][0],y:q[G][1]});v.push(null)}q=v[0].x;var E=v[0].x,H=v[0].y,M=v[0].y;for(G=1;G<v.length;G++)null!=v[G]&&(q=Math.max(q,v[G].x),E=Math.min(E,v[G].x),H=Math.max(H,v[G].y),M=Math.min(M,v[G].y));q-=E;H-=M;if(0<q&&0<H){var L=100/q,k=100/H;v.map(function(R){if(null==R)return R;R.x=(R.x-E)*L;R.y=(R.y-M)*k;return R});var y='<shape strokewidth="inherit"><foreground>',F=0;for(G=0;G<v.length;G++){var K=v[G];if(null==K){K=!1;F=-v[F];var P=v[G-1];!J&&N&&(K=F.x-P.x,P=F.y-P.y,K=Math.sqrt(K*K+P*P)<=b.tolerance);if(J||K)y+='<line x="'+F.x.toFixed(2)+'" y="'+F.y.toFixed(2)+'"/>';y+="</path>"+(e||J||K?"<fillstroke/>":"<stroke/>");F=G+1}else y=G==F?y+('<path><move x="'+K.x.toFixed(2)+'" y="'+K.y.toFixed(2)+'"/>'):y+('<line x="'+K.x.toFixed(2)+'" y="'+K.y.toFixed(2)+'"/>')}y+="</foreground></shape>";if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){G=this.createStyle("stencil("+Graph.compress(y)+")");y=b.view.scale;F=b.view.translate;-G=new mxCell("",new mxGeometry(E/y-F.x,M/y-F.y,q/y,H/y),G);G.vertex=1;b.model.beginUpdate();try{G=b.addCell(G),b.fireEvent(new mxEventObject("cellsInserted","cells",[G])),b.fireEvent(new mxEventObject("freehandInserted","cell",G))}finally{b.model.endUpdate()}u&&b.setSelectionCells([G])}}for(G=0;G<t.length;G++)t[G].parentNode.removeChild(t[G]);d=null;t=[];v=[]}A(!1)};b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(q,G){q=G.getProperty("eventName");G=G.getProperty("event");q==mxEvent.MOUSE_MOVE&&+v[G].y]);q=PerfectFreehand.getStroke(q,D);v=[];for(G=0;G<q.length;G++)v.push({x:q[G][0],y:q[G][1]});v.push(null)}q=v[0].x;var E=v[0].x,H=v[0].y,L=v[0].y;for(G=1;G<v.length;G++)null!=v[G]&&(q=Math.max(q,v[G].x),E=Math.min(E,v[G].x),H=Math.max(H,v[G].y),L=Math.min(L,v[G].y));q-=E;H-=L;if(0<q&&0<H){var K=100/q,k=100/H;v.map(function(R){if(null==R)return R;R.x=(R.x-E)*K;R.y=(R.y-L)*k;return R});var y='<shape strokewidth="inherit"><foreground>',F=0;for(G=0;G<v.length;G++){var M=v[G];if(null==M){M=!1;F=+v[F];var P=v[G-1];!J&&N&&(M=F.x-P.x,P=F.y-P.y,M=Math.sqrt(M*M+P*P)<=b.tolerance);if(J||M)y+='<line x="'+F.x.toFixed(2)+'" y="'+F.y.toFixed(2)+'"/>';y+="</path>"+(e||J||M?"<fillstroke/>":"<stroke/>");F=G+1}else y=G==F?y+('<path><move x="'+M.x.toFixed(2)+'" y="'+M.y.toFixed(2)+'"/>'):y+('<line x="'+M.x.toFixed(2)+'" y="'+M.y.toFixed(2)+'"/>')}y+="</foreground></shape>";if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){G=this.createStyle("stencil("+Graph.compress(y)+")");y=b.view.scale;F=b.view.translate;+G=new mxCell("",new mxGeometry(E/y-F.x,L/y-F.y,q/y,H/y),G);G.vertex=1;b.model.beginUpdate();try{G=b.addCell(G),b.fireEvent(new mxEventObject("cellsInserted","cells",[G])),b.fireEvent(new mxEventObject("freehandInserted","cell",G))}finally{b.model.endUpdate()}u&&b.setSelectionCells([G])}}for(G=0;G<t.length;G++)t[G].parentNode.removeChild(t[G]);d=null;t=[];v=[]}A(!1)};b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(q,G){q=G.getProperty("eventName");G=G.getProperty("event");q==mxEvent.MOUSE_MOVE&&l&&(null!=G.sourceState&&G.sourceState.setCursor("crosshair"),G.consume())}));b.addMouseListener({mouseDown:mxUtils.bind(this,function(q,G){if(b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(q=G.getEvent(),l&&!mxEvent.isPopupTrigger(q)&&!mxEvent.isMiddleMouseButton(q)&&!mxEvent.isMultiTouchEvent(q))){var E=parseFloat(b.currentVertexStyle[mxConstants.STYLE_STROKEWIDTH]||1);E=Math.max(1,E*b.view.scale);var H=this.getStrokeColor();d=document.createElementNS("http://www.w3.org/2000/svg","path");-d.setAttribute("fill",C?H:"none");d.setAttribute("pointer-events","none");d.setAttribute("stroke",H);d.setAttribute("stroke-width",E);"1"==b.currentVertexStyle[mxConstants.STYLE_DASHED]&&(H=b.currentVertexStyle[mxConstants.STYLE_DASH_PATTERN]||"3 3",H=H.split(" ").map(function(M){return parseFloat(M)*E}).join(" "),d.setAttribute("stroke-dasharray",H));g=[];q=U(q);O(q);x="M"+q.x+" "+q.y;v.push(q);B=[];d.setAttribute("d",C?PerfectFreehand.getSvgPathFromStroke([[q.x,q.y]],D):x);f.appendChild(d);G.consume()}}),-mouseMove:mxUtils.bind(this,function(q,G){if(null!=d&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){q=G.getEvent();q=U(q);O(q);var E=p(0);if(E)if(v.push(E),C){var H=[];for(E=0;E<v.length;E++)H.push([v[E].x,v[E].y]);B=[];for(var M=2;M<g.length;M+=2)E=p(M),H.push([E.x,E.y]),B.push(E);d.setAttribute("d",PerfectFreehand.getSvgPathFromStroke(H,D))}else{x+=" L"+E.x+" "+E.y;H="";B=[];for(M=2;M<g.length;M+=2)E=p(M),H+=" L"+E.x+" "+E.y,B.push(E);d.setAttribute("d",x+H)}c&&(E=b.view.translate,b.scrollRectToVisible((new mxRectangle(q.x--E.x,q.y-E.y)).grow(20)));G.consume()}}),mouseUp:mxUtils.bind(this,function(q,G){null!=d&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(Q(G.getEvent()),G.consume())})});var U=function(q){return mxUtils.convertPoint(b.container,mxEvent.getClientX(q),mxEvent.getClientY(q))},O=function(q){for(g.push(q);g.length>m;)g.shift()},p=function(q){var G=g.length;if(1===G%2||G>=m){var E=0,H=0,M,L=0;for(M=q;M<G;M++)L++,q=g[M],E+=q.x,H+=q.y;return{x:E/L,y:H/L}}return null}}}+d.setAttribute("fill",C?H:"none");d.setAttribute("pointer-events","none");d.setAttribute("stroke",H);d.setAttribute("stroke-width",E);"1"==b.currentVertexStyle[mxConstants.STYLE_DASHED]&&(H=b.currentVertexStyle[mxConstants.STYLE_DASH_PATTERN]||"3 3",H=H.split(" ").map(function(L){return parseFloat(L)*E}).join(" "),d.setAttribute("stroke-dasharray",H));g=[];q=U(q);O(q);x="M"+q.x+" "+q.y;v.push(q);B=[];d.setAttribute("d",C?PerfectFreehand.getSvgPathFromStroke([[q.x,q.y]],D):x);f.appendChild(d);G.consume()}}),+mouseMove:mxUtils.bind(this,function(q,G){if(null!=d&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())){q=G.getEvent();q=U(q);O(q);var E=p(0);if(E)if(v.push(E),C){var H=[];for(E=0;E<v.length;E++)H.push([v[E].x,v[E].y]);B=[];for(var L=2;L<g.length;L+=2)E=p(L),H.push([E.x,E.y]),B.push(E);d.setAttribute("d",PerfectFreehand.getSvgPathFromStroke(H,D))}else{x+=" L"+E.x+" "+E.y;H="";B=[];for(L=2;L<g.length;L+=2)E=p(L),H+=" L"+E.x+" "+E.y,B.push(E);d.setAttribute("d",x+H)}c&&(E=b.view.translate,b.scrollRectToVisible((new mxRectangle(q.x-+E.x,q.y-E.y)).grow(20)));G.consume()}}),mouseUp:mxUtils.bind(this,function(q,G){null!=d&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(Q(G.getEvent()),G.consume())})});var U=function(q){return mxUtils.convertPoint(b.container,mxEvent.getClientX(q),mxEvent.getClientY(q))},O=function(q){for(g.push(q);g.length>m;)g.shift()},p=function(q){var G=g.length;if(1===G%2||G>=m){var E=0,H=0,L,K=0;for(L=q;L<G;L++)K++,q=g[L],E+=q.x,H+=q.y;return{x:E/K,y:H/K}}return null}}}mxFreehand.prototype.NO_SMOOTHING=1;mxFreehand.prototype.MILD_SMOOTHING=4;mxFreehand.prototype.NORMAL_SMOOTHING=8;mxFreehand.prototype.VERY_SMOOTH_SMOOTHING=12;mxFreehand.prototype.SUPER_SMOOTH_SMOOTHING=16;mxFreehand.prototype.HYPER_SMOOTH_SMOOTHING=20;DrawioUser=function(b,f,m,d,t){this.id=b;this.email=f;this.displayName=m;this.pictureUrl=d;this.locale=t};DrawioComment=function(b,f,m,d,t,x,v){this.file=b;this.id=f;this.content=m;this.modifiedDate=d;this.createdDate=t;this.isResolved=x;this.user=v;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,f,m,d,t){f()};DrawioComment.prototype.editComment=function(b,f,m){f()};DrawioComment.prototype.deleteComment=function(b,f){b()};Graph.prototype.defaultThemes["default-style2"]=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="default"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="default"/><add as="endArrow" value="classic"/><add as="fontSize" value="11"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="rounded" value="1"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="text"><add as="fillColor" value="none"/><add as="gradientColor" value="none"/><add as="strokeColor" value="none"/><add as="align" value="left"/><add as="verticalAlign" value="top"/></add><add as="edgeLabel" extend="text"><add as="labelBackgroundColor" value="default"/><add as="fontSize" value="11"/></add><add as="label"><add as="fontStyle" value="1"/><add as="align" value="left"/><add as="verticalAlign" value="middle"/><add as="spacing" value="2"/><add as="spacingLeft" value="52"/><add as="imageWidth" value="42"/><add as="imageHeight" value="42"/><add as="rounded" value="1"/></add><add as="icon" extend="label"><add as="align" value="center"/><add as="imageAlign" value="center"/><add as="verticalLabelPosition" value="bottom"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="4"/><add as="labelBackgroundColor" value="default"/><add as="spacing" value="0"/><add as="spacingLeft" value="0"/><add as="spacingTop" value="6"/><add as="fontStyle" value="0"/><add as="imageWidth" value="48"/><add as="imageHeight" value="48"/></add><add as="swimlane"><add as="shape" value="swimlane"/><add as="fontSize" value="12"/><add as="fontStyle" value="1"/><add as="startSize" value="23"/></add><add as="group"><add as="verticalAlign" value="top"/><add as="fillColor" value="none"/><add as="strokeColor" value="none"/><add as="gradientColor" value="none"/><add as="pointerEvents" value="0"/></add><add as="ellipse"><add as="shape" value="ellipse"/><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombus"><add as="shape" value="rhombus"/><add as="perimeter" value="rhombusPerimeter"/></add><add as="triangle"><add as="shape" value="triangle"/><add as="perimeter" value="trianglePerimeter"/></add><add as="line"><add as="shape" value="line"/><add as="strokeWidth" value="4"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="verticalLabelPosition" value="bottom"/></add><add as="roundImage" extend="image"><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombusImage" extend="image"><add as="perimeter" value="rhombusPerimeter"/></add><add as="arrow"><add as="shape" value="arrow"/><add as="edgeStyle" value="none"/><add as="fillColor" value="default"/></add><add as="fancy"><add as="shadow" value="1"/><add as="glass" value="1"/></add><add as="gray" extend="fancy"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="blue" extend="fancy"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="green" extend="fancy"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="turquoise" extend="fancy"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="yellow" extend="fancy"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="orange" extend="fancy"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="red" extend="fancy"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="pink" extend="fancy"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="purple" extend="fancy"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add><add as="plain-gray"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="plain-blue"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="plain-green"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="plain-turquoise"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="plain-yellow"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="plain-orange"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="plain-red"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="plain-pink"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="plain-purple"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add></mxStylesheet>').documentElement;Graph.prototype.defaultThemes.darkTheme=Graph.prototype.defaultThemes["default-style2"];LucidImporter={};diff --git a/src/main/webapp/js/sanitizer/purify.min.js b/src/main/webapp/js/sanitizer/purify.min.jsindex b9d442cd4..3bc845738 100644--- a/src/main/webapp/js/sanitizer/purify.min.js+++ b/src/main/webapp/js/sanitizer/purify.min.js@@ -1,2 +1,2 @@-/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */-!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DOMPurify=t()}(this,(function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:r}=Object;let{freeze:i,seal:a,create:l}=Object,{apply:c,construct:s}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),a||(a=function(e){return e}),c||(c=function(e,t,n){return e.apply(t,n)}),s||(s=function(e,t){return new e(...t)});const u=R(Array.prototype.forEach),m=R(Array.prototype.lastIndexOf),p=R(Array.prototype.pop),f=R(Array.prototype.push),d=R(Array.prototype.splice),h=R(String.prototype.toLowerCase),g=R(String.prototype.toString),T=R(String.prototype.match),y=R(String.prototype.replace),E=R(String.prototype.indexOf),A=R(String.prototype.trim),_=R(Object.prototype.hasOwnProperty),S=R(RegExp.prototype.test),b=(N=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(N,t)});var N;function R(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return c(e,t,o)}}function w(e,o){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;t&&t(e,null);let i=o.length;for(;i--;){let t=o[i];if("string"==typeof t){const e=r(t);e!==t&&(n(o)||(o[i]=e),t=e)}e[t]=!0}return e}function O(e){for(let t=0;t<e.length;t++){_(e,t)||(e[t]=null)}return e}function D(t){const n=l(null);for(const[o,r]of e(t)){_(t,o)&&(Array.isArray(r)?n[o]=O(r):r&&"object"==typeof r&&r.constructor===Object?n[o]=D(r):n[o]=r)}return n}function v(e,t){for(;null!==e;){const n=r(e,t);if(n){if(n.get)return R(n.get);if("function"==typeof n.value)return R(n.value)}e=o(e)}return function(){return null}}const L=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),C=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),x=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),M=i(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),k=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),I=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),U=i(["#text"]),z=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),P=i(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),H=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),F=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),W=a(/<%[\w\W]*|[\w\W]*%>/gm),G=a(/\$\{[\w\W]*/gm),Y=a(/^data-[\-\w.\u00B7-\uFFFF]+$/),j=a(/^aria-[\-\w]+$/),X=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),q=a(/^(?:\w+script|data):/i),$=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=a(/^html$/i),V=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var Z=Object.freeze({__proto__:null,ARIA_ATTR:j,ATTR_WHITESPACE:$,CUSTOM_ELEMENT:V,DATA_ATTR:Y,DOCTYPE_NAME:K,ERB_EXPR:W,IS_ALLOWED_URI:X,IS_SCRIPT_OR_DATA:q,MUSTACHE_EXPR:B,TMPLIT_EXPR:G});const J=1,Q=3,ee=7,te=8,ne=9,oe=function(){return"undefined"==typeof window?null:window};var re=function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oe();const o=e=>t(e);if(o.version="3.2.4",o.removed=[],!n||!n.document||n.document.nodeType!==ne||!n.Element)return o.isSupported=!1,o;let{document:r}=n;const a=r,c=a.currentScript,{DocumentFragment:s,HTMLTemplateElement:N,Node:R,Element:O,NodeFilter:B,NamedNodeMap:W=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:G,DOMParser:Y,trustedTypes:j}=n,q=O.prototype,$=v(q,"cloneNode"),V=v(q,"remove"),re=v(q,"nextSibling"),ie=v(q,"childNodes"),ae=v(q,"parentNode");if("function"==typeof N){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let le,ce="";const{implementation:se,createNodeIterator:ue,createDocumentFragment:me,getElementsByTagName:pe}=r,{importNode:fe}=a;let de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};o.isSupported="function"==typeof e&&"function"==typeof ae&&se&&void 0!==se.createHTMLDocument;const{MUSTACHE_EXPR:he,ERB_EXPR:ge,TMPLIT_EXPR:Te,DATA_ATTR:ye,ARIA_ATTR:Ee,IS_SCRIPT_OR_DATA:Ae,ATTR_WHITESPACE:_e,CUSTOM_ELEMENT:Se}=Z;let{IS_ALLOWED_URI:be}=Z,Ne=null;const Re=w({},[...L,...C,...x,...k,...U]);let we=null;const Oe=w({},[...z,...P,...H,...F]);let De=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ve=null,Le=null,Ce=!0,xe=!0,Me=!1,ke=!0,Ie=!1,Ue=!0,ze=!1,Pe=!1,He=!1,Fe=!1,Be=!1,We=!1,Ge=!0,Ye=!1,je=!0,Xe=!1,qe={},$e=null;const Ke=w({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ve=null;const Ze=w({},["audio","video","img","source","image","track"]);let Je=null;const Qe=w({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let ot=nt,rt=!1,it=null;const at=w({},[et,tt,nt],g);let lt=w({},["mi","mo","mn","ms","mtext"]),ct=w({},["annotation-xml"]);const st=w({},["title","style","font","a","script"]);let ut=null;const mt=["application/xhtml+xml","text/html"];let pt=null,ft=null;const dt=r.createElement("form"),ht=function(e){return e instanceof RegExp||e instanceof Function},gt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ft||ft!==e){if(e&&"object"==typeof e||(e={}),e=D(e),ut=-1===mt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,pt="application/xhtml+xml"===ut?g:h,Ne=_(e,"ALLOWED_TAGS")?w({},e.ALLOWED_TAGS,pt):Re,we=_(e,"ALLOWED_ATTR")?w({},e.ALLOWED_ATTR,pt):Oe,it=_(e,"ALLOWED_NAMESPACES")?w({},e.ALLOWED_NAMESPACES,g):at,Je=_(e,"ADD_URI_SAFE_ATTR")?w(D(Qe),e.ADD_URI_SAFE_ATTR,pt):Qe,Ve=_(e,"ADD_DATA_URI_TAGS")?w(D(Ze),e.ADD_DATA_URI_TAGS,pt):Ze,$e=_(e,"FORBID_CONTENTS")?w({},e.FORBID_CONTENTS,pt):Ke,ve=_(e,"FORBID_TAGS")?w({},e.FORBID_TAGS,pt):{},Le=_(e,"FORBID_ATTR")?w({},e.FORBID_ATTR,pt):{},qe=!!_(e,"USE_PROFILES")&&e.USE_PROFILES,Ce=!1!==e.ALLOW_ARIA_ATTR,xe=!1!==e.ALLOW_DATA_ATTR,Me=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ke=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Ie=e.SAFE_FOR_TEMPLATES||!1,Ue=!1!==e.SAFE_FOR_XML,ze=e.WHOLE_DOCUMENT||!1,Fe=e.RETURN_DOM||!1,Be=e.RETURN_DOM_FRAGMENT||!1,We=e.RETURN_TRUSTED_TYPE||!1,He=e.FORCE_BODY||!1,Ge=!1!==e.SANITIZE_DOM,Ye=e.SANITIZE_NAMED_PROPS||!1,je=!1!==e.KEEP_CONTENT,Xe=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||X,ot=e.NAMESPACE||nt,lt=e.MATHML_TEXT_INTEGRATION_POINTS||lt,ct=e.HTML_INTEGRATION_POINTS||ct,De=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(De.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(De.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(De.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ie&&(xe=!1),Be&&(Fe=!0),qe&&(Ne=w({},U),we=[],!0===qe.html&&(w(Ne,L),w(we,z)),!0===qe.svg&&(w(Ne,C),w(we,P),w(we,F)),!0===qe.svgFilters&&(w(Ne,x),w(we,P),w(we,F)),!0===qe.mathMl&&(w(Ne,k),w(we,H),w(we,F))),e.ADD_TAGS&&(Ne===Re&&(Ne=D(Ne)),w(Ne,e.ADD_TAGS,pt)),e.ADD_ATTR&&(we===Oe&&(we=D(we)),w(we,e.ADD_ATTR,pt)),e.ADD_URI_SAFE_ATTR&&w(Je,e.ADD_URI_SAFE_ATTR,pt),e.FORBID_CONTENTS&&($e===Ke&&($e=D($e)),w($e,e.FORBID_CONTENTS,pt)),je&&(Ne["#text"]=!0),ze&&w(Ne,["html","head","body"]),Ne.table&&(w(Ne,["tbody"]),delete ve.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');le=e.TRUSTED_TYPES_POLICY,ce=le.createHTML("")}else void 0===le&&(le=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(j,c)),null!==le&&"string"==typeof ce&&(ce=le.createHTML(""));i&&i(e),ft=e}},Tt=w({},[...C,...x,...M]),yt=w({},[...k,...I]),Et=function(e){f(o.removed,{element:e});try{ae(e).removeChild(e)}catch(t){V(e)}},At=function(e,t){try{f(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Fe||Be)try{Et(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},_t=function(e){let t=null,n=null;if(He)e="<remove></remove>"+e;else{const t=T(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ut&&ot===nt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=le?le.createHTML(e):e;if(ot===nt)try{t=(new Y).parseFromString(o,ut)}catch(e){}if(!t||!t.documentElement){t=se.createDocument(ot,"template",null);try{t.documentElement.innerHTML=rt?ce:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),ot===nt?pe.call(t,ze?"html":"body")[0]:ze?t.documentElement:i},St=function(e){return ue.call(e.ownerDocument||e,e,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT|B.SHOW_PROCESSING_INSTRUCTION|B.SHOW_CDATA_SECTION,null)},bt=function(e){return e instanceof G&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof W)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Nt=function(e){return"function"==typeof R&&e instanceof R};function Rt(e,t,n){u(e,(e=>{e.call(o,t,n,ft)}))}const wt=function(e){let t=null;if(Rt(de.beforeSanitizeElements,e,null),bt(e))return Et(e),!0;const n=pt(e.nodeName);if(Rt(de.uponSanitizeElement,e,{tagName:n,allowedTags:Ne}),e.hasChildNodes()&&!Nt(e.firstElementChild)&&S(/<[/\w]/g,e.innerHTML)&&S(/<[/\w]/g,e.textContent))return Et(e),!0;if(e.nodeType===ee)return Et(e),!0;if(Ue&&e.nodeType===te&&S(/<[/\w]/g,e.data))return Et(e),!0;if(!Ne[n]||ve[n]){if(!ve[n]&&Dt(n)){if(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n))return!1;if(De.tagNameCheck instanceof Function&&De.tagNameCheck(n))return!1}if(je&&!$e[n]){const t=ae(e)||e.parentNode,n=ie(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o){const r=$(n[o],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,re(e))}}}return Et(e),!0}return e instanceof O&&!function(e){let t=ae(e);t&&t.tagName||(t={namespaceURI:ot,tagName:"template"});const n=h(e.tagName),o=h(t.tagName);return!!it[e.namespaceURI]&&(e.namespaceURI===tt?t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===o||lt[o]):Boolean(Tt[n]):e.namespaceURI===et?t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&ct[o]:Boolean(yt[n]):e.namespaceURI===nt?!(t.namespaceURI===tt&&!ct[o])&&!(t.namespaceURI===et&&!lt[o])&&!yt[n]&&(st[n]||!Tt[n]):!("application/xhtml+xml"!==ut||!it[e.namespaceURI]))}(e)?(Et(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!S(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ie&&e.nodeType===Q&&(t=e.textContent,u([he,ge,Te],(e=>{t=y(t,e," ")})),e.textContent!==t&&(f(o.removed,{element:e.cloneNode()}),e.textContent=t)),Rt(de.afterSanitizeElements,e,null),!1):(Et(e),!0)},Ot=function(e,t,n){if(Ge&&("id"===t||"name"===t)&&(n in r||n in dt))return!1;if(xe&&!Le[t]&&S(ye,t));else if(Ce&&S(Ee,t));else if(!we[t]||Le[t]){if(!(Dt(e)&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,e)||De.tagNameCheck instanceof Function&&De.tagNameCheck(e))&&(De.attributeNameCheck instanceof RegExp&&S(De.attributeNameCheck,t)||De.attributeNameCheck instanceof Function&&De.attributeNameCheck(t))||"is"===t&&De.allowCustomizedBuiltInElements&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n)||De.tagNameCheck instanceof Function&&De.tagNameCheck(n))))return!1}else if(Je[t]);else if(S(be,y(n,_e,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==E(n,"data:")||!Ve[e]){if(Me&&!S(Ae,y(n,_e,"")));else if(n)return!1}else;return!0},Dt=function(e){return"annotation-xml"!==e&&T(e,Se)},vt=function(e){Rt(de.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||bt(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:we,forceKeepAttr:void 0};let r=t.length;for(;r--;){const i=t[r],{name:a,namespaceURI:l,value:c}=i,s=pt(a);let m="value"===a?c:A(c);if(n.attrName=s,n.attrValue=m,n.keepAttr=!0,n.forceKeepAttr=void 0,Rt(de.uponSanitizeAttribute,e,n),m=n.attrValue,!Ye||"id"!==s&&"name"!==s||(At(a,e),m="user-content-"+m),Ue&&S(/((--!?|])>)|<\/(style|title)/i,m)){At(a,e);continue}if(n.forceKeepAttr)continue;if(At(a,e),!n.keepAttr)continue;if(!ke&&S(/\/>/i,m)){At(a,e);continue}Ie&&u([he,ge,Te],(e=>{m=y(m,e," ")}));const f=pt(e.nodeName);if(Ot(f,s,m)){if(le&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(l);else switch(j.getAttributeType(f,s)){case"TrustedHTML":m=le.createHTML(m);break;case"TrustedScriptURL":m=le.createScriptURL(m)}try{l?e.setAttributeNS(l,a,m):e.setAttribute(a,m),bt(e)?Et(e):p(o.removed)}catch(e){}}}Rt(de.afterSanitizeAttributes,e,null)},Lt=function e(t){let n=null;const o=St(t);for(Rt(de.beforeSanitizeShadowDOM,t,null);n=o.nextNode();)Rt(de.uponSanitizeShadowNode,n,null),wt(n),vt(n),n.content instanceof s&&e(n.content);Rt(de.afterSanitizeShadowDOM,t,null)};return o.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=null,i=null,l=null;if(rt=!e,rt&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Nt(e)){if("function"!=typeof e.toString)throw b("toString is not a function");if("string"!=typeof(e=e.toString()))throw b("dirty is not a string, aborting")}if(!o.isSupported)return e;if(Pe||gt(t),o.removed=[],"string"==typeof e&&(Xe=!1),Xe){if(e.nodeName){const t=pt(e.nodeName);if(!Ne[t]||ve[t])throw b("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof R)n=_t("\x3c!----\x3e"),r=n.ownerDocument.importNode(e,!0),r.nodeType===J&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(!Fe&&!Ie&&!ze&&-1===e.indexOf("<"))return le&&We?le.createHTML(e):e;if(n=_t(e),!n)return Fe?null:We?ce:""}n&&He&&Et(n.firstChild);const c=St(Xe?e:n);for(;i=c.nextNode();)wt(i),vt(i),i.content instanceof s&&Lt(i.content);if(Xe)return e;if(Fe){if(Be)for(l=me.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(we.shadowroot||we.shadowrootmode)&&(l=fe.call(a,l,!0)),l}let m=ze?n.outerHTML:n.innerHTML;return ze&&Ne["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&S(K,n.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+m),Ie&&u([he,ge,Te],(e=>{m=y(m,e," ")})),le&&We?le.createHTML(m):m},o.setConfig=function(){gt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Pe=!0},o.clearConfig=function(){ft=null,Pe=!1},o.isValidAttribute=function(e,t,n){ft||gt({});const o=pt(e),r=pt(t);return Ot(o,r,n)},o.addHook=function(e,t){"function"==typeof t&&f(de[e],t)},o.removeHook=function(e,t){if(void 0!==t){const n=m(de[e],t);return-1===n?void 0:d(de[e],n,1)[0]}return p(de[e])},o.removeHooks=function(e){de[e]=[]},o.removeAllHooks=function(){de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},o}();return re}));+/*! @license DOMPurify 3.2.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.5/LICENSE */+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DOMPurify=t()}(this,(function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:r}=Object;let{freeze:i,seal:a,create:l}=Object,{apply:c,construct:s}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),a||(a=function(e){return e}),c||(c=function(e,t,n){return e.apply(t,n)}),s||(s=function(e,t){return new e(...t)});const u=R(Array.prototype.forEach),m=R(Array.prototype.lastIndexOf),p=R(Array.prototype.pop),f=R(Array.prototype.push),d=R(Array.prototype.splice),h=R(String.prototype.toLowerCase),g=R(String.prototype.toString),T=R(String.prototype.match),y=R(String.prototype.replace),E=R(String.prototype.indexOf),A=R(String.prototype.trim),_=R(Object.prototype.hasOwnProperty),S=R(RegExp.prototype.test),b=(N=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(N,t)});var N;function R(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return c(e,t,o)}}function w(e,o){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;t&&t(e,null);let i=o.length;for(;i--;){let t=o[i];if("string"==typeof t){const e=r(t);e!==t&&(n(o)||(o[i]=e),t=e)}e[t]=!0}return e}function O(e){for(let t=0;t<e.length;t++){_(e,t)||(e[t]=null)}return e}function D(t){const n=l(null);for(const[o,r]of e(t)){_(t,o)&&(Array.isArray(r)?n[o]=O(r):r&&"object"==typeof r&&r.constructor===Object?n[o]=D(r):n[o]=r)}return n}function v(e,t){for(;null!==e;){const n=r(e,t);if(n){if(n.get)return R(n.get);if("function"==typeof n.value)return R(n.value)}e=o(e)}return function(){return null}}const L=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),C=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),x=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=i(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),M=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),k=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),U=i(["#text"]),z=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),P=i(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),H=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),F=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),W=a(/<%[\w\W]*|[\w\W]*%>/gm),G=a(/\$\{[\w\W]*/gm),Y=a(/^data-[\-\w.\u00B7-\uFFFF]+$/),j=a(/^aria-[\-\w]+$/),X=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),q=a(/^(?:\w+script|data):/i),$=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=a(/^html$/i),V=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var Z=Object.freeze({__proto__:null,ARIA_ATTR:j,ATTR_WHITESPACE:$,CUSTOM_ELEMENT:V,DATA_ATTR:Y,DOCTYPE_NAME:K,ERB_EXPR:W,IS_ALLOWED_URI:X,IS_SCRIPT_OR_DATA:q,MUSTACHE_EXPR:B,TMPLIT_EXPR:G});const J=1,Q=3,ee=7,te=8,ne=9,oe=function(){return"undefined"==typeof window?null:window};var re=function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oe();const o=e=>t(e);if(o.version="3.2.5",o.removed=[],!n||!n.document||n.document.nodeType!==ne||!n.Element)return o.isSupported=!1,o;let{document:r}=n;const a=r,c=a.currentScript,{DocumentFragment:s,HTMLTemplateElement:N,Node:R,Element:O,NodeFilter:B,NamedNodeMap:W=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:G,DOMParser:Y,trustedTypes:j}=n,q=O.prototype,$=v(q,"cloneNode"),V=v(q,"remove"),re=v(q,"nextSibling"),ie=v(q,"childNodes"),ae=v(q,"parentNode");if("function"==typeof N){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let le,ce="";const{implementation:se,createNodeIterator:ue,createDocumentFragment:me,getElementsByTagName:pe}=r,{importNode:fe}=a;let de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};o.isSupported="function"==typeof e&&"function"==typeof ae&&se&&void 0!==se.createHTMLDocument;const{MUSTACHE_EXPR:he,ERB_EXPR:ge,TMPLIT_EXPR:Te,DATA_ATTR:ye,ARIA_ATTR:Ee,IS_SCRIPT_OR_DATA:Ae,ATTR_WHITESPACE:_e,CUSTOM_ELEMENT:Se}=Z;let{IS_ALLOWED_URI:be}=Z,Ne=null;const Re=w({},[...L,...C,...x,...M,...U]);let we=null;const Oe=w({},[...z,...P,...H,...F]);let De=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ve=null,Le=null,Ce=!0,xe=!0,Ie=!1,Me=!0,ke=!1,Ue=!0,ze=!1,Pe=!1,He=!1,Fe=!1,Be=!1,We=!1,Ge=!0,Ye=!1,je=!0,Xe=!1,qe={},$e=null;const Ke=w({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ve=null;const Ze=w({},["audio","video","img","source","image","track"]);let Je=null;const Qe=w({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let ot=nt,rt=!1,it=null;const at=w({},[et,tt,nt],g);let lt=w({},["mi","mo","mn","ms","mtext"]),ct=w({},["annotation-xml"]);const st=w({},["title","style","font","a","script"]);let ut=null;const mt=["application/xhtml+xml","text/html"];let pt=null,ft=null;const dt=r.createElement("form"),ht=function(e){return e instanceof RegExp||e instanceof Function},gt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ft||ft!==e){if(e&&"object"==typeof e||(e={}),e=D(e),ut=-1===mt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,pt="application/xhtml+xml"===ut?g:h,Ne=_(e,"ALLOWED_TAGS")?w({},e.ALLOWED_TAGS,pt):Re,we=_(e,"ALLOWED_ATTR")?w({},e.ALLOWED_ATTR,pt):Oe,it=_(e,"ALLOWED_NAMESPACES")?w({},e.ALLOWED_NAMESPACES,g):at,Je=_(e,"ADD_URI_SAFE_ATTR")?w(D(Qe),e.ADD_URI_SAFE_ATTR,pt):Qe,Ve=_(e,"ADD_DATA_URI_TAGS")?w(D(Ze),e.ADD_DATA_URI_TAGS,pt):Ze,$e=_(e,"FORBID_CONTENTS")?w({},e.FORBID_CONTENTS,pt):Ke,ve=_(e,"FORBID_TAGS")?w({},e.FORBID_TAGS,pt):{},Le=_(e,"FORBID_ATTR")?w({},e.FORBID_ATTR,pt):{},qe=!!_(e,"USE_PROFILES")&&e.USE_PROFILES,Ce=!1!==e.ALLOW_ARIA_ATTR,xe=!1!==e.ALLOW_DATA_ATTR,Ie=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,ke=e.SAFE_FOR_TEMPLATES||!1,Ue=!1!==e.SAFE_FOR_XML,ze=e.WHOLE_DOCUMENT||!1,Fe=e.RETURN_DOM||!1,Be=e.RETURN_DOM_FRAGMENT||!1,We=e.RETURN_TRUSTED_TYPE||!1,He=e.FORCE_BODY||!1,Ge=!1!==e.SANITIZE_DOM,Ye=e.SANITIZE_NAMED_PROPS||!1,je=!1!==e.KEEP_CONTENT,Xe=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||X,ot=e.NAMESPACE||nt,lt=e.MATHML_TEXT_INTEGRATION_POINTS||lt,ct=e.HTML_INTEGRATION_POINTS||ct,De=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(De.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(De.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(De.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ke&&(xe=!1),Be&&(Fe=!0),qe&&(Ne=w({},U),we=[],!0===qe.html&&(w(Ne,L),w(we,z)),!0===qe.svg&&(w(Ne,C),w(we,P),w(we,F)),!0===qe.svgFilters&&(w(Ne,x),w(we,P),w(we,F)),!0===qe.mathMl&&(w(Ne,M),w(we,H),w(we,F))),e.ADD_TAGS&&(Ne===Re&&(Ne=D(Ne)),w(Ne,e.ADD_TAGS,pt)),e.ADD_ATTR&&(we===Oe&&(we=D(we)),w(we,e.ADD_ATTR,pt)),e.ADD_URI_SAFE_ATTR&&w(Je,e.ADD_URI_SAFE_ATTR,pt),e.FORBID_CONTENTS&&($e===Ke&&($e=D($e)),w($e,e.FORBID_CONTENTS,pt)),je&&(Ne["#text"]=!0),ze&&w(Ne,["html","head","body"]),Ne.table&&(w(Ne,["tbody"]),delete ve.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');le=e.TRUSTED_TYPES_POLICY,ce=le.createHTML("")}else void 0===le&&(le=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(j,c)),null!==le&&"string"==typeof ce&&(ce=le.createHTML(""));i&&i(e),ft=e}},Tt=w({},[...C,...x,...I]),yt=w({},[...M,...k]),Et=function(e){f(o.removed,{element:e});try{ae(e).removeChild(e)}catch(t){V(e)}},At=function(e,t){try{f(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Fe||Be)try{Et(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},_t=function(e){let t=null,n=null;if(He)e="<remove></remove>"+e;else{const t=T(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ut&&ot===nt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=le?le.createHTML(e):e;if(ot===nt)try{t=(new Y).parseFromString(o,ut)}catch(e){}if(!t||!t.documentElement){t=se.createDocument(ot,"template",null);try{t.documentElement.innerHTML=rt?ce:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),ot===nt?pe.call(t,ze?"html":"body")[0]:ze?t.documentElement:i},St=function(e){return ue.call(e.ownerDocument||e,e,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT|B.SHOW_PROCESSING_INSTRUCTION|B.SHOW_CDATA_SECTION,null)},bt=function(e){return e instanceof G&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof W)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Nt=function(e){return"function"==typeof R&&e instanceof R};function Rt(e,t,n){u(e,(e=>{e.call(o,t,n,ft)}))}const wt=function(e){let t=null;if(Rt(de.beforeSanitizeElements,e,null),bt(e))return Et(e),!0;const n=pt(e.nodeName);if(Rt(de.uponSanitizeElement,e,{tagName:n,allowedTags:Ne}),e.hasChildNodes()&&!Nt(e.firstElementChild)&&S(/<[/\w!]/g,e.innerHTML)&&S(/<[/\w!]/g,e.textContent))return Et(e),!0;if(e.nodeType===ee)return Et(e),!0;if(Ue&&e.nodeType===te&&S(/<[/\w]/g,e.data))return Et(e),!0;if(!Ne[n]||ve[n]){if(!ve[n]&&Dt(n)){if(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n))return!1;if(De.tagNameCheck instanceof Function&&De.tagNameCheck(n))return!1}if(je&&!$e[n]){const t=ae(e)||e.parentNode,n=ie(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o){const r=$(n[o],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,re(e))}}}return Et(e),!0}return e instanceof O&&!function(e){let t=ae(e);t&&t.tagName||(t={namespaceURI:ot,tagName:"template"});const n=h(e.tagName),o=h(t.tagName);return!!it[e.namespaceURI]&&(e.namespaceURI===tt?t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===o||lt[o]):Boolean(Tt[n]):e.namespaceURI===et?t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&ct[o]:Boolean(yt[n]):e.namespaceURI===nt?!(t.namespaceURI===tt&&!ct[o])&&!(t.namespaceURI===et&&!lt[o])&&!yt[n]&&(st[n]||!Tt[n]):!("application/xhtml+xml"!==ut||!it[e.namespaceURI]))}(e)?(Et(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!S(/<\/no(script|embed|frames)/i,e.innerHTML)?(ke&&e.nodeType===Q&&(t=e.textContent,u([he,ge,Te],(e=>{t=y(t,e," ")})),e.textContent!==t&&(f(o.removed,{element:e.cloneNode()}),e.textContent=t)),Rt(de.afterSanitizeElements,e,null),!1):(Et(e),!0)},Ot=function(e,t,n){if(Ge&&("id"===t||"name"===t)&&(n in r||n in dt))return!1;if(xe&&!Le[t]&&S(ye,t));else if(Ce&&S(Ee,t));else if(!we[t]||Le[t]){if(!(Dt(e)&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,e)||De.tagNameCheck instanceof Function&&De.tagNameCheck(e))&&(De.attributeNameCheck instanceof RegExp&&S(De.attributeNameCheck,t)||De.attributeNameCheck instanceof Function&&De.attributeNameCheck(t))||"is"===t&&De.allowCustomizedBuiltInElements&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n)||De.tagNameCheck instanceof Function&&De.tagNameCheck(n))))return!1}else if(Je[t]);else if(S(be,y(n,_e,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==E(n,"data:")||!Ve[e]){if(Ie&&!S(Ae,y(n,_e,"")));else if(n)return!1}else;return!0},Dt=function(e){return"annotation-xml"!==e&&T(e,Se)},vt=function(e){Rt(de.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||bt(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:we,forceKeepAttr:void 0};let r=t.length;for(;r--;){const i=t[r],{name:a,namespaceURI:l,value:c}=i,s=pt(a);let m="value"===a?c:A(c);if(n.attrName=s,n.attrValue=m,n.keepAttr=!0,n.forceKeepAttr=void 0,Rt(de.uponSanitizeAttribute,e,n),m=n.attrValue,!Ye||"id"!==s&&"name"!==s||(At(a,e),m="user-content-"+m),Ue&&S(/((--!?|])>)|<\/(style|title)/i,m)){At(a,e);continue}if(n.forceKeepAttr)continue;if(At(a,e),!n.keepAttr)continue;if(!Me&&S(/\/>/i,m)){At(a,e);continue}ke&&u([he,ge,Te],(e=>{m=y(m,e," ")}));const f=pt(e.nodeName);if(Ot(f,s,m)){if(le&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(l);else switch(j.getAttributeType(f,s)){case"TrustedHTML":m=le.createHTML(m);break;case"TrustedScriptURL":m=le.createScriptURL(m)}try{l?e.setAttributeNS(l,a,m):e.setAttribute(a,m),bt(e)?Et(e):p(o.removed)}catch(e){}}}Rt(de.afterSanitizeAttributes,e,null)},Lt=function e(t){let n=null;const o=St(t);for(Rt(de.beforeSanitizeShadowDOM,t,null);n=o.nextNode();)Rt(de.uponSanitizeShadowNode,n,null),wt(n),vt(n),n.content instanceof s&&e(n.content);Rt(de.afterSanitizeShadowDOM,t,null)};return o.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=null,i=null,l=null;if(rt=!e,rt&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Nt(e)){if("function"!=typeof e.toString)throw b("toString is not a function");if("string"!=typeof(e=e.toString()))throw b("dirty is not a string, aborting")}if(!o.isSupported)return e;if(Pe||gt(t),o.removed=[],"string"==typeof e&&(Xe=!1),Xe){if(e.nodeName){const t=pt(e.nodeName);if(!Ne[t]||ve[t])throw b("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof R)n=_t("\x3c!----\x3e"),r=n.ownerDocument.importNode(e,!0),r.nodeType===J&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(!Fe&&!ke&&!ze&&-1===e.indexOf("<"))return le&&We?le.createHTML(e):e;if(n=_t(e),!n)return Fe?null:We?ce:""}n&&He&&Et(n.firstChild);const c=St(Xe?e:n);for(;i=c.nextNode();)wt(i),vt(i),i.content instanceof s&&Lt(i.content);if(Xe)return e;if(Fe){if(Be)for(l=me.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(we.shadowroot||we.shadowrootmode)&&(l=fe.call(a,l,!0)),l}let m=ze?n.outerHTML:n.innerHTML;return ze&&Ne["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&S(K,n.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+m),ke&&u([he,ge,Te],(e=>{m=y(m,e," ")})),le&&We?le.createHTML(m):m},o.setConfig=function(){gt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Pe=!0},o.clearConfig=function(){ft=null,Pe=!1},o.isValidAttribute=function(e,t,n){ft||gt({});const o=pt(e),r=pt(t);return Ot(o,r,n)},o.addHook=function(e,t){"function"==typeof t&&f(de[e],t)},o.removeHook=function(e,t){if(void 0!==t){const n=m(de[e],t);return-1===n?void 0:d(de[e],n,1)[0]}return p(de[e])},o.removeHooks=function(e){de[e]=[]},o.removeAllHooks=function(){de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},o}();return re}));diff --git a/src/main/webapp/js/viewer-static.min.js b/src/main/webapp/js/viewer-static.min.jsindex 77c8efc51..7dd3b2c50 100644--- a/src/main/webapp/js/viewer-static.min.js+++ b/src/main/webapp/js/viewer-static.min.js@@ -2,8 +2,8 @@ window.PROXY_URL=window.PROXY_URL||"https://viewer.diagrams.net/proxy";window.STwindow.mxImageBasePath=window.mxImageBasePath||"https://viewer.diagrams.net/mxgraph/images";window.mxBasePath=window.mxBasePath||"https://viewer.diagrams.net/mxgraph/";window.mxLoadStylesheets=window.mxLoadStylesheets||!1;//fgnass.github.com/spin.js#v2.0.0!function(a,b){"object"==typeof exports?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Spinner=b()}(this,function(){"use strict";function a(a,b){var c,d=document.createElement(a||"div");for(c in b)d[c]=b[c];return d}function b(a){for(var b=1,c=arguments.length;c>b;b++)a.appendChild(arguments[b]);return a}function c(a,b,c,d){var e=["opacity",b,~~(100*a),c,d].join("-"),f=.01+c/d*100,g=Math.max(1-(1-a)/b*(100-f),a),h=j.substring(0,j.indexOf("Animation")).toLowerCase(),i=h&&"-"+h+"-"||"";return l[e]||(m.insertRule("@"+i+"keyframes "+e+"{0%{opacity:"+g+"}"+f+"%{opacity:"+a+"}"+(f+.01)+"%{opacity:1}"+(f+b)%100+"%{opacity:"+a+"}100%{opacity:"+g+"}}",m.cssRules.length),l[e]=1),e}function d(a,b){var c,d,e=a.style;for(b=b.charAt(0).toUpperCase()+b.slice(1),d=0;d<k.length;d++)if(c=k[d]+b,void 0!==e[c])return c;return void 0!==e[b]?b:void 0}function e(a,b){for(var c in b)a.style[d(a,c)||c]=b[c];return a}function f(a){for(var b=1;b<arguments.length;b++){var c=arguments[b];for(var d in c)void 0===a[d]&&(a[d]=c[d])}return a}function g(a,b){return"string"==typeof a?a:a[b%a.length]}function h(a){this.opts=f(a||{},h.defaults,n)}function i(){function c(b,c){return a("<"+b+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',c)}m.addRule(".spin-vml","behavior:url(#default#VML)"),h.prototype.lines=function(a,d){function f(){return e(c("group",{coordsize:k+" "+k,coordorigin:-j+" "+-j}),{width:k,height:k})}function h(a,h,i){b(m,b(e(f(),{rotation:360/d.lines*a+"deg",left:~~h}),b(e(c("roundrect",{arcsize:d.corners}),{width:j,height:d.width,left:d.radius,top:-d.width>>1,filter:i}),c("fill",{color:g(d.color,a),opacity:d.opacity}),c("stroke",{opacity:0}))))}var i,j=d.length+d.width,k=2*j,l=2*-(d.width+d.length)+"px",m=e(f(),{position:"absolute",top:l,left:l});if(d.shadow)for(i=1;i<=d.lines;i++)h(i,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(i=1;i<=d.lines;i++)h(i);return b(a,m)},h.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d<e.childNodes.length&&(e=e.childNodes[b+d],e=e&&e.firstChild,e=e&&e.firstChild,e&&(e.opacity=c))}}var j,k=["webkit","Moz","ms","O"],l={},m=function(){var c=a("style",{type:"text/css"});return b(document.getElementsByTagName("head")[0],c),c.sheet||c.styleSheet}(),n={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:"#000",direction:1,speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"50%",left:"50%",position:"absolute"};h.defaults={},f(h.prototype,{spin:function(b){this.stop();{var c=this,d=c.opts,f=c.el=e(a(0,{className:d.className}),{position:d.position,width:0,zIndex:d.zIndex});d.radius+d.length+d.width}if(b&&(b.insertBefore(f,b.firstChild||null),e(f,{left:d.left,top:d.top})),f.setAttribute("role","progressbar"),c.lines(f,c.opts),!j){var g,h=0,i=(d.lines-1)*(1-d.direction)/2,k=d.fps,l=k/d.speed,m=(1-d.opacity)/(l*d.trail/100),n=l/d.lines;!function o(){h++;for(var a=0;a<d.lines;a++)g=Math.max(1-(h+(d.lines-a)*n)%l*m,d.opacity),c.opacity(f,a*d.direction+i,g,d);c.timeout=c.el&&setTimeout(o,~~(1e3/k))}()}return c},stop:function(){var a=this.el;return a&&(clearTimeout(this.timeout),a.parentNode&&a.parentNode.removeChild(a),this.el=void 0),this},lines:function(d,f){function h(b,c){return e(a(),{position:"absolute",width:f.length+f.width+"px",height:f.width+"px",background:b,boxShadow:c,transformOrigin:"left",transform:"rotate("+~~(360/f.lines*k+f.rotate)+"deg) translate("+f.radius+"px,0)",borderRadius:(f.corners*f.width>>1)+"px"})}for(var i,k=0,l=(f.lines-1)*(1-f.direction)/2;k<f.lines;k++)i=e(a(),{position:"absolute",top:1+~(f.width/2)+"px",transform:f.hwaccel?"translate3d(0,0,0)":"",opacity:f.opacity,animation:j&&c(f.opacity,f.trail,l+k*f.direction,f.lines)+" "+1/f.speed+"s linear infinite"}),f.shadow&&b(i,e(h("#000","0 0 4px #000"),{top:"2px"})),b(d,b(i,h(g(f.color,k),"0 0 1px rgba(0,0,0,.1)")));return d},opacity:function(a,b,c){b<a.childNodes.length&&(a.childNodes[b].style.opacity=c)}});var o=e(a("group"),{behavior:"url(#default#VML)"});return!d(o,"transform")&&o.adj?i():j=d(o,"animation"),h});-/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */-!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DOMPurify=t()}(this,(function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:r}=Object;let{freeze:i,seal:a,create:l}=Object,{apply:c,construct:s}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),a||(a=function(e){return e}),c||(c=function(e,t,n){return e.apply(t,n)}),s||(s=function(e,t){return new e(...t)});const u=R(Array.prototype.forEach),m=R(Array.prototype.lastIndexOf),p=R(Array.prototype.pop),f=R(Array.prototype.push),d=R(Array.prototype.splice),h=R(String.prototype.toLowerCase),g=R(String.prototype.toString),T=R(String.prototype.match),y=R(String.prototype.replace),E=R(String.prototype.indexOf),A=R(String.prototype.trim),_=R(Object.prototype.hasOwnProperty),S=R(RegExp.prototype.test),b=(N=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(N,t)});var N;function R(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return c(e,t,o)}}function w(e,o){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;t&&t(e,null);let i=o.length;for(;i--;){let t=o[i];if("string"==typeof t){const e=r(t);e!==t&&(n(o)||(o[i]=e),t=e)}e[t]=!0}return e}function O(e){for(let t=0;t<e.length;t++){_(e,t)||(e[t]=null)}return e}function D(t){const n=l(null);for(const[o,r]of e(t)){_(t,o)&&(Array.isArray(r)?n[o]=O(r):r&&"object"==typeof r&&r.constructor===Object?n[o]=D(r):n[o]=r)}return n}function v(e,t){for(;null!==e;){const n=r(e,t);if(n){if(n.get)return R(n.get);if("function"==typeof n.value)return R(n.value)}e=o(e)}return function(){return null}}const L=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),C=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),x=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),M=i(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),k=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),I=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),U=i(["#text"]),z=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),P=i(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),H=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),F=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),W=a(/<%[\w\W]*|[\w\W]*%>/gm),G=a(/\$\{[\w\W]*/gm),Y=a(/^data-[\-\w.\u00B7-\uFFFF]+$/),j=a(/^aria-[\-\w]+$/),X=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),q=a(/^(?:\w+script|data):/i),$=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=a(/^html$/i),V=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var Z=Object.freeze({__proto__:null,ARIA_ATTR:j,ATTR_WHITESPACE:$,CUSTOM_ELEMENT:V,DATA_ATTR:Y,DOCTYPE_NAME:K,ERB_EXPR:W,IS_ALLOWED_URI:X,IS_SCRIPT_OR_DATA:q,MUSTACHE_EXPR:B,TMPLIT_EXPR:G});const J=1,Q=3,ee=7,te=8,ne=9,oe=function(){return"undefined"==typeof window?null:window};var re=function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oe();const o=e=>t(e);if(o.version="3.2.4",o.removed=[],!n||!n.document||n.document.nodeType!==ne||!n.Element)return o.isSupported=!1,o;let{document:r}=n;const a=r,c=a.currentScript,{DocumentFragment:s,HTMLTemplateElement:N,Node:R,Element:O,NodeFilter:B,NamedNodeMap:W=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:G,DOMParser:Y,trustedTypes:j}=n,q=O.prototype,$=v(q,"cloneNode"),V=v(q,"remove"),re=v(q,"nextSibling"),ie=v(q,"childNodes"),ae=v(q,"parentNode");if("function"==typeof N){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let le,ce="";const{implementation:se,createNodeIterator:ue,createDocumentFragment:me,getElementsByTagName:pe}=r,{importNode:fe}=a;let de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};o.isSupported="function"==typeof e&&"function"==typeof ae&&se&&void 0!==se.createHTMLDocument;const{MUSTACHE_EXPR:he,ERB_EXPR:ge,TMPLIT_EXPR:Te,DATA_ATTR:ye,ARIA_ATTR:Ee,IS_SCRIPT_OR_DATA:Ae,ATTR_WHITESPACE:_e,CUSTOM_ELEMENT:Se}=Z;let{IS_ALLOWED_URI:be}=Z,Ne=null;const Re=w({},[...L,...C,...x,...k,...U]);let we=null;const Oe=w({},[...z,...P,...H,...F]);let De=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ve=null,Le=null,Ce=!0,xe=!0,Me=!1,ke=!0,Ie=!1,Ue=!0,ze=!1,Pe=!1,He=!1,Fe=!1,Be=!1,We=!1,Ge=!0,Ye=!1,je=!0,Xe=!1,qe={},$e=null;const Ke=w({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ve=null;const Ze=w({},["audio","video","img","source","image","track"]);let Je=null;const Qe=w({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let ot=nt,rt=!1,it=null;const at=w({},[et,tt,nt],g);let lt=w({},["mi","mo","mn","ms","mtext"]),ct=w({},["annotation-xml"]);const st=w({},["title","style","font","a","script"]);let ut=null;const mt=["application/xhtml+xml","text/html"];let pt=null,ft=null;const dt=r.createElement("form"),ht=function(e){return e instanceof RegExp||e instanceof Function},gt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ft||ft!==e){if(e&&"object"==typeof e||(e={}),e=D(e),ut=-1===mt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,pt="application/xhtml+xml"===ut?g:h,Ne=_(e,"ALLOWED_TAGS")?w({},e.ALLOWED_TAGS,pt):Re,we=_(e,"ALLOWED_ATTR")?w({},e.ALLOWED_ATTR,pt):Oe,it=_(e,"ALLOWED_NAMESPACES")?w({},e.ALLOWED_NAMESPACES,g):at,Je=_(e,"ADD_URI_SAFE_ATTR")?w(D(Qe),e.ADD_URI_SAFE_ATTR,pt):Qe,Ve=_(e,"ADD_DATA_URI_TAGS")?w(D(Ze),e.ADD_DATA_URI_TAGS,pt):Ze,$e=_(e,"FORBID_CONTENTS")?w({},e.FORBID_CONTENTS,pt):Ke,ve=_(e,"FORBID_TAGS")?w({},e.FORBID_TAGS,pt):{},Le=_(e,"FORBID_ATTR")?w({},e.FORBID_ATTR,pt):{},qe=!!_(e,"USE_PROFILES")&&e.USE_PROFILES,Ce=!1!==e.ALLOW_ARIA_ATTR,xe=!1!==e.ALLOW_DATA_ATTR,Me=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ke=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Ie=e.SAFE_FOR_TEMPLATES||!1,Ue=!1!==e.SAFE_FOR_XML,ze=e.WHOLE_DOCUMENT||!1,Fe=e.RETURN_DOM||!1,Be=e.RETURN_DOM_FRAGMENT||!1,We=e.RETURN_TRUSTED_TYPE||!1,He=e.FORCE_BODY||!1,Ge=!1!==e.SANITIZE_DOM,Ye=e.SANITIZE_NAMED_PROPS||!1,je=!1!==e.KEEP_CONTENT,Xe=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||X,ot=e.NAMESPACE||nt,lt=e.MATHML_TEXT_INTEGRATION_POINTS||lt,ct=e.HTML_INTEGRATION_POINTS||ct,De=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(De.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(De.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(De.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ie&&(xe=!1),Be&&(Fe=!0),qe&&(Ne=w({},U),we=[],!0===qe.html&&(w(Ne,L),w(we,z)),!0===qe.svg&&(w(Ne,C),w(we,P),w(we,F)),!0===qe.svgFilters&&(w(Ne,x),w(we,P),w(we,F)),!0===qe.mathMl&&(w(Ne,k),w(we,H),w(we,F))),e.ADD_TAGS&&(Ne===Re&&(Ne=D(Ne)),w(Ne,e.ADD_TAGS,pt)),e.ADD_ATTR&&(we===Oe&&(we=D(we)),w(we,e.ADD_ATTR,pt)),e.ADD_URI_SAFE_ATTR&&w(Je,e.ADD_URI_SAFE_ATTR,pt),e.FORBID_CONTENTS&&($e===Ke&&($e=D($e)),w($e,e.FORBID_CONTENTS,pt)),je&&(Ne["#text"]=!0),ze&&w(Ne,["html","head","body"]),Ne.table&&(w(Ne,["tbody"]),delete ve.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');le=e.TRUSTED_TYPES_POLICY,ce=le.createHTML("")}else void 0===le&&(le=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(j,c)),null!==le&&"string"==typeof ce&&(ce=le.createHTML(""));i&&i(e),ft=e}},Tt=w({},[...C,...x,...M]),yt=w({},[...k,...I]),Et=function(e){f(o.removed,{element:e});try{ae(e).removeChild(e)}catch(t){V(e)}},At=function(e,t){try{f(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Fe||Be)try{Et(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},_t=function(e){let t=null,n=null;if(He)e="<remove></remove>"+e;else{const t=T(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ut&&ot===nt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=le?le.createHTML(e):e;if(ot===nt)try{t=(new Y).parseFromString(o,ut)}catch(e){}if(!t||!t.documentElement){t=se.createDocument(ot,"template",null);try{t.documentElement.innerHTML=rt?ce:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),ot===nt?pe.call(t,ze?"html":"body")[0]:ze?t.documentElement:i},St=function(e){return ue.call(e.ownerDocument||e,e,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT|B.SHOW_PROCESSING_INSTRUCTION|B.SHOW_CDATA_SECTION,null)},bt=function(e){return e instanceof G&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof W)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Nt=function(e){return"function"==typeof R&&e instanceof R};function Rt(e,t,n){u(e,(e=>{e.call(o,t,n,ft)}))}const wt=function(e){let t=null;if(Rt(de.beforeSanitizeElements,e,null),bt(e))return Et(e),!0;const n=pt(e.nodeName);if(Rt(de.uponSanitizeElement,e,{tagName:n,allowedTags:Ne}),e.hasChildNodes()&&!Nt(e.firstElementChild)&&S(/<[/\w]/g,e.innerHTML)&&S(/<[/\w]/g,e.textContent))return Et(e),!0;if(e.nodeType===ee)return Et(e),!0;if(Ue&&e.nodeType===te&&S(/<[/\w]/g,e.data))return Et(e),!0;if(!Ne[n]||ve[n]){if(!ve[n]&&Dt(n)){if(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n))return!1;if(De.tagNameCheck instanceof Function&&De.tagNameCheck(n))return!1}if(je&&!$e[n]){const t=ae(e)||e.parentNode,n=ie(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o){const r=$(n[o],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,re(e))}}}return Et(e),!0}return e instanceof O&&!function(e){let t=ae(e);t&&t.tagName||(t={namespaceURI:ot,tagName:"template"});const n=h(e.tagName),o=h(t.tagName);return!!it[e.namespaceURI]&&(e.namespaceURI===tt?t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===o||lt[o]):Boolean(Tt[n]):e.namespaceURI===et?t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&ct[o]:Boolean(yt[n]):e.namespaceURI===nt?!(t.namespaceURI===tt&&!ct[o])&&!(t.namespaceURI===et&&!lt[o])&&!yt[n]&&(st[n]||!Tt[n]):!("application/xhtml+xml"!==ut||!it[e.namespaceURI]))}(e)?(Et(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!S(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ie&&e.nodeType===Q&&(t=e.textContent,u([he,ge,Te],(e=>{t=y(t,e," ")})),e.textContent!==t&&(f(o.removed,{element:e.cloneNode()}),e.textContent=t)),Rt(de.afterSanitizeElements,e,null),!1):(Et(e),!0)},Ot=function(e,t,n){if(Ge&&("id"===t||"name"===t)&&(n in r||n in dt))return!1;if(xe&&!Le[t]&&S(ye,t));else if(Ce&&S(Ee,t));else if(!we[t]||Le[t]){if(!(Dt(e)&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,e)||De.tagNameCheck instanceof Function&&De.tagNameCheck(e))&&(De.attributeNameCheck instanceof RegExp&&S(De.attributeNameCheck,t)||De.attributeNameCheck instanceof Function&&De.attributeNameCheck(t))||"is"===t&&De.allowCustomizedBuiltInElements&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n)||De.tagNameCheck instanceof Function&&De.tagNameCheck(n))))return!1}else if(Je[t]);else if(S(be,y(n,_e,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==E(n,"data:")||!Ve[e]){if(Me&&!S(Ae,y(n,_e,"")));else if(n)return!1}else;return!0},Dt=function(e){return"annotation-xml"!==e&&T(e,Se)},vt=function(e){Rt(de.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||bt(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:we,forceKeepAttr:void 0};let r=t.length;for(;r--;){const i=t[r],{name:a,namespaceURI:l,value:c}=i,s=pt(a);let m="value"===a?c:A(c);if(n.attrName=s,n.attrValue=m,n.keepAttr=!0,n.forceKeepAttr=void 0,Rt(de.uponSanitizeAttribute,e,n),m=n.attrValue,!Ye||"id"!==s&&"name"!==s||(At(a,e),m="user-content-"+m),Ue&&S(/((--!?|])>)|<\/(style|title)/i,m)){At(a,e);continue}if(n.forceKeepAttr)continue;if(At(a,e),!n.keepAttr)continue;if(!ke&&S(/\/>/i,m)){At(a,e);continue}Ie&&u([he,ge,Te],(e=>{m=y(m,e," ")}));const f=pt(e.nodeName);if(Ot(f,s,m)){if(le&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(l);else switch(j.getAttributeType(f,s)){case"TrustedHTML":m=le.createHTML(m);break;case"TrustedScriptURL":m=le.createScriptURL(m)}try{l?e.setAttributeNS(l,a,m):e.setAttribute(a,m),bt(e)?Et(e):p(o.removed)}catch(e){}}}Rt(de.afterSanitizeAttributes,e,null)},Lt=function e(t){let n=null;const o=St(t);for(Rt(de.beforeSanitizeShadowDOM,t,null);n=o.nextNode();)Rt(de.uponSanitizeShadowNode,n,null),wt(n),vt(n),n.content instanceof s&&e(n.content);Rt(de.afterSanitizeShadowDOM,t,null)};return o.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=null,i=null,l=null;if(rt=!e,rt&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Nt(e)){if("function"!=typeof e.toString)throw b("toString is not a function");if("string"!=typeof(e=e.toString()))throw b("dirty is not a string, aborting")}if(!o.isSupported)return e;if(Pe||gt(t),o.removed=[],"string"==typeof e&&(Xe=!1),Xe){if(e.nodeName){const t=pt(e.nodeName);if(!Ne[t]||ve[t])throw b("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof R)n=_t("\x3c!----\x3e"),r=n.ownerDocument.importNode(e,!0),r.nodeType===J&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(!Fe&&!Ie&&!ze&&-1===e.indexOf("<"))return le&&We?le.createHTML(e):e;if(n=_t(e),!n)return Fe?null:We?ce:""}n&&He&&Et(n.firstChild);const c=St(Xe?e:n);for(;i=c.nextNode();)wt(i),vt(i),i.content instanceof s&&Lt(i.content);if(Xe)return e;if(Fe){if(Be)for(l=me.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(we.shadowroot||we.shadowrootmode)&&(l=fe.call(a,l,!0)),l}let m=ze?n.outerHTML:n.innerHTML;return ze&&Ne["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&S(K,n.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+m),Ie&&u([he,ge,Te],(e=>{m=y(m,e," ")})),le&&We?le.createHTML(m):m},o.setConfig=function(){gt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Pe=!0},o.clearConfig=function(){ft=null,Pe=!1},o.isValidAttribute=function(e,t,n){ft||gt({});const o=pt(e),r=pt(t);return Ot(o,r,n)},o.addHook=function(e,t){"function"==typeof t&&f(de[e],t)},o.removeHook=function(e,t){if(void 0!==t){const n=m(de[e],t);return-1===n?void 0:d(de[e],n,1)[0]}return p(de[e])},o.removeHooks=function(e){de[e]=[]},o.removeAllHooks=function(){de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},o}();return re}));+/*! @license DOMPurify 3.2.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.5/LICENSE */+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DOMPurify=t()}(this,(function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:r}=Object;let{freeze:i,seal:a,create:l}=Object,{apply:c,construct:s}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),a||(a=function(e){return e}),c||(c=function(e,t,n){return e.apply(t,n)}),s||(s=function(e,t){return new e(...t)});const u=R(Array.prototype.forEach),m=R(Array.prototype.lastIndexOf),p=R(Array.prototype.pop),f=R(Array.prototype.push),d=R(Array.prototype.splice),h=R(String.prototype.toLowerCase),g=R(String.prototype.toString),T=R(String.prototype.match),y=R(String.prototype.replace),E=R(String.prototype.indexOf),A=R(String.prototype.trim),_=R(Object.prototype.hasOwnProperty),S=R(RegExp.prototype.test),b=(N=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(N,t)});var N;function R(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return c(e,t,o)}}function w(e,o){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;t&&t(e,null);let i=o.length;for(;i--;){let t=o[i];if("string"==typeof t){const e=r(t);e!==t&&(n(o)||(o[i]=e),t=e)}e[t]=!0}return e}function O(e){for(let t=0;t<e.length;t++){_(e,t)||(e[t]=null)}return e}function D(t){const n=l(null);for(const[o,r]of e(t)){_(t,o)&&(Array.isArray(r)?n[o]=O(r):r&&"object"==typeof r&&r.constructor===Object?n[o]=D(r):n[o]=r)}return n}function v(e,t){for(;null!==e;){const n=r(e,t);if(n){if(n.get)return R(n.get);if("function"==typeof n.value)return R(n.value)}e=o(e)}return function(){return null}}const L=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),C=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),x=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=i(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),M=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),k=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),U=i(["#text"]),z=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),P=i(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),H=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),F=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),W=a(/<%[\w\W]*|[\w\W]*%>/gm),G=a(/\$\{[\w\W]*/gm),Y=a(/^data-[\-\w.\u00B7-\uFFFF]+$/),j=a(/^aria-[\-\w]+$/),X=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),q=a(/^(?:\w+script|data):/i),$=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=a(/^html$/i),V=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var Z=Object.freeze({__proto__:null,ARIA_ATTR:j,ATTR_WHITESPACE:$,CUSTOM_ELEMENT:V,DATA_ATTR:Y,DOCTYPE_NAME:K,ERB_EXPR:W,IS_ALLOWED_URI:X,IS_SCRIPT_OR_DATA:q,MUSTACHE_EXPR:B,TMPLIT_EXPR:G});const J=1,Q=3,ee=7,te=8,ne=9,oe=function(){return"undefined"==typeof window?null:window};var re=function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oe();const o=e=>t(e);if(o.version="3.2.5",o.removed=[],!n||!n.document||n.document.nodeType!==ne||!n.Element)return o.isSupported=!1,o;let{document:r}=n;const a=r,c=a.currentScript,{DocumentFragment:s,HTMLTemplateElement:N,Node:R,Element:O,NodeFilter:B,NamedNodeMap:W=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:G,DOMParser:Y,trustedTypes:j}=n,q=O.prototype,$=v(q,"cloneNode"),V=v(q,"remove"),re=v(q,"nextSibling"),ie=v(q,"childNodes"),ae=v(q,"parentNode");if("function"==typeof N){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let le,ce="";const{implementation:se,createNodeIterator:ue,createDocumentFragment:me,getElementsByTagName:pe}=r,{importNode:fe}=a;let de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};o.isSupported="function"==typeof e&&"function"==typeof ae&&se&&void 0!==se.createHTMLDocument;const{MUSTACHE_EXPR:he,ERB_EXPR:ge,TMPLIT_EXPR:Te,DATA_ATTR:ye,ARIA_ATTR:Ee,IS_SCRIPT_OR_DATA:Ae,ATTR_WHITESPACE:_e,CUSTOM_ELEMENT:Se}=Z;let{IS_ALLOWED_URI:be}=Z,Ne=null;const Re=w({},[...L,...C,...x,...M,...U]);let we=null;const Oe=w({},[...z,...P,...H,...F]);let De=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ve=null,Le=null,Ce=!0,xe=!0,Ie=!1,Me=!0,ke=!1,Ue=!0,ze=!1,Pe=!1,He=!1,Fe=!1,Be=!1,We=!1,Ge=!0,Ye=!1,je=!0,Xe=!1,qe={},$e=null;const Ke=w({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ve=null;const Ze=w({},["audio","video","img","source","image","track"]);let Je=null;const Qe=w({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let ot=nt,rt=!1,it=null;const at=w({},[et,tt,nt],g);let lt=w({},["mi","mo","mn","ms","mtext"]),ct=w({},["annotation-xml"]);const st=w({},["title","style","font","a","script"]);let ut=null;const mt=["application/xhtml+xml","text/html"];let pt=null,ft=null;const dt=r.createElement("form"),ht=function(e){return e instanceof RegExp||e instanceof Function},gt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ft||ft!==e){if(e&&"object"==typeof e||(e={}),e=D(e),ut=-1===mt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,pt="application/xhtml+xml"===ut?g:h,Ne=_(e,"ALLOWED_TAGS")?w({},e.ALLOWED_TAGS,pt):Re,we=_(e,"ALLOWED_ATTR")?w({},e.ALLOWED_ATTR,pt):Oe,it=_(e,"ALLOWED_NAMESPACES")?w({},e.ALLOWED_NAMESPACES,g):at,Je=_(e,"ADD_URI_SAFE_ATTR")?w(D(Qe),e.ADD_URI_SAFE_ATTR,pt):Qe,Ve=_(e,"ADD_DATA_URI_TAGS")?w(D(Ze),e.ADD_DATA_URI_TAGS,pt):Ze,$e=_(e,"FORBID_CONTENTS")?w({},e.FORBID_CONTENTS,pt):Ke,ve=_(e,"FORBID_TAGS")?w({},e.FORBID_TAGS,pt):{},Le=_(e,"FORBID_ATTR")?w({},e.FORBID_ATTR,pt):{},qe=!!_(e,"USE_PROFILES")&&e.USE_PROFILES,Ce=!1!==e.ALLOW_ARIA_ATTR,xe=!1!==e.ALLOW_DATA_ATTR,Ie=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,ke=e.SAFE_FOR_TEMPLATES||!1,Ue=!1!==e.SAFE_FOR_XML,ze=e.WHOLE_DOCUMENT||!1,Fe=e.RETURN_DOM||!1,Be=e.RETURN_DOM_FRAGMENT||!1,We=e.RETURN_TRUSTED_TYPE||!1,He=e.FORCE_BODY||!1,Ge=!1!==e.SANITIZE_DOM,Ye=e.SANITIZE_NAMED_PROPS||!1,je=!1!==e.KEEP_CONTENT,Xe=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||X,ot=e.NAMESPACE||nt,lt=e.MATHML_TEXT_INTEGRATION_POINTS||lt,ct=e.HTML_INTEGRATION_POINTS||ct,De=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(De.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(De.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(De.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ke&&(xe=!1),Be&&(Fe=!0),qe&&(Ne=w({},U),we=[],!0===qe.html&&(w(Ne,L),w(we,z)),!0===qe.svg&&(w(Ne,C),w(we,P),w(we,F)),!0===qe.svgFilters&&(w(Ne,x),w(we,P),w(we,F)),!0===qe.mathMl&&(w(Ne,M),w(we,H),w(we,F))),e.ADD_TAGS&&(Ne===Re&&(Ne=D(Ne)),w(Ne,e.ADD_TAGS,pt)),e.ADD_ATTR&&(we===Oe&&(we=D(we)),w(we,e.ADD_ATTR,pt)),e.ADD_URI_SAFE_ATTR&&w(Je,e.ADD_URI_SAFE_ATTR,pt),e.FORBID_CONTENTS&&($e===Ke&&($e=D($e)),w($e,e.FORBID_CONTENTS,pt)),je&&(Ne["#text"]=!0),ze&&w(Ne,["html","head","body"]),Ne.table&&(w(Ne,["tbody"]),delete ve.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');le=e.TRUSTED_TYPES_POLICY,ce=le.createHTML("")}else void 0===le&&(le=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(j,c)),null!==le&&"string"==typeof ce&&(ce=le.createHTML(""));i&&i(e),ft=e}},Tt=w({},[...C,...x,...I]),yt=w({},[...M,...k]),Et=function(e){f(o.removed,{element:e});try{ae(e).removeChild(e)}catch(t){V(e)}},At=function(e,t){try{f(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Fe||Be)try{Et(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},_t=function(e){let t=null,n=null;if(He)e="<remove></remove>"+e;else{const t=T(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ut&&ot===nt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=le?le.createHTML(e):e;if(ot===nt)try{t=(new Y).parseFromString(o,ut)}catch(e){}if(!t||!t.documentElement){t=se.createDocument(ot,"template",null);try{t.documentElement.innerHTML=rt?ce:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),ot===nt?pe.call(t,ze?"html":"body")[0]:ze?t.documentElement:i},St=function(e){return ue.call(e.ownerDocument||e,e,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT|B.SHOW_PROCESSING_INSTRUCTION|B.SHOW_CDATA_SECTION,null)},bt=function(e){return e instanceof G&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof W)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Nt=function(e){return"function"==typeof R&&e instanceof R};function Rt(e,t,n){u(e,(e=>{e.call(o,t,n,ft)}))}const wt=function(e){let t=null;if(Rt(de.beforeSanitizeElements,e,null),bt(e))return Et(e),!0;const n=pt(e.nodeName);if(Rt(de.uponSanitizeElement,e,{tagName:n,allowedTags:Ne}),e.hasChildNodes()&&!Nt(e.firstElementChild)&&S(/<[/\w!]/g,e.innerHTML)&&S(/<[/\w!]/g,e.textContent))return Et(e),!0;if(e.nodeType===ee)return Et(e),!0;if(Ue&&e.nodeType===te&&S(/<[/\w]/g,e.data))return Et(e),!0;if(!Ne[n]||ve[n]){if(!ve[n]&&Dt(n)){if(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n))return!1;if(De.tagNameCheck instanceof Function&&De.tagNameCheck(n))return!1}if(je&&!$e[n]){const t=ae(e)||e.parentNode,n=ie(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o){const r=$(n[o],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,re(e))}}}return Et(e),!0}return e instanceof O&&!function(e){let t=ae(e);t&&t.tagName||(t={namespaceURI:ot,tagName:"template"});const n=h(e.tagName),o=h(t.tagName);return!!it[e.namespaceURI]&&(e.namespaceURI===tt?t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===o||lt[o]):Boolean(Tt[n]):e.namespaceURI===et?t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&ct[o]:Boolean(yt[n]):e.namespaceURI===nt?!(t.namespaceURI===tt&&!ct[o])&&!(t.namespaceURI===et&&!lt[o])&&!yt[n]&&(st[n]||!Tt[n]):!("application/xhtml+xml"!==ut||!it[e.namespaceURI]))}(e)?(Et(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!S(/<\/no(script|embed|frames)/i,e.innerHTML)?(ke&&e.nodeType===Q&&(t=e.textContent,u([he,ge,Te],(e=>{t=y(t,e," ")})),e.textContent!==t&&(f(o.removed,{element:e.cloneNode()}),e.textContent=t)),Rt(de.afterSanitizeElements,e,null),!1):(Et(e),!0)},Ot=function(e,t,n){if(Ge&&("id"===t||"name"===t)&&(n in r||n in dt))return!1;if(xe&&!Le[t]&&S(ye,t));else if(Ce&&S(Ee,t));else if(!we[t]||Le[t]){if(!(Dt(e)&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,e)||De.tagNameCheck instanceof Function&&De.tagNameCheck(e))&&(De.attributeNameCheck instanceof RegExp&&S(De.attributeNameCheck,t)||De.attributeNameCheck instanceof Function&&De.attributeNameCheck(t))||"is"===t&&De.allowCustomizedBuiltInElements&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n)||De.tagNameCheck instanceof Function&&De.tagNameCheck(n))))return!1}else if(Je[t]);else if(S(be,y(n,_e,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==E(n,"data:")||!Ve[e]){if(Ie&&!S(Ae,y(n,_e,"")));else if(n)return!1}else;return!0},Dt=function(e){return"annotation-xml"!==e&&T(e,Se)},vt=function(e){Rt(de.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||bt(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:we,forceKeepAttr:void 0};let r=t.length;for(;r--;){const i=t[r],{name:a,namespaceURI:l,value:c}=i,s=pt(a);let m="value"===a?c:A(c);if(n.attrName=s,n.attrValue=m,n.keepAttr=!0,n.forceKeepAttr=void 0,Rt(de.uponSanitizeAttribute,e,n),m=n.attrValue,!Ye||"id"!==s&&"name"!==s||(At(a,e),m="user-content-"+m),Ue&&S(/((--!?|])>)|<\/(style|title)/i,m)){At(a,e);continue}if(n.forceKeepAttr)continue;if(At(a,e),!n.keepAttr)continue;if(!Me&&S(/\/>/i,m)){At(a,e);continue}ke&&u([he,ge,Te],(e=>{m=y(m,e," ")}));const f=pt(e.nodeName);if(Ot(f,s,m)){if(le&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(l);else switch(j.getAttributeType(f,s)){case"TrustedHTML":m=le.createHTML(m);break;case"TrustedScriptURL":m=le.createScriptURL(m)}try{l?e.setAttributeNS(l,a,m):e.setAttribute(a,m),bt(e)?Et(e):p(o.removed)}catch(e){}}}Rt(de.afterSanitizeAttributes,e,null)},Lt=function e(t){let n=null;const o=St(t);for(Rt(de.beforeSanitizeShadowDOM,t,null);n=o.nextNode();)Rt(de.uponSanitizeShadowNode,n,null),wt(n),vt(n),n.content instanceof s&&e(n.content);Rt(de.afterSanitizeShadowDOM,t,null)};return o.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=null,i=null,l=null;if(rt=!e,rt&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Nt(e)){if("function"!=typeof e.toString)throw b("toString is not a function");if("string"!=typeof(e=e.toString()))throw b("dirty is not a string, aborting")}if(!o.isSupported)return e;if(Pe||gt(t),o.removed=[],"string"==typeof e&&(Xe=!1),Xe){if(e.nodeName){const t=pt(e.nodeName);if(!Ne[t]||ve[t])throw b("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof R)n=_t("\x3c!----\x3e"),r=n.ownerDocument.importNode(e,!0),r.nodeType===J&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(!Fe&&!ke&&!ze&&-1===e.indexOf("<"))return le&&We?le.createHTML(e):e;if(n=_t(e),!n)return Fe?null:We?ce:""}n&&He&&Et(n.firstChild);const c=St(Xe?e:n);for(;i=c.nextNode();)wt(i),vt(i),i.content instanceof s&&Lt(i.content);if(Xe)return e;if(Fe){if(Be)for(l=me.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(we.shadowroot||we.shadowrootmode)&&(l=fe.call(a,l,!0)),l}let m=ze?n.outerHTML:n.innerHTML;return ze&&Ne["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&S(K,n.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+m),ke&&u([he,ge,Te],(e=>{m=y(m,e," ")})),le&&We?le.createHTML(m):m},o.setConfig=function(){gt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Pe=!0},o.clearConfig=function(){ft=null,Pe=!1},o.isValidAttribute=function(e,t,n){ft||gt({});const o=pt(e),r=pt(t);return Ot(o,r,n)},o.addHook=function(e,t){"function"==typeof t&&f(de[e],t)},o.removeHook=function(e,t){if(void 0!==t){const n=m(de[e],t);return-1===n?void 0:d(de[e],n,1)[0]}return p(de[e])},o.removeHooks=function(e){de[e]=[]},o.removeAllHooks=function(){de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},o}();return re}));/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).pako={})}(this,(function(t){"use strict";function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=256,n=286,i=30,r=15,s=new Uint8Array([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]),o=new Uint8Array([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]),l=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),h=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=new Array(576);e(d);var _=new Array(60);e(_);var f=new Array(512);e(f);var u=new Array(256);e(u);var c=new Array(29);e(c);var w,m,b,g=new Array(i);function p(t,e,a,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}function v(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(g);var k=function(t){return t<256?f[t]:f[256+(t>>>7)]},y=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},x=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,y(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},z=function(t,e,a){x(t,a[2*e],a[2*e+1])},A=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},E=function(t,e,a){var n,i,s=new Array(16),o=0;for(n=1;n<=r;n++)o=o+a[n-1]<<1,s[n]=o;for(i=0;i<=e;i++){var l=t[2*i+1];0!==l&&(t[2*i]=A(s[l]++,l))}},R=function(t){var e;for(e=0;e<n;e++)t.dyn_ltree[2*e]=0;for(e=0;e<i;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},Z=function(t){t.bi_valid>8?y(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},S=function(t,e,a,n){var i=2*e,r=2*a;return t[i]<t[r]||t[i]===t[r]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],i=a<<1;i<=t.heap_len&&(i<t.heap_len&&S(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!S(e,n,t.heap[i],t.depth));)t.heap[a]=t.heap[i],a=i,i<<=1;t.heap[a]=n},D=function(t,e,n){var i,r,l,h,d=0;if(0!==t.sym_next)do{i=255&t.pending_buf[t.sym_buf+d++],i+=(255&t.pending_buf[t.sym_buf+d++])<<8,r=t.pending_buf[t.sym_buf+d++],0===i?z(t,r,e):(l=u[r],z(t,l+a+1,e),0!==(h=s[l])&&(r-=c[l],x(t,r,h)),i--,l=k(i),z(t,l,n),0!==(h=o[l])&&(i-=g[l],x(t,i,h)))}while(d<t.sym_next);z(t,256,e)},T=function(t,e){var a,n,i,s=e.dyn_tree,o=e.stat_desc.static_tree,l=e.stat_desc.has_stree,h=e.stat_desc.elems,d=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<h;a++)0!==s[2*a]?(t.heap[++t.heap_len]=d=a,t.depth[a]=0):s[2*a+1]=0;for(;t.heap_len<2;)s[2*(i=t.heap[++t.heap_len]=d<2?++d:0)]=1,t.depth[i]=0,t.opt_len--,l&&(t.static_len-=o[2*i+1]);for(e.max_code=d,a=t.heap_len>>1;a>=1;a--)U(t,s,a);i=h;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,s,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,s[2*i]=s[2*a]+s[2*n],t.depth[i]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,s[2*a+1]=s[2*n+1]=i,t.heap[1]=i++,U(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,i,s,o,l,h=e.dyn_tree,d=e.max_code,_=e.stat_desc.static_tree,f=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,w=e.stat_desc.max_length,m=0;for(s=0;s<=r;s++)t.bl_count[s]=0;for(h[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(s=h[2*h[2*(n=t.heap[a])+1]+1]+1)>w&&(s=w,m++),h[2*n+1]=s,n>d||(t.bl_count[s]++,o=0,n>=c&&(o=u[n-c]),l=h[2*n],t.opt_len+=l*(s+o),f&&(t.static_len+=l*(_[2*n+1]+o)));if(0!==m){do{for(s=w-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[w]--,m-=2}while(m>0);for(s=w;0!==s;s--)for(n=t.bl_count[s];0!==n;)(i=t.heap[--a])>d||(h[2*i+1]!==s&&(t.opt_len+=(s-h[2*i+1])*h[2*i],h[2*i+1]=s),n--)}}(t,e),E(s,d,t.bl_count)},O=function(t,e,a){var n,i,r=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)i=s,s=e[2*(n+1)+1],++o<l&&i===s||(o<h?t.bl_tree[2*i]+=o:0!==i?(i!==r&&t.bl_tree[2*i]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,r=i,0===s?(l=138,h=3):i===s?(l=6,h=3):(l=7,h=4))},I=function(t,e,a){var n,i,r=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),n=0;n<=a;n++)if(i=s,s=e[2*(n+1)+1],!(++o<l&&i===s)){if(o<h)do{z(t,i,t.bl_tree)}while(0!=--o);else 0!==i?(i!==r&&(z(t,i,t.bl_tree),o--),z(t,16,t.bl_tree),x(t,o-3,2)):o<=10?(z(t,17,t.bl_tree),x(t,o-3,3)):(z(t,18,t.bl_tree),x(t,o-11,7));o=0,r=i,0===s?(l=138,h=3):i===s?(l=6,h=3):(l=7,h=4)}},F=!1,L=function(t,e,a,n){x(t,0+(n?1:0),3),Z(t),y(t,a),y(t,~a),a&&t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a},N=function(t,e,n,i){var r,s,o=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<a;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),T(t,t.l_desc),T(t,t.d_desc),o=function(t){var e;for(O(t,t.dyn_ltree,t.l_desc.max_code),O(t,t.dyn_dtree,t.d_desc.max_code),T(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=r&&(r=s)):r=s=n+5,n+4<=r&&-1!==e?L(t,e,n,i):4===t.strategy||s===r?(x(t,2+(i?1:0),3),D(t,d,_)):(x(t,4+(i?1:0),3),function(t,e,a,n){var i;for(x(t,e-257,5),x(t,a-1,5),x(t,n-4,4),i=0;i<n;i++)x(t,t.bl_tree[2*h[i]+1],3);I(t,t.dyn_ltree,e-1),I(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),D(t,t.dyn_ltree,t.dyn_dtree)),R(t),i&&Z(t)},B={_tr_init:function(t){F||(!function(){var t,e,a,h,v,k=new Array(16);for(a=0,h=0;h<28;h++)for(c[h]=a,t=0;t<1<<s[h];t++)u[a++]=h;for(u[a-1]=h,v=0,h=0;h<16;h++)for(g[h]=v,t=0;t<1<<o[h];t++)f[v++]=h;for(v>>=7;h<i;h++)for(g[h]=v<<7,t=0;t<1<<o[h]-7;t++)f[256+v++]=h;for(e=0;e<=r;e++)k[e]=0;for(t=0;t<=143;)d[2*t+1]=8,t++,k[8]++;for(;t<=255;)d[2*t+1]=9,t++,k[9]++;for(;t<=279;)d[2*t+1]=7,t++,k[7]++;for(;t<=287;)d[2*t+1]=8,t++,k[8]++;for(E(d,287,k),t=0;t<i;t++)_[2*t+1]=5,_[2*t]=A(t,5);w=new p(d,s,257,n,r),m=new p(_,o,0,i,r),b=new p(new Array(0),l,0,19,7)}(),F=!0),t.l_desc=new v(t.dyn_ltree,w),t.d_desc=new v(t.dyn_dtree,m),t.bl_desc=new v(t.bl_tree,b),t.bi_buf=0,t.bi_valid=0,R(t)},_tr_stored_block:L,_tr_flush_block:N,_tr_tally:function(t,e,n){return t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=n,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(u[n]+a+1)]++,t.dyn_dtree[2*k(e)]++),t.sym_next===t.sym_end},_tr_align:function(t){x(t,2,3),z(t,256,d),function(t){16===t.bi_valid?(y(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)}(t)}},C=function(t,e,a,n){for(var i=65535&t|0,r=t>>>16&65535|0,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{r=r+(i=i+e[n++]|0)|0}while(--s);i%=65521,r%=65521}return i|r<<16|0},M=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),H=function(t,e,a,n){var i=M,r=n+a;t^=-1;for(var s=n;s<r;s++)t=t>>>8^i[255&(t^e[s])];return-1^t},j={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"},K={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},P=B._tr_init,Y=B._tr_stored_block,G=B._tr_flush_block,X=B._tr_tally,W=B._tr_align,q=K.Z_NO_FLUSH,J=K.Z_PARTIAL_FLUSH,Q=K.Z_FULL_FLUSH,V=K.Z_FINISH,$=K.Z_BLOCK,tt=K.Z_OK,et=K.Z_STREAM_END,at=K.Z_STREAM_ERROR,nt=K.Z_DATA_ERROR,it=K.Z_BUF_ERROR,rt=K.Z_DEFAULT_COMPRESSION,st=K.Z_FILTERED,ot=K.Z_HUFFMAN_ONLY,lt=K.Z_RLE,ht=K.Z_FIXED,dt=K.Z_DEFAULT_STRATEGY,_t=K.Z_UNKNOWN,ft=K.Z_DEFLATED,ut=258,ct=262,wt=42,mt=113,bt=666,gt=function(t,e){return t.msg=j[e],e},pt=function(t){return 2*t-(t>4?9:0)},vt=function(t){for(var e=t.length;--e>=0;)t[e]=0},kt=function(t){var e,a,n,i=t.w_size;n=e=t.hash_size;do{a=t.head[--n],t.head[n]=a>=i?a-i:0}while(--e);n=e=i;do{a=t.prev[--n],t.prev[n]=a>=i?a-i:0}while(--e)},yt=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},xt=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},zt=function(t,e){G(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,xt(t.strm)},At=function(t,e){t.pending_buf[t.pending++]=e},Et=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Rt=function(t,e,a,n){var i=t.avail_in;return i>n&&(i=n),0===i?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),a),1===t.state.wrap?t.adler=C(t.adler,e,i,a):2===t.state.wrap&&(t.adler=H(t.adler,e,i,a)),t.next_in+=i,t.total_in+=i,i)},Zt=function(t,e){var a,n,i=t.max_chain_length,r=t.strstart,s=t.prev_length,o=t.nice_match,l=t.strstart>t.w_size-ct?t.strstart-(t.w_size-ct):0,h=t.window,d=t.w_mask,_=t.prev,f=t.strstart+ut,u=h[r+s-1],c=h[r+s];t.prev_length>=t.good_match&&(i>>=2),o>t.lookahead&&(o=t.lookahead);do{if(h[(a=e)+s]===c&&h[a+s-1]===u&&h[a]===h[r]&&h[++a]===h[r+1]){r+=2,a++;do{}while(h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&r<f);if(n=ut-(f-r),r=f-ut,n>s){if(t.match_start=e,s=n,n>=o)break;u=h[r+s-1],c=h[r+s]}}}while((e=_[e&d])>l&&0!=--i);return s<=t.lookahead?s:t.lookahead},St=function(t){var e,a,n,i=t.w_size;do{if(a=t.window_size-t.lookahead-t.strstart,t.strstart>=i+(i-ct)&&(t.window.set(t.window.subarray(i,i+i-a),0),t.match_start-=i,t.strstart-=i,t.block_start-=i,t.insert>t.strstart&&(t.insert=t.strstart),kt(t),a+=i),0===t.strm.avail_in)break;if(e=Rt(t.strm,t.window,t.strstart+t.lookahead,a),t.lookahead+=e,t.lookahead+t.insert>=3)for(n=t.strstart-t.insert,t.ins_h=t.window[n],t.ins_h=yt(t,t.ins_h,t.window[n+1]);t.insert&&(t.ins_h=yt(t,t.ins_h,t.window[n+3-1]),t.prev[n&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=n,n++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<ct&&0!==t.strm.avail_in)},Ut=function(t,e){var a,n,i,r=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,s=0,o=t.strm.avail_in;do{if(a=65535,i=t.bi_valid+42>>3,t.strm.avail_out<i)break;if(i=t.strm.avail_out-i,a>(n=t.strstart-t.block_start)+t.strm.avail_in&&(a=n+t.strm.avail_in),a>i&&(a=i),a<r&&(0===a&&e!==V||e===q||a!==n+t.strm.avail_in))break;s=e===V&&a===n+t.strm.avail_in?1:0,Y(t,0,0,s),t.pending_buf[t.pending-4]=a,t.pending_buf[t.pending-3]=a>>8,t.pending_buf[t.pending-2]=~a,t.pending_buf[t.pending-1]=~a>>8,xt(t.strm),n&&(n>a&&(n=a),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+n),t.strm.next_out),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n,t.block_start+=n,a-=n),a&&(Rt(t.strm,t.strm.output,t.strm.next_out,a),t.strm.next_out+=a,t.strm.avail_out-=a,t.strm.total_out+=a)}while(0===s);return(o-=t.strm.avail_in)&&(o>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=o&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-o,t.strm.next_in),t.strstart),t.strstart+=o,t.insert+=o>t.w_size-t.insert?t.w_size-t.insert:o),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),s?4:e!==q&&e!==V&&0===t.strm.avail_in&&t.strstart===t.block_start?2:(i=t.window_size-t.strstart,t.strm.avail_in>i&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,i+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),i>t.strm.avail_in&&(i=t.strm.avail_in),i&&(Rt(t.strm,t.window,t.strstart,i),t.strstart+=i,t.insert+=i>t.w_size-t.insert?t.w_size-t.insert:i),t.high_water<t.strstart&&(t.high_water=t.strstart),i=t.bi_valid+42>>3,r=(i=t.pending_buf_size-i>65535?65535:t.pending_buf_size-i)>t.w_size?t.w_size:i,((n=t.strstart-t.block_start)>=r||(n||e===V)&&e!==q&&0===t.strm.avail_in&&n<=i)&&(a=n>i?i:n,s=e===V&&0===t.strm.avail_in&&a===n?1:0,Y(t,t.block_start,a,s),t.block_start+=a,xt(t.strm)),s?3:1)},Dt=function(t,e){for(var a,n;;){if(t.lookahead<ct){if(St(t),t.lookahead<ct&&e===q)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=yt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-ct&&(t.match_length=Zt(t,a)),t.match_length>=3)if(n=X(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=yt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=yt(t,t.ins_h,t.window[t.strstart+1]);else n=X(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(zt(t,!1),0===t.strm.avail_out)?1:2},Tt=function(t,e){for(var a,n,i;;){if(t.lookahead<ct){if(St(t),t.lookahead<ct&&e===q)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=yt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-ct&&(t.match_length=Zt(t,a),t.match_length<=5&&(t.strategy===st||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,n=X(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=yt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(zt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=X(t,0,t.window[t.strstart-1]))&&zt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=X(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(zt(t,!1),0===t.strm.avail_out)?1:2};function Ot(t,e,a,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=i}var It=[new Ot(0,0,0,0,Ut),new Ot(4,4,8,4,Dt),new Ot(4,5,16,8,Dt),new Ot(4,6,32,32,Dt),new Ot(4,4,16,16,Tt),new Ot(8,16,32,32,Tt),new Ot(8,16,128,128,Tt),new Ot(8,32,128,256,Tt),new Ot(32,128,258,1024,Tt),new Ot(32,258,258,4096,Tt)];function Ft(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ft,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),vt(this.dyn_ltree),vt(this.dyn_dtree),vt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),vt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),vt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Lt=function(t){if(!t)return 1;var e=t.state;return!e||e.strm!==t||e.status!==wt&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&e.status!==mt&&e.status!==bt?1:0},Nt=function(t){if(Lt(t))return gt(t,at);t.total_in=t.total_out=0,t.data_type=_t;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?wt:mt,t.adler=2===e.wrap?0:1,e.last_flush=-2,P(e),tt},Bt=function(t){var e,a=Nt(t);return a===tt&&((e=t.state).window_size=2*e.w_size,vt(e.head),e.max_lazy_match=It[e.level].max_lazy,e.good_match=It[e.level].good_length,e.nice_match=It[e.level].nice_length,e.max_chain_length=It[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),a},Ct=function(t,e,a,n,i,r){if(!t)return at;var s=1;if(e===rt&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),i<1||i>9||a!==ft||n<8||n>15||e<0||e>9||r<0||r>ht||8===n&&1!==s)return gt(t,at);8===n&&(n=9);var o=new Ft;return t.state=o,o.strm=t,o.status=wt,o.wrap=s,o.gzhead=null,o.w_bits=n,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=i+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new Uint8Array(2*o.w_size),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<i+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=3*(o.lit_bufsize-1),o.level=e,o.strategy=r,o.method=a,Bt(t)},Mt={deflateInit:function(t,e){return Ct(t,e,ft,15,8,dt)},deflateInit2:Ct,deflateReset:Bt,deflateResetKeep:Nt,deflateSetHeader:function(t,e){return Lt(t)||2!==t.state.wrap?at:(t.state.gzhead=e,tt)},deflate:function(t,e){if(Lt(t)||e>$||e<0)return t?gt(t,at):at;var a=t.state;if(!t.output||0!==t.avail_in&&!t.input||a.status===bt&&e!==V)return gt(t,0===t.avail_out?it:at);var n=a.last_flush;if(a.last_flush=e,0!==a.pending){if(xt(t),0===t.avail_out)return a.last_flush=-1,tt}else if(0===t.avail_in&&pt(e)<=pt(n)&&e!==V)return gt(t,it);if(a.status===bt&&0!==t.avail_in)return gt(t,it);if(a.status===wt&&0===a.wrap&&(a.status=mt),a.status===wt){var i=ft+(a.w_bits-8<<4)<<8;if(i|=(a.strategy>=ot||a.level<2?0:a.level<6?1:6===a.level?2:3)<<6,0!==a.strstart&&(i|=32),Et(a,i+=31-i%31),0!==a.strstart&&(Et(a,t.adler>>>16),Et(a,65535&t.adler)),t.adler=1,a.status=mt,xt(t),0!==a.pending)return a.last_flush=-1,tt}if(57===a.status)if(t.adler=0,At(a,31),At(a,139),At(a,8),a.gzhead)At(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),At(a,255&a.gzhead.time),At(a,a.gzhead.time>>8&255),At(a,a.gzhead.time>>16&255),At(a,a.gzhead.time>>24&255),At(a,9===a.level?2:a.strategy>=ot||a.level<2?4:0),At(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(At(a,255&a.gzhead.extra.length),At(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(t.adler=H(t.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69;else if(At(a,0),At(a,0),At(a,0),At(a,0),At(a,0),At(a,9===a.level?2:a.strategy>=ot||a.level<2?4:0),At(a,3),a.status=mt,xt(t),0!==a.pending)return a.last_flush=-1,tt;if(69===a.status){if(a.gzhead.extra){for(var r=a.pending,s=(65535&a.gzhead.extra.length)-a.gzindex;a.pending+s>a.pending_buf_size;){var o=a.pending_buf_size-a.pending;if(a.pending_buf.set(a.gzhead.extra.subarray(a.gzindex,a.gzindex+o),a.pending),a.pending=a.pending_buf_size,a.gzhead.hcrc&&a.pending>r&&(t.adler=H(t.adler,a.pending_buf,a.pending-r,r)),a.gzindex+=o,xt(t),0!==a.pending)return a.last_flush=-1,tt;r=0,s-=o}var l=new Uint8Array(a.gzhead.extra);a.pending_buf.set(l.subarray(a.gzindex,a.gzindex+s),a.pending),a.pending+=s,a.gzhead.hcrc&&a.pending>r&&(t.adler=H(t.adler,a.pending_buf,a.pending-r,r)),a.gzindex=0}a.status=73}if(73===a.status){if(a.gzhead.name){var h,d=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>d&&(t.adler=H(t.adler,a.pending_buf,a.pending-d,d)),xt(t),0!==a.pending)return a.last_flush=-1,tt;d=0}h=a.gzindex<a.gzhead.name.length?255&a.gzhead.name.charCodeAt(a.gzindex++):0,At(a,h)}while(0!==h);a.gzhead.hcrc&&a.pending>d&&(t.adler=H(t.adler,a.pending_buf,a.pending-d,d)),a.gzindex=0}a.status=91}if(91===a.status){if(a.gzhead.comment){var _,f=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>f&&(t.adler=H(t.adler,a.pending_buf,a.pending-f,f)),xt(t),0!==a.pending)return a.last_flush=-1,tt;f=0}_=a.gzindex<a.gzhead.comment.length?255&a.gzhead.comment.charCodeAt(a.gzindex++):0,At(a,_)}while(0!==_);a.gzhead.hcrc&&a.pending>f&&(t.adler=H(t.adler,a.pending_buf,a.pending-f,f))}a.status=103}if(103===a.status){if(a.gzhead.hcrc){if(a.pending+2>a.pending_buf_size&&(xt(t),0!==a.pending))return a.last_flush=-1,tt;At(a,255&t.adler),At(a,t.adler>>8&255),t.adler=0}if(a.status=mt,xt(t),0!==a.pending)return a.last_flush=-1,tt}if(0!==t.avail_in||0!==a.lookahead||e!==q&&a.status!==bt){var u=0===a.level?Ut(a,e):a.strategy===ot?function(t,e){for(var a;;){if(0===t.lookahead&&(St(t),0===t.lookahead)){if(e===q)return 1;break}if(t.match_length=0,a=X(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(zt(t,!1),0===t.strm.avail_out)?1:2}(a,e):a.strategy===lt?function(t,e){for(var a,n,i,r,s=t.window;;){if(t.lookahead<=ut){if(St(t),t.lookahead<=ut&&e===q)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[i=t.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){r=t.strstart+ut;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<r);t.match_length=ut-(r-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=X(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=X(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(zt(t,!1),0===t.strm.avail_out)?1:2}(a,e):It[a.level].func(a,e);if(3!==u&&4!==u||(a.status=bt),1===u||3===u)return 0===t.avail_out&&(a.last_flush=-1),tt;if(2===u&&(e===J?W(a):e!==$&&(Y(a,0,0,!1),e===Q&&(vt(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),xt(t),0===t.avail_out))return a.last_flush=-1,tt}return e!==V?tt:a.wrap<=0?et:(2===a.wrap?(At(a,255&t.adler),At(a,t.adler>>8&255),At(a,t.adler>>16&255),At(a,t.adler>>24&255),At(a,255&t.total_in),At(a,t.total_in>>8&255),At(a,t.total_in>>16&255),At(a,t.total_in>>24&255)):(Et(a,t.adler>>>16),Et(a,65535&t.adler)),xt(t),a.wrap>0&&(a.wrap=-a.wrap),0!==a.pending?tt:et)},deflateEnd:function(t){if(Lt(t))return at;var e=t.state.status;return t.state=null,e===mt?gt(t,nt):tt},deflateSetDictionary:function(t,e){var a=e.length;if(Lt(t))return at;var n=t.state,i=n.wrap;if(2===i||1===i&&n.status!==wt||n.lookahead)return at;if(1===i&&(t.adler=C(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===i&&(vt(n.head),n.strstart=0,n.block_start=0,n.insert=0);var r=new Uint8Array(n.w_size);r.set(e.subarray(a-n.w_size,a),0),e=r,a=n.w_size}var s=t.avail_in,o=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,St(n);n.lookahead>=3;){var h=n.strstart,d=n.lookahead-2;do{n.ins_h=yt(n,n.ins_h,n.window[h+3-1]),n.prev[h&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=h,h++}while(--d);n.strstart=h,n.lookahead=2,St(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=o,t.input=l,t.avail_in=s,n.wrap=i,tt},deflateInfo:"pako deflate (from Nodeca project)"};function Ht(t){return Ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ht(t)}var jt=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},Kt=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var a=e.shift();if(a){if("object"!==Ht(a))throw new TypeError(a+"must be non-object");for(var n in a)jt(a,n)&&(t[n]=a[n])}}return t},Pt=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var i=new Uint8Array(e),r=0,s=0,o=t.length;r<o;r++){var l=t[r];i.set(l,s),s+=l.length}return i},Yt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Yt=!1}for(var Gt=new Uint8Array(256),Xt=0;Xt<256;Xt++)Gt[Xt]=Xt>=252?6:Xt>=248?5:Xt>=240?4:Xt>=224?3:Xt>=192?2:1;Gt[254]=Gt[254]=1;var Wt=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);var e,a,n,i,r,s=t.length,o=0;for(i=0;i<s;i++)55296==(64512&(a=t.charCodeAt(i)))&&i+1<s&&56320==(64512&(n=t.charCodeAt(i+1)))&&(a=65536+(a-55296<<10)+(n-56320),i++),o+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(o),r=0,i=0;r<o;i++)55296==(64512&(a=t.charCodeAt(i)))&&i+1<s&&56320==(64512&(n=t.charCodeAt(i+1)))&&(a=65536+(a-55296<<10)+(n-56320),i++),a<128?e[r++]=a:a<2048?(e[r++]=192|a>>>6,e[r++]=128|63&a):a<65536?(e[r++]=224|a>>>12,e[r++]=128|a>>>6&63,e[r++]=128|63&a):(e[r++]=240|a>>>18,e[r++]=128|a>>>12&63,e[r++]=128|a>>>6&63,e[r++]=128|63&a);return e},qt=function(t,e){var a,n,i=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));var r=new Array(2*i);for(n=0,a=0;a<i;){var s=t[a++];if(s<128)r[n++]=s;else{var o=Gt[s];if(o>4)r[n++]=65533,a+=o-1;else{for(s&=2===o?31:3===o?15:7;o>1&&a<i;)s=s<<6|63&t[a++],o--;o>1?r[n++]=65533:s<65536?r[n++]=s:(s-=65536,r[n++]=55296|s>>10&1023,r[n++]=56320|1023&s)}}}return function(t,e){if(e<65534&&t.subarray&&Yt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));for(var a="",n=0;n<e;n++)a+=String.fromCharCode(t[n]);return a}(r,n)},Jt=function(t,e){(e=e||t.length)>t.length&&(e=t.length);for(var a=e-1;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+Gt[t[a]]>e?a:e};var Qt=function(){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},Vt=Object.prototype.toString,$t=K.Z_NO_FLUSH,te=K.Z_SYNC_FLUSH,ee=K.Z_FULL_FLUSH,ae=K.Z_FINISH,ne=K.Z_OK,ie=K.Z_STREAM_END,re=K.Z_DEFAULT_COMPRESSION,se=K.Z_DEFAULT_STRATEGY,oe=K.Z_DEFLATED;function le(t){this.options=Kt({level:re,method:oe,chunkSize:16384,windowBits:15,memLevel:8,strategy:se},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Qt,this.strm.avail_out=0;var a=Mt.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==ne)throw new Error(j[a]);if(e.header&&Mt.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(n="string"==typeof e.dictionary?Wt(e.dictionary):"[object ArrayBuffer]"===Vt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(a=Mt.deflateSetDictionary(this.strm,n))!==ne)throw new Error(j[a]);this._dict_set=!0}}function he(t,e){var a=new le(e);if(a.push(t,!0),a.err)throw a.msg||j[a.err];return a.result}le.prototype.push=function(t,e){var a,n,i=this.strm,r=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?ae:$t,"string"==typeof t?i.input=Wt(t):"[object ArrayBuffer]"===Vt.call(t)?i.input=new Uint8Array(t):i.input=t,i.next_in=0,i.avail_in=i.input.length;;)if(0===i.avail_out&&(i.output=new Uint8Array(r),i.next_out=0,i.avail_out=r),(n===te||n===ee)&&i.avail_out<=6)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else{if((a=Mt.deflate(i,n))===ie)return i.next_out>0&&this.onData(i.output.subarray(0,i.next_out)),a=Mt.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===ne;if(0!==i.avail_out){if(n>0&&i.next_out>0)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else if(0===i.avail_in)break}else this.onData(i.output)}return!0},le.prototype.onData=function(t){this.chunks.push(t)},le.prototype.onEnd=function(t){t===ne&&(this.result=Pt(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var de={Deflate:le,deflate:he,deflateRaw:function(t,e){return(e=e||{}).raw=!0,he(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,he(t,e)},constants:K},_e=16209,fe=function(t,e){var a,n,i,r,s,o,l,h,d,_,f,u,c,w,m,b,g,p,v,k,y,x,z,A,E=t.state;a=t.next_in,z=t.input,n=a+(t.avail_in-5),i=t.next_out,A=t.output,r=i-(e-t.avail_out),s=i+(t.avail_out-257),o=E.dmax,l=E.wsize,h=E.whave,d=E.wnext,_=E.window,f=E.hold,u=E.bits,c=E.lencode,w=E.distcode,m=(1<<E.lenbits)-1,b=(1<<E.distbits)-1;t:do{u<15&&(f+=z[a++]<<u,u+=8,f+=z[a++]<<u,u+=8),g=c[f&m];e:for(;;){if(f>>>=p=g>>>24,u-=p,0===(p=g>>>16&255))A[i++]=65535&g;else{if(!(16&p)){if(0==(64&p)){g=c[(65535&g)+(f&(1<<p)-1)];continue e}if(32&p){E.mode=16191;break t}t.msg="invalid literal/length code",E.mode=_e;break t}v=65535&g,(p&=15)&&(u<p&&(f+=z[a++]<<u,u+=8),v+=f&(1<<p)-1,f>>>=p,u-=p),u<15&&(f+=z[a++]<<u,u+=8,f+=z[a++]<<u,u+=8),g=w[f&b];a:for(;;){if(f>>>=p=g>>>24,u-=p,!(16&(p=g>>>16&255))){if(0==(64&p)){g=w[(65535&g)+(f&(1<<p)-1)];continue a}t.msg="invalid distance code",E.mode=_e;break t}if(k=65535&g,u<(p&=15)&&(f+=z[a++]<<u,(u+=8)<p&&(f+=z[a++]<<u,u+=8)),(k+=f&(1<<p)-1)>o){t.msg="invalid distance too far back",E.mode=_e;break t}if(f>>>=p,u-=p,k>(p=i-r)){if((p=k-p)>h&&E.sane){t.msg="invalid distance too far back",E.mode=_e;break t}if(y=0,x=_,0===d){if(y+=l-p,p<v){v-=p;do{A[i++]=_[y++]}while(--p);y=i-k,x=A}}else if(d<p){if(y+=l+d-p,(p-=d)<v){v-=p;do{A[i++]=_[y++]}while(--p);if(y=0,d<v){v-=p=d;do{A[i++]=_[y++]}while(--p);y=i-k,x=A}}}else if(y+=d-p,p<v){v-=p;do{A[i++]=_[y++]}while(--p);y=i-k,x=A}for(;v>2;)A[i++]=x[y++],A[i++]=x[y++],A[i++]=x[y++],v-=3;v&&(A[i++]=x[y++],v>1&&(A[i++]=x[y++]))}else{y=i-k;do{A[i++]=A[y++],A[i++]=A[y++],A[i++]=A[y++],v-=3}while(v>2);v&&(A[i++]=A[y++],v>1&&(A[i++]=A[y++]))}break}}break}}while(a<n&&i<s);a-=v=u>>3,f&=(1<<(u-=v<<3))-1,t.next_in=a,t.next_out=i,t.avail_in=a<n?n-a+5:5-(a-n),t.avail_out=i<s?s-i+257:257-(i-s),E.hold=f,E.bits=u},ue=15,ce=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),we=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),me=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),be=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),ge=function(t,e,a,n,i,r,s,o){var l,h,d,_,f,u,c,w,m,b=o.bits,g=0,p=0,v=0,k=0,y=0,x=0,z=0,A=0,E=0,R=0,Z=null,S=new Uint16Array(16),U=new Uint16Array(16),D=null;for(g=0;g<=ue;g++)S[g]=0;for(p=0;p<n;p++)S[e[a+p]]++;for(y=b,k=ue;k>=1&&0===S[k];k--);if(y>k&&(y=k),0===k)return i[r++]=20971520,i[r++]=20971520,o.bits=1,0;for(v=1;v<k&&0===S[v];v++);for(y<v&&(y=v),A=1,g=1;g<=ue;g++)if(A<<=1,(A-=S[g])<0)return-1;if(A>0&&(0===t||1!==k))return-1;for(U[1]=0,g=1;g<ue;g++)U[g+1]=U[g]+S[g];for(p=0;p<n;p++)0!==e[a+p]&&(s[U[e[a+p]]++]=p);if(0===t?(Z=D=s,u=20):1===t?(Z=ce,D=we,u=257):(Z=me,D=be,u=0),R=0,p=0,g=v,f=r,x=y,z=0,d=-1,_=(E=1<<y)-1,1===t&&E>852||2===t&&E>592)return 1;for(;;){c=g-z,s[p]+1<u?(w=0,m=s[p]):s[p]>=u?(w=D[s[p]-u],m=Z[s[p]-u]):(w=96,m=0),l=1<<g-z,v=h=1<<x;do{i[f+(R>>z)+(h-=l)]=c<<24|w<<16|m|0}while(0!==h);for(l=1<<g-1;R&l;)l>>=1;if(0!==l?(R&=l-1,R+=l):R=0,p++,0==--S[g]){if(g===k)break;g=e[a+s[p]]}if(g>y&&(R&_)!==d){for(0===z&&(z=y),f+=v,A=1<<(x=g-z);x+z<k&&!((A-=S[x+z])<=0);)x++,A<<=1;if(E+=1<<x,1===t&&E>852||2===t&&E>592)return 1;i[d=R&_]=y<<24|x<<16|f-r|0}}return 0!==R&&(i[f+R]=g-z<<24|64<<16|0),o.bits=y,0},pe=K.Z_FINISH,ve=K.Z_BLOCK,ke=K.Z_TREES,ye=K.Z_OK,xe=K.Z_STREAM_END,ze=K.Z_NEED_DICT,Ae=K.Z_STREAM_ERROR,Ee=K.Z_DATA_ERROR,Re=K.Z_MEM_ERROR,Ze=K.Z_BUF_ERROR,Se=K.Z_DEFLATED,Ue=16180,De=16190,Te=16191,Oe=16192,Ie=16194,Fe=16199,Le=16200,Ne=16206,Be=16209,Ce=function(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)};function Me(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var He,je,Ke=function(t){if(!t)return 1;var e=t.state;return!e||e.strm!==t||e.mode<Ue||e.mode>16211?1:0},Pe=function(t){if(Ke(t))return Ae;var e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=Ue,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,ye},Ye=function(t){if(Ke(t))return Ae;var e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Pe(t)},Ge=function(t,e){var a;if(Ke(t))return Ae;var n=t.state;return e<0?(a=0,e=-e):(a=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?Ae:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=a,n.wbits=e,Ye(t))},Xe=function(t,e){if(!t)return Ae;var a=new Me;t.state=a,a.strm=t,a.window=null,a.mode=Ue;var n=Ge(t,e);return n!==ye&&(t.state=null),n},We=!0,qe=function(t){if(We){He=new Int32Array(512),je=new Int32Array(32);for(var e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ge(1,t.lens,0,288,He,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ge(2,t.lens,0,32,je,0,t.work,{bits:5}),We=!1}t.lencode=He,t.lenbits=9,t.distcode=je,t.distbits=5},Je=function(t,e,a,n){var i,r=t.state;return null===r.window&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new Uint8Array(r.wsize)),n>=r.wsize?(r.window.set(e.subarray(a-r.wsize,a),0),r.wnext=0,r.whave=r.wsize):((i=r.wsize-r.wnext)>n&&(i=n),r.window.set(e.subarray(a-n,a-n+i),r.wnext),(n-=i)?(r.window.set(e.subarray(a-n,a),0),r.wnext=n,r.whave=r.wsize):(r.wnext+=i,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=i))),0},Qe={inflateReset:Ye,inflateReset2:Ge,inflateResetKeep:Pe,inflateInit:function(t){return Xe(t,15)},inflateInit2:Xe,inflate:function(t,e){var a,n,i,r,s,o,l,h,d,_,f,u,c,w,m,b,g,p,v,k,y,x,z,A,E=0,R=new Uint8Array(4),Z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Ke(t)||!t.output||!t.input&&0!==t.avail_in)return Ae;(a=t.state).mode===Te&&(a.mode=Oe),s=t.next_out,i=t.output,l=t.avail_out,r=t.next_in,n=t.input,o=t.avail_in,h=a.hold,d=a.bits,_=o,f=l,x=ye;t:for(;;)switch(a.mode){case Ue:if(0===a.wrap){a.mode=Oe;break}for(;d<16;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(2&a.wrap&&35615===h){0===a.wbits&&(a.wbits=15),a.check=0,R[0]=255&h,R[1]=h>>>8&255,a.check=H(a.check,R,2,0),h=0,d=0,a.mode=16181;break}if(a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",a.mode=Be;break}if((15&h)!==Se){t.msg="unknown compression method",a.mode=Be;break}if(d-=4,y=8+(15&(h>>>=4)),0===a.wbits&&(a.wbits=y),y>15||y>a.wbits){t.msg="invalid window size",a.mode=Be;break}a.dmax=1<<a.wbits,a.flags=0,t.adler=a.check=1,a.mode=512&h?16189:Te,h=0,d=0;break;case 16181:for(;d<16;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(a.flags=h,(255&a.flags)!==Se){t.msg="unknown compression method",a.mode=Be;break}if(57344&a.flags){t.msg="unknown header flags set",a.mode=Be;break}a.head&&(a.head.text=h>>8&1),512&a.flags&&4&a.wrap&&(R[0]=255&h,R[1]=h>>>8&255,a.check=H(a.check,R,2,0)),h=0,d=0,a.mode=16182;case 16182:for(;d<32;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}a.head&&(a.head.time=h),512&a.flags&&4&a.wrap&&(R[0]=255&h,R[1]=h>>>8&255,R[2]=h>>>16&255,R[3]=h>>>24&255,a.check=H(a.check,R,4,0)),h=0,d=0,a.mode=16183;case 16183:for(;d<16;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}a.head&&(a.head.xflags=255&h,a.head.os=h>>8),512&a.flags&&4&a.wrap&&(R[0]=255&h,R[1]=h>>>8&255,a.check=H(a.check,R,2,0)),h=0,d=0,a.mode=16184;case 16184:if(1024&a.flags){for(;d<16;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}a.length=h,a.head&&(a.head.extra_len=h),512&a.flags&&4&a.wrap&&(R[0]=255&h,R[1]=h>>>8&255,a.check=H(a.check,R,2,0)),h=0,d=0}else a.head&&(a.head.extra=null);a.mode=16185;case 16185:if(1024&a.flags&&((u=a.length)>o&&(u=o),u&&(a.head&&(y=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(n.subarray(r,r+u),y)),512&a.flags&&4&a.wrap&&(a.check=H(a.check,n,u,r)),o-=u,r+=u,a.length-=u),a.length))break t;a.length=0,a.mode=16186;case 16186:if(2048&a.flags){if(0===o)break t;u=0;do{y=n[r+u++],a.head&&y&&a.length<65536&&(a.head.name+=String.fromCharCode(y))}while(y&&u<o);if(512&a.flags&&4&a.wrap&&(a.check=H(a.check,n,u,r)),o-=u,r+=u,y)break t}else a.head&&(a.head.name=null);a.length=0,a.mode=16187;case 16187:if(4096&a.flags){if(0===o)break t;u=0;do{y=n[r+u++],a.head&&y&&a.length<65536&&(a.head.comment+=String.fromCharCode(y))}while(y&&u<o);if(512&a.flags&&4&a.wrap&&(a.check=H(a.check,n,u,r)),o-=u,r+=u,y)break t}else a.head&&(a.head.comment=null);a.mode=16188;case 16188:if(512&a.flags){for(;d<16;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(4&a.wrap&&h!==(65535&a.check)){t.msg="header crc mismatch",a.mode=Be;break}h=0,d=0}a.head&&(a.head.hcrc=a.flags>>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=Te;break;case 16189:for(;d<32;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}t.adler=a.check=Ce(h),h=0,d=0,a.mode=De;case De:if(0===a.havedict)return t.next_out=s,t.avail_out=l,t.next_in=r,t.avail_in=o,a.hold=h,a.bits=d,ze;t.adler=a.check=1,a.mode=Te;case Te:if(e===ve||e===ke)break t;case Oe:if(a.last){h>>>=7&d,d-=7&d,a.mode=Ne;break}for(;d<3;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}switch(a.last=1&h,d-=1,3&(h>>>=1)){case 0:a.mode=16193;break;case 1:if(qe(a),a.mode=Fe,e===ke){h>>>=2,d-=2;break t}break;case 2:a.mode=16196;break;case 3:t.msg="invalid block type",a.mode=Be}h>>>=2,d-=2;break;case 16193:for(h>>>=7&d,d-=7&d;d<32;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if((65535&h)!=(h>>>16^65535)){t.msg="invalid stored block lengths",a.mode=Be;break}if(a.length=65535&h,h=0,d=0,a.mode=Ie,e===ke)break t;case Ie:a.mode=16195;case 16195:if(u=a.length){if(u>o&&(u=o),u>l&&(u=l),0===u)break t;i.set(n.subarray(r,r+u),s),o-=u,r+=u,l-=u,s+=u,a.length-=u;break}a.mode=Te;break;case 16196:for(;d<14;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(a.nlen=257+(31&h),h>>>=5,d-=5,a.ndist=1+(31&h),h>>>=5,d-=5,a.ncode=4+(15&h),h>>>=4,d-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=Be;break}a.have=0,a.mode=16197;case 16197:for(;a.have<a.ncode;){for(;d<3;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}a.lens[Z[a.have++]]=7&h,h>>>=3,d-=3}for(;a.have<19;)a.lens[Z[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,z={bits:a.lenbits},x=ge(0,a.lens,0,19,a.lencode,0,a.work,z),a.lenbits=z.bits,x){t.msg="invalid code lengths set",a.mode=Be;break}a.have=0,a.mode=16198;case 16198:for(;a.have<a.nlen+a.ndist;){for(;b=(E=a.lencode[h&(1<<a.lenbits)-1])>>>16&255,g=65535&E,!((m=E>>>24)<=d);){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(g<16)h>>>=m,d-=m,a.lens[a.have++]=g;else{if(16===g){for(A=m+2;d<A;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(h>>>=m,d-=m,0===a.have){t.msg="invalid bit length repeat",a.mode=Be;break}y=a.lens[a.have-1],u=3+(3&h),h>>>=2,d-=2}else if(17===g){for(A=m+3;d<A;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}d-=m,y=0,u=3+(7&(h>>>=m)),h>>>=3,d-=3}else{for(A=m+7;d<A;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}d-=m,y=0,u=11+(127&(h>>>=m)),h>>>=7,d-=7}if(a.have+u>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=Be;break}for(;u--;)a.lens[a.have++]=y}}if(a.mode===Be)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=Be;break}if(a.lenbits=9,z={bits:a.lenbits},x=ge(1,a.lens,0,a.nlen,a.lencode,0,a.work,z),a.lenbits=z.bits,x){t.msg="invalid literal/lengths set",a.mode=Be;break}if(a.distbits=6,a.distcode=a.distdyn,z={bits:a.distbits},x=ge(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,z),a.distbits=z.bits,x){t.msg="invalid distances set",a.mode=Be;break}if(a.mode=Fe,e===ke)break t;case Fe:a.mode=Le;case Le:if(o>=6&&l>=258){t.next_out=s,t.avail_out=l,t.next_in=r,t.avail_in=o,a.hold=h,a.bits=d,fe(t,f),s=t.next_out,i=t.output,l=t.avail_out,r=t.next_in,n=t.input,o=t.avail_in,h=a.hold,d=a.bits,a.mode===Te&&(a.back=-1);break}for(a.back=0;b=(E=a.lencode[h&(1<<a.lenbits)-1])>>>16&255,g=65535&E,!((m=E>>>24)<=d);){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(b&&0==(240&b)){for(p=m,v=b,k=g;b=(E=a.lencode[k+((h&(1<<p+v)-1)>>p)])>>>16&255,g=65535&E,!(p+(m=E>>>24)<=d);){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}h>>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,a.length=g,0===b){a.mode=16205;break}if(32&b){a.back=-1,a.mode=Te;break}if(64&b){t.msg="invalid literal/length code",a.mode=Be;break}a.extra=15&b,a.mode=16201;case 16201:if(a.extra){for(A=a.extra;d<A;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}a.length+=h&(1<<a.extra)-1,h>>>=a.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=16202;case 16202:for(;b=(E=a.distcode[h&(1<<a.distbits)-1])>>>16&255,g=65535&E,!((m=E>>>24)<=d);){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(0==(240&b)){for(p=m,v=b,k=g;b=(E=a.distcode[k+((h&(1<<p+v)-1)>>p)])>>>16&255,g=65535&E,!(p+(m=E>>>24)<=d);){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}h>>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,64&b){t.msg="invalid distance code",a.mode=Be;break}a.offset=g,a.extra=15&b,a.mode=16203;case 16203:if(a.extra){for(A=a.extra;d<A;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}a.offset+=h&(1<<a.extra)-1,h>>>=a.extra,d-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=Be;break}a.mode=16204;case 16204:if(0===l)break t;if(u=f-l,a.offset>u){if((u=a.offset-u)>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=Be;break}u>a.wnext?(u-=a.wnext,c=a.wsize-u):c=a.wnext-u,u>a.length&&(u=a.length),w=a.window}else w=i,c=s-a.offset,u=a.length;u>l&&(u=l),l-=u,a.length-=u;do{i[s++]=w[c++]}while(--u);0===a.length&&(a.mode=Le);break;case 16205:if(0===l)break t;i[s++]=a.length,l--,a.mode=Le;break;case Ne:if(a.wrap){for(;d<32;){if(0===o)break t;o--,h|=n[r++]<<d,d+=8}if(f-=l,t.total_out+=f,a.total+=f,4&a.wrap&&f&&(t.adler=a.check=a.flags?H(a.check,i,f,s-f):C(a.check,i,f,s-f)),f=l,4&a.wrap&&(a.flags?h:Ce(h))!==a.check){t.msg="incorrect data check",a.mode=Be;break}h=0,d=0}a.mode=16207;case 16207:if(a.wrap&&a.flags){for(;d<32;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(4&a.wrap&&h!==(4294967295&a.total)){t.msg="incorrect length check",a.mode=Be;break}h=0,d=0}a.mode=16208;case 16208:x=xe;break t;case Be:x=Ee;break t;case 16210:return Re;default:return Ae}return t.next_out=s,t.avail_out=l,t.next_in=r,t.avail_in=o,a.hold=h,a.bits=d,(a.wsize||f!==t.avail_out&&a.mode<Be&&(a.mode<Ne||e!==pe))&&Je(t,t.output,t.next_out,f-t.avail_out),_-=t.avail_in,f-=t.avail_out,t.total_in+=_,t.total_out+=f,a.total+=f,4&a.wrap&&f&&(t.adler=a.check=a.flags?H(a.check,i,f,t.next_out-f):C(a.check,i,f,t.next_out-f)),t.data_type=a.bits+(a.last?64:0)+(a.mode===Te?128:0)+(a.mode===Fe||a.mode===Ie?256:0),(0===_&&0===f||e===pe)&&x===ye&&(x=Ze),x},inflateEnd:function(t){if(Ke(t))return Ae;var e=t.state;return e.window&&(e.window=null),t.state=null,ye},inflateGetHeader:function(t,e){if(Ke(t))return Ae;var a=t.state;return 0==(2&a.wrap)?Ae:(a.head=e,e.done=!1,ye)},inflateSetDictionary:function(t,e){var a,n=e.length;return Ke(t)||0!==(a=t.state).wrap&&a.mode!==De?Ae:a.mode===De&&C(1,e,n,0)!==a.check?Ee:Je(t,e,n,n)?(a.mode=16210,Re):(a.havedict=1,ye)},inflateInfo:"pako inflate (from Nodeca project)"};var Ve=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},$e=Object.prototype.toString,ta=K.Z_NO_FLUSH,ea=K.Z_FINISH,aa=K.Z_OK,na=K.Z_STREAM_END,ia=K.Z_NEED_DICT,ra=K.Z_STREAM_ERROR,sa=K.Z_DATA_ERROR,oa=K.Z_MEM_ERROR;function la(t){this.options=Kt({chunkSize:65536,windowBits:15,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Qt,this.strm.avail_out=0;var a=Qe.inflateInit2(this.strm,e.windowBits);if(a!==aa)throw new Error(j[a]);if(this.header=new Ve,Qe.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Wt(e.dictionary):"[object ArrayBuffer]"===$e.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=Qe.inflateSetDictionary(this.strm,e.dictionary))!==aa))throw new Error(j[a])}function ha(t,e){var a=new la(e);if(a.push(t),a.err)throw a.msg||j[a.err];return a.result}la.prototype.push=function(t,e){var a,n,i,r=this.strm,s=this.options.chunkSize,o=this.options.dictionary;if(this.ended)return!1;for(n=e===~~e?e:!0===e?ea:ta,"[object ArrayBuffer]"===$e.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(s),r.next_out=0,r.avail_out=s),(a=Qe.inflate(r,n))===ia&&o&&((a=Qe.inflateSetDictionary(r,o))===aa?a=Qe.inflate(r,n):a===sa&&(a=ia));r.avail_in>0&&a===na&&r.state.wrap>0&&0!==t[r.next_in];)Qe.inflateReset(r),a=Qe.inflate(r,n);switch(a){case ra:case sa:case ia:case oa:return this.onEnd(a),this.ended=!0,!1}if(i=r.avail_out,r.next_out&&(0===r.avail_out||a===na))if("string"===this.options.to){var l=Jt(r.output,r.next_out),h=r.next_out-l,d=qt(r.output,l);r.next_out=h,r.avail_out=s-h,h&&r.output.set(r.output.subarray(l,l+h),0),this.onData(d)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(a!==aa||0!==i){if(a===na)return a=Qe.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},la.prototype.onData=function(t){this.chunks.push(t)},la.prototype.onEnd=function(t){t===aa&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Pt(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var da={Inflate:la,inflate:ha,inflateRaw:function(t,e){return(e=e||{}).raw=!0,ha(t,e)},ungzip:ha,constants:K},_a=de.Deflate,fa=de.deflate,ua=de.deflateRaw,ca=de.gzip,wa=da.Inflate,ma=da.inflate,ba=da.inflateRaw,ga=da.ungzip,pa=K,va={Deflate:_a,deflate:fa,deflateRaw:ua,gzip:ca,Inflate:wa,inflate:ma,inflateRaw:ba,ungzip:ga,constants:pa};t.Deflate=_a,t.Inflate=wa,t.constants=pa,t.default=va,t.deflate=fa,t.deflateRaw=ua,t.gzip=ca,t.inflate=ma,t.inflateRaw=ba,t.ungzip=ga,Object.defineProperty(t,"__esModule",{value:!0})}));var rough=function(){"use strict";function t(t,e,s){if(t&&t.length){const[n,o]=e,a=Math.PI/180*s,h=Math.cos(a),r=Math.sin(a);for(const e of t){const[t,s]=e;e[0]=(t-n)*h-(s-o)*r+n,e[1]=(t-n)*r+(s-o)*h+o}}}function e(t,e){return t[0]===e[0]&&t[1]===e[1]}function s(s,n,o,a=1){const h=o,r=Math.max(n,.1),i=s[0]&&s[0][0]&&"number"==typeof s[0][0]?[s]:s,c=[0,0];if(h)for(const e of i)t(e,c,h);const l=function(t,s,n){const o=[];for(const s of t){const t=[...s];e(t[0],t[t.length-1])||t.push([t[0][0],t[0][1]]),t.length>2&&o.push(t)}const a=[];s=Math.max(s,.1);const h=[];for(const t of o)for(let e=0;e<t.length-1;e++){const s=t[e],n=t[e+1];if(s[1]!==n[1]){const t=Math.min(s[1],n[1]);h.push({ymin:t,ymax:Math.max(s[1],n[1]),x:t===s[1]?s[0]:n[0],islope:(n[0]-s[0])/(n[1]-s[1])})}}if(h.sort(((t,e)=>t.ymin<e.ymin?-1:t.ymin>e.ymin?1:t.x<e.x?-1:t.x>e.x?1:t.ymax===e.ymax?0:(t.ymax-e.ymax)/Math.abs(t.ymax-e.ymax))),!h.length)return a;let r=[],i=h[0].ymin,c=0;for(;r.length||h.length;){if(h.length){let t=-1;for(let e=0;e<h.length&&!(h[e].ymin>i);e++)t=e;h.splice(0,t+1).forEach((t=>{r.push({s:i,edge:t})}))}if(r=r.filter((t=>!(t.edge.ymax<=i))),r.sort(((t,e)=>t.edge.x===e.edge.x?0:(t.edge.x-e.edge.x)/Math.abs(t.edge.x-e.edge.x))),(1!==n||c%s==0)&&r.length>1)for(let t=0;t<r.length;t+=2){const e=t+1;if(e>=r.length)break;const s=r[t].edge,n=r[e].edge;a.push([[Math.round(s.x),i],[Math.round(n.x),i]])}i+=n,r.forEach((t=>{t.edge.x=t.edge.x+n*t.edge.islope})),c++}return a}(i,r,a);if(h){for(const e of i)t(e,c,-h);!function(e,s,n){const o=[];e.forEach((t=>o.push(...t))),t(o,s,n)}(l,c,-h)}return l}function n(t,e){var n;const o=e.hachureAngle+90;let a=e.hachureGap;a<0&&(a=4*e.strokeWidth),a=Math.round(Math.max(a,.1));let h=1;return e.roughness>=1&&((null===(n=e.randomizer)||void 0===n?void 0:n.next())||Math.random())>.7&&(h=a),s(t,a,o,h||1)}class o{constructor(t){this.helper=t}fillPolygons(t,e){return this._fillPolygons(t,e)}_fillPolygons(t,e){const s=n(t,e);return{type:"fillSketch",ops:this.renderLines(s,e)}}renderLines(t,e){const s=[];for(const n of t)s.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],e));return s}}function a(t){const e=t[0],s=t[1];return Math.sqrt(Math.pow(e[0]-s[0],2)+Math.pow(e[1]-s[1],2))}class h extends o{fillPolygons(t,e){let s=e.hachureGap;s<0&&(s=4*e.strokeWidth),s=Math.max(s,.1);const o=n(t,Object.assign({},e,{hachureGap:s})),h=Math.PI/180*e.hachureAngle,r=[],i=.5*s*Math.cos(h),c=.5*s*Math.sin(h);for(const[t,e]of o)a([t,e])&&r.push([[t[0]-i,t[1]+c],[...e]],[[t[0]+i,t[1]-c],[...e]]);return{type:"fillSketch",ops:this.renderLines(r,e)}}}class r extends o{fillPolygons(t,e){const s=this._fillPolygons(t,e),n=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),o=this._fillPolygons(t,n);return s.ops=s.ops.concat(o.ops),s}}class i{constructor(t){this.helper=t}fillPolygons(t,e){const s=n(t,e=Object.assign({},e,{hachureAngle:0}));return this.dotsOnLines(s,e)}dotsOnLines(t,e){const s=[];let n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.max(n,.1);let o=e.fillWeight;o<0&&(o=e.strokeWidth/2);const h=n/4;for(const r of t){const t=a(r),i=t/n,c=Math.ceil(i)-1,l=t-c*n,u=(r[0][0]+r[1][0])/2-n/4,p=Math.min(r[0][1],r[1][1]);for(let t=0;t<c;t++){const a=p+l+t*n,r=u-h+2*Math.random()*h,i=a-h+2*Math.random()*h,c=this.helper.ellipse(r,i,o,o,e);s.push(...c.ops)}}return{type:"fillSketch",ops:s}}}class c{constructor(t){this.helper=t}fillPolygons(t,e){const s=n(t,e);return{type:"fillSketch",ops:this.dashedLine(s,e)}}dashedLine(t,e){const s=e.dashOffset<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashOffset,n=e.dashGap<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashGap,o=[];return t.forEach((t=>{const h=a(t),r=Math.floor(h/(s+n)),i=(h+n-r*(s+n))/2;let c=t[0],l=t[1];c[0]>l[0]&&(c=t[1],l=t[0]);const u=Math.atan((l[1]-c[1])/(l[0]-c[0]));for(let t=0;t<r;t++){const a=t*(s+n),h=a+s,r=[c[0]+a*Math.cos(u)+i*Math.cos(u),c[1]+a*Math.sin(u)+i*Math.sin(u)],l=[c[0]+h*Math.cos(u)+i*Math.cos(u),c[1]+h*Math.sin(u)+i*Math.sin(u)];o.push(...this.helper.doubleLineOps(r[0],r[1],l[0],l[1],e))}})),o}}class l{constructor(t){this.helper=t}fillPolygons(t,e){const s=e.hachureGap<0?4*e.strokeWidth:e.hachureGap,o=e.zigzagOffset<0?s:e.zigzagOffset,a=n(t,e=Object.assign({},e,{hachureGap:s+o}));return{type:"fillSketch",ops:this.zigzagLines(a,o,e)}}zigzagLines(t,e,s){const n=[];return t.forEach((t=>{const o=a(t),h=Math.round(o/(2*e));let r=t[0],i=t[1];r[0]>i[0]&&(r=t[1],i=t[0]);const c=Math.atan((i[1]-r[1])/(i[0]-r[0]));for(let t=0;t<h;t++){const o=2*t*e,a=2*(t+1)*e,h=Math.sqrt(2*Math.pow(e,2)),i=[r[0]+o*Math.cos(c),r[1]+o*Math.sin(c)],l=[r[0]+a*Math.cos(c),r[1]+a*Math.sin(c)],u=[i[0]+h*Math.cos(c+Math.PI/4),i[1]+h*Math.sin(c+Math.PI/4)];n.push(...this.helper.doubleLineOps(i[0],i[1],u[0],u[1],s),...this.helper.doubleLineOps(u[0],u[1],l[0],l[1],s))}})),n}}const u={};class p{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const f=0,d=1,g=2,M={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function k(t,e){return t.type===e}function b(t){const e=[],s=function(t){const e=new Array;for(;""!==t;)if(t.match(/^([ \t\r\n,]+)/))t=t.substr(RegExp.$1.length);else if(t.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]={type:f,text:RegExp.$1},t=t.substr(RegExp.$1.length);else{if(!t.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];e[e.length]={type:d,text:`${parseFloat(RegExp.$1)}`},t=t.substr(RegExp.$1.length)}return e[e.length]={type:g,text:""},e}(t);let n="BOD",o=0,a=s[o];for(;!k(a,g);){let h=0;const r=[];if("BOD"===n){if("M"!==a.text&&"m"!==a.text)return b("M0,0"+t);o++,h=M[a.text],n=a.text}else k(a,d)?h=M[n]:(o++,h=M[a.text],n=a.text);if(!(o+h<s.length))throw new Error("Path data ended short");for(let t=o;t<o+h;t++){const e=s[t];if(!k(e,d))throw new Error("Param not a number: "+n+","+e.text);r[r.length]=+e.text}if("number"!=typeof M[n])throw new Error("Bad segment: "+n);{const t={key:n,data:r};e.push(t),o+=h,a=s[o],"M"===n&&(n="L"),"m"===n&&(n="l")}}return e}function y(t){let e=0,s=0,n=0,o=0;const a=[];for(const{key:h,data:r}of t)switch(h){case"M":a.push({key:"M",data:[...r]}),[e,s]=r,[n,o]=r;break;case"m":e+=r[0],s+=r[1],a.push({key:"M",data:[e,s]}),n=e,o=s;break;case"L":a.push({key:"L",data:[...r]}),[e,s]=r;break;case"l":e+=r[0],s+=r[1],a.push({key:"L",data:[e,s]});break;case"C":a.push({key:"C",data:[...r]}),e=r[4],s=r[5];break;case"c":{const t=r.map(((t,n)=>n%2?t+s:t+e));a.push({key:"C",data:t}),e=t[4],s=t[5];break}case"Q":a.push({key:"Q",data:[...r]}),e=r[2],s=r[3];break;case"q":{const t=r.map(((t,n)=>n%2?t+s:t+e));a.push({key:"Q",data:t}),e=t[2],s=t[3];break}case"A":a.push({key:"A",data:[...r]}),e=r[5],s=r[6];break;case"a":e+=r[5],s+=r[6],a.push({key:"A",data:[r[0],r[1],r[2],r[3],r[4],e,s]});break;case"H":a.push({key:"H",data:[...r]}),e=r[0];break;case"h":e+=r[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...r]}),s=r[0];break;case"v":s+=r[0],a.push({key:"V",data:[s]});break;case"S":a.push({key:"S",data:[...r]}),e=r[2],s=r[3];break;case"s":{const t=r.map(((t,n)=>n%2?t+s:t+e));a.push({key:"S",data:t}),e=t[2],s=t[3];break}case"T":a.push({key:"T",data:[...r]}),e=r[0],s=r[1];break;case"t":e+=r[0],s+=r[1],a.push({key:"T",data:[e,s]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=n,s=o}return a}function m(t){const e=[];let s="",n=0,o=0,a=0,h=0,r=0,i=0;for(const{key:c,data:l}of t){switch(c){case"M":e.push({key:"M",data:[...l]}),[n,o]=l,[a,h]=l;break;case"C":e.push({key:"C",data:[...l]}),n=l[4],o=l[5],r=l[2],i=l[3];break;case"L":e.push({key:"L",data:[...l]}),[n,o]=l;break;case"H":n=l[0],e.push({key:"L",data:[n,o]});break;case"V":o=l[0],e.push({key:"L",data:[n,o]});break;case"S":{let t=0,a=0;"C"===s||"S"===s?(t=n+(n-r),a=o+(o-i)):(t=n,a=o),e.push({key:"C",data:[t,a,...l]}),r=l[0],i=l[1],n=l[2],o=l[3];break}case"T":{const[t,a]=l;let h=0,c=0;"Q"===s||"T"===s?(h=n+(n-r),c=o+(o-i)):(h=n,c=o);const u=n+2*(h-n)/3,p=o+2*(c-o)/3,f=t+2*(h-t)/3,d=a+2*(c-a)/3;e.push({key:"C",data:[u,p,f,d,t,a]}),r=h,i=c,n=t,o=a;break}case"Q":{const[t,s,a,h]=l,c=n+2*(t-n)/3,u=o+2*(s-o)/3,p=a+2*(t-a)/3,f=h+2*(s-h)/3;e.push({key:"C",data:[c,u,p,f,a,h]}),r=t,i=s,n=a,o=h;break}case"A":{const t=Math.abs(l[0]),s=Math.abs(l[1]),a=l[2],h=l[3],r=l[4],i=l[5],c=l[6];if(0===t||0===s)e.push({key:"C",data:[n,o,i,c,i,c]}),n=i,o=c;else if(n!==i||o!==c){x(n,o,i,c,t,s,a,h,r).forEach((function(t){e.push({key:"C",data:t})})),n=i,o=c}break}case"Z":e.push({key:"Z",data:[]}),n=a,o=h}s=c}return e}function w(t,e,s){return[t*Math.cos(s)-e*Math.sin(s),t*Math.sin(s)+e*Math.cos(s)]}function x(t,e,s,n,o,a,h,r,i,c){const l=(u=h,Math.PI*u/180);var u;let p=[],f=0,d=0,g=0,M=0;if(c)[f,d,g,M]=c;else{[t,e]=w(t,e,-l),[s,n]=w(s,n,-l);const h=(t-s)/2,c=(e-n)/2;let u=h*h/(o*o)+c*c/(a*a);u>1&&(u=Math.sqrt(u),o*=u,a*=u);const p=o*o,k=a*a,b=p*k-p*c*c-k*h*h,y=p*c*c+k*h*h,m=(r===i?-1:1)*Math.sqrt(Math.abs(b/y));g=m*o*c/a+(t+s)/2,M=m*-a*h/o+(e+n)/2,f=Math.asin(parseFloat(((e-M)/a).toFixed(9))),d=Math.asin(parseFloat(((n-M)/a).toFixed(9))),t<g&&(f=Math.PI-f),s<g&&(d=Math.PI-d),f<0&&(f=2*Math.PI+f),d<0&&(d=2*Math.PI+d),i&&f>d&&(f-=2*Math.PI),!i&&d>f&&(d-=2*Math.PI)}let k=d-f;if(Math.abs(k)>120*Math.PI/180){const t=d,e=s,r=n;d=i&&d>f?f+120*Math.PI/180*1:f+120*Math.PI/180*-1,p=x(s=g+o*Math.cos(d),n=M+a*Math.sin(d),e,r,o,a,h,0,i,[d,t,g,M])}k=d-f;const b=Math.cos(f),y=Math.sin(f),m=Math.cos(d),P=Math.sin(d),v=Math.tan(k/4),S=4/3*o*v,O=4/3*a*v,L=[t,e],T=[t+S*y,e-O*b],D=[s+S*P,n-O*m],A=[s,n];if(T[0]=2*L[0]-T[0],T[1]=2*L[1]-T[1],c)return[T,D,A].concat(p);{p=[T,D,A].concat(p);const t=[];for(let e=0;e<p.length;e+=3){const s=w(p[e][0],p[e][1],l),n=w(p[e+1][0],p[e+1][1],l),o=w(p[e+2][0],p[e+2][1],l);t.push([s[0],s[1],n[0],n[1],o[0],o[1]])}return t}}const P={randOffset:function(t,e){return G(t,e)},randOffsetWithRange:function(t,e,s){return E(t,e,s)},ellipse:function(t,e,s,n,o){const a=T(s,n,o);return D(t,e,o,a).opset},doubleLineOps:function(t,e,s,n,o){return $(t,e,s,n,o,!0)}};function v(t,e,s,n,o){return{type:"path",ops:$(t,e,s,n,o)}}function S(t,e,s){const n=(t||[]).length;if(n>2){const o=[];for(let e=0;e<n-1;e++)o.push(...$(t[e][0],t[e][1],t[e+1][0],t[e+1][1],s));return e&&o.push(...$(t[n-1][0],t[n-1][1],t[0][0],t[0][1],s)),{type:"path",ops:o}}return 2===n?v(t[0][0],t[0][1],t[1][0],t[1][1],s):{type:"path",ops:[]}}function O(t,e,s,n,o){return function(t,e){return S(t,!0,e)}([[t,e],[t+s,e],[t+s,e+n],[t,e+n]],o)}function L(t,e){if(t.length){const s="number"==typeof t[0][0]?[t]:t,n=j(s[0],1*(1+.2*e.roughness),e),o=e.disableMultiStroke?[]:j(s[0],1.5*(1+.22*e.roughness),z(e));for(let t=1;t<s.length;t++){const a=s[t];if(a.length){const t=j(a,1*(1+.2*e.roughness),e),s=e.disableMultiStroke?[]:j(a,1.5*(1+.22*e.roughness),z(e));for(const e of t)"move"!==e.op&&n.push(e);for(const t of s)"move"!==t.op&&o.push(t)}}return{type:"path",ops:n.concat(o)}}return{type:"path",ops:[]}}function T(t,e,s){const n=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(t/2,2)+Math.pow(e/2,2))/2)),o=Math.ceil(Math.max(s.curveStepCount,s.curveStepCount/Math.sqrt(200)*n)),a=2*Math.PI/o;let h=Math.abs(t/2),r=Math.abs(e/2);const i=1-s.curveFitting;return h+=G(h*i,s),r+=G(r*i,s),{increment:a,rx:h,ry:r}}function D(t,e,s,n){const[o,a]=F(n.increment,t,e,n.rx,n.ry,1,n.increment*E(.1,E(.4,1,s),s),s);let h=q(o,null,s);if(!s.disableMultiStroke&&0!==s.roughness){const[o]=F(n.increment,t,e,n.rx,n.ry,1.5,0,s),a=q(o,null,s);h=h.concat(a)}return{estimatedPoints:a,opset:{type:"path",ops:h}}}function A(t,e,s,n,o,a,h,r,i){const c=t,l=e;let u=Math.abs(s/2),p=Math.abs(n/2);u+=G(.01*u,i),p+=G(.01*p,i);let f=o,d=a;for(;f<0;)f+=2*Math.PI,d+=2*Math.PI;d-f>2*Math.PI&&(f=0,d=2*Math.PI);const g=2*Math.PI/i.curveStepCount,M=Math.min(g/2,(d-f)/2),k=V(M,c,l,u,p,f,d,1,i);if(!i.disableMultiStroke){const t=V(M,c,l,u,p,f,d,1.5,i);k.push(...t)}return h&&(r?k.push(...$(c,l,c+u*Math.cos(f),l+p*Math.sin(f),i),...$(c,l,c+u*Math.cos(d),l+p*Math.sin(d),i)):k.push({op:"lineTo",data:[c,l]},{op:"lineTo",data:[c+u*Math.cos(f),l+p*Math.sin(f)]})),{type:"path",ops:k}}function _(t,e){const s=m(y(b(t))),n=[];let o=[0,0],a=[0,0];for(const{key:t,data:h}of s)switch(t){case"M":a=[h[0],h[1]],o=[h[0],h[1]];break;case"L":n.push(...$(a[0],a[1],h[0],h[1],e)),a=[h[0],h[1]];break;case"C":{const[t,s,o,r,i,c]=h;n.push(...Z(t,s,o,r,i,c,a,e)),a=[i,c];break}case"Z":n.push(...$(a[0],a[1],o[0],o[1],e)),a=[o[0],o[1]]}return{type:"path",ops:n}}function I(t,e){const s=[];for(const n of t)if(n.length){const t=e.maxRandomnessOffset||0,o=n.length;if(o>2){s.push({op:"move",data:[n[0][0]+G(t,e),n[0][1]+G(t,e)]});for(let a=1;a<o;a++)s.push({op:"lineTo",data:[n[a][0]+G(t,e),n[a][1]+G(t,e)]})}}return{type:"fillPath",ops:s}}function C(t,e){return function(t,e){let s=t.fillStyle||"hachure";if(!u[s])switch(s){case"zigzag":u[s]||(u[s]=new h(e));break;case"cross-hatch":u[s]||(u[s]=new r(e));break;case"dots":u[s]||(u[s]=new i(e));break;case"dashed":u[s]||(u[s]=new c(e));break;case"zigzag-line":u[s]||(u[s]=new l(e));break;default:s="hachure",u[s]||(u[s]=new o(e))}return u[s]}(e,P).fillPolygons(t,e)}function z(t){const e=Object.assign({},t);return e.randomizer=void 0,t.seed&&(e.seed=t.seed+1),e}function W(t){return t.randomizer||(t.randomizer=new p(t.seed||0)),t.randomizer.next()}function E(t,e,s,n=1){return s.roughness*n*(W(s)*(e-t)+t)}function G(t,e,s=1){return E(-t,t,e,s)}function $(t,e,s,n,o,a=!1){const h=a?o.disableMultiStrokeFill:o.disableMultiStroke,r=R(t,e,s,n,o,!0,!1);if(h)return r;const i=R(t,e,s,n,o,!0,!0);return r.concat(i)}function R(t,e,s,n,o,a,h){const r=Math.pow(t-s,2)+Math.pow(e-n,2),i=Math.sqrt(r);let c=1;c=i<200?1:i>500?.4:-.0016668*i+1.233334;let l=o.maxRandomnessOffset||0;l*l*100>r&&(l=i/10);const u=l/2,p=.2+.2*W(o);let f=o.bowing*o.maxRandomnessOffset*(n-e)/200,d=o.bowing*o.maxRandomnessOffset*(t-s)/200;f=G(f,o,c),d=G(d,o,c);const g=[],M=()=>G(u,o,c),k=()=>G(l,o,c),b=o.preserveVertices;return a&&(h?g.push({op:"move",data:[t+(b?0:M()),e+(b?0:M())]}):g.push({op:"move",data:[t+(b?0:G(l,o,c)),e+(b?0:G(l,o,c))]})),h?g.push({op:"bcurveTo",data:[f+t+(s-t)*p+M(),d+e+(n-e)*p+M(),f+t+2*(s-t)*p+M(),d+e+2*(n-e)*p+M(),s+(b?0:M()),n+(b?0:M())]}):g.push({op:"bcurveTo",data:[f+t+(s-t)*p+k(),d+e+(n-e)*p+k(),f+t+2*(s-t)*p+k(),d+e+2*(n-e)*p+k(),s+(b?0:k()),n+(b?0:k())]}),g}function j(t,e,s){if(!t.length)return[];const n=[];n.push([t[0][0]+G(e,s),t[0][1]+G(e,s)]),n.push([t[0][0]+G(e,s),t[0][1]+G(e,s)]);for(let o=1;o<t.length;o++)n.push([t[o][0]+G(e,s),t[o][1]+G(e,s)]),o===t.length-1&&n.push([t[o][0]+G(e,s),t[o][1]+G(e,s)]);return q(n,null,s)}function q(t,e,s){const n=t.length,o=[];if(n>3){const a=[],h=1-s.curveTightness;o.push({op:"move",data:[t[1][0],t[1][1]]});for(let e=1;e+2<n;e++){const s=t[e];a[0]=[s[0],s[1]],a[1]=[s[0]+(h*t[e+1][0]-h*t[e-1][0])/6,s[1]+(h*t[e+1][1]-h*t[e-1][1])/6],a[2]=[t[e+1][0]+(h*t[e][0]-h*t[e+2][0])/6,t[e+1][1]+(h*t[e][1]-h*t[e+2][1])/6],a[3]=[t[e+1][0],t[e+1][1]],o.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(e&&2===e.length){const t=s.maxRandomnessOffset;o.push({op:"lineTo",data:[e[0]+G(t,s),e[1]+G(t,s)]})}}else 3===n?(o.push({op:"move",data:[t[1][0],t[1][1]]}),o.push({op:"bcurveTo",data:[t[1][0],t[1][1],t[2][0],t[2][1],t[2][0],t[2][1]]})):2===n&&o.push(...R(t[0][0],t[0][1],t[1][0],t[1][1],s,!0,!0));return o}function F(t,e,s,n,o,a,h,r){const i=[],c=[];if(0===r.roughness){t/=4,c.push([e+n*Math.cos(-t),s+o*Math.sin(-t)]);for(let a=0;a<=2*Math.PI;a+=t){const t=[e+n*Math.cos(a),s+o*Math.sin(a)];i.push(t),c.push(t)}c.push([e+n*Math.cos(0),s+o*Math.sin(0)]),c.push([e+n*Math.cos(t),s+o*Math.sin(t)])}else{const l=G(.5,r)-Math.PI/2;c.push([G(a,r)+e+.9*n*Math.cos(l-t),G(a,r)+s+.9*o*Math.sin(l-t)]);const u=2*Math.PI+l-.01;for(let h=l;h<u;h+=t){const t=[G(a,r)+e+n*Math.cos(h),G(a,r)+s+o*Math.sin(h)];i.push(t),c.push(t)}c.push([G(a,r)+e+n*Math.cos(l+2*Math.PI+.5*h),G(a,r)+s+o*Math.sin(l+2*Math.PI+.5*h)]),c.push([G(a,r)+e+.98*n*Math.cos(l+h),G(a,r)+s+.98*o*Math.sin(l+h)]),c.push([G(a,r)+e+.9*n*Math.cos(l+.5*h),G(a,r)+s+.9*o*Math.sin(l+.5*h)])}return[c,i]}function V(t,e,s,n,o,a,h,r,i){const c=a+G(.1,i),l=[];l.push([G(r,i)+e+.9*n*Math.cos(c-t),G(r,i)+s+.9*o*Math.sin(c-t)]);for(let a=c;a<=h;a+=t)l.push([G(r,i)+e+n*Math.cos(a),G(r,i)+s+o*Math.sin(a)]);return l.push([e+n*Math.cos(h),s+o*Math.sin(h)]),l.push([e+n*Math.cos(h),s+o*Math.sin(h)]),q(l,null,i)}function Z(t,e,s,n,o,a,h,r){const i=[],c=[r.maxRandomnessOffset||1,(r.maxRandomnessOffset||1)+.3];let l=[0,0];const u=r.disableMultiStroke?1:2,p=r.preserveVertices;for(let f=0;f<u;f++)0===f?i.push({op:"move",data:[h[0],h[1]]}):i.push({op:"move",data:[h[0]+(p?0:G(c[0],r)),h[1]+(p?0:G(c[0],r))]}),l=p?[o,a]:[o+G(c[f],r),a+G(c[f],r)],i.push({op:"bcurveTo",data:[t+G(c[f],r),e+G(c[f],r),s+G(c[f],r),n+G(c[f],r),l[0],l[1]]});return i}function Q(t){return[...t]}function H(t,e=0){const s=t.length;if(s<3)throw new Error("A curve must have at least three points.");const n=[];if(3===s)n.push(Q(t[0]),Q(t[1]),Q(t[2]),Q(t[2]));else{const s=[];s.push(t[0],t[0]);for(let e=1;e<t.length;e++)s.push(t[e]),e===t.length-1&&s.push(t[e]);const o=[],a=1-e;n.push(Q(s[0]));for(let t=1;t+2<s.length;t++){const e=s[t];o[0]=[e[0],e[1]],o[1]=[e[0]+(a*s[t+1][0]-a*s[t-1][0])/6,e[1]+(a*s[t+1][1]-a*s[t-1][1])/6],o[2]=[s[t+1][0]+(a*s[t][0]-a*s[t+2][0])/6,s[t+1][1]+(a*s[t][1]-a*s[t+2][1])/6],o[3]=[s[t+1][0],s[t+1][1]],n.push(o[1],o[2],o[3])}}return n}function N(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)}function B(t,e,s){const n=N(e,s);if(0===n)return N(t,e);let o=((t[0]-e[0])*(s[0]-e[0])+(t[1]-e[1])*(s[1]-e[1]))/n;return o=Math.max(0,Math.min(1,o)),N(t,J(e,s,o))}function J(t,e,s){return[t[0]+(e[0]-t[0])*s,t[1]+(e[1]-t[1])*s]}function K(t,e,s,n){const o=n||[];if(function(t,e){const s=t[e+0],n=t[e+1],o=t[e+2],a=t[e+3];let h=3*n[0]-2*s[0]-a[0];h*=h;let r=3*n[1]-2*s[1]-a[1];r*=r;let i=3*o[0]-2*a[0]-s[0];i*=i;let c=3*o[1]-2*a[1]-s[1];return c*=c,h<i&&(h=i),r<c&&(r=c),h+r}(t,e)<s){const s=t[e+0];if(o.length){(a=o[o.length-1],h=s,Math.sqrt(N(a,h)))>1&&o.push(s)}else o.push(s);o.push(t[e+3])}else{const n=.5,a=t[e+0],h=t[e+1],r=t[e+2],i=t[e+3],c=J(a,h,n),l=J(h,r,n),u=J(r,i,n),p=J(c,l,n),f=J(l,u,n),d=J(p,f,n);K([a,c,p,d],0,s,o),K([d,f,u,i],0,s,o)}var a,h;return o}function U(t,e){return X(t,0,t.length,e)}function X(t,e,s,n,o){const a=o||[],h=t[e],r=t[s-1];let i=0,c=1;for(let n=e+1;n<s-1;++n){const e=B(t[n],h,r);e>i&&(i=e,c=n)}return Math.sqrt(i)>n?(X(t,e,c+1,n,a),X(t,c,s,n,a)):(a.length||a.push(h),a.push(r)),a}function Y(t,e=.15,s){const n=[],o=(t.length-1)/3;for(let s=0;s<o;s++){K(t,3*s,e,n)}return s&&s>0?X(n,0,n.length,s):n}const tt="none";class et{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,e,s){return{shape:t,sets:e||[],options:s||this.defaultOptions}}line(t,e,s,n,o){const a=this._o(o);return this._d("line",[v(t,e,s,n,a)],a)}rectangle(t,e,s,n,o){const a=this._o(o),h=[],r=O(t,e,s,n,a);if(a.fill){const o=[[t,e],[t+s,e],[t+s,e+n],[t,e+n]];"solid"===a.fillStyle?h.push(I([o],a)):h.push(C([o],a))}return a.stroke!==tt&&h.push(r),this._d("rectangle",h,a)}ellipse(t,e,s,n,o){const a=this._o(o),h=[],r=T(s,n,a),i=D(t,e,a,r);if(a.fill)if("solid"===a.fillStyle){const s=D(t,e,a,r).opset;s.type="fillPath",h.push(s)}else h.push(C([i.estimatedPoints],a));return a.stroke!==tt&&h.push(i.opset),this._d("ellipse",h,a)}circle(t,e,s,n){const o=this.ellipse(t,e,s,s,n);return o.shape="circle",o}linearPath(t,e){const s=this._o(e);return this._d("linearPath",[S(t,!1,s)],s)}arc(t,e,s,n,o,a,h=!1,r){const i=this._o(r),c=[],l=A(t,e,s,n,o,a,h,!0,i);if(h&&i.fill)if("solid"===i.fillStyle){const h=Object.assign({},i);h.disableMultiStroke=!0;const r=A(t,e,s,n,o,a,!0,!1,h);r.type="fillPath",c.push(r)}else c.push(function(t,e,s,n,o,a,h){const r=t,i=e;let c=Math.abs(s/2),l=Math.abs(n/2);c+=G(.01*c,h),l+=G(.01*l,h);let u=o,p=a;for(;u<0;)u+=2*Math.PI,p+=2*Math.PI;p-u>2*Math.PI&&(u=0,p=2*Math.PI);const f=(p-u)/h.curveStepCount,d=[];for(let t=u;t<=p;t+=f)d.push([r+c*Math.cos(t),i+l*Math.sin(t)]);return d.push([r+c*Math.cos(p),i+l*Math.sin(p)]),d.push([r,i]),C([d],h)}(t,e,s,n,o,a,i));return i.stroke!==tt&&c.push(l),this._d("arc",c,i)}curve(t,e){const s=this._o(e),n=[],o=L(t,s);if(s.fill&&s.fill!==tt)if("solid"===s.fillStyle){const e=L(t,Object.assign(Object.assign({},s),{disableMultiStroke:!0,roughness:s.roughness?s.roughness+s.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else{const e=[],o=t;if(o.length){const t="number"==typeof o[0][0]?[o]:o;for(const n of t)n.length<3?e.push(...n):3===n.length?e.push(...Y(H([n[0],n[0],n[1],n[2]]),10,(1+s.roughness)/2)):e.push(...Y(H(n),10,(1+s.roughness)/2))}e.length&&n.push(C([e],s))}return s.stroke!==tt&&n.push(o),this._d("curve",n,s)}polygon(t,e){const s=this._o(e),n=[],o=S(t,!0,s);return s.fill&&("solid"===s.fillStyle?n.push(I([t],s)):n.push(C([t],s))),s.stroke!==tt&&n.push(o),this._d("polygon",n,s)}path(t,e){const s=this._o(e),n=[];if(!t)return this._d("path",n,s);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const o=s.fill&&"transparent"!==s.fill&&s.fill!==tt,a=s.stroke!==tt,h=!!(s.simplification&&s.simplification<1),r=function(t,e,s){const n=m(y(b(t))),o=[];let a=[],h=[0,0],r=[];const i=()=>{r.length>=4&&a.push(...Y(r,e)),r=[]},c=()=>{i(),a.length&&(o.push(a),a=[])};for(const{key:t,data:e}of n)switch(t){case"M":c(),h=[e[0],e[1]],a.push(h);break;case"L":i(),a.push([e[0],e[1]]);break;case"C":if(!r.length){const t=a.length?a[a.length-1]:h;r.push([t[0],t[1]])}r.push([e[0],e[1]]),r.push([e[2],e[3]]),r.push([e[4],e[5]]);break;case"Z":i(),a.push([h[0],h[1]])}if(c(),!s)return o;const l=[];for(const t of o){const e=U(t,s);e.length&&l.push(e)}return l}(t,1,h?4-4*(s.simplification||1):(1+s.roughness)/2),i=_(t,s);if(o)if("solid"===s.fillStyle)if(1===r.length){const e=_(t,Object.assign(Object.assign({},s),{disableMultiStroke:!0,roughness:s.roughness?s.roughness+s.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else n.push(I(r,s));else n.push(C(r,s));return a&&(h?r.forEach((t=>{n.push(S(t,!1,s))})):n.push(i)),this._d("path",n,s)}opsToPath(t,e){let s="";for(const n of t.ops){const t="number"==typeof e&&e>=0?n.data.map((t=>+t.toFixed(e))):n.data;switch(n.op){case"move":s+=`M${t[0]} ${t[1]} `;break;case"bcurveTo":s+=`C${t[0]} ${t[1]}, ${t[2]} ${t[3]}, ${t[4]} ${t[5]} `;break;case"lineTo":s+=`L${t[0]} ${t[1]} `}}return s.trim()}toPaths(t){const e=t.sets||[],s=t.options||this.defaultOptions,n=[];for(const t of e){let e=null;switch(t.type){case"path":e={d:this.opsToPath(t),stroke:s.stroke,strokeWidth:s.strokeWidth,fill:tt};break;case"fillPath":e={d:this.opsToPath(t),stroke:tt,strokeWidth:0,fill:s.fill||tt};break;case"fillSketch":e=this.fillSketch(t,s)}e&&n.push(e)}return n}fillSketch(t,e){let s=e.fillWeight;return s<0&&(s=e.strokeWidth/2),{d:this.opsToPath(t),stroke:e.fill||tt,strokeWidth:s,fill:tt}}_mergedShape(t){return t.filter(((t,e)=>0===e||"move"!==t.op))}}class st{constructor(t,e){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new et(e)}draw(t){const e=t.sets||[],s=t.options||this.getDefaultOptions(),n=this.ctx,o=t.options.fixedDecimalPlaceDigits;for(const a of e)switch(a.type){case"path":n.save(),n.strokeStyle="none"===s.stroke?"transparent":s.stroke,n.lineWidth=s.strokeWidth,s.strokeLineDash&&n.setLineDash(s.strokeLineDash),s.strokeLineDashOffset&&(n.lineDashOffset=s.strokeLineDashOffset),this._drawToContext(n,a,o),n.restore();break;case"fillPath":{n.save(),n.fillStyle=s.fill||"";const e="curve"===t.shape||"polygon"===t.shape||"path"===t.shape?"evenodd":"nonzero";this._drawToContext(n,a,o,e),n.restore();break}case"fillSketch":this.fillSketch(n,a,s)}}fillSketch(t,e,s){let n=s.fillWeight;n<0&&(n=s.strokeWidth/2),t.save(),s.fillLineDash&&t.setLineDash(s.fillLineDash),s.fillLineDashOffset&&(t.lineDashOffset=s.fillLineDashOffset),t.strokeStyle=s.fill||"",t.lineWidth=n,this._drawToContext(t,e,s.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,e,s,n="nonzero"){t.beginPath();for(const n of e.ops){const e="number"==typeof s&&s>=0?n.data.map((t=>+t.toFixed(s))):n.data;switch(n.op){case"move":t.moveTo(e[0],e[1]);break;case"bcurveTo":t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]);break;case"lineTo":t.lineTo(e[0],e[1])}}"fillPath"===e.type?t.fill(n):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,e,s,n,o){const a=this.gen.line(t,e,s,n,o);return this.draw(a),a}rectangle(t,e,s,n,o){const a=this.gen.rectangle(t,e,s,n,o);return this.draw(a),a}ellipse(t,e,s,n,o){const a=this.gen.ellipse(t,e,s,n,o);return this.draw(a),a}circle(t,e,s,n){const o=this.gen.circle(t,e,s,n);return this.draw(o),o}linearPath(t,e){const s=this.gen.linearPath(t,e);return this.draw(s),s}polygon(t,e){const s=this.gen.polygon(t,e);return this.draw(s),s}arc(t,e,s,n,o,a,h=!1,r){const i=this.gen.arc(t,e,s,n,o,a,h,r);return this.draw(i),i}curve(t,e){const s=this.gen.curve(t,e);return this.draw(s),s}path(t,e){const s=this.gen.path(t,e);return this.draw(s),s}}const nt="http://www.w3.org/2000/svg";class ot{constructor(t,e){this.svg=t,this.gen=new et(e)}draw(t){const e=t.sets||[],s=t.options||this.getDefaultOptions(),n=this.svg.ownerDocument||window.document,o=n.createElementNS(nt,"g"),a=t.options.fixedDecimalPlaceDigits;for(const h of e){let e=null;switch(h.type){case"path":e=n.createElementNS(nt,"path"),e.setAttribute("d",this.opsToPath(h,a)),e.setAttribute("stroke",s.stroke),e.setAttribute("stroke-width",s.strokeWidth+""),e.setAttribute("fill","none"),s.strokeLineDash&&e.setAttribute("stroke-dasharray",s.strokeLineDash.join(" ").trim()),s.strokeLineDashOffset&&e.setAttribute("stroke-dashoffset",`${s.strokeLineDashOffset}`);break;case"fillPath":e=n.createElementNS(nt,"path"),e.setAttribute("d",this.opsToPath(h,a)),e.setAttribute("stroke","none"),e.setAttribute("stroke-width","0"),e.setAttribute("fill",s.fill||""),"curve"!==t.shape&&"polygon"!==t.shape||e.setAttribute("fill-rule","evenodd");break;case"fillSketch":e=this.fillSketch(n,h,s)}e&&o.appendChild(e)}return o}fillSketch(t,e,s){let n=s.fillWeight;n<0&&(n=s.strokeWidth/2);const o=t.createElementNS(nt,"path");return o.setAttribute("d",this.opsToPath(e,s.fixedDecimalPlaceDigits)),o.setAttribute("stroke",s.fill||""),o.setAttribute("stroke-width",n+""),o.setAttribute("fill","none"),s.fillLineDash&&o.setAttribute("stroke-dasharray",s.fillLineDash.join(" ").trim()),s.fillLineDashOffset&&o.setAttribute("stroke-dashoffset",`${s.fillLineDashOffset}`),o}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,e){return this.gen.opsToPath(t,e)}line(t,e,s,n,o){const a=this.gen.line(t,e,s,n,o);return this.draw(a)}rectangle(t,e,s,n,o){const a=this.gen.rectangle(t,e,s,n,o);return this.draw(a)}ellipse(t,e,s,n,o){const a=this.gen.ellipse(t,e,s,n,o);return this.draw(a)}circle(t,e,s,n){const o=this.gen.circle(t,e,s,n);return this.draw(o)}linearPath(t,e){const s=this.gen.linearPath(t,e);return this.draw(s)}polygon(t,e){const s=this.gen.polygon(t,e);return this.draw(s)}arc(t,e,s,n,o,a,h=!1,r){const i=this.gen.arc(t,e,s,n,o,a,h,r);return this.draw(i)}curve(t,e){const s=this.gen.curve(t,e);return this.draw(s)}path(t,e){const s=this.gen.path(t,e);return this.draw(s)}}return{canvas:(t,e)=>new st(t,e),svg:(t,e)=>new ot(t,e),generator:t=>new et(t),newSeed:()=>et.newSeed()}}();@@ -28,7 +28,7 @@ if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==url"se.diagrams.net"==window.location.hostname&&(urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.plugins="0",urlParams.mode="google",urlParams.lockdown="1",window.DRAWIO_GOOGLE_APP_ID=window.DRAWIO_GOOGLE_APP_ID||"184079235871",window.DRAWIO_GOOGLE_CLIENT_ID=window.DRAWIO_GOOGLE_CLIENT_ID||"184079235871-pjf5nn0lff27lk8qf0770gmffiv9gt61.apps.googleusercontent.com");"trello"==urlParams.mode&&(urlParams.tr="1");"embed.diagrams.net"==window.location.hostname&&(urlParams.embed="1");(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.open&&(window.location.hash=urlParams.open);"function"!==typeof window.structuredClone&&(window.structuredClone=function(a){return a});window.urlParams=window.urlParams||{};window.DOM_PURIFY_CONFIG=window.DOM_PURIFY_CONFIG||{ADD_TAGS:["use","foreignObject"],FORBID_TAGS:["form"],ALLOWED_URI_REGEXP:/^((?!javascript:).)*$/i,HTML_INTEGRATION_POINTS:{foreignobject:!0},ADD_ATTR:["target","content","pointer-events","requiredFeatures"]};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"mxgraph";-window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"26.2.2",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),+window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"26.2.7",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:0<=navigator.appVersion.indexOf("Android"),IS_IOS:/iP(hone|od|ad)/.test(navigator.platform)||navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&2<navigator.maxTouchPoints,IS_WEBVIEW:/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:-1<navigator.userAgent.toLowerCase().indexOf("firefox"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||@@ -83,73 +83,73 @@ mxUtils.write(c,a);mxEvent.addListener(c,"click",function(e){b(e)});null!=d&&(c.b,c,d,e,f){return mxUtils.link(a,b,function(){c[d](e)},f)},link:function(a,b,c,d){var e=document.createElement("span");e.style.color="blue";e.style.textDecoration="underline";e.style.cursor="pointer";null!=d&&(e.style.paddingLeft=d+"px");mxEvent.addListener(e,"click",c);mxUtils.write(e,b);null!=a&&a.appendChild(e);return e},getDocumentSize:function(){var a=document.body,b=document.documentElement;try{return new mxRectangle(0,0,a.clientWidth||b.clientWidth,Math.max(a.clientHeight||0,b.clientHeight))}catch(c){return new mxRectangle}},fit:function(a,b){b=b||0;var c=mxUtils.getDocumentSize(),d=parseInt(a.offsetLeft),e=parseInt(a.offsetWidth),f=mxUtils.getDocumentScrollOrigin(a.ownerDocument),g=f.x;f=f.y;var k=g+c.width-b;d+e>k&&(a.style.left=Math.max(g+b,k-e)+"px");d=parseInt(a.offsetTop);e=parseInt(a.offsetHeight);c=f+c.height-b;d+e>c&&(a.style.top=Math.max(f+b,c-e)+"px")},load:function(a){a=new mxXmlRequest(a,null,"GET",!1);a.send();return a},get:function(a,b,c,d,e,f,g){a=new mxXmlRequest(a,null,"GET");var k=a.setRequestHeaders;g&&(a.setRequestHeaders=function(l,m){k.apply(this,arguments);for(var n in g)l.setRequestHeader(n,g[n])});null!=d&&a.setBinary(d);a.send(b,c,e,f);return a},getAll:function(a,b,c){for(var d=a.length,e=[],f=0,g=function(){0==f&&null!=c&&c();f++},k=0;k<a.length;k++)(function(l,m){mxUtils.get(l,function(n){var p=n.getStatus();200>p||299<p?g():(e[m]=n,d--,0==d&&b(e))},g)})(a[k],k);0==d&&b(e)},post:function(a,b,c,d){return(new mxXmlRequest(a,b)).send(c,d)},submit:function(a,b,c,d){return(new mxXmlRequest(a,-b)).simulate(c,d)},loadInto:function(a,b,c){mxClient.IS_IE?b.onreadystatechange=function(){4==b.readyState&&c()}:b.addEventListener("load",c,!1);b.load(a)},getValue:function(a,b,c){a=null!=a?a[b]:null;null==a&&(a=c);return a},getNumber:function(a,b,c){a=null!=a?a[b]:null;null==a&&(a=c||0);return Number(a)},isLightDarkColor:function(a){return"string"===typeof a&&"light-dark"==mxUtils.ltrim(a).substring(0,10)},isVarColor:function(a){return mxUtils.varColorRegex.test(a)},isHexColor:function(a){return mxUtils.hexColorRegex.test(a)},-isRgbColor:function(a){return mxUtils.rgbaColorRegex.test(a)},isValidColor:function(a){if(null==a)return!1;a=String(a).replace(/\s/g,"");if(a.toLowerCase()==mxUtils.normalizedValidInvalidColor)return!0;mxUtils.canvasContext.fillStyle=mxUtils.validInvalidColor;mxUtils.canvasContext.fillStyle=a;return mxUtils.canvasContext.fillStyle!=mxUtils.validInvalidColor},isDarkColor:function(a){a=mxUtils.parseColor(a);return null!=a?128>.213*a.r+.715*a.g+.072*a.b:!1},parseLightDarkColor:function(a,b,c){var d=-a,e=null;null!=a&&(a=a.match(mxUtils.lightDarkColorRegex))&&3===a.length&&(d=mxUtils.trim(a[1]),e=mxUtils.trim(a[2]));null==e&&(c||mxUtils.isVarColor(d))&&(e=d);e=null!=e?e:null!=b?b:mxUtils.getInverseColor(d);return{light:d,dark:e}},getInverseColor:function(a,b,c){function d(m){return Math.round(b/100*(255-m)+m*(1-b/100))}function e(m){return Math.round(Math.max(0,Math.min(255,m)))}c=null!=c?c:180;b=null!=b?b:93;var f=0,g=0,k=0;if("transparent"==a.toLowerCase())return a;k=mxUtils.parseColor(a);if(null==-k)return a;f=k.r;g=k.g;k=k.b;f=d(f);g=d(g);k=d(k);a=[1,0,0,0,1,0,0,0,1];var l=Math.cos(c*Math.PI/180);c=Math.sin(c*Math.PI/180);a[0]=.2126+.7874*l-.2126*c;a[1]=.7152-.7152*l-.7152*c;a[2]=.0722-.0722*l+.9278*c;a[3]=.2126-.2126*l+.143*c;a[4]=.7152+(1-.7152)*l+.14*c;a[5]=.0722-.0722*l-.283*c;a[6]=.2126-.2126*l-.7874*c;a[7]=.7152-.7152*l+.7152*c;a[8]=.0722+.9278*l+.0722*c;c=e(a[0]*f+a[1]*g+a[2]*k);l=e(a[3]*f+a[4]*g+a[5]*k);f=e(a[6]*f+a[7]*g+a[8]*k);return"#"+(16777216|c<<16|l<<8|f).toString(16).slice(1)},-addAlphaToColor:function(a,b){null!=b&&null!=a&&"transparent"!=a&&(a=mxUtils.parseColor(a),a="rgba("+a.r+","+a.g+","+a.b+","+b+")");return a},getLightDarkColor:function(a,b,c,d){var e={light:"transparent",dark:"transparent",cssText:"transparent"};null!=a&&a!=mxConstants.NONE&&("string"===typeof a?(a=mxUtils.parseLightDarkColor(a,c,d),e.light=mxUtils.addAlphaToColor(a.light,b),e.dark=mxUtils.addAlphaToColor(a.dark,b),e.cssText=mxUtils.lightDarkColorSupported?e.light==e.dark?e.light:"light-dark("+e.light+-", "+e.dark+")":mxUtils.preferDarkColor?e.dark:e.light):(e.light=a,e.dark=a,e.cssText=a));return e},invertLightDarkColor:function(a){var b={};b.light=a.dark;b.dark=a.light;b.cssText=b.light==b.dark?b.light:"light-dark("+b.light+", "+b.dark+")";return b},getColor:function(a,b,c){a=null!=a?a[b]:null;null==a?a=c:a==mxConstants.NONE&&(a=null);return a},isEmptyObject:function(a){for(var b in a)return!1;return!0},clone:function(a,b,c){c=null!=c?c:!1;var d=null;if(null!=a&&"function"==typeof a.constructor)if(a.constructor===-Element)d=a.cloneNode(null!=c?!c:!1);else{d=new a.constructor;for(var e in a)e!=mxObjectIdentity.FIELD_NAME&&(null==b||0>mxUtils.indexOf(b,e))&&(d[e]=c||"object"!=typeof a[e]?a[e]:mxUtils.clone(a[e]))}return d},equalPoints:function(a,b){if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b)for(var c=0;c<a.length;c++)if(null!=a[c]&&null==b[c]||null==a[c]&&null!=b[c]||null!=a[c]&&null!=b[c]&&(a[c].x!=b[c].x||a[c].y!=b[c].y))return!1;return!0},equalEntries:function(a,-b){var c=0;if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b){for(var d in b)c++;for(d in a)if(c--,!(mxUtils.isNaN(a[d])&&mxUtils.isNaN(b[d])||a[d]==b[d]))return!1}return 0==c},removeDuplicates:function(a){for(var b=new mxDictionary,c=[],d=0;d<a.length;d++)b.get(a[d])||(c.push(a[d]),b.put(a[d],!0));return c},isNaN:function(a){return"number"==typeof a&&isNaN(a)},extend:function(a,b){var c=function(){};c.prototype=b.prototype;a.prototype=new c;-a.prototype.constructor=a},toString:function(a){var b="",c;for(c in a)try{if(null==a[c])b+=c+" = [null]\n";else if("function"==typeof a[c])b+=c+" => [Function]\n";else if("object"==typeof a[c]){var d=mxUtils.getFunctionName(a[c].constructor);b+=c+" => ["+d+"]\n"}else b+=c+" = "+a[c]+"\n"}catch(e){b+=c+"="+e.message}return b},toRadians:function(a){return Math.PI*a/180},toDegree:function(a){return 180*a/Math.PI},arcToCurves:function(a,b,c,d,e,f,g,k,l){k-=a;l-=b;if(0===c||0===d)return A;c=Math.abs(c);-d=Math.abs(d);var m=-k/2,n=-l/2,p=Math.cos(e*Math.PI/180);A=Math.sin(e*Math.PI/180);e=p*m+A*n;m=-1*A*m+p*n;n=e*e;var q=m*m,r=c*c,t=d*d,u=n/r+q/t;1<u?(c*=Math.sqrt(u),d*=Math.sqrt(u),f=0):(u=1,f===g&&(u=-1),f=u*Math.sqrt((r*t-r*q-t*n)/(r*q+t*n)));n=f*c*m/d;q=-1*f*d*e/c;k=p*n-A*q+k/2;l=A*n+p*q+l/2;r=Math.atan2((m-q)/d,(e-n)/c)-Math.atan2(0,1);f=0<=r?r:2*Math.PI+r;r=Math.atan2((-m-q)/d,(-e-n)/c)-Math.atan2((m-q)/d,(e-n)/c);e=0<=r?r:2*Math.PI+r;0==g&&0<e?e-=2*Math.PI:0!=g&&0>e&&(e+=2*Math.PI);g=2*e/Math.PI;-g=Math.ceil(0>g?-1*g:g);e/=g;m=8/3*Math.sin(e/4)*Math.sin(e/4)/Math.sin(e/2);n=p*c;p*=d;c*=A;d*=A;var x=Math.cos(f),y=Math.sin(f);q=-m*(n*y+d*x);r=-m*(c*y-p*x);for(var A=[],z=0;z<g;++z){f+=e;x=Math.cos(f);y=Math.sin(f);t=n*x-d*y+k;u=c*x+p*y+l;var C=-m*(n*y+d*x);x=-m*(c*y-p*x);y=6*z;A[y]=Number(q+a);A[y+1]=Number(r+b);A[y+2]=Number(t-C+a);A[y+3]=Number(u-x+b);A[y+4]=Number(t+a);A[y+5]=Number(u+b);q=t+C;r=u+x}return A},getBoundingBox:function(a,b,c){var d=null;if(null!=a&&null!=b&&0!=b){b=mxUtils.toRadians(b);-d=Math.cos(b);var e=Math.sin(b);c=null!=c?c:new mxPoint(a.x+a.width/2,a.y+a.height/2);var f=new mxPoint(a.x,a.y);b=new mxPoint(a.x+a.width,a.y);var g=new mxPoint(b.x,a.y+a.height);a=new mxPoint(a.x,g.y);f=mxUtils.getRotatedPoint(f,d,e,c);b=mxUtils.getRotatedPoint(b,d,e,c);g=mxUtils.getRotatedPoint(g,d,e,c);a=mxUtils.getRotatedPoint(a,d,e,c);d=new mxRectangle(f.x,f.y,0,0);d.add(new mxRectangle(b.x,b.y,0,0));d.add(new mxRectangle(g.x,g.y,0,0));d.add(new mxRectangle(a.x,a.y,0,0))}return d},getRotatedPoint:function(a,-b,c,d){d=null!=d?d:new mxPoint;var e=a.x-d.x;a=a.y-d.y;return new mxPoint(e*b-a*c+d.x,a*b+e*c+d.y)},getPortConstraints:function(a,b,c,d){b=mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT,mxUtils.getValue(b.style,c?mxConstants.STYLE_SOURCE_PORT_CONSTRAINT:mxConstants.STYLE_TARGET_PORT_CONSTRAINT,null));if(null==b)return d;d=b.toString();b=mxConstants.DIRECTION_MASK_NONE;c=0;1==mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT_ROTATION,0)&&(c=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,-0));a=0;45<c?(a=1,135<=c&&(a=2)):-45>c&&(a=3,-135>=c&&(a=2));if(0<=d.indexOf(mxConstants.DIRECTION_NORTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:b|=mxConstants.DIRECTION_MASK_EAST;break;case 2:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:b|=mxConstants.DIRECTION_MASK_WEST}if(0<=d.indexOf(mxConstants.DIRECTION_WEST))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_WEST;break;case 1:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:b|=mxConstants.DIRECTION_MASK_EAST;break;-case 3:b|=mxConstants.DIRECTION_MASK_SOUTH}if(0<=d.indexOf(mxConstants.DIRECTION_SOUTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:b|=mxConstants.DIRECTION_MASK_WEST;break;case 2:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:b|=mxConstants.DIRECTION_MASK_EAST}if(0<=d.indexOf(mxConstants.DIRECTION_EAST))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_EAST;break;case 1:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:b|=mxConstants.DIRECTION_MASK_WEST;break;case 3:b|=mxConstants.DIRECTION_MASK_NORTH}return b},-reversePortConstraints:function(a){var b=(a&mxConstants.DIRECTION_MASK_WEST)<<3;b|=(a&mxConstants.DIRECTION_MASK_NORTH)<<1;b|=(a&mxConstants.DIRECTION_MASK_SOUTH)>>1;return b|(a&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(a,b,c){var d=-1;if(0<a.absolutePoints.length)for(var e=a.absolutePoints[0],f=null,g=1;g<a.absolutePoints.length;g++){var k=a.absolutePoints[g];e=mxUtils.ptSegDistSq(e.x,e.y,k.x,k.y,b,c);if(null==f||e<f)f=e,d=g-1;e=k}return d},getDirectedBounds:function(a,b,c,-d,e){var f=mxUtils.getValue(c,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);d=null!=d?d:mxUtils.getValue(c,mxConstants.STYLE_FLIPH,!1);e=null!=e?e:mxUtils.getValue(c,mxConstants.STYLE_FLIPV,!1);b.x=Math.round(Math.max(0,Math.min(a.width,b.x)));b.y=Math.round(Math.max(0,Math.min(a.height,b.y)));b.width=Math.round(Math.max(0,Math.min(a.width,b.width)));b.height=Math.round(Math.max(0,Math.min(a.height,b.height)));if(e&&(f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH)||d&&(f==-mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST))c=b.x,b.x=b.width,b.width=c;if(d&&(f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH)||e&&(f==mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST))c=b.y,b.y=b.height,b.height=c;d=mxRectangle.fromRectangle(b);f==mxConstants.DIRECTION_SOUTH?(d.y=b.x,d.x=b.height,d.width=b.y,d.height=b.width):f==mxConstants.DIRECTION_WEST?(d.y=b.height,d.x=b.width,d.width=b.x,d.height=b.y):f==mxConstants.DIRECTION_NORTH&&(d.y=b.width,d.x=b.y,-d.width=b.height,d.height=b.x);return new mxRectangle(a.x+d.x,a.y+d.y,a.width-d.width-d.x,a.height-d.height-d.y)},getPerimeterPoint:function(a,b,c){for(var d=null,e=0;e<a.length-1;e++){var f=mxUtils.intersection(a[e].x,a[e].y,a[e+1].x,a[e+1].y,b.x,b.y,c.x,c.y);if(null!=f){var g=c.x-f.x,k=c.y-f.y;f={p:f,distSq:k*k+g*g};null!=f&&(null==d||d.distSq>f.distSq)&&(d=f)}}return null!=d?d.p:null},intersectsPoints:function(a,b){for(var c=0;c<b.length-1;c++)if(mxUtils.rectangleIntersectsSegment(a,b[c],b[c+1]))return!0;-return!1},rectangleIntersectsSegment:function(a,b,c){var d=a.y,e=a.x,f=d+a.height,g=e+a.width;a=b.x;var k=c.x;b.x>c.x&&(a=c.x,k=b.x);k>g&&(k=g);a<e&&(a=e);if(a>k)return!1;e=b.y;g=c.y;var l=c.x-b.x;1E-7<Math.abs(l)&&(c=(c.y-b.y)/l,b=b.y-c*b.x,e=c*a+b,g=c*k+b);e>g&&(b=g,g=e,e=b);g>f&&(g=f);e<d&&(e=d);return e>g?!1:!0},contains:function(a,b,c){return a.x<=b&&a.x+a.width>=b&&a.y<=c&&a.y+a.height>=c},intersects:function(a,b,c){var d=a.width,e=a.height,f=b.width,g=b.height;if(!c&&(0>=f||0>=g||0>=d||0>=-e))return!1;c=a.x;a=a.y;var k=b.x;b=b.y;f+=k;g+=b;d+=c;e+=a;return(f<k||f>c)&&(g<b||g>a)&&(d<c||d>k)&&(e<a||e>b)},intersectsHotspot:function(a,b,c,d,e,f){d=null!=d?d:1;e=null!=e?e:0;f=null!=f?f:0;if(0<d){var g=a.getCenterX(),k=a.getCenterY(),l=a.width,m=a.height,n=mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE)*a.view.scale;0<n&&(mxUtils.getValue(a.style,mxConstants.STYLE_HORIZONTAL,!0)?(k=a.y+n/2,m=n):(g=a.x+n/2,l=n));l=Math.max(e,l*d);m=Math.max(e,m*d);0<f&&(l=Math.min(l,f),m=Math.min(m,f));-d=new mxRectangle(g-l/2,k-m/2,l,m);g=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)||0);0!=g&&(e=Math.cos(-g),f=Math.sin(-g),g=new mxPoint(a.getCenterX(),a.getCenterY()),a=mxUtils.getRotatedPoint(new mxPoint(b,c),e,f,g),b=a.x,c=a.y);return mxUtils.contains(d,b,c)}return!0},getOffset:function(a,b){for(var c=0,d=0,e=!1,f=a,g=document.body,k=document.documentElement;null!=f&&f!=g&&f!=k&&!e;){var l=mxUtils.getCurrentStyle(f);null!=l&&(e=e||"fixed"==l.position);f=f.parentNode}b||-e||(b=mxUtils.getDocumentScrollOrigin(a.ownerDocument),c+=b.x,d+=b.y);a=a.getBoundingClientRect();null!=a&&(c+=a.left,d+=a.top);return new mxPoint(c,d)},getDocumentScrollOrigin:function(a){a=a.defaultView||a.parentWindow;return new mxPoint(null!=a&&void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,null!=a&&void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)},-getScrollOrigin:function(a,b,c){b=null!=b?b:!1;c=null!=c?c:!0;for(var d=null!=a?a.ownerDocument:document,e=d.body,f=d.documentElement,g=new mxPoint,k=!1;null!=a&&a!=e&&a!=f;){isNaN(a.scrollLeft)||isNaN(a.scrollTop)||(g.x+=a.scrollLeft,g.y+=a.scrollTop);var l=mxUtils.getCurrentStyle(a);null!=l&&(k=k||"fixed"==l.position);a=b?a.parentNode:null}!k&&c&&(a=mxUtils.getDocumentScrollOrigin(d),g.x+=a.x,g.y+=a.y);return g},convertPoint:function(a,b,c){var d=mxUtils.getScrollOrigin(a,!1);a=mxUtils.getOffset(a);-a.x-=d.x;a.y-=d.y;return new mxPoint(b-a.x,c-a.y)},removeJavascriptProtocol:function(a){for(a=null!=a?mxUtils.zapGremlins(a):null;null!=a&&"javascript:"===mxUtils.ltrim(a.toLowerCase()).substring(0,11);)a=a.substring(a.toLowerCase().indexOf(":")+1);return a},zapGremlins:function(a){for(var b=0,c=[],d=0;d<a.length;d++){var e=a.charCodeAt(d);(32<=e||9==e||10==e||13==e)&&65535!=e&&65534!=e||(c.push(a.substring(b,d)),b=d+1)}0<b&&b<a.length&&c.push(a.substring(b));return 0==c.length?a:c.join("")},ltrim:function(a,-b){return null!=a?a.replace(new RegExp("^["+(b||"\\s|\\0")+"]+","g"),""):null},rtrim:function(a,b){return null!=a?a.replace(new RegExp("["+(b||"\\s|\\0")+"]+$","g"),""):null},trim:function(a,b){return mxUtils.ltrim(mxUtils.rtrim(a,b),b)},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)&&("string"!=typeof a||0>a.toLowerCase().indexOf("0x"))},isInteger:function(a){return String(parseInt(a))===String(a)},mod:function(a,b){return(a%b+b)%b},intersection:function(a,b,c,d,e,f,g,k){var l=(k--f)*(c-a)-(g-e)*(d-b);g=((g-e)*(b-f)-(k-f)*(a-e))/l;e=((c-a)*(b-f)-(d-b)*(a-e))/l;return 0<=g&&1>=g&&0<=e&&1>=e?new mxPoint(a+g*(c-a),b+g*(d-b)):null},ptSegDistSq:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;0>=e*c+f*d?c=0:(e=c-e,f=d-f,a=e*c+f*d,c=0>=a?0:a*a/(c*c+d*d));e=e*e+f*f-c;0>e&&(e=0);return e},ptLineDist:function(a,b,c,d,e,f){return Math.abs((d-b)*e-(c-a)*f+c*b-d*a)/Math.sqrt((d-b)*(d-b)+(c-a)*(c-a))},relativeCcw:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;a=e*d-f*c;0==a&&(a=e*c+f*d,0<a&&(a=(e--c)*c+(f-d)*d,0>a&&(a=0)));return 0>a?-1:0<a?1:0},animateChanges:function(a,b){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(a,b,c){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(a,b,c,d,e,f){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(a,b){mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?a.style.filter=100<=b?"":"alpha(opacity="+b+")":a.style.opacity=b/100},createElementNs:function(a,b,c){if(null!=a.createElementNS)return a.createElementNS(b,-c);a=a.createElement(c);null!=namespace&&a.setAttribute("xmlns",b);return a},createImage:function(a){var b=document.createElement("img");b.setAttribute("src",a);b.setAttribute("border","0");return b},sortCells:function(a,b){b=null!=b?b:!0;var c=new mxDictionary;a.sort(function(d,e){var f=c.get(d);null==f&&(f=mxCellPath.create(d).split(mxCellPath.PATH_SEPARATOR),c.put(d,f));d=c.get(e);null==d&&(d=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),c.put(e,d));e=mxCellPath.compare(f,d);return 0==-e?0:0<e==b?1:-1});return a},getStylename:function(a){return null!=a&&(a=a.split(";")[0],0>a.indexOf("="))?a:""},getStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;c<a.length;c++)0>a[c].indexOf("=")&&b.push(a[c])}return b},indexOfStylename:function(a,b){if(null!=a&&null!=b){a=a.split(";");for(var c=0,d=0;d<a.length;d++){if(a[d]==b)return c;c+=a[d].length+1}}return-1},addStylename:function(a,b){0>mxUtils.indexOfStylename(a,b)&&(null==a?a="":0<a.length&&";"!=a.charAt(a.length--1)&&(a+=";"),a+=b);return a},removeStylename:function(a,b){var c=[];if(null!=a){a=a.split(";");for(var d=0;d<a.length;d++)a[d]!=b&&c.push(a[d])}return c.join(";")},removeAllStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;c<a.length;c++)0<=a[c].indexOf("=")&&b.push(a[c])}return b.join(";")},setCellStyles:function(a,b,c,d){if(null!=b&&0<b.length){a.beginUpdate();try{for(var e=0;e<b.length;e++)if(null!=b[e]){var f=mxUtils.setStyle(a.getStyle(b[e]),c,d);a.setStyle(b[e],f)}}finally{a.endUpdate()}}},-parseColor:function(a,b){b=null!=b?b:1;var c=null;if(null!=a&&a!=mxConstants.NONE){if(mxUtils.isRgbColor(a)){a=a.replace(/[^\d,]/g,"").split(",");c=parseInt(a[0]);var d=parseInt(a[1]),e=parseInt(a[2]);4==a.length&&(b=parseFloat(a[3]))}else mxUtils.isHexColor(a)||(a=mxUtils.color2hex(a)),a=a.substring(1),c=parseInt(a.substr(0,2),16),d=parseInt(a.substr(2,2),16),e=parseInt(a.substr(4,2),16),6<a.length&&(b=parseInt(a.substr(6,2),16)/255);c={r:c,g:d,b:e,a:b}}return c},hex2rgb:function(a){var b=mxUtils.parseColor(a);-null!=b&&(a="rgb("+b.r+", "+b.g+", "+b.b+")");return a},hex2rgba:function(a,b){b=mxUtils.parseColor(a,b);null!=b&&(a="rgba("+b.r+", "+b.g+", "+b.b+", "+b.a+")");return a},rgba2hex:function(a){var b=mxUtils.parseColor(a);return null!=b?"#"+("0"+b.r.toString(16)).slice(-2)+("0"+b.g.toString(16)).slice(-2)+("0"+b.b.toString(16)).slice(-2):a},color2hex:function(a,b){b=null!=b?b:"#000000";try{null!=a&&(a=String(a).replace(/\s/g,""),a.toLowerCase()==mxUtils.normalizedValidInvalidColor?b="#000000":(mxUtils.canvasContext.fillStyle=-mxUtils.validInvalidColor,mxUtils.canvasContext.fillStyle=a,mxUtils.canvasContext.fillStyle!=mxUtils.validInvalidColor&&(b=mxUtils.canvasContext.fillStyle)))}catch(c){}return b},setStyle:function(a,b,c){var d=null!=c&&("undefined"==typeof c.length||0<c.length);if(null==a||0==a.length)d&&(a=b+"="+c+";");else if(a.substring(0,b.length+1)==b+"="){var e=a.indexOf(";");a=d?b+"="+c+(0>e?";":a.substring(e)):0>e||e==a.length-1?"":a.substring(e+1)}else{var f=a.indexOf(";"+b+"=");0>f?d&&(d=";"==a.charAt(a.length--1)?"":";",a=a+d+b+"="+c+";"):(e=a.indexOf(";",f+1),a=d?a.substring(0,f+1)+b+"="+c+(0>e?";":a.substring(e)):a.substring(0,f)+(0>e?";":a.substring(e)))}return a},setCellStyleFlags:function(a,b,c,d,e){if(null!=b&&0<b.length){a.beginUpdate();try{for(var f=0;f<b.length;f++)if(null!=b[f]){var g=mxUtils.setStyleFlag(a.getStyle(b[f]),c,d,e);a.setStyle(b[f],g)}}finally{a.endUpdate()}}},setStyleFlag:function(a,b,c,d){if(null==a||0==a.length)a=d||null==d?b+"="+c:b+"=0";else{var e=a.indexOf(b+"=");if(0>e)e=";"==-a.charAt(a.length-1)?"":";",a=d||null==d?a+e+b+"="+c:a+e+b+"=0";else{var f=a.indexOf(";",e),g=0>f?a.substring(e+b.length+1):a.substring(e+b.length+1,f);g=null==d?parseInt(g)^c:d?parseInt(g)|c:parseInt(g)&~c;a=a.substring(0,e)+b+"="+g+(0<=f?a.substring(f):"")}}return a},getAlignmentAsPoint:function(a,b){var c=-.5,d=-.5;a==mxConstants.ALIGN_LEFT?c=0:a==mxConstants.ALIGN_RIGHT&&(c=-1);b==mxConstants.ALIGN_TOP?d=0:b==mxConstants.ALIGN_BOTTOM&&(d=-1);return new mxPoint(c,d)},getSizeForString:function(a,-b,c,d,e){b=null!=b?b:mxConstants.DEFAULT_FONTSIZE;c=null!=c?c:mxConstants.DEFAULT_FONTFAMILY;var f=document.createElement("div");f.style.fontFamily=c;f.style.fontSize=Math.round(b)+"px";f.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?b*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*mxSvgCanvas2D.prototype.lineHeightCorrection;null!=e&&((e&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(f.style.fontWeight="bold"),(e&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(f.style.fontStyle="italic"),-b=[],(e&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&b.push("underline"),(e&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&b.push("line-through"),0<b.length&&(f.style.textDecoration=b.join(" ")));f.style.position="absolute";f.style.visibility="hidden";f.style.display="inline-block";f.style.zoom="1";null!=d?(f.style.width=d+"px",f.style.whiteSpace="normal"):f.style.whiteSpace="nowrap";f.innerHTML=a;document.body.appendChild(f);a=new mxRectangle(0,0,f.offsetWidth,f.offsetHeight);-document.body.removeChild(f);return a},getViewXml:function(a,b,c,d,e){d=null!=d?d:0;e=null!=e?e:0;b=null!=b?b:1;null==c&&(c=[a.getModel().getRoot()]);var f=a.getView(),g=null,k=f.isEventsEnabled();f.setEventsEnabled(!1);var l=f.drawPane,m=f.overlayPane;a.dialect==mxConstants.DIALECT_SVG?(f.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),f.canvas.appendChild(f.drawPane),f.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g")):(f.drawPane=f.drawPane.cloneNode(!1),f.canvas.appendChild(f.drawPane),-f.overlayPane=f.overlayPane.cloneNode(!1));f.canvas.appendChild(f.overlayPane);var n=f.getTranslate();f.translate=new mxPoint(d,e);b=new mxTemporaryCellStates(a.getView(),b,c);try{g=(new mxCodec).encode(a.getView())}finally{b.destroy(),f.translate=n,f.canvas.removeChild(f.drawPane),f.canvas.removeChild(f.overlayPane),f.drawPane=l,f.overlayPane=m,f.setEventsEnabled(k)}return g},getScaleForPageCount:function(a,b,c,d){if(1>a)return 1;c=null!=c?c:mxConstants.PAGE_FORMAT_A4_PORTRAIT;d=null!=d?d:0;var e=-c.width-2*d;c=c.height-2*d;d=mxRectangle.fromRectangle(b.getGraphBounds());b=b.getView().getScale();d.width/=b;d.height/=b;b=d.width;var f=Math.sqrt(a);d=Math.sqrt(b/d.height/(e/c));c=f*d;d=f/d;if(1>c&&d>a){var g=d/a;d=a;c/=g}1>d&&c>a&&(g=c/a,c=a,d/=g);g=Math.ceil(c)*Math.ceil(d);for(f=0;g>a;){g=Math.floor(c)/c;var k=Math.floor(d)/d;1==g&&(g=Math.floor(c-1)/c);1==k&&(k=Math.floor(d-1)/d);g=g>k?g:k;c*=g;d*=g;g=Math.ceil(c)*Math.ceil(d);f++;if(10<f)break}return e*c/b*.99999},show:function(a,b,c,d,e,-f){c=null!=c?c:0;d=null!=d?d:0;null==b?b=window.open().document:b.open();9==document.documentMode&&b.writeln('\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=9"><![endif]--\x3e');var g=a.getGraphBounds(),k=Math.ceil(c-g.x),l=Math.ceil(d-g.y);null==e&&(e=Math.ceil(g.width+c)+Math.ceil(Math.ceil(g.x)-g.x));null==f&&(f=Math.ceil(g.height+d)+Math.ceil(Math.ceil(g.y)-g.y));if(mxClient.IS_IE||11==document.documentMode){d="<html><head>";g=document.getElementsByTagName("base");for(c=0;c<g.length;c++)d+=-g[c].outerHTML;d+="<style>";for(c=0;c<document.styleSheets.length;c++)try{d+=document.styleSheets[c].cssText}catch(m){}d=d+'</style></head><body style="margin:0px;"><div style="position:absolute;overflow:hidden;width:'+(e+"px;height:"+f+'px;"><div style="position:relative;left:'+k+"px;top:"+l+'px;">')+a.container.innerHTML;b.writeln(d+"</div></div></body><html>");b.close()}else{b.writeln("<html><head>");g=document.getElementsByTagName("base");for(c=0;c<g.length;c++)b.writeln(mxUtils.getOuterHtml(g[c]));-d=document.getElementsByTagName("link");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));d=document.getElementsByTagName("style");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));b.writeln('</head><body style="margin:0px;"></body></html>');b.close();c=b.createElement("div");c.position="absolute";c.overflow="hidden";c.style.width=e+"px";c.style.height=f+"px";e=b.createElement("div");e.style.position="absolute";e.style.left=k+"px";e.style.top=l+"px";f=a.container.firstChild;-for(d=null;null!=f;)g=f.cloneNode(!0),f==a.view.drawPane.ownerSVGElement?(c.appendChild(g),d=g):e.appendChild(g),f=f.nextSibling;b.body.appendChild(c);null!=e.firstChild&&b.body.appendChild(e);null!=d&&(d.style.minWidth="",d.style.minHeight="",d.firstChild.setAttribute("transform","translate("+k+","+l+")"))}mxUtils.removeCursors(b.body);return b},printScreen:function(a){var b=window.open();mxUtils.show(a,b.document);a=function(){b.focus();b.print();b.close()};mxClient.IS_GC?b.setTimeout(a,500):a()},-popup:function(a,b){if(b){var c=document.createElement("div");c.style.overflow="scroll";c.style.width="636px";c.style.height="460px";b=document.createElement("pre");b.innerHTML=mxUtils.htmlEntities(a,!1).replace(/\n/g,"<br>").replace(/ /g," ");c.appendChild(b);c=new mxWindow("Popup Window",c,document.body.clientWidth/2-320,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight)/2-240,640,480,!1,!0);c.setClosable(!0);c.setVisible(!0)}else mxClient.IS_NS?(c=window.open(),-c.document.writeln("<pre>"+mxUtils.htmlEntities(a)+"</pre"),c.document.close()):(c=window.open(),b=c.document.createElement("pre"),b.innerHTML=mxUtils.htmlEntities(a,!1).replace(/\n/g,"<br>").replace(/ /g," "),c.document.body.appendChild(b))},alert:function(a){alert(a)},prompt:function(a,b){return prompt(a,null!=b?b:"")},confirm:function(a){return confirm(a)},error:function(a,b,c,d){var e=document.createElement("div");e.style.padding="20px";var f=document.createElement("img");f.setAttribute("src",-d||mxUtils.errorImage);f.setAttribute("valign","bottom");f.style.verticalAlign="middle";e.appendChild(f);e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));mxUtils.write(e,a);a=document.body.clientWidth;d=document.body.clientHeight||document.documentElement.clientHeight;var g=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,e,(a-b)/2,d/4,b,null,!1,!0);c&&(mxUtils.br(e),b=document.createElement("p"),-c=document.createElement("button"),mxClient.IS_IE?c.style.cssText="float:right":c.setAttribute("style","float:right"),mxEvent.addListener(c,"click",function(k){g.destroy()}),mxUtils.write(c,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),b.appendChild(c),e.appendChild(b),mxUtils.br(e),g.setClosable(!0));g.setVisible(!0);return g},makeDraggable:function(a,b,c,d,e,f,g,k,l,m){a=new mxDragSource(a,c);a.dragOffset=new mxPoint(null!=e?e:0,null!=f?f:mxConstants.TOOLTIP_VERTICAL_OFFSET);a.autoscroll=-g;a.setGuidesEnabled(!1);null!=l&&(a.highlightDropTargets=l);null!=m&&(a.getDropTarget=m);a.getGraphForEvent=function(n){return"function"==typeof b?b(n):b};null!=d&&(a.createDragElement=function(){return d.cloneNode(!0)},k&&(a.createPreviewElement=function(n){var p=d.cloneNode(!0),q=parseInt(p.style.width),r=parseInt(p.style.height);p.style.width=Math.round(q*n.view.scale)+"px";p.style.height=Math.round(r*n.view.scale)+"px";return p}));return a},format:function(a){return parseFloat(parseFloat(a).toFixed(2))}},-mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"#808080",VML_SHADOWCOLOR:"#808080",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_BLUR:2,SHADOW_OPACITY:1,-NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",OUTLINE_HIGHLIGHT_COLOR:"#00FF00",OUTLINE_HIGHLIGHT_STROKEWIDTH:5,HIGHLIGHT_STROKEWIDTH:3,HIGHLIGHT_SIZE:2,HIGHLIGHT_OPACITY:100,CURSOR_MOVABLE_VERTEX:"move",-CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_TERMINAL_HANDLE:"pointer",CURSOR_BEND_HANDLE:"crosshair",CURSOR_VIRTUAL_BEND_HANDLE:"crosshair",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,-EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:6,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",DEFAULT_FONTSIZE:11,DEFAULT_TEXT_DIRECTION:"",LINE_HEIGHT:1.2,WORD_WRAP:"normal",-ABSOLUTE_LINE_HEIGHT:!1,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:0,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,827,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,827),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",-STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_PORT_CONSTRAINT_ROTATION:"portConstraintRotation",STYLE_SOURCE_PORT_CONSTRAINT:"sourcePortConstraint",STYLE_TARGET_PORT_CONSTRAINT:"targetPortConstraint",STYLE_OPACITY:"opacity",STYLE_FILL_OPACITY:"fillOpacity",STYLE_FILL_STYLE:"fillStyle",STYLE_STROKE_OPACITY:"strokeOpacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_TEXT_DIRECTION:"textDirection",STYLE_OVERFLOW:"overflow",STYLE_BLOCK_SPACING:"blockSpacing",STYLE_ORTHOGONAL:"orthogonal",-STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_DX:"exitDx",STYLE_EXIT_DY:"exitDy",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_DX:"entryDx",STYLE_ENTRY_DY:"entryDy",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_POINTER_EVENTS:"pointerEvents",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",STYLE_MARGIN:"margin",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",-STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_WIDTH:"labelWidth",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",-STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",-STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_TEXT_SHADOW:"textShadow",STYLE_SHADOW_OFFSET_X:"shadowOffsetX",STYLE_SHADOW_OFFSET_Y:"shadowOffsetY",STYLE_SHADOW_BLUR:"shadowBlur",STYLE_SHADOWCOLOR:"shadowColor",STYLE_SHADOW_OPACITY:"shadowOpacity",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",-STYLE_SWIMLANE_HEAD:"swimlaneHead",STYLE_SWIMLANE_BODY:"swimlaneBody",STYLE_ENDFILL:"endFill",STYLE_ENDFILLCOLOR:"endFillColor",STYLE_STARTFILL:"startFill",STYLE_STARTFILLCOLOR:"startFillColor",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_FIX_DASH:"fixDash",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_ABSOLUTE_ARCSIZE:"absoluteArcSize",STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",-STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ANCHOR_POINT_DIRECTION:"anchorPointDirection",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_ASPECT:"aspect",STYLE_AUTOSIZE:"autosize",STYLE_AUTOSIZE_GRID:"autosizeGrid",STYLE_FIXED_WIDTH:"fixedWidth",-STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BACKGROUND_OUTLINE:"backgroundOutline",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_RESIZE_WIDTH:"resizeWidth",STYLE_RESIZE_HEIGHT:"resizeHeight",STYLE_ROTATABLE:"rotatable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",STYLE_EDGE:"edgeStyle",STYLE_JETTY_SIZE:"jettySize",STYLE_SOURCE_JETTY_SIZE:"sourceJettySize",STYLE_TARGET_JETTY_SIZE:"targetJettySize",STYLE_LOOP:"loopStyle",-STYLE_ORTHOGONAL_LOOP:"orthogonalLoop",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",STYLE_CLIP_PATH:"clipPath",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_STRIKETHROUGH:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",SHAPE_ARROW:"arrow",SHAPE_ARROW_CONNECTOR:"arrowConnector",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",-SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_CLASSIC_THIN:"classicThin",ARROW_BLOCK:"block",ARROW_BLOCK_THIN:"blockThin",ARROW_OPEN:"open",ARROW_OPEN_THIN:"openThin",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",-DIRECTION_WEST:"west",DIRECTION_RADIAL:"radial",TEXT_DIRECTION_DEFAULT:"",TEXT_DIRECTION_AUTO:"auto",TEXT_DIRECTION_LTR:"ltr",TEXT_DIRECTION_RTL:"rtl",TEXT_DIRECTION_VERTICAL_LR:"vertical-lr",TEXT_DIRECTION_VERTICAL_RL:"vertical-rl",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",-EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_HEXAGON:"hexagonPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};+b)).simulate(c,d)},loadInto:function(a,b,c){mxClient.IS_IE?b.onreadystatechange=function(){4==b.readyState&&c()}:b.addEventListener("load",c,!1);b.load(a)},getValue:function(a,b,c){a=null!=a?a[b]:null;null==a&&(a=c);return a},getColorValue:function(a,b,c){a=null!=a?a[b]:null;if(null==a||"default"==a)a=c;return a},getNumber:function(a,b,c){a=null!=a?a[b]:null;null==a&&(a=c||0);return Number(a)},isLightDarkColor:function(a){return"string"===typeof a&&"light-dark"==mxUtils.ltrim(a).substring(0,10)},+isVarColor:function(a){return mxUtils.varColorRegex.test(a)},isHexColor:function(a){return mxUtils.hexColorRegex.test(a)},isRgbColor:function(a){return mxUtils.rgbaColorRegex.test(a)},isValidColor:function(a){if(null==a)return!1;a=String(a).replace(/\s/g,"");if(a.toLowerCase()==mxUtils.normalizedValidInvalidColor)return!0;mxUtils.canvasContext.fillStyle=mxUtils.validInvalidColor;mxUtils.canvasContext.fillStyle=a;return mxUtils.canvasContext.fillStyle!=mxUtils.validInvalidColor},isDarkColor:function(a){a=+mxUtils.parseColor(a);return null!=a?128>.213*a.r+.715*a.g+.072*a.b:!1},parseLightDarkColor:function(a,b,c){var d=a,e=null;null!=a&&(a=a.match(mxUtils.lightDarkColorRegex))&&3===a.length&&(d=mxUtils.trim(a[1]),e=mxUtils.trim(a[2]));null==e&&(c||mxUtils.isVarColor(d))&&(e=d);e=null!=e?e:null!=b?b:mxUtils.getInverseColor(d);return{light:d,dark:e}},getInverseColor:function(a,b,c){function d(m){return Math.round(b/100*(255-m)+m*(1-b/100))}function e(m){return Math.round(Math.max(0,Math.min(255,m)))}c=+null!=c?c:180;b=null!=b?b:93;var f=0,g=0,k=0;if("transparent"==a.toLowerCase())return a;k=mxUtils.parseColor(a);if(null==k)return a;f=k.r;g=k.g;k=k.b;f=d(f);g=d(g);k=d(k);a=[1,0,0,0,1,0,0,0,1];var l=Math.cos(c*Math.PI/180);c=Math.sin(c*Math.PI/180);a[0]=.2126+.7874*l-.2126*c;a[1]=.7152-.7152*l-.7152*c;a[2]=.0722-.0722*l+.9278*c;a[3]=.2126-.2126*l+.143*c;a[4]=.7152+(1-.7152)*l+.14*c;a[5]=.0722-.0722*l-.283*c;a[6]=.2126-.2126*l-.7874*c;a[7]=.7152-.7152*l+.7152*c;a[8]=.0722+.9278*l+.0722*c;c=e(a[0]*+f+a[1]*g+a[2]*k);l=e(a[3]*f+a[4]*g+a[5]*k);f=e(a[6]*f+a[7]*g+a[8]*k);return"#"+(16777216|c<<16|l<<8|f).toString(16).slice(1)},addAlphaToColor:function(a,b){null!=b&&null!=a&&"transparent"!=a&&(a=mxUtils.parseColor(a),a="rgba("+a.r+","+a.g+","+a.b+","+b+")");return a},getLightDarkColor:function(a,b,c,d){var e={light:"transparent",dark:"transparent",cssText:"transparent"};null!=a&&a!=mxConstants.NONE&&("string"===typeof a?(a=mxUtils.parseLightDarkColor(a,c,d),e.light=mxUtils.addAlphaToColor(a.light,+b),e.dark=mxUtils.addAlphaToColor(a.dark,b),e.cssText=mxUtils.lightDarkColorSupported?e.light==e.dark?e.light:"light-dark("+e.light+", "+e.dark+")":mxUtils.preferDarkColor?e.dark:e.light):(e.light=a,e.dark=a,e.cssText=a));return e},invertLightDarkColor:function(a){var b={};b.light=a.dark;b.dark=a.light;b.cssText=b.light==b.dark?b.light:"light-dark("+b.light+", "+b.dark+")";return b},getColor:function(a,b,c){a=null!=a?a[b]:null;null==a?a=c:a==mxConstants.NONE&&(a=null);return a},isEmptyObject:function(a){for(var b in a)return!1;+return!0},clone:function(a,b,c){c=null!=c?c:!1;var d=null;if(null!=a&&"function"==typeof a.constructor)if(a.constructor===Element)d=a.cloneNode(null!=c?!c:!1);else{d=new a.constructor;for(var e in a)e!=mxObjectIdentity.FIELD_NAME&&(null==b||0>mxUtils.indexOf(b,e))&&(d[e]=c||"object"!=typeof a[e]?a[e]:mxUtils.clone(a[e]))}return d},equalPoints:function(a,b){if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b)for(var c=0;c<a.length;c++)if(null!=a[c]&&+null==b[c]||null==a[c]&&null!=b[c]||null!=a[c]&&null!=b[c]&&(a[c].x!=b[c].x||a[c].y!=b[c].y))return!1;return!0},equalEntries:function(a,b){var c=0;if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b){for(var d in b)c++;for(d in a)if(c--,!(mxUtils.isNaN(a[d])&&mxUtils.isNaN(b[d])||a[d]==b[d]))return!1}return 0==c},removeDuplicates:function(a){for(var b=new mxDictionary,c=[],d=0;d<a.length;d++)b.get(a[d])||(c.push(a[d]),b.put(a[d],!0));return c},+isNaN:function(a){return"number"==typeof a&&isNaN(a)},extend:function(a,b){var c=function(){};c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a},toString:function(a){var b="",c;for(c in a)try{if(null==a[c])b+=c+" = [null]\n";else if("function"==typeof a[c])b+=c+" => [Function]\n";else if("object"==typeof a[c]){var d=mxUtils.getFunctionName(a[c].constructor);b+=c+" => ["+d+"]\n"}else b+=c+" = "+a[c]+"\n"}catch(e){b+=c+"="+e.message}return b},toRadians:function(a){return Math.PI*a/+180},toDegree:function(a){return 180*a/Math.PI},arcToCurves:function(a,b,c,d,e,f,g,k,l){k-=a;l-=b;if(0===c||0===d)return A;c=Math.abs(c);d=Math.abs(d);var m=-k/2,n=-l/2,p=Math.cos(e*Math.PI/180);A=Math.sin(e*Math.PI/180);e=p*m+A*n;m=-1*A*m+p*n;n=e*e;var q=m*m,r=c*c,t=d*d,u=n/r+q/t;1<u?(c*=Math.sqrt(u),d*=Math.sqrt(u),f=0):(u=1,f===g&&(u=-1),f=u*Math.sqrt((r*t-r*q-t*n)/(r*q+t*n)));n=f*c*m/d;q=-1*f*d*e/c;k=p*n-A*q+k/2;l=A*n+p*q+l/2;r=Math.atan2((m-q)/d,(e-n)/c)-Math.atan2(0,1);f=0<=r?r:2*Math.PI+r;+r=Math.atan2((-m-q)/d,(-e-n)/c)-Math.atan2((m-q)/d,(e-n)/c);e=0<=r?r:2*Math.PI+r;0==g&&0<e?e-=2*Math.PI:0!=g&&0>e&&(e+=2*Math.PI);g=2*e/Math.PI;g=Math.ceil(0>g?-1*g:g);e/=g;m=8/3*Math.sin(e/4)*Math.sin(e/4)/Math.sin(e/2);n=p*c;p*=d;c*=A;d*=A;var x=Math.cos(f),y=Math.sin(f);q=-m*(n*y+d*x);r=-m*(c*y-p*x);for(var A=[],z=0;z<g;++z){f+=e;x=Math.cos(f);y=Math.sin(f);t=n*x-d*y+k;u=c*x+p*y+l;var C=-m*(n*y+d*x);x=-m*(c*y-p*x);y=6*z;A[y]=Number(q+a);A[y+1]=Number(r+b);A[y+2]=Number(t-C+a);A[y+3]=Number(u-x++b);A[y+4]=Number(t+a);A[y+5]=Number(u+b);q=t+C;r=u+x}return A},getBoundingBox:function(a,b,c){var d=null;if(null!=a&&null!=b&&0!=b){b=mxUtils.toRadians(b);d=Math.cos(b);var e=Math.sin(b);c=null!=c?c:new mxPoint(a.x+a.width/2,a.y+a.height/2);var f=new mxPoint(a.x,a.y);b=new mxPoint(a.x+a.width,a.y);var g=new mxPoint(b.x,a.y+a.height);a=new mxPoint(a.x,g.y);f=mxUtils.getRotatedPoint(f,d,e,c);b=mxUtils.getRotatedPoint(b,d,e,c);g=mxUtils.getRotatedPoint(g,d,e,c);a=mxUtils.getRotatedPoint(a,d,e,c);d=new mxRectangle(f.x,+f.y,0,0);d.add(new mxRectangle(b.x,b.y,0,0));d.add(new mxRectangle(g.x,g.y,0,0));d.add(new mxRectangle(a.x,a.y,0,0))}return d},getRotatedPoint:function(a,b,c,d){d=null!=d?d:new mxPoint;var e=a.x-d.x;a=a.y-d.y;return new mxPoint(e*b-a*c+d.x,a*b+e*c+d.y)},getPortConstraints:function(a,b,c,d){b=mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT,mxUtils.getValue(b.style,c?mxConstants.STYLE_SOURCE_PORT_CONSTRAINT:mxConstants.STYLE_TARGET_PORT_CONSTRAINT,null));if(null==b)return d;d=b.toString();+b=mxConstants.DIRECTION_MASK_NONE;c=0;1==mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT_ROTATION,0)&&(c=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0));a=0;45<c?(a=1,135<=c&&(a=2)):-45>c&&(a=3,-135>=c&&(a=2));if(0<=d.indexOf(mxConstants.DIRECTION_NORTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:b|=mxConstants.DIRECTION_MASK_EAST;break;case 2:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:b|=mxConstants.DIRECTION_MASK_WEST}if(0<=d.indexOf(mxConstants.DIRECTION_WEST))switch(a){case 0:b|=+mxConstants.DIRECTION_MASK_WEST;break;case 1:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:b|=mxConstants.DIRECTION_MASK_EAST;break;case 3:b|=mxConstants.DIRECTION_MASK_SOUTH}if(0<=d.indexOf(mxConstants.DIRECTION_SOUTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:b|=mxConstants.DIRECTION_MASK_WEST;break;case 2:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:b|=mxConstants.DIRECTION_MASK_EAST}if(0<=d.indexOf(mxConstants.DIRECTION_EAST))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_EAST;+break;case 1:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:b|=mxConstants.DIRECTION_MASK_WEST;break;case 3:b|=mxConstants.DIRECTION_MASK_NORTH}return b},reversePortConstraints:function(a){var b=(a&mxConstants.DIRECTION_MASK_WEST)<<3;b|=(a&mxConstants.DIRECTION_MASK_NORTH)<<1;b|=(a&mxConstants.DIRECTION_MASK_SOUTH)>>1;return b|(a&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(a,b,c){var d=-1;if(0<a.absolutePoints.length)for(var e=a.absolutePoints[0],f=null,g=1;g<a.absolutePoints.length;g++){var k=+a.absolutePoints[g];e=mxUtils.ptSegDistSq(e.x,e.y,k.x,k.y,b,c);if(null==f||e<f)f=e,d=g-1;e=k}return d},getDirectedBounds:function(a,b,c,d,e){var f=mxUtils.getValue(c,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);d=null!=d?d:mxUtils.getValue(c,mxConstants.STYLE_FLIPH,!1);e=null!=e?e:mxUtils.getValue(c,mxConstants.STYLE_FLIPV,!1);b.x=Math.round(Math.max(0,Math.min(a.width,b.x)));b.y=Math.round(Math.max(0,Math.min(a.height,b.y)));b.width=Math.round(Math.max(0,Math.min(a.width,b.width)));b.height=+Math.round(Math.max(0,Math.min(a.height,b.height)));if(e&&(f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH)||d&&(f==mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST))c=b.x,b.x=b.width,b.width=c;if(d&&(f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH)||e&&(f==mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST))c=b.y,b.y=b.height,b.height=c;d=mxRectangle.fromRectangle(b);f==mxConstants.DIRECTION_SOUTH?(d.y=b.x,d.x=b.height,d.width=b.y,d.height=b.width):f==+mxConstants.DIRECTION_WEST?(d.y=b.height,d.x=b.width,d.width=b.x,d.height=b.y):f==mxConstants.DIRECTION_NORTH&&(d.y=b.width,d.x=b.y,d.width=b.height,d.height=b.x);return new mxRectangle(a.x+d.x,a.y+d.y,a.width-d.width-d.x,a.height-d.height-d.y)},getPerimeterPoint:function(a,b,c){for(var d=null,e=0;e<a.length-1;e++){var f=mxUtils.intersection(a[e].x,a[e].y,a[e+1].x,a[e+1].y,b.x,b.y,c.x,c.y);if(null!=f){var g=c.x-f.x,k=c.y-f.y;f={p:f,distSq:k*k+g*g};null!=f&&(null==d||d.distSq>f.distSq)&&(d=f)}}return null!=+d?d.p:null},intersectsPoints:function(a,b){for(var c=0;c<b.length-1;c++)if(mxUtils.rectangleIntersectsSegment(a,b[c],b[c+1]))return!0;return!1},rectangleIntersectsSegment:function(a,b,c){var d=a.y,e=a.x,f=d+a.height,g=e+a.width;a=b.x;var k=c.x;b.x>c.x&&(a=c.x,k=b.x);k>g&&(k=g);a<e&&(a=e);if(a>k)return!1;e=b.y;g=c.y;var l=c.x-b.x;1E-7<Math.abs(l)&&(c=(c.y-b.y)/l,b=b.y-c*b.x,e=c*a+b,g=c*k+b);e>g&&(b=g,g=e,e=b);g>f&&(g=f);e<d&&(e=d);return e>g?!1:!0},contains:function(a,b,c){return a.x<=b&&a.x+a.width>=+b&&a.y<=c&&a.y+a.height>=c},intersects:function(a,b,c){var d=a.width,e=a.height,f=b.width,g=b.height;if(!c&&(0>=f||0>=g||0>=d||0>=e))return!1;c=a.x;a=a.y;var k=b.x;b=b.y;f+=k;g+=b;d+=c;e+=a;return(f<k||f>c)&&(g<b||g>a)&&(d<c||d>k)&&(e<a||e>b)},intersectsHotspot:function(a,b,c,d,e,f){d=null!=d?d:1;e=null!=e?e:0;f=null!=f?f:0;if(0<d){var g=a.getCenterX(),k=a.getCenterY(),l=a.width,m=a.height,n=mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE)*a.view.scale;0<n&&(mxUtils.getValue(a.style,mxConstants.STYLE_HORIZONTAL,+!0)?(k=a.y+n/2,m=n):(g=a.x+n/2,l=n));l=Math.max(e,l*d);m=Math.max(e,m*d);0<f&&(l=Math.min(l,f),m=Math.min(m,f));d=new mxRectangle(g-l/2,k-m/2,l,m);g=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)||0);0!=g&&(e=Math.cos(-g),f=Math.sin(-g),g=new mxPoint(a.getCenterX(),a.getCenterY()),a=mxUtils.getRotatedPoint(new mxPoint(b,c),e,f,g),b=a.x,c=a.y);return mxUtils.contains(d,b,c)}return!0},getOffset:function(a,b){for(var c=0,d=0,e=!1,f=a,g=document.body,k=document.documentElement;null!=+f&&f!=g&&f!=k&&!e;){var l=mxUtils.getCurrentStyle(f);null!=l&&(e=e||"fixed"==l.position);f=f.parentNode}b||e||(b=mxUtils.getDocumentScrollOrigin(a.ownerDocument),c+=b.x,d+=b.y);a=a.getBoundingClientRect();null!=a&&(c+=a.left,d+=a.top);return new mxPoint(c,d)},getDocumentScrollOrigin:function(a){a=a.defaultView||a.parentWindow;return new mxPoint(null!=a&&void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,null!=a&&void 0!==window.pageYOffset?+window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)},getScrollOrigin:function(a,b,c){b=null!=b?b:!1;c=null!=c?c:!0;for(var d=null!=a?a.ownerDocument:document,e=d.body,f=d.documentElement,g=new mxPoint,k=!1;null!=a&&a!=e&&a!=f;){isNaN(a.scrollLeft)||isNaN(a.scrollTop)||(g.x+=a.scrollLeft,g.y+=a.scrollTop);var l=mxUtils.getCurrentStyle(a);null!=l&&(k=k||"fixed"==l.position);a=b?a.parentNode:null}!k&&c&&(a=mxUtils.getDocumentScrollOrigin(d),g.x+=a.x,g.y+=+a.y);return g},convertPoint:function(a,b,c){var d=mxUtils.getScrollOrigin(a,!1);a=mxUtils.getOffset(a);a.x-=d.x;a.y-=d.y;return new mxPoint(b-a.x,c-a.y)},removeJavascriptProtocol:function(a){for(a=null!=a?mxUtils.zapGremlins(a):null;null!=a&&"javascript:"===mxUtils.ltrim(a.toLowerCase()).substring(0,11);)a=a.substring(a.toLowerCase().indexOf(":")+1);return a},zapGremlins:function(a){for(var b=0,c=[],d=0;d<a.length;d++){var e=a.charCodeAt(d);(32<=e||9==e||10==e||13==e)&&65535!=e&&65534!=e||(c.push(a.substring(b,+d)),b=d+1)}0<b&&b<a.length&&c.push(a.substring(b));return 0==c.length?a:c.join("")},ltrim:function(a,b){return null!=a?a.replace(new RegExp("^["+(b||"\\s|\\0")+"]+","g"),""):null},rtrim:function(a,b){return null!=a?a.replace(new RegExp("["+(b||"\\s|\\0")+"]+$","g"),""):null},trim:function(a,b){return mxUtils.ltrim(mxUtils.rtrim(a,b),b)},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)&&("string"!=typeof a||0>a.toLowerCase().indexOf("0x"))},isInteger:function(a){return String(parseInt(a))===+String(a)},mod:function(a,b){return(a%b+b)%b},intersection:function(a,b,c,d,e,f,g,k){var l=(k-f)*(c-a)-(g-e)*(d-b);g=((g-e)*(b-f)-(k-f)*(a-e))/l;e=((c-a)*(b-f)-(d-b)*(a-e))/l;return 0<=g&&1>=g&&0<=e&&1>=e?new mxPoint(a+g*(c-a),b+g*(d-b)):null},ptSegDistSq:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;0>=e*c+f*d?c=0:(e=c-e,f=d-f,a=e*c+f*d,c=0>=a?0:a*a/(c*c+d*d));e=e*e+f*f-c;0>e&&(e=0);return e},ptLineDist:function(a,b,c,d,e,f){return Math.abs((d-b)*e-(c-a)*f+c*b-d*a)/Math.sqrt((d-b)*(d-b)+(c-a)*(c-a))},+relativeCcw:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;a=e*d-f*c;0==a&&(a=e*c+f*d,0<a&&(a=(e-c)*c+(f-d)*d,0>a&&(a=0)));return 0>a?-1:0<a?1:0},animateChanges:function(a,b){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(a,b,c){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(a,b,c,d,e,f){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(a,b){mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?a.style.filter=100<=b?+"":"alpha(opacity="+b+")":a.style.opacity=b/100},createElementNs:function(a,b,c){if(null!=a.createElementNS)return a.createElementNS(b,c);a=a.createElement(c);null!=namespace&&a.setAttribute("xmlns",b);return a},createImage:function(a){var b=document.createElement("img");b.setAttribute("src",a);b.setAttribute("border","0");return b},sortCells:function(a,b){b=null!=b?b:!0;var c=new mxDictionary;a.sort(function(d,e){var f=c.get(d);null==f&&(f=mxCellPath.create(d).split(mxCellPath.PATH_SEPARATOR),c.put(d,+f));d=c.get(e);null==d&&(d=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),c.put(e,d));e=mxCellPath.compare(f,d);return 0==e?0:0<e==b?1:-1});return a},getStylename:function(a){return null!=a&&(a=a.split(";")[0],0>a.indexOf("="))?a:""},getStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;c<a.length;c++)0>a[c].indexOf("=")&&b.push(a[c])}return b},indexOfStylename:function(a,b){if(null!=a&&null!=b){a=a.split(";");for(var c=0,d=0;d<a.length;d++){if(a[d]==b)return c;c+=a[d].length++1}}return-1},addStylename:function(a,b){0>mxUtils.indexOfStylename(a,b)&&(null==a?a="":0<a.length&&";"!=a.charAt(a.length-1)&&(a+=";"),a+=b);return a},removeStylename:function(a,b){var c=[];if(null!=a){a=a.split(";");for(var d=0;d<a.length;d++)a[d]!=b&&c.push(a[d])}return c.join(";")},removeAllStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;c<a.length;c++)0<=a[c].indexOf("=")&&b.push(a[c])}return b.join(";")},setCellStyles:function(a,b,c,d){if(null!=b&&0<b.length){a.beginUpdate();+try{for(var e=0;e<b.length;e++)if(null!=b[e]){var f=mxUtils.setStyle(a.getStyle(b[e]),c,d);a.setStyle(b[e],f)}}finally{a.endUpdate()}}},parseColor:function(a,b){b=null!=b?b:1;var c=null;if(null!=a&&a!=mxConstants.NONE){if(mxUtils.isRgbColor(a)){a=a.replace(/[^\d,]/g,"").split(",");c=parseInt(a[0]);var d=parseInt(a[1]),e=parseInt(a[2]);4==a.length&&(b=parseFloat(a[3]))}else mxUtils.isHexColor(a)||(a=mxUtils.color2hex(a)),a=a.substring(1),c=parseInt(a.substr(0,2),16),d=parseInt(a.substr(2,2),16),e=+parseInt(a.substr(4,2),16),6<a.length&&(b=parseInt(a.substr(6,2),16)/255);c={r:c,g:d,b:e,a:b}}return c},hex2rgb:function(a){var b=mxUtils.parseColor(a);null!=b&&(a="rgb("+b.r+", "+b.g+", "+b.b+")");return a},hex2rgba:function(a,b){b=mxUtils.parseColor(a,b);null!=b&&(a="rgba("+b.r+", "+b.g+", "+b.b+", "+b.a+")");return a},rgba2hex:function(a){var b=mxUtils.parseColor(a);return null!=b?"#"+("0"+b.r.toString(16)).slice(-2)+("0"+b.g.toString(16)).slice(-2)+("0"+b.b.toString(16)).slice(-2):a},color2hex:function(a,+b){b=null!=b?b:"#000000";try{null!=a&&(a=String(a).replace(/\s/g,""),a.toLowerCase()==mxUtils.normalizedValidInvalidColor?b="#000000":(mxUtils.canvasContext.fillStyle=mxUtils.validInvalidColor,mxUtils.canvasContext.fillStyle=a,mxUtils.canvasContext.fillStyle!=mxUtils.validInvalidColor&&(b=mxUtils.canvasContext.fillStyle)))}catch(c){}return b},setStyle:function(a,b,c){var d=null!=c&&("undefined"==typeof c.length||0<c.length);if(null==a||0==a.length)d&&(a=b+"="+c+";");else if(a.substring(0,b.length++1)==b+"="){var e=a.indexOf(";");a=d?b+"="+c+(0>e?";":a.substring(e)):0>e||e==a.length-1?"":a.substring(e+1)}else{var f=a.indexOf(";"+b+"=");0>f?d&&(d=";"==a.charAt(a.length-1)?"":";",a=a+d+b+"="+c+";"):(e=a.indexOf(";",f+1),a=d?a.substring(0,f+1)+b+"="+c+(0>e?";":a.substring(e)):a.substring(0,f)+(0>e?";":a.substring(e)))}return a},setCellStyleFlags:function(a,b,c,d,e){if(null!=b&&0<b.length){a.beginUpdate();try{for(var f=0;f<b.length;f++)if(null!=b[f]){var g=mxUtils.setStyleFlag(a.getStyle(b[f]),+c,d,e);a.setStyle(b[f],g)}}finally{a.endUpdate()}}},setStyleFlag:function(a,b,c,d){if(null==a||0==a.length)a=d||null==d?b+"="+c:b+"=0";else{var e=a.indexOf(b+"=");if(0>e)e=";"==a.charAt(a.length-1)?"":";",a=d||null==d?a+e+b+"="+c:a+e+b+"=0";else{var f=a.indexOf(";",e),g=0>f?a.substring(e+b.length+1):a.substring(e+b.length+1,f);g=null==d?parseInt(g)^c:d?parseInt(g)|c:parseInt(g)&~c;a=a.substring(0,e)+b+"="+g+(0<=f?a.substring(f):"")}}return a},getAlignmentAsPoint:function(a,b){var c=-.5,d=-.5;a==mxConstants.ALIGN_LEFT?+c=0:a==mxConstants.ALIGN_RIGHT&&(c=-1);b==mxConstants.ALIGN_TOP?d=0:b==mxConstants.ALIGN_BOTTOM&&(d=-1);return new mxPoint(c,d)},getSizeForString:function(a,b,c,d,e){b=null!=b?b:mxConstants.DEFAULT_FONTSIZE;c=null!=c?c:mxConstants.DEFAULT_FONTFAMILY;var f=document.createElement("div");f.style.fontFamily=c;f.style.fontSize=Math.round(b)+"px";f.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?b*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*mxSvgCanvas2D.prototype.lineHeightCorrection;null!=+e&&((e&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(f.style.fontWeight="bold"),(e&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(f.style.fontStyle="italic"),b=[],(e&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&b.push("underline"),(e&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&b.push("line-through"),0<b.length&&(f.style.textDecoration=b.join(" ")));f.style.position="absolute";f.style.visibility="hidden";f.style.display="inline-block";f.style.zoom="1";null!=+d?(f.style.width=d+"px",f.style.whiteSpace="normal"):f.style.whiteSpace="nowrap";f.innerHTML=a;document.body.appendChild(f);a=new mxRectangle(0,0,f.offsetWidth,f.offsetHeight);document.body.removeChild(f);return a},getViewXml:function(a,b,c,d,e){d=null!=d?d:0;e=null!=e?e:0;b=null!=b?b:1;null==c&&(c=[a.getModel().getRoot()]);var f=a.getView(),g=null,k=f.isEventsEnabled();f.setEventsEnabled(!1);var l=f.drawPane,m=f.overlayPane;a.dialect==mxConstants.DIALECT_SVG?(f.drawPane=document.createElementNS(mxConstants.NS_SVG,+"g"),f.canvas.appendChild(f.drawPane),f.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g")):(f.drawPane=f.drawPane.cloneNode(!1),f.canvas.appendChild(f.drawPane),f.overlayPane=f.overlayPane.cloneNode(!1));f.canvas.appendChild(f.overlayPane);var n=f.getTranslate();f.translate=new mxPoint(d,e);b=new mxTemporaryCellStates(a.getView(),b,c);try{g=(new mxCodec).encode(a.getView())}finally{b.destroy(),f.translate=n,f.canvas.removeChild(f.drawPane),f.canvas.removeChild(f.overlayPane),f.drawPane=+l,f.overlayPane=m,f.setEventsEnabled(k)}return g},getScaleForPageCount:function(a,b,c,d){if(1>a)return 1;c=null!=c?c:mxConstants.PAGE_FORMAT_A4_PORTRAIT;d=null!=d?d:0;var e=c.width-2*d;c=c.height-2*d;d=mxRectangle.fromRectangle(b.getGraphBounds());b=b.getView().getScale();d.width/=b;d.height/=b;b=d.width;var f=Math.sqrt(a);d=Math.sqrt(b/d.height/(e/c));c=f*d;d=f/d;if(1>c&&d>a){var g=d/a;d=a;c/=g}1>d&&c>a&&(g=c/a,c=a,d/=g);g=Math.ceil(c)*Math.ceil(d);for(f=0;g>a;){g=Math.floor(c)/c;var k=Math.floor(d)/+d;1==g&&(g=Math.floor(c-1)/c);1==k&&(k=Math.floor(d-1)/d);g=g>k?g:k;c*=g;d*=g;g=Math.ceil(c)*Math.ceil(d);f++;if(10<f)break}return e*c/b*.99999},show:function(a,b,c,d,e,f){c=null!=c?c:0;d=null!=d?d:0;null==b?b=window.open().document:b.open();9==document.documentMode&&b.writeln('\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=9"><![endif]--\x3e');var g=a.getGraphBounds(),k=Math.ceil(c-g.x),l=Math.ceil(d-g.y);null==e&&(e=Math.ceil(g.width+c)+Math.ceil(Math.ceil(g.x)-g.x));null==f&&(f=+Math.ceil(g.height+d)+Math.ceil(Math.ceil(g.y)-g.y));if(mxClient.IS_IE||11==document.documentMode){d="<html><head>";g=document.getElementsByTagName("base");for(c=0;c<g.length;c++)d+=g[c].outerHTML;d+="<style>";for(c=0;c<document.styleSheets.length;c++)try{d+=document.styleSheets[c].cssText}catch(m){}d=d+'</style></head><body style="margin:0px;"><div style="position:absolute;overflow:hidden;width:'+(e+"px;height:"+f+'px;"><div style="position:relative;left:'+k+"px;top:"+l+'px;">')+a.container.innerHTML;+b.writeln(d+"</div></div></body><html>");b.close()}else{b.writeln("<html><head>");g=document.getElementsByTagName("base");for(c=0;c<g.length;c++)b.writeln(mxUtils.getOuterHtml(g[c]));d=document.getElementsByTagName("link");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));d=document.getElementsByTagName("style");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));b.writeln('</head><body style="margin:0px;"></body></html>');b.close();c=b.createElement("div");c.position="absolute";+c.overflow="hidden";c.style.width=e+"px";c.style.height=f+"px";e=b.createElement("div");e.style.position="absolute";e.style.left=k+"px";e.style.top=l+"px";f=a.container.firstChild;for(d=null;null!=f;)g=f.cloneNode(!0),f==a.view.drawPane.ownerSVGElement?(c.appendChild(g),d=g):e.appendChild(g),f=f.nextSibling;b.body.appendChild(c);null!=e.firstChild&&b.body.appendChild(e);null!=d&&(d.style.minWidth="",d.style.minHeight="",d.firstChild.setAttribute("transform","translate("+k+","+l+")"))}mxUtils.removeCursors(b.body);+return b},printScreen:function(a){var b=window.open();mxUtils.show(a,b.document);a=function(){b.focus();b.print();b.close()};mxClient.IS_GC?b.setTimeout(a,500):a()},popup:function(a,b){if(b){var c=document.createElement("div");c.style.overflow="scroll";c.style.width="636px";c.style.height="460px";b=document.createElement("pre");b.innerHTML=mxUtils.htmlEntities(a,!1).replace(/\n/g,"<br>").replace(/ /g," ");c.appendChild(b);c=new mxWindow("Popup Window",c,document.body.clientWidth/2-320,Math.max(document.body.clientHeight||+0,document.documentElement.clientHeight)/2-240,640,480,!1,!0);c.setClosable(!0);c.setVisible(!0)}else mxClient.IS_NS?(c=window.open(),c.document.writeln("<pre>"+mxUtils.htmlEntities(a)+"</pre"),c.document.close()):(c=window.open(),b=c.document.createElement("pre"),b.innerHTML=mxUtils.htmlEntities(a,!1).replace(/\n/g,"<br>").replace(/ /g," "),c.document.body.appendChild(b))},alert:function(a){alert(a)},prompt:function(a,b){return prompt(a,null!=b?b:"")},confirm:function(a){return confirm(a)},+error:function(a,b,c,d){var e=document.createElement("div");e.style.padding="20px";var f=document.createElement("img");f.setAttribute("src",d||mxUtils.errorImage);f.setAttribute("valign","bottom");f.style.verticalAlign="middle";e.appendChild(f);e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));mxUtils.write(e,a);a=document.body.clientWidth;d=document.body.clientHeight||document.documentElement.clientHeight;var g=new mxWindow(mxResources.get(mxUtils.errorResource)||+mxUtils.errorResource,e,(a-b)/2,d/4,b,null,!1,!0);c&&(mxUtils.br(e),b=document.createElement("p"),c=document.createElement("button"),mxClient.IS_IE?c.style.cssText="float:right":c.setAttribute("style","float:right"),mxEvent.addListener(c,"click",function(k){g.destroy()}),mxUtils.write(c,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),b.appendChild(c),e.appendChild(b),mxUtils.br(e),g.setClosable(!0));g.setVisible(!0);return g},makeDraggable:function(a,b,c,d,e,f,g,k,l,m){a=new mxDragSource(a,+c);a.dragOffset=new mxPoint(null!=e?e:0,null!=f?f:mxConstants.TOOLTIP_VERTICAL_OFFSET);a.autoscroll=g;a.setGuidesEnabled(!1);null!=l&&(a.highlightDropTargets=l);null!=m&&(a.getDropTarget=m);a.getGraphForEvent=function(n){return"function"==typeof b?b(n):b};null!=d&&(a.createDragElement=function(){return d.cloneNode(!0)},k&&(a.createPreviewElement=function(n){var p=d.cloneNode(!0),q=parseInt(p.style.width),r=parseInt(p.style.height);p.style.width=Math.round(q*n.view.scale)+"px";p.style.height=Math.round(r*+n.view.scale)+"px";return p}));return a},format:function(a){return parseFloat(parseFloat(a).toFixed(2))}},mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"#808080",+VML_SHADOWCOLOR:"#808080",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_BLUR:2,SHADOW_OPACITY:1,NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",OUTLINE_HIGHLIGHT_COLOR:"#00FF00",OUTLINE_HIGHLIGHT_STROKEWIDTH:5,+HIGHLIGHT_STROKEWIDTH:3,HIGHLIGHT_SIZE:2,HIGHLIGHT_OPACITY:100,CURSOR_MOVABLE_VERTEX:"move",CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_TERMINAL_HANDLE:"pointer",CURSOR_BEND_HANDLE:"crosshair",CURSOR_VIRTUAL_BEND_HANDLE:"crosshair",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",+VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:6,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",+DEFAULT_FONTSIZE:11,DEFAULT_TEXT_DIRECTION:"",LINE_HEIGHT:1.2,WORD_WRAP:"normal",ABSOLUTE_LINE_HEIGHT:!1,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:0,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,827,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,827),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,+0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_PORT_CONSTRAINT_ROTATION:"portConstraintRotation",STYLE_SOURCE_PORT_CONSTRAINT:"sourcePortConstraint",STYLE_TARGET_PORT_CONSTRAINT:"targetPortConstraint",STYLE_OPACITY:"opacity",STYLE_FILL_OPACITY:"fillOpacity",STYLE_FILL_STYLE:"fillStyle",STYLE_STROKE_OPACITY:"strokeOpacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_TEXT_DIRECTION:"textDirection",+STYLE_OVERFLOW:"overflow",STYLE_BLOCK_SPACING:"blockSpacing",STYLE_ORTHOGONAL:"orthogonal",STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_DX:"exitDx",STYLE_EXIT_DY:"exitDy",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_DX:"entryDx",STYLE_ENTRY_DY:"entryDy",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_POINTER_EVENTS:"pointerEvents",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",+STYLE_MARGIN:"margin",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_WIDTH:"labelWidth",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",+STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",+STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_TEXT_SHADOW:"textShadow",STYLE_SHADOW_OFFSET_X:"shadowOffsetX",STYLE_SHADOW_OFFSET_Y:"shadowOffsetY",STYLE_SHADOW_BLUR:"shadowBlur",STYLE_SHADOWCOLOR:"shadowColor",STYLE_SHADOW_OPACITY:"shadowOpacity",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",+STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_SWIMLANE_HEAD:"swimlaneHead",STYLE_SWIMLANE_BODY:"swimlaneBody",STYLE_ENDFILL:"endFill",STYLE_ENDFILLCOLOR:"endFillColor",STYLE_STARTFILL:"startFill",STYLE_STARTFILLCOLOR:"startFillColor",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_FIX_DASH:"fixDash",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_ABSOLUTE_ARCSIZE:"absoluteArcSize",+STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ANCHOR_POINT_DIRECTION:"anchorPointDirection",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",+STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_ASPECT:"aspect",STYLE_AUTOSIZE:"autosize",STYLE_AUTOSIZE_GRID:"autosizeGrid",STYLE_FIXED_WIDTH:"fixedWidth",STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BACKGROUND_OUTLINE:"backgroundOutline",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_RESIZE_WIDTH:"resizeWidth",STYLE_RESIZE_HEIGHT:"resizeHeight",STYLE_ROTATABLE:"rotatable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",+STYLE_EDGE:"edgeStyle",STYLE_JETTY_SIZE:"jettySize",STYLE_SOURCE_JETTY_SIZE:"sourceJettySize",STYLE_TARGET_JETTY_SIZE:"targetJettySize",STYLE_LOOP:"loopStyle",STYLE_ORTHOGONAL_LOOP:"orthogonalLoop",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",STYLE_CLIP_PATH:"clipPath",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_STRIKETHROUGH:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",+SHAPE_ARROW:"arrow",SHAPE_ARROW_CONNECTOR:"arrowConnector",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_CLASSIC_THIN:"classicThin",ARROW_BLOCK:"block",ARROW_BLOCK_THIN:"blockThin",ARROW_OPEN:"open",ARROW_OPEN_THIN:"openThin",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",+ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",DIRECTION_WEST:"west",DIRECTION_RADIAL:"radial",TEXT_DIRECTION_DEFAULT:"",TEXT_DIRECTION_AUTO:"auto",TEXT_DIRECTION_LTR:"ltr",TEXT_DIRECTION_RTL:"rtl",TEXT_DIRECTION_VERTICAL_LR:"vertical-lr",TEXT_DIRECTION_VERTICAL_RL:"vertical-rl",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,+ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_HEXAGON:"hexagonPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};function mxEventObject(a){this.name=a;this.properties=[];for(var b=1;b<arguments.length;b+=2)null!=arguments[b+1]&&(this.properties[arguments[b]]=arguments[b+1])}mxEventObject.prototype.name=null;mxEventObject.prototype.properties=null;mxEventObject.prototype.consumed=!1;mxEventObject.prototype.getName=function(){return this.name};mxEventObject.prototype.getProperties=function(){return this.properties};mxEventObject.prototype.getProperty=function(a){return this.properties[a]};mxEventObject.prototype.isConsumed=function(){return this.consumed};mxEventObject.prototype.consume=function(){this.consumed=!0};function mxMouseEvent(a,b){this.evt=a;this.sourceState=this.state=b}mxMouseEvent.prototype.consumed=!1;mxMouseEvent.prototype.evt=null;mxMouseEvent.prototype.graphX=null;mxMouseEvent.prototype.graphY=null;mxMouseEvent.prototype.state=null;mxMouseEvent.prototype.sourceState=null;mxMouseEvent.prototype.getEvent=function(){return this.evt};mxMouseEvent.prototype.getSource=function(){return mxEvent.getSource(this.evt)};mxMouseEvent.prototype.isSource=function(a){return null!=a?mxUtils.isAncestorNode(a.node,this.getSource()):!1};mxMouseEvent.prototype.getX=function(){return mxEvent.getClientX(this.getEvent())};mxMouseEvent.prototype.getY=function(){return mxEvent.getClientY(this.getEvent())};mxMouseEvent.prototype.getGraphX=function(){return this.graphX};mxMouseEvent.prototype.getGraphY=function(){return this.graphY};@@ -442,7 +442,7 @@ mxShape.prototype.outline=!1;mxShape.prototype.visible=!0;mxShape.prototype.useSmxShape.prototype.getSvgScreenOffset=function(){return 1==mxUtils.mod(Math.max(1,Math.round((this.stencil&&"inherit"!=this.stencil.strokewidth?Number(this.stencil.strokewidth):this.strokewidth)*this.scale)),2)?.5:0};mxShape.prototype.create=function(a){return null!=a&&null!=a.ownerSVGElement?this.createSvg(a):this.createHtml(a)};mxShape.prototype.createSvg=function(){return document.createElementNS(mxConstants.NS_SVG,"g")};mxShape.prototype.createHtml=function(){var a=document.createElement("div");a.style.position="absolute";return a};mxShape.prototype.reconfigure=function(){this.redraw()};mxShape.prototype.redraw=function(){this.updateBoundsFromPoints();this.visible&&this.checkBounds()?(this.node.style.visibility="visible",this.clear(),"DIV"==this.node.nodeName?this.redrawHtmlShape():this.redrawShape()):(this.node.style.visibility="hidden",this.boundingBox=null)};mxShape.prototype.clear=function(){if(null!=this.node.ownerSVGElement)for(;null!=this.node.lastChild;)this.node.removeChild(this.node.lastChild);else this.node.style.cssText="position:absolute;"+(null!=this.cursor?"cursor:"+this.cursor+";":""),this.node.innerText=""};-mxShape.prototype.updateBoundsFromPoints=function(){var a=this.points;if(null!=a&&0<a.length&&null!=a[0]){this.bounds=new mxRectangle(Number(a[0].x),Number(a[0].y),this.scale,this.scale);for(var b=1;b<this.points.length;b++)null!=a[b]&&this.bounds.add(new mxRectangle(Number(a[b].x),Number(a[b].y),this.scale,this.scale))}};+mxShape.prototype.updateBoundsFromPoints=function(){var a=this.points;if(null!=a&&0<a.length&&null!=a[0]){this.bounds=new mxRectangle(Number(a[0].x),Number(a[0].y),this.scale,this.scale);for(var b=1;b<this.points.length;b++)null!=a[b]&&this.bounds.add(new mxRectangle(Number(a[b].x),Number(a[b].y),this.scale,this.scale))}};mxShape.prototype.styleChanged=function(a,b,c){};mxShape.prototype.getLabelBounds=function(a){var b=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),c=a;b!=mxConstants.DIRECTION_SOUTH&&b!=mxConstants.DIRECTION_NORTH&&null!=this.state&&null!=this.state.text&&this.state.text.isPaintBoundsInverted()&&(c=c.clone(),b=c.width,c.width=c.height,c.height=b);c=this.getLabelMargins(c);if(null!=c){var d="1"==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,!1),e="1"==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,!1);null!=this.state&&null!=this.state.text&&this.state.text.isPaintBoundsInverted()&&(b=c.x,c.x=c.height,c.height=c.width,c.width=c.y,c.y=b,b=d,d=e,e=b);return mxUtils.getDirectedBounds(a,c,this.style,d,e)}return a};mxShape.prototype.getLabelMargins=function(a){return null};mxShape.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&0<this.scale&&null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&0<this.bounds.width&&0<this.bounds.height};@@ -489,10 +489,10 @@ mxStencil.prototype.desc=null;mxStencil.prototype.constraints=null;mxStencil.promxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0];this.bgNode=this.desc.getElementsByTagName("background")[0];this.w0=Number(this.desc.getAttribute("w")||100);this.h0=Number(this.desc.getAttribute("h")||100);var a=this.desc.getAttribute("aspect");this.aspect=null!=a?a:"variable";a=this.desc.getAttribute("strokewidth");this.strokewidth=null!=a?a:"1"};mxStencil.prototype.parseConstraints=function(){var a=this.desc.getElementsByTagName("connections")[0];if(null!=a&&(a=mxUtils.getChildNodes(a),null!=a&&0<a.length)){this.constraints=[];for(var b=0;b<a.length;b++)this.constraints.push(this.parseConstraint(a[b]))}};mxStencil.prototype.parseConstraint=function(a){var b=Number(a.getAttribute("x")),c=Number(a.getAttribute("y")),d="1"==a.getAttribute("perimeter");a=a.getAttribute("name");return new mxConnectionConstraint(new mxPoint(b,c),d,a)};mxStencil.prototype.evaluateTextAttribute=function(a,b,c){b=this.evaluateAttribute(a,b,c);a=a.getAttribute("localized");if(mxStencil.defaultLocalized&&null==a||"1"==a)b=mxResources.get(b);return b};mxStencil.prototype.evaluateAttribute=function(a,b,c){b=a.getAttribute(b);null==b&&(a=mxUtils.getTextContent(a),null!=a&&mxStencil.allowEval&&(a=mxUtils.eval(a),"function"==typeof a&&(b=a(c))));return b};-mxStencil.prototype.drawShape=function(a,b,c,d,e,f,g){var k=a.states.slice(),l=mxUtils.getValue(b.style,mxConstants.STYLE_DIRECTION,null);l=this.computeAspect(b.style,c,d,e,f,l);var m=Math.min(l.width,l.height);m="inherit"==this.strokewidth?Number(mxUtils.getNumber(b.style,mxConstants.STYLE_STROKEWIDTH,1)):Number(this.strokewidth)*m;a.setStrokeWidth(m);null!=b.style&&"1"==mxUtils.getValue(b.style,mxConstants.STYLE_POINTER_EVENTS,"0")&&(a.setStrokeColor(mxConstants.NONE),a.rect(c,d,e,f),a.stroke(),-a.setStrokeColor(b.stroke));this.drawChildren(a,b,c,d,e,f,this.bgNode,l,!1,!0,g);this.drawChildren(a,b,c,d,e,f,this.fgNode,l,!0,!b.outline||null==b.style||0==mxUtils.getValue(b.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0),g);a.states.length!=k.length&&(a.states=k)};mxStencil.prototype.drawChildren=function(a,b,c,d,e,f,g,k,l,m,n){if(null!=g&&0<e&&0<f)for(c=g.firstChild;null!=c;)c.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(a,b,c,k,l,m,n),c=c.nextSibling};+mxStencil.prototype.drawShape=function(a,b,c,d,e,f,g){g=null!=g?g:null!=b&&null!=b.state?b.state.view.graph:null;var k=a.states.slice(),l=mxUtils.getValue(b.style,mxConstants.STYLE_DIRECTION,null);l=this.computeAspect(b.style,c,d,e,f,l);var m=Math.min(l.width,l.height);m="inherit"==this.strokewidth?Number(mxUtils.getNumber(b.style,mxConstants.STYLE_STROKEWIDTH,1)):Number(this.strokewidth)*m;a.setStrokeWidth(m);null!=b.style&&"1"==mxUtils.getValue(b.style,mxConstants.STYLE_POINTER_EVENTS,"0")&&(a.setStrokeColor(mxConstants.NONE),+a.rect(c,d,e,f),a.stroke(),a.setStrokeColor(b.stroke));this.drawChildren(a,b,c,d,e,f,this.bgNode,l,!1,!0,g);this.drawChildren(a,b,c,d,e,f,this.fgNode,l,!0,!b.outline||null==b.style||0==mxUtils.getValue(b.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0),g);a.states.length!=k.length&&(a.states=k)};mxStencil.prototype.drawChildren=function(a,b,c,d,e,f,g,k,l,m,n){if(null!=g&&0<e&&0<f)for(c=g.firstChild;null!=c;)c.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(a,b,c,k,l,m,n),c=c.nextSibling};mxStencil.prototype.computeAspect=function(a,b,c,d,e,f){a=b;b=d/this.w0;var g=e/this.h0;if(f=f==mxConstants.DIRECTION_NORTH||f==mxConstants.DIRECTION_SOUTH){g=d/this.h0;b=e/this.w0;var k=(d-e)/2;a+=k;c-=k}"fixed"==this.aspect&&(b=g=Math.min(b,g),f?(a+=(e-this.w0*b)/2,c+=(d-this.h0*g)/2):(a+=(d-this.w0*b)/2,c+=(e-this.h0*g)/2));return new mxRectangle(a,c,b,g)};-mxStencil.prototype.parseColor=function(a,b,c,d,e){"stroke"==d?d=b.stroke:"fill"==d?d=b.fill:"font"==d&&null!=b.style?d=mxUtils.getValue(b.style,mxConstants.STYLE_FONTCOLOR,"black"):null==b.style||mxUtils.isValidColor(d)||(a=mxUtils.getValue(b.style,d,mxConstants.NONE),"default"==a&&(a="fillcolor"==c.nodeName?e.shapeBackgroundColor:e.shapeForegroundColor),d=a);return d};+mxStencil.prototype.parseColor=function(a,b,c,d,e){"stroke"==d?d=b.stroke:"fill"==d?d=b.fill:"font"==d&&null!=b.style?d=mxUtils.getValue(b.style,mxConstants.STYLE_FONTCOLOR,"black"):null==b.style||mxUtils.isValidColor(d)||(a=mxUtils.getValue(b.style,d,mxConstants.NONE),"default"==a&&(a=null!=e?"fillcolor"==c.nodeName?e.shapeBackgroundColor:e.shapeForegroundColor:"#ffffff"),d=a);return d};mxStencil.prototype.drawNode=function(a,b,c,d,e,f,g){var k=c.nodeName,l=d.x,m=d.y,n=d.width,p=d.height,q=Math.min(n,p);if("save"==k)a.save();else if("restore"==k)a.restore();else if(f){if("path"==k){a.begin();q=!0;if("1"==c.getAttribute("rounded")){q=!1;for(var r=Number(c.getAttribute("arcSize")),t=0,u=[],x=c.firstChild;null!=x;){if(x.nodeType==mxConstants.NODETYPE_ELEMENT){var y=x.nodeName;if("move"==y||"line"==y)"move"!=y&&0!=u.length||u.push([]),u[u.length-1].push(new mxPoint(l+Number(x.getAttribute("x"))*n,m+Number(x.getAttribute("y"))*p)),t++;else{q=!0;break}}x=x.nextSibling}if(!q&&0<t)for(n=0;n<u.length;n++)p=!1,m=u[n][0],l=u[n][u[n].length-1],m.x==l.x&&m.y==l.y&&(u[n].pop(),p=!0),this.addPoints(a,u[n],!0,r,p);else q=!0}if(q)for(x=c.firstChild;null!=x;)x.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(a,b,x,d,e,f,g),x=x.nextSibling}else if("close"==k)a.close();else if("move"==k)a.moveTo(l+Number(c.getAttribute("x"))*n,m+Number(c.getAttribute("y"))*p);else if("line"==k)a.lineTo(l+Number(c.getAttribute("x"))*n,m+Number(c.getAttribute("y"))*p);else if("quad"==k)a.quadTo(l+Number(c.getAttribute("x1"))*n,m+Number(c.getAttribute("y1"))*p,l+Number(c.getAttribute("x2"))*n,m+Number(c.getAttribute("y2"))*p);else if("curve"==k)a.curveTo(l+Number(c.getAttribute("x1"))*n,m+Number(c.getAttribute("y1"))*p,l+Number(c.getAttribute("x2"))*n,m+Number(c.getAttribute("y2"))*p,l+Number(c.getAttribute("x3"))*n,m+Number(c.getAttribute("y3"))*p);else if("arc"==k)a.arcTo(Number(c.getAttribute("rx"))*n,Number(c.getAttribute("ry"))*@@ -1031,8 +1031,8 @@ this.initializeShape(a),this.createCellOverlays(a),this.installListeners(a),a.vinull!=a.shape.indicatorShape&&(a.shape.indicator=new a.shape.indicatorShape,a.shape.indicator.dialect=a.shape.dialect,a.shape.indicator.init(a.node),b=!0));null!=a.shape&&(this.createControl(a),b||this.isShapeInvalid(a,a.shape))&&(null!=a.absolutePoints?(a.shape.points=a.absolutePoints.slice(),a.shape.bounds=null):(a.shape.points=null,a.shape.bounds=new mxRectangle(a.x,a.y,a.width,a.height)),a.shape.scale=a.view.scale,(null==c||c)&&this.doRedrawShape(a),e=!0);return e};mxCellRenderer.prototype.doRedrawShape=function(a){a.shape.redraw()};mxCellRenderer.prototype.isShapeInvalid=function(a,b){return null==b.bounds||b.scale!=a.view.scale||null==a.absolutePoints&&!b.bounds.equals(a)||null!=a.absolutePoints&&!mxUtils.equalPoints(b.points,a.absolutePoints)};mxCellRenderer.prototype.destroy=function(a){null!=a.shape&&(null!=a.text&&(a.text.destroy(),a.text=null),null!=a.overlays&&(a.overlays.visit(function(b,c){c.destroy()}),a.overlays=null),null!=a.control&&(a.control.destroy(),a.control=null),a.shape.destroy(),a.shape=null)};-var mxEdgeStyle={EntityRelation:function(a,b,c,d,e){var f=a.view,g=f.graph;d=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*f.scale;var k=a.absolutePoints,l=k[0],m=k[k.length-1];k=!1;if(null!=b){var n=g.getCellGeometry(b.cell);n.relative?k=.5>=n.x:null!=c&&(k=(null!=m?m.x:c.x+c.width)<(null!=l?l.x:b.x))}if(null!=l)b=new mxCellState,b.x=l.x,b.y=l.y;else if(null!=b){var p=mxUtils.getPortConstraints(b,a,!0,mxConstants.DIRECTION_MASK_NONE);p!=mxConstants.DIRECTION_MASK_NONE&&-p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(k=p==mxConstants.DIRECTION_MASK_WEST)}else return;n=!0;null!=c&&(g=g.getCellGeometry(c.cell),g.relative?n=.5>=g.x:null!=b&&(n=(null!=l?l.x:b.x+b.width)<(null!=m?m.x:c.x)));null!=m?(c=new mxCellState,c.x=m.x,c.y=m.y):null!=c&&(p=mxUtils.getPortConstraints(c,a,!1,mxConstants.DIRECTION_MASK_NONE),p!=mxConstants.DIRECTION_MASK_NONE&&p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(n=p==mxConstants.DIRECTION_MASK_WEST));+var mxEdgeStyle={EntityRelation:function(a,b,c,d,e){var f=a.view,g=f.graph;d=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*f.scale;var k=a.absolutePoints,l=k[0],m=k[k.length-1];k=!1;if(null!=b){var n=g.getCellGeometry(b.cell);null!=n&&n.relative?k=.5>=n.x:null!=c&&(k=(null!=m?m.x:c.x+c.width)<(null!=l?l.x:b.x))}if(null!=l)b=new mxCellState,b.x=l.x,b.y=l.y;else if(null!=b){var p=mxUtils.getPortConstraints(b,a,!0,mxConstants.DIRECTION_MASK_NONE);p!=mxConstants.DIRECTION_MASK_NONE&&+p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(k=p==mxConstants.DIRECTION_MASK_WEST)}else return;n=!0;null!=c&&(g=g.getCellGeometry(c.cell),null!=g&&g.relative?n=.5>=g.x:null!=b&&(n=(null!=l?l.x:b.x+b.width)<(null!=m?m.x:c.x)));null!=m?(c=new mxCellState,c.x=m.x,c.y=m.y):null!=c&&(p=mxUtils.getPortConstraints(c,a,!1,mxConstants.DIRECTION_MASK_NONE),p!=mxConstants.DIRECTION_MASK_NONE&&p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(n=p==mxConstants.DIRECTION_MASK_WEST));null!=b&&null!=c&&(a=k?b.x:b.x+b.width,b=f.getRoutingCenterY(b),l=n?c.x:c.x+c.width,c=f.getRoutingCenterY(c),f=new mxPoint(a+(k?-d:d),b),g=new mxPoint(l+(n?-d:d),c),k==n?(d=k?Math.min(a,l)-d:Math.max(a,l)+d,e.push(new mxPoint(d,b)),e.push(new mxPoint(d,c))):(f.x<g.x==k?(d=b+(c-b)/2,e.push(f),e.push(new mxPoint(f.x,d)),e.push(new mxPoint(g.x,d))):e.push(f),e.push(g)))},Loop:function(a,b,c,d,e){c=a.absolutePoints;var f=c[c.length-1];if(null!=c[0]&&null!=f){if(null!=d&&0<d.length)for(b=0;b<d.length;b++)c=d[b],c=a.view.transformControlPoint(a,c),e.push(new mxPoint(c.x,c.y))}else if(null!=b){f=a.view;var g=f.graph;c=null!=d&&0<d.length?d[0]:null;null!=c&&(c=f.transformControlPoint(a,c),mxUtils.contains(b,c.x,c.y)&&(c=null));var k=d=0,l=0,m=0;g=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,g.gridSize)*f.scale;a=mxUtils.getValue(a.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST);a==mxConstants.DIRECTION_NORTH||a==mxConstants.DIRECTION_SOUTH?(d=f.getRoutingCenterX(b),k=g):(l=f.getRoutingCenterY(b),m=g);null==c||c.x<b.x||c.x>b.x+b.width?null!=c?(d=c.x,m=Math.max(Math.abs(l-c.y),m)):a==mxConstants.DIRECTION_NORTH?l=b.y-2*k:a==mxConstants.DIRECTION_SOUTH?l=b.y+b.height+2*k:d=a==mxConstants.DIRECTION_EAST?b.x-2*m:b.x+b.width+2*m:null!=c&&(d=f.getRoutingCenterX(b),k=Math.max(Math.abs(d-c.x),m),l=c.y,m=0);e.push(new mxPoint(d-k,l-m));e.push(new mxPoint(d+k,l+m))}},ElbowConnector:function(a,b,c,d,e){var f=null!=d&&0<d.length?d[0]:null,g=!1,k=!1;if(null!=b&&null!=c)if(null!=f){var l=Math.min(b.x,c.x),@@ -1099,8 +1099,8 @@ mxGraphView.prototype.stateValidated=function(a){var b=this.graph.getModel().isEmxGraphView.prototype.updateFixedTerminalPoints=function(a,b,c){this.updateFixedTerminalPoint(a,b,!0,this.graph.getConnectionConstraint(a,b,!0));this.updateFixedTerminalPoint(a,c,!1,this.graph.getConnectionConstraint(a,c,!1))};mxGraphView.prototype.updateFixedTerminalPoint=function(a,b,c,d){a.setAbsoluteTerminalPoint(this.getFixedTerminalPoint(a,b,c,d),c)};mxGraphView.prototype.getFixedTerminalPoint=function(a,b,c,d){var e=null;null!=d&&(e=this.graph.getConnectionPoint(b,d,!1));if(null==e&&null==b){b=this.scale;d=this.translate;var f=a.origin;e=this.graph.getCellGeometry(a.cell).getTerminalPoint(c);null!=e&&(e=new mxPoint(b*(d.x+e.x+f.x),b*(d.y+e.y+f.y)))}return e};mxGraphView.prototype.updateBoundsFromStencil=function(a){var b=null;if(null!=a&&null!=a.shape&&null!=a.shape.stencil&&"fixed"==a.shape.stencil.aspect){b=mxRectangle.fromRectangle(a);var c=a.shape.stencil.computeAspect(a.style,a.x,a.y,a.width,a.height);a.setRect(c.x,c.y,a.shape.stencil.w0*c.width,a.shape.stencil.h0*c.height)}return b};-mxGraphView.prototype.updatePoints=function(a,b,c,d){if(null!=a){var e=[];e.push(a.absolutePoints[0]);var f=this.getEdgeStyle(a,b,c,d);if(null!=f){c=this.getTerminalPort(a,c,!0);d=this.getTerminalPort(a,d,!1);var g=this.updateBoundsFromStencil(c),k=this.updateBoundsFromStencil(d);f(a,c,d,b,e);null!=g&&c.setRect(g.x,g.y,g.width,g.height);null!=k&&d.setRect(k.x,k.y,k.width,k.height)}else if(null!=b)for(f=0;f<b.length;f++)null!=b[f]&&(c=mxUtils.clone(b[f]),e.push(this.transformControlPoint(a,c)));b=-a.absolutePoints;e.push(b[b.length-1]);a.absolutePoints=e}};mxGraphView.prototype.transformControlPoint=function(a,b,c){return null!=a&&null!=b?(a=a.origin,c=c?1:this.scale,new mxPoint(c*(b.x+this.translate.x+a.x),c*(b.y+this.translate.y+a.y))):null};+mxGraphView.prototype.updatePoints=function(a,b,c,d){if(null!=a&&null!=a.absolutePoints&&0<a.absolutePoints.length){var e=[];e.push(a.absolutePoints[0]);var f=this.getEdgeStyle(a,b,c,d);if(null!=f){c=this.getTerminalPort(a,c,!0);d=this.getTerminalPort(a,d,!1);var g=this.updateBoundsFromStencil(c),k=this.updateBoundsFromStencil(d);f(a,c,d,b,e);null!=g&&c.setRect(g.x,g.y,g.width,g.height);null!=k&&d.setRect(k.x,k.y,k.width,k.height)}else if(null!=b)for(f=0;f<b.length;f++)null!=b[f]&&(c=mxUtils.clone(b[f]),+e.push(this.transformControlPoint(a,c)));b=a.absolutePoints;e.push(b[b.length-1]);a.absolutePoints=e}};mxGraphView.prototype.transformControlPoint=function(a,b,c){return null!=a&&null!=b?(a=a.origin,c=c?1:this.scale,new mxPoint(c*(b.x+this.translate.x+a.x),c*(b.y+this.translate.y+a.y))):null};mxGraphView.prototype.isLoopStyleEnabled=function(a,b,c,d){var e=this.graph.getConnectionConstraint(a,c,!0),f=this.graph.getConnectionConstraint(a,d,!1);return!(null==b||2>b.length)||mxUtils.getValue(a.style,mxConstants.STYLE_ORTHOGONAL_LOOP,!1)&&(null!=e&&null!=e.point||null!=f&&null!=f.point)?!1:null!=c&&c==d};mxGraphView.prototype.getEdgeStyle=function(a,b,c,d){a=this.isLoopStyleEnabled(a,b,c,d)?mxUtils.getValue(a.style,mxConstants.STYLE_LOOP,this.graph.defaultLoopStyle):mxUtils.getValue(a.style,mxConstants.STYLE_NOEDGESTYLE,!1)?null:a.style[mxConstants.STYLE_EDGE];"string"==typeof a&&(b=mxStyleRegistry.getValue(a),null==b&&this.isAllowEval()&&(b=mxUtils.eval(a)),a=b);return"function"==typeof a?a:null};mxGraphView.prototype.updateFloatingTerminalPoints=function(a,b,c){var d=a.absolutePoints,e=d[0];null==d[d.length-1]&&null!=c&&this.updateFloatingTerminalPoint(a,c,b,!1);null==e&&null!=b&&this.updateFloatingTerminalPoint(a,b,c,!0)};mxGraphView.prototype.updateFloatingTerminalPoint=function(a,b,c,d){a.setAbsoluteTerminalPoint(this.getFloatingTerminalPoint(a,b,c,d),d)};@@ -1188,7 +1188,8 @@ l),Math.round(f.y+q*f.height))]:[new mxPoint(Math.round(f.x+q*f.width),Math.rounmxGraph.prototype.getCurrentCellStyle=function(a,b){b=b?null:this.view.getState(a);return null!=b?b.style:this.getCellStyle(a)};mxGraph.prototype.getCellStyle=function(a,b){b=null!=b?b:!0;var c=this.model.getStyle(a),d=this.model.isEdge(a)?this.stylesheet.getDefaultEdgeStyle():this.stylesheet.getDefaultVertexStyle();null!=c&&0<c.length?d=this.stylesheet.getCellStyle(c,d,b):null!=d&&(d=mxUtils.clone(d));null==d?d={}:b&&(d=this.postProcessCellStyle(a,d));return d};mxGraph.prototype.postProcessCellStyle=function(a,b){if(null!=b){var c=b[mxConstants.STYLE_IMAGE];a=this.getImageFromBundles(c);null!=a?b[mxConstants.STYLE_IMAGE]=a:a=c;null!=a&&"function"===typeof a.substring&&"data:image/"==a.substring(0,11)&&("data:image/svg+xml,<"==a.substring(0,20)?a=a.substring(0,19)+encodeURIComponent(a.substring(19)):"data:image/svg+xml,%3C"!=a.substring(0,22)&&(c=a.indexOf(","),0<c&&";base64,"!=a.substring(c-7,c+1)&&(a=a.substring(0,c)+";base64,"+a.substring(c+1))),b[mxConstants.STYLE_IMAGE]=a)}return b};mxGraph.prototype.setCellStyle=function(a,b){b=b||this.getSelectionCells();if(null!=b){this.model.beginUpdate();try{for(var c=0;c<b.length;c++)this.model.setStyle(b[c],a)}finally{this.model.endUpdate()}}};mxGraph.prototype.toggleCellStyle=function(a,b,c){c=c||this.getSelectionCell();return this.toggleCellStyles(a,b,[c])};-mxGraph.prototype.toggleCellStyles=function(a,b,c){b=null!=b?b:!1;c=c||this.getEditableCells(this.getSelectionCells());var d=null;null!=c&&0<c.length&&(d=this.getCurrentCellStyle(c[0]),d=mxUtils.getValue(d,a,b)?0:1,this.setCellStyles(a,d,c));return d};mxGraph.prototype.setCellStyles=function(a,b,c){c=c||this.getEditableCells(this.getSelectionCells());mxUtils.setCellStyles(this.model,c,a,b)};mxGraph.prototype.toggleCellStyleFlags=function(a,b,c){this.setCellStyleFlags(a,b,null,c)};+mxGraph.prototype.toggleCellStyles=function(a,b,c){b=null!=b?b:!1;c=c||this.getEditableCells(this.getSelectionCells());var d=null;null!=c&&0<c.length&&(d=this.getCurrentCellStyle(c[0]),d=mxUtils.getValue(d,a,b)?0:1,this.setCellStyles(a,d,c));return d};+mxGraph.prototype.setCellStyles=function(a,b,c){c=c||this.getEditableCells(this.getSelectionCells());this.model.beginUpdate();try{mxUtils.setCellStyles(this.model,c,a,b);for(var d=0;d<c.length;d++){var e=this.view.getState(c[d]);null!=e&&null!=e.shape&&e.shape.styleChanged(a,b,e)}}finally{this.model.endUpdate()}};mxGraph.prototype.toggleCellStyleFlags=function(a,b,c){this.setCellStyleFlags(a,b,null,c)};mxGraph.prototype.setCellStyleFlags=function(a,b,c,d){d=d||this.getEditableCells(this.getSelectionCells());null!=d&&0<d.length&&(null==c&&(c=this.getCurrentCellStyle(d[0]),c=(parseInt(c[a]||0)&b)!=b),mxUtils.setCellStyleFlags(this.model,d,a,b,c))};mxGraph.prototype.getOriginForCell=function(a){a=this.model.getParent(a);for(var b=new mxPoint;null!=a;){var c=this.getCellGeometry(a);null==c||c.relative||(b.x+=c.x,b.y+=c.y);a=this.model.getParent(a)}return b};mxGraph.prototype.alignCells=function(a,b,c){null==b&&(b=this.getMovableCells(this.getSelectionCells()));if(null!=b&&1<b.length){if(null==c)for(var d=0;d<b.length;d++){var e=this.getOriginForCell(b[d]),f=this.getCellGeometry(b[d]);if(!this.model.isEdge(b[d])&&null!=f&&!f.relative)if(null==c)if(a==mxConstants.ALIGN_CENTER){c=e.x+f.x+f.width/2;break}else if(a==mxConstants.ALIGN_RIGHT)c=e.x+f.x+f.width;else if(a==mxConstants.ALIGN_TOP)c=e.y+f.y;else if(a==mxConstants.ALIGN_MIDDLE){c=e.y+f.y+f.height/2;break}else c=a==mxConstants.ALIGN_BOTTOM?e.y+f.y+f.height:e.x+f.x;else c=a==mxConstants.ALIGN_RIGHT?Math.max(c,e.x+f.x+f.width):a==mxConstants.ALIGN_TOP?Math.min(c,e.y+f.y):a==mxConstants.ALIGN_BOTTOM?Math.max(c,e.y+f.y+f.height):Math.min(c,e.x+f.x)}if(null!=c){b=mxUtils.sortCells(b);this.model.beginUpdate();try{for(d=0;d<b.length;d++)e=this.getOriginForCell(b[d]),f=this.getCellGeometry(b[d]),this.model.isEdge(b[d])||null==f||f.relative||(f=f.clone(),a==mxConstants.ALIGN_CENTER?f.x=c-e.x-f.width/@@ -1851,7 +1852,7 @@ mxObjectCodec.prototype.afterEncode=function(a,b,c){return c};mxObjectCodec.protmxObjectCodec.prototype.decodeAttributes=function(a,b,c){b=b.attributes;if(null!=b)for(var d=0;d<b.length;d++)this.decodeAttribute(a,b[d],c)};mxObjectCodec.prototype.isIgnoredAttribute=function(a,b,c){return"as"==b.nodeName||"id"==b.nodeName||"function"===typeof c[b.nodeName]};mxObjectCodec.prototype.decodeAttribute=function(a,b,c){if(!this.isIgnoredAttribute(a,b,c)){var d=b.nodeName;b=this.convertAttributeFromXml(a,b,c);var e=this.getFieldName(d);if(this.isReference(c,e,b,!1)){a=a.getObject(b);if(null==a){mxLog.warn("mxObjectCodec.decode: No object for "+this.getName()+"."+d+"="+b);return}b=a}this.isExcluded(c,d,b,!1)||(c[d]=b)}};mxObjectCodec.prototype.decodeChildren=function(a,b,c){for(b=b.firstChild;null!=b;){var d=b.nextSibling;b.nodeType!=mxConstants.NODETYPE_ELEMENT||this.processInclude(a,b,c)||this.decodeChild(a,b,c);b=d}};-mxObjectCodec.prototype.decodeChild=function(a,b,c){var d=this.getFieldName(b.getAttribute("as"));if(null==d||!this.isExcluded(c,d,b,!1)){var e=this.getFieldTemplate(c,d,b);"add"==b.nodeName?(a=b.getAttribute("value"),null==a&&mxObjectCodec.allowEval&&(a=mxUtils.eval(mxUtils.getTextContent(b)))):a=a.decode(b,e);try{this.addObjectValue(c,d,a,e)}catch(f){throw Error(f.message+" for "+b.nodeName);}}};+mxObjectCodec.prototype.decodeChild=function(a,b,c){var d=this.getFieldName(b.getAttribute("as"));if(null==d||!this.isExcluded(c,d,b,!1)){var e=this.getFieldTemplate(c,d,b);"add"==b.nodeName?(a=b.getAttribute("value"),null==a&&mxObjectCodec.allowEval&&(a=mxUtils.eval(mxUtils.getTextContent(b)))):a=a.decode(b,e);try{this.addObjectValue(c,d,a,e)}catch(f){throw Error(f.message+" "+b.nodeName+(null!=d?" as "+d:""));}}};mxObjectCodec.prototype.getFieldTemplate=function(a,b,c){a=a[b];a instanceof Array&&0<a.length&&(a=null);return a};mxObjectCodec.prototype.addObjectValue=function(a,b,c,d){if(null!=c&&c!=d)if(null!=b&&0<b.length)a[b]=c;else if(a.constructor===Array)a.push(c);else throw Error("Could not add object");};mxObjectCodec.prototype.processInclude=function(a,b,c){if("include"==b.nodeName){b=b.getAttribute("name");if(null!=b)try{var d=mxUtils.load(b).getDocumentElement();null!=d&&a.decode(d,c)}catch(e){}return!0}return!1};mxObjectCodec.prototype.beforeDecode=function(a,b,c){return b};mxObjectCodec.prototype.afterDecode=function(a,b,c){return c};mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]);a.isCellCodec=function(){return!0};a.isNumericAttribute=function(b,c,d){return"value"!==c.nodeName&&mxObjectCodec.prototype.isNumericAttribute.apply(this,arguments)};a.isExcluded=function(b,c,d,e){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||e&&"value"==c&&mxUtils.isNode(d)};a.afterEncode=function(b,c,d){if(null!=c.value&&mxUtils.isNode(c.value)){var e=@@ -1873,8 +1874,8 @@ var mxStylesheetCodec=mxCodecRegistry.register(function(){var a=new mxObjectCodefunction(b,c){b=typeof c;"function"==b?c=mxStyleRegistry.getName(c):"object"==b&&(c=null);return c};a.decode=function(b,c,d){d=d||new this.template.constructor;var e=c.getAttribute("id");null!=e&&(b.objects[e]=d);for(c=c.firstChild;null!=c;){if(!this.processInclude(b,c,d)&&"add"==c.nodeName&&(e=c.getAttribute("as"),null!=e)){var f=c.getAttribute("extend"),g=null!=f?mxUtils.clone(d.styles[f]):null;null==g&&(null!=f&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+f+" not found to extend"),g={});for(f=c.firstChild;null!=f;){if(f.nodeType==mxConstants.NODETYPE_ELEMENT){var k=f.getAttribute("as");if("add"==f.nodeName){var l=mxUtils.getTextContent(f);null!=l&&0<l.length&&mxStylesheetCodec.allowEval?l=mxUtils.eval(l):(l=f.getAttribute("value"),mxUtils.isNumeric(l)&&(l=parseFloat(l)));null!=l&&(g[k]=l)}else"remove"==f.nodeName&&delete g[k]}f=f.nextSibling}d.putCellStyle(e,g)}c=c.nextSibling}return d};return a}());mxStylesheetCodec.allowEval=!1;var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(b){return b.raw=b};$jscomp.createTemplateTagFirstArgWithRaw=function(b,e){b.raw=e;return b};$jscomp.arrayIteratorImpl=function(b){var e=0;return function(){return e<b.length?{done:!1,value:b[e++]}:{done:!0}}};$jscomp.arrayIterator=function(b){return{next:$jscomp.arrayIteratorImpl(b)}};$jscomp.makeIterator=function(b){var e="undefined"!=typeof Symbol&&Symbol.iterator&&b[Symbol.iterator];return e?e.call(b):$jscomp.arrayIterator(b)};-Editor=function(b,e,g,m,v){mxEventSource.call(this);this.chromeless=null!=b?b:this.chromeless;this.initStencilRegistry();this.graph=m||this.createGraph(e,g);this.editable=null!=v?v:!b;this.undoManager=this.createUndoManager();this.status="";this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[Editor.pageCounter])+".xml"};this.getFilename=function(){return this.filename};this.setStatus=function(p,A){this.status=p;this.statusFunction=A;this.fireEvent(new mxEventObject("statusChanged"))};-this.getStatus=function(){return this.status};this.graphChangeListener=function(p,A){p=null!=A?A.getProperty("edit"):null;null!=p&&p.ignoreEdit||this.setModified(!0)};this.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.graphChangeListener.apply(this,arguments)}));this.graph.resetViewOnRootChange=!1;this.init()};mxConstants.POINTS=1;mxConstants.MILLIMETERS=2;mxConstants.INCHES=3;mxConstants.METERS=4;mxConstants.PIXELS_PER_MM=3.937;mxConstants.PIXELS_PER_INCH=100;+Editor=function(b,e,g,m,v){mxEventSource.call(this);this.chromeless=null!=b?b:this.chromeless;this.initStencilRegistry();this.graph=m||this.createGraph(e,g);this.editable=null!=v?v:!b;this.undoManager=this.createUndoManager();this.status="";this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[Editor.pageCounter])+".xml"};this.getFilename=function(){return this.filename};this.setStatus=function(n,A){this.status=n;this.statusFunction=A;this.fireEvent(new mxEventObject("statusChanged"))};+this.getStatus=function(){return this.status};this.graphChangeListener=function(n,A){n=null!=A?A.getProperty("edit"):null;null!=n&&n.ignoreEdit||this.setModified(!0)};this.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.graphChangeListener.apply(this,arguments)}));this.graph.resetViewOnRootChange=!1;this.init()};mxConstants.POINTS=1;mxConstants.MILLIMETERS=2;mxConstants.INCHES=3;mxConstants.METERS=4;mxConstants.PIXELS_PER_MM=3.937;mxConstants.PIXELS_PER_INCH=100;Editor.pageCounter=0;(function(){try{for(var b=window;null!=b.opener&&"undefined"!==typeof b.opener.Editor&&!isNaN(b.opener.Editor.pageCounter)&&b.opener!=b;)b=b.opener;null!=b&&(b.Editor.pageCounter++,Editor.pageCounter=b.Editor.pageCounter)}catch(e){}})();Editor.defaultHtmlFont='-apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", system-ui, ui-sans-serif, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"';Editor.useLocalStorage="undefined"!=typeof Storage&&mxClient.IS_IOS;Editor.smallScreenWidth=1024;Editor.helpImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDc4LTI0MHEyMSAwIDM1LjUtMTQuNVQ1MjgtMjkwcTAtMjEtMTQuNS0zNS41VDQ3OC0zNDBxLTIxIDAtMzUuNSAxNC41VDQyOC0yOTBxMCAyMSAxNC41IDM1LjVUNDc4LTI0MFptLTM2LTE1NGg3NHEwLTMzIDcuNS01MnQ0Mi41LTUycTI2LTI2IDQxLTQ5LjV0MTUtNTYuNXEwLTU2LTQxLTg2dC05Ny0zMHEtNTcgMC05Mi41IDMwVDM0Mi02MThsNjYgMjZxNS0xOCAyMi41LTM5dDUzLjUtMjFxMzIgMCA0OCAxNy41dDE2IDM4LjVxMCAyMC0xMiAzNy41VDUwNi01MjZxLTQ0IDM5LTU0IDU5dC0xMCA3M1ptMzggMzE0cS04MyAwLTE1Ni0zMS41VDE5Ny0xOTdxLTU0LTU0LTg1LjUtMTI3VDgwLTQ4MHEwLTgzIDMxLjUtMTU2VDE5Ny03NjNxNTQtNTQgMTI3LTg1LjVUNDgwLTg4MHE4MyAwIDE1NiAzMS41VDc2My03NjNxNTQgNTQgODUuNSAxMjdUODgwLTQ4MHEwIDgzLTMxLjUgMTU2VDc2My0xOTdxLTU0IDU0LTEyNyA4NS41VDQ4MC04MFptMC04MHExMzQgMCAyMjctOTN0OTMtMjI3cTAtMTM0LTkzLTIyN3QtMjI3LTkzcS0xMzQgMC0yMjcgOTN0LTkzIDIyN3EwIDEzNCA5MyAyMjd0MjI3IDkzWm0wLTMyMFoiLz48L3N2Zz4=";Editor.menuImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTI0MHYtODBoNzIwdjgwSDEyMFptMC0yMDB2LTgwaDcyMHY4MEgxMjBabTAtMjAwdi04MGg3MjB2ODBIMTIwWiIvPjwvc3ZnPg==";Editor.moveImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI4cHgiIGhlaWdodD0iMjhweCI+PGc+PC9nPjxnPjxnPjxnPjxwYXRoIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIuNCwyLjQpc2NhbGUoMC44KXJvdGF0ZSg0NSwxMiwxMikiIHN0cm9rZT0iIzI5YjZmMiIgZmlsbD0iIzI5YjZmMiIgZD0iTTE1LDNsMi4zLDIuM2wtMi44OSwyLjg3bDEuNDIsMS40MkwxOC43LDYuN0wyMSw5VjNIMTV6IE0zLDlsMi4zLTIuM2wyLjg3LDIuODlsMS40Mi0xLjQyTDYuNyw1LjNMOSwzSDNWOXogTTksMjEgbC0yLjMtMi4zbDIuODktMi44N2wtMS40Mi0xLjQyTDUuMywxNy4zTDMsMTV2Nkg5eiBNMjEsMTVsLTIuMywyLjNsLTIuODctMi44OWwtMS40MiwxLjQybDIuODksMi44N0wxNSwyMWg2VjE1eiIvPjwvZz48L2c+PC9nPjwvc3ZnPgo=";@@ -1944,9 +1945,9 @@ Editor.roughFillStyles=[{val:"auto",dispName:"Auto"},{val:"hachure",dispName:"HaEditor.fillStyles=[{val:"auto",dispName:"Auto"},{val:"hatch",dispName:"Hatch"},{val:"solid",dispName:"Solid"},{val:"dots",dispName:"Dots"},{val:"cross-hatch",dispName:"Cross Hatch"},{val:"dashed",dispName:"Dashed"},{val:"zigzag-line",dispName:"ZigZag Line"}];Editor.themes=[];Editor.ctrlKey=mxClient.IS_MAC?"Cmd":"Ctrl";Editor.hintOffset=20;Editor.shapePickerHoverDelay=300;Editor.fitWindowBorders=null;Editor.popupsAllowed=null!=window.urlParams?"1"!=urlParams.noDevice:!0;Editor.simpleLabels=!1;Editor.enableNativeCipboard=window==window.top&&!mxClient.IS_FF&&null!=navigator.clipboard;Editor.sketchMode=!1;Editor.darkMode=!1;Editor.currentTheme=uiTheme;Editor.darkColor="#121212";Editor.darkColorVar="--ge-dark-color";Editor.fontSizeUnit="px";Editor.transitionDelay=.1;Editor.pageSizeUnit=mxConstants.INCHES;Editor.isDarkMode=function(){return Editor.darkMode};Editor.isPngDataUrl=function(b){return null!=b&&"data:image/png;"==b.substring(0,15)};Editor.isPngData=function(b){return 8<b.length&&137==b.charCodeAt(0)&&80==b.charCodeAt(1)&&78==b.charCodeAt(2)&&71==b.charCodeAt(3)&&13==b.charCodeAt(4)&&10==b.charCodeAt(5)&&26==b.charCodeAt(6)&&10==b.charCodeAt(7)};Editor.convertHtmlToText=function(b){if(null!=b){var e=document.createElement("div");e.innerHTML=Graph.sanitizeHtml(b);return mxUtils.extractTextWithWhitespace(e.childNodes)}return null};-Editor.extractGraphModelFromPng=function(b){var e=null;try{var g=b.substring(b.indexOf(",")+1),m=window.atob&&!mxClient.IS_SF?atob(g):Base64.decode(g,!0);EditorUi.parsePng(m,mxUtils.bind(this,function(v,p,A){v=m.substring(v+8,v+8+A);"zTXt"==p?(A=v.indexOf(String.fromCharCode(0)),"mxGraphModel"==v.substring(0,A)&&(v=pako.inflateRaw(Graph.stringToArrayBuffer(v.substring(A+2)),{to:"string"}).replace(/\+/g," "),null!=v&&0<v.length&&(e=v))):"tEXt"==p&&(v=v.split(String.fromCharCode(0)),1<v.length&&("mxGraphModel"==-v[0]||"mxfile"==v[0])&&(e=v[1]));if(null!=e||"IDAT"==p)return!0}))}catch(v){}null!=e&&"%"==e.charAt(0)&&(e=decodeURIComponent(e));null!=e&&"%"==e.charAt(0)&&(e=decodeURIComponent(e));return e};-Editor.soundex=function(b){if(null==b||0==b.length)return"";var e=[],g=1;e[0]=b[0].toUpperCase();for(var m=1,v=b.length;m<v;m++){var p=b[m].toUpperCase().charCodeAt(0)-65;if(0<=p&&25>=p&&"0"!="01230120022455012603010202"[p]&&("01230120022455012603010202"[p]!=e[g-1]&&(e[g]="01230120022455012603010202"[p],g++),3<g))break}if(3>=g)for(;3>=g;)e[g]="0",g++;return e.join("")};+Editor.extractGraphModelFromPng=function(b){var e=null;try{var g=b.substring(b.indexOf(",")+1),m=window.atob&&!mxClient.IS_SF?atob(g):Base64.decode(g,!0);EditorUi.parsePng(m,mxUtils.bind(this,function(v,n,A){v=m.substring(v+8,v+8+A);"zTXt"==n?(A=v.indexOf(String.fromCharCode(0)),"mxGraphModel"==v.substring(0,A)&&(v=pako.inflateRaw(Graph.stringToArrayBuffer(v.substring(A+2)),{to:"string"}).replace(/\+/g," "),null!=v&&0<v.length&&(e=v))):"tEXt"==n&&(v=v.split(String.fromCharCode(0)),1<v.length&&("mxGraphModel"==+v[0]||"mxfile"==v[0])&&(e=v[1]));if(null!=e||"IDAT"==n)return!0}))}catch(v){}null!=e&&"%"==e.charAt(0)&&(e=decodeURIComponent(e));null!=e&&"%"==e.charAt(0)&&(e=decodeURIComponent(e));return e};+Editor.soundex=function(b){if(null==b||0==b.length)return"";var e=[],g=1;e[0]=b[0].toUpperCase();for(var m=1,v=b.length;m<v;m++){var n=b[m].toUpperCase().charCodeAt(0)-65;if(0<=n&&25>=n&&"0"!="01230120022455012603010202"[n]&&("01230120022455012603010202"[n]!=e[g-1]&&(e[g]="01230120022455012603010202"[n],g++),3<g))break}if(3>=g)for(;3>=g;)e[g]="0",g++;return e.join("")};Editor.selectFilename=function(b){var e=b.value.lastIndexOf(".");if(0<e){var g=b.value.substring(e+1);"drawio"!=g&&0<=mxUtils.indexOf(["png","svg","html","xml","pdf"],g)&&(g=b.value.lastIndexOf(".drawio.",e),0<g&&(e=g))}e=0<e?e:b.value.length;Editor.selectSubstring(b,0,e)};Editor.selectSubstring=function(b,e,g){b.focus();"undefined"!=typeof b.selectionStart?(b.selectionStart=e,b.selectionEnd=g):document.selection&&document.selection.createRange&&(b.select(),b=document.selection.createRange(),b.collapse(!0),b.moveEnd("character",g),b.moveStart("character",e),b.select())};Editor.toUnit=function(b,e){return e==mxConstants.INCHES?Math.round(100*b/mxConstants.PIXELS_PER_INCH)/100:e==mxConstants.MILLIMETERS?Math.round(100*b/mxConstants.PIXELS_PER_MM)/100:e==mxConstants.METERS?Math.round(1E3*b/(1E3*mxConstants.PIXELS_PER_MM))/1E3:Math.round(b)};@@ -1966,79 +1967,79 @@ Editor.prototype.getGraphXml=function(b){if(null!=b?b:1){var e=new mxCodec(mxUtithis.graph.isGridEnabled()?"1":"0");b.setAttribute("gridSize",this.graph.gridSize);b.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0");b.setAttribute("tooltips",this.graph.tooltipHandler.isEnabled()?"1":"0");b.setAttribute("connect",this.graph.connectionHandler.isEnabled()?"1":"0");b.setAttribute("arrows",this.graph.connectionArrowsEnabled?"1":"0");b.setAttribute("fold",this.graph.foldingEnabled?"1":"0");b.setAttribute("page",this.graph.pageVisible?"1":"0");b.setAttribute("pageScale",this.graph.pageScale);b.setAttribute("pageWidth",this.graph.pageFormat.width);b.setAttribute("pageHeight",this.graph.pageFormat.height);null!=this.graph.background&&b.setAttribute("background",this.graph.background);return b};Editor.prototype.updateGraphComponents=function(){var b=this.graph;null!=b.container&&(b.view.validateBackground(),b.container.style.overflow=b.scrollbars?"auto":this.defaultGraphOverflow,this.fireEvent(new mxEventObject("updateGraphComponents")))};Editor.prototype.setModified=function(b){this.modified=b};Editor.prototype.setFilename=function(b){this.filename=b};-Editor.prototype.createUndoManager=function(){var b=this.graph,e=new mxUndoManager;this.undoListener=function(m,v){e.undoableEditHappened(v.getProperty("edit"))};var g=mxUtils.bind(this,function(m,v){this.undoListener.apply(this,arguments)});b.getModel().addListener(mxEvent.UNDO,g);b.getView().addListener(mxEvent.UNDO,g);g=function(m,v){m=v.getProperty("edit").changes;m=b.getSelectionCellsForChanges(m);v=!1;if(0<m.length){for(var p=[],A=0;A<m.length;A++)null!=b.view.getState(m[A])&&(p.push(m[A]),-v||(b.scrollCellToVisible(m[A]),v=!0));b.setSelectionCells(p)}};e.addListener(mxEvent.UNDO,g);e.addListener(mxEvent.REDO,g);return e};Editor.prototype.initStencilRegistry=function(){};Editor.prototype.destroy=function(){null!=this.graph&&(this.graph.destroy(),this.graph=null)};OpenFile=function(b){this.consumer=this.producer=null;this.done=b;this.args=null};OpenFile.prototype.setConsumer=function(b){this.consumer=b;this.execute()};OpenFile.prototype.setData=function(){this.args=arguments;this.execute()};+Editor.prototype.createUndoManager=function(){var b=this.graph,e=new mxUndoManager;this.undoListener=function(m,v){e.undoableEditHappened(v.getProperty("edit"))};var g=mxUtils.bind(this,function(m,v){this.undoListener.apply(this,arguments)});b.getModel().addListener(mxEvent.UNDO,g);b.getView().addListener(mxEvent.UNDO,g);g=function(m,v){m=v.getProperty("edit").changes;m=b.getSelectionCellsForChanges(m);v=!1;if(0<m.length){for(var n=[],A=0;A<m.length;A++)null!=b.view.getState(m[A])&&(n.push(m[A]),+v||(b.scrollCellToVisible(m[A]),v=!0));b.setSelectionCells(n)}};e.addListener(mxEvent.UNDO,g);e.addListener(mxEvent.REDO,g);return e};Editor.prototype.initStencilRegistry=function(){};Editor.prototype.destroy=function(){null!=this.graph&&(this.graph.destroy(),this.graph=null)};OpenFile=function(b){this.consumer=this.producer=null;this.done=b;this.args=null};OpenFile.prototype.setConsumer=function(b){this.consumer=b;this.execute()};OpenFile.prototype.setData=function(){this.args=arguments;this.execute()};OpenFile.prototype.error=function(b){this.cancel(!0);mxUtils.alert(b)};OpenFile.prototype.execute=function(){null!=this.consumer&&null!=this.args&&(this.cancel(!1),this.consumer.apply(this,this.args))};OpenFile.prototype.cancel=function(b){null!=this.done&&this.done(null!=b?b:!0)};-function Dialog(b,e,g,m,v,p,A,H,S,F,K){this.editorUi=b;null==this.bg&&(this.bg=b.createDiv("geBackground"));v&&document.body.appendChild(this.bg);v=b.createDiv(S?"geTransDialog":"geDialog");v.style.width=g+60+"px";v.style.height=m+60+"px";"1"!=urlParams.embedInline||Editor.inlineFullscreen||null==b.embedViewport||(v.style.left=b.embedViewport.x+b.embedViewport.width/2+"px",v.style.top=b.embedViewport.y+b.embedViewport.height/2+"px");v.appendChild(e);document.body.appendChild(v);if(p&&(e=document.createElement("div"),+function Dialog(b,e,g,m,v,n,A,G,S,F,K){this.editorUi=b;null==this.bg&&(this.bg=b.createDiv("geBackground"));v&&document.body.appendChild(this.bg);v=b.createDiv(S?"geTransDialog":"geDialog");v.style.width=g+60+"px";v.style.height=m+60+"px";"1"!=urlParams.embedInline||Editor.inlineFullscreen||null==b.embedViewport||(v.style.left=b.embedViewport.x+b.embedViewport.width/2+"px",v.style.top=b.embedViewport.y+b.embedViewport.height/2+"px");v.appendChild(e);document.body.appendChild(v);if(n&&(e=document.createElement("div"),e.className="geButton",e.setAttribute("title",mxResources.get("close")),e.style.backgroundImage="url("+Editor.crossImage+")",e.style.position="absolute",e.style.top="0px",e.style.right="0px",mxEvent.addListener(e,"click",mxUtils.bind(this,function(){b.hideDialog(!0)})),v.appendChild(e),!K)){var c=!1;mxEvent.addGestureListeners(this.bg,mxUtils.bind(this,function(f){c=!0}),null,mxUtils.bind(this,function(f){c&&(b.hideDialog(!0),c=!1)}))}this.onDialogClose=A;this.container=v;b.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.prototype.noColorImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkEzRDlBMUUwODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkEzRDlBMUUxODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTNEOUExREU4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTNEOUExREY4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5xh3fmAAAABlBMVEX////MzMw46qqDAAAAGElEQVR42mJggAJGKGAYIIGBth8KAAIMAEUQAIElnLuQAAAAAElFTkSuQmCC";Dialog.prototype.closeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJAQMAAADaX5RTAAAABlBMVEV7mr3///+wksspAAAAAnRSTlP/AOW3MEoAAAAdSURBVAgdY9jXwCDDwNDRwHCwgeExmASygSL7GgB12QiqNHZZIwAAAABJRU5ErkJggg==";Dialog.prototype.clearImage="data:image/gif;base64,R0lGODlhDQAKAIABAMDAwP///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OUIzOEM1NzI4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OUIzOEM1NzM4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5QjM4QzU3MDg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo5QjM4QzU3MTg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAEAAAEALAAAAAANAAoAAAIXTGCJebD9jEOTqRlttXdrB32PJ2ncyRQAOw==";Dialog.prototype.getDocumentSize=function(){return mxUtils.getDocumentSize()};Dialog.prototype.getPosition=function(b,e){return new mxPoint(b,e)};Dialog.prototype.close=function(b,e){if(null!=this.onDialogClose){if(0==this.onDialogClose(b,e))return!1;this.onDialogClose=null}null!=this.dialogImg&&null!=this.dialogImg.parentNode&&(this.dialogImg.parentNode.removeChild(this.dialogImg),this.dialogImg=null);null!=this.bg&&null!=this.bg.parentNode&&this.bg.parentNode.removeChild(this.bg);null!=this.editorUi.embedViewport?this.editorUi.removeListener(this.resizeListener):mxEvent.removeListener(window,"resize",this.resizeListener);null!=this.container.parentNode&&this.container.parentNode.removeChild(this.container)};-var ErrorDialog=function(b,e,g,m,v,p,A,H,S,F,K){S=null!=S?S:!0;var c=document.createElement("div");c.style.textAlign="center";if(null!=e){var f=document.createElement("div");f.style.padding="0px";f.style.margin="0px";f.style.fontSize="18px";f.style.paddingBottom="16px";f.style.marginBottom="10px";f.style.borderBottom="1px solid #c0c0c0";f.style.color="gray";f.style.whiteSpace="nowrap";f.style.textOverflow="ellipsis";f.style.overflow="hidden";mxUtils.write(f,e);f.setAttribute("title",e);c.appendChild(f)}e=-document.createElement("div");e.style.lineHeight="1.2em";e.style.padding="6px";"string"===typeof g&&(g=g.replace(/\n/g,"<br/>"));e.innerHTML=Graph.sanitizeHtml(g);c.appendChild(e);g=document.createElement("div");g.style.marginTop="12px";g.style.textAlign="center";null!=p&&(e=mxUtils.button(mxResources.get("tryAgain"),function(){b.hideDialog();p()}),e.className="geBtn",g.appendChild(e),g.style.textAlign="center");null!=F&&(F=mxUtils.button(F,function(){null!=K&&K()}),F.className="geBtn",g.appendChild(F));-var l=mxUtils.button(m,function(){S&&b.hideDialog();null!=v&&v()});l.className="geBtn";g.appendChild(l);null!=A&&(m=mxUtils.button(A,function(){S&&b.hideDialog();null!=H&&H()}),m.className="geBtn gePrimaryBtn",g.appendChild(m));this.init=function(){l.focus()};c.appendChild(g);this.container=c},PrintDialog=function(b,e,g,m){this.create(b,e,g,m)};-PrintDialog.prototype.create=function(b){function e(l){var t=A.checked||F.checked,q=parseInt(c.value)/100;isNaN(q)&&(q=1,c.value="100%");mxClient.IS_SF&&(q*=.75);var D=g.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,G=1/g.pageScale;if(t){var N=A.checked?1:parseInt(K.value);isNaN(N)||(G=mxUtils.getScaleForPageCount(N,g,D))}var L=N=0;D=mxRectangle.fromRectangle(D);D.width=Math.ceil(D.width*q);D.height=Math.ceil(D.height*q);G*=q;!t&&g.pageVisible?(q=g.getPageLayout(),N-=q.x*D.width,L-=q.y*D.height):-t=!0;t=PrintDialog.createPrintPreview(g,G,D,0,N,L,t);t.open();l&&PrintDialog.printPreview(t)}var g=b.editor.graph,m=document.createElement("table");m.style.width="100%";m.style.height="100%";var v=document.createElement("tbody");var p=document.createElement("tr");var A=document.createElement("input");A.setAttribute("type","checkbox");var H=document.createElement("td");H.setAttribute("colspan","2");H.style.fontSize="10pt";H.appendChild(A);var S=document.createElement("span");mxUtils.write(S," "+mxResources.get("fitPage"));-H.appendChild(S);mxEvent.addListener(S,"click",function(l){A.checked=!A.checked;F.checked=!A.checked;mxEvent.consume(l)});mxEvent.addListener(A,"change",function(){F.checked=!A.checked});p.appendChild(H);v.appendChild(p);p=p.cloneNode(!1);var F=document.createElement("input");F.setAttribute("type","checkbox");H=document.createElement("td");H.style.fontSize="10pt";H.appendChild(F);S=document.createElement("span");mxUtils.write(S," "+mxResources.get("posterPrint")+":");H.appendChild(S);mxEvent.addListener(S,-"click",function(l){F.checked=!F.checked;A.checked=!F.checked;mxEvent.consume(l)});p.appendChild(H);var K=document.createElement("input");K.setAttribute("value","1");K.setAttribute("type","number");K.setAttribute("min","1");K.setAttribute("size","4");K.setAttribute("disabled","disabled");K.style.width="50px";H=document.createElement("td");H.style.fontSize="10pt";H.appendChild(K);mxUtils.write(H," "+mxResources.get("pages")+" (max)");p.appendChild(H);v.appendChild(p);mxEvent.addListener(F,"change",-function(){F.checked?K.removeAttribute("disabled"):K.setAttribute("disabled","disabled");A.checked=!F.checked});p=p.cloneNode(!1);H=document.createElement("td");mxUtils.write(H,mxResources.get("pageScale")+":");p.appendChild(H);H=document.createElement("td");var c=document.createElement("input");c.setAttribute("value","100 %");c.setAttribute("size","5");c.style.width="50px";H.appendChild(c);p.appendChild(H);v.appendChild(p);p=document.createElement("tr");H=document.createElement("td");H.colSpan=2;-H.style.paddingTop="20px";H.setAttribute("align","right");S=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});S.className="geBtn";b.editor.cancelFirst&&H.appendChild(S);if(PrintDialog.previewEnabled){var f=mxUtils.button(mxResources.get("preview"),function(){b.hideDialog();e(!1)});f.className="geBtn";H.appendChild(f)}f=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){b.hideDialog();e(!0)});f.className="geBtn gePrimaryBtn";H.appendChild(f);b.editor.cancelFirst||-H.appendChild(S);p.appendChild(H);v.appendChild(p);m.appendChild(v);this.container=m};PrintDialog.printPreview=function(b){try{null!=b.wnd&&window.setTimeout(function(){b.wnd.focus();b.wnd.print();b.wnd.close()},500)}catch(e){}};-PrintDialog.createPrintPreview=function(b,e,g,m,v,p,A){e=new mxPrintPreview(b,e,g,m,v,p);e.title=mxResources.get("preview");e.addPageCss=!mxClient.IS_SF;e.printBackgroundImage=!0;e.autoOrigin=A;A=b.background;if(null==A||""==A||A==mxConstants.NONE)A="#ffffff";e.backgroundColor=A;var H=e.isTextLabel;e.isTextLabel=function(F){return"geHint"==!F.className&&H.apply(this,arguments)};var S=e.getLinkForCellState;e.getLinkForCellState=function(F){return b.getAbsoluteUrl(S.apply(this,arguments))};return e};+var ErrorDialog=function(b,e,g,m,v,n,A,G,S,F,K){S=null!=S?S:!0;var c=document.createElement("div");c.style.textAlign="center";if(null!=e){var f=document.createElement("div");f.style.padding="0px";f.style.margin="0px";f.style.fontSize="18px";f.style.paddingBottom="16px";f.style.marginBottom="10px";f.style.borderBottom="1px solid #c0c0c0";f.style.color="gray";f.style.whiteSpace="nowrap";f.style.textOverflow="ellipsis";f.style.overflow="hidden";mxUtils.write(f,e);f.setAttribute("title",e);c.appendChild(f)}e=+document.createElement("div");e.style.lineHeight="1.2em";e.style.padding="6px";"string"===typeof g&&(g=g.replace(/\n/g,"<br/>"));e.innerHTML=Graph.sanitizeHtml(g);c.appendChild(e);g=document.createElement("div");g.style.marginTop="12px";g.style.textAlign="center";null!=n&&(e=mxUtils.button(mxResources.get("tryAgain"),function(){b.hideDialog();n()}),e.className="geBtn",g.appendChild(e),g.style.textAlign="center");null!=F&&(F=mxUtils.button(F,function(){null!=K&&K()}),F.className="geBtn",g.appendChild(F));+var l=mxUtils.button(m,function(){S&&b.hideDialog();null!=v&&v()});l.className="geBtn";g.appendChild(l);null!=A&&(m=mxUtils.button(A,function(){S&&b.hideDialog();null!=G&&G()}),m.className="geBtn gePrimaryBtn",g.appendChild(m));this.init=function(){l.focus()};c.appendChild(g);this.container=c},PrintDialog=function(b,e,g,m){this.create(b,e,g,m)};+PrintDialog.prototype.create=function(b){function e(l){var t=A.checked||F.checked,q=parseInt(c.value)/100;isNaN(q)&&(q=1,c.value="100%");mxClient.IS_SF&&(q*=.75);var D=g.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,H=1/g.pageScale;if(t){var N=A.checked?1:parseInt(K.value);isNaN(N)||(H=mxUtils.getScaleForPageCount(N,g,D))}var L=N=0;D=mxRectangle.fromRectangle(D);D.width=Math.ceil(D.width*q);D.height=Math.ceil(D.height*q);H*=q;!t&&g.pageVisible?(q=g.getPageLayout(),N-=q.x*D.width,L-=q.y*D.height):+t=!0;t=PrintDialog.createPrintPreview(g,H,D,0,N,L,t);t.open();l&&PrintDialog.printPreview(t)}var g=b.editor.graph,m=document.createElement("table");m.style.width="100%";m.style.height="100%";var v=document.createElement("tbody");var n=document.createElement("tr");var A=document.createElement("input");A.setAttribute("type","checkbox");var G=document.createElement("td");G.setAttribute("colspan","2");G.style.fontSize="10pt";G.appendChild(A);var S=document.createElement("span");mxUtils.write(S," "+mxResources.get("fitPage"));+G.appendChild(S);mxEvent.addListener(S,"click",function(l){A.checked=!A.checked;F.checked=!A.checked;mxEvent.consume(l)});mxEvent.addListener(A,"change",function(){F.checked=!A.checked});n.appendChild(G);v.appendChild(n);n=n.cloneNode(!1);var F=document.createElement("input");F.setAttribute("type","checkbox");G=document.createElement("td");G.style.fontSize="10pt";G.appendChild(F);S=document.createElement("span");mxUtils.write(S," "+mxResources.get("posterPrint")+":");G.appendChild(S);mxEvent.addListener(S,+"click",function(l){F.checked=!F.checked;A.checked=!F.checked;mxEvent.consume(l)});n.appendChild(G);var K=document.createElement("input");K.setAttribute("value","1");K.setAttribute("type","number");K.setAttribute("min","1");K.setAttribute("size","4");K.setAttribute("disabled","disabled");K.style.width="50px";G=document.createElement("td");G.style.fontSize="10pt";G.appendChild(K);mxUtils.write(G," "+mxResources.get("pages")+" (max)");n.appendChild(G);v.appendChild(n);mxEvent.addListener(F,"change",+function(){F.checked?K.removeAttribute("disabled"):K.setAttribute("disabled","disabled");A.checked=!F.checked});n=n.cloneNode(!1);G=document.createElement("td");mxUtils.write(G,mxResources.get("pageScale")+":");n.appendChild(G);G=document.createElement("td");var c=document.createElement("input");c.setAttribute("value","100 %");c.setAttribute("size","5");c.style.width="50px";G.appendChild(c);n.appendChild(G);v.appendChild(n);n=document.createElement("tr");G=document.createElement("td");G.colSpan=2;+G.style.paddingTop="20px";G.setAttribute("align","right");S=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});S.className="geBtn";b.editor.cancelFirst&&G.appendChild(S);if(PrintDialog.previewEnabled){var f=mxUtils.button(mxResources.get("preview"),function(){b.hideDialog();e(!1)});f.className="geBtn";G.appendChild(f)}f=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){b.hideDialog();e(!0)});f.className="geBtn gePrimaryBtn";G.appendChild(f);b.editor.cancelFirst||+G.appendChild(S);n.appendChild(G);v.appendChild(n);m.appendChild(v);this.container=m};PrintDialog.printPreview=function(b){try{null!=b.wnd&&window.setTimeout(function(){b.wnd.focus();b.wnd.print();b.wnd.close()},500)}catch(e){}};+PrintDialog.createPrintPreview=function(b,e,g,m,v,n,A){e=new mxPrintPreview(b,e,g,m,v,n);e.title=mxResources.get("preview");e.addPageCss=!mxClient.IS_SF;e.printBackgroundImage=!0;e.autoOrigin=A;A=b.background;if(null==A||""==A||A==mxConstants.NONE)A="#ffffff";e.backgroundColor=A;var G=e.isTextLabel;e.isTextLabel=function(F){return"geHint"==!F.className&&G.apply(this,arguments)};var S=e.getLinkForCellState;e.getLinkForCellState=function(F){return b.getAbsoluteUrl(S.apply(this,arguments))};return e};PrintDialog.previewEnabled=!0;var PageSetupDialog=function(b){function e(){var q=c;null!=q&&null!=q.originalSrc&&(q=b.createImageForPageLink(q.originalSrc,null));null!=q&&null!=q.src?(K.style.backgroundImage="url("+q.src+")",K.style.display="inline-block"):(K.style.backgroundImage="",K.style.display="none");K.style.backgroundColor="";null!=f&&f!=mxConstants.NONE&&(K.style.backgroundColor=f,K.style.display="inline-block")}var g=b.editor.graph,m=document.createElement("table");m.style.width="100%";m.style.height="100%";var v=document.createElement("tbody");-var p=document.createElement("tr");var A=document.createElement("td");A.style.verticalAlign="top";A.style.fontSize="10pt";mxUtils.write(A,mxResources.get("paperSize")+":");p.appendChild(A);A=document.createElement("td");A.style.verticalAlign="top";A.style.fontSize="10pt";var H=PageSetupDialog.addPageFormatPanel(A,"pagesetupdialog",g.pageFormat);p.appendChild(A);v.appendChild(p);p=document.createElement("tr");A=document.createElement("td");mxUtils.write(A,mxResources.get("gridSize")+":");p.appendChild(A);-A=document.createElement("td");A.style.whiteSpace="nowrap";var S=document.createElement("input");S.setAttribute("type","number");S.setAttribute("min","0");S.style.width="40px";S.style.marginLeft="6px";S.value=g.getGridSize();A.appendChild(S);mxEvent.addListener(S,"change",function(){var q=parseInt(S.value);S.value=Math.max(1,isNaN(q)?g.getGridSize():q)});p.appendChild(A);v.appendChild(p);p=document.createElement("tr");A=document.createElement("td");mxUtils.write(A,mxResources.get("background")+":");-p.appendChild(A);A=document.createElement("td");var F=document.createElement("button");F.className="geBtn";F.style.margin="0px";mxUtils.write(F,mxResources.get("change")+"...");var K=document.createElement("div");K.style.display="inline-block";K.style.verticalAlign="middle";K.style.backgroundPosition="center center";K.style.backgroundRepeat="no-repeat";K.style.backgroundSize="contain";K.style.border="1px solid lightGray";K.style.borderRadius="4px";K.style.marginRight="14px";K.style.height="32px";-K.style.width="64px";K.style.cursor="pointer";K.style.padding="4px";var c=g.backgroundImage,f=g.background,l=g.shadowVisible,t=function(q){b.showBackgroundImageDialog(function(D,G,N,L){G||(null!=D&&null!=D.src&&Graph.isPageLink(D.src)&&(D={originalSrc:D.src}),c=D,l=L);f=N;e()},c,f,!0);mxEvent.consume(q)};mxEvent.addListener(F,"click",t);mxEvent.addListener(K,"click",t);e();A.appendChild(K);A.appendChild(F);p.appendChild(A);v.appendChild(p);p=document.createElement("tr");A=document.createElement("td");-A.colSpan=2;A.style.paddingTop="16px";A.setAttribute("align","right");F=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});F.className="geBtn";b.editor.cancelFirst&&A.appendChild(F);t=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();var q=parseInt(S.value);isNaN(q)||g.gridSize===q||g.setGridSize(q);q=new ChangePageSetup(b,f,c,H.get());q.ignoreColor=g.background==f;q.ignoreImage=(null!=g.backgroundImage?g.backgroundImage.src:null)===(null!=c?c.src:null);null!=l&&-(q.shadowVisible=l);g.pageFormat.width==q.previousFormat.width&&g.pageFormat.height==q.previousFormat.height&&q.ignoreColor&&q.ignoreImage&&q.shadowVisible==g.shadowVisible||g.model.execute(q)});t.className="geBtn gePrimaryBtn";A.appendChild(t);b.editor.cancelFirst||A.appendChild(F);p.appendChild(A);v.appendChild(p);m.appendChild(v);this.container=m};-PageSetupDialog.addPageFormatPanel=function(b,e,g,m){e="format-"+e;var v=document.createElement("input");v.setAttribute("name",e);v.setAttribute("type","radio");v.setAttribute("value","portrait");var p=document.createElement("input");p.setAttribute("name",e);p.setAttribute("type","radio");p.setAttribute("value","landscape");var A=document.createElement("select");A.style.position="relative";A.style.marginBottom="4px";A.style.borderRadius="4px";A.style.borderWidth="1px";A.style.borderStyle="solid";-A.style.boxSizing="border-box";A.style.padding="2px";A.style.width="210px";var H=document.createElement("div");H.style.whiteSpace="nowrap";H.style.marginLeft="4px";H.style.width="210px";H.style.height="24px";v.style.marginRight="6px";H.appendChild(v);e=document.createElement("span");e.style.maxWidth="100px";mxUtils.write(e,mxResources.get("portrait"));H.appendChild(e);p.style.marginLeft="10px";p.style.marginRight="6px";H.appendChild(p);var S=document.createElement("span");S.style.width="100px";mxUtils.write(S,-mxResources.get("landscape"));H.appendChild(S);var F=document.createElement("div");F.style.whiteSpace="nowrap";F.style.marginLeft="4px";F.style.fontSize="12px";F.style.width="210px";F.style.height="24px";var K=document.createElement("input");K.setAttribute("size","7");K.setAttribute("title",mxResources.get("width"));K.style.textAlign="right";F.appendChild(K);mxUtils.write(F," x ");var c=document.createElement("input");c.setAttribute("size","7");c.setAttribute("title",mxResources.get("height"));c.style.textAlign=+var n=document.createElement("tr");var A=document.createElement("td");A.style.verticalAlign="top";A.style.fontSize="10pt";mxUtils.write(A,mxResources.get("paperSize")+":");n.appendChild(A);A=document.createElement("td");A.style.verticalAlign="top";A.style.fontSize="10pt";var G=PageSetupDialog.addPageFormatPanel(A,"pagesetupdialog",g.pageFormat);n.appendChild(A);v.appendChild(n);n=document.createElement("tr");A=document.createElement("td");mxUtils.write(A,mxResources.get("gridSize")+":");n.appendChild(A);+A=document.createElement("td");A.style.whiteSpace="nowrap";var S=document.createElement("input");S.setAttribute("type","number");S.setAttribute("min","0");S.style.width="40px";S.style.marginLeft="6px";S.value=g.getGridSize();A.appendChild(S);mxEvent.addListener(S,"change",function(){var q=parseInt(S.value);S.value=Math.max(1,isNaN(q)?g.getGridSize():q)});n.appendChild(A);v.appendChild(n);n=document.createElement("tr");A=document.createElement("td");mxUtils.write(A,mxResources.get("background")+":");+n.appendChild(A);A=document.createElement("td");var F=document.createElement("button");F.className="geBtn";F.style.margin="0px";mxUtils.write(F,mxResources.get("change")+"...");var K=document.createElement("div");K.style.display="inline-block";K.style.verticalAlign="middle";K.style.backgroundPosition="center center";K.style.backgroundRepeat="no-repeat";K.style.backgroundSize="contain";K.style.border="1px solid lightGray";K.style.borderRadius="4px";K.style.marginRight="14px";K.style.height="32px";+K.style.width="64px";K.style.cursor="pointer";K.style.padding="4px";var c=g.backgroundImage,f=g.background,l=g.shadowVisible,t=function(q){b.showBackgroundImageDialog(function(D,H,N,L){H||(null!=D&&null!=D.src&&Graph.isPageLink(D.src)&&(D={originalSrc:D.src}),c=D,l=L);f=N;e()},c,f,!0);mxEvent.consume(q)};mxEvent.addListener(F,"click",t);mxEvent.addListener(K,"click",t);e();A.appendChild(K);A.appendChild(F);n.appendChild(A);v.appendChild(n);n=document.createElement("tr");A=document.createElement("td");+A.colSpan=2;A.style.paddingTop="16px";A.setAttribute("align","right");F=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});F.className="geBtn";b.editor.cancelFirst&&A.appendChild(F);t=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();var q=parseInt(S.value);isNaN(q)||g.gridSize===q||g.setGridSize(q);q=new ChangePageSetup(b,f,c,G.get());q.ignoreColor=g.background==f;q.ignoreImage=(null!=g.backgroundImage?g.backgroundImage.src:null)===(null!=c?c.src:null);null!=l&&+(q.shadowVisible=l);g.pageFormat.width==q.previousFormat.width&&g.pageFormat.height==q.previousFormat.height&&q.ignoreColor&&q.ignoreImage&&q.shadowVisible==g.shadowVisible||g.model.execute(q)});t.className="geBtn gePrimaryBtn";A.appendChild(t);b.editor.cancelFirst||A.appendChild(F);n.appendChild(A);v.appendChild(n);m.appendChild(v);this.container=m};+PageSetupDialog.addPageFormatPanel=function(b,e,g,m){e="format-"+e;var v=document.createElement("input");v.setAttribute("name",e);v.setAttribute("type","radio");v.setAttribute("value","portrait");var n=document.createElement("input");n.setAttribute("name",e);n.setAttribute("type","radio");n.setAttribute("value","landscape");var A=document.createElement("select");A.style.position="relative";A.style.marginBottom="4px";A.style.borderRadius="4px";A.style.borderWidth="1px";A.style.borderStyle="solid";+A.style.boxSizing="border-box";A.style.padding="2px";A.style.width="210px";var G=document.createElement("div");G.style.whiteSpace="nowrap";G.style.marginLeft="4px";G.style.width="210px";G.style.height="24px";v.style.marginRight="6px";G.appendChild(v);e=document.createElement("span");e.style.maxWidth="100px";mxUtils.write(e,mxResources.get("portrait"));G.appendChild(e);n.style.marginLeft="10px";n.style.marginRight="6px";G.appendChild(n);var S=document.createElement("span");S.style.width="100px";mxUtils.write(S,+mxResources.get("landscape"));G.appendChild(S);var F=document.createElement("div");F.style.whiteSpace="nowrap";F.style.marginLeft="4px";F.style.fontSize="12px";F.style.width="210px";F.style.height="24px";var K=document.createElement("input");K.setAttribute("size","7");K.setAttribute("title",mxResources.get("width"));K.style.textAlign="right";F.appendChild(K);mxUtils.write(F," x ");var c=document.createElement("input");c.setAttribute("size","7");c.setAttribute("title",mxResources.get("height"));c.style.textAlign="right";F.appendChild(c);var f=document.createElement("select");f.style.marginLeft="4px";f.style.maxWidth="78px";f.style.width="78px";for(var l=[{label:mxResources.get("points"),unit:mxConstants.POINTS},{label:mxResources.get("inches"),unit:mxConstants.INCHES},{label:mxResources.get("millimeters"),unit:mxConstants.MILLIMETERS}],t=0;t<l.length;t++){var q=document.createElement("option");q.setAttribute("value",l[t].unit);mxUtils.write(q,l[t].label);f.appendChild(q)}f.value=Editor.pageSizeUnit;F.appendChild(f);-H.style.display="none";F.style.display="none";var D={},G=PageSetupDialog.getFormats();for(t=0;t<G.length;t++)l=G[t],D[l.key]=l,q=document.createElement("option"),q.setAttribute("value",l.key),mxUtils.write(q,l.title),A.appendChild(q);var N=function(){A.value="custom";for(var J=0;J<G.length;J++){var Y=G[J];null!=Y.format&&("a4"==Y.key?826==g.width?(g=mxRectangle.fromRectangle(g),g.width=827):826==g.height&&(g=mxRectangle.fromRectangle(g),g.height=827):"a5"==Y.key&&(584==g.width?(g=mxRectangle.fromRectangle(g),-g.width=583):584==g.height&&(g=mxRectangle.fromRectangle(g),g.height=583)),g.width==Y.format.width&&g.height==Y.format.height?(A.value=Y.key,v.setAttribute("checked","checked"),v.defaultChecked=!0,v.checked=!0,p.removeAttribute("checked"),p.defaultChecked=!1,p.checked=!1,detected=!0):g.width==Y.format.height&&g.height==Y.format.width&&(A.value=Y.key,v.removeAttribute("checked"),v.defaultChecked=!1,v.checked=!1,p.setAttribute("checked","checked"),p.defaultChecked=!0,detected=p.checked=!0))}"custom"==-A.value?(K.value=Editor.toUnit(g.width,f.value),c.value=Editor.toUnit(g.height,f.value),v.setAttribute("checked","checked"),A.value="custom",H.style.display="none",F.style.display=""):(H.style.display="",F.style.display="none")};N();b.appendChild(A);mxUtils.br(b);b.appendChild(H);b.appendChild(F);var L=function(J,Y){J=D[A.value];null!=J.format?(K.value=Editor.toUnit(p.checked?J.format.height:J.format.width,f.value),c.value=Editor.toUnit(p.checked?J.format.width:J.format.height,f.value),F.style.display=-"none",H.style.display=""):(H.style.display="none",F.style.display="");J=parseFloat(K.value);if(isNaN(J)||0>=J)K.value=Editor.toUnit(g.width,f.value);J=parseFloat(c.value);if(isNaN(J)||0>=J)c.value=Editor.toUnit(g.height,f.value);J=new mxRectangle(0,0,Math.floor(Editor.fromUnit(parseFloat(K.value),f.value)),Math.floor(Editor.fromUnit(parseFloat(c.value),f.value)));Y||J.width==g.width&&J.height==g.height||(g=J,null!=m&&m(g))};mxEvent.addListener(e,"click",function(J){v.checked=!0;L(J);mxEvent.consume(J)});-mxEvent.addListener(S,"click",function(J){p.checked=!0;L(J);mxEvent.consume(J)});mxEvent.addListener(K,"blur",L);mxEvent.addListener(K,"click",L);mxEvent.addListener(c,"blur",L);mxEvent.addListener(c,"click",L);mxEvent.addListener(p,"change",L);mxEvent.addListener(v,"change",L);mxEvent.addListener(A,"change",function(J){L(J,"custom"==A.value);mxEvent.consume(J)});mxEvent.addListener(f,"change",function(J){K.value=Editor.toUnit(Editor.fromUnit(K.value,Editor.pageSizeUnit),f.value);c.value=Editor.toUnit(Editor.fromUnit(c.value,+G.style.display="none";F.style.display="none";var D={},H=PageSetupDialog.getFormats();for(t=0;t<H.length;t++)l=H[t],D[l.key]=l,q=document.createElement("option"),q.setAttribute("value",l.key),mxUtils.write(q,l.title),A.appendChild(q);var N=function(){A.value="custom";for(var J=0;J<H.length;J++){var Y=H[J];null!=Y.format&&("a4"==Y.key?826==g.width?(g=mxRectangle.fromRectangle(g),g.width=827):826==g.height&&(g=mxRectangle.fromRectangle(g),g.height=827):"a5"==Y.key&&(584==g.width?(g=mxRectangle.fromRectangle(g),+g.width=583):584==g.height&&(g=mxRectangle.fromRectangle(g),g.height=583)),g.width==Y.format.width&&g.height==Y.format.height?(A.value=Y.key,v.setAttribute("checked","checked"),v.defaultChecked=!0,v.checked=!0,n.removeAttribute("checked"),n.defaultChecked=!1,n.checked=!1,detected=!0):g.width==Y.format.height&&g.height==Y.format.width&&(A.value=Y.key,v.removeAttribute("checked"),v.defaultChecked=!1,v.checked=!1,n.setAttribute("checked","checked"),n.defaultChecked=!0,detected=n.checked=!0))}"custom"==+A.value?(K.value=Editor.toUnit(g.width,f.value),c.value=Editor.toUnit(g.height,f.value),v.setAttribute("checked","checked"),A.value="custom",G.style.display="none",F.style.display=""):(G.style.display="",F.style.display="none")};N();b.appendChild(A);mxUtils.br(b);b.appendChild(G);b.appendChild(F);var L=function(J,Y){J=D[A.value];null!=J.format?(K.value=Editor.toUnit(n.checked?J.format.height:J.format.width,f.value),c.value=Editor.toUnit(n.checked?J.format.width:J.format.height,f.value),F.style.display=+"none",G.style.display=""):(G.style.display="none",F.style.display="");J=parseFloat(K.value);if(isNaN(J)||0>=J)K.value=Editor.toUnit(g.width,f.value);J=parseFloat(c.value);if(isNaN(J)||0>=J)c.value=Editor.toUnit(g.height,f.value);J=new mxRectangle(0,0,Math.floor(Editor.fromUnit(parseFloat(K.value),f.value)),Math.floor(Editor.fromUnit(parseFloat(c.value),f.value)));Y||J.width==g.width&&J.height==g.height||(g=J,null!=m&&m(g))};mxEvent.addListener(e,"click",function(J){v.checked=!0;L(J);mxEvent.consume(J)});+mxEvent.addListener(S,"click",function(J){n.checked=!0;L(J);mxEvent.consume(J)});mxEvent.addListener(K,"blur",L);mxEvent.addListener(K,"click",L);mxEvent.addListener(c,"blur",L);mxEvent.addListener(c,"click",L);mxEvent.addListener(n,"change",L);mxEvent.addListener(v,"change",L);mxEvent.addListener(A,"change",function(J){L(J,"custom"==A.value);mxEvent.consume(J)});mxEvent.addListener(f,"change",function(J){K.value=Editor.toUnit(Editor.fromUnit(K.value,Editor.pageSizeUnit),f.value);c.value=Editor.toUnit(Editor.fromUnit(c.value,Editor.pageSizeUnit),f.value);Editor.pageSizeUnit=f.value;L(J,!0);mxEvent.consume(J)});L(null,!0);return{set:function(J){g=J;N(null,null,!0)},get:function(){return g},widthInput:K,heightInput:c}};PageSetupDialog.getFormats=function(){return[{key:"letter",title:'US-Letter (8,5" x 11")',format:mxConstants.PAGE_FORMAT_LETTER_PORTRAIT},{key:"legal",title:'US-Legal (8,5" x 14")',format:new mxRectangle(0,0,850,1400)},{key:"tabloid",title:'US-Tabloid (11" x 17")',format:new mxRectangle(0,0,1100,1700)},{key:"executive",title:'US-Executive (7" x 10")',format:new mxRectangle(0,0,700,1E3)},{key:"a0",title:"A0 (841 mm x 1189 mm)",format:new mxRectangle(0,0,3300,4681)},{key:"a1",title:"A1 (594 mm x 841 mm)",format:new mxRectangle(0,0,2339,3300)},{key:"a2",title:"A2 (420 mm x 594 mm)",format:new mxRectangle(0,0,1654,2336)},{key:"a3",title:"A3 (297 mm x 420 mm)",format:new mxRectangle(0,0,1169,1654)},{key:"a4",title:"A4 (210 mm x 297 mm)",format:mxConstants.PAGE_FORMAT_A4_PORTRAIT},{key:"a5",title:"A5 (148 mm x 210 mm)",format:new mxRectangle(0,0,583,827)},{key:"a6",title:"A6 (105 mm x 148 mm)",format:new mxRectangle(0,0,413,583)},{key:"a7",title:"A7 (74 mm x 105 mm)",format:new mxRectangle(0,0,291,413)},{key:"b4",title:"B4 (250 mm x 353 mm)",format:new mxRectangle(0,0,980,1390)},{key:"b5",title:"B5 (176 mm x 250 mm)",format:new mxRectangle(0,0,690,980)},{key:"16-9",title:"16:9 (1600 x 900)",format:new mxRectangle(0,0,900,1600)},{key:"16-10",title:"16:10 (1920 x 1200)",format:new mxRectangle(0,0,1200,1920)},{key:"4-3",title:"4:3 (1600 x 1200)",format:new mxRectangle(0,0,1200,1600)},{key:"custom",title:mxResources.get("custom"),format:null}]};-var FilenameDialog=function(b,e,g,m,v,p,A,H,S,F,K){S=null!=S?S:!0;var c=document.createElement("div"),f=document.createElement("div");f.style.width="100%";f.style.display="grid";f.style.gap="5px 8px";f.style.gridAutoColumns="auto 1fr";f.style.boxSizing="border-box";f.style.padding="3px";var l=document.createElement("div");l.style.display="inline-flex";l.style.alignItems="center";l.style.justifyContent="flex-end";l.style.minWidth="0";var t=document.createElement("div");t.style.display="inline-block";-t.style.textOverflow="ellipsis";t.style.whiteSpace="nowrap";t.style.overflow="hidden";t.style.fontSize="10pt";t.style.padding="2px 0";t.setAttribute("title",v||mxResources.get("filename"));mxUtils.write(t,(v||mxResources.get("filename"))+":");l.appendChild(t);f.appendChild(l);var q=document.createElement("input");q.setAttribute("value",e||"");q.style.flexGrow="1";var D=mxUtils.button(g,function(){if(null==p||p(q.value))S&&b.hideDialog(),m(q.value)});D.className="geBtn gePrimaryBtn";this.init=function(){if(null!=-v||null==A)if(null!=K?Editor.selectFilename(q):(q.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?q.select():document.execCommand("selectAll",!1,null)),Graph.fileSupport){var G=f.parentNode;if(null!=G){var N=null;mxEvent.addListener(G,"dragleave",function(L){null!=N&&(N.style.backgroundColor="",N=null);L.stopPropagation();L.preventDefault()});mxEvent.addListener(G,"dragover",mxUtils.bind(this,function(L){null==N&&(!mxClient.IS_IE||10<document.documentMode)&&(N=q,N.style.backgroundColor=-"#ebf2f9");L.stopPropagation();L.preventDefault()}));mxEvent.addListener(G,"drop",mxUtils.bind(this,function(L){null!=N&&(N.style.backgroundColor="",N=null);0<=mxUtils.indexOf(L.dataTransfer.types,"text/uri-list")&&(q.value=decodeURIComponent(L.dataTransfer.getData("text/uri-list")),D.click());L.stopPropagation();L.preventDefault()}))}}};l=document.createElement("div");l.style.display="inline-flex";l.style.alignItems="center";l.style.gap="4px";l.style.whiteSpace="nowrap";l.appendChild(q);f.appendChild(l);+var FilenameDialog=function(b,e,g,m,v,n,A,G,S,F,K){S=null!=S?S:!0;var c=document.createElement("div"),f=document.createElement("div");f.style.width="100%";f.style.display="grid";f.style.gap="5px 8px";f.style.gridAutoColumns="auto 1fr";f.style.boxSizing="border-box";f.style.padding="3px";var l=document.createElement("div");l.style.display="inline-flex";l.style.alignItems="center";l.style.justifyContent="flex-end";l.style.minWidth="0";var t=document.createElement("div");t.style.display="inline-block";+t.style.textOverflow="ellipsis";t.style.whiteSpace="nowrap";t.style.overflow="hidden";t.style.fontSize="10pt";t.style.padding="2px 0";t.setAttribute("title",v||mxResources.get("filename"));mxUtils.write(t,(v||mxResources.get("filename"))+":");l.appendChild(t);f.appendChild(l);var q=document.createElement("input");q.setAttribute("value",e||"");q.style.flexGrow="1";var D=mxUtils.button(g,function(){if(null==n||n(q.value))S&&b.hideDialog(),m(q.value)});D.className="geBtn gePrimaryBtn";this.init=function(){if(null!=+v||null==A)if(null!=K?Editor.selectFilename(q):(q.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?q.select():document.execCommand("selectAll",!1,null)),Graph.fileSupport){var H=f.parentNode;if(null!=H){var N=null;mxEvent.addListener(H,"dragleave",function(L){null!=N&&(N.style.backgroundColor="",N=null);L.stopPropagation();L.preventDefault()});mxEvent.addListener(H,"dragover",mxUtils.bind(this,function(L){null==N&&(!mxClient.IS_IE||10<document.documentMode)&&(N=q,N.style.backgroundColor=+"#ebf2f9");L.stopPropagation();L.preventDefault()}));mxEvent.addListener(H,"drop",mxUtils.bind(this,function(L){null!=N&&(N.style.backgroundColor="",N=null);0<=mxUtils.indexOf(L.dataTransfer.types,"text/uri-list")&&(q.value=decodeURIComponent(L.dataTransfer.getData("text/uri-list")),D.click());L.stopPropagation();L.preventDefault()}))}}};l=document.createElement("div");l.style.display="inline-flex";l.style.alignItems="center";l.style.gap="4px";l.style.whiteSpace="nowrap";l.appendChild(q);f.appendChild(l);null==v&&null!=A||null==K||null==b.editor.diagramFileTypes||(l=document.createElement("div"),l.style.display="inline-flex",l.style.alignItems="center",l.style.textOverflow="ellipsis",l.style.justifyContent="flex-end",l.style.fontSize="10pt",mxUtils.write(l,mxResources.get("type")+":"),f.appendChild(l),l=document.createElement("div"),l.style.display="inline-flex",l.style.alignItems="center",l.style.whiteSpace="nowrap",f.appendChild(l),e=FilenameDialog.createFileTypes(b,q,b.editor.diagramFileTypes),-e.style.width="100%",l.appendChild(e));null!=A&&f.appendChild(A);row=document.createElement("div");row.style.gridColumn="1 / span 2";row.style.paddingTop=null!=K?"6px":"14px";row.style.whiteSpace="nowrap";row.style.display="inline-flex";row.style.alignItems="center";row.style.justifyContent="flex-end";row.setAttribute("align","right");l=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=F&&F()});l.className="geBtn";null==H||b.isOffline()||row.appendChild(b.createHelpIcon(H));-b.editor.cancelFirst&&row.appendChild(l);mxEvent.addListener(q,"keypress",function(G){13==G.keyCode&&D.click()});row.appendChild(D);b.editor.cancelFirst||row.appendChild(l);f.appendChild(row);c.appendChild(f);this.container=c};FilenameDialog.filenameHelpLink=null;-FilenameDialog.createFileTypes=function(b,e,g){var m=document.createElement("select");for(b=0;b<g.length;b++){var v=document.createElement("option");v.setAttribute("value",b);mxUtils.write(v,mxResources.get(g[b].description)+" (."+g[b].extension+")");m.appendChild(v)}mxEvent.addListener(m,"change",function(p){p=g[m.value].extension;var A=e.value.lastIndexOf(".drawio.");A=0<A?A:e.value.lastIndexOf(".");"drawio"!=p&&(p="drawio."+p);e.value=0<A?e.value.substring(0,A+1)+p:e.value+"."+p;"createEvent"in-document?(p=document.createEvent("HTMLEvents"),p.initEvent("change",!1,!0),e.dispatchEvent(p)):e.fireEvent("onchange")});b=function(p){p=e.value.toLowerCase();for(var A=0,H=0;H<g.length;H++){var S=g[H].extension,F=null;"drawio"!=S&&(F=S,S=".drawio."+S);if(p.substring(p.length-S.length-1)=="."+S||null!=F&&p.substring(p.length-F.length-1)=="."+F){A=H;break}}m.value=A};mxEvent.addListener(e,"change",b);mxEvent.addListener(e,"keyup",b);b();return m};-var WrapperWindow=function(b,e,g,m,v,p,A,H){H=null!=H?H:document.createElement("div");this.window=new mxWindow(e,H,g,m,v,p,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);b.installResizeHandler(this,!0);A(H)};-(function(){mxGraphView.prototype.validateBackgroundPage=function(){var A=this.graph;if(null!=A.container&&!A.transparentBackground){if(A.pageVisible){var H=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var S=A.container.firstChild;null!=S&&S.nodeType!=mxConstants.NODETYPE_ELEMENT;)S=S.nextSibling;null!=S&&(this.backgroundPageShape=this.createBackgroundPageShape(H),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML,+e.style.width="100%",l.appendChild(e));null!=A&&f.appendChild(A);row=document.createElement("div");row.style.gridColumn="1 / span 2";row.style.paddingTop=null!=K?"6px":"14px";row.style.whiteSpace="nowrap";row.style.display="inline-flex";row.style.alignItems="center";row.style.justifyContent="flex-end";row.setAttribute("align","right");l=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=F&&F()});l.className="geBtn";null==G||b.isOffline()||row.appendChild(b.createHelpIcon(G));+b.editor.cancelFirst&&row.appendChild(l);mxEvent.addListener(q,"keypress",function(H){13==H.keyCode&&D.click()});row.appendChild(D);b.editor.cancelFirst||row.appendChild(l);f.appendChild(row);c.appendChild(f);this.container=c};FilenameDialog.filenameHelpLink=null;+FilenameDialog.createFileTypes=function(b,e,g){var m=document.createElement("select");for(b=0;b<g.length;b++){var v=document.createElement("option");v.setAttribute("value",b);mxUtils.write(v,mxResources.get(g[b].description)+" (."+g[b].extension+")");m.appendChild(v)}mxEvent.addListener(m,"change",function(n){n=g[m.value].extension;var A=e.value.lastIndexOf(".drawio.");A=0<A?A:e.value.lastIndexOf(".");"drawio"!=n&&(n="drawio."+n);e.value=0<A?e.value.substring(0,A+1)+n:e.value+"."+n;"createEvent"in+document?(n=document.createEvent("HTMLEvents"),n.initEvent("change",!1,!0),e.dispatchEvent(n)):e.fireEvent("onchange")});b=function(n){n=e.value.toLowerCase();for(var A=0,G=0;G<g.length;G++){var S=g[G].extension,F=null;"drawio"!=S&&(F=S,S=".drawio."+S);if(n.substring(n.length-S.length-1)=="."+S||null!=F&&n.substring(n.length-F.length-1)=="."+F){A=G;break}}m.value=A};mxEvent.addListener(e,"change",b);mxEvent.addListener(e,"keyup",b);b();return m};+var WrapperWindow=function(b,e,g,m,v,n,A,G){G=null!=G?G:document.createElement("div");this.window=new mxWindow(e,G,g,m,v,n,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);b.installResizeHandler(this,!0);A(G)};+(function(){mxGraphView.prototype.validateBackgroundPage=function(){var A=this.graph;if(null!=A.container&&!A.transparentBackground){if(A.pageVisible){var G=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var S=A.container.firstChild;null!=S&&S.nodeType!=mxConstants.NODETYPE_ELEMENT;)S=S.nextSibling;null!=S&&(this.backgroundPageShape=this.createBackgroundPageShape(G),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML,this.backgroundPageShape.init(A.container),S.style.position="absolute",A.container.insertBefore(this.backgroundPageShape.node,S),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(F){A.dblClick(F)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(F){A.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(F))}),mxUtils.bind(this,function(F){null!=-A.tooltipHandler&&A.tooltipHandler.isHideOnHover()&&A.tooltipHandler.hide();A.isMouseDown&&!mxEvent.isConsumed(F)&&A.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(F))}),mxUtils.bind(this,function(F){A.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(F))})))}else this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=H,this.backgroundPageShape.redraw()}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null);this.validateBackgroundStyles()}};-mxGraphView.prototype.validateBackgroundStyles=function(A,H,S){var F=this.graph;A=null!=A?A:1;var K=mxUtils.getLightDarkColor(null==F.background||F.background==mxConstants.NONE?F.defaultPageBackgroundColor:F.background).cssText,c=mxUtils.getLightDarkColor(F.defaultPageBorderColor).cssText,f=null!=K&&this.gridColor!=K.toLowerCase()?this.gridColor:"#ffffff",l="none",t="";"simple"==F.getAdaptiveColors()&&F.background!=mxConstants.NONE&&null!=F.background&&(K=F.background);if(F.isGridEnabled()||F.gridVisible){t=-10;mxClient.IS_SVG?(l=unescape(encodeURIComponent(this.createSvgGrid(f,A))),l=window.btoa?btoa(l):Base64.encode(l,!0),l="url(data:image/svg+xml;base64,"+l+")",t=F.gridSize*this.scale*this.gridSteps*A):l="url("+this.gridImage+")";var q=f=0;H=null!=H?H-this.translate.x*this.scale:0;S=null!=S?S-this.translate.y*this.scale:0;var D=F.gridSize*this.scale*this.gridSteps,G=H%D;D=S%D;null!=F.view.backgroundPageShape&&(q=this.getBackgroundPageBounds(),f=1+q.x,q=1+q.y);t=-Math.round(t-mxUtils.mod(this.translate.x*-this.scale-f+H,t)+G*A)+"px "+-Math.round(t-mxUtils.mod(this.translate.y*this.scale-q+S,t)+D*A)+"px"}A=F.view.canvas;null!=A.ownerSVGElement&&(A=A.ownerSVGElement);f=!Editor.isDarkMode()&&F.enableDiagramBackground;null!=F.view.backgroundPageShape?(F.view.backgroundPageShape.node.style.backgroundPosition=t,F.view.backgroundPageShape.node.style.backgroundImage=l,F.view.backgroundPageShape.node.style.backgroundColor=K,F.view.backgroundPageShape.node.style.borderColor=c,F.view.backgroundPageShape.node.style.colorScheme=+A.tooltipHandler&&A.tooltipHandler.isHideOnHover()&&A.tooltipHandler.hide();A.isMouseDown&&!mxEvent.isConsumed(F)&&A.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(F))}),mxUtils.bind(this,function(F){A.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(F))})))}else this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=G,this.backgroundPageShape.redraw()}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null);this.validateBackgroundStyles()}};+mxGraphView.prototype.validateBackgroundStyles=function(A,G,S){var F=this.graph;A=null!=A?A:1;var K=mxUtils.getLightDarkColor(null==F.background||F.background==mxConstants.NONE?F.defaultPageBackgroundColor:F.background).cssText,c=mxUtils.getLightDarkColor(F.defaultPageBorderColor).cssText,f=null!=K&&this.gridColor!=K.toLowerCase()?this.gridColor:"#ffffff",l="none",t="";"simple"==F.getAdaptiveColors()&&F.background!=mxConstants.NONE&&null!=F.background&&(K=F.background);if(F.isGridEnabled()||F.gridVisible){t=+10;mxClient.IS_SVG?(l=unescape(encodeURIComponent(this.createSvgGrid(f,A))),l=window.btoa?btoa(l):Base64.encode(l,!0),l="url(data:image/svg+xml;base64,"+l+")",t=F.gridSize*this.scale*this.gridSteps*A):l="url("+this.gridImage+")";var q=f=0;G=null!=G?G-this.translate.x*this.scale:0;S=null!=S?S-this.translate.y*this.scale:0;var D=F.gridSize*this.scale*this.gridSteps,H=G%D;D=S%D;null!=F.view.backgroundPageShape&&(q=this.getBackgroundPageBounds(),f=1+q.x,q=1+q.y);t=-Math.round(t-mxUtils.mod(this.translate.x*+this.scale-f+G,t)+H*A)+"px "+-Math.round(t-mxUtils.mod(this.translate.y*this.scale-q+S,t)+D*A)+"px"}A=F.view.canvas;null!=A.ownerSVGElement&&(A=A.ownerSVGElement);f=!Editor.isDarkMode()&&F.enableDiagramBackground;null!=F.view.backgroundPageShape?(F.view.backgroundPageShape.node.style.backgroundPosition=t,F.view.backgroundPageShape.node.style.backgroundImage=l,F.view.backgroundPageShape.node.style.backgroundColor=K,F.view.backgroundPageShape.node.style.borderColor=c,F.view.backgroundPageShape.node.style.colorScheme="none"==F.getAdaptiveColors()?"light":"",A.style.backgroundImage="none",A.style.backgroundColor="",F.container.style.backgroundColor=f?F.diagramBackgroundColor:""):(A.style.backgroundPosition=t,A.style.backgroundImage=l,"1"==urlParams.transparent?F.container.style.background="transparent":!f||null!=F.background&&F.background!=mxConstants.NONE?A.style.backgroundColor=K:(A.style.backgroundColor=F.diagramBackgroundColor,F.container.style.backgroundColor=""))};mxGraphView.prototype.createSvgGrid=function(A,-H){for(var S=this.graph.gridSize*this.scale*(null!=H?H:1);S<this.minGridSize;)S*=2;H=this.gridSteps*S;for(var F=[],K=1;K<this.gridSteps;K++){var c=K*S;F.push("M 0 "+c+" L "+H+" "+c+" M "+c+" 0 L "+c+" "+H)}A=mxUtils.getLightDarkColor(A);S="color-scheme: light dark;";mxClient.IS_SF&&(S="color-scheme: "+("none"!=this.graph.getAdaptiveColors()&&Editor.isDarkMode()?"dark":"light"));return'<svg style="'+S+'" width="'+H+'" height="'+H+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+-H+'" height="'+H+'" patternUnits="userSpaceOnUse"><path d="'+F.join(" ")+'" fill="none" style="stroke:'+mxUtils.htmlEntities(A.cssText)+';" stroke="'+A.light+'" opacity="0.2" stroke-width="1"/><path d="M '+H+" 0 L 0 0 0 "+H+'" fill="none" style="stroke:'+mxUtils.htmlEntities(A.cssText)+';" stroke="'+A.light+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var b=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(A,H){b.apply(this,arguments);-if(null!=this.shiftPreview1){var S=this.view.canvas;null!=S.ownerSVGElement&&(S=S.ownerSVGElement);var F=this.gridSize*this.view.scale*this.view.gridSteps;F=-Math.round(F-mxUtils.mod(this.view.translate.x*this.view.scale+A,F))+"px "+-Math.round(F-mxUtils.mod(this.view.translate.y*this.view.scale+H,F))+"px";S.style.backgroundPosition=F}};mxGraph.prototype.updatePageBreaks=function(A,H,S){var F=this.view.scale,K=this.view.translate,c=this.pageFormat,f=F*this.pageScale,l=this.view.getBackgroundPageBounds();-H=l.width;S=l.height;var t=new mxRectangle(F*K.x,F*K.y,c.width*f,c.height*f),q=(A=A&&Math.min(t.width,t.height)>this.minPageBreakDist)?Math.ceil(S/t.height)-1:0,D=A?Math.ceil(H/t.width)-1:0,G=l.x+H,N=l.y+S;null==this.horizontalPageBreaks&&0<q&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<D&&(this.verticalPageBreaks=[]);A=mxUtils.bind(this,function(L){if(null!=L){for(var J=L==this.horizontalPageBreaks?q:D,Y=0;Y<=J;Y++){var ha=L==this.horizontalPageBreaks?[new mxPoint(Math.round(l.x),-Math.round(l.y+(Y+1)*t.height)),new mxPoint(Math.round(G),Math.round(l.y+(Y+1)*t.height))]:[new mxPoint(Math.round(l.x+(Y+1)*t.width),Math.round(l.y)),new mxPoint(Math.round(l.x+(Y+1)*t.width),Math.round(N))];null!=L[Y]?(L[Y].points=ha,L[Y].redraw()):(ha=new mxPolyline(ha,this.pageBreakColor),ha.dialect=this.dialect,ha.isDashed=this.pageBreakDashed,ha.pointerEvents=!1,ha.init(this.view.backgroundPane),ha.redraw(),L[Y]=ha)}for(Y=J;Y<L.length;Y++)null!=L[Y]&&L[Y].destroy();L.splice(J,L.length-J)}});-A(this.horizontalPageBreaks);A(this.verticalPageBreaks)};var e=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(A,H,S){for(var F=0;F<H.length;F++){if(this.graph.isTableCell(H[F])||this.graph.isTableRow(H[F]))return!1;if(this.graph.getModel().isVertex(H[F])){var K=this.graph.getCellGeometry(H[F]);if(null!=K&&K.relative)return!1}}return e.apply(this,arguments)};var g=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=-function(){var A=g.apply(this,arguments);A.intersects=mxUtils.bind(this,function(H,S){return this.isConnecting()?!0:mxCellMarker.prototype.intersects.apply(A,arguments)});return A};mxGraphView.prototype.createBackgroundPageShape=function(A){return new mxRectangleShape(A,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var A=this.getGraphBounds(),H=0<A.width?A.x/this.scale-this.translate.x:0,S=0<A.height?A.y/this.scale-this.translate.y:0,F=this.graph.pageFormat,-K=this.graph.pageScale,c=F.width*K;F=F.height*K;K=Math.floor(Math.min(0,H)/c);var f=Math.floor(Math.min(0,S)/F);return new mxRectangle(this.scale*(this.translate.x+K*c),this.scale*(this.translate.y+f*F),this.scale*(Math.ceil(Math.max(1,H+A.width/this.scale)/c)-K)*c,this.scale*(Math.ceil(Math.max(1,S+A.height/this.scale)/F)-f)*F)};var m=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(A,H){m.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||-this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=A+"px",this.view.backgroundPageShape.node.style.marginTop=H+"px")};var v=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(A,H,S,F,K,c){var f=v.apply(this,arguments);null==c||c||mxEvent.addListener(f,"mousedown",function(l){mxEvent.consume(l)});return f};var p=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=-function(A,H,S){var F=this.graph.model.getParent(A);if(H){var K=this.graph.model.isEdge(A)?null:this.graph.getCellGeometry(A);K=!this.graph.model.isEdge(F)&&!this.graph.isSiblingSelected(A)&&(null!=K&&K.relative||!this.graph.isContainer(F)||this.graph.isPart(A))}else if(K=p.apply(this,arguments),this.graph.isTableCell(A)||this.graph.isTableRow(A))K=F,this.graph.isTable(K)||(K=this.graph.model.getParent(K)),K=!this.graph.selectionCellsHandler.isHandled(K)||this.graph.isCellSelected(K)&&this.graph.isToggleEvent(S.getEvent())||-this.graph.isCellSelected(A)&&!this.graph.isToggleEvent(S.getEvent())||this.graph.isTableCell(A)&&this.graph.isCellSelected(F);return K};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(A){A=A.getCell();for(var H=this.graph.getModel(),S=H.getParent(A),F=this.graph.view.getState(S),K=this.graph.isCellSelected(A);null!=F&&(H.isVertex(S)||H.isEdge(S));){var c=this.graph.isCellSelected(S);K=K||c;if(c||!K&&(this.graph.isTableCell(A)||this.graph.isTableRow(A)))A=S;S=H.getParent(S)}return A}})();EditorUi=function(b,e,g){mxEventSource.call(this);this.destroyFunctions=[];this.editor=b||new Editor;this.container=e||document.body;var m=this,v=this.editor.graph;v.lightbox=g;var p=v.getGraphBounds;v.getGraphBounds=function(){var W=p.apply(this,arguments),ba=this.backgroundImage;if(null!=ba&&null!=ba.width&&null!=ba.height){var ja=this.view.translate,ca=this.view.scale;W=mxRectangle.fromRectangle(W);W.add(new mxRectangle((ja.x+ba.x)*ca,(ja.y+ba.y)*ca,ba.width*ca,ba.height*ca))}return W};v.useCssTransforms&&+G){for(var S=this.graph.gridSize*this.scale*(null!=G?G:1);S<this.minGridSize;)S*=2;G=this.gridSteps*S;for(var F=[],K=1;K<this.gridSteps;K++){var c=K*S;F.push("M 0 "+c+" L "+G+" "+c+" M "+c+" 0 L "+c+" "+G)}A=mxUtils.getLightDarkColor(A);S="color-scheme: light dark;";mxClient.IS_SF&&(S="color-scheme: "+("none"!=this.graph.getAdaptiveColors()&&Editor.isDarkMode()?"dark":"light"));return'<svg style="'+S+'" width="'+G+'" height="'+G+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'++G+'" height="'+G+'" patternUnits="userSpaceOnUse"><path d="'+F.join(" ")+'" fill="none" style="stroke:'+mxUtils.htmlEntities(A.cssText)+';" stroke="'+A.light+'" opacity="0.2" stroke-width="1"/><path d="M '+G+" 0 L 0 0 0 "+G+'" fill="none" style="stroke:'+mxUtils.htmlEntities(A.cssText)+';" stroke="'+A.light+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var b=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(A,G){b.apply(this,arguments);+if(null!=this.shiftPreview1){var S=this.view.canvas;null!=S.ownerSVGElement&&(S=S.ownerSVGElement);var F=this.gridSize*this.view.scale*this.view.gridSteps;F=-Math.round(F-mxUtils.mod(this.view.translate.x*this.view.scale+A,F))+"px "+-Math.round(F-mxUtils.mod(this.view.translate.y*this.view.scale+G,F))+"px";S.style.backgroundPosition=F}};mxGraph.prototype.updatePageBreaks=function(A,G,S){var F=this.view.scale,K=this.view.translate,c=this.pageFormat,f=F*this.pageScale,l=this.view.getBackgroundPageBounds();+G=l.width;S=l.height;var t=new mxRectangle(F*K.x,F*K.y,c.width*f,c.height*f),q=(A=A&&Math.min(t.width,t.height)>this.minPageBreakDist)?Math.ceil(S/t.height)-1:0,D=A?Math.ceil(G/t.width)-1:0,H=l.x+G,N=l.y+S;null==this.horizontalPageBreaks&&0<q&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<D&&(this.verticalPageBreaks=[]);A=mxUtils.bind(this,function(L){if(null!=L){for(var J=L==this.horizontalPageBreaks?q:D,Y=0;Y<=J;Y++){var ha=L==this.horizontalPageBreaks?[new mxPoint(Math.round(l.x),+Math.round(l.y+(Y+1)*t.height)),new mxPoint(Math.round(H),Math.round(l.y+(Y+1)*t.height))]:[new mxPoint(Math.round(l.x+(Y+1)*t.width),Math.round(l.y)),new mxPoint(Math.round(l.x+(Y+1)*t.width),Math.round(N))];null!=L[Y]?(L[Y].points=ha,L[Y].redraw()):(ha=new mxPolyline(ha,this.pageBreakColor),ha.dialect=this.dialect,ha.isDashed=this.pageBreakDashed,ha.pointerEvents=!1,ha.init(this.view.backgroundPane),ha.redraw(),L[Y]=ha)}for(Y=J;Y<L.length;Y++)null!=L[Y]&&L[Y].destroy();L.splice(J,L.length-J)}});+A(this.horizontalPageBreaks);A(this.verticalPageBreaks)};var e=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(A,G,S){for(var F=0;F<G.length;F++){if(this.graph.isTableCell(G[F])||this.graph.isTableRow(G[F]))return!1;if(this.graph.getModel().isVertex(G[F])){var K=this.graph.getCellGeometry(G[F]);if(null!=K&&K.relative)return!1}}return e.apply(this,arguments)};var g=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=+function(){var A=g.apply(this,arguments);A.intersects=mxUtils.bind(this,function(G,S){return this.isConnecting()?!0:mxCellMarker.prototype.intersects.apply(A,arguments)});return A};mxGraphView.prototype.createBackgroundPageShape=function(A){return new mxRectangleShape(A,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var A=this.getGraphBounds(),G=0<A.width?A.x/this.scale-this.translate.x:0,S=0<A.height?A.y/this.scale-this.translate.y:0,F=this.graph.pageFormat,+K=this.graph.pageScale,c=F.width*K;F=F.height*K;K=Math.floor(Math.min(0,G)/c);var f=Math.floor(Math.min(0,S)/F);return new mxRectangle(this.scale*(this.translate.x+K*c),this.scale*(this.translate.y+f*F),this.scale*(Math.ceil(Math.max(1,G+A.width/this.scale)/c)-K)*c,this.scale*(Math.ceil(Math.max(1,S+A.height/this.scale)/F)-f)*F)};var m=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(A,G){m.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||+this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=A+"px",this.view.backgroundPageShape.node.style.marginTop=G+"px")};var v=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(A,G,S,F,K,c){var f=v.apply(this,arguments);null==c||c||mxEvent.addListener(f,"mousedown",function(l){mxEvent.consume(l)});return f};var n=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=+function(A,G,S){var F=this.graph.model.getParent(A);if(G){var K=this.graph.model.isEdge(A)?null:this.graph.getCellGeometry(A);K=!this.graph.model.isEdge(F)&&!this.graph.isSiblingSelected(A)&&(null!=K&&K.relative||!this.graph.isContainer(F)||this.graph.isPart(A))}else if(K=n.apply(this,arguments),this.graph.isTableCell(A)||this.graph.isTableRow(A))K=F,this.graph.isTable(K)||(K=this.graph.model.getParent(K)),K=!this.graph.selectionCellsHandler.isHandled(K)||this.graph.isCellSelected(K)&&this.graph.isToggleEvent(S.getEvent())||+this.graph.isCellSelected(A)&&!this.graph.isToggleEvent(S.getEvent())||this.graph.isTableCell(A)&&this.graph.isCellSelected(F);return K};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(A){A=A.getCell();for(var G=this.graph.getModel(),S=G.getParent(A),F=this.graph.view.getState(S),K=this.graph.isCellSelected(A);null!=F&&(G.isVertex(S)||G.isEdge(S));){var c=this.graph.isCellSelected(S);K=K||c;if(c||!K&&(this.graph.isTableCell(A)||this.graph.isTableRow(A)))A=S;S=G.getParent(S)}return A}})();EditorUi=function(b,e,g){mxEventSource.call(this);this.destroyFunctions=[];this.editor=b||new Editor;this.container=e||document.body;var m=this,v=this.editor.graph;v.lightbox=g;var n=v.getGraphBounds;v.getGraphBounds=function(){var W=n.apply(this,arguments),ba=this.backgroundImage;if(null!=ba&&null!=ba.width&&null!=ba.height){var ja=this.view.translate,ca=this.view.scale;W=mxRectangle.fromRectangle(W);W.add(new mxRectangle((ja.x+ba.x)*ca,(ja.y+ba.y)*ca,ba.width*ca,ba.height*ca))}return W};v.useCssTransforms&&(this.lazyZoomDelay=0);this.selectionStateListener=mxUtils.bind(this,function(W,ba){this.clearSelectionState()});v.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionStateListener);v.getModel().addListener(mxEvent.CHANGE,this.selectionStateListener);v.addListener(mxEvent.EDITING_STARTED,this.selectionStateListener);v.addListener(mxEvent.EDITING_STOPPED,this.selectionStateListener);v.getView().addListener("unitChanged",this.selectionStateListener);if(this.editor.chromeless&&!this.editor.editable){v.isEnabled=-function(){return!1};v.panningHandler.isForcePanningEvent=function(W){for(var ba=W.getSource();null!=ba&&ba!=v.container;){if("foreignObject"===ba.nodeName||"text"===ba.nodeName)return!1;ba=ba.parentNode}return!mxEvent.isPopupTrigger(W.getEvent())};var A=v.panningHandler.start;v.panningHandler.start=function(){A.apply(this,arguments);mxUtils.clearSelection()}}this.actions=new Actions(this);this.menus=this.createMenus();if(!v.standalone){var H=!1,S=!1;this.setDefaultStyle=function(W){try{v.getModel().isEdge(W)?-S=v.pasteEdgeStyle=!1:H=!1;var ba=v.getCellStyle(W,!1),ja=[],ca=[],la;for(la in ba)ja.push(ba[la]),ca.push(la);v.getModel().isEdge(W)?v.currentEdgeStyle={}:v.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",ca,"values",ja,"cells",[W],"force",!0));v.getModel().isEdge(W)?S=v.pasteEdgeStyle=!0:H=!0}catch(Q){this.handleError(Q)}};this.clearDefaultStyle=function(){v.currentEdgeStyle=mxUtils.clone(v.defaultEdgeStyle);v.currentVertexStyle=mxUtils.clone(v.defaultVertexStyle);H=+function(){return!1};v.panningHandler.isForcePanningEvent=function(W){for(var ba=W.getSource();null!=ba&&ba!=v.container;){if("foreignObject"===ba.nodeName||"text"===ba.nodeName)return!1;ba=ba.parentNode}return!mxEvent.isPopupTrigger(W.getEvent())};var A=v.panningHandler.start;v.panningHandler.start=function(){A.apply(this,arguments);mxUtils.clearSelection()}}this.actions=new Actions(this);this.menus=this.createMenus();if(!v.standalone){var G=!1,S=!1;this.setDefaultStyle=function(W){try{v.getModel().isEdge(W)?+S=v.pasteEdgeStyle=!1:G=!1;var ba=v.getCellStyle(W,!1),ja=[],ca=[],la;for(la in ba)ja.push(ba[la]),ca.push(la);v.getModel().isEdge(W)?v.currentEdgeStyle={}:v.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",ca,"values",ja,"cells",[W],"force",!0));v.getModel().isEdge(W)?S=v.pasteEdgeStyle=!0:G=!0}catch(Q){this.handleError(Q)}};this.clearDefaultStyle=function(){v.currentEdgeStyle=mxUtils.clone(v.defaultEdgeStyle);v.currentVertexStyle=mxUtils.clone(v.defaultVertexStyle);G=S=v.pasteEdgeStyle=!1;this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};v.addListener("cellsInserted",function(W,ba){v.pasteCellStyles(v.includeDescendants(ba.getProperty("cells")))});v.addListener("textInserted",function(W,ba){v.pasteCellStyles(ba.getProperty("cells"))});this.createDivs();this.createUi();this.refresh();var F=mxUtils.bind(this,function(W){null==W&&(W=window.event);return v.isEditing()||null!=W&&this.isSelectionAllowed(W)});this.container!=document.body||this.editor.chromeless&&!this.editor.editable||(this.menubarContainer.onselectstart=F,this.menubarContainer.onmousedown=F,this.toolbarContainer.onselectstart=F,this.toolbarContainer.onmousedown=F,this.diagramContainer.onselectstart=F,this.diagramContainer.onmousedown=F,this.sidebarContainer.onselectstart=F,this.sidebarContainer.onmousedown=F,this.formatContainer.onselectstart=F,this.formatContainer.onmousedown=F,null!=this.tabContainer&&(this.tabContainer.onselectstart=F),mxClient.IS_IOS&&(e=function(){var W=null;if(/iP(hone|od|ad)/.test(navigator.platform)){var ba=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);try{W=[parseInt(ba[1],10),parseInt(ba[2],10),parseInt(ba[3]||0,10)]}catch(ja){}}return W}(),null!=e&&16<=e[0]&&(mxUtils.setPrefixedStyle(this.menubarContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.diagramContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.sidebarContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.formatContainer.style,"userSelect",@@ -2047,13 +2048,13 @@ null;if(/iP(hone|od|ad)/.test(navigator.platform)){var ba=navigator.appVersion.mba.x-this.diagramContainer.clientWidth||0<mxEvent.getClientY(W)-ba.y-this.diagramContainer.clientHeight?this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var c=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(W,ba){return m.isSpaceDown()||c.apply(this,arguments)};this.keydownHandler=mxUtils.bind(this,function(W){16==W.which?this.shiftDown=!0:32!=W.which||v.isEditing()?mxEvent.isConsumed(W)||27!=W.keyCode||this.hideDialog(null,!0):(this.spaceDown=!0,this.hoverIcons.reset(),v.container.style.cursor="move",v.isEditing()||mxEvent.getSource(W)!=v.container||mxEvent.consume(W))});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(W){v.container.style.cursor="";this.shiftDown=this.spaceDown=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);var f=v.panningHandler.isForcePanningEvent;v.panningHandler.isForcePanningEvent=function(W){return f.apply(this,arguments)||m.isSpaceDown()||mxEvent.isMouseEvent(W.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(W.getEvent()))&&(!mxEvent.isControlDown(W.getEvent())&&mxEvent.isRightMouseButton(W.getEvent())||mxEvent.isMiddleMouseButton(W.getEvent()))};var l=v.cellEditor.isStopEditingEvent;v.cellEditor.isStopEditingEvent=function(W){return l.apply(this,arguments)||13==W.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(W)||mxClient.IS_MAC&&mxEvent.isMetaDown(W)||mxClient.IS_SF&&mxEvent.isShiftDown(W))};-var t=v.isZoomWheelEvent;v.isZoomWheelEvent=function(){return m.isSpaceDown()||t.apply(this,arguments)};var q=mxUtils.bind(this,function(){if(null!=this.toolbar)for(var W=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,ba=this.toolbar.container.firstChild;null!=ba;){var ja=ba.getAttribute("data-min-width");null!=ja&&parseInt(ja)>W?ba.style.display="none":ba.style.display="";ba=ba.nextSibling}}),D=!1,G=null,N=null,L=null,J=mxUtils.bind(this,function(){if(null!=this.toolbar&&-D!=v.cellEditor.isContentEditing()){for(var W=this.toolbar.container.firstChild,ba=[];null!=W;){var ja=W.nextSibling;W.parentNode.removeChild(W);ba.push(W);W=ja}W=this.toolbar.fontMenu;ja=this.toolbar.sizeMenu;if(null==L)this.toolbar.createTextToolbar();else{for(var ca=0;ca<L.length;ca++)this.toolbar.container.appendChild(L[ca]);this.toolbar.fontMenu=G;this.toolbar.sizeMenu=N}D=v.cellEditor.isContentEditing();G=W;N=ja;L=ba;q()}});this.addListener("languageChanged",mxUtils.bind(this,function(){this.destroyWindows(!0);+var t=v.isZoomWheelEvent;v.isZoomWheelEvent=function(){return m.isSpaceDown()||t.apply(this,arguments)};var q=mxUtils.bind(this,function(){if(null!=this.toolbar)for(var W=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,ba=this.toolbar.container.firstChild;null!=ba;){var ja=ba.getAttribute("data-min-width");null!=ja&&parseInt(ja)>W?ba.style.display="none":ba.style.display="";ba=ba.nextSibling}}),D=!1,H=null,N=null,L=null,J=mxUtils.bind(this,function(){if(null!=this.toolbar&&+D!=v.cellEditor.isContentEditing()){for(var W=this.toolbar.container.firstChild,ba=[];null!=W;){var ja=W.nextSibling;W.parentNode.removeChild(W);ba.push(W);W=ja}W=this.toolbar.fontMenu;ja=this.toolbar.sizeMenu;if(null==L)this.toolbar.createTextToolbar();else{for(var ca=0;ca<L.length;ca++)this.toolbar.container.appendChild(L[ca]);this.toolbar.fontMenu=H;this.toolbar.sizeMenu=N}D=v.cellEditor.isContentEditing();H=W;N=ja;L=ba;q()}});this.addListener("languageChanged",mxUtils.bind(this,function(){this.destroyWindows(!0);this.descriptorChanged();this.updateStatusAgain();J()}));this.addListener("currentThemeChanged",q);mxEvent.addListener(window,"resize",q);q();var Y=v.cellEditor.startEditing;v.cellEditor.startEditing=function(){Y.apply(this,arguments);J();if(v.cellEditor.isContentEditing()){var W=!1,ba=function(){W||(W=!0,window.setTimeout(function(){var ja=v.getSelectedEditingElement();null!=ja&&(ja=mxUtils.getCurrentStyle(ja),null!=ja&&null!=m.toolbar&&(m.toolbar.setFontName(mxUtils.getCssFontFamily(ja.fontFamily)),m.toolbar.setFontSize(parseInt(ja.fontSize))));W=!1},0))};mxEvent.addListener(v.cellEditor.textarea,"input",ba);mxEvent.addListener(v.cellEditor.textarea,"touchend",ba);mxEvent.addListener(v.cellEditor.textarea,"mouseup",ba);mxEvent.addListener(v.cellEditor.textarea,"keyup",ba);ba()}};var ha=v.cellEditor.stopEditing;v.cellEditor.stopEditing=function(W,ba){try{ha.apply(this,arguments),J()}catch(ja){m.handleError(ja)}};v.container.setAttribute("tabindex","0");v.container.style.cursor="default";if(window.self===window.top&&null!=v.container.parentNode)try{v.container.focus()}catch(W){}var ea=v.fireMouseEvent;v.fireMouseEvent=function(W,ba,ja){try{W==mxEvent.MOUSE_DOWN&&this.container.focus(),ea.apply(this,arguments)}catch(ca){m.handleError(ca)}};var aa=v.foldCells;v.foldCells=function(W,ba,ja,ca,la){try{aa.apply(this,arguments)}catch(Q){m.handleError(Q)}};v.popupMenuHandler.autoExpand=!0;null!=this.menus&&(v.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(W,ba,ja){this.menus.createPopupMenu(W,ba,ja)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(W){v.popupMenuHandler.hideMenu()}));this.keyHandler=this.createKeyHandler(b);this.getKeyHandler=function(){return keyHandler};v.connectionHandler.addListener(mxEvent.CONNECT,function(W,ba){var ja=[ba.getProperty("cell")];ba.getProperty("terminalInserted")&&(ja.push(ba.getProperty("terminal")),window.setTimeout(function(){null!=m.hoverIcons&&m.hoverIcons.update(v.view.getState(ja[ja.length-1]))},0));v.pasteCellStyles(ja)});this.addListener("styleChanged",-mxUtils.bind(this,function(W,ba){W=ba.getProperty("force");(this.updateDefaultStyle||W)&&v.copyCellStyles(ba.getProperty("cells"),ba.getProperty("keys"),ba.getProperty("values"),v.currentVertexStyle,v.currentEdgeStyle,H,S);null!=this.toolbar&&(this.toolbar.setFontName(v.currentVertexStyle.fontFamily||Menus.prototype.defaultFont),this.toolbar.setFontSize(v.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),null!=this.toolbar.edgeStyleMenu&&("orthogonalEdgeStyle"==v.currentEdgeStyle.edgeStyle&&+mxUtils.bind(this,function(W,ba){W=ba.getProperty("force");(this.updateDefaultStyle||W)&&v.copyCellStyles(ba.getProperty("cells"),ba.getProperty("keys"),ba.getProperty("values"),v.currentVertexStyle,v.currentEdgeStyle,G,S);null!=this.toolbar&&(this.toolbar.setFontName(v.currentVertexStyle.fontFamily||Menus.prototype.defaultFont),this.toolbar.setFontSize(v.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),null!=this.toolbar.edgeStyleMenu&&("orthogonalEdgeStyle"==v.currentEdgeStyle.edgeStyle&&"1"==v.currentEdgeStyle.curved?this.toolbar.setMenuIcon(this.toolbar.edgeStyleMenu,Format.curvedImage.src):"straight"==v.currentEdgeStyle.edgeStyle||"none"==v.currentEdgeStyle.edgeStyle||null==v.currentEdgeStyle.edgeStyle?this.toolbar.setMenuIcon(this.toolbar.edgeStyleMenu,Format.straightImage.src):"entityRelationEdgeStyle"==v.currentEdgeStyle.edgeStyle?this.toolbar.setMenuIcon(this.toolbar.edgeStyleMenu,Format.entityImage.src):"elbowEdgeStyle"==v.currentEdgeStyle.edgeStyle?"vertical"==v.currentEdgeStyle.elbow?this.toolbar.setMenuIcon(this.toolbar.edgeStyleMenu,Format.verticalElbowImage.src):this.toolbar.setMenuIcon(this.toolbar.edgeStyleMenu,Format.horizontalElbowImage.src):"isometricEdgeStyle"==v.currentEdgeStyle.edgeStyle?"vertical"==v.currentEdgeStyle.elbow?this.toolbar.setMenuIcon(this.toolbar.edgeStyleMenu,Format.verticalIsometricImage.src):this.toolbar.setMenuIcon(this.toolbar.edgeStyleMenu,Format.horizontalIsometricImage.src):this.toolbar.setMenuIcon(this.toolbar.edgeStyleMenu,Format.orthogonalImage.src)),null!=this.toolbar.edgeShapeMenu&&("link"==v.currentEdgeStyle.shape?this.toolbar.setMenuIcon(this.toolbar.edgeShapeMenu,Format.linkEdgeImage.src):"flexArrow"==v.currentEdgeStyle.shape?this.toolbar.setMenuIcon(this.toolbar.edgeShapeMenu,Format.arrowImage.src):"arrow"==v.currentEdgeStyle.shape?this.toolbar.setMenuIcon(this.toolbar.edgeShapeMenu,Format.simpleArrowImage.src):this.toolbar.setMenuIcon(this.toolbar.edgeShapeMenu,Format.connectionImage.src)))}));null!=this.toolbar&&(b=mxUtils.bind(this,function(){var W=@@ -2062,45 +2063,48 @@ ba=ba.getProperty("parent");null!=ba&&v.getModel().isLayer(ba)&&!v.isCellVisiblethis.gestureHandler);var na=null;this.resizeHandler=mxUtils.bind(this,function(){null!=na&&window.clearTimeout(na);na=window.setTimeout(mxUtils.bind(this,function(){na=null;this.windowResized()}),100)});mxEvent.addListener(window,"resize",this.resizeHandler);this.orientationChangeHandler=mxUtils.bind(this,function(){this.refresh()});mxEvent.addListener(window,"orientationchange",this.orientationChangeHandler);mxClient.IS_IOS&&!window.navigator.standalone&&"undefined"!==typeof Menus&&(this.scrollHandler=mxUtils.bind(this,function(){window.scrollTo(0,0)}),mxEvent.addListener(window,"scroll",this.scrollHandler));this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.resetScrollbars()}));this.addListener("gridEnabledChanged",mxUtils.bind(this,function(){v.view.validateBackground()}));this.addListener("backgroundColorChanged",mxUtils.bind(this,function(){v.view.validateBackground()}));v.addListener("gridSizeChanged",mxUtils.bind(this,function(){v.isGridEnabled()&&v.view.validateBackground()}));this.editor.resetGraph()}this.init();v.standalone||this.open()};EditorUi.compactUi=!0;-EditorUi.parsePng=function(b,e,g){function m(H,S){var F=p;p+=S;return H.substring(F,p)}function v(H){H=m(H,4);return H.charCodeAt(3)+(H.charCodeAt(2)<<8)+(H.charCodeAt(1)<<16)+(H.charCodeAt(0)<<24)}var p=0;if(m(b,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=g&&g();else if(m(b,4),"IHDR"!=m(b,4))null!=g&&g();else{m(b,17);do{g=v(b);var A=m(b,4);if(null!=e&&e(p-8,A,g))break;value=m(b,g);m(b,4);if("IEND"==A)break}while(g)}};mxUtils.extend(EditorUi,mxEventSource);+EditorUi.parsePng=function(b,e,g){function m(G,S){var F=n;n+=S;return G.substring(F,n)}function v(G){G=m(G,4);return G.charCodeAt(3)+(G.charCodeAt(2)<<8)+(G.charCodeAt(1)<<16)+(G.charCodeAt(0)<<24)}var n=0;if(m(b,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=g&&g();else if(m(b,4),"IHDR"!=m(b,4))null!=g&&g();else{m(b,17);do{g=v(b);var A=m(b,4);if(null!=e&&e(n-8,A,g))break;value=m(b,g);m(b,4);if("IEND"==A)break}while(g)}};mxUtils.extend(EditorUi,mxEventSource);EditorUi.prototype.splitSize=mxClient.IS_TOUCH||mxClient.IS_POINTER?12:8;EditorUi.prototype.formatEnabled=!0;EditorUi.prototype.formatWidth=240;EditorUi.prototype.defaultSidebarWidth=Math.min(screen.width/2,"large"!=urlParams["sidebar-entries"]?218:230);EditorUi.prototype.hsplitPosition=screen.width<=Editor.smallScreenWidth?0:EditorUi.prototype.defaultSidebarWidth;EditorUi.prototype.allowAnimation=!0;EditorUi.prototype.lightboxMaxFitScale=2;EditorUi.prototype.lightboxVerticalDivider=4;EditorUi.prototype.hsplitClickEnabled=!1;EditorUi.prototype.updateDefaultStyle=!1;EditorUi.prototype.spaceDown=!1;EditorUi.prototype.shiftDown=!1;EditorUi.prototype.init=function(){var b=this.editor.graph;if(!b.standalone){"0"!=urlParams["shape-picker"]&&this.installShapePicker();mxEvent.addListener(b.container,"scroll",mxUtils.bind(this,function(){b.tooltipHandler.hide();null!=b.connectionHandler&&null!=b.connectionHandler.constraintHandler&&b.connectionHandler.constraintHandler.reset()}));b.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){b.tooltipHandler.hide();var m=b.getRubberband();null!=m&&m.cancel()}));mxEvent.addListener(b.container,"keydown",mxUtils.bind(this,function(m){this.onKeyDown(m)}));mxEvent.addListener(b.container,"keypress",mxUtils.bind(this,function(m){this.onKeyPress(m)}));this.addUndoListener();this.addBeforeUnloadListener();b.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()}));b.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()}));var e=b.setDefaultParent,g=this;this.editor.graph.setDefaultParent=function(){e.apply(this,arguments);g.updateActionStates()};b.showLinkDialog=mxUtils.bind(g,g.showLinkDialog);b.editLink=g.actions.get("editLink").funct;this.updateActionStates();this.initClipboard();this.initCanvas();null!=this.format&&this.format.init()}};EditorUi.prototype.clearSelectionState=function(){this.selectionState=null};EditorUi.prototype.getSelectionState=function(){null==this.selectionState&&(this.selectionState=this.createSelectionState());return this.selectionState};-EditorUi.prototype.createSelectionState=function(){for(var b=this.editor.graph,e=b.getSelectionCells(),g=this.initSelectionState(),m=!0,v=0;v<e.length;v++){var p=b.getCurrentCellStyle(e[v]);"0"!=mxUtils.getValue(p,mxConstants.STYLE_EDITABLE,"1")&&(this.updateSelectionStateForCell(g,e[v],e,m),m=!1)}this.updateSelectionStateForTableCells(g);return g};+EditorUi.prototype.createSelectionState=function(){for(var b=this.editor.graph,e=b.getSelectionCells(),g=this.initSelectionState(),m=!0,v=0;v<e.length;v++){var n=b.getCurrentCellStyle(e[v]);"0"!=mxUtils.getValue(n,mxConstants.STYLE_EDITABLE,"1")&&(this.updateSelectionStateForCell(g,e[v],e,m),m=!1)}this.updateSelectionStateForTableCells(g);if(Editor.enableCustomProperties&&null!=this.format){g.customProperties={};b=g.vertices;e=g.edges;for(v=0;v<b.length;v++)this.findCommonProperties(b[v],g.customProperties,+0==v,g);for(v=0;v<e.length;v++)this.findCommonProperties(e[v],g.customProperties,0==b.length&&0==v,g)}return g};+EditorUi.prototype.findCommonProperties=function(b,e,g,m){if(null!=e){var v=mxUtils.bind(this,function(A){if(null!=A)if(g)for(var G=0;G<A.length;G++){if("function"!==typeof A[G].isVisible||A[G].isVisible(m,this.format))e[A[G].name]=A[G]}else for(var S in e){var F=!1;for(G=0;G<A.length;G++)if(A[G].name==S&&A[G].type==e[S].type){F=!0;break}F||delete e[S]}}),n=this.editor.graph.view.getState(b);null!=n&&null!=n.shape&&(n.shape.commonCustomPropAdded||(n.shape.commonCustomPropAdded=!0,n.shape.customProperties=+n.shape.customProperties||[],n.cell.vertex?Array.prototype.push.apply(n.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(n.shape.customProperties,Editor.commonEdgeProperties)),v(n.shape.customProperties));b=b.getAttribute("customProperties");if(null!=b)try{v(JSON.parse(b))}catch(A){}}};EditorUi.prototype.initSelectionState=function(){return{vertices:[],edges:[],cells:[],x:null,y:null,width:null,height:null,style:{},containsImage:!1,containsLabel:!1,fill:!0,glass:!0,html:!0,rounded:!0,autoSize:!1,image:!1,shadow:!0,lineJumps:!0,resizable:!0,table:!1,cell:!1,row:!1,movable:!0,rotatable:!0,stroke:!0,swimlane:!1,unlocked:this.editor.graph.isEnabled(),connections:!1}};-EditorUi.prototype.updateSelectionStateForTableCells=function(b){if(1<b.cells.length&&b.cell){var e=mxUtils.sortCells(b.cells),g=this.editor.graph.model,m=g.getParent(e[0]),v=g.getParent(m);if(null!=m&&null!=v){for(var p=m.getIndex(e[0]),A=v.getIndex(m),H=null,S=1,F=1,K=0,c=A<v.getChildCount()-1?g.getChildAt(g.getChildAt(v,A+1),p):null;K<e.length-1;){var f=e[++K];null==c||c!=f||null!=H&&S!=H||(H=S,S=0,F++,m=g.getParent(c),c=A+F<v.getChildCount()?g.getChildAt(g.getChildAt(v,A+F),p):null);var l=this.editor.graph.view.getState(f);-if(f==g.getChildAt(m,p+S)&&null!=l&&1==mxUtils.getValue(l.style,"colspan",1)&&1==mxUtils.getValue(l.style,"rowspan",1))S++;else break}K==F*S-1&&(b.mergeCell=e[0],b.colspan=S,b.rowspan=F)}}};EditorUi.prototype.windowResized=function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor.graph&&this.editor.graph.sizeDidChange()}),0)};-EditorUi.prototype.createTimeout=function(b,e,g){var m=!0,v=null,p=mxUtils.bind(this,function(H){v.clear()&&(m=!1,H=null!=H?H:{code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.createTimeout(b,e,g)})},null!=g?g(H):this.handleError(H))}),A=window.setTimeout(p,null!=b?b:this.timeout);v={clear:function(){window.clearTimeout(A);return m},isAlive:function(){return m}};null!=e&&this.tryAndHandle(mxUtils.bind(this,function(){e(v)}),p);return v};+EditorUi.prototype.updateSelectionStateForTableCells=function(b){if(1<b.cells.length&&b.cell){var e=mxUtils.sortCells(b.cells),g=this.editor.graph.model,m=g.getParent(e[0]),v=g.getParent(m);if(null!=m&&null!=v){for(var n=m.getIndex(e[0]),A=v.getIndex(m),G=null,S=1,F=1,K=0,c=A<v.getChildCount()-1?g.getChildAt(g.getChildAt(v,A+1),n):null;K<e.length-1;){var f=e[++K];null==c||c!=f||null!=G&&S!=G||(G=S,S=0,F++,m=g.getParent(c),c=A+F<v.getChildCount()?g.getChildAt(g.getChildAt(v,A+F),n):null);var l=this.editor.graph.view.getState(f);+if(f==g.getChildAt(m,n+S)&&null!=l&&1==mxUtils.getValue(l.style,"colspan",1)&&1==mxUtils.getValue(l.style,"rowspan",1))S++;else break}K==F*S-1&&(b.mergeCell=e[0],b.colspan=S,b.rowspan=F)}}};EditorUi.prototype.windowResized=function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor.graph&&this.editor.graph.sizeDidChange()}),0)};+EditorUi.prototype.createTimeout=function(b,e,g){var m=!0,v=null,n=mxUtils.bind(this,function(G){v.clear()&&(m=!1,G=null!=G?G:{code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.createTimeout(b,e,g)})},null!=g?g(G):this.handleError(G))}),A=window.setTimeout(n,null!=b?b:this.timeout);v={clear:function(){window.clearTimeout(A);return m},isAlive:function(){return m}};null!=e&&this.tryAndHandle(mxUtils.bind(this,function(){e(v)}),n);return v};EditorUi.prototype.tryAndHandle=function(b,e){try{b()}catch(g){null!=e?e(g):this.handleError(g)}};-EditorUi.prototype.removeUserDefinedDarkColors=function(b,e,g){var m=this.editor.graph;b=null!=b?b:m.getSelectionCells();var v=Graph.colorStyles,p=document.createElement("div");m.model.beginUpdate();try{for(var A=0;A<b.length;A++)if(m.model.isEdge(b[A])||m.model.isVertex(b[A])){var H=m.getCellStyle(b[A],!1);if(null!=H)for(var S=0;S<v.length;S++)try{var F=H[v[S]];if(mxUtils.isLightDarkColor(F)){var K=mxUtils.getLightDarkColor(F);m.setCellStyles(v[S],K.light,[b[A]])}}catch(f){}e&&m.isHtmlLabel(b[A])&&-"0"!=mxUtils.getValue(H,"html","0")&&(p.innerHTML=Graph.sanitizeHtml(m.getLabel(b[A])),Graph.addLightDarkColors(p,null,null,function(f,l,t){return mxUtils.isLightDarkColor(t)?(t=mxUtils.getLightDarkColor(t),f.style.setProperty(l,t.light),!0):!1})&&m.cellLabelChanged(b[A],p.innerHTML))}if(g&&mxUtils.isLightDarkColor(m.background)){K=mxUtils.getLightDarkColor(m.background);var c=new ChangePageSetup(this,K.light);c.ignoreImage=!0;m.model.execute(c)}}finally{m.model.endUpdate()}return b};+EditorUi.prototype.removeUserDefinedDarkColors=function(b,e,g){var m=this.editor.graph;b=null!=b?b:m.getSelectionCells();var v=Graph.colorStyles,n=document.createElement("div");m.model.beginUpdate();try{for(var A=0;A<b.length;A++)if(m.model.isEdge(b[A])||m.model.isVertex(b[A])){var G=m.getCellStyle(b[A],!1);if(null!=G)for(var S=0;S<v.length;S++)try{var F=G[v[S]];if(mxUtils.isLightDarkColor(F)){var K=mxUtils.getLightDarkColor(F);m.setCellStyles(v[S],K.light,[b[A]])}}catch(f){}e&&m.isHtmlLabel(b[A])&&+"0"!=mxUtils.getValue(G,"html","0")&&(n.innerHTML=Graph.sanitizeHtml(m.getLabel(b[A])),Graph.addLightDarkColors(n,null,null,function(f,l,t){return mxUtils.isLightDarkColor(t)?(t=mxUtils.getLightDarkColor(t),f.style.setProperty(l,t.light),!0):!1})&&m.cellLabelChanged(b[A],n.innerHTML))}if(g&&mxUtils.isLightDarkColor(m.background)){K=mxUtils.getLightDarkColor(m.background);var c=new ChangePageSetup(this,K.light);c.ignoreImage=!0;m.model.execute(c)}}finally{m.model.endUpdate()}return b};EditorUi.prototype.updateSelectionStateForCell=function(b,e,g,m){g=this.editor.graph;b.cells.push(e);if(g.getModel().isVertex(e)){b.connections=0<g.model.getEdgeCount(e);b.unlocked=b.unlocked&&!g.isCellLocked(e);b.resizable=b.resizable&&g.isCellResizable(e);b.rotatable=b.rotatable&&g.isCellRotatable(e);b.movable=b.movable&&g.isCellMovable(e)&&!g.isTableRow(e)&&!g.isTableCell(e);b.swimlane=b.swimlane||g.isSwimlane(e);b.table=b.table||g.isTable(e);b.cell=b.cell||g.isTableCell(e);b.row=b.row||g.isTableRow(e);-b.vertices.push(e);var v=g.getCellGeometry(e);if(null!=v&&(0<v.width?null==b.width?b.width=v.width:b.width!=v.width&&(b.width=""):b.containsLabel=!0,0<v.height?null==b.height?b.height=v.height:b.height!=v.height&&(b.height=""):b.containsLabel=!0,!v.relative||null!=v.offset)){var p=v.relative?v.offset.x:v.x;v=v.relative?v.offset.y:v.y;null==b.x?b.x=p:b.x!=p&&(b.x="");null==b.y?b.y=v:b.y!=v&&(b.y="")}}else g.getModel().isEdge(e)&&(b.edges.push(e),b.connections=!0,b.resizable=!1,b.rotatable=!1,b.movable=-!1);p=g.view.getState(e);null!=p&&(b.html=b.html&&g.isHtmlLabel(e),b.autoSize=b.autoSize||g.isAutoSizeState(p),b.glass=b.glass&&g.isGlassState(p),b.rounded=b.rounded&&g.isRoundedState(p),b.lineJumps=b.lineJumps&&g.isLineJumpState(p),b.image=b.image||g.isImageState(p),b.shadow=b.shadow&&g.isShadowState(p),b.fill=b.fill&&g.isFillState(p),b.gradient=b.fill&&g.isGradientState(p),b.stroke=b.stroke&&g.isStrokeState(p),e=mxUtils.getValue(p.style,mxConstants.STYLE_SHAPE,null),b.containsImage=b.containsImage||-"image"==e,g.mergeStyle(p.style,b.style,m))};+b.vertices.push(e);var v=g.getCellGeometry(e);if(null!=v&&(0<v.width?null==b.width?b.width=v.width:b.width!=v.width&&(b.width=""):b.containsLabel=!0,0<v.height?null==b.height?b.height=v.height:b.height!=v.height&&(b.height=""):b.containsLabel=!0,!v.relative||null!=v.offset)){var n=v.relative?v.offset.x:v.x;v=v.relative?v.offset.y:v.y;null==b.x?b.x=n:b.x!=n&&(b.x="");null==b.y?b.y=v:b.y!=v&&(b.y="")}}else g.getModel().isEdge(e)&&(b.edges.push(e),b.connections=!0,b.resizable=!1,b.rotatable=!1,b.movable=+!1);n=g.view.getState(e);null!=n&&(b.html=b.html&&g.isHtmlLabel(e),b.autoSize=b.autoSize||g.isAutoSizeState(n),b.glass=b.glass&&g.isGlassState(n),b.rounded=b.rounded&&g.isRoundedState(n),b.lineJumps=b.lineJumps&&g.isLineJumpState(n),b.image=b.image||g.isImageState(n),b.shadow=b.shadow&&g.isShadowState(n),b.fill=b.fill&&g.isFillState(n),b.gradient=b.fill&&g.isGradientState(n),b.stroke=b.stroke&&g.isStrokeState(n),e=mxUtils.getValue(n.style,mxConstants.STYLE_SHAPE,null),b.containsImage=b.containsImage||+"image"==e,g.mergeStyle(n.style,b.style,m))};EditorUi.prototype.installShapePicker=function(){var b=this.editor.graph,e=this;b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(S,F){"mouseDown"==F.getProperty("eventName")&&e.hideShapePicker()}));var g=mxUtils.bind(this,function(){e.hideShapePicker(!0)});b.addListener("wheel",g);b.addListener(mxEvent.ESCAPE,g);b.view.addListener(mxEvent.SCALE,g);b.view.addListener(mxEvent.SCALE_AND_TRANSLATE,g);b.getSelectionModel().addListener(mxEvent.CHANGE,g);var m=b.popupMenuHandler.isMenuShowing;b.popupMenuHandler.isMenuShowing=function(){return m.apply(this,arguments)||null!=e.shapePicker||null!=e.currentMenu};var v=b.dblClick;b.dblClick=function(S,F){if(this.isEnabled())if(null!=F||null==e.sidebar||mxEvent.isShiftDown(S)||b.isCellLocked(b.getDefaultParent()))v.apply(this,arguments);else{var K=mxUtils.convertPoint(this.container,mxEvent.getClientX(S),mxEvent.getClientY(S));mxEvent.consume(S);window.setTimeout(mxUtils.bind(this,function(){e.showShapePicker(K.x,K.y)}),30)}};if(null!=this.hoverIcons){this.hoverIcons.addListener("reset",-g);var p=this.hoverIcons.drag;this.hoverIcons.drag=function(){e.hideShapePicker();p.apply(this,arguments)};var A=this.hoverIcons.execute;this.hoverIcons.execute=function(S,F,K){var c=K.getEvent();this.graph.isCloneEvent(c)||mxEvent.isShiftDown(c)?A.apply(this,arguments):this.graph.connectVertex(S.cell,F,this.graph.defaultEdgeLength,c,null,null,mxUtils.bind(this,function(f,l,t){var q=b.getCompositeParent(S.cell);f=b.getCellGeometry(q);for(K.consume();null!=q&&b.model.isVertex(q)&&null!=f&&f.relative;)cell=-q,q=b.model.getParent(cell),f=b.getCellGeometry(q);window.setTimeout(mxUtils.bind(this,function(){e.showShapePicker(K.getGraphX(),K.getGraphY(),q,mxUtils.bind(this,function(D){t(D);null!=e.hoverIcons&&e.hoverIcons.update(b.view.getState(D))}),F)}),30)}),mxUtils.bind(this,function(f){this.graph.selectCellsForConnectVertex(f,c,this)}))};var H=null;this.hoverIcons.addListener("focus",mxUtils.bind(this,function(S,F){null!=H&&window.clearTimeout(H);H=window.setTimeout(mxUtils.bind(this,function(){var K=-F.getProperty("arrow"),c=F.getProperty("direction"),f=F.getProperty("event");K=K.getBoundingClientRect();var l=mxUtils.getOffset(b.container),t=b.container.scrollLeft+K.x-l.x;l=b.container.scrollTop+K.y-l.y;var q=b.getCompositeParent(null!=this.hoverIcons.currentState?this.hoverIcons.currentState.cell:null),D=e.showShapePicker(t,l,q,mxUtils.bind(this,function(G){null!=G&&b.connectVertex(q,c,b.defaultEdgeLength,f,!0,!1,function(N,L,J){J(G);null!=e.hoverIcons&&e.hoverIcons.update(b.view.getState(G))},-function(N){b.selectCellsForConnectVertex(N)},f,this.hoverIcons)}),c,!0);null!=D&&(this.centerShapePicker(D,K,t,l,c),mxUtils.setOpacity(D,30),mxEvent.addListener(D,"mouseenter",function(){mxUtils.setOpacity(D,100)}),mxEvent.addListener(D,"mouseleave",function(){e.hideShapePicker()}))}),Editor.shapePickerHoverDelay)}));this.hoverIcons.addListener("blur",mxUtils.bind(this,function(S,F){null!=H&&window.clearTimeout(H)}))}};-EditorUi.prototype.centerShapePicker=function(b,e,g,m,v){if(v==mxConstants.DIRECTION_EAST||v==mxConstants.DIRECTION_WEST)b.style.width="40px";var p=b.getBoundingClientRect();v==mxConstants.DIRECTION_NORTH?(g-=p.width/2-10,m-=p.height+6):v==mxConstants.DIRECTION_SOUTH?(g-=p.width/2-10,m+=e.height+6):v==mxConstants.DIRECTION_WEST?(g-=p.width+6,m-=p.height/2-10):v==mxConstants.DIRECTION_EAST&&(g+=e.width+6,m-=p.height/2-10);b.style.left=g+"px";b.style.top=m+"px"};-EditorUi.prototype.showShapePicker=function(b,e,g,m,v,p,A,H,S){var F=null;this.editor.graph.freehand.isDrawing()||(H=H||null==g,F=this.createShapePicker(b,e,g,m,v,mxUtils.bind(this,function(){this.hideShapePicker()}),this.getCellsForShapePicker(g,p,H),p,A,H,S),null!=F&&(null==this.hoverIcons||p||this.hoverIcons.reset(),b=this.editor.graph,b.popupMenuHandler.hideMenu(),b.tooltipHandler.hideTooltip(),this.hideCurrentMenu(),this.hideShapePicker(),this.shapePickerCallback=m,this.shapePicker=F));return F};-EditorUi.prototype.createShapePicker=function(b,e,g,m,v,p,A,H,S,F,K){K=null!=K?K:!0;var c=this.editor.graph,f=null;S=null!=S?S:function(q){q=q[0];var D=0,G=0,N=q.geometry;null!=N&&(c.model.isEdge(q)&&(q=N.getTerminalPoint(!1),N=new mxRectangle(0,0,q.x,q.y)),D=N.width/2,G=N.height/2);return new mxPoint(c.snap(Math.round(b/c.view.scale)-c.view.translate.x-D),c.snap(Math.round(e/c.view.scale)-c.view.translate.y-G))};if(null!=A&&0<A.length){var l=this;c=this.editor.graph;f=document.createElement("div");-v=c.view.getState(g);var t=null==g||null!=v&&c.isTransparentState(v)?null:c.copyStyle(g);f.className="geShapePicker";f.setAttribute("title",mxResources.get("sidebarTooltip"));f.style.left=Math.round(b)+"px";f.style.top=Math.round(e)+"px";mxClient.IS_POINTER&&(f.style.touchAction="none");H||mxUtils.setPrefixedStyle(f.style,"transform","translate(-22px,-22px)");c.container.appendChild(f);v=mxUtils.bind(this,function(q){var D=document.createElement("a");f.appendChild(D);null!=t&&"1"!=urlParams.sketch?-this.sidebar.graph.pasteStyle(t,[q]):this.sidebar.graph.pasteCellStyles([q],c.currentVertexStyle,c.currentEdgeStyle);var G=q.geometry;c.model.isEdge(q)&&(G=G.getTerminalPoint(!1),G=new mxRectangle(0,0,G.x,G.y));null!=G&&(G=this.sidebar.createVertexTemplateFromCells([q],G.width,G.height,"",!0,!1,null,!1,mxUtils.bind(this,function(N){if(!mxEvent.isShiftDown(N)||null==g&&c.isSelectionEmpty()){var L=c.cloneCell(q);if(null!=m)m(L);else{var J=S([L]);c.model.isEdge(L)?L.geometry.translate(J.x,J.y):(L.geometry.x=-J.x,L.geometry.y=J.y);c.model.beginUpdate();try{c.addCell(L),c.model.isVertex(L)&&c.isAutoSizeCell(L)&&c.updateCellSize(L)}finally{c.model.endUpdate()}c.setSelectionCell(L);c.scrollCellToVisible(L);K&&c.startEditing(L);null!=l.hoverIcons&&l.hoverIcons.update(c.view.getState(L))}}else L=c.getEditableCells(null!=g?[g]:c.getSelectionCells()),c.updateShapes(q,L);null!=p&&p(N);mxEvent.consume(N)}),25,25,null,null,g),G.style.display="flex",G.style.alignItems="center",G.style.justifyContent="center",D.appendChild(G))});-for(F=0;F<(H?Math.min(A.length,4):A.length);F++)v(A[F]);A=f.offsetTop+f.clientHeight-(c.container.scrollTop+c.container.offsetHeight);0<A&&(f.style.top=Math.max(c.container.scrollTop+22,e-A)+"px");A=f.offsetLeft+f.clientWidth-(c.container.scrollLeft+c.container.offsetWidth);0<A&&(f.style.left=Math.max(c.container.scrollLeft+22,b-A)+"px")}return f};-EditorUi.prototype.getCellsForShapePicker=function(b,e,g){var m=this.editor.graph,v=mxUtils.bind(this,function(p,A,H,S){return m.createVertex(null,null,S||"",0,0,A||120,H||60,p,!1)});e=mxUtils.bind(this,function(p,A,H){p=new mxCell(H||"",new mxGeometry(0,0,m.defaultEdgeLength+20,0),p);p.geometry.setTerminalPoint(new mxPoint(0,0),!0);p.geometry.setTerminalPoint(new mxPoint(p.geometry.width,null!=A?A:0),!1);p.geometry.points=null!=A?[new mxPoint(p.geometry.width/2,A)]:[];p.geometry.relative=!0;p.edge=-!0;return p});if(null!=b)try{b=m.cloneCell(b),m.model.isVertex(b)&&null!=b.geometry&&(b.geometry.x=0,b.geometry.y=0)}catch(p){b=null}null==b&&(b=v(m.appendFontSize("text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;",m.vertexFontSize),40,20,"Text"),m.model.isVertex(b)&&m.isAutoSizeCell(b)&&Graph.createOffscreenGraph(m.getStylesheet()).updateCellSize(b));b=[b,v("whiteSpace=wrap;html=1;"),v("ellipse;whiteSpace=wrap;html=1;",80,80),v("rhombus;whiteSpace=wrap;html=1;",+g);var n=this.hoverIcons.drag;this.hoverIcons.drag=function(){e.hideShapePicker();n.apply(this,arguments)};var A=this.hoverIcons.execute;this.hoverIcons.execute=function(S,F,K){var c=K.getEvent();this.graph.isCloneEvent(c)||mxEvent.isShiftDown(c)?A.apply(this,arguments):this.graph.connectVertex(S.cell,F,this.graph.defaultEdgeLength,c,null,null,mxUtils.bind(this,function(f,l,t){var q=b.getCompositeParent(S.cell);f=b.getCellGeometry(q);for(K.consume();null!=q&&b.model.isVertex(q)&&null!=f&&f.relative;)cell=+q,q=b.model.getParent(cell),f=b.getCellGeometry(q);window.setTimeout(mxUtils.bind(this,function(){e.showShapePicker(K.getGraphX(),K.getGraphY(),q,mxUtils.bind(this,function(D){t(D);null!=e.hoverIcons&&e.hoverIcons.update(b.view.getState(D))}),F)}),30)}),mxUtils.bind(this,function(f){this.graph.selectCellsForConnectVertex(f,c,this)}))};var G=null;this.hoverIcons.addListener("focus",mxUtils.bind(this,function(S,F){null!=G&&window.clearTimeout(G);G=window.setTimeout(mxUtils.bind(this,function(){var K=+F.getProperty("arrow"),c=F.getProperty("direction"),f=F.getProperty("event");K=K.getBoundingClientRect();var l=mxUtils.getOffset(b.container),t=b.container.scrollLeft+K.x-l.x;l=b.container.scrollTop+K.y-l.y;var q=b.getCompositeParent(null!=this.hoverIcons.currentState?this.hoverIcons.currentState.cell:null),D=e.showShapePicker(t,l,q,mxUtils.bind(this,function(H){null!=H&&b.connectVertex(q,c,b.defaultEdgeLength,f,!0,!1,function(N,L,J){J(H);null!=e.hoverIcons&&e.hoverIcons.update(b.view.getState(H))},+function(N){b.selectCellsForConnectVertex(N)},f,this.hoverIcons)}),c,!0);null!=D&&(this.centerShapePicker(D,K,t,l,c),mxUtils.setOpacity(D,30),mxEvent.addListener(D,"mouseenter",function(){mxUtils.setOpacity(D,100)}),mxEvent.addListener(D,"mouseleave",function(){e.hideShapePicker()}))}),Editor.shapePickerHoverDelay)}));this.hoverIcons.addListener("blur",mxUtils.bind(this,function(S,F){null!=G&&window.clearTimeout(G)}))}};+EditorUi.prototype.centerShapePicker=function(b,e,g,m,v){if(v==mxConstants.DIRECTION_EAST||v==mxConstants.DIRECTION_WEST)b.style.width="40px";var n=b.getBoundingClientRect();v==mxConstants.DIRECTION_NORTH?(g-=n.width/2-10,m-=n.height+6):v==mxConstants.DIRECTION_SOUTH?(g-=n.width/2-10,m+=e.height+6):v==mxConstants.DIRECTION_WEST?(g-=n.width+6,m-=n.height/2-10):v==mxConstants.DIRECTION_EAST&&(g+=e.width+6,m-=n.height/2-10);b.style.left=g+"px";b.style.top=m+"px"};+EditorUi.prototype.showShapePicker=function(b,e,g,m,v,n,A,G,S){var F=null;this.editor.graph.freehand.isDrawing()||(G=G||null==g,F=this.createShapePicker(b,e,g,m,v,mxUtils.bind(this,function(){this.hideShapePicker()}),this.getCellsForShapePicker(g,n,G),n,A,G,S),null!=F&&(null==this.hoverIcons||n||this.hoverIcons.reset(),b=this.editor.graph,b.popupMenuHandler.hideMenu(),b.tooltipHandler.hideTooltip(),this.hideCurrentMenu(),this.hideShapePicker(),this.shapePickerCallback=m,this.shapePicker=F));return F};+EditorUi.prototype.createShapePicker=function(b,e,g,m,v,n,A,G,S,F,K){K=null!=K?K:!0;var c=this.editor.graph,f=null;S=null!=S?S:function(q){q=q[0];var D=0,H=0,N=q.geometry;null!=N&&(c.model.isEdge(q)&&(q=N.getTerminalPoint(!1),N=new mxRectangle(0,0,q.x,q.y)),D=N.width/2,H=N.height/2);return new mxPoint(c.snap(Math.round(b/c.view.scale)-c.view.translate.x-D),c.snap(Math.round(e/c.view.scale)-c.view.translate.y-H))};if(null!=A&&0<A.length){var l=this;c=this.editor.graph;f=document.createElement("div");+v=c.view.getState(g);var t=null==g||null!=v&&c.isTransparentState(v)?null:c.copyStyle(g);f.className="geShapePicker";f.setAttribute("title",mxResources.get("sidebarTooltip"));f.style.left=Math.round(b)+"px";f.style.top=Math.round(e)+"px";mxClient.IS_POINTER&&(f.style.touchAction="none");G||mxUtils.setPrefixedStyle(f.style,"transform","translate(-22px,-22px)");c.container.appendChild(f);v=mxUtils.bind(this,function(q){var D=document.createElement("a");f.appendChild(D);null!=t&&"1"!=urlParams.sketch?+this.sidebar.graph.pasteStyle(t,[q]):this.sidebar.graph.pasteCellStyles([q],c.currentVertexStyle,c.currentEdgeStyle);var H=q.geometry;c.model.isEdge(q)&&(H=H.getTerminalPoint(!1),H=new mxRectangle(0,0,H.x,H.y));null!=H&&(H=this.sidebar.createVertexTemplateFromCells([q],H.width,H.height,"",!0,!1,null,!1,mxUtils.bind(this,function(N){if(!mxEvent.isShiftDown(N)||null==g&&c.isSelectionEmpty()){var L=c.cloneCell(q);if(null!=m)m(L);else{var J=S([L]);c.model.isEdge(L)?L.geometry.translate(J.x,J.y):(L.geometry.x=+J.x,L.geometry.y=J.y);c.model.beginUpdate();try{c.addCell(L),c.model.isVertex(L)&&c.isAutoSizeCell(L)&&c.updateCellSize(L)}finally{c.model.endUpdate()}c.setSelectionCell(L);c.scrollCellToVisible(L);K&&c.startEditing(L);null!=l.hoverIcons&&l.hoverIcons.update(c.view.getState(L))}}else L=c.getEditableCells(null!=g?[g]:c.getSelectionCells()),c.updateShapes(q,L);null!=n&&n(N);mxEvent.consume(N)}),25,25,null,null,g),H.style.display="flex",H.style.alignItems="center",H.style.justifyContent="center",D.appendChild(H))});+for(F=0;F<(G?Math.min(A.length,4):A.length);F++)v(A[F]);A=f.offsetTop+f.clientHeight-(c.container.scrollTop+c.container.offsetHeight);0<A&&(f.style.top=Math.max(c.container.scrollTop+22,e-A)+"px");A=f.offsetLeft+f.clientWidth-(c.container.scrollLeft+c.container.offsetWidth);0<A&&(f.style.left=Math.max(c.container.scrollLeft+22,b-A)+"px")}return f};+EditorUi.prototype.getCellsForShapePicker=function(b,e,g){var m=this.editor.graph,v=mxUtils.bind(this,function(n,A,G,S){return m.createVertex(null,null,S||"",0,0,A||120,G||60,n,!1)});e=mxUtils.bind(this,function(n,A,G){n=new mxCell(G||"",new mxGeometry(0,0,m.defaultEdgeLength+20,0),n);n.geometry.setTerminalPoint(new mxPoint(0,0),!0);n.geometry.setTerminalPoint(new mxPoint(n.geometry.width,null!=A?A:0),!1);n.geometry.points=null!=A?[new mxPoint(n.geometry.width/2,A)]:[];n.geometry.relative=!0;n.edge=+!0;return n});if(null!=b)try{b=m.cloneCell(b),m.model.isVertex(b)&&null!=b.geometry&&(b.geometry.x=0,b.geometry.y=0)}catch(n){b=null}null==b&&(b=v(m.appendFontSize("text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;",m.vertexFontSize),40,20,"Text"),m.model.isVertex(b)&&m.isAutoSizeCell(b)&&Graph.createOffscreenGraph(m.getStylesheet()).updateCellSize(b));b=[b,v("whiteSpace=wrap;html=1;"),v("ellipse;whiteSpace=wrap;html=1;",80,80),v("rhombus;whiteSpace=wrap;html=1;",80,80),v("rounded=1;whiteSpace=wrap;html=1;"),v("shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;"),v("shape=trapezoid;perimeter=trapezoidPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,60),v("shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;",120,80),v("shape=step;perimeter=stepPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,80),v("shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;"),v("triangle;whiteSpace=wrap;html=1;",60,80),v("shape=document;whiteSpace=wrap;html=1;boundedLbl=1;",120,80),v("shape=tape;whiteSpace=wrap;html=1;",120,100),v("ellipse;shape=cloud;whiteSpace=wrap;html=1;",120,80),v("shape=singleArrow;whiteSpace=wrap;html=1;arrowWidth=0.4;arrowSize=0.4;",80,60),v("shape=waypoint;sketch=0;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;rotatable=0;perimeter=centerPerimeter;snapToPoint=1;",20,20)];g&&(b=b.concat([e("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;"),e("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;startArrow=classic;endSize=8;startSize=8;"),e("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;rounded=1;startSize=8;endSize=8;"),e("edgeStyle=segmentEdgeStyle;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;",this.editor.graph.defaultEdgeLength/2)]));return b};EditorUi.prototype.isShapePickerVisible=function(b){return null!=this.shapePicker};EditorUi.prototype.hideShapePicker=function(b){null!=this.shapePicker&&(this.shapePicker.parentNode.removeChild(this.shapePicker),this.shapePicker=null,b||null==this.shapePickerCallback||this.shapePickerCallback(),this.shapePickerCallback=null)};EditorUi.prototype.isSpaceDown=function(){return this.spaceDown};EditorUi.prototype.isShiftDown=function(){return this.shiftDown};EditorUi.prototype.onKeyDown=function(b){var e=this.editor.graph;if(9==b.which&&e.isEnabled()&&!mxEvent.isControlDown(b)){if(e.isEditing())if(mxEvent.isAltDown(b))e.stopEditing(!1);else try{var g=e.cellEditor.isContentEditing()&&e.cellEditor.isTextSelected();if(window.getSelection&&e.cellEditor.isContentEditing()&&!g&&!mxClient.IS_IE&&!mxClient.IS_IE11){var m=window.getSelection(),v=0<m.rangeCount?m.getRangeAt(0).commonAncestorContainer:null;g=null!=v&&("LI"==v.nodeName||null!=v.parentNode&&"LI"==-v.parentNode.nodeName)}g?document.execCommand(mxEvent.isShiftDown(b)?"outdent":"indent",!1,null):mxEvent.isShiftDown(b)?e.stopEditing(!1):e.cellEditor.insertTab(e.cellEditor.isContentEditing()?null:4)}catch(p){}else mxEvent.isAltDown(b)?e.selectParentCell():e.selectCell(!mxEvent.isShiftDown(b));mxEvent.consume(b)}};+v.parentNode.nodeName)}g?document.execCommand(mxEvent.isShiftDown(b)?"outdent":"indent",!1,null):mxEvent.isShiftDown(b)?e.stopEditing(!1):e.cellEditor.insertTab(e.cellEditor.isContentEditing()?null:4)}catch(n){}else mxEvent.isAltDown(b)?e.selectParentCell():e.selectCell(!mxEvent.isShiftDown(b));mxEvent.consume(b)}};EditorUi.prototype.onKeyPress=function(b){var e=this.editor.graph;!this.isImmediateEditingEvent(b)||e.isEditing()||e.isSelectionEmpty()||0===b.which||27===b.which||mxEvent.isAltDown(b)||mxEvent.isControlDown(b)||mxEvent.isMetaDown(b)||(e.escape(),e.startEditing(null,String.fromCharCode(b.which)))};EditorUi.prototype.isImmediateEditingEvent=function(b){return!0};EditorUi.prototype.updateCssForMarker=function(b,e,g,m,v){g=this.getImageForMarker(m,v,g);b.innerHTML="";null==g?b.innerHTML=mxUtils.htmlEntities(mxResources.get("none")):(m=document.createElement("img"),m.setAttribute("src",g),"end"==e&&mxUtils.setPrefixedStyle(m.style,"transform","scaleX(-1)"),b.appendChild(m))};EditorUi.prototype.getImageForMarker=function(b,e,g){return"flexArrow"==g?null!=b&&b!=mxConstants.NONE?Format.blockMarkerImage.src:null:b==mxConstants.ARROW_CLASSIC?"1"!=e?Format.classicMarkerImage.src:Format.classicFilledMarkerImage.src:b==mxConstants.ARROW_CLASSIC_THIN?"1"!=e?Format.classicThinMarkerImage.src:Format.openThinFilledMarkerImage.src:b==mxConstants.ARROW_OPEN?Format.openFilledMarkerImage.src:b==mxConstants.ARROW_OPEN_THIN?Format.openThinFilledMarkerImage.src:b==mxConstants.ARROW_BLOCK?@@ -2108,9 +2112,9 @@ EditorUi.prototype.getImageForMarker=function(b,e,g){return"flexArrow"==g?null!=b?"1"!=e?Format.doubleBlockMarkerImage.src:Format.doubleBlockFilledMarkerImage.src:"box"==b?Format.boxMarkerImage.src:"halfCircle"==b?Format.halfCircleMarkerImage.src:"openAsync"==b?Format.openAsyncFilledMarkerImage.src:"async"==b?"1"!=e?Format.asyncMarkerImage.src:Format.asyncFilledMarkerImage.src:"dash"==b?Format.dashMarkerImage.src:"baseDash"==b?Format.baseDashMarkerImage.src:"cross"==b?Format.crossMarkerImage.src:"circle"==b?Format.circleMarkerImage.src:"circlePlus"==b?Format.circlePlusMarkerImage.src:"ERone"==b?Format.EROneMarkerImage.src:"ERmandOne"==b?Format.ERmandOneMarkerImage.src:"ERmany"==b?Format.ERmanyMarkerImage.src:"ERoneToMany"==b?Format.ERoneToManyMarkerImage.src:"ERzeroToOne"==b?Format.ERzeroToOneMarkerImage.src:"ERzeroToMany"==b?Format.ERzeroToManyMarkerImage.src:null};EditorUi.prototype.createMenus=function(){return null};EditorUi.prototype.updatePasteActionStates=function(){var b=this.editor.graph,e=this.actions.get("paste"),g=this.actions.get("pasteHere");e.setEnabled(this.editor.graph.cellEditor.isContentEditing()||(!mxClient.IS_FF&&null!=navigator.clipboard||!mxClipboard.isEmpty())&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent()));g.setEnabled(e.isEnabled())};-EditorUi.prototype.initClipboard=function(){var b=this,e=mxClipboard.cut;mxClipboard.cut=function(p){p.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):e.apply(this,arguments);b.updatePasteActionStates()};mxClipboard.copy=function(p){var A=null;if(p.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{A=A||p.getSelectionCells();A=p.getExportableCells(p.model.getTopmostCells(A));for(var H={},S=p.createCellLookup(A),F=p.cloneCells(A,null,H),K=new mxGraphModel,c=K.getChildAt(K.getRoot(),-0),f=0;f<F.length;f++){K.add(c,F[f]);var l=p.view.getState(A[f]);if(null!=l){var t=p.getCellGeometry(F[f]);null!=t&&t.relative&&!K.isEdge(A[f])&&null==S[mxObjectIdentity.get(K.getParent(A[f]))]&&(t.offset=null,t.relative=!1,t.x=l.x/l.view.scale-l.view.translate.x,t.y=l.y/l.view.scale-l.view.translate.y)}}p.updateCustomLinks(p.createCellMapping(H,S),F);mxClipboard.insertCount=1;mxClipboard.setCells(F)}b.updatePasteActionStates();return A};var g=mxClipboard.paste;mxClipboard.paste=function(p){var A=-null;p.cellEditor.isContentEditing()?document.execCommand("paste",!1,null):A=g.apply(this,arguments);b.updatePasteActionStates();return A};var m=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){m.apply(this,arguments);b.updatePasteActionStates()};var v=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(p,A){v.apply(this,arguments);b.updatePasteActionStates()};this.updatePasteActionStates()};+EditorUi.prototype.initClipboard=function(){var b=this,e=mxClipboard.cut;mxClipboard.cut=function(n){n.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):e.apply(this,arguments);b.updatePasteActionStates()};mxClipboard.copy=function(n){var A=null;if(n.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{A=A||n.getSelectionCells();A=n.getExportableCells(n.model.getTopmostCells(A));for(var G={},S=n.createCellLookup(A),F=n.cloneCells(A,null,G),K=new mxGraphModel,c=K.getChildAt(K.getRoot(),+0),f=0;f<F.length;f++){K.add(c,F[f]);var l=n.view.getState(A[f]);if(null!=l){var t=n.getCellGeometry(F[f]);null!=t&&t.relative&&!K.isEdge(A[f])&&null==S[mxObjectIdentity.get(K.getParent(A[f]))]&&(t.offset=null,t.relative=!1,t.x=l.x/l.view.scale-l.view.translate.x,t.y=l.y/l.view.scale-l.view.translate.y)}}n.updateCustomLinks(n.createCellMapping(G,S),F);mxClipboard.insertCount=1;mxClipboard.setCells(F)}b.updatePasteActionStates();return A};var g=mxClipboard.paste;mxClipboard.paste=function(n){var A=+null;n.cellEditor.isContentEditing()?document.execCommand("paste",!1,null):A=g.apply(this,arguments);b.updatePasteActionStates();return A};var m=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){m.apply(this,arguments);b.updatePasteActionStates()};var v=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(n,A){v.apply(this,arguments);b.updatePasteActionStates()};this.updatePasteActionStates()};EditorUi.prototype.lazyZoomDelay=20;EditorUi.prototype.wheelZoomDelay=500;EditorUi.prototype.buttonZoomDelay=600;EditorUi.prototype.initCanvas=function(){var b=this.editor.graph;b.timerAutoScroll=!0;b.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((b.container.offsetWidth-34)/b.view.scale)),Math.max(0,Math.round((b.container.offsetHeight-34)/b.view.scale)))};b.view.getBackgroundPageBounds=function(){var P=this.graph.getPageLayout(),T=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+P.x*T.width),this.scale*(this.translate.y+P.y*T.height),this.scale*P.width*T.width,this.scale*P.height*T.height)};b.getPreferredPageSize=function(P,T,X){P=this.getPageLayout();T=this.getPageSize();return new mxRectangle(0,0,P.width*T.width,P.height*T.height)};var e=null,g=this;if(this.editor.isChromelessView()){this.chromelessResize=e=mxUtils.bind(this,function(P,T,X,Z){if(null!=b.container&&!b.isViewer()){X=null!=X?X:0;Z=null!=Z?Z:0;var ka=b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds(),va=mxUtils.hasScrollbars(b.container),ua=b.view.translate,qa=b.view.scale,@@ -2118,24 +2122,24 @@ Ba=mxRectangle.fromRectangle(ka);Ba.x=Ba.x/qa-ua.x;Ba.y=Ba.y/qa-ua.y;Ba.width/=q0));if(va||ka.width<za||ka.height<La)b.view.scaleAndTranslate(P,Math.floor(T-Ba.x),Math.floor(Ea-Ba.y)),b.container.scrollTop=ua*P/qa,b.container.scrollLeft=ya*P/qa;else if(0!=X||0!=Z)ka=b.view.translate,b.view.setTranslate(Math.floor(ka.x+X/qa),Math.floor(ka.y+Z/qa))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var m=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",m);this.destroyFunctions.push(function(){mxEvent.removeListener(window,"resize",m)});this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(P){b.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(P){b.zoomOut();this.chromelessResize(!1)});if("0"!=urlParams.toolbar){var v=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position="fixed";this.chromelessToolbar.style.overflow="hidden";this.chromelessToolbar.style.boxSizing="border-box";this.chromelessToolbar.style.whiteSpace="nowrap";this.chromelessToolbar.style.padding="10px 10px 8px 10px";this.chromelessToolbar.style.left=b.isViewer()?"0":"50%";mxClient.IS_IE||mxClient.IS_IE11?(this.chromelessToolbar.style.backgroundColor="#ffffff",this.chromelessToolbar.style.border="3px solid black"):this.chromelessToolbar.style.backgroundColor="#000000";mxUtils.setPrefixedStyle(this.chromelessToolbar.style,-"borderRadius","16px");mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out");var p=mxUtils.bind(this,function(){var P=mxUtils.getCurrentStyle(b.container);b.isViewer()?this.chromelessToolbar.style.top="0":this.chromelessToolbar.style.bottom=(null!=P?parseInt(P["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",p);p();var A=0;p=mxUtils.bind(this,function(P,T,X){A++;-var Z=document.createElement("span");Z.style.paddingLeft="8px";Z.style.paddingRight="8px";Z.style.cursor="pointer";mxEvent.addListener(Z,"click",P);null!=X&&Z.setAttribute("title",X);P=document.createElement("img");P.setAttribute("border","0");P.setAttribute("src",T);P.style.width="36px";P.style.filter="invert(100%)";Z.appendChild(P);this.chromelessToolbar.appendChild(Z);return Z});if(null!=v.backBtn){var H=Graph.sanitizeLink(v.backBtn.url);null!=H&&p(mxUtils.bind(this,function(P){window.location.href=-H;mxEvent.consume(P)}),Editor.backImage,mxResources.get("back",null,"Back"))}if(this.isPagesEnabled()){var S=p(mxUtils.bind(this,function(P){this.actions.get("previousPage").funct();mxEvent.consume(P)}),Editor.chevronLeftImage,mxResources.get("previousPage")),F=document.createElement("div");F.style.fontFamily=Editor.defaultHtmlFont;F.style.display="inline-block";F.style.verticalAlign="top";F.style.fontWeight="bold";F.style.marginTop="8px";F.style.fontSize="14px";F.style.cursor="default";F.style.color=-mxClient.IS_IE||mxClient.IS_IE11?"#000000":"#ffffff";this.chromelessToolbar.appendChild(F);var K=p(mxUtils.bind(this,function(P){this.actions.get("nextPage").funct();mxEvent.consume(P)}),Editor.chevronRightImage,mxResources.get("nextPage")),c=mxUtils.bind(this,function(){if(null!=this.pages&&1<this.pages.length&&null!=this.currentPage){F.innerText="";var P=mxUtils.indexOf(this.pages,this.currentPage);mxUtils.write(F,P+1+" / "+this.pages.length);F.setAttribute("title",mxResources.get("currentPage")++"borderRadius","16px");mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out");var n=mxUtils.bind(this,function(){var P=mxUtils.getCurrentStyle(b.container);b.isViewer()?this.chromelessToolbar.style.top="0":this.chromelessToolbar.style.bottom=(null!=P?parseInt(P["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",n);n();var A=0;n=mxUtils.bind(this,function(P,T,X){A++;+var Z=document.createElement("span");Z.style.paddingLeft="8px";Z.style.paddingRight="8px";Z.style.cursor="pointer";mxEvent.addListener(Z,"click",P);null!=X&&Z.setAttribute("title",X);P=document.createElement("img");P.setAttribute("border","0");P.setAttribute("src",T);P.style.width="36px";P.style.filter="invert(100%)";Z.appendChild(P);this.chromelessToolbar.appendChild(Z);return Z});if(null!=v.backBtn){var G=Graph.sanitizeLink(v.backBtn.url);null!=G&&n(mxUtils.bind(this,function(P){window.location.href=+G;mxEvent.consume(P)}),Editor.backImage,mxResources.get("back",null,"Back"))}if(this.isPagesEnabled()){var S=n(mxUtils.bind(this,function(P){this.actions.get("previousPage").funct();mxEvent.consume(P)}),Editor.chevronLeftImage,mxResources.get("previousPage")),F=document.createElement("div");F.style.fontFamily=Editor.defaultHtmlFont;F.style.display="inline-block";F.style.verticalAlign="top";F.style.fontWeight="bold";F.style.marginTop="8px";F.style.fontSize="14px";F.style.cursor="default";F.style.color=+mxClient.IS_IE||mxClient.IS_IE11?"#000000":"#ffffff";this.chromelessToolbar.appendChild(F);var K=n(mxUtils.bind(this,function(P){this.actions.get("nextPage").funct();mxEvent.consume(P)}),Editor.chevronRightImage,mxResources.get("nextPage")),c=mxUtils.bind(this,function(){if(null!=this.pages&&1<this.pages.length&&null!=this.currentPage){F.innerText="";var P=mxUtils.indexOf(this.pages,this.currentPage);mxUtils.write(F,P+1+" / "+this.pages.length);F.setAttribute("title",mxResources.get("currentPage")+": "+this.currentPage.getName());S.setAttribute("title",mxResources.get("previousPage")+": "+this.pages[mxUtils.mod(P-1,this.pages.length)].getName());K.setAttribute("title",mxResources.get("nextPage")+": "+this.pages[mxUtils.mod(P+1,this.pages.length)].getName())}});S.style.paddingLeft="0px";S.style.paddingRight="4px";K.style.paddingLeft="4px";K.style.paddingRight="0px";var f=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(K.style.display="",S.style.display="",F.style.display="inline-block"):(K.style.display="none",S.style.display="none",F.style.display="none");c()});if(null!=this.menus){var l=this.menus.get("pages");null!=l&&mxEvent.addListener(F,"click",mxUtils.bind(this,function(P){var T=new mxPopupMenu(l.funct);T.smartSeparators=!0;T.showDisabled=!0;T.autoExpand=!0;T.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(T,arguments);T.destroy()});var X=mxUtils.getOffset(F);T.popup(X.x,X.y+F.offsetHeight,null,P);mxEvent.addListener(T.div,-"mouseleave",mxUtils.bind(this,function(){T.hideMenu()}))}))}this.editor.addListener("resetGraphView",f);this.editor.addListener("pageSelected",c)}p(mxUtils.bind(this,function(P){this.actions.get("zoomOut").funct();mxEvent.consume(P)}),Editor.zoomOutImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");p(mxUtils.bind(this,function(P){this.actions.get("zoomIn").funct();mxEvent.consume(P)}),Editor.zoomInImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");p(mxUtils.bind(this,function(P){b.isLightboxView()?+"mouseleave",mxUtils.bind(this,function(){T.hideMenu()}))}))}this.editor.addListener("resetGraphView",f);this.editor.addListener("pageSelected",c)}n(mxUtils.bind(this,function(P){this.actions.get("zoomOut").funct();mxEvent.consume(P)}),Editor.zoomOutImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");n(mxUtils.bind(this,function(P){this.actions.get("zoomIn").funct();mxEvent.consume(P)}),Editor.zoomInImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");n(mxUtils.bind(this,function(P){b.isLightboxView()?(1==b.view.scale?this.lightboxFit():b.zoomTo(1),this.chromelessResize(!1)):this.chromelessResize(!0);mxEvent.consume(P)}),Editor.zoomFitImage,mxResources.get("fit"));var t=null,q=null,D=mxUtils.bind(this,function(P){null!=t&&(window.clearTimeout(t),t=null);null!=q&&(window.clearTimeout(q),q=null);t=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);t=null;q=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";q=null}),-600)}),P||200)}),G=mxUtils.bind(this,function(P){null!=t&&(window.clearTimeout(t),t=null);null!=q&&(window.clearTimeout(q),q=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,P||30)});if("1"==urlParams.layers){this.layersDialog=null;var N=p(mxUtils.bind(this,function(P){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=b.createLayersDialog(mxUtils.bind(this,function(){this.chromelessResize&&+600)}),P||200)}),H=mxUtils.bind(this,function(P){null!=t&&(window.clearTimeout(t),t=null);null!=q&&(window.clearTimeout(q),q=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,P||30)});if("1"==urlParams.layers){this.layersDialog=null;var N=n(mxUtils.bind(this,function(P){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=b.createLayersDialog(mxUtils.bind(this,function(){this.chromelessResize&&this.chromelessResize()}),!0);mxEvent.addListener(this.layersDialog,"mouseleave",mxUtils.bind(this,function(){this.layersDialog.parentNode.removeChild(this.layersDialog);this.layersDialog=null}));var T=N.getBoundingClientRect();mxUtils.setPrefixedStyle(this.layersDialog.style,"borderRadius","5px");this.layersDialog.style.position="fixed";this.layersDialog.style.fontFamily=Editor.defaultHtmlFont;this.layersDialog.style.width="160px";this.layersDialog.style.padding="4px 2px 4px 2px";this.layersDialog.style.left=T.left+"px";this.layersDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";mxClient.IS_IE||mxClient.IS_IE11?(this.layersDialog.style.backgroundColor="#ffffff",this.layersDialog.style.border="2px solid black",this.layersDialog.style.color="#000000"):(this.layersDialog.style.backgroundColor="#000000",this.layersDialog.style.color="#ffffff",mxUtils.setOpacity(this.layersDialog,80));T=mxUtils.getCurrentStyle(this.editor.graph.container);this.layersDialog.style.zIndex=-T.zIndex;document.body.appendChild(this.layersDialog);this.editor.fireEvent(new mxEventObject("layersDialogShown"))}mxEvent.consume(P)}),Editor.layersImage,mxResources.get("layers")),L=b.getModel();L.addListener(mxEvent.CHANGE,function(){N.style.display=1<L.getChildCount(L.root)?"":"none"})}("1"!=urlParams.openInSameWin||navigator.standalone)&&this.addChromelessToolbarItems(p);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||p(mxUtils.bind(this,function(P){null!=this.editor.editButtonFunc?-this.editor.editButtonFunc():"_blank"==this.editor.editButtonLink?this.editor.editAsNew(this.getEditBlankXml()):b.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(P)}),Editor.editImage,mxResources.get("edit"));if(null!=this.lightboxToolbarActions)for(f=0;f<this.lightboxToolbarActions.length;f++){var J=this.lightboxToolbarActions[f];J.elem=p(J.fn,J.icon,J.tooltip)}if(null!=v.refreshBtn){var Y=null==v.refreshBtn.url?null:Graph.sanitizeLink(v.refreshBtn.url);p(mxUtils.bind(this,function(P){null!=-Y?window.location.href=Y:window.location.reload();mxEvent.consume(P)}),Editor.refreshImage,mxResources.get("refresh",null,"Refresh"))}null!=v.fullscreenBtn&&window.self!==window.top&&p(mxUtils.bind(this,function(P){v.fullscreenBtn.url?b.openLink(v.fullscreenBtn.url):b.openLink(window.location.href);mxEvent.consume(P)}),Editor.fullscreenImage,mxResources.get("openInNewWindow",null,"Open in New Window"));!v.noCloseBtn&&(v.closeBtn&&window.self===window.top||b.lightbox&&("1"==urlParams.close||this.container!=-document.body))&&p(mxUtils.bind(this,function(P){"1"==urlParams.close||v.closeBtn?window.close():(this.destroy(),mxEvent.consume(P))}),Editor.closeImage,mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";b.isViewer()||mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");b.container.appendChild(this.chromelessToolbar);mxEvent.addListener(b.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(P){mxEvent.isTouchEvent(P)||-(mxEvent.isShiftDown(P)||G(30),D())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(P){mxEvent.consume(P)});mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(P){b.tooltipHandler.resetTimer();b.tooltipHandler.hideTooltip();mxEvent.isShiftDown(P)?D():G(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(P){mxEvent.isShiftDown(P)?D():G(100);mxEvent.consume(P)}));mxEvent.addListener(this.chromelessToolbar,-"mouseleave",mxUtils.bind(this,function(P){mxEvent.isTouchEvent(P)||G(30)}));var ha=b.getTolerance();b.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(P,T){this.startX=T.getGraphX();this.startY=T.getGraphY();this.scrollLeft=b.container.scrollLeft;this.scrollTop=b.container.scrollTop},mouseMove:function(P,T){},mouseUp:function(P,T){mxEvent.isTouchEvent(T.getEvent())&&Math.abs(this.scrollLeft-b.container.scrollLeft)<ha&&Math.abs(this.scrollTop-b.container.scrollTop)<-ha&&Math.abs(this.startX-T.getGraphX())<ha&&Math.abs(this.startY-T.getGraphY())<ha&&(0<parseFloat(g.chromelessToolbar.style.opacity||0)?D():G(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var ea=b.view.validate,aa=new mxPoint,na=!1,W=null;b.view.validate=function(){if(null!=b.container&&mxUtils.hasScrollbars(b.container)){if(null!=g.currentPage&&W!=g.currentPage){W=g.currentPage;na=!0;var P=b.getBoundingBoxFromGeometry(b.model.getCells(),!0,null,+T.zIndex;document.body.appendChild(this.layersDialog);this.editor.fireEvent(new mxEventObject("layersDialogShown"))}mxEvent.consume(P)}),Editor.layersImage,mxResources.get("layers")),L=b.getModel();L.addListener(mxEvent.CHANGE,function(){N.style.display=1<L.getChildCount(L.root)?"":"none"})}("1"!=urlParams.openInSameWin||navigator.standalone)&&this.addChromelessToolbarItems(n);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||n(mxUtils.bind(this,function(P){null!=this.editor.editButtonFunc?+this.editor.editButtonFunc():"_blank"==this.editor.editButtonLink?this.editor.editAsNew(this.getEditBlankXml()):b.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(P)}),Editor.editImage,mxResources.get("edit"));if(null!=this.lightboxToolbarActions)for(f=0;f<this.lightboxToolbarActions.length;f++){var J=this.lightboxToolbarActions[f];J.elem=n(J.fn,J.icon,J.tooltip)}if(null!=v.refreshBtn){var Y=null==v.refreshBtn.url?null:Graph.sanitizeLink(v.refreshBtn.url);n(mxUtils.bind(this,function(P){null!=+Y?window.location.href=Y:window.location.reload();mxEvent.consume(P)}),Editor.refreshImage,mxResources.get("refresh",null,"Refresh"))}null!=v.fullscreenBtn&&window.self!==window.top&&n(mxUtils.bind(this,function(P){v.fullscreenBtn.url?b.openLink(v.fullscreenBtn.url):b.openLink(window.location.href);mxEvent.consume(P)}),Editor.fullscreenImage,mxResources.get("openInNewWindow",null,"Open in New Window"));!v.noCloseBtn&&(v.closeBtn&&window.self===window.top||b.lightbox&&("1"==urlParams.close||this.container!=+document.body))&&n(mxUtils.bind(this,function(P){"1"==urlParams.close||v.closeBtn?window.close():(this.destroy(),mxEvent.consume(P))}),Editor.closeImage,mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";b.isViewer()||mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");b.container.appendChild(this.chromelessToolbar);mxEvent.addListener(b.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(P){mxEvent.isTouchEvent(P)||+(mxEvent.isShiftDown(P)||H(30),D())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(P){mxEvent.consume(P)});mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(P){b.tooltipHandler.resetTimer();b.tooltipHandler.hideTooltip();mxEvent.isShiftDown(P)?D():H(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(P){mxEvent.isShiftDown(P)?D():H(100);mxEvent.consume(P)}));mxEvent.addListener(this.chromelessToolbar,+"mouseleave",mxUtils.bind(this,function(P){mxEvent.isTouchEvent(P)||H(30)}));var ha=b.getTolerance();b.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(P,T){this.startX=T.getGraphX();this.startY=T.getGraphY();this.scrollLeft=b.container.scrollLeft;this.scrollTop=b.container.scrollTop},mouseMove:function(P,T){},mouseUp:function(P,T){mxEvent.isTouchEvent(T.getEvent())&&Math.abs(this.scrollLeft-b.container.scrollLeft)<ha&&Math.abs(this.scrollTop-b.container.scrollTop)<+ha&&Math.abs(this.startX-T.getGraphX())<ha&&Math.abs(this.startY-T.getGraphY())<ha&&(0<parseFloat(g.chromelessToolbar.style.opacity||0)?D():H(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var ea=b.view.validate,aa=new mxPoint,na=!1,W=null;b.view.validate=function(){if(null!=b.container&&mxUtils.hasScrollbars(b.container)){if(null!=g.currentPage&&W!=g.currentPage){W=g.currentPage;na=!0;var P=b.getBoundingBoxFromGeometry(b.model.getCells(),!0,null,!0);null==P&&(P=new mxRectangle(b.view.translate.x*b.view.scale,b.view.translate.y*b.view.scale));P=b.getPageLayout(P,aa,1);var T=b.getDefaultTranslate(P);this.x0=P.x;this.y0=P.y;if(T.x!=this.translate.x||T.y!=this.translate.y)this.invalidate(),this.translate.x=T.x,this.translate.y=T.y}T=b.getPagePadding();var X=b.getPageSize();P=T.x-(this.x0||0)*X.width;T=T.y-(this.y0||0)*X.height;if(this.translate.x!=P||this.translate.y!=T)this.invalidate(),this.translate.x=P,this.translate.y=T}ea.apply(this,arguments)};if(!b.isViewer()){var ba=b.sizeDidChange;b.sizeDidChange=function(){var P=na;na=!1;if(null!=this.container&&mxUtils.hasScrollbars(this.container)){this.updateMinimumSize();if(!this.autoTranslate){var T=this.getPageLayout(),X=this.getDefaultTranslate(T),Z=this.view.translate.x,ka=this.view.translate.y;if(X.x!=Z||X.y!=ka){this.view.x0=T.x;this.view.y0=T.y;this.autoTranslate=!0;this.view.setTranslate(X.x,X.y);this.autoTranslate=!1;P||(this.container.scrollLeft+=Math.round((X.x-Z)*this.view.scale),this.container.scrollTop+=Math.round((X.y-ka)*this.view.scale));return}}ba.apply(this,arguments)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}var ja=b.view.getBackgroundPane(),ca=b.view.getDrawPane();b.cumulativeZoomFactor=1;var la=null,Q=null,k=null,B=null,I=null,U=function(P){null!=la&&window.clearTimeout(la);0<=P&&window.setTimeout(function(){if(!b.isMouseDown||B)la=window.setTimeout(mxUtils.bind(this,function(){b.isFastZoomEnabled()&&(null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node&&@@ -2166,10 +2170,10 @@ g.x,e.height+=g.height+g.y),b.fitWindow(e))};EditorUi.prototype.hasScrollbars=fuEditorUi.prototype.resetScrollbars=function(){var b=this.editor.graph,e=b.container;if(!this.editor.extendCanvas)e.scrollTop=0,e.scrollLeft=0,mxUtils.hasScrollbars(e)||b.view.setTranslate(0,0);else if(!this.editor.isChromelessView())if(mxUtils.hasScrollbars(e))if(b.pageVisible){var g=b.getPagePadding();e.scrollTop=Math.floor(g.y);e.scrollLeft=Math.floor(Math.min(g.x,(e.scrollWidth-e.clientWidth)/2));g=b.getGraphBounds();0<g.width&&0<g.height&&(g.x>e.scrollLeft+.9*e.clientWidth&&(e.scrollLeft=Math.min(g.x+g.width-e.clientWidth,g.x-10)),g.y>e.scrollTop+.9*e.clientHeight&&(e.scrollTop=Math.min(g.y+g.height-e.clientHeight,g.y-10)))}else if(g=b.getGraphBounds(),0==g.width&&0==g.height)e.scrollLeft=(e.scrollWidth-e.clientWidth)/2,e.scrollTop=(e.scrollHeight-e.clientHeight)/2;else{var m=Math.max(g.height,b.scrollTileSize.height*b.view.scale);e.scrollLeft=Math.floor(Math.max(0,g.x-Math.max(0,(e.clientWidth-Math.max(g.width,b.scrollTileSize.width*b.view.scale))/2)));e.scrollTop=Math.floor(Math.max(0,g.y-Math.max(20,(e.clientHeight-m)/4)))}else{g=mxRectangle.fromRectangle(b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds());m=b.view.translate;var v=b.view.scale;g.x=g.x/v-m.x;g.y=g.y/v-m.y;g.width/=v;g.height/=v;b.view.setTranslate(Math.floor(Math.max(0,(e.clientWidth-g.width)/2)-g.x+2),Math.floor((b.pageVisible?0:Math.max(0,(e.clientHeight-g.height)/4))-g.y+1))}};-EditorUi.prototype.setPageVisible=function(b){var e=this.editor.graph,g=mxUtils.hasScrollbars(e.container),m=0,v=0;g&&(m=e.view.translate.x*e.view.scale-e.container.scrollLeft,v=e.view.translate.y*e.view.scale-e.container.scrollTop);e.pageVisible=b;e.pageBreaksVisible=b;e.preferPageSize=b;e.view.validateBackground();if(g){var p=e.getSelectionCells();e.clearSelection();e.setSelectionCells(p)}e.sizeDidChange();g&&(e.container.scrollLeft=e.view.translate.x*e.view.scale-m,e.container.scrollTop=e.view.translate.y*+EditorUi.prototype.setPageVisible=function(b){var e=this.editor.graph,g=mxUtils.hasScrollbars(e.container),m=0,v=0;g&&(m=e.view.translate.x*e.view.scale-e.container.scrollLeft,v=e.view.translate.y*e.view.scale-e.container.scrollTop);e.pageVisible=b;e.pageBreaksVisible=b;e.preferPageSize=b;e.view.validateBackground();if(g){var n=e.getSelectionCells();e.clearSelection();e.setSelectionCells(n)}e.sizeDidChange();g&&(e.container.scrollLeft=e.view.translate.x*e.view.scale-m,e.container.scrollTop=e.view.translate.y*e.view.scale-v);e.defaultPageVisible=b;this.fireEvent(new mxEventObject("pageViewChanged"))};-EditorUi.prototype.installResizeHandler=function(b,e,g){e&&(b.window.setSize=function(v,p){if(!this.minimized){var A=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;v=Math.min(v,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.getX());p=Math.min(p,A-this.getY())}mxWindow.prototype.setSize.apply(this,arguments)});b.window.setLocation=function(v,p){var A=window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth,-H=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,S=parseInt(this.div.style.width),F=parseInt(this.div.style.height);v=Math.max(0,Math.min(v,A-S));p=Math.max(0,Math.min(p,H-F));this.getX()==v&&this.getY()==p||mxWindow.prototype.setLocation.apply(this,arguments);e&&!this.minimized&&this.setSize(S,F)};var m=mxUtils.bind(this,function(){var v=b.window.getX(),p=b.window.getY();b.window.setLocation(v,p)});mxEvent.addListener(window,"resize",m);b.destroy=function(){mxEvent.removeListener(window,+EditorUi.prototype.installResizeHandler=function(b,e,g){e&&(b.window.setSize=function(v,n){if(!this.minimized){var A=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;v=Math.min(v,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.getX());n=Math.min(n,A-this.getY())}mxWindow.prototype.setSize.apply(this,arguments)});b.window.setLocation=function(v,n){var A=window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth,+G=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,S=parseInt(this.div.style.width),F=parseInt(this.div.style.height);v=Math.max(0,Math.min(v,A-S));n=Math.max(0,Math.min(n,G-F));this.getX()==v&&this.getY()==n||mxWindow.prototype.setLocation.apply(this,arguments);e&&!this.minimized&&this.setSize(S,F)};var m=mxUtils.bind(this,function(){var v=b.window.getX(),n=b.window.getY();b.window.setLocation(v,n)});mxEvent.addListener(window,"resize",m);b.destroy=function(){mxEvent.removeListener(window,"resize",m);b.window.destroy();null!=g&&g()}};function ChangeGridColor(b,e){this.ui=b;this.color=e}ChangeGridColor.prototype.execute=function(){var b=this.ui.editor.graph.view.gridColor;this.ui.setGridColor(this.color);this.color=b};(function(){var b=new mxObjectCodec(new ChangeGridColor,["ui"]);mxCodecRegistry.register(b)})();function ChangePageSetup(b,e,g,m,v){this.ui=b;this.previousColor=this.color=e;this.previousImage=this.image=g;this.previousFormat=this.format=m;this.previousPageScale=this.pageScale=v;this.ignoreImage=this.ignoreColor=!1}ChangePageSetup.prototype.execute=function(){var b=this.ui.editor.graph;if(!this.ignoreColor){this.color=this.previousColor;var e=b.background;this.ui.setBackgroundColor(this.previousColor);this.previousColor=e}if(!this.ignoreImage){this.image=this.previousImage;e=b.backgroundImage;var g=this.previousImage;null!=g&&Graph.isPageLink(g.src)&&(g=this.ui.createImageForPageLink(g.src,this.ui.currentPage));this.ui.setBackgroundImage(g);this.previousImage=e}null!=this.previousFormat&&(this.format=this.previousFormat,@@ -2178,9 +2182,9 @@ e=b.pageFormat,this.previousFormat.width!=e.width||this.previousFormat.height!=eEditorUi.prototype.setFoldingEnabled=function(b){this.editor.graph.foldingEnabled=b;this.editor.graph.view.revalidate();this.fireEvent(new mxEventObject("foldingEnabledChanged"))};EditorUi.prototype.setPageFormat=function(b,e){e=null!=e?e:"1"==urlParams.sketch;this.editor.graph.pageFormat=b;e||(this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct());this.fireEvent(new mxEventObject("pageFormatChanged"))};EditorUi.prototype.setPageScale=function(b){this.editor.graph.pageScale=b;this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct();this.fireEvent(new mxEventObject("pageScaleChanged"))};EditorUi.prototype.setGridColor=function(b,e){e=null!=e?e:Editor.isDarkMode();var g=this.editor.graph;e?g.view.defaultDarkGridColor=b:g.view.defaultGridColor=b;g.view.gridColor="light-dark("+g.view.defaultGridColor+", "+g.view.defaultDarkGridColor+")";g.view.validateBackground();this.fireEvent(new mxEventObject("gridColorChanged"))};-EditorUi.prototype.addUndoListener=function(){var b=this.editor.undoManager,e=mxUtils.bind(this,function(){this.updateActionStates()});b.addListener(mxEvent.ADD,e);b.addListener(mxEvent.UNDO,e);b.addListener(mxEvent.REDO,e);b.addListener(mxEvent.CLEAR,e);var g=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){g.apply(this,arguments);e()};var m=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(v,p){m.apply(this,arguments);+EditorUi.prototype.addUndoListener=function(){var b=this.editor.undoManager,e=mxUtils.bind(this,function(){this.updateActionStates()});b.addListener(mxEvent.ADD,e);b.addListener(mxEvent.UNDO,e);b.addListener(mxEvent.REDO,e);b.addListener(mxEvent.CLEAR,e);var g=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){g.apply(this,arguments);e()};var m=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(v,n){m.apply(this,arguments);e()};e()};-EditorUi.prototype.updateActionStates=function(){for(var b=this.editor.graph,e=this.getSelectionState(),g=b.isEnabled()&&!b.isCellLocked(b.getDefaultParent()),m=!this.editor.chromeless||this.editor.editable,v="cut copy bold italic underline delete duplicate editStyle editTooltip editLink backgroundColor borderColor edit toFront toBack solid dashed pasteSize dotted fillColor gradientColor shadow fontColor formattedText rounded toggleRounded strokeColor sharp snapToGrid".split(" "),p=0;p<v.length;p++)this.actions.get(v[p]).setEnabled(0<+EditorUi.prototype.updateActionStates=function(){for(var b=this.editor.graph,e=this.getSelectionState(),g=b.isEnabled()&&!b.isCellLocked(b.getDefaultParent()),m=!this.editor.chromeless||this.editor.editable,v="cut copy bold italic underline delete duplicate editStyle editTooltip editLink backgroundColor borderColor edit toFront toBack solid dashed pasteSize dotted fillColor gradientColor shadow fontColor formattedText rounded toggleRounded strokeColor sharp snapToGrid".split(" "),n=0;n<v.length;n++)this.actions.get(v[n]).setEnabled(0<e.cells.length);this.actions.get("grid").setEnabled(m);this.actions.get("undo").setEnabled(this.canUndo()&&m);this.actions.get("redo").setEnabled(this.canRedo()&&m);this.actions.get("swap").setEnabled(2==e.cells.length&&2==e.vertices.length);this.actions.get("pasteSize").setEnabled(null!=this.copiedSize&&0<e.vertices.length);this.actions.get("pasteData").setEnabled(null!=this.copiedValue&&0<e.cells.length);this.actions.get("setAsDefaultStyle").setEnabled(1==b.getSelectionCount());this.actions.get("lockUnlock").setEnabled(!b.isSelectionEmpty());this.actions.get("bringForward").setEnabled(1==e.cells.length);this.actions.get("sendBackward").setEnabled(1==e.cells.length);this.actions.get("rotation").setEnabled(1==e.vertices.length);this.actions.get("wordWrap").setEnabled(1==e.vertices.length);this.actions.get("autosize").setEnabled(0<e.vertices.length);this.actions.get("copySize").setEnabled(1==e.vertices.length);this.actions.get("clearWaypoints").setEnabled(e.connections);this.actions.get("clearAnchors").setEnabled(e.connections);this.actions.get("curved").setEnabled(0<e.edges.length);this.actions.get("turn").setEnabled(0<e.cells.length);this.actions.get("group").setEnabled(1<e.cells.length||1==e.vertices.length&&0==b.model.getChildCount(e.cells[0])&&!b.isContainer(e.vertices[0]));this.actions.get("ungroup").setEnabled(!e.row&&!e.cell&&!e.table&&0<e.vertices.length&&(b.isContainer(e.vertices[0])||0<b.getModel().getChildCount(e.vertices[0])));this.actions.get("removeFromGroup").setEnabled(1==e.cells.length&&b.getModel().isVertex(b.getModel().getParent(e.cells[0])));@@ -2199,22 +2203,22 @@ EditorUi.prototype.setStatusText=function(b){this.statusContainer.innerHTML=Grap"transition","all 0.2s ease");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(g,100);mxUtils.setPrefixedStyle(g.style,"transform","scaleX(1)");mxUtils.setPrefixedStyle(g.style,"transition","all 1s ease");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(g.style,"transform","scaleX(0)");mxUtils.setOpacity(g,0);window.setTimeout(mxUtils.bind(this,function(){null!=g.parentNode&&g.parentNode.removeChild(g)}),1E3)}),Editor.updateStatusInterval/2)}),0)})(b[e])};EditorUi.prototype.clearStatus=function(){this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus("")}))};EditorUi.prototype.updateStatus=function(b){null!=b&&b();this.lastStatusUpdate=b};EditorUi.prototype.updateStatusAgain=function(){null!=this.lastStatusUpdate&&this.lastStatusUpdate()};EditorUi.prototype.createStatusDiv=function(b){var e=document.createElement("div");e.className="geStatusDiv";e.setAttribute("title",b);e.innerText=b;return e};EditorUi.prototype.createToolbar=function(b){return new Toolbar(this,b)};EditorUi.prototype.createSidebar=function(b){return new Sidebar(this,b)};EditorUi.prototype.createFormat=function(b){return new Format(this,b)};EditorUi.prototype.createDiv=function(b){var e=document.createElement("div");e.className=b;return e};-EditorUi.prototype.addSplitHandler=function(b,e,g,m){function v(c){if(null!=A){var f=new mxPoint(mxEvent.getClientX(c),mxEvent.getClientY(c));m(Math.max(0,H+(e?f.x-A.x:A.y-f.y)-g));mxEvent.consume(c);H!=K()&&(S=!0,F=null)}}function p(c){v(c);A=H=null}var A=null,H=null,S=!0,F=null;mxClient.IS_POINTER&&(b.style.touchAction="none");var K=mxUtils.bind(this,function(){var c=parseInt(e?b.offsetLeft:b.offsetTop);e||(c+=g);return c});mxEvent.addGestureListeners(b,function(c){A=new mxPoint(mxEvent.getClientX(c),-mxEvent.getClientY(c));H=K();S=!1;mxEvent.consume(c)});mxEvent.addListener(b,"click",mxUtils.bind(this,function(c){if(!S&&this.hsplitClickEnabled){var f=null!=F?F-g:0;F=K();m(f);mxEvent.consume(c)}}));mxEvent.addGestureListeners(document,null,v,p);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,v,p)})};+EditorUi.prototype.addSplitHandler=function(b,e,g,m){function v(c){if(null!=A){var f=new mxPoint(mxEvent.getClientX(c),mxEvent.getClientY(c));m(Math.max(0,G+(e?f.x-A.x:A.y-f.y)-g));mxEvent.consume(c);G!=K()&&(S=!0,F=null)}}function n(c){v(c);A=G=null}var A=null,G=null,S=!0,F=null;mxClient.IS_POINTER&&(b.style.touchAction="none");var K=mxUtils.bind(this,function(){var c=parseInt(e?b.offsetLeft:b.offsetTop);e||(c+=g);return c});mxEvent.addGestureListeners(b,function(c){A=new mxPoint(mxEvent.getClientX(c),+mxEvent.getClientY(c));G=K();S=!1;mxEvent.consume(c)});mxEvent.addListener(b,"click",mxUtils.bind(this,function(c){if(!S&&this.hsplitClickEnabled){var f=null!=F?F-g:0;F=K();m(f);mxEvent.consume(c)}}));mxEvent.addGestureListeners(document,null,v,n);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,v,n)})};EditorUi.prototype.prompt=function(b,e,g){b=new FilenameDialog(this,e,mxResources.get("apply"),function(m){g(parseFloat(m))},b);this.showDialog(b.container,300,80,!0,!0);b.init()};-EditorUi.prototype.handleError=function(b,e,g,m,v){b=null!=b&&null!=b.error?b.error:b;if(null!=b||null!=e){v=mxUtils.htmlEntities(mxResources.get("unknownError"));var p=mxResources.get("ok");e=null!=e?e:mxResources.get("error");null!=b&&null!=b.message&&(v=mxUtils.htmlEntities(b.message));this.showError(e,v,p,g,null,null,null,null,null,null,null,null,m?g:null)}else null!=g&&g()};-EditorUi.prototype.showError=function(b,e,g,m,v,p,A,H,S,F,K,c,f){b=new ErrorDialog(this,b,e,g||mxResources.get("ok"),m,v,p,A,c,H,S);e=Math.ceil(null!=e?e.length/50:1);this.showDialog(b.container,F||340,K||100+20*e,!0,!1,f);b.init()};EditorUi.prototype.showDialog=function(b,e,g,m,v,p,A,H,S,F){this.editor.graph.tooltipHandler.resetTimer();this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,b,e,g,m,v,p,A,H,S,F);this.dialogs.push(this.dialog)};+EditorUi.prototype.handleError=function(b,e,g,m,v){b=null!=b&&null!=b.error?b.error:b;if(null!=b||null!=e){v=mxUtils.htmlEntities(mxResources.get("unknownError"));var n=mxResources.get("ok");e=null!=e?e:mxResources.get("error");null!=b&&null!=b.message&&(v=mxUtils.htmlEntities(b.message));this.showError(e,v,n,g,null,null,null,null,null,null,null,null,m?g:null)}else null!=g&&g()};+EditorUi.prototype.showError=function(b,e,g,m,v,n,A,G,S,F,K,c,f){b=new ErrorDialog(this,b,e,g||mxResources.get("ok"),m,v,n,A,c,G,S);e=Math.ceil(null!=e?e.length/50:1);this.showDialog(b.container,F||340,K||100+20*e,!0,!1,f);b.init()};EditorUi.prototype.showDialog=function(b,e,g,m,v,n,A,G,S,F){this.editor.graph.tooltipHandler.resetTimer();this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,b,e,g,m,v,n,A,G,S,F);this.dialogs.push(this.dialog)};EditorUi.prototype.hideDialog=function(b,e,g){var m=null;if(null!=this.dialogs&&0<this.dialogs.length)for(var v=this.dialogs.length-1;0<=v;v--)if(!this.dialogs[v].closing){m=this.dialogs[v];break}null==m||null!=g&&g!=this.dialog.container.firstChild||(m.closing=!0,0==m.close(b,e)?delete m.closing:(delete m.closing,b=mxUtils.lastIndexOf(this.dialogs,m),0<=b&&this.dialogs.splice(b,1),this.dialog=0<this.dialogs.length?this.dialogs[this.dialogs.length-1]:null,this.editor.fireEvent(new mxEventObject("hideDialog","dialog",m)),null==this.dialog&&null!=this.editor.graph.container&&"hidden"!=this.editor.graph.container.style.visibility&&window.setTimeout(mxUtils.bind(this,function(){null==this.editor||null!=this.dialogs&&0!=this.dialogs.length||(this.editor.graph.isEditing()&&null!=this.editor.graph.cellEditor.textarea?this.editor.graph.cellEditor.textarea.focus():(mxUtils.clearSelection(),this.editor.graph.container.focus()))}),0)))};-EditorUi.prototype.ctrlEnter=function(){var b=this.editor.graph;if(b.isEnabled())try{for(var e=b.getSelectionCells(),g=new mxDictionary,m=[],v=0;v<e.length;v++){var p=b.isTableCell(e[v])?b.model.getParent(e[v]):e[v];null==p||g.get(p)||(g.put(p,!0),m.push(p))}b.setSelectionCells(b.duplicateCells(m,!1))}catch(A){this.handleError(A)}};-EditorUi.prototype.pickColor=function(b,e,g,m,v){var p=this.editor.graph,A=p.cellEditor.saveSelection(),H=(v?240:290)+17*(Math.ceil(ColorDialog.prototype.presetColors.length/12)+Math.ceil(ColorDialog.prototype.defaultColors.length/12));b=new ColorDialog(this,b,function(S){p.cellEditor.restoreSelection(A);e(S)},function(){p.cellEditor.restoreSelection(A)},g,m,v);this.showDialog(b.container,230,H,!0,!1);b.init()};+EditorUi.prototype.ctrlEnter=function(){var b=this.editor.graph;if(b.isEnabled())try{for(var e=b.getSelectionCells(),g=new mxDictionary,m=[],v=0;v<e.length;v++){var n=b.isTableCell(e[v])?b.model.getParent(e[v]):e[v];null==n||g.get(n)||(g.put(n,!0),m.push(n))}b.setSelectionCells(b.duplicateCells(m,!1))}catch(A){this.handleError(A)}};+EditorUi.prototype.pickColor=function(b,e,g,m,v){var n=this.editor.graph,A=n.cellEditor.saveSelection(),G=(v?240:290)+17*(Math.ceil(ColorDialog.prototype.presetColors.length/12)+Math.ceil(ColorDialog.prototype.defaultColors.length/12));b=new ColorDialog(this,b,function(S){n.cellEditor.restoreSelection(A);e(S)},function(){n.cellEditor.restoreSelection(A)},g,m,v);this.showDialog(b.container,230,G,!0,!1);b.init()};EditorUi.prototype.openFile=function(){window.openFile=new OpenFile(mxUtils.bind(this,function(b){this.hideDialog(b)}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:320,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null})};-EditorUi.prototype.base64ToBlob=function(b,e){e=e||"";b=atob(b);for(var g=b.length,m=Math.ceil(g/1024),v=Array(m),p=0;p<m;++p){for(var A=1024*p,H=Math.min(A+1024,g),S=Array(H-A),F=0;A<H;++F,++A)S[F]=b[A].charCodeAt(0);v[p]=new Uint8Array(S)}return new Blob(v,{type:e})};+EditorUi.prototype.base64ToBlob=function(b,e){e=e||"";b=atob(b);for(var g=b.length,m=Math.ceil(g/1024),v=Array(m),n=0;n<m;++n){for(var A=1024*n,G=Math.min(A+1024,g),S=Array(G-A),F=0;A<G;++F,++A)S[F]=b[A].charCodeAt(0);v[n]=new Uint8Array(S)}return new Blob(v,{type:e})};EditorUi.prototype.writeImageToClipboard=function(b,e,g,m){var v=this.base64ToBlob(b.substring(b.indexOf(",")+1),"image/png");b=new ClipboardItem({"image/png":v,"text/html":new Blob(['<img src="'+b+'" width="'+e+'" height="'+g+'">'],{type:"text/html"})});navigator.clipboard.write([b])["catch"](m)};EditorUi.prototype.writeHtmlToClipboard=function(b,e){b=new ClipboardItem({"text/plain":new Blob([Editor.convertHtmlToText(b)],{type:"text/plain"}),"text/html":new Blob([b],{type:"text/html"})});navigator.clipboard.write([b])["catch"](e)};EditorUi.prototype.writeTextToClipboard=function(b,e){navigator.clipboard.writeText(b)["catch"](e)};EditorUi.prototype.extractGraphModelFromHtml=function(b){var e=null;try{var g=b.indexOf("<mxGraphModel ");if(0<=g){var m=b.lastIndexOf("</mxGraphModel>");m>g&&(e=b.substring(g,m+21).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}}catch(v){}return e};EditorUi.prototype.readGraphModelFromClipboard=function(b){this.readGraphModelFromClipboardWithType(mxUtils.bind(this,function(e){null!=e?b(e):this.readGraphModelFromClipboardWithType(mxUtils.bind(this,function(g){if(null!=g){var m=decodeURIComponent(g);this.isCompatibleString(m)&&(g=m)}b(g)}),"text")}),"html")};-EditorUi.prototype.readGraphModelFromClipboardWithType=function(b,e){navigator.clipboard.read().then(mxUtils.bind(this,function(g){if(null!=g&&0<g.length&&"html"==e&&0<=mxUtils.indexOf(g[0].types,"text/html"))g[0].getType("text/html").then(mxUtils.bind(this,function(m){m.text().then(mxUtils.bind(this,function(v){try{var p=this.parseHtmlData(v),A="text/plain"!=p.getAttribute("data-type")?p.innerHTML:mxUtils.trim(null==p.innerText?mxUtils.getTextContent(p):p.innerText);try{var H=A.lastIndexOf("%3E");-0<=H&&H<A.length-3&&(A=A.substring(0,H+3))}catch(K){}try{var S=p.getElementsByTagName("span"),F=null!=S&&0<S.length?mxUtils.trim(decodeURIComponent(S[0].textContent)):decodeURIComponent(A);this.isCompatibleString(F)&&(A=F)}catch(K){}}catch(K){}b(this.isCompatibleString(A)?A:null)}))["catch"](function(v){b(null)})}))["catch"](function(m){b(null)});else if(null!=g&&0<g.length&&"text"==e&&0<=mxUtils.indexOf(g[0].types,"text/plain"))g[0].getType("text/plain").then(function(m){m.text().then(function(v){b(v)})["catch"](function(){b(null)})})["catch"](function(){b(null)});+EditorUi.prototype.readGraphModelFromClipboardWithType=function(b,e){navigator.clipboard.read().then(mxUtils.bind(this,function(g){if(null!=g&&0<g.length&&"html"==e&&0<=mxUtils.indexOf(g[0].types,"text/html"))g[0].getType("text/html").then(mxUtils.bind(this,function(m){m.text().then(mxUtils.bind(this,function(v){try{var n=this.parseHtmlData(v),A="text/plain"!=n.getAttribute("data-type")?n.innerHTML:mxUtils.trim(null==n.innerText?mxUtils.getTextContent(n):n.innerText);try{var G=A.lastIndexOf("%3E");+0<=G&&G<A.length-3&&(A=A.substring(0,G+3))}catch(K){}try{var S=n.getElementsByTagName("span"),F=null!=S&&0<S.length?mxUtils.trim(decodeURIComponent(S[0].textContent)):decodeURIComponent(A);this.isCompatibleString(F)&&(A=F)}catch(K){}}catch(K){}b(this.isCompatibleString(A)?A:null)}))["catch"](function(v){b(null)})}))["catch"](function(m){b(null)});else if(null!=g&&0<g.length&&"text"==e&&0<=mxUtils.indexOf(g[0].types,"text/plain"))g[0].getType("text/plain").then(function(m){m.text().then(function(v){b(v)})["catch"](function(){b(null)})})["catch"](function(){b(null)});else b(null)}))["catch"](function(g){b(null)})};EditorUi.prototype.parseHtmlData=function(b){var e=null;if(null!=b&&0<b.length){var g="<meta "==b.substring(0,6);e=document.createElement("div");e.innerHTML=(g?'<meta charset="utf-8">':"")+Graph.sanitizeHtml(b);asHtml=!0;b=e.getElementsByTagName("style");if(null!=b)for(;0<b.length;)b[0].parentNode.removeChild(b[0]);null!=e.firstChild&&e.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=e.firstChild.nextSibling&&e.firstChild.nextSibling.nodeType==mxConstants.NODETYPE_ELEMENT&&"META"==e.firstChild.nodeName&&"A"==e.firstChild.nextSibling.nodeName&&null==e.firstChild.nextSibling.nextSibling&&(b=null==e.firstChild.nextSibling.innerText?mxUtils.getTextContent(e.firstChild.nextSibling):e.firstChild.nextSibling.innerText,b==e.firstChild.nextSibling.getAttribute("href")&&(mxUtils.setTextContent(e,b),asHtml=!1));g=g&&null!=e.firstChild?e.firstChild.nextSibling:e.firstChild;null!=g&&null==g.nextSibling&&g.nodeType==mxConstants.NODETYPE_ELEMENT&&"IMG"==g.nodeName?(b=g.getAttribute("src"),null!=b&&(Editor.isPngDataUrl(b)&&@@ -2225,17 +2229,17 @@ EditorUi.prototype.save=function(b){if(null!=b){this.editor.graph.isEditing()&&t"filename="+encodeURIComponent(b)+"&xml="+encodeURIComponent(e))).simulate(document,"_blank");else{mxUtils.alert(mxResources.get("drawingTooLarge"));mxUtils.popup(e);return}this.editor.setModified(!1);this.editor.setFilename(b);this.updateDocumentTitle()}catch(g){this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("errorSavingFile")))}))}}};EditorUi.prototype.executeLayouts=function(b,e){this.executeLayout(mxUtils.bind(this,function(){var g=new mxCompositeLayout(this.editor.graph,b),m=this.editor.graph.getSelectionCells();g.execute(this.editor.graph.getDefaultParent(),0==m.length?null:m)}),!0,e)};EditorUi.prototype.executeLayout=function(b,e,g){var m=this.editor.graph;m.getModel().beginUpdate();try{b()}catch(v){throw v;}finally{this.allowAnimation&&e&&m.isEnabled()?(b=new mxMorphing(m),b.addListener(mxEvent.DONE,mxUtils.bind(this,function(){m.getModel().endUpdate();null!=g&&g()})),b.startAnimation()):(m.getModel().endUpdate(),null!=g&&g())}};-EditorUi.prototype.showImageDialog=function(b,e,g,m){m=this.editor.graph.cellEditor;var v=m.saveSelection(),p=mxUtils.prompt(b,e);m.restoreSelection(v);if(null!=p&&0<p.length){var A=new Image;A.onload=function(){g(p,A.width,A.height)};A.onerror=function(){g(null);mxUtils.alert(mxResources.get("fileNotFound"))};A.src=p}else g(null)};EditorUi.prototype.showLinkDialog=function(b,e,g){b=new LinkDialog(this,b,e,g);this.showDialog(b.container,420,90,!0,!0);b.init()};+EditorUi.prototype.showImageDialog=function(b,e,g,m){m=this.editor.graph.cellEditor;var v=m.saveSelection(),n=mxUtils.prompt(b,e);m.restoreSelection(v);if(null!=n&&0<n.length){var A=new Image;A.onload=function(){g(n,A.width,A.height)};A.onerror=function(){g(null);mxUtils.alert(mxResources.get("fileNotFound"))};A.src=n}else g(null)};EditorUi.prototype.showLinkDialog=function(b,e,g){b=new LinkDialog(this,b,e,g);this.showDialog(b.container,420,90,!0,!0);b.init()};EditorUi.prototype.showDataDialog=function(b){null!=b&&"undefined"!==typeof window.EditDataDialog&&(b=new EditDataDialog(this,b),this.showDialog(b.container,480,420,!0,!1,null,!1),b.init())};EditorUi.prototype.showBackgroundImageDialog=function(b,e){b=null!=b?b:mxUtils.bind(this,function(m){m=new ChangePageSetup(this,null,m);m.ignoreColor=!0;this.editor.graph.model.execute(m)});var g=mxUtils.prompt(mxResources.get("backgroundImage"),null!=e?e.src:"");null!=g&&0<g.length?(e=new Image,e.onload=function(){b(new mxImage(g,e.width,e.height),!1)},e.onerror=function(){b(null,!0);mxUtils.alert(mxResources.get("fileNotFound"))},e.src=g):b(null)};EditorUi.prototype.setBackgroundImage=function(b){this.editor.graph.setBackgroundImage(b);this.editor.graph.view.validateBackgroundImage();this.fireEvent(new mxEventObject("backgroundImageChanged"))};EditorUi.prototype.confirm=function(b,e,g){mxUtils.confirm(b)?null!=e&&e():null!=g&&g()};EditorUi.prototype.createOutline=function(b){var e=new mxOutline(this.editor.graph);mxEvent.addListener(window,"resize",function(){e.update(!1)});return e};EditorUi.prototype.altShiftActions={65:"connectionArrows",82:"clearWaypoints",76:"editLink",79:"connectionPoints",81:"editConnectionPoints",84:"editTooltip",86:"pasteSize",70:"copySize",66:"copyData",69:"pasteData"};EditorUi.prototype.ctrlAltShiftActions={70:"bringForward",66:"sendBackward"};EditorUi.prototype.ctrlAltActions={88:"copyAsImage"};EditorUi.prototype.createKeyHandler=function(b){function e(c,f,l){if(!m.isSelectionEmpty()&&m.isEnabled()){f=null!=f?f:1;var t=m.getCompositeParents(m.getSelectionCells()),q=0<t.length?t[0]:null;if(null!=q)if(l){m.getModel().beginUpdate();try{for(q=0;q<t.length;q++)if(m.getModel().isVertex(t[q])&&m.isCellResizable(t[q])){var D=m.getCellGeometry(t[q]);null!=D&&(D=D.clone(),37==c?D.width=Math.max(0,D.width-f):38==c?D.height=Math.max(0,D.height-f):39==c?D.width+=f:40==c&&(D.height+=f),m.getModel().setGeometry(t[q],-D))}}finally{m.getModel().endUpdate()}}else{D=m.model.getParent(q);var G=m.getView().scale;l=null;1==m.getSelectionCount()&&m.model.isVertex(q)&&null!=m.layoutManager&&!m.isCellLocked(q)&&(l=m.layoutManager.getLayout(D));if(null!=l&&l.constructor==mxStackLayout)f=D.getIndex(q),37==c||38==c?m.model.add(D,q,Math.max(0,f-1)):(39==c||40==c)&&m.model.add(D,q,Math.min(m.model.getChildCount(D),f+1));else{var N=m.graphHandler;null!=N&&(null==N.first&&N.start(q,0,0,m.getMovableCells(t)),null!=N.first&&(q=-t=0,37==c?t=-f:38==c?q=-f:39==c?t=f:40==c&&(q=f),N.currentDx+=t*G,N.currentDy+=q*G,N.checkPreview(),N.updatePreview()),null!=A&&window.clearTimeout(A),A=window.setTimeout(function(){if(null!=N.first){var L=N.roundLength(N.currentDx/G),J=N.roundLength(N.currentDy/G);N.moveCells(N.cells,L,J);N.reset()}},400))}}}}var g=this,m=this.editor.graph,v=new mxKeyHandler(m),p=v.isEventIgnored;v.isEventIgnored=function(c){return!(mxEvent.isShiftDown(c)&&9==c.keyCode)&&(!this.isControlDown(c)||mxEvent.isShiftDown(c)||-90!=c.keyCode&&89!=c.keyCode&&188!=c.keyCode&&190!=c.keyCode&&85!=c.keyCode&&83!=c.keyCode)&&(66!=c.keyCode&&73!=c.keyCode||!this.isControlDown(c)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&(109!=c.keyCode&&107!=c.keyCode||!this.isControlDown(c)&&!mxEvent.isShiftDown(c)||!this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&p.apply(this,arguments)};v.isEnabledForEvent=function(c){return!mxEvent.isConsumed(c)&&this.isGraphEvent(c)&&this.isEnabled()&&-(null==g.dialogs||0==g.dialogs.length)};v.isControlDown=function(c){return mxEvent.isControlDown(c)||mxClient.IS_MAC&&c.metaKey};var A=null,H={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},S=v.getFunction;mxKeyHandler.prototype.getFunction=function(c){if(m.isEnabled()){var f=null;mxEvent.isShiftDown(c)&&this.isControlDown(c)&&mxEvent.isAltDown(c)?f=g.actions.get(g.ctrlAltShiftActions[c.keyCode]):mxEvent.isShiftDown(c)&&mxEvent.isAltDown(c)?-f=g.actions.get(g.altShiftActions[c.keyCode]):this.isControlDown(c)&&mxEvent.isAltDown(c)&&(f=g.actions.get(g.ctrlAltActions[c.keyCode]));if(null!=f)return f.funct;if(null!=H[c.keyCode]&&!m.isSelectionEmpty())if(!this.isControlDown(c)&&mxEvent.isShiftDown(c)&&mxEvent.isAltDown(c)){if(m.model.isVertex(m.getSelectionCell()))return function(){var l=m.connectVertex(m.getSelectionCell(),H[c.keyCode],m.defaultEdgeLength,c,!0);null!=l&&0<l.length&&(1==l.length&&m.model.isEdge(l[0])?m.setSelectionCell(m.model.getTerminal(l[0],+D))}}finally{m.getModel().endUpdate()}}else{D=m.model.getParent(q);var H=m.getView().scale;l=null;1==m.getSelectionCount()&&m.model.isVertex(q)&&null!=m.layoutManager&&!m.isCellLocked(q)&&(l=m.layoutManager.getLayout(D));if(null!=l&&l.constructor==mxStackLayout)f=D.getIndex(q),37==c||38==c?m.model.add(D,q,Math.max(0,f-1)):(39==c||40==c)&&m.model.add(D,q,Math.min(m.model.getChildCount(D),f+1));else{var N=m.graphHandler;null!=N&&(null==N.first&&N.start(q,0,0,m.getMovableCells(t)),null!=N.first&&(q=+t=0,37==c?t=-f:38==c?q=-f:39==c?t=f:40==c&&(q=f),N.currentDx+=t*H,N.currentDy+=q*H,N.checkPreview(),N.updatePreview()),null!=A&&window.clearTimeout(A),A=window.setTimeout(function(){if(null!=N.first){var L=N.roundLength(N.currentDx/H),J=N.roundLength(N.currentDy/H);N.moveCells(N.cells,L,J);N.reset()}},400))}}}}var g=this,m=this.editor.graph,v=new mxKeyHandler(m),n=v.isEventIgnored;v.isEventIgnored=function(c){return!(mxEvent.isShiftDown(c)&&9==c.keyCode)&&(!this.isControlDown(c)||mxEvent.isShiftDown(c)||+90!=c.keyCode&&89!=c.keyCode&&188!=c.keyCode&&190!=c.keyCode&&85!=c.keyCode&&83!=c.keyCode)&&(66!=c.keyCode&&73!=c.keyCode||!this.isControlDown(c)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&(109!=c.keyCode&&107!=c.keyCode||!this.isControlDown(c)&&!mxEvent.isShiftDown(c)||!this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&n.apply(this,arguments)};v.isEnabledForEvent=function(c){return!mxEvent.isConsumed(c)&&this.isGraphEvent(c)&&this.isEnabled()&&+(null==g.dialogs||0==g.dialogs.length)};v.isControlDown=function(c){return mxEvent.isControlDown(c)||mxClient.IS_MAC&&c.metaKey};var A=null,G={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},S=v.getFunction;mxKeyHandler.prototype.getFunction=function(c){if(m.isEnabled()){var f=null;mxEvent.isShiftDown(c)&&this.isControlDown(c)&&mxEvent.isAltDown(c)?f=g.actions.get(g.ctrlAltShiftActions[c.keyCode]):mxEvent.isShiftDown(c)&&mxEvent.isAltDown(c)?+f=g.actions.get(g.altShiftActions[c.keyCode]):this.isControlDown(c)&&mxEvent.isAltDown(c)&&(f=g.actions.get(g.ctrlAltActions[c.keyCode]));if(null!=f)return f.funct;if(null!=G[c.keyCode]&&!m.isSelectionEmpty())if(!this.isControlDown(c)&&mxEvent.isShiftDown(c)&&mxEvent.isAltDown(c)){if(m.model.isVertex(m.getSelectionCell()))return function(){var l=m.connectVertex(m.getSelectionCell(),G[c.keyCode],m.defaultEdgeLength,c,!0);null!=l&&0<l.length&&(1==l.length&&m.model.isEdge(l[0])?m.setSelectionCell(m.model.getTerminal(l[0],!1)):m.setSelectionCell(l[l.length-1]),m.scrollCellToVisible(m.getSelectionCell()),null!=g.hoverIcons&&g.hoverIcons.update(m.view.getState(m.getSelectionCell())))}}else return this.isControlDown(c)?function(){e(c.keyCode,mxEvent.isShiftDown(c)?m.gridSize:null,!0)}:function(){e(c.keyCode,mxEvent.isShiftDown(c)?m.gridSize:null)}}return S.apply(this,arguments)};v.bindAction=mxUtils.bind(this,function(c,f,l,t){var q=this.actions.get(l);null!=q&&(l=function(){q.isEnabled()&&q.funct.apply(this,arguments)},f?t?v.bindControlShiftKey(c,l):v.bindControlKey(c,l):t?v.bindShiftKey(c,l):v.bindKey(c,l))});var F=this,K=v.escape;v.escape=function(c){K.apply(this,arguments)};v.enter=function(){};v.bindControlShiftKey(36,function(){m.exitGroup()});v.bindControlShiftKey(35,function(){m.enterGroup()});v.bindShiftKey(36,function(){m.home()});v.bindKey(35,function(){m.refresh()});v.bindAction(80,!0,"print");v.bindAction(107,!0,"zoomIn");v.bindAction(109,!0,"zoomOut");v.bindAction(61,!0,"zoomIn");v.bindAction(187,!0,"zoomIn");v.bindAction(222,!0,"zoomIn");v.bindAction(173,!0,"zoomOut");v.bindAction(189,!0,"zoomOut");if(!this.editor.chromeless||this.editor.editable)v.bindAction(79,!0,"outline",!0),v.bindControlKey(36,function(){m.isEnabled()&&m.foldCells(!0)}),v.bindControlKey(35,function(){m.isEnabled()&&m.foldCells(!1)}),v.bindControlKey(13,function(){F.ctrlEnter()}),v.bindAction(8,!1,"delete"),v.bindAction(8,!0,"deleteAll"),v.bindAction(8,!1,"deleteLabels",!0),v.bindAction(46,!1,"delete"),v.bindAction(46,!0,@@ -2243,48 +2247,48 @@ f?t?v.bindControlShiftKey(c,l):v.bindControlKey(c,l):t?v.bindShiftKey(c,l):v.bin!0,"editStyle"),v.bindAction(66,!0,"bold"),v.bindAction(66,!0,"toBack",!0),v.bindAction(70,!0,"toFront",!0),v.bindAction(68,!0,"duplicate"),v.bindAction(68,!0,"setAsDefaultStyle",!0),v.bindAction(90,!0,"undo"),v.bindAction(90,!0,"redo",!0),v.bindAction(89,!0,"redo"),v.bindAction(89,!0,"autosize",!0),v.bindAction(88,!0,"cut"),v.bindAction(67,!0,"copy"),v.bindAction(86,!0,"paste"),v.bindAction(71,!0,"group"),v.bindAction(77,!0,"editData"),v.bindAction(71,!0,"grid",!0),v.bindAction(73,!0,"italic"),v.bindAction(76,!0,"lockUnlock"),v.bindAction(76,!0,"layers",!0),v.bindAction(80,!0,"format",!0),v.bindAction(85,!0,"underline"),v.bindAction(85,!0,"ungroup",!0),v.bindAction(109,!0,"decreaseFontSize",!0),v.bindAction(107,!0,"increaseFontSize",!0),v.bindAction(219,!0,"decreaseFontSize",!0),v.bindAction(221,!0,"increaseFontSize",!0),v.bindAction(190,!0,"superscript"),v.bindAction(188,!0,"subscript"),v.bindAction(13,!1,"keyPressEnter"),v.bindKey(113,function(){m.isEnabled()&&m.startEditingAtCell()});return v};EditorUi.prototype.createMenuElement=function(b,e,g){var m=document.createElement("a");this.addMenuHandler(m,e,g);mxUtils.write(m,b);m.className="geItem";return m};-EditorUi.prototype.addMenuHandler=function(b,e,g){if(null!=e){var m=!0,v=mxUtils.bind(this,function(p){null!=g&&g(p);if(!mxEvent.isConsumed(p)&&m&&(null==b.enabled||b.enabled)){this.editor.graph.popupMenuHandler.hideMenu();var A=new mxPopupMenu(e);A.smartSeparators=!0;A.showDisabled=!0;A.autoExpand=!0;A.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(A,arguments);this.resetCurrentMenu();A.destroy()});this.menus.autoPopup||null==this.currentMenu||this.hideCurrentMenu();var H=-mxUtils.getOffset(b);A.popup(H.x,H.y+b.offsetHeight,null,p);this.setCurrentMenu(A,b)}mxEvent.consume(p)});mxEvent.addListener(b,"mousemove",mxUtils.bind(this,function(p){if(this.menus.autoPopup&&null!=this.currentMenu&&this.currentMenuElt!=b&&null!=this.currentMenuElt){var A=this.currentMenuElt;this.hideCurrentMenu();A.parentNode==b.parentNode&&"INPUT"!=b.nodeName&&v(p)}}));mxEvent.addListener(b,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(p){!this.menus.autoPopup&&null!=-this.currentMenu&&this.currentMenuElt!=b&&mxEvent.isMouseEvent(p)&&this.hideCurrentMenu();m=null==this.currentMenu;"INPUT"!=mxEvent.getSource(p).nodeName?p.preventDefault():p.stopPropagation()}));mxEvent.addListener(b,"click",mxUtils.bind(this,function(p){v(p);m=!0}))}};+EditorUi.prototype.addMenuHandler=function(b,e,g){if(null!=e){var m=!0,v=mxUtils.bind(this,function(n){null!=g&&g(n);if(!mxEvent.isConsumed(n)&&m&&(null==b.enabled||b.enabled)){this.editor.graph.popupMenuHandler.hideMenu();var A=new mxPopupMenu(e);A.smartSeparators=!0;A.showDisabled=!0;A.autoExpand=!0;A.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(A,arguments);this.resetCurrentMenu();A.destroy()});this.menus.autoPopup||null==this.currentMenu||this.hideCurrentMenu();var G=+mxUtils.getOffset(b);A.popup(G.x,G.y+b.offsetHeight,null,n);this.setCurrentMenu(A,b)}mxEvent.consume(n)});mxEvent.addListener(b,"mousemove",mxUtils.bind(this,function(n){if(this.menus.autoPopup&&null!=this.currentMenu&&this.currentMenuElt!=b&&null!=this.currentMenuElt){var A=this.currentMenuElt;this.hideCurrentMenu();A.parentNode==b.parentNode&&"INPUT"!=b.nodeName&&v(n)}}));mxEvent.addListener(b,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(n){!this.menus.autoPopup&&null!=+this.currentMenu&&this.currentMenuElt!=b&&mxEvent.isMouseEvent(n)&&this.hideCurrentMenu();m=null==this.currentMenu;"INPUT"!=mxEvent.getSource(n).nodeName?n.preventDefault():n.stopPropagation()}));mxEvent.addListener(b,"click",mxUtils.bind(this,function(n){v(n);m=!0}))}};EditorUi.prototype.createZoomInput=function(b){var e=document.createElement("input");e.className="geButton geZoomInput";e.style.backgroundImage="url("+Editor.thinExpandImage+")";e.setAttribute("type","text");e.setAttribute("value","100%");var g=this.menus.get("viewZoom");this.dependsOnLanguage(mxUtils.bind(this,function(){e.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)")}));b&&e.setAttribute("readonly","true");var m=!1;mxEvent.addGestureListeners(e,mxUtils.bind(this,function(v){m=!1;mxClient.IS_TOUCH||mxEvent.getSource(v)!=e||document.activeElement==e||(e.focus(),mxClient.IS_GC||mxClient.IS_FF?e.select():document.execCommand("selectAll",!1,null),m=!0)}),mxUtils.bind(this,function(v){mxEvent.getSource(v)==e&&m&&mxEvent.consume(v)}),mxUtils.bind(this,function(v){m&&(mxEvent.consume(v),m=!1)}));this.addMenuHandler(e,g.funct);mxUtils.bind(this,function(v){mxEvent.addListener(v,"click",mxUtils.bind(this,function(A){mxEvent.isAltDown(A)?(this.hideCurrentMenu(),this.actions.get("customZoom").funct(),-mxEvent.consume(A)):mxEvent.isShiftDown(A)&&(this.hideCurrentMenu(),this.actions.get("smartFit").funct(),mxEvent.consume(A))}));var p=mxUtils.bind(this,function(A,H,S){e.value=Math.round(100*this.editor.graph.view.scale*(null!=S?S:1))+"%";document.activeElement==e&&this.editor.graph.container.focus()});mxEvent.addListener(e,"keydown",mxUtils.bind(this,function(A){if(27==A.keyCode||13==A.keyCode||9==A.keyCode)27==A.keyCode||isNaN(parseInt(e.value))?p():this.editor.graph.zoomTo(parseInt(e.value)/100),-this.hideCurrentMenu(),mxEvent.consume(A)}));this.editor.graph.view.addListener(mxEvent.EVENT_SCALE,p);this.editor.addListener("resetGraphView",p);this.editor.addListener("pageSelected",p);mxEvent.addListener(e,"blur",p);this.editor.graph.addListener("zoomPreview",mxUtils.bind(this,function(A,H){p(A,H,H.getProperty("factor"))}))})(e);return e};+mxEvent.consume(A)):mxEvent.isShiftDown(A)&&(this.hideCurrentMenu(),this.actions.get("smartFit").funct(),mxEvent.consume(A))}));var n=mxUtils.bind(this,function(A,G,S){e.value=Math.round(100*this.editor.graph.view.scale*(null!=S?S:1))+"%";document.activeElement==e&&this.editor.graph.container.focus()});mxEvent.addListener(e,"keydown",mxUtils.bind(this,function(A){if(27==A.keyCode||13==A.keyCode||9==A.keyCode)27==A.keyCode||isNaN(parseInt(e.value))?n():this.editor.graph.zoomTo(parseInt(e.value)/100),+this.hideCurrentMenu(),mxEvent.consume(A)}));this.editor.graph.view.addListener(mxEvent.EVENT_SCALE,n);this.editor.addListener("resetGraphView",n);this.editor.addListener("pageSelected",n);mxEvent.addListener(e,"blur",n);this.editor.graph.addListener("zoomPreview",mxUtils.bind(this,function(A,G){n(A,G,G.getProperty("factor"))}))})(e);return e};EditorUi.prototype.createHelpIcon=function(b,e){e=document.createElement("img");e.setAttribute("src",Editor.helpImage);e.setAttribute("title",mxResources.get("help"));e.className="geHelpIcon";mxEvent.addGestureListeners(e,mxUtils.bind(this,function(g){this.hideCurrentMenu();this.openLink(b);mxEvent.consume(g)}));return e};EditorUi.prototype.destroy=function(){var b=this.editor.graph;null!=b&&null!=this.selectionStateListener&&(b.getSelectionModel().removeListener(this.selectionStateListener),b.getModel().removeListener(this.selectionStateListener),b.getView().removeListener(this.selectionStateListener),b.removeListener(this.selectionStateListener),this.selectionStateListener=null);null!=this.editor&&(this.editor.destroy(),this.editor=null);null!=this.menubar&&(this.menubar.destroy(),this.menubar=null);null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null);null!=this.sidebar&&(this.sidebar.destroy(),this.sidebar=null);null!=this.keyHandler&&(this.keyHandler.destroy(),this.keyHandler=null);null!=this.keydownHandler&&(mxEvent.removeListener(document,"keydown",this.keydownHandler),this.keydownHandler=null);null!=this.keyupHandler&&(mxEvent.removeListener(document,"keyup",this.keyupHandler),this.keyupHandler=null);null!=this.resizeHandler&&(mxEvent.removeListener(window,"resize",this.resizeHandler),this.resizeHandler=null);null!=this.gestureHandler&&(mxEvent.removeGestureListeners(document,this.gestureHandler),this.gestureHandler=null);null!=this.orientationChangeHandler&&(mxEvent.removeListener(window,"orientationchange",this.orientationChangeHandler),this.orientationChangeHandler=null);null!=this.scrollHandler&&(mxEvent.removeListener(window,"scroll",this.scrollHandler),this.scrollHandler=null);if(null!=this.destroyFunctions){for(b=0;b<this.destroyFunctions.length;b++)this.destroyFunctions[b]();this.destroyFunctions=-null}var e=[this.menubarContainer,this.toolbarContainer,this.sidebarContainer,this.formatContainer,this.diagramContainer,this.hsplit,this.chromelessToolbar,this.layersDialog];for(b=0;b<e.length;b++)null!=e[b]&&null!=e[b].parentNode&&e[b].parentNode.removeChild(e[b])};(function(){var b=[["nbsp","160"],["shy","173"]],e=mxUtils.parseXml;mxUtils.parseXml=function(m){for(var v=0;v<b.length;v++)m=m.replace(new RegExp("&"+b[v][0]+";","g"),"&#"+b[v][1]+";");return e(m)};var g=mxUtils.getSizeForString;mxUtils.getSizeForString=function(m,v,p,A){return g(Graph.sanitizeHtml(m),v,p,A)}})();+null}var e=[this.menubarContainer,this.toolbarContainer,this.sidebarContainer,this.formatContainer,this.diagramContainer,this.hsplit,this.chromelessToolbar,this.layersDialog];for(b=0;b<e.length;b++)null!=e[b]&&null!=e[b].parentNode&&e[b].parentNode.removeChild(e[b])};(function(){var b=[["nbsp","160"],["shy","173"]],e=mxUtils.parseXml;mxUtils.parseXml=function(m){for(var v=0;v<b.length;v++)m=m.replace(new RegExp("&"+b[v][0]+";","g"),"&#"+b[v][1]+";");return e(m)};var g=mxUtils.getSizeForString;mxUtils.getSizeForString=function(m,v,n,A){return g(Graph.sanitizeHtml(m),v,n,A)}})();Date.prototype.toISOString||function(){function b(e){e=String(e);1===e.length&&(e="0"+e);return e}Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+b(this.getUTCMonth()+1)+"-"+b(this.getUTCDate())+"T"+b(this.getUTCHours())+":"+b(this.getUTCMinutes())+":"+b(this.getUTCSeconds())+"."+String((this.getUTCMilliseconds()/1E3).toFixed(3)).slice(2,5)+"Z"}}();Date.now||(Date.now=function(){return(new Date).getTime()});-Uint8Array.from||(Uint8Array.from=function(){var b=Object.prototype.toString,e=function(m){return"function"===typeof m||"[object Function]"===b.call(m)},g=Math.pow(2,53)-1;return function(m){var v=Object(m);if(null==m)throw new TypeError("Array.from requires an array-like object - not null or undefined");var p=1<arguments.length?arguments[1]:void 0,A;if("undefined"!==typeof p){if(!e(p))throw new TypeError("Array.from: when provided, the second argument must be a function");2<arguments.length&&(A=-arguments[2])}var H=Number(v.length);H=isNaN(H)?0:0!==H&&isFinite(H)?(0<H?1:-1)*Math.floor(Math.abs(H)):H;H=Math.min(Math.max(H,0),g);for(var S=e(this)?Object(new this(H)):Array(H),F=0,K;F<H;)K=v[F],S[F]=p?"undefined"===typeof A?p(K,F):p.call(A,K,F):K,F+=1;S.length=H;return S}}());mxConstants.SHADOW_OPACITY=.25;mxConstants.SHADOWCOLOR="#000000";mxConstants.VML_SHADOWCOLOR="#d0d0d0";mxCodec.allowlist="mxStylesheet Array mxGraphModel mxCell mxGeometry mxRectangle mxPoint mxChildChange mxRootChange mxTerminalChange mxValueChange mxStyleChange mxGeometryChange mxCollapseChange mxVisibleChange mxCellAttributeChange".split(" ");+Uint8Array.from||(Uint8Array.from=function(){var b=Object.prototype.toString,e=function(m){return"function"===typeof m||"[object Function]"===b.call(m)},g=Math.pow(2,53)-1;return function(m){var v=Object(m);if(null==m)throw new TypeError("Array.from requires an array-like object - not null or undefined");var n=1<arguments.length?arguments[1]:void 0,A;if("undefined"!==typeof n){if(!e(n))throw new TypeError("Array.from: when provided, the second argument must be a function");2<arguments.length&&(A=+arguments[2])}var G=Number(v.length);G=isNaN(G)?0:0!==G&&isFinite(G)?(0<G?1:-1)*Math.floor(Math.abs(G)):G;G=Math.min(Math.max(G,0),g);for(var S=e(this)?Object(new this(G)):Array(G),F=0,K;F<G;)K=v[F],S[F]=n?"undefined"===typeof A?n(K,F):n.call(A,K,F):K,F+=1;S.length=G;return S}}());mxConstants.SHADOW_OPACITY=.25;mxConstants.SHADOWCOLOR="#000000";mxConstants.VML_SHADOWCOLOR="#d0d0d0";mxCodec.allowlist="mxStylesheet Array mxGraphModel mxCell mxGeometry mxRectangle mxPoint mxChildChange mxRootChange mxTerminalChange mxValueChange mxStyleChange mxGeometryChange mxCollapseChange mxVisibleChange mxCellAttributeChange".split(" ");mxGraph.prototype.pageBreakColor="#c0c0c0";mxGraph.prototype.pageScale=1;(function(){try{if(null!=navigator&&null!=navigator.language){var b=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===b||"en-ca"===b||"es-mx"===b?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(e){}})();mxText.prototype.baseSpacingTop=5;mxText.prototype.baseSpacingBottom=1;mxGraphModel.prototype.ignoreRelativeEdgeParent=!1;mxGraphView.prototype.gridImage="data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=";mxGraphView.prototype.gridSteps=4;mxGraphView.prototype.minGridSize=4;mxGraphView.prototype.defaultGridColor="#d0d0d0";mxGraphView.prototype.defaultDarkGridColor="#424242";mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultGridColor;mxGraphView.prototype.unit=mxConstants.POINTS;mxGraphView.prototype.setUnit=function(b){this.unit!=b&&(this.unit=b,this.graph.refresh(),this.fireEvent(new mxEventObject("unitChanged","unit",b)))};mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]";mxShape.prototype.getConstraints=function(b,e,g){return null};mxImageShape.prototype.getImageDataUri=function(){var b=String(this.image);if("data:image/svg+xml;base64,"==b.substring(0,26)&&null!=this.style&&"1"==mxUtils.getValue(this.style,"clipSvg","0")){if(null==this.clippedSvg||this.clippedImage!=b)this.clippedSvg=Graph.clipSvgDataUri(b),this.clippedImage=b;b=this.clippedSvg}return b};-(function(){var b=mxStencil.prototype.parseColor;mxStencil.prototype.parseColor=function(e,g,m,v,p){return"default"==v&&null!=p?"fillcolor"==m.nodeName?p.shapeBackgroundColor:p.shapeForegroundColor:b.apply(this,arguments)}})();(function(){var b=mxResources.get;mxResources.get=function(e,g,m){null==m&&(m=e);return b.apply(this,[e,g,m])}})();-(function(){var b=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(e,g,m,v,p,A,H,S){var F=b.apply(this,arguments);if(null!=g){var K=F.getElementsByTagName("img");0<K.length&&(K[0].className="geButton")}return F}})();-Graph=function(b,e,g,m,v,p){mxGraph.call(this,b,e,g,m);this.themes=v||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);this.standalone=null!=p?p:!1;b=this.baseUrl;e=b.indexOf("//");this.domainPathUrl=this.domainUrl="";0<e&&(e=b.indexOf("/",e+2),0<e&&(this.domainUrl=b.substring(0,e)),e=b.lastIndexOf("/"),0<e&&(this.domainPathUrl=b.substring(0,e+1)));this.isHtmlLabel=function(Q){Q=this.getCurrentCellStyle(Q);-return null!=Q?"1"==Q.html||"wrap"==Q[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.immediateHandling){var A=null,H=null,S=null,F=null,K=!1,c=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(Q,k){if("mouseDown"==k.getProperty("eventName")&&this.isEnabled()){Q=k.getProperty("event");var B=Q.getState();k=this.view.scale;if(!mxEvent.isAltDown(Q.getEvent())&&null!=B&&(c=this.isCellSelected(B.cell),!this.panningHandler.isActive()&&!mxEvent.isControlDown(Q.getEvent()))){var I=this.selectionCellsHandler.getHandler(B.cell);+(function(){var b=mxStencil.prototype.parseColor;mxStencil.prototype.parseColor=function(e,g,m,v,n){return"default"==v&&null!=n?"fillcolor"==m.nodeName?n.shapeBackgroundColor:n.shapeForegroundColor:b.apply(this,arguments)}})();(function(){var b=mxResources.get;mxResources.get=function(e,g,m){null==m&&(m=e);return b.apply(this,[e,g,m])}})();+(function(){var b=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(e,g,m,v,n,A,G,S){var F=b.apply(this,arguments);if(null!=g){var K=F.getElementsByTagName("img");0<K.length&&(K[0].className="geButton")}return F}})();+Graph=function(b,e,g,m,v,n){mxGraph.call(this,b,e,g,m);this.themes=v||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);this.standalone=null!=n?n:!1;b=this.baseUrl;e=b.indexOf("//");this.domainPathUrl=this.domainUrl="";0<e&&(e=b.indexOf("/",e+2),0<e&&(this.domainUrl=b.substring(0,e)),e=b.lastIndexOf("/"),0<e&&(this.domainPathUrl=b.substring(0,e+1)));this.isHtmlLabel=function(Q){Q=this.getCurrentCellStyle(Q);+return null!=Q?"1"==Q.html||"wrap"==Q[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.immediateHandling){var A=null,G=null,S=null,F=null,K=!1,c=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(Q,k){if("mouseDown"==k.getProperty("eventName")&&this.isEnabled()){Q=k.getProperty("event");var B=Q.getState();k=this.view.scale;if(!mxEvent.isAltDown(Q.getEvent())&&null!=B&&(c=this.isCellSelected(B.cell),!this.panningHandler.isActive()&&!mxEvent.isControlDown(Q.getEvent()))){var I=this.selectionCellsHandler.getHandler(B.cell);if(null==I||null==I.getHandleForEvent(Q)){var U=new mxRectangle(Q.getGraphX()-1,Q.getGraphY()-1),P=mxEvent.isTouchEvent(Q.getEvent())?mxShape.prototype.svgStrokeTolerance-1:(mxShape.prototype.svgStrokeTolerance+2)/2;I=P+2;U.grow(P);if(this.isTableCell(B.cell)&&this.isCellMovable(B.cell)&&!this.isCellSelected(B.cell)&&!(mxUtils.contains(B,Q.getGraphX()-I,Q.getGraphY()-I)&&mxUtils.contains(B,Q.getGraphX()-I,Q.getGraphY()+I)&&mxUtils.contains(B,Q.getGraphX()+I,Q.getGraphY()+I)&&mxUtils.contains(B,Q.getGraphX()+I,Q.getGraphY()-I))){var T=this.model.getParent(B.cell);I=this.model.getParent(T);if(!this.isCellSelected(I)){P*=k;var X=2*P;if(this.model.getChildAt(I,0)!=T&&mxUtils.intersects(U,new mxRectangle(B.x,B.y-P,B.width,X))||this.model.getChildAt(T,0)!=B.cell&&mxUtils.intersects(U,new mxRectangle(B.x-P,B.y,X,B.height))||mxUtils.intersects(U,new mxRectangle(B.x,B.y+B.height-P,B.width,X))||mxUtils.intersects(U,new mxRectangle(B.x+B.width-P,B.y,X,B.height)))T=this.selectionCellsHandler.isHandled(I),this.selectCellForEvent(I,Q.getEvent()),I=this.selectionCellsHandler.getHandler(I),null!=I&&(P=I.getHandleForEvent(Q),null!=P&&(I.start(Q.getGraphX(),Q.getGraphY(),P),I.blockDelayedSelection=!T,Q.consume()))}}for(;!Q.isConsumed()&&null!=B&&(this.isTableCell(B.cell)||this.isTableRow(B.cell)||this.isTable(B.cell));)this.isSwimlane(B.cell)&&this.isCellMovable(B.cell)&&(I=this.getActualStartSize(B.cell),(0<I.x||0<I.width)&&mxUtils.intersects(U,new mxRectangle(B.x+(I.x-I.width-1)*k+(0==I.x?B.width:0),B.y,1,B.height))||(0<I.y||0<I.height)&&mxUtils.intersects(U,new mxRectangle(B.x,B.y+(I.y-I.height-1)*k+(0==I.y?B.height:0),B.width,1)))&&(this.selectCellForEvent(B.cell,Q.getEvent()),I=this.selectionCellsHandler.getHandler(B.cell),null!=I&&null!=I.customHandles&&(P=mxEvent.CUSTOM_HANDLE-I.customHandles.length+1,I.start(Q.getGraphX(),Q.getGraphY(),P),Q.consume())),B=this.view.getState(this.model.getParent(B.cell))}}}}));this.addListener(mxEvent.CONSUME_MOUSE_EVENT,mxUtils.bind(this,function(Q,k){if("mouseDown"==k.getProperty("eventName")&&-this.isEnabled()){Q=k.getProperty("event");var B=Q.getState();mxEvent.isAltDown(Q.getEvent())||mxEvent.isControlDown(k)||mxEvent.isShiftDown(k)||c||null==B||!this.model.isEdge(B.cell)||(A=new mxPoint(Q.getGraphX(),Q.getGraphY()),K=this.isCellSelected(B.cell),S=B,H=Q,null!=B.text&&null!=B.text.boundingBox&&mxUtils.contains(B.text.boundingBox,Q.getGraphX(),Q.getGraphY())?F=mxEvent.LABEL_HANDLE:(k=this.selectionCellsHandler.getHandler(B.cell),null!=k&&null!=k.bends&&0<k.bends.length&&(F=k.getHandleForEvent(Q))))}}));-this.addMouseListener({mouseDown:function(Q,k){},mouseMove:mxUtils.bind(this,function(Q,k){Q=this.selectionCellsHandler.handlers.map;for(var B in Q)if(null!=Q[B].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isAltDown(k.getEvent())){var I=this.tolerance;if(null!=A&&null!=S&&null!=H){if(B=S,null!=F||Math.abs(A.x-k.getGraphX())>I||Math.abs(A.y-k.getGraphY())>I){var U=null;mxEvent.isShiftDown(k.getEvent())||(U=this.selectionCellsHandler.getHandler(B.cell));if(null!=U&&null!=-U.bends&&0<U.bends.length){U.redrawHandles();var P=null!=F?F:U.getHandleForEvent(H),T=this.view.getEdgeStyle(B),X=T==mxEdgeStyle.EntityRelation;I=B.absolutePoints;K||(P=F);P!=mxEvent.LABEL_HANDLE&&null!=I&&(P=F,null==P&&(Q=new mxRectangle(A.x,A.y),Q.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(Q,I[0].x,I[0].y)?P=0:mxUtils.contains(Q,I[I.length-1].x,I[I.length-1].y)?P=U.bends.length-1:null!=I&&(null==T&&null==P||T==mxEdgeStyle.SegmentConnector||T==mxEdgeStyle.OrthConnector)&&+this.isEnabled()){Q=k.getProperty("event");var B=Q.getState();mxEvent.isAltDown(Q.getEvent())||mxEvent.isControlDown(k)||mxEvent.isShiftDown(k)||c||null==B||!this.model.isEdge(B.cell)||(A=new mxPoint(Q.getGraphX(),Q.getGraphY()),K=this.isCellSelected(B.cell),S=B,G=Q,null!=B.text&&null!=B.text.boundingBox&&mxUtils.contains(B.text.boundingBox,Q.getGraphX(),Q.getGraphY())?F=mxEvent.LABEL_HANDLE:(k=this.selectionCellsHandler.getHandler(B.cell),null!=k&&null!=k.bends&&0<k.bends.length&&(F=k.getHandleForEvent(Q))))}}));+this.addMouseListener({mouseDown:function(Q,k){},mouseMove:mxUtils.bind(this,function(Q,k){Q=this.selectionCellsHandler.handlers.map;for(var B in Q)if(null!=Q[B].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isAltDown(k.getEvent())){var I=this.tolerance;if(null!=A&&null!=S&&null!=G){if(B=S,null!=F||Math.abs(A.x-k.getGraphX())>I||Math.abs(A.y-k.getGraphY())>I){var U=null;mxEvent.isShiftDown(k.getEvent())||(U=this.selectionCellsHandler.getHandler(B.cell));if(null!=U&&null!=+U.bends&&0<U.bends.length){U.redrawHandles();var P=null!=F?F:U.getHandleForEvent(G),T=this.view.getEdgeStyle(B),X=T==mxEdgeStyle.EntityRelation;I=B.absolutePoints;K||(P=F);P!=mxEvent.LABEL_HANDLE&&null!=I&&(P=F,null==P&&(Q=new mxRectangle(A.x,A.y),Q.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(Q,I[0].x,I[0].y)?P=0:mxUtils.contains(Q,I[I.length-1].x,I[I.length-1].y)?P=U.bends.length-1:null!=I&&(null==T&&null==P||T==mxEdgeStyle.SegmentConnector||T==mxEdgeStyle.OrthConnector)&&(null!=T&&(2==I.length||3==I.length&&(0==Math.round(I[0].x-I[1].x)&&0==Math.round(I[1].x-I[2].x)||0==Math.round(I[0].y-I[1].y)&&0==Math.round(I[1].y-I[2].y)))?P=2:(P=mxUtils.findNearestSegment(B,A.x,A.y),P=null==T?mxEvent.VIRTUAL_HANDLE-P:P+1))),null==P&&(P=mxEvent.VIRTUAL_HANDLE));Q=P==mxEvent.LABEL_HANDLE||0==P||P==U.bends.length-1;if(!X&&(null!=B.visibleSourceState||null!=B.visibleTargetState)||Q)U.start(k.getGraphX(),k.getGraphX(),P),k.consume(),this.graphHandler.reset()}null!=U&&(this.selectionCellsHandler.isHandlerActive(U)?-this.isCellSelected(B.cell)||(this.selectionCellsHandler.handlers.put(B.cell,U),this.selectCellForEvent(B.cell,k.getEvent())):this.isCellSelected(B.cell)||U.destroy());K=!1;A=H=S=F=null}}else if(B=k.getState(),null!=B&&this.isCellEditable(B.cell)){Q=this.model.getParent(B.cell);U=null;if(this.model.isEdge(B.cell)&&!this.isCellSelected(B.cell)&&!mxEvent.isAltDown(k.getEvent())&&!mxEvent.isShiftDown(k.getEvent())&&!this.isAncestorSelected(B.cell)&&(this.isSwimlane(Q)||this.model.isLayer(Q)||this.getCurrentRoot()==+this.isCellSelected(B.cell)||(this.selectionCellsHandler.handlers.put(B.cell,U),this.selectCellForEvent(B.cell,k.getEvent())):this.isCellSelected(B.cell)||U.destroy());K=!1;A=G=S=F=null}}else if(B=k.getState(),null!=B&&this.isCellEditable(B.cell)){Q=this.model.getParent(B.cell);U=null;if(this.model.isEdge(B.cell)&&!this.isCellSelected(B.cell)&&!mxEvent.isAltDown(k.getEvent())&&!mxEvent.isShiftDown(k.getEvent())&&!this.isAncestorSelected(B.cell)&&(this.isSwimlane(Q)||this.model.isLayer(Q)||this.getCurrentRoot()==Q)){if(Q=new mxRectangle(k.getGraphX(),k.getGraphY()),Q.grow(mxEdgeHandler.prototype.handleImage.width/2),I=B.absolutePoints,null!=I)null!=B.text&&null!=B.text.boundingBox&&mxUtils.contains(B.text.boundingBox,k.getGraphX(),k.getGraphY())?U="move":mxUtils.contains(Q,I[0].x,I[0].y)||mxUtils.contains(Q,I[I.length-1].x,I[I.length-1].y)?U="pointer":(T=this.view.getEdgeStyle(B),T==mxEdgeStyle.EntityRelation||null==B.visibleSourceState&&null==B.visibleTargetState||(U="crosshair",T!=mxEdgeStyle.SegmentConnector&&T!=mxEdgeStyle.OrthConnector))||(k=mxUtils.findNearestSegment(B,k.getGraphX(),k.getGraphY()),k<I.length-1&&0<=k&&(U=0==Math.round(I[k].x-I[k+1].x)?"col-resize":"row-resize"))}else if(!mxEvent.isControlDown(k.getEvent())){I=mxShape.prototype.svgStrokeTolerance/2;Q=new mxRectangle(k.getGraphX(),k.getGraphY());Q.grow(I);if(this.isTableCell(B.cell)&&this.isCellMovable(B.cell)&&(k=this.model.getParent(B.cell),I=this.model.getParent(k),!this.isCellSelected(I)))if(mxUtils.intersects(Q,new mxRectangle(B.x,B.y-2,B.width,4))&&this.model.getChildAt(I,0)!=k||mxUtils.intersects(Q,new mxRectangle(B.x,B.y+B.height-2,B.width,4)))U="row-resize";else if(mxUtils.intersects(Q,new mxRectangle(B.x-2,B.y,4,B.height))&&this.model.getChildAt(k,0)!=B.cell||mxUtils.intersects(Q,new mxRectangle(B.x+B.width-2,B.y,4,B.height)))U="col-resize";for(k=B;null==U&&null!=k&&(this.isTableCell(k.cell)||this.isTableRow(k.cell)||this.isTable(k.cell));)this.isSwimlane(k.cell)&&this.isCellMovable(k.cell)&&(I=this.getActualStartSize(k.cell),-P=this.view.scale,(0<I.x||0<I.width)&&mxUtils.intersects(Q,new mxRectangle(k.x+(I.x-I.width-1)*P+(0==I.x?k.width*P:0),k.y,1,k.height))?U="col-resize":(0<I.y||0<I.height)&&mxUtils.intersects(Q,new mxRectangle(k.x,k.y+(I.y-I.height-1)*P+(0==I.y?k.height:0),k.width,1))&&(U="row-resize")),k=this.view.getState(this.model.getParent(k.cell))}null!=U&&B.setCursor(U)}}}),mouseUp:mxUtils.bind(this,function(Q,k){F=A=H=S=null})})}this.cellRenderer.minSvgStrokeWidth=.1;var f=document.createElement("div");this.cellRenderer.getLabelValue=+P=this.view.scale,(0<I.x||0<I.width)&&mxUtils.intersects(Q,new mxRectangle(k.x+(I.x-I.width-1)*P+(0==I.x?k.width*P:0),k.y,1,k.height))?U="col-resize":(0<I.y||0<I.height)&&mxUtils.intersects(Q,new mxRectangle(k.x,k.y+(I.y-I.height-1)*P+(0==I.y?k.height:0),k.width,1))&&(U="row-resize")),k=this.view.getState(this.model.getParent(k.cell))}null!=U&&B.setCursor(U)}}}),mouseUp:mxUtils.bind(this,function(Q,k){F=A=G=S=null})})}this.cellRenderer.minSvgStrokeWidth=.1;var f=document.createElement("div");this.cellRenderer.getLabelValue=function(Q){var k=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);Q.view.graph.isHtmlLabel(Q.cell)&&("0"==mxUtils.getValue(Q.style,"html","0")?k=mxUtils.htmlEntities(k,!1):(Q.lastLabelValue!=k&&(Q.lastLabelValue=k,Q.lastSanitizedLabelValue=Graph.sanitizeHtml(k),f.innerHTML=Q.lastSanitizedLabelValue,Graph.addLightDarkColors(f,null,"simple"==Q.view.graph.getAdaptiveColors())&&(Q.lastSanitizedLabelValue=f.innerHTML)),k=Q.lastSanitizedLabelValue));return k};if("undefined"!==typeof mxVertexHandler){this.setConnectable(!0);this.setDropEnabled(!0);this.setPanning(!0);this.setTooltips(!0);this.setAllowLoops(!0);this.allowAutoPanning=!0;this.constrainChildren=this.resetEdgesOnConnect=!1;this.constrainRelativeChildren=!0;this.graphHandler.scrollOnMove=!1;this.graphHandler.scaleGrid=!0;this.connectionHandler.setCreateTarget(!1);this.connectionHandler.insertBeforeSource=!0;this.connectionHandler.isValidSource=function(Q,k){return!1};this.alternateEdgeStyle="vertical";null==m&&this.loadStylesheet();var l=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates=function(){var Q=l.apply(this,arguments);if(this.graph.pageVisible){var k=[],B=this.graph.pageFormat,I=this.graph.pageScale,U=B.width*I;B=B.height*I;I=this.graph.view.translate;for(var P=this.graph.view.scale,T=this.graph.getPageLayout(),X=0;X<T.width;X++)k.push(new mxRectangle(((T.x+X)*U+I.x)*P,(T.y*B+I.y)*P,U*P,B*P));for(X=1;X<T.height;X++)k.push(new mxRectangle((T.x*U+I.x)*P,((T.y+X)*B+I.y)*P,U*P,B*P));Q=k.concat(Q)}return Q};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor=function(Q,k){return null==Q.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(Q){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};var t=this.graphHandler.getCells;this.graphHandler.getCells=function(Q){for(var k=t.apply(this,arguments),B=new mxDictionary,I=[],U=0;U<k.length;U++){var P=this.graph.isTableCell(Q)&&this.graph.isTableCell(k[U])&&this.graph.isCellSelected(k[U])?this.graph.model.getParent(k[U]):this.graph.isTableRow(Q)&&this.graph.isTableRow(k[U])&&this.graph.isCellSelected(k[U])?k[U]:this.graph.getCompositeParent(k[U]);null==P||B.get(P)||(B.put(P,!0),I.push(P))}return I};var q=this.graphHandler.start;this.graphHandler.start=function(Q,k,B,I){var U=!1;this.graph.isTableCell(Q)&&(this.graph.isCellSelected(Q)?U=!0:Q=this.graph.model.getParent(Q));U||this.graph.isTableRow(Q)&&this.graph.isCellSelected(Q)||(Q=this.graph.getCompositeParent(Q));q.apply(this,arguments)};this.connectionHandler.createTargetVertex=function(Q,k){k=this.graph.getCompositeParent(k);return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};this.connectionHandler.insertEdge=function(Q,k,B,I,U,P){var T=mxConnectionHandler.prototype.insertEdge.apply(this,arguments);null!=I&&this.graph.applyNewEdgeStyle(I,[T]);return T};var D=new mxRubberband(this);this.getRubberband=function(){return D};-var G=(new Date).getTime(),N=0,L=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var Q=this.currentState;L.apply(this,arguments);Q!=this.currentState?(G=(new Date).getTime(),N=0):N=(new Date).getTime()-G};var J=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(Q){return mxEvent.isShiftDown(Q.getEvent())&&mxEvent.isAltDown(Q.getEvent())?!1:null!=this.currentState&&Q.getState()==this.currentState&&2E3<N||(null==this.currentState||+var H=(new Date).getTime(),N=0,L=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var Q=this.currentState;L.apply(this,arguments);Q!=this.currentState?(H=(new Date).getTime(),N=0):N=(new Date).getTime()-H};var J=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(Q){return mxEvent.isShiftDown(Q.getEvent())&&mxEvent.isAltDown(Q.getEvent())?!1:null!=this.currentState&&Q.getState()==this.currentState&&2E3<N||(null==this.currentState||"0"!=mxUtils.getValue(this.currentState.style,"outlineConnect","1"))&&J.apply(this,arguments)};var Y=this.isToggleEvent;this.isToggleEvent=function(Q){return Y.apply(this,arguments)||!mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(Q)};var ha=D.isForceRubberbandEvent;D.isForceRubberbandEvent=function(Q){return ha.apply(this,arguments)||mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(Q.getEvent())||mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==Q.getState()&&mxEvent.isTouchEvent(Q.getEvent())};var ea=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&(ea=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&(this.container.style.cursor=ea)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(Q){return mxEvent.isMouseEvent(Q.getEvent())};var aa=this.click;this.click=function(Q){var k=null==Q.state&&null!=Q.sourceState&&this.isCellLocked(this.getLayerForCell(Q.sourceState.cell));if(this.isEnabled()&&!k||Q.isConsumed())return aa.apply(this,arguments);var B=k?Q.sourceState.cell:Q.getCell();if(null!=B){var I=this.getClickableLinkForCell(B);null!=I?this.isCustomLink(I)?this.customLinkClicked(I,B):this.openLink(I):k&&this.clearSelection()}};this.tooltipHandler.getStateForEvent=function(Q){return Q.sourceState};var na=this.tooltipHandler.show;this.tooltipHandler.show=function(){na.apply(this,arguments);@@ -2304,75 +2308,75 @@ Graph.getDefaultAdaptiveColorsKey=function(){return"auto"==Graph.defaultAdaptiveGraph.createOffscreenGraph=function(b){var e=new Graph(document.createElement("div"));e.stylesheet.styles=mxUtils.clone(b.styles);e.resetViewOnRootChange=!1;e.setConnectable(!1);e.gridEnabled=!1;e.autoScroll=!1;e.setTooltips(!1);e.setEnabled(!1);e.container.style.visibility="hidden";e.container.style.position="absolute";e.container.style.overflow="hidden";e.container.style.height="1px";e.container.style.width="1px";return e};Graph.createSvgImage=function(b,e,g,m,v){g=unescape(encodeURIComponent(Graph.svgDoctype+'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+b+'px" height="'+e+'px" '+(null!=m&&null!=v?'viewBox="0 0 '+m+" "+v+'" ':"")+'version="1.1" style="color-scheme: light dark;">'+g+"</svg>"));return new mxImage("data:image/svg+xml;base64,"+(window.btoa?btoa(g):Base64.encode(g,!0)),b,e)};Graph.getSvgFromDataUri=function(b){return null!=b&&"data:image/svg"==b.substring(0,14)?Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+decodeURIComponent(escape(atob(b.substring(b.indexOf(",")+1)))):null};-Graph.createSvgNode=function(b,e,g,m,v){var p=mxUtils.createXmlDocument(),A=null!=p.createElementNS?p.createElementNS(mxConstants.NS_SVG,"svg"):p.createElement("svg");null!=v&&A.setAttribute("style","background: "+v.light+"; background-color: "+v.cssText+";");null==p.createElementNS?(A.setAttribute("xmlns",mxConstants.NS_SVG),A.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):A.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);A.setAttribute("version","1.1");A.setAttribute("width",-g+"px");A.setAttribute("height",m+"px");A.setAttribute("viewBox",b+" "+e+" "+g+" "+m);p.appendChild(A);return A};-Graph.htmlToPng=function(b,e,g,m,v,p){v=null!=v?v:"";p=null!=p?p:Editor.htmlRasterScale;var A=document.createElement("canvas");A.width=e*p;A.height=g*p;var H=document.createElement("img");H.onload=mxUtils.bind(this,function(){try{var F=A.getContext("2d");F.scale(p,p);F.drawImage(H,0,0);m(A.toDataURL())}catch(K){m(null)}});var S=mxUtils.createXmlDocument();S=null!=S.createElementNS?S.createElementNS(mxConstants.NS_SVG,"svg"):S.createElement("svg");b=(new mxSvgCanvas2D(S)).convertHtml(b);H.onerror=-function(F){m(null)};H.src="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'+e+'" height="'+g+'">'+(""!=v?'<defs xmlns="http://www.w3.org/2000/svg"><style type="text/css">'+v+"</style></defs>":"")+'<foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml">'+b+"</div></foreignObject></svg>")};-Graph.addLightDarkColors=function(b,e,g,m){function v(f,l,t){return null!=m?m(f,l,t):mxUtils.isValidColor(t)?(null==A&&null!=e&&(A={}),null!=A&&(A[l]=f.style.getPropertyValue(l)),t=mxUtils.getLightDarkColor(t,null,null,g),f.style.setProperty(l,t.cssText),!0):!1}for(var p=b.getElementsByTagName("*"),A=null,H=!1,S=0;S<p.length;S++)if(p[S]!=b&&null!=p[S].style){A=null;for(var F=0;F<p[S].style.length;F++){var K=p[S].style.item(F),c=p[S].style.getPropertyValue(K);H=v(p[S],K,c)||H}"FONT"==p[S].nodeName&&-""==p[S].style.getPropertyValue("color")&&(c=p[S].getAttribute("color"),H=v(p[S],"color",c)||H);null!=e&&null!=A&&p[S].setAttribute(e,JSON.stringify(A))}return H};Graph.removeLightDarkColors=function(b,e){b=b.getElementsByTagName("*");for(var g=!1,m=0;m<b.length;m++)try{var v=b[m].getAttribute(e);if(null!=v){b[m].removeAttribute(e);var p=JSON.parse(v),A;for(A in p){var H=p[A];""==H?(b[m].style[A]=null,""==b[m].getAttribute("style")&&b[m].removeAttribute("style")):b[m].style[A]=H;g=!0}}}catch(S){}return g};-Graph.getGivenColor=function(b,e){var g=null;if(b.nodeType==mxConstants.NODETYPE_ELEMENT){try{var m=b.getAttribute(Graph.backupStyleAttribute);if(null!=m){var v=JSON.parse(m);null!=v&&null!=v[e]&&("color"==e&&"FONT"==b.nodeName&&""==v[e]&&null!=b.getAttribute("color")?g=b.getAttribute("color"):""!=v[e]&&(g=v[e]))}}catch(p){}null==g&&""!=b.style[e]&&(g=b.style[e])}return g};-Graph.setTextColor=function(b,e,g){for(var m=g?Graph.newColorPlaceholder:Graph.newBackgroundPlaceholder,v=g?"color":"background-color",p=b.getElementsByTagName("*"),A=[],H=0;H<p.length;H++)A.push({node:p[H],value:p[H].style[v]});document.execCommand(g?"forecolor":"backcolor",!1,m);b=b.getElementsByTagName("*");for(H=0;H<b.length;H++){if(H<A.length&&A[H].node==b[H]&&A[H].value!=b[H].style[v]&&""==b[H].style[v])try{if(p=b[H].getAttribute(Graph.backupStyleAttribute),null!=p){var S=JSON.parse(p);S[v]=-"";b[H].setAttribute(Graph.backupStyleAttribute,JSON.stringify(S))}}catch(F){}if(g&&b[H].getAttribute("color")==m||b[H].style[v]==m){g&&b[H].getAttribute("color")==m&&b[H].removeAttribute("color");b[H].style[v]=e!=mxConstants.NONE?mxUtils.getLightDarkColor(e).cssText:null;try{p=b[H].getAttribute(Graph.backupStyleAttribute),S=null!=p?JSON.parse(p):{},S[v]=e!=mxConstants.NONE?e:"",b[H].setAttribute(Graph.backupStyleAttribute,JSON.stringify(S))}catch(F){}if(g&&mxClient.IS_FF){e=b[H];g=e.firstChild;if(null!=+Graph.createSvgNode=function(b,e,g,m,v){var n=mxUtils.createXmlDocument(),A=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"svg"):n.createElement("svg");null!=v&&A.setAttribute("style","background: "+v.light+"; background-color: "+v.cssText+";");null==n.createElementNS?(A.setAttribute("xmlns",mxConstants.NS_SVG),A.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):A.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);A.setAttribute("version","1.1");A.setAttribute("width",+g+"px");A.setAttribute("height",m+"px");A.setAttribute("viewBox",b+" "+e+" "+g+" "+m);n.appendChild(A);return A};+Graph.htmlToPng=function(b,e,g,m,v,n){v=null!=v?v:"";n=null!=n?n:Editor.htmlRasterScale;var A=document.createElement("canvas");A.width=e*n;A.height=g*n;var G=document.createElement("img");G.onload=mxUtils.bind(this,function(){try{var F=A.getContext("2d");F.scale(n,n);F.drawImage(G,0,0);m(A.toDataURL())}catch(K){m(null)}});var S=mxUtils.createXmlDocument();S=null!=S.createElementNS?S.createElementNS(mxConstants.NS_SVG,"svg"):S.createElement("svg");b=(new mxSvgCanvas2D(S)).convertHtml(b);G.onerror=+function(F){m(null)};G.src="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'+e+'" height="'+g+'">'+(""!=v?'<defs xmlns="http://www.w3.org/2000/svg"><style type="text/css">'+v+"</style></defs>":"")+'<foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml">'+b+"</div></foreignObject></svg>")};+Graph.addLightDarkColors=function(b,e,g,m){function v(f,l,t){return null!=m?m(f,l,t):mxUtils.isValidColor(t)?(null==A&&null!=e&&(A={}),null!=A&&(A[l]=f.style.getPropertyValue(l)),t=mxUtils.getLightDarkColor(t,null,null,g),f.style.setProperty(l,t.cssText),!0):!1}for(var n=b.getElementsByTagName("*"),A=null,G=!1,S=0;S<n.length;S++)if(n[S]!=b&&null!=n[S].style){A=null;for(var F=0;F<n[S].style.length;F++){var K=n[S].style.item(F),c=n[S].style.getPropertyValue(K);G=v(n[S],K,c)||G}"FONT"==n[S].nodeName&&+""==n[S].style.getPropertyValue("color")&&(c=n[S].getAttribute("color"),G=v(n[S],"color",c)||G);null!=e&&null!=A&&n[S].setAttribute(e,JSON.stringify(A))}return G};Graph.removeLightDarkColors=function(b,e){b=b.getElementsByTagName("*");for(var g=!1,m=0;m<b.length;m++)try{var v=b[m].getAttribute(e);if(null!=v){b[m].removeAttribute(e);var n=JSON.parse(v),A;for(A in n){var G=n[A];""==G?(b[m].style[A]=null,""==b[m].getAttribute("style")&&b[m].removeAttribute("style")):b[m].style[A]=G;g=!0}}}catch(S){}return g};+Graph.getGivenColor=function(b,e){var g=null;if(b.nodeType==mxConstants.NODETYPE_ELEMENT){try{var m=b.getAttribute(Graph.backupStyleAttribute);if(null!=m){var v=JSON.parse(m);null!=v&&null!=v[e]&&("color"==e&&"FONT"==b.nodeName&&""==v[e]&&null!=b.getAttribute("color")?g=b.getAttribute("color"):""!=v[e]&&(g=v[e]))}}catch(n){}null==g&&""!=b.style[e]&&(g=b.style[e])}return g};+Graph.setTextColor=function(b,e,g){for(var m=g?Graph.newColorPlaceholder:Graph.newBackgroundPlaceholder,v=g?"color":"background-color",n=b.getElementsByTagName("*"),A=[],G=0;G<n.length;G++)A.push({node:n[G],value:n[G].style[v]});document.execCommand(g?"forecolor":"backcolor",!1,m);b=b.getElementsByTagName("*");for(G=0;G<b.length;G++){if(G<A.length&&A[G].node==b[G]&&A[G].value!=b[G].style[v]&&""==b[G].style[v])try{if(n=b[G].getAttribute(Graph.backupStyleAttribute),null!=n){var S=JSON.parse(n);S[v]=+"";b[G].setAttribute(Graph.backupStyleAttribute,JSON.stringify(S))}}catch(F){}if(g&&b[G].getAttribute("color")==m||b[G].style[v]==m){g&&b[G].getAttribute("color")==m&&b[G].removeAttribute("color");b[G].style[v]=e!=mxConstants.NONE?mxUtils.getLightDarkColor(e).cssText:null;try{n=b[G].getAttribute(Graph.backupStyleAttribute),S=null!=n?JSON.parse(n):{},S[v]=e!=mxConstants.NONE?e:"",b[G].setAttribute(Graph.backupStyleAttribute,JSON.stringify(S))}catch(F){}if(g&&mxClient.IS_FF){e=b[G];g=e.firstChild;if(null!=g&&"A"==g.nodeName&&null==g.nextSibling&&null!=g.firstChild){e.parentNode.insertBefore(g,e);for(m=g.firstChild;null!=m;)v=m.nextSibling,e.appendChild(m),m=v;g.appendChild(e)}break}}}};Graph.zapGremlins=function(b){return mxUtils.zapGremlins(b)};Graph.stringToBytes=function(b){for(var e=Array(b.length),g=0;g<b.length;g++)e[g]=b.charCodeAt(g);return e};Graph.bytesToString=function(b){for(var e=Array(b.length),g=0;g<b.length;g++)e[g]=String.fromCharCode(b[g]);return e.join("")};Graph.base64EncodeUnicode=function(b){return btoa(encodeURIComponent(b).replace(/%([0-9A-F]{2})/g,function(e,g){return String.fromCharCode(parseInt(g,16))}))};Graph.base64DecodeUnicode=function(b){return decodeURIComponent(Array.prototype.map.call(atob(b),function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))};Graph.compressNode=function(b,e){b=mxUtils.getXml(b);return Graph.compress(e?b:Graph.zapGremlins(b))};Graph.arrayBufferToString=function(b){var e="";b=new Uint8Array(b);for(var g=b.byteLength,m=0;m<g;m++)e+=String.fromCharCode(b[m]);return e};Graph.stringToArrayBuffer=function(b){return Uint8Array.from(b,function(e){return e.charCodeAt(0)})};-Graph.arrayBufferIndexOfString=function(b,e,g){var m=e.charCodeAt(0),v=1,p=-1;for(g=g||0;g<b.byteLength;g++)if(b[g]==m){p=g;break}for(g=p+1;-1<p&&g<b.byteLength&&g<p+e.length-1;g++){if(b[g]!=e.charCodeAt(v))return Graph.arrayBufferIndexOfString(b,e,p+1);v++}return v==e.length-1?p:-1};Graph.compress=function(b,e){if(null==b||0==b.length||"undefined"===typeof pako)return b;b=e?pako.deflate(encodeURIComponent(b)):pako.deflateRaw(encodeURIComponent(b));return btoa(Graph.arrayBufferToString(new Uint8Array(b)))};+Graph.arrayBufferIndexOfString=function(b,e,g){var m=e.charCodeAt(0),v=1,n=-1;for(g=g||0;g<b.byteLength;g++)if(b[g]==m){n=g;break}for(g=n+1;-1<n&&g<b.byteLength&&g<n+e.length-1;g++){if(b[g]!=e.charCodeAt(v))return Graph.arrayBufferIndexOfString(b,e,n+1);v++}return v==e.length-1?n:-1};Graph.compress=function(b,e){if(null==b||0==b.length||"undefined"===typeof pako)return b;b=e?pako.deflate(encodeURIComponent(b)):pako.deflateRaw(encodeURIComponent(b));return btoa(Graph.arrayBufferToString(new Uint8Array(b)))};Graph.decompress=function(b,e,g){if(null==b||0==b.length||"undefined"===typeof pako)return b;b=Graph.stringToArrayBuffer(atob(b));e=decodeURIComponent(e?pako.inflate(b,{to:"string"}):pako.inflateRaw(b,{to:"string"}));return g?e:Graph.zapGremlins(e)};Graph.fadeNodes=function(b,e,g,m,v){v=null!=v?v:1E3;Graph.setTransitionForNodes(b,null);Graph.setOpacityForNodes(b,e);window.setTimeout(function(){Graph.setTransitionForNodes(b,"all "+v+"ms ease-in-out");Graph.setOpacityForNodes(b,g);window.setTimeout(function(){Graph.setTransitionForNodes(b,null);null!=m&&m()},v)},0)};-Graph.exploreFromCell=function(b,e,g){pageSize=null!=g&&null!=g.pageSize?g.pageSize:8;minSize=null!=g&&null!=g.minSize?g.minSize:180;(function(m,v){function p(K,c){if(K.getModel().isVertex(c)){var f=K.container.scrollWidth/2,l=K.container.scrollHeight/2;K.rootCell=c.referenceCell||c;K.getModel().beginUpdate();try{for(var t=c.referenceCell||c,q=m.model.getCell(t.sourceCellId),D=m.getEdges(q,null,!0,!0,!1,!0),G=[],N=0;N<D.length;N++)null!=D[N].getTerminal(!0)&&null!=D[N].getTerminal(!1)&&m.isCellVisible(D[N])&&-!m.isEdgeIgnored(D[N])&&m.isCellVisible(D[N].getTerminal(!0))&&m.isCellVisible(D[N].getTerminal(!1))&&m.isCellVisible(m.getLayerForCell(D[N]))&&G.push(D[N]);G=D=G;if(null!=c.startIndex||0<pageSize&&D.length>pageSize){var L=c.startIndex||0;G=D.slice(Math.max(0,L),Math.min(D.length,L+pageSize))}G=m.getOpposites(G,q).concat(G);var J=K.cloneCells(G);for(N=0;N<G.length;N++)if(J[N].sourceCellId=G[N].id,K.model.isEdge(J[N]))for(J[N].geometry.x=0,J[N].geometry.y=0,J[N].geometry.points=null,J[N].setStyle(J[N].getStyle()++Graph.exploreFromCell=function(b,e,g){pageSize=null!=g&&null!=g.pageSize?g.pageSize:8;minSize=null!=g&&null!=g.minSize?g.minSize:180;(function(m,v){function n(K,c){if(K.getModel().isVertex(c)){var f=K.container.scrollWidth/2,l=K.container.scrollHeight/2;K.rootCell=c.referenceCell||c;K.getModel().beginUpdate();try{for(var t=c.referenceCell||c,q=m.model.getCell(t.sourceCellId),D=m.getEdges(q,null,!0,!0,!1,!0),H=[],N=0;N<D.length;N++)null!=D[N].getTerminal(!0)&&null!=D[N].getTerminal(!1)&&m.isCellVisible(D[N])&&+!m.isEdgeIgnored(D[N])&&m.isCellVisible(D[N].getTerminal(!0))&&m.isCellVisible(D[N].getTerminal(!1))&&m.isCellVisible(m.getLayerForCell(D[N]))&&H.push(D[N]);H=D=H;if(null!=c.startIndex||0<pageSize&&D.length>pageSize){var L=c.startIndex||0;H=D.slice(Math.max(0,L),Math.min(D.length,L+pageSize))}H=m.getOpposites(H,q).concat(H);var J=K.cloneCells(H);for(N=0;N<H.length;N++)if(J[N].sourceCellId=H[N].id,K.model.isEdge(J[N]))for(J[N].geometry.x=0,J[N].geometry.y=0,J[N].geometry.points=null,J[N].setStyle(J[N].getStyle()+";curved=1;noEdgeStyle=1;entryX=none;entryY=none;exitX=none;exitY=none;labelBackgroundColor=#ffffffc0;textOpacity=100;"),J[N].setTerminal(t,null==J[N].getTerminal(!0)),q=0;q<J[N].getChildCount();q++){var Y=J[N].getChildAt(q);null!=Y.geometry&&Y.geometry.relative&&(Y.setStyle(Y.getStyle()+";labelBackgroundColor=#ffffffc0;textOpacity=100;"),Y.geometry.offset=new mxPoint(0,0),Y.geometry.y=0,Y.geometry.x=.5>Y.geometry.x?-.8:.5<Y.geometry.x?.8:0)}if(0<c.startIndex){var ha=K.createVertex(null,null,mxResources.get("previousPage")+" ("+Math.ceil((c.startIndex||0)/pageSize)+"/"+Math.ceil(D.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");ha.referenceCell=t;ha.startIndex=Math.max(0,(c.startIndex||0)-pageSize);J.splice(0,0,ha)}if(D.length>(c.startIndex||0)+pageSize){var ea=K.createVertex(null,null,mxResources.get("nextPage")+" ("+(Math.ceil((c.startIndex||0)/pageSize)+2)+"/"+Math.ceil(D.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");ea.referenceCell=t;ea.startIndex=(c.startIndex||0)+pageSize;J.splice(0,0,ea)}for(var aa in K.getModel().cells){var na=K.getModel().getCell(aa);na!=K.rootCell&&!K.getModel().isAncestor(K.rootCell,na)&&K.getModel().isVertex(na)&&K.removeCells([na])}K.addCells(J);var W=K.getModel().getGeometry(K.rootCell);null!=W&&(W=W.clone(),W.x=f-W.width/2,W.y=l-W.height/3,K.getModel().setGeometry(K.rootCell,W));c=[];for(aa in K.getModel().cells)na=K.getModel().getCell(aa),na!=K.rootCell&&K.getModel().isVertex(na)&&K.getModel().getParent(na)==K.getDefaultParent()&&(c.push(na),W=K.getModel().getGeometry(na),null!=W&&(W.x=f-W.width/2,W.y=l-W.height/2));var ba=c.length,ja=2*Math.PI/ba,ca=Math.max(minSize,Math.min(K.container.scrollWidth/2.5-80,K.container.scrollHeight/2.5-80));for(f=0;f<ba;f++)W=K.getModel().getGeometry(c[f]),null!=W&&(W=W.clone(),W.x+=ca*Math.sin(f*ja),W.y+=ca*Math.cos(f*ja),K.getModel().setGeometry(c[f],W))}finally{K.getModel().endUpdate()}}}var A=document.createElement("div");A.style.position=-"absolute";A.style.display="block";A.style.background=Editor.isDarkMode()?Editor.darkColor:"#ffffff";A.style.width="100%";A.style.height="100%";A.style.left="0px";A.style.top="0px";A.style.zIndex=2;var H=document.createElement("img");H.setAttribute("src",Editor.closeBlackImage);H.style.position="absolute";H.style.cursor="pointer";H.style.right="10px";H.style.top="10px";A.appendChild(H);var S=document.createElement("div");S.style.position="absolute";S.style.cursor="pointer";S.style.right="38px";S.style.top=-"14px";S.style.textAlign="right";S.style.verticalAlign="top";mxUtils.write(S,mxResources.get("close"));A.appendChild(S);document.body.appendChild(A);var F=function(K){27==K.keyCode&&H.click()};mxEvent.addListener(document,"keydown",F);(function(K){if(mxClient.isBrowserSupported()){var c=new Graph(K);c.keepEdgesInBackground=!0;c.isCellResizable=function(){return!1};c.isCellRotatable=function(){return!1};c.getCursorForCell=function(G){return this.model.isVertex(G)?"pointer":null};c.getFoldingImage=-function(){return null};var f=function(){mxEvent.removeListener(document,"keydown",F);K.parentNode.removeChild(K);m.scrollCellToVisible(v)};mxEvent.addListener(H,"click",f);mxEvent.addListener(S,"click",f);c.setEnabled(!1);var l=c.click;c.click=function(G){var N=G.getCell(),L=null!=N?null!=N.referenceCell?N.referenceCell:N:null;null!=N&&c.rootCell!=N&&0<c.getEdges(L).length?p(c,N):l.apply(this,arguments)};f=c.container.scrollWidth/2;var t=c.container.scrollHeight/3;c.model.beginUpdate();var q=c.importCells([v])[0];-q.sourceCellId=v.id;q.geometry.x=f-q.geometry.width/2;q.geometry.y=t-q.geometry.height/2;c.model.endUpdate();var D=!1;c.getModel().addListener(mxEvent.CHANGE,function(G,N){D||(G=N.getProperty("edit").changes,mxText.prototype.enableBoundingBox=!1,c.labelsVisible=!1,D=!0,mxEffects.animateChanges(c,G,function(){var L=new mxParallelEdgeLayout(c);L.spacing=60;var J=L.layout;L.layout=function(Y){L.spacing=Math.min(60,Math.max(30,60-5*Y.length));J.apply(this,arguments)};L.execute(c.getDefaultParent());mxText.prototype.enableBoundingBox=-!0;c.labelsVisible=!0;c.tooltipHandler.hide();c.refresh();D=!1}))});p(c,q)}else mxUtils.error("Browser is not supported!",200,!1)})(A)})(b,e)};Graph.removeKeys=function(b,e){for(var g in b)e(g)&&delete b[g]};Graph.setTransitionForNodes=function(b,e){for(var g=0;g<b.length;g++)mxUtils.setPrefixedStyle(b[g].style,"transition",e)};Graph.setOpacityForNodes=function(b,e){for(var g=0;g<b.length;g++)b[g].style.opacity=e};+"absolute";A.style.display="block";A.style.background=Editor.isDarkMode()?Editor.darkColor:"#ffffff";A.style.width="100%";A.style.height="100%";A.style.left="0px";A.style.top="0px";A.style.zIndex=2;var G=document.createElement("img");G.setAttribute("src",Editor.closeBlackImage);G.style.position="absolute";G.style.cursor="pointer";G.style.right="10px";G.style.top="10px";A.appendChild(G);var S=document.createElement("div");S.style.position="absolute";S.style.cursor="pointer";S.style.right="38px";S.style.top=+"14px";S.style.textAlign="right";S.style.verticalAlign="top";mxUtils.write(S,mxResources.get("close"));A.appendChild(S);document.body.appendChild(A);var F=function(K){27==K.keyCode&&G.click()};mxEvent.addListener(document,"keydown",F);(function(K){if(mxClient.isBrowserSupported()){var c=new Graph(K);c.keepEdgesInBackground=!0;c.isCellResizable=function(){return!1};c.isCellRotatable=function(){return!1};c.getCursorForCell=function(H){return this.model.isVertex(H)?"pointer":null};c.getFoldingImage=+function(){return null};var f=function(){mxEvent.removeListener(document,"keydown",F);K.parentNode.removeChild(K);m.scrollCellToVisible(v)};mxEvent.addListener(G,"click",f);mxEvent.addListener(S,"click",f);c.setEnabled(!1);var l=c.click;c.click=function(H){var N=H.getCell(),L=null!=N?null!=N.referenceCell?N.referenceCell:N:null;null!=N&&c.rootCell!=N&&0<c.getEdges(L).length?n(c,N):l.apply(this,arguments)};f=c.container.scrollWidth/2;var t=c.container.scrollHeight/3;c.model.beginUpdate();var q=c.importCells([v])[0];+q.sourceCellId=v.id;q.geometry.x=f-q.geometry.width/2;q.geometry.y=t-q.geometry.height/2;c.model.endUpdate();var D=!1;c.getModel().addListener(mxEvent.CHANGE,function(H,N){D||(H=N.getProperty("edit").changes,mxText.prototype.enableBoundingBox=!1,c.labelsVisible=!1,D=!0,mxEffects.animateChanges(c,H,function(){var L=new mxParallelEdgeLayout(c);L.spacing=60;var J=L.layout;L.layout=function(Y){L.spacing=Math.min(60,Math.max(30,60-5*Y.length));J.apply(this,arguments)};L.execute(c.getDefaultParent());mxText.prototype.enableBoundingBox=+!0;c.labelsVisible=!0;c.tooltipHandler.hide();c.refresh();D=!1}))});n(c,q)}else mxUtils.error("Browser is not supported!",200,!1)})(A)})(b,e)};Graph.removeKeys=function(b,e){for(var g in b)e(g)&&delete b[g]};Graph.setTransitionForNodes=function(b,e){for(var g=0;g<b.length;g++)mxUtils.setPrefixedStyle(b[g].style,"transition",e)};Graph.setOpacityForNodes=function(b,e){for(var g=0;g<b.length;g++)b[g].style.opacity=e};Graph.removePasteFormatting=function(b,e){for(;null!=b;){null!=b.firstChild&&Graph.removePasteFormatting(b.firstChild,!0);var g=b.nextSibling;if(b.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=b.style){"#000000"==b.style.color&&(b.style.color="");if("SPAN"==b.nodeName&&"Apple-tab-span"==b.className){var m=Graph.createTabNode(4);b.parentNode.replaceChild(m,b);b=m}if("P"==b.nodeName&&"p1"==b.className){for(;null!=b.firstChild;)b.parentNode.insertBefore(b.firstChild,b);null!=g&&"P"==g.nodeName&&"p1"==g.className&&b.parentNode.insertBefore(b.ownerDocument.createElement("br"),b);b.parentNode.removeChild(b)}!e&&null!=b.innerHTML&&0<=b.innerHTML.indexOf("\t")&&(m=Graph.createTabNode(4),b.innerHTML=b.innerHTML.replace(/\t/g,m.outerHTML))}b=g}};Graph.createTabNode=function(b){var e="\t";if(null!=b)for(e="";0<b;)e+=" ",b--;b=document.createElement("span");b.style.whiteSpace="pre";b.appendChild(document.createTextNode(e));return b};Graph.sanitizeHtml=function(b,e){return Graph.domPurify(b,!1)};Graph.sanitizeLink=function(b){if(null==b)return null;var e=document.createElement("a");e.setAttribute("href",b);Graph.sanitizeNode(e);return e.getAttribute("href")};Graph.sanitizeNode=function(b){return Graph.domPurify(b,!0)};DOMPurify.addHook("afterSanitizeAttributes",function(b){"use"==b.nodeName&&(null!=b.getAttribute("xlink:href")&&!b.getAttribute("xlink:href").startsWith("#")||null!=b.getAttribute("href")&&!b.getAttribute("href").startsWith("#"))&&b.remove()});Graph.domPurify=function(b,e){window.DOM_PURIFY_CONFIG.IN_PLACE=e;return DOMPurify.sanitize(b,window.DOM_PURIFY_CONFIG)};-Graph.clipSvgDataUri=function(b){if(null!=b&&"data:image/svg+xml;base64,"==b.substring(0,26))try{var e=document.createElement("div");e.style.position="absolute";e.style.visibility="hidden";var g=decodeURIComponent(escape(atob(b.substring(26)))),m=g.indexOf("<svg");if(0<=m){e.innerHTML=Graph.sanitizeHtml(g.substring(m));var v=e.getElementsByTagName("svg");if(0<v.length){document.body.appendChild(e);try{m=g=1;var p=v[0].getAttribute("width"),A=v[0].getAttribute("height");p=null!=p&&"%"!=p.charAt(p.length--1)?parseFloat(p):NaN;A=null!=A&&"%"!=A.charAt(A.length-1)?parseFloat(A):NaN;var H=v[0].getAttribute("viewBox");if(null!=H&&!isNaN(p)&&!isNaN(A)){var S=H.split(" ");4<=H.length&&(g=parseFloat(S[2])/p,m=parseFloat(S[3])/A,new mxRectangle(parseFloat(S[0]),parseFloat(S[1]),parseFloat(S[2]),parseFloat(S[3])))}var F=v[0].getBBox();if(0<F.width&&0<F.height){p=0;var K=v[0].querySelectorAll("[stroke-width]");for(A=0;A<K.length;A++)p=Math.max(p,parseFloat(K[A].getAttribute("stroke-width")));F=new mxRectangle(F.x,-F.y,F.width,F.height);F.grow(p/2);e.getElementsByTagName("svg")[0].setAttribute("viewBox",F.x+" "+F.y+" "+F.width+" "+F.height);e.getElementsByTagName("svg")[0].setAttribute("width",F.width/g);e.getElementsByTagName("svg")[0].setAttribute("height",F.height/m)}}catch(c){}finally{document.body.removeChild(e)}b=Editor.createSvgDataUri(mxUtils.getXml(v[0]))}}}catch(c){}return b};+Graph.clipSvgDataUri=function(b){if(null!=b&&"data:image/svg+xml;base64,"==b.substring(0,26))try{var e=document.createElement("div");e.style.position="absolute";e.style.visibility="hidden";var g=decodeURIComponent(escape(atob(b.substring(26)))),m=g.indexOf("<svg");if(0<=m){e.innerHTML=Graph.sanitizeHtml(g.substring(m));var v=e.getElementsByTagName("svg");if(0<v.length){document.body.appendChild(e);try{m=g=1;var n=v[0].getAttribute("width"),A=v[0].getAttribute("height");n=null!=n&&"%"!=n.charAt(n.length-+1)?parseFloat(n):NaN;A=null!=A&&"%"!=A.charAt(A.length-1)?parseFloat(A):NaN;var G=v[0].getAttribute("viewBox");if(null!=G&&!isNaN(n)&&!isNaN(A)){var S=G.split(" ");4<=G.length&&(g=parseFloat(S[2])/n,m=parseFloat(S[3])/A,new mxRectangle(parseFloat(S[0]),parseFloat(S[1]),parseFloat(S[2]),parseFloat(S[3])))}var F=v[0].getBBox();if(0<F.width&&0<F.height){n=0;var K=v[0].querySelectorAll("[stroke-width]");for(A=0;A<K.length;A++)n=Math.max(n,parseFloat(K[A].getAttribute("stroke-width")));F=new mxRectangle(F.x,+F.y,F.width,F.height);F.grow(n/2);e.getElementsByTagName("svg")[0].setAttribute("viewBox",F.x+" "+F.y+" "+F.width+" "+F.height);e.getElementsByTagName("svg")[0].setAttribute("width",F.width/g);e.getElementsByTagName("svg")[0].setAttribute("height",F.height/m)}}catch(c){}finally{document.body.removeChild(e)}b=Editor.createSvgDataUri(mxUtils.getXml(v[0]))}}}catch(c){}return b};Graph.createRemoveIcon=function(b,e){var g=document.createElement("img");g.setAttribute("src",Dialog.prototype.clearImage);g.setAttribute("title",b);g.setAttribute("width","13");g.setAttribute("height","10");g.style.marginLeft="4px";g.style.marginBottom="-1px";g.style.cursor="pointer";mxEvent.addListener(g,"click",e);return g};Graph.isPageLink=function(b){return null!=b&&"data:page/id,"==b.substring(0,13)};-Graph.rewritePageLinks=function(b,e){function g(v,p){var A=v.getAttribute(p);if(null!=A){Graph.isPageLink(A)&&(A="#"+A.substring(A.indexOf(":")+1));var H=p;e&&"xlink:href"==p&&(v.removeAttribute(p),H="href");v.setAttribute(H,A)}}b=b.getElementsByTagName("a");if(null!=b)for(var m=0;m<b.length;m++)g(b[m],"href"),g(b[m],"xlink:href")};Graph.isLink=function(b){return null!=b&&b.match(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g)};+Graph.rewritePageLinks=function(b,e){function g(v,n){var A=v.getAttribute(n);if(null!=A){Graph.isPageLink(A)&&(A="#"+A.substring(A.indexOf(":")+1));var G=n;e&&"xlink:href"==n&&(v.removeAttribute(n),G="href");v.setAttribute(G,A)}}b=b.getElementsByTagName("a");if(null!=b)for(var m=0;m<b.length;m++)g(b[m],"href"),g(b[m],"xlink:href")};Graph.isLink=function(b){return null!=b&&b.match(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g)};mxUtils.extend(Graph,mxGraph);Graph.prototype.minFitScale=null;Graph.prototype.maxFitScale=null;Graph.prototype.linkPolicy="frame"==urlParams.target?"blank":urlParams.target||"auto";Graph.prototype.linkTarget="frame"==urlParams.target?"_self":"_blank";Graph.prototype.linkRelation="nofollow noopener noreferrer";Graph.prototype.defaultScrollbars=!0;Graph.prototype.defaultPageVisible=!0;Graph.prototype.defaultGridEnabled="0"!=urlParams.grid;Graph.prototype.lightbox=!1;Graph.prototype.diagramBackgroundColor="#f0f0f0";Graph.prototype.enableDiagramBackground=!1;Graph.prototype.defaultPageBackgroundColor="1"==urlParams.embedInline?"transparent":"light-dark(#ffffff, "+Editor.darkColor+")";Graph.prototype.defaultPageBorderColor="light-dark(#ffffff, #000000)";Graph.prototype.shapeForegroundColor="light-dark(#000000, #ffffff)";Graph.prototype.shapeBackgroundColor="light-dark(#ffffff, var("+Editor.darkColorVar+", "+Editor.darkColor+"))";Graph.prototype.scrollTileSize=new mxRectangle(0,0,400,400);Graph.prototype.transparentBackground=!0;Graph.prototype.selectParentAfterDelete=!1;Graph.prototype.defaultEdgeLength=80;Graph.prototype.immediateHandling=!0;Graph.prototype.connectionArrowsEnabled=!0;Graph.prototype.placeholderPattern=RegExp("%(date{.*}|[^%^{^}^ ^\"^ '^=^;]+)%","g");Graph.prototype.absoluteUrlPattern=RegExp("^(?:[a-z]+:)?//","i");Graph.prototype.defaultThemeName="default";Graph.prototype.defaultThemes={};Graph.prototype.baseUrl=null!=urlParams.base?mxUtils.removeJavascriptProtocol(decodeURIComponent(urlParams.base)):(window!=window.top?document.referrer:document.location.toString()).split("#")[0];Graph.prototype.editAfterInsert=!1;Graph.prototype.builtInProperties=["label","tooltip","placeholders","placeholder"];Graph.prototype.standalone=!1;Graph.prototype.enableFlowAnimation=!1;Graph.prototype.roundableShapes="label rectangle internalStorage corner parallelogram swimlane triangle trapezoid ext step tee process link rhombus offPageConnector loopLimit hexagon manualInput card curlyBracket singleArrow callout doubleArrow flexArrow umlLifeline".split(" ");Graph.prototype.vertexFontSize=null;Graph.prototype.edgeFontSize=null;Graph.prototype.adaptiveColors="auto";-Graph.prototype.init=function(b){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(g,m){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var v=g.view.graph.tolerance,p=!0,A=null,H=mxUtils.bind(this,function(K){p=!0;A=new mxPoint(mxEvent.getClientX(K),mxEvent.getClientY(K))}),S=mxUtils.bind(this,function(K){p=p&&null!=A&&Math.abs(A.x-mxEvent.getClientX(K))<v&&Math.abs(A.y-mxEvent.getClientY(K))<v}),F=mxUtils.bind(this,function(K){if(p)for(var c=mxEvent.getSource(K);null!=-c&&c!=m.node;){if("a"==c.nodeName.toLowerCase()){g.view.graph.labelLinkClicked(g,c,K);break}c=c.parentNode}});mxEvent.addGestureListeners(m.node,H,S,F);mxEvent.addListener(m.node,"click",function(K){mxEvent.consume(K)})};if(null!=this.tooltipHandler){var e=this.tooltipHandler.init;this.tooltipHandler.init=function(){e.apply(this,arguments);null!=this.div&&mxEvent.addListener(this.div,"click",mxUtils.bind(this,function(g){var m=mxEvent.getSource(g);"A"==m.nodeName&&(m=m.getAttribute("href"),null!=+Graph.prototype.init=function(b){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(g,m){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var v=g.view.graph.tolerance,n=!0,A=null,G=mxUtils.bind(this,function(K){n=!0;A=new mxPoint(mxEvent.getClientX(K),mxEvent.getClientY(K))}),S=mxUtils.bind(this,function(K){n=n&&null!=A&&Math.abs(A.x-mxEvent.getClientX(K))<v&&Math.abs(A.y-mxEvent.getClientY(K))<v}),F=mxUtils.bind(this,function(K){if(n)for(var c=mxEvent.getSource(K);null!=+c&&c!=m.node;){if("a"==c.nodeName.toLowerCase()){g.view.graph.labelLinkClicked(g,c,K);break}c=c.parentNode}});mxEvent.addGestureListeners(m.node,G,S,F);mxEvent.addListener(m.node,"click",function(K){mxEvent.consume(K)})};if(null!=this.tooltipHandler){var e=this.tooltipHandler.init;this.tooltipHandler.init=function(){e.apply(this,arguments);null!=this.div&&mxEvent.addListener(this.div,"click",mxUtils.bind(this,function(g){var m=mxEvent.getSource(g);"A"==m.nodeName&&(m=m.getAttribute("href"),null!=m&&this.graph.isCustomLink(m)&&(mxEvent.isTouchEvent(g)||!mxEvent.isPopupTrigger(g))&&this.graph.customLinkClicked(m)&&mxEvent.consume(g))}))}}this.initLayoutManager()};(function(){Graph.prototype.useCssTransforms=!1;Graph.prototype.currentScale=1;Graph.prototype.currentTranslate=new mxPoint(0,0);Graph.prototype.pasteEdgeStyle=!1;Graph.prototype.isFillState=function(A){return!this.isSpecialColor(A.style[mxConstants.STYLE_FILLCOLOR])&&"1"!=mxUtils.getValue(A.style,"lineShape",null)&&(this.model.isVertex(A.cell)||"arrow"==mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null)||"wire"==mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null)||"filledEdge"==mxUtils.getValue(A.style,-mxConstants.STYLE_SHAPE,null)||"flexArrow"==mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null)||"mxgraph.arrows2.wedgeArrow"==mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null))};Graph.prototype.isGradientState=function(A){return this.isFillState(A)&&"wire"!=mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null)};Graph.prototype.isStrokeState=function(A){return!0};Graph.prototype.getTextColor=function(A,H){for(var S=H?"color":"background-color",F=A==this.cellEditor.textarea&&H?"default":Graph.getGivenColor(A,-S);null==F&&null!=A&&A!=this.cellEditor.textarea.parentNode;)F=A==this.cellEditor.textarea&&H?"default":Graph.getGivenColor(A,S),A=A.parentNode;if("rgba(0, 0, 0, 0)"==F||"transparent"==F)F=mxConstants.NONE;return F};Graph.prototype.isSpecialColor=function(A){return 0<=mxUtils.indexOf([mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_FILLCOLOR,"inherit","swimlane","indicated"],A)};Graph.prototype.isGlassState=function(A){A=mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null);return"label"==A||"rectangle"==-A||"internalStorage"==A||"ext"==A||"umlLifeline"==A||"swimlane"==A||"process"==A};Graph.prototype.isRoundedState=function(A){return null!=A.shape?A.shape.isRoundable():0<=mxUtils.indexOf(this.roundableShapes,mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null))};Graph.prototype.isLineJumpState=function(A){var H=mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null);return!mxUtils.getValue(A.style,mxConstants.STYLE_CURVED,!1)&&("connector"==H||"filledEdge"==H||"wire"==H)};Graph.prototype.isAutoSizeState=-function(A){return"1"==mxUtils.getValue(A.style,mxConstants.STYLE_AUTOSIZE,null)};Graph.prototype.isImageState=function(A){return null!=mxUtils.getValue(A.style,mxConstants.STYLE_IMAGE,null)};Graph.prototype.isShadowState=function(A){return!0};Graph.prototype.getVerticesAndEdges=function(A,H){A=null!=A?A:!0;H=null!=H?H:!0;var S=this.model;return S.filterDescendants(function(F){return A&&S.isVertex(F)||H&&S.isEdge(F)},S.getRoot())};Graph.prototype.applyNewEdgeStyle=function(A,H,S){A=this.getCellStyle(A).newEdgeStyle;-if(null!=A){this.model.beginUpdate();try{var F=JSON.parse(A),K;for(K in F)this.setCellStyles(K,F[K],H),"edgeStyle"==K&&"elbowEdgeStyle"==F[K]&&null!=S&&this.setCellStyles("elbow",S==mxConstants.DIRECTION_SOUTH||S==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",H)}finally{this.model.endUpdate()}}};Graph.prototype.getCommonStyle=function(A){for(var H={},S=0;S<A.length;S++){var F=this.view.getState(A[S]);null!=F&&this.mergeStyle(F.style,H,0==S)}return H};Graph.prototype.mergeStyle=function(A,H,S){if(null!=-A){var F={},K;for(K in A){var c=A[K];null!=c&&(F[K]=!0,null==H[K]&&S?H[K]=c:H[K]!=c&&delete H[K])}for(K in H)F[K]||delete H[K]}};Graph.prototype.getStartEditingCell=function(A,H){H=this.getCellStyle(A);H=parseInt(mxUtils.getValue(H,mxConstants.STYLE_STARTSIZE,0));this.isTable(A)&&(!this.isSwimlane(A)||0==H)&&""==this.getLabel(A)&&0<this.model.getChildCount(A)&&(A=this.model.getChildAt(A,0),H=this.getCellStyle(A),H=parseInt(mxUtils.getValue(H,mxConstants.STYLE_STARTSIZE,0)));if(this.isTableRow(A)&&-(!this.isSwimlane(A)||0==H)&&""==this.getLabel(A)&&0<this.model.getChildCount(A))for(H=0;H<this.model.getChildCount(A);H++){var S=this.model.getChildAt(A,H);if(this.isCellEditable(S)){A=S;break}}return A};Graph.prototype.copyStyle=function(A){return this.getCellStyle(A,!1)};Graph.prototype.pasteStyle=function(A,H,S,F){null!=A&&(F||(S=null!=S?S:Graph.cellStyles,Graph.removeKeys(A,function(K){return 0>mxUtils.indexOf(S,K)})),this.updateCellStyles(A,H))};Graph.prototype.copyCellStyles=function(A,H,S,-F,K,c,f){var l=!1,t=!1;if(0<A.length)for(var q=0;q<A.length&&(l=this.getModel().isVertex(A[q])||l,!(t=this.getModel().isEdge(A[q])||t)||!l);q++);else t=l=!0;l=l&&!c;t=t&&!f;for(q=0;q<H.length;q++)if(A=0<=mxUtils.indexOf(Graph.textStyles,H[q]),"strokeColor"!=H[q]||null!=S[q]&&"none"!=S[q])if(0<=mxUtils.indexOf(Graph.cellStyles,H[q])||"shape"==H[q])if("shape"!=H[q]&&(l||A)&&(null==S[q]?delete F[H[q]]:F[H[q]]=S[q]),t||A)null==S[q]?delete K[H[q]]:K[H[q]]=S[q]};Graph.prototype.includeDescendants=function(A){for(var H=-[],S=0;S<A.length;S++)H=H.concat(this.model.getDescendants(A[S]));return H};Graph.prototype.pasteCellStyles=function(A,H,S,F,K){H=null!=H?H:this.currentVertexStyle;S=null!=S?S:this.currentEdgeStyle;K=null!=K?K:this.pasteEdgeStyle;this.model.beginUpdate();try{for(var c=0;c<A.length;c++){var f=A[c],l=this.model.getStyle(f),t=!1;null!=f.style&&(pairs=f.style.split(";"),t=t||0<=mxUtils.indexOf(pairs,"text"));if(t)var q=Graph.textStyles;else if(q=Graph.cellStyles.slice(),!F)for(var D=null!=l?l.split(";"):-[],G=0;G<D.length;G++){var N=D[G],L=N.indexOf("=");if(0<=L){var J=N.substring(0,L),Y=mxUtils.indexOf(q,J);0<=Y&&q.splice(Y,1);for(t=0;t<Graph.cellStyleGroups.length;t++){var ha=Graph.cellStyleGroups[t];if(0<=mxUtils.indexOf(ha,J))for(var ea=0;ea<ha.length;ea++){var aa=mxUtils.indexOf(q,ha[ea]);0<=aa&&q.splice(aa,1)}}}}var na=this.model.isEdge(f);t=na?S:H;for(G=0;G<q.length;G++){J=q[G];var W=t[J];null!=W&&("edgeStyle"!=J||K)&&(na||!na&&0>mxUtils.indexOf(Graph.edgeStyles,J))&&(l=mxUtils.setStyle(l,-J,W),"fontFamily"==J&&null==t.fontSource&&(l=mxUtils.setStyle(l,"fontSource",null)),na&&"rounded"==J&&"1"==W&&null==t.curved&&(l=mxUtils.setStyle(l,"curved",null)))}Editor.simpleLabels&&(l=mxUtils.setStyle(mxUtils.setStyle(l,"html",null),"whiteSpace",null));this.model.setStyle(f,l)}}finally{this.model.endUpdate()}return A};Graph.prototype.updateCellStyles=function(A,H){this.model.beginUpdate();try{for(var S=0;S<H.length;S++)if(this.model.isVertex(H[S])||this.model.isEdge(H[S])){var F=this.getCellStyle(H[S],-!1),K=F[mxConstants.STYLE_PERIMETER],c=!1;for(l in A){var f=A[l];if(F[l]!=f){if(l==mxConstants.STYLE_SHAPE&&"umlLifeline"==F[l]&&"umlLifeline"!=f){c=!0;var l="participant"}this.setCellStyles(l,f,[H[S]])}}c&&this.setCellStyles(mxConstants.STYLE_PERIMETER,K,[H[S]])}}finally{this.model.endUpdate()}};Graph.prototype.isFastZoomEnabled=function(){return"nocss"!=urlParams.zoom&&!mxClient.NO_FO&&!mxClient.IS_EDGE&&!this.useCssTransforms&&(this.isCssTransformsSupported()||mxClient.IS_IOS)};Graph.prototype.isCssTransformsSupported=-function(){return this.dialect==mxConstants.DIALECT_SVG&&!mxClient.NO_FO&&(!this.lightbox||!mxClient.IS_SF)};Graph.prototype.getCellAt=function(A,H,S,F,K,c){this.useCssTransforms&&(A=A/this.currentScale-this.currentTranslate.x,H=H/this.currentScale-this.currentTranslate.y);return this.getScaledCellAt.apply(this,arguments)};Graph.prototype.getScaledCellAt=function(A,H,S,F,K,c){F=null!=F?F:!0;K=null!=K?K:!0;null==S&&(S=this.getCurrentRoot(),null==S&&(S=this.getModel().getRoot()));if(null!=S)for(var f=-this.model.getChildCount(S)-1;0<=f;f--){var l=this.model.getChildAt(S,f),t=this.getScaledCellAt(A,H,l,F,K,c);if(null!=t)return t;if(this.isCellVisible(l)&&(K&&this.model.isEdge(l)||F&&this.model.isVertex(l))&&(t=this.view.getState(l),null!=t&&(null==c||!c(t,A,H))&&this.intersects(t,A,H)))return l}return null};Graph.prototype.isRecursiveVertexResize=function(A){return!this.isSwimlane(A.cell)&&0<this.model.getChildCount(A.cell)&&!this.isCellCollapsed(A.cell)&&"1"==mxUtils.getValue(A.style,"recursiveResize",-"1")&&null==mxUtils.getValue(A.style,"childLayout",null)};Graph.prototype.getAbsoluteParent=function(A){for(var H=this.getCellGeometry(A);null!=H&&H.relative;)A=this.getModel().getParent(A),H=this.getCellGeometry(A);return A};Graph.prototype.isPart=function(A){return"1"==mxUtils.getValue(this.getCurrentCellStyle(A),"part","0")||this.isTableCell(A)||this.isTableRow(A)};Graph.prototype.getCompositeParents=function(A){for(var H=new mxDictionary,S=[],F=0;F<A.length;F++){var K=this.getCompositeParent(A[F]);-this.isTableCell(K)&&(K=this.graph.model.getParent(K));this.isTableRow(K)&&(K=this.graph.model.getParent(K));null==K||H.get(K)||(H.put(K,!0),S.push(K))}return S};Graph.prototype.getReferenceTerminal=function(A){if(null!=A){var H=this.getCellGeometry(A);null!=H&&H.relative&&(A=this.model.getParent(A))}null!=A&&this.model.isEdge(A)&&(A=this.model.getParent(A));null!=A&&(A=this.getCompositeParent(A));return A};Graph.prototype.getCompositeParent=function(A){for(;this.isPart(A);){var H=this.model.getParent(A);-if(!this.model.isVertex(H))break;A=H}return A};Graph.prototype.filterSelectionCells=function(A){var H=this.getSelectionCells();if(null!=A){for(var S=[],F=0;F<H.length;F++)A(H[F])||S.push(H[F]);H=S}return H};var b=mxGraph.prototype.scrollRectToVisible;Graph.prototype.scrollRectToVisible=function(A){if(this.useCssTransforms){var H=this.currentScale,S=this.currentTranslate;A=new mxRectangle((A.x+2*S.x)*H-S.x,(A.y+2*S.y)*H-S.y,A.width*H,A.height*H)}b.apply(this,arguments)};mxCellHighlight.prototype.getStrokeWidth=-function(A){A=this.strokeWidth;this.graph.useCssTransforms&&(A/=this.graph.currentScale);return A};mxGraphView.prototype.getGraphBounds=function(){var A=this.graphBounds;if(this.graph.useCssTransforms){var H=this.graph.currentTranslate,S=this.graph.currentScale;A=new mxRectangle((A.x+H.x)*S,(A.y+H.y)*S,A.width*S,A.height*S)}return A};mxGraphView.prototype.viewStateChanged=function(){this.graph.useCssTransforms?this.validate():this.revalidate();this.graph.sizeDidChange()};var e=mxGraphView.prototype.validate;+mxConstants.STYLE_SHAPE,null)||"flexArrow"==mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null)||"mxgraph.arrows2.wedgeArrow"==mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null))};Graph.prototype.isGradientState=function(A){return this.isFillState(A)&&"wire"!=mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null)};Graph.prototype.isStrokeState=function(A){return!0};Graph.prototype.getTextColor=function(A,G){for(var S=G?"color":"background-color",F=A==this.cellEditor.textarea&&G?"default":Graph.getGivenColor(A,+S);null==F&&null!=A&&A!=this.cellEditor.textarea.parentNode;)F=A==this.cellEditor.textarea&&G?"default":Graph.getGivenColor(A,S),A=A.parentNode;if("rgba(0, 0, 0, 0)"==F||"transparent"==F)F=mxConstants.NONE;return F};Graph.prototype.isSpecialColor=function(A){return 0<=mxUtils.indexOf([mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_FILLCOLOR,"inherit","swimlane","indicated"],A)};Graph.prototype.isGlassState=function(A){A=mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null);return"label"==A||"rectangle"==+A||"internalStorage"==A||"ext"==A||"umlLifeline"==A||"swimlane"==A||"process"==A};Graph.prototype.isRoundedState=function(A){return null!=A.shape?A.shape.isRoundable():0<=mxUtils.indexOf(this.roundableShapes,mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null))};Graph.prototype.isLineJumpState=function(A){var G=mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null);return!mxUtils.getValue(A.style,mxConstants.STYLE_CURVED,!1)&&("connector"==G||"filledEdge"==G||"wire"==G)};Graph.prototype.isAutoSizeState=+function(A){return"1"==mxUtils.getValue(A.style,mxConstants.STYLE_AUTOSIZE,null)};Graph.prototype.isImageState=function(A){return null!=mxUtils.getValue(A.style,mxConstants.STYLE_IMAGE,null)};Graph.prototype.isShadowState=function(A){return!0};Graph.prototype.getVerticesAndEdges=function(A,G){A=null!=A?A:!0;G=null!=G?G:!0;var S=this.model;return S.filterDescendants(function(F){return A&&S.isVertex(F)||G&&S.isEdge(F)},S.getRoot())};Graph.prototype.applyNewEdgeStyle=function(A,G,S){A=this.getCellStyle(A).newEdgeStyle;+if(null!=A){this.model.beginUpdate();try{var F=JSON.parse(A),K;for(K in F)this.setCellStyles(K,F[K],G),"edgeStyle"==K&&"elbowEdgeStyle"==F[K]&&null!=S&&this.setCellStyles("elbow",S==mxConstants.DIRECTION_SOUTH||S==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",G)}finally{this.model.endUpdate()}}};Graph.prototype.getCommonStyle=function(A){for(var G={},S=0;S<A.length;S++){var F=this.view.getState(A[S]);null!=F&&this.mergeStyle(F.style,G,0==S)}return G};Graph.prototype.mergeStyle=function(A,G,S){if(null!=+A){var F={},K;for(K in A){var c=A[K];null!=c&&(F[K]=!0,null==G[K]&&S?G[K]=c:G[K]!=c&&delete G[K])}for(K in G)F[K]||delete G[K]}};Graph.prototype.getStartEditingCell=function(A,G){G=this.getCellStyle(A);G=parseInt(mxUtils.getValue(G,mxConstants.STYLE_STARTSIZE,0));this.isTable(A)&&(!this.isSwimlane(A)||0==G)&&""==this.getLabel(A)&&0<this.model.getChildCount(A)&&(A=this.model.getChildAt(A,0),G=this.getCellStyle(A),G=parseInt(mxUtils.getValue(G,mxConstants.STYLE_STARTSIZE,0)));if(this.isTableRow(A)&&+(!this.isSwimlane(A)||0==G)&&""==this.getLabel(A)&&0<this.model.getChildCount(A))for(G=0;G<this.model.getChildCount(A);G++){var S=this.model.getChildAt(A,G);if(this.isCellEditable(S)){A=S;break}}return A};Graph.prototype.copyStyle=function(A){return this.getCellStyle(A,!1)};Graph.prototype.pasteStyle=function(A,G,S,F){null!=A&&(F||(S=null!=S?S:Graph.cellStyles,Graph.removeKeys(A,function(K){return 0>mxUtils.indexOf(S,K)})),this.updateCellStyles(A,G))};Graph.prototype.copyCellStyles=function(A,G,S,+F,K,c,f){var l=!1,t=!1;if(0<A.length)for(var q=0;q<A.length&&(l=this.getModel().isVertex(A[q])||l,!(t=this.getModel().isEdge(A[q])||t)||!l);q++);else t=l=!0;l=l&&!c;t=t&&!f;for(q=0;q<G.length;q++)if(A=0<=mxUtils.indexOf(Graph.textStyles,G[q]),"strokeColor"!=G[q]||null!=S[q]&&"none"!=S[q])if(0<=mxUtils.indexOf(Graph.cellStyles,G[q])||"shape"==G[q])if("shape"!=G[q]&&(l||A)&&(null==S[q]?delete F[G[q]]:F[G[q]]=S[q]),t||A)null==S[q]?delete K[G[q]]:K[G[q]]=S[q]};Graph.prototype.includeDescendants=function(A){for(var G=+[],S=0;S<A.length;S++)G=G.concat(this.model.getDescendants(A[S]));return G};Graph.prototype.pasteCellStyles=function(A,G,S,F,K){G=null!=G?G:this.currentVertexStyle;S=null!=S?S:this.currentEdgeStyle;K=null!=K?K:this.pasteEdgeStyle;this.model.beginUpdate();try{for(var c=0;c<A.length;c++){var f=A[c],l=this.model.getStyle(f),t=!1;null!=f.style&&(pairs=f.style.split(";"),t=t||0<=mxUtils.indexOf(pairs,"text"));if(t)var q=Graph.textStyles;else if(q=Graph.cellStyles.slice(),!F)for(var D=null!=l?l.split(";"):+[],H=0;H<D.length;H++){var N=D[H],L=N.indexOf("=");if(0<=L){var J=N.substring(0,L),Y=mxUtils.indexOf(q,J);0<=Y&&q.splice(Y,1);for(t=0;t<Graph.cellStyleGroups.length;t++){var ha=Graph.cellStyleGroups[t];if(0<=mxUtils.indexOf(ha,J))for(var ea=0;ea<ha.length;ea++){var aa=mxUtils.indexOf(q,ha[ea]);0<=aa&&q.splice(aa,1)}}}}var na=this.model.isEdge(f);t=na?S:G;for(H=0;H<q.length;H++){J=q[H];var W=t[J];null!=W&&("edgeStyle"!=J||K)&&(na||!na&&0>mxUtils.indexOf(Graph.edgeStyles,J))&&(l=mxUtils.setStyle(l,+J,W),"fontFamily"==J&&null==t.fontSource&&(l=mxUtils.setStyle(l,"fontSource",null)),na&&"rounded"==J&&"1"==W&&null==t.curved&&(l=mxUtils.setStyle(l,"curved",null)))}Editor.simpleLabels&&(l=mxUtils.setStyle(mxUtils.setStyle(l,"html",null),"whiteSpace",null));this.model.setStyle(f,l)}}finally{this.model.endUpdate()}return A};Graph.prototype.updateCellStyles=function(A,G){this.model.beginUpdate();try{for(var S=0;S<G.length;S++)if(this.model.isVertex(G[S])||this.model.isEdge(G[S])){var F=this.getCellStyle(G[S],+!1),K=F[mxConstants.STYLE_PERIMETER],c=!1;for(l in A){var f=A[l];if(F[l]!=f){if(l==mxConstants.STYLE_SHAPE&&"umlLifeline"==F[l]&&"umlLifeline"!=f){c=!0;var l="participant"}this.setCellStyles(l,f,[G[S]])}}c&&this.setCellStyles(mxConstants.STYLE_PERIMETER,K,[G[S]])}}finally{this.model.endUpdate()}};Graph.prototype.isFastZoomEnabled=function(){return"nocss"!=urlParams.zoom&&!mxClient.NO_FO&&!mxClient.IS_EDGE&&!this.useCssTransforms&&(this.isCssTransformsSupported()||mxClient.IS_IOS)};Graph.prototype.isCssTransformsSupported=+function(){return this.dialect==mxConstants.DIALECT_SVG&&!mxClient.NO_FO&&(!this.lightbox||!mxClient.IS_SF)};Graph.prototype.getCellAt=function(A,G,S,F,K,c){this.useCssTransforms&&(A=A/this.currentScale-this.currentTranslate.x,G=G/this.currentScale-this.currentTranslate.y);return this.getScaledCellAt.apply(this,arguments)};Graph.prototype.getScaledCellAt=function(A,G,S,F,K,c){F=null!=F?F:!0;K=null!=K?K:!0;null==S&&(S=this.getCurrentRoot(),null==S&&(S=this.getModel().getRoot()));if(null!=S)for(var f=+this.model.getChildCount(S)-1;0<=f;f--){var l=this.model.getChildAt(S,f),t=this.getScaledCellAt(A,G,l,F,K,c);if(null!=t)return t;if(this.isCellVisible(l)&&(K&&this.model.isEdge(l)||F&&this.model.isVertex(l))&&(t=this.view.getState(l),null!=t&&(null==c||!c(t,A,G))&&this.intersects(t,A,G)))return l}return null};Graph.prototype.isRecursiveVertexResize=function(A){return!this.isSwimlane(A.cell)&&0<this.model.getChildCount(A.cell)&&!this.isCellCollapsed(A.cell)&&"1"==mxUtils.getValue(A.style,"recursiveResize",+"1")&&null==mxUtils.getValue(A.style,"childLayout",null)};Graph.prototype.getAbsoluteParent=function(A){for(var G=this.getCellGeometry(A);null!=G&&G.relative;)A=this.getModel().getParent(A),G=this.getCellGeometry(A);return A};Graph.prototype.isPart=function(A){return"1"==mxUtils.getValue(this.getCurrentCellStyle(A),"part","0")||this.isTableCell(A)||this.isTableRow(A)};Graph.prototype.getCompositeParents=function(A){for(var G=new mxDictionary,S=[],F=0;F<A.length;F++){var K=this.getCompositeParent(A[F]);+this.isTableCell(K)&&(K=this.graph.model.getParent(K));this.isTableRow(K)&&(K=this.graph.model.getParent(K));null==K||G.get(K)||(G.put(K,!0),S.push(K))}return S};Graph.prototype.getReferenceTerminal=function(A){if(null!=A){var G=this.getCellGeometry(A);null!=G&&G.relative&&(A=this.model.getParent(A))}null!=A&&this.model.isEdge(A)&&(A=this.model.getParent(A));null!=A&&(A=this.getCompositeParent(A));return A};Graph.prototype.getCompositeParent=function(A){for(;this.isPart(A);){var G=this.model.getParent(A);+if(!this.model.isVertex(G))break;A=G}return A};Graph.prototype.filterSelectionCells=function(A){var G=this.getSelectionCells();if(null!=A){for(var S=[],F=0;F<G.length;F++)A(G[F])||S.push(G[F]);G=S}return G};var b=mxGraph.prototype.scrollRectToVisible;Graph.prototype.scrollRectToVisible=function(A){if(this.useCssTransforms){var G=this.currentScale,S=this.currentTranslate;A=new mxRectangle((A.x+2*S.x)*G-S.x,(A.y+2*S.y)*G-S.y,A.width*G,A.height*G)}b.apply(this,arguments)};mxCellHighlight.prototype.getStrokeWidth=+function(A){A=this.strokeWidth;this.graph.useCssTransforms&&(A/=this.graph.currentScale);return A};mxGraphView.prototype.getGraphBounds=function(){var A=this.graphBounds;if(this.graph.useCssTransforms){var G=this.graph.currentTranslate,S=this.graph.currentScale;A=new mxRectangle((A.x+G.x)*S,(A.y+G.y)*S,A.width*S,A.height*S)}return A};mxGraphView.prototype.viewStateChanged=function(){this.graph.useCssTransforms?this.validate():this.revalidate();this.graph.sizeDidChange()};var e=mxGraphView.prototype.validate;mxGraphView.prototype.validate=function(A){this.graph.useCssTransforms&&(this.graph.currentScale=this.scale,this.graph.currentTranslate.x=this.translate.x,this.graph.currentTranslate.y=this.translate.y,this.scale=1,this.translate.x=0,this.translate.y=0);e.apply(this,arguments);this.graph.useCssTransforms&&(this.graph.updateCssTransform(),this.scale=this.graph.currentScale,this.translate.x=this.graph.currentTranslate.x,this.translate.y=this.graph.currentTranslate.y)};var g=mxGraph.prototype.getCellsForGroup;-Graph.prototype.getCellsForGroup=function(A){A=g.apply(this,arguments);for(var H=[],S=0;S<A.length;S++)this.isTableRow(A[S])||this.isTableCell(A[S])||H.push(A[S]);return H};var m=mxGraph.prototype.getCellsForUngroup;Graph.prototype.getCellsForUngroup=function(A){A=m.apply(this,arguments);for(var H=[],S=0;S<A.length;S++)this.isTable(A[S])||this.isTableRow(A[S])||this.isTableCell(A[S])||H.push(A[S]);return H};Graph.prototype.updateCssTransform=function(){var A=this.view.getDrawPane();if(null!=A)if(A=-A.parentNode,this.useCssTransforms){var H=A.getAttribute("transform");A.setAttribute("transformOrigin","0 0");var S=Math.round(100*this.currentScale)/100;A.setAttribute("transform","scale("+S+","+S+")translate("+Math.round(100*this.currentTranslate.x)/100+","+Math.round(100*this.currentTranslate.y)/100+")");H!=A.getAttribute("transform")&&this.fireEvent(new mxEventObject("cssTransformChanged"),"transform",A.getAttribute("transform"))}else A.removeAttribute("transformOrigin"),A.removeAttribute("transform")};-var v=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){var A=this.graph.useCssTransforms,H=this.scale,S=this.translate;A&&(this.scale=this.graph.currentScale,this.translate=this.graph.currentTranslate);v.apply(this,arguments);A&&(this.scale=H,this.translate=S)};var p=mxGraph.prototype.updatePageBreaks;mxGraph.prototype.updatePageBreaks=function(A,H,S){var F=this.useCssTransforms,K=this.view.scale,c=this.view.translate;F&&(this.view.scale=1,this.view.translate=-new mxPoint(0,0),this.useCssTransforms=!1);p.apply(this,arguments);F&&(this.view.scale=K,this.view.translate=c,this.useCssTransforms=!0)}})();Graph.prototype.isLightboxView=function(){return this.lightbox};Graph.prototype.isViewer=function(){return!1};+Graph.prototype.getCellsForGroup=function(A){A=g.apply(this,arguments);for(var G=[],S=0;S<A.length;S++)this.isTableRow(A[S])||this.isTableCell(A[S])||G.push(A[S]);return G};var m=mxGraph.prototype.getCellsForUngroup;Graph.prototype.getCellsForUngroup=function(A){A=m.apply(this,arguments);for(var G=[],S=0;S<A.length;S++)this.isTable(A[S])||this.isTableRow(A[S])||this.isTableCell(A[S])||G.push(A[S]);return G};Graph.prototype.updateCssTransform=function(){var A=this.view.getDrawPane();if(null!=A)if(A=+A.parentNode,this.useCssTransforms){var G=A.getAttribute("transform");A.setAttribute("transformOrigin","0 0");var S=Math.round(100*this.currentScale)/100;A.setAttribute("transform","scale("+S+","+S+")translate("+Math.round(100*this.currentTranslate.x)/100+","+Math.round(100*this.currentTranslate.y)/100+")");G!=A.getAttribute("transform")&&this.fireEvent(new mxEventObject("cssTransformChanged"),"transform",A.getAttribute("transform"))}else A.removeAttribute("transformOrigin"),A.removeAttribute("transform")};+var v=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){var A=this.graph.useCssTransforms,G=this.scale,S=this.translate;A&&(this.scale=this.graph.currentScale,this.translate=this.graph.currentTranslate);v.apply(this,arguments);A&&(this.scale=G,this.translate=S)};var n=mxGraph.prototype.updatePageBreaks;mxGraph.prototype.updatePageBreaks=function(A,G,S){var F=this.useCssTransforms,K=this.view.scale,c=this.view.translate;F&&(this.view.scale=1,this.view.translate=+new mxPoint(0,0),this.useCssTransforms=!1);n.apply(this,arguments);F&&(this.view.scale=K,this.view.translate=c,this.useCssTransforms=!0)}})();Graph.prototype.isLightboxView=function(){return this.lightbox};Graph.prototype.isViewer=function(){return!1};Graph.prototype.labelLinkClicked=function(b,e,g){var m=e.getAttribute("href");m!=Graph.sanitizeLink(m)&&Graph.sanitizeNode(e);if(null!=m&&!this.isCustomLink(m)&&(mxEvent.isLeftMouseButton(g)&&!mxEvent.isPopupTrigger(g)||mxEvent.isTouchEvent(g))){if(!this.isEnabled()||this.isCellLocked(b.cell))b=this.isBlankLink(m)?this.linkTarget:"_top",this.openLink(this.getAbsoluteUrl(m),b);mxEvent.consume(g)}};-Graph.prototype.openLink=function(b,e,g){var m=window;try{if(b=Graph.sanitizeLink(b),null!=b)if("_self"==e&&window!=window.top)window.location.href=b;else if(b.substring(0,this.baseUrl.length)==this.baseUrl&&"#"==b.charAt(this.baseUrl.length)&&"_top"==e&&window==window.top){var v=b.split("#")[1];window.location.hash=="#"+v&&(window.location.hash="");window.location.hash=v}else m=window.open(b,null!=e?e:"_blank",g?null:"noopener,noreferrer"),null==m||g||(m.opener=null)}catch(p){}return m};+Graph.prototype.openLink=function(b,e,g){var m=window;try{if(b=Graph.sanitizeLink(b),null!=b)if("_self"==e&&window!=window.top)window.location.href=b;else if(b.substring(0,this.baseUrl.length)==this.baseUrl&&"#"==b.charAt(this.baseUrl.length)&&"_top"==e&&window==window.top){var v=b.split("#")[1];window.location.hash=="#"+v&&(window.location.hash="");window.location.hash=v}else m=window.open(b,null!=e?e:"_blank",g?null:"noopener,noreferrer"),null==m||g||(m.opener=null)}catch(n){}return m};Graph.prototype.getLinkTitle=function(b){return b.substring(b.lastIndexOf("/")+1)};Graph.prototype.isCustomLink=function(b){return"data:"==b.substring(0,5)};Graph.prototype.customLinkClicked=function(b,e){return!1};Graph.prototype.isExternalProtocol=function(b){return"mailto:"===b.substring(0,7)};Graph.prototype.isBlankLink=function(b){return!this.isExternalProtocol(b)&&("blank"===this.linkPolicy||"self"!==this.linkPolicy&&!this.isRelativeUrl(b)&&b.substring(0,this.domainUrl.length)!==this.domainUrl)};Graph.prototype.isRelativeUrl=function(b){return null!=b&&!this.absoluteUrlPattern.test(b)&&"data:"!==b.substring(0,5)&&!this.isExternalProtocol(b)};Graph.prototype.getAbsoluteUrl=function(b){null!=b&&this.isRelativeUrl(b)&&(b="#"==b.charAt(0)?this.baseUrl+b:"/"==b.charAt(0)?this.domainUrl+b:this.domainPathUrl+b);return b};Graph.prototype.initLayoutManager=function(){this.layoutManager=new mxLayoutManager(this);this.layoutManager.hasLayout=function(b){return null!=this.graph.getCellStyle(b).childLayout};this.layoutManager.getLayout=function(b,e){var g=this.graph.model.getParent(b);if(!this.graph.isCellCollapsed(b)&&(e!=mxEvent.BEGIN_UPDATE||this.hasLayout(g,e))){b=this.graph.getCellStyle(b);if("stackLayout"==b.childLayout)return e=new mxStackLayout(this.graph,!0),e.resizeParentMax="1"==mxUtils.getValue(b,"resizeParentMax",@@ -2382,15 +2386,15 @@ b.childLayout)return e=new mxCompactTreeLayout(this.graph),e.horizontal="1"==mxUe.parallelEdgeSpacing=mxUtils.getValue(b,"parallelEdgeSpacing",mxHierarchicalLayout.prototype.parallelEdgeSpacing),e;if("circleLayout"==b.childLayout)return new mxCircleLayout(this.graph);if("organicLayout"==b.childLayout)return new mxFastOrganicLayout(this.graph);if("tableLayout"==b.childLayout)return new TableLayout(this.graph);if(null!=b.childLayout&&"["==String(b.childLayout).charAt(0))try{return new mxCompositeLayout(this.graph,this.graph.createLayouts(JSON.parse(b.childLayout)))}catch(m){null!=window.console&&console.error(m)}}return null}};Graph.prototype.createLayouts=function(b){for(var e=[],g=0;g<b.length;g++)if(0<=mxUtils.indexOf(Graph.layoutNames,b[g].layout)){var m="mxOrgChartLayout"==b[g].layout&&null!=b[g].config?new window[b[g].layout](this,b[g].config.branchOptimizer):new window[b[g].layout](this);if(null!=b[g].config)for(var v in b[g].config)if("mxOrgChartLayout"!=b[g].layout||"branchOptimizer"!=v)m[v]=b[g].config[v];e.push(m)}else throw Error(mxResources.get("invalidCallFnNotFound",[b[g].layout]));return e};-Graph.prototype.getDataForCells=function(b,e){for(var g=[],m=0;m<b.length;m++){var v={};v.id=b[m].id;var p=null!=b[m].value?b[m].value.attributes:null;this.isReplacePlaceholders(b[m])&&e&&(v.value=this.getLabel(b[m]));if(null!=p)for(var A=0;A<p.length;A++)v[p[A].nodeName]=p[A].nodeValue;else v.label=this.convertValueToString(b[m]);g.push(v)}return g};-Graph.prototype.getNodesForCells=function(b){for(var e=[],g=0;g<b.length;g++){var m=this.view.getState(b[g]);if(null!=m){for(var v=this.cellRenderer.getShapesForState(m),p=0;p<v.length;p++)null!=v[p]&&null!=v[p].node&&e.push(v[p].node);null!=m.control&&null!=m.control.node&&e.push(m.control.node)}}return e};+Graph.prototype.getDataForCells=function(b,e){for(var g=[],m=0;m<b.length;m++){var v={};v.id=b[m].id;var n=null!=b[m].value?b[m].value.attributes:null;this.isReplacePlaceholders(b[m])&&e&&(v.value=this.getLabel(b[m]));if(null!=n)for(var A=0;A<n.length;A++)v[n[A].nodeName]=n[A].nodeValue;else v.label=this.convertValueToString(b[m]);g.push(v)}return g};+Graph.prototype.getNodesForCells=function(b){for(var e=[],g=0;g<b.length;g++){var m=this.view.getState(b[g]);if(null!=m){for(var v=this.cellRenderer.getShapesForState(m),n=0;n<v.length;n++)null!=v[n]&&null!=v[n].node&&e.push(v[n].node);null!=m.control&&null!=m.control.node&&e.push(m.control.node)}}return e};Graph.prototype.createWipeAnimations=function(b,e){for(var g=[],m=0;m<b.length;m++){var v=this.view.getState(b[m]);null!=v&&null!=v.shape&&(this.model.isEdge(v.cell)&&null!=v.absolutePoints&&1<v.absolutePoints.length?g.push(this.createEdgeWipeAnimation(v,e)):this.model.isVertex(v.cell)&&null!=v.shape.bounds&&g.push(this.createVertexWipeAnimation(v,e)))}return g};-Graph.prototype.createEdgeWipeAnimation=function(b,e){var g=b.absolutePoints.slice(),m=b.segments,v=b.length,p=g.length;return{execute:mxUtils.bind(this,function(A,H){if(null!=b.shape){var S=[g[0]];H=A/H;e||(H=1-H);for(var F=v*H,K=1;K<p;K++)if(F<=m[K-1]){S.push(new mxPoint(g[K-1].x+(g[K].x-g[K-1].x)*F/m[K-1],g[K-1].y+(g[K].y-g[K-1].y)*F/m[K-1]));break}else F-=m[K-1],S.push(g[K]);b.shape.points=S;b.shape.redraw();0==A&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1);null!=b.text&&null!=-b.text.node&&(b.text.node.style.opacity=H)}}),stop:mxUtils.bind(this,function(){null!=b.shape&&(b.shape.points=g,b.shape.redraw(),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),e?1:0))})}};+Graph.prototype.createEdgeWipeAnimation=function(b,e){var g=b.absolutePoints.slice(),m=b.segments,v=b.length,n=g.length;return{execute:mxUtils.bind(this,function(A,G){if(null!=b.shape){var S=[g[0]];G=A/G;e||(G=1-G);for(var F=v*G,K=1;K<n;K++)if(F<=m[K-1]){S.push(new mxPoint(g[K-1].x+(g[K].x-g[K-1].x)*F/m[K-1],g[K-1].y+(g[K].y-g[K-1].y)*F/m[K-1]));break}else F-=m[K-1],S.push(g[K]);b.shape.points=S;b.shape.redraw();0==A&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1);null!=b.text&&null!=+b.text.node&&(b.text.node.style.opacity=G)}}),stop:mxUtils.bind(this,function(){null!=b.shape&&(b.shape.points=g,b.shape.redraw(),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),e?1:0))})}};Graph.prototype.createVertexWipeAnimation=function(b,e){var g=new mxRectangle.fromRectangle(b.shape.bounds);return{execute:mxUtils.bind(this,function(m,v){null!=b.shape&&(v=m/v,e||(v=1-v),b.shape.bounds=new mxRectangle(g.x,g.y,g.width*v,g.height),b.shape.redraw(),0==m&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=v))}),stop:mxUtils.bind(this,function(){null!=b.shape&&(b.shape.bounds=g,b.shape.redraw(),null!=b.text&&null!=b.text.node&&-(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),e?1:0))})}};Graph.prototype.executeAnimations=function(b,e,g,m){g=null!=g?g:30;m=null!=m?m:30;var v=null,p=0,A=mxUtils.bind(this,function(){if(p==g||this.stoppingCustomActions){window.clearInterval(v);for(var H=0;H<b.length;H++)b[H].stop();null!=e&&e()}else for(H=0;H<b.length;H++)b[H].execute(p,g);p++});v=window.setInterval(A,m);A()};+(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),e?1:0))})}};Graph.prototype.executeAnimations=function(b,e,g,m){g=null!=g?g:30;m=null!=m?m:30;var v=null,n=0,A=mxUtils.bind(this,function(){if(n==g||this.stoppingCustomActions){window.clearInterval(v);for(var G=0;G<b.length;G++)b[G].stop();null!=e&&e()}else for(G=0;G<b.length;G++)b[G].execute(n,g);n++});v=window.setInterval(A,m);A()};Graph.prototype.getPageSize=function(){return this.pageVisible&&null!=this.pageFormat?new mxRectangle(0,0,this.pageFormat.width*this.pageScale,this.pageFormat.height*this.pageScale):this.scrollTileSize};-Graph.prototype.getPageLayout=function(b,e,g){b=null!=b?b:this.getGraphBounds();e=null!=e?e:this.view.translate;g=null!=g?g:this.view.scale;var m=this.getPageSize();if(0==b.width||0==b.height)return new mxRectangle(0,0,1,1);var v=Math.floor(Math.ceil(b.x/g-e.x)/m.width),p=Math.floor(Math.ceil(b.y/g-e.y)/m.height);return new mxRectangle(v,p,Math.ceil((Math.floor((b.x+b.width)/g)-e.x)/m.width)-v,Math.ceil((Math.floor((b.y+b.height)/g)-e.y)/m.height)-p)};+Graph.prototype.getPageLayout=function(b,e,g){b=null!=b?b:this.getGraphBounds();e=null!=e?e:this.view.translate;g=null!=g?g:this.view.scale;var m=this.getPageSize();if(0==b.width||0==b.height)return new mxRectangle(0,0,1,1);var v=Math.floor(Math.ceil(b.x/g-e.x)/m.width),n=Math.floor(Math.ceil(b.y/g-e.y)/m.height);return new mxRectangle(v,n,Math.ceil((Math.floor((b.x+b.width)/g)-e.x)/m.width)-v,Math.ceil((Math.floor((b.y+b.height)/g)-e.y)/m.height)-n)};Graph.prototype.getDefaultTranslate=function(b){var e=this.getPagePadding(),g=this.getPageSize();return new mxPoint(e.x-b.x*g.width,e.y-b.y*g.height)};Graph.prototype.updateMinimumSize=function(){var b=this.getPageLayout(),e=this.getPagePadding(),g=this.getPageSize(),m=Math.ceil(2*e.x+b.width*g.width);b=Math.ceil(2*e.y+b.height*g.height);if(null==this.minimumGraphSize||this.minimumGraphSize.width!=m||this.minimumGraphSize.height!=b)this.minimumGraphSize=new mxRectangle(0,0,m,b)};Graph.prototype.sanitizeHtml=function(b,e){return Graph.sanitizeHtml(b,e)};Graph.prototype.updatePlaceholders=function(){var b=!1,e;for(e in this.model.cells){var g=this.model.cells[e];this.isReplacePlaceholders(g)&&(this.view.invalidate(g,!1,!1),b=!0)}b&&this.view.validate()};Graph.prototype.isReplacePlaceholders=function(b){return null!=b.value&&"object"==typeof b.value&&"1"==b.value.getAttribute("placeholders")};Graph.prototype.isZoomWheelEvent=function(b){return Graph.zoomWheel&&!mxEvent.isShiftDown(b)&&!mxEvent.isMetaDown(b)&&!mxEvent.isAltDown(b)&&(!mxEvent.isControlDown(b)||mxClient.IS_MAC)||!Graph.zoomWheel&&(mxEvent.isAltDown(b)||mxEvent.isControlDown(b))};Graph.prototype.isScrollWheelEvent=function(b){return!this.isZoomWheelEvent(b)};Graph.prototype.isTransparentClickEvent=function(b){return mxEvent.isAltDown(b)||mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(b)};@@ -2399,32 +2403,32 @@ Graph.prototype.isSplitTarget=function(b,e,g){return!this.model.isEdge(e[0])&&!mGraph.prototype.isLabelMovable=function(b){var e=this.getCurrentCellStyle(b);return!this.isCellLocked(b)&&(this.model.isEdge(b)&&this.edgeLabelsMovable||this.model.isVertex(b)&&(this.vertexLabelsMovable||"1"==mxUtils.getValue(e,"labelMovable","0")))};Graph.prototype.setGridSize=function(b){this.gridSize=b;this.fireEvent(new mxEventObject("gridSizeChanged"))};Graph.prototype.setDefaultParent=function(b){this.defaultParent=b;this.fireEvent(new mxEventObject("defaultParentChanged"))};Graph.prototype.getClickableLinkForCell=function(b){do{var e=this.getLinkForCell(b);if(null!=e)return e;b=this.model.getParent(b)}while(null!=b);return null};Graph.prototype.getGlobalVariable=function(b){var e=null;"date"==b?e=(new Date).toLocaleDateString():"time"==b?e=(new Date).toLocaleTimeString():"timestamp"==b?e=(new Date).toLocaleString():"date{"==b.substring(0,5)&&(b=b.substring(5,b.length-1),e=this.formatDate(new Date,b));return e};Graph.prototype.formatDate=function(b,e,g){null==this.dateFormatCache&&(this.dateFormatCache={i18n:{dayNames:"Sun Mon Tue Wed Thu Fri Sat Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),monthNames:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec January February March April May June July August September October November December".split(" ")},masks:{"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",-shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});var m=this.dateFormatCache,v=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,p=/[^-+\dA-Z]/g,A=function(G,N){G=String(G);for(N=N||2;G.length<N;)G="0"+G;return G};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(b)||-/\d/.test(b)||(e=b,b=void 0);b=b?new Date(b):new Date;if(isNaN(b))throw SyntaxError("invalid date");e=String(m.masks[e]||e||m.masks["default"]);"UTC:"==e.slice(0,4)&&(e=e.slice(4),g=!0);var H=g?"getUTC":"get",S=b[H+"Date"](),F=b[H+"Day"](),K=b[H+"Month"](),c=b[H+"FullYear"](),f=b[H+"Hours"](),l=b[H+"Minutes"](),t=b[H+"Seconds"]();H=b[H+"Milliseconds"]();var q=g?0:b.getTimezoneOffset(),D={d:S,dd:A(S),ddd:m.i18n.dayNames[F],dddd:m.i18n.dayNames[F+7],m:K+1,mm:A(K+1),mmm:m.i18n.monthNames[K],mmmm:m.i18n.monthNames[K+-12],yy:String(c).slice(2),yyyy:c,h:f%12||12,hh:A(f%12||12),H:f,HH:A(f),M:l,MM:A(l),s:t,ss:A(t),l:A(H,3),L:A(99<H?Math.round(H/10):H),t:12>f?"a":"p",tt:12>f?"am":"pm",T:12>f?"A":"P",TT:12>f?"AM":"PM",Z:g?"UTC":(String(b).match(v)||[""]).pop().replace(p,""),o:(0<q?"-":"+")+A(100*Math.floor(Math.abs(q)/60)+Math.abs(q)%60,4),S:["th","st","nd","rd"][3<S%10?0:(10!=S%100-S%10)*S%10]};return e.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(G){return G in D?D[G]:G.slice(1,-G.length-1)})};Graph.prototype.getLayerForCell=function(b){for(;null!=b&&!this.model.isLayer(b);)b=this.model.getParent(b);return b};Graph.prototype.getLayerForCells=function(b){var e=null;if(0<b.length){e=this.getLayerForCell(b[0]);for(var g=1;g<b.length;g++)if(!this.model.isAncestor(e,b[g])){e=null;break}}return e};-Graph.prototype.createLayersDialog=function(b,e){var g=document.createElement("div");g.style.position="absolute";for(var m=this.getModel(),v=m.getChildCount(m.root),p=0;p<v;p++)mxUtils.bind(this,function(A){function H(){m.isVisible(A)?(K.setAttribute("src",Editor.visibleImage),mxUtils.setOpacity(F,75)):(K.setAttribute("src",Editor.hiddenImage),mxUtils.setOpacity(F,25))}var S=this.convertValueToString(A)||mxResources.get("background")||"Background",F=document.createElement("div");F.style.overflow=+shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});var m=this.dateFormatCache,v=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,n=/[^-+\dA-Z]/g,A=function(H,N){H=String(H);for(N=N||2;H.length<N;)H="0"+H;return H};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(b)||+/\d/.test(b)||(e=b,b=void 0);b=b?new Date(b):new Date;if(isNaN(b))throw SyntaxError("invalid date");e=String(m.masks[e]||e||m.masks["default"]);"UTC:"==e.slice(0,4)&&(e=e.slice(4),g=!0);var G=g?"getUTC":"get",S=b[G+"Date"](),F=b[G+"Day"](),K=b[G+"Month"](),c=b[G+"FullYear"](),f=b[G+"Hours"](),l=b[G+"Minutes"](),t=b[G+"Seconds"]();G=b[G+"Milliseconds"]();var q=g?0:b.getTimezoneOffset(),D={d:S,dd:A(S),ddd:m.i18n.dayNames[F],dddd:m.i18n.dayNames[F+7],m:K+1,mm:A(K+1),mmm:m.i18n.monthNames[K],mmmm:m.i18n.monthNames[K++12],yy:String(c).slice(2),yyyy:c,h:f%12||12,hh:A(f%12||12),H:f,HH:A(f),M:l,MM:A(l),s:t,ss:A(t),l:A(G,3),L:A(99<G?Math.round(G/10):G),t:12>f?"a":"p",tt:12>f?"am":"pm",T:12>f?"A":"P",TT:12>f?"AM":"PM",Z:g?"UTC":(String(b).match(v)||[""]).pop().replace(n,""),o:(0<q?"-":"+")+A(100*Math.floor(Math.abs(q)/60)+Math.abs(q)%60,4),S:["th","st","nd","rd"][3<S%10?0:(10!=S%100-S%10)*S%10]};return e.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(H){return H in D?D[H]:H.slice(1,+H.length-1)})};Graph.prototype.getLayerForCell=function(b){for(;null!=b&&!this.model.isLayer(b);)b=this.model.getParent(b);return b};Graph.prototype.getLayerForCells=function(b){var e=null;if(0<b.length){e=this.getLayerForCell(b[0]);for(var g=1;g<b.length;g++)if(!this.model.isAncestor(e,b[g])){e=null;break}}return e};+Graph.prototype.createLayersDialog=function(b,e){var g=document.createElement("div");g.style.position="absolute";for(var m=this.getModel(),v=m.getChildCount(m.root),n=0;n<v;n++)mxUtils.bind(this,function(A){function G(){m.isVisible(A)?(K.setAttribute("src",Editor.visibleImage),mxUtils.setOpacity(F,75)):(K.setAttribute("src",Editor.hiddenImage),mxUtils.setOpacity(F,25))}var S=this.convertValueToString(A)||mxResources.get("background")||"Background",F=document.createElement("div");F.style.overflow="hidden";F.style.textOverflow="ellipsis";F.style.padding="2px";F.style.whiteSpace="nowrap";F.style.cursor="pointer";F.setAttribute("title",mxResources.get(m.isVisible(A)?"hideIt":"show",[S]));var K=document.createElement("img");K.setAttribute("draggable","false");K.setAttribute("align","absmiddle");K.setAttribute("border","0");K.style.position="relative";K.style.width="16px";K.style.padding="0px 6px 0 4px";e&&(K.style.filter="invert(100%)",K.style.top="-2px");F.appendChild(K);mxUtils.write(F,S);g.appendChild(F);-mxEvent.addListener(F,"click",function(){m.setVisible(A,!m.isVisible(A));H();null!=b&&b(A)});H()})(m.getChildAt(m.root,p));return g};-Graph.prototype.replacePlaceholders=function(b,e,g,m){m=[];if(null!=e){for(var v=0;match=this.placeholderPattern.exec(e);){var p=match[0];if(2<p.length&&"%label%"!=p&&"%tooltip%"!=p){var A=null;if(match.index>v&&"%"==e.charAt(match.index-1))A=p.substring(1);else{var H=p.substring(1,p.length-1),S={mm:mxConstants.MILLIMETERS,"in":mxConstants.INCHES,m:mxConstants.METERS,current:this.view.unit};if("id"==H)A=b.id;else if("width"===H.substring(0,5)&&this.model.isVertex(b)){var F=this.getCellGeometry(b);-null!=F&&(A=F.width,5<H.length&&(A=Editor.toUnit(A,S[H.substring(6)])))}else if("height"==H.substring(0,6)&&this.model.isVertex(b))F=this.getCellGeometry(b),null!=F&&(A=F.height,6<H.length&&(A=Editor.toUnit(A,S[H.substring(7)])));else if("length"==H.substring(0,6)){for(F=b;null!=F&&!this.model.isEdge(F);)F=this.model.getParent(F);F=this.view.getState(F);null!=F&&(A=Math.round(F.length/this.view.scale),6<H.length&&(A=Editor.toUnit(A,S[H.substring(7)])))}else if(0>H.indexOf("{"))for(S=b;null==A&&null!=-S;)null!=S.value&&"object"==typeof S.value&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(A=S.getAttribute(H+"_"+Graph.diagramLanguage)),null==A&&(A=S.hasAttribute(H)?null!=S.getAttribute(H)?S.getAttribute(H):"":null)),S=this.model.getParent(S);null==A&&(A=this.getGlobalVariable(H));null==A&&null!=g&&(A=g[H])}m.push(e.substring(v,match.index)+(null!=A?A:p));v=match.index+p.length}}m.push(e.substring(v))}return m.join("")};+mxEvent.addListener(F,"click",function(){m.setVisible(A,!m.isVisible(A));G();null!=b&&b(A)});G()})(m.getChildAt(m.root,n));return g};+Graph.prototype.replacePlaceholders=function(b,e,g,m){m=[];if(null!=e){for(var v=0;match=this.placeholderPattern.exec(e);){var n=match[0];if(2<n.length&&"%label%"!=n&&"%tooltip%"!=n){var A=null;if(match.index>v&&"%"==e.charAt(match.index-1))A=n.substring(1);else{var G=n.substring(1,n.length-1),S={mm:mxConstants.MILLIMETERS,"in":mxConstants.INCHES,m:mxConstants.METERS,current:this.view.unit};if("id"==G)A=b.id;else if("width"===G.substring(0,5)&&this.model.isVertex(b)){var F=this.getCellGeometry(b);+null!=F&&(A=F.width,5<G.length&&(A=Editor.toUnit(A,S[G.substring(6)])))}else if("height"==G.substring(0,6)&&this.model.isVertex(b))F=this.getCellGeometry(b),null!=F&&(A=F.height,6<G.length&&(A=Editor.toUnit(A,S[G.substring(7)])));else if("length"==G.substring(0,6)){for(F=b;null!=F&&!this.model.isEdge(F);)F=this.model.getParent(F);F=this.view.getState(F);null!=F&&(A=Math.round(F.length/this.view.scale),6<G.length&&(A=Editor.toUnit(A,S[G.substring(7)])))}else if(0>G.indexOf("{"))for(S=b;null==A&&null!=+S;)null!=S.value&&"object"==typeof S.value&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(A=S.getAttribute(G+"_"+Graph.diagramLanguage)),null==A&&(A=S.hasAttribute(G)?null!=S.getAttribute(G)?S.getAttribute(G):"":null)),S=this.model.getParent(S);null==A&&(A=this.getGlobalVariable(G));null==A&&null!=g&&(A=g[G])}m.push(e.substring(v,match.index)+(null!=A?A:n));v=match.index+n.length}}m.push(e.substring(v))}return m.join("")};Graph.prototype.restoreSelection=function(b){if(null!=b&&0<b.length){for(var e=[],g=0;g<b.length;g++){var m=this.model.getCell(b[g].id);null!=m&&e.push(m)}this.setSelectionCells(e)}else this.clearSelection()};Graph.prototype.selectCellForEvent=function(b,e){mxEvent.isShiftDown(e)&&!this.isSelectionEmpty()&&this.selectTableRange(this.getSelectionCell(),b)||mxGraph.prototype.selectCellForEvent.apply(this,arguments)};-Graph.prototype.selectTableRange=function(b,e){var g=!1;if(this.isTableCell(b)&&this.isTableCell(e)){var m=this.model.getParent(b),v=this.model.getParent(m),p=this.model.getParent(e);if(v==this.model.getParent(p)){b=m.getIndex(b);m=v.getIndex(m);var A=p.getIndex(e),H=v.getIndex(p);p=Math.max(m,H);e=Math.min(b,A);b=Math.max(b,A);A=[];for(m=Math.min(m,H);m<=p;m++){H=this.model.getChildAt(v,m);for(var S=e;S<=b;S++)A.push(this.model.getChildAt(H,S))}0<A.length&&(1<A.length||1<this.getSelectionCount()||+Graph.prototype.selectTableRange=function(b,e){var g=!1;if(this.isTableCell(b)&&this.isTableCell(e)){var m=this.model.getParent(b),v=this.model.getParent(m),n=this.model.getParent(e);if(v==this.model.getParent(n)){b=m.getIndex(b);m=v.getIndex(m);var A=n.getIndex(e),G=v.getIndex(n);n=Math.max(m,G);e=Math.min(b,A);b=Math.max(b,A);A=[];for(m=Math.min(m,G);m<=n;m++){G=this.model.getChildAt(v,m);for(var S=e;S<=b;S++)A.push(this.model.getChildAt(G,S))}0<A.length&&(1<A.length||1<this.getSelectionCount()||!this.isCellSelected(A[0]))&&(this.setSelectionCells(A),g=!0)}}return g};-Graph.prototype.snapCellsToGrid=function(b,e){this.getModel().beginUpdate();try{for(var g=0;g<b.length;g++){var m=b[g],v=this.getCellGeometry(m);if(null!=v){v=v.clone();if(this.getModel().isVertex(m))v.x=Math.round(v.x/e)*e,v.y=Math.round(v.y/e)*e,v.width=Math.round(v.width/e)*e,v.height=Math.round(v.height/e)*e;else if(this.getModel().isEdge(m)&&null!=v.points)for(var p=0;p<v.points.length;p++)v.points[p].x=Math.round(v.points[p].x/e)*e,v.points[p].y=Math.round(v.points[p].y/e)*e;this.getModel().setGeometry(m,+Graph.prototype.snapCellsToGrid=function(b,e){this.getModel().beginUpdate();try{for(var g=0;g<b.length;g++){var m=b[g],v=this.getCellGeometry(m);if(null!=v){v=v.clone();if(this.getModel().isVertex(m))v.x=Math.round(v.x/e)*e,v.y=Math.round(v.y/e)*e,v.width=Math.round(v.width/e)*e,v.height=Math.round(v.height/e)*e;else if(this.getModel().isEdge(m)&&null!=v.points)for(var n=0;n<v.points.length;n++)v.points[n].x=Math.round(v.points[n].x/e)*e,v.points[n].y=Math.round(v.points[n].y/e)*e;this.getModel().setGeometry(m,v)}}}finally{this.getModel().endUpdate()}};Graph.prototype.removeChildCells=function(b){this.model.beginUpdate();try{for(var e=this.model.getChildCount(b);0<=e;e--)this.model.remove(this.model.getChildAt(b,e))}finally{this.model.endUpdate()}};-Graph.prototype.updateShapes=function(b,e,g){this.model.beginUpdate();try{var m=this.model.getStyle(b),v=g?this.stylesheet.getCellStyle(m,{},!1):null;null!=v&&null==v[mxConstants.STYLE_SHAPE]&&(this.model.isVertex(b)?v[mxConstants.STYLE_SHAPE]=this.stylesheet.getDefaultVertexStyle()[mxConstants.STYLE_SHAPE]:this.model.isEdge(b)&&(v[mxConstants.STYLE_SHAPE]=this.stylesheet.getDefaultEdgeStyle()[mxConstants.STYLE_SHAPE]));for(var p=0;p<e.length;p++){if(this.model.isVertex(b)&&this.model.isVertex(e[p])||-this.model.isEdge(b)&&this.model.isEdge(e[p]))if(g){var A=this.model.getStyle(e[p]);if(null!=A){var H=A.split(";");0<H.length&&0>H[0].indexOf("=")&&(H=H.slice(1));this.model.setStyle(e[p],H.join(";"))}this.setCellStyles(mxConstants.STYLE_PERIMETER,null,[e[p]]);this.setCellStyles("points",null,[e[p]]);this.pasteStyle(v,[e[p]],null,!0)}else v=this.copyStyle(e[p]),this.model.setStyle(e[p],m),this.pasteStyle(v,[e[p]]);"1"==mxUtils.getValue(this.getCellStyle(e[p],!1),"composite","0")&&this.removeChildCells(e[p])}}finally{this.model.endUpdate()}};+Graph.prototype.updateShapes=function(b,e,g){this.model.beginUpdate();try{var m=this.model.getStyle(b),v=g?this.stylesheet.getCellStyle(m,{},!1):null;null!=v&&null==v[mxConstants.STYLE_SHAPE]&&(this.model.isVertex(b)?v[mxConstants.STYLE_SHAPE]=this.stylesheet.getDefaultVertexStyle()[mxConstants.STYLE_SHAPE]:this.model.isEdge(b)&&(v[mxConstants.STYLE_SHAPE]=this.stylesheet.getDefaultEdgeStyle()[mxConstants.STYLE_SHAPE]));for(var n=0;n<e.length;n++){if(this.model.isVertex(b)&&this.model.isVertex(e[n])||+this.model.isEdge(b)&&this.model.isEdge(e[n]))if(g){var A=this.model.getStyle(e[n]);if(null!=A){var G=A.split(";");0<G.length&&0>G[0].indexOf("=")&&(G=G.slice(1));this.model.setStyle(e[n],G.join(";"))}this.setCellStyles(mxConstants.STYLE_PERIMETER,null,[e[n]]);this.setCellStyles("points",null,[e[n]]);this.pasteStyle(v,[e[n]],null,!0)}else v=this.copyStyle(e[n]),this.model.setStyle(e[n],m),this.pasteStyle(v,[e[n]]);"1"==mxUtils.getValue(this.getCellStyle(e[n],!1),"composite","0")&&this.removeChildCells(e[n])}}finally{this.model.endUpdate()}};Graph.prototype.selectCellsForConnectVertex=function(b,e,g){2==b.length&&this.model.isVertex(b[1])?(this.setSelectionCell(b[1]),this.scrollCellToVisible(b[1]),null!=g&&(mxEvent.isTouchEvent(e)?g.update(g.getState(this.view.getState(b[1]))):g.reset())):this.setSelectionCells(b)};Graph.prototype.isCloneConnectSource=function(b){var e=null;null!=this.layoutManager&&(e=this.layoutManager.getLayout(this.model.getParent(b)));return this.isTableRow(b)||this.isTableCell(b)||null!=e&&e.constructor==mxStackLayout};Graph.prototype.insertEdgeBeforeCell=function(b,e){for(var g=e;null!=g.parent&&null!=g.geometry&&g.geometry.relative&&g.parent!=b.parent;)g=this.model.getParent(g);null!=g&&null!=g.parent&&g.parent==b.parent&&(e=g.parent.getIndex(g),this.model.add(g.parent,b,e))};-Graph.prototype.connectVertex=function(b,e,g,m,v,p,A,H){p=p?p:!1;if(b.geometry.relative&&this.model.isEdge(b.parent))return[];for(;b.geometry.relative&&this.model.isVertex(b.parent);)b=b.parent;var S=this.isCloneConnectSource(b),F=S?b:this.getCompositeParent(b),K=b.geometry.relative&&null!=b.parent.geometry?new mxPoint(b.parent.geometry.width*b.geometry.x,b.parent.geometry.height*b.geometry.y):new mxPoint(F.geometry.x,F.geometry.y);e==mxConstants.DIRECTION_NORTH?(K.x+=F.geometry.width/2,K.y-=g):e==-mxConstants.DIRECTION_SOUTH?(K.x+=F.geometry.width/2,K.y+=F.geometry.height+g):(K.x=e==mxConstants.DIRECTION_WEST?K.x-g:K.x+(F.geometry.width+g),K.y+=F.geometry.height/2);var c=this.view.getState(this.model.getParent(b));g=this.view.scale;var f=this.view.translate;F=f.x*g;f=f.y*g;null!=c&&this.model.isVertex(c.cell)&&(F=c.x,f=c.y);this.model.isVertex(b.parent)&&b.geometry.relative&&(K.x+=b.parent.geometry.x,K.y+=b.parent.geometry.y);p=p?null:(new mxRectangle(F+K.x*g,f+K.y*g)).grow(40*g);p=null!=p?-this.getCells(0,0,0,0,null,null,p,null,!0):null;c=this.view.getState(b);var l=null,t=null;if(null!=p){p=p.reverse();for(var q=0;q<p.length;q++)if(!this.isCellLocked(p[q])&&!this.model.isEdge(p[q])&&p[q]!=b)if(!this.model.isAncestor(b,p[q])&&this.isContainer(p[q])&&(null==l||p[q]==this.model.getParent(b)))l=p[q];else if(null==t&&this.isCellConnectable(p[q])&&!this.model.isAncestor(p[q],b)&&!this.isSwimlane(p[q])){var D=this.view.getState(p[q]);null==c||null==D||mxUtils.intersects(c,D)||(t=p[q])}}var G=-!mxEvent.isShiftDown(m)||mxEvent.isControlDown(m)||v;G&&("1"!=urlParams.sketch||v)&&(e==mxConstants.DIRECTION_NORTH?K.y-=b.geometry.height/2:e==mxConstants.DIRECTION_SOUTH?K.y+=b.geometry.height/2:K.x=e==mxConstants.DIRECTION_WEST?K.x-b.geometry.width/2:K.x+b.geometry.width/2);var N=[],L=t;t=l;v=mxUtils.bind(this,function(J){if(null==A||null!=J||null==t&&S){this.model.beginUpdate();try{if(null==L&&G){var Y=this.getAbsoluteParent(null!=J?J:b);Y=S?b:this.getCompositeParent(Y);L=null!=J?J:this.duplicateCells([Y],-!1)[0];null!=J&&this.addCells([L],this.model.getParent(b),null,null,null,!0);var ha=this.getCellGeometry(L);null!=ha&&(null!=J&&"1"==urlParams.sketch&&(e==mxConstants.DIRECTION_NORTH?K.y-=ha.height/2:e==mxConstants.DIRECTION_SOUTH?K.y+=ha.height/2:K.x=e==mxConstants.DIRECTION_WEST?K.x-ha.width/2:K.x+ha.width/2),ha.x=K.x-ha.width/2,ha.y=K.y-ha.height/2);null!=l?(this.addCells([L],l,null,null,null,!0),t=null):G&&!S&&this.addCells([L],this.getDefaultParent(),null,null,null,!0)}var ea=mxEvent.isControlDown(m)&&-mxEvent.isShiftDown(m)&&G||null==t&&S?null:this.insertEdge(this.model.getParent(b),null,"",b,L,this.createCurrentEdgeStyle());null!=ea&&(N.push(ea),this.applyNewEdgeStyle(b,[ea],e),this.connectionHandler.insertBeforeSource&&this.insertEdgeBeforeCell(ea,b));if(null==t&&null!=L&&null!=b.parent&&S&&e==mxConstants.DIRECTION_WEST){var aa=b.parent.getIndex(b);this.model.add(b.parent,L,aa)}null==t&&null!=L&&N.push(L);null==L&&null!=ea&&ea.geometry.setTerminalPoint(K,!1);null!=ea&&this.fireEvent(new mxEventObject("cellsInserted",-"cells",[ea]))}finally{this.model.endUpdate()}}if(null!=H)H(N);else return N});if(null==A||null!=L||!G||null==t&&S)return v(L);A(F+K.x*g,f+K.y*g,v)};+Graph.prototype.connectVertex=function(b,e,g,m,v,n,A,G){n=n?n:!1;if(b.geometry.relative&&this.model.isEdge(b.parent))return[];for(;b.geometry.relative&&this.model.isVertex(b.parent);)b=b.parent;var S=this.isCloneConnectSource(b),F=S?b:this.getCompositeParent(b),K=b.geometry.relative&&null!=b.parent.geometry?new mxPoint(b.parent.geometry.width*b.geometry.x,b.parent.geometry.height*b.geometry.y):new mxPoint(F.geometry.x,F.geometry.y);e==mxConstants.DIRECTION_NORTH?(K.x+=F.geometry.width/2,K.y-=g):e==+mxConstants.DIRECTION_SOUTH?(K.x+=F.geometry.width/2,K.y+=F.geometry.height+g):(K.x=e==mxConstants.DIRECTION_WEST?K.x-g:K.x+(F.geometry.width+g),K.y+=F.geometry.height/2);var c=this.view.getState(this.model.getParent(b));g=this.view.scale;var f=this.view.translate;F=f.x*g;f=f.y*g;null!=c&&this.model.isVertex(c.cell)&&(F=c.x,f=c.y);this.model.isVertex(b.parent)&&b.geometry.relative&&(K.x+=b.parent.geometry.x,K.y+=b.parent.geometry.y);n=n?null:(new mxRectangle(F+K.x*g,f+K.y*g)).grow(40*g);n=null!=n?+this.getCells(0,0,0,0,null,null,n,null,!0):null;c=this.view.getState(b);var l=null,t=null;if(null!=n){n=n.reverse();for(var q=0;q<n.length;q++)if(!this.isCellLocked(n[q])&&!this.model.isEdge(n[q])&&n[q]!=b)if(!this.model.isAncestor(b,n[q])&&this.isContainer(n[q])&&(null==l||n[q]==this.model.getParent(b)))l=n[q];else if(null==t&&this.isCellConnectable(n[q])&&!this.model.isAncestor(n[q],b)&&!this.isSwimlane(n[q])){var D=this.view.getState(n[q]);null==c||null==D||mxUtils.intersects(c,D)||(t=n[q])}}var H=+!mxEvent.isShiftDown(m)||mxEvent.isControlDown(m)||v;H&&("1"!=urlParams.sketch||v)&&(e==mxConstants.DIRECTION_NORTH?K.y-=b.geometry.height/2:e==mxConstants.DIRECTION_SOUTH?K.y+=b.geometry.height/2:K.x=e==mxConstants.DIRECTION_WEST?K.x-b.geometry.width/2:K.x+b.geometry.width/2);var N=[],L=t;t=l;v=mxUtils.bind(this,function(J){if(null==A||null!=J||null==t&&S){this.model.beginUpdate();try{if(null==L&&H){var Y=this.getAbsoluteParent(null!=J?J:b);Y=S?b:this.getCompositeParent(Y);L=null!=J?J:this.duplicateCells([Y],+!1)[0];null!=J&&this.addCells([L],this.model.getParent(b),null,null,null,!0);var ha=this.getCellGeometry(L);null!=ha&&(null!=J&&"1"==urlParams.sketch&&(e==mxConstants.DIRECTION_NORTH?K.y-=ha.height/2:e==mxConstants.DIRECTION_SOUTH?K.y+=ha.height/2:K.x=e==mxConstants.DIRECTION_WEST?K.x-ha.width/2:K.x+ha.width/2),ha.x=K.x-ha.width/2,ha.y=K.y-ha.height/2);null!=l?(this.addCells([L],l,null,null,null,!0),t=null):H&&!S&&this.addCells([L],this.getDefaultParent(),null,null,null,!0)}var ea=mxEvent.isControlDown(m)&&+mxEvent.isShiftDown(m)&&H||null==t&&S?null:this.insertEdge(this.model.getParent(b),null,"",b,L,this.createCurrentEdgeStyle());null!=ea&&(N.push(ea),this.applyNewEdgeStyle(b,[ea],e),this.connectionHandler.insertBeforeSource&&this.insertEdgeBeforeCell(ea,b));if(null==t&&null!=L&&null!=b.parent&&S&&e==mxConstants.DIRECTION_WEST){var aa=b.parent.getIndex(b);this.model.add(b.parent,L,aa)}null==t&&null!=L&&N.push(L);null==L&&null!=ea&&ea.geometry.setTerminalPoint(K,!1);null!=ea&&this.fireEvent(new mxEventObject("cellsInserted",+"cells",[ea]))}finally{this.model.endUpdate()}}if(null!=G)G(N);else return N});if(null==A||null!=L||!H||null==t&&S)return v(L);A(F+K.x*g,f+K.y*g,v)};Graph.prototype.getIndexableText=function(b){b=null!=b?b:this.model.getDescendants(this.model.root);for(var e=document.createElement("div"),g=[],m,v=0;v<b.length;v++)if(m=b[v],this.model.isVertex(m)||this.model.isEdge(m))this.isHtmlLabel(m)?(e.innerHTML=Graph.sanitizeHtml(this.getLabel(m)),m=mxUtils.extractTextWithWhitespace([e])):m=this.getLabel(m),m=mxUtils.trim(m.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")),0<m.length&&g.push(m);return g.join(" ")};Graph.prototype.convertValueToString=function(b){var e=this.model.getValue(b);if(null!=e&&"object"==typeof e){var g=null;if(this.isReplacePlaceholders(b)&&null!=b.getAttribute("placeholder")){e=b.getAttribute("placeholder");for(var m=b;null==g&&null!=m;)null!=m.value&&"object"==typeof m.value&&(g=m.hasAttribute(e)?null!=m.getAttribute(e)?m.getAttribute(e):"":null),m=this.model.getParent(m)}else g=null,Graph.translateDiagram&&null!=Graph.diagramLanguage&&(g=e.getAttribute("label_"+Graph.diagramLanguage)),null==g&&(g=e.getAttribute("label")||"");return g||""}return mxGraph.prototype.convertValueToString.apply(this,arguments)};Graph.prototype.getLinksForState=function(b){return null!=b&&null!=b.text&&null!=b.text.node?b.text.node.getElementsByTagName("a"):null};Graph.prototype.getLinkForCell=function(b,e){return null!=b.value&&"object"==typeof b.value?(b=b.value.getAttribute("link"),e||(b=mxUtils.removeJavascriptProtocol(b)),b):null};@@ -2435,23 +2439,23 @@ mxConstants.STYLE_IMAGE_BACKGROUND,b);this.replaceDefaultColor(e,mxConstants.STYGraph.prototype.getDefaultColor=function(b,e,g){e="default"+e.charAt(0).toUpperCase()+e.substring(1);"invert"==b[e]&&(b=mxUtils.getLightDarkColor(g),g="light-dark("+b.dark+", "+b.light+")");return g};Graph.prototype.setAdaptiveColors=function(b){this.adaptiveColors="default"==b?null:b;"1"==urlParams.embedInline?null!=this.container&&(this.container.style.colorScheme="none"==this.getAdaptiveColors()?"light":""):(b=this.view.getDrawPane().ownerSVGElement,null!=b&&(b.style.colorScheme="none"==this.getAdaptiveColors()?"light":""))};Graph.prototype.getAdaptiveColors=function(){return null!=this.adaptiveColors?this.adaptiveColors:Graph.defaultAdaptiveColors};Graph.prototype.updateAlternateBounds=function(b,e,g){if(null!=b&&null!=e&&null!=this.layoutManager&&null!=e.alternateBounds){var m=this.layoutManager.getLayout(this.model.getParent(b));null!=m&&m.constructor==mxStackLayout&&(m.horizontal?e.alternateBounds.height=0:e.alternateBounds.width=0)}mxGraph.prototype.updateAlternateBounds.apply(this,arguments)};Graph.prototype.isMoveCellsEvent=function(b,e){return mxEvent.isShiftDown(b)||"1"==mxUtils.getValue(e.style,"moveCells","0")};-Graph.prototype.foldCells=function(b,e,g,m,v){e=null!=e?e:!1;null==g&&(g=this.getFoldableCells(this.getSelectionCells(),b));if(null!=g){this.model.beginUpdate();try{if(mxGraph.prototype.foldCells.apply(this,arguments),null!=this.layoutManager)for(var p=0;p<g.length;p++){var A=this.view.getState(g[p]),H=this.getCellGeometry(g[p]);if(null!=A&&null!=H){var S=0,F=0;if(H.alternateBounds)S=H.width-H.alternateBounds.width,F=H.height-H.alternateBounds.height;else{var K=this.useCssTransforms?1:this.view.scale;-S=Math.round(H.width-A.width/K);F=Math.round(H.height-A.height/K)}if(0!=F||0!=S){var c=this.model.getParent(g[p]),f=this.layoutManager.getLayout(c);null==f?null!=v&&this.isMoveCellsEvent(v,A)&&this.moveSiblings(A,c,S,F):null!=v&&mxEvent.isAltDown(v)||f.constructor!=mxStackLayout||f.resizeLast||this.resizeParentStacks(c,f,S,F)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(g)}};-Graph.prototype.moveSiblings=function(b,e,g,m){this.model.beginUpdate();try{var v=this.getCellsBeyond(b.x,b.y,e,!0,!0);for(e=0;e<v.length;e++)if(v[e]!=b.cell){var p=this.view.getState(v[e]),A=this.getCellGeometry(v[e]);null!=p&&null!=A&&(A=A.clone(),A.translate(Math.round(g*Math.max(0,Math.min(1,(p.x-b.x)/b.width))),Math.round(m*Math.max(0,Math.min(1,(p.y-b.y)/b.height)))),this.model.setGeometry(v[e],A))}}finally{this.model.endUpdate()}};-Graph.prototype.resizeParentStacks=function(b,e,g,m){if(null!=this.layoutManager&&null!=e&&e.constructor==mxStackLayout&&!e.resizeLast){this.model.beginUpdate();try{for(var v=e.horizontal;null!=b&&null!=e&&e.constructor==mxStackLayout&&e.horizontal==v&&!e.resizeLast;){var p=this.getCellGeometry(b),A=this.view.getState(b);null!=A&&null!=p&&(p=p.clone(),e.horizontal?p.width+=g+Math.min(0,A.width/this.view.scale-p.width):p.height+=m+Math.min(0,A.height/this.view.scale-p.height),this.model.setGeometry(b,-p));b=this.model.getParent(b);e=this.layoutManager.getLayout(b)}}finally{this.model.endUpdate()}}};Graph.prototype.isContainer=function(b){var e=this.getCurrentCellStyle(b);return this.isSwimlane(b)?"0"!=e.container:"1"==e.container};Graph.prototype.isCellConnectable=function(b){var e=this.getCurrentCellStyle(b);return!this.isCellLocked(this.getLayerForCell(b))&&(null!=e.connectable?"0"!=e.connectable:mxGraph.prototype.isCellConnectable.apply(this,arguments))};+Graph.prototype.foldCells=function(b,e,g,m,v){e=null!=e?e:!1;null==g&&(g=this.getFoldableCells(this.getSelectionCells(),b));if(null!=g){this.model.beginUpdate();try{if(mxGraph.prototype.foldCells.apply(this,arguments),null!=this.layoutManager)for(var n=0;n<g.length;n++){var A=this.view.getState(g[n]),G=this.getCellGeometry(g[n]);if(null!=A&&null!=G){var S=0,F=0;if(G.alternateBounds)S=G.width-G.alternateBounds.width,F=G.height-G.alternateBounds.height;else{var K=this.useCssTransforms?1:this.view.scale;+S=Math.round(G.width-A.width/K);F=Math.round(G.height-A.height/K)}if(0!=F||0!=S){var c=this.model.getParent(g[n]),f=this.layoutManager.getLayout(c);null==f?null!=v&&this.isMoveCellsEvent(v,A)&&this.moveSiblings(A,c,S,F):null!=v&&mxEvent.isAltDown(v)||f.constructor!=mxStackLayout||f.resizeLast||this.resizeParentStacks(c,f,S,F)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(g)}};+Graph.prototype.moveSiblings=function(b,e,g,m){this.model.beginUpdate();try{var v=this.getCellsBeyond(b.x,b.y,e,!0,!0);for(e=0;e<v.length;e++)if(v[e]!=b.cell){var n=this.view.getState(v[e]),A=this.getCellGeometry(v[e]);null!=n&&null!=A&&(A=A.clone(),A.translate(Math.round(g*Math.max(0,Math.min(1,(n.x-b.x)/b.width))),Math.round(m*Math.max(0,Math.min(1,(n.y-b.y)/b.height)))),this.model.setGeometry(v[e],A))}}finally{this.model.endUpdate()}};+Graph.prototype.resizeParentStacks=function(b,e,g,m){if(null!=this.layoutManager&&null!=e&&e.constructor==mxStackLayout&&!e.resizeLast){this.model.beginUpdate();try{for(var v=e.horizontal;null!=b&&null!=e&&e.constructor==mxStackLayout&&e.horizontal==v&&!e.resizeLast;){var n=this.getCellGeometry(b),A=this.view.getState(b);null!=A&&null!=n&&(n=n.clone(),e.horizontal?n.width+=g+Math.min(0,A.width/this.view.scale-n.width):n.height+=m+Math.min(0,A.height/this.view.scale-n.height),this.model.setGeometry(b,+n));b=this.model.getParent(b);e=this.layoutManager.getLayout(b)}}finally{this.model.endUpdate()}}};Graph.prototype.isContainer=function(b){var e=this.getCurrentCellStyle(b);return this.isSwimlane(b)?"0"!=e.container:"1"==e.container};Graph.prototype.isCellConnectable=function(b){var e=this.getCurrentCellStyle(b);return!this.isCellLocked(this.getLayerForCell(b))&&(null!=e.connectable?"0"!=e.connectable:mxGraph.prototype.isCellConnectable.apply(this,arguments))};Graph.prototype.isLabelMovable=function(b){var e=this.getCurrentCellStyle(b);return null!=e.movableLabel?"0"!=e.movableLabel:mxGraph.prototype.isLabelMovable.apply(this,arguments)};Graph.prototype.selectAll=function(b){b=b||this.getDefaultParent();this.isCellLocked(b)||mxGraph.prototype.selectAll.apply(this,arguments)};Graph.prototype.selectCells=function(b,e,g){g=g||this.getDefaultParent();this.isCellLocked(g)||mxGraph.prototype.selectCells.apply(this,arguments)};Graph.prototype.getSwimlaneAt=function(b,e,g){var m=mxGraph.prototype.getSwimlaneAt.apply(this,arguments);this.isCellLocked(m)&&(m=null);return m};Graph.prototype.isCellFoldable=function(b){var e=this.getCurrentCellStyle(b);return this.foldingEnabled&&"0"!=mxUtils.getValue(e,mxConstants.STYLE_RESIZABLE,"1")&&("1"==e.treeFolding||!this.isCellLocked(b)&&(this.isContainer(b)&&"0"!=e.collapsible||!this.isContainer(b)&&"1"==e.collapsible))};Graph.prototype.reset=function(){this.isEditing()&&this.stopEditing(!0);this.escape();this.isSelectionEmpty()||this.clearSelection()};Graph.prototype.zoom=function(b,e){b=Math.max(.01,Math.min(this.view.scale*b,160))/this.view.scale;mxGraph.prototype.zoom.apply(this,arguments)};Graph.prototype.zoomIn=function(){.15>this.view.scale?this.zoom((this.view.scale+.01)/this.view.scale):this.zoom(Math.round(this.view.scale*this.zoomFactor*20)/20/this.view.scale)};Graph.prototype.zoomOut=function(){.15>=this.view.scale?this.zoom((this.view.scale-.01)/this.view.scale):this.zoom(Math.round(1/this.zoomFactor*this.view.scale*20)/20/this.view.scale)};-Graph.prototype.fitPages=function(b,e){var g=1;null==b&&(g=this.getPageLayout(),b=g.width,g=g.height);var m=this.pageScale,v=this.pageFormat,p=this.container.clientHeight-10;b=(this.container.clientWidth-10)/(b*v.width)/m;this.zoomTo(Math.floor(20*(e?b:Math.min(b,p/(g*v.height)/m)))/20);mxUtils.hasScrollbars(this.container)&&(b=this.getPagePadding(),this.container.scrollLeft=Math.min(b.x*this.view.scale,(this.container.scrollWidth-this.container.clientWidth)/2),e||(this.container.scrollTop=Math.min(b.y*+Graph.prototype.fitPages=function(b,e){var g=1;null==b&&(g=this.getPageLayout(),b=g.width,g=g.height);var m=this.pageScale,v=this.pageFormat,n=this.container.clientHeight-10;b=(this.container.clientWidth-10)/(b*v.width)/m;this.zoomTo(Math.floor(20*(e?b:Math.min(b,n/(g*v.height)/m)))/20);mxUtils.hasScrollbars(this.container)&&(b=this.getPagePadding(),this.container.scrollLeft=Math.min(b.x*this.view.scale,(this.container.scrollWidth-this.container.clientWidth)/2),e||(this.container.scrollTop=Math.min(b.y*this.view.scale,(this.container.scrollHeight-this.container.clientHeight)/2)))};Graph.prototype.fitWindow=function(b,e){e=null!=e?e:10;var g=this.container.clientWidth-e,m=this.container.clientHeight-e;this.zoomTo(Math.floor(20*Math.min(g/b.width,m/b.height))/20);mxUtils.hasScrollbars(this.container)&&window.setTimeout(mxUtils.bind(this,function(){var v=this.view.translate;this.container.scrollLeft=(b.x+v.x)*this.view.scale-Math.max((g-b.width*this.view.scale)/2+e/2,0);this.container.scrollTop=(b.y+v.y)*this.view.scale-Math.max((m-b.height*this.view.scale)/2+e/2,0)}),0)};Graph.prototype.convertValueToTooltip=function(b){var e=null;mxUtils.isNode(b.value)&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(e=b.value.getAttribute("tooltip_"+Graph.diagramLanguage)),null==e&&(e=b.value.getAttribute("tooltip")),null!=e&&(null!=e&&this.isReplacePlaceholders(b)&&(e=this.replacePlaceholders(b,e)),e=Graph.sanitizeHtml(e)));return e};-Graph.prototype.getTooltipForCell=function(b){var e="";if(mxUtils.isNode(b.value)&&(e=this.convertValueToTooltip(b),null==e)){var g=this.builtInProperties;b=b.value.attributes;var m=[];e="";this.isEnabled()&&(g.push("linkTarget"),g.push("link"));for(var v=0;v<b.length;v++)(Graph.translateDiagram&&"label"==b[v].nodeName||0>mxUtils.indexOf(g,b[v].nodeName))&&0<b[v].nodeValue.length&&m.push({name:b[v].nodeName,value:b[v].nodeValue});m.sort(function(p,A){return p.name<A.name?-1:p.name>A.name?1:0});for(v=+Graph.prototype.getTooltipForCell=function(b){var e="";if(mxUtils.isNode(b.value)&&(e=this.convertValueToTooltip(b),null==e)){var g=this.builtInProperties;b=b.value.attributes;var m=[];e="";this.isEnabled()&&(g.push("linkTarget"),g.push("link"));for(var v=0;v<b.length;v++)(Graph.translateDiagram&&"label"==b[v].nodeName||0>mxUtils.indexOf(g,b[v].nodeName))&&0<b[v].nodeValue.length&&m.push({name:b[v].nodeName,value:b[v].nodeValue});m.sort(function(n,A){return n.name<A.name?-1:n.name>A.name?1:0});for(v=0;v<m.length;v++)"link"==m[v].name&&this.isCustomLink(m[v].value)||(e+=("link"!=m[v].name?"<b>"+mxUtils.htmlEntities(m[v].name)+":</b> ":"")+mxUtils.htmlEntities(m[v].value)+"\n");0<e.length&&(e=e.substring(0,e.length-1),mxClient.IS_SVG&&(e='<div style="max-width:360px;text-overflow:ellipsis;overflow:hidden;">'+e+"</div>"))}return e};-Graph.prototype.addFlowAnimationToNode=function(b,e,g,m){if(null!=b&&null!=m){var v=b.getAttribute("stroke-dasharray");if(""==v||null==v){var p=String(mxUtils.getValue(e,mxConstants.STYLE_DASH_PATTERN,"8")).split(" ");v=1==mxUtils.getValue(e,mxConstants.STYLE_FIX_DASH,!1)||null==e.dashPattern?1:mxUtils.getNumber(e,mxConstants.STYLE_STROKEWIDTH,1);if(0<p.length)for(var A=0;A<p.length;A++)p[A]=Math.round(Number(p[A])*g*v*100)/100;b.setAttribute("stroke-dasharray",p.join(" "))}else p=v.split(" ");if(0<-p.length){for(A=v=0;A<p.length;A++){var H=parseFloat(p[A]);isNaN(H)||(v+=parseFloat(p[A]))}0!=p.length%2&&(v*=2);g=Math.round(v/g/16*parseInt(mxUtils.getValue(e,"flowAnimationDuration",500)));p=mxUtils.getValue(e,"flowAnimationTimingFunction","linear");e=mxUtils.getValue(e,"flowAnimationDirection","normal");b.style.animation=m+" "+g+"ms "+mxUtils.htmlEntities(p)+" infinite "+mxUtils.htmlEntities(e);b.style.strokeDashoffset=v}}};+Graph.prototype.addFlowAnimationToNode=function(b,e,g,m){if(null!=b&&null!=m){var v=b.getAttribute("stroke-dasharray");if(""==v||null==v){var n=String(mxUtils.getValue(e,mxConstants.STYLE_DASH_PATTERN,"8")).split(" ");v=1==mxUtils.getValue(e,mxConstants.STYLE_FIX_DASH,!1)||null==e.dashPattern?1:mxUtils.getNumber(e,mxConstants.STYLE_STROKEWIDTH,1);if(0<n.length)for(var A=0;A<n.length;A++)n[A]=Math.round(Number(n[A])*g*v*100)/100;b.setAttribute("stroke-dasharray",n.join(" "))}else n=v.split(" ");if(0<+n.length){for(A=v=0;A<n.length;A++){var G=parseFloat(n[A]);isNaN(G)||(v+=parseFloat(n[A]))}0!=n.length%2&&(v*=2);g=Math.round(v/g/16*parseInt(mxUtils.getValue(e,"flowAnimationDuration",500)));n=mxUtils.getValue(e,"flowAnimationTimingFunction","linear");e=mxUtils.getValue(e,"flowAnimationDirection","normal");b.style.animation=m+" "+g+"ms "+mxUtils.htmlEntities(n)+" infinite "+mxUtils.htmlEntities(e);b.style.strokeDashoffset=v}}};Graph.prototype.addFlowAnimationStyle=function(){var b=document.getElementsByTagName("head")[0];if(null!=b&&null==this.flowAnimationId){this.flowAnimationId="ge-flow-animation-"+Editor.guid();var e=document.createElement("style");e.innerHTML=this.createFlowAnimationCss(this.flowAnimationId);b.appendChild(e)}return this.flowAnimationId};Graph.prototype.createFlowAnimationCss=function(b){return"@keyframes "+b+" {\n to {\n stroke-dashoffset: 0;\n }\n}"};Graph.prototype.stringToBytes=function(b){return Graph.stringToBytes(b)};Graph.prototype.bytesToString=function(b){return Graph.bytesToString(b)};Graph.prototype.compressNode=function(b){return Graph.compressNode(b)};Graph.prototype.compress=function(b,e){return Graph.compress(b,e)};Graph.prototype.decompress=function(b,e){return Graph.decompress(b,e)};Graph.prototype.zapGremlins=function(b){return Graph.zapGremlins(b)};HoverIcons=function(b){mxEventSource.call(this);this.graph=b;this.init()};mxUtils.extend(HoverIcons,mxEventSource);HoverIcons.prototype.arrowSpacing=2;HoverIcons.prototype.updateDelay=500;HoverIcons.prototype.activationDelay=140;HoverIcons.prototype.currentState=null;HoverIcons.prototype.activeArrow=null;HoverIcons.prototype.inactiveOpacity=15;HoverIcons.prototype.cssCursor="copy";HoverIcons.prototype.checkCollisions=!0;HoverIcons.prototype.arrowFill="#29b6f2";HoverIcons.prototype.triangleUp=Graph.createSvgImage(18,28,'<path d="m 6 26 L 12 26 L 12 12 L 18 12 L 9 1 L 1 12 L 6 12 z" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');@@ -2473,14 +2477,14 @@ HoverIcons.prototype.getDirection=function(){var b=mxConstants.DIRECTION_EAST;thHoverIcons.prototype.setDisplay=function(b){this.visitNodes(function(e){e.style.display=b})};HoverIcons.prototype.isActive=function(){return null!=this.activeArrow&&null!=this.currentState};HoverIcons.prototype.drag=function(b,e,g){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);null!=this.currentState&&(this.graph.connectionHandler.start(this.currentState,e,g),this.graph.isMouseTrigger=mxEvent.isMouseEvent(b),this.graph.isMouseDown=!0,e=this.graph.selectionCellsHandler.getHandler(this.currentState.cell),null!=e&&e.setHandlesVisible(!1),e=this.graph.connectionHandler.edgeState,null!=b&&mxEvent.isShiftDown(b)&&mxEvent.isControlDown(b)&&null!=e&&"orthogonalEdgeStyle"===mxUtils.getValue(e.style,mxConstants.STYLE_EDGE,null)&&(b=this.getDirection(),e.cell.style=mxUtils.setStyle(e.cell.style,"sourcePortConstraint",b),e.style.sourcePortConstraint=b))};HoverIcons.prototype.getStateAt=function(b,e,g){return this.graph.view.getState(this.graph.getCellAt(e,g))};-HoverIcons.prototype.click=function(b,e,g){var m=g.getEvent(),v=g.getGraphX(),p=g.getGraphY();v=this.getStateAt(b,v,p);null==v||!this.graph.model.isEdge(v.cell)||this.graph.isCloneEvent(m)||v.getVisibleTerminalState(!0)!=b&&v.getVisibleTerminalState(!1)!=b?null!=b&&this.execute(b,e,g):(this.graph.setSelectionCell(v.cell),this.reset());g.consume()};+HoverIcons.prototype.click=function(b,e,g){var m=g.getEvent(),v=g.getGraphX(),n=g.getGraphY();v=this.getStateAt(b,v,n);null==v||!this.graph.model.isEdge(v.cell)||this.graph.isCloneEvent(m)||v.getVisibleTerminalState(!0)!=b&&v.getVisibleTerminalState(!1)!=b?null!=b&&this.execute(b,e,g):(this.graph.setSelectionCell(v.cell),this.reset());g.consume()};HoverIcons.prototype.execute=function(b,e,g){g=g.getEvent();this.graph.selectCellsForConnectVertex(this.graph.connectVertex(b.cell,e,this.graph.defaultEdgeLength,g,this.graph.isCloneEvent(g),this.graph.isCloneEvent(g)),g,this)};HoverIcons.prototype.reset=function(b){null!=b&&!b||null==this.updateThread||window.clearTimeout(this.updateThread);this.activeArrow=this.currentState=this.mouseDownPoint=null;this.removeNodes();this.bbox=null;this.fireEvent(new mxEventObject("reset"))};HoverIcons.prototype.repaint=function(){this.bbox=null;if(null!=this.currentState){this.currentState=this.getState(this.currentState);if(null!=this.currentState&&this.graph.model.isVertex(this.currentState.cell)&&this.graph.isCellConnectable(this.currentState.cell)){var b=mxRectangle.fromRectangle(this.currentState);null!=this.currentState.shape&&null!=this.currentState.shape.boundingBox&&(b=mxRectangle.fromRectangle(this.currentState.shape.boundingBox));b.grow(this.graph.tolerance);b.grow(this.arrowSpacing);var e=this.graph.selectionCellsHandler.getHandler(this.currentState.cell);this.graph.isTableRow(this.currentState.cell)&&(e=this.graph.selectionCellsHandler.getHandler(this.graph.model.getParent(this.currentState.cell)));var g=null;null!=e&&(b.x-=e.horizontalOffset/2,b.y-=e.verticalOffset/2,b.width+=e.horizontalOffset,b.height+=e.verticalOffset,null!=e.rotationShape&&null!=e.rotationShape.node&&"hidden"!=e.rotationShape.node.style.visibility&&"none"!=e.rotationShape.node.style.display&&null!=e.rotationShape.boundingBox&&-(g=e.rotationShape.boundingBox));e=mxUtils.bind(this,function(H,S,F){if(null!=g){var K=new mxRectangle(S,F,H.clientWidth,H.clientHeight);mxUtils.intersects(K,g)&&(H==this.arrowUp?F-=K.y+K.height-g.y:H==this.arrowRight?S+=g.x+g.width-K.x:H==this.arrowDown?F+=g.y+g.height-K.y:H==this.arrowLeft&&(S-=K.x+K.width-g.x))}H.style.left=S+"px";H.style.top=F+"px";mxUtils.setOpacity(H,this.inactiveOpacity)});e(this.arrowUp,Math.round(this.currentState.getCenterX()-this.triangleUp.width/2-this.tolerance),Math.round(b.y-+(g=e.rotationShape.boundingBox));e=mxUtils.bind(this,function(G,S,F){if(null!=g){var K=new mxRectangle(S,F,G.clientWidth,G.clientHeight);mxUtils.intersects(K,g)&&(G==this.arrowUp?F-=K.y+K.height-g.y:G==this.arrowRight?S+=g.x+g.width-K.x:G==this.arrowDown?F+=g.y+g.height-K.y:G==this.arrowLeft&&(S-=K.x+K.width-g.x))}G.style.left=S+"px";G.style.top=F+"px";mxUtils.setOpacity(G,this.inactiveOpacity)});e(this.arrowUp,Math.round(this.currentState.getCenterX()-this.triangleUp.width/2-this.tolerance),Math.round(b.y-this.triangleUp.height-this.tolerance));e(this.arrowRight,Math.round(b.x+b.width-this.tolerance),Math.round(this.currentState.getCenterY()-this.triangleRight.height/2-this.tolerance));e(this.arrowDown,parseInt(this.arrowUp.style.left),Math.round(b.y+b.height-this.tolerance));e(this.arrowLeft,Math.round(b.x-this.triangleLeft.width-this.tolerance),parseInt(this.arrowRight.style.top));if(this.checkCollisions){e=this.graph.getCellAt(b.x+b.width+this.triangleRight.width/2,this.currentState.getCenterY());-var m=this.graph.getCellAt(b.x-this.triangleLeft.width/2,this.currentState.getCenterY()),v=this.graph.getCellAt(this.currentState.getCenterX(),b.y-this.triangleUp.height/2);b=this.graph.getCellAt(this.currentState.getCenterX(),b.y+b.height+this.triangleDown.height/2);null!=e&&e==m&&m==v&&v==b&&(b=v=m=e=null);var p=this.graph.getCellGeometry(this.currentState.cell),A=mxUtils.bind(this,function(H,S){var F=this.graph.model.isVertex(H)&&this.graph.getCellGeometry(H);null==H||this.graph.model.isAncestor(H,-this.currentState.cell)||this.graph.isSwimlane(H)||!(null==F||null==p||F.height<3*p.height&&F.width<3*p.width)?S.style.visibility="visible":S.style.visibility="hidden"});A(e,this.arrowRight);A(m,this.arrowLeft);A(v,this.arrowUp);A(b,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")),+var m=this.graph.getCellAt(b.x-this.triangleLeft.width/2,this.currentState.getCenterY()),v=this.graph.getCellAt(this.currentState.getCenterX(),b.y-this.triangleUp.height/2);b=this.graph.getCellAt(this.currentState.getCenterX(),b.y+b.height+this.triangleDown.height/2);null!=e&&e==m&&m==v&&v==b&&(b=v=m=e=null);var n=this.graph.getCellGeometry(this.currentState.cell),A=mxUtils.bind(this,function(G,S){var F=this.graph.model.isVertex(G)&&this.graph.getCellGeometry(G);null==G||this.graph.model.isAncestor(G,+this.currentState.cell)||this.graph.isSwimlane(G)||!(null==F||null==n||F.height<3*n.height&&F.width<3*n.width)?S.style.visibility="visible":S.style.visibility="hidden"});A(e,this.arrowRight);A(m,this.arrowLeft);A(v,this.arrowUp);A(b,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")),this.arrowRight.setAttribute("title",mxResources.get("plusTooltip")),this.arrowUp.setAttribute("title",mxResources.get("plusTooltip")),this.arrowDown.setAttribute("title",mxResources.get("plusTooltip"))):(this.arrowLeft.removeAttribute("title"),this.arrowRight.removeAttribute("title"),this.arrowUp.removeAttribute("title"),this.arrowDown.removeAttribute("title"))}else this.reset();null!=this.currentState&&(this.bbox=this.computeBoundingBox(),null!=this.bbox&&this.bbox.grow(10))}};HoverIcons.prototype.computeBoundingBox=function(){var b=this.graph.model.isEdge(this.currentState.cell)?null:mxRectangle.fromRectangle(this.currentState);this.visitNodes(function(e){null!=e.parentNode&&(e=new mxRectangle(e.offsetLeft,e.offsetTop,e.offsetWidth,e.offsetHeight),null==b?b=e:b.add(e))});return b};HoverIcons.prototype.getState=function(b){if(null!=b)if(b=b.cell,this.graph.getModel().contains(b)){if(this.graph.getModel().isVertex(b)&&!this.graph.isCellConnectable(b)){var e=this.graph.getModel().getParent(b);this.graph.getModel().isVertex(e)&&this.graph.isCellConnectable(e)&&(b=e)}if(this.graph.isCellLocked(b)||this.graph.model.isEdge(b))b=null;b=this.graph.view.getState(b);null!=b&&null==b.style&&(b=null)}else b=null;return b};@@ -2489,59 +2493,59 @@ window.setTimeout(mxUtils.bind(this,function(){this.isActive()||this.graph.isMoub||null==this.bbox||null==e||null==g||!mxUtils.contains(this.bbox,e,g))&&(null!=b&&this.graph.isEnabled()?(this.removeNodes(),this.setCurrentState(b),this.repaint(),this.graph.connectionHandler.constraintHandler.currentFocus!=b&&this.graph.connectionHandler.constraintHandler.reset()):this.reset())}};HoverIcons.prototype.setCurrentState=function(b){"eastwest"!=b.style.portConstraint&&(this.graph.container.appendChild(this.arrowUp),this.graph.container.appendChild(this.arrowDown));this.graph.container.appendChild(this.arrowRight);this.graph.container.appendChild(this.arrowLeft);this.currentState=b};Graph.prototype.removeTextStyleForCell=function(b,e){var g=this.getCurrentCellStyle(b),m=!1;this.getModel().beginUpdate();try{if("1"==mxUtils.getValue(g,"html","0")){var v=this.convertValueToString(b);"0"!=mxUtils.getValue(g,"nl2Br","1")&&(v=v.replace(/\n/g,"").replace(/<br\s*.?>/g,"\n"));v=Editor.convertHtmlToText(v);this.cellLabelChanged(b,v);m=!0}e&&(this.setCellStyles("fontSource",null,[b]),this.setCellStyles(mxConstants.STYLE_FONTFAMILY,null,[b]),this.setCellStyles(mxConstants.STYLE_FONTSIZE,-null,[b]),this.setCellStyles(mxConstants.STYLE_FONTSTYLE,null,[b]),this.setCellStyles(mxConstants.STYLE_FONTCOLOR,null,[b]),this.setCellStyles(mxConstants.STYLE_LABEL_BORDERCOLOR,null,[b]),this.setCellStyles(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null,[b]))}finally{this.getModel().endUpdate()}return m};Graph.prototype.createParent=function(b,e,g,m,v){b=this.cloneCell(b);for(var p=0;p<g;p++){var A=this.cloneCell(e),H=this.getCellGeometry(A);null!=H&&(H.x+=p*m,H.y+=p*v);b.insert(A)}return b};-Graph.prototype.createTable=function(b,e,g,m,v,p,A,H,S){g=null!=g?g:60;m=null!=m?m:40;p=null!=p?p:30;H=null!=H?H:"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;strokeColor=inherit;top=0;left=0;bottom=0;right=0;collapsible=0;dropTarget=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;";S=null!=S?S:"shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;strokeColor=inherit;overflow=hidden;fillColor=none;top=0;left=0;bottom=0;right=0;pointerEvents=1;";return this.createParent(this.createVertex(null,-null,null!=v?v:"",0,0,e*g,b*m+(null!=v?p:0),null!=A?A:"shape=table;startSize="+(null!=v?p:"0")+";container=1;collapsible=0;childLayout=tableLayout;"),this.createParent(this.createVertex(null,null,"",0,0,e*g,m,H),this.createVertex(null,null,"",0,0,g,m,S),e,g,0),b,0,m)};-Graph.prototype.setTableValues=function(b,e,g){for(var m=this.model.getChildCells(b,!0),v=0;v<m.length;v++)if(null!=g&&(m[v].value=g[v]),null!=e)for(var p=this.model.getChildCells(m[v],!0),A=0;A<p.length;A++)null!=e[v][A]&&(p[A].value=e[v][A]);return b};-Graph.prototype.createCrossFunctionalSwimlane=function(b,e,g,m,v,p,A,H,S){g=null!=g?g:120;m=null!=m?m:120;A=null!=A?A:"shape=tableRow;horizontal=0;swimlaneHead=0;swimlaneBody=0;top=0;left=0;strokeColor=inherit;bottom=0;right=0;dropTarget=0;fontStyle=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;startSize=40;collapsible=0;recursiveResize=0;expand=0;";H=null!=H?H:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;strokeColor=inherit;connectable=0;fillColor=none;startSize=40;collapsible=0;recursiveResize=0;expand=0;";-S=null!=S?S:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;connectable=0;strokeColor=inherit;fillColor=none;startSize=0;collapsible=0;recursiveResize=0;expand=0;";v=this.createVertex(null,null,null!=v?v:"",0,0,e*g,b*m,null!=p?p:"shape=table;childLayout=tableLayout;"+(null==v?"startSize=0;fillColor=none;":"startSize=40;")+"collapsible=0;recursiveResize=0;expand=0;");p=mxUtils.getValue(this.getCellStyle(v),mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);v.geometry.width+=p;v.geometry.height+=-p;A=this.createVertex(null,null,"",0,p,e*g+p,m,A);v.insert(this.createParent(A,this.createVertex(null,null,"",p,0,g,m,H),e,g,0));return 1<b?(A.geometry.y=m+p,this.createParent(v,this.createParent(A,this.createVertex(null,null,"",p,0,g,m,S),e,g,0),b-1,0,m)):v};-Graph.prototype.visitTableCells=function(b,e){var g=null,m=this.model.getChildCells(b,!0);b=this.getActualStartSize(b,!0);for(var v=0;v<m.length;v++){for(var p=this.getActualStartSize(m[v],!0),A=this.model.getChildCells(m[v],!0),H=this.getCellStyle(m[v],!0),S=null,F=[],K=0;K<A.length;K++){var c=this.getCellGeometry(A[K]),f={cell:A[K],rospan:1,colspan:1,row:v,col:K,geo:c};c=null!=c.alternateBounds?c.alternateBounds:c;f.point=new mxPoint(c.width+(null!=S?S.point.x:b.x+p.x),c.height+(null!=g&&null!=-g[0]?g[0].point.y:b.y+p.y));f.actual=f;null!=g&&null!=g[K]&&1<g[K].rowspan?(f.rowspan=g[K].rowspan-1,f.colspan=g[K].colspan,f.actual=g[K].actual):null!=S&&1<S.colspan?(f.rowspan=S.rowspan,f.colspan=S.colspan-1,f.actual=S.actual):(S=this.getCurrentCellStyle(A[K],!0),null!=S&&(f.rowspan=parseInt(S.rowspan||1),f.colspan=parseInt(S.colspan||1)));S=1==mxUtils.getValue(H,mxConstants.STYLE_SWIMLANE_HEAD,1)&&mxUtils.getValue(H,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!=mxConstants.NONE;e(f,A.length,-m.length,b.x+(S?p.x:0),b.y+(S?p.y:0));F.push(f);S=f}g=F}};Graph.prototype.getTableLines=function(b,e,g){var m=[],v=[];(e||g)&&this.visitTableCells(b,mxUtils.bind(this,function(p,A,H,S,F){e&&p.row<H-1&&(null==m[p.row]&&(m[p.row]=[new mxPoint(S,p.point.y)]),1<p.rowspan&&m[p.row].push(null),m[p.row].push(p.point));g&&p.col<A-1&&(null==v[p.col]&&(v[p.col]=[new mxPoint(p.point.x,F)]),1<p.colspan&&v[p.col].push(null),v[p.col].push(p.point))}));return m.concat(v)};+null,[b]),this.setCellStyles(mxConstants.STYLE_FONTSTYLE,null,[b]),this.setCellStyles(mxConstants.STYLE_FONTCOLOR,null,[b]),this.setCellStyles(mxConstants.STYLE_LABEL_BORDERCOLOR,null,[b]),this.setCellStyles(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null,[b]))}finally{this.getModel().endUpdate()}return m};Graph.prototype.createParent=function(b,e,g,m,v){b=this.cloneCell(b);for(var n=0;n<g;n++){var A=this.cloneCell(e),G=this.getCellGeometry(A);null!=G&&(G.x+=n*m,G.y+=n*v);b.insert(A)}return b};+Graph.prototype.createTable=function(b,e,g,m,v,n,A,G,S){g=null!=g?g:60;m=null!=m?m:40;n=null!=n?n:30;G=null!=G?G:"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;strokeColor=inherit;top=0;left=0;bottom=0;right=0;collapsible=0;dropTarget=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;";S=null!=S?S:"shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;strokeColor=inherit;overflow=hidden;fillColor=none;top=0;left=0;bottom=0;right=0;pointerEvents=1;";return this.createParent(this.createVertex(null,+null,null!=v?v:"",0,0,e*g,b*m+(null!=v?n:0),null!=A?A:"shape=table;startSize="+(null!=v?n:"0")+";container=1;collapsible=0;childLayout=tableLayout;"),this.createParent(this.createVertex(null,null,"",0,0,e*g,m,G),this.createVertex(null,null,"",0,0,g,m,S),e,g,0),b,0,m)};+Graph.prototype.setTableValues=function(b,e,g){for(var m=this.model.getChildCells(b,!0),v=0;v<m.length;v++)if(null!=g&&(m[v].value=g[v]),null!=e)for(var n=this.model.getChildCells(m[v],!0),A=0;A<n.length;A++)null!=e[v][A]&&(n[A].value=e[v][A]);return b};+Graph.prototype.createCrossFunctionalSwimlane=function(b,e,g,m,v,n,A,G,S){g=null!=g?g:120;m=null!=m?m:120;A=null!=A?A:"shape=tableRow;horizontal=0;swimlaneHead=0;swimlaneBody=0;top=0;left=0;strokeColor=inherit;bottom=0;right=0;dropTarget=0;fontStyle=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;startSize=40;collapsible=0;recursiveResize=0;expand=0;";G=null!=G?G:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;strokeColor=inherit;connectable=0;fillColor=none;startSize=40;collapsible=0;recursiveResize=0;expand=0;";+S=null!=S?S:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;connectable=0;strokeColor=inherit;fillColor=none;startSize=0;collapsible=0;recursiveResize=0;expand=0;";v=this.createVertex(null,null,null!=v?v:"",0,0,e*g,b*m,null!=n?n:"shape=table;childLayout=tableLayout;"+(null==v?"startSize=0;fillColor=none;":"startSize=40;")+"collapsible=0;recursiveResize=0;expand=0;");n=mxUtils.getValue(this.getCellStyle(v),mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);v.geometry.width+=n;v.geometry.height+=+n;A=this.createVertex(null,null,"",0,n,e*g+n,m,A);v.insert(this.createParent(A,this.createVertex(null,null,"",n,0,g,m,G),e,g,0));return 1<b?(A.geometry.y=m+n,this.createParent(v,this.createParent(A,this.createVertex(null,null,"",n,0,g,m,S),e,g,0),b-1,0,m)):v};+Graph.prototype.visitTableCells=function(b,e){var g=null,m=this.model.getChildCells(b,!0);b=this.getActualStartSize(b,!0);for(var v=0;v<m.length;v++){for(var n=this.getActualStartSize(m[v],!0),A=this.model.getChildCells(m[v],!0),G=this.getCellStyle(m[v],!0),S=null,F=[],K=0;K<A.length;K++){var c=this.getCellGeometry(A[K]),f={cell:A[K],rospan:1,colspan:1,row:v,col:K,geo:c};c=null!=c.alternateBounds?c.alternateBounds:c;f.point=new mxPoint(c.width+(null!=S?S.point.x:b.x+n.x),c.height+(null!=g&&null!=+g[0]?g[0].point.y:b.y+n.y));f.actual=f;null!=g&&null!=g[K]&&1<g[K].rowspan?(f.rowspan=g[K].rowspan-1,f.colspan=g[K].colspan,f.actual=g[K].actual):null!=S&&1<S.colspan?(f.rowspan=S.rowspan,f.colspan=S.colspan-1,f.actual=S.actual):(S=this.getCurrentCellStyle(A[K],!0),null!=S&&(f.rowspan=parseInt(S.rowspan||1),f.colspan=parseInt(S.colspan||1)));S=1==mxUtils.getValue(G,mxConstants.STYLE_SWIMLANE_HEAD,1)&&mxUtils.getValue(G,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!=mxConstants.NONE;e(f,A.length,+m.length,b.x+(S?n.x:0),b.y+(S?n.y:0));F.push(f);S=f}g=F}};Graph.prototype.getTableLines=function(b,e,g){var m=[],v=[];(e||g)&&this.visitTableCells(b,mxUtils.bind(this,function(n,A,G,S,F){e&&n.row<G-1&&(null==m[n.row]&&(m[n.row]=[new mxPoint(S,n.point.y)]),1<n.rowspan&&m[n.row].push(null),m[n.row].push(n.point));g&&n.col<A-1&&(null==v[n.col]&&(v[n.col]=[new mxPoint(n.point.x,F)]),1<n.colspan&&v[n.col].push(null),v[n.col].push(n.point))}));return m.concat(v)};Graph.prototype.isTableCell=function(b){return this.model.isVertex(b)&&this.isTableRow(this.model.getParent(b))};Graph.prototype.isTableRow=function(b){return this.model.isVertex(b)&&this.isTable(this.model.getParent(b))};Graph.prototype.isTable=function(b){b=this.getCellStyle(b);return null!=b&&"tableLayout"==b.childLayout};Graph.prototype.isStack=function(b){b=this.getCellStyle(b);return null!=b&&"stackLayout"==b.childLayout};Graph.prototype.isStackChild=function(b){return this.model.isVertex(b)&&this.isStack(this.model.getParent(b))};-Graph.prototype.setTableRowHeight=function(b,e,g){g=null!=g?g:!0;var m=this.getModel();m.beginUpdate();try{var v=this.getCellGeometry(b);if(null!=v){v=v.clone();v.height+=e;m.setGeometry(b,v);var p=m.getParent(b),A=m.getChildCells(p,!0);if(!g){var H=mxUtils.indexOf(A,b);if(H<A.length-1){var S=A[H+1],F=this.getCellGeometry(S);null!=F&&(F=F.clone(),F.y+=e,F.height-=e,m.setGeometry(S,F))}}var K=this.getCellGeometry(p);null!=K&&(g||(g=b==A[A.length-1]),g&&(K=K.clone(),K.height+=e,m.setGeometry(p,K)))}}finally{m.endUpdate()}};-Graph.prototype.setTableColumnWidth=function(b,e,g){g=null!=g?g:!1;var m=this.getModel(),v=m.getParent(b),p=m.getParent(v),A=m.getChildCells(v,!0);b=mxUtils.indexOf(A,b);var H=b==A.length-1;m.beginUpdate();try{for(var S=m.getChildCells(p,!0),F=0;F<S.length;F++){v=S[F];A=m.getChildCells(v,!0);var K=A[b],c=this.getCellGeometry(K);null!=c&&(c=c.clone(),c.width+=e,null!=c.alternateBounds&&(c.alternateBounds.width+=e),m.setGeometry(K,c));b<A.length-1&&(K=A[b+1],c=this.getCellGeometry(K),null!=c&&(c=c.clone(),-c.x+=e,g||(c.width-=e,null!=c.alternateBounds&&(c.alternateBounds.width-=e)),m.setGeometry(K,c)))}if(H||g){var f=this.getCellGeometry(p);null!=f&&(f=f.clone(),f.width+=e,m.setGeometry(p,f))}null!=this.layoutManager&&this.layoutManager.executeLayout(p)}finally{m.endUpdate()}};function TableLayout(b){mxGraphLayout.call(this,b)}TableLayout.prototype=new mxStackLayout;TableLayout.prototype.constructor=TableLayout;TableLayout.prototype.isHorizontal=function(){return!1};+Graph.prototype.setTableRowHeight=function(b,e,g){g=null!=g?g:!0;var m=this.getModel();m.beginUpdate();try{var v=this.getCellGeometry(b);if(null!=v){v=v.clone();v.height+=e;m.setGeometry(b,v);var n=m.getParent(b),A=m.getChildCells(n,!0);if(!g){var G=mxUtils.indexOf(A,b);if(G<A.length-1){var S=A[G+1],F=this.getCellGeometry(S);null!=F&&(F=F.clone(),F.y+=e,F.height-=e,m.setGeometry(S,F))}}var K=this.getCellGeometry(n);null!=K&&(g||(g=b==A[A.length-1]),g&&(K=K.clone(),K.height+=e,m.setGeometry(n,K)))}}finally{m.endUpdate()}};+Graph.prototype.setTableColumnWidth=function(b,e,g){g=null!=g?g:!1;var m=this.getModel(),v=m.getParent(b),n=m.getParent(v),A=m.getChildCells(v,!0);b=mxUtils.indexOf(A,b);var G=b==A.length-1;m.beginUpdate();try{for(var S=m.getChildCells(n,!0),F=0;F<S.length;F++){v=S[F];A=m.getChildCells(v,!0);var K=A[b],c=this.getCellGeometry(K);null!=c&&(c=c.clone(),c.width+=e,null!=c.alternateBounds&&(c.alternateBounds.width+=e),m.setGeometry(K,c));b<A.length-1&&(K=A[b+1],c=this.getCellGeometry(K),null!=c&&(c=c.clone(),+c.x+=e,g||(c.width-=e,null!=c.alternateBounds&&(c.alternateBounds.width-=e)),m.setGeometry(K,c)))}if(G||g){var f=this.getCellGeometry(n);null!=f&&(f=f.clone(),f.width+=e,m.setGeometry(n,f))}null!=this.layoutManager&&this.layoutManager.executeLayout(n)}finally{m.endUpdate()}};function TableLayout(b){mxGraphLayout.call(this,b)}TableLayout.prototype=new mxStackLayout;TableLayout.prototype.constructor=TableLayout;TableLayout.prototype.isHorizontal=function(){return!1};TableLayout.prototype.isVertexIgnored=function(b){return!this.graph.getModel().isVertex(b)||!this.graph.isCellVisible(b)};TableLayout.prototype.getSize=function(b,e){for(var g=0,m=0;m<b.length;m++)if(!this.isVertexIgnored(b[m])){var v=this.graph.getCellGeometry(b[m]);null!=v&&(g+=e?v.width:v.height)}return g};-TableLayout.prototype.getRowLayout=function(b,e){var g=this.graph.model.getChildCells(b,!0),m=this.graph.getActualStartSize(b,!0);b=this.getSize(g,!0);e=e-m.x-m.width;var v=[];m=m.x;for(var p=0;p<g.length;p++){var A=this.graph.getCellGeometry(g[p]);null!=A&&(m+=(null!=A.alternateBounds?A.alternateBounds.width:A.width)*e/b,v.push(Math.round(m)))}return v};-TableLayout.prototype.layoutRow=function(b,e,g,m){var v=this.graph.getModel(),p=v.getChildCells(b,!0);b=this.graph.getActualStartSize(b,!0);var A=b.x,H=0;null!=e&&(e=e.slice(),e.splice(0,0,b.x));for(var S=0;S<p.length;S++){var F=this.graph.getCellGeometry(p[S]);null!=F&&(F=F.clone(),F.y=b.y,F.height=g-b.y-b.height,null!=e?(F.x=e[S],F.width=e[S+1]-F.x,S==p.length-1&&S<e.length-2&&(F.width=m-F.x-b.x-b.width)):(F.x=A,A+=F.width,S==p.length-1?F.width=m-b.x-b.width-H:H+=F.width),F.alternateBounds=new mxRectangle(0,-0,F.width,F.height),v.setGeometry(p[S],F))}return H};-TableLayout.prototype.execute=function(b){if(null!=b){var e=this.graph.getActualStartSize(b,!0),g=this.graph.getCellGeometry(b),m=this.graph.getCellStyle(b),v="1"==mxUtils.getValue(m,"resizeLastRow","0"),p="1"==mxUtils.getValue(m,"resizeLast","0");m="1"==mxUtils.getValue(m,"fixedRows","0");var A=this.graph.getModel(),H=0;A.beginUpdate();try{for(var S=g.height-e.y-e.height,F=g.width-e.x-e.width,K=A.getChildCells(b,!0),c=0;c<K.length;c++)A.setVisible(K[c],!0);var f=this.getSize(K,!1);if(0<S&&0<F&&0<-K.length&&0<f){if(v){var l=this.graph.getCellGeometry(K[K.length-1]);null!=l&&(l=l.clone(),l.height=S-f+l.height,A.setGeometry(K[K.length-1],l))}var t=p?null:this.getRowLayout(K[0],F),q=[],D=e.y;for(c=0;c<K.length;c++)l=this.graph.getCellGeometry(K[c]),null!=l&&(l=l.clone(),l.x=e.x,l.width=F,l.y=Math.round(D),D=v||m?D+l.height:D+l.height/f*S,l.height=Math.round(D)-l.y,A.setGeometry(K[c],l)),H=Math.max(H,this.layoutRow(K[c],t,l.height,F,q));m&&S<f&&(g=g.clone(),g.height=D+e.height,A.setGeometry(b,-g));p&&F<H+Graph.minTableColumnWidth&&(g=g.clone(),g.width=H+e.width+e.x+Graph.minTableColumnWidth,A.setGeometry(b,g));this.graph.visitTableCells(b,mxUtils.bind(this,function(G){A.setVisible(G.cell,G.actual.cell==G.cell);if(G.actual.cell!=G.cell){if(G.actual.row==G.row){var N=null!=G.geo.alternateBounds?G.geo.alternateBounds:G.geo;G.actual.geo.width+=N.width}G.actual.col==G.col&&(N=null!=G.geo.alternateBounds?G.geo.alternateBounds:G.geo,G.actual.geo.height+=N.height)}}))}else for(c=0;c<K.length;c++)A.setVisible(K[c],+TableLayout.prototype.getRowLayout=function(b,e){var g=this.graph.model.getChildCells(b,!0),m=this.graph.getActualStartSize(b,!0);b=this.getSize(g,!0);e=e-m.x-m.width;var v=[];m=m.x;for(var n=0;n<g.length;n++){var A=this.graph.getCellGeometry(g[n]);null!=A&&(m+=(null!=A.alternateBounds?A.alternateBounds.width:A.width)*e/b,v.push(Math.round(m)))}return v};+TableLayout.prototype.layoutRow=function(b,e,g,m){var v=this.graph.getModel(),n=v.getChildCells(b,!0);b=this.graph.getActualStartSize(b,!0);var A=b.x,G=0;null!=e&&(e=e.slice(),e.splice(0,0,b.x));for(var S=0;S<n.length;S++){var F=this.graph.getCellGeometry(n[S]);null!=F&&(F=F.clone(),F.y=b.y,F.height=g-b.y-b.height,null!=e?(F.x=e[S],F.width=e[S+1]-F.x,S==n.length-1&&S<e.length-2&&(F.width=m-F.x-b.x-b.width)):(F.x=A,A+=F.width,S==n.length-1?F.width=m-b.x-b.width-G:G+=F.width),F.alternateBounds=new mxRectangle(0,+0,F.width,F.height),v.setGeometry(n[S],F))}return G};+TableLayout.prototype.execute=function(b){if(null!=b){var e=this.graph.getActualStartSize(b,!0),g=this.graph.getCellGeometry(b),m=this.graph.getCellStyle(b),v="1"==mxUtils.getValue(m,"resizeLastRow","0"),n="1"==mxUtils.getValue(m,"resizeLast","0");m="1"==mxUtils.getValue(m,"fixedRows","0");var A=this.graph.getModel(),G=0;A.beginUpdate();try{for(var S=g.height-e.y-e.height,F=g.width-e.x-e.width,K=A.getChildCells(b,!0),c=0;c<K.length;c++)A.setVisible(K[c],!0);var f=this.getSize(K,!1);if(0<S&&0<F&&0<+K.length&&0<f){if(v){var l=this.graph.getCellGeometry(K[K.length-1]);null!=l&&(l=l.clone(),l.height=S-f+l.height,A.setGeometry(K[K.length-1],l))}var t=n?null:this.getRowLayout(K[0],F),q=[],D=e.y;for(c=0;c<K.length;c++)l=this.graph.getCellGeometry(K[c]),null!=l&&(l=l.clone(),l.x=e.x,l.width=F,l.y=Math.round(D),D=v||m?D+l.height:D+l.height/f*S,l.height=Math.round(D)-l.y,A.setGeometry(K[c],l)),G=Math.max(G,this.layoutRow(K[c],t,l.height,F,q));m&&S<f&&(g=g.clone(),g.height=D+e.height,A.setGeometry(b,+g));n&&F<G+Graph.minTableColumnWidth&&(g=g.clone(),g.width=G+e.width+e.x+Graph.minTableColumnWidth,A.setGeometry(b,g));this.graph.visitTableCells(b,mxUtils.bind(this,function(H){A.setVisible(H.cell,H.actual.cell==H.cell);if(H.actual.cell!=H.cell){if(H.actual.row==H.row){var N=null!=H.geo.alternateBounds?H.geo.alternateBounds:H.geo;H.actual.geo.width+=N.width}H.actual.col==H.col&&(N=null!=H.geo.alternateBounds?H.geo.alternateBounds:H.geo,H.actual.geo.height+=N.height)}}))}else for(c=0;c<K.length;c++)A.setVisible(K[c],!1)}finally{A.endUpdate()}}};(function(){var b=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){b.apply(this,arguments);this.validEdges=[]};var e=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(c,f){f=null!=f?f:!0;var l=this.getState(c);null!=l&&f&&this.graph.model.isEdge(l.cell)&&null!=l.style&&1!=l.style[mxConstants.STYLE_CURVED]&&!l.invalid&&this.updateLineJumps(l)&&this.graph.cellRenderer.redraw(l,!1,this.isRendering());l=e.apply(this,arguments);null!=l&&f&&this.graph.model.isEdge(l.cell)&&null!=l.style&&1!=l.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(l);return l};mxShape.prototype.isFlowAnimationEnabled=function(){return null!=this.state&&this.state.view.graph.enableFlowAnimation&&this.state.view.graph.model.isEdge(this.state.cell)&&"1"==mxUtils.getValue(this.state.style,"flowAnimation","0")};mxShape.prototype.getFlowAnimationPath=function(){var c=null!=this.node?this.node.getElementsByTagName("path"):null;if(null!=c)for(var f=0;f<c.length;f++)if("hidden"!=c[f].getAttribute("visibility"))return c[f];return null};mxShape.prototype.addFlowAnimationToShape=function(){null!=this.state&&this.state.view.graph.addFlowAnimationToNode(this.getFlowAnimationPath(),this.state.style,this.state.view.scale,this.state.view.graph.addFlowAnimationStyle())};var g=mxShape.prototype.paint;mxShape.prototype.paint=function(c){g.apply(this,arguments);this.isFlowAnimationEnabled()&&this.addFlowAnimationToShape()};var m=mxShape.prototype.createSvgCanvas;-mxShape.prototype.createSvgCanvas=function(c){c=m.apply(this,arguments);null!=this.state&&(c.adaptiveColors=this.state.view.graph.getAdaptiveColors());return c};var v=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(c,f){return v.apply(this,arguments)||null!=c.routedPoints&&null!=f.routedPoints&&!mxUtils.equalPoints(f.routedPoints,c.routedPoints)};var p=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(c){p.apply(this,arguments);+mxShape.prototype.createSvgCanvas=function(c){c=m.apply(this,arguments);null!=this.state&&(c.adaptiveColors=this.state.view.graph.getAdaptiveColors());return c};var v=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(c,f){return v.apply(this,arguments)||null!=c.routedPoints&&null!=f.routedPoints&&!mxUtils.equalPoints(f.routedPoints,c.routedPoints)};var n=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(c){n.apply(this,arguments);this.graph.model.isEdge(c.cell)&&1!=c.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(c)};mxGraphView.prototype.updateLineJumps=function(c){var f=c.absolutePoints;if(Graph.lineJumpsEnabled){var l=null!=c.routedPoints,t=null;if(null!=f&&null!=this.validEdges&&"none"!==mxUtils.getValue(c.style,"jumpStyle","none")){var q=function(ca,la,Q){var k=new mxPoint(la,Q);k.type=ca;t.push(k);k=null!=c.routedPoints?c.routedPoints[t.length-1]:null;return null==k||k.type!=ca||k.x!=la||k.y!=Q},D=.5*this.scale;-l=!1;t=[];for(var G=0;G<f.length-1;G++){for(var N=f[G+1],L=f[G],J=[],Y=f[G+2];G<f.length-2&&mxUtils.ptSegDistSq(L.x,L.y,Y.x,Y.y,N.x,N.y)<1*this.scale*this.scale;)N=Y,G++,Y=f[G+2];l=q(0,L.x,L.y)||l;for(var ha=0;ha<this.validEdges.length;ha++){var ea=this.validEdges[ha],aa=ea.absolutePoints;if(null!=aa&&mxUtils.intersects(c,ea)&&"1"!=ea.style.noJump){var na=null;for(ea=0;ea<aa.length-1;ea++){var W=aa[ea+1],ba=aa[ea];for(Y=aa[ea+2];ea<aa.length-2&&mxUtils.ptSegDistSq(ba.x,ba.y,Y.x,Y.y,W.x,W.y)<1*this.scale*+l=!1;t=[];for(var H=0;H<f.length-1;H++){for(var N=f[H+1],L=f[H],J=[],Y=f[H+2];H<f.length-2&&mxUtils.ptSegDistSq(L.x,L.y,Y.x,Y.y,N.x,N.y)<1*this.scale*this.scale;)N=Y,H++,Y=f[H+2];l=q(0,L.x,L.y)||l;for(var ha=0;ha<this.validEdges.length;ha++){var ea=this.validEdges[ha],aa=ea.absolutePoints;if(null!=aa&&mxUtils.intersects(c,ea)&&"1"!=ea.style.noJump){var na=null;for(ea=0;ea<aa.length-1;ea++){var W=aa[ea+1],ba=aa[ea];for(Y=aa[ea+2];ea<aa.length-2&&mxUtils.ptSegDistSq(ba.x,ba.y,Y.x,Y.y,W.x,W.y)<1*this.scale*this.scale;)W=Y,ea++,Y=aa[ea+2];var ja=mxUtils.intersection(L.x,L.y,N.x,N.y,ba.x,ba.y,W.x,W.y);if(null!=ja&&(Math.abs(ja.x-L.x)>D||Math.abs(ja.y-L.y)>D)&&(Math.abs(ja.x-N.x)>D||Math.abs(ja.y-N.y)>D)&&(null==na||mxUtils.ptLineDist(L.x,L.y,N.x,N.y,na.x,na.y)>D||mxUtils.ptLineDist(L.x,L.y,N.x,N.y,ba.x,ba.y)>D)&&(null==Y||mxUtils.ptLineDist(L.x,L.y,N.x,N.y,Y.x,Y.y)>D||mxUtils.ptLineDist(L.x,L.y,N.x,N.y,W.x,W.y)>D)){Y=ja.x-L.x;na=ja.y-L.y;ja={distSq:Y*Y+na*na,x:ja.x,y:ja.y};for(Y=0;Y<J.length;Y++)if(J[Y].distSq>ja.distSq){J.splice(Y,0,ja);ja=null;break}null==ja||0!=J.length&&J[J.length-1].x===ja.x&&J[J.length-1].y===ja.y||J.push(ja)}na=ba}}}for(ea=0;ea<J.length;ea++)l=q(1,J[ea].x,J[ea].y)||l}ja=f[f.length-1];l=q(0,ja.x,ja.y)||l}c.routedPoints=t;return l}return!1};var A=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(c,f,l){this.routedPoints=null!=this.state?this.state.routedPoints:null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)A.apply(this,-arguments);else{var t=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,q=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,D=mxUtils.getValue(this.style,"jumpStyle","none"),G=!0,N=null,L=null,J=[],Y=null;c.begin();for(var ha=0;ha<this.state.routedPoints.length;ha++){var ea=this.state.routedPoints[ha],aa=new mxPoint(ea.x/this.scale,ea.y/this.scale);0==ha?aa=f[0]:ha==this.state.routedPoints.length-1&&(aa=f[f.length-1]);var na=-!1;if(null!=N&&1==ea.type){var W=this.state.routedPoints[ha+1];ea=W.x/this.scale-aa.x;W=W.y/this.scale-aa.y;ea=ea*ea+W*W;null==Y&&(Y=new mxPoint(aa.x-N.x,aa.y-N.y),L=Math.sqrt(Y.x*Y.x+Y.y*Y.y),0<L?(Y.x=Y.x*q/L,Y.y=Y.y*q/L):Y=null);ea>q*q&&0<L&&(ea=N.x-aa.x,W=N.y-aa.y,ea=ea*ea+W*W,ea>q*q&&(na=new mxPoint(aa.x-Y.x,aa.y-Y.y),ea=new mxPoint(aa.x+Y.x,aa.y+Y.y),J.push(na),this.addPoints(c,J,l,t,!1,null,G),J=0>Math.round(Y.x)||0==Math.round(Y.x)&&0>=Math.round(Y.y)?1:-1,G=!1,"sharp"==D?(c.lineTo(na.x-Y.y*-J,na.y+Y.x*J),c.lineTo(ea.x-Y.y*J,ea.y+Y.x*J),c.lineTo(ea.x,ea.y)):"line"==D?(c.moveTo(na.x+Y.y*J,na.y-Y.x*J),c.lineTo(na.x-Y.y*J,na.y+Y.x*J),c.moveTo(ea.x-Y.y*J,ea.y+Y.x*J),c.lineTo(ea.x+Y.y*J,ea.y-Y.x*J),c.moveTo(ea.x,ea.y)):"arc"==D?(J*=1.3,c.curveTo(na.x-Y.y*J,na.y+Y.x*J,ea.x-Y.y*J,ea.y+Y.x*J,ea.x,ea.y)):(c.moveTo(ea.x,ea.y),G=!0),J=[ea],na=!0))}else Y=null;na||(J.push(aa),N=aa)}this.addPoints(c,J,l,t,!1,null,G);c.stroke()}};var H=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=-function(c,f,l,t){return null!=f&&"centerPerimeter"==f.style[mxConstants.STYLE_PERIMETER]?new mxPoint(f.getCenterX(),f.getCenterY()):H.apply(this,arguments)};var S=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(c,f,l,t){if(null==f||null==c||"1"!=f.style.snapToPoint&&"1"!=c.style.snapToPoint)S.apply(this,arguments);else{f=this.getTerminalPort(c,f,t);var q=this.getNextPoint(c,l,t),D=this.graph.isOrthogonal(c),G=mxUtils.toRadians(Number(f.style[mxConstants.STYLE_ROTATION]||-"0")),N=new mxPoint(f.getCenterX(),f.getCenterY());if(0!=G){var L=Math.cos(-G),J=Math.sin(-G);q=mxUtils.getRotatedPoint(q,L,J,N)}L=parseFloat(c.style[mxConstants.STYLE_PERIMETER_SPACING]||0);L+=parseFloat(c.style[t?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);q=this.getPerimeterPoint(f,q,0==G&&D,L);0!=G&&(L=Math.cos(G),J=Math.sin(G),q=mxUtils.getRotatedPoint(q,L,J,N));c.setAbsoluteTerminalPoint(this.snapToAnchorPoint(c,f,l,t,q),t)}};mxGraphView.prototype.snapToAnchorPoint=-function(c,f,l,t,q){if(null!=f&&null!=c){c=this.graph.getAllConnectionConstraints(f);t=l=null;if(null!=c)for(var D=0;D<c.length;D++){var G=this.graph.getConnectionPoint(f,c[D]);if(null!=G){var N=(G.x-q.x)*(G.x-q.x)+(G.y-q.y)*(G.y-q.y);if(null==t||N<t)l=G,t=N}}null!=l&&(q=l)}return q};var F=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(c,f,l){var t=F.apply(this,arguments);"1"==c.getAttribute("placeholders")&&null!=l.state&&(t=l.state.view.graph.replacePlaceholders(l.state.cell,+arguments);else{var t=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,q=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,D=mxUtils.getValue(this.style,"jumpStyle","none"),H=!0,N=null,L=null,J=[],Y=null;c.begin();for(var ha=0;ha<this.state.routedPoints.length;ha++){var ea=this.state.routedPoints[ha],aa=new mxPoint(ea.x/this.scale,ea.y/this.scale);0==ha?aa=f[0]:ha==this.state.routedPoints.length-1&&(aa=f[f.length-1]);var na=+!1;if(null!=N&&1==ea.type){var W=this.state.routedPoints[ha+1];ea=W.x/this.scale-aa.x;W=W.y/this.scale-aa.y;ea=ea*ea+W*W;null==Y&&(Y=new mxPoint(aa.x-N.x,aa.y-N.y),L=Math.sqrt(Y.x*Y.x+Y.y*Y.y),0<L?(Y.x=Y.x*q/L,Y.y=Y.y*q/L):Y=null);ea>q*q&&0<L&&(ea=N.x-aa.x,W=N.y-aa.y,ea=ea*ea+W*W,ea>q*q&&(na=new mxPoint(aa.x-Y.x,aa.y-Y.y),ea=new mxPoint(aa.x+Y.x,aa.y+Y.y),J.push(na),this.addPoints(c,J,l,t,!1,null,H),J=0>Math.round(Y.x)||0==Math.round(Y.x)&&0>=Math.round(Y.y)?1:-1,H=!1,"sharp"==D?(c.lineTo(na.x-Y.y*+J,na.y+Y.x*J),c.lineTo(ea.x-Y.y*J,ea.y+Y.x*J),c.lineTo(ea.x,ea.y)):"line"==D?(c.moveTo(na.x+Y.y*J,na.y-Y.x*J),c.lineTo(na.x-Y.y*J,na.y+Y.x*J),c.moveTo(ea.x-Y.y*J,ea.y+Y.x*J),c.lineTo(ea.x+Y.y*J,ea.y-Y.x*J),c.moveTo(ea.x,ea.y)):"arc"==D?(J*=1.3,c.curveTo(na.x-Y.y*J,na.y+Y.x*J,ea.x-Y.y*J,ea.y+Y.x*J,ea.x,ea.y)):(c.moveTo(ea.x,ea.y),H=!0),J=[ea],na=!0))}else Y=null;na||(J.push(aa),N=aa)}this.addPoints(c,J,l,t,!1,null,H);c.stroke()}};var G=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=+function(c,f,l,t){return null!=f&&"centerPerimeter"==f.style[mxConstants.STYLE_PERIMETER]?new mxPoint(f.getCenterX(),f.getCenterY()):G.apply(this,arguments)};var S=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(c,f,l,t){if(null==f||null==c||"1"!=f.style.snapToPoint&&"1"!=c.style.snapToPoint)S.apply(this,arguments);else{f=this.getTerminalPort(c,f,t);var q=this.getNextPoint(c,l,t),D=this.graph.isOrthogonal(c),H=mxUtils.toRadians(Number(f.style[mxConstants.STYLE_ROTATION]||+"0")),N=new mxPoint(f.getCenterX(),f.getCenterY());if(0!=H){var L=Math.cos(-H),J=Math.sin(-H);q=mxUtils.getRotatedPoint(q,L,J,N)}L=parseFloat(c.style[mxConstants.STYLE_PERIMETER_SPACING]||0);L+=parseFloat(c.style[t?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);q=this.getPerimeterPoint(f,q,0==H&&D,L);0!=H&&(L=Math.cos(H),J=Math.sin(H),q=mxUtils.getRotatedPoint(q,L,J,N));c.setAbsoluteTerminalPoint(this.snapToAnchorPoint(c,f,l,t,q),t)}};mxGraphView.prototype.snapToAnchorPoint=+function(c,f,l,t,q){if(null!=f&&null!=c){c=this.graph.getAllConnectionConstraints(f);t=l=null;if(null!=c)for(var D=0;D<c.length;D++){var H=this.graph.getConnectionPoint(f,c[D]);if(null!=H){var N=(H.x-q.x)*(H.x-q.x)+(H.y-q.y)*(H.y-q.y);if(null==t||N<t)l=H,t=N}}null!=l&&(q=l)}return q};var F=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(c,f,l){var t=F.apply(this,arguments);"1"==c.getAttribute("placeholders")&&null!=l.state&&(t=l.state.view.graph.replacePlaceholders(l.state.cell,t));return t};var K=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(c){if(null!=c.style&&"undefined"!==typeof pako){var f=mxUtils.getValue(c.style,mxConstants.STYLE_SHAPE,null);if(null!=f&&"string"===typeof f&&"stencil("==f.substring(0,8))try{var l=f.substring(8,f.length-1),t=mxUtils.parseXml(Graph.decompress(l));return new mxShape(new mxStencil(t.documentElement))}catch(q){null!=window.console&&console.log("Error in shape: "+q)}}return K.apply(this,arguments)}})();mxStencilRegistry.libraries={};mxStencilRegistry.dynamicLoading=!0;mxStencilRegistry.allowEval=!0;mxStencilRegistry.packages=[];mxStencilRegistry.filesLoaded={};mxStencilRegistry.isFileLoaded=function(b){return!mxClient.IS_FF&&mxStencilRegistry.filesLoaded[b]};mxStencilRegistry.setFileLoaded=function(b){mxStencilRegistry.filesLoaded[b]=!0};mxStencilRegistry.getStencil=function(b){var e=mxStencilRegistry.stencils[b];if(null==e&&null==mxCellRenderer.defaultShapes[b]&&mxStencilRegistry.dynamicLoading){var g=mxStencilRegistry.getBasenameForStencil(b);if(null!=g){e=mxStencilRegistry.libraries[g];if(null!=e){if(null==mxStencilRegistry.packages[g]){for(var m=0;m<e.length;m++){var v=e[m];if(!mxStencilRegistry.isFileLoaded(v))if(mxStencilRegistry.setFileLoaded(v),".xml"==v.toLowerCase().substring(v.length-4,v.length))mxStencilRegistry.loadStencilSet(v,-null);else if(".js"==v.toLowerCase().substring(v.length-3,v.length))try{if(mxStencilRegistry.allowEval){var p=mxUtils.load(v);null!=p&&200<=p.getStatus()&&299>=p.getStatus()&&eval.call(window,p.getText())}}catch(A){null!=window.console&&console.log("error in getStencil:",b,g,e,v,A)}}mxStencilRegistry.packages[g]=1}}else g=g.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+g+".xml",null);e=mxStencilRegistry.stencils[b]}}return e};+null);else if(".js"==v.toLowerCase().substring(v.length-3,v.length))try{if(mxStencilRegistry.allowEval){var n=mxUtils.load(v);null!=n&&200<=n.getStatus()&&299>=n.getStatus()&&eval.call(window,n.getText())}}catch(A){null!=window.console&&console.log("error in getStencil:",b,g,e,v,A)}}mxStencilRegistry.packages[g]=1}}else g=g.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+g+".xml",null);e=mxStencilRegistry.stencils[b]}}return e};mxStencilRegistry.getBasenameForStencil=function(b){var e=null;if(null!=b&&"string"===typeof b&&(b=b.split("."),0<b.length&&"mxgraph"==b[0])){e=b[1];for(var g=2;g<b.length-1;g++)e+="/"+b[g]}return e};-mxStencilRegistry.loadStencilSet=function(b,e,g,m){var v=mxStencilRegistry.packages[b];if(null!=g&&g||null==v){var p=!1;if(null==v)try{if(m){mxStencilRegistry.loadStencil(b,mxUtils.bind(this,function(A){null!=A&&null!=A.documentElement&&(mxStencilRegistry.packages[b]=A,p=!0,mxStencilRegistry.parseStencilSet(A.documentElement,e,p))}));return}v=mxStencilRegistry.loadStencil(b);mxStencilRegistry.packages[b]=v;p=!0}catch(A){null!=window.console&&console.log("error in loadStencilSet:",b,A)}null!=v&&null!=-v.documentElement&&mxStencilRegistry.parseStencilSet(v.documentElement,e,p)}};mxStencilRegistry.loadStencil=function(b,e){if(null!=e)mxUtils.get(b,mxUtils.bind(this,function(g){e(200<=g.getStatus()&&299>=g.getStatus()?g.getXml():null)}),mxUtils.bind(this,function(g){e(null)}));else return mxUtils.load(b).getXml()};mxStencilRegistry.parseStencilSets=function(b){for(var e=0;e<b.length;e++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(b[e]).documentElement)};-mxStencilRegistry.parseStencilSet=function(b,e,g){if("stencils"==b.nodeName)for(var m=b.firstChild;null!=m;)"shapes"==m.nodeName&&mxStencilRegistry.parseStencilSet(m,e,g),m=m.nextSibling;else{g=null!=g?g:!0;m=b.firstChild;var v="";b=b.getAttribute("name");for(null!=b&&(v=b+".");null!=m;){if(m.nodeType==mxConstants.NODETYPE_ELEMENT&&(b=m.getAttribute("name"),null!=b)){v=v.toLowerCase();var p=b.replace(/ /g,"_");g&&mxStencilRegistry.addStencil(v+p.toLowerCase(),new mxStencil(m));if(null!=e){var A=m.getAttribute("w"),-H=m.getAttribute("h");A=null==A?80:parseInt(A,10);H=null==H?80:parseInt(H,10);e(v,p,b,A,H)}}m=m.nextSibling}}};+mxStencilRegistry.loadStencilSet=function(b,e,g,m){var v=mxStencilRegistry.packages[b];if(null!=g&&g||null==v){var n=!1;if(null==v)try{if(m){mxStencilRegistry.loadStencil(b,mxUtils.bind(this,function(A){null!=A&&null!=A.documentElement&&(mxStencilRegistry.packages[b]=A,n=!0,mxStencilRegistry.parseStencilSet(A.documentElement,e,n))}));return}v=mxStencilRegistry.loadStencil(b);mxStencilRegistry.packages[b]=v;n=!0}catch(A){null!=window.console&&console.log("error in loadStencilSet:",b,A)}null!=v&&null!=+v.documentElement&&mxStencilRegistry.parseStencilSet(v.documentElement,e,n)}};mxStencilRegistry.loadStencil=function(b,e){if(null!=e)mxUtils.get(b,mxUtils.bind(this,function(g){e(200<=g.getStatus()&&299>=g.getStatus()?g.getXml():null)}),mxUtils.bind(this,function(g){e(null)}));else return mxUtils.load(b).getXml()};mxStencilRegistry.parseStencilSets=function(b){for(var e=0;e<b.length;e++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(b[e]).documentElement)};+mxStencilRegistry.parseStencilSet=function(b,e,g){if("stencils"==b.nodeName)for(var m=b.firstChild;null!=m;)"shapes"==m.nodeName&&mxStencilRegistry.parseStencilSet(m,e,g),m=m.nextSibling;else{g=null!=g?g:!0;m=b.firstChild;var v="";b=b.getAttribute("name");for(null!=b&&(v=b+".");null!=m;){if(m.nodeType==mxConstants.NODETYPE_ELEMENT&&(b=m.getAttribute("name"),null!=b)){v=v.toLowerCase();var n=b.replace(/ /g,"_");g&&mxStencilRegistry.addStencil(v+n.toLowerCase(),new mxStencil(m));if(null!=e){var A=m.getAttribute("w"),+G=m.getAttribute("h");A=null==A?80:parseInt(A,10);G=null==G?80:parseInt(G,10);e(v,n,b,A,G)}}m=m.nextSibling}}};"undefined"!==typeof mxVertexHandler&&function(){function b(){var y=document.createElement("div");y.className="geHint";y.style.whiteSpace="nowrap";y.style.position="absolute";return y}function e(y,O){switch(O){case mxConstants.POINTS:return y;case mxConstants.MILLIMETERS:return(y/mxConstants.PIXELS_PER_MM).toFixed(1);case mxConstants.METERS:return(y/(1E3*mxConstants.PIXELS_PER_MM)).toFixed(4);case mxConstants.INCHES:return(y/mxConstants.PIXELS_PER_INCH).toFixed(3)}}mxConstants.HANDLE_FILLCOLOR="#29b6f2";mxConstants.HANDLE_STROKECOLOR="#0088cf";mxConstants.VERTEX_SELECTION_COLOR="#00a8ff";mxConstants.OUTLINE_COLOR="#00a8ff";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#99ccff";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#00a8ff";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.EDGE_SELECTION_COLOR="#00a8ff";mxConstants.DEFAULT_VALID_COLOR="#00a8ff";mxConstants.LABEL_HANDLE_FILLCOLOR="#cee7ff";mxConstants.GUIDE_COLOR="#0088cf";mxConstants.HIGHLIGHT_STROKEWIDTH=5;mxConstants.HIGHLIGHT_OPACITY=50;mxConstants.HIGHLIGHT_SIZE=5;mxWindow.prototype.closeImage=Graph.createSvgImage(18,10,'<path d="M 5 1 L 13 9 M 13 1 L 5 9" stroke="#707070" stroke-width="2"/>').src;mxWindow.prototype.minimizeImage=Graph.createSvgImage(14,10,'<path d="M 3 7 L 7 3 L 11 7" stroke="#707070" stroke-width="2" fill="none"/>').src;mxWindow.prototype.normalizeImage=Graph.createSvgImage(14,10,'<path d="M 3 3 L 7 7 L 11 3" stroke="#707070" stroke-width="2" fill="none"/>').src;mxWindow.prototype.resizeImage=Graph.createSvgImage(10,10,'<path d="Z" stroke="#C0C0C0" stroke-width="1" fill="none"/>').src;mxEdgeHandler.prototype.snapToTerminals=!0;mxGraphHandler.prototype.guidesEnabled=!0;mxGraphHandler.prototype.removeEmptyParents=!0;mxRubberband.prototype.fadeOut=!0;mxGuide.prototype.isEnabledForEvent=function(y){return!mxEvent.isAltDown(y)||mxEvent.isShiftDown(y)};var g=mxGraphLayout.prototype.isVertexIgnored;mxGraphLayout.prototype.isVertexIgnored=function(y){return g.apply(this,arguments)||this.graph.isTableRow(y)||this.graph.isTableCell(y)};var m=mxGraphLayout.prototype.isEdgeIgnored;mxGraphLayout.prototype.isEdgeIgnored=function(y){return m.apply(this,arguments)||this.graph.isEdgeIgnored(y)};var v=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(y){return this.graph.isCloneEvent(y)!=v.apply(this,arguments)};mxConstraintHandler.prototype.createHighlightShape=function(){var y=new mxEllipse(null,this.highlightColor,this.highlightColor,0);y.opacity=mxConstants.HIGHLIGHT_OPACITY;return y};mxConnectionHandler.prototype.livePreview=!0;mxConnectionHandler.prototype.cursor="crosshair";mxConnectionHandler.prototype.createEdgeState=function(y){y=this.graph.createCurrentEdgeStyle();y=this.graph.createEdge(null,null,null,null,null,y);y=new mxCellState(this.graph.view,y,this.graph.getCellStyle(y));for(var O in this.graph.currentEdgeStyle)y.style[O]=this.graph.currentEdgeStyle[O];if(null!=this.previous){var R=this.previous.style.newEdgeStyle;if(null!=R)try{var V=JSON.parse(R);for(O in V)y.style[O]=V[O]}catch(fa){}}y.style=this.graph.postProcessCellStyle(y.cell,y.style);return y};-var p=mxConnectionHandler.prototype.createShape;mxConnectionHandler.prototype.createShape=function(){var y=p.apply(this,arguments);y.isDashed="1"==this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED];return y};mxConnectionHandler.prototype.updatePreview=function(y){};var A=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var y=A.apply(this,arguments),O=y.getCell;y.getCell=mxUtils.bind(this,function(R){var V=O.apply(this,arguments);this.error=null;return V});+var n=mxConnectionHandler.prototype.createShape;mxConnectionHandler.prototype.createShape=function(){var y=n.apply(this,arguments);y.isDashed="1"==this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED];return y};mxConnectionHandler.prototype.updatePreview=function(y){};var A=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var y=A.apply(this,arguments),O=y.getCell;y.getCell=mxUtils.bind(this,function(R){var V=O.apply(this,arguments);this.error=null;return V});return y};Graph.prototype.defaultVertexStyle={};Graph.prototype.defaultEdgeStyle={edgeStyle:"orthogonalEdgeStyle",rounded:"0",jettySize:"auto",orthogonalLoop:"1"};Graph.prototype.createCurrentEdgeStyle=function(){for(var y="edgeStyle="+(this.currentEdgeStyle.edgeStyle||"none")+";",O="shape curved rounded comic sketch fillWeight hachureGap hachureAngle jiggle disableMultiStroke disableMultiStrokeFill fillStyle curveFitting simplification comicStyle jumpStyle jumpSize".split(" "),R=0;R<O.length;R++)null!=this.currentEdgeStyle[O[R]]&&(y+=O[R]+"="+this.currentEdgeStyle[O[R]]+";");null!=this.currentEdgeStyle.orthogonalLoop?y+="orthogonalLoop="+this.currentEdgeStyle.orthogonalLoop+";":null!=Graph.prototype.defaultEdgeStyle.orthogonalLoop&&(y+="orthogonalLoop="+Graph.prototype.defaultEdgeStyle.orthogonalLoop+";");null!=this.currentEdgeStyle.jettySize?y+="jettySize="+this.currentEdgeStyle.jettySize+";":null!=Graph.prototype.defaultEdgeStyle.jettySize&&(y+="jettySize="+Graph.prototype.defaultEdgeStyle.jettySize+";");"elbowEdgeStyle"==this.currentEdgeStyle.edgeStyle&&null!=this.currentEdgeStyle.elbow&&(y+="elbow="+this.currentEdgeStyle.elbow+";");return y=null!=this.currentEdgeStyle.html?y+("html="+this.currentEdgeStyle.html+";"):y+"html=1;"};Graph.prototype.getPagePadding=function(){return new mxPoint(0,0)};Graph.prototype.loadStylesheet=function(){var y=null!=this.themes?this.themes[this.defaultThemeName]:mxStyleRegistry.dynamicLoading?mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement():null;null!=@@ -2549,7 +2553,7 @@ y&&(new mxCodec(y.ownerDocument)).decode(y,this.getStylesheet())};Graph.prototypO,R,V){O=null!=O?O:0;R=null!=R?R:0;var fa=new mxCodec(y.ownerDocument),ia=new mxGraphModel;fa.decode(y,ia);y=[];fa={};var oa={},ta=ia.getChildren(this.cloneCell(ia.root,this.isCloneInvalidEdges(),fa));if(null!=ta){var ra=this.createCellLookup([ia.root]);ta=ta.slice();this.model.beginUpdate();try{if(1!=ta.length||this.isCellLocked(this.getDefaultParent()))for(ia=0;ia<ta.length;ia++)xa=this.model.getChildren(this.moveCells([ta[ia]],O,R,!1,this.model.getRoot())[0]),null!=xa&&(y=y.concat(xa));else{var xa=ia.getChildren(ta[0]);null!=xa&&(y=this.moveCells(xa,O,R,!1,this.getDefaultParent()),oa[ia.getChildAt(ia.root,0).getId()]=this.getDefaultParent().getId())}if(null!=y&&(this.createCellMapping(fa,ra,oa),this.updateCustomLinks(oa,y),V)){this.isGridEnabled()&&(O=this.snap(O),R=this.snap(R));var Da=this.getBoundingBoxFromGeometry(y,!0);null!=Da&&this.moveCells(y,O-Da.x,R-Da.y)}}finally{this.model.endUpdate()}}return y};Graph.prototype.encodeCells=function(y){for(var O={},R=this.cloneCells(y,null,O),V=new mxDictionary,fa=0;fa<y.length;fa++)V.put(y[fa],!0);var ia=new mxCodec,oa=new mxGraphModel,ta=oa.getChildAt(oa.getRoot(),0);for(fa=0;fa<R.length;fa++){oa.add(ta,R[fa]);var ra=this.view.getState(y[fa]);if(null!=ra){var xa=this.getCellGeometry(R[fa]);null!=xa&&xa.relative&&!this.model.isEdge(y[fa])&&null==V.get(this.model.getParent(y[fa]))&&(xa.offset=null,xa.relative=!1,xa.x=ra.x/ra.view.scale-ra.view.translate.x,xa.y=ra.y/ra.view.scale-ra.view.translate.y)}}this.updateCustomLinks(this.createCellMapping(O,-this.createCellLookup(y)),R);return ia.encode(oa)};Graph.prototype.isSwimlane=function(y,O){var R=null;null==y||this.model.isEdge(y)||this.model.getParent(y)==this.model.getRoot()||(R=this.getCurrentCellStyle(y,O)[mxConstants.STYLE_SHAPE]);return R==mxConstants.SHAPE_SWIMLANE||"table"==R||"tableRow"==R};var H=Graph.prototype.isCellEditable;Graph.prototype.isCellEditable=function(y){return null!=y&&H.apply(this,arguments)?this.isTableCell(y)||this.isTableRow(y)?this.isCellEditable(this.model.getParent(y)):+this.createCellLookup(y)),R);return ia.encode(oa)};Graph.prototype.isSwimlane=function(y,O){var R=null;null==y||this.model.isEdge(y)||this.model.getParent(y)==this.model.getRoot()||(R=this.getCurrentCellStyle(y,O)[mxConstants.STYLE_SHAPE]);return R==mxConstants.SHAPE_SWIMLANE||"table"==R||"tableRow"==R};var G=Graph.prototype.isCellEditable;Graph.prototype.isCellEditable=function(y){return null!=y&&G.apply(this,arguments)?this.isTableCell(y)||this.isTableRow(y)?this.isCellEditable(this.model.getParent(y)):!0:!1};var S=Graph.prototype.isCellMovable;Graph.prototype.isCellMovable=function(y){return null!=y&&S.apply(this,arguments)?this.isTableCell(y)||this.isTableRow(y)?this.isCellMovable(this.model.getParent(y)):!0:!1};var F=Graph.prototype.isExtendParent;Graph.prototype.isExtendParent=function(y){var O=this.model.getParent(y);if(null!=O){var R=this.getCurrentCellStyle(O);if(null!=R.expand)return"0"!=R.expand}return F.apply(this,arguments)&&(null==O||!this.isTable(O))};var K=Graph.prototype.splitEdge;Graph.prototype.splitEdge=function(y,O,R,V,fa,ia,oa,ta){null==ta&&(ta=this.model.getParent(y),this.isTable(ta)||this.isTableRow(ta))&&(ta=this.getCellAt(ia,oa,null,!0,!1));R=null;this.model.beginUpdate();try{R=K.apply(this,[y,O,R,V,fa,ia,oa,ta]);this.model.setValue(R,"");var ra=this.getChildCells(R,!0);for(O=0;O<ra.length;O++){var xa=this.getCellGeometry(ra[O]);null!=xa&&xa.relative&&0<xa.x&&this.model.remove(ra[O])}var Da=this.getChildCells(y,!0);for(O=0;O<Da.length;O++)xa=this.getCellGeometry(Da[O]),null!=xa&&xa.relative&&0>=xa.x&&this.model.remove(Da[O]);var Ia=this.model.getTerminal(R,!1);if(null!=Ia){var Xa=this.getCurrentCellStyle(Ia);null!=Xa&&"1"==Xa.snapToPoint&&(this.setCellStyles(mxConstants.STYLE_EXIT_X,null,[y]),this.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[y]),this.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[R]),this.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[R]))}}finally{this.model.endUpdate()}return R};var c=Graph.prototype.selectCell;Graph.prototype.selectCell=function(y,@@ -2605,7 +2609,7 @@ null!=oa.createElementNS?oa.createElementNS(mxConstants.NS_SVG,"g"):oa.createEley.width,y.height));return O};Graph.prototype.getBackgroundImageObject=function(y){return y};Graph.prototype.getSvg=function(y,O,R,V,fa,ia,oa,ta,ra,xa,Da,Ia,Xa,Za,$a,Pa){var Na=null;if(null!=Za)for(Na=new mxDictionary,Da=0;Da<Za.length;Da++)Na.put(Za[Da],!0);Za=this.useCssTransforms;var jb=this.enableFlowAnimation;this.enableFlowAnimation=!1;Za&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{O=null!=O?O:1;R=null!=R?R:0;fa=null!=fa?fa:!0;ia=null!=ia?ia:!0;oa=null!=oa?oa:!0;xa=null!=xa?xa:!1;var cb="page"==Xa?this.view.getBackgroundPageBounds():ia&&null==Na||V||"diagram"==Xa?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells()),ab=this.backgroundImage,db=this.view.translate,lb=this.view.scale;"diagram"==Xa&&null!=ab&&null!=ab.width&&null!=ab.height&&(cb=mxRectangle.fromRectangle(cb),cb.add(new mxRectangle((db.x+ab.x)*lb,(db.y+ab.y)*lb,ab.width*lb,ab.height*lb)));if(null==cb)throw Error(mxResources.get("drawingEmpty"));V=O/lb;var kb=Math.max(1,Math.ceil(cb.width*V)+2*R)+(xa&&0==R?5:0),pb=Math.max(1,Math.ceil(cb.height*V)+2*R)+(xa&&0==R?5:0);xa=fa?-.5:0;var fb=mxUtils.getLightDarkColor(y),ob=Graph.createSvgNode(xa,xa,kb,pb,fb),tb=ob.ownerDocument;if(null!=y){var eb=mxUtils.createElementNs(tb,mxConstants.NS_SVG,"rect");eb.setAttribute("fill",fb.light);eb.style.fill=fb.cssText;eb.setAttribute("width","100%");eb.setAttribute("height","100%");eb.setAttribute("x","0");eb.setAttribute("y","0");ob.appendChild(eb)}var nb=mxUtils.createElementNs(tb,mxConstants.NS_SVG,-"g");ob.appendChild(nb);var mb=this.createSvgCanvas(nb);mb.foOffset=fa?-.5:0;mb.textOffset=fa?-.5:0;mb.imageOffset=fa?-.5:0;mb.translate(Math.floor(R/O-cb.x/lb),Math.floor(R/O-cb.y/lb));mb.idPrefix="drawio-svg-"+Editor.guid();var qb=document.createElement("div"),ub=mb.getAlternateText;mb.getAlternateText=function(hb,Ab,sb,wb,yb,rb,Bb,d,n,z,u,x,C){if(null!=rb&&0<this.state.fontSize)try{mxUtils.isNode(rb)?rb=rb.innerText:(qb.innerHTML=rb,rb=mxUtils.extractTextWithWhitespace(qb.childNodes));for(var E=+"g");ob.appendChild(nb);var mb=this.createSvgCanvas(nb);mb.foOffset=fa?-.5:0;mb.textOffset=fa?-.5:0;mb.imageOffset=fa?-.5:0;mb.translate(Math.floor(R/O-cb.x/lb),Math.floor(R/O-cb.y/lb));mb.idPrefix="drawio-svg-"+Editor.guid();var qb=document.createElement("div"),ub=mb.getAlternateText;mb.getAlternateText=function(hb,Ab,sb,wb,yb,rb,Bb,d,p,z,u,x,C){if(null!=rb&&0<this.state.fontSize)try{mxUtils.isNode(rb)?rb=rb.innerText:(qb.innerHTML=rb,rb=mxUtils.extractTextWithWhitespace(qb.childNodes));for(var E=Math.ceil(2*wb/this.state.fontSize),da=[],M=0,sa=0;(0==E||M<E)&&sa<rb.length;){var ma=rb.charCodeAt(sa);if(10==ma||13==ma){if(0<M)break}else da.push(rb.charAt(sa)),255>ma&&M++;sa++}da.length<rb.length&&1<rb.length-da.length&&(rb=mxUtils.trim(da.join(""))+"...");return rb}catch(Wa){return ub.apply(this,arguments)}else return ub.apply(this,arguments)};null!=ab&&null!=ab.width&&null!=ab.height&&(y=lb/O,xa=new mxRectangle((ab.x+db.x)*y,(ab.y+db.y)*y,ab.width*y,ab.height*y),mxUtils.intersects(cb,xa)&&mb.image(ab.x+db.x,ab.y+db.y,ab.width,ab.height,ab.src,!0));mb.scale(V);mb.textEnabled=oa;ta=null!=ta?ta:this.createSvgImageExport();var zb=ta.getLinkForCellState;ta.getLinkForCellState=function(hb,Ab){var sb=hb.view.graph.getAbsoluteUrl(zb.apply(this,arguments));return null==sb||hb.view.graph.isCustomLink(sb)?null:sb};ta.getLinkTargetForCellState=function(hb,Ab){return hb.view.graph.getLinkTargetForCell(hb.cell)};var Cb=ta.drawCellState,xb=null,vb=mxUtils.bind(this,function(){if(null==xb){xb="ge-flow-animation-"+Editor.guid();var hb=null!=tb.createElementNS?tb.createElementNS(mxConstants.NS_SVG,"style"):tb.createElement("style");hb.innerHTML=this.createFlowAnimationCss(xb);tb.getElementsByTagName("defs")[0].appendChild(hb)}return xb});ta.drawCellState=function(hb,Ab){for(var sb=hb.view.graph,wb=null!=Na?Na.get(hb.cell):sb.isCellSelected(hb.cell),yb=sb.model.getParent(hb.cell);!(ia&&null==Na||wb)&&null!=yb;)wb=null!=Na?Na.get(yb):sb.isCellSelected(yb),yb=sb.model.getParent(yb);if(null!=hb.shape)try{var rb=@@ -2638,7 +2642,7 @@ this.popupMenuHandler.popup(oa.getX()+xa.x+1,oa.getY()+xa.y+1,ra,oa.getEvent())}"";window.getSelection?y=window.getSelection():document.getSelection?y=document.getSelection():document.selection&&(y=document.selection.createRange().text);return""!=y};mxCellEditor.prototype.insertTab=function(y){var O=this.textarea.ownerDocument.defaultView.getSelection(),R=O.getRangeAt(0);y=Graph.createTabNode(y);R.insertNode(y);R.setStartAfter(y);R.setEndAfter(y);O.removeAllRanges();O.addRange(R)};mxCellEditor.prototype.alignText=function(y,O){var R=this.graph.getView().getState(this.editingCell);if(null!=R){R=mxUtils.getValue(R.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);var V=null!=R&&"vertical-"==R.substring(0,9),fa=null!=O&&mxEvent.isShiftDown(O);if(fa||null!=window.getSelection&&null!=window.getSelection().containsNode){var ia=!0;this.graph.processElements(this.textarea,function(oa){fa||V||window.getSelection().containsNode(oa,!0)?(oa.removeAttribute("align"),oa.style.textAlign=null):ia=!1});(ia||V)&&this.graph.cellEditor.setAlign(y)}V||document.execCommand("justify"+y.toLowerCase(),!1,null)}};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){var y=window.getSelection();if(y.getRangeAt&&y.rangeCount){for(var O=[],R=0,V=y.rangeCount;R<V;++R)O.push(y.getRangeAt(R));return O}}else if(document.selection&&document.selection.createRange)return document.selection.createRange();return null};mxCellEditor.prototype.restoreSelection=function(y){try{if(y)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var O=0,R=y.length;O<-R;++O)sel.addRange(y[O])}else document.selection&&y.select&&y.select()}catch(V){}};var D=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(y){null!=y.text&&(y.text.replaceLinefeeds="0"!=mxUtils.getValue(y.style,"nl2Br","1"));D.apply(this,arguments)};var G=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(y,O){this.isKeepFocusEvent(y)||!mxEvent.isAltDown(y.getEvent())?G.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=+R;++O)sel.addRange(y[O])}else document.selection&&y.select&&y.select()}catch(V){}};var D=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(y){null!=y.text&&(y.text.replaceLinefeeds="0"!=mxUtils.getValue(y.style,"nl2Br","1"));D.apply(this,arguments)};var H=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(y,O){this.isKeepFocusEvent(y)||!mxEvent.isAltDown(y.getEvent())?H.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(y){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing=!1;var N=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(y,O){y=this.graph.getStartEditingCell(y,O);N.apply(this,arguments);var R=this.graph.view.getState(y);this.textarea.className=null!=R&&1==R.style.html?"mxCellEditor geContentEditable":"mxCellEditor mxPlainTextEditor";this.textarea.style.colorScheme="none"==this.graph.getAdaptiveColors()?"light":"";this.codeViewMode=!1;this.switchSelectionState=null;this.graph.setSelectionCell(y)};mxCellEditor.prototype.toggleViewMode=function(){var y=this.graph.view.getState(this.editingCell);if(null!=y){var O=null!=y&&"0"!=mxUtils.getValue(y.style,"nl2Br","1"),R=this.saveSelection();if(this.codeViewMode){Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);ta=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<ta.length&&"\n"==ta.charAt(ta.length-1)&&(ta=ta.substring(0,ta.length-1));ta=Graph.sanitizeHtml(O?ta.replace(/\n/g,"<br/>"):ta,!0);this.textarea.className="mxCellEditor geContentEditable";ra=mxUtils.getValue(y.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);O=mxUtils.getValue(y.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);var V=mxUtils.getValue(y.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),fa=(mxUtils.getValue(y.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,ia=(mxUtils.getValue(y.style,@@ -2727,249 +2731,249 @@ mxResources.get("rotateTooltip")),this.rotationShape.node.style.display=null!=ththis.state.style[mxConstants.STYLE_ROTATION]||"0"):this.state,O=null!=this.state.text?this.state.text.boundingBox:null,null==R&&(R=this.state),R=R.y+R.height,null!=O&&(R=Math.max(R,O.y+O.height)),this.linkHint.style.left=y.x+y.width/2+"px",this.linkHint.style.top=Math.round(R+this.verticalOffset/2+Editor.hintOffset)+"px",this.linkHint.style.display=1<this.graph.getSelectionCount()?"none":"")};var Ra=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(){Ra.apply(this,arguments);this.destroyMoveHandles();this.destroyCornerHandles();null!=this.linkHint&&(null!=this.linkHint.parentNode&&this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getSelectionModel().removeListener(this.changeHandler),this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null);null!=this.editingHandler&&(this.graph.removeListener(this.editingHandler),this.editingHandler=null)};var Sa=mxEdgeHandler.prototype.redrawHandles;mxEdgeHandler.prototype.redrawHandles=function(){if(null!=this.marker&&(Sa.apply(this),null!=this.state&&null!=this.linkHint)){var y=this.state;null!=this.state.text&&null!=this.state.text.bounds&&(y=new mxRectangle(y.x,y.y,y.width,y.height),y.add(this.state.text.bounds));this.linkHint.style.left=y.x+y.width/2+"px";this.linkHint.style.top=Math.round(y.y+y.height+Editor.hintOffset)+"px";this.linkHint.style.display=1<this.graph.getSelectionCount()?"none":""}};var Ha=mxEdgeHandler.prototype.reset;mxEdgeHandler.prototype.reset=-function(){Ha.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var Ma=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){Ma.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getSelectionModel().removeListener(this.changeHandler),this.changeHandler=null)}}();(function(){function b(d,n,z){mxShape.call(this);this.line=d;this.stroke=n;this.strokewidth=null!=z?z:1;this.updateBoundsFromLine()}function e(){mxSwimlane.call(this)}function g(){mxSwimlane.call(this)}function m(){mxCylinder.call(this)}function v(){mxConnector.call(this)}function p(){mxCylinder.call(this)}function A(){mxActor.call(this)}function H(){mxCylinder.call(this)}function S(){mxCylinder.call(this)}function F(){mxCylinder.call(this)}function K(){mxCylinder.call(this)}function c(){mxShape.call(this)}-function f(){mxShape.call(this)}function l(d,n,z,u){mxShape.call(this);this.bounds=d;this.fill=n;this.stroke=z;this.strokewidth=null!=u?u:1}function t(){mxActor.call(this)}function q(){mxCylinder.call(this)}function D(){mxCylinder.call(this)}function G(){mxActor.call(this)}function N(){mxActor.call(this)}function L(){mxActor.call(this)}function J(){mxActor.call(this)}function Y(){mxActor.call(this)}function ha(){mxActor.call(this)}function ea(){mxActor.call(this)}function aa(d,n){this.canvas=d;this.canvas.setLineJoin("round");-this.canvas.setLineCap("round");this.defaultVariation=n;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,aa.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,aa.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,aa.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,aa.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=+function(){Ha.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var Ma=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){Ma.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getSelectionModel().removeListener(this.changeHandler),this.changeHandler=null)}}();(function(){function b(d,p,z){mxShape.call(this);this.line=d;this.stroke=p;this.strokewidth=null!=z?z:1;this.updateBoundsFromLine()}function e(){mxSwimlane.call(this)}function g(){mxSwimlane.call(this)}function m(){mxCylinder.call(this)}function v(){mxConnector.call(this)}function n(){mxCylinder.call(this)}function A(){mxActor.call(this)}function G(){mxCylinder.call(this)}function S(){mxCylinder.call(this)}function F(){mxCylinder.call(this)}function K(){mxCylinder.call(this)}function c(){mxShape.call(this)}+function f(){mxShape.call(this)}function l(d,p,z,u){mxShape.call(this);this.bounds=d;this.fill=p;this.stroke=z;this.strokewidth=null!=u?u:1}function t(){mxActor.call(this)}function q(){mxCylinder.call(this)}function D(){mxCylinder.call(this)}function H(){mxActor.call(this)}function N(){mxActor.call(this)}function L(){mxActor.call(this)}function J(){mxActor.call(this)}function Y(){mxActor.call(this)}function ha(){mxActor.call(this)}function ea(){mxActor.call(this)}function aa(d,p){this.canvas=d;this.canvas.setLineJoin("round");+this.canvas.setLineCap("round");this.defaultVariation=p;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,aa.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,aa.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,aa.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,aa.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,aa.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,aa.prototype.arcTo)}function na(){mxRectangleShape.call(this)}function W(){mxRectangleShape.call(this)}function ba(){mxActor.call(this)}function ja(){mxActor.call(this)}function ca(){mxActor.call(this)}function la(){mxRectangleShape.call(this)}function Q(){mxRectangleShape.call(this)}function k(){mxCylinder.call(this)}function B(){mxShape.call(this)}function I(){mxShape.call(this)}function U(){mxEllipse.call(this)}function P(){mxShape.call(this)}function T(){mxShape.call(this)}function X(){mxRectangleShape.call(this)}function Z(){mxShape.call(this)}function ka(){mxShape.call(this)}function va(){mxShape.call(this)}function ua(){mxShape.call(this)}function qa(){mxShape.call(this)}function Ba(){mxCylinder.call(this)}function ya(){mxCylinder.call(this)}function La(){mxRectangleShape.call(this)}function za(){mxDoubleEllipse.call(this)}function Ea(){mxDoubleEllipse.call(this)}function pa(){mxArrowConnector.call(this);this.spacing=0}function Ca(){mxArrowConnector.call(this);this.spacing=0}function Aa(){mxActor.call(this)}function wa(){mxRectangleShape.call(this)}function Ya(){mxActor.call(this)}function Qa(){mxActor.call(this)}function Ra(){mxActor.call(this)}function Sa(){mxActor.call(this)}function Ha(){mxActor.call(this)}function Ma(){mxActor.call(this)}function y(){mxActor.call(this)}function O(){mxActor.call(this)}function R(){mxActor.call(this)}function V(){mxActor.call(this)}function fa(){mxEllipse.call(this)}-function ia(){mxEllipse.call(this)}function oa(){mxEllipse.call(this)}function ta(){mxRhombus.call(this)}function ra(){mxEllipse.call(this)}function xa(){mxEllipse.call(this)}function Da(){mxEllipse.call(this)}function Ia(){mxEllipse.call(this)}function Xa(){mxActor.call(this)}function Za(){mxActor.call(this)}function $a(){mxActor.call(this)}function Pa(d,n,z,u){mxShape.call(this);this.bounds=d;this.fill=n;this.stroke=z;this.strokewidth=null!=u?u:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=-!0;this.indent=2;this.rectOutline="single"}function Na(){mxConnector.call(this)}function jb(d,n,z,u,x,C,E,da,M,sa){E+=M;var ma=u.clone();u.x-=x*(2*E+M);u.y-=C*(2*E+M);x*=E+M;C*=E+M;return function(){d.ellipse(ma.x-x-E,ma.y-C-E,2*E,2*E);sa?d.fillAndStroke():d.stroke()}}mxUtils.extend(b,mxShape);b.prototype.updateBoundsFromLine=function(){var d=null;if(null!=this.line)for(var n=0;n<this.line.length;n++){var z=this.line[n];null!=z&&(z=new mxRectangle(z.x,z.y,this.strokewidth,this.strokewidth),null==-d?d=z:d.add(z))}this.bounds=null!=d?d:new mxRectangle};b.prototype.paintVertexShape=function(d,n,z,u,x){this.paintTableLine(d,this.line,0,0)};b.prototype.paintTableLine=function(d,n,z,u){if(null!=n){var x=null;d.begin();for(var C=0;C<n.length;C++){var E=n[C];null!=E&&(null==x?d.moveTo(E.x+z,E.y+u):null!=x&&d.lineTo(E.x+z,E.y+u));x=E}d.end();d.stroke()}};b.prototype.intersectsRectangle=function(d){var n=!1;if(mxShape.prototype.intersectsRectangle.apply(this,arguments)&&null!=this.line)for(var z=null,-u=0;u<this.line.length&&!n;u++){var x=this.line[u];null!=x&&null!=z&&(n=mxUtils.rectangleIntersectsSegment(d,z,x));z=x}return n};mxCellRenderer.registerShape("tableLine",b);mxUtils.extend(e,mxSwimlane);e.prototype.getLabelBounds=function(d){return 0==this.getTitleSize()?mxShape.prototype.getLabelBounds.apply(this,arguments):mxSwimlane.prototype.getLabelBounds.apply(this,arguments)};e.prototype.paintVertexShape=function(d,n,z,u,x){var C=null!=this.state?this.state.view.graph.isCellCollapsed(this.state.cell):-!1,E=this.isHorizontal(),da=this.getTitleSize();0==da||this.outline?Da.prototype.paintVertexShape.apply(this,arguments):(mxSwimlane.prototype.paintVertexShape.apply(this,arguments),d.translate(-n,-z));C||this.outline||!(E&&da<x||!E&&da<u)||this.paintForeground(d,n,z,u,x)};e.prototype.paintForeground=function(d,n,z,u,x){if(null!=this.state){var C=this.flipH,E=this.flipV;if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH){var da=C;C=E;E=da}d.rotate(-this.getShapeRotation(),-C,E,n+u/2,z+x/2);s=this.scale;n=this.bounds.x/s;z=this.bounds.y/s;u=this.bounds.width/s;x=this.bounds.height/s;this.paintTableForeground(d,n,z,u,x)}};e.prototype.paintTableForeground=function(d,n,z,u,x){u=this.state.view.graph.getTableLines(this.state.cell,"0"!=mxUtils.getValue(this.state.style,"rowLines","1"),"0"!=mxUtils.getValue(this.state.style,"columnLines","1"));for(x=0;x<u.length;x++)b.prototype.paintTableLine(d,u[x],n,z)};e.prototype.configurePointerEvents=function(d){0==this.getTitleSize()?-d.pointerEvents=!1:mxSwimlane.prototype.configurePointerEvents.apply(this,arguments)};mxCellRenderer.registerShape("table",e);mxUtils.extend(g,e);g.prototype.paintForeground=function(){};mxCellRenderer.registerShape("tableRow",g);mxUtils.extend(m,mxCylinder);m.prototype.size=20;m.prototype.darkOpacity=0;m.prototype.darkOpacity2=0;m.prototype.paintVertexShape=function(d,n,z,u,x){var C=Math.max(0,Math.min(u,Math.min(x,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),E=Math.max(-1,Math.min(1,-parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity)))),da=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity2",this.darkOpacity2))));d.translate(n,z);d.begin();d.moveTo(0,0);d.lineTo(u-C,0);d.lineTo(u,C);d.lineTo(u,x);d.lineTo(C,x);d.lineTo(0,x-C);d.lineTo(0,0);d.close();d.end();d.fillAndStroke();this.outline||(d.setShadow(!1),0!=E&&(d.setFillAlpha(Math.abs(E)),d.setFillColor(0>E?"#FFFFFF":"#000000"),d.begin(),d.moveTo(0,0),d.lineTo(u-C,0),d.lineTo(u,C),+function ia(){mxEllipse.call(this)}function oa(){mxEllipse.call(this)}function ta(){mxRhombus.call(this)}function ra(){mxEllipse.call(this)}function xa(){mxEllipse.call(this)}function Da(){mxEllipse.call(this)}function Ia(){mxEllipse.call(this)}function Xa(){mxActor.call(this)}function Za(){mxActor.call(this)}function $a(){mxActor.call(this)}function Pa(d,p,z,u){mxShape.call(this);this.bounds=d;this.fill=p;this.stroke=z;this.strokewidth=null!=u?u:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=+!0;this.indent=2;this.rectOutline="single"}function Na(){mxConnector.call(this)}function jb(d,p,z,u,x,C,E,da,M,sa){E+=M;var ma=u.clone();u.x-=x*(2*E+M);u.y-=C*(2*E+M);x*=E+M;C*=E+M;return function(){d.ellipse(ma.x-x-E,ma.y-C-E,2*E,2*E);sa?d.fillAndStroke():d.stroke()}}mxUtils.extend(b,mxShape);b.prototype.updateBoundsFromLine=function(){var d=null;if(null!=this.line)for(var p=0;p<this.line.length;p++){var z=this.line[p];null!=z&&(z=new mxRectangle(z.x,z.y,this.strokewidth,this.strokewidth),null==+d?d=z:d.add(z))}this.bounds=null!=d?d:new mxRectangle};b.prototype.paintVertexShape=function(d,p,z,u,x){this.paintTableLine(d,this.line,0,0)};b.prototype.paintTableLine=function(d,p,z,u){if(null!=p){var x=null;d.begin();for(var C=0;C<p.length;C++){var E=p[C];null!=E&&(null==x?d.moveTo(E.x+z,E.y+u):null!=x&&d.lineTo(E.x+z,E.y+u));x=E}d.end();d.stroke()}};b.prototype.intersectsRectangle=function(d){var p=!1;if(mxShape.prototype.intersectsRectangle.apply(this,arguments)&&null!=this.line)for(var z=null,+u=0;u<this.line.length&&!p;u++){var x=this.line[u];null!=x&&null!=z&&(p=mxUtils.rectangleIntersectsSegment(d,z,x));z=x}return p};mxCellRenderer.registerShape("tableLine",b);mxUtils.extend(e,mxSwimlane);e.prototype.getLabelBounds=function(d){return 0==this.getTitleSize()?mxShape.prototype.getLabelBounds.apply(this,arguments):mxSwimlane.prototype.getLabelBounds.apply(this,arguments)};e.prototype.paintVertexShape=function(d,p,z,u,x){var C=null!=this.state?this.state.view.graph.isCellCollapsed(this.state.cell):+!1,E=this.isHorizontal(),da=this.getTitleSize();0==da||this.outline?Da.prototype.paintVertexShape.apply(this,arguments):(mxSwimlane.prototype.paintVertexShape.apply(this,arguments),d.translate(-p,-z));C||this.outline||!(E&&da<x||!E&&da<u)||this.paintForeground(d,p,z,u,x)};e.prototype.paintForeground=function(d,p,z,u,x){if(null!=this.state){var C=this.flipH,E=this.flipV;if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH){var da=C;C=E;E=da}d.rotate(-this.getShapeRotation(),+C,E,p+u/2,z+x/2);s=this.scale;p=this.bounds.x/s;z=this.bounds.y/s;u=this.bounds.width/s;x=this.bounds.height/s;this.paintTableForeground(d,p,z,u,x)}};e.prototype.paintTableForeground=function(d,p,z,u,x){u=this.state.view.graph.getTableLines(this.state.cell,"0"!=mxUtils.getValue(this.state.style,"rowLines","1"),"0"!=mxUtils.getValue(this.state.style,"columnLines","1"));for(x=0;x<u.length;x++)b.prototype.paintTableLine(d,u[x],p,z)};e.prototype.configurePointerEvents=function(d){0==this.getTitleSize()?+d.pointerEvents=!1:mxSwimlane.prototype.configurePointerEvents.apply(this,arguments)};mxCellRenderer.registerShape("table",e);mxUtils.extend(g,e);g.prototype.paintForeground=function(){};mxCellRenderer.registerShape("tableRow",g);mxUtils.extend(m,mxCylinder);m.prototype.size=20;m.prototype.darkOpacity=0;m.prototype.darkOpacity2=0;m.prototype.paintVertexShape=function(d,p,z,u,x){var C=Math.max(0,Math.min(u,Math.min(x,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),E=Math.max(-1,Math.min(1,+parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity)))),da=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity2",this.darkOpacity2))));d.translate(p,z);d.begin();d.moveTo(0,0);d.lineTo(u-C,0);d.lineTo(u,C);d.lineTo(u,x);d.lineTo(C,x);d.lineTo(0,x-C);d.lineTo(0,0);d.close();d.end();d.fillAndStroke();this.outline||(d.setShadow(!1),0!=E&&(d.setFillAlpha(Math.abs(E)),d.setFillColor(0>E?"#FFFFFF":"#000000"),d.begin(),d.moveTo(0,0),d.lineTo(u-C,0),d.lineTo(u,C),d.lineTo(C,C),d.close(),d.fill()),0!=da&&(d.setFillAlpha(Math.abs(da)),d.setFillColor(0>da?"#FFFFFF":"#000000"),d.begin(),d.moveTo(0,0),d.lineTo(C,C),d.lineTo(C,x),d.lineTo(0,x-C),d.close(),d.fill()),d.begin(),d.moveTo(C,x),d.lineTo(C,C),d.lineTo(0,0),d.moveTo(C,C),d.lineTo(u,C),d.end(),d.stroke())};m.prototype.getLabelMargins=function(d){return mxUtils.getValue(this.style,"boundedLbl",!1)?(d=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(d,d,0,0)):null};mxCellRenderer.registerShape("cube",-m);var cb=Math.tan(mxUtils.toRadians(30)),ab=(.5-cb)/2;mxCellRenderer.registerShape("isoRectangle",A);mxUtils.extend(v,mxConnector);v.prototype.paintEdgeShape=function(d,n){var z=this.createMarker(d,n,!0),u=this.createMarker(d,n,!1);d.setDashed(!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);null!=this.isDashed&&d.setDashed(this.isDashed,null!=this.style?1==mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,!1):!1);d.setShadow(!1);d.setStrokeColor(this.fill);mxPolyline.prototype.paintEdgeShape.apply(this,-arguments);d.setStrokeColor(this.stroke);d.setFillColor(this.stroke);d.setDashed(!1);null!=z&&z();null!=u&&u()};mxCellRenderer.registerShape("wire",v);mxUtils.extend(p,mxCylinder);p.prototype.size=6;p.prototype.paintVertexShape=function(d,n,z,u,x){d.setFillColor(this.stroke);var C=Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size))-2)+2*this.strokewidth;d.ellipse(n+.5*(u-C),z+.5*(x-C),C,C);d.fill();d.setFillColor(mxConstants.NONE);d.rect(n,z,u,x);d.fill()};mxCellRenderer.registerShape("waypoint",-p);mxUtils.extend(A,mxActor);A.prototype.size=20;A.prototype.redrawPath=function(d,n,z,u,x){n=Math.min(u,x/cb);d.translate((u-n)/2,(x-n)/2+n/4);d.moveTo(0,.25*n);d.lineTo(.5*n,n*ab);d.lineTo(n,.25*n);d.lineTo(.5*n,(.5-ab)*n);d.lineTo(0,.25*n);d.close();d.end()};mxCellRenderer.registerShape("isoRectangle",A);mxUtils.extend(H,mxCylinder);H.prototype.size=20;H.prototype.redrawPath=function(d,n,z,u,x,C){n=Math.min(u,x/(.5+cb));C?(d.moveTo(0,.25*n),d.lineTo(.5*n,(.5-ab)*n),d.lineTo(n,.25*n),d.moveTo(.5*-n,(.5-ab)*n),d.lineTo(.5*n,(1-ab)*n)):(d.translate((u-n)/2,(x-n)/2),d.moveTo(0,.25*n),d.lineTo(.5*n,n*ab),d.lineTo(n,.25*n),d.lineTo(n,.75*n),d.lineTo(.5*n,(1-ab)*n),d.lineTo(0,.75*n),d.close());d.end()};mxCellRenderer.registerShape("isoCube",H);mxUtils.extend(S,mxCylinder);S.prototype.redrawPath=function(d,n,z,u,x,C){n=Math.min(x/2,Math.round(x/8)+this.strokewidth-1);if(C&&null!=this.fill||!C&&null==this.fill)d.moveTo(0,n),d.curveTo(0,2*n,u,2*n,u,n),C||(d.stroke(),d.begin()),d.translate(0,n/2),d.moveTo(0,-n),d.curveTo(0,2*n,u,2*n,u,n),C||(d.stroke(),d.begin()),d.translate(0,n/2),d.moveTo(0,n),d.curveTo(0,2*n,u,2*n,u,n),C||(d.stroke(),d.begin()),d.translate(0,-n);C||(d.moveTo(0,n),d.curveTo(0,-n/3,u,-n/3,u,n),d.lineTo(u,x-n),d.curveTo(u,x+n/3,0,x+n/3,0,x-n),d.close())};S.prototype.getLabelMargins=function(d){return new mxRectangle(0,2.5*Math.min(d.height/2,Math.round(d.height/8)+this.strokewidth-1),0,0)};mxCellRenderer.registerShape("datastore",S);mxUtils.extend(F,mxCylinder);F.prototype.size=30;F.prototype.darkOpacity=-0;F.prototype.paintVertexShape=function(d,n,z,u,x){var C=Math.max(0,Math.min(u,Math.min(x,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),E=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity))));d.translate(n,z);d.begin();d.moveTo(0,0);d.lineTo(u-C,0);d.lineTo(u,C);d.lineTo(u,x);d.lineTo(0,x);d.lineTo(0,0);d.close();d.end();d.fillAndStroke();this.outline||(d.setShadow(!1),0!=E&&(d.setFillAlpha(Math.abs(E)),d.setFillColor(0>E?"#FFFFFF":"#000000"),-d.begin(),d.moveTo(u-C,0),d.lineTo(u-C,C),d.lineTo(u,C),d.close(),d.fill()),d.begin(),d.moveTo(u-C,0),d.lineTo(u-C,C),d.lineTo(u,C),d.end(),d.stroke())};mxCellRenderer.registerShape("note",F);mxUtils.extend(K,F);mxCellRenderer.registerShape("note2",K);K.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(d.height*this.scale,n*this.scale),0,0)}return null};mxUtils.extend(c,mxShape);c.prototype.isoAngle=-15;c.prototype.paintVertexShape=function(d,n,z,u,x){var C=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;C=Math.min(u*Math.tan(C),.5*x);d.translate(n,z);d.begin();d.moveTo(.5*u,0);d.lineTo(u,C);d.lineTo(u,x-C);d.lineTo(.5*u,x);d.lineTo(0,x-C);d.lineTo(0,C);d.close();d.fillAndStroke();d.setShadow(!1);d.begin();d.moveTo(0,C);d.lineTo(.5*u,2*C);d.lineTo(u,C);d.moveTo(.5*u,2*C);d.lineTo(.5*u,x);d.stroke()};mxCellRenderer.registerShape("isoCube2",-c);mxUtils.extend(f,mxShape);f.prototype.size=15;f.prototype.paintVertexShape=function(d,n,z,u,x){var C=Math.max(0,Math.min(.5*x,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.translate(n,z);0==C?(d.rect(0,0,u,x),d.fillAndStroke()):(d.begin(),d.moveTo(0,C),d.arcTo(.5*u,C,0,0,1,.5*u,0),d.arcTo(.5*u,C,0,0,1,u,C),d.lineTo(u,x-C),d.arcTo(.5*u,C,0,0,1,.5*u,x),d.arcTo(.5*u,C,0,0,1,0,x-C),d.close(),d.fillAndStroke(),d.setShadow(!1),d.begin(),d.moveTo(u,C),d.arcTo(.5*u,C,0,0,1,.5*u,2*C),d.arcTo(.5*-u,C,0,0,1,0,C),d.stroke())};mxCellRenderer.registerShape("cylinder2",f);mxUtils.extend(l,mxCylinder);l.prototype.size=15;l.prototype.paintVertexShape=function(d,n,z,u,x){var C=Math.max(0,Math.min(.5*x,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),E=mxUtils.getValue(this.style,"lid",!0);d.translate(n,z);0==C?(d.rect(0,0,u,x),d.fillAndStroke()):(d.begin(),E?(d.moveTo(0,C),d.arcTo(.5*u,C,0,0,1,.5*u,0),d.arcTo(.5*u,C,0,0,1,u,C)):(d.moveTo(0,0),d.arcTo(.5*u,C,0,0,0,.5*u,C),d.arcTo(.5*u,C,-0,0,0,u,0)),d.lineTo(u,x-C),d.arcTo(.5*u,C,0,0,1,.5*u,x),d.arcTo(.5*u,C,0,0,1,0,x-C),d.close(),d.fillAndStroke(),d.setShadow(!1),E&&(d.begin(),d.moveTo(u,C),d.arcTo(.5*u,C,0,0,1,.5*u,2*C),d.arcTo(.5*u,C,0,0,1,0,C),d.stroke()))};mxCellRenderer.registerShape("cylinder3",l);mxUtils.extend(t,mxActor);t.prototype.redrawPath=function(d,n,z,u,x){d.moveTo(0,0);d.quadTo(u/2,.5*x,u,0);d.quadTo(.5*u,x/2,u,x);d.quadTo(u/2,.5*x,0,x);d.quadTo(.5*u,x/2,0,0);d.end()};mxCellRenderer.registerShape("switch",t);mxUtils.extend(q,-mxCylinder);q.prototype.tabWidth=60;q.prototype.tabHeight=20;q.prototype.tabPosition="right";q.prototype.arcSize=.1;q.prototype.isRoundable=function(){return!0};q.prototype.paintVertexShape=function(d,n,z,u,x){d.translate(n,z);n=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));z=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var C=mxUtils.getValue(this.style,"tabPosition",this.tabPosition),E=mxUtils.getValue(this.style,-"rounded",!1),da=mxUtils.getValue(this.style,"absoluteArcSize",!1),M=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));da||(M*=Math.min(u,x));M=Math.min(M,.5*u,.5*(x-z));n=Math.max(n,M);n=Math.min(u-M,n);E||(M=0);d.begin();"left"==C?(d.moveTo(Math.max(M,0),z),d.lineTo(Math.max(M,0),0),d.lineTo(n,0),d.lineTo(n,z)):(d.moveTo(u-n,z),d.lineTo(u-n,0),d.lineTo(u-Math.max(M,0),0),d.lineTo(u-Math.max(M,0),z));E?(d.moveTo(0,M+z),d.arcTo(M,M,0,0,1,M,z),d.lineTo(u-M,z),d.arcTo(M,M,0,0,1,u,M+z),-d.lineTo(u,x-M),d.arcTo(M,M,0,0,1,u-M,x),d.lineTo(M,x),d.arcTo(M,M,0,0,1,0,x-M)):(d.moveTo(0,z),d.lineTo(u,z),d.lineTo(u,x),d.lineTo(0,x));d.close();d.fillAndStroke();d.setShadow(!1);"triangle"==mxUtils.getValue(this.style,"folderSymbol",null)&&(d.begin(),d.moveTo(u-30,z+20),d.lineTo(u-20,z+10),d.lineTo(u-10,z+20),d.close(),d.stroke())};mxCellRenderer.registerShape("folder",q);q.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=mxUtils.getValue(this.style,-"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var z=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;n=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var u=mxUtils.getValue(this.style,"rounded",!1),x=mxUtils.getValue(this.style,"absoluteArcSize",!1),C=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));x||(C*=Math.min(d.width,d.height));C=Math.min(C,.5*d.width,.5*(d.height-n));u||(C=0);return"left"==mxUtils.getValue(this.style,"tabPosition",-this.tabPosition)?new mxRectangle(C,0,Math.min(d.width,d.width-z),Math.min(d.height,d.height-n)):new mxRectangle(Math.min(d.width,d.width-z),0,C,Math.min(d.height,d.height-n))}return new mxRectangle(0,Math.min(d.height,n),0,0)}return null};mxUtils.extend(D,mxCylinder);D.prototype.arcSize=.1;D.prototype.paintVertexShape=function(d,n,z,u,x){d.translate(n,z);var C=mxUtils.getValue(this.style,"rounded",!1),E=mxUtils.getValue(this.style,"absoluteArcSize",!1);n=parseFloat(mxUtils.getValue(this.style,"arcSize",-this.arcSize));z=mxUtils.getValue(this.style,"umlStateConnection",null);E||(n*=Math.min(u,x));n=Math.min(n,.5*u,.5*x);C||(n=0);C=0;null!=z&&(C=10);d.begin();d.moveTo(C,n);d.arcTo(n,n,0,0,1,C+n,0);d.lineTo(u-n,0);d.arcTo(n,n,0,0,1,u,n);d.lineTo(u,x-n);d.arcTo(n,n,0,0,1,u-n,x);d.lineTo(C+n,x);d.arcTo(n,n,0,0,1,C,x-n);d.close();d.fillAndStroke();d.setShadow(!1);"collapseState"==mxUtils.getValue(this.style,"umlStateSymbol",null)&&(d.roundrect(u-40,x-20,10,10,3,3),d.stroke(),d.roundrect(u-20,x-20,10,10,+m);var cb=Math.tan(mxUtils.toRadians(30)),ab=(.5-cb)/2;mxCellRenderer.registerShape("isoRectangle",A);mxUtils.extend(v,mxConnector);v.prototype.paintEdgeShape=function(d,p){var z=this.createMarker(d,p,!0),u=this.createMarker(d,p,!1);d.setDashed(!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);null!=this.isDashed&&d.setDashed(this.isDashed,null!=this.style?1==mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,!1):!1);d.setShadow(!1);d.setStrokeColor(this.fill);mxPolyline.prototype.paintEdgeShape.apply(this,+arguments);d.setStrokeColor(this.stroke);d.setFillColor(this.stroke);d.setDashed(!1);null!=z&&z();null!=u&&u()};mxCellRenderer.registerShape("wire",v);mxUtils.extend(n,mxCylinder);n.prototype.size=6;n.prototype.paintVertexShape=function(d,p,z,u,x){d.setFillColor(this.stroke);var C=Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size))-2)+2*this.strokewidth;d.ellipse(p+.5*(u-C),z+.5*(x-C),C,C);d.fill();d.setFillColor(mxConstants.NONE);d.rect(p,z,u,x);d.fill()};mxCellRenderer.registerShape("waypoint",+n);mxUtils.extend(A,mxActor);A.prototype.size=20;A.prototype.redrawPath=function(d,p,z,u,x){p=Math.min(u,x/cb);d.translate((u-p)/2,(x-p)/2+p/4);d.moveTo(0,.25*p);d.lineTo(.5*p,p*ab);d.lineTo(p,.25*p);d.lineTo(.5*p,(.5-ab)*p);d.lineTo(0,.25*p);d.close();d.end()};mxCellRenderer.registerShape("isoRectangle",A);mxUtils.extend(G,mxCylinder);G.prototype.size=20;G.prototype.redrawPath=function(d,p,z,u,x,C){p=Math.min(u,x/(.5+cb));C?(d.moveTo(0,.25*p),d.lineTo(.5*p,(.5-ab)*p),d.lineTo(p,.25*p),d.moveTo(.5*+p,(.5-ab)*p),d.lineTo(.5*p,(1-ab)*p)):(d.translate((u-p)/2,(x-p)/2),d.moveTo(0,.25*p),d.lineTo(.5*p,p*ab),d.lineTo(p,.25*p),d.lineTo(p,.75*p),d.lineTo(.5*p,(1-ab)*p),d.lineTo(0,.75*p),d.close());d.end()};mxCellRenderer.registerShape("isoCube",G);mxUtils.extend(S,mxCylinder);S.prototype.redrawPath=function(d,p,z,u,x,C){p=Math.min(x/2,Math.round(x/8)+this.strokewidth-1);if(C&&null!=this.fill||!C&&null==this.fill)d.moveTo(0,p),d.curveTo(0,2*p,u,2*p,u,p),C||(d.stroke(),d.begin()),d.translate(0,p/2),d.moveTo(0,+p),d.curveTo(0,2*p,u,2*p,u,p),C||(d.stroke(),d.begin()),d.translate(0,p/2),d.moveTo(0,p),d.curveTo(0,2*p,u,2*p,u,p),C||(d.stroke(),d.begin()),d.translate(0,-p);C||(d.moveTo(0,p),d.curveTo(0,-p/3,u,-p/3,u,p),d.lineTo(u,x-p),d.curveTo(u,x+p/3,0,x+p/3,0,x-p),d.close())};S.prototype.getLabelMargins=function(d){return new mxRectangle(0,2.5*Math.min(d.height/2,Math.round(d.height/8)+this.strokewidth-1),0,0)};mxCellRenderer.registerShape("datastore",S);mxUtils.extend(F,mxCylinder);F.prototype.size=30;F.prototype.darkOpacity=+0;F.prototype.paintVertexShape=function(d,p,z,u,x){var C=Math.max(0,Math.min(u,Math.min(x,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),E=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity))));d.translate(p,z);d.begin();d.moveTo(0,0);d.lineTo(u-C,0);d.lineTo(u,C);d.lineTo(u,x);d.lineTo(0,x);d.lineTo(0,0);d.close();d.end();d.fillAndStroke();this.outline||(d.setShadow(!1),0!=E&&(d.setFillAlpha(Math.abs(E)),d.setFillColor(0>E?"#FFFFFF":"#000000"),+d.begin(),d.moveTo(u-C,0),d.lineTo(u-C,C),d.lineTo(u,C),d.close(),d.fill()),d.begin(),d.moveTo(u-C,0),d.lineTo(u-C,C),d.lineTo(u,C),d.end(),d.stroke())};mxCellRenderer.registerShape("note",F);mxUtils.extend(K,F);mxCellRenderer.registerShape("note2",K);K.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var p=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(d.height*this.scale,p*this.scale),0,0)}return null};mxUtils.extend(c,mxShape);c.prototype.isoAngle=+15;c.prototype.paintVertexShape=function(d,p,z,u,x){var C=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;C=Math.min(u*Math.tan(C),.5*x);d.translate(p,z);d.begin();d.moveTo(.5*u,0);d.lineTo(u,C);d.lineTo(u,x-C);d.lineTo(.5*u,x);d.lineTo(0,x-C);d.lineTo(0,C);d.close();d.fillAndStroke();d.setShadow(!1);d.begin();d.moveTo(0,C);d.lineTo(.5*u,2*C);d.lineTo(u,C);d.moveTo(.5*u,2*C);d.lineTo(.5*u,x);d.stroke()};mxCellRenderer.registerShape("isoCube2",+c);mxUtils.extend(f,mxShape);f.prototype.size=15;f.prototype.paintVertexShape=function(d,p,z,u,x){var C=Math.max(0,Math.min(.5*x,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.translate(p,z);0==C?(d.rect(0,0,u,x),d.fillAndStroke()):(d.begin(),d.moveTo(0,C),d.arcTo(.5*u,C,0,0,1,.5*u,0),d.arcTo(.5*u,C,0,0,1,u,C),d.lineTo(u,x-C),d.arcTo(.5*u,C,0,0,1,.5*u,x),d.arcTo(.5*u,C,0,0,1,0,x-C),d.close(),d.fillAndStroke(),d.setShadow(!1),d.begin(),d.moveTo(u,C),d.arcTo(.5*u,C,0,0,1,.5*u,2*C),d.arcTo(.5*+u,C,0,0,1,0,C),d.stroke())};mxCellRenderer.registerShape("cylinder2",f);mxUtils.extend(l,mxCylinder);l.prototype.size=15;l.prototype.paintVertexShape=function(d,p,z,u,x){var C=Math.max(0,Math.min(.5*x,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),E=mxUtils.getValue(this.style,"lid",!0);d.translate(p,z);0==C?(d.rect(0,0,u,x),d.fillAndStroke()):(d.begin(),E?(d.moveTo(0,C),d.arcTo(.5*u,C,0,0,1,.5*u,0),d.arcTo(.5*u,C,0,0,1,u,C)):(d.moveTo(0,0),d.arcTo(.5*u,C,0,0,0,.5*u,C),d.arcTo(.5*u,C,+0,0,0,u,0)),d.lineTo(u,x-C),d.arcTo(.5*u,C,0,0,1,.5*u,x),d.arcTo(.5*u,C,0,0,1,0,x-C),d.close(),d.fillAndStroke(),d.setShadow(!1),E&&(d.begin(),d.moveTo(u,C),d.arcTo(.5*u,C,0,0,1,.5*u,2*C),d.arcTo(.5*u,C,0,0,1,0,C),d.stroke()))};mxCellRenderer.registerShape("cylinder3",l);mxUtils.extend(t,mxActor);t.prototype.redrawPath=function(d,p,z,u,x){d.moveTo(0,0);d.quadTo(u/2,.5*x,u,0);d.quadTo(.5*u,x/2,u,x);d.quadTo(u/2,.5*x,0,x);d.quadTo(.5*u,x/2,0,0);d.end()};mxCellRenderer.registerShape("switch",t);mxUtils.extend(q,+mxCylinder);q.prototype.tabWidth=60;q.prototype.tabHeight=20;q.prototype.tabPosition="right";q.prototype.arcSize=.1;q.prototype.isRoundable=function(){return!0};q.prototype.paintVertexShape=function(d,p,z,u,x){d.translate(p,z);p=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));z=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var C=mxUtils.getValue(this.style,"tabPosition",this.tabPosition),E=mxUtils.getValue(this.style,+"rounded",!1),da=mxUtils.getValue(this.style,"absoluteArcSize",!1),M=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));da||(M*=Math.min(u,x));M=Math.min(M,.5*u,.5*(x-z));p=Math.max(p,M);p=Math.min(u-M,p);E||(M=0);d.begin();"left"==C?(d.moveTo(Math.max(M,0),z),d.lineTo(Math.max(M,0),0),d.lineTo(p,0),d.lineTo(p,z)):(d.moveTo(u-p,z),d.lineTo(u-p,0),d.lineTo(u-Math.max(M,0),0),d.lineTo(u-Math.max(M,0),z));E?(d.moveTo(0,M+z),d.arcTo(M,M,0,0,1,M,z),d.lineTo(u-M,z),d.arcTo(M,M,0,0,1,u,M+z),+d.lineTo(u,x-M),d.arcTo(M,M,0,0,1,u-M,x),d.lineTo(M,x),d.arcTo(M,M,0,0,1,0,x-M)):(d.moveTo(0,z),d.lineTo(u,z),d.lineTo(u,x),d.lineTo(0,x));d.close();d.fillAndStroke();d.setShadow(!1);"triangle"==mxUtils.getValue(this.style,"folderSymbol",null)&&(d.begin(),d.moveTo(u-30,z+20),d.lineTo(u-20,z+10),d.lineTo(u-10,z+20),d.close(),d.stroke())};mxCellRenderer.registerShape("folder",q);q.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var p=mxUtils.getValue(this.style,+"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var z=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;p=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var u=mxUtils.getValue(this.style,"rounded",!1),x=mxUtils.getValue(this.style,"absoluteArcSize",!1),C=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));x||(C*=Math.min(d.width,d.height));C=Math.min(C,.5*d.width,.5*(d.height-p));u||(C=0);return"left"==mxUtils.getValue(this.style,"tabPosition",+this.tabPosition)?new mxRectangle(C,0,Math.min(d.width,d.width-z),Math.min(d.height,d.height-p)):new mxRectangle(Math.min(d.width,d.width-z),0,C,Math.min(d.height,d.height-p))}return new mxRectangle(0,Math.min(d.height,p),0,0)}return null};mxUtils.extend(D,mxCylinder);D.prototype.arcSize=.1;D.prototype.paintVertexShape=function(d,p,z,u,x){d.translate(p,z);var C=mxUtils.getValue(this.style,"rounded",!1),E=mxUtils.getValue(this.style,"absoluteArcSize",!1);p=parseFloat(mxUtils.getValue(this.style,"arcSize",+this.arcSize));z=mxUtils.getValue(this.style,"umlStateConnection",null);E||(p*=Math.min(u,x));p=Math.min(p,.5*u,.5*x);C||(p=0);C=0;null!=z&&(C=10);d.begin();d.moveTo(C,p);d.arcTo(p,p,0,0,1,C+p,0);d.lineTo(u-p,0);d.arcTo(p,p,0,0,1,u,p);d.lineTo(u,x-p);d.arcTo(p,p,0,0,1,u-p,x);d.lineTo(C+p,x);d.arcTo(p,p,0,0,1,C,x-p);d.close();d.fillAndStroke();d.setShadow(!1);"collapseState"==mxUtils.getValue(this.style,"umlStateSymbol",null)&&(d.roundrect(u-40,x-20,10,10,3,3),d.stroke(),d.roundrect(u-20,x-20,10,10,3,3),d.stroke(),d.begin(),d.moveTo(u-30,x-15),d.lineTo(u-20,x-15),d.stroke());"connPointRefEntry"==z?(d.ellipse(0,.5*x-10,20,20),d.fillAndStroke()):"connPointRefExit"==z&&(d.ellipse(0,.5*x-10,20,20),d.fillAndStroke(),d.begin(),d.moveTo(5,.5*x-5),d.lineTo(15,.5*x+5),d.moveTo(15,.5*x-5),d.lineTo(5,.5*x+5),d.stroke())};D.prototype.getLabelMargins=function(d){return mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*this.scale,-0,0,0):null};mxCellRenderer.registerShape("umlState",D);mxUtils.extend(G,mxActor);G.prototype.size=30;G.prototype.isRoundable=function(){return!0};G.prototype.redrawPath=function(d,n,z,u,x){n=Math.max(0,Math.min(u,Math.min(x,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(n,0),new mxPoint(u,0),new mxPoint(u,x),new mxPoint(0,x),new mxPoint(0,n)],this.isRounded,z,!0);d.end()};-mxCellRenderer.registerShape("card",G);mxUtils.extend(N,mxActor);N.prototype.size=.4;N.prototype.redrawPath=function(d,n,z,u,x){n=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.moveTo(0,n/2);d.quadTo(u/4,1.4*n,u/2,n/2);d.quadTo(3*u/4,n*(1-1.4),u,n/2);d.lineTo(u,x-n/2);d.quadTo(3*u/4,x-1.4*n,u/2,x-n/2);d.quadTo(u/4,x-n*(1-1.4),0,x-n/2);d.lineTo(0,n/2);d.close();d.end()};N.prototype.getLabelBounds=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=-mxUtils.getValue(this.style,"size",this.size),z=d.width,u=d.height;if(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return n*=u,new mxRectangle(d.x,d.y+n,z,u-2*n);n*=z;return new mxRectangle(d.x+n,d.y,z-2*n,u)}return d};mxCellRenderer.registerShape("tape",N);mxUtils.extend(L,mxActor);L.prototype.size=.3;L.prototype.getLabelMargins=function(d){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,-"size",this.size))*d.height):null};L.prototype.redrawPath=function(d,n,z,u,x){n=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.moveTo(0,0);d.lineTo(u,0);d.lineTo(u,x-n/2);d.quadTo(3*u/4,x-1.4*n,u/2,x-n/2);d.quadTo(u/4,x-n*(1-1.4),0,x-n/2);d.lineTo(0,n/2);d.close();d.end()};mxCellRenderer.registerShape("document",L);var db=mxCylinder.prototype.getCylinderSize;mxCylinder.prototype.getCylinderSize=function(d,n,z,u){var x=mxUtils.getValue(this.style,"size");return null!=-x?u*Math.max(0,Math.min(1,x)):db.apply(this,arguments)};mxCylinder.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=2*mxUtils.getValue(this.style,"size",.15);return new mxRectangle(0,Math.min(this.maxHeight*this.scale,d.height*n),0,0)}return null};l.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=mxUtils.getValue(this.style,"size",15);mxUtils.getValue(this.style,"lid",!0)||(n/=2);return new mxRectangle(0,Math.min(d.height*-this.scale,2*n*this.scale),0,Math.max(0,.3*n*this.scale))}return null};q.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var z=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;n=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var u=mxUtils.getValue(this.style,"rounded",!1),x=mxUtils.getValue(this.style,"absoluteArcSize",!1),C=parseFloat(mxUtils.getValue(this.style,-"arcSize",this.arcSize));x||(C*=Math.min(d.width,d.height));C=Math.min(C,.5*d.width,.5*(d.height-n));u||(C=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(C,0,Math.min(d.width,d.width-z),Math.min(d.height,d.height-n)):new mxRectangle(Math.min(d.width,d.width-z),0,C,Math.min(d.height,d.height-n))}return new mxRectangle(0,Math.min(d.height,n),0,0)}return null};D.prototype.getLabelMargins=function(d){return mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=-mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*this.scale,0,0,0):null};K.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(d.height*this.scale,n*this.scale),0,Math.max(0,n*this.scale))}return null};mxUtils.extend(J,mxActor);J.prototype.size=.2;J.prototype.fixedSize=20;J.prototype.isRoundable=function(){return!0};J.prototype.redrawPath=function(d,n,z,u,x){n=-"0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,x),new mxPoint(n,0),new mxPoint(u,0),new mxPoint(u-n,x)],this.isRounded,z,!0);d.end()};mxCellRenderer.registerShape("parallelogram",J);mxUtils.extend(Y,mxActor);Y.prototype.size=-.2;Y.prototype.fixedSize=20;Y.prototype.isRoundable=function(){return!0};Y.prototype.redrawPath=function(d,n,z,u,x){n="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,x),new mxPoint(n,0),new mxPoint(u-n,0),new mxPoint(u,-x)],this.isRounded,z,!0)};mxCellRenderer.registerShape("trapezoid",Y);mxUtils.extend(ha,mxActor);ha.prototype.size=.5;ha.prototype.redrawPath=function(d,n,z,u,x){d.setFillColor(null);n=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(u,0),new mxPoint(n,0),new mxPoint(n,x/2),new mxPoint(0,x/2),new mxPoint(n,x/2),new mxPoint(n,x),new mxPoint(u,x)],this.isRounded,-z,!1);d.end()};mxCellRenderer.registerShape("curlyBracket",ha);mxUtils.extend(ea,mxActor);ea.prototype.redrawPath=function(d,n,z,u,x){d.setStrokeWidth(1);d.setFillColor(this.stroke);n=u/5;d.rect(0,0,n,x);d.fillAndStroke();d.rect(2*n,0,n,x);d.fillAndStroke();d.rect(4*n,0,n,x);d.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",ea);aa.prototype.moveTo=function(d,n){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=n;this.firstX=d;this.firstY=n};aa.prototype.close=-function(){null!=this.firstX&&null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,arguments));this.originalClose.apply(this.canvas,arguments)};aa.prototype.quadTo=function(d,n,z,u){this.originalQuadTo.apply(this.canvas,arguments);this.lastX=z;this.lastY=u};aa.prototype.curveTo=function(d,n,z,u,x,C){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=x;this.lastY=C};aa.prototype.arcTo=function(d,n,z,u,x,C,E){this.originalArcTo.apply(this.canvas,arguments);-this.lastX=C;this.lastY=E};aa.prototype.lineTo=function(d,n){if(null!=this.lastX&&null!=this.lastY){var z=function(ma){return"number"===typeof ma?ma?0>ma?-1:1:ma===ma?0:NaN:NaN},u=Math.abs(d-this.lastX),x=Math.abs(n-this.lastY),C=Math.sqrt(u*u+x*x);if(2>C){this.originalLineTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=n;return}var E=Math.round(C/10),da=this.defaultVariation;5>E&&(E=5,da/=3);var M=z(d-this.lastX)*u/E;z=z(n-this.lastY)*x/E;u/=C;x/=C;for(C=0;C<E;C++){var sa=(Math.random()--.5)*da;this.originalLineTo.call(this.canvas,M*C+this.lastX-sa*x,z*C+this.lastY-sa*u)}this.originalLineTo.call(this.canvas,d,n)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=n};aa.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};var lb=mxShape.prototype.beforePaint;+0,0,0):null};mxCellRenderer.registerShape("umlState",D);mxUtils.extend(H,mxActor);H.prototype.size=30;H.prototype.isRoundable=function(){return!0};H.prototype.redrawPath=function(d,p,z,u,x){p=Math.max(0,Math.min(u,Math.min(x,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(p,0),new mxPoint(u,0),new mxPoint(u,x),new mxPoint(0,x),new mxPoint(0,p)],this.isRounded,z,!0);d.end()};+mxCellRenderer.registerShape("card",H);mxUtils.extend(N,mxActor);N.prototype.size=.4;N.prototype.redrawPath=function(d,p,z,u,x){p=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.moveTo(0,p/2);d.quadTo(u/4,1.4*p,u/2,p/2);d.quadTo(3*u/4,p*(1-1.4),u,p/2);d.lineTo(u,x-p/2);d.quadTo(3*u/4,x-1.4*p,u/2,x-p/2);d.quadTo(u/4,x-p*(1-1.4),0,x-p/2);d.lineTo(0,p/2);d.close();d.end()};N.prototype.getLabelBounds=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var p=+mxUtils.getValue(this.style,"size",this.size),z=d.width,u=d.height;if(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return p*=u,new mxRectangle(d.x,d.y+p,z,u-2*p);p*=z;return new mxRectangle(d.x+p,d.y,z-2*p,u)}return d};mxCellRenderer.registerShape("tape",N);mxUtils.extend(L,mxActor);L.prototype.size=.3;L.prototype.getLabelMargins=function(d){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,+"size",this.size))*d.height):null};L.prototype.redrawPath=function(d,p,z,u,x){p=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.moveTo(0,0);d.lineTo(u,0);d.lineTo(u,x-p/2);d.quadTo(3*u/4,x-1.4*p,u/2,x-p/2);d.quadTo(u/4,x-p*(1-1.4),0,x-p/2);d.lineTo(0,p/2);d.close();d.end()};mxCellRenderer.registerShape("document",L);var db=mxCylinder.prototype.getCylinderSize;mxCylinder.prototype.getCylinderSize=function(d,p,z,u){var x=mxUtils.getValue(this.style,"size");return null!=+x?u*Math.max(0,Math.min(1,x)):db.apply(this,arguments)};mxCylinder.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var p=2*mxUtils.getValue(this.style,"size",.15);return new mxRectangle(0,Math.min(this.maxHeight*this.scale,d.height*p),0,0)}return null};l.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var p=mxUtils.getValue(this.style,"size",15);mxUtils.getValue(this.style,"lid",!0)||(p/=2);return new mxRectangle(0,Math.min(d.height*+this.scale,2*p*this.scale),0,Math.max(0,.3*p*this.scale))}return null};q.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var p=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var z=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;p=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var u=mxUtils.getValue(this.style,"rounded",!1),x=mxUtils.getValue(this.style,"absoluteArcSize",!1),C=parseFloat(mxUtils.getValue(this.style,+"arcSize",this.arcSize));x||(C*=Math.min(d.width,d.height));C=Math.min(C,.5*d.width,.5*(d.height-p));u||(C=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(C,0,Math.min(d.width,d.width-z),Math.min(d.height,d.height-p)):new mxRectangle(Math.min(d.width,d.width-z),0,C,Math.min(d.height,d.height-p))}return new mxRectangle(0,Math.min(d.height,p),0,0)}return null};D.prototype.getLabelMargins=function(d){return mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=+mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*this.scale,0,0,0):null};K.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var p=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(d.height*this.scale,p*this.scale),0,Math.max(0,p*this.scale))}return null};mxUtils.extend(J,mxActor);J.prototype.size=.2;J.prototype.fixedSize=20;J.prototype.isRoundable=function(){return!0};J.prototype.redrawPath=function(d,p,z,u,x){p=+"0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,x),new mxPoint(p,0),new mxPoint(u,0),new mxPoint(u-p,x)],this.isRounded,z,!0);d.end()};mxCellRenderer.registerShape("parallelogram",J);mxUtils.extend(Y,mxActor);Y.prototype.size=+.2;Y.prototype.fixedSize=20;Y.prototype.isRoundable=function(){return!0};Y.prototype.redrawPath=function(d,p,z,u,x){p="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,x),new mxPoint(p,0),new mxPoint(u-p,0),new mxPoint(u,+x)],this.isRounded,z,!0)};mxCellRenderer.registerShape("trapezoid",Y);mxUtils.extend(ha,mxActor);ha.prototype.size=.5;ha.prototype.redrawPath=function(d,p,z,u,x){d.setFillColor(null);p=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(u,0),new mxPoint(p,0),new mxPoint(p,x/2),new mxPoint(0,x/2),new mxPoint(p,x/2),new mxPoint(p,x),new mxPoint(u,x)],this.isRounded,+z,!1);d.end()};mxCellRenderer.registerShape("curlyBracket",ha);mxUtils.extend(ea,mxActor);ea.prototype.redrawPath=function(d,p,z,u,x){d.setStrokeWidth(1);d.setFillColor(this.stroke);p=u/5;d.rect(0,0,p,x);d.fillAndStroke();d.rect(2*p,0,p,x);d.fillAndStroke();d.rect(4*p,0,p,x);d.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",ea);aa.prototype.moveTo=function(d,p){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=p;this.firstX=d;this.firstY=p};aa.prototype.close=+function(){null!=this.firstX&&null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,arguments));this.originalClose.apply(this.canvas,arguments)};aa.prototype.quadTo=function(d,p,z,u){this.originalQuadTo.apply(this.canvas,arguments);this.lastX=z;this.lastY=u};aa.prototype.curveTo=function(d,p,z,u,x,C){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=x;this.lastY=C};aa.prototype.arcTo=function(d,p,z,u,x,C,E){this.originalArcTo.apply(this.canvas,arguments);+this.lastX=C;this.lastY=E};aa.prototype.lineTo=function(d,p){if(null!=this.lastX&&null!=this.lastY){var z=function(ma){return"number"===typeof ma?ma?0>ma?-1:1:ma===ma?0:NaN:NaN},u=Math.abs(d-this.lastX),x=Math.abs(p-this.lastY),C=Math.sqrt(u*u+x*x);if(2>C){this.originalLineTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=p;return}var E=Math.round(C/10),da=this.defaultVariation;5>E&&(E=5,da/=3);var M=z(d-this.lastX)*u/E;z=z(p-this.lastY)*x/E;u/=C;x/=C;for(C=0;C<E;C++){var sa=(Math.random()-+.5)*da;this.originalLineTo.call(this.canvas,M*C+this.lastX-sa*x,z*C+this.lastY-sa*u)}this.originalLineTo.call(this.canvas,d,p)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=p};aa.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};var lb=mxShape.prototype.beforePaint;mxShape.prototype.beforePaint=function(d){lb.apply(this,arguments);null==d.handJiggle&&(d.handJiggle=this.createHandJiggle(d))};var kb=mxShape.prototype.afterPaint;mxShape.prototype.afterPaint=function(d){kb.apply(this,arguments);null!=d.handJiggle&&(d.handJiggle.destroy(),delete d.handJiggle)};mxShape.prototype.createComicCanvas=function(d){return new aa(d,mxUtils.getValue(this.style,"jiggle",Editor.sketchDefaultJiggle))};mxShape.prototype.createHandJiggle=function(d){return this.outline||null==-this.style||"0"==mxUtils.getValue(this.style,"comic","0")?null:this.createComicCanvas(d)};var pb=mxRectangleShape.prototype.isHtmlAllowed;mxRectangleShape.prototype.isHtmlAllowed=function(){return!this.outline&&(null==this.style||"0"==mxUtils.getValue(this.style,"comic","0")&&"0"==mxUtils.getValue(this.style,"sketch","1"==urlParams.rough?"1":"0"))&&pb.apply(this,arguments)};var fb=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(d,n,z,u,x){if(null==d.handJiggle||+this.style||"0"==mxUtils.getValue(this.style,"comic","0")?null:this.createComicCanvas(d)};var pb=mxRectangleShape.prototype.isHtmlAllowed;mxRectangleShape.prototype.isHtmlAllowed=function(){return!this.outline&&(null==this.style||"0"==mxUtils.getValue(this.style,"comic","0")&&"0"==mxUtils.getValue(this.style,"sketch","1"==urlParams.rough?"1":"0"))&&pb.apply(this,arguments)};var fb=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(d,p,z,u,x){if(null==d.handJiggle||d.handJiggle.constructor!=aa)fb.apply(this,arguments);else{var C=!0;null!=this.style&&(C="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(C||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE)C||null!=this.fill&&this.fill!=mxConstants.NONE||(d.pointerEvents=!1),d.begin(),this.isRounded?("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?C=Math.min(u/2,Math.min(x/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,-mxConstants.LINE_ARCSIZE)/2)):(C=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,C=Math.min(u*C,x*C)),d.moveTo(n+C,z),d.lineTo(n+u-C,z),d.quadTo(n+u,z,n+u,z+C),d.lineTo(n+u,z+x-C),d.quadTo(n+u,z+x,n+u-C,z+x),d.lineTo(n+C,z+x),d.quadTo(n,z+x,n,z+x-C),d.lineTo(n,z+C),d.quadTo(n,z,n+C,z)):(d.moveTo(n,z),d.lineTo(n+u,z),d.lineTo(n+u,z+x),d.lineTo(n,z+x),d.lineTo(n,z)),d.close(),d.end(),d.fillAndStroke()}};mxUtils.extend(na,mxRectangleShape);na.prototype.size=-.1;na.prototype.fixedSize=!1;na.prototype.isHtmlAllowed=function(){return!1};na.prototype.getLabelBounds=function(d){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)){var n=d.width,z=d.height;d=new mxRectangle(d.x,d.y,n,z);var u=n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded){var x=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,-100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;u=Math.max(u,Math.min(n*x,z*x))}d.x+=Math.round(u);d.width-=Math.round(2*u);return d}return d};na.prototype.paintForeground=function(d,n,z,u,x){var C=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),E=parseFloat(mxUtils.getValue(this.style,"size",this.size));E=C?Math.max(0,Math.min(u,E)):u*Math.max(0,Math.min(1,E));this.isRounded&&(C=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,E=Math.max(E,-Math.min(u*C,x*C)));E=Math.round(E);d.begin();d.moveTo(n+E,z);d.lineTo(n+E,z+x);d.moveTo(n+u-E,z);d.lineTo(n+u-E,z+x);d.end();d.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("process",na);mxCellRenderer.registerShape("process2",na);mxUtils.extend(W,mxRectangleShape);W.prototype.paintBackground=function(d,n,z,u,x){d.setFillColor(mxConstants.NONE);d.rect(n,z,u,x);d.fill()};W.prototype.paintForeground=function(d,n,z,u,x){};mxCellRenderer.registerShape("transparent",-W);mxUtils.extend(ba,mxHexagon);ba.prototype.size=30;ba.prototype.position=.5;ba.prototype.position2=.5;ba.prototype.base=20;ba.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};ba.prototype.isRoundable=function(){return!0};ba.prototype.redrawPath=function(d,n,z,u,x){n=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;z=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,-"size",this.size))));var C=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),E=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2)))),da=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(d,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,x-z),new mxPoint(Math.min(u,C+da),x-z),new mxPoint(E,x),new mxPoint(Math.max(0,C),x-z),new mxPoint(0,x-z)],this.isRounded,n,!0,[4])};mxCellRenderer.registerShape("callout",-ba);mxUtils.extend(ja,mxActor);ja.prototype.size=.2;ja.prototype.fixedSize=20;ja.prototype.isRoundable=function(){return!0};ja.prototype.redrawPath=function(d,n,z,u,x){n="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,-0),new mxPoint(u-n,0),new mxPoint(u,x/2),new mxPoint(u-n,x),new mxPoint(0,x),new mxPoint(n,x/2)],this.isRounded,z,!0);d.end()};mxCellRenderer.registerShape("step",ja);mxUtils.extend(ca,mxHexagon);ca.prototype.size=.25;ca.prototype.fixedSize=20;ca.prototype.isRoundable=function(){return!0};ca.prototype.redrawPath=function(d,n,z,u,x){n="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,-"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(n,0),new mxPoint(u-n,0),new mxPoint(u,.5*x),new mxPoint(u-n,x),new mxPoint(n,x),new mxPoint(0,.5*x)],this.isRounded,z,!0)};mxCellRenderer.registerShape("hexagon",ca);mxUtils.extend(la,mxRectangleShape);la.prototype.isHtmlAllowed=function(){return!1};la.prototype.paintForeground=function(d,n,z,u,x){var C=Math.min(u/5,x/5)+1;d.begin();d.moveTo(n+u/2,z+C);d.lineTo(n+-u/2,z+x-C);d.moveTo(n+C,z+x/2);d.lineTo(n+u-C,z+x/2);d.end();d.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",la);var ob=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(d){if(1==this.style["double"]){var n=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(d.x+n,d.y+n,d.width-2*n,d.height-2*n)}return d};mxRhombus.prototype.paintVertexShape=-function(d,n,z,u,x){ob.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var C=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);n+=C;z+=C;u-=2*C;x-=2*C;0<u&&0<x&&(d.setShadow(!1),ob.apply(this,[d,n,z,u,x]))}};mxUtils.extend(Q,mxRectangleShape);Q.prototype.isHtmlAllowed=function(){return!1};Q.prototype.getLabelBounds=function(d){if(1==this.style["double"]){var n=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;-return new mxRectangle(d.x+n,d.y+n,d.width-2*n,d.height-2*n)}return d};Q.prototype.paintForeground=function(d,n,z,u,x){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var C=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);n+=C;z+=C;u-=2*C;x-=2*C;0<u&&0<x&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}d.setDashed(!1);C=0;do{var E=mxCellRenderer.defaultShapes[this.style["symbol"+C]];if(null!=E){var da=this.style["symbol"+C+"Align"],-M=this.style["symbol"+C+"VerticalAlign"],sa=this.style["symbol"+C+"Width"],ma=this.style["symbol"+C+"Height"],Wa=this.style["symbol"+C+"Spacing"]||0,gb=this.style["symbol"+C+"VSpacing"]||Wa,bb=this.style["symbol"+C+"ArcSpacing"];null!=bb&&(bb*=this.getArcSize(u+this.strokewidth,x+this.strokewidth),Wa+=bb,gb+=bb);bb=n;var Fa=z;bb=da==mxConstants.ALIGN_CENTER?bb+(u-sa)/2:da==mxConstants.ALIGN_RIGHT?bb+(u-sa-Wa):bb+Wa;Fa=M==mxConstants.ALIGN_MIDDLE?Fa+(x-ma)/2:M==mxConstants.ALIGN_BOTTOM?Fa+(x-ma-gb):-Fa+gb;d.save();da=new E;da.style=this.style;E.prototype.paintVertexShape.call(da,d,bb,Fa,sa,ma);d.restore()}C++}while(null!=E)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",Q);mxUtils.extend(k,mxCylinder);k.prototype.redrawPath=function(d,n,z,u,x,C){C?(d.moveTo(0,0),d.lineTo(u/2,x/2),d.lineTo(u,0),d.end()):(d.moveTo(0,0),d.lineTo(u,0),d.lineTo(u,x),d.lineTo(0,x),d.close())};mxCellRenderer.registerShape("message",k);mxUtils.extend(B,mxShape);B.prototype.paintBackground=-function(d,n,z,u,x){d.translate(n,z);d.ellipse(u/4,0,u/2,x/4);d.fillAndStroke();d.begin();d.moveTo(u/2,x/4);d.lineTo(u/2,2*x/3);d.moveTo(u/2,x/3);d.lineTo(0,x/3);d.moveTo(u/2,x/3);d.lineTo(u,x/3);d.moveTo(u/2,2*x/3);d.lineTo(0,x);d.moveTo(u/2,2*x/3);d.lineTo(u,x);d.end();d.stroke()};mxCellRenderer.registerShape("umlActor",B);mxUtils.extend(I,mxShape);I.prototype.getLabelMargins=function(d){return new mxRectangle(d.width/6,0,0,0)};I.prototype.paintBackground=function(d,n,z,u,x){d.translate(n,z);d.begin();-d.moveTo(0,x/4);d.lineTo(0,3*x/4);d.end();d.stroke();d.begin();d.moveTo(0,x/2);d.lineTo(u/6,x/2);d.end();d.stroke();d.ellipse(u/6,0,5*u/6,x);d.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",I);mxUtils.extend(U,mxEllipse);U.prototype.paintVertexShape=function(d,n,z,u,x){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.begin();d.moveTo(n+u/8,z+x);d.lineTo(n+7*u/8,z+x);d.end();d.stroke()};mxCellRenderer.registerShape("umlEntity",U);mxUtils.extend(P,mxShape);P.prototype.paintVertexShape=-function(d,n,z,u,x){d.translate(n,z);d.begin();d.moveTo(u,0);d.lineTo(0,x);d.moveTo(0,0);d.lineTo(u,x);d.end();d.stroke()};mxCellRenderer.registerShape("umlDestroy",P);mxUtils.extend(T,mxShape);T.prototype.getLabelBounds=function(d){return new mxRectangle(d.x,d.y+d.height/8,d.width,7*d.height/8)};T.prototype.paintBackground=function(d,n,z,u,x){d.translate(n,z);d.begin();d.moveTo(3*u/8,x/8*1.1);d.lineTo(5*u/8,0);d.end();d.stroke();d.ellipse(0,x/8,u,7*x/8);d.fillAndStroke()};T.prototype.paintForeground=-function(d,n,z,u,x){d.begin();d.moveTo(3*u/8,x/8*1.1);d.lineTo(5*u/8,x/4);d.end();d.stroke()};mxCellRenderer.registerShape("umlControl",T);mxUtils.extend(X,mxRectangleShape);X.prototype.size=40;X.prototype.isHtmlAllowed=function(){return!1};X.prototype.getLabelBounds=function(d){var n=Math.max(0,Math.min(d.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(d.x,d.y,d.width,n)};X.prototype.paintBackground=function(d,n,z,u,x){var C=Math.max(0,Math.min(x,-parseFloat(mxUtils.getValue(this.style,"size",this.size)))),E=mxUtils.getValue(this.style,"participant");null==E||null==this.state?mxRectangleShape.prototype.paintBackground.call(this,d,n,z,u,C):(E=this.state.view.graph.cellRenderer.getShape(E),null!=E&&E!=X&&(E=new E,E.apply(this.state),d.save(),E.paintVertexShape(d,n,z,u,C),d.restore()));C<x&&(d.setDashed("1"==mxUtils.getValue(this.style,"lifelineDashed","1")),d.begin(),d.moveTo(n+u/2,z+C),d.lineTo(n+u/2,z+x),d.end(),d.stroke())};X.prototype.paintForeground=-function(d,n,z,u,x){var C=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,d,n,z,u,Math.min(x,C))};mxCellRenderer.registerShape("umlLifeline",X);mxUtils.extend(Z,mxShape);Z.prototype.width=60;Z.prototype.height=30;Z.prototype.corner=10;Z.prototype.configurePointerEvents=function(d){var n=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);null==this.style||null!=n&&n!=mxConstants.NONE&&-0!=this.opacity&&0!=this.fillOpacity||"0"!=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||(d.pointerEvents=!1)};Z.prototype.getLabelMargins=function(d){return new mxRectangle(0,0,d.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),d.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};Z.prototype.paintBackground=function(d,n,z,u,x){var C=this.corner,E=Math.min(u,Math.max(C,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),-da=Math.min(x,Math.max(1.5*C,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),M=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);M!=mxConstants.NONE&&(d.setFillColor(M),d.rect(n,z,u,x),d.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(d,n,z,u,x),d.setGradient(this.fill,this.gradient,n,z,u,x,this.gradientDirection)):d.setFillColor(this.fill);d.pointerEvents=!0;d.begin();d.moveTo(n,-z);d.lineTo(n+E,z);d.lineTo(n+E,z+Math.max(0,da-1.5*C));d.lineTo(n+Math.max(0,E-C),z+da);d.lineTo(n,z+da);d.close();d.fillAndStroke();this.configurePointerEvents(d);d.begin();d.moveTo(n+E,z);d.lineTo(n+u,z);d.lineTo(n+u,z+x);d.lineTo(n,z+x);d.lineTo(n,z+da);d.stroke()};mxCellRenderer.registerShape("umlFrame",Z);mxPerimeter.CenterPerimeter=function(d,n,z,u){return new mxPoint(d.getCenterX(),d.getCenterY())};mxStyleRegistry.putValue("centerPerimeter",mxPerimeter.CenterPerimeter);mxPerimeter.LifelinePerimeter=-function(d,n,z,u){u=X.prototype.size;null!=n&&(u=mxUtils.getValue(n.style,"size",u)*n.view.scale);n=parseFloat(n.style[mxConstants.STYLE_STROKEWIDTH]||1)*n.view.scale/2-1;z.x<d.getCenterX()&&(n=-1*(n+1));return new mxPoint(d.getCenterX()+n,Math.min(d.y+d.height,Math.max(d.y+u,z.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);mxPerimeter.OrthogonalPerimeter=function(d,n,z,u){u=!0;return mxPerimeter.RectanglePerimeter.apply(this,arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",-mxPerimeter.OrthogonalPerimeter);mxPerimeter.BackbonePerimeter=function(d,n,z,u){u=parseFloat(n.style[mxConstants.STYLE_STROKEWIDTH]||1)*n.view.scale/2-1;null!=n.style.backboneSize&&(u+=parseFloat(n.style.backboneSize)*n.view.scale/2-1);if("south"==n.style[mxConstants.STYLE_DIRECTION]||"north"==n.style[mxConstants.STYLE_DIRECTION])return z.x<d.getCenterX()&&(u=-1*(u+1)),new mxPoint(d.getCenterX()+u,Math.min(d.y+d.height,Math.max(d.y,z.y)));z.y<d.getCenterY()&&(u=-1*(u+1));return new mxPoint(Math.min(d.x+-d.width,Math.max(d.x,z.x)),d.getCenterY()+u)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(d,n,z,u){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(d,new mxRectangle(0,0,0,Math.max(0,Math.min(d.height,parseFloat(mxUtils.getValue(n.style,"size",ba.prototype.size))*n.view.scale))),n.style),n,z,u)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);mxPerimeter.ParallelogramPerimeter=function(d,-n,z,u){var x="0"!=mxUtils.getValue(n.style,"fixedSize","0"),C=x?J.prototype.fixedSize:J.prototype.size;null!=n&&(C=mxUtils.getValue(n.style,"size",C));x&&(C*=n.view.scale);var E=d.x,da=d.y,M=d.width,sa=d.height;n=null!=n?mxUtils.getValue(n.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;n==mxConstants.DIRECTION_NORTH||n==mxConstants.DIRECTION_SOUTH?(x=x?Math.max(0,Math.min(sa,C)):sa*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da),new mxPoint(E+M,da+x),new mxPoint(E+-M,da+sa),new mxPoint(E,da+sa-x),new mxPoint(E,da)]):(x=x?Math.max(0,Math.min(.5*M,C)):M*Math.max(0,Math.min(1,C)),da=[new mxPoint(E+x,da),new mxPoint(E+M,da),new mxPoint(E+M-x,da+sa),new mxPoint(E,da+sa),new mxPoint(E+x,da)]);sa=d.getCenterX();d=d.getCenterY();d=new mxPoint(sa,d);u&&(z.x<E||z.x>E+M?d.y=z.y:d.x=z.x);return mxUtils.getPerimeterPoint(da,d,z)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(d,n,z,u){var x="0"!=-mxUtils.getValue(n.style,"fixedSize","0"),C=x?Y.prototype.fixedSize:Y.prototype.size;null!=n&&(C=mxUtils.getValue(n.style,"size",C));x&&(C*=n.view.scale);var E=d.x,da=d.y,M=d.width,sa=d.height;n=null!=n?mxUtils.getValue(n.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;n==mxConstants.DIRECTION_EAST?(x=x?Math.max(0,Math.min(.5*M,C)):M*Math.max(0,Math.min(1,C)),da=[new mxPoint(E+x,da),new mxPoint(E+M-x,da),new mxPoint(E+M,da+sa),new mxPoint(E,da+sa),new mxPoint(E+-x,da)]):n==mxConstants.DIRECTION_WEST?(x=x?Math.max(0,Math.min(M,C)):M*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da),new mxPoint(E+M,da),new mxPoint(E+M-x,da+sa),new mxPoint(E+x,da+sa),new mxPoint(E,da)]):n==mxConstants.DIRECTION_NORTH?(x=x?Math.max(0,Math.min(sa,C)):sa*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da+x),new mxPoint(E+M,da),new mxPoint(E+M,da+sa),new mxPoint(E,da+sa-x),new mxPoint(E,da+x)]):(x=x?Math.max(0,Math.min(sa,C)):sa*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da),new mxPoint(E+-M,da+x),new mxPoint(E+M,da+sa-x),new mxPoint(E,da+sa),new mxPoint(E,da)]);sa=d.getCenterX();d=d.getCenterY();d=new mxPoint(sa,d);u&&(z.x<E||z.x>E+M?d.y=z.y:d.x=z.x);return mxUtils.getPerimeterPoint(da,d,z)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(d,n,z,u){var x="0"!=mxUtils.getValue(n.style,"fixedSize","0"),C=x?ja.prototype.fixedSize:ja.prototype.size;null!=n&&(C=mxUtils.getValue(n.style,"size",C));x&&(C*=n.view.scale);var E=-d.x,da=d.y,M=d.width,sa=d.height,ma=d.getCenterX();d=d.getCenterY();n=null!=n?mxUtils.getValue(n.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;n==mxConstants.DIRECTION_EAST?(x=x?Math.max(0,Math.min(M,C)):M*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da),new mxPoint(E+M-x,da),new mxPoint(E+M,d),new mxPoint(E+M-x,da+sa),new mxPoint(E,da+sa),new mxPoint(E+x,d),new mxPoint(E,da)]):n==mxConstants.DIRECTION_WEST?(x=x?Math.max(0,Math.min(M,C)):M*Math.max(0,Math.min(1,-C)),da=[new mxPoint(E+x,da),new mxPoint(E+M,da),new mxPoint(E+M-x,d),new mxPoint(E+M,da+sa),new mxPoint(E+x,da+sa),new mxPoint(E,d),new mxPoint(E+x,da)]):n==mxConstants.DIRECTION_NORTH?(x=x?Math.max(0,Math.min(sa,C)):sa*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da+x),new mxPoint(ma,da),new mxPoint(E+M,da+x),new mxPoint(E+M,da+sa),new mxPoint(ma,da+sa-x),new mxPoint(E,da+sa),new mxPoint(E,da+x)]):(x=x?Math.max(0,Math.min(sa,C)):sa*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da),new mxPoint(ma,da+-x),new mxPoint(E+M,da),new mxPoint(E+M,da+sa-x),new mxPoint(ma,da+sa),new mxPoint(E,da+sa-x),new mxPoint(E,da)]);ma=new mxPoint(ma,d);u&&(z.x<E||z.x>E+M?ma.y=z.y:ma.x=z.x);return mxUtils.getPerimeterPoint(da,ma,z)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(d,n,z,u){var x="0"!=mxUtils.getValue(n.style,"fixedSize","0"),C=x?ca.prototype.fixedSize:ca.prototype.size;null!=n&&(C=mxUtils.getValue(n.style,"size",C));x&&(C*=n.view.scale);var E=-d.x,da=d.y,M=d.width,sa=d.height,ma=d.getCenterX();d=d.getCenterY();n=null!=n?mxUtils.getValue(n.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;n==mxConstants.DIRECTION_NORTH||n==mxConstants.DIRECTION_SOUTH?(x=x?Math.max(0,Math.min(sa,C)):sa*Math.max(0,Math.min(1,C)),da=[new mxPoint(ma,da),new mxPoint(E+M,da+x),new mxPoint(E+M,da+sa-x),new mxPoint(ma,da+sa),new mxPoint(E,da+sa-x),new mxPoint(E,da+x),new mxPoint(ma,da)]):(x=x?Math.max(0,Math.min(M,C)):M*Math.max(0,-Math.min(1,C)),da=[new mxPoint(E+x,da),new mxPoint(E+M-x,da),new mxPoint(E+M,d),new mxPoint(E+M-x,da+sa),new mxPoint(E+x,da+sa),new mxPoint(E,d),new mxPoint(E+x,da)]);ma=new mxPoint(ma,d);u&&(z.x<E||z.x>E+M?ma.y=z.y:ma.x=z.x);return mxUtils.getPerimeterPoint(da,ma,z)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(ka,mxShape);ka.prototype.size=10;ka.prototype.paintBackground=function(d,n,z,u,x){var C=parseFloat(mxUtils.getValue(this.style,"size",this.size));-d.translate(n,z);d.ellipse((u-C)/2,0,C,C);d.fillAndStroke();d.begin();d.moveTo(u/2,C);d.lineTo(u/2,x);d.end();d.stroke()};mxCellRenderer.registerShape("lollipop",ka);mxUtils.extend(va,mxShape);va.prototype.size=10;va.prototype.inset=2;va.prototype.paintBackground=function(d,n,z,u,x){var C=parseFloat(mxUtils.getValue(this.style,"size",this.size)),E=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;d.translate(n,z);d.begin();d.moveTo(u/2,C+E);d.lineTo(u/2,x);d.end();d.stroke();-d.begin();d.moveTo((u-C)/2-E,C/2);d.quadTo((u-C)/2-E,C+E,u/2,C+E);d.quadTo((u+C)/2+E,C+E,(u+C)/2+E,C/2);d.end();d.stroke()};mxCellRenderer.registerShape("requires",va);mxUtils.extend(ua,mxShape);ua.prototype.paintBackground=function(d,n,z,u,x){d.translate(n,z);d.begin();d.moveTo(0,0);d.quadTo(u,0,u,x/2);d.quadTo(u,x,0,x);d.end();d.stroke()};mxCellRenderer.registerShape("requiredInterface",ua);mxUtils.extend(qa,mxShape);qa.prototype.inset=2;qa.prototype.paintBackground=function(d,n,z,u,x){var C=parseFloat(mxUtils.getValue(this.style,-"inset",this.inset))+this.strokewidth;d.translate(n,z);d.ellipse(0,C,u-2*C,x-2*C);d.fillAndStroke();d.begin();d.moveTo(u/2,0);d.quadTo(u,0,u,x/2);d.quadTo(u,x,u/2,x);d.end();d.stroke()};mxCellRenderer.registerShape("providedRequiredInterface",qa);mxUtils.extend(Ba,mxCylinder);Ba.prototype.jettyWidth=20;Ba.prototype.jettyHeight=10;Ba.prototype.redrawPath=function(d,n,z,u,x,C){var E=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));n=parseFloat(mxUtils.getValue(this.style,"jettyHeight",-this.jettyHeight));z=E/2;E=z+E/2;var da=Math.min(n,x-n),M=Math.min(da+2*n,x-n);C?(d.moveTo(z,da),d.lineTo(E,da),d.lineTo(E,da+n),d.lineTo(z,da+n),d.moveTo(z,M),d.lineTo(E,M),d.lineTo(E,M+n),d.lineTo(z,M+n)):(d.moveTo(z,0),d.lineTo(u,0),d.lineTo(u,x),d.lineTo(z,x),d.lineTo(z,M+n),d.lineTo(0,M+n),d.lineTo(0,M),d.lineTo(z,M),d.lineTo(z,da+n),d.lineTo(0,da+n),d.lineTo(0,da),d.lineTo(z,da),d.close());d.end()};mxCellRenderer.registerShape("module",Ba);mxUtils.extend(ya,mxCylinder);ya.prototype.jettyWidth=-32;ya.prototype.jettyHeight=12;ya.prototype.redrawPath=function(d,n,z,u,x,C){var E=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));n=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));z=E/2;E=z+E/2;var da=.3*x-n/2,M=.7*x-n/2;C?(d.moveTo(z,da),d.lineTo(E,da),d.lineTo(E,da+n),d.lineTo(z,da+n),d.moveTo(z,M),d.lineTo(E,M),d.lineTo(E,M+n),d.lineTo(z,M+n)):(d.moveTo(z,0),d.lineTo(u,0),d.lineTo(u,x),d.lineTo(z,x),d.lineTo(z,M+n),d.lineTo(0,M+n),d.lineTo(0,M),d.lineTo(z,-M),d.lineTo(z,da+n),d.lineTo(0,da+n),d.lineTo(0,da),d.lineTo(z,da),d.close());d.end()};mxCellRenderer.registerShape("component",ya);mxUtils.extend(La,mxRectangleShape);La.prototype.paintForeground=function(d,n,z,u,x){var C=u/2,E=x/2,da=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;d.begin();this.addPoints(d,[new mxPoint(n+C,z),new mxPoint(n+u,z+E),new mxPoint(n+C,z+x),new mxPoint(n,z+E)],this.isRounded,da,!0);d.stroke();mxRectangleShape.prototype.paintForeground.apply(this,-arguments)};mxCellRenderer.registerShape("associativeEntity",La);mxUtils.extend(za,mxDoubleEllipse);za.prototype.outerStroke=!0;za.prototype.paintVertexShape=function(d,n,z,u,x){var C=Math.min(4,Math.min(u/5,x/5));0<u&&0<x&&(d.ellipse(n+C,z+C,u-2*C,x-2*C),d.fillAndStroke());d.setShadow(!1);this.outerStroke&&(d.ellipse(n,z,u,x),d.stroke())};mxCellRenderer.registerShape("endState",za);mxUtils.extend(Ea,za);Ea.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState",Ea);mxUtils.extend(pa,mxArrowConnector);+mxConstants.LINE_ARCSIZE)/2)):(C=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,C=Math.min(u*C,x*C)),d.moveTo(p+C,z),d.lineTo(p+u-C,z),d.quadTo(p+u,z,p+u,z+C),d.lineTo(p+u,z+x-C),d.quadTo(p+u,z+x,p+u-C,z+x),d.lineTo(p+C,z+x),d.quadTo(p,z+x,p,z+x-C),d.lineTo(p,z+C),d.quadTo(p,z,p+C,z)):(d.moveTo(p,z),d.lineTo(p+u,z),d.lineTo(p+u,z+x),d.lineTo(p,z+x),d.lineTo(p,z)),d.close(),d.end(),d.fillAndStroke()}};mxUtils.extend(na,mxRectangleShape);na.prototype.size=+.1;na.prototype.fixedSize=!1;na.prototype.isHtmlAllowed=function(){return!1};na.prototype.getLabelBounds=function(d){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)){var p=d.width,z=d.height;d=new mxRectangle(d.x,d.y,p,z);var u=p*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded){var x=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,+100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;u=Math.max(u,Math.min(p*x,z*x))}d.x+=Math.round(u);d.width-=Math.round(2*u);return d}return d};na.prototype.paintForeground=function(d,p,z,u,x){var C=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),E=parseFloat(mxUtils.getValue(this.style,"size",this.size));E=C?Math.max(0,Math.min(u,E)):u*Math.max(0,Math.min(1,E));this.isRounded&&(C=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,E=Math.max(E,+Math.min(u*C,x*C)));E=Math.round(E);d.begin();d.moveTo(p+E,z);d.lineTo(p+E,z+x);d.moveTo(p+u-E,z);d.lineTo(p+u-E,z+x);d.end();d.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("process",na);mxCellRenderer.registerShape("process2",na);mxUtils.extend(W,mxRectangleShape);W.prototype.paintBackground=function(d,p,z,u,x){d.setFillColor(mxConstants.NONE);d.rect(p,z,u,x);d.fill()};W.prototype.paintForeground=function(d,p,z,u,x){};mxCellRenderer.registerShape("transparent",+W);mxUtils.extend(ba,mxHexagon);ba.prototype.size=30;ba.prototype.position=.5;ba.prototype.position2=.5;ba.prototype.base=20;ba.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};ba.prototype.isRoundable=function(){return!0};ba.prototype.redrawPath=function(d,p,z,u,x){p=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;z=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,+"size",this.size))));var C=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),E=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2)))),da=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(d,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,x-z),new mxPoint(Math.min(u,C+da),x-z),new mxPoint(E,x),new mxPoint(Math.max(0,C),x-z),new mxPoint(0,x-z)],this.isRounded,p,!0,[4])};mxCellRenderer.registerShape("callout",+ba);mxUtils.extend(ja,mxActor);ja.prototype.size=.2;ja.prototype.fixedSize=20;ja.prototype.isRoundable=function(){return!0};ja.prototype.redrawPath=function(d,p,z,u,x){p="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,+0),new mxPoint(u-p,0),new mxPoint(u,x/2),new mxPoint(u-p,x),new mxPoint(0,x),new mxPoint(p,x/2)],this.isRounded,z,!0);d.end()};mxCellRenderer.registerShape("step",ja);mxUtils.extend(ca,mxHexagon);ca.prototype.size=.25;ca.prototype.fixedSize=20;ca.prototype.isRoundable=function(){return!0};ca.prototype.redrawPath=function(d,p,z,u,x){p="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,+"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(p,0),new mxPoint(u-p,0),new mxPoint(u,.5*x),new mxPoint(u-p,x),new mxPoint(p,x),new mxPoint(0,.5*x)],this.isRounded,z,!0)};mxCellRenderer.registerShape("hexagon",ca);mxUtils.extend(la,mxRectangleShape);la.prototype.isHtmlAllowed=function(){return!1};la.prototype.paintForeground=function(d,p,z,u,x){var C=Math.min(u/5,x/5)+1;d.begin();d.moveTo(p+u/2,z+C);d.lineTo(p++u/2,z+x-C);d.moveTo(p+C,z+x/2);d.lineTo(p+u-C,z+x/2);d.end();d.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",la);var ob=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(d){if(1==this.style["double"]){var p=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(d.x+p,d.y+p,d.width-2*p,d.height-2*p)}return d};mxRhombus.prototype.paintVertexShape=+function(d,p,z,u,x){ob.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var C=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);p+=C;z+=C;u-=2*C;x-=2*C;0<u&&0<x&&(d.setShadow(!1),ob.apply(this,[d,p,z,u,x]))}};mxUtils.extend(Q,mxRectangleShape);Q.prototype.isHtmlAllowed=function(){return!1};Q.prototype.getLabelBounds=function(d){if(1==this.style["double"]){var p=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;+return new mxRectangle(d.x+p,d.y+p,d.width-2*p,d.height-2*p)}return d};Q.prototype.paintForeground=function(d,p,z,u,x){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var C=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);p+=C;z+=C;u-=2*C;x-=2*C;0<u&&0<x&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}d.setDashed(!1);C=0;do{var E=mxCellRenderer.defaultShapes[this.style["symbol"+C]];if(null!=E){var da=this.style["symbol"+C+"Align"],+M=this.style["symbol"+C+"VerticalAlign"],sa=this.style["symbol"+C+"Width"],ma=this.style["symbol"+C+"Height"],Wa=this.style["symbol"+C+"Spacing"]||0,gb=this.style["symbol"+C+"VSpacing"]||Wa,bb=this.style["symbol"+C+"ArcSpacing"];null!=bb&&(bb*=this.getArcSize(u+this.strokewidth,x+this.strokewidth),Wa+=bb,gb+=bb);bb=p;var Fa=z;bb=da==mxConstants.ALIGN_CENTER?bb+(u-sa)/2:da==mxConstants.ALIGN_RIGHT?bb+(u-sa-Wa):bb+Wa;Fa=M==mxConstants.ALIGN_MIDDLE?Fa+(x-ma)/2:M==mxConstants.ALIGN_BOTTOM?Fa+(x-ma-gb):+Fa+gb;d.save();da=new E;da.style=this.style;E.prototype.paintVertexShape.call(da,d,bb,Fa,sa,ma);d.restore()}C++}while(null!=E)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",Q);mxUtils.extend(k,mxCylinder);k.prototype.redrawPath=function(d,p,z,u,x,C){C?(d.moveTo(0,0),d.lineTo(u/2,x/2),d.lineTo(u,0),d.end()):(d.moveTo(0,0),d.lineTo(u,0),d.lineTo(u,x),d.lineTo(0,x),d.close())};mxCellRenderer.registerShape("message",k);mxUtils.extend(B,mxShape);B.prototype.paintBackground=+function(d,p,z,u,x){d.translate(p,z);d.ellipse(u/4,0,u/2,x/4);d.fillAndStroke();d.begin();d.moveTo(u/2,x/4);d.lineTo(u/2,2*x/3);d.moveTo(u/2,x/3);d.lineTo(0,x/3);d.moveTo(u/2,x/3);d.lineTo(u,x/3);d.moveTo(u/2,2*x/3);d.lineTo(0,x);d.moveTo(u/2,2*x/3);d.lineTo(u,x);d.end();d.stroke()};mxCellRenderer.registerShape("umlActor",B);mxUtils.extend(I,mxShape);I.prototype.getLabelMargins=function(d){return new mxRectangle(d.width/6,0,0,0)};I.prototype.paintBackground=function(d,p,z,u,x){d.translate(p,z);d.begin();+d.moveTo(0,x/4);d.lineTo(0,3*x/4);d.end();d.stroke();d.begin();d.moveTo(0,x/2);d.lineTo(u/6,x/2);d.end();d.stroke();d.ellipse(u/6,0,5*u/6,x);d.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",I);mxUtils.extend(U,mxEllipse);U.prototype.paintVertexShape=function(d,p,z,u,x){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.begin();d.moveTo(p+u/8,z+x);d.lineTo(p+7*u/8,z+x);d.end();d.stroke()};mxCellRenderer.registerShape("umlEntity",U);mxUtils.extend(P,mxShape);P.prototype.paintVertexShape=+function(d,p,z,u,x){d.translate(p,z);d.begin();d.moveTo(u,0);d.lineTo(0,x);d.moveTo(0,0);d.lineTo(u,x);d.end();d.stroke()};mxCellRenderer.registerShape("umlDestroy",P);mxUtils.extend(T,mxShape);T.prototype.getLabelBounds=function(d){return new mxRectangle(d.x,d.y+d.height/8,d.width,7*d.height/8)};T.prototype.paintBackground=function(d,p,z,u,x){d.translate(p,z);d.begin();d.moveTo(3*u/8,x/8*1.1);d.lineTo(5*u/8,0);d.end();d.stroke();d.ellipse(0,x/8,u,7*x/8);d.fillAndStroke()};T.prototype.paintForeground=+function(d,p,z,u,x){d.begin();d.moveTo(3*u/8,x/8*1.1);d.lineTo(5*u/8,x/4);d.end();d.stroke()};mxCellRenderer.registerShape("umlControl",T);mxUtils.extend(X,mxRectangleShape);X.prototype.size=40;X.prototype.isHtmlAllowed=function(){return!1};X.prototype.getLabelBounds=function(d){var p=Math.max(0,Math.min(d.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(d.x,d.y,d.width,p)};X.prototype.paintBackground=function(d,p,z,u,x){var C=Math.max(0,Math.min(x,+parseFloat(mxUtils.getValue(this.style,"size",this.size)))),E=mxUtils.getValue(this.style,"participant");null==E||null==this.state?mxRectangleShape.prototype.paintBackground.call(this,d,p,z,u,C):(E=this.state.view.graph.cellRenderer.getShape(E),null!=E&&E!=X&&(E=new E,E.apply(this.state),d.save(),E.paintVertexShape(d,p,z,u,C),d.restore()));C<x&&(d.setDashed("1"==mxUtils.getValue(this.style,"lifelineDashed","1")),d.begin(),d.moveTo(p+u/2,z+C),d.lineTo(p+u/2,z+x),d.end(),d.stroke())};X.prototype.paintForeground=+function(d,p,z,u,x){var C=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,d,p,z,u,Math.min(x,C))};mxCellRenderer.registerShape("umlLifeline",X);mxUtils.extend(Z,mxShape);Z.prototype.width=60;Z.prototype.height=30;Z.prototype.corner=10;Z.prototype.configurePointerEvents=function(d){var p=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);null==this.style||null!=p&&p!=mxConstants.NONE&&+0!=this.opacity&&0!=this.fillOpacity||"0"!=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||(d.pointerEvents=!1)};Z.prototype.getLabelMargins=function(d){return new mxRectangle(0,0,d.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),d.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};Z.prototype.paintBackground=function(d,p,z,u,x){var C=this.corner,E=Math.min(u,Math.max(C,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),+da=Math.min(x,Math.max(1.5*C,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),M=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);M!=mxConstants.NONE&&(d.setFillColor(M),d.rect(p,z,u,x),d.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(d,p,z,u,x),d.setGradient(this.fill,this.gradient,p,z,u,x,this.gradientDirection)):d.setFillColor(this.fill);d.pointerEvents=!0;d.begin();d.moveTo(p,+z);d.lineTo(p+E,z);d.lineTo(p+E,z+Math.max(0,da-1.5*C));d.lineTo(p+Math.max(0,E-C),z+da);d.lineTo(p,z+da);d.close();d.fillAndStroke();this.configurePointerEvents(d);d.begin();d.moveTo(p+E,z);d.lineTo(p+u,z);d.lineTo(p+u,z+x);d.lineTo(p,z+x);d.lineTo(p,z+da);d.stroke()};mxCellRenderer.registerShape("umlFrame",Z);mxPerimeter.CenterPerimeter=function(d,p,z,u){return new mxPoint(d.getCenterX(),d.getCenterY())};mxStyleRegistry.putValue("centerPerimeter",mxPerimeter.CenterPerimeter);mxPerimeter.LifelinePerimeter=+function(d,p,z,u){u=X.prototype.size;null!=p&&(u=mxUtils.getValue(p.style,"size",u)*p.view.scale);p=parseFloat(p.style[mxConstants.STYLE_STROKEWIDTH]||1)*p.view.scale/2-1;z.x<d.getCenterX()&&(p=-1*(p+1));return new mxPoint(d.getCenterX()+p,Math.min(d.y+d.height,Math.max(d.y+u,z.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);mxPerimeter.OrthogonalPerimeter=function(d,p,z,u){u=!0;return mxPerimeter.RectanglePerimeter.apply(this,arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",+mxPerimeter.OrthogonalPerimeter);mxPerimeter.BackbonePerimeter=function(d,p,z,u){u=parseFloat(p.style[mxConstants.STYLE_STROKEWIDTH]||1)*p.view.scale/2-1;null!=p.style.backboneSize&&(u+=parseFloat(p.style.backboneSize)*p.view.scale/2-1);if("south"==p.style[mxConstants.STYLE_DIRECTION]||"north"==p.style[mxConstants.STYLE_DIRECTION])return z.x<d.getCenterX()&&(u=-1*(u+1)),new mxPoint(d.getCenterX()+u,Math.min(d.y+d.height,Math.max(d.y,z.y)));z.y<d.getCenterY()&&(u=-1*(u+1));return new mxPoint(Math.min(d.x++d.width,Math.max(d.x,z.x)),d.getCenterY()+u)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(d,p,z,u){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(d,new mxRectangle(0,0,0,Math.max(0,Math.min(d.height,parseFloat(mxUtils.getValue(p.style,"size",ba.prototype.size))*p.view.scale))),p.style),p,z,u)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);mxPerimeter.ParallelogramPerimeter=function(d,+p,z,u){var x="0"!=mxUtils.getValue(p.style,"fixedSize","0"),C=x?J.prototype.fixedSize:J.prototype.size;null!=p&&(C=mxUtils.getValue(p.style,"size",C));x&&(C*=p.view.scale);var E=d.x,da=d.y,M=d.width,sa=d.height;p=null!=p?mxUtils.getValue(p.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;p==mxConstants.DIRECTION_NORTH||p==mxConstants.DIRECTION_SOUTH?(x=x?Math.max(0,Math.min(sa,C)):sa*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da),new mxPoint(E+M,da+x),new mxPoint(E++M,da+sa),new mxPoint(E,da+sa-x),new mxPoint(E,da)]):(x=x?Math.max(0,Math.min(.5*M,C)):M*Math.max(0,Math.min(1,C)),da=[new mxPoint(E+x,da),new mxPoint(E+M,da),new mxPoint(E+M-x,da+sa),new mxPoint(E,da+sa),new mxPoint(E+x,da)]);sa=d.getCenterX();d=d.getCenterY();d=new mxPoint(sa,d);u&&(z.x<E||z.x>E+M?d.y=z.y:d.x=z.x);return mxUtils.getPerimeterPoint(da,d,z)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(d,p,z,u){var x="0"!=+mxUtils.getValue(p.style,"fixedSize","0"),C=x?Y.prototype.fixedSize:Y.prototype.size;null!=p&&(C=mxUtils.getValue(p.style,"size",C));x&&(C*=p.view.scale);var E=d.x,da=d.y,M=d.width,sa=d.height;p=null!=p?mxUtils.getValue(p.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;p==mxConstants.DIRECTION_EAST?(x=x?Math.max(0,Math.min(.5*M,C)):M*Math.max(0,Math.min(1,C)),da=[new mxPoint(E+x,da),new mxPoint(E+M-x,da),new mxPoint(E+M,da+sa),new mxPoint(E,da+sa),new mxPoint(E++x,da)]):p==mxConstants.DIRECTION_WEST?(x=x?Math.max(0,Math.min(M,C)):M*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da),new mxPoint(E+M,da),new mxPoint(E+M-x,da+sa),new mxPoint(E+x,da+sa),new mxPoint(E,da)]):p==mxConstants.DIRECTION_NORTH?(x=x?Math.max(0,Math.min(sa,C)):sa*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da+x),new mxPoint(E+M,da),new mxPoint(E+M,da+sa),new mxPoint(E,da+sa-x),new mxPoint(E,da+x)]):(x=x?Math.max(0,Math.min(sa,C)):sa*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da),new mxPoint(E++M,da+x),new mxPoint(E+M,da+sa-x),new mxPoint(E,da+sa),new mxPoint(E,da)]);sa=d.getCenterX();d=d.getCenterY();d=new mxPoint(sa,d);u&&(z.x<E||z.x>E+M?d.y=z.y:d.x=z.x);return mxUtils.getPerimeterPoint(da,d,z)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(d,p,z,u){var x="0"!=mxUtils.getValue(p.style,"fixedSize","0"),C=x?ja.prototype.fixedSize:ja.prototype.size;null!=p&&(C=mxUtils.getValue(p.style,"size",C));x&&(C*=p.view.scale);var E=+d.x,da=d.y,M=d.width,sa=d.height,ma=d.getCenterX();d=d.getCenterY();p=null!=p?mxUtils.getValue(p.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;p==mxConstants.DIRECTION_EAST?(x=x?Math.max(0,Math.min(M,C)):M*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da),new mxPoint(E+M-x,da),new mxPoint(E+M,d),new mxPoint(E+M-x,da+sa),new mxPoint(E,da+sa),new mxPoint(E+x,d),new mxPoint(E,da)]):p==mxConstants.DIRECTION_WEST?(x=x?Math.max(0,Math.min(M,C)):M*Math.max(0,Math.min(1,+C)),da=[new mxPoint(E+x,da),new mxPoint(E+M,da),new mxPoint(E+M-x,d),new mxPoint(E+M,da+sa),new mxPoint(E+x,da+sa),new mxPoint(E,d),new mxPoint(E+x,da)]):p==mxConstants.DIRECTION_NORTH?(x=x?Math.max(0,Math.min(sa,C)):sa*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da+x),new mxPoint(ma,da),new mxPoint(E+M,da+x),new mxPoint(E+M,da+sa),new mxPoint(ma,da+sa-x),new mxPoint(E,da+sa),new mxPoint(E,da+x)]):(x=x?Math.max(0,Math.min(sa,C)):sa*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da),new mxPoint(ma,da++x),new mxPoint(E+M,da),new mxPoint(E+M,da+sa-x),new mxPoint(ma,da+sa),new mxPoint(E,da+sa-x),new mxPoint(E,da)]);ma=new mxPoint(ma,d);u&&(z.x<E||z.x>E+M?ma.y=z.y:ma.x=z.x);return mxUtils.getPerimeterPoint(da,ma,z)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(d,p,z,u){var x="0"!=mxUtils.getValue(p.style,"fixedSize","0"),C=x?ca.prototype.fixedSize:ca.prototype.size;null!=p&&(C=mxUtils.getValue(p.style,"size",C));x&&(C*=p.view.scale);var E=+d.x,da=d.y,M=d.width,sa=d.height,ma=d.getCenterX();d=d.getCenterY();p=null!=p?mxUtils.getValue(p.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;p==mxConstants.DIRECTION_NORTH||p==mxConstants.DIRECTION_SOUTH?(x=x?Math.max(0,Math.min(sa,C)):sa*Math.max(0,Math.min(1,C)),da=[new mxPoint(ma,da),new mxPoint(E+M,da+x),new mxPoint(E+M,da+sa-x),new mxPoint(ma,da+sa),new mxPoint(E,da+sa-x),new mxPoint(E,da+x),new mxPoint(ma,da)]):(x=x?Math.max(0,Math.min(M,C)):M*Math.max(0,+Math.min(1,C)),da=[new mxPoint(E+x,da),new mxPoint(E+M-x,da),new mxPoint(E+M,d),new mxPoint(E+M-x,da+sa),new mxPoint(E+x,da+sa),new mxPoint(E,d),new mxPoint(E+x,da)]);ma=new mxPoint(ma,d);u&&(z.x<E||z.x>E+M?ma.y=z.y:ma.x=z.x);return mxUtils.getPerimeterPoint(da,ma,z)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(ka,mxShape);ka.prototype.size=10;ka.prototype.paintBackground=function(d,p,z,u,x){var C=parseFloat(mxUtils.getValue(this.style,"size",this.size));+d.translate(p,z);d.ellipse((u-C)/2,0,C,C);d.fillAndStroke();d.begin();d.moveTo(u/2,C);d.lineTo(u/2,x);d.end();d.stroke()};mxCellRenderer.registerShape("lollipop",ka);mxUtils.extend(va,mxShape);va.prototype.size=10;va.prototype.inset=2;va.prototype.paintBackground=function(d,p,z,u,x){var C=parseFloat(mxUtils.getValue(this.style,"size",this.size)),E=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;d.translate(p,z);d.begin();d.moveTo(u/2,C+E);d.lineTo(u/2,x);d.end();d.stroke();+d.begin();d.moveTo((u-C)/2-E,C/2);d.quadTo((u-C)/2-E,C+E,u/2,C+E);d.quadTo((u+C)/2+E,C+E,(u+C)/2+E,C/2);d.end();d.stroke()};mxCellRenderer.registerShape("requires",va);mxUtils.extend(ua,mxShape);ua.prototype.paintBackground=function(d,p,z,u,x){d.translate(p,z);d.begin();d.moveTo(0,0);d.quadTo(u,0,u,x/2);d.quadTo(u,x,0,x);d.end();d.stroke()};mxCellRenderer.registerShape("requiredInterface",ua);mxUtils.extend(qa,mxShape);qa.prototype.inset=2;qa.prototype.paintBackground=function(d,p,z,u,x){var C=parseFloat(mxUtils.getValue(this.style,+"inset",this.inset))+this.strokewidth;d.translate(p,z);d.ellipse(0,C,u-2*C,x-2*C);d.fillAndStroke();d.begin();d.moveTo(u/2,0);d.quadTo(u,0,u,x/2);d.quadTo(u,x,u/2,x);d.end();d.stroke()};mxCellRenderer.registerShape("providedRequiredInterface",qa);mxUtils.extend(Ba,mxCylinder);Ba.prototype.jettyWidth=20;Ba.prototype.jettyHeight=10;Ba.prototype.redrawPath=function(d,p,z,u,x,C){var E=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));p=parseFloat(mxUtils.getValue(this.style,"jettyHeight",+this.jettyHeight));z=E/2;E=z+E/2;var da=Math.min(p,x-p),M=Math.min(da+2*p,x-p);C?(d.moveTo(z,da),d.lineTo(E,da),d.lineTo(E,da+p),d.lineTo(z,da+p),d.moveTo(z,M),d.lineTo(E,M),d.lineTo(E,M+p),d.lineTo(z,M+p)):(d.moveTo(z,0),d.lineTo(u,0),d.lineTo(u,x),d.lineTo(z,x),d.lineTo(z,M+p),d.lineTo(0,M+p),d.lineTo(0,M),d.lineTo(z,M),d.lineTo(z,da+p),d.lineTo(0,da+p),d.lineTo(0,da),d.lineTo(z,da),d.close());d.end()};mxCellRenderer.registerShape("module",Ba);mxUtils.extend(ya,mxCylinder);ya.prototype.jettyWidth=+32;ya.prototype.jettyHeight=12;ya.prototype.redrawPath=function(d,p,z,u,x,C){var E=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));p=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));z=E/2;E=z+E/2;var da=.3*x-p/2,M=.7*x-p/2;C?(d.moveTo(z,da),d.lineTo(E,da),d.lineTo(E,da+p),d.lineTo(z,da+p),d.moveTo(z,M),d.lineTo(E,M),d.lineTo(E,M+p),d.lineTo(z,M+p)):(d.moveTo(z,0),d.lineTo(u,0),d.lineTo(u,x),d.lineTo(z,x),d.lineTo(z,M+p),d.lineTo(0,M+p),d.lineTo(0,M),d.lineTo(z,+M),d.lineTo(z,da+p),d.lineTo(0,da+p),d.lineTo(0,da),d.lineTo(z,da),d.close());d.end()};mxCellRenderer.registerShape("component",ya);mxUtils.extend(La,mxRectangleShape);La.prototype.paintForeground=function(d,p,z,u,x){var C=u/2,E=x/2,da=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;d.begin();this.addPoints(d,[new mxPoint(p+C,z),new mxPoint(p+u,z+E),new mxPoint(p+C,z+x),new mxPoint(p,z+E)],this.isRounded,da,!0);d.stroke();mxRectangleShape.prototype.paintForeground.apply(this,+arguments)};mxCellRenderer.registerShape("associativeEntity",La);mxUtils.extend(za,mxDoubleEllipse);za.prototype.outerStroke=!0;za.prototype.paintVertexShape=function(d,p,z,u,x){var C=Math.min(4,Math.min(u/5,x/5));0<u&&0<x&&(d.ellipse(p+C,z+C,u-2*C,x-2*C),d.fillAndStroke());d.setShadow(!1);this.outerStroke&&(d.ellipse(p,z,u,x),d.stroke())};mxCellRenderer.registerShape("endState",za);mxUtils.extend(Ea,za);Ea.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState",Ea);mxUtils.extend(pa,mxArrowConnector);pa.prototype.defaultWidth=4;pa.prototype.isOpenEnded=function(){return!0};pa.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};pa.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",pa);mxUtils.extend(Ca,mxArrowConnector);Ca.prototype.defaultWidth=10;Ca.prototype.defaultArrowWidth=20;Ca.prototype.getStartArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,-"startWidth",this.defaultArrowWidth)};Ca.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};Ca.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",Ca);mxUtils.extend(Aa,mxActor);Aa.prototype.size=30;Aa.prototype.isRoundable=function(){return!0};Aa.prototype.redrawPath=function(d,n,z,u,x){n=Math.min(x,parseFloat(mxUtils.getValue(this.style,-"size",this.size)));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,x),new mxPoint(0,n),new mxPoint(u,0),new mxPoint(u,x)],this.isRounded,z,!0);d.end()};mxCellRenderer.registerShape("manualInput",Aa);mxUtils.extend(wa,mxRectangleShape);wa.prototype.dx=20;wa.prototype.dy=20;wa.prototype.isHtmlAllowed=function(){return!1};wa.prototype.paintForeground=function(d,n,z,u,x){mxRectangleShape.prototype.paintForeground.apply(this,arguments);-var C=0;if(this.isRounded){var E=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;C=Math.max(C,Math.min(u*E,x*E))}E=Math.max(C,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));C=Math.max(C,Math.min(x,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));d.begin();d.moveTo(n,z+C);d.lineTo(n+u,z+C);d.end();d.stroke();d.begin();d.moveTo(n+E,z);d.lineTo(n+E,z+x);d.end();d.stroke()};mxCellRenderer.registerShape("internalStorage",wa);-mxUtils.extend(Ya,mxActor);Ya.prototype.dx=20;Ya.prototype.dy=20;Ya.prototype.isRoundable=function(){return!0};Ya.prototype.redrawPath=function(d,n,z,u,x){n=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));z=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var C=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,0),new mxPoint(u,-0),new mxPoint(u,z),new mxPoint(n,z),new mxPoint(n,x),new mxPoint(0,x)],this.isRounded,C,!0);d.end()};mxCellRenderer.registerShape("corner",Ya);mxUtils.extend(Qa,mxActor);Qa.prototype.redrawPath=function(d,n,z,u,x){d.moveTo(0,0);d.lineTo(0,x);d.end();d.moveTo(u,0);d.lineTo(u,x);d.end();d.moveTo(0,x/2);d.lineTo(u,x/2);d.end()};mxCellRenderer.registerShape("crossbar",Qa);mxUtils.extend(Ra,mxActor);Ra.prototype.dx=20;Ra.prototype.dy=20;Ra.prototype.isRoundable=function(){return!0};Ra.prototype.redrawPath=-function(d,n,z,u,x){n=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));z=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var C=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,z),new mxPoint((u+n)/2,z),new mxPoint((u+n)/2,x),new mxPoint((u-n)/2,x),new mxPoint((u-n)/2,z),new mxPoint(0,-z)],this.isRounded,C,!0);d.end()};mxCellRenderer.registerShape("tee",Ra);mxUtils.extend(Sa,mxActor);Sa.prototype.arrowWidth=.3;Sa.prototype.arrowSize=.2;Sa.prototype.isRoundable=function(){return!0};Sa.prototype.redrawPath=function(d,n,z,u,x){var C=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));n=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));z=(x-C)/2;C=z+C;var E=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,-mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,z),new mxPoint(u-n,z),new mxPoint(u-n,0),new mxPoint(u,x/2),new mxPoint(u-n,x),new mxPoint(u-n,C),new mxPoint(0,C)],this.isRounded,E,!0);d.end()};mxCellRenderer.registerShape("singleArrow",Sa);mxUtils.extend(Ha,mxActor);Ha.prototype.isRoundable=function(){return!0};Ha.prototype.redrawPath=function(d,n,z,u,x){var C=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",Sa.prototype.arrowWidth))));n=u*Math.max(0,Math.min(1,-parseFloat(mxUtils.getValue(this.style,"arrowSize",Sa.prototype.arrowSize))));z=(x-C)/2;C=z+C;var E=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,x/2),new mxPoint(n,0),new mxPoint(n,z),new mxPoint(u-n,z),new mxPoint(u-n,0),new mxPoint(u,x/2),new mxPoint(u-n,x),new mxPoint(u-n,C),new mxPoint(n,C),new mxPoint(n,x)],this.isRounded,E,!0);d.end()};mxCellRenderer.registerShape("doubleArrow",Ha);mxUtils.extend(Ma,mxActor);Ma.prototype.size=-.1;Ma.prototype.fixedSize=20;Ma.prototype.redrawPath=function(d,n,z,u,x){n="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.moveTo(n,0);d.lineTo(u,0);d.quadTo(u-2*n,x/2,u,x);d.lineTo(n,x);d.quadTo(n-2*n,x/2,n,0);d.close();d.end()};mxCellRenderer.registerShape("dataStorage",Ma);mxUtils.extend(y,mxActor);y.prototype.redrawPath=-function(d,n,z,u,x){d.moveTo(0,0);d.quadTo(u,0,u,x/2);d.quadTo(u,x,0,x);d.close();d.end()};mxCellRenderer.registerShape("or",y);mxUtils.extend(O,mxActor);O.prototype.redrawPath=function(d,n,z,u,x){d.moveTo(0,0);d.quadTo(u,0,u,x/2);d.quadTo(u,x,0,x);d.quadTo(u/2,x/2,0,0);d.close();d.end()};mxCellRenderer.registerShape("xor",O);mxUtils.extend(R,mxActor);R.prototype.size=20;R.prototype.isRoundable=function(){return!0};R.prototype.redrawPath=function(d,n,z,u,x){n=Math.min(u/2,Math.min(x,parseFloat(mxUtils.getValue(this.style,-"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(n,0),new mxPoint(u-n,0),new mxPoint(u,.8*n),new mxPoint(u,x),new mxPoint(0,x),new mxPoint(0,.8*n)],this.isRounded,z,!0);d.end()};mxCellRenderer.registerShape("loopLimit",R);mxUtils.extend(V,mxActor);V.prototype.size=.375;V.prototype.isRoundable=function(){return!0};V.prototype.redrawPath=function(d,n,z,u,x){n=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,-"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,x-n),new mxPoint(u/2,x),new mxPoint(0,x-n)],this.isRounded,z,!0);d.end()};mxCellRenderer.registerShape("offPageConnector",V);mxUtils.extend(fa,mxEllipse);fa.prototype.paintVertexShape=function(d,n,z,u,x){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.begin();d.moveTo(n+u/2,z+x);d.lineTo(n+u,z+x);d.end();d.stroke()};-mxCellRenderer.registerShape("tapeData",fa);mxUtils.extend(ia,mxEllipse);ia.prototype.paintVertexShape=function(d,n,z,u,x){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.setShadow(!1);d.begin();d.moveTo(n,z+x/2);d.lineTo(n+u,z+x/2);d.end();d.stroke();d.begin();d.moveTo(n+u/2,z);d.lineTo(n+u/2,z+x);d.end();d.stroke()};mxCellRenderer.registerShape("orEllipse",ia);mxUtils.extend(oa,mxEllipse);oa.prototype.paintVertexShape=function(d,n,z,u,x){mxEllipse.prototype.paintVertexShape.apply(this,-arguments);d.setShadow(!1);d.begin();d.moveTo(n+.145*u,z+.145*x);d.lineTo(n+.855*u,z+.855*x);d.end();d.stroke();d.begin();d.moveTo(n+.855*u,z+.145*x);d.lineTo(n+.145*u,z+.855*x);d.end();d.stroke()};mxCellRenderer.registerShape("sumEllipse",oa);mxUtils.extend(ta,mxRhombus);ta.prototype.paintVertexShape=function(d,n,z,u,x){mxRhombus.prototype.paintVertexShape.apply(this,arguments);d.setShadow(!1);d.begin();d.moveTo(n,z+x/2);d.lineTo(n+u,z+x/2);d.end();d.stroke()};mxCellRenderer.registerShape("sortShape",-ta);mxUtils.extend(ra,mxEllipse);ra.prototype.paintVertexShape=function(d,n,z,u,x){d.begin();d.moveTo(n,z);d.lineTo(n+u,z);d.lineTo(n+u/2,z+x/2);d.close();d.fillAndStroke();d.begin();d.moveTo(n,z+x);d.lineTo(n+u,z+x);d.lineTo(n+u/2,z+x/2);d.close();d.fillAndStroke()};mxCellRenderer.registerShape("collate",ra);mxUtils.extend(xa,mxEllipse);xa.prototype.paintVertexShape=function(d,n,z,u,x){var C=d.state.strokeWidth/2,E=10+2*C,da=z+x-E/2;d.begin();d.moveTo(n,z);d.lineTo(n,z+x);d.moveTo(n+C,da);d.lineTo(n+-C+E,da-E/2);d.moveTo(n+C,da);d.lineTo(n+C+E,da+E/2);d.moveTo(n+C,da);d.lineTo(n+u-C,da);d.moveTo(n+u,z);d.lineTo(n+u,z+x);d.moveTo(n+u-C,da);d.lineTo(n+u-E-C,da-E/2);d.moveTo(n+u-C,da);d.lineTo(n+u-E-C,da+E/2);d.end();d.stroke()};mxCellRenderer.registerShape("dimension",xa);mxUtils.extend(Da,mxEllipse);Da.prototype.drawHidden=!0;Da.prototype.paintVertexShape=function(d,n,z,u,x){this.outline||d.setStrokeColor(null);if(null!=this.style){var C=d.pointerEvents,E=null!=this.fill&&this.fill!=mxConstants.NONE;-"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||E||(d.pointerEvents=!1);var da="1"==mxUtils.getValue(this.style,"top","1"),M="1"==mxUtils.getValue(this.style,"left","1"),sa="1"==mxUtils.getValue(this.style,"right","1"),ma="1"==mxUtils.getValue(this.style,"bottom","1");this.drawHidden||E||this.outline||da||sa||ma||M?(d.rect(n,z,u,x),d.fill(),d.pointerEvents=C,d.setStrokeColor(this.stroke),d.setLineCap("square"),d.begin(),d.moveTo(n,z),this.outline||da?d.lineTo(n+u,z):d.moveTo(n+-u,z),this.outline||sa?d.lineTo(n+u,z+x):d.moveTo(n+u,z+x),this.outline||ma?d.lineTo(n,z+x):d.moveTo(n,z+x),(this.outline||M)&&d.lineTo(n,z),d.end(),d.stroke(),d.setLineCap("flat")):d.setStrokeColor(this.stroke)}};mxCellRenderer.registerShape("partialRectangle",Da);mxUtils.extend(Ia,mxEllipse);Ia.prototype.paintVertexShape=function(d,n,z,u,x){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.setShadow(!1);d.begin();"vertical"==mxUtils.getValue(this.style,"line")?(d.moveTo(n+u/2,z),d.lineTo(n+-u/2,z+x)):(d.moveTo(n,z+x/2),d.lineTo(n+u,z+x/2));d.end();d.stroke()};mxCellRenderer.registerShape("lineEllipse",Ia);mxUtils.extend(Xa,mxActor);Xa.prototype.redrawPath=function(d,n,z,u,x){n=Math.min(u,x/2);d.moveTo(0,0);d.lineTo(u-n,0);d.quadTo(u,0,u,x/2);d.quadTo(u,x,u-n,x);d.lineTo(0,x);d.close();d.end()};mxCellRenderer.registerShape("delay",Xa);mxUtils.extend(Za,mxActor);Za.prototype.size=.2;Za.prototype.redrawPath=function(d,n,z,u,x){n=Math.min(x,u);var C=Math.max(0,Math.min(n,n*parseFloat(mxUtils.getValue(this.style,-"size",this.size))));n=(x-C)/2;z=n+C;var E=(u-C)/2;C=E+C;d.moveTo(0,n);d.lineTo(E,n);d.lineTo(E,0);d.lineTo(C,0);d.lineTo(C,n);d.lineTo(u,n);d.lineTo(u,z);d.lineTo(C,z);d.lineTo(C,x);d.lineTo(E,x);d.lineTo(E,z);d.lineTo(0,z);d.close();d.end()};mxCellRenderer.registerShape("cross",Za);mxUtils.extend($a,mxActor);$a.prototype.size=.25;$a.prototype.redrawPath=function(d,n,z,u,x){n=Math.min(u,x/2);z=Math.min(u-n,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*u);d.moveTo(0,x/2);d.lineTo(z,-0);d.lineTo(u-n,0);d.quadTo(u,0,u,x/2);d.quadTo(u,x,u-n,x);d.lineTo(z,x);d.close();d.end()};mxCellRenderer.registerShape("display",$a);mxUtils.extend(Pa,mxActor);Pa.prototype.cst={RECT2:"mxgraph.basic.rect"};Pa.prototype.customProperties=[{name:"rectStyle",dispName:"Style",type:"enum",defVal:"square",enumList:[{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"size",dispName:"Corner Size",+"startWidth",this.defaultArrowWidth)};Ca.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};Ca.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",Ca);mxUtils.extend(Aa,mxActor);Aa.prototype.size=30;Aa.prototype.isRoundable=function(){return!0};Aa.prototype.redrawPath=function(d,p,z,u,x){p=Math.min(x,parseFloat(mxUtils.getValue(this.style,+"size",this.size)));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,x),new mxPoint(0,p),new mxPoint(u,0),new mxPoint(u,x)],this.isRounded,z,!0);d.end()};mxCellRenderer.registerShape("manualInput",Aa);mxUtils.extend(wa,mxRectangleShape);wa.prototype.dx=20;wa.prototype.dy=20;wa.prototype.isHtmlAllowed=function(){return!1};wa.prototype.paintForeground=function(d,p,z,u,x){mxRectangleShape.prototype.paintForeground.apply(this,arguments);+var C=0;if(this.isRounded){var E=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;C=Math.max(C,Math.min(u*E,x*E))}E=Math.max(C,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));C=Math.max(C,Math.min(x,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));d.begin();d.moveTo(p,z+C);d.lineTo(p+u,z+C);d.end();d.stroke();d.begin();d.moveTo(p+E,z);d.lineTo(p+E,z+x);d.end();d.stroke()};mxCellRenderer.registerShape("internalStorage",wa);+mxUtils.extend(Ya,mxActor);Ya.prototype.dx=20;Ya.prototype.dy=20;Ya.prototype.isRoundable=function(){return!0};Ya.prototype.redrawPath=function(d,p,z,u,x){p=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));z=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var C=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,0),new mxPoint(u,+0),new mxPoint(u,z),new mxPoint(p,z),new mxPoint(p,x),new mxPoint(0,x)],this.isRounded,C,!0);d.end()};mxCellRenderer.registerShape("corner",Ya);mxUtils.extend(Qa,mxActor);Qa.prototype.redrawPath=function(d,p,z,u,x){d.moveTo(0,0);d.lineTo(0,x);d.end();d.moveTo(u,0);d.lineTo(u,x);d.end();d.moveTo(0,x/2);d.lineTo(u,x/2);d.end()};mxCellRenderer.registerShape("crossbar",Qa);mxUtils.extend(Ra,mxActor);Ra.prototype.dx=20;Ra.prototype.dy=20;Ra.prototype.isRoundable=function(){return!0};Ra.prototype.redrawPath=+function(d,p,z,u,x){p=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));z=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var C=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,z),new mxPoint((u+p)/2,z),new mxPoint((u+p)/2,x),new mxPoint((u-p)/2,x),new mxPoint((u-p)/2,z),new mxPoint(0,+z)],this.isRounded,C,!0);d.end()};mxCellRenderer.registerShape("tee",Ra);mxUtils.extend(Sa,mxActor);Sa.prototype.arrowWidth=.3;Sa.prototype.arrowSize=.2;Sa.prototype.isRoundable=function(){return!0};Sa.prototype.redrawPath=function(d,p,z,u,x){var C=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));p=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));z=(x-C)/2;C=z+C;var E=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,+mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,z),new mxPoint(u-p,z),new mxPoint(u-p,0),new mxPoint(u,x/2),new mxPoint(u-p,x),new mxPoint(u-p,C),new mxPoint(0,C)],this.isRounded,E,!0);d.end()};mxCellRenderer.registerShape("singleArrow",Sa);mxUtils.extend(Ha,mxActor);Ha.prototype.isRoundable=function(){return!0};Ha.prototype.redrawPath=function(d,p,z,u,x){var C=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",Sa.prototype.arrowWidth))));p=u*Math.max(0,Math.min(1,+parseFloat(mxUtils.getValue(this.style,"arrowSize",Sa.prototype.arrowSize))));z=(x-C)/2;C=z+C;var E=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,x/2),new mxPoint(p,0),new mxPoint(p,z),new mxPoint(u-p,z),new mxPoint(u-p,0),new mxPoint(u,x/2),new mxPoint(u-p,x),new mxPoint(u-p,C),new mxPoint(p,C),new mxPoint(p,x)],this.isRounded,E,!0);d.end()};mxCellRenderer.registerShape("doubleArrow",Ha);mxUtils.extend(Ma,mxActor);Ma.prototype.size=+.1;Ma.prototype.fixedSize=20;Ma.prototype.redrawPath=function(d,p,z,u,x){p="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.moveTo(p,0);d.lineTo(u,0);d.quadTo(u-2*p,x/2,u,x);d.lineTo(p,x);d.quadTo(p-2*p,x/2,p,0);d.close();d.end()};mxCellRenderer.registerShape("dataStorage",Ma);mxUtils.extend(y,mxActor);y.prototype.redrawPath=+function(d,p,z,u,x){d.moveTo(0,0);d.quadTo(u,0,u,x/2);d.quadTo(u,x,0,x);d.close();d.end()};mxCellRenderer.registerShape("or",y);mxUtils.extend(O,mxActor);O.prototype.redrawPath=function(d,p,z,u,x){d.moveTo(0,0);d.quadTo(u,0,u,x/2);d.quadTo(u,x,0,x);d.quadTo(u/2,x/2,0,0);d.close();d.end()};mxCellRenderer.registerShape("xor",O);mxUtils.extend(R,mxActor);R.prototype.size=20;R.prototype.isRoundable=function(){return!0};R.prototype.redrawPath=function(d,p,z,u,x){p=Math.min(u/2,Math.min(x,parseFloat(mxUtils.getValue(this.style,+"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(p,0),new mxPoint(u-p,0),new mxPoint(u,.8*p),new mxPoint(u,x),new mxPoint(0,x),new mxPoint(0,.8*p)],this.isRounded,z,!0);d.end()};mxCellRenderer.registerShape("loopLimit",R);mxUtils.extend(V,mxActor);V.prototype.size=.375;V.prototype.isRoundable=function(){return!0};V.prototype.redrawPath=function(d,p,z,u,x){p=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,+"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,x-p),new mxPoint(u/2,x),new mxPoint(0,x-p)],this.isRounded,z,!0);d.end()};mxCellRenderer.registerShape("offPageConnector",V);mxUtils.extend(fa,mxEllipse);fa.prototype.paintVertexShape=function(d,p,z,u,x){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.begin();d.moveTo(p+u/2,z+x);d.lineTo(p+u,z+x);d.end();d.stroke()};+mxCellRenderer.registerShape("tapeData",fa);mxUtils.extend(ia,mxEllipse);ia.prototype.paintVertexShape=function(d,p,z,u,x){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.setShadow(!1);d.begin();d.moveTo(p,z+x/2);d.lineTo(p+u,z+x/2);d.end();d.stroke();d.begin();d.moveTo(p+u/2,z);d.lineTo(p+u/2,z+x);d.end();d.stroke()};mxCellRenderer.registerShape("orEllipse",ia);mxUtils.extend(oa,mxEllipse);oa.prototype.paintVertexShape=function(d,p,z,u,x){mxEllipse.prototype.paintVertexShape.apply(this,+arguments);d.setShadow(!1);d.begin();d.moveTo(p+.145*u,z+.145*x);d.lineTo(p+.855*u,z+.855*x);d.end();d.stroke();d.begin();d.moveTo(p+.855*u,z+.145*x);d.lineTo(p+.145*u,z+.855*x);d.end();d.stroke()};mxCellRenderer.registerShape("sumEllipse",oa);mxUtils.extend(ta,mxRhombus);ta.prototype.paintVertexShape=function(d,p,z,u,x){mxRhombus.prototype.paintVertexShape.apply(this,arguments);d.setShadow(!1);d.begin();d.moveTo(p,z+x/2);d.lineTo(p+u,z+x/2);d.end();d.stroke()};mxCellRenderer.registerShape("sortShape",+ta);mxUtils.extend(ra,mxEllipse);ra.prototype.paintVertexShape=function(d,p,z,u,x){d.begin();d.moveTo(p,z);d.lineTo(p+u,z);d.lineTo(p+u/2,z+x/2);d.close();d.fillAndStroke();d.begin();d.moveTo(p,z+x);d.lineTo(p+u,z+x);d.lineTo(p+u/2,z+x/2);d.close();d.fillAndStroke()};mxCellRenderer.registerShape("collate",ra);mxUtils.extend(xa,mxEllipse);xa.prototype.paintVertexShape=function(d,p,z,u,x){var C=d.state.strokeWidth/2,E=10+2*C,da=z+x-E/2;d.begin();d.moveTo(p,z);d.lineTo(p,z+x);d.moveTo(p+C,da);d.lineTo(p++C+E,da-E/2);d.moveTo(p+C,da);d.lineTo(p+C+E,da+E/2);d.moveTo(p+C,da);d.lineTo(p+u-C,da);d.moveTo(p+u,z);d.lineTo(p+u,z+x);d.moveTo(p+u-C,da);d.lineTo(p+u-E-C,da-E/2);d.moveTo(p+u-C,da);d.lineTo(p+u-E-C,da+E/2);d.end();d.stroke()};mxCellRenderer.registerShape("dimension",xa);mxUtils.extend(Da,mxEllipse);Da.prototype.drawHidden=!0;Da.prototype.paintVertexShape=function(d,p,z,u,x){this.outline||d.setStrokeColor(null);if(null!=this.style){var C=d.pointerEvents,E=null!=this.fill&&this.fill!=mxConstants.NONE;+"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||E||(d.pointerEvents=!1);var da="1"==mxUtils.getValue(this.style,"top","1"),M="1"==mxUtils.getValue(this.style,"left","1"),sa="1"==mxUtils.getValue(this.style,"right","1"),ma="1"==mxUtils.getValue(this.style,"bottom","1");this.drawHidden||E||this.outline||da||sa||ma||M?(d.rect(p,z,u,x),d.fill(),d.pointerEvents=C,d.setStrokeColor(this.stroke),d.setLineCap("square"),d.begin(),d.moveTo(p,z),this.outline||da?d.lineTo(p+u,z):d.moveTo(p++u,z),this.outline||sa?d.lineTo(p+u,z+x):d.moveTo(p+u,z+x),this.outline||ma?d.lineTo(p,z+x):d.moveTo(p,z+x),(this.outline||M)&&d.lineTo(p,z),d.end(),d.stroke(),d.setLineCap("flat")):d.setStrokeColor(this.stroke)}};mxCellRenderer.registerShape("partialRectangle",Da);mxUtils.extend(Ia,mxEllipse);Ia.prototype.paintVertexShape=function(d,p,z,u,x){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.setShadow(!1);d.begin();"vertical"==mxUtils.getValue(this.style,"line")?(d.moveTo(p+u/2,z),d.lineTo(p++u/2,z+x)):(d.moveTo(p,z+x/2),d.lineTo(p+u,z+x/2));d.end();d.stroke()};mxCellRenderer.registerShape("lineEllipse",Ia);mxUtils.extend(Xa,mxActor);Xa.prototype.redrawPath=function(d,p,z,u,x){p=Math.min(u,x/2);d.moveTo(0,0);d.lineTo(u-p,0);d.quadTo(u,0,u,x/2);d.quadTo(u,x,u-p,x);d.lineTo(0,x);d.close();d.end()};mxCellRenderer.registerShape("delay",Xa);mxUtils.extend(Za,mxActor);Za.prototype.size=.2;Za.prototype.redrawPath=function(d,p,z,u,x){p=Math.min(x,u);var C=Math.max(0,Math.min(p,p*parseFloat(mxUtils.getValue(this.style,+"size",this.size))));p=(x-C)/2;z=p+C;var E=(u-C)/2;C=E+C;d.moveTo(0,p);d.lineTo(E,p);d.lineTo(E,0);d.lineTo(C,0);d.lineTo(C,p);d.lineTo(u,p);d.lineTo(u,z);d.lineTo(C,z);d.lineTo(C,x);d.lineTo(E,x);d.lineTo(E,z);d.lineTo(0,z);d.close();d.end()};mxCellRenderer.registerShape("cross",Za);mxUtils.extend($a,mxActor);$a.prototype.size=.25;$a.prototype.redrawPath=function(d,p,z,u,x){p=Math.min(u,x/2);z=Math.min(u-p,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*u);d.moveTo(0,x/2);d.lineTo(z,+0);d.lineTo(u-p,0);d.quadTo(u,0,u,x/2);d.quadTo(u,x,u-p,x);d.lineTo(z,x);d.close();d.end()};mxCellRenderer.registerShape("display",$a);mxUtils.extend(Pa,mxActor);Pa.prototype.cst={RECT2:"mxgraph.basic.rect"};Pa.prototype.customProperties=[{name:"rectStyle",dispName:"Style",type:"enum",defVal:"square",enumList:[{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"size",dispName:"Corner Size",type:"float",defVal:10},{name:"absoluteCornerSize",dispName:"Abs. Corner Size",type:"bool",defVal:!0},{name:"indent",dispName:"Indent",type:"float",defVal:2},{name:"rectOutline",dispName:"Outline",type:"enum",defVal:"single",enumList:[{val:"single",dispName:"Single"},{val:"double",dispName:"Double"},{val:"frame",dispName:"Frame"}]},{name:"fillColor2",dispName:"Inside Fill Color",type:"color",defVal:"none"},{name:"gradientColor2",dispName:"Inside Gradient Color",type:"color",defVal:"none"},{name:"gradientDirection2",dispName:"Inside Gradient Direction",type:"enum",defVal:"south",enumList:[{val:"south",dispName:"South"},{val:"west",dispName:"West"},{val:"north",dispName:"North"},{val:"east",dispName:"East"}]},{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"right",dispName:"Right",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left ",type:"bool",defVal:!0},{name:"topLeftStyle",dispName:"Top Left Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"topRightStyle",dispName:"Top Right Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"bottomRightStyle",dispName:"Bottom Right Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"bottomLeftStyle",dispName:"Bottom Left Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",-dispName:"Fold"}]}];Pa.prototype.paintVertexShape=function(d,n,z,u,x){d.translate(n,z);this.strictDrawShape(d,0,0,u,x)};Pa.prototype.strictDrawShape=function(d,n,z,u,x,C){var E=C&&C.rectStyle?C.rectStyle:mxUtils.getValue(this.style,"rectStyle",this.rectStyle),da=C&&C.absoluteCornerSize?C.absoluteCornerSize:mxUtils.getValue(this.style,"absoluteCornerSize",this.absoluteCornerSize),M=C&&C.size?C.size:Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),sa=C&&C.rectOutline?+dispName:"Fold"}]}];Pa.prototype.paintVertexShape=function(d,p,z,u,x){d.translate(p,z);this.strictDrawShape(d,0,0,u,x)};Pa.prototype.strictDrawShape=function(d,p,z,u,x,C){var E=C&&C.rectStyle?C.rectStyle:mxUtils.getValue(this.style,"rectStyle",this.rectStyle),da=C&&C.absoluteCornerSize?C.absoluteCornerSize:mxUtils.getValue(this.style,"absoluteCornerSize",this.absoluteCornerSize),M=C&&C.size?C.size:Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),sa=C&&C.rectOutline?C.rectOutline:mxUtils.getValue(this.style,"rectOutline",this.rectOutline),ma=C&&C.indent?C.indent:Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"indent",this.indent)))),Wa=C&&C.dashed?C.dashed:mxUtils.getValue(this.style,"dashed",!1),gb=C&&C.dashPattern?C.dashPattern:mxUtils.getValue(this.style,"dashPattern",null),bb=C&&C.relIndent?C.relIndent:Math.max(0,Math.min(50,ma)),Fa=C&&C.top?C.top:mxUtils.getValue(this.style,"top",!0),Ka=C&&C.right?C.right:mxUtils.getValue(this.style,"right",!0),Ja=C&&C.bottom?C.bottom:mxUtils.getValue(this.style,"bottom",!0),Ga=C&&C.left?C.left:mxUtils.getValue(this.style,"left",!0),Oa=C&&C.topLeftStyle?C.topLeftStyle:mxUtils.getValue(this.style,"topLeftStyle","default"),Ta=C&&C.topRightStyle?C.topRightStyle:mxUtils.getValue(this.style,"topRightStyle","default"),Ua=C&&C.bottomRightStyle?C.bottomRightStyle:mxUtils.getValue(this.style,"bottomRightStyle","default"),Va=C&&C.bottomLeftStyle?C.bottomLeftStyle:mxUtils.getValue(this.style,"bottomLeftStyle","default"),Fb=C&&C.fillColor?C.fillColor:mxUtils.getValue(this.style,"fillColor","#ffffff");C&&C.strokeColor||mxUtils.getValue(this.style,"strokeColor","#000000");var Gb=C&&C.strokeWidth?C.strokeWidth:mxUtils.getValue(this.style,"strokeWidth","1"),Db=C&&C.fillColor2?C.fillColor2:mxUtils.getValue(this.style,"fillColor2","none"),Eb=C&&C.gradientColor2?C.gradientColor2:mxUtils.getValue(this.style,"gradientColor2","none"),Hb=C&&C.gradientDirection2?C.gradientDirection2:mxUtils.getValue(this.style,"gradientDirection2",-"south"),Ib=C&&C.opacity?C.opacity:mxUtils.getValue(this.style,"opacity","100"),Jb=Math.max(0,Math.min(50,M));C=Pa.prototype;d.setDashed(Wa);gb&&""!=gb&&d.setDashPattern(gb);d.setStrokeWidth(Gb);M=Math.min(.5*x,.5*u,M);da||(M=Jb*Math.min(u,x)/100);M=Math.min(M,.5*Math.min(u,x));da||(ma=Math.min(bb*Math.min(u,x)/100));ma=Math.min(ma,.5*Math.min(u,x)-M);(Fa||Ka||Ja||Ga)&&"frame"!=sa&&(d.begin(),Fa?C.moveNW(d,n,z,u,x,E,Oa,M,Ga):d.moveTo(0,0),Fa&&C.paintNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,-Ta,M,Ka),Ka&&C.paintNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),Ja&&C.paintSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),Ga&&C.paintSW(d,n,z,u,x,E,Va,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),d.close(),d.fill(),d.setShadow(!1),d.setFillColor(Db),Wa=da=Ib,"none"==Db&&(da=0),"none"==Eb&&(Wa=0),d.setGradient(Db,Eb,0,0,u,x,Hb,da,Wa),d.begin(),Fa?C.moveNWInner(d,n,z,u,x,E,Oa,M,ma,Fa,Ga):d.moveTo(ma,0),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga),Ga&&Ja&&C.paintSWInner(d,n,z,u,x,-E,Va,M,ma,Ja),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja),Ja&&Ka&&C.paintSEInner(d,n,z,u,x,E,Ua,M,ma),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka),Ka&&Fa&&C.paintNEInner(d,n,z,u,x,E,Ta,M,ma),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa),Fa&&Ga&&C.paintNWInner(d,n,z,u,x,E,Oa,M,ma),d.fill(),"none"==Fb&&(d.begin(),C.paintFolds(d,n,z,u,x,E,Oa,Ta,Ua,Va,M,Fa,Ka,Ja,Ga),d.stroke()));Fa||Ka||Ja||!Ga?Fa||Ka||!Ja||Ga?!Fa&&!Ka&&Ja&&Ga?"frame"!=sa?(d.begin(),C.moveSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,-x,E,Va,M,Ga),C.paintSW(d,n,z,u,x,E,Va,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),"double"==sa&&(C.moveNWInner(d,n,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga),C.paintSWInner(d,n,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja)),d.stroke()):(d.begin(),C.moveSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),C.paintSW(d,n,z,u,x,E,Va,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),C.lineNWInner(d,n,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga),C.paintSWInner(d,-n,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja),d.close(),d.fillAndStroke()):Fa||!Ka||Ja||Ga?!Fa&&Ka&&!Ja&&Ga?"frame"!=sa?(d.begin(),C.moveSW(d,n,z,u,x,E,Oa,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),"double"==sa&&(C.moveNWInner(d,n,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga)),d.stroke(),d.begin(),C.moveNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),"double"==sa&&(C.moveSEInner(d,n,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka)),-d.stroke()):(d.begin(),C.moveSW(d,n,z,u,x,E,Oa,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),C.lineNWInner(d,n,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga),d.close(),d.fillAndStroke(),d.begin(),C.moveNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),C.lineSEInner(d,n,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka),d.close(),d.fillAndStroke()):!Fa&&Ka&&Ja&&!Ga?"frame"!=sa?(d.begin(),C.moveNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),C.paintSE(d,-n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),"double"==sa&&(C.moveSWInner(d,n,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,n,z,u,x,E,Ua,M,ma),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka)),d.stroke()):(d.begin(),C.moveNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),C.paintSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),C.lineSWInner(d,n,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,n,z,u,x,E,Ua,-M,ma),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka),d.close(),d.fillAndStroke()):!Fa&&Ka&&Ja&&Ga?"frame"!=sa?(d.begin(),C.moveNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),C.paintSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),C.paintSW(d,n,z,u,x,E,Va,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),"double"==sa&&(C.moveNWInner(d,n,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga),C.paintSWInner(d,n,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,-n,z,u,x,E,Ua,M,ma),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka)),d.stroke()):(d.begin(),C.moveNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),C.paintSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),C.paintSW(d,n,z,u,x,E,Va,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),C.lineNWInner(d,n,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga),C.paintSWInner(d,n,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,n,z,u,x,E,Ua,M,ma),C.paintRightInner(d,-n,z,u,x,E,Ta,M,ma,Fa,Ka),d.close(),d.fillAndStroke()):!Fa||Ka||Ja||Ga?Fa&&!Ka&&!Ja&&Ga?"frame"!=sa?(d.begin(),C.moveSW(d,n,z,u,x,E,Va,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),C.paintNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),"double"==sa&&(C.moveNEInner(d,n,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,n,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga)),d.stroke()):(d.begin(),C.moveSW(d,n,z,u,x,E,Va,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),C.paintNW(d,-n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),C.lineNEInner(d,n,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,n,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga),d.close(),d.fillAndStroke()):Fa&&!Ka&&Ja&&!Ga?"frame"!=sa?(d.begin(),C.moveNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),"double"==sa&&(C.moveNEInner(d,n,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa)),d.stroke(),d.begin(),C.moveSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,-n,z,u,x,E,Va,M,Ga),"double"==sa&&(C.moveSWInner(d,n,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja)),d.stroke()):(d.begin(),C.moveNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),C.lineNEInner(d,n,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa),d.close(),d.fillAndStroke(),d.begin(),C.moveSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),C.lineSWInner(d,n,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja),d.close(),d.fillAndStroke()):-Fa&&!Ka&&Ja&&Ga?"frame"!=sa?(d.begin(),C.moveSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),C.paintSW(d,n,z,u,x,E,Va,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),C.paintNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),"double"==sa&&(C.moveNEInner(d,n,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,n,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga),C.paintSWInner(d,n,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja)),d.stroke()):-(d.begin(),C.moveSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),C.paintSW(d,n,z,u,x,E,Va,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),C.paintNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),C.lineNEInner(d,n,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,n,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga),C.paintSWInner(d,n,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja),d.close(),d.fillAndStroke()):Fa&&Ka&&!Ja&&!Ga?"frame"!=-sa?(d.begin(),C.moveNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),C.paintNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),"double"==sa&&(C.moveSEInner(d,n,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,n,z,u,x,E,Ta,M,ma),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa)),d.stroke()):(d.begin(),C.moveNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),C.paintNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),C.lineSEInner(d,n,z,u,x,E,Ua,M,ma,-Ja),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,n,z,u,x,E,Ta,M,ma),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa),d.close(),d.fillAndStroke()):Fa&&Ka&&!Ja&&Ga?"frame"!=sa?(d.begin(),C.moveSW(d,n,z,u,x,E,Va,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),C.paintNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),C.paintNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),"double"==sa&&(C.moveSEInner(d,n,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,-n,z,u,x,E,Ta,M,ma),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,n,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga)),d.stroke()):(d.begin(),C.moveSW(d,n,z,u,x,E,Va,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),C.paintNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),C.paintNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),C.lineSEInner(d,n,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,n,z,u,x,E,Ta,M,ma),C.paintTopInner(d,n,z,u,x,-E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,n,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga),d.close(),d.fillAndStroke()):Fa&&Ka&&Ja&&!Ga?"frame"!=sa?(d.begin(),C.moveNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),C.paintNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),C.paintSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),"double"==sa&&(C.moveSWInner(d,n,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,n,z,u,x,E,Ua,M,ma),C.paintRightInner(d,-n,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,n,z,u,x,E,Ta,M,ma),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa)),d.stroke()):(d.begin(),C.moveNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),C.paintNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),C.paintSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),C.lineSWInner(d,n,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,n,z,u,x,E,Ua,M,ma),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,-n,z,u,x,E,Ta,M,ma),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa),d.close(),d.fillAndStroke()):Fa&&Ka&&Ja&&Ga&&("frame"!=sa?(d.begin(),C.moveNW(d,n,z,u,x,E,Oa,M,Ga),C.paintNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),C.paintNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),C.paintSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),C.paintSW(d,n,z,u,x,E,Va,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),d.close(),"double"==sa&&(C.moveSWInner(d,n,z,u,x,E,Va,M,ma,Ga),C.paintSWInner(d,n,-z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,n,z,u,x,E,Ua,M,ma),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,n,z,u,x,E,Ta,M,ma),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,n,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga),d.close()),d.stroke()):(d.begin(),C.moveNW(d,n,z,u,x,E,Oa,M,Ga),C.paintNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),C.paintNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),C.paintSE(d,-n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),C.paintSW(d,n,z,u,x,E,Va,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),d.close(),C.moveSWInner(d,n,z,u,x,E,Va,M,ma,Ga),C.paintSWInner(d,n,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,n,z,u,x,E,Ua,M,ma),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,n,z,u,x,E,Ta,M,ma),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,n,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga),d.close(),-d.fillAndStroke())):"frame"!=sa?(d.begin(),C.moveNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),"double"==sa&&(C.moveNEInner(d,n,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa)),d.stroke()):(d.begin(),C.moveNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),C.lineNEInner(d,n,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa),d.close(),d.fillAndStroke()):"frame"!=sa?(d.begin(),C.moveNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),"double"==sa&&(C.moveSEInner(d,-n,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka)),d.stroke()):(d.begin(),C.moveNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),C.lineSEInner(d,n,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka),d.close(),d.fillAndStroke()):"frame"!=sa?(d.begin(),C.moveSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),"double"==sa&&(C.moveSWInner(d,n,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja)),d.stroke()):(d.begin(),C.moveSE(d,n,z,u,x,E,Ua,-M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),C.lineSWInner(d,n,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja),d.close(),d.fillAndStroke()):"frame"!=sa?(d.begin(),C.moveSW(d,n,z,u,x,E,Oa,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),"double"==sa&&(C.moveNWInner(d,n,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga)),d.stroke()):(d.begin(),C.moveSW(d,n,z,u,x,E,Oa,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),C.lineNWInner(d,n,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,n,z,u,x,E,Va,M,-ma,Ja,Ga),d.close(),d.fillAndStroke());d.begin();C.paintFolds(d,n,z,u,x,E,Oa,Ta,Ua,Va,M,Fa,Ka,Ja,Ga);d.stroke()};Pa.prototype.moveNW=function(d,n,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.moveTo(0,0):d.moveTo(0,da)};Pa.prototype.moveNE=function(d,n,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.moveTo(u,0):d.moveTo(u-da,0)};Pa.prototype.moveSE=function(d,n,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.moveTo(u,x):d.moveTo(u,x-da)};Pa.prototype.moveSW=-function(d,n,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.moveTo(0,x):d.moveTo(da,x)};Pa.prototype.paintNW=function(d,n,z,u,x,C,E,da,M){if(M)if("rounded"==E||"default"==E&&"rounded"==C||"invRound"==E||"default"==E&&"invRound"==C){n=0;if("rounded"==E||"default"==E&&"rounded"==C)n=1;d.arcTo(da,da,0,0,n,da,0)}else("snip"==E||"default"==E&&"snip"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(da,0);else d.lineTo(0,0)};Pa.prototype.paintTop=function(d,n,z,u,x,C,E,da,M){"square"==E||-"default"==E&&"square"==C||!M?d.lineTo(u,0):d.lineTo(u-da,0)};Pa.prototype.paintNE=function(d,n,z,u,x,C,E,da,M){if(M)if("rounded"==E||"default"==E&&"rounded"==C||"invRound"==E||"default"==E&&"invRound"==C){n=0;if("rounded"==E||"default"==E&&"rounded"==C)n=1;d.arcTo(da,da,0,0,n,u,da)}else("snip"==E||"default"==E&&"snip"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(u,da);else d.lineTo(u,0)};Pa.prototype.paintRight=function(d,n,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.lineTo(u,-x):d.lineTo(u,x-da)};Pa.prototype.paintLeft=function(d,n,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.lineTo(0,0):d.lineTo(0,da)};Pa.prototype.paintSE=function(d,n,z,u,x,C,E,da,M){if(M)if("rounded"==E||"default"==E&&"rounded"==C||"invRound"==E||"default"==E&&"invRound"==C){n=0;if("rounded"==E||"default"==E&&"rounded"==C)n=1;d.arcTo(da,da,0,0,n,u-da,x)}else("snip"==E||"default"==E&&"snip"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(u-da,x);else d.lineTo(u,x)};Pa.prototype.paintBottom=-function(d,n,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.lineTo(0,x):d.lineTo(da,x)};Pa.prototype.paintSW=function(d,n,z,u,x,C,E,da,M){if(M)if("rounded"==E||"default"==E&&"rounded"==C||"invRound"==E||"default"==E&&"invRound"==C){n=0;if("rounded"==E||"default"==E&&"rounded"==C)n=1;d.arcTo(da,da,0,0,n,0,x-da)}else("snip"==E||"default"==E&&"snip"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(0,x-da);else d.lineTo(0,x)};Pa.prototype.paintNWInner=function(d,n,z,u,x,C,E,da,M){if("rounded"==-E||"default"==E&&"rounded"==C)d.arcTo(da-.5*M,da-.5*M,0,0,0,M,.5*M+da);else if("invRound"==E||"default"==E&&"invRound"==C)d.arcTo(da+M,da+M,0,0,1,M,M+da);else if("snip"==E||"default"==E&&"snip"==C)d.lineTo(M,.5*M+da);else if("fold"==E||"default"==E&&"fold"==C)d.lineTo(M+da,M+da),d.lineTo(M,M+da)};Pa.prototype.paintTopInner=function(d,n,z,u,x,C,E,da,M,sa,ma){sa||ma?!sa&&ma?d.lineTo(0,M):sa&&!ma?d.lineTo(M,0):sa?"square"==E||"default"==E&&"square"==C?d.lineTo(M,M):"rounded"==E||"default"==E&&"rounded"==-C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(da+.5*M,M):d.lineTo(da+M,M):d.lineTo(0,M):d.lineTo(0,0)};Pa.prototype.paintNEInner=function(d,n,z,u,x,C,E,da,M){if("rounded"==E||"default"==E&&"rounded"==C)d.arcTo(da-.5*M,da-.5*M,0,0,0,u-da-.5*M,M);else if("invRound"==E||"default"==E&&"invRound"==C)d.arcTo(da+M,da+M,0,0,1,u-da-M,M);else if("snip"==E||"default"==E&&"snip"==C)d.lineTo(u-da-.5*M,M);else if("fold"==E||"default"==E&&"fold"==C)d.lineTo(u-da-M,da+M),d.lineTo(u-da-M,M)};Pa.prototype.paintRightInner=-function(d,n,z,u,x,C,E,da,M,sa,ma){sa||ma?!sa&&ma?d.lineTo(u-M,0):sa&&!ma?d.lineTo(u,M):sa?"square"==E||"default"==E&&"square"==C?d.lineTo(u-M,M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(u-M,da+.5*M):d.lineTo(u-M,da+M):d.lineTo(u-M,0):d.lineTo(u,0)};Pa.prototype.paintLeftInner=function(d,n,z,u,x,C,E,da,M,sa,ma){sa||ma?!sa&&ma?d.lineTo(M,x):sa&&!ma?d.lineTo(0,x-M):sa?"square"==E||"default"==E&&"square"==C?d.lineTo(M,x-M):"rounded"==E||"default"==E&&"rounded"==-C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(M,x-da-.5*M):d.lineTo(M,x-da-M):d.lineTo(M,x):d.lineTo(0,x)};Pa.prototype.paintSEInner=function(d,n,z,u,x,C,E,da,M){if("rounded"==E||"default"==E&&"rounded"==C)d.arcTo(da-.5*M,da-.5*M,0,0,0,u-M,x-da-.5*M);else if("invRound"==E||"default"==E&&"invRound"==C)d.arcTo(da+M,da+M,0,0,1,u-M,x-da-M);else if("snip"==E||"default"==E&&"snip"==C)d.lineTo(u-M,x-da-.5*M);else if("fold"==E||"default"==E&&"fold"==C)d.lineTo(u-da-M,x-da-M),d.lineTo(u-M,x-da-M)};Pa.prototype.paintBottomInner=-function(d,n,z,u,x,C,E,da,M,sa,ma){sa||ma?!sa&&ma?d.lineTo(u,x-M):sa&&!ma?d.lineTo(u-M,x):"square"==E||"default"==E&&"square"==C||!sa?d.lineTo(u-M,x-M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(u-da-.5*M,x-M):d.lineTo(u-da-M,x-M):d.lineTo(u,x)};Pa.prototype.paintSWInner=function(d,n,z,u,x,C,E,da,M,sa){if(!sa)d.lineTo(M,x);else if("square"==E||"default"==E&&"square"==C)d.lineTo(M,x-M);else if("rounded"==E||"default"==E&&"rounded"==C)d.arcTo(da-.5*M,da-.5*-M,0,0,0,da+.5*M,x-M);else if("invRound"==E||"default"==E&&"invRound"==C)d.arcTo(da+M,da+M,0,0,1,da+M,x-M);else if("snip"==E||"default"==E&&"snip"==C)d.lineTo(da+.5*M,x-M);else if("fold"==E||"default"==E&&"fold"==C)d.lineTo(M+da,x-da-M),d.lineTo(M+da,x-M)};Pa.prototype.moveSWInner=function(d,n,z,u,x,C,E,da,M,sa){sa?"square"==E||"default"==E&&"square"==C?d.moveTo(M,x-M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.moveTo(M,x-da-.5*M):("invRound"==E||"default"==E&&"invRound"==-C||"fold"==E||"default"==E&&"fold"==C)&&d.moveTo(M,x-da-M):d.moveTo(0,x-M)};Pa.prototype.lineSWInner=function(d,n,z,u,x,C,E,da,M,sa){sa?"square"==E||"default"==E&&"square"==C?d.lineTo(M,x-M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(M,x-da-.5*M):("invRound"==E||"default"==E&&"invRound"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(M,x-da-M):d.lineTo(0,x-M)};Pa.prototype.moveSEInner=function(d,n,z,u,x,C,E,da,M,sa){sa?"square"==E||"default"==E&&"square"==-C?d.moveTo(u-M,x-M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.moveTo(u-M,x-da-.5*M):("invRound"==E||"default"==E&&"invRound"==C||"fold"==E||"default"==E&&"fold"==C)&&d.moveTo(u-M,x-da-M):d.moveTo(u-M,x)};Pa.prototype.lineSEInner=function(d,n,z,u,x,C,E,da,M,sa){sa?"square"==E||"default"==E&&"square"==C?d.lineTo(u-M,x-M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(u-M,x-da-.5*M):("invRound"==E||"default"==E&&"invRound"==-C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(u-M,x-da-M):d.lineTo(u-M,x)};Pa.prototype.moveNEInner=function(d,n,z,u,x,C,E,da,M,sa){sa?"square"==E||"default"==E&&"square"==C||sa?d.moveTo(u-M,M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.moveTo(u-M,da+.5*M):("invRound"==E||"default"==E&&"invRound"==C||"fold"==E||"default"==E&&"fold"==C)&&d.moveTo(u-M,da+M):d.moveTo(u,M)};Pa.prototype.lineNEInner=function(d,n,z,u,x,C,E,da,M,sa){sa?"square"==E||"default"==E&&"square"==-C||sa?d.lineTo(u-M,M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(u-M,da+.5*M):("invRound"==E||"default"==E&&"invRound"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(u-M,da+M):d.lineTo(u,M)};Pa.prototype.moveNWInner=function(d,n,z,u,x,C,E,da,M,sa,ma){sa||ma?!sa&&ma?d.moveTo(M,0):sa&&!ma?d.moveTo(0,M):"square"==E||"default"==E&&"square"==C?d.moveTo(M,M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.moveTo(M,da+.5*M):("invRound"==-E||"default"==E&&"invRound"==C||"fold"==E||"default"==E&&"fold"==C)&&d.moveTo(M,da+M):d.moveTo(0,0)};Pa.prototype.lineNWInner=function(d,n,z,u,x,C,E,da,M,sa,ma){sa||ma?!sa&&ma?d.lineTo(M,0):sa&&!ma?d.lineTo(0,M):"square"==E||"default"==E&&"square"==C?d.lineTo(M,M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(M,da+.5*M):("invRound"==E||"default"==E&&"invRound"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(M,da+M):d.lineTo(0,0)};Pa.prototype.paintFolds=function(d,-n,z,u,x,C,E,da,M,sa,ma,Wa,gb,bb,Fa){if("fold"==C||"fold"==E||"fold"==da||"fold"==M||"fold"==sa)("fold"==E||"default"==E&&"fold"==C)&&Wa&&Fa&&(d.moveTo(0,ma),d.lineTo(ma,ma),d.lineTo(ma,0)),("fold"==da||"default"==da&&"fold"==C)&&Wa&&gb&&(d.moveTo(u-ma,0),d.lineTo(u-ma,ma),d.lineTo(u,ma)),("fold"==M||"default"==M&&"fold"==C)&&bb&&gb&&(d.moveTo(u-ma,x),d.lineTo(u-ma,x-ma),d.lineTo(u,x-ma)),("fold"==sa||"default"==sa&&"fold"==C)&&bb&&Fa&&(d.moveTo(0,x-ma),d.lineTo(ma,x-ma),d.lineTo(ma,x))};mxCellRenderer.registerShape(Pa.prototype.cst.RECT2,-Pa);Pa.prototype.constraints=null;mxUtils.extend(Na,mxConnector);Na.prototype.origPaintEdgeShape=Na.prototype.paintEdgeShape;Na.prototype.paintEdgeShape=function(d,n,z){for(var u=[],x=0;x<n.length;x++)u.push(mxUtils.clone(n[x]));x=d.state.dashed;var C=d.state.fixDash;Na.prototype.origPaintEdgeShape.apply(this,[d,u,z]);3<=d.state.strokeWidth&&(u=mxUtils.getValue(this.style,"fillColor",null),null!=u&&(d.setStrokeColor(u),d.setStrokeWidth(d.state.strokeWidth-2),d.setDashed(x,C),Na.prototype.origPaintEdgeShape.apply(this,-[d,n,z])))};mxCellRenderer.registerShape("filledEdge",Na);"undefined"!==typeof StyleFormatPanel&&function(){var d=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var n=this.editorUi.getSelectionState(),z=d.apply(this,arguments);"umlFrame"==n.style.shape&&z.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return z}}();mxMarker.addMarker("dash",function(d,n,z,u,x,C,E,da,M,sa){var ma=x*(E+M+1),Wa=C*(E+M+1);return function(){d.begin();-d.moveTo(u.x-ma/2-Wa/2,u.y-Wa/2+ma/2);d.lineTo(u.x+Wa/2-3*ma/2,u.y-3*Wa/2-ma/2);d.stroke()}});mxMarker.addMarker("box",function(d,n,z,u,x,C,E,da,M,sa){var ma=x*(E+M+1),Wa=C*(E+M+1),gb=u.x+ma/2,bb=u.y+Wa/2;u.x-=ma;u.y-=Wa;return function(){d.begin();d.moveTo(gb-ma/2-Wa/2,bb-Wa/2+ma/2);d.lineTo(gb-ma/2+Wa/2,bb-Wa/2-ma/2);d.lineTo(gb+Wa/2-3*ma/2,bb-3*Wa/2-ma/2);d.lineTo(gb-Wa/2-3*ma/2,bb-3*Wa/2+ma/2);d.close();sa?d.fillAndStroke():d.stroke()}});mxMarker.addMarker("cross",function(d,n,z,u,x,C,E,da,M,-sa){var ma=x*(E+M+1),Wa=C*(E+M+1);return function(){d.begin();d.moveTo(u.x-ma/2-Wa/2,u.y-Wa/2+ma/2);d.lineTo(u.x+Wa/2-3*ma/2,u.y-3*Wa/2-ma/2);d.moveTo(u.x-ma/2+Wa/2,u.y-Wa/2-ma/2);d.lineTo(u.x-Wa/2-3*ma/2,u.y-3*Wa/2+ma/2);d.stroke()}});mxMarker.addMarker("circle",jb);mxMarker.addMarker("circlePlus",function(d,n,z,u,x,C,E,da,M,sa){var ma=u.clone(),Wa=jb.apply(this,arguments),gb=x*(E+2*M),bb=C*(E+2*M);return function(){Wa.apply(this,arguments);d.begin();d.moveTo(ma.x-x*M,ma.y-C*M);d.lineTo(ma.x-2*gb+-x*M,ma.y-2*bb+C*M);d.moveTo(ma.x-gb-bb+C*M,ma.y-bb+gb-x*M);d.lineTo(ma.x+bb-gb-C*M,ma.y-bb-gb+x*M);d.stroke()}});mxMarker.addMarker("halfCircle",function(d,n,z,u,x,C,E,da,M,sa){var ma=x*(E+M+1),Wa=C*(E+M+1),gb=u.clone();u.x-=ma;u.y-=Wa;return function(){d.begin();d.moveTo(gb.x-Wa,gb.y+ma);d.quadTo(u.x-Wa,u.y+ma,u.x,u.y);d.quadTo(u.x+Wa,u.y-ma,gb.x+Wa,gb.y-ma);d.stroke()}});mxMarker.addMarker("async",function(d,n,z,u,x,C,E,da,M,sa){n=x*M*1.118;z=C*M*1.118;x*=E+M;C*=E+M;var ma=u.clone();ma.x-=n;ma.y-=-z;u.x+=-x-n;u.y+=-C-z;return function(){d.begin();d.moveTo(ma.x,ma.y);da?d.lineTo(ma.x-x-C/2,ma.y-C+x/2):d.lineTo(ma.x+C/2-x,ma.y-C-x/2);d.lineTo(ma.x-x,ma.y-C);d.close();sa?d.fillAndStroke():d.stroke()}});mxMarker.addMarker("openAsync",function(d){d=null!=d?d:2;return function(n,z,u,x,C,E,da,M,sa,ma){C*=da+sa;E*=da+sa;var Wa=x.clone();return function(){n.begin();n.moveTo(Wa.x,Wa.y);M?n.lineTo(Wa.x-C-E/d,Wa.y-E+C/d):n.lineTo(Wa.x+E/d-C,Wa.y-E-C/d);n.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var tb=-function(d,n,z){return eb(d,["width"],n,function(u,x,C,E,da){da=d.shape.getEdgeWidth()*d.view.scale+z;return new mxPoint(E.x+x*u/4+C*da/2,E.y+C*u/4-x*da/2)},function(u,x,C,E,da,M){u=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,da.x,da.y,M.x,M.y));d.style.width=Math.round(2*u)/d.view.scale-z})},eb=function(d,n,z,u,x){return ib(d,n,function(C){var E=d.absolutePoints;if(null!=E&&0<E.length){var da=E.length-1;C=d.view.translate;var M=d.view.scale,sa=z?E[0]:E[da];E=z?E[1]:E[da-1];da=E.x-sa.x;var ma=E.y-sa.y,-Wa=Math.sqrt(da*da+ma*ma);sa=u.call(this,Wa,da/Wa,ma/Wa,sa,E);return new mxPoint(sa.x/M-C.x,sa.y/M-C.y)}return null},function(C,E,da){var M=d.absolutePoints,sa=M.length-1;C=d.view.translate;var ma=d.view.scale,Wa=z?M[0]:M[sa];M=z?M[1]:M[sa-1];sa=M.x-Wa.x;var gb=M.y-Wa.y,bb=Math.sqrt(sa*sa+gb*gb);E.x=(E.x+C.x)*ma;E.y=(E.y+C.y)*ma;x.call(this,bb,sa/bb,gb/bb,Wa,M,E,da)})},nb=function(d,n){return function(z){return[eb(z,["startWidth"],!0,function(u,x,C,E,da){da=mxUtils.getNumber(z.style,"startWidth",-d)*z.view.scale+n;return new mxPoint(E.x+x*u/4+C*da/2,E.y+C*u/4-x*da/2)},function(u,x,C,E,da,M){u=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,da.x,da.y,M.x,M.y));z.style.startWidth=Math.round(2*u)/z.view.scale-n})]}},mb=function(d){return function(n){return[ib(n,["arrowWidth","arrowSize"],function(z){var u=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",Sa.prototype.arrowWidth))),x=Math.max(0,Math.min(d,mxUtils.getValue(this.state.style,"arrowSize",Sa.prototype.arrowSize)));return new mxPoint(z.x+-(1-x)*z.width,z.y+(1-u)*z.height/2)},function(z,u){this.state.style.arrowWidth=Math.max(0,Math.min(1,Math.abs(z.y+z.height/2-u.y)/z.height*2));this.state.style.arrowSize=Math.max(0,Math.min(d,(z.x+z.width-u.x)/z.width))})]}},qb=function(d){return function(n){return[ib(n,["size"],function(z){var u=Math.max(0,Math.min(.5*z.height,parseFloat(mxUtils.getValue(this.state.style,"size",d))));return new mxPoint(z.x,z.y+u)},function(z,u){this.state.style.size=Math.max(0,u.y-z.y)},!0)]}},ub=function(d,n,z){return function(u){var x=-[ib(u,["size"],function(C){var E=Math.max(0,Math.min(C.width,Math.min(C.height,parseFloat(mxUtils.getValue(this.state.style,"size",n)))))*d;return new mxPoint(C.x+E,C.y+E)},function(C,E){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(C.width,E.x-C.x),Math.min(C.height,E.y-C.y)))/d)},!1)];z&&mxUtils.getValue(u.style,mxConstants.STYLE_ROUNDED,!1)&&x.push(vb(u));return x}},zb=function(d,n,z,u,x){z=null!=z?z:.5;return function(C){var E=[ib(C,["size"],function(da){var M=null!=x?"0"!=mxUtils.getValue(this.state.style,-"fixedSize","0"):null,sa=parseFloat(mxUtils.getValue(this.state.style,"size",M?x:d));return new mxPoint(da.x+Math.max(0,Math.min(.5*da.width,sa*(M?1:da.width))),da.getCenterY())},function(da,M,sa){da=null!=x&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?M.x-da.x:Math.max(0,Math.min(z,(M.x-da.x)/da.width));this.state.style.size=da},!1,u)];n&&mxUtils.getValue(C.style,mxConstants.STYLE_ROUNDED,!1)&&E.push(vb(C));return E}},Cb=function(d,n,z){d=null!=d?d:.5;return function(u){var x=[ib(u,["size"],-function(C){var E=null!=z?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,da=Math.max(0,parseFloat(mxUtils.getValue(this.state.style,"size",E?z:n)));return new mxPoint(C.x+Math.min(.75*C.width*d,da*(E?.75:.75*C.width)),C.y+C.height/4)},function(C,E){C=null!=z&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?E.x-C.x:Math.max(0,Math.min(d,(E.x-C.x)/C.width*.75));this.state.style.size=C},!1,!0)];mxUtils.getValue(u.style,mxConstants.STYLE_ROUNDED,!1)&&x.push(vb(u));return x}},xb=-function(){return function(d){var n=[];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&n.push(vb(d));return n}},vb=function(d,n){return ib(d,[mxConstants.STYLE_ARCSIZE],function(z){var u=null!=n?n:z.height/8;if("1"==mxUtils.getValue(d.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var x=mxUtils.getValue(d.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(z.x+z.width-Math.min(z.width/2,x),z.y+u)}x=Math.max(0,parseFloat(mxUtils.getValue(d.style,mxConstants.STYLE_ARCSIZE,-100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100;return new mxPoint(z.x+z.width-Math.min(Math.max(z.width/2,z.height/2),Math.min(z.width,z.height)*x),z.y+u)},function(z,u,x){"1"==mxUtils.getValue(d.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(z.width,2*(z.x+z.width-u.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(z.width-u.x+z.x)/Math.min(z.width,z.height))))})},ib=function(d,n,z,u,-x,C,E){var da=new mxHandle(d,null,mxVertexHandler.prototype.secondaryHandleImage);da.execute=function(sa){for(var ma=0;ma<n.length;ma++)this.copyStyle(n[ma]);E&&E(sa)};da.getPosition=z;da.setPosition=u;da.ignoreGrid=null!=x?x:!0;if(C){var M=da.positionChanged;da.positionChanged=function(){M.apply(this,arguments);d.view.invalidate(this.state.cell);d.view.validate()}}return da},hb={link:function(d){return[tb(d,!0,10),tb(d,!1,10)]},flexArrow:function(d){var n=d.view.graph.gridSize/d.view.scale,z=[];+"south"),Ib=C&&C.opacity?C.opacity:mxUtils.getValue(this.style,"opacity","100"),Jb=Math.max(0,Math.min(50,M));C=Pa.prototype;d.setDashed(Wa);gb&&""!=gb&&d.setDashPattern(gb);d.setStrokeWidth(Gb);M=Math.min(.5*x,.5*u,M);da||(M=Jb*Math.min(u,x)/100);M=Math.min(M,.5*Math.min(u,x));da||(ma=Math.min(bb*Math.min(u,x)/100));ma=Math.min(ma,.5*Math.min(u,x)-M);(Fa||Ka||Ja||Ga)&&"frame"!=sa&&(d.begin(),Fa?C.moveNW(d,p,z,u,x,E,Oa,M,Ga):d.moveTo(0,0),Fa&&C.paintNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,+Ta,M,Ka),Ka&&C.paintNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),Ja&&C.paintSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),Ga&&C.paintSW(d,p,z,u,x,E,Va,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),d.close(),d.fill(),d.setShadow(!1),d.setFillColor(Db),Wa=da=Ib,"none"==Db&&(da=0),"none"==Eb&&(Wa=0),d.setGradient(Db,Eb,0,0,u,x,Hb,da,Wa),d.begin(),Fa?C.moveNWInner(d,p,z,u,x,E,Oa,M,ma,Fa,Ga):d.moveTo(ma,0),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga),Ga&&Ja&&C.paintSWInner(d,p,z,u,x,+E,Va,M,ma,Ja),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja),Ja&&Ka&&C.paintSEInner(d,p,z,u,x,E,Ua,M,ma),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka),Ka&&Fa&&C.paintNEInner(d,p,z,u,x,E,Ta,M,ma),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa),Fa&&Ga&&C.paintNWInner(d,p,z,u,x,E,Oa,M,ma),d.fill(),"none"==Fb&&(d.begin(),C.paintFolds(d,p,z,u,x,E,Oa,Ta,Ua,Va,M,Fa,Ka,Ja,Ga),d.stroke()));Fa||Ka||Ja||!Ga?Fa||Ka||!Ja||Ga?!Fa&&!Ka&&Ja&&Ga?"frame"!=sa?(d.begin(),C.moveSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,+x,E,Va,M,Ga),C.paintSW(d,p,z,u,x,E,Va,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),"double"==sa&&(C.moveNWInner(d,p,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga),C.paintSWInner(d,p,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja)),d.stroke()):(d.begin(),C.moveSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),C.paintSW(d,p,z,u,x,E,Va,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),C.lineNWInner(d,p,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga),C.paintSWInner(d,+p,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja),d.close(),d.fillAndStroke()):Fa||!Ka||Ja||Ga?!Fa&&Ka&&!Ja&&Ga?"frame"!=sa?(d.begin(),C.moveSW(d,p,z,u,x,E,Oa,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),"double"==sa&&(C.moveNWInner(d,p,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga)),d.stroke(),d.begin(),C.moveNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),"double"==sa&&(C.moveSEInner(d,p,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka)),+d.stroke()):(d.begin(),C.moveSW(d,p,z,u,x,E,Oa,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),C.lineNWInner(d,p,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga),d.close(),d.fillAndStroke(),d.begin(),C.moveNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),C.lineSEInner(d,p,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka),d.close(),d.fillAndStroke()):!Fa&&Ka&&Ja&&!Ga?"frame"!=sa?(d.begin(),C.moveNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),C.paintSE(d,+p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),"double"==sa&&(C.moveSWInner(d,p,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,p,z,u,x,E,Ua,M,ma),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka)),d.stroke()):(d.begin(),C.moveNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),C.paintSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),C.lineSWInner(d,p,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,p,z,u,x,E,Ua,+M,ma),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka),d.close(),d.fillAndStroke()):!Fa&&Ka&&Ja&&Ga?"frame"!=sa?(d.begin(),C.moveNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),C.paintSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),C.paintSW(d,p,z,u,x,E,Va,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),"double"==sa&&(C.moveNWInner(d,p,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga),C.paintSWInner(d,p,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,+p,z,u,x,E,Ua,M,ma),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka)),d.stroke()):(d.begin(),C.moveNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),C.paintSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),C.paintSW(d,p,z,u,x,E,Va,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),C.lineNWInner(d,p,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga),C.paintSWInner(d,p,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,p,z,u,x,E,Ua,M,ma),C.paintRightInner(d,+p,z,u,x,E,Ta,M,ma,Fa,Ka),d.close(),d.fillAndStroke()):!Fa||Ka||Ja||Ga?Fa&&!Ka&&!Ja&&Ga?"frame"!=sa?(d.begin(),C.moveSW(d,p,z,u,x,E,Va,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),C.paintNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),"double"==sa&&(C.moveNEInner(d,p,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,p,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga)),d.stroke()):(d.begin(),C.moveSW(d,p,z,u,x,E,Va,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),C.paintNW(d,+p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),C.lineNEInner(d,p,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,p,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga),d.close(),d.fillAndStroke()):Fa&&!Ka&&Ja&&!Ga?"frame"!=sa?(d.begin(),C.moveNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),"double"==sa&&(C.moveNEInner(d,p,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa)),d.stroke(),d.begin(),C.moveSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,+p,z,u,x,E,Va,M,Ga),"double"==sa&&(C.moveSWInner(d,p,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja)),d.stroke()):(d.begin(),C.moveNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),C.lineNEInner(d,p,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa),d.close(),d.fillAndStroke(),d.begin(),C.moveSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),C.lineSWInner(d,p,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja),d.close(),d.fillAndStroke()):+Fa&&!Ka&&Ja&&Ga?"frame"!=sa?(d.begin(),C.moveSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),C.paintSW(d,p,z,u,x,E,Va,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),C.paintNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),"double"==sa&&(C.moveNEInner(d,p,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,p,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga),C.paintSWInner(d,p,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja)),d.stroke()):+(d.begin(),C.moveSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),C.paintSW(d,p,z,u,x,E,Va,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),C.paintNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),C.lineNEInner(d,p,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,p,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga),C.paintSWInner(d,p,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja),d.close(),d.fillAndStroke()):Fa&&Ka&&!Ja&&!Ga?"frame"!=+sa?(d.begin(),C.moveNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),C.paintNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),"double"==sa&&(C.moveSEInner(d,p,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,p,z,u,x,E,Ta,M,ma),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa)),d.stroke()):(d.begin(),C.moveNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),C.paintNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),C.lineSEInner(d,p,z,u,x,E,Ua,M,ma,+Ja),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,p,z,u,x,E,Ta,M,ma),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa),d.close(),d.fillAndStroke()):Fa&&Ka&&!Ja&&Ga?"frame"!=sa?(d.begin(),C.moveSW(d,p,z,u,x,E,Va,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),C.paintNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),C.paintNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),"double"==sa&&(C.moveSEInner(d,p,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,+p,z,u,x,E,Ta,M,ma),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,p,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga)),d.stroke()):(d.begin(),C.moveSW(d,p,z,u,x,E,Va,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),C.paintNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),C.paintNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),C.lineSEInner(d,p,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,p,z,u,x,E,Ta,M,ma),C.paintTopInner(d,p,z,u,x,+E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,p,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga),d.close(),d.fillAndStroke()):Fa&&Ka&&Ja&&!Ga?"frame"!=sa?(d.begin(),C.moveNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),C.paintNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),C.paintSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),"double"==sa&&(C.moveSWInner(d,p,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,p,z,u,x,E,Ua,M,ma),C.paintRightInner(d,+p,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,p,z,u,x,E,Ta,M,ma),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa)),d.stroke()):(d.begin(),C.moveNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),C.paintNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),C.paintSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),C.lineSWInner(d,p,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,p,z,u,x,E,Ua,M,ma),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,+p,z,u,x,E,Ta,M,ma),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa),d.close(),d.fillAndStroke()):Fa&&Ka&&Ja&&Ga&&("frame"!=sa?(d.begin(),C.moveNW(d,p,z,u,x,E,Oa,M,Ga),C.paintNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),C.paintNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),C.paintSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),C.paintSW(d,p,z,u,x,E,Va,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),d.close(),"double"==sa&&(C.moveSWInner(d,p,z,u,x,E,Va,M,ma,Ga),C.paintSWInner(d,p,+z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,p,z,u,x,E,Ua,M,ma),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,p,z,u,x,E,Ta,M,ma),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,p,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga),d.close()),d.stroke()):(d.begin(),C.moveNW(d,p,z,u,x,E,Oa,M,Ga),C.paintNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),C.paintNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),C.paintSE(d,+p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),C.paintSW(d,p,z,u,x,E,Va,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),d.close(),C.moveSWInner(d,p,z,u,x,E,Va,M,ma,Ga),C.paintSWInner(d,p,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,p,z,u,x,E,Ua,M,ma),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,p,z,u,x,E,Ta,M,ma),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,p,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga),d.close(),+d.fillAndStroke())):"frame"!=sa?(d.begin(),C.moveNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),"double"==sa&&(C.moveNEInner(d,p,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa)),d.stroke()):(d.begin(),C.moveNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),C.lineNEInner(d,p,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa),d.close(),d.fillAndStroke()):"frame"!=sa?(d.begin(),C.moveNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),"double"==sa&&(C.moveSEInner(d,+p,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka)),d.stroke()):(d.begin(),C.moveNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),C.lineSEInner(d,p,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka),d.close(),d.fillAndStroke()):"frame"!=sa?(d.begin(),C.moveSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),"double"==sa&&(C.moveSWInner(d,p,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja)),d.stroke()):(d.begin(),C.moveSE(d,p,z,u,x,E,Ua,+M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),C.lineSWInner(d,p,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja),d.close(),d.fillAndStroke()):"frame"!=sa?(d.begin(),C.moveSW(d,p,z,u,x,E,Oa,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),"double"==sa&&(C.moveNWInner(d,p,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga)),d.stroke()):(d.begin(),C.moveSW(d,p,z,u,x,E,Oa,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),C.lineNWInner(d,p,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,p,z,u,x,E,Va,M,+ma,Ja,Ga),d.close(),d.fillAndStroke());d.begin();C.paintFolds(d,p,z,u,x,E,Oa,Ta,Ua,Va,M,Fa,Ka,Ja,Ga);d.stroke()};Pa.prototype.moveNW=function(d,p,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.moveTo(0,0):d.moveTo(0,da)};Pa.prototype.moveNE=function(d,p,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.moveTo(u,0):d.moveTo(u-da,0)};Pa.prototype.moveSE=function(d,p,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.moveTo(u,x):d.moveTo(u,x-da)};Pa.prototype.moveSW=+function(d,p,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.moveTo(0,x):d.moveTo(da,x)};Pa.prototype.paintNW=function(d,p,z,u,x,C,E,da,M){if(M)if("rounded"==E||"default"==E&&"rounded"==C||"invRound"==E||"default"==E&&"invRound"==C){p=0;if("rounded"==E||"default"==E&&"rounded"==C)p=1;d.arcTo(da,da,0,0,p,da,0)}else("snip"==E||"default"==E&&"snip"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(da,0);else d.lineTo(0,0)};Pa.prototype.paintTop=function(d,p,z,u,x,C,E,da,M){"square"==E||+"default"==E&&"square"==C||!M?d.lineTo(u,0):d.lineTo(u-da,0)};Pa.prototype.paintNE=function(d,p,z,u,x,C,E,da,M){if(M)if("rounded"==E||"default"==E&&"rounded"==C||"invRound"==E||"default"==E&&"invRound"==C){p=0;if("rounded"==E||"default"==E&&"rounded"==C)p=1;d.arcTo(da,da,0,0,p,u,da)}else("snip"==E||"default"==E&&"snip"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(u,da);else d.lineTo(u,0)};Pa.prototype.paintRight=function(d,p,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.lineTo(u,+x):d.lineTo(u,x-da)};Pa.prototype.paintLeft=function(d,p,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.lineTo(0,0):d.lineTo(0,da)};Pa.prototype.paintSE=function(d,p,z,u,x,C,E,da,M){if(M)if("rounded"==E||"default"==E&&"rounded"==C||"invRound"==E||"default"==E&&"invRound"==C){p=0;if("rounded"==E||"default"==E&&"rounded"==C)p=1;d.arcTo(da,da,0,0,p,u-da,x)}else("snip"==E||"default"==E&&"snip"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(u-da,x);else d.lineTo(u,x)};Pa.prototype.paintBottom=+function(d,p,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.lineTo(0,x):d.lineTo(da,x)};Pa.prototype.paintSW=function(d,p,z,u,x,C,E,da,M){if(M)if("rounded"==E||"default"==E&&"rounded"==C||"invRound"==E||"default"==E&&"invRound"==C){p=0;if("rounded"==E||"default"==E&&"rounded"==C)p=1;d.arcTo(da,da,0,0,p,0,x-da)}else("snip"==E||"default"==E&&"snip"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(0,x-da);else d.lineTo(0,x)};Pa.prototype.paintNWInner=function(d,p,z,u,x,C,E,da,M){if("rounded"==+E||"default"==E&&"rounded"==C)d.arcTo(da-.5*M,da-.5*M,0,0,0,M,.5*M+da);else if("invRound"==E||"default"==E&&"invRound"==C)d.arcTo(da+M,da+M,0,0,1,M,M+da);else if("snip"==E||"default"==E&&"snip"==C)d.lineTo(M,.5*M+da);else if("fold"==E||"default"==E&&"fold"==C)d.lineTo(M+da,M+da),d.lineTo(M,M+da)};Pa.prototype.paintTopInner=function(d,p,z,u,x,C,E,da,M,sa,ma){sa||ma?!sa&&ma?d.lineTo(0,M):sa&&!ma?d.lineTo(M,0):sa?"square"==E||"default"==E&&"square"==C?d.lineTo(M,M):"rounded"==E||"default"==E&&"rounded"==+C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(da+.5*M,M):d.lineTo(da+M,M):d.lineTo(0,M):d.lineTo(0,0)};Pa.prototype.paintNEInner=function(d,p,z,u,x,C,E,da,M){if("rounded"==E||"default"==E&&"rounded"==C)d.arcTo(da-.5*M,da-.5*M,0,0,0,u-da-.5*M,M);else if("invRound"==E||"default"==E&&"invRound"==C)d.arcTo(da+M,da+M,0,0,1,u-da-M,M);else if("snip"==E||"default"==E&&"snip"==C)d.lineTo(u-da-.5*M,M);else if("fold"==E||"default"==E&&"fold"==C)d.lineTo(u-da-M,da+M),d.lineTo(u-da-M,M)};Pa.prototype.paintRightInner=+function(d,p,z,u,x,C,E,da,M,sa,ma){sa||ma?!sa&&ma?d.lineTo(u-M,0):sa&&!ma?d.lineTo(u,M):sa?"square"==E||"default"==E&&"square"==C?d.lineTo(u-M,M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(u-M,da+.5*M):d.lineTo(u-M,da+M):d.lineTo(u-M,0):d.lineTo(u,0)};Pa.prototype.paintLeftInner=function(d,p,z,u,x,C,E,da,M,sa,ma){sa||ma?!sa&&ma?d.lineTo(M,x):sa&&!ma?d.lineTo(0,x-M):sa?"square"==E||"default"==E&&"square"==C?d.lineTo(M,x-M):"rounded"==E||"default"==E&&"rounded"==+C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(M,x-da-.5*M):d.lineTo(M,x-da-M):d.lineTo(M,x):d.lineTo(0,x)};Pa.prototype.paintSEInner=function(d,p,z,u,x,C,E,da,M){if("rounded"==E||"default"==E&&"rounded"==C)d.arcTo(da-.5*M,da-.5*M,0,0,0,u-M,x-da-.5*M);else if("invRound"==E||"default"==E&&"invRound"==C)d.arcTo(da+M,da+M,0,0,1,u-M,x-da-M);else if("snip"==E||"default"==E&&"snip"==C)d.lineTo(u-M,x-da-.5*M);else if("fold"==E||"default"==E&&"fold"==C)d.lineTo(u-da-M,x-da-M),d.lineTo(u-M,x-da-M)};Pa.prototype.paintBottomInner=+function(d,p,z,u,x,C,E,da,M,sa,ma){sa||ma?!sa&&ma?d.lineTo(u,x-M):sa&&!ma?d.lineTo(u-M,x):"square"==E||"default"==E&&"square"==C||!sa?d.lineTo(u-M,x-M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(u-da-.5*M,x-M):d.lineTo(u-da-M,x-M):d.lineTo(u,x)};Pa.prototype.paintSWInner=function(d,p,z,u,x,C,E,da,M,sa){if(!sa)d.lineTo(M,x);else if("square"==E||"default"==E&&"square"==C)d.lineTo(M,x-M);else if("rounded"==E||"default"==E&&"rounded"==C)d.arcTo(da-.5*M,da-.5*+M,0,0,0,da+.5*M,x-M);else if("invRound"==E||"default"==E&&"invRound"==C)d.arcTo(da+M,da+M,0,0,1,da+M,x-M);else if("snip"==E||"default"==E&&"snip"==C)d.lineTo(da+.5*M,x-M);else if("fold"==E||"default"==E&&"fold"==C)d.lineTo(M+da,x-da-M),d.lineTo(M+da,x-M)};Pa.prototype.moveSWInner=function(d,p,z,u,x,C,E,da,M,sa){sa?"square"==E||"default"==E&&"square"==C?d.moveTo(M,x-M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.moveTo(M,x-da-.5*M):("invRound"==E||"default"==E&&"invRound"==+C||"fold"==E||"default"==E&&"fold"==C)&&d.moveTo(M,x-da-M):d.moveTo(0,x-M)};Pa.prototype.lineSWInner=function(d,p,z,u,x,C,E,da,M,sa){sa?"square"==E||"default"==E&&"square"==C?d.lineTo(M,x-M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(M,x-da-.5*M):("invRound"==E||"default"==E&&"invRound"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(M,x-da-M):d.lineTo(0,x-M)};Pa.prototype.moveSEInner=function(d,p,z,u,x,C,E,da,M,sa){sa?"square"==E||"default"==E&&"square"==+C?d.moveTo(u-M,x-M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.moveTo(u-M,x-da-.5*M):("invRound"==E||"default"==E&&"invRound"==C||"fold"==E||"default"==E&&"fold"==C)&&d.moveTo(u-M,x-da-M):d.moveTo(u-M,x)};Pa.prototype.lineSEInner=function(d,p,z,u,x,C,E,da,M,sa){sa?"square"==E||"default"==E&&"square"==C?d.lineTo(u-M,x-M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(u-M,x-da-.5*M):("invRound"==E||"default"==E&&"invRound"==+C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(u-M,x-da-M):d.lineTo(u-M,x)};Pa.prototype.moveNEInner=function(d,p,z,u,x,C,E,da,M,sa){sa?"square"==E||"default"==E&&"square"==C||sa?d.moveTo(u-M,M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.moveTo(u-M,da+.5*M):("invRound"==E||"default"==E&&"invRound"==C||"fold"==E||"default"==E&&"fold"==C)&&d.moveTo(u-M,da+M):d.moveTo(u,M)};Pa.prototype.lineNEInner=function(d,p,z,u,x,C,E,da,M,sa){sa?"square"==E||"default"==E&&"square"==+C||sa?d.lineTo(u-M,M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(u-M,da+.5*M):("invRound"==E||"default"==E&&"invRound"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(u-M,da+M):d.lineTo(u,M)};Pa.prototype.moveNWInner=function(d,p,z,u,x,C,E,da,M,sa,ma){sa||ma?!sa&&ma?d.moveTo(M,0):sa&&!ma?d.moveTo(0,M):"square"==E||"default"==E&&"square"==C?d.moveTo(M,M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.moveTo(M,da+.5*M):("invRound"==+E||"default"==E&&"invRound"==C||"fold"==E||"default"==E&&"fold"==C)&&d.moveTo(M,da+M):d.moveTo(0,0)};Pa.prototype.lineNWInner=function(d,p,z,u,x,C,E,da,M,sa,ma){sa||ma?!sa&&ma?d.lineTo(M,0):sa&&!ma?d.lineTo(0,M):"square"==E||"default"==E&&"square"==C?d.lineTo(M,M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(M,da+.5*M):("invRound"==E||"default"==E&&"invRound"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(M,da+M):d.lineTo(0,0)};Pa.prototype.paintFolds=function(d,+p,z,u,x,C,E,da,M,sa,ma,Wa,gb,bb,Fa){if("fold"==C||"fold"==E||"fold"==da||"fold"==M||"fold"==sa)("fold"==E||"default"==E&&"fold"==C)&&Wa&&Fa&&(d.moveTo(0,ma),d.lineTo(ma,ma),d.lineTo(ma,0)),("fold"==da||"default"==da&&"fold"==C)&&Wa&&gb&&(d.moveTo(u-ma,0),d.lineTo(u-ma,ma),d.lineTo(u,ma)),("fold"==M||"default"==M&&"fold"==C)&&bb&&gb&&(d.moveTo(u-ma,x),d.lineTo(u-ma,x-ma),d.lineTo(u,x-ma)),("fold"==sa||"default"==sa&&"fold"==C)&&bb&&Fa&&(d.moveTo(0,x-ma),d.lineTo(ma,x-ma),d.lineTo(ma,x))};mxCellRenderer.registerShape(Pa.prototype.cst.RECT2,+Pa);Pa.prototype.constraints=null;mxUtils.extend(Na,mxConnector);Na.prototype.origPaintEdgeShape=Na.prototype.paintEdgeShape;Na.prototype.paintEdgeShape=function(d,p,z){for(var u=[],x=0;x<p.length;x++)u.push(mxUtils.clone(p[x]));x=d.state.dashed;var C=d.state.fixDash;Na.prototype.origPaintEdgeShape.apply(this,[d,u,z]);3<=d.state.strokeWidth&&(u=mxUtils.getValue(this.style,"fillColor",null),null!=u&&(d.setStrokeColor(u),d.setStrokeWidth(d.state.strokeWidth-2),d.setDashed(x,C),Na.prototype.origPaintEdgeShape.apply(this,+[d,p,z])))};mxCellRenderer.registerShape("filledEdge",Na);"undefined"!==typeof StyleFormatPanel&&function(){var d=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var p=this.editorUi.getSelectionState(),z=d.apply(this,arguments);"umlFrame"==p.style.shape&&z.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return z}}();mxMarker.addMarker("dash",function(d,p,z,u,x,C,E,da,M,sa){var ma=x*(E+M+1),Wa=C*(E+M+1);return function(){d.begin();+d.moveTo(u.x-ma/2-Wa/2,u.y-Wa/2+ma/2);d.lineTo(u.x+Wa/2-3*ma/2,u.y-3*Wa/2-ma/2);d.stroke()}});mxMarker.addMarker("box",function(d,p,z,u,x,C,E,da,M,sa){var ma=x*(E+M+1),Wa=C*(E+M+1),gb=u.x+ma/2,bb=u.y+Wa/2;u.x-=ma;u.y-=Wa;return function(){d.begin();d.moveTo(gb-ma/2-Wa/2,bb-Wa/2+ma/2);d.lineTo(gb-ma/2+Wa/2,bb-Wa/2-ma/2);d.lineTo(gb+Wa/2-3*ma/2,bb-3*Wa/2-ma/2);d.lineTo(gb-Wa/2-3*ma/2,bb-3*Wa/2+ma/2);d.close();sa?d.fillAndStroke():d.stroke()}});mxMarker.addMarker("cross",function(d,p,z,u,x,C,E,da,M,+sa){var ma=x*(E+M+1),Wa=C*(E+M+1);return function(){d.begin();d.moveTo(u.x-ma/2-Wa/2,u.y-Wa/2+ma/2);d.lineTo(u.x+Wa/2-3*ma/2,u.y-3*Wa/2-ma/2);d.moveTo(u.x-ma/2+Wa/2,u.y-Wa/2-ma/2);d.lineTo(u.x-Wa/2-3*ma/2,u.y-3*Wa/2+ma/2);d.stroke()}});mxMarker.addMarker("circle",jb);mxMarker.addMarker("circlePlus",function(d,p,z,u,x,C,E,da,M,sa){var ma=u.clone(),Wa=jb.apply(this,arguments),gb=x*(E+2*M),bb=C*(E+2*M);return function(){Wa.apply(this,arguments);d.begin();d.moveTo(ma.x-x*M,ma.y-C*M);d.lineTo(ma.x-2*gb++x*M,ma.y-2*bb+C*M);d.moveTo(ma.x-gb-bb+C*M,ma.y-bb+gb-x*M);d.lineTo(ma.x+bb-gb-C*M,ma.y-bb-gb+x*M);d.stroke()}});mxMarker.addMarker("halfCircle",function(d,p,z,u,x,C,E,da,M,sa){var ma=x*(E+M+1),Wa=C*(E+M+1),gb=u.clone();u.x-=ma;u.y-=Wa;return function(){d.begin();d.moveTo(gb.x-Wa,gb.y+ma);d.quadTo(u.x-Wa,u.y+ma,u.x,u.y);d.quadTo(u.x+Wa,u.y-ma,gb.x+Wa,gb.y-ma);d.stroke()}});mxMarker.addMarker("async",function(d,p,z,u,x,C,E,da,M,sa){p=x*M*1.118;z=C*M*1.118;x*=E+M;C*=E+M;var ma=u.clone();ma.x-=p;ma.y-=+z;u.x+=-x-p;u.y+=-C-z;return function(){d.begin();d.moveTo(ma.x,ma.y);da?d.lineTo(ma.x-x-C/2,ma.y-C+x/2):d.lineTo(ma.x+C/2-x,ma.y-C-x/2);d.lineTo(ma.x-x,ma.y-C);d.close();sa?d.fillAndStroke():d.stroke()}});mxMarker.addMarker("openAsync",function(d){d=null!=d?d:2;return function(p,z,u,x,C,E,da,M,sa,ma){C*=da+sa;E*=da+sa;var Wa=x.clone();return function(){p.begin();p.moveTo(Wa.x,Wa.y);M?p.lineTo(Wa.x-C-E/d,Wa.y-E+C/d):p.lineTo(Wa.x+E/d-C,Wa.y-E-C/d);p.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var tb=+function(d,p,z){return eb(d,["width"],p,function(u,x,C,E,da){da=d.shape.getEdgeWidth()*d.view.scale+z;return new mxPoint(E.x+x*u/4+C*da/2,E.y+C*u/4-x*da/2)},function(u,x,C,E,da,M){u=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,da.x,da.y,M.x,M.y));d.style.width=Math.round(2*u)/d.view.scale-z})},eb=function(d,p,z,u,x){return ib(d,p,function(C){var E=d.absolutePoints;if(null!=E&&0<E.length){var da=E.length-1;C=d.view.translate;var M=d.view.scale,sa=z?E[0]:E[da];E=z?E[1]:E[da-1];da=E.x-sa.x;var ma=E.y-sa.y,+Wa=Math.sqrt(da*da+ma*ma);sa=u.call(this,Wa,da/Wa,ma/Wa,sa,E);return new mxPoint(sa.x/M-C.x,sa.y/M-C.y)}return null},function(C,E,da){var M=d.absolutePoints,sa=M.length-1;C=d.view.translate;var ma=d.view.scale,Wa=z?M[0]:M[sa];M=z?M[1]:M[sa-1];sa=M.x-Wa.x;var gb=M.y-Wa.y,bb=Math.sqrt(sa*sa+gb*gb);E.x=(E.x+C.x)*ma;E.y=(E.y+C.y)*ma;x.call(this,bb,sa/bb,gb/bb,Wa,M,E,da)})},nb=function(d,p){return function(z){return[eb(z,["startWidth"],!0,function(u,x,C,E,da){da=mxUtils.getNumber(z.style,"startWidth",+d)*z.view.scale+p;return new mxPoint(E.x+x*u/4+C*da/2,E.y+C*u/4-x*da/2)},function(u,x,C,E,da,M){u=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,da.x,da.y,M.x,M.y));z.style.startWidth=Math.round(2*u)/z.view.scale-p})]}},mb=function(d){return function(p){return[ib(p,["arrowWidth","arrowSize"],function(z){var u=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",Sa.prototype.arrowWidth))),x=Math.max(0,Math.min(d,mxUtils.getValue(this.state.style,"arrowSize",Sa.prototype.arrowSize)));return new mxPoint(z.x++(1-x)*z.width,z.y+(1-u)*z.height/2)},function(z,u){this.state.style.arrowWidth=Math.max(0,Math.min(1,Math.abs(z.y+z.height/2-u.y)/z.height*2));this.state.style.arrowSize=Math.max(0,Math.min(d,(z.x+z.width-u.x)/z.width))})]}},qb=function(d){return function(p){return[ib(p,["size"],function(z){var u=Math.max(0,Math.min(.5*z.height,parseFloat(mxUtils.getValue(this.state.style,"size",d))));return new mxPoint(z.x,z.y+u)},function(z,u){this.state.style.size=Math.max(0,u.y-z.y)},!0)]}},ub=function(d,p,z){return function(u){var x=+[ib(u,["size"],function(C){var E=Math.max(0,Math.min(C.width,Math.min(C.height,parseFloat(mxUtils.getValue(this.state.style,"size",p)))))*d;return new mxPoint(C.x+E,C.y+E)},function(C,E){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(C.width,E.x-C.x),Math.min(C.height,E.y-C.y)))/d)},!1)];z&&mxUtils.getValue(u.style,mxConstants.STYLE_ROUNDED,!1)&&x.push(vb(u));return x}},zb=function(d,p,z,u,x){z=null!=z?z:.5;return function(C){var E=[ib(C,["size"],function(da){var M=null!=x?"0"!=mxUtils.getValue(this.state.style,+"fixedSize","0"):null,sa=parseFloat(mxUtils.getValue(this.state.style,"size",M?x:d));return new mxPoint(da.x+Math.max(0,Math.min(.5*da.width,sa*(M?1:da.width))),da.getCenterY())},function(da,M,sa){da=null!=x&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?M.x-da.x:Math.max(0,Math.min(z,(M.x-da.x)/da.width));this.state.style.size=da},!1,u)];p&&mxUtils.getValue(C.style,mxConstants.STYLE_ROUNDED,!1)&&E.push(vb(C));return E}},Cb=function(d,p,z){d=null!=d?d:.5;return function(u){var x=[ib(u,["size"],+function(C){var E=null!=z?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,da=Math.max(0,parseFloat(mxUtils.getValue(this.state.style,"size",E?z:p)));return new mxPoint(C.x+Math.min(.75*C.width*d,da*(E?.75:.75*C.width)),C.y+C.height/4)},function(C,E){C=null!=z&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?E.x-C.x:Math.max(0,Math.min(d,(E.x-C.x)/C.width*.75));this.state.style.size=C},!1,!0)];mxUtils.getValue(u.style,mxConstants.STYLE_ROUNDED,!1)&&x.push(vb(u));return x}},xb=+function(){return function(d){var p=[];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&p.push(vb(d));return p}},vb=function(d,p){return ib(d,[mxConstants.STYLE_ARCSIZE],function(z){var u=null!=p?p:z.height/8;if("1"==mxUtils.getValue(d.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var x=mxUtils.getValue(d.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(z.x+z.width-Math.min(z.width/2,x),z.y+u)}x=Math.max(0,parseFloat(mxUtils.getValue(d.style,mxConstants.STYLE_ARCSIZE,+100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100;return new mxPoint(z.x+z.width-Math.min(Math.max(z.width/2,z.height/2),Math.min(z.width,z.height)*x),z.y+u)},function(z,u,x){"1"==mxUtils.getValue(d.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(z.width,2*(z.x+z.width-u.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(z.width-u.x+z.x)/Math.min(z.width,z.height))))})},ib=function(d,p,z,u,+x,C,E){var da=new mxHandle(d,null,mxVertexHandler.prototype.secondaryHandleImage);da.execute=function(sa){for(var ma=0;ma<p.length;ma++)this.copyStyle(p[ma]);E&&E(sa)};da.getPosition=z;da.setPosition=u;da.ignoreGrid=null!=x?x:!0;if(C){var M=da.positionChanged;da.positionChanged=function(){M.apply(this,arguments);d.view.invalidate(this.state.cell);d.view.validate()}}return da},hb={link:function(d){return[tb(d,!0,10),tb(d,!1,10)]},flexArrow:function(d){var p=d.view.graph.gridSize/d.view.scale,z=[];mxUtils.getValue(d.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(z.push(eb(d,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(u,x,C,E,da){u=(d.shape.getEdgeWidth()-d.shape.strokewidth)*d.view.scale;da=3*mxUtils.getNumber(d.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(E.x+x*(da+d.shape.strokewidth*d.view.scale)+C*u/2,E.y+C*(da+d.shape.strokewidth*d.view.scale)-x*u/2)},function(u,x,C,E,da,M,sa){u=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,da.x,da.y,M.x,M.y));x=mxUtils.ptLineDist(E.x,E.y,E.x+C,E.y-x,M.x,M.y);d.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(x-d.shape.strokewidth)/3)/100/d.view.scale;d.style.width=Math.round(2*u)/d.view.scale;if(mxEvent.isShiftDown(sa.getEvent())||mxEvent.isControlDown(sa.getEvent()))d.style[mxConstants.STYLE_ENDSIZE]=d.style[mxConstants.STYLE_STARTSIZE];mxEvent.isAltDown(sa.getEvent())||Math.abs(parseFloat(d.style[mxConstants.STYLE_STARTSIZE])-parseFloat(d.style[mxConstants.STYLE_ENDSIZE]))<-n/6&&(d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE])})),z.push(eb(d,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(u,x,C,E,da){u=(d.shape.getStartArrowWidth()-d.shape.strokewidth)*d.view.scale;da=3*mxUtils.getNumber(d.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(E.x+x*(da+d.shape.strokewidth*d.view.scale)+C*u/2,E.y+C*(da+d.shape.strokewidth*d.view.scale)-x*u/2)},function(u,x,C,E,da,+p/6&&(d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE])})),z.push(eb(d,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(u,x,C,E,da){u=(d.shape.getStartArrowWidth()-d.shape.strokewidth)*d.view.scale;da=3*mxUtils.getNumber(d.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(E.x+x*(da+d.shape.strokewidth*d.view.scale)+C*u/2,E.y+C*(da+d.shape.strokewidth*d.view.scale)-x*u/2)},function(u,x,C,E,da,M,sa){u=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,da.x,da.y,M.x,M.y));x=mxUtils.ptLineDist(E.x,E.y,E.x+C,E.y-x,M.x,M.y);d.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(x-d.shape.strokewidth)/3)/100/d.view.scale;d.style.startWidth=Math.max(0,Math.round(2*u)-d.shape.getEdgeWidth())/d.view.scale;if(mxEvent.isShiftDown(sa.getEvent())||mxEvent.isControlDown(sa.getEvent()))d.style[mxConstants.STYLE_ENDSIZE]=d.style[mxConstants.STYLE_STARTSIZE],d.style.endWidth=d.style.startWidth;mxEvent.isAltDown(sa.getEvent())||-(Math.abs(parseFloat(d.style[mxConstants.STYLE_STARTSIZE])-parseFloat(d.style[mxConstants.STYLE_ENDSIZE]))<n/6&&(d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(d.style.startWidth)-parseFloat(d.style.endWidth))<n&&(d.style.startWidth=d.style.endWidth))})));mxUtils.getValue(d.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(z.push(eb(d,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(u,x,C,E,da){u=(d.shape.getEdgeWidth()-+(Math.abs(parseFloat(d.style[mxConstants.STYLE_STARTSIZE])-parseFloat(d.style[mxConstants.STYLE_ENDSIZE]))<p/6&&(d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(d.style.startWidth)-parseFloat(d.style.endWidth))<p&&(d.style.startWidth=d.style.endWidth))})));mxUtils.getValue(d.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(z.push(eb(d,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(u,x,C,E,da){u=(d.shape.getEdgeWidth()-d.shape.strokewidth)*d.view.scale;da=3*mxUtils.getNumber(d.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(E.x+x*(da+d.shape.strokewidth*d.view.scale)-C*u/2,E.y+C*(da+d.shape.strokewidth*d.view.scale)+x*u/2)},function(u,x,C,E,da,M,sa){u=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,da.x,da.y,M.x,M.y));x=mxUtils.ptLineDist(E.x,E.y,E.x+C,E.y-x,M.x,M.y);d.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(x-d.shape.strokewidth)/3)/100/d.view.scale;d.style.width=Math.round(2*-u)/d.view.scale;if(mxEvent.isShiftDown(sa.getEvent())||mxEvent.isControlDown(sa.getEvent()))d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE];mxEvent.isAltDown(sa.getEvent())||Math.abs(parseFloat(d.style[mxConstants.STYLE_ENDSIZE])-parseFloat(d.style[mxConstants.STYLE_STARTSIZE]))<n/6&&(d.style[mxConstants.STYLE_ENDSIZE]=d.style[mxConstants.STYLE_STARTSIZE])})),z.push(eb(d,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(u,x,C,E,da){u=+u)/d.view.scale;if(mxEvent.isShiftDown(sa.getEvent())||mxEvent.isControlDown(sa.getEvent()))d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE];mxEvent.isAltDown(sa.getEvent())||Math.abs(parseFloat(d.style[mxConstants.STYLE_ENDSIZE])-parseFloat(d.style[mxConstants.STYLE_STARTSIZE]))<p/6&&(d.style[mxConstants.STYLE_ENDSIZE]=d.style[mxConstants.STYLE_STARTSIZE])})),z.push(eb(d,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(u,x,C,E,da){u=(d.shape.getEndArrowWidth()-d.shape.strokewidth)*d.view.scale;da=3*mxUtils.getNumber(d.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(E.x+x*(da+d.shape.strokewidth*d.view.scale)-C*u/2,E.y+C*(da+d.shape.strokewidth*d.view.scale)+x*u/2)},function(u,x,C,E,da,M,sa){u=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,da.x,da.y,M.x,M.y));x=mxUtils.ptLineDist(E.x,E.y,E.x+C,E.y-x,M.x,M.y);d.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(x-d.shape.strokewidth)/3)/100/d.view.scale;-d.style.endWidth=Math.max(0,Math.round(2*u)-d.shape.getEdgeWidth())/d.view.scale;if(mxEvent.isShiftDown(sa.getEvent())||mxEvent.isControlDown(sa.getEvent()))d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE],d.style.startWidth=d.style.endWidth;mxEvent.isAltDown(sa.getEvent())||(Math.abs(parseFloat(d.style[mxConstants.STYLE_ENDSIZE])-parseFloat(d.style[mxConstants.STYLE_STARTSIZE]))<n/6&&(d.style[mxConstants.STYLE_ENDSIZE]=d.style[mxConstants.STYLE_STARTSIZE]),Math.abs(parseFloat(d.style.endWidth)--parseFloat(d.style.startWidth))<n&&(d.style.endWidth=d.style.startWidth))})));return z},swimlane:function(d){var n=[];if(mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED)){var z=parseFloat(mxUtils.getValue(d.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));n.push(vb(d,z/2))}n.push(ib(d,[mxConstants.STYLE_STARTSIZE],function(u){var x=parseFloat(mxUtils.getValue(d.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(d.style,mxConstants.STYLE_HORIZONTAL,+d.style.endWidth=Math.max(0,Math.round(2*u)-d.shape.getEdgeWidth())/d.view.scale;if(mxEvent.isShiftDown(sa.getEvent())||mxEvent.isControlDown(sa.getEvent()))d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE],d.style.startWidth=d.style.endWidth;mxEvent.isAltDown(sa.getEvent())||(Math.abs(parseFloat(d.style[mxConstants.STYLE_ENDSIZE])-parseFloat(d.style[mxConstants.STYLE_STARTSIZE]))<p/6&&(d.style[mxConstants.STYLE_ENDSIZE]=d.style[mxConstants.STYLE_STARTSIZE]),Math.abs(parseFloat(d.style.endWidth)-+parseFloat(d.style.startWidth))<p&&(d.style.endWidth=d.style.startWidth))})));return z},swimlane:function(d){var p=[];if(mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED)){var z=parseFloat(mxUtils.getValue(d.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));p.push(vb(d,z/2))}p.push(ib(d,[mxConstants.STYLE_STARTSIZE],function(u){var x=parseFloat(mxUtils.getValue(d.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(d.style,mxConstants.STYLE_HORIZONTAL,1)?new mxPoint(u.getCenterX(),u.y+Math.max(0,Math.min(u.height,x))):new mxPoint(u.x+Math.max(0,Math.min(u.width,x)),u.getCenterY())},function(u,x){d.style[mxConstants.STYLE_STARTSIZE]=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,1)?Math.round(Math.max(0,Math.min(u.height,x.y-u.y))):Math.round(Math.max(0,Math.min(u.width,x.x-u.x)))},!1,null,function(u){var x=d.view.graph;if(!mxEvent.isShiftDown(u.getEvent())&&!mxEvent.isControlDown(u.getEvent())&&(x.isTableRow(d.cell)||x.isTableCell(d.cell))){u=-x.getSwimlaneDirection(d.style);var C=x.model.getParent(d.cell);C=x.model.getChildCells(C,!0);for(var E=[],da=0;da<C.length;da++)C[da]!=d.cell&&x.isSwimlane(C[da])&&x.getSwimlaneDirection(x.getCurrentCellStyle(C[da]))==u&&E.push(C[da]);x.setCellStyles(mxConstants.STYLE_STARTSIZE,d.style[mxConstants.STYLE_STARTSIZE],E)}}));return n},label:xb(),ext:xb(),rectangle:xb(),triangle:xb(),rhombus:xb(),umlLifeline:function(d){return[ib(d,["size"],function(n){var z=Math.max(0,Math.min(n.height,parseFloat(mxUtils.getValue(this.state.style,-"size",X.prototype.size))));return new mxPoint(n.getCenterX(),n.y+z)},function(n,z){this.state.style.size=Math.round(Math.max(0,Math.min(n.height,z.y-n.y)))},!1)]},umlFrame:function(d){return[ib(d,["width","height"],function(n){var z=Math.max(Z.prototype.corner,Math.min(n.width,mxUtils.getValue(this.state.style,"width",Z.prototype.width))),u=Math.max(1.5*Z.prototype.corner,Math.min(n.height,mxUtils.getValue(this.state.style,"height",Z.prototype.height)));return new mxPoint(n.x+z,n.y+u)},function(n,-z){this.state.style.width=Math.round(Math.max(Z.prototype.corner,Math.min(n.width,z.x-n.x)));this.state.style.height=Math.round(Math.max(1.5*Z.prototype.corner,Math.min(n.height,z.y-n.y)))},!1)]},process:function(d){var n=[ib(d,["size"],function(z){var u="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),x=parseFloat(mxUtils.getValue(this.state.style,"size",na.prototype.size));return u?new mxPoint(z.x+x,z.y+z.height/4):new mxPoint(z.x+z.width*x,z.y+z.height/4)},function(z,u){z="0"!=mxUtils.getValue(this.state.style,-"fixedSize","0")?Math.max(0,Math.min(.5*z.width,u.x-z.x)):Math.max(0,Math.min(.5,(u.x-z.x)/z.width));this.state.style.size=z},!1)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&n.push(vb(d));return n},cross:function(d){return[ib(d,["size"],function(n){var z=Math.min(n.width,n.height);z=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"size",Za.prototype.size)))*z/2;return new mxPoint(n.getCenterX()-z,n.getCenterY()-z)},function(n,z){var u=Math.min(n.width,n.height);this.state.style.size=-Math.max(0,Math.min(1,Math.min(Math.max(0,n.getCenterY()-z.y)/u*2,Math.max(0,n.getCenterX()-z.x)/u*2)))})]},note:function(d){return[ib(d,["size"],function(n){var z=Math.max(0,Math.min(n.width,Math.min(n.height,parseFloat(mxUtils.getValue(this.state.style,"size",F.prototype.size)))));return new mxPoint(n.x+n.width-z,n.y+z)},function(n,z){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(n.width,n.x+n.width-z.x),Math.min(n.height,z.y-n.y))))})]},note2:function(d){return[ib(d,["size"],function(n){var z=-Math.max(0,Math.min(n.width,Math.min(n.height,parseFloat(mxUtils.getValue(this.state.style,"size",K.prototype.size)))));return new mxPoint(n.x+n.width-z,n.y+z)},function(n,z){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(n.width,n.x+n.width-z.x),Math.min(n.height,z.y-n.y))))})]},manualInput:function(d){var n=[ib(d,["size"],function(z){var u=Math.max(0,Math.min(z.height,mxUtils.getValue(this.state.style,"size",Aa.prototype.size)));return new mxPoint(z.x+z.width/4,z.y+3*u/4)},function(z,-u){this.state.style.size=Math.round(Math.max(0,Math.min(z.height,4*(u.y-z.y)/3)))},!1)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&n.push(vb(d));return n},dataStorage:function(d){return[ib(d,["size"],function(n){var z="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),u=parseFloat(mxUtils.getValue(this.state.style,"size",z?Ma.prototype.fixedSize:Ma.prototype.size));return new mxPoint(n.x+n.width-u*(z?1:n.width),n.getCenterY())},function(n,z){n="0"!=mxUtils.getValue(this.state.style,-"fixedSize","0")?Math.max(0,Math.min(n.width,n.x+n.width-z.x)):Math.max(0,Math.min(1,(n.x+n.width-z.x)/n.width));this.state.style.size=n},!1)]},callout:function(d){var n=[ib(d,["size","position"],function(z){var u=Math.max(0,Math.min(z.height,mxUtils.getValue(this.state.style,"size",ba.prototype.size))),x=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",ba.prototype.position)));mxUtils.getValue(this.state.style,"base",ba.prototype.base);return new mxPoint(z.x+x*z.width,z.y+z.height-+x.getSwimlaneDirection(d.style);var C=x.model.getParent(d.cell);C=x.model.getChildCells(C,!0);for(var E=[],da=0;da<C.length;da++)C[da]!=d.cell&&x.isSwimlane(C[da])&&x.getSwimlaneDirection(x.getCurrentCellStyle(C[da]))==u&&E.push(C[da]);x.setCellStyles(mxConstants.STYLE_STARTSIZE,d.style[mxConstants.STYLE_STARTSIZE],E)}}));return p},label:xb(),ext:xb(),rectangle:xb(),triangle:xb(),rhombus:xb(),umlLifeline:function(d){return[ib(d,["size"],function(p){var z=Math.max(0,Math.min(p.height,parseFloat(mxUtils.getValue(this.state.style,+"size",X.prototype.size))));return new mxPoint(p.getCenterX(),p.y+z)},function(p,z){this.state.style.size=Math.round(Math.max(0,Math.min(p.height,z.y-p.y)))},!1)]},umlFrame:function(d){return[ib(d,["width","height"],function(p){var z=Math.max(Z.prototype.corner,Math.min(p.width,mxUtils.getValue(this.state.style,"width",Z.prototype.width))),u=Math.max(1.5*Z.prototype.corner,Math.min(p.height,mxUtils.getValue(this.state.style,"height",Z.prototype.height)));return new mxPoint(p.x+z,p.y+u)},function(p,+z){this.state.style.width=Math.round(Math.max(Z.prototype.corner,Math.min(p.width,z.x-p.x)));this.state.style.height=Math.round(Math.max(1.5*Z.prototype.corner,Math.min(p.height,z.y-p.y)))},!1)]},process:function(d){var p=[ib(d,["size"],function(z){var u="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),x=parseFloat(mxUtils.getValue(this.state.style,"size",na.prototype.size));return u?new mxPoint(z.x+x,z.y+z.height/4):new mxPoint(z.x+z.width*x,z.y+z.height/4)},function(z,u){z="0"!=mxUtils.getValue(this.state.style,+"fixedSize","0")?Math.max(0,Math.min(.5*z.width,u.x-z.x)):Math.max(0,Math.min(.5,(u.x-z.x)/z.width));this.state.style.size=z},!1)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&p.push(vb(d));return p},cross:function(d){return[ib(d,["size"],function(p){var z=Math.min(p.width,p.height);z=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"size",Za.prototype.size)))*z/2;return new mxPoint(p.getCenterX()-z,p.getCenterY()-z)},function(p,z){var u=Math.min(p.width,p.height);this.state.style.size=+Math.max(0,Math.min(1,Math.min(Math.max(0,p.getCenterY()-z.y)/u*2,Math.max(0,p.getCenterX()-z.x)/u*2)))})]},note:function(d){return[ib(d,["size"],function(p){var z=Math.max(0,Math.min(p.width,Math.min(p.height,parseFloat(mxUtils.getValue(this.state.style,"size",F.prototype.size)))));return new mxPoint(p.x+p.width-z,p.y+z)},function(p,z){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(p.width,p.x+p.width-z.x),Math.min(p.height,z.y-p.y))))})]},note2:function(d){return[ib(d,["size"],function(p){var z=+Math.max(0,Math.min(p.width,Math.min(p.height,parseFloat(mxUtils.getValue(this.state.style,"size",K.prototype.size)))));return new mxPoint(p.x+p.width-z,p.y+z)},function(p,z){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(p.width,p.x+p.width-z.x),Math.min(p.height,z.y-p.y))))})]},manualInput:function(d){var p=[ib(d,["size"],function(z){var u=Math.max(0,Math.min(z.height,mxUtils.getValue(this.state.style,"size",Aa.prototype.size)));return new mxPoint(z.x+z.width/4,z.y+3*u/4)},function(z,+u){this.state.style.size=Math.round(Math.max(0,Math.min(z.height,4*(u.y-z.y)/3)))},!1)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&p.push(vb(d));return p},dataStorage:function(d){return[ib(d,["size"],function(p){var z="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),u=parseFloat(mxUtils.getValue(this.state.style,"size",z?Ma.prototype.fixedSize:Ma.prototype.size));return new mxPoint(p.x+p.width-u*(z?1:p.width),p.getCenterY())},function(p,z){p="0"!=mxUtils.getValue(this.state.style,+"fixedSize","0")?Math.max(0,Math.min(p.width,p.x+p.width-z.x)):Math.max(0,Math.min(1,(p.x+p.width-z.x)/p.width));this.state.style.size=p},!1)]},callout:function(d){var p=[ib(d,["size","position"],function(z){var u=Math.max(0,Math.min(z.height,mxUtils.getValue(this.state.style,"size",ba.prototype.size))),x=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",ba.prototype.position)));mxUtils.getValue(this.state.style,"base",ba.prototype.base);return new mxPoint(z.x+x*z.width,z.y+z.height-u)},function(z,u){mxUtils.getValue(this.state.style,"base",ba.prototype.base);this.state.style.size=Math.round(Math.max(0,Math.min(z.height,z.y+z.height-u.y)));this.state.style.position=Math.round(100*Math.max(0,Math.min(1,(u.x-z.x)/z.width)))/100},!1),ib(d,["position2"],function(z){var u=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position2",ba.prototype.position2)));return new mxPoint(z.x+u*z.width,z.y+z.height)},function(z,u){this.state.style.position2=Math.round(100*Math.max(0,Math.min(1,(u.x-z.x)/z.width)))/100},!1),ib(d,["base"],function(z){var u=Math.max(0,Math.min(z.height,mxUtils.getValue(this.state.style,"size",ba.prototype.size))),x=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",ba.prototype.position))),C=Math.max(0,Math.min(z.width,mxUtils.getValue(this.state.style,"base",ba.prototype.base)));return new mxPoint(z.x+Math.min(z.width,x*z.width+C),z.y+z.height-u)},function(z,u){var x=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",ba.prototype.position)));-this.state.style.base=Math.round(Math.max(0,Math.min(z.width,u.x-z.x-x*z.width)))},!1)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&n.push(vb(d));return n},internalStorage:function(d){var n=[ib(d,["dx","dy"],function(z){var u=Math.max(0,Math.min(z.width,mxUtils.getValue(this.state.style,"dx",wa.prototype.dx))),x=Math.max(0,Math.min(z.height,mxUtils.getValue(this.state.style,"dy",wa.prototype.dy)));return new mxPoint(z.x+u,z.y+x)},function(z,u){this.state.style.dx=Math.round(Math.max(0,-Math.min(z.width,u.x-z.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(z.height,u.y-z.y)))},!1)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&n.push(vb(d));return n},module:function(d){return[ib(d,["jettyWidth","jettyHeight"],function(n){var z=Math.max(0,Math.min(n.width,mxUtils.getValue(this.state.style,"jettyWidth",Ba.prototype.jettyWidth))),u=Math.max(0,Math.min(n.height,mxUtils.getValue(this.state.style,"jettyHeight",Ba.prototype.jettyHeight)));return new mxPoint(n.x+z/2,n.y+-2*u)},function(n,z){this.state.style.jettyWidth=Math.round(2*Math.max(0,Math.min(n.width,z.x-n.x)));this.state.style.jettyHeight=Math.round(Math.max(0,Math.min(n.height,z.y-n.y))/2)})]},corner:function(d){return[ib(d,["dx","dy"],function(n){var z=Math.max(0,Math.min(n.width,mxUtils.getValue(this.state.style,"dx",Ya.prototype.dx))),u=Math.max(0,Math.min(n.height,mxUtils.getValue(this.state.style,"dy",Ya.prototype.dy)));return new mxPoint(n.x+z,n.y+u)},function(n,z){this.state.style.dx=Math.round(Math.max(0,-Math.min(n.width,z.x-n.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(n.height,z.y-n.y)))},!1)]},tee:function(d){return[ib(d,["dx","dy"],function(n){var z=Math.max(0,Math.min(n.width,mxUtils.getValue(this.state.style,"dx",Ra.prototype.dx))),u=Math.max(0,Math.min(n.height,mxUtils.getValue(this.state.style,"dy",Ra.prototype.dy)));return new mxPoint(n.x+(n.width+z)/2,n.y+u)},function(n,z){this.state.style.dx=Math.round(Math.max(0,2*Math.min(n.width/2,z.x-n.x-n.width/2)));this.state.style.dy=-Math.round(Math.max(0,Math.min(n.height,z.y-n.y)))},!1)]},singleArrow:mb(1),doubleArrow:mb(.5),"mxgraph.arrows2.wedgeArrow":nb(20,20),"mxgraph.arrows2.wedgeArrowDashed":nb(20,20),"mxgraph.arrows2.wedgeArrowDashed2":nb(20,20),folder:function(d){return[ib(d,["tabWidth","tabHeight"],function(n){var z=Math.max(0,Math.min(n.width,mxUtils.getValue(this.state.style,"tabWidth",q.prototype.tabWidth))),u=Math.max(0,Math.min(n.height,mxUtils.getValue(this.state.style,"tabHeight",q.prototype.tabHeight)));mxUtils.getValue(this.state.style,-"tabPosition",q.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(z=n.width-z);return new mxPoint(n.x+z,n.y+u)},function(n,z){var u=Math.max(0,Math.min(n.width,z.x-n.x));mxUtils.getValue(this.state.style,"tabPosition",q.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(u=n.width-u);this.state.style.tabWidth=Math.round(u);this.state.style.tabHeight=Math.round(Math.max(0,Math.min(n.height,z.y-n.y)))},!1)]},document:function(d){return[ib(d,["size"],function(n){var z=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,-"size",L.prototype.size))));return new mxPoint(n.x+3*n.width/4,n.y+(1-z)*n.height)},function(n,z){this.state.style.size=Math.max(0,Math.min(1,(n.y+n.height-z.y)/n.height))},!1)]},tape:function(d){return[ib(d,["size"],function(n){var z=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",N.prototype.size))));return new mxPoint(n.getCenterX(),n.y+z*n.height/2)},function(n,z){this.state.style.size=Math.max(0,Math.min(1,(z.y-n.y)/n.height*2))},!1)]},isoCube2:function(d){return[ib(d,-["isoAngle"],function(n){var z=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.state.style,"isoAngle",c.isoAngle))))*Math.PI/200;return new mxPoint(n.x,n.y+Math.min(n.width*Math.tan(z),.5*n.height))},function(n,z){this.state.style.isoAngle=Math.max(0,50*(z.y-n.y)/n.height)},!0)]},cylinder2:qb(f.prototype.size),cylinder3:qb(l.prototype.size),offPageConnector:function(d){return[ib(d,["size"],function(n){var z=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",V.prototype.size))));-return new mxPoint(n.getCenterX(),n.y+(1-z)*n.height)},function(n,z){this.state.style.size=Math.max(0,Math.min(1,(n.y+n.height-z.y)/n.height))},!1)]},"mxgraph.basic.rect":function(d){var n=[Graph.createHandle(d,["size"],function(z){var u=Math.max(0,Math.min(z.width/2,z.height/2,parseFloat(mxUtils.getValue(this.state.style,"size",this.size))));return new mxPoint(z.x+u,z.y+u)},function(z,u){this.state.style.size=Math.round(100*Math.max(0,Math.min(z.height/2,z.width/2,u.x-z.x)))/100})];d=Graph.createHandle(d,-["indent"],function(z){var u=Math.max(0,Math.min(100,parseFloat(mxUtils.getValue(this.state.style,"indent",this.dx2))));return new mxPoint(z.x+.75*z.width,z.y+u*z.height/200)},function(z,u){this.state.style.indent=Math.round(100*Math.max(0,Math.min(100,200*(u.y-z.y)/z.height)))/100});n.push(d);return n},step:zb(ja.prototype.size,!0,null,!0,ja.prototype.fixedSize),hexagon:zb(ca.prototype.size,!0,.5,!0,ca.prototype.fixedSize),curlyBracket:zb(ha.prototype.size,!1),display:zb($a.prototype.size,!1),cube:ub(1,-m.prototype.size,!1),card:ub(.5,G.prototype.size,!0),loopLimit:ub(.5,R.prototype.size,!0),trapezoid:Cb(.5,Y.prototype.size,Y.prototype.fixedSize),parallelogram:Cb(1,J.prototype.size,J.prototype.fixedSize)};Graph.createHandle=ib;Graph.handleFactory=hb;var Ab=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){var d=Ab.apply(this,arguments);if(this.graph.isCellRotatable(this.state.cell)){var n=this.state.style.shape;null==mxCellRenderer.defaultShapes[n]&&-null==mxStencilRegistry.getStencil(n)?n=mxConstants.SHAPE_RECTANGLE:this.state.view.graph.isSwimlane(this.state.cell)&&(n=mxConstants.SHAPE_SWIMLANE);n=hb[n];null==n&&null!=this.state.shape&&this.state.shape.isRoundable()&&(n=hb[mxConstants.SHAPE_RECTANGLE]);null!=n&&(n=n(this.state),null!=n&&(d=null==d?n:d.concat(n)))}return d};mxEdgeHandler.prototype.createCustomHandles=function(){var d=this.state.style.shape;null==mxCellRenderer.defaultShapes[d]&&null==mxStencilRegistry.getStencil(d)&&(d=mxConstants.SHAPE_CONNECTOR);-d=hb[d];return null!=d?d(this.state):null}}else Graph.createHandle=function(){},Graph.handleFactory={};var sb=new mxPoint(1,0),wb=new mxPoint(1,0),yb=mxUtils.toRadians(-30);sb=mxUtils.getRotatedPoint(sb,Math.cos(yb),Math.sin(yb));var rb=mxUtils.toRadians(-150);wb=mxUtils.getRotatedPoint(wb,Math.cos(rb),Math.sin(rb));mxEdgeStyle.IsometricConnector=function(d,n,z,u,x){var C=d.view;u=null!=u&&0<u.length?u[0]:null;var E=d.absolutePoints,da=E[0];E=E[E.length-1];null!=u&&(u=C.transformControlPoint(d,u));-null==da&&null!=n&&(da=new mxPoint(n.getCenterX(),n.getCenterY()));null==E&&null!=z&&(E=new mxPoint(z.getCenterX(),z.getCenterY()));var M=sb.x,sa=sb.y,ma=wb.x,Wa=wb.y,gb="horizontal"==mxUtils.getValue(d.style,"elbow","horizontal");if(null!=E&&null!=da){d=function(Fa,Ka,Ja){Fa-=bb.x;var Ga=Ka-bb.y;Ka=(Wa*Fa-ma*Ga)/(M*Wa-sa*ma);Fa=(sa*Fa-M*Ga)/(sa*ma-M*Wa);gb?(Ja&&(bb=new mxPoint(bb.x+M*Ka,bb.y+sa*Ka),x.push(bb)),bb=new mxPoint(bb.x+ma*Fa,bb.y+Wa*Fa)):(Ja&&(bb=new mxPoint(bb.x+ma*Fa,bb.y+Wa*Fa),x.push(bb)),-bb=new mxPoint(bb.x+M*Ka,bb.y+sa*Ka));x.push(bb)};var bb=da;null==u&&(u=new mxPoint(da.x+(E.x-da.x)/2,da.y+(E.y-da.y)/2));d(u.x,u.y,!0);d(E.x,E.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var Bb=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(d,n){if(n==mxEdgeStyle.IsometricConnector){var z=new mxElbowEdgeHandler(d);z.snapToTerminals=!1;return z}return Bb.apply(this,arguments)};A.prototype.constraints=[];H.prototype.getConstraints=-function(d,n,z){d=[];var u=Math.tan(mxUtils.toRadians(30)),x=(.5-u)/2;u=Math.min(n,z/(.5+u));n=(n-u)/2;z=(z-u)/2;d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,z+.25*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n+.5*u,z+u*x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n+u,z+.25*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n+u,z+.75*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n+.5*u,z+(1-x)*u));d.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,n,z+.75*u));return d};c.prototype.getConstraints=function(d,n,z){d=[];var u=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;u=Math.min(n*Math.tan(u),.5*z);d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,u));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,z-u));d.push(new mxConnectionConstraint(new mxPoint(.5,-1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z-u));d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,u));return d};ba.prototype.getConstraints=function(d,n,z){d=[];mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE);var u=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))));parseFloat(mxUtils.getValue(this.style,"position",this.position));var x=n*Math.max(0,-Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2))));parseFloat(mxUtils.getValue(this.style,"base",this.base));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(.25,0),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(.75,0),!1));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,.5*(z-u)));d.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,n,z-u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z-u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(z-u)));n>=2*u&&d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return d};mxRectangleShape.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,+this.state.style.base=Math.round(Math.max(0,Math.min(z.width,u.x-z.x-x*z.width)))},!1)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&p.push(vb(d));return p},internalStorage:function(d){var p=[ib(d,["dx","dy"],function(z){var u=Math.max(0,Math.min(z.width,mxUtils.getValue(this.state.style,"dx",wa.prototype.dx))),x=Math.max(0,Math.min(z.height,mxUtils.getValue(this.state.style,"dy",wa.prototype.dy)));return new mxPoint(z.x+u,z.y+x)},function(z,u){this.state.style.dx=Math.round(Math.max(0,+Math.min(z.width,u.x-z.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(z.height,u.y-z.y)))},!1)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&p.push(vb(d));return p},module:function(d){return[ib(d,["jettyWidth","jettyHeight"],function(p){var z=Math.max(0,Math.min(p.width,mxUtils.getValue(this.state.style,"jettyWidth",Ba.prototype.jettyWidth))),u=Math.max(0,Math.min(p.height,mxUtils.getValue(this.state.style,"jettyHeight",Ba.prototype.jettyHeight)));return new mxPoint(p.x+z/2,p.y++2*u)},function(p,z){this.state.style.jettyWidth=Math.round(2*Math.max(0,Math.min(p.width,z.x-p.x)));this.state.style.jettyHeight=Math.round(Math.max(0,Math.min(p.height,z.y-p.y))/2)})]},corner:function(d){return[ib(d,["dx","dy"],function(p){var z=Math.max(0,Math.min(p.width,mxUtils.getValue(this.state.style,"dx",Ya.prototype.dx))),u=Math.max(0,Math.min(p.height,mxUtils.getValue(this.state.style,"dy",Ya.prototype.dy)));return new mxPoint(p.x+z,p.y+u)},function(p,z){this.state.style.dx=Math.round(Math.max(0,+Math.min(p.width,z.x-p.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(p.height,z.y-p.y)))},!1)]},tee:function(d){return[ib(d,["dx","dy"],function(p){var z=Math.max(0,Math.min(p.width,mxUtils.getValue(this.state.style,"dx",Ra.prototype.dx))),u=Math.max(0,Math.min(p.height,mxUtils.getValue(this.state.style,"dy",Ra.prototype.dy)));return new mxPoint(p.x+(p.width+z)/2,p.y+u)},function(p,z){this.state.style.dx=Math.round(Math.max(0,2*Math.min(p.width/2,z.x-p.x-p.width/2)));this.state.style.dy=+Math.round(Math.max(0,Math.min(p.height,z.y-p.y)))},!1)]},singleArrow:mb(1),doubleArrow:mb(.5),"mxgraph.arrows2.wedgeArrow":nb(20,20),"mxgraph.arrows2.wedgeArrowDashed":nb(20,20),"mxgraph.arrows2.wedgeArrowDashed2":nb(20,20),folder:function(d){return[ib(d,["tabWidth","tabHeight"],function(p){var z=Math.max(0,Math.min(p.width,mxUtils.getValue(this.state.style,"tabWidth",q.prototype.tabWidth))),u=Math.max(0,Math.min(p.height,mxUtils.getValue(this.state.style,"tabHeight",q.prototype.tabHeight)));mxUtils.getValue(this.state.style,+"tabPosition",q.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(z=p.width-z);return new mxPoint(p.x+z,p.y+u)},function(p,z){var u=Math.max(0,Math.min(p.width,z.x-p.x));mxUtils.getValue(this.state.style,"tabPosition",q.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(u=p.width-u);this.state.style.tabWidth=Math.round(u);this.state.style.tabHeight=Math.round(Math.max(0,Math.min(p.height,z.y-p.y)))},!1)]},document:function(d){return[ib(d,["size"],function(p){var z=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,+"size",L.prototype.size))));return new mxPoint(p.x+3*p.width/4,p.y+(1-z)*p.height)},function(p,z){this.state.style.size=Math.max(0,Math.min(1,(p.y+p.height-z.y)/p.height))},!1)]},tape:function(d){return[ib(d,["size"],function(p){var z=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",N.prototype.size))));return new mxPoint(p.getCenterX(),p.y+z*p.height/2)},function(p,z){this.state.style.size=Math.max(0,Math.min(1,(z.y-p.y)/p.height*2))},!1)]},isoCube2:function(d){return[ib(d,+["isoAngle"],function(p){var z=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.state.style,"isoAngle",c.isoAngle))))*Math.PI/200;return new mxPoint(p.x,p.y+Math.min(p.width*Math.tan(z),.5*p.height))},function(p,z){this.state.style.isoAngle=Math.max(0,50*(z.y-p.y)/p.height)},!0)]},cylinder2:qb(f.prototype.size),cylinder3:qb(l.prototype.size),offPageConnector:function(d){return[ib(d,["size"],function(p){var z=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",V.prototype.size))));+return new mxPoint(p.getCenterX(),p.y+(1-z)*p.height)},function(p,z){this.state.style.size=Math.max(0,Math.min(1,(p.y+p.height-z.y)/p.height))},!1)]},"mxgraph.basic.rect":function(d){var p=[Graph.createHandle(d,["size"],function(z){var u=Math.max(0,Math.min(z.width/2,z.height/2,parseFloat(mxUtils.getValue(this.state.style,"size",this.size))));return new mxPoint(z.x+u,z.y+u)},function(z,u){this.state.style.size=Math.round(100*Math.max(0,Math.min(z.height/2,z.width/2,u.x-z.x)))/100})];d=Graph.createHandle(d,+["indent"],function(z){var u=Math.max(0,Math.min(100,parseFloat(mxUtils.getValue(this.state.style,"indent",this.dx2))));return new mxPoint(z.x+.75*z.width,z.y+u*z.height/200)},function(z,u){this.state.style.indent=Math.round(100*Math.max(0,Math.min(100,200*(u.y-z.y)/z.height)))/100});p.push(d);return p},step:zb(ja.prototype.size,!0,null,!0,ja.prototype.fixedSize),hexagon:zb(ca.prototype.size,!0,.5,!0,ca.prototype.fixedSize),curlyBracket:zb(ha.prototype.size,!1),display:zb($a.prototype.size,!1),cube:ub(1,+m.prototype.size,!1),card:ub(.5,H.prototype.size,!0),loopLimit:ub(.5,R.prototype.size,!0),trapezoid:Cb(.5,Y.prototype.size,Y.prototype.fixedSize),parallelogram:Cb(1,J.prototype.size,J.prototype.fixedSize)};Graph.createHandle=ib;Graph.handleFactory=hb;var Ab=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){var d=Ab.apply(this,arguments);if(this.graph.isCellRotatable(this.state.cell)){var p=this.state.style.shape;null==mxCellRenderer.defaultShapes[p]&&+null==mxStencilRegistry.getStencil(p)?p=mxConstants.SHAPE_RECTANGLE:this.state.view.graph.isSwimlane(this.state.cell)&&(p=mxConstants.SHAPE_SWIMLANE);p=hb[p];null==p&&null!=this.state.shape&&this.state.shape.isRoundable()&&(p=hb[mxConstants.SHAPE_RECTANGLE]);null!=p&&(p=p(this.state),null!=p&&(d=null==d?p:d.concat(p)))}return d};mxEdgeHandler.prototype.createCustomHandles=function(){var d=this.state.style.shape;null==mxCellRenderer.defaultShapes[d]&&null==mxStencilRegistry.getStencil(d)&&(d=mxConstants.SHAPE_CONNECTOR);+d=hb[d];return null!=d?d(this.state):null}}else Graph.createHandle=function(){},Graph.handleFactory={};var sb=new mxPoint(1,0),wb=new mxPoint(1,0),yb=mxUtils.toRadians(-30);sb=mxUtils.getRotatedPoint(sb,Math.cos(yb),Math.sin(yb));var rb=mxUtils.toRadians(-150);wb=mxUtils.getRotatedPoint(wb,Math.cos(rb),Math.sin(rb));mxEdgeStyle.IsometricConnector=function(d,p,z,u,x){var C=d.view;u=null!=u&&0<u.length?u[0]:null;var E=d.absolutePoints,da=E[0];E=E[E.length-1];null!=u&&(u=C.transformControlPoint(d,u));+null==da&&null!=p&&(da=new mxPoint(p.getCenterX(),p.getCenterY()));null==E&&null!=z&&(E=new mxPoint(z.getCenterX(),z.getCenterY()));var M=sb.x,sa=sb.y,ma=wb.x,Wa=wb.y,gb="horizontal"==mxUtils.getValue(d.style,"elbow","horizontal");if(null!=E&&null!=da){d=function(Fa,Ka,Ja){Fa-=bb.x;var Ga=Ka-bb.y;Ka=(Wa*Fa-ma*Ga)/(M*Wa-sa*ma);Fa=(sa*Fa-M*Ga)/(sa*ma-M*Wa);gb?(Ja&&(bb=new mxPoint(bb.x+M*Ka,bb.y+sa*Ka),x.push(bb)),bb=new mxPoint(bb.x+ma*Fa,bb.y+Wa*Fa)):(Ja&&(bb=new mxPoint(bb.x+ma*Fa,bb.y+Wa*Fa),x.push(bb)),+bb=new mxPoint(bb.x+M*Ka,bb.y+sa*Ka));x.push(bb)};var bb=da;null==u&&(u=new mxPoint(da.x+(E.x-da.x)/2,da.y+(E.y-da.y)/2));d(u.x,u.y,!0);d(E.x,E.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var Bb=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(d,p){if(p==mxEdgeStyle.IsometricConnector){var z=new mxElbowEdgeHandler(d);z.snapToTerminals=!1;return z}return Bb.apply(this,arguments)};A.prototype.constraints=[];G.prototype.getConstraints=+function(d,p,z){d=[];var u=Math.tan(mxUtils.toRadians(30)),x=(.5-u)/2;u=Math.min(p,z/(.5+u));p=(p-u)/2;z=(z-u)/2;d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,z+.25*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p+.5*u,z+u*x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p+u,z+.25*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p+u,z+.75*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p+.5*u,z+(1-x)*u));d.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,p,z+.75*u));return d};c.prototype.getConstraints=function(d,p,z){d=[];var u=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;u=Math.min(p*Math.tan(u),.5*z);d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,u));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,z-u));d.push(new mxConnectionConstraint(new mxPoint(.5,+1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z-u));d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,u));return d};ba.prototype.getConstraints=function(d,p,z){d=[];mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE);var u=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))));parseFloat(mxUtils.getValue(this.style,"position",this.position));var x=p*Math.max(0,+Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2))));parseFloat(mxUtils.getValue(this.style,"base",this.base));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(.25,0),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(.75,0),!1));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,.5*(z-u)));d.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,p,z-u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z-u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(z-u)));p>=2*u&&d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return d};mxRectangleShape.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0)];mxEllipse.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(1,.5))];Da.prototype.constraints=mxRectangleShape.prototype.constraints;-mxImageShape.prototype.constraints=mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints=mxRectangleShape.prototype.constraints;la.prototype.constraints=mxRectangleShape.prototype.constraints;mxLabel.prototype.constraints=mxRectangleShape.prototype.constraints;F.prototype.getConstraints=function(d,n,z){d=[];var u=Math.max(0,Math.min(n,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,.5*(n-u),0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-u,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-.5*u,.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,.5*(z+u)));d.push(new mxConnectionConstraint(new mxPoint(1,1),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,-.5),!1));n>=2*u&&d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return d};G.prototype.getConstraints=function(d,n,z){d=[];var u=Math.max(0,Math.min(n,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n+u),0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,0,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(z+u)));d.push(new mxConnectionConstraint(new mxPoint(0,1),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(1,1),!1));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));n>=2*u&&d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return d};m.prototype.getConstraints=function(d,n,z){d=[];var u=Math.max(0,Math.min(n,Math.min(z,parseFloat(mxUtils.getValue(this.style,-"size",this.size)))));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n-u),0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-u,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-.5*u,.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,.5*(z+u)));d.push(new mxConnectionConstraint(new mxPoint(1,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,.5*(n+u),z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,z-.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z-u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(z-u)));return d};l.prototype.getConstraints=function(d,n,z){d=[];n=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,-.5),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,n));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1,null,0,n));d.push(new mxConnectionConstraint(new mxPoint(1,1),!1,null,0,-n));d.push(new mxConnectionConstraint(new mxPoint(0,1),!1,null,0,-n));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,n+.5*(.5*z-n)));d.push(new mxConnectionConstraint(new mxPoint(1,-0),!1,null,0,n+.5*(.5*z-n)));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1,null,0,z-n-.5*(.5*z-n)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z-n-.5*(.5*z-n)));d.push(new mxConnectionConstraint(new mxPoint(.145,0),!1,null,0,.29*n));d.push(new mxConnectionConstraint(new mxPoint(.855,0),!1,null,0,.29*n));d.push(new mxConnectionConstraint(new mxPoint(.855,1),!1,null,0,.29*-n));d.push(new mxConnectionConstraint(new mxPoint(.145,1),!1,null,0,.29*-n));return d};q.prototype.getConstraints=-function(d,n,z){d=[];var u=Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth)))),x=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?(d.push(new mxConnectionConstraint(new mxPoint(0,0),!1)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,0)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,0)),d.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,u,x)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n+u),x))):(d.push(new mxConnectionConstraint(new mxPoint(1,0),!1)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-.5*u,0)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-u,0)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-u,x)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n-u),x)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,x));d.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,n,.25*(z-x)+x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,.5*(z-x)+x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,.75*(z-x)+x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.25*(z-x)+x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(z-x)+x));d.push(new mxConnectionConstraint(new mxPoint(0,+mxImageShape.prototype.constraints=mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints=mxRectangleShape.prototype.constraints;la.prototype.constraints=mxRectangleShape.prototype.constraints;mxLabel.prototype.constraints=mxRectangleShape.prototype.constraints;F.prototype.getConstraints=function(d,p,z){d=[];var u=Math.max(0,Math.min(p,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,.5*(p-u),0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-u,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-.5*u,.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,.5*(z+u)));d.push(new mxConnectionConstraint(new mxPoint(1,1),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,+.5),!1));p>=2*u&&d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return d};H.prototype.getConstraints=function(d,p,z){d=[];var u=Math.max(0,Math.min(p,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p+u),0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,0,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(z+u)));d.push(new mxConnectionConstraint(new mxPoint(0,1),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(1,1),!1));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));p>=2*u&&d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return d};m.prototype.getConstraints=function(d,p,z){d=[];var u=Math.max(0,Math.min(p,Math.min(z,parseFloat(mxUtils.getValue(this.style,+"size",this.size)))));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p-u),0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-u,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-.5*u,.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,.5*(z+u)));d.push(new mxConnectionConstraint(new mxPoint(1,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,.5*(p+u),z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,z-.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z-u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(z-u)));return d};l.prototype.getConstraints=function(d,p,z){d=[];p=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,+.5),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,p));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1,null,0,p));d.push(new mxConnectionConstraint(new mxPoint(1,1),!1,null,0,-p));d.push(new mxConnectionConstraint(new mxPoint(0,1),!1,null,0,-p));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,p+.5*(.5*z-p)));d.push(new mxConnectionConstraint(new mxPoint(1,+0),!1,null,0,p+.5*(.5*z-p)));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1,null,0,z-p-.5*(.5*z-p)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z-p-.5*(.5*z-p)));d.push(new mxConnectionConstraint(new mxPoint(.145,0),!1,null,0,.29*p));d.push(new mxConnectionConstraint(new mxPoint(.855,0),!1,null,0,.29*p));d.push(new mxConnectionConstraint(new mxPoint(.855,1),!1,null,0,.29*-p));d.push(new mxConnectionConstraint(new mxPoint(.145,1),!1,null,0,.29*-p));return d};q.prototype.getConstraints=+function(d,p,z){d=[];var u=Math.max(0,Math.min(p,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth)))),x=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?(d.push(new mxConnectionConstraint(new mxPoint(0,0),!1)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,0)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,0)),d.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,u,x)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p+u),x))):(d.push(new mxConnectionConstraint(new mxPoint(1,0),!1)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-.5*u,0)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-u,0)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-u,x)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p-u),x)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,x));d.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,p,.25*(z-x)+x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,.5*(z-x)+x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,.75*(z-x)+x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.25*(z-x)+x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(z-x)+x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.75*(z-x)+x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z));d.push(new mxConnectionConstraint(new mxPoint(.25,1),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(.75,1),!1));return d};wa.prototype.constraints=mxRectangleShape.prototype.constraints;Ma.prototype.constraints=mxRectangleShape.prototype.constraints;fa.prototype.constraints=mxEllipse.prototype.constraints;ia.prototype.constraints=mxEllipse.prototype.constraints;-oa.prototype.constraints=mxEllipse.prototype.constraints;Ia.prototype.constraints=mxEllipse.prototype.constraints;Aa.prototype.constraints=mxRectangleShape.prototype.constraints;Xa.prototype.constraints=mxRectangleShape.prototype.constraints;$a.prototype.getConstraints=function(d,n,z){d=[];var u=Math.min(n,z/2),x=Math.min(n-u,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*n);d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null));d.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,x,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(x+n-u),0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-u,0));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1,null));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-u,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(x+n-u),z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,z));return d};Ba.prototype.getConstraints=function(d,n,z){n=parseFloat(mxUtils.getValue(d,-"jettyWidth",Ba.prototype.jettyWidth))/2;d=parseFloat(mxUtils.getValue(d,"jettyHeight",Ba.prototype.jettyHeight));var u=[new mxConnectionConstraint(new mxPoint(0,0),!1,null,n),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,-.75),!0),new mxConnectionConstraint(new mxPoint(0,1),!1,null,n),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(z-.5*d,1.5*d)),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(z-.5*d,3.5*d))];z>5*d&&u.push(new mxConnectionConstraint(new mxPoint(0,.75),!1,null,n));z>8*d&&u.push(new mxConnectionConstraint(new mxPoint(0,-.5),!1,null,n));z>15*d&&u.push(new mxConnectionConstraint(new mxPoint(0,.25),!1,null,n));return u};R.prototype.constraints=mxRectangleShape.prototype.constraints;V.prototype.constraints=mxRectangleShape.prototype.constraints;mxCylinder.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.15,.05),!1),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.85,.05),!1),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,+oa.prototype.constraints=mxEllipse.prototype.constraints;Ia.prototype.constraints=mxEllipse.prototype.constraints;Aa.prototype.constraints=mxRectangleShape.prototype.constraints;Xa.prototype.constraints=mxRectangleShape.prototype.constraints;$a.prototype.getConstraints=function(d,p,z){d=[];var u=Math.min(p,z/2),x=Math.min(p-u,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*p);d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null));d.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,x,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(x+p-u),0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-u,0));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1,null));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-u,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(x+p-u),z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,z));return d};Ba.prototype.getConstraints=function(d,p,z){p=parseFloat(mxUtils.getValue(d,+"jettyWidth",Ba.prototype.jettyWidth))/2;d=parseFloat(mxUtils.getValue(d,"jettyHeight",Ba.prototype.jettyHeight));var u=[new mxConnectionConstraint(new mxPoint(0,0),!1,null,p),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,+.75),!0),new mxConnectionConstraint(new mxPoint(0,1),!1,null,p),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(z-.5*d,1.5*d)),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(z-.5*d,3.5*d))];z>5*d&&u.push(new mxConnectionConstraint(new mxPoint(0,.75),!1,null,p));z>8*d&&u.push(new mxConnectionConstraint(new mxPoint(0,+.5),!1,null,p));z>15*d&&u.push(new mxConnectionConstraint(new mxPoint(0,.25),!1,null,p));return u};R.prototype.constraints=mxRectangleShape.prototype.constraints;V.prototype.constraints=mxRectangleShape.prototype.constraints;mxCylinder.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.15,.05),!1),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.85,.05),!1),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.3),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.7),!0),new mxConnectionConstraint(new mxPoint(.15,.95),!1),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.85,.95),!1)];B.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.1),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.75,.1),!1),new mxConnectionConstraint(new mxPoint(0,1/3),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(1,1/3),!1),new mxConnectionConstraint(new mxPoint(1,1),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1)];ya.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];mxActor.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.25,.2),!1),new mxConnectionConstraint(new mxPoint(.1,.5),!1),new mxConnectionConstraint(new mxPoint(0,@@ -2981,117 +2985,117 @@ oa.prototype.constraints=mxEllipse.prototype.constraints;Ia.prototype.constraint.5),!0)];mxHexagon.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.375,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.625,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.375,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.625,1),!0)];mxCloud.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.25),!1),new mxConnectionConstraint(new mxPoint(.4,.1),!1),new mxConnectionConstraint(new mxPoint(.16,.55),!1),new mxConnectionConstraint(new mxPoint(.07,.4),!1),new mxConnectionConstraint(new mxPoint(.31,.8),!1),new mxConnectionConstraint(new mxPoint(.13,.77),!1),new mxConnectionConstraint(new mxPoint(.8,.8),!1),new mxConnectionConstraint(new mxPoint(.55,.95),!1),new mxConnectionConstraint(new mxPoint(.875,.5),!1),new mxConnectionConstraint(new mxPoint(.96,.7),!1),new mxConnectionConstraint(new mxPoint(.625,.2),!1),new mxConnectionConstraint(new mxPoint(.88,.25),!1)];J.prototype.constraints=mxRectangleShape.prototype.constraints;Y.prototype.constraints=mxRectangleShape.prototype.constraints;L.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,-0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)];mxArrow.prototype.constraints=null;Ra.prototype.getConstraints=function(d,n,z){d=[];var u=Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),x=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,-"dy",this.dy))));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,.5*x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.75*n+.25*u,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n+u),x));d.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,.5*(n+u),.5*(z+x)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n+u),z));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n-u),z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n-u),.5*(z+x)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n-u),x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.25*n-.25*u,x));d.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,0,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*x));return d};Ya.prototype.getConstraints=function(d,n,z){d=[];var u=Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),x=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,n,.5*x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n+u),x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,.5*(z+x)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,z));d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,+0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)];mxArrow.prototype.constraints=null;Ra.prototype.getConstraints=function(d,p,z){d=[];var u=Math.max(0,Math.min(p,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),x=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,+"dy",this.dy))));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,.5*x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.75*p+.25*u,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p+u),x));d.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,.5*(p+u),.5*(z+x)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p+u),z));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p-u),z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p-u),.5*(z+x)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p-u),x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.25*p-.25*u,x));d.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,0,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*x));return d};Ya.prototype.getConstraints=function(d,p,z){d=[];var u=Math.max(0,Math.min(p,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),x=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,p,.5*x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p+u),x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,.5*(z+x)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,z));d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,1),!1));return d};Qa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];Sa.prototype.getConstraints=-function(d,n,z){d=[];var u=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth)))),x=n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));u=(z-u)/2;d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n-x),u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-x,0));d.push(new mxConnectionConstraint(new mxPoint(1,-.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-x,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n-x),z-u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z-u));return d};Ha.prototype.getConstraints=function(d,n,z){d=[];var u=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",Sa.prototype.arrowWidth)))),x=n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Sa.prototype.arrowSize))));u=(z-u)/2;d.push(new mxConnectionConstraint(new mxPoint(0,-.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*n,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-x,0));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-x,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*n,z-u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,z));return d};Za.prototype.getConstraints=-function(d,n,z){d=[];var u=Math.min(z,n),x=Math.max(0,Math.min(u,u*parseFloat(mxUtils.getValue(this.style,"size",this.size))));u=(z-x)/2;var C=u+x,E=(n-x)/2;x=E+x;d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,E,.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,E,0));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,x,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,E,z-.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,E,z));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,z-.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,C));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n+x),u));d.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,n,u));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,C));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n+x),C));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,E,C));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*E,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,u));d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,+function(d,p,z){d=[];var u=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth)))),x=p*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));u=(z-u)/2;d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p-x),u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-x,0));d.push(new mxConnectionConstraint(new mxPoint(1,+.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-x,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p-x),z-u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z-u));return d};Ha.prototype.getConstraints=function(d,p,z){d=[];var u=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",Sa.prototype.arrowWidth)))),x=p*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Sa.prototype.arrowSize))));u=(z-u)/2;d.push(new mxConnectionConstraint(new mxPoint(0,+.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*p,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-x,0));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-x,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*p,z-u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,z));return d};Za.prototype.getConstraints=+function(d,p,z){d=[];var u=Math.min(z,p),x=Math.max(0,Math.min(u,u*parseFloat(mxUtils.getValue(this.style,"size",this.size))));u=(z-x)/2;var C=u+x,E=(p-x)/2;x=E+x;d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,E,.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,E,0));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,x,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,E,z-.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,E,z));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,z-.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,C));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p+x),u));d.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,p,u));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,C));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p+x),C));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,E,C));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*E,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,u));d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,C));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*E,C));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,E,u));return d};X.prototype.constraints=null;y.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];O.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.175,.25),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.175,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];ua.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];qa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)]})();function Actions(b){this.editorUi=b;this.actions={};this.init()}-Actions.prototype.init=function(){function b(F){p.escape();F=p.deleteCells(p.getDeletableCells(p.getSelectionCells()),F);null!=F&&p.setSelectionCells(F)}function e(){if(!p.isSelectionEmpty()){p.getModel().beginUpdate();try{for(var F=p.getSelectionCells(),K=0;K<F.length;K++)p.cellLabelChanged(F[K],"")}finally{p.getModel().endUpdate()}}}function g(F,K,c,f,l){l.getModel().beginUpdate();try{var t=l.getCellGeometry(F);null!=t&&c&&f&&(c/=f,t=t.clone(),1<c?t.height=t.width/c:t.width=t.height*c,l.getModel().setGeometry(F,-t));l.setCellStyles(mxConstants.STYLE_CLIP_PATH,K,[F]);l.setCellStyles(mxConstants.STYLE_ASPECT,"fixed",[F])}finally{l.getModel().endUpdate()}}var m=this.editorUi,v=m.editor,p=v.graph,A=function(){return Action.prototype.isEnabled.apply(this,arguments)&&p.isEnabled()};this.addAction("new...",function(){p.openLink(m.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";m.openFile()});var H=new Action("smartFit",function(){p.popupMenuHandler.hideMenu();var F=p.view.scale,-K=p.container.scrollLeft,c=p.container.scrollTop,f=p.view.translate.x,l=p.view.translate.y;m.actions.get("resetView").funct();1E-5>Math.abs(F-p.view.scale)&&5>Math.abs(K-p.container.scrollLeft)&&5>Math.abs(c-p.container.scrollTop)&&f==p.view.translate.x&&l==p.view.translate.y&&m.actions.get("fitWindow").funct()},null,null,"Enter");H.getTitle=function(){return mxResources.get("fitWindow")+" / "+mxResources.get("resetView")};this.put("smartFit",H);this.addAction("keyPressEnter",function(){p.isSelectionEmpty()?-m.actions.get("smartFit").funct():p.isEnabled()&&p.startEditingAtCell()});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){m.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(F,K){try{var c=mxUtils.parseXml(F);v.graph.setSelectionCells(v.graph.importGraphModel(c.documentElement))}catch(f){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+f.message)}}));m.showDialog((new OpenDialog(this)).container,+Actions.prototype.init=function(){function b(F){n.escape();F=n.deleteCells(n.getDeletableCells(n.getSelectionCells()),F);null!=F&&n.setSelectionCells(F)}function e(){if(!n.isSelectionEmpty()){n.getModel().beginUpdate();try{for(var F=n.getSelectionCells(),K=0;K<F.length;K++)n.cellLabelChanged(F[K],"")}finally{n.getModel().endUpdate()}}}function g(F,K,c,f,l){l.getModel().beginUpdate();try{var t=l.getCellGeometry(F);null!=t&&c&&f&&(c/=f,t=t.clone(),1<c?t.height=t.width/c:t.width=t.height*c,l.getModel().setGeometry(F,+t));l.setCellStyles(mxConstants.STYLE_CLIP_PATH,K,[F]);l.setCellStyles(mxConstants.STYLE_ASPECT,"fixed",[F])}finally{l.getModel().endUpdate()}}var m=this.editorUi,v=m.editor,n=v.graph,A=function(){return Action.prototype.isEnabled.apply(this,arguments)&&n.isEnabled()};this.addAction("new...",function(){n.openLink(m.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";m.openFile()});var G=new Action("smartFit",function(){n.popupMenuHandler.hideMenu();var F=n.view.scale,+K=n.container.scrollLeft,c=n.container.scrollTop,f=n.view.translate.x,l=n.view.translate.y;m.actions.get("resetView").funct();1E-5>Math.abs(F-n.view.scale)&&5>Math.abs(K-n.container.scrollLeft)&&5>Math.abs(c-n.container.scrollTop)&&f==n.view.translate.x&&l==n.view.translate.y&&m.actions.get("fitWindow").funct()},null,null,"Enter");G.getTitle=function(){return mxResources.get("fitWindow")+" / "+mxResources.get("resetView")};this.put("smartFit",G);this.addAction("keyPressEnter",function(){n.isSelectionEmpty()?+m.actions.get("smartFit").funct():n.isEnabled()&&n.startEditingAtCell()});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){m.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(F,K){try{var c=mxUtils.parseXml(F);v.graph.setSelectionCells(v.graph.importGraphModel(c.documentElement))}catch(f){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+f.message)}}));m.showDialog((new OpenDialog(this)).container,320,220,!0,!0,function(){window.openFile=null})}).isEnabled=A;this.addAction("save",function(){m.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=A;this.addAction("saveAs...",function(){m.saveFile(!0)},null,null,Editor.ctrlKey+"+Shift+S");this.addAction("export...",function(){m.showDialog((new ExportDialog(m)).container,300,340,!0,!0)});this.addAction("editDiagram...",function(){var F=new EditDiagramDialog(m);m.showDialog(F.container,620,420,!0,!1);F.init()}).isEnabled=A;this.addAction("pageSetup...",-function(){m.showDialog((new PageSetupDialog(m)).container,320,240,!0,!0)}).isEnabled=A;this.addAction("print...",function(){m.showPrintDialog()},null,"sprite-print",Editor.ctrlKey+"+P");this.addAction("preview",function(){mxUtils.show(p,null,10,10)});this.addAction("undo",function(){m.undo()},null,"sprite-undo",Editor.ctrlKey+"+Z");this.addAction("redo",function(){m.redo()},null,"sprite-redo",mxClient.IS_WIN?Editor.ctrlKey+"+Y":Editor.ctrlKey+"+Shift+Z");this.addAction("cut",function(){var F=null;-try{F=m.copyXml(),null!=F&&p.removeCells(F,!1)}catch(K){}try{null==F&&mxClipboard.cut(p)}catch(K){m.handleError(K)}},null,"sprite-cut",Editor.ctrlKey+"+X");this.addAction("copy",function(){try{m.copyXml()}catch(F){}try{mxClipboard.copy(p)}catch(F){m.handleError(F)}},null,"sprite-copy",Editor.ctrlKey+"+C");this.addAction("paste",function(){if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())){var F=!1;try{Editor.enableNativeCipboard&&(m.readGraphModelFromClipboard(function(K){if(null!=K){p.getModel().beginUpdate();-try{m.pasteXml(K,!0)}finally{p.getModel().endUpdate()}}else mxClipboard.paste(p)}),F=!0)}catch(K){}F||mxClipboard.paste(p)}},!1,"sprite-paste",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(F){function K(f){if(null!=f){for(var l=!0,t=0;t<f.length&&l;t++)l=l&&p.model.isEdge(f[t]);var q=p.view.translate;t=p.view.scale;var D=q.x,G=q.y;q=null;if(1==f.length&&l){var N=p.getCellGeometry(f[0]);null!=N&&(q=N.getTerminalPoint(!0))}q=null!=q?q:p.getBoundingBoxFromGeometry(f,l);null!=q&&(l=Math.round(p.snap(p.popupMenuHandler.triggerX/-t-D)),t=Math.round(p.snap(p.popupMenuHandler.triggerY/t-G)),p.cellsMoved(f,l-q.x,t-q.y))}}function c(){p.getModel().beginUpdate();try{K(mxClipboard.paste(p))}finally{p.getModel().endUpdate()}}if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())){F=!1;try{Editor.enableNativeCipboard&&(m.readGraphModelFromClipboard(function(f){if(null!=f){p.getModel().beginUpdate();try{K(m.pasteXml(f,!0))}finally{p.getModel().endUpdate()}}else c()}),F=!0)}catch(f){}F||c()}});this.addAction("swap",function(){var F=-p.getSelectionCells();2==F.length&&p.swapShapes(F[0],F[1])});this.addAction("copySize",function(){var F=p.getSelectionCell();p.isEnabled()&&null!=F&&p.getModel().isVertex(F)&&(F=p.getCellGeometry(F),null!=F&&(m.copiedSize=new mxRectangle(F.x,F.y,F.width,F.height)))},null,null,"Alt+Shift+F");this.addAction("pasteSize",function(){if(p.isEnabled()&&!p.isSelectionEmpty()&&null!=m.copiedSize){p.getModel().beginUpdate();try{for(var F=p.getResizableCells(p.getSelectionCells()),K=0;K<F.length;K++)if(p.getModel().isVertex(F[K])){var c=-p.getCellGeometry(F[K]);null!=c&&(c=c.clone(),c.width=m.copiedSize.width,c.height=m.copiedSize.height,p.getModel().setGeometry(F[K],c))}}finally{p.getModel().endUpdate()}}},null,null,"Alt+Shift+V");this.addAction("copyData",function(){var F=p.getSelectionCell()||p.getModel().getRoot();p.isEnabled()&&null!=F&&(F=F.cloneValue(),null==F||isNaN(F.nodeType)||(m.copiedValue=F))},null,null,"Alt+Shift+B");this.addAction("copyAsText",function(){var F=p.getSelectionCell();if(p.isEnabled()&&null!=F)try{p.isHtmlLabel(F)?-m.writeHtmlToClipboard(p.getLabel(F),mxUtils.bind(this,function(K){m.handleError(K)})):m.writeTextToClipboard(p.getLabel(F),mxUtils.bind(this,function(K){m.handleError(K)}))}catch(K){m.handleError(K)}});this.addAction("pasteData",function(F,K){function c(t,q){var D=f.getValue(t);q=t.cloneValue(q);q.removeAttribute("placeholders");null==D||isNaN(D.nodeType)||q.setAttribute("placeholders",D.getAttribute("placeholders"));null!=F&&mxEvent.isShiftDown(F)||q.setAttribute("label",p.convertValueToString(t));-f.setValue(t,q)}F=null!=K?K:F;var f=p.getModel();if(p.isEnabled()&&!p.isSelectionEmpty()&&null!=m.copiedValue){f.beginUpdate();try{var l=p.getEditableCells(p.getSelectionCells());if(0==l.length)c(f.getRoot(),m.copiedValue);else for(K=0;K<l.length;K++)c(l[K],m.copiedValue)}finally{f.endUpdate()}}},null,null,"Alt+Shift+E");this.addAction("delete",function(F,K){F=null!=K?K:F;null!=F&&mxEvent.isShiftDown(F)?e():b(null!=F&&(mxEvent.isControlDown(F)||mxEvent.isMetaDown(F)||mxEvent.isAltDown(F)))},null,-null,"Delete");this.addAction("deleteAll",function(){b(!0)});this.addAction("deleteLabels",function(){e()},null,null,Editor.ctrlKey+"+Delete");this.addAction("duplicate",function(){try{p.setSelectionCells(p.duplicateCells()),p.scrollCellToVisible(p.getSelectionCell())}catch(F){m.handleError(F)}},null,null,Editor.ctrlKey+"+D");this.put("mergeCells",new Action("merge",function(){var F=m.getSelectionState();if(null!=F.mergeCell){p.getModel().beginUpdate();try{p.setCellStyles("rowspan",F.rowspan,[F.mergeCell]),-p.setCellStyles("colspan",F.colspan,[F.mergeCell])}finally{p.getModel().endUpdate()}}}));this.put("unmergeCells",new Action("unmerge",function(){var F=m.getSelectionState();if(0<F.cells.length){p.getModel().beginUpdate();try{p.setCellStyles("rowspan",null,F.cells),p.setCellStyles("colspan",null,F.cells)}finally{p.getModel().endUpdate()}}}));H=new Action("turn",function(F,K){F=null!=K?K:F;p.turnShapes(p.getResizableCells(p.getSelectionCells()),null!=F?mxEvent.isShiftDown(F):!1)},null,null,mxClient.IS_SF?-null:Editor.ctrlKey+"+R");H.getTitle=function(){return mxResources.get("turn")+" / "+mxResources.get("reverse")};this.put("turn",H);this.put("selectConnections",new Action("selectEdges",function(F){F=p.getSelectionCell();p.isEnabled()&&null!=F&&p.addSelectionCells(p.getEdges(F))}));this.addAction("selectVertices",function(){p.selectVertices(null,!0)},null,null,Editor.ctrlKey+"+Shift+I");this.addAction("selectEdges",function(){p.selectEdges()},null,null,Editor.ctrlKey+"+Shift+E");this.addAction("selectAll",-function(){p.selectAll(null,!0)},null,null,Editor.ctrlKey+"+A");this.addAction("selectNone",function(){p.clearSelection()},null,null,Editor.ctrlKey+"+Shift+A");this.addAction("lockUnlock",function(){if(!p.isSelectionEmpty()){p.getModel().beginUpdate();try{var F=p.getSelectionCells(),K=p.getCurrentCellStyle(p.getSelectionCell()),c=1==mxUtils.getValue(K,mxConstants.STYLE_EDITABLE,1)?0:1;p.setCellStyles(mxConstants.STYLE_MOVABLE,c,F);p.setCellStyles(mxConstants.STYLE_RESIZABLE,c,F);p.setCellStyles(mxConstants.STYLE_ROTATABLE,-c,F);p.setCellStyles(mxConstants.STYLE_DELETABLE,c,F);p.setCellStyles(mxConstants.STYLE_EDITABLE,c,F);p.setCellStyles("locked",1==c?0:1,F);p.setCellStyles("connectable",c,F)}finally{p.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+L");this.addAction("explore",function(){p.model.isVertex(p.getSelectionCell())&&Graph.exploreFromCell(m.editor.graph,m.editor.graph.getSelectionCell())});this.addAction("home",function(){p.home()},null,null,"Shift+Home");this.addAction("exitGroup",function(){p.exitGroup()},-null,null,Editor.ctrlKey+"+Shift+Home");this.addAction("enterGroup",function(){p.enterGroup()},null,null,Editor.ctrlKey+"+Shift+End");this.addAction("collapse",function(){p.foldCells(!0)},null,null,Editor.ctrlKey+"+Home");this.addAction("expand",function(){p.foldCells(!1)},null,null,Editor.ctrlKey+"+End");this.addAction("toFront",function(){p.orderCells(!1)},null,null,Editor.ctrlKey+"+Shift+F");this.addAction("toBack",function(){p.orderCells(!0)},null,null,Editor.ctrlKey+"+Shift+B");this.addAction("bringForward",-function(F){p.orderCells(!1,null,!0)},null,null,Editor.ctrlKey+"+Alt+Shift+F");this.addAction("sendBackward",function(F){p.orderCells(!0,null,!0)},null,null,Editor.ctrlKey+"+Alt+Shift+B");this.addAction("group",function(){if(p.isEnabled()){var F=mxUtils.sortCells(p.getSelectionCells(),!0);1!=F.length||p.isTable(F[0])||p.isTableRow(F[0])?(F=p.getCellsForGroup(F),1<F.length&&p.setSelectionCell(p.groupCells(null,0,F))):p.setCellStyles("container","1")}},null,null,Editor.ctrlKey+"+G");this.addAction("ungroup",-function(){if(p.isEnabled()){var F=p.getEditableCells(p.getSelectionCells());p.model.beginUpdate();try{var K=p.ungroupCells();if(null!=F)for(var c=0;c<F.length;c++)p.model.contains(F[c])&&(0==p.model.getChildCount(F[c])&&p.model.isVertex(F[c])&&p.setCellStyles("container","0",[F[c]]),K.push(F[c]))}finally{p.model.endUpdate()}0<K.length&&p.setSelectionCells(K)}},null,null,Editor.ctrlKey+"+Shift+U");this.addAction("removeFromGroup",function(){if(p.isEnabled()){var F=p.getSelectionCells();if(null!=F){for(var K=-[],c=0;c<F.length;c++)p.isTableRow(F[c])||p.isTableCell(F[c])||K.push(F[c]);p.removeCellsFromParent(K);0<K.length&&p.scrollCellToVisible(K[0])}}});this.addAction("edit",function(){p.isEnabled()&&p.startEditingAtCell()},null,null,"F2/Enter");this.addAction("editData...",function(){var F=p.getSelectionCell()||p.getModel().getRoot();m.showDataDialog(F)},null,null,Editor.ctrlKey+"+M");this.addAction("editTooltip...",function(){var F=p.getSelectionCell();if(p.isEnabled()&&null!=F&&p.isCellEditable(F)){var K=-"";if(mxUtils.isNode(F.value)){var c=null;Graph.translateDiagram&&null!=Graph.diagramLanguage&&F.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(c=F.value.getAttribute("tooltip_"+Graph.diagramLanguage));null==c&&(c=F.value.getAttribute("tooltip"));null!=c&&(K=c)}K=new TextareaDialog(m,mxResources.get("editTooltip")+":",K,function(f){p.setTooltipForCell(F,f)});m.showDialog(K.container,320,200,!0,!0);K.init()}},null,null,"Alt+Shift+T");this.addAction("openLink",function(){var F=p.getLinkForCell(p.getSelectionCell());-null!=F&&p.openLink(F)});this.addAction("editLink...",function(){var F=p.getSelectionCell();if(p.isEnabled()&&null!=F&&p.isCellEditable(F)){var K=p.getLinkForCell(F,!0)||"";m.showLinkDialog(K,mxResources.get("ok"),function(c,f,l){p.getModel().beginUpdate();try{p.setLinkForCell(F,0<c.length?c:null),p.setAttributeForCell(F,"linkTarget",l)}finally{p.getModel().endUpdate()}},!0,p.getLinkTargetForCell(F))}},null,null,"Alt+Shift+L");this.put("insertImage",new Action("image...",function(){p.isEnabled()&&-!p.isCellLocked(p.getDefaultParent())&&(p.clearSelection(),m.actions.get("image").funct())})).isEnabled=A;this.addAction("editImage...",function(){m.actions.get("image").funct()});this.put("insertLink",new Action("link...",function(){p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&m.showLinkDialog("",mxResources.get("ok"),function(F,K,c){F=mxUtils.trim(F);if(0<F.length){var f=null,l=p.getLinkTitle(F);null!=K&&0<K.length&&(f=K[0].iconUrl,l=K[0].name||K[0].type,l=l.charAt(0).toUpperCase()+l.substring(1),-30<l.length&&(l=l.substring(0,30)+"..."));K=new mxCell(l,new mxGeometry(0,0,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=f?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+f:"spacing=10;"));K.vertex=!0;f=p.getCenterInsertPoint(p.getBoundingBoxFromGeometry([K],!0));K.geometry.x=f.x;K.geometry.y=f.y;p.setAttributeForCell(K,"linkTarget",c);p.setLinkForCell(K,F);p.cellSizeUpdated(K,!0);p.getModel().beginUpdate();try{K=p.addCell(K),p.fireEvent(new mxEventObject("cellsInserted",-"cells",[K]))}finally{p.getModel().endUpdate()}p.setSelectionCell(K);p.scrollCellToVisible(p.getSelectionCell())}},!0)},null,null,"L")).isEnabled=A;this.addAction("link...",mxUtils.bind(this,function(){if(p.isEnabled())if(p.cellEditor.isContentEditing()){var F=p.getSelectedElement(),K=p.getParentByName(F,"A",p.cellEditor.textarea),c="";if(null==K&&null!=F&&null!=F.getElementsByTagName)for(var f=F.getElementsByTagName("a"),l=0;l<f.length&&null==K;l++)f[l].textContent==F.textContent&&(K=f[l]);null!=-K&&"A"==K.nodeName&&(c=K.getAttribute("href")||"",p.selectNode(K));var t=p.cellEditor.saveSelection();m.showLinkDialog(c,mxResources.get("ok"),mxUtils.bind(this,function(q){p.cellEditor.restoreSelection(t);null!=q&&p.insertLink(q)}))}else p.isSelectionEmpty()?this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=A;this.addAction("autosize",function(){var F=p.getSelectionCells();if(null!=F){p.getModel().beginUpdate();try{for(var K=0;K<F.length;K++){var c=F[K];p.getModel().isVertex(c)&&-(0<p.getModel().getChildCount(c)?p.updateGroupBounds([c],0,!0):p.updateCellSize(c))}}finally{p.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+Y");this.addAction("snapToGrid",function(){p.snapCellsToGrid(p.getSelectionCells(),p.gridSize)});this.addAction("formattedText",function(){p.stopEditing();var F=p.getCommonStyle(p.getSelectionCells());F="1"==mxUtils.getValue(F,"html","0")?null:"1";p.getModel().beginUpdate();try{for(var K=p.getEditableCells(p.getSelectionCells()),c=0;c<K.length;c++)if(state=-p.getView().getState(K[c]),null!=state){var f=mxUtils.getValue(state.style,"html","0");if("1"==f&&null==F)p.removeTextStyleForCell(state.cell),p.setCellStyles("html",F,[K[c]]);else if("0"==f&&"1"==F){var l=mxUtils.htmlEntities(p.convertValueToString(state.cell),!1);"0"!=mxUtils.getValue(state.style,"nl2Br","1")&&(l=l.replace(/\n/g,"<br/>"));p.cellLabelChanged(state.cell,Graph.sanitizeHtml(l));p.setCellStyles("html",F,[K[c]])}}m.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=-F?F:"0"],"cells",K))}finally{p.getModel().endUpdate()}});this.addAction("wordWrap",function(){var F=p.getView().getState(p.getSelectionCell()),K="wrap";p.stopEditing();null!=F&&"wrap"==F.style[mxConstants.STYLE_WHITE_SPACE]&&(K=null);p.setCellStyles(mxConstants.STYLE_WHITE_SPACE,K)});this.addAction("rotation",function(){var F="0",K=p.getView().getState(p.getSelectionCell());null!=K&&(F=K.style[mxConstants.STYLE_ROTATION]||F);F=new FilenameDialog(m,F,mxResources.get("apply"),function(c){null!=c&&0<-c.length&&p.setCellStyles(mxConstants.STYLE_ROTATION,c)},mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");m.showDialog(F.container,375,80,!0,!0);F.init()});this.addAction("resetView",function(){p.zoomTo(1);m.resetScrollbars()},null,null,"Enter/Home");this.addAction("zoomIn",function(F){p.isFastZoomEnabled()?p.lazyZoom(!0,!0,m.buttonZoomDelay):p.zoomIn()},null,null,Editor.ctrlKey+" + / Alt+Mousewheel");this.addAction("zoomOut",function(F){p.isFastZoomEnabled()?p.lazyZoom(!1,-!0,m.buttonZoomDelay):p.zoomOut()},null,null,Editor.ctrlKey+" - / Alt+Mousewheel");this.addAction("fitWindow",function(){p.pageVisible&&p.isSelectionEmpty()?p.fitPages():m.fitDiagramToWindow()},null,null,Editor.ctrlKey+"+Shift+H");this.addAction("fitPage",mxUtils.bind(this,function(){p.pageVisible?p.fitPages(1):this.get("pageView").funct()}),null,null,Editor.ctrlKey+"+J");this.addAction("fitTwoPages",mxUtils.bind(this,function(){p.pageVisible?p.fitPages(2):this.get("pageView").funct()}),null,null,-Editor.ctrlKey+"+Shift+J");this.addAction("fitPageWidth",mxUtils.bind(this,function(){p.pageVisible?p.fitPages(1,!0):this.get("pageView").funct()}));this.put("customZoom",new Action("custom...",mxUtils.bind(this,function(){var F=new FilenameDialog(this.editorUi,parseInt(100*p.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(K){K=parseInt(K);!isNaN(K)&&0<K&&p.zoomTo(K/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(F.container,300,80,!0,!0);F.init()}),null,-null,Editor.ctrlKey+"+0"));this.addAction("pageScale...",mxUtils.bind(this,function(){var F=new FilenameDialog(this.editorUi,parseInt(100*p.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(K){K=parseInt(K);!isNaN(K)&&0<K&&(K=new ChangePageSetup(m,null,null,null,K/100),K.ignoreColor=!0,K.ignoreImage=!0,p.model.execute(K))}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(F.container,300,80,!0,!0);F.init()}));H=null;H=this.addAction("grid",function(){p.setGridEnabled(!p.isGridEnabled());-p.defaultGridEnabled=p.isGridEnabled();m.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+Shift+G");H.setToggleAction(!0);H.setSelectedCallback(function(){return p.isGridEnabled()});H.setEnabled(!1);H=this.addAction("guides",function(){p.graphHandler.guidesEnabled=!p.graphHandler.guidesEnabled;m.fireEvent(new mxEventObject("guidesEnabledChanged"))});H.setToggleAction(!0);H.setSelectedCallback(function(){return p.graphHandler.guidesEnabled});H.setEnabled(!1);H=this.addAction("animations",-function(){Editor.enableAnimations=!Editor.enableAnimations;m.fireEvent(new mxEventObject("enableAnimationsChanged"))});H.setToggleAction(!0);H.setSelectedCallback(function(){return Editor.enableAnimations});H=this.addAction("tooltips",function(){p.tooltipHandler.setEnabled(!p.tooltipHandler.isEnabled());m.fireEvent(new mxEventObject("tooltipsEnabledChanged"))});H.setToggleAction(!0);H.setSelectedCallback(function(){return p.tooltipHandler.isEnabled()});H=this.addAction("collapseExpand",function(){var F=-new ChangePageSetup(m);F.ignoreColor=!0;F.ignoreImage=!0;F.foldingEnabled=!p.foldingEnabled;p.model.execute(F)});H.setToggleAction(!0);H.setSelectedCallback(function(){return p.foldingEnabled});H.isEnabled=A;H=this.addAction("pageView",mxUtils.bind(this,function(){m.setPageVisible(!p.pageVisible)}));H.setToggleAction(!0);H.setSelectedCallback(function(){return p.pageVisible});H=this.addAction("connectionArrows",function(){p.connectionArrowsEnabled=!p.connectionArrowsEnabled;m.fireEvent(new mxEventObject("connectionArrowsChanged"))},-null,null,"Alt+Shift+A");H.setToggleAction(!0);H.setSelectedCallback(function(){return p.connectionArrowsEnabled});H=this.addAction("connectionPoints",function(){p.setConnectable(!p.connectionHandler.isEnabled());m.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,"Alt+Shift+O");H.setToggleAction(!0);H.setSelectedCallback(function(){return p.connectionHandler.isEnabled()});H=this.addAction("copyConnect",function(){p.connectionHandler.setCreateTarget(!p.connectionHandler.isCreateTarget());-m.fireEvent(new mxEventObject("copyConnectChanged"))});H.setToggleAction(!0);H.setSelectedCallback(function(){return p.connectionHandler.isCreateTarget()});H.isEnabled=A;H=this.addAction("autosave",function(){m.editor.setAutosave(!m.editor.autosave)});H.setToggleAction(!0);H.setSelectedCallback(function(){return m.editor.autosave});H.isEnabled=A;H.visible=!1;this.addAction("help",function(){var F="";mxResources.isLanguageSupported(mxClient.language)&&(F="_"+mxClient.language);p.openLink(RESOURCES_PATH+-"/help"+F+".html")});var S=!1;H=new Action("about",function(){S||(m.showDialog((new AboutDialog(m)).container,320,280,!0,!0,function(){S=!1}),S=!0)});H.getTitle=function(){return mxResources.get("about")+" Graph Editor..."};this.put("about",H);H=mxUtils.bind(this,function(F,K,c,f){return this.addAction(F,function(){if(null!=c&&p.cellEditor.isContentEditing())c();else{p.stopEditing(!1);p.getModel().beginUpdate();try{var l=p.getEditableCells(p.getSelectionCells());p.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,-K,l);(K&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?p.updateLabelElements(l,function(q){q.style.fontWeight=null;"B"==q.nodeName&&p.replaceElement(q)}):(K&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?p.updateLabelElements(l,function(q){q.style.fontStyle=null;"I"==q.nodeName&&p.replaceElement(q)}):(K&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&p.updateLabelElements(l,function(q){q.style.textDecoration=null;"U"==q.nodeName&&p.replaceElement(q)});for(var t=0;t<l.length;t++)0==p.model.getChildCount(l[t])&&-p.autoSizeCell(l[t],!1)}finally{p.getModel().endUpdate()}}},null,null,f)});H("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");H("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I");H("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){m.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000",-"default",p.shapeForegroundColor)});this.addAction("strokeColor...",function(){m.menus.pickColor(mxConstants.STYLE_STROKECOLOR,null,null,"default",p.shapeForegroundColor)});this.addAction("fillColor...",function(){m.menus.pickColor(mxConstants.STYLE_FILLCOLOR,null,null,"default",p.shapeBackgroundColor)});this.addAction("gradientColor...",function(){m.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR,null,null,"default",p.shapeForegroundColor)});this.addAction("backgroundColor...",function(){m.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,-"backcolor",null,"default",p.shapeBackgroundColor)});this.addAction("borderColor...",function(){m.menus.pickColor(mxConstants.STYLE_LABEL_BORDERCOLOR,null,null,"default",p.shapeForegroundColor)});this.addAction("removeFormat",function(){if(p.isEnabled()&&!p.isSelectionEmpty()&&!p.isEditing()){p.getModel().beginUpdate();try{for(var F=p.getSelectionCells(),K=0;K<F.length;K++)p.removeTextStyleForCell(F[K],!0)}finally{p.getModel().endUpdate()}}});this.addAction("vertical",function(){m.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,-!0)});this.addAction("shadow",function(){m.menus.toggleStyle(mxConstants.STYLE_SHADOW)});this.addAction("solid",function(){p.getModel().beginUpdate();try{p.setCellStyles(mxConstants.STYLE_DASHED,null),p.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",[null,null],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("dashed",function(){p.getModel().beginUpdate();-try{p.setCellStyles(mxConstants.STYLE_DASHED,"1"),p.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1",null],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("dotted",function(){p.getModel().beginUpdate();try{p.setCellStyles(mxConstants.STYLE_DASHED,"1"),p.setCellStyles(mxConstants.STYLE_DASH_PATTERN,"1 4"),m.fireEvent(new mxEventObject("styleChanged",-"keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1","1 4"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("sharp",function(){p.getModel().beginUpdate();try{p.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),p.setCellStyles(mxConstants.STYLE_CURVED,"0"),m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","0"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});-this.addAction("rounded",function(){p.getModel().beginUpdate();try{p.setCellStyles(mxConstants.STYLE_ROUNDED,"1"),p.setCellStyles(mxConstants.STYLE_CURVED,"0"),m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["1","0"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("toggleRounded",function(){if(!p.isSelectionEmpty()&&p.isEnabled()){p.getModel().beginUpdate();try{var F=p.getSelectionCells(),K=p.getCurrentCellStyle(F[0]),-c="1"==mxUtils.getValue(K,mxConstants.STYLE_ROUNDED,"0")?"0":"1";p.setCellStyles(mxConstants.STYLE_ROUNDED,c);p.setCellStyles(mxConstants.STYLE_CURVED,null);m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[c,"0"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}}});this.addAction("curved",function(){p.getModel().beginUpdate();try{p.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),p.setCellStyles(mxConstants.STYLE_CURVED,-"1"),m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","1"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("collapsible",function(){var F=p.view.getState(p.getSelectionCell()),K="1";null!=F&&null!=p.getFoldingImage(F)&&(K="0");p.setCellStyles("collapsible",K);m.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[K],"cells",p.getSelectionCells()))});this.addAction("editStyle...",-mxUtils.bind(this,function(){var F=p.getEditableCells(p.getSelectionCells());if(null!=F&&0<F.length){var K=p.getModel();K=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",K.getStyle(F[0])||"",function(c){null!=c&&p.setCellStyle(mxUtils.trim(c),F)},null,null,400,220);this.editorUi.showDialog(K.container,420,300,!0,!0);K.init()}}),null,null,Editor.ctrlKey+"+E");this.addAction("setAsDefaultStyle",function(){p.isEnabled()&&!p.isSelectionEmpty()&&m.setDefaultStyle(p.getSelectionCell())},-null,null,Editor.ctrlKey+"+Shift+D");this.addAction("clearDefaultStyle",function(){p.isEnabled()&&m.clearDefaultStyle()},null,null,Editor.ctrlKey+"+Shift+R");this.addAction("addWaypoint",function(){var F=p.getSelectionCell();if(null!=F&&p.getModel().isEdge(F)){var K=v.graph.selectionCellsHandler.getHandler(F);if(K instanceof mxEdgeHandler){var c=p.view.translate,f=p.view.scale,l=c.x;c=c.y;F=p.getModel().getParent(F);for(var t=p.getCellGeometry(F);p.getModel().isVertex(F)&&null!=t;)l+=t.x,c+=t.y,F=-p.getModel().getParent(F),t=p.getCellGeometry(F);l=Math.round(p.snap(p.popupMenuHandler.triggerX/f-l));f=Math.round(p.snap(p.popupMenuHandler.triggerY/f-c));K.addPointAt(K.state,l,f)}}});this.addAction("removeWaypoint",function(){var F=m.actions.get("removeWaypoint");null!=F.handler&&F.handler.removePoint(F.handler.state,F.index)});this.addAction("clearAnchors",function(){var F=p.getSelectionCells();if(null!=F){F=p.getEditableCells(p.addAllEdges(F));p.getModel().beginUpdate();try{for(var K=0;K<F.length;K++){var c=-F[K];p.getModel().isEdge(c)&&(p.setCellStyles(mxConstants.STYLE_EXIT_X,null,[c]),p.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[c]),p.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[c]),p.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[c]))}}finally{p.getModel().endUpdate()}}});this.addAction("clearWaypoints",function(){var F=p.getSelectionCells();if(null!=F){F=p.getEditableCells(p.addAllEdges(F));p.getModel().beginUpdate();try{for(var K=0;K<F.length;K++){var c=F[K];if(p.getModel().isEdge(c)){var f=p.getCellGeometry(c);-null!=f&&(f=f.clone(),f.points=null,f.x=0,f.y=0,f.offset=null,p.getModel().setGeometry(c,f))}}}finally{p.getModel().endUpdate()}}},null,null,"Alt+Shift+R");H=this.addAction("subscript",mxUtils.bind(this,function(){p.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");H=this.addAction("superscript",mxUtils.bind(this,function(){p.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");H=this.addAction("decreaseFontSize",-mxUtils.bind(this,function(){if(!p.isSelectionEmpty()){var F=p.getCurrentCellStyle(p.getSelectionCell());F=mxUtils.getValue(F,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);p.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.max(1,F-1),p.getSelectionCells())}}),null,null,Editor.ctrlKey+"+Shift + (Numpad)");H=this.addAction("increaseFontSize",mxUtils.bind(this,function(){if(!p.isSelectionEmpty()){var F=p.getCurrentCellStyle(p.getSelectionCell());F=mxUtils.getValue(F,mxConstants.STYLE_FONTSIZE,-mxConstants.DEFAULT_FONTSIZE);p.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.min(100,F+1),p.getSelectionCells())}}),null,null,Editor.ctrlKey+"+Shift - (Numpad)");this.addAction("image...",function(){if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())){var F=mxResources.get("image")+" ("+mxResources.get("url")+"):",K=p.getView().getState(p.getSelectionCell()),c="",f=null;null!=K&&(c=K.style[mxConstants.STYLE_IMAGE]||c,f=K.style[mxConstants.STYLE_CLIP_PATH]||f);var l=p.cellEditor.saveSelection();-m.showImageDialog(F,c,function(t,q,D,G,N,L){if(p.cellEditor.isContentEditing())p.cellEditor.restoreSelection(l),p.insertImage(t,q,D);else{var J=p.getSelectionCells();if(null!=t&&(0<t.length||0<J.length)){var Y=null;p.getModel().beginUpdate();try{if(0==J.length){J=[p.insertVertex(p.getDefaultParent(),null,"",0,0,q,D,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];var ha=p.getCenterInsertPoint(p.getBoundingBoxFromGeometry(J,!0));J[0].geometry.x=ha.x;J[0].geometry.y=-ha.y;null!=G&&g(J[0],G,N,L,p);Y=J;p.fireEvent(new mxEventObject("cellsInserted","cells",Y))}p.setCellStyles(mxConstants.STYLE_IMAGE,0<t.length?t:null,J);var ea=p.getCurrentCellStyle(J[0]);"image"!=ea[mxConstants.STYLE_SHAPE]&&"label"!=ea[mxConstants.STYLE_SHAPE]?p.setCellStyles(mxConstants.STYLE_SHAPE,"image",J):0==t.length&&p.setCellStyles(mxConstants.STYLE_SHAPE,null,J);null==G&&p.setCellStyles(mxConstants.STYLE_CLIP_PATH,null,J);if(null!=q&&null!=D)for(t=0;t<J.length;t++){var aa=J[t];if("0"!=p.getCurrentCellStyle(aa).expand){var na=-p.getModel().getGeometry(aa);null!=na&&(na=na.clone(),na.width=q,na.height=D,p.getModel().setGeometry(aa,na))}null!=G&&g(aa,G,N,L,p)}}finally{p.getModel().endUpdate()}null!=Y&&(p.setSelectionCells(Y),p.scrollCellToVisible(Y[0]))}}},p.cellEditor.isContentEditing(),!p.cellEditor.isContentEditing(),!0,f)}}).isEnabled=A;this.addAction("crop...",function(){var F=p.getSelectionCell();if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&null!=F){var K=p.getCurrentCellStyle(F),c=K[mxConstants.STYLE_IMAGE],-f=K[mxConstants.STYLE_SHAPE];c&&"image"==f&&(K=new CropImageDialog(m,c,K[mxConstants.STYLE_CLIP_PATH],function(l,t,q){g(F,l,t,q,p)}),m.showDialog(K.container,300,390,!0,!0))}}).isEnabled=A;H=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(m,document.body.offsetWidth-280,120,212,200),this.layersWindow.window.addListener("show",mxUtils.bind(this,function(){m.fireEvent(new mxEventObject("layers"))})),this.layersWindow.window.addListener("hide",-function(){m.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),m.fireEvent(new mxEventObject("layers")),this.layersWindow.init()):this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+L");H.setToggleAction(!0);H.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));H=this.addAction("format",mxUtils.bind(this,function(){m.toggleFormatPanel()}),null,-null,Editor.ctrlKey+"+Shift+P");H.setToggleAction(!0);H.setSelectedCallback(mxUtils.bind(this,function(){return m.isFormatPanelVisible()}));H=this.addAction("outline",mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(m,document.body.offsetWidth-260,100,180,180),this.outlineWindow.window.addListener("show",mxUtils.bind(this,function(){m.fireEvent(new mxEventObject("outline"))})),this.outlineWindow.window.addListener("hide",function(){m.fireEvent(new mxEventObject("outline"))}),-this.outlineWindow.window.setVisible(!0),m.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+O");H.setToggleAction(!0);H.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}));this.addAction("editConnectionPoints...",function(){var F=p.getSelectionCell();if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&null!=F&&null!=F.geometry){var K=-new ConnectionPointsDialog(m,F);m.showDialog(K.container,350,450,!0,!1,function(){K.destroy()});K.init()}},null,null,"Alt+Shift+Q").isEnabled=A};Actions.prototype.addAction=function(b,e,g,m,v){var p=b;"..."==p.substring(p.length-3)&&(p=p.substring(0,p.length-3));return this.put(p,new Action(b,e,g,m,v))};Actions.prototype.put=function(b,e){return this.actions[b]=e};Actions.prototype.get=function(b){return this.actions[b]};+function(){m.showDialog((new PageSetupDialog(m)).container,320,240,!0,!0)}).isEnabled=A;this.addAction("print...",function(){m.showPrintDialog()},null,"sprite-print",Editor.ctrlKey+"+P");this.addAction("preview",function(){mxUtils.show(n,null,10,10)});this.addAction("undo",function(){m.undo()},null,"sprite-undo",Editor.ctrlKey+"+Z");this.addAction("redo",function(){m.redo()},null,"sprite-redo",mxClient.IS_WIN?Editor.ctrlKey+"+Y":Editor.ctrlKey+"+Shift+Z");this.addAction("cut",function(){var F=null;+try{F=m.copyXml(),null!=F&&n.removeCells(F,!1)}catch(K){}try{null==F&&mxClipboard.cut(n)}catch(K){m.handleError(K)}},null,"sprite-cut",Editor.ctrlKey+"+X");this.addAction("copy",function(){try{m.copyXml()}catch(F){}try{mxClipboard.copy(n)}catch(F){m.handleError(F)}},null,"sprite-copy",Editor.ctrlKey+"+C");this.addAction("paste",function(){if(n.isEnabled()&&!n.isCellLocked(n.getDefaultParent())){var F=!1;try{Editor.enableNativeCipboard&&(m.readGraphModelFromClipboard(function(K){if(null!=K){n.getModel().beginUpdate();+try{m.pasteXml(K,!0)}finally{n.getModel().endUpdate()}}else mxClipboard.paste(n)}),F=!0)}catch(K){}F||mxClipboard.paste(n)}},!1,"sprite-paste",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(F){function K(f){if(null!=f){for(var l=!0,t=0;t<f.length&&l;t++)l=l&&n.model.isEdge(f[t]);var q=n.view.translate;t=n.view.scale;var D=q.x,H=q.y;q=null;if(1==f.length&&l){var N=n.getCellGeometry(f[0]);null!=N&&(q=N.getTerminalPoint(!0))}q=null!=q?q:n.getBoundingBoxFromGeometry(f,l);null!=q&&(l=Math.round(n.snap(n.popupMenuHandler.triggerX/+t-D)),t=Math.round(n.snap(n.popupMenuHandler.triggerY/t-H)),n.cellsMoved(f,l-q.x,t-q.y))}}function c(){n.getModel().beginUpdate();try{K(mxClipboard.paste(n))}finally{n.getModel().endUpdate()}}if(n.isEnabled()&&!n.isCellLocked(n.getDefaultParent())){F=!1;try{Editor.enableNativeCipboard&&(m.readGraphModelFromClipboard(function(f){if(null!=f){n.getModel().beginUpdate();try{K(m.pasteXml(f,!0))}finally{n.getModel().endUpdate()}}else c()}),F=!0)}catch(f){}F||c()}});this.addAction("swap",function(){var F=+n.getSelectionCells();2==F.length&&n.swapShapes(F[0],F[1])});this.addAction("copySize",function(){var F=n.getSelectionCell();n.isEnabled()&&null!=F&&n.getModel().isVertex(F)&&(F=n.getCellGeometry(F),null!=F&&(m.copiedSize=new mxRectangle(F.x,F.y,F.width,F.height)))},null,null,"Alt+Shift+F");this.addAction("pasteSize",function(){if(n.isEnabled()&&!n.isSelectionEmpty()&&null!=m.copiedSize){n.getModel().beginUpdate();try{for(var F=n.getResizableCells(n.getSelectionCells()),K=0;K<F.length;K++)if(n.getModel().isVertex(F[K])){var c=+n.getCellGeometry(F[K]);null!=c&&(c=c.clone(),c.width=m.copiedSize.width,c.height=m.copiedSize.height,n.getModel().setGeometry(F[K],c))}}finally{n.getModel().endUpdate()}}},null,null,"Alt+Shift+V");this.addAction("copyData",function(){var F=n.getSelectionCell()||n.getModel().getRoot();n.isEnabled()&&null!=F&&(F=F.cloneValue(),null==F||isNaN(F.nodeType)||(m.copiedValue=F))},null,null,"Alt+Shift+B");this.addAction("copyAsText",function(){var F=n.getSelectionCell();if(n.isEnabled()&&null!=F)try{n.isHtmlLabel(F)?+m.writeHtmlToClipboard(n.getLabel(F),mxUtils.bind(this,function(K){m.handleError(K)})):m.writeTextToClipboard(n.getLabel(F),mxUtils.bind(this,function(K){m.handleError(K)}))}catch(K){m.handleError(K)}});this.addAction("pasteData",function(F,K){function c(t,q){var D=f.getValue(t);q=t.cloneValue(q);q.removeAttribute("placeholders");null==D||isNaN(D.nodeType)||q.setAttribute("placeholders",D.getAttribute("placeholders"));null!=F&&mxEvent.isShiftDown(F)||q.setAttribute("label",n.convertValueToString(t));+f.setValue(t,q)}F=null!=K?K:F;var f=n.getModel();if(n.isEnabled()&&!n.isSelectionEmpty()&&null!=m.copiedValue){f.beginUpdate();try{var l=n.getEditableCells(n.getSelectionCells());if(0==l.length)c(f.getRoot(),m.copiedValue);else for(K=0;K<l.length;K++)c(l[K],m.copiedValue)}finally{f.endUpdate()}}},null,null,"Alt+Shift+E");this.addAction("delete",function(F,K){F=null!=K?K:F;null!=F&&mxEvent.isShiftDown(F)?e():b(null!=F&&(mxEvent.isControlDown(F)||mxEvent.isMetaDown(F)||mxEvent.isAltDown(F)))},null,+null,"Delete");this.addAction("deleteAll",function(){b(!0)});this.addAction("deleteLabels",function(){e()},null,null,Editor.ctrlKey+"+Delete");this.addAction("duplicate",function(){try{n.setSelectionCells(n.duplicateCells()),n.scrollCellToVisible(n.getSelectionCell())}catch(F){m.handleError(F)}},null,null,Editor.ctrlKey+"+D");this.put("mergeCells",new Action("merge",function(){var F=m.getSelectionState();if(null!=F.mergeCell){n.getModel().beginUpdate();try{n.setCellStyles("rowspan",F.rowspan,[F.mergeCell]),+n.setCellStyles("colspan",F.colspan,[F.mergeCell])}finally{n.getModel().endUpdate()}}}));this.put("unmergeCells",new Action("unmerge",function(){var F=m.getSelectionState();if(0<F.cells.length){n.getModel().beginUpdate();try{n.setCellStyles("rowspan",null,F.cells),n.setCellStyles("colspan",null,F.cells)}finally{n.getModel().endUpdate()}}}));G=new Action("turn",function(F,K){F=null!=K?K:F;n.turnShapes(n.getResizableCells(n.getSelectionCells()),null!=F?mxEvent.isShiftDown(F):!1)},null,null,mxClient.IS_SF?+null:Editor.ctrlKey+"+R");G.getTitle=function(){return mxResources.get("turn")+" / "+mxResources.get("reverse")};this.put("turn",G);this.put("selectConnections",new Action("selectEdges",function(F){F=n.getSelectionCell();n.isEnabled()&&null!=F&&n.addSelectionCells(n.getEdges(F))}));this.addAction("selectVertices",function(){n.selectVertices(null,!0)},null,null,Editor.ctrlKey+"+Shift+I");this.addAction("selectEdges",function(){n.selectEdges()},null,null,Editor.ctrlKey+"+Shift+E");this.addAction("selectAll",+function(){n.selectAll(null,!0)},null,null,Editor.ctrlKey+"+A");this.addAction("selectNone",function(){n.clearSelection()},null,null,Editor.ctrlKey+"+Shift+A");this.addAction("lockUnlock",function(){if(!n.isSelectionEmpty()){n.getModel().beginUpdate();try{var F=n.getSelectionCells(),K=n.getCurrentCellStyle(n.getSelectionCell()),c=1==mxUtils.getValue(K,mxConstants.STYLE_EDITABLE,1)?0:1;n.setCellStyles(mxConstants.STYLE_MOVABLE,c,F);n.setCellStyles(mxConstants.STYLE_RESIZABLE,c,F);n.setCellStyles(mxConstants.STYLE_ROTATABLE,+c,F);n.setCellStyles(mxConstants.STYLE_DELETABLE,c,F);n.setCellStyles(mxConstants.STYLE_EDITABLE,c,F);n.setCellStyles("locked",1==c?0:1,F);n.setCellStyles("connectable",c,F)}finally{n.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+L");this.addAction("explore",function(){n.model.isVertex(n.getSelectionCell())&&Graph.exploreFromCell(m.editor.graph,m.editor.graph.getSelectionCell())});this.addAction("home",function(){n.home()},null,null,"Shift+Home");this.addAction("exitGroup",function(){n.exitGroup()},+null,null,Editor.ctrlKey+"+Shift+Home");this.addAction("enterGroup",function(){n.enterGroup()},null,null,Editor.ctrlKey+"+Shift+End");this.addAction("collapse",function(){n.foldCells(!0)},null,null,Editor.ctrlKey+"+Home");this.addAction("expand",function(){n.foldCells(!1)},null,null,Editor.ctrlKey+"+End");this.addAction("toFront",function(){n.orderCells(!1)},null,null,Editor.ctrlKey+"+Shift+F");this.addAction("toBack",function(){n.orderCells(!0)},null,null,Editor.ctrlKey+"+Shift+B");this.addAction("bringForward",+function(F){n.orderCells(!1,null,!0)},null,null,Editor.ctrlKey+"+Alt+Shift+F");this.addAction("sendBackward",function(F){n.orderCells(!0,null,!0)},null,null,Editor.ctrlKey+"+Alt+Shift+B");this.addAction("group",function(){if(n.isEnabled()){var F=mxUtils.sortCells(n.getSelectionCells(),!0);1!=F.length||n.isTable(F[0])||n.isTableRow(F[0])?(F=n.getCellsForGroup(F),1<F.length&&n.setSelectionCell(n.groupCells(null,0,F))):n.setCellStyles("container","1")}},null,null,Editor.ctrlKey+"+G");this.addAction("ungroup",+function(){if(n.isEnabled()){var F=n.getEditableCells(n.getSelectionCells());n.model.beginUpdate();try{var K=n.ungroupCells();if(null!=F)for(var c=0;c<F.length;c++)n.model.contains(F[c])&&(0==n.model.getChildCount(F[c])&&n.model.isVertex(F[c])&&n.setCellStyles("container","0",[F[c]]),K.push(F[c]))}finally{n.model.endUpdate()}0<K.length&&n.setSelectionCells(K)}},null,null,Editor.ctrlKey+"+Shift+U");this.addAction("removeFromGroup",function(){if(n.isEnabled()){var F=n.getSelectionCells();if(null!=F){for(var K=+[],c=0;c<F.length;c++)n.isTableRow(F[c])||n.isTableCell(F[c])||K.push(F[c]);n.removeCellsFromParent(K);0<K.length&&n.scrollCellToVisible(K[0])}}});this.addAction("edit",function(){n.isEnabled()&&n.startEditingAtCell()},null,null,"F2/Enter");this.addAction("editData...",function(){var F=n.getSelectionCell()||n.getModel().getRoot();m.showDataDialog(F)},null,null,Editor.ctrlKey+"+M");this.addAction("editTooltip...",function(){var F=n.getSelectionCell();if(n.isEnabled()&&null!=F&&n.isCellEditable(F)){var K=+"";if(mxUtils.isNode(F.value)){var c=null;Graph.translateDiagram&&null!=Graph.diagramLanguage&&F.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(c=F.value.getAttribute("tooltip_"+Graph.diagramLanguage));null==c&&(c=F.value.getAttribute("tooltip"));null!=c&&(K=c)}K=new TextareaDialog(m,mxResources.get("editTooltip")+":",K,function(f){n.setTooltipForCell(F,f)});m.showDialog(K.container,320,200,!0,!0);K.init()}},null,null,"Alt+Shift+T");this.addAction("openLink",function(){var F=n.getLinkForCell(n.getSelectionCell());+null!=F&&n.openLink(F)});this.addAction("editLink...",function(){var F=n.getSelectionCell();if(n.isEnabled()&&null!=F&&n.isCellEditable(F)){var K=n.getLinkForCell(F,!0)||"";m.showLinkDialog(K,mxResources.get("ok"),function(c,f,l){n.getModel().beginUpdate();try{n.setLinkForCell(F,0<c.length?c:null),n.setAttributeForCell(F,"linkTarget",l)}finally{n.getModel().endUpdate()}},!0,n.getLinkTargetForCell(F))}},null,null,"Alt+Shift+L");this.put("insertImage",new Action("image...",function(){n.isEnabled()&&+!n.isCellLocked(n.getDefaultParent())&&(n.clearSelection(),m.actions.get("image").funct())})).isEnabled=A;this.addAction("editImage...",function(){m.actions.get("image").funct()});this.put("insertLink",new Action("link...",function(){n.isEnabled()&&!n.isCellLocked(n.getDefaultParent())&&m.showLinkDialog("",mxResources.get("ok"),function(F,K,c){F=mxUtils.trim(F);if(0<F.length){var f=null,l=n.getLinkTitle(F);null!=K&&0<K.length&&(f=K[0].iconUrl,l=K[0].name||K[0].type,l=l.charAt(0).toUpperCase()+l.substring(1),+30<l.length&&(l=l.substring(0,30)+"..."));K=new mxCell(l,new mxGeometry(0,0,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=f?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+f:"spacing=10;"));K.vertex=!0;f=n.getCenterInsertPoint(n.getBoundingBoxFromGeometry([K],!0));K.geometry.x=f.x;K.geometry.y=f.y;n.setAttributeForCell(K,"linkTarget",c);n.setLinkForCell(K,F);n.cellSizeUpdated(K,!0);n.getModel().beginUpdate();try{K=n.addCell(K),n.fireEvent(new mxEventObject("cellsInserted",+"cells",[K]))}finally{n.getModel().endUpdate()}n.setSelectionCell(K);n.scrollCellToVisible(n.getSelectionCell())}},!0)},null,null,"L")).isEnabled=A;this.addAction("link...",mxUtils.bind(this,function(){if(n.isEnabled())if(n.cellEditor.isContentEditing()){var F=n.getSelectedElement(),K=n.getParentByName(F,"A",n.cellEditor.textarea),c="";if(null==K&&null!=F&&null!=F.getElementsByTagName)for(var f=F.getElementsByTagName("a"),l=0;l<f.length&&null==K;l++)f[l].textContent==F.textContent&&(K=f[l]);null!=+K&&"A"==K.nodeName&&(c=K.getAttribute("href")||"",n.selectNode(K));var t=n.cellEditor.saveSelection();m.showLinkDialog(c,mxResources.get("ok"),mxUtils.bind(this,function(q){n.cellEditor.restoreSelection(t);null!=q&&n.insertLink(q)}))}else n.isSelectionEmpty()?this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=A;this.addAction("autosize",function(){var F=n.getSelectionCells();if(null!=F){n.getModel().beginUpdate();try{for(var K=0;K<F.length;K++){var c=F[K];n.getModel().isVertex(c)&&+(0<n.getModel().getChildCount(c)?n.updateGroupBounds([c],0,!0):n.updateCellSize(c))}}finally{n.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+Y");this.addAction("snapToGrid",function(){n.snapCellsToGrid(n.getSelectionCells(),n.gridSize)});this.addAction("formattedText",function(){n.stopEditing();var F=n.getCommonStyle(n.getSelectionCells());F="1"==mxUtils.getValue(F,"html","0")?null:"1";n.getModel().beginUpdate();try{for(var K=n.getEditableCells(n.getSelectionCells()),c=0;c<K.length;c++)if(state=+n.getView().getState(K[c]),null!=state){var f=mxUtils.getValue(state.style,"html","0");if("1"==f&&null==F)n.removeTextStyleForCell(state.cell),n.setCellStyles("html",F,[K[c]]);else if("0"==f&&"1"==F){var l=mxUtils.htmlEntities(n.convertValueToString(state.cell),!1);"0"!=mxUtils.getValue(state.style,"nl2Br","1")&&(l=l.replace(/\n/g,"<br/>"));n.cellLabelChanged(state.cell,Graph.sanitizeHtml(l));n.setCellStyles("html",F,[K[c]])}}m.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=+F?F:"0"],"cells",K))}finally{n.getModel().endUpdate()}});this.addAction("wordWrap",function(){var F=n.getView().getState(n.getSelectionCell()),K="wrap";n.stopEditing();null!=F&&"wrap"==F.style[mxConstants.STYLE_WHITE_SPACE]&&(K=null);n.setCellStyles(mxConstants.STYLE_WHITE_SPACE,K)});this.addAction("rotation",function(){var F="0",K=n.getView().getState(n.getSelectionCell());null!=K&&(F=K.style[mxConstants.STYLE_ROTATION]||F);F=new FilenameDialog(m,F,mxResources.get("apply"),function(c){null!=c&&0<+c.length&&n.setCellStyles(mxConstants.STYLE_ROTATION,c)},mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");m.showDialog(F.container,375,80,!0,!0);F.init()});this.addAction("resetView",function(){n.zoomTo(1);m.resetScrollbars()},null,null,"Enter/Home");this.addAction("zoomIn",function(F){n.isFastZoomEnabled()?n.lazyZoom(!0,!0,m.buttonZoomDelay):n.zoomIn()},null,null,Editor.ctrlKey+" + / Alt+Mousewheel");this.addAction("zoomOut",function(F){n.isFastZoomEnabled()?n.lazyZoom(!1,+!0,m.buttonZoomDelay):n.zoomOut()},null,null,Editor.ctrlKey+" - / Alt+Mousewheel");this.addAction("fitWindow",function(){n.pageVisible&&n.isSelectionEmpty()?n.fitPages():m.fitDiagramToWindow()},null,null,Editor.ctrlKey+"+Shift+H");this.addAction("fitPage",mxUtils.bind(this,function(){n.pageVisible?n.fitPages(1):this.get("pageView").funct()}),null,null,Editor.ctrlKey+"+J");this.addAction("fitTwoPages",mxUtils.bind(this,function(){n.pageVisible?n.fitPages(2):this.get("pageView").funct()}),null,null,+Editor.ctrlKey+"+Shift+J");this.addAction("fitPageWidth",mxUtils.bind(this,function(){n.pageVisible?n.fitPages(1,!0):this.get("pageView").funct()}));this.put("customZoom",new Action("custom...",mxUtils.bind(this,function(){var F=new FilenameDialog(this.editorUi,parseInt(100*n.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(K){K=parseInt(K);!isNaN(K)&&0<K&&n.zoomTo(K/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(F.container,300,80,!0,!0);F.init()}),null,+null,Editor.ctrlKey+"+0"));this.addAction("pageScale...",mxUtils.bind(this,function(){var F=new FilenameDialog(this.editorUi,parseInt(100*n.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(K){K=parseInt(K);!isNaN(K)&&0<K&&(K=new ChangePageSetup(m,null,null,null,K/100),K.ignoreColor=!0,K.ignoreImage=!0,n.model.execute(K))}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(F.container,300,80,!0,!0);F.init()}));G=null;G=this.addAction("grid",function(){n.setGridEnabled(!n.isGridEnabled());+n.defaultGridEnabled=n.isGridEnabled();m.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+Shift+G");G.setToggleAction(!0);G.setSelectedCallback(function(){return n.isGridEnabled()});G.setEnabled(!1);G=this.addAction("guides",function(){n.graphHandler.guidesEnabled=!n.graphHandler.guidesEnabled;m.fireEvent(new mxEventObject("guidesEnabledChanged"))});G.setToggleAction(!0);G.setSelectedCallback(function(){return n.graphHandler.guidesEnabled});G.setEnabled(!1);G=this.addAction("animations",+function(){Editor.enableAnimations=!Editor.enableAnimations;m.fireEvent(new mxEventObject("enableAnimationsChanged"))});G.setToggleAction(!0);G.setSelectedCallback(function(){return Editor.enableAnimations});G=this.addAction("tooltips",function(){n.tooltipHandler.setEnabled(!n.tooltipHandler.isEnabled());m.fireEvent(new mxEventObject("tooltipsEnabledChanged"))});G.setToggleAction(!0);G.setSelectedCallback(function(){return n.tooltipHandler.isEnabled()});G=this.addAction("collapseExpand",function(){var F=+new ChangePageSetup(m);F.ignoreColor=!0;F.ignoreImage=!0;F.foldingEnabled=!n.foldingEnabled;n.model.execute(F)});G.setToggleAction(!0);G.setSelectedCallback(function(){return n.foldingEnabled});G.isEnabled=A;G=this.addAction("pageView",mxUtils.bind(this,function(){m.setPageVisible(!n.pageVisible)}));G.setToggleAction(!0);G.setSelectedCallback(function(){return n.pageVisible});G=this.addAction("connectionArrows",function(){n.connectionArrowsEnabled=!n.connectionArrowsEnabled;m.fireEvent(new mxEventObject("connectionArrowsChanged"))},+null,null,"Alt+Shift+A");G.setToggleAction(!0);G.setSelectedCallback(function(){return n.connectionArrowsEnabled});G=this.addAction("connectionPoints",function(){n.setConnectable(!n.connectionHandler.isEnabled());m.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,"Alt+Shift+O");G.setToggleAction(!0);G.setSelectedCallback(function(){return n.connectionHandler.isEnabled()});G=this.addAction("copyConnect",function(){n.connectionHandler.setCreateTarget(!n.connectionHandler.isCreateTarget());+m.fireEvent(new mxEventObject("copyConnectChanged"))});G.setToggleAction(!0);G.setSelectedCallback(function(){return n.connectionHandler.isCreateTarget()});G.isEnabled=A;G=this.addAction("autosave",function(){m.editor.setAutosave(!m.editor.autosave)});G.setToggleAction(!0);G.setSelectedCallback(function(){return m.editor.autosave});G.isEnabled=A;G.visible=!1;this.addAction("help",function(){var F="";mxResources.isLanguageSupported(mxClient.language)&&(F="_"+mxClient.language);n.openLink(RESOURCES_PATH++"/help"+F+".html")});var S=!1;G=new Action("about",function(){S||(m.showDialog((new AboutDialog(m)).container,320,280,!0,!0,function(){S=!1}),S=!0)});G.getTitle=function(){return mxResources.get("about")+" Graph Editor..."};this.put("about",G);G=mxUtils.bind(this,function(F,K,c,f){return this.addAction(F,function(){if(null!=c&&n.cellEditor.isContentEditing())c();else{n.stopEditing(!1);n.getModel().beginUpdate();try{var l=n.getEditableCells(n.getSelectionCells());n.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,+K,l);(K&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?n.updateLabelElements(l,function(q){q.style.fontWeight=null;"B"==q.nodeName&&n.replaceElement(q)}):(K&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?n.updateLabelElements(l,function(q){q.style.fontStyle=null;"I"==q.nodeName&&n.replaceElement(q)}):(K&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&n.updateLabelElements(l,function(q){q.style.textDecoration=null;"U"==q.nodeName&&n.replaceElement(q)});for(var t=0;t<l.length;t++)0==n.model.getChildCount(l[t])&&+n.autoSizeCell(l[t],!1)}finally{n.getModel().endUpdate()}}},null,null,f)});G("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");G("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I");G("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){m.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000",+"default",n.shapeForegroundColor)});this.addAction("strokeColor...",function(){m.menus.pickColor(mxConstants.STYLE_STROKECOLOR,null,null,"default",n.shapeForegroundColor)});this.addAction("fillColor...",function(){m.menus.pickColor(mxConstants.STYLE_FILLCOLOR,null,null,"default",n.shapeBackgroundColor)});this.addAction("gradientColor...",function(){m.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR,null,null,"default",n.shapeForegroundColor)});this.addAction("backgroundColor...",function(){m.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,+"backcolor",null,"default",n.shapeBackgroundColor)});this.addAction("borderColor...",function(){m.menus.pickColor(mxConstants.STYLE_LABEL_BORDERCOLOR,null,null,"default",n.shapeForegroundColor)});this.addAction("removeFormat",function(){if(n.isEnabled()&&!n.isSelectionEmpty()&&!n.isEditing()){n.getModel().beginUpdate();try{for(var F=n.getSelectionCells(),K=0;K<F.length;K++)n.removeTextStyleForCell(F[K],!0)}finally{n.getModel().endUpdate()}}});this.addAction("vertical",function(){m.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,+!0)});this.addAction("shadow",function(){m.menus.toggleStyle(mxConstants.STYLE_SHADOW)});this.addAction("solid",function(){n.getModel().beginUpdate();try{n.setCellStyles(mxConstants.STYLE_DASHED,null),n.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",[null,null],"cells",n.getSelectionCells()))}finally{n.getModel().endUpdate()}});this.addAction("dashed",function(){n.getModel().beginUpdate();+try{n.setCellStyles(mxConstants.STYLE_DASHED,"1"),n.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1",null],"cells",n.getSelectionCells()))}finally{n.getModel().endUpdate()}});this.addAction("dotted",function(){n.getModel().beginUpdate();try{n.setCellStyles(mxConstants.STYLE_DASHED,"1"),n.setCellStyles(mxConstants.STYLE_DASH_PATTERN,"1 4"),m.fireEvent(new mxEventObject("styleChanged",+"keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1","1 4"],"cells",n.getSelectionCells()))}finally{n.getModel().endUpdate()}});this.addAction("sharp",function(){n.getModel().beginUpdate();try{n.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),n.setCellStyles(mxConstants.STYLE_CURVED,"0"),m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","0"],"cells",n.getSelectionCells()))}finally{n.getModel().endUpdate()}});+this.addAction("rounded",function(){n.getModel().beginUpdate();try{n.setCellStyles(mxConstants.STYLE_ROUNDED,"1"),n.setCellStyles(mxConstants.STYLE_CURVED,"0"),m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["1","0"],"cells",n.getSelectionCells()))}finally{n.getModel().endUpdate()}});this.addAction("toggleRounded",function(){if(!n.isSelectionEmpty()&&n.isEnabled()){n.getModel().beginUpdate();try{var F=n.getSelectionCells(),K=n.getCurrentCellStyle(F[0]),+c="1"==mxUtils.getValue(K,mxConstants.STYLE_ROUNDED,"0")?"0":"1";n.setCellStyles(mxConstants.STYLE_ROUNDED,c);n.setCellStyles(mxConstants.STYLE_CURVED,null);m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[c,"0"],"cells",n.getSelectionCells()))}finally{n.getModel().endUpdate()}}});this.addAction("curved",function(){n.getModel().beginUpdate();try{n.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),n.setCellStyles(mxConstants.STYLE_CURVED,+"1"),m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","1"],"cells",n.getSelectionCells()))}finally{n.getModel().endUpdate()}});this.addAction("collapsible",function(){var F=n.view.getState(n.getSelectionCell()),K="1";null!=F&&null!=n.getFoldingImage(F)&&(K="0");n.setCellStyles("collapsible",K);m.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[K],"cells",n.getSelectionCells()))});this.addAction("editStyle...",+mxUtils.bind(this,function(){var F=n.getEditableCells(n.getSelectionCells());if(null!=F&&0<F.length){var K=n.getModel();K=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",K.getStyle(F[0])||"",function(c){null!=c&&n.setCellStyle(mxUtils.trim(c),F)},null,null,400,220);this.editorUi.showDialog(K.container,420,300,!0,!0);K.init()}}),null,null,Editor.ctrlKey+"+E");this.addAction("setAsDefaultStyle",function(){n.isEnabled()&&!n.isSelectionEmpty()&&m.setDefaultStyle(n.getSelectionCell())},+null,null,Editor.ctrlKey+"+Shift+D");this.addAction("clearDefaultStyle",function(){n.isEnabled()&&m.clearDefaultStyle()},null,null,Editor.ctrlKey+"+Shift+R");this.addAction("addWaypoint",function(){var F=n.getSelectionCell();if(null!=F&&n.getModel().isEdge(F)){var K=v.graph.selectionCellsHandler.getHandler(F);if(K instanceof mxEdgeHandler){var c=n.view.translate,f=n.view.scale,l=c.x;c=c.y;F=n.getModel().getParent(F);for(var t=n.getCellGeometry(F);n.getModel().isVertex(F)&&null!=t;)l+=t.x,c+=t.y,F=+n.getModel().getParent(F),t=n.getCellGeometry(F);l=Math.round(n.snap(n.popupMenuHandler.triggerX/f-l));f=Math.round(n.snap(n.popupMenuHandler.triggerY/f-c));K.addPointAt(K.state,l,f)}}});this.addAction("removeWaypoint",function(){var F=m.actions.get("removeWaypoint");null!=F.handler&&F.handler.removePoint(F.handler.state,F.index)});this.addAction("clearAnchors",function(){var F=n.getSelectionCells();if(null!=F){F=n.getEditableCells(n.addAllEdges(F));n.getModel().beginUpdate();try{for(var K=0;K<F.length;K++){var c=+F[K];n.getModel().isEdge(c)&&(n.setCellStyles(mxConstants.STYLE_EXIT_X,null,[c]),n.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[c]),n.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[c]),n.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[c]))}}finally{n.getModel().endUpdate()}}});this.addAction("clearWaypoints",function(){var F=n.getSelectionCells();if(null!=F){F=n.getEditableCells(n.addAllEdges(F));n.getModel().beginUpdate();try{for(var K=0;K<F.length;K++){var c=F[K];if(n.getModel().isEdge(c)){var f=n.getCellGeometry(c);+null!=f&&(f=f.clone(),f.points=null,f.x=0,f.y=0,f.offset=null,n.getModel().setGeometry(c,f))}}}finally{n.getModel().endUpdate()}}},null,null,"Alt+Shift+R");G=this.addAction("subscript",mxUtils.bind(this,function(){n.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");G=this.addAction("superscript",mxUtils.bind(this,function(){n.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");G=this.addAction("decreaseFontSize",+mxUtils.bind(this,function(){if(!n.isSelectionEmpty()){var F=n.getCurrentCellStyle(n.getSelectionCell());F=mxUtils.getValue(F,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);n.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.max(1,F-1),n.getSelectionCells())}}),null,null,Editor.ctrlKey+"+Shift + (Numpad)");G=this.addAction("increaseFontSize",mxUtils.bind(this,function(){if(!n.isSelectionEmpty()){var F=n.getCurrentCellStyle(n.getSelectionCell());F=mxUtils.getValue(F,mxConstants.STYLE_FONTSIZE,+mxConstants.DEFAULT_FONTSIZE);n.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.min(100,F+1),n.getSelectionCells())}}),null,null,Editor.ctrlKey+"+Shift - (Numpad)");this.addAction("image...",function(){if(n.isEnabled()&&!n.isCellLocked(n.getDefaultParent())){var F=mxResources.get("image")+" ("+mxResources.get("url")+"):",K=n.getView().getState(n.getSelectionCell()),c="",f=null;null!=K&&(c=K.style[mxConstants.STYLE_IMAGE]||c,f=K.style[mxConstants.STYLE_CLIP_PATH]||f);var l=n.cellEditor.saveSelection();+m.showImageDialog(F,c,function(t,q,D,H,N,L){if(n.cellEditor.isContentEditing())n.cellEditor.restoreSelection(l),n.insertImage(t,q,D);else{var J=n.getSelectionCells();if(null!=t&&(0<t.length||0<J.length)){var Y=null;n.getModel().beginUpdate();try{if(0==J.length){J=[n.insertVertex(n.getDefaultParent(),null,"",0,0,q,D,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];var ha=n.getCenterInsertPoint(n.getBoundingBoxFromGeometry(J,!0));J[0].geometry.x=ha.x;J[0].geometry.y=+ha.y;null!=H&&g(J[0],H,N,L,n);Y=J;n.fireEvent(new mxEventObject("cellsInserted","cells",Y))}n.setCellStyles(mxConstants.STYLE_IMAGE,0<t.length?t:null,J);var ea=n.getCurrentCellStyle(J[0]);"image"!=ea[mxConstants.STYLE_SHAPE]&&"label"!=ea[mxConstants.STYLE_SHAPE]?n.setCellStyles(mxConstants.STYLE_SHAPE,"image",J):0==t.length&&n.setCellStyles(mxConstants.STYLE_SHAPE,null,J);null==H&&n.setCellStyles(mxConstants.STYLE_CLIP_PATH,null,J);if(null!=q&&null!=D)for(t=0;t<J.length;t++){var aa=J[t];if("0"!=n.getCurrentCellStyle(aa).expand){var na=+n.getModel().getGeometry(aa);null!=na&&(na=na.clone(),na.width=q,na.height=D,n.getModel().setGeometry(aa,na))}null!=H&&g(aa,H,N,L,n)}}finally{n.getModel().endUpdate()}null!=Y&&(n.setSelectionCells(Y),n.scrollCellToVisible(Y[0]))}}},n.cellEditor.isContentEditing(),!n.cellEditor.isContentEditing(),!0,f)}}).isEnabled=A;this.addAction("crop...",function(){var F=n.getSelectionCell();if(n.isEnabled()&&!n.isCellLocked(n.getDefaultParent())&&null!=F){var K=n.getCurrentCellStyle(F),c=K[mxConstants.STYLE_IMAGE],+f=K[mxConstants.STYLE_SHAPE];c&&"image"==f&&(K=new CropImageDialog(m,c,K[mxConstants.STYLE_CLIP_PATH],function(l,t,q){g(F,l,t,q,n)}),m.showDialog(K.container,300,390,!0,!0))}}).isEnabled=A;G=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(m,document.body.offsetWidth-280,120,212,200),this.layersWindow.window.addListener("show",mxUtils.bind(this,function(){m.fireEvent(new mxEventObject("layers"))})),this.layersWindow.window.addListener("hide",+function(){m.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),m.fireEvent(new mxEventObject("layers")),this.layersWindow.init()):this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+L");G.setToggleAction(!0);G.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));G=this.addAction("format",mxUtils.bind(this,function(){m.toggleFormatPanel()}),null,+null,Editor.ctrlKey+"+Shift+P");G.setToggleAction(!0);G.setSelectedCallback(mxUtils.bind(this,function(){return m.isFormatPanelVisible()}));G=this.addAction("outline",mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(m,document.body.offsetWidth-260,100,180,180),this.outlineWindow.window.addListener("show",mxUtils.bind(this,function(){m.fireEvent(new mxEventObject("outline"))})),this.outlineWindow.window.addListener("hide",function(){m.fireEvent(new mxEventObject("outline"))}),+this.outlineWindow.window.setVisible(!0),m.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+O");G.setToggleAction(!0);G.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}));this.addAction("editConnectionPoints...",function(){var F=n.getSelectionCell();if(n.isEnabled()&&!n.isCellLocked(n.getDefaultParent())&&null!=F&&null!=F.geometry){var K=+new ConnectionPointsDialog(m,F);m.showDialog(K.container,350,450,!0,!1,function(){K.destroy()});K.init()}},null,null,"Alt+Shift+Q").isEnabled=A};Actions.prototype.addAction=function(b,e,g,m,v){var n=b;"..."==n.substring(n.length-3)&&(n=n.substring(0,n.length-3));return this.put(n,new Action(b,e,g,m,v))};Actions.prototype.put=function(b,e){return this.actions[b]=e};Actions.prototype.get=function(b){return this.actions[b]};function Action(b,e,g,m,v){mxEventSource.call(this);this.label=b;this.funct=this.createFunction(e);this.enabled=null!=g?g:!0;this.iconCls=m;this.shortcut=v;this.visible=!0}mxUtils.extend(Action,mxEventSource);Action.prototype.getTitle=function(){var b=this.label;"..."==b.substring(b.length-3)?(b=b.substring(0,b.length-3),b=mxResources.get(b)+"..."):b=mxResources.get(b);return b};Action.prototype.createFunction=function(b){return b};Action.prototype.setEnabled=function(b){this.enabled!=b&&(this.enabled=b,this.fireEvent(new mxEventObject("stateChanged")))};Action.prototype.isEnabled=function(){return this.enabled};Action.prototype.setToggleAction=function(b){this.toggleAction=b};Action.prototype.setSelectedCallback=function(b){this.selectedCallback=b};Action.prototype.isSelected=function(){return this.selectedCallback()};DrawioFile=function(b,e){mxEventSource.call(this);this.ui=b;this.setData(e||"");this.initialData=this.getData();this.created=(new Date).getTime();this.stats={opened:0,merged:0,fileMerged:0,fileReloaded:0,conflicts:0,timeouts:0,saved:0,closed:0,destroyed:0,joined:0,checksumErrors:0,bytesSent:0,bytesReceived:0,msgSent:0,msgReceived:0,cacheHits:0,cacheMiss:0,cacheFail:0}};DrawioFile.SYNC=urlParams.sync||"auto";DrawioFile.LAST_WRITE_WINS=!0;DrawioFile.RESTRICT_EXPORT=!1;mxUtils.extend(DrawioFile,mxEventSource);DrawioFile.prototype.allChangesSavedKey="allChangesSaved";DrawioFile.prototype.savingSpinnerKey="saving";DrawioFile.prototype.savingStatusKey="saving";DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.optimisticSyncDelay=300;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.lastSaved=null;DrawioFile.prototype.lastChanged=null;DrawioFile.prototype.opened=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.shadowModified=!1;DrawioFile.prototype.data=null;DrawioFile.prototype.shadowPages=null;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=3E5;DrawioFile.prototype.inConflictState=!1;DrawioFile.prototype.invalidChecksum=!1;DrawioFile.prototype.ageStart=null;DrawioFile.prototype.getSize=function(){return null!=this.data?this.data.length:0};DrawioFile.prototype.getShadowPages=function(){null==this.shadowPages&&(this.shadowPages=this.ui.getPagesForXml(this.initialData));return this.shadowPages};DrawioFile.prototype.setShadowPages=function(b){this.shadowPages=b};-DrawioFile.prototype.synchronizeFile=function(b,e){if(this.savingFile)null!=e&&e({message:mxResources.get("busy")});else{var g=!0,m=window.setTimeout(mxUtils.bind(this,function(){g=!1;null!=e&&e({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.synchronizeFile(b,e)})})}),this.ui.timeout),v=mxUtils.bind(this,function(A){g&&(window.clearTimeout(m),null!=e&&e(A))}),p=mxUtils.bind(this,function(){return!g});null!=this.sync?this.sync.fileChanged(mxUtils.bind(this,-function(A){g&&(window.clearTimeout(m),this.sync.cleanup(b,e,A))}),v,p):this.updateFile(mxUtils.bind(this,function(){g&&(window.clearTimeout(m),null!=b&&b())}),v,p)}};-DrawioFile.prototype.updateFile=function(b,e,g,m,v){null!=g&&g()||(EditorUi.debug("DrawioFile.updateFile",[this],"immediate",v,"invalidChecksum",this.invalidChecksum),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=e&&e():this.getLatestVersion(mxUtils.bind(this,function(p){try{null!=g&&g()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum,"latestFile",[p]),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=e&&e():null!=p?this.mergeFile(p,b,e,+DrawioFile.prototype.synchronizeFile=function(b,e){if(this.savingFile)null!=e&&e({message:mxResources.get("busy")});else{var g=!0,m=window.setTimeout(mxUtils.bind(this,function(){g=!1;null!=e&&e({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.synchronizeFile(b,e)})})}),this.ui.timeout),v=mxUtils.bind(this,function(A){g&&(window.clearTimeout(m),null!=e&&e(A))}),n=mxUtils.bind(this,function(){return!g});null!=this.sync?this.sync.fileChanged(mxUtils.bind(this,+function(A){g&&(window.clearTimeout(m),this.sync.cleanup(b,e,A))}),v,n):this.updateFile(mxUtils.bind(this,function(){g&&(window.clearTimeout(m),null!=b&&b())}),v,n)}};+DrawioFile.prototype.updateFile=function(b,e,g,m,v){null!=g&&g()||(EditorUi.debug("DrawioFile.updateFile",[this],"immediate",v,"invalidChecksum",this.invalidChecksum),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=e&&e():this.getLatestVersion(mxUtils.bind(this,function(n){try{null!=g&&g()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum,"latestFile",[n]),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=e&&e():null!=n?this.mergeFile(n,b,e,m,v):this.reloadFile(b,e))}catch(A){null!=e&&e(A)}}),e))};-DrawioFile.prototype.mergeFile=function(b,e,g,m,v){try{var p=b.getShadowPages();if(null!=p&&0<p.length){var A=this.getShadowPages(),H=[this.ui.diffPages(null!=m?m:A,p)],S=this.ignorePatches(H);if(S)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",S),null!=e&&e();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var F=this.isModified()?this.ui.diffPages(A,-this.isRealtime()?this.ownPages:this.ui.pages):null,K=this.ui.patchPages(this.ui.clonePages(A),H[0]),c=this.ui.getHashValueForPages(K,{}),f=this.ui.getHashValueForPages(p,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",A,"pages",p,"patched",K,"patches",H,"changes",F,"checksum",c,"current",f,"valid",c==f,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",v);if(null!=c&&c!=f)this.checksumError(g,H,null,null,"mergeFile",-c,f,b.getCurrentRevisionId());else{this.setShadowPages(p);if(null!=this.sync){var l=this.sync.patchRealtime(H,DrawioFile.LAST_WRITE_WINS?F:null,null,v);null==l||mxUtils.isEmptyObject(l)||H.push(l)}this.patch(H,DrawioFile.LAST_WRITE_WINS?F:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());this.descriptorChanged();null!=e&&e()}}catch(D){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=g&&g(D);try{var t=this.getCurrentUser(),q=null!=t?-t.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),q,D)}catch(G){}}}else throw Error(mxResources.get("notADiagramFile"));}catch(D){null!=g&&g(D)}};+DrawioFile.prototype.mergeFile=function(b,e,g,m,v){try{var n=b.getShadowPages();if(null!=n&&0<n.length){var A=this.getShadowPages(),G=[this.ui.diffPages(null!=m?m:A,n)],S=this.ignorePatches(G);if(S)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",S),null!=e&&e();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var F=this.isModified()?this.ui.diffPages(A,+this.isRealtime()?this.ownPages:this.ui.pages):null,K=this.ui.patchPages(this.ui.clonePages(A),G[0]),c=this.ui.getHashValueForPages(K,{}),f=this.ui.getHashValueForPages(n,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",A,"pages",n,"patched",K,"patches",G,"changes",F,"checksum",c,"current",f,"valid",c==f,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",v);if(null!=c&&c!=f)this.checksumError(g,G,null,null,"mergeFile",+c,f,b.getCurrentRevisionId());else{this.setShadowPages(n);if(null!=this.sync){var l=this.sync.patchRealtime(G,DrawioFile.LAST_WRITE_WINS?F:null,null,v);null==l||mxUtils.isEmptyObject(l)||G.push(l)}this.patch(G,DrawioFile.LAST_WRITE_WINS?F:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());this.descriptorChanged();null!=e&&e()}}catch(D){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=g&&g(D);try{var t=this.getCurrentUser(),q=null!=t?+t.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),q,D)}catch(H){}}}else throw Error(mxResources.get("notADiagramFile"));}catch(D){null!=g&&g(D)}};DrawioFile.prototype.getAnonymizedXmlForPages=function(b){var e=new mxCodec(mxUtils.createXmlDocument()),g=e.document.createElement("mxfile");if(null!=b)for(var m=0;m<b.length;m++){var v=e.encode(new mxGraphModel(b[m].root));"1"!=urlParams.dev&&(v=this.ui.anonymizeNode(v,!0));v.setAttribute("id",b[m].getId());b[m].viewState&&this.ui.editor.graph.saveViewState(b[m].viewState,v,!0);g.appendChild(v)}return mxUtils.getPrettyXml(g)};DrawioFile.prototype.compressReportData=function(b,e,g){e=null!=e?e:1E4;null!=g&&null!=b&&b.length>g?b=b.substring(0,g)+"[...]":null!=b&&b.length>e&&(b=Graph.compress(b)+"\n");return b};-DrawioFile.prototype.checksumError=function(b,e,g,m,v,p,A,H){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var S=this.getCurrentUser(),F=null!=S?S.id:"unknown",K=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",c=JSON.stringify(e).length,f=null;if(null!=e&&1E3>c){b=[];for(g=0;g<e.length;g++)b.push(this.ui.anonymizePatch(e[g]));f=JSON.stringify(b);f=null!=f&&1E3>-f.length?Graph.compress(f):null}this.getLatestVersion(mxUtils.bind(this,function(l){try{var t=null!=f?"report":"error",q=this.ui.getHashValueForPages(l.getShadowPages()),D="unknown",G="unknown",N="unknown";try{var L=null!=l.initialData&&0<l.initialData.length?mxUtils.parseXml(l.initialData).documentElement:null;null!=L&&(null!=L.getAttribute("version")&&(D=L.getAttribute("version")),null!=L.getAttribute("agent")&&(G=L.getAttribute("agent")),null!=L.getAttribute("type")&&(N=L.getAttribute("type")))}catch(J){}EditorUi.logError("Checksum "+-t+" in "+v,null,this.getMode()+"."+K,"user_"+F+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+c+"-patches_"+e.length+(null!=f?"-json_"+f:"")+"-size_"+this.getSize()+(null!=p?"-expected_"+p:"")+(null!=A?"-current_"+A:"")+(null!=H?"-rev_"+this.ui.hashValue(H):"")+(null!=q?"-latest_"+q:"")+"-latestRev_"+this.ui.hashValue(l.getCurrentRevisionId())+("-latestVersion_"+D)+("-latestAgent_"+G)+("-latestType_"+N));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+K,action:v,label:"user_"++DrawioFile.prototype.checksumError=function(b,e,g,m,v,n,A,G){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var S=this.getCurrentUser(),F=null!=S?S.id:"unknown",K=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",c=JSON.stringify(e).length,f=null;if(null!=e&&1E3>c){b=[];for(g=0;g<e.length;g++)b.push(this.ui.anonymizePatch(e[g]));f=JSON.stringify(b);f=null!=f&&1E3>+f.length?Graph.compress(f):null}this.getLatestVersion(mxUtils.bind(this,function(l){try{var t=null!=f?"report":"error",q=this.ui.getHashValueForPages(l.getShadowPages()),D="unknown",H="unknown",N="unknown";try{var L=null!=l.initialData&&0<l.initialData.length?mxUtils.parseXml(l.initialData).documentElement:null;null!=L&&(null!=L.getAttribute("version")&&(D=L.getAttribute("version")),null!=L.getAttribute("agent")&&(H=L.getAttribute("agent")),null!=L.getAttribute("type")&&(N=L.getAttribute("type")))}catch(J){}EditorUi.logError("Checksum "++t+" in "+v,null,this.getMode()+"."+K,"user_"+F+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+c+"-patches_"+e.length+(null!=f?"-json_"+f:"")+"-size_"+this.getSize()+(null!=n?"-expected_"+n:"")+(null!=A?"-current_"+A:"")+(null!=G?"-rev_"+this.ui.hashValue(G):"")+(null!=q?"-latest_"+q:"")+"-latestRev_"+this.ui.hashValue(l.getCurrentRevisionId())+("-latestVersion_"+D)+("-latestAgent_"+H)+("-latestType_"+N));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+K,action:v,label:"user_"+F+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+c+"-patches_"+e.length+"-size_"+this.getSize()})}catch(J){}}),function(){})}catch(l){}};-DrawioFile.prototype.sendErrorReport=function(b,e,g,m){try{var v=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),p=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),A=this.getCurrentUser(),H=null!=A?this.ui.hashValue(A.id):"unknown",S=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",F=this.getTitle(),K=F.lastIndexOf(".");A="xml";0<K&&(A=F.substring(K));var c=null!=g?g.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()+-":\n\nAppVersion="+navigator.appVersion+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+A+")\nUser="+H+S+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=e?"\n\n"+e:-"")+(null!=g?"\n\nError: "+g.message:"")+"\n\nStack:\n"+c+"\n\nShadow:\n"+v+"\n\nData:\n"+p,m)}catch(f){}};-DrawioFile.prototype.reloadFile=function(b,e){try{this.stats.fileReloaded++;var g=this.ui.diffPages(this.getShadowPages(),this.isRealtime()?this.ownPages:this.ui.pages),m=this.ui.editor.graph,v=m.getSelectionCells(),p=m.getViewState(),A=this.ui.currentPage;this.getLatestVersion(mxUtils.bind(this,function(H){EditorUi.debug("DrawioFile.reloadFile",[this],"modified",this.isModified(),"rev",this.getCurrentRevisionId(),"changes",[g],"viewState",[p],"latestFile",H);null!=H?(this.ui.replaceFileData(H.getData(),-[g]),this.ui.restoreViewState(A,p,v),this.setDescriptor(H.getDescriptor()),this.descriptorChanged(),null!=b&&b()):(this.ui.spinner.stop(),this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){var S=this.ui.getCurrentFile();null!=S&&(S.stats=this.stats,S.patch([g]),S.fileChanged());this.ui.restoreViewState(A,p,v);null!=b&&b()}else null!=e&&e(this.ui.fileLoadedError)}),!0))}),e)}catch(H){null!=e&&e(H)}};+DrawioFile.prototype.sendErrorReport=function(b,e,g,m){try{var v=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),n=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),A=this.getCurrentUser(),G=null!=A?this.ui.hashValue(A.id):"unknown",S=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",F=this.getTitle(),K=F.lastIndexOf(".");A="xml";0<K&&(A=F.substring(K));var c=null!=g?g.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()++":\n\nAppVersion="+navigator.appVersion+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+A+")\nUser="+G+S+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=e?"\n\n"+e:+"")+(null!=g?"\n\nError: "+g.message:"")+"\n\nStack:\n"+c+"\n\nShadow:\n"+v+"\n\nData:\n"+n,m)}catch(f){}};+DrawioFile.prototype.reloadFile=function(b,e){try{this.stats.fileReloaded++;var g=this.ui.diffPages(this.getShadowPages(),this.isRealtime()?this.ownPages:this.ui.pages),m=this.ui.editor.graph,v=m.getSelectionCells(),n=m.getViewState(),A=this.ui.currentPage;this.getLatestVersion(mxUtils.bind(this,function(G){EditorUi.debug("DrawioFile.reloadFile",[this],"modified",this.isModified(),"rev",this.getCurrentRevisionId(),"changes",[g],"viewState",[n],"latestFile",G);null!=G?(this.ui.replaceFileData(G.getData(),+[g]),this.ui.restoreViewState(A,n,v),this.setDescriptor(G.getDescriptor()),this.descriptorChanged(),null!=b&&b()):(this.ui.spinner.stop(),this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){var S=this.ui.getCurrentFile();null!=S&&(S.stats=this.stats,S.patch([g]),S.fileChanged());this.ui.restoreViewState(A,n,v);null!=b&&b()}else null!=e&&e(this.ui.fileLoadedError)}),!0))}),e)}catch(G){null!=e&&e(G)}};DrawioFile.prototype.copyFile=function(b,e){this.ui.editor.editAsNew(this.ui.getFileData(!0),this.ui.getCopyFilename(this))};DrawioFile.prototype.ignorePatches=function(b){var e=!0;if(null!=b)for(var g=0;g<b.length&&e;g++)e=e&&mxUtils.isEmptyObject(b[g]);return e};-DrawioFile.prototype.patch=function(b,e,g,m){if(null!=b){var v=this.ui.editor.undoManager,p=v.history.slice(),A=v.indexOfNextAdd,H=this.ui.editor.graph;H.container.style.visibility="hidden";var S=this.changeListenerEnabled;this.changeListenerEnabled=g;var F=H.foldingEnabled,K=H.mathEnabled,c=H.cellRenderer.redraw;H.cellRenderer.redraw=function(G){G.view.graph.isEditing(G.cell)&&(G.view.graph.scrollCellToVisible(G.cell),G.view.graph.cellEditor.resize());c.apply(this,arguments)};H.model.beginUpdate();+DrawioFile.prototype.patch=function(b,e,g,m){if(null!=b){var v=this.ui.editor.undoManager,n=v.history.slice(),A=v.indexOfNextAdd,G=this.ui.editor.graph;G.container.style.visibility="hidden";var S=this.changeListenerEnabled;this.changeListenerEnabled=g;var F=G.foldingEnabled,K=G.mathEnabled,c=G.cellRenderer.redraw;G.cellRenderer.redraw=function(H){H.view.graph.isEditing(H.cell)&&(H.view.graph.scrollCellToVisible(H.cell),H.view.graph.cellEditor.resize());c.apply(this,arguments)};G.model.beginUpdate();try{if(g){for(var f=this.ui.pages.slice(),l=this.ui.currentPage,t=this.ui.applyPatches(this.ui.pages,b,!0,e,this.isModified()),q=0;q<t.length;q++){var D=mxUtils.indexOf(this.ui.pages,t[q]);0>D?this.ui.insertPage(t[q],Math.min(q,this.ui.pages.length)):this.ui.movePage(D,q)}for(q=0;q<f.length;q++)0>mxUtils.indexOf(t,f[q])&&this.ui.removePage(f[q]);0<=mxUtils.indexOf(this.ui.pages,l)&&this.ui.selectPage(l,!0)}else this.ui.pages=this.ui.applyPatches(this.ui.pages,b,!0,e,this.isModified());0==this.ui.pages.length&&-this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0);H.checkDefaultParent()}finally{H.container.style.visibility="";H.model.endUpdate();H.cellRenderer.redraw=c;this.changeListenerEnabled=S;g||(v.history=p,v.indexOfNextAdd=A,v.fireEvent(new mxEventObject(mxEvent.CLEAR)));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)K!=H.mathEnabled?(this.ui.editor.updateGraphComponents(),H.refresh()):(F!=H.foldingEnabled?-H.view.revalidate():H.view.validate(),H.sizeDidChange());null!=this.sync&&this.isRealtime()&&!m&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages));this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",[this],"patches",b,"resolver",e,"undoable",g)}return b};-DrawioFile.prototype.save=function(b,e,g,m,v,p){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",m,"overwrite",v,"manual",p,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!v&&this.invalidChecksum)if(null!=g)g({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=e&&e();else if(null!=g)g({message:mxResources.get("readOnly")});+this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0);G.checkDefaultParent()}finally{G.container.style.visibility="";G.model.endUpdate();G.cellRenderer.redraw=c;this.changeListenerEnabled=S;g||(v.history=n,v.indexOfNextAdd=A,v.fireEvent(new mxEventObject(mxEvent.CLEAR)));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)K!=G.mathEnabled?(this.ui.editor.updateGraphComponents(),G.refresh()):(F!=G.foldingEnabled?+G.view.revalidate():G.view.validate(),G.sizeDidChange());null!=this.sync&&this.isRealtime()&&!m&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages));this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",[this],"patches",b,"resolver",e,"undoable",g)}return b};+DrawioFile.prototype.save=function(b,e,g,m,v,n){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",m,"overwrite",v,"manual",n,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!v&&this.invalidChecksum)if(null!=g)g({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=e&&e();else if(null!=g)g({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));}catch(A){if(null!=g)g(A);else throw A;}};DrawioFile.prototype.createData=function(){var b=this.ui.pages;if(this.isRealtime()&&(this.ui.pages=this.ownPages,null!=this.ui.currentPage)){var e=this.ui.getPageById(this.ui.currentPage.getId(),this.ownPages);null!=e&&(e.viewState=this.ui.editor.graph.getViewState(),e.needsUpdate=!0)}e=this.ui.getFileData(null,null,null,null,null,null,null,null,this,!this.isCompressed());this.ui.pages=b;return e};DrawioFile.prototype.updateFileData=function(){null!=this.sync&&this.sync.sendLocalChanges();this.setData(this.createData());null!=this.sync&&this.sync.fileDataUpdated()};DrawioFile.prototype.isCompressedStorage=function(){return Editor.defaultCompressed};DrawioFile.prototype.isCompressed=function(){var b=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("compressed"):null;return null!=b?"false"!=b:this.isCompressedStorage()&&Editor.compressXml};DrawioFile.prototype.setLocked=function(b){this.ui.fileNode.setAttribute("locked",b?"true":"false");this.ui.fireEvent(new mxEventObject("lockedChanged"));this.fileChanged();b&&this.ui.editor.graph.clearSelection()};DrawioFile.prototype.isLocked=function(){var b=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("locked"):null;return null!=b?"true"==b:!1};DrawioFile.prototype.saveAs=function(b,e,g){};DrawioFile.prototype.saveFile=function(b,e,g,m){};DrawioFile.prototype.getFileUrl=function(){return null};@@ -3131,28 +3135,28 @@ DrawioFile.prototype.handleFileSuccess=function(b){this.ui.spinner.stop();this.uthis.ui.updateStatus(mxUtils.bind(this,function(){this.addAllSavedStatus()})),null!=this.sync&&(this.sync.resetUpdateStatusThread(),this.sync.remoteFileChanged&&(this.sync.remoteFileChanged=!1,this.sync.fileChangedNotify()))):this.ui.clearStatus())};DrawioFile.prototype.handleFileError=function(b,e){this.ui.spinner.stop();this.ui.getCurrentFile()==this&&(this.inConflictState?this.handleConflictError(b,e):(this.isModified()&&this.addUnsavedStatus(b),e?this.ui.handleError(b,null!=b?mxResources.get("errorSavingFile"):null):this.isModified()||this.ui.updateStatus(mxUtils.bind(this,function(){var g=this.getErrorMessage(b);null!=g&&60<g.length&&(g=g.substring(0,60)+"...");this.ui.editor.setStatus('<div class="geStatusAlert">'+mxUtils.htmlEntities(mxResources.get("error"))+(null!=g?" ("+mxUtils.htmlEntities(g)+")":"")+"</div>")}))))};-DrawioFile.prototype.handleConflictError=function(b,e){var g=mxUtils.bind(this,function(){this.handleFileSuccess(!0)}),m=mxUtils.bind(this,function(A){this.handleFileError(A,!0)}),v=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get(this.savingSpinnerKey))&&(this.ui.clearStatus(),this.save(!0,g,m,null,!0,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage))}),p=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("updatingDocument"))&&-this.synchronizeFile(mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.spinner.spin(document.body,mxResources.get(this.savingSpinnerKey))&&this.save(!0,g,m,null,null,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage)}),m)});"none"==DrawioFile.SYNC?this.showCopyDialog(g,m,v):this.invalidChecksum&&e?this.showRefreshDialog(g,m,this.getErrorMessage(b)):e?this.showConflictDialog(v,p):this.addConflictStatus(this.getErrorMessage(b),mxUtils.bind(this,function(){this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("updatingDocument")));+DrawioFile.prototype.handleConflictError=function(b,e){var g=mxUtils.bind(this,function(){this.handleFileSuccess(!0)}),m=mxUtils.bind(this,function(A){this.handleFileError(A,!0)}),v=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get(this.savingSpinnerKey))&&(this.ui.clearStatus(),this.save(!0,g,m,null,!0,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage))}),n=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("updatingDocument"))&&+this.synchronizeFile(mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.spinner.spin(document.body,mxResources.get(this.savingSpinnerKey))&&this.save(!0,g,m,null,null,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage)}),m)});"none"==DrawioFile.SYNC?this.showCopyDialog(g,m,v):this.invalidChecksum&&e?this.showRefreshDialog(g,m,this.getErrorMessage(b)):e?this.showConflictDialog(v,n):this.addConflictStatus(this.getErrorMessage(b),mxUtils.bind(this,function(){this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("updatingDocument")));this.synchronizeFile(g,m)}))};DrawioFile.prototype.getErrorMessage=function(b){var e=null!=b?null!=b.error?b.error.message:b.message:null;null==e&&null!=b&&b.code==App.ERROR_TIMEOUT?e=mxResources.get("timeout"):"0"==e&&(e=mxResources.get("noResponse"));return e};DrawioFile.prototype.isOverdue=function(){return null!=this.ageStart&&Date.now()-this.ageStart.getTime()>=this.ui.warnInterval};-DrawioFile.prototype.compressionChanged=function(b){var e=null!=this.ownPages?this.ownPages:this.ui.pages;if(null!=e)for(var g=0;g<e.length;g++){var m=e[g].node;if(null!=m&&(null==this.ui.currentPage||this.ui.currentPage.getId()!=e[g].getId())){var v=m.getElementsByTagName("mxGraphModel");v=0<v.length?v[0]:null;var p=Graph.decompress(mxUtils.getNodeValue(m));b?0==p.length&&null!=v&&(EditorUi.removeChildNodes(m),mxUtils.setTextContent(m,Graph.compressNode(v)),EditorUi.debug("DrawioFile.compressionChanged",-[this],"Page "+g+" compressed")):0<p.length&&null==v&&(EditorUi.removeChildNodes(m),m.appendChild(mxUtils.parseXml(p).documentElement),EditorUi.debug("DrawioFile.compressionChanged",[this],"Page "+g+" decompressed"))}}};DrawioFile.prototype.fileReplaced=function(b){this.inConflictState=this.invalidChecksum=!1;null!=b&&this.patch(b);null!=this.sync&&this.sync.initRealtime();EditorUi.debug("DrawioFile.fileReplaced",[this],"patches",b)};+DrawioFile.prototype.compressionChanged=function(b){var e=null!=this.ownPages?this.ownPages:this.ui.pages;if(null!=e)for(var g=0;g<e.length;g++){var m=e[g].node;if(null!=m&&(null==this.ui.currentPage||this.ui.currentPage.getId()!=e[g].getId())){var v=m.getElementsByTagName("mxGraphModel");v=0<v.length?v[0]:null;var n=Graph.decompress(mxUtils.getNodeValue(m));b?0==n.length&&null!=v&&(EditorUi.removeChildNodes(m),mxUtils.setTextContent(m,Graph.compressNode(v)),EditorUi.debug("DrawioFile.compressionChanged",+[this],"Page "+g+" compressed")):0<n.length&&null==v&&(EditorUi.removeChildNodes(m),m.appendChild(mxUtils.parseXml(n).documentElement),EditorUi.debug("DrawioFile.compressionChanged",[this],"Page "+g+" decompressed"))}}};DrawioFile.prototype.fileReplaced=function(b){this.inConflictState=this.invalidChecksum=!1;null!=b&&this.patch(b);null!=this.sync&&this.sync.initRealtime();EditorUi.debug("DrawioFile.fileReplaced",[this],"patches",b)};DrawioFile.prototype.fileChanged=function(b){b=null!=b?b:!0;this.lastChanged=new Date;this.setModified(!0);EditorUi.debug("DrawioFile.fileChanged",[this],"autosaveDelay",this.autosaveDelay,"autosave",this.isAutosave(),"saving",this.savingFile);this.isAutosave()?(null!=this.savingStatusKey&&this.ui.updateStatus(mxUtils.bind(this,function(){this.addAllSavedStatus(mxUtils.htmlEntities(mxResources.get(this.savingStatusKey))+"...")})),this.ui.scheduleSanityCheck(),null==this.ageStart&&(this.ageStart=new Date),this.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.bind(this,function(e){this.ui.stopSanityCheck();null==this.autosaveThread?(this.handleFileSuccess(!0),this.ageStart=null):this.isModified()&&(this.ui.scheduleSanityCheck(),this.ageStart=this.lastChanged)}),mxUtils.bind(this,function(e){this.handleFileError(e)}))):(this.ageStart=null,this.isAutosaveOptional()&&this.ui.editor.autosave||this.inConflictState||this.addUnsavedStatus());null!=this.sync&&b&&this.sync.localFileChanged()};DrawioFile.prototype.createSecret=function(b){var e=Editor.guid(32);Editor.enableRealtimeCache&&null!=this.sync&&!this.isOptimisticSync()?this.sync.createToken(e,mxUtils.bind(this,function(g){EditorUi.debug("DrawioFile.createSecret",[this],"secret",e,"token",g);b(e,g)}),mxUtils.bind(this,function(){b(e)})):b(e)};DrawioFile.prototype.fileSaving=function(){null!=this.sync&&this.sync.fileSaving()};-DrawioFile.prototype.fileSaved=function(b,e,g,m,v,p,A){this.lastSaved=new Date;this.ageStart=null;this.stats.saved++;try{this.invalidChecksum=this.inConflictState=!1;p=null!=p?p:this.ui.getPagesForXml(b);try{null==this.sync||this.isOptimisticSync()?(this.setShadowPages(p),null!=this.sync&&(this.sync.lastModified=this.getLastModifiedDate(),this.sync.resetUpdateStatusThread(),this.isRealtime()&&this.sync.scheduleCleanup()),null!=g&&g()):this.sync.fileSaved(p,e,g,m,v,A)}catch(F){this.invalidChecksum=-this.inConflictState=!0;this.descriptorChanged();null!=m&&m(F);try{var H=this.getCurrentUser(),S=null!=H?H.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),S,F)}catch(K){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[e],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(F){this.descriptorChanged(),null!=m&&m(F)}};-DrawioFile.prototype.autosave=function(b,e,g,m){null==this.lastAutosave&&(this.lastAutosave=Date.now());var v=Date.now()-this.lastAutosave<e?b:0;this.clearAutosave();var p=window.setTimeout(mxUtils.bind(this,function(){try{if(this.lastAutosave=null,this.autosaveThread==p&&(this.autosaveThread=null),EditorUi.debug("DrawioFile.autosave",[this],"thread",p,"modified",this.isModified(),"now",this.isAutosaveNow(),"saving",this.savingFile),this.isModified()&&this.isAutosaveNow()){var A=this.isAutosaveRevision();-A&&(this.lastAutosaveRevision=(new Date).getTime());this.save(A,mxUtils.bind(this,function(H){this.autosaveCompleted();null!=g&&g(H)}),mxUtils.bind(this,function(H){null!=m&&m(H)}))}else this.isModified()||this.ui.clearStatus(),null!=g&&g(null)}catch(H){null!=m&&m(H)}}),v);this.autosaveThread=p;EditorUi.debug("DrawioFile.autosave",[this],"thread",p,"delay",b,"maxDelay",e,"actualDelay",v,"lastAutosave",this.lastAutosave,"saving",this.savingFile)};DrawioFile.prototype.isAutosaveNow=function(){return!0};+DrawioFile.prototype.fileSaved=function(b,e,g,m,v,n,A){this.lastSaved=new Date;this.ageStart=null;this.stats.saved++;try{this.invalidChecksum=this.inConflictState=!1;n=null!=n?n:this.ui.getPagesForXml(b);try{null==this.sync||this.isOptimisticSync()?(this.setShadowPages(n),null!=this.sync&&(this.sync.lastModified=this.getLastModifiedDate(),this.sync.resetUpdateStatusThread(),this.isRealtime()&&this.sync.scheduleCleanup()),null!=g&&g()):this.sync.fileSaved(n,e,g,m,v,A)}catch(F){this.invalidChecksum=+this.inConflictState=!0;this.descriptorChanged();null!=m&&m(F);try{var G=this.getCurrentUser(),S=null!=G?G.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),S,F)}catch(K){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[e],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(F){this.descriptorChanged(),null!=m&&m(F)}};+DrawioFile.prototype.autosave=function(b,e,g,m){null==this.lastAutosave&&(this.lastAutosave=Date.now());var v=Date.now()-this.lastAutosave<e?b:0;this.clearAutosave();var n=window.setTimeout(mxUtils.bind(this,function(){try{if(this.lastAutosave=null,this.autosaveThread==n&&(this.autosaveThread=null),EditorUi.debug("DrawioFile.autosave",[this],"thread",n,"modified",this.isModified(),"now",this.isAutosaveNow(),"saving",this.savingFile),this.isModified()&&this.isAutosaveNow()){var A=this.isAutosaveRevision();+A&&(this.lastAutosaveRevision=(new Date).getTime());this.save(A,mxUtils.bind(this,function(G){this.autosaveCompleted();null!=g&&g(G)}),mxUtils.bind(this,function(G){null!=m&&m(G)}))}else this.isModified()||this.ui.clearStatus(),null!=g&&g(null)}catch(G){null!=m&&m(G)}}),v);this.autosaveThread=n;EditorUi.debug("DrawioFile.autosave",[this],"thread",n,"delay",b,"maxDelay",e,"actualDelay",v,"lastAutosave",this.lastAutosave,"saving",this.savingFile)};DrawioFile.prototype.isAutosaveNow=function(){return!0};DrawioFile.prototype.autosaveCompleted=function(){};DrawioFile.prototype.clearAutosave=function(){null!=this.autosaveThread&&(window.clearTimeout(this.autosaveThread),this.autosaveThread=null)};DrawioFile.prototype.isAutosaveRevision=function(){var b=(new Date).getTime();return null==this.lastAutosaveRevision||b-this.lastAutosaveRevision>this.maxAutosaveRevisionDelay};DrawioFile.prototype.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))};DrawioFile.prototype.contentChanged=function(){this.fireEvent(new mxEventObject("contentChanged"))};DrawioFile.prototype.close=function(b){try{this.isAutosave()&&this.isModified()&&(this.updateFileData(),this.save(this.isAutosaveRevision(),null,null,b))}catch(e){}this.stats.closed++;this.destroy()};DrawioFile.prototype.hasSameExtension=function(b,e){if(null!=b&&null!=e){var g=b.lastIndexOf(".");b=0<g?b.substring(g):"";g=e.lastIndexOf(".");return b===(0<g?e.substring(g):"")}return b==e};DrawioFile.prototype.removeListeners=function(){null!=this.changeListener&&(this.ui.editor.graph.model.removeListener(this.changeListener),this.ui.editor.graph.removeListener(this.changeListener),this.ui.removeListener(this.changeListener),this.changeListener=null)};DrawioFile.prototype.destroy=function(){this.clearAutosave();this.removeListeners();this.stats.destroyed++;null!=this.sync&&(this.sync.destroy(),this.sync=null)};DrawioFile.prototype.commentsSupported=function(){return!1};-DrawioFile.prototype.commentsRefreshNeeded=function(){return!0};DrawioFile.prototype.commentsSaveNeeded=function(){return!1};DrawioFile.prototype.getComments=function(b,e){b([])};DrawioFile.prototype.addComment=function(b,e,g){e(Date.now())};DrawioFile.prototype.canReplyToReplies=function(){return!0};DrawioFile.prototype.canComment=function(){return!0};DrawioFile.prototype.newComment=function(b,e){return new DrawioComment(this,null,b,Date.now(),Date.now(),!1,e)};LocalFile=function(b,e,g,m,v,p,A){DrawioFile.call(this,b,e);this.title=g;this.mode=m?null:App.MODE_DEVICE;this.fileHandle=v;this.desc=p;this.editable=A};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return null!=this.fileHandle&&!this.invalidFileHandle&&DrawioFile.prototype.isAutosave.apply(this,arguments)};LocalFile.prototype.isAutosaveOptional=function(){return null!=this.fileHandle};LocalFile.prototype.getMode=function(){return this.mode};+DrawioFile.prototype.commentsRefreshNeeded=function(){return!0};DrawioFile.prototype.commentsSaveNeeded=function(){return!1};DrawioFile.prototype.getComments=function(b,e){b([])};DrawioFile.prototype.addComment=function(b,e,g){e(Date.now())};DrawioFile.prototype.canReplyToReplies=function(){return!0};DrawioFile.prototype.canComment=function(){return!0};DrawioFile.prototype.newComment=function(b,e){return new DrawioComment(this,null,b,Date.now(),Date.now(),!1,e)};LocalFile=function(b,e,g,m,v,n,A){DrawioFile.call(this,b,e);this.title=g;this.mode=m?null:App.MODE_DEVICE;this.fileHandle=v;this.desc=n;this.editable=A};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return null!=this.fileHandle&&!this.invalidFileHandle&&DrawioFile.prototype.isAutosave.apply(this,arguments)};LocalFile.prototype.isAutosaveOptional=function(){return null!=this.fileHandle};LocalFile.prototype.getMode=function(){return this.mode};LocalFile.prototype.getTitle=function(){return this.title};LocalFile.prototype.isRenamable=function(){return!0};LocalFile.prototype.isEditable=function(){return DrawioFile.prototype.isEditable.apply(this,arguments)&&(null==this.editable||this.editable)};LocalFile.prototype.setEditable=function(b){this.editable=b;this.descriptorChanged()};LocalFile.prototype.save=function(b,e,g,m,v){this.saveAs(this.title,e,g,m,v)};LocalFile.prototype.saveAs=function(b,e,g,m,v){this.saveFile(b,!1,e,g,null,m,v)};LocalFile.prototype.getDescriptor=function(){return this.desc};LocalFile.prototype.setDescriptor=function(b){this.desc=b};LocalFile.prototype.getLatestVersion=function(b,e){null==this.fileHandle?null!=e&&e({message:mxResources.get("cannotOpenFile")}):this.ui.loadFileSystemEntry(this.fileHandle,b,e)};-LocalFile.prototype.saveFile=function(b,e,g,m,v,p,A){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;v||this.updateFileData();var H=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var S=this.getData(),F=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=g&&g()}),K=mxUtils.bind(this,function(c){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=-!0;var f=mxUtils.bind(this,function(t){this.savingFile=!1;null!=m&&m({error:t})});this.saveDraft(S);this.fileHandle.createWritable().then(mxUtils.bind(this,function(t){this.fileHandle.getFile().then(mxUtils.bind(this,function(q){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[q],"conflict",this.desc.lastModified!=q.lastModified);A||this.desc.lastModified==q.lastModified?t.write(H?this.ui.base64ToBlob(c,"image/png"):c).then(mxUtils.bind(this,function(){t.close().then(mxUtils.bind(this,-function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(D){try{var G=this.desc;this.savingFile=!1;this.desc=D;this.fileSaved(S,G,F,f);this.removeDraft()}catch(N){f(N)}}),f)}),f)}),f):(this.inConflictState=!0,f())}),mxUtils.bind(this,function(q){this.invalidFileHandle=!0;f(q)}))}),f)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(c,b,H?"image/png":"text/xml",H);else if(c.length<MAX_REQUEST_SIZE){var l=b.lastIndexOf(".");l=0<l?b.substring(l+1):"xml";-(new mxXmlRequest(SAVE_URL,"format="+l+"&xml="+encodeURIComponent(c)+"&filename="+encodeURIComponent(b)+(H?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(c)}));F()}});H?(e=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(c){K(c)}),m,this.ui.getCurrentFile()!=this?S:null,e.scale,e.border)):K(S)};+LocalFile.prototype.saveFile=function(b,e,g,m,v,n,A){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;v||this.updateFileData();var G=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var S=this.getData(),F=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=g&&g()}),K=mxUtils.bind(this,function(c){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=+!0;var f=mxUtils.bind(this,function(t){this.savingFile=!1;null!=m&&m({error:t})});this.saveDraft(S);this.fileHandle.createWritable().then(mxUtils.bind(this,function(t){this.fileHandle.getFile().then(mxUtils.bind(this,function(q){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[q],"conflict",this.desc.lastModified!=q.lastModified);A||this.desc.lastModified==q.lastModified?t.write(G?this.ui.base64ToBlob(c,"image/png"):c).then(mxUtils.bind(this,function(){t.close().then(mxUtils.bind(this,+function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(D){try{var H=this.desc;this.savingFile=!1;this.desc=D;this.fileSaved(S,H,F,f);this.removeDraft()}catch(N){f(N)}}),f)}),f)}),f):(this.inConflictState=!0,f())}),mxUtils.bind(this,function(q){this.invalidFileHandle=!0;f(q)}))}),f)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(c,b,G?"image/png":"text/xml",G);else if(c.length<MAX_REQUEST_SIZE){var l=b.lastIndexOf(".");l=0<l?b.substring(l+1):"xml";+(new mxXmlRequest(SAVE_URL,"format="+l+"&xml="+encodeURIComponent(c)+"&filename="+encodeURIComponent(b)+(G?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(c)}));F()}});G?(e=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(c){K(c)}),m,this.ui.getCurrentFile()!=this?S:null,e.scale,e.border)):K(S)};LocalFile.prototype.rename=function(b,e,g){this.title=b;this.descriptorChanged();null!=e&&e()};(function(){"undefined"!==typeof html4&&(html4.ATTRIBS["span::data-lucid-content"]=0,html4.ATTRIBS["span::data-lucid-type"]=0,html4.ATTRIBS["font::data-font-src"]=0);Editor.sketchFontFamily="Architects Daughter";Editor.sketchFontSource="https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter";Editor.sketchFonts=[{fontFamily:Editor.sketchFontFamily,fontUrl:decodeURIComponent(Editor.sketchFontSource)}];Editor.sketchDefaultCurveFitting="1";Editor.sketchDefaultJiggle="2";Editor.thinFormatImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0ibTM2LjUgMTguMzUtNi44NS02Ljg1IDMuMjUtMy4ycS44NS0uODUgMi4wMjUtLjg1IDEuMTc1IDAgMi4wMjUuODVsMi43NSAyLjhxLjg1LjguODUgMnQtLjg1IDJaTTYuODUgNDEuMXYtNi45bDkuNTUtOS41NUw1LjUgMTMuN2w3LjgtNy44NSAxMSAxMSA1LjM1LTUuMzUgNi44NSA2Ljg1LTUuMzUgNS4zNSAxMSAxMS03Ljg1IDcuNzUtMTAuOTUtMTAuOS05LjYgOS41NVptMTEuMi0xOC4wNSA0LjY1LTQuNi00LjA1LTQuMDUtMi4zNSAyLjQtMS42LTEuNiAyLjM1LTIuNC0zLjc1LTMuNzUtNC42IDQuNjVabTE2LjIgMTYuMjUgNC42NS00LjY1LTMuNzUtMy43NS0yLjQgMi40LTEuNi0xLjYgMi40LTIuNC00LjA1LTQtNC42IDQuNjVabS0yNS4xLS40NWgzLjZsMjAuNS0yMC40NS0zLjY1LTMuNjVMOS4xNSAzNS4yWiIvPjwvc3ZnPg==";Editor.thinGestureImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI4IDQxLjZxLTIuNSAwLTQuMDc1LTEuNjUtMS41NzUtMS42NS0xLjU3NS00LjM1IDAtMi4zNSAxLjEtNC4xIDEuMS0xLjc1IDIuODI1LTIuOTUgMS43MjUtMS4yIDMuNy0xLjgyNVQzMy42NSAyNnEtLjE1LTMuMDUtMS4yNS00LjQyNVQyOS4yNSAyMC4ycS0yLjMgMC00LjE3NSAxLjV0LTQuNDI1IDQuOTVxLTIuNjUgMy40NS00LjYgNS4xLTEuOTUgMS42NS00LjM1IDEuNjUtMi4xIDAtMy42NS0xLjM3NVE2LjUgMzAuNjUgNi41IDI3LjQ1cTAtMiAxLjItNC41MjUgMS4yLTIuNTI1IDMuNS02LjE3NSAxLjMtMS44NSAxLjk3NS0zLjIyNXQuNjc1LTIuMzc1cTAtLjctLjM1LTEuMDUtLjM1LS4zNS0xLjA1LS4zNS0uNzUgMC0xLjYuNDc1UTEwIDEwLjcgOSAxMS45TDcgOS44cTEuMzUtMS41NSAyLjcyNS0yLjI3NVExMS4xIDYuOCAxMi41IDYuOHExLjkgMCAzLjEgMS4yNSAxLjIgMS4yNSAxLjIgMy4yIDAgMS44LS45NzUgMy41NzVRMTQuODUgMTYuNiAxMy4wNSAxOS4zcS0xLjk1IDIuOTUtMi43NzUgNC43dC0uODI1IDMuNjVxMCAxLjYuNzUgMi4yLjc1LjYgMS43NS42IDEuNDUgMCAyLjgyNS0xLjMgMS4zNzUtMS4zIDMuNTc1LTQuMTUgMi45NS0zLjggNS41MjUtNS43NzUgMi41NzUtMS45NzUgNS42NzUtMS45NzUgMy4xNSAwIDUgMi4zMjVUMzYuNiAyNS45aDQuOXYyLjk1aC00LjlxLS40NSA3LjM1LTMuMiAxMC4wNS0yLjc1IDIuNy01LjQgMi43Wm0uMS0yLjk1cTEuODUgMCAzLjY1LTIuMjUgMS44LTIuMjUgMi03LjUtMi44LjE1LTUuNjI1IDIuMDI1VDI1LjMgMzUuOXEwIDEuMy43NSAyLjAyNS43NS43MjUgMi4wNS43MjVaIi8+PC9zdmc+";@@ -3312,10 +3316,10 @@ B,I){var U=mxClient.IS_FF?8192:16384;return Math.min(I,Math.min(U/k,U/B))};Editofunction(Aa){try{var wa=new Image;wa.onload=mxUtils.bind(this,function(){try{var Qa=function(){mxClient.IS_SF?window.setTimeout(function(){Ma.drawImage(wa,0,0);k(Ra,Aa)},0):(Ma.drawImage(wa,0,0),k(Ra,Aa))},Ra=document.createElement("canvas"),Sa=parseInt(Aa.getAttribute("width")),Ha=parseInt(Aa.getAttribute("height"));Z=null!=Z?Z:1;null!=B&&(Z=T?Math.min(1,Math.min(3*B/(4*Ha),B/Sa)):B/Sa);Z=this.getMaxCanvasScale(Sa,Ha,Z);Sa=Math.ceil(Z*Sa);Ha=Math.ceil(Z*Ha);Ra.setAttribute("width",Sa);Ra.setAttribute("height",Ha);var Ma=Ra.getContext("2d");if(null!=Ca){var y=mxUtils.getLightDarkColor(Ca);Ma.beginPath();Ma.rect(0,0,Sa,Ha);Ma.fillStyle="dark"==za&&"none"!=qa.getAdaptiveColors()?y.dark:y.light;Ma.fill()}1!=Z&&Ma.scale(Z,Z);if(La){var O=qa.view,R=O.scale;O.scale=1;var V=btoa(unescape(encodeURIComponent(O.createSvgGrid(O.gridColor))));O.scale=R;V="data:image/svg+xml;base64,"+V;var fa=qa.gridSize*O.gridSteps*Z,ia=qa.getGraphBounds(),oa=O.translate.x*R,ta=O.translate.y*R,ra=oa+(ia.x-oa)/R-Ba,xa=ta+(ia.y-ta)/R-Ba,Da=new Image;Da.onload=function(){try{for(var Ia=-Math.round(fa-mxUtils.mod((oa-ra)*Z,fa)),Xa=-Math.round(fa-mxUtils.mod((ta-xa)*Z,fa));Ia<Sa;Ia+=fa)for(var Za=Xa;Za<Ha;Za+=fa)Ma.drawImage(Da,Ia/Z,Za/Z);Qa()}catch($a){null!=P&&P($a)}};Da.onerror=function(Ia){null!=P&&P(Ia)};Da.src=V}else Qa()}catch(Ia){null!=P&&P(Ia)}});wa.onerror=function(Qa){null!=P&&P(Qa)};va&&this.graph.addSvgShadow(Aa);this.graph.mathEnabled&&this.addMathCss(Aa);var Ya=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&-this.addFontCss(Aa,this.resolvedFontCss),wa.src=Editor.createSvgDataUri(mxUtils.getXml(Aa))}catch(Qa){null!=P&&P(Qa)}});this.embedExtFonts(mxUtils.bind(this,function(Qa){try{null!=Qa&&this.addFontCss(Aa,Qa),this.loadFonts(Ya)}catch(Ra){null!=P&&P(Ra)}}))}catch(Qa){null!=P&&P(Qa)}}),I,ua)}catch(Aa){null!=P&&P(Aa)}};Editor.crcTable=[];for(var v=0;256>v;v++)for(var p=v,A=0;8>A;A++)p=1==(p&1)?3988292384^p>>>1:p>>>1,Editor.crcTable[v]=p;Editor.updateCRC=function(k,B,I,U){for(var P=0;P<U;P++)k=Editor.crcTable[(k^+this.addFontCss(Aa,this.resolvedFontCss),wa.src=Editor.createSvgDataUri(mxUtils.getXml(Aa))}catch(Qa){null!=P&&P(Qa)}});this.embedExtFonts(mxUtils.bind(this,function(Qa){try{null!=Qa&&this.addFontCss(Aa,Qa),this.loadFonts(Ya)}catch(Ra){null!=P&&P(Ra)}}))}catch(Qa){null!=P&&P(Qa)}}),I,ua)}catch(Aa){null!=P&&P(Aa)}};Editor.crcTable=[];for(var v=0;256>v;v++)for(var n=v,A=0;8>A;A++)n=1==(n&1)?3988292384^n>>>1:n>>>1,Editor.crcTable[v]=n;Editor.updateCRC=function(k,B,I,U){for(var P=0;P<U;P++)k=Editor.crcTable[(k^B.charCodeAt(I+P))&255]^k>>>8;return k};Editor.crc32=function(k){for(var B=-1,I=0;I<k.length;I++)B=B>>>8^Editor.crcTable[(B^k.charCodeAt(I))&255];return(B^-1)>>>0};Editor.writeGraphModelToPng=function(k,B,I,U,P){function T(ua,qa){var Ba=ka;ka+=qa;return ua.substring(Ba,ka)}function X(ua){ua=T(ua,4);return ua.charCodeAt(3)+(ua.charCodeAt(2)<<8)+(ua.charCodeAt(1)<<16)+(ua.charCodeAt(0)<<24)}function Z(ua){return String.fromCharCode(ua>>24&255,ua>>16&255,ua>>8&255,ua&255)}k=k.substring(k.indexOf(",")+1);k=window.atob?atob(k):Base64.decode(k,!0);var ka=0;if(T(k,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=P&&P();else if(T(k,4),"IHDR"!=T(k,4))null!=P&&P();else{T(k,17);P=k.substring(0,ka);do{var va=X(k);if("IDAT"==T(k,4)){P=k.substring(0,ka-8);"pHYs"==B&&"dpi"==I?(I=Math.round(U/.0254),I=Z(I)+Z(I)+String.fromCharCode(1)):I=I+String.fromCharCode(0)+("zTXt"==B?String.fromCharCode(0):"")+U;U=4294967295;U=Editor.updateCRC(U,B,0,4);U=Editor.updateCRC(U,I,0,I.length);P+=Z(I.length)+-B+I+Z(U^4294967295);P+=k.substring(ka-8,k.length);break}P+=k.substring(ka-8,ka-4+va);T(k,va);T(k,4)}while(va);return"data:image/png;base64,"+(window.btoa?btoa(P):Base64.encode(P,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var H=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(k,B){H.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var S=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=+B+I+Z(U^4294967295);P+=k.substring(ka-8,k.length);break}P+=k.substring(ka-8,ka-4+va);T(k,va);T(k,4)}while(va);return"data:image/png;base64,"+(window.btoa?btoa(P):Base64.encode(P,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var G=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(k,B){G.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var S=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){S.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(k,B){var I=null;null!=k.editor.graph.getModel().getParent(B)?I=B.getId():null!=k.currentPage&&(I=k.currentPage.getId());return I});if(null!=window.StyleFormatPanel){var F=Format.prototype.init;Format.prototype.init=function(){F.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var K=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?K.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(k){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var c=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(k){k=c.apply(this,arguments);var B=this.editorUi,I=B.editor.graph;if(I.isEnabled()){var U=B.getCurrentFile();null!=U&&U.isAutosaveOptional()&&k.appendChild(this.createOption(mxResources.get("autosave"),function(){return B.editor.autosave},function(T){B.editor.setAutosave(T);B.editor.autosave&&U.isModified()&&U.fileChanged()},{install:function(T){this.listener=function(){T(B.editor.autosave)};B.editor.addListener("autosaveChanged",this.listener)},destroy:function(){B.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&I.isEnabled()&&"undefined"!==@@ -3343,141 +3347,139 @@ min:0}];mxCellRenderer.defaultShapes.umlFrame.prototype.customProperties=[{name:stroke:"#9673a6"}],[{fill:"",stroke:""},{fill:"#60a917",stroke:"#2D7600",font:"#ffffff"},{fill:"#008a00",stroke:"#005700",font:"#ffffff"},{fill:"#1ba1e2",stroke:"#006EAF",font:"#ffffff"},{fill:"#0050ef",stroke:"#001DBC",font:"#ffffff"},{fill:"#6a00ff",stroke:"#3700CC",font:"#ffffff"},{fill:"#d80073",stroke:"#A50040",font:"#ffffff"},{fill:"#a20025",stroke:"#6F0000",font:"#ffffff"}],[{fill:"#e51400",stroke:"#B20000",font:"#ffffff"},{fill:"#fa6800",stroke:"#C73500",font:"#000000"},{fill:"#f0a30a",stroke:"#BD7000",font:"#000000"},{fill:"#e3c800",stroke:"#B09500",font:"#000000"},{fill:"#6d8764",stroke:"#3A5431",font:"#ffffff"},{fill:"#647687",stroke:"#314354",font:"#ffffff"},{fill:"#76608a",stroke:"#432D57",font:"#ffffff"},{fill:"#a0522d",stroke:"#6D1F00",font:"#ffffff"}],[{fill:"",stroke:""},{fill:mxConstants.NONE,stroke:""},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",stroke:"#23445d"}],[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[{fill:"",stroke:""},{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},-{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;StyleFormatPanel.prototype.findCommonProperties=function(k,B,I,U){if(null!=B){var P=mxUtils.bind(this,function(X){if(null!=X)if(I)for(var Z=0;Z<X.length;Z++){if("function"!==typeof X[Z].isVisible||X[Z].isVisible(U,this))B[X[Z].name]=X[Z]}else for(var ka in B){var va=!1;for(Z=0;Z<-X.length;Z++)if(X[Z].name==ka&&X[Z].type==B[ka].type){va=!0;break}va||delete B[ka]}}),T=this.editorUi.editor.graph.view.getState(k);null!=T&&null!=T.shape&&(T.shape.commonCustomPropAdded||(T.shape.commonCustomPropAdded=!0,T.shape.customProperties=T.shape.customProperties||[],T.cell.vertex?Array.prototype.push.apply(T.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(T.shape.customProperties,Editor.commonEdgeProperties)),P(T.shape.customProperties));k=k.getAttribute("customProperties");-if(null!=k)try{P(JSON.parse(k))}catch(X){}}};var f=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var k=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&"image"!=k.style.shape&&!k.containsLabel&&0<k.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));f.apply(this,arguments);if(Editor.enableCustomProperties){for(var B={},I=k.vertices,U=k.edges,P=0;P<I.length;P++)this.findCommonProperties(I[P],B,-0==P,k);for(P=0;P<U.length;P++)this.findCommonProperties(U[P],B,0==I.length&&0==P,k);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(B).length&&this.container.appendChild(this.addProperties(this.createPanel(),B,k))}};var l=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(k){var B=this.editorUi.getSelectionState();1==B.cells.length?this.addActions(k,["copyStyle","pasteStyle"]):1<=B.cells.length&&this.addActions(k,["pasteStyle","pasteData"]);l.apply(this,-arguments);return k};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(k,B,I,U){function P(Ma,y,O,R,V){if(null!=O.valueChanged)O.valueChanged(y,V);else{Ba.getModel().beginUpdate();try{V=[];var fa=[];if(null!=O.index){for(var ia=[],oa=O.parentRow.nextSibling;oa&&oa.getAttribute("data-pName")==Ma;)ia.push(oa.getAttribute("data-pValue")),oa=oa.nextSibling;O.index<ia.length?null!=R?ia.splice(R,1):ia[O.index]=y:ia.push(y);null!=O.size&&ia.length>O.size&&(ia=ia.slice(0,-O.size));y=ia.join(",");null!=O.countProperty&&(Ba.setCellStyles(O.countProperty,ia.length,Ba.getSelectionCells()),V.push(O.countProperty),fa.push(ia.length))}Ba.setCellStyles(Ma,y,Ba.getSelectionCells());V.push(Ma);fa.push(y);if(null!=O.dependentProps)for(Ma=0;Ma<O.dependentProps.length;Ma++){var ta=O.dependentPropsDefVal[Ma],ra=O.dependentPropsVals[Ma];if(ra.length>y)ra=ra.slice(0,y);else for(var xa=ra.length;xa<y;xa++)ra.push(ta);ra=ra.join(",");Ba.setCellStyles(O.dependentProps[Ma],ra,Ba.getSelectionCells());-V.push(O.dependentProps[Ma]);fa.push(ra)}if("function"==typeof O.onChange)O.onChange(Ba,y);qa.editorUi.fireEvent(new mxEventObject("styleChanged","keys",V,"values",fa,"cells",Ba.getSelectionCells()))}finally{Ba.getModel().endUpdate()}}}function T(Ma,y,O){var R=mxUtils.getOffset(k,!0),V=mxUtils.getOffset(Ma,!0);y.style.position="absolute";y.style.left=V.x-R.x+"px";y.style.top=V.y-R.y+"px";y.style.width=Ma.offsetWidth+"px";y.style.height=Ma.offsetHeight-(O?4:0)+"px";y.style.zIndex=5}function X(Ma,y,-O){function R(fa){if(null==fa||fa==mxConstants.NONE)V.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==fa)V.style.background="";else{var ia=mxUtils.getLightDarkColor(fa);mxUtils.isLightDarkColor(fa)&&ia.light!=ia.dark?V.style.background="linear-gradient(to right bottom, "+ia.cssText+" 50%, "+mxUtils.invertLightDarkColor(ia).cssText+" 50.3%)":V.style.background=fa}}var V=document.createElement("div");V.style.width="32px";V.style.height="8px";V.style.margin="2px";V.style.borderStyle=-"solid";V.style.borderWidth="1px";R(y);btn=mxUtils.button("",mxUtils.bind(qa,function(fa){this.editorUi.pickColor(y,function(ia){P(Ma,ia,O);R(ia)});mxEvent.consume(fa)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(V);return btn}function Z(Ma,y,O,R,V,fa,ia){null!=y&&(y=y.split(","),ya.push({name:Ma,values:y,type:O,defVal:R,countProperty:V,parentRow:fa,isDeletable:!0,flipBkg:ia}));btn=mxUtils.button("+",-mxUtils.bind(qa,function(oa){for(var ta=fa,ra=0;null!=ta.nextSibling;)if(ta.nextSibling.getAttribute("data-pName")==Ma)ta=ta.nextSibling,ra++;else break;var xa={type:O,parentRow:fa,index:ra,isDeletable:!0,defVal:R,countProperty:V};ra=ua(Ma,"",xa,0==ra%2,ia);P(Ma,R,xa);ta.parentNode.insertBefore(ra,ta.nextSibling);mxEvent.consume(oa)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function ka(Ma,y,O,R,V,fa,ia){if(0<V){var oa=Array(V);y=null!=y?y.split(","):[];-for(var ta=0;ta<V;ta++)oa[ta]=null!=y[ta]?y[ta]:null!=R?R:"";ya.push({name:Ma,values:oa,type:O,defVal:R,parentRow:fa,flipBkg:ia,size:V})}return document.createElement("div")}function va(Ma,y,O){var R=document.createElement("input");R.type="checkbox";R.checked="1"==y;mxEvent.addListener(R,"change",function(){P(Ma,R.checked?"1":"0",O)});return R}function ua(Ma,y,O,R,V){var fa=O.dispName,ia=O.type,oa=document.createElement("tr");oa.className="gePropRow"+(V?"Dark":"")+(R?"Alt":"")+" gePropNonHeaderRow";-oa.setAttribute("data-pName",Ma);oa.setAttribute("data-pValue",y);R=!1;null!=O.index&&(oa.setAttribute("data-index",O.index),fa=(null!=fa?fa:"")+"["+O.index+"]",R=!0);var ta=document.createElement("td");ta.className="gePropRowCell";fa=mxResources.get(fa,null,fa);mxUtils.write(ta,fa);ta.setAttribute("title",fa);R&&(ta.style.textAlign="right");oa.appendChild(ta);ta=document.createElement("td");ta.className="gePropRowCell";ta.setAttribute("title",null!=y?y:mxResources.get("none"));if("color"==ia)ta.appendChild(X(Ma,-y,O));else if("bool"==ia||"boolean"==ia)ta.appendChild(va(Ma,y,O));else if("enum"==ia){var ra=O.enumList;for(V=0;V<ra.length;V++)if(fa=ra[V],fa.val==y){mxUtils.write(ta,mxResources.get(fa.dispName,null,fa.dispName));break}mxEvent.addListener(ta,"click",mxUtils.bind(qa,function(){var xa=document.createElement("select"),Da=null;T(ta,xa);for(var Ia=0;Ia<ra.length;Ia++){var Xa=ra[Ia],Za=document.createElement("option");Za.value=mxUtils.htmlEntities(Xa.val);mxUtils.write(Za,mxResources.get(Xa.dispName,-null,Xa.dispName));xa.appendChild(Za);null==Xa.val&&(Za.value="null",Da=Za)}xa.value=null==y&&null!=Da?"null":y;k.appendChild(xa);mxEvent.addListener(xa,"change",function(){var $a=mxUtils.htmlEntities(xa.value);if(xa[xa.selectedIndex]==Da||"null"==$a.value)$a=null;P(Ma,$a,O)});xa.focus();mxEvent.addListener(xa,"blur",function(){k.removeChild(xa)})}))}else"dynamicArr"==ia?ta.appendChild(Z(Ma,y,O.subType,O.subDefVal,O.countProperty,oa,V)):"staticArr"==ia?ta.appendChild(ka(Ma,y,O.subType,O.subDefVal,-O.size,oa,V)):"readOnly"==ia?(V=document.createElement("input"),V.setAttribute("readonly",""),V.value=y,V.style.borderWidth="0px","id"==Ma?(V.style.width="190px",V.style.position="relative",V.style.right="6px",V.style.float="right",V.style.background="none",V.style.textAlign="right",oa.firstChild.setAttribute("colspan","2"),V.setAttribute("title",y),oa.firstChild.appendChild(V)):(V.style.width="96px",ta.appendChild(V))):(ta.innerHTML=mxUtils.htmlEntities(decodeURIComponent(y)),mxEvent.addListener(ta,-"click",mxUtils.bind(qa,function(){function xa(){var Ia=Da.value;Ia=0==Ia.length&&"string"!=ia&&"numbers"!=ia?0:Ia;O.allowAuto&&(null!=Ia.trim&&"auto"==Ia.trim().toLowerCase()?(Ia="auto",ia="string"):(Ia=parseFloat(Ia),Ia=isNaN(Ia)?0:Ia));null!=O.min&&Ia<O.min?Ia=O.min:null!=O.max&&Ia>O.max&&(Ia=O.max);var Xa=null;try{Xa="numbers"==ia?Ia.match(/\d+/g).map(Number).join(" "):encodeURIComponent(("int"==ia?parseInt(Ia):Ia)+"")}catch(Za){}P(Ma,Xa,O,null,Da)}var Da=document.createElement("input");T(ta,-Da,!0);Da.value=decodeURIComponent(y);Da.className="gePropEditor";"int"!=ia&&"float"!=ia||O.allowAuto||(Da.type="number",Da.step="int"==ia?"1":"any",null!=O.min&&(Da.min=parseFloat(O.min)),null!=O.max&&(Da.max=parseFloat(O.max)));k.appendChild(Da);mxEvent.addListener(Da,"keypress",function(Ia){13==Ia.keyCode&&xa()});Da.focus();mxEvent.addListener(Da,"blur",function(){xa()})})));O.isDeletable&&(V=mxUtils.button("-",mxUtils.bind(qa,function(xa){P(Ma,"",O,O.index);mxEvent.consume(xa)})),V.style.height=-"16px",V.style.width="25px",V.style.float="right",V.className="geColorBtn",ta.appendChild(V));oa.appendChild(ta);return oa}var qa=this,Ba=this.editorUi.editor.graph,ya=[],La=document.createElement("table");La.className="geProperties geFullWidthElement";var za=document.createElement("tr");za.className="gePropHeader";var Ea=document.createElement("th");Ea.className="gePropHeaderCell";Ea.style.paddingLeft="16px";Ea.style.backgroundRepeat="no-repeat";Ea.style.backgroundPosition="-2px 50%";Ea.style.backgroundSize=-"20px";mxUtils.write(Ea,mxResources.get("property"));za.style.cursor="pointer";var pa=function(){var Ma=La.querySelectorAll(".gePropNonHeaderRow");if(qa.editorUi.propertiesCollapsed){Ea.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var y="none";for(var O=k.childNodes.length-1;0<=O;O--)try{var R=k.childNodes[O],V=R.nodeName.toUpperCase();"INPUT"!=V&&"SELECT"!=V||k.removeChild(R)}catch(fa){}}else Ea.style.backgroundImage="url('"+Editor.arrowDownImage+"')",y="";for(O=0;O<Ma.length;O++)Ma[O].style.display=-y};mxEvent.addListener(za,"click",function(){qa.editorUi.propertiesCollapsed=!qa.editorUi.propertiesCollapsed;pa()});za.appendChild(Ea);var Ca=document.createElement("th");Ca.className="gePropHeaderCell";Ca.style.paddingLeft="4px";mxUtils.write(Ca,mxResources.get("value"));za.appendChild(Ca);La.appendChild(za);var Aa=Ca=!1;za=null;1==I.vertices.length&&0==I.edges.length?za=I.vertices[0].id:0==I.vertices.length&&1==I.edges.length&&(za=I.edges[0].id);null==za||U||La.appendChild(ua("id",mxUtils.htmlEntities(za),-{dispName:"id",type:"readOnly"},!0,!1));for(var wa in B)if(U=B[wa],"function"!=typeof U.isVisible||U.isVisible(I,this)){var Ya=null!=U.getValue?U.getValue():null!=I.style[wa]?mxUtils.htmlEntities(I.style[wa]+""):null!=U.getDefaultValue?U.getDefaultValue(I,this):U.defVal;if("separator"==U.type)Aa=!Aa;else{if("staticArr"==U.type)U.size=parseInt(I.style[U.sizeProperty]||B[U.sizeProperty].defVal)||0;else if(null!=U.dependentProps){var Qa=U.dependentProps,Ra=[],Sa=[];for(za=0;za<Qa.length;za++){var Ha=-I.style[Qa[za]];Sa.push(B[Qa[za]].subDefVal);Ra.push(null!=Ha?Ha.split(","):[])}U.dependentPropsDefVal=Sa;U.dependentPropsVals=Ra}La.appendChild(ua(wa,Ya,U,Ca,Aa));Ca=!Ca}}for(za=0;za<ya.length;za++)for(U=ya[za],B=U.parentRow,I=0;I<U.values.length;I++)wa=ua(U.name,U.values[I],{type:U.type,parentRow:U.parentRow,isDeletable:U.isDeletable,index:I,defVal:U.defVal,countProperty:U.countProperty,size:U.size},0==I%2,U.flipBkg),B.parentNode.insertBefore(wa,B.nextSibling),B=wa;k.appendChild(La);pa();return k};-StyleFormatPanel.prototype.addStyles=function(k){if(null!=this.defaultColorSchemes){var B=this.editorUi,I=B.editor.graph,U=document.createElement("div");U.style.padding="6px 20px 0 24px";k.appendChild(U);var P=document.createElement("div");P.className="geSwitcher";P.style.padding="4px 18px 6px 0px";for(var T=[],X=0;X<this.defaultColorSchemes.length;X++){var Z=document.createElement("div");Z.className="geSwitcherDot";mxUtils.bind(this,function(Ba){mxEvent.addListener(Z,"click",mxUtils.bind(this,function(){ka(Ba)}))})(X);-T.push(Z);P.appendChild(Z)}var ka=mxUtils.bind(this,function(Ba){null!=T[Ba]&&(null!=this.format.currentScheme&&null!=T[this.format.currentScheme]&&(T[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=Ba,va(this.defaultColorSchemes[this.format.currentScheme]),T[this.format.currentScheme].style.background="#84d7ff")}),va=mxUtils.bind(this,function(Ba){var ya=mxUtils.clone(I.defaultVertexStyle);ya[mxConstants.STYLE_STROKECOLOR]=null!=ya[mxConstants.STYLE_STROKECOLOR]?-ya[mxConstants.STYLE_STROKECOLOR]:"default";ya[mxConstants.STYLE_FILLCOLOR]=null!=ya[mxConstants.STYLE_FILLCOLOR]?ya[mxConstants.STYLE_FILLCOLOR]:"default";ya[mxConstants.STYLE_FONTCOLOR]=null!=ya[mxConstants.STYLE_FONTCOLOR]?ya[mxConstants.STYLE_FONTCOLOR]:"default";I.replaceDefaultColors(new mxCell,ya);var La=mxUtils.bind(this,function(Ea){var pa=mxUtils.button("",mxUtils.bind(this,function(wa){I.getModel().beginUpdate();try{for(var Ya=B.getSelectionState().cells,Qa=0;Qa<Ya.length;Qa++){var Ra=-I.getModel().getStyle(Ya[Qa]);null!=Ea?(mxEvent.isShiftDown(wa)||(Ra=""==Ea.fill||null==Ea.fill?mxUtils.setStyle(Ra,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(Ra,mxConstants.STYLE_FILLCOLOR,Ea.fill),Ra=""==Ea.gradient||null==Ea.gradient?mxUtils.setStyle(Ra,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(Ra,mxConstants.STYLE_GRADIENTCOLOR,Ea.gradient),mxEvent.isControlDown(wa)||mxClient.IS_MAC&&mxEvent.isMetaDown(wa)||!I.getModel().isVertex(Ya[Qa])||(Ra=""==Ea.font||null==Ea.font?mxUtils.setStyle(Ra,-mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(Ra,mxConstants.STYLE_FONTCOLOR,Ea.font))),mxEvent.isAltDown(wa)||(Ra=""==Ea.stroke||null==Ea.fill?mxUtils.setStyle(Ra,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(Ra,mxConstants.STYLE_STROKECOLOR,Ea.stroke))):(Ra=mxUtils.setStyle(Ra,mxConstants.STYLE_FILLCOLOR,null),Ra=mxUtils.setStyle(Ra,mxConstants.STYLE_STROKECOLOR,null),Ra=mxUtils.setStyle(Ra,mxConstants.STYLE_GRADIENTCOLOR,null),I.getModel().isVertex(Ya[Qa])&&(Ra=mxUtils.setStyle(Ra,-mxConstants.STYLE_FONTCOLOR,null)));I.getModel().setStyle(Ya[Qa],Ra)}}finally{I.getModel().endUpdate()}}));pa.className="geStyleButton";pa.style.width="36px";pa.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";pa.style.margin="0px 6px 6px 0px";if(null!=Ea){var Ca="1px solid";null!=Ea.border&&(Ca=Ea.border);if(null!=Ea.gradient)pa.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(Ea.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(Ea.gradient).cssText+" 100%)";else if(Ea.fill==-mxConstants.NONE)pa.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==Ea.fill||""==Ea.fill)pa.style.backgroundColor=mxUtils.getLightDarkColor(mxUtils.getValue(ya,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var Aa=mxUtils.getLightDarkColor(Ea.fill);pa.style.backgroundImage="linear-gradient(to right bottom, "+Aa.cssText+" 50%, "+Aa.light+" 50.3%)"}null==Ea.stroke||Ea.stroke==mxConstants.NONE?pa.style.border=Ca+" transparent":""==Ea.stroke?pa.style.border="1px solid "+-mxUtils.getLightDarkColor(mxUtils.getValue(ya,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(Aa=mxUtils.getLightDarkColor(Ea.stroke),pa.style.border=Ca+" "+Aa.cssText,pa.style.borderRightColor=Aa.light,pa.style.borderBottomColor=pa.style.borderRightColor);null!=Ea.title&&pa.setAttribute("title",Ea.title)}else Ca=mxUtils.getValue(ya,mxConstants.STYLE_FILLCOLOR,"#ffffff"),Aa=mxUtils.getValue(ya,mxConstants.STYLE_STROKECOLOR,"#000000"),pa.style.backgroundColor=Ca,pa.style.border="1px solid "+Aa;-pa.style.borderRadius="0";U.appendChild(pa);null!=Ea&&null!=Ea.gradient&&(Ca=pa.cloneNode(!1),Ca.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(Ea.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(Ea.gradient).light+") 100%)",Ca.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",Ca.style.backgroundColor="transparent",U.appendChild(Ca),Ca.style.marginLeft="-42px",mxEvent.addListener(Ca,"click",function(){pa.click()}))});U.innerText=-"";if(null!=Ba)for(var za=0;za<Ba.length;za++)0<za&&0==mxUtils.mod(za,4)&&mxUtils.br(U),La(Ba[za])});null==this.format.currentScheme?ka(Math.min(T.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):ka(this.format.currentScheme);X=10>=this.defaultColorSchemes.length?43:23;var ua=document.createElement("div");ua.className="geButton";ua.style.cssText="position:absolute;left:0px;bottom:"+X+"px;width:20px;background-image:url("+Editor.chevronLeftImage+");";mxEvent.addListener(ua,"click",mxUtils.bind(this,-function(){ka(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var qa=document.createElement("div");qa.className="geButton";qa.style.cssText="position:absolute;left:186px;bottom:"+X+"px;width:20px;background-image:url("+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(k.appendChild(ua),k.appendChild(qa));mxEvent.addListener(qa,"click",mxUtils.bind(this,function(){ka(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));va(this.defaultColorSchemes[this.format.currentScheme]);-10>=this.defaultColorSchemes.length&&k.appendChild(P)}return k}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements={};Graph.isGoogleFontUrl=function(k){return k.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||k.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=-function(k){return Graph.isGoogleFontUrl(k)};Graph.rewriteGoogleFontUrl=function(k){null!=k&&k.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(k=Editor.GOOGLE_FONTS_CSS2+k.substring(Editor.GOOGLE_FONTS.length)+":wght@400;500");return k};Graph.createFontElement=function(k,B){var I=Graph.fontMapping[B];null==I&&Graph.isCssFontUrl(B)?(k=document.createElement("link"),k.setAttribute("rel","stylesheet"),k.setAttribute("type","text/css"),k.setAttribute("charset","UTF-8"),k.setAttribute("href",-Graph.rewriteGoogleFontUrl(B))):(null==I&&(I='@font-face {\nfont-family: "'+k+'";\nsrc: url("'+B+'");\n}'),k=document.createElement("style"),mxUtils.write(k,I));return k};Graph.addRecentCustomFont=function(k,B){};Graph.addFont=function(k,B,I){if(null!=k&&0<k.length&&null!=B&&0<B.length){var U=k.toLowerCase();if("helvetica"!=U&&"arial"!=k&&"sans-serif"!=U){var P=Graph.customFontElements[U];null!=P&&P.url!=B&&(P.elt.parentNode.removeChild(P.elt),P=null);null==P?(P=B,"http:"==B.substring(0,5)&&(P=PROXY_URL+-"?url="+encodeURIComponent(B)),P={name:k,url:B,elt:Graph.createFontElement(k,P)},Graph.customFontElements[U]=P,B=document.getElementsByTagName("head")[0],null!=I&&("link"==P.elt.nodeName.toLowerCase()?(P.elt.onload=I,P.elt.onerror=I):I()),null!=B&&B.appendChild(P.elt)):null!=I&&I()}else null!=I&&I()}else null!=I&&I();return k};Graph.getFontUrl=function(k,B){k=Graph.customFontElements[k.toLowerCase()];null!=k&&(B=k.url);return B};Graph.processFontAttributes=function(k){k=k.getElementsByTagName("*");-for(var B=0;B<k.length;B++){var I=k[B].getAttribute("data-font-src");if(null!=I){var U="FONT"==k[B].nodeName?k[B].getAttribute("face"):k[B].style.fontFamily;null!=U&&Graph.addFont(U,I)}}};Graph.processFontStyle=function(k){if(null!=k){var B=mxUtils.getValue(k,"fontSource",null);if(null!=B){var I=mxUtils.getValue(k,mxConstants.STYLE_FONTFAMILY,null);if(null!=I)try{Graph.addFont(I,decodeURIComponent(B))}catch(U){}}}return k};Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=-null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;Graph.prototype.shadowId="drawio-drop-shadow";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var t=Graph.prototype.init;Graph.prototype.init=function(){function k(P){B=P}t.apply(this,arguments);-this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var B=null;mxEvent.addListener(this.container,"mouseenter",k);mxEvent.addListener(this.container,"mousemove",k);mxEvent.addListener(this.container,"mouseleave",function(P){B=null});this.isMouseInsertPoint=function(){return null!=B};var I=this.getInsertPoint;this.getInsertPoint=function(){return null!=B?this.getPointForEvent(B):I.apply(this,arguments)};var U=this.layoutManager.getLayout;this.layoutManager.getLayout=function(P){var T=-this.graph.getCellStyle(P);if(null!=T&&"rack"==T.childLayout){var X=new mxStackLayout(this.graph,!1);X.gridSize=null!=T.rackUnitSize?parseFloat(T.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;X.marginLeft=T.marginLeft||0;X.marginRight=T.marginRight||0;X.marginTop=T.marginTop||0;X.marginBottom=T.marginBottom||0;X.allowGaps=T.allowGaps||0;X.horizontal="1"==mxUtils.getValue(T,"horizontalRack","0");X.resizeParent=!1;X.fill=!0;return X}return U.apply(this,arguments)};this.updateGlobalUrlVariables()};-var q=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(k,B){return Graph.processFontStyle(q.apply(this,arguments))};var D=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(k,B,I,U,P,T,X,Z,ka,va,ua,qa){D.apply(this,arguments);Graph.processFontAttributes(qa)};var G=mxText.prototype.redraw;mxText.prototype.redraw=function(){G.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};-Graph.prototype.createTagsDialog=function(k,B,I,U){function P(){for(var za=Z.getSelectionCells(),Ea=[],pa=0;pa<za.length;pa++)Z.isCellVisible(za[pa])&&Ea.push(za[pa]);Z.setSelectionCells(Ea)}function T(za){Z.setHiddenTags(za?[]:ka.slice());P();Z.refresh()}function X(za,Ea){ua.innerText="";if(0<za.length){var pa=document.createElement("table");pa.setAttribute("cellpadding","2");pa.style.boxSizing="border-box";pa.style.tableLayout="fixed";pa.style.width="100%";var Ca=document.createElement("tbody");-if(null!=za&&0<za.length)for(var Aa=0;Aa<za.length;Aa++)(function(wa){function Ya(){var y=Z.getCellsForTags([wa],null,null,!0);Z.isEnabled()?Z.setSelectionCells(y):Z.highlightCells(y,null,null,70)}var Qa=0>mxUtils.indexOf(Z.hiddenTags,wa),Ra=document.createElement("tr"),Sa=document.createElement("td");Sa.style.align="center";Sa.style.width="16px";var Ha=document.createElement("img");Ha.setAttribute("src",Qa?Editor.visibleImage:Editor.hiddenImage);Ha.setAttribute("title",mxResources.get(Qa?"hideIt":-"show",[wa]));mxUtils.setOpacity(Ha,Qa?75:25);Ha.className="geAdaptiveAsset";Ha.style.verticalAlign="middle";Ha.style.cursor="pointer";Ha.style.width="16px";if(B||Editor.isDarkMode())Ha.style.filter="invert(100%)";Sa.appendChild(Ha);mxEvent.addListener(Ha,"click",function(y){mxEvent.isShiftDown(y)?T(0<=mxUtils.indexOf(Z.hiddenTags,wa)):(Z.toggleHiddenTag(wa),P(),Z.refresh());mxEvent.consume(y)});Ra.appendChild(Sa);Sa=document.createElement("td");Sa.style.align="center";Sa.style.width="16px";Ha=document.createElement("img");-Ha.setAttribute("src",Editor.selectImage);Ha.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Ha,Qa?75:25);Ha.className="geAdaptiveAsset";Ha.style.verticalAlign="middle";Ha.style.cursor="pointer";Ha.style.width="16px";if(B||Editor.isDarkMode())Ha.style.filter="invert(100%)";mxEvent.addListener(Ha,"click",function(y){T(!0);Ya();mxEvent.consume(y)});Sa.appendChild(Ha);Ra.appendChild(Sa);Sa=document.createElement("td");Sa.style.overflow="hidden";Sa.style.whiteSpace="nowrap";Sa.style.textOverflow=-"ellipsis";Sa.style.verticalAlign="middle";Sa.style.cursor="pointer";Sa.setAttribute("title",wa);a=document.createElement("a");mxUtils.write(a,wa);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,Qa?100:40);Sa.appendChild(a);mxEvent.addListener(Sa,"click",function(y){if(mxEvent.isShiftDown(y))T(!0),Ya();else if(Qa&&0<Z.hiddenTags.length)T(!0);else{var O=ka.slice(),R=mxUtils.indexOf(O,wa);O.splice(R,1);Z.setHiddenTags(O);P();Z.refresh()}mxEvent.consume(y)});Ra.appendChild(Sa);-if(Z.isEnabled()){Sa=document.createElement("td");Sa.style.verticalAlign="middle";Sa.style.textAlign="center";Sa.style.width="18px";if(null==Ea){Sa.style.align="center";Sa.style.width="16px";Ha=document.createElement("img");Ha.setAttribute("src",Editor.trashImage);Ha.setAttribute("title",mxResources.get("removeIt",[wa]));mxUtils.setOpacity(Ha,Qa?75:25);Ha.className="geAdaptiveAsset";Ha.style.verticalAlign="middle";Ha.style.cursor="pointer";Ha.style.width="16px";if(B||Editor.isDarkMode())Ha.style.filter=-"invert(100%)";mxEvent.addListener(Ha,"click",function(y){var O=mxUtils.indexOf(ka,wa);0<=O&&ka.splice(O,1);Z.removeTagsForCells(Z.model.getDescendants(Z.model.getRoot()),[wa]);Z.refresh();mxEvent.consume(y)});Sa.appendChild(Ha)}else{var Ma=document.createElement("input");Ma.setAttribute("type","checkbox");Ma.style.margin="0px";Ma.defaultChecked=null!=Ea&&0<=mxUtils.indexOf(Ea,wa);Ma.checked=Ma.defaultChecked;Ma.style.background="transparent";Ma.setAttribute("title",mxResources.get(Ma.defaultChecked?-"removeIt":"add",[wa]));mxEvent.addListener(Ma,"change",function(y){Ma.checked?Z.addTagsForCells(Z.getSelectionCells(),[wa]):Z.removeTagsForCells(Z.getSelectionCells(),[wa]);mxEvent.consume(y)});Sa.appendChild(Ma)}Ra.appendChild(Sa)}Ca.appendChild(Ra)})(za[Aa]);pa.appendChild(Ca);ua.appendChild(pa)}}var Z=this,ka=Z.hiddenTags.slice(),va=document.createElement("div");va.style.userSelect="none";va.style.overflow="hidden";va.style.padding="10px";va.style.height="100%";var ua=document.createElement("div");-ua.style.position="absolute";ua.style.boxSizing="border-box";ua.style.userSelect="none";ua.style.overflow="auto";ua.style.padding="3px";ua.style.left="0px";ua.style.right="0px";ua.style.top="0px";ua.style.bottom="0px";va.appendChild(ua);Z.addListener(mxEvent.ROOT,function(){ka=Z.hiddenTags.slice()});var qa=mxUtils.bind(this,function(za,Ea){if(k()){za=Z.getAllTags();for(Ea=0;Ea<za.length;Ea++)0>mxUtils.indexOf(ka,za[Ea])&&ka.push(za[Ea]);ka.sort();Z.isSelectionEmpty()?X(ka):X(ka,Z.getCommonTagsForCells(Z.getSelectionCells()))}});-Z.selectionModel.addListener(mxEvent.CHANGE,qa);Z.model.addListener(mxEvent.CHANGE,qa);Z.addListener(mxEvent.REFRESH,qa);var Ba=document.createElement("div");Ba.className="geToolbarContainer geDialogToolbar";Ba.style.position="absolute";Ba.style.display="flex";Ba.style.bottom="0px";Ba.style.left="0px";Ba.style.right="0px";Ba.style.height="32px";Ba.style.overflow="hidden";Ba.style.padding="3px 4px 4px 4px";Ba.style.borderWidth="1px 0px 0px 0px";Ba.style.borderStyle="solid";Ba.style.whiteSpace="nowrap";-if(Z.isEnabled()){ua.style.bottom="32px";var ya=document.createElement("a");ya.className="geButton";var La=ya.cloneNode(!1);La.style.backgroundImage="url("+Editor.visibleImage+")";La.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(La,"click",function(za){Z.setHiddenTags([]);mxEvent.isShiftDown(za)||(ka=Z.hiddenTags.slice());P();Z.refresh();mxEvent.consume(za)});Ba.appendChild(La);null!=I&&(ya=ya.cloneNode(!1),ya.style.backgroundImage="url("+Editor.plusImage+")",ya.setAttribute("title",-mxResources.get("add")),mxEvent.addListener(ya,"click",function(za){I(ka,function(Ea){ka=Ea;qa()});mxEvent.consume(za)}),Ba.appendChild(ya));va.appendChild(Ba)}null!=U&&Ba.appendChild(U);return{div:va,refresh:qa}};Graph.prototype.getCustomFonts=function(){var k=this.extFonts;k=null!=k?k.slice():[];for(var B in Graph.customFontElements){var I=Graph.customFontElements[B];k.push({name:I.name,url:I.url})}return k};Graph.prototype.setFont=function(k,B){Graph.addFont(k,B);var I=Editor.guid();document.execCommand("fontname",-!1,I);for(var U=this.cellEditor.textarea.getElementsByTagName("font"),P=!1,T=0;T<U.length;T++)U[T].getAttribute("face")==I&&(P=!0,U[T].setAttribute("face",k),null!=B?U[T].setAttribute("data-font-src",B):U[T].removeAttribute("data-font-src"));P||document.execCommand("fontname",!1,k)};var N=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return N.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=-Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var k=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=k)for(var B in k)this.globalVars[B]=k[B]}catch(I){null!=window.console&&console.log("Error in vars URL parameter: "+I)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var L=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(k){var B=-L.apply(this,arguments);null==B&&null!=this.globalVars&&(B=this.globalVars[k]);return B};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var k=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(k.ownerDocument)).decode(k)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var J=Graph.prototype.getSvg;Graph.prototype.getSvg=function(k,B,I,U,P,T,X,Z,ka,va,ua,qa,Ba,ya,La,za){var Ea=J.apply(this,arguments);if(null!=-qa){var pa=Ea.getAttribute("style");null==pa&&(pa="");qa="auto"==qa||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":qa;Ea.setAttribute("style",pa+(" color-scheme: "+qa+";"))}var Ca=this.getCustomFonts();if(ua&&0<Ca.length){var Aa=Ea.ownerDocument;pa=null!=Aa.createElementNS?Aa.createElementNS(mxConstants.NS_SVG,"style"):Aa.createElement("style");null!=Aa.setAttributeNS?pa.setAttributeNS("type","text/css"):pa.setAttribute("type","text/css");for(var wa="",Ya=-"",Qa=0;Qa<Ca.length;Qa++){var Ra=Ca[Qa].name,Sa=Ca[Qa].url;Graph.isCssFontUrl(Sa)?wa+="@import url("+Graph.rewriteGoogleFontUrl(Sa)+");\n":Ya+='@font-face {\nfont-family: "'+Ra+'";\nsrc: url("'+Sa+'");\n}\n'}pa.appendChild(Aa.createTextNode(wa+Ya));Ea.getElementsByTagName("defs")[0].appendChild(pa)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(Ea);this.mathEnabled&&(document.body.appendChild(Ea),Editor.MathJaxRender(Ea),Ea.parentNode.removeChild(Ea),-pa=Ea.ownerDocument.getElementById("MJX-SVG-styles"),null!=pa&&Ea.getElementsByTagName("defs")[0].appendChild(pa.cloneNode(!0)));return Ea};var Y=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(k){Y.apply(this,arguments);null!=k.secondLabel&&(k.secondLabel.destroy(),k.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(k){return[k.shape,k.text,k.secondLabel,k.control]};var ha=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=-function(){ha.apply(this,arguments);this.enumerationState=0};var ea=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(k){null!=k.shape&&this.redrawEnumerationState(k);return ea.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(k){k=decodeURIComponent(mxUtils.getValue(k.style,"enumerateValue",""));""==k&&(k=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(k)+-"</div>"};mxGraphView.prototype.redrawEnumerationState=function(k){var B="1"==mxUtils.getValue(k.style,"enumerate",0);B&&null==k.secondLabel?(k.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),k.secondLabel.size=12,k.secondLabel.state=k,k.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(k,k.secondLabel)):B||null==k.secondLabel||(k.secondLabel.destroy(),k.secondLabel=null);B=k.secondLabel;if(null!=B){var I=k.view.scale,-U=this.createEnumerationValue(k);k=this.graph.model.isVertex(k.cell)?new mxRectangle(k.x+k.width-4*I,k.y+4*I,0,0):mxRectangle.fromPoint(k.view.getPoint(k));B.bounds.equals(k)&&B.value==U&&B.scale==I||(B.bounds=k,B.value=U,B.scale=I,B.redraw())}};var aa=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();aa.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),-this.view.validateBackgroundImage())};var na=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){na.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(k,B){"data:action/json,"==k.substring(0,17)&&(k=JSON.parse(k.substring(17)),null!=k.actions&&this.executeCustomActions(k.actions,null,B))};Graph.prototype.executeCustomActions=function(k,B,I){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&&-window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=!0;var U=!1,P=0,T=0,X=mxUtils.bind(this,function(){U||(U=!0,this.model.beginUpdate())}),Z=mxUtils.bind(this,function(){U&&(U=!1,this.model.endUpdate())}),ka=mxUtils.bind(this,function(){0<P&&P--;0==P&&va()}),va=mxUtils.bind(this,function(){if(T<k.length){var ua=this.stoppingCustomActions,qa=-k[T++],Ba=[];if(null!=qa.open)if(Z(),this.isCustomLink(qa.open)){if(!this.customLinkClicked(qa.open,I))return}else this.openLink(qa.open);null==qa.wait||ua||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;ka()}),P++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=qa.wait?parseInt(qa.wait):1E3),Z());null!=qa.opacity&&null!=qa.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(qa.opacity,-!0)),qa.opacity.value);null!=qa.fadeIn&&(P++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(qa.fadeIn,!0)),0,1,ka,ua?0:qa.fadeIn.delay));null!=qa.fadeOut&&(P++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(qa.fadeOut,!0)),1,0,ka,ua?0:qa.fadeOut.delay));null!=qa.wipeIn&&(Ba=Ba.concat(this.createWipeAnimations(this.getCellsForAction(qa.wipeIn,!0),!0)));null!=qa.wipeOut&&(Ba=Ba.concat(this.createWipeAnimations(this.getCellsForAction(qa.wipeOut,!0),!1)));null!=qa.toggle&&-(X(),this.toggleCells(this.getCellsForAction(qa.toggle,!0)));if(null!=qa.show){X();var ya=this.getCellsForAction(qa.show,!0);Graph.setOpacityForNodes(this.getNodesForCells(ya),1);this.setCellsVisible(ya,!0)}null!=qa.hide&&(X(),ya=this.getCellsForAction(qa.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(ya),0),this.setCellsVisible(ya,!1));null!=qa.toggleStyle&&null!=qa.toggleStyle.key&&(X(),this.toggleCellStyles(qa.toggleStyle.key,null!=qa.toggleStyle.defaultValue?qa.toggleStyle.defaultValue:-"0",this.getCellsForAction(qa.toggleStyle,!0)));null!=qa.style&&null!=qa.style.key&&(X(),this.setCellStyles(qa.style.key,qa.style.value,this.getCellsForAction(qa.style,!0)));ya=[];null!=qa.select&&this.isEnabled()&&(ya=this.getCellsForAction(qa.select),this.setSelectionCells(ya));null!=qa.highlight&&(ya=this.getCellsForAction(qa.highlight),this.highlightCells(ya,qa.highlight.color,qa.highlight.duration,qa.highlight.opacity));null!=qa.scroll&&(ya=this.getCellsForAction(qa.scroll));null!=qa.viewbox&&-this.fitWindow(qa.viewbox,qa.viewbox.border);0<ya.length&&this.scrollCellToVisible(ya[0]);null!=I&&null!=qa.explore&&Graph.exploreFromCell(this,I,qa.explore);if(null!=qa.tags){if(null!=qa.tags.toggle){var La=qa.tags.toggle;0==La.length&&(La=this.getAllTags());for(ya=0;ya<La.length;ya++)this.toggleHiddenTag(La[ya])}La=null;null!=qa.tags.hidden&&(null==La&&(La=[]),La=La.concat(qa.tags.hidden));if(null!=qa.tags.visible){null==La&&(La=[]);var za=this.getAllTags();for(ya=0;ya<za.length;ya++)0>mxUtils.indexOf(qa.tags.visible,-za[ya])&&0>mxUtils.indexOf(La,za[ya])&&La.push(za[ya])}null!=La&&this.setHiddenTags(La);this.refresh()}0<Ba.length&&(P++,this.executeAnimations(Ba,ka,ua?1:qa.steps,ua?0:qa.delay));0==P?va():Z()}else this.stoppingCustomActions=this.executingCustomActions=!1,Z(),null!=B&&B()});va()}};Graph.prototype.doUpdateCustomLinksForCell=function(k,B){var I=this.getLinkForCell(B);null!=I&&"data:action/json,"==I.substring(0,17)&&this.setLinkForCell(B,this.updateCustomLink(k,I));if(this.isHtmlLabel(B)){var U=document.createElement("div");-U.innerHTML=Graph.sanitizeHtml(this.getLabel(B));for(var P=U.getElementsByTagName("a"),T=!1,X=0;X<P.length;X++)I=P[X].getAttribute("href"),null!=I&&"data:action/json,"==I.substring(0,17)&&(P[X].setAttribute("href",this.updateCustomLink(k,I)),T=!0);T&&this.labelChanged(B,U.innerHTML)}};Graph.prototype.updateCustomLink=function(k,B){if("data:action/json,"==B.substring(0,17))try{var I=JSON.parse(B.substring(17));null!=I.actions&&(this.updateCustomLinkActions(k,I.actions),B="data:action/json,"+JSON.stringify(I))}catch(U){}return B};-Graph.prototype.updateCustomLinkActions=function(k,B){for(var I=0;I<B.length;I++){var U=B[I],P;for(P in U)this.updateCustomLinkAction(k,U[P],"cells"),this.updateCustomLinkAction(k,U[P],"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(k,B,I){if(null!=B&&null!=B[I]){for(var U=[],P=0;P<B[I].length;P++)if("*"==B[I][P])U.push(B[I][P]);else{var T=k[B[I][P]];null!=T?""!=T&&U.push(T):U.push(B[I][P])}B[I]=U}};Graph.prototype.getCellsForAction=function(k,B){B=this.getCellsById(k.cells).concat(this.getCellsForTags(k.tags,-null,B));if(null!=k.excludeCells){for(var I=[],U=0;U<B.length;U++)0>k.excludeCells.indexOf(B[U].id)&&I.push(B[U]);B=I}return B};Graph.prototype.getCellsById=function(k){var B=[];if(null!=k)for(var I=0;I<k.length;I++)if("*"==k[I]){var U=this.model.getRoot();B=B.concat(this.model.filterDescendants(function(T){return T!=U},U))}else{var P=this.model.getCell(k[I]);null!=P&&B.push(P)}return B};var W=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(k){return W.apply(this,arguments)&&-!this.isAllTagsHidden(this.getTagsForCell(k))};Graph.prototype.setHiddenTags=function(k){this.hiddenTags=k;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(k){var B=mxUtils.indexOf(this.hiddenTags,k);0>B?this.hiddenTags.push(k):0<=B&&this.hiddenTags.splice(B,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(k){if(null==k||0==k.length||0==this.hiddenTags.length)return!1;k=k.split(" ");if(k.length>this.hiddenTags.length)return!1;-for(var B=0;B<k.length;B++)if(0>mxUtils.indexOf(this.hiddenTags,k[B]))return!1;return!0};Graph.prototype.getCellsForTags=function(k,B,I,U){var P=[];if(null!=k){B=null!=B?B:this.model.getDescendants(this.model.getRoot());for(var T=0,X={},Z=0;Z<k.length;Z++)0<k[Z].length&&(X[k[Z]]=!0,T++);for(Z=0;Z<B.length;Z++)if(I&&this.model.getParent(B[Z])==this.model.root||this.model.isVertex(B[Z])||this.model.isEdge(B[Z])){var ka=this.getTagsForCell(B[Z]),va=!1;if(0<ka.length&&(ka=ka.split(" "),ka.length>=k.length)){for(var ua=-va=0;ua<ka.length&&va<T;ua++)null!=X[ka[ua]]&&va++;va=va==T}va&&(1!=U||this.isCellVisible(B[Z]))&&P.push(B[Z])}}return P};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(k){for(var B=null,I=[],U=0;U<k.length;U++){var P=this.getTagsForCell(k[U]);I=[];if(0<P.length){P=P.split(" ");for(var T={},X=0;X<P.length;X++)if(null==B||null!=B[P[X]])T[P[X]]=!0,I.push(P[X]);B=T}else return[]}return I};-Graph.prototype.getTagsForCells=function(k){for(var B=[],I={},U=0;U<k.length;U++){var P=this.getTagsForCell(k[U]);if(0<P.length){P=P.split(" ");for(var T=0;T<P.length;T++)null==I[P[T]]&&(I[P[T]]=!0,B.push(P[T]))}}return B};Graph.prototype.getTagsForCell=function(k){return this.getAttributeForCell(k,"tags","")};Graph.prototype.addTagsForCells=function(k,B){if(0<k.length&&0<B.length){this.model.beginUpdate();try{for(var I=0;I<k.length;I++){for(var U=this.getTagsForCell(k[I]),P=U.split(" "),T=!1,X=0;X<-B.length;X++){var Z=mxUtils.trim(B[X]);""!=Z&&0>mxUtils.indexOf(P,Z)&&(U=0<U.length?U+" "+Z:Z,T=!0)}T&&this.setAttributeForCell(k[I],"tags",U)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(k,B){if(0<k.length&&0<B.length){this.model.beginUpdate();try{for(var I=0;I<k.length;I++){var U=this.getTagsForCell(k[I]);if(0<U.length){for(var P=U.split(" "),T=!1,X=0;X<B.length;X++){var Z=mxUtils.indexOf(P,B[X]);0<=Z&&(P.splice(Z,1),T=!0)}T&&this.setAttributeForCell(k[I],"tags",-P.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(k){this.model.beginUpdate();try{for(var B=0;B<k.length;B++)this.model.setVisible(k[B],!this.model.isVisible(k[B]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(k,B){this.model.beginUpdate();try{for(var I=0;I<k.length;I++)this.model.setVisible(k[I],B)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(k,B,I,U){for(var P=0;P<k.length;P++)this.highlightCell(k[P],B,-I,U)};Graph.prototype.highlightCell=function(k,B,I,U,P){B=null!=B?B:mxConstants.DEFAULT_VALID_COLOR;I=null!=I?I:1E3;k=this.view.getState(k);var T=null;null!=k&&(P=null!=P?P:4,P=Math.max(P+1,mxUtils.getValue(k.style,mxConstants.STYLE_STROKEWIDTH,1)+P),T=new mxCellHighlight(this,B,P,!1),null!=U&&(T.opacity=U),T.highlight(k),window.setTimeout(function(){null!=T.shape&&(mxUtils.setPrefixedStyle(T.shape.node.style,"transition","all 1200ms ease-in-out"),T.shape.node.style.opacity=0);window.setTimeout(function(){T.destroy()},-1200)},I));return T};Graph.prototype.addSvgShadow=function(k,B,I,U){I=null!=I?I:!1;U=null!=U?U:!0;var P=k.ownerDocument,T=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"filter"):P.createElement("filter");T.setAttribute("id",this.shadowId);var X=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):P.createElement("feGaussianBlur");X.setAttribute("in","SourceAlpha");X.setAttribute("stdDeviation",this.svgShadowBlur);X.setAttribute("result","blur");T.appendChild(X);-X=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feOffset"):P.createElement("feOffset");X.setAttribute("in","blur");X.setAttribute("dx",this.svgShadowSize);X.setAttribute("dy",this.svgShadowSize);X.setAttribute("result","offsetBlur");T.appendChild(X);X=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feFlood"):P.createElement("feFlood");X.setAttribute("flood-color",this.svgShadowColor);X.setAttribute("flood-opacity",this.svgShadowOpacity);X.setAttribute("result","offsetColor");-T.appendChild(X);X=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feComposite"):P.createElement("feComposite");X.setAttribute("in","offsetColor");X.setAttribute("in2","offsetBlur");X.setAttribute("operator","in");X.setAttribute("result","offsetBlur");T.appendChild(X);X=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feBlend"):P.createElement("feBlend");X.setAttribute("in","SourceGraphic");X.setAttribute("in2","offsetBlur");T.appendChild(X);X=k.getElementsByTagName("defs");-0==X.length?(P=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"defs"):P.createElement("defs"),null!=k.firstChild?k.insertBefore(P,k.firstChild):k.appendChild(P)):P=X[0];P.appendChild(T);I||(B=null!=B?B:k.getElementsByTagName("g")[0],null!=B&&(B.setAttribute("filter","url(#"+this.shadowId+")"),!isNaN(parseInt(k.getAttribute("width")))&&U&&(k.setAttribute("width",parseInt(k.getAttribute("width"))+6),k.setAttribute("height",parseInt(k.getAttribute("height"))+6),B=k.getAttribute("viewBox"),-null!=B&&0<B.length&&(B=B.split(" "),3<B.length&&(w=parseFloat(B[2])+6,h=parseFloat(B[3])+6,k.setAttribute("viewBox",B[0]+" "+B[1]+" "+w+" "+h))))));return T};Graph.prototype.setShadowVisible=function(k,B){mxClient.IS_SVG&&!mxClient.IS_SF&&(B=null!=B?B:!0,(this.shadowVisible=k)?this.view.getDrawPane().setAttribute("filter","url(#"+this.shadowId+")"):this.view.getDrawPane().removeAttribute("filter"),B&&this.fireEvent(new mxEventObject("shadowVisibleChanged")))};Graph.prototype.checkDefaultParent=function(){null==-this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var k=this.model.getChildCount(this.model.root),B=0;do var I=this.model.getChildAt(this.model.root,B);while(B++<k&&"1"==mxUtils.getValue(this.getCellStyle(I),"locked","0"));null!=I&&this.setDefaultParent(I)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=-[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=[SHAPES_PATH+"/mxCisco19.js",STENCIL_PATH+-"/cisco19.xml"];mxStencilRegistry.libraries.cisco_safe=[SHAPES_PATH+"/mxCiscoSafe.js",STENCIL_PATH+"/cisco_safe/architecture.xml",STENCIL_PATH+"/cisco_safe/business_icons.xml",STENCIL_PATH+"/cisco_safe/capability.xml",STENCIL_PATH+"/cisco_safe/design.xml",STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",STENCIL_PATH+"/cisco_safe/people_places_things_icons.xml",STENCIL_PATH+"/cisco_safe/security_icons.xml",STENCIL_PATH+"/cisco_safe/technology_icons.xml",STENCIL_PATH+"/cisco_safe/threat.xml"];mxStencilRegistry.libraries.dfd=-[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.kubernetes=[SHAPES_PATH+"/mxKubernetes.js",STENCIL_PATH+"/kubernetes.xml",STENCIL_PATH+"/kubernetes2.xml"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=-[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/abstract"]=-[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/miscellaneous"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/miscellaneous.xml"];mxStencilRegistry.libraries["electrical/signal_sources"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/signal_sources.xml"];mxStencilRegistry.libraries["electrical/electro-mechanical"]=-[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/electro-mechanical.xml"];mxStencilRegistry.libraries["electrical/transmission"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries.infographic=[SHAPES_PATH+"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries["mockup/containers"]=[SHAPES_PATH+"/mockup/mxMockupContainers.js"];mxStencilRegistry.libraries["mockup/forms"]=-[SHAPES_PATH+"/mockup/mxMockupForms.js"];mxStencilRegistry.libraries["mockup/graphics"]=[SHAPES_PATH+"/mockup/mxMockupGraphics.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/markup"]=[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=-[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.ibm=[SHAPES_PATH+"/mxIBM.js",STENCIL_PATH+-"/ibm.xml"];mxStencilRegistry.libraries.ibmcloud=[STENCIL_PATH+"/ibm_cloud.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=-[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=[SHAPES_PATH+"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];-mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=-[STENCIL_PATH+"/salesforce.xml"];mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(k){var B=null;null!=k&&0<k.length&&("ER"==k.substring(0,2)?B="mxgraph.er":"sysML"==k.substring(0,5)&&(B="mxgraph.sysml"));return B};var ba=mxMarker.createMarker;mxMarker.createMarker=function(k,B,I,U,P,T,X,Z,ka,va){if(null!=I&&null==mxMarker.markers[I]){var ua=this.getPackageForType(I);-null!=ua&&mxStencilRegistry.getStencil(ua)}return ba.apply(this,arguments)};var ja=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(k,B,I,U,P,T){"1"==mxUtils.getValue(B.style,"lineShape",null)&&k.setFillColor(mxUtils.getValue(B.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return ja.apply(this,arguments)};PrintDialog.prototype.create=function(k,B,I,U){function P(){La.value=Math.max(1,Math.min(ua,Math.max(parseInt(La.value),parseInt(ya.value))));ya.value=Math.max(1,Math.min(ua,-Math.min(parseInt(La.value),parseInt(ya.value))))}function T(Da){k.lastPrintPagesRadioChecked=Ba.checked;k.lastPrintSelectionOnlyChecked=Ea.checked;k.lastPrintCropRadioChecked=Ca.checked;k.lastPrintFitRadioChecked=Aa.checked;Ba.checked&&ya.value<La.value?(k.lastPrintPagesFromInput=ya.value,k.lastPrintPagesToInput=La.value):(k.lastPrintPagesFromInput=null,k.lastPrintPagesToInput=null);fa.value=Math.max(1,Math.min(1600,parseInt(fa.value)))+"%";k.lastPrintZoom=fa.value;k.lastPrintBorder=V.value;k.lastPrintGrid=-ia.checked;k.lastPrintTransparent=oa.checked;k.lastPrintInclude=ta.checked;k.lastPrintSheetsAcross=O.value;k.lastPrintSheetsDown=R.value;var Ia={};Ia.border=parseInt(V.value);Ia.scale=parseInt(fa.value)/100;Ia.grid=ia.checked;Ia.transparent=oa.checked;Ia.includeCopy=ta.checked;Ia.sheetsAcross=parseInt(O.value);Ia.sheetsDown=parseInt(R.value);Ia.pagesFrom=parseInt(ya.value);Ia.pagesTo=parseInt(La.value);Ia.allPages=qa.checked;Ia.selection=Ea.checked;Ia.pageView=pa.checked;Ia.crop=Ca.checked;Ia.fit=-Aa.checked;return null!=I?I(!Da,Ia):k.print(!Da,Ia)}var X=k.editor.graph,Z=document.createElement("div"),ka=document.createElement("h3");ka.style.width="100%";ka.style.textAlign="center";ka.style.marginTop="0px";mxUtils.write(ka,B||mxResources.get("print"));Z.appendChild(ka);var va=1,ua=1;ka=document.createElement("div");ka.style.whiteSpace="nowrap";var qa=document.createElement("input");qa.style.marginRight="8px";qa.style.marginBottom="8px";qa.setAttribute("type","radio");qa.setAttribute("name",-"pages-printdialog");ka.appendChild(qa);B=document.createElement("span");mxUtils.write(B,mxResources.get("allPages"));mxEvent.addListener(B,"click",function(){qa.checked=!0});ka.appendChild(B);mxUtils.br(ka);var Ba=qa.cloneNode(!0);ka.appendChild(Ba);B=document.createElement("span");mxUtils.write(B,mxResources.get("pages")+":");ka.appendChild(B);mxEvent.addListener(B,"click",function(){Ba.checked=!0});var ya=document.createElement("input");ya.style.margin="0 4px";ya.setAttribute("value","1");ya.setAttribute("type",-"number");ya.setAttribute("min","1");ya.style.width="40px";ka.appendChild(ya);B=document.createElement("span");mxUtils.write(B,mxResources.get("to"));ka.appendChild(B);var La=ya.cloneNode(!0);ka.appendChild(La);mxEvent.addListener(ya,"focus",function(){Ba.checked=!0});mxEvent.addListener(La,"focus",function(){Ba.checked=!0});mxEvent.addListener(ya,"change",P);mxEvent.addListener(La,"change",P);if(null!=k.pages&&(ua=k.pages.length,null!=k.currentPage))for(var za=0;za<ua;za++)if(k.currentPage==k.pages[za]){va=-za+1;break}null!=k.lastPrintPagesFromInput&&null!=k.lastPrintPagesToInput?(ya.value=Math.min(ua,Math.max(1,k.lastPrintPagesFromInput)),La.value=Math.min(ua,Math.max(1,k.lastPrintPagesToInput))):(ya.value=va,La.value=va);ya.setAttribute("max",ua);La.setAttribute("max",ua);za=mxUtils.button(mxResources.get("currentPage"),function(Da){ya.value=va;La.value=va;Ba.checked=!0});za.setAttribute("title",mxResources.get("currentPage"));za.style.marginLeft="4px";za.style.maxWidth="100px";za.style.overflow="hidden";-za.style.textOverflow="ellipsis";za.style.whiteSpace="nowrap";ka.appendChild(za);1<ua&&Z.appendChild(ka);ka=document.createElement("div");ka.style.borderBottom="1px solid lightGray";ka.style.paddingBottom="12px";ka.style.marginBottom="12px";ka.style.whiteSpace="nowrap";var Ea=document.createElement("input");Ea.setAttribute("name","pages-printdialog");Ea.setAttribute("type",1==ua?"checkbox":"radio");Ea.style.marginRight="8px";X.isSelectionEmpty()&&Ea.setAttribute("disabled","disabled");X.isEnabled()&&-(ka.appendChild(Ea),B=document.createElement("span"),mxUtils.write(B,mxResources.get("selectionOnly")),ka.appendChild(B));(X.isEnabled()||1<ua)&&Z.appendChild(ka);!k.isPagesEnabled()||k.lastPrintPagesRadioChecked?Ba.checked=!0:!X.isSelectionEmpty()&&k.lastPrintSelectionOnlyChecked?Ea.checked=!0:qa.checked=!0;X.isSelectionEmpty()||mxEvent.addListener(B,"click",function(){Ea.checked=!Ea.checked});X=document.createElement("div");X.style.whiteSpace="nowrap";var pa=document.createElement("input");pa.style.marginBottom=-"8px";pa.style.marginRight="8px";pa.setAttribute("type","radio");pa.setAttribute("name","printSize");X.appendChild(pa);B=document.createElement("span");mxUtils.write(B,mxResources.get("pageView"));X.appendChild(B);mxEvent.addListener(X,"click",function(){pa.checked=!0});Z.appendChild(X);X=document.createElement("div");X.style.whiteSpace="nowrap";var Ca=document.createElement("input");Ca.style.marginBottom="8px";Ca.style.marginRight="8px";Ca.setAttribute("type","radio");Ca.setAttribute("name","printSize");-X.appendChild(Ca);B=document.createElement("span");mxUtils.write(B,mxResources.get("crop"));X.appendChild(B);mxEvent.addListener(X,"click",function(){Ca.checked=!0});Z.appendChild(X);X=document.createElement("div");X.style.whiteSpace="nowrap";var Aa=document.createElement("input");Aa.style.marginBottom="8px";Aa.style.marginRight="8px";Aa.setAttribute("type","radio");Aa.setAttribute("name","printSize");B=document.createElement("div");B.style.display="inline-block";B.style.verticalAlign="top";B.style.paddingTop=-"2px";B.appendChild(Aa);X.appendChild(B);ka=document.createElement("table");ka.style.display="inline-block";ka.style.borderSpacing="0";za=document.createElement("tbody");var wa=document.createElement("tr"),Ya=wa.cloneNode(!0),Qa=document.createElement("td"),Ra=Qa.cloneNode(!0),Sa=Qa.cloneNode(!0),Ha=Qa.cloneNode(!0),Ma=Qa.cloneNode(!0),y=Qa.cloneNode(!0);Qa.style.textAlign="right";Ha.style.textAlign="right";mxUtils.write(Qa,mxResources.get("fitTo"));mxEvent.addListener(X,"click",function(Da){mxEvent.getSource(Da)!=-Aa&&(Aa.checked=!Aa.checked)});var O=document.createElement("input");O.style.margin="0 2px";O.style.boxSizing="border-box";O.setAttribute("value",k.lastPrintSheetsAcross||"1");O.setAttribute("min","1");O.setAttribute("type","number");O.style.width="40px";Ra.appendChild(O);B=document.createElement("span");mxUtils.write(B,mxResources.get("fitToSheetsAcross"));Sa.appendChild(B);mxUtils.write(Ha,mxResources.get("fitToBy"));var R=O.cloneNode(!0);R.setAttribute("value",k.lastPrintSheetsDown||"1");Ma.appendChild(R);-mxEvent.addListener(O,"click",function(Da){Aa.checked=!0;mxEvent.consume(Da)});mxEvent.addListener(R,"click",function(Da){Aa.checked=!0;mxEvent.consume(Da)});k.lastPrintCropRadioChecked?Ca.checked=!0:k.lastPrintFitRadioChecked?Aa.checked=!0:pa.checked=!0;B=document.createElement("span");mxUtils.write(B,mxResources.get("fitToSheetsDown"));y.appendChild(B);wa.appendChild(Qa);wa.appendChild(Ra);wa.appendChild(Sa);Ya.appendChild(Ha);Ya.appendChild(Ma);Ya.appendChild(y);za.appendChild(wa);za.appendChild(Ya);-ka.appendChild(za);X.appendChild(ka);Z.appendChild(X);X=document.createElement("div");X.style.borderTop="1px solid lightGray";X.style.whiteSpace="nowrap";X.style.paddingTop="12px";X.style.marginTop="12px";X.style.paddingLeft="8px";mxUtils.write(X,mxResources.get("borderWidth")+":");var V=document.createElement("input");V.setAttribute("type","number");V.setAttribute("min","0");V.style.width="40px";V.style.marginLeft="4px";V.value=null!=k.lastPrintBorder?k.lastPrintBorder:mxPrintPreview.prototype.pageMargin;-X.appendChild(V);B=document.createElement("span");B.style.marginLeft="8px";mxUtils.write(B,mxResources.get("zoom")+":");X.appendChild(B);var fa=document.createElement("input");fa.style.width="60px";fa.style.marginLeft="4px";fa.value=null!=k.lastPrintZoom?k.lastPrintZoom:"100%";X.appendChild(fa);mxUtils.br(X);var ia=document.createElement("input");ia.setAttribute("type","checkbox");ia.style.marginTop="12px";ia.checked=null!=k.lastPrintGrid?k.lastPrintGrid:!1;X.appendChild(ia);B=document.createElement("span");-B.style.marginLeft="4px";B.style.marginRight="8px";mxUtils.write(B,mxResources.get("grid"));X.appendChild(B);mxEvent.addListener(B,"click",function(Da){ia.checked=!0;mxEvent.consume(Da)});var oa=document.createElement("input");oa.setAttribute("type","checkbox");oa.style.marginTop="10px";oa.checked=null!=k.lastPrintTransparent?k.lastPrintTransparent:!1;null!=I&&(X.appendChild(oa),B=document.createElement("span"),B.style.marginLeft="4px",mxUtils.write(B,mxResources.get("transparentBackground")),X.appendChild(B),-mxEvent.addListener(B,"click",function(Da){oa.checked=!0;mxEvent.consume(Da)}));var ta=document.createElement("input");ta.setAttribute("type","checkbox");ta.style.marginTop="10px";ta.checked=null!=k.lastPrintInclude?k.lastPrintInclude:Editor.defaultIncludeDiagram;null==I||mxClient.IS_CHROMEAPP||"draw.io"!=k.getServiceName()||(mxUtils.br(X),X.appendChild(ta),B=document.createElement("span"),B.style.marginLeft="4px",mxUtils.write(B,mxResources.get("includeCopyOfMyDiagram")),X.appendChild(B),mxEvent.addListener(B,-"click",function(Da){ta.checked=!0;mxEvent.consume(Da)}));Z.appendChild(X);B=document.createElement("div");B.style.marginTop="40px";B.style.textAlign="right";B.style.whiteSpace="nowrap";k.isOffline()||null!=I||B.appendChild(k.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));X=mxUtils.button(mxResources.get("cancel"),function(){k.hideDialog()});X.className="geBtn";k.editor.cancelFirst&&B.appendChild(X);PrintDialog.previewEnabled&&null==I&&(ka=mxUtils.button(mxResources.get("preview"),-function(){try{k.hideDialog(),T(!1)}catch(Da){k.handleError(Da)}}),ka.className="geBtn",B.appendChild(ka));U=null!=U?U:null!=I?"export":PrintDialog.previewEnabled?"print":"ok";U=mxUtils.button(mxResources.get(U),function(){try{k.hideDialog(),T(!0)}catch(Da){k.handleError(Da)}});U.className="geBtn gePrimaryBtn";B.appendChild(U);k.editor.cancelFirst||B.appendChild(X);Z.appendChild(B);if(k.editor.isChromelessView()){var ra=function(){Editor.isDarkMode()?(Z.classList.add("geDarkMode"),Z.style.colorScheme=-"dark"):(Z.classList.remove("geDarkMode"),Z.style.colorScheme="light")};k.addListener("darkModeChanged",ra);ra();var xa=function(Da,Ia){Da=Ia.getProperty("dialog");Z.parentNode==Da.container&&(k.editor.removeListener(xa),k.removeListener(ra))};k.editor.addListener("hideDialog",xa)}this.container=Z};var ca=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);if(this.page!=this.ui.currentPage){if(null!=this.page.viewState){this.ignoreColor||-(this.page.viewState.background=this.color);if(!this.ignoreImage){var k=this.image;null!=k&&null!=k.src&&Graph.isPageLink(k.src)&&(k={originalSrc:k.src});this.page.viewState.backgroundImage=k}null!=this.format&&(this.page.viewState.pageFormat=this.format);null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled);null!=this.adaptiveColors&&(this.page.viewState.adaptiveColors=this.adaptiveColors);null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)}}else ca.apply(this,-arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.adaptiveColors&&this.adaptiveColors!=this.ui.editor.graph.adaptiveColors&&(k=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=k?k:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),-this.shadowVisible=!this.shadowVisible)};Editor.prototype.useCanvasForExport=!1;try{var la=document.createElement("canvas"),Q=new Image;Q.onload=function(){try{la.getContext("2d").drawImage(Q,0,0);var k=la.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=k&&6<k.length}catch(B){}};Q.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(k){}Editor.prototype.useCanvasForExport=-!1})();(function(){var b=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);b.beforeDecode=function(e,g,m){m.ui=e.ui;return g};b.afterDecode=function(e,g,m){m.previousColor=m.color;m.previousImage=m.image;m.previousFormat=m.format;m.previousAdaptiveColors=m.adaptiveColors;null!=m.foldingEnabled&&(m.foldingEnabled=!m.foldingEnabled);null!=m.mathEnabled&&(m.mathEnabled=!m.mathEnabled);null!=m.shadowVisible&&(m.shadowVisible=!m.shadowVisible);return m};mxCodecRegistry.register(b)})();-(function(){var b=new mxObjectCodec(new ChangeGridColor,["ui"]);b.beforeDecode=function(e,g,m){m.ui=e.ui;return g};mxCodecRegistry.register(b)})();(function(){EditorUi.VERSION="26.2.2";EditorUi.compactUi="atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&"support.draw.io"!=window.location.hostname&&+{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;var f=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var k=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&"image"!=k.style.shape&&!k.containsLabel&&0<k.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));+f.apply(this,arguments);null!=k.customProperties&&this.container.appendChild(this.addProperties(this.createPanel(),k.customProperties,k))};var l=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(k){var B=this.editorUi.getSelectionState();1==B.cells.length?this.addActions(k,["copyStyle","pasteStyle"]):1<=B.cells.length&&this.addActions(k,["pasteStyle","pasteData"]);l.apply(this,arguments);return k};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=+function(k,B,I,U){function P(Ma,y,O,R,V){if(null!=O.valueChanged)O.valueChanged(y,V);else{Ba.getModel().beginUpdate();try{V=[];var fa=[];if(null!=O.index){for(var ia=[],oa=O.parentRow.nextSibling;oa&&oa.getAttribute("data-pName")==Ma;)ia.push(oa.getAttribute("data-pValue")),oa=oa.nextSibling;O.index<ia.length?null!=R?ia.splice(R,1):ia[O.index]=y:ia.push(y);null!=O.size&&ia.length>O.size&&(ia=ia.slice(0,O.size));y=ia.join(",");null!=O.countProperty&&(Ba.setCellStyles(O.countProperty,ia.length,Ba.getSelectionCells()),+V.push(O.countProperty),fa.push(ia.length))}Ba.setCellStyles(Ma,y,Ba.getSelectionCells());V.push(Ma);fa.push(y);if(null!=O.dependentProps)for(Ma=0;Ma<O.dependentProps.length;Ma++){var ta=O.dependentPropsDefVal[Ma],ra=O.dependentPropsVals[Ma];if(ra.length>y)ra=ra.slice(0,y);else for(var xa=ra.length;xa<y;xa++)ra.push(ta);ra=ra.join(",");Ba.setCellStyles(O.dependentProps[Ma],ra,Ba.getSelectionCells());V.push(O.dependentProps[Ma]);fa.push(ra)}if("function"==typeof O.onChange)O.onChange(Ba,y);qa.editorUi.fireEvent(new mxEventObject("styleChanged",+"keys",V,"values",fa,"cells",Ba.getSelectionCells()))}finally{Ba.getModel().endUpdate()}}}function T(Ma,y,O){var R=mxUtils.getOffset(k,!0),V=mxUtils.getOffset(Ma,!0);y.style.position="absolute";y.style.left=V.x-R.x+"px";y.style.top=V.y-R.y+"px";y.style.width=Ma.offsetWidth+"px";y.style.height=Ma.offsetHeight-(O?4:0)+"px";y.style.zIndex=5}function X(Ma,y,O){function R(fa){if(null==fa||fa==mxConstants.NONE)V.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==fa)V.style.background=+"";else{var ia=mxUtils.getLightDarkColor(fa);mxUtils.isLightDarkColor(fa)&&ia.light!=ia.dark?V.style.background="linear-gradient(to right bottom, "+ia.cssText+" 50%, "+mxUtils.invertLightDarkColor(ia).cssText+" 50.3%)":V.style.background=fa}}var V=document.createElement("div");V.style.width="32px";V.style.height="8px";V.style.margin="2px";V.style.borderStyle="solid";V.style.borderWidth="1px";R(y);btn=mxUtils.button("",mxUtils.bind(qa,function(fa){this.editorUi.pickColor(y,function(ia){P(Ma,ia,O);+R(ia)});mxEvent.consume(fa)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(V);return btn}function Z(Ma,y,O,R,V,fa,ia){null!=y&&(y=y.split(","),ya.push({name:Ma,values:y,type:O,defVal:R,countProperty:V,parentRow:fa,isDeletable:!0,flipBkg:ia}));btn=mxUtils.button("+",mxUtils.bind(qa,function(oa){for(var ta=fa,ra=0;null!=ta.nextSibling;)if(ta.nextSibling.getAttribute("data-pName")==Ma)ta=ta.nextSibling,+ra++;else break;var xa={type:O,parentRow:fa,index:ra,isDeletable:!0,defVal:R,countProperty:V};ra=ua(Ma,"",xa,0==ra%2,ia);P(Ma,R,xa);ta.parentNode.insertBefore(ra,ta.nextSibling);mxEvent.consume(oa)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function ka(Ma,y,O,R,V,fa,ia){if(0<V){var oa=Array(V);y=null!=y?y.split(","):[];for(var ta=0;ta<V;ta++)oa[ta]=null!=y[ta]?y[ta]:null!=R?R:"";ya.push({name:Ma,values:oa,type:O,defVal:R,parentRow:fa,flipBkg:ia,size:V})}return document.createElement("div")}+function va(Ma,y,O){var R=document.createElement("input");R.type="checkbox";R.checked="1"==y;mxEvent.addListener(R,"change",function(){P(Ma,R.checked?"1":"0",O)});return R}function ua(Ma,y,O,R,V){var fa=O.dispName,ia=O.type,oa=document.createElement("tr");oa.className="gePropRow"+(V?"Dark":"")+(R?"Alt":"")+" gePropNonHeaderRow";oa.setAttribute("data-pName",Ma);oa.setAttribute("data-pValue",y);R=!1;null!=O.index&&(oa.setAttribute("data-index",O.index),fa=(null!=fa?fa:"")+"["+O.index+"]",R=!0);var ta=+document.createElement("td");ta.className="gePropRowCell";fa=mxResources.get(fa,null,fa);mxUtils.write(ta,fa);ta.setAttribute("title",fa);R&&(ta.style.textAlign="right");oa.appendChild(ta);ta=document.createElement("td");ta.className="gePropRowCell";ta.setAttribute("title",null!=y?y:mxResources.get("none"));if("color"==ia)ta.appendChild(X(Ma,y,O));else if("bool"==ia||"boolean"==ia)ta.appendChild(va(Ma,y,O));else if("enum"==ia){var ra=O.enumList;for(V=0;V<ra.length;V++)if(fa=ra[V],fa.val==y){mxUtils.write(ta,+mxResources.get(fa.dispName,null,fa.dispName));break}mxEvent.addListener(ta,"click",mxUtils.bind(qa,function(){var xa=document.createElement("select"),Da=null;T(ta,xa);for(var Ia=0;Ia<ra.length;Ia++){var Xa=ra[Ia],Za=document.createElement("option");Za.value=mxUtils.htmlEntities(Xa.val);mxUtils.write(Za,mxResources.get(Xa.dispName,null,Xa.dispName));xa.appendChild(Za);null==Xa.val&&(Za.value="null",Da=Za)}xa.value=null==y&&null!=Da?"null":y;k.appendChild(xa);mxEvent.addListener(xa,"change",function(){var $a=+mxUtils.htmlEntities(xa.value);if(xa[xa.selectedIndex]==Da||"null"==$a.value)$a=null;P(Ma,$a,O)});xa.focus();mxEvent.addListener(xa,"blur",function(){k.removeChild(xa)})}))}else"dynamicArr"==ia?ta.appendChild(Z(Ma,y,O.subType,O.subDefVal,O.countProperty,oa,V)):"staticArr"==ia?ta.appendChild(ka(Ma,y,O.subType,O.subDefVal,O.size,oa,V)):"readOnly"==ia?(V=document.createElement("input"),V.setAttribute("readonly",""),V.value=y,V.style.borderWidth="0px","id"==Ma?(V.style.width="190px",V.style.position=+"relative",V.style.right="6px",V.style.float="right",V.style.background="none",V.style.textAlign="right",oa.firstChild.setAttribute("colspan","2"),V.setAttribute("title",y),oa.firstChild.appendChild(V)):(V.style.width="96px",ta.appendChild(V))):(ta.innerHTML=mxUtils.htmlEntities(decodeURIComponent(y)),mxEvent.addListener(ta,"click",mxUtils.bind(qa,function(){function xa(){var Ia=Da.value;Ia=0==Ia.length&&"string"!=ia&&"numbers"!=ia?0:Ia;O.allowAuto&&(null!=Ia.trim&&"auto"==Ia.trim().toLowerCase()?+(Ia="auto",ia="string"):(Ia=parseFloat(Ia),Ia=isNaN(Ia)?0:Ia));null!=O.min&&Ia<O.min?Ia=O.min:null!=O.max&&Ia>O.max&&(Ia=O.max);var Xa=null;try{Xa="numbers"==ia?Ia.match(/\d+/g).map(Number).join(" "):encodeURIComponent(("int"==ia?parseInt(Ia):Ia)+"")}catch(Za){}P(Ma,Xa,O,null,Da)}var Da=document.createElement("input");T(ta,Da,!0);Da.value=decodeURIComponent(y);Da.className="gePropEditor";"int"!=ia&&"float"!=ia||O.allowAuto||(Da.type="number",Da.step="int"==ia?"1":"any",null!=O.min&&(Da.min=parseFloat(O.min)),+null!=O.max&&(Da.max=parseFloat(O.max)));k.appendChild(Da);mxEvent.addListener(Da,"keypress",function(Ia){13==Ia.keyCode&&xa()});Da.focus();mxEvent.addListener(Da,"blur",function(){xa()})})));O.isDeletable&&(V=mxUtils.button("-",mxUtils.bind(qa,function(xa){P(Ma,"",O,O.index);mxEvent.consume(xa)})),V.style.height="16px",V.style.width="25px",V.style.float="right",V.className="geColorBtn",ta.appendChild(V));oa.appendChild(ta);return oa}var qa=this,Ba=this.editorUi.editor.graph,ya=[],La=document.createElement("table");+La.className="geProperties geFullWidthElement";var za=document.createElement("tr");za.className="gePropHeader";var Ea=document.createElement("th");Ea.className="gePropHeaderCell";Ea.style.paddingLeft="16px";Ea.style.backgroundRepeat="no-repeat";Ea.style.backgroundPosition="-2px 50%";Ea.style.backgroundSize="20px";mxUtils.write(Ea,mxResources.get("property"));za.style.cursor="pointer";var pa=function(){var Ma=La.querySelectorAll(".gePropNonHeaderRow");if(qa.editorUi.propertiesCollapsed){Ea.style.backgroundImage=+"url('"+Editor.arrowRightImage+"')";var y="none";for(var O=k.childNodes.length-1;0<=O;O--)try{var R=k.childNodes[O],V=R.nodeName.toUpperCase();"INPUT"!=V&&"SELECT"!=V||k.removeChild(R)}catch(fa){}}else Ea.style.backgroundImage="url('"+Editor.arrowDownImage+"')",y="";for(O=0;O<Ma.length;O++)Ma[O].style.display=y};mxEvent.addListener(za,"click",function(){qa.editorUi.propertiesCollapsed=!qa.editorUi.propertiesCollapsed;pa()});za.appendChild(Ea);var Ca=document.createElement("th");Ca.className="gePropHeaderCell";+Ca.style.paddingLeft="4px";mxUtils.write(Ca,mxResources.get("value"));za.appendChild(Ca);La.appendChild(za);var Aa=Ca=!1;za=null;1==I.vertices.length&&0==I.edges.length?za=I.vertices[0].id:0==I.vertices.length&&1==I.edges.length&&(za=I.edges[0].id);null==za||U||La.appendChild(ua("id",mxUtils.htmlEntities(za),{dispName:"id",type:"readOnly"},!0,!1));for(var wa in B)if(U=B[wa],!U.primary&&("function"!=typeof U.isVisible||U.isVisible(I,this))){var Ya=null!=U.getValue?U.getValue():null!=I.style[wa]?mxUtils.htmlEntities(I.style[wa]++""):null!=U.getDefaultValue?U.getDefaultValue(I,this):U.defVal;if("separator"==U.type)Aa=!Aa;else{if("staticArr"==U.type)U.size=parseInt(I.style[U.sizeProperty]||B[U.sizeProperty].defVal)||0;else if(null!=U.dependentProps){var Qa=U.dependentProps,Ra=[],Sa=[];for(za=0;za<Qa.length;za++){var Ha=I.style[Qa[za]];Sa.push(B[Qa[za]].subDefVal);Ra.push(null!=Ha?Ha.split(","):[])}U.dependentPropsDefVal=Sa;U.dependentPropsVals=Ra}La.appendChild(ua(wa,Ya,U,Ca,Aa));Ca=!Ca}}for(za=0;za<ya.length;za++)for(U=ya[za],+B=U.parentRow,I=0;I<U.values.length;I++)wa=ua(U.name,U.values[I],{type:U.type,parentRow:U.parentRow,isDeletable:U.isDeletable,index:I,defVal:U.defVal,countProperty:U.countProperty,size:U.size},0==I%2,U.flipBkg),B.parentNode.insertBefore(wa,B.nextSibling),B=wa;k.appendChild(La);pa();return k};StyleFormatPanel.prototype.addStyles=function(k){if(null!=this.defaultColorSchemes){var B=this.editorUi,I=B.editor.graph,U=document.createElement("div");U.style.padding="6px 20px 0 24px";k.appendChild(U);var P=+document.createElement("div");P.className="geSwitcher";P.style.padding="4px 18px 6px 0px";for(var T=[],X=0;X<this.defaultColorSchemes.length;X++){var Z=document.createElement("div");Z.className="geSwitcherDot";mxUtils.bind(this,function(Ba){mxEvent.addListener(Z,"click",mxUtils.bind(this,function(){ka(Ba)}))})(X);T.push(Z);P.appendChild(Z)}var ka=mxUtils.bind(this,function(Ba){null!=T[Ba]&&(null!=this.format.currentScheme&&null!=T[this.format.currentScheme]&&(T[this.format.currentScheme].style.background=+"transparent"),this.format.currentScheme=Ba,va(this.defaultColorSchemes[this.format.currentScheme]),T[this.format.currentScheme].style.background="#84d7ff")}),va=mxUtils.bind(this,function(Ba){var ya=mxUtils.clone(I.defaultVertexStyle);ya[mxConstants.STYLE_STROKECOLOR]=null!=ya[mxConstants.STYLE_STROKECOLOR]?ya[mxConstants.STYLE_STROKECOLOR]:"default";ya[mxConstants.STYLE_FILLCOLOR]=null!=ya[mxConstants.STYLE_FILLCOLOR]?ya[mxConstants.STYLE_FILLCOLOR]:"default";ya[mxConstants.STYLE_FONTCOLOR]=null!=+ya[mxConstants.STYLE_FONTCOLOR]?ya[mxConstants.STYLE_FONTCOLOR]:"default";I.replaceDefaultColors(new mxCell,ya);var La=mxUtils.bind(this,function(Ea){var pa=mxUtils.button("",mxUtils.bind(this,function(wa){I.getModel().beginUpdate();try{for(var Ya=B.getSelectionState().cells,Qa=0;Qa<Ya.length;Qa++){var Ra=I.getModel().getStyle(Ya[Qa]);null!=Ea?(mxEvent.isShiftDown(wa)||(Ra=""==Ea.fill||null==Ea.fill?mxUtils.setStyle(Ra,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(Ra,mxConstants.STYLE_FILLCOLOR,+Ea.fill),Ra=""==Ea.gradient||null==Ea.gradient?mxUtils.setStyle(Ra,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(Ra,mxConstants.STYLE_GRADIENTCOLOR,Ea.gradient),mxEvent.isControlDown(wa)||mxClient.IS_MAC&&mxEvent.isMetaDown(wa)||!I.getModel().isVertex(Ya[Qa])||(Ra=""==Ea.font||null==Ea.font?mxUtils.setStyle(Ra,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(Ra,mxConstants.STYLE_FONTCOLOR,Ea.font))),mxEvent.isAltDown(wa)||(Ra=""==Ea.stroke||null==Ea.fill?mxUtils.setStyle(Ra,mxConstants.STYLE_STROKECOLOR,+null):mxUtils.setStyle(Ra,mxConstants.STYLE_STROKECOLOR,Ea.stroke))):(Ra=mxUtils.setStyle(Ra,mxConstants.STYLE_FILLCOLOR,null),Ra=mxUtils.setStyle(Ra,mxConstants.STYLE_STROKECOLOR,null),Ra=mxUtils.setStyle(Ra,mxConstants.STYLE_GRADIENTCOLOR,null),I.getModel().isVertex(Ya[Qa])&&(Ra=mxUtils.setStyle(Ra,mxConstants.STYLE_FONTCOLOR,null)));I.getModel().setStyle(Ya[Qa],Ra)}}finally{I.getModel().endUpdate()}}));pa.className="geStyleButton";pa.style.width="36px";pa.style.height=10>=this.defaultColorSchemes.length?+"24px":"30px";pa.style.margin="0px 6px 6px 0px";if(null!=Ea){var Ca="1px solid";null!=Ea.border&&(Ca=Ea.border);if(null!=Ea.gradient)pa.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(Ea.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(Ea.gradient).cssText+" 100%)";else if(Ea.fill==mxConstants.NONE)pa.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==Ea.fill||""==Ea.fill)pa.style.backgroundColor=mxUtils.getLightDarkColor(mxUtils.getValue(ya,mxConstants.STYLE_FILLCOLOR,+"#ffffff")).cssText;else{var Aa=mxUtils.getLightDarkColor(Ea.fill);pa.style.backgroundImage="linear-gradient(to right bottom, "+Aa.cssText+" 50%, "+Aa.light+" 50.3%)"}null==Ea.stroke||Ea.stroke==mxConstants.NONE?pa.style.border=Ca+" transparent":""==Ea.stroke?pa.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(ya,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(Aa=mxUtils.getLightDarkColor(Ea.stroke),pa.style.border=Ca+" "+Aa.cssText,pa.style.borderRightColor=Aa.light,pa.style.borderBottomColor=+pa.style.borderRightColor);null!=Ea.title&&pa.setAttribute("title",Ea.title)}else Ca=mxUtils.getValue(ya,mxConstants.STYLE_FILLCOLOR,"#ffffff"),Aa=mxUtils.getValue(ya,mxConstants.STYLE_STROKECOLOR,"#000000"),pa.style.backgroundColor=Ca,pa.style.border="1px solid "+Aa;pa.style.borderRadius="0";U.appendChild(pa);null!=Ea&&null!=Ea.gradient&&(Ca=pa.cloneNode(!1),Ca.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(Ea.fill).light+") 0px, light-dark(transparent, "++mxUtils.getLightDarkColor(Ea.gradient).light+") 100%)",Ca.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",Ca.style.backgroundColor="transparent",U.appendChild(Ca),Ca.style.marginLeft="-42px",mxEvent.addListener(Ca,"click",function(){pa.click()}))});U.innerText="";if(null!=Ba)for(var za=0;za<Ba.length;za++)0<za&&0==mxUtils.mod(za,4)&&mxUtils.br(U),La(Ba[za])});null==this.format.currentScheme?ka(Math.min(T.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):ka(this.format.currentScheme);+X=10>=this.defaultColorSchemes.length?43:23;var ua=document.createElement("div");ua.className="geButton";ua.style.cssText="position:absolute;left:0px;bottom:"+X+"px;width:20px;background-image:url("+Editor.chevronLeftImage+");";mxEvent.addListener(ua,"click",mxUtils.bind(this,function(){ka(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var qa=document.createElement("div");qa.className="geButton";qa.style.cssText="position:absolute;left:186px;bottom:"+X+"px;width:20px;background-image:url("++Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(k.appendChild(ua),k.appendChild(qa));mxEvent.addListener(qa,"click",mxUtils.bind(this,function(){ka(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));va(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&k.appendChild(P)}return k}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('++STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements={};Graph.isGoogleFontUrl=function(k){return k.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||k.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=function(k){return Graph.isGoogleFontUrl(k)};Graph.rewriteGoogleFontUrl=function(k){null!=k&&k.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(k=Editor.GOOGLE_FONTS_CSS2+k.substring(Editor.GOOGLE_FONTS.length)++":wght@400;500");return k};Graph.createFontElement=function(k,B){var I=Graph.fontMapping[B];null==I&&Graph.isCssFontUrl(B)?(k=document.createElement("link"),k.setAttribute("rel","stylesheet"),k.setAttribute("type","text/css"),k.setAttribute("charset","UTF-8"),k.setAttribute("href",Graph.rewriteGoogleFontUrl(B))):(null==I&&(I='@font-face {\nfont-family: "'+k+'";\nsrc: url("'+B+'");\n}'),k=document.createElement("style"),mxUtils.write(k,I));return k};Graph.addRecentCustomFont=function(k,B){};Graph.addFont=+function(k,B,I){if(null!=k&&0<k.length&&null!=B&&0<B.length){var U=k.toLowerCase();if("helvetica"!=U&&"arial"!=k&&"sans-serif"!=U){var P=Graph.customFontElements[U];null!=P&&P.url!=B&&(P.elt.parentNode.removeChild(P.elt),P=null);null==P?(P=B,"http:"==B.substring(0,5)&&(P=PROXY_URL+"?url="+encodeURIComponent(B)),P={name:k,url:B,elt:Graph.createFontElement(k,P)},Graph.customFontElements[U]=P,B=document.getElementsByTagName("head")[0],null!=I&&("link"==P.elt.nodeName.toLowerCase()?(P.elt.onload=I,P.elt.onerror=+I):I()),null!=B&&B.appendChild(P.elt)):null!=I&&I()}else null!=I&&I()}else null!=I&&I();return k};Graph.getFontUrl=function(k,B){k=Graph.customFontElements[k.toLowerCase()];null!=k&&(B=k.url);return B};Graph.processFontAttributes=function(k){k=k.getElementsByTagName("*");for(var B=0;B<k.length;B++){var I=k[B].getAttribute("data-font-src");if(null!=I){var U="FONT"==k[B].nodeName?k[B].getAttribute("face"):k[B].style.fontFamily;null!=U&&Graph.addFont(U,I)}}};Graph.processFontStyle=function(k){if(null!=+k){var B=mxUtils.getValue(k,"fontSource",null);if(null!=B){var I=mxUtils.getValue(k,mxConstants.STYLE_FONTFAMILY,null);if(null!=I)try{Graph.addFont(I,decodeURIComponent(B))}catch(U){}}}return k};Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;Graph.prototype.shadowId="drawio-drop-shadow";Graph.prototype.svgShadowColor="#3D4574";+Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var t=Graph.prototype.init;Graph.prototype.init=function(){function k(P){B=P}t.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var B=null;mxEvent.addListener(this.container,"mouseenter",k);mxEvent.addListener(this.container,"mousemove",k);mxEvent.addListener(this.container,"mouseleave",+function(P){B=null});this.isMouseInsertPoint=function(){return null!=B};var I=this.getInsertPoint;this.getInsertPoint=function(){return null!=B?this.getPointForEvent(B):I.apply(this,arguments)};var U=this.layoutManager.getLayout;this.layoutManager.getLayout=function(P){var T=this.graph.getCellStyle(P);if(null!=T&&"rack"==T.childLayout){var X=new mxStackLayout(this.graph,!1);X.gridSize=null!=T.rackUnitSize?parseFloat(T.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;+X.marginLeft=T.marginLeft||0;X.marginRight=T.marginRight||0;X.marginTop=T.marginTop||0;X.marginBottom=T.marginBottom||0;X.allowGaps=T.allowGaps||0;X.horizontal="1"==mxUtils.getValue(T,"horizontalRack","0");X.resizeParent=!1;X.fill=!0;return X}return U.apply(this,arguments)};this.updateGlobalUrlVariables()};var q=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(k,B){return Graph.processFontStyle(q.apply(this,arguments))};var D=mxSvgCanvas2D.prototype.updateTextNodes;+mxSvgCanvas2D.prototype.updateTextNodes=function(k,B,I,U,P,T,X,Z,ka,va,ua,qa){D.apply(this,arguments);Graph.processFontAttributes(qa)};var H=mxText.prototype.redraw;mxText.prototype.redraw=function(){H.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(k,B,I,U){function P(){for(var za=Z.getSelectionCells(),Ea=[],pa=0;pa<za.length;pa++)Z.isCellVisible(za[pa])&&Ea.push(za[pa]);Z.setSelectionCells(Ea)}function T(za){Z.setHiddenTags(za?+[]:ka.slice());P();Z.refresh()}function X(za,Ea){ua.innerText="";if(0<za.length){var pa=document.createElement("table");pa.setAttribute("cellpadding","2");pa.style.boxSizing="border-box";pa.style.tableLayout="fixed";pa.style.width="100%";var Ca=document.createElement("tbody");if(null!=za&&0<za.length)for(var Aa=0;Aa<za.length;Aa++)(function(wa){function Ya(){var y=Z.getCellsForTags([wa],null,null,!0);Z.isEnabled()?Z.setSelectionCells(y):Z.highlightCells(y,null,null,70)}var Qa=0>mxUtils.indexOf(Z.hiddenTags,+wa),Ra=document.createElement("tr"),Sa=document.createElement("td");Sa.style.align="center";Sa.style.width="16px";var Ha=document.createElement("img");Ha.setAttribute("src",Qa?Editor.visibleImage:Editor.hiddenImage);Ha.setAttribute("title",mxResources.get(Qa?"hideIt":"show",[wa]));mxUtils.setOpacity(Ha,Qa?75:25);Ha.className="geAdaptiveAsset";Ha.style.verticalAlign="middle";Ha.style.cursor="pointer";Ha.style.width="16px";if(B||Editor.isDarkMode())Ha.style.filter="invert(100%)";Sa.appendChild(Ha);+mxEvent.addListener(Ha,"click",function(y){mxEvent.isShiftDown(y)?T(0<=mxUtils.indexOf(Z.hiddenTags,wa)):(Z.toggleHiddenTag(wa),P(),Z.refresh());mxEvent.consume(y)});Ra.appendChild(Sa);Sa=document.createElement("td");Sa.style.align="center";Sa.style.width="16px";Ha=document.createElement("img");Ha.setAttribute("src",Editor.selectImage);Ha.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Ha,Qa?75:25);Ha.className="geAdaptiveAsset";Ha.style.verticalAlign="middle";Ha.style.cursor="pointer";+Ha.style.width="16px";if(B||Editor.isDarkMode())Ha.style.filter="invert(100%)";mxEvent.addListener(Ha,"click",function(y){T(!0);Ya();mxEvent.consume(y)});Sa.appendChild(Ha);Ra.appendChild(Sa);Sa=document.createElement("td");Sa.style.overflow="hidden";Sa.style.whiteSpace="nowrap";Sa.style.textOverflow="ellipsis";Sa.style.verticalAlign="middle";Sa.style.cursor="pointer";Sa.setAttribute("title",wa);a=document.createElement("a");mxUtils.write(a,wa);a.style.textOverflow="ellipsis";a.style.position="relative";+mxUtils.setOpacity(a,Qa?100:40);Sa.appendChild(a);mxEvent.addListener(Sa,"click",function(y){if(mxEvent.isShiftDown(y))T(!0),Ya();else if(Qa&&0<Z.hiddenTags.length)T(!0);else{var O=ka.slice(),R=mxUtils.indexOf(O,wa);O.splice(R,1);Z.setHiddenTags(O);P();Z.refresh()}mxEvent.consume(y)});Ra.appendChild(Sa);if(Z.isEnabled()){Sa=document.createElement("td");Sa.style.verticalAlign="middle";Sa.style.textAlign="center";Sa.style.width="18px";if(null==Ea){Sa.style.align="center";Sa.style.width="16px";Ha=document.createElement("img");+Ha.setAttribute("src",Editor.trashImage);Ha.setAttribute("title",mxResources.get("removeIt",[wa]));mxUtils.setOpacity(Ha,Qa?75:25);Ha.className="geAdaptiveAsset";Ha.style.verticalAlign="middle";Ha.style.cursor="pointer";Ha.style.width="16px";if(B||Editor.isDarkMode())Ha.style.filter="invert(100%)";mxEvent.addListener(Ha,"click",function(y){var O=mxUtils.indexOf(ka,wa);0<=O&&ka.splice(O,1);Z.removeTagsForCells(Z.model.getDescendants(Z.model.getRoot()),[wa]);Z.refresh();mxEvent.consume(y)});Sa.appendChild(Ha)}else{var Ma=+document.createElement("input");Ma.setAttribute("type","checkbox");Ma.style.margin="0px";Ma.defaultChecked=null!=Ea&&0<=mxUtils.indexOf(Ea,wa);Ma.checked=Ma.defaultChecked;Ma.style.background="transparent";Ma.setAttribute("title",mxResources.get(Ma.defaultChecked?"removeIt":"add",[wa]));mxEvent.addListener(Ma,"change",function(y){Ma.checked?Z.addTagsForCells(Z.getSelectionCells(),[wa]):Z.removeTagsForCells(Z.getSelectionCells(),[wa]);mxEvent.consume(y)});Sa.appendChild(Ma)}Ra.appendChild(Sa)}Ca.appendChild(Ra)})(za[Aa]);+pa.appendChild(Ca);ua.appendChild(pa)}}var Z=this,ka=Z.hiddenTags.slice(),va=document.createElement("div");va.style.userSelect="none";va.style.overflow="hidden";va.style.padding="10px";va.style.height="100%";var ua=document.createElement("div");ua.style.position="absolute";ua.style.boxSizing="border-box";ua.style.userSelect="none";ua.style.overflow="auto";ua.style.padding="3px";ua.style.left="0px";ua.style.right="0px";ua.style.top="0px";ua.style.bottom="0px";va.appendChild(ua);Z.addListener(mxEvent.ROOT,+function(){ka=Z.hiddenTags.slice()});var qa=mxUtils.bind(this,function(za,Ea){if(k()){za=Z.getAllTags();for(Ea=0;Ea<za.length;Ea++)0>mxUtils.indexOf(ka,za[Ea])&&ka.push(za[Ea]);ka.sort();Z.isSelectionEmpty()?X(ka):X(ka,Z.getCommonTagsForCells(Z.getSelectionCells()))}});Z.selectionModel.addListener(mxEvent.CHANGE,qa);Z.model.addListener(mxEvent.CHANGE,qa);Z.addListener(mxEvent.REFRESH,qa);var Ba=document.createElement("div");Ba.className="geToolbarContainer geDialogToolbar";Ba.style.position="absolute";+Ba.style.display="flex";Ba.style.bottom="0px";Ba.style.left="0px";Ba.style.right="0px";Ba.style.height="32px";Ba.style.overflow="hidden";Ba.style.padding="3px 4px 4px 4px";Ba.style.borderWidth="1px 0px 0px 0px";Ba.style.borderStyle="solid";Ba.style.whiteSpace="nowrap";if(Z.isEnabled()){ua.style.bottom="32px";var ya=document.createElement("a");ya.className="geButton";var La=ya.cloneNode(!1);La.style.backgroundImage="url("+Editor.visibleImage+")";La.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(La,+"click",function(za){Z.setHiddenTags([]);mxEvent.isShiftDown(za)||(ka=Z.hiddenTags.slice());P();Z.refresh();mxEvent.consume(za)});Ba.appendChild(La);null!=I&&(ya=ya.cloneNode(!1),ya.style.backgroundImage="url("+Editor.plusImage+")",ya.setAttribute("title",mxResources.get("add")),mxEvent.addListener(ya,"click",function(za){I(ka,function(Ea){ka=Ea;qa()});mxEvent.consume(za)}),Ba.appendChild(ya));va.appendChild(Ba)}null!=U&&Ba.appendChild(U);return{div:va,refresh:qa}};Graph.prototype.getCustomFonts=+function(){var k=this.extFonts;k=null!=k?k.slice():[];for(var B in Graph.customFontElements){var I=Graph.customFontElements[B];k.push({name:I.name,url:I.url})}return k};Graph.prototype.setFont=function(k,B){Graph.addFont(k,B);var I=Editor.guid();document.execCommand("fontname",!1,I);for(var U=this.cellEditor.textarea.getElementsByTagName("font"),P=!1,T=0;T<U.length;T++)U[T].getAttribute("face")==I&&(P=!0,U[T].setAttribute("face",k),null!=B?U[T].setAttribute("data-font-src",B):U[T].removeAttribute("data-font-src"));+P||document.execCommand("fontname",!1,k)};var N=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return N.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var k=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=k)for(var B in k)this.globalVars[B]=k[B]}catch(I){null!=+window.console&&console.log("Error in vars URL parameter: "+I)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var L=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(k){var B=L.apply(this,arguments);null==B&&null!=this.globalVars&&(B=this.globalVars[k]);return B};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var k=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(k.ownerDocument)).decode(k)}return this.defaultStylesheet};+Graph.prototype.isViewer=function(){return urlParams.viewer};var J=Graph.prototype.getSvg;Graph.prototype.getSvg=function(k,B,I,U,P,T,X,Z,ka,va,ua,qa,Ba,ya,La,za){var Ea=J.apply(this,arguments);if(null!=qa){var pa=Ea.getAttribute("style");null==pa&&(pa="");qa="auto"==qa||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":qa;Ea.setAttribute("style",pa+(" color-scheme: "+qa+";"))}var Ca=this.getCustomFonts();if(ua&&0<Ca.length){var Aa=Ea.ownerDocument;pa=null!=Aa.createElementNS?+Aa.createElementNS(mxConstants.NS_SVG,"style"):Aa.createElement("style");null!=Aa.setAttributeNS?pa.setAttributeNS("type","text/css"):pa.setAttribute("type","text/css");for(var wa="",Ya="",Qa=0;Qa<Ca.length;Qa++){var Ra=Ca[Qa].name,Sa=Ca[Qa].url;Graph.isCssFontUrl(Sa)?wa+="@import url("+Graph.rewriteGoogleFontUrl(Sa)+");\n":Ya+='@font-face {\nfont-family: "'+Ra+'";\nsrc: url("'+Sa+'");\n}\n'}pa.appendChild(Aa.createTextNode(wa+Ya));Ea.getElementsByTagName("defs")[0].appendChild(pa)}Editor.replaceSvgDataUris&&+null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(Ea);this.mathEnabled&&(document.body.appendChild(Ea),Editor.MathJaxRender(Ea),Ea.parentNode.removeChild(Ea),pa=Ea.ownerDocument.getElementById("MJX-SVG-styles"),null!=pa&&Ea.getElementsByTagName("defs")[0].appendChild(pa.cloneNode(!0)));return Ea};var Y=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(k){Y.apply(this,arguments);null!=k.secondLabel&&(k.secondLabel.destroy(),k.secondLabel=+null)};mxCellRenderer.prototype.getShapesForState=function(k){return[k.shape,k.text,k.secondLabel,k.control]};var ha=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){ha.apply(this,arguments);this.enumerationState=0};var ea=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(k){null!=k.shape&&this.redrawEnumerationState(k);return ea.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(k){k=decodeURIComponent(mxUtils.getValue(k.style,+"enumerateValue",""));""==k&&(k=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(k)+"</div>"};mxGraphView.prototype.redrawEnumerationState=function(k){var B="1"==mxUtils.getValue(k.style,"enumerate",0);B&&null==k.secondLabel?(k.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),k.secondLabel.size=12,k.secondLabel.state=k,k.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,+this.graph.cellRenderer.initializeLabel(k,k.secondLabel)):B||null==k.secondLabel||(k.secondLabel.destroy(),k.secondLabel=null);B=k.secondLabel;if(null!=B){var I=k.view.scale,U=this.createEnumerationValue(k);k=this.graph.model.isVertex(k.cell)?new mxRectangle(k.x+k.width-4*I,k.y+4*I,0,0):mxRectangle.fromPoint(k.view.getPoint(k));B.bounds.equals(k)&&B.value==U&&B.scale==I||(B.bounds=k,B.value=U,B.scale=I,B.redraw())}};var aa=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();+aa.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),this.view.validateBackgroundImage())};var na=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){na.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(k,B){"data:action/json,"==k.substring(0,17)&&(k=JSON.parse(k.substring(17)),null!=k.actions&&+this.executeCustomActions(k.actions,null,B))};Graph.prototype.executeCustomActions=function(k,B,I){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=!0;var U=!1,P=0,T=0,X=mxUtils.bind(this,function(){U||(U=!0,this.model.beginUpdate())}),Z=mxUtils.bind(this,+function(){U&&(U=!1,this.model.endUpdate())}),ka=mxUtils.bind(this,function(){0<P&&P--;0==P&&va()}),va=mxUtils.bind(this,function(){if(T<k.length){var ua=this.stoppingCustomActions,qa=k[T++],Ba=[];if(null!=qa.open)if(Z(),this.isCustomLink(qa.open)){if(!this.customLinkClicked(qa.open,I))return}else this.openLink(qa.open);null==qa.wait||ua||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;ka()}),P++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,+""!=qa.wait?parseInt(qa.wait):1E3),Z());null!=qa.opacity&&null!=qa.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(qa.opacity,!0)),qa.opacity.value);null!=qa.fadeIn&&(P++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(qa.fadeIn,!0)),0,1,ka,ua?0:qa.fadeIn.delay));null!=qa.fadeOut&&(P++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(qa.fadeOut,!0)),1,0,ka,ua?0:qa.fadeOut.delay));null!=qa.wipeIn&&(Ba=Ba.concat(this.createWipeAnimations(this.getCellsForAction(qa.wipeIn,+!0),!0)));null!=qa.wipeOut&&(Ba=Ba.concat(this.createWipeAnimations(this.getCellsForAction(qa.wipeOut,!0),!1)));null!=qa.toggle&&(X(),this.toggleCells(this.getCellsForAction(qa.toggle,!0)));if(null!=qa.show){X();var ya=this.getCellsForAction(qa.show,!0);Graph.setOpacityForNodes(this.getNodesForCells(ya),1);this.setCellsVisible(ya,!0)}null!=qa.hide&&(X(),ya=this.getCellsForAction(qa.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(ya),0),this.setCellsVisible(ya,!1));null!=qa.toggleStyle&&null!=+qa.toggleStyle.key&&(X(),this.toggleCellStyles(qa.toggleStyle.key,null!=qa.toggleStyle.defaultValue?qa.toggleStyle.defaultValue:"0",this.getCellsForAction(qa.toggleStyle,!0)));null!=qa.style&&null!=qa.style.key&&(X(),this.setCellStyles(qa.style.key,qa.style.value,this.getCellsForAction(qa.style,!0)));ya=[];null!=qa.select&&this.isEnabled()&&(ya=this.getCellsForAction(qa.select),this.setSelectionCells(ya));null!=qa.highlight&&(ya=this.getCellsForAction(qa.highlight),this.highlightCells(ya,qa.highlight.color,+qa.highlight.duration,qa.highlight.opacity));null!=qa.scroll&&(ya=this.getCellsForAction(qa.scroll));null!=qa.viewbox&&this.fitWindow(qa.viewbox,qa.viewbox.border);0<ya.length&&this.scrollCellToVisible(ya[0]);null!=I&&null!=qa.explore&&Graph.exploreFromCell(this,I,qa.explore);if(null!=qa.tags){if(null!=qa.tags.toggle){var La=qa.tags.toggle;0==La.length&&(La=this.getAllTags());for(ya=0;ya<La.length;ya++)this.toggleHiddenTag(La[ya])}La=null;null!=qa.tags.hidden&&(null==La&&(La=[]),La=La.concat(qa.tags.hidden));+if(null!=qa.tags.visible){null==La&&(La=[]);var za=this.getAllTags();for(ya=0;ya<za.length;ya++)0>mxUtils.indexOf(qa.tags.visible,za[ya])&&0>mxUtils.indexOf(La,za[ya])&&La.push(za[ya])}null!=La&&this.setHiddenTags(La);this.refresh()}0<Ba.length&&(P++,this.executeAnimations(Ba,ka,ua?1:qa.steps,ua?0:qa.delay));0==P?va():Z()}else this.stoppingCustomActions=this.executingCustomActions=!1,Z(),null!=B&&B()});va()}};Graph.prototype.doUpdateCustomLinksForCell=function(k,B){var I=this.getLinkForCell(B);null!=+I&&"data:action/json,"==I.substring(0,17)&&this.setLinkForCell(B,this.updateCustomLink(k,I));if(this.isHtmlLabel(B)){var U=document.createElement("div");U.innerHTML=Graph.sanitizeHtml(this.getLabel(B));for(var P=U.getElementsByTagName("a"),T=!1,X=0;X<P.length;X++)I=P[X].getAttribute("href"),null!=I&&"data:action/json,"==I.substring(0,17)&&(P[X].setAttribute("href",this.updateCustomLink(k,I)),T=!0);T&&this.labelChanged(B,U.innerHTML)}};Graph.prototype.updateCustomLink=function(k,B){if("data:action/json,"==+B.substring(0,17))try{var I=JSON.parse(B.substring(17));null!=I.actions&&(this.updateCustomLinkActions(k,I.actions),B="data:action/json,"+JSON.stringify(I))}catch(U){}return B};Graph.prototype.updateCustomLinkActions=function(k,B){for(var I=0;I<B.length;I++){var U=B[I],P;for(P in U)this.updateCustomLinkAction(k,U[P],"cells"),this.updateCustomLinkAction(k,U[P],"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(k,B,I){if(null!=B&&null!=B[I]){for(var U=[],P=0;P<B[I].length;P++)if("*"==+B[I][P])U.push(B[I][P]);else{var T=k[B[I][P]];null!=T?""!=T&&U.push(T):U.push(B[I][P])}B[I]=U}};Graph.prototype.getCellsForAction=function(k,B){B=this.getCellsById(k.cells).concat(this.getCellsForTags(k.tags,null,B));if(null!=k.excludeCells){for(var I=[],U=0;U<B.length;U++)0>k.excludeCells.indexOf(B[U].id)&&I.push(B[U]);B=I}return B};Graph.prototype.getCellsById=function(k){var B=[];if(null!=k)for(var I=0;I<k.length;I++)if("*"==k[I]){var U=this.model.getRoot();B=B.concat(this.model.filterDescendants(function(T){return T!=+U},U))}else{var P=this.model.getCell(k[I]);null!=P&&B.push(P)}return B};var W=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(k){return W.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(k))};Graph.prototype.setHiddenTags=function(k){this.hiddenTags=k;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(k){var B=mxUtils.indexOf(this.hiddenTags,k);0>B?this.hiddenTags.push(k):0<=B&&this.hiddenTags.splice(B,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};+Graph.prototype.isAllTagsHidden=function(k){if(null==k||0==k.length||0==this.hiddenTags.length)return!1;k=k.split(" ");if(k.length>this.hiddenTags.length)return!1;for(var B=0;B<k.length;B++)if(0>mxUtils.indexOf(this.hiddenTags,k[B]))return!1;return!0};Graph.prototype.getCellsForTags=function(k,B,I,U){var P=[];if(null!=k){B=null!=B?B:this.model.getDescendants(this.model.getRoot());for(var T=0,X={},Z=0;Z<k.length;Z++)0<k[Z].length&&(X[k[Z]]=!0,T++);for(Z=0;Z<B.length;Z++)if(I&&this.model.getParent(B[Z])==+this.model.root||this.model.isVertex(B[Z])||this.model.isEdge(B[Z])){var ka=this.getTagsForCell(B[Z]),va=!1;if(0<ka.length&&(ka=ka.split(" "),ka.length>=k.length)){for(var ua=va=0;ua<ka.length&&va<T;ua++)null!=X[ka[ua]]&&va++;va=va==T}va&&(1!=U||this.isCellVisible(B[Z]))&&P.push(B[Z])}}return P};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(k){for(var B=null,I=[],U=0;U<k.length;U++){var P=+this.getTagsForCell(k[U]);I=[];if(0<P.length){P=P.split(" ");for(var T={},X=0;X<P.length;X++)if(null==B||null!=B[P[X]])T[P[X]]=!0,I.push(P[X]);B=T}else return[]}return I};Graph.prototype.getTagsForCells=function(k){for(var B=[],I={},U=0;U<k.length;U++){var P=this.getTagsForCell(k[U]);if(0<P.length){P=P.split(" ");for(var T=0;T<P.length;T++)null==I[P[T]]&&(I[P[T]]=!0,B.push(P[T]))}}return B};Graph.prototype.getTagsForCell=function(k){return this.getAttributeForCell(k,"tags","")};Graph.prototype.addTagsForCells=+function(k,B){if(0<k.length&&0<B.length){this.model.beginUpdate();try{for(var I=0;I<k.length;I++){for(var U=this.getTagsForCell(k[I]),P=U.split(" "),T=!1,X=0;X<B.length;X++){var Z=mxUtils.trim(B[X]);""!=Z&&0>mxUtils.indexOf(P,Z)&&(U=0<U.length?U+" "+Z:Z,T=!0)}T&&this.setAttributeForCell(k[I],"tags",U)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(k,B){if(0<k.length&&0<B.length){this.model.beginUpdate();try{for(var I=0;I<k.length;I++){var U=this.getTagsForCell(k[I]);+if(0<U.length){for(var P=U.split(" "),T=!1,X=0;X<B.length;X++){var Z=mxUtils.indexOf(P,B[X]);0<=Z&&(P.splice(Z,1),T=!0)}T&&this.setAttributeForCell(k[I],"tags",P.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(k){this.model.beginUpdate();try{for(var B=0;B<k.length;B++)this.model.setVisible(k[B],!this.model.isVisible(k[B]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(k,B){this.model.beginUpdate();try{for(var I=0;I<k.length;I++)this.model.setVisible(k[I],+B)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(k,B,I,U){for(var P=0;P<k.length;P++)this.highlightCell(k[P],B,I,U)};Graph.prototype.highlightCell=function(k,B,I,U,P){B=null!=B?B:mxConstants.DEFAULT_VALID_COLOR;I=null!=I?I:1E3;k=this.view.getState(k);var T=null;null!=k&&(P=null!=P?P:4,P=Math.max(P+1,mxUtils.getValue(k.style,mxConstants.STYLE_STROKEWIDTH,1)+P),T=new mxCellHighlight(this,B,P,!1),null!=U&&(T.opacity=U),T.highlight(k),window.setTimeout(function(){null!=T.shape&&+(mxUtils.setPrefixedStyle(T.shape.node.style,"transition","all 1200ms ease-in-out"),T.shape.node.style.opacity=0);window.setTimeout(function(){T.destroy()},1200)},I));return T};Graph.prototype.addSvgShadow=function(k,B,I,U){I=null!=I?I:!1;U=null!=U?U:!0;var P=k.ownerDocument,T=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"filter"):P.createElement("filter");T.setAttribute("id",this.shadowId);var X=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):P.createElement("feGaussianBlur");+X.setAttribute("in","SourceAlpha");X.setAttribute("stdDeviation",this.svgShadowBlur);X.setAttribute("result","blur");T.appendChild(X);X=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feOffset"):P.createElement("feOffset");X.setAttribute("in","blur");X.setAttribute("dx",this.svgShadowSize);X.setAttribute("dy",this.svgShadowSize);X.setAttribute("result","offsetBlur");T.appendChild(X);X=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feFlood"):P.createElement("feFlood");+X.setAttribute("flood-color",this.svgShadowColor);X.setAttribute("flood-opacity",this.svgShadowOpacity);X.setAttribute("result","offsetColor");T.appendChild(X);X=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feComposite"):P.createElement("feComposite");X.setAttribute("in","offsetColor");X.setAttribute("in2","offsetBlur");X.setAttribute("operator","in");X.setAttribute("result","offsetBlur");T.appendChild(X);X=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feBlend"):P.createElement("feBlend");+X.setAttribute("in","SourceGraphic");X.setAttribute("in2","offsetBlur");T.appendChild(X);X=k.getElementsByTagName("defs");0==X.length?(P=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"defs"):P.createElement("defs"),null!=k.firstChild?k.insertBefore(P,k.firstChild):k.appendChild(P)):P=X[0];P.appendChild(T);I||(B=null!=B?B:k.getElementsByTagName("g")[0],null!=B&&(B.setAttribute("filter","url(#"+this.shadowId+")"),!isNaN(parseInt(k.getAttribute("width")))&&U&&(k.setAttribute("width",parseInt(k.getAttribute("width"))++6),k.setAttribute("height",parseInt(k.getAttribute("height"))+6),B=k.getAttribute("viewBox"),null!=B&&0<B.length&&(B=B.split(" "),3<B.length&&(w=parseFloat(B[2])+6,h=parseFloat(B[3])+6,k.setAttribute("viewBox",B[0]+" "+B[1]+" "+w+" "+h))))));return T};Graph.prototype.setShadowVisible=function(k,B){mxClient.IS_SVG&&!mxClient.IS_SF&&(B=null!=B?B:!0,(this.shadowVisible=k)?this.view.getDrawPane().setAttribute("filter","url(#"+this.shadowId+")"):this.view.getDrawPane().removeAttribute("filter"),B&&this.fireEvent(new mxEventObject("shadowVisibleChanged")))};+Graph.prototype.checkDefaultParent=function(){null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var k=this.model.getChildCount(this.model.root),B=0;do var I=this.model.getChildAt(this.model.root,B);while(B++<k&&"1"==mxUtils.getValue(this.getCellStyle(I),"locked","0"));null!=I&&this.setDefaultParent(I)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH++"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=+[SHAPES_PATH+"/mxCisco19.js",STENCIL_PATH+"/cisco19.xml"];mxStencilRegistry.libraries.cisco_safe=[SHAPES_PATH+"/mxCiscoSafe.js",STENCIL_PATH+"/cisco_safe/architecture.xml",STENCIL_PATH+"/cisco_safe/business_icons.xml",STENCIL_PATH+"/cisco_safe/capability.xml",STENCIL_PATH+"/cisco_safe/design.xml",STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",STENCIL_PATH+"/cisco_safe/people_places_things_icons.xml",STENCIL_PATH+"/cisco_safe/security_icons.xml",STENCIL_PATH+"/cisco_safe/technology_icons.xml",STENCIL_PATH++"/cisco_safe/threat.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.kubernetes=[SHAPES_PATH+"/mxKubernetes.js",STENCIL_PATH+"/kubernetes.xml",STENCIL_PATH+"/kubernetes2.xml"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH++"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=+[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/abstract"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/miscellaneous"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/miscellaneous.xml"];mxStencilRegistry.libraries["electrical/signal_sources"]=+[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/signal_sources.xml"];mxStencilRegistry.libraries["electrical/electro-mechanical"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/electro-mechanical.xml"];mxStencilRegistry.libraries["electrical/transmission"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries.infographic=[SHAPES_PATH+"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];+mxStencilRegistry.libraries["mockup/containers"]=[SHAPES_PATH+"/mockup/mxMockupContainers.js"];mxStencilRegistry.libraries["mockup/forms"]=[SHAPES_PATH+"/mockup/mxMockupForms.js"];mxStencilRegistry.libraries["mockup/graphics"]=[SHAPES_PATH+"/mockup/mxMockupGraphics.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/markup"]=[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];+mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH++"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.ibm=[SHAPES_PATH+"/mxIBM.js",STENCIL_PATH+"/ibm.xml"];mxStencilRegistry.libraries.ibmcloud=[STENCIL_PATH+"/ibm_cloud.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=+[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=[SHAPES_PATH++"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH++"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=[STENCIL_PATH+"/salesforce.xml"];mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(k){var B=null;null!=k&&0<k.length&&("ER"==k.substring(0,2)?B="mxgraph.er":"sysML"==k.substring(0,5)&&(B="mxgraph.sysml"));return B};var ba=+mxMarker.createMarker;mxMarker.createMarker=function(k,B,I,U,P,T,X,Z,ka,va){if(null!=I&&null==mxMarker.markers[I]){var ua=this.getPackageForType(I);null!=ua&&mxStencilRegistry.getStencil(ua)}return ba.apply(this,arguments)};var ja=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(k,B,I,U,P,T){"1"==mxUtils.getValue(B.style,"lineShape",null)&&k.setFillColor(mxUtils.getValue(B.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return ja.apply(this,arguments)};PrintDialog.prototype.create=+function(k,B,I,U){function P(){La.value=Math.max(1,Math.min(ua,Math.max(parseInt(La.value),parseInt(ya.value))));ya.value=Math.max(1,Math.min(ua,Math.min(parseInt(La.value),parseInt(ya.value))))}function T(Da){k.lastPrintPagesRadioChecked=Ba.checked;k.lastPrintSelectionOnlyChecked=Ea.checked;k.lastPrintCropRadioChecked=Ca.checked;k.lastPrintFitRadioChecked=Aa.checked;Ba.checked&&ya.value<La.value?(k.lastPrintPagesFromInput=ya.value,k.lastPrintPagesToInput=La.value):(k.lastPrintPagesFromInput=null,+k.lastPrintPagesToInput=null);fa.value=Math.max(1,Math.min(1600,parseInt(fa.value)))+"%";k.lastPrintZoom=fa.value;k.lastPrintBorder=V.value;k.lastPrintGrid=ia.checked;k.lastPrintTransparent=oa.checked;k.lastPrintInclude=ta.checked;k.lastPrintSheetsAcross=O.value;k.lastPrintSheetsDown=R.value;var Ia={};Ia.border=parseInt(V.value);Ia.scale=parseInt(fa.value)/100;Ia.grid=ia.checked;Ia.transparent=oa.checked;Ia.includeCopy=ta.checked;Ia.sheetsAcross=parseInt(O.value);Ia.sheetsDown=parseInt(R.value);Ia.pagesFrom=+parseInt(ya.value);Ia.pagesTo=parseInt(La.value);Ia.allPages=qa.checked;Ia.selection=Ea.checked;Ia.pageView=pa.checked;Ia.crop=Ca.checked;Ia.fit=Aa.checked;return null!=I?I(!Da,Ia):k.print(!Da,Ia)}var X=k.editor.graph,Z=document.createElement("div"),ka=document.createElement("h3");ka.style.width="100%";ka.style.textAlign="center";ka.style.marginTop="0px";mxUtils.write(ka,B||mxResources.get("print"));Z.appendChild(ka);var va=1,ua=1;ka=document.createElement("div");ka.style.whiteSpace="nowrap";var qa=+document.createElement("input");qa.style.marginRight="8px";qa.style.marginBottom="8px";qa.setAttribute("type","radio");qa.setAttribute("name","pages-printdialog");ka.appendChild(qa);B=document.createElement("span");mxUtils.write(B,mxResources.get("allPages"));mxEvent.addListener(B,"click",function(){qa.checked=!0});ka.appendChild(B);mxUtils.br(ka);var Ba=qa.cloneNode(!0);ka.appendChild(Ba);B=document.createElement("span");mxUtils.write(B,mxResources.get("pages")+":");ka.appendChild(B);mxEvent.addListener(B,+"click",function(){Ba.checked=!0});var ya=document.createElement("input");ya.style.margin="0 4px";ya.setAttribute("value","1");ya.setAttribute("type","number");ya.setAttribute("min","1");ya.style.width="40px";ka.appendChild(ya);B=document.createElement("span");mxUtils.write(B,mxResources.get("to"));ka.appendChild(B);var La=ya.cloneNode(!0);ka.appendChild(La);mxEvent.addListener(ya,"focus",function(){Ba.checked=!0});mxEvent.addListener(La,"focus",function(){Ba.checked=!0});mxEvent.addListener(ya,"change",+P);mxEvent.addListener(La,"change",P);if(null!=k.pages&&(ua=k.pages.length,null!=k.currentPage))for(var za=0;za<ua;za++)if(k.currentPage==k.pages[za]){va=za+1;break}null!=k.lastPrintPagesFromInput&&null!=k.lastPrintPagesToInput?(ya.value=Math.min(ua,Math.max(1,k.lastPrintPagesFromInput)),La.value=Math.min(ua,Math.max(1,k.lastPrintPagesToInput))):(ya.value=va,La.value=va);ya.setAttribute("max",ua);La.setAttribute("max",ua);za=mxUtils.button(mxResources.get("currentPage"),function(Da){ya.value=va;La.value=+va;Ba.checked=!0});za.setAttribute("title",mxResources.get("currentPage"));za.style.marginLeft="4px";za.style.maxWidth="100px";za.style.overflow="hidden";za.style.textOverflow="ellipsis";za.style.whiteSpace="nowrap";ka.appendChild(za);1<ua&&Z.appendChild(ka);ka=document.createElement("div");ka.style.borderBottom="1px solid lightGray";ka.style.paddingBottom="12px";ka.style.marginBottom="12px";ka.style.whiteSpace="nowrap";var Ea=document.createElement("input");Ea.setAttribute("name","pages-printdialog");+Ea.setAttribute("type",1==ua?"checkbox":"radio");Ea.style.marginRight="8px";X.isSelectionEmpty()&&Ea.setAttribute("disabled","disabled");X.isEnabled()&&(ka.appendChild(Ea),B=document.createElement("span"),mxUtils.write(B,mxResources.get("selectionOnly")),ka.appendChild(B));(X.isEnabled()||1<ua)&&Z.appendChild(ka);!k.isPagesEnabled()||k.lastPrintPagesRadioChecked?Ba.checked=!0:!X.isSelectionEmpty()&&k.lastPrintSelectionOnlyChecked?Ea.checked=!0:qa.checked=!0;X.isSelectionEmpty()||mxEvent.addListener(B,+"click",function(){Ea.checked=!Ea.checked});X=document.createElement("div");X.style.whiteSpace="nowrap";var pa=document.createElement("input");pa.style.marginBottom="8px";pa.style.marginRight="8px";pa.setAttribute("type","radio");pa.setAttribute("name","printSize");X.appendChild(pa);B=document.createElement("span");mxUtils.write(B,mxResources.get("pageView"));X.appendChild(B);mxEvent.addListener(X,"click",function(){pa.checked=!0});Z.appendChild(X);X=document.createElement("div");X.style.whiteSpace=+"nowrap";var Ca=document.createElement("input");Ca.style.marginBottom="8px";Ca.style.marginRight="8px";Ca.setAttribute("type","radio");Ca.setAttribute("name","printSize");X.appendChild(Ca);B=document.createElement("span");mxUtils.write(B,mxResources.get("crop"));X.appendChild(B);mxEvent.addListener(X,"click",function(){Ca.checked=!0});Z.appendChild(X);X=document.createElement("div");X.style.whiteSpace="nowrap";var Aa=document.createElement("input");Aa.style.marginBottom="8px";Aa.style.marginRight=+"8px";Aa.setAttribute("type","radio");Aa.setAttribute("name","printSize");B=document.createElement("div");B.style.display="inline-block";B.style.verticalAlign="top";B.style.paddingTop="2px";B.appendChild(Aa);X.appendChild(B);ka=document.createElement("table");ka.style.display="inline-block";ka.style.borderSpacing="0";za=document.createElement("tbody");var wa=document.createElement("tr"),Ya=wa.cloneNode(!0),Qa=document.createElement("td"),Ra=Qa.cloneNode(!0),Sa=Qa.cloneNode(!0),Ha=Qa.cloneNode(!0),+Ma=Qa.cloneNode(!0),y=Qa.cloneNode(!0);Qa.style.textAlign="right";Ha.style.textAlign="right";mxUtils.write(Qa,mxResources.get("fitTo"));mxEvent.addListener(X,"click",function(Da){mxEvent.getSource(Da)!=Aa&&(Aa.checked=!Aa.checked)});var O=document.createElement("input");O.style.margin="0 2px";O.style.boxSizing="border-box";O.setAttribute("value",k.lastPrintSheetsAcross||"1");O.setAttribute("min","1");O.setAttribute("type","number");O.style.width="40px";Ra.appendChild(O);B=document.createElement("span");+mxUtils.write(B,mxResources.get("fitToSheetsAcross"));Sa.appendChild(B);mxUtils.write(Ha,mxResources.get("fitToBy"));var R=O.cloneNode(!0);R.setAttribute("value",k.lastPrintSheetsDown||"1");Ma.appendChild(R);mxEvent.addListener(O,"click",function(Da){Aa.checked=!0;mxEvent.consume(Da)});mxEvent.addListener(R,"click",function(Da){Aa.checked=!0;mxEvent.consume(Da)});k.lastPrintCropRadioChecked?Ca.checked=!0:k.lastPrintFitRadioChecked?Aa.checked=!0:pa.checked=!0;B=document.createElement("span");mxUtils.write(B,+mxResources.get("fitToSheetsDown"));y.appendChild(B);wa.appendChild(Qa);wa.appendChild(Ra);wa.appendChild(Sa);Ya.appendChild(Ha);Ya.appendChild(Ma);Ya.appendChild(y);za.appendChild(wa);za.appendChild(Ya);ka.appendChild(za);X.appendChild(ka);Z.appendChild(X);X=document.createElement("div");X.style.borderTop="1px solid lightGray";X.style.whiteSpace="nowrap";X.style.paddingTop="12px";X.style.marginTop="12px";X.style.paddingLeft="8px";mxUtils.write(X,mxResources.get("borderWidth")+":");var V=document.createElement("input");+V.setAttribute("type","number");V.setAttribute("min","0");V.style.width="40px";V.style.marginLeft="4px";V.value=null!=k.lastPrintBorder?k.lastPrintBorder:mxPrintPreview.prototype.pageMargin;X.appendChild(V);B=document.createElement("span");B.style.marginLeft="8px";mxUtils.write(B,mxResources.get("zoom")+":");X.appendChild(B);var fa=document.createElement("input");fa.style.width="60px";fa.style.marginLeft="4px";fa.value=null!=k.lastPrintZoom?k.lastPrintZoom:"100%";X.appendChild(fa);mxUtils.br(X);var ia=+document.createElement("input");ia.setAttribute("type","checkbox");ia.style.marginTop="12px";ia.checked=null!=k.lastPrintGrid?k.lastPrintGrid:!1;X.appendChild(ia);B=document.createElement("span");B.style.marginLeft="4px";B.style.marginRight="8px";mxUtils.write(B,mxResources.get("grid"));X.appendChild(B);mxEvent.addListener(B,"click",function(Da){ia.checked=!0;mxEvent.consume(Da)});var oa=document.createElement("input");oa.setAttribute("type","checkbox");oa.style.marginTop="10px";oa.checked=null!=+k.lastPrintTransparent?k.lastPrintTransparent:!1;null!=I&&(X.appendChild(oa),B=document.createElement("span"),B.style.marginLeft="4px",mxUtils.write(B,mxResources.get("transparentBackground")),X.appendChild(B),mxEvent.addListener(B,"click",function(Da){oa.checked=!0;mxEvent.consume(Da)}));var ta=document.createElement("input");ta.setAttribute("type","checkbox");ta.style.marginTop="10px";ta.checked=null!=k.lastPrintInclude?k.lastPrintInclude:Editor.defaultIncludeDiagram;null==I||mxClient.IS_CHROMEAPP||+"draw.io"!=k.getServiceName()||(mxUtils.br(X),X.appendChild(ta),B=document.createElement("span"),B.style.marginLeft="4px",mxUtils.write(B,mxResources.get("includeCopyOfMyDiagram")),X.appendChild(B),mxEvent.addListener(B,"click",function(Da){ta.checked=!0;mxEvent.consume(Da)}));Z.appendChild(X);B=document.createElement("div");B.style.marginTop="40px";B.style.textAlign="right";B.style.whiteSpace="nowrap";k.isOffline()||null!=I||B.appendChild(k.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));+X=mxUtils.button(mxResources.get("cancel"),function(){k.hideDialog()});X.className="geBtn";k.editor.cancelFirst&&B.appendChild(X);PrintDialog.previewEnabled&&null==I&&(ka=mxUtils.button(mxResources.get("preview"),function(){try{k.hideDialog(),T(!1)}catch(Da){k.handleError(Da)}}),ka.className="geBtn",B.appendChild(ka));U=null!=U?U:null!=I?"export":PrintDialog.previewEnabled?"print":"ok";U=mxUtils.button(mxResources.get(U),function(){try{k.hideDialog(),T(!0)}catch(Da){k.handleError(Da)}});U.className=+"geBtn gePrimaryBtn";B.appendChild(U);k.editor.cancelFirst||B.appendChild(X);Z.appendChild(B);if(k.editor.isChromelessView()){var ra=function(){Editor.isDarkMode()?(Z.classList.add("geDarkMode"),Z.style.colorScheme="dark"):(Z.classList.remove("geDarkMode"),Z.style.colorScheme="light")};k.addListener("darkModeChanged",ra);ra();var xa=function(Da,Ia){Da=Ia.getProperty("dialog");Z.parentNode==Da.container&&(k.editor.removeListener(xa),k.removeListener(ra))};k.editor.addListener("hideDialog",xa)}this.container=+Z};var ca=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);if(this.page!=this.ui.currentPage){if(null!=this.page.viewState){this.ignoreColor||(this.page.viewState.background=this.color);if(!this.ignoreImage){var k=this.image;null!=k&&null!=k.src&&Graph.isPageLink(k.src)&&(k={originalSrc:k.src});this.page.viewState.backgroundImage=k}null!=this.format&&(this.page.viewState.pageFormat=this.format);null!=this.mathEnabled&&+(this.page.viewState.mathEnabled=this.mathEnabled);null!=this.adaptiveColors&&(this.page.viewState.adaptiveColors=this.adaptiveColors);null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)}}else ca.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.adaptiveColors&&this.adaptiveColors!=this.ui.editor.graph.adaptiveColors&&(k=this.ui.editor.graph.adaptiveColors,+this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=k?k:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible)};Editor.prototype.useCanvasForExport=!1;try{var la=document.createElement("canvas"),Q=new Image;Q.onload=function(){try{la.getContext("2d").drawImage(Q,0,0);var k=la.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=k&&+6<k.length}catch(B){}};Q.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(k){}Editor.prototype.useCanvasForExport=!1})();+(function(){var b=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);b.beforeDecode=function(e,g,m){m.ui=e.ui;return g};b.afterDecode=function(e,g,m){m.previousColor=m.color;m.previousImage=m.image;m.previousFormat=m.format;m.previousAdaptiveColors=m.adaptiveColors;null!=m.foldingEnabled&&(m.foldingEnabled=!m.foldingEnabled);null!=m.mathEnabled&&(m.mathEnabled=!m.mathEnabled);null!=m.shadowVisible&&(m.shadowVisible=!m.shadowVisible);return m};mxCodecRegistry.register(b)})();+(function(){var b=new mxObjectCodec(new ChangeGridColor,["ui"]);b.beforeDecode=function(e,g,m){m.ui=e.ui;return g};mxCodecRegistry.register(b)})();(function(){EditorUi.VERSION="26.2.7";EditorUi.compactUi="atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&"support.draw.io"!=window.location.hostname&&"test.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl=window.REALTIME_URL;null==EditorUi.cacheUrl&&"undefined"!==typeof DrawioFile&&(DrawioFile.SYNC="none");Editor.cacheTimeout=1E4;EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.nativeFileSupport=!mxClient.IS_OP&&!EditorUi.isElectronApp&&"1"!=urlParams.extAuth&&"showSaveFilePicker"in window&&"showOpenFilePicker"in window;EditorUi.enableDrafts=!mxClient.IS_CHROMEAPP&&isLocalStorage&&"0"!=urlParams.drafts;EditorUi.scratchpadHelpLink="https://www.drawio.com/doc/faq/scratchpad";EditorUi.enableHtmlEditOption=!0;EditorUi.mermaidDiagramTypes="flowchart classDiagram sequenceDiagram stateDiagram mindmap graph erDiagram requirementDiagram journey gantt pie gitGraph".split(" ");EditorUi.defaultMermaidConfig={theme:"neutral",arrowMarkerAbsolute:!1,flowchart:{htmlLabels:!1},sequence:{diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!0,bottomMarginAdj:1,useMaxWidth:!0,rightAngles:!1,showSequenceNumbers:!1},gantt:{titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,leftPadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:4,axisFormat:"%Y-%m-%d"}};-EditorUi.logError=function(c,f,l,t,q,D,G){if(null!=c){q=null!=q?q:Error(c);q.stack=null!=q.stack?q.stack:"";D=null!=D?D:0>c.indexOf("NetworkError")&&0>c.indexOf("SecurityError")&&0>c.indexOf("NS_ERROR_FAILURE")&&0>c.indexOf("out of memory")?"SEVERE":"CONFIG";try{EditorUi.enableLogging&&"1"!=urlParams.dev&&c!=EditorUi.lastErrorMessage&&0>c.indexOf("extension:")&&0>c.indexOf("ResizeObserver loop completed with undelivered notifications")&&0>q.stack.indexOf("extension:")&&0>q.stack.indexOf("<anonymous>:")&&-0>q.stack.indexOf("/math/es5/")&&(EditorUi.lastErrorMessage=c,(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+D+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(c)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(l)+(null!=t?":colno:"+encodeURIComponent(t):"")+(""!=q.stack?"&stack="+encodeURIComponent(q.stack):""))}catch(N){}try{G||null==window.console||console.error(D,c,f,l,t,q)}catch(N){}}};EditorUi.logEvent=+EditorUi.logError=function(c,f,l,t,q,D,H){if(null!=c){q=null!=q?q:Error(c);q.stack=null!=q.stack?q.stack:"";D=null!=D?D:0>c.indexOf("NetworkError")&&0>c.indexOf("SecurityError")&&0>c.indexOf("NS_ERROR_FAILURE")&&0>c.indexOf("out of memory")?"SEVERE":"CONFIG";try{EditorUi.enableLogging&&"1"!=urlParams.dev&&c!=EditorUi.lastErrorMessage&&0>c.indexOf("extension:")&&0>c.indexOf("ResizeObserver loop completed with undelivered notifications")&&0>q.stack.indexOf("extension:")&&0>q.stack.indexOf("<anonymous>:")&&+0>q.stack.indexOf("/math/es5/")&&(EditorUi.lastErrorMessage=c,(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+D+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(c)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(l)+(null!=t?":colno:"+encodeURIComponent(t):"")+(""!=q.stack?"&stack="+encodeURIComponent(q.stack):""))}catch(N){}try{H||null==window.console||console.error(D,c,f,l,t,q)}catch(N){}}};EditorUi.logEvent=function(c){if("1"==urlParams.dev)EditorUi.debug("logEvent",c);else if(EditorUi.enableLogging)try{var f=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=f+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=c?"&data="+encodeURIComponent(JSON.stringify(c)):"")}catch(l){}};EditorUi.sendReport=function(c,f){if("1"==urlParams.dev)EditorUi.debug("sendReport",c);else if(EditorUi.enableLogging)try{f=null!=f?f:5E4,c.length>f&&(c=c.substring(0,f)+"\n...[SHORTENED]"),mxUtils.post("/email","version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&data="+encodeURIComponent(c))}catch(l){}};EditorUi.debug=function(){try{if(null!=window.console&&"1"==urlParams.test){for(var c=[(new Date).toISOString()],f=0;f<arguments.length;f++)c.push(arguments[f]);console.log.apply(console,c)}}catch(l){}};EditorUi.removeChildNodes=function(c){for(;null!=c.firstChild;)c.removeChild(c.firstChild)};EditorUi.embedSvgImages=function(c){c=c.getElementsByTagName("image");for(var f=[],l=0;l<c.length;l++)f.push(c[l]);for(l=0;l<f.length;l++)EditorUi.replaceSvgImage(f[l])};EditorUi.replaceSvgImage=function(c){try{var f=null;f=null==c.getAttributeNS?c.getAttribute("xlink:href"):c.getAttributeNS(mxConstants.NS_XLINK,"href");var l=EditorUi.getSvgSubtree(f);if(null!=l&&"svg"==l.nodeName){l.setAttribute("x",c.getAttribute("x"));l.setAttribute("y",c.getAttribute("y"));l.setAttribute("width",c.getAttribute("width"));l.setAttribute("height",c.getAttribute("height"));l.style.fontFamily="initial";var t=mxUtils.createElementNs(l.ownerDocument,mxConstants.NS_SVG,"g");t.appendChild(l);c.hasAttribute("transform")&&t.setAttribute("transform",c.getAttribute("transform"));c.parentNode.replaceChild(t,c)}}catch(q){}};EditorUi.getSvgSubtree=function(c){var f=Graph.getSvgFromDataUri(c);c=null;if(null!=f){c=Graph.sanitizeNode(mxUtils.parseXml(f).documentElement);f=c.getElementsByTagName("style");if(0<f.length){var l="svg-image-"+Editor.guid();c.setAttribute("id",l);for(var t=document.implementation.createHTMLDocument(""),-q=document.createElement("style"),D=0;D<f.length;D++){q.textContent=f[D].textContent;t.body.appendChild(q);for(var G="",N=0;N<q.sheet.cssRules.length;N++){var L=q.sheet.cssRules[N];if(null!=L.selectorText){for(var J=L.selectorText.split(","),Y=0;Y<J.length;Y++)J[Y]="#"+l+" "+J[Y];L.selectorText=J.join(",")}G+=L.cssText+"\n"}f[D].textContent=G}}f=c.getElementsByTagName("*");for(l=0;l<f.length;l++)f[l].removeAttribute("data-cell-id")}return c};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';+q=document.createElement("style"),D=0;D<f.length;D++){q.textContent=f[D].textContent;t.body.appendChild(q);for(var H="",N=0;N<q.sheet.cssRules.length;N++){var L=q.sheet.cssRules[N];if(null!=L.selectorText){for(var J=L.selectorText.split(","),Y=0;Y<J.length;Y++)J[Y]="#"+l+" "+J[Y];L.selectorText=J.join(",")}H+=L.cssText+"\n"}f[D].textContent=H}}f=c.getElementsByTagName("*");for(l=0;l<f.length;l++)f[l].removeAttribute("data-cell-id")}return c};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.timeout=Editor.prototype.timeout;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=1200;EditorUi.prototype.maxTextWidth=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=2E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.maxTextBytes=5E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.insertTemplateEnabled=!0;EditorUi.prototype.closableScratchpad=!0;EditorUi.prototype.embedExportBorder=8;EditorUi.prototype.embedExportTheme="auto";EditorUi.prototype.embedExportBackground=null;EditorUi.prototype.shareCursorPosition=!0;EditorUi.prototype.showRemoteCursors=!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;EditorUi.prototype.webpSupported=!1;try{var c=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!c.getContext||!c.getContext("2d"))}catch(q){}try{var f=document.createElement("canvas"),@@ -3487,118 +3489,118 @@ EditorUi.prototype.getLocalData=function(c,f){f(localStorage.getItem(c))};Editorfunction(){return this.shareCursorPosition};EditorUi.prototype.setShowRemoteCursors=function(c){this.showRemoteCursors=c;this.fireEvent(new mxEventObject("showRemoteCursorsChanged"))};EditorUi.prototype.isShowRemoteCursors=function(){return this.showRemoteCursors};EditorUi.prototype.setMathEnabled=function(c){var f=this.editor.graph;f.mathEnabled=c;null!=f.view.backgroundImage&&(f.view.backgroundImage.destroy(),f.view.backgroundImage=null);this.editor.updateGraphComponents();f.refresh();f.defaultMathEnabled=c;this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(c){return this.editor.graph.mathEnabled};EditorUi.prototype.setAdaptiveColors=function(c){this.editor.graph.setAdaptiveColors(c);this.editor.graph.view.clear();this.fireEvent(new mxEventObject("adaptiveColorsChanged"))};EditorUi.prototype.isStandaloneApp=function(){return mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(c){return this.isOfflineApp()||!navigator.onLine||!c&&("1"==urlParams.stealth||"1"==urlParams.lockdown)};EditorUi.prototype.isExternalDataComms=function(){return"1"!=urlParams.offline&&!this.isOffline()&&!this.isOfflineApp()};EditorUi.prototype.createSpinner=function(c,f,l){var t=null==c||null==f;l=null!=l?l:24;var q=new Spinner({lines:12,length:l,width:Math.round(l/3),radius:Math.round(l/2),rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,-hwaccel:!1,zIndex:2E9}),D=this.timeout,G=q.spin,N=null,L=null,J=mxUtils.bind(this,function(ea){null!=ea&&ea()}),Y=this;q.spin=function(ea,aa,na,W){W=null!=W?W:D;var ba=!1;if(!this.active){var ja=Date.now();null!=na&&(N=window.setTimeout(function(){q.stop();N=null;na({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:L})},W));t&&(f=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,c=document.body.clientWidth/2-2);ea==document.body&&"1"==urlParams.embedInline&&-(ea=Y.diagramContainer,c=ea.scrollLeft+ea.clientWidth/2,f=ea.scrollTop+ea.clientHeight/2);G.call(this,ea);"1"==urlParams.embedInline&&null!=q.el&&(q.el.style.marginTop=ea.scrollTop+"px",q.el.style.marginLeft=ea.scrollLeft+"px");this.active=!0;null!=aa&&(ba=document.createElement("div"),ba.className="geSpinnerStatus",ba.style.position="absolute",ba.style.whiteSpace="nowrap",ba.style.background="#4B4243",ba.style.color="white",ba.style.fontFamily=Editor.defaultHtmlFont,ba.style.fontSize="9pt",ba.style.padding=+hwaccel:!1,zIndex:2E9}),D=this.timeout,H=q.spin,N=null,L=null,J=mxUtils.bind(this,function(ea){null!=ea&&ea()}),Y=this;q.spin=function(ea,aa,na,W){W=null!=W?W:D;var ba=!1;if(!this.active){var ja=Date.now();null!=na&&(N=window.setTimeout(function(){q.stop();N=null;na({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:L})},W));t&&(f=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,c=document.body.clientWidth/2-2);ea==document.body&&"1"==urlParams.embedInline&&+(ea=Y.diagramContainer,c=ea.scrollLeft+ea.clientWidth/2,f=ea.scrollTop+ea.clientHeight/2);H.call(this,ea);"1"==urlParams.embedInline&&null!=q.el&&(q.el.style.marginTop=ea.scrollTop+"px",q.el.style.marginLeft=ea.scrollLeft+"px");this.active=!0;null!=aa&&(ba=document.createElement("div"),ba.className="geSpinnerStatus",ba.style.position="absolute",ba.style.whiteSpace="nowrap",ba.style.background="#4B4243",ba.style.color="white",ba.style.fontFamily=Editor.defaultHtmlFont,ba.style.fontSize="9pt",ba.style.padding="6px",ba.style.paddingLeft="10px",ba.style.paddingRight="10px",ba.style.zIndex=2E9,ba.style.left=Math.max(0,c)+"px",ba.style.top=Math.max(0,f+70)+"px",mxUtils.setPrefixedStyle(ba.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(ba.style,"transform","translate(-50%,-50%)"),Editor.isDarkMode()||mxUtils.setPrefixedStyle(ba.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=aa.substring(aa.length-3,aa.length)&&"!"!=aa.charAt(aa.length-1)&&(aa+="..."),ba.innerText=aa,ea.appendChild(ba),q.status=ba);this.pause=mxUtils.bind(this,function(){var ca=J;this.active&&(W=Math.max(0,W-(Date.now()-ja)),ca=mxUtils.bind(this,function(la){this.spin(ea,aa,na,W);if(null!=la)try{la(),L=mxUtils.bind(this,function(){this.spin(ea,aa,na,W);try{la()}catch(Q){null!=na&&na(Q)}})}catch(Q){null!=na&&na(Q)}}));this.stop();return ca});ba=!0}return ba};var ha=q.stop;q.stop=function(){ha.call(this);this.active&&(this.active=!1,null!=N&&(window.clearTimeout(N),N=null),null!=q.status&&null!=q.status.parentNode&&q.status.parentNode.removeChild(q.status),q.status=null)};q.pause=function(){return J};return q};EditorUi.prototype.isCompatibleString=function(c){try{var f=mxUtils.parseXml(c),l=this.editor.extractGraphModel(f.documentElement,!0);return null!=l&&0==l.getElementsByTagName("parsererror").length}catch(t){}return!1};EditorUi.isVisioFilename=function(c){return/(\.v(dx|sdx?))($|\?)/i.test(c)||/(\.vs(x|sx?))($|\?)/i.test(c)};EditorUi.prototype.isVisioData=function(c){return 8<c.length&&(208==c.charCodeAt(0)&&207==c.charCodeAt(1)&&17==c.charCodeAt(2)&&224==c.charCodeAt(3)&&161==c.charCodeAt(4)&&177==c.charCodeAt(5)&&26==c.charCodeAt(6)&&225==c.charCodeAt(7)||80==c.charCodeAt(0)&&75==c.charCodeAt(1)&&3==c.charCodeAt(2)&&4==c.charCodeAt(3)||80==c.charCodeAt(0)&&75==c.charCodeAt(1)&&3==c.charCodeAt(2)&&6==c.charCodeAt(3))};EditorUi.prototype.isRemoteVisioData=function(c){return 8<c.length&&(208==c.charCodeAt(0)&&207==c.charCodeAt(1)&&17==c.charCodeAt(2)&&224==c.charCodeAt(3)&&161==c.charCodeAt(4)&&177==c.charCodeAt(5)&&26==c.charCodeAt(6)&&225==c.charCodeAt(7)||-60==c.charCodeAt(0)&&63==c.charCodeAt(1)&&120==c.charCodeAt(2)&&109==c.charCodeAt(3)&&108==c.charCodeAt(3))};var b=EditorUi.prototype.createKeyHandler;EditorUi.prototype.createKeyHandler=function(c){var f=b.apply(this,arguments);if(!this.editor.chromeless||this.editor.editable){var l=f.getFunction,t=this.editor.graph,q=this;f.getFunction=function(D){if(t.isSelectionEmpty()&&null!=q.pages&&0<q.pages.length){var G=q.getSelectedPageIndex();if(mxEvent.isShiftDown(D)){if(37==D.keyCode)return function(){0<-G&&q.movePage(G,G-1)};if(38==D.keyCode)return function(){0<G&&q.movePage(G,0)};if(39==D.keyCode)return function(){G<q.pages.length-1&&q.movePage(G,G+1)};if(40==D.keyCode)return function(){G<q.pages.length-1&&q.movePage(G,q.pages.length-1)}}else if(mxEvent.isControlDown(D)||mxClient.IS_MAC&&mxEvent.isMetaDown(D)){if(37==D.keyCode)return function(){0<G&&q.selectNextPage(!1)};if(38==D.keyCode)return function(){0<G&&q.selectPage(q.pages[0])};if(39==D.keyCode)return function(){G<q.pages.length-1&&q.selectNextPage(!0)};-if(40==D.keyCode)return function(){G<q.pages.length-1&&q.selectPage(q.pages[q.pages.length-1])}}}return!(65<=D.keyCode&&90>=D.keyCode)||t.isSelectionEmpty()||mxEvent.isAltDown(D)||mxEvent.isShiftDown(D)||mxEvent.isControlDown(D)||mxClient.IS_MAC&&mxEvent.isMetaDown(D)?l.apply(this,arguments):null}}return f};var e=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var f=e.apply(this,arguments);if(null==f)try{var l=c.indexOf("<mxfile ");if(0<=l){var t=-c.lastIndexOf("</mxfile>");t>l&&(f=c.substring(l,t+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else{var q=mxUtils.parseXml(c),D=this.editor.extractGraphModel(q.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility);f=null!=D?mxUtils.getXml(D):""}}catch(G){}return f};EditorUi.prototype.validateFileData=function(c){if(null!=c&&0<c.length){var f=c.indexOf('<meta charset="utf-8">');0<=f&&(c=c.slice(0,f)+'<meta charset="utf-8"/>'++60==c.charCodeAt(0)&&63==c.charCodeAt(1)&&120==c.charCodeAt(2)&&109==c.charCodeAt(3)&&108==c.charCodeAt(3))};var b=EditorUi.prototype.createKeyHandler;EditorUi.prototype.createKeyHandler=function(c){var f=b.apply(this,arguments);if(!this.editor.chromeless||this.editor.editable){var l=f.getFunction,t=this.editor.graph,q=this;f.getFunction=function(D){if(t.isSelectionEmpty()&&null!=q.pages&&0<q.pages.length){var H=q.getSelectedPageIndex();if(mxEvent.isShiftDown(D)){if(37==D.keyCode)return function(){0<+H&&q.movePage(H,H-1)};if(38==D.keyCode)return function(){0<H&&q.movePage(H,0)};if(39==D.keyCode)return function(){H<q.pages.length-1&&q.movePage(H,H+1)};if(40==D.keyCode)return function(){H<q.pages.length-1&&q.movePage(H,q.pages.length-1)}}else if(mxEvent.isControlDown(D)||mxClient.IS_MAC&&mxEvent.isMetaDown(D)){if(37==D.keyCode)return function(){0<H&&q.selectNextPage(!1)};if(38==D.keyCode)return function(){0<H&&q.selectPage(q.pages[0])};if(39==D.keyCode)return function(){H<q.pages.length-1&&q.selectNextPage(!0)};+if(40==D.keyCode)return function(){H<q.pages.length-1&&q.selectPage(q.pages[q.pages.length-1])}}}return!(65<=D.keyCode&&90>=D.keyCode)||t.isSelectionEmpty()||mxEvent.isAltDown(D)||mxEvent.isShiftDown(D)||mxEvent.isControlDown(D)||mxClient.IS_MAC&&mxEvent.isMetaDown(D)?l.apply(this,arguments):null}}return f};var e=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var f=e.apply(this,arguments);if(null==f)try{var l=c.indexOf("<mxfile ");if(0<=l){var t=+c.lastIndexOf("</mxfile>");t>l&&(f=c.substring(l,t+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else{var q=mxUtils.parseXml(c),D=this.editor.extractGraphModel(q.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility);f=null!=D?mxUtils.getXml(D):""}}catch(H){}return f};EditorUi.prototype.validateFileData=function(c){if(null!=c&&0<c.length){var f=c.indexOf('<meta charset="utf-8">');0<=f&&(c=c.slice(0,f)+'<meta charset="utf-8"/>'+c.slice(f+23-1,c.length));c=Graph.zapGremlins(c)}return c};EditorUi.prototype.replaceFileData=function(c,f){EditorUi.debug("EditorUi.replaceFileData",[this],"data",[c],"patches",f);c=this.validateFileData(c);c=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var l=null!=c?this.editor.extractGraphModel(c,!0):null;null!=l&&(c=l);if(null!=c){l=this.editor.graph;l.model.beginUpdate();try{var t=null!=this.pages?this.pages.slice():null,q=c.getElementsByTagName("diagram");if(1<q.length||1==q.length&&-q[0].hasAttribute("name")){this.fileNode=c;this.pages=null!=this.pages?this.pages:[];for(var D=q.length-1;0<=D;D--){var G=this.updatePageRoot(new DiagramPage(q[D]));null==G.getName()&&G.setName(mxResources.get("pageWithNumber",[D+1]));l.model.execute(new ChangePage(this,G,0==D?G:null,0))}}else null==this.fileNode&&(this.fileNode=c.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(c.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",-[1])),l.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(c),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,l.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0)));if(null!=t)for(D=0;D<t.length;D++)l.model.execute(new ChangePage(this,t[D],null));var N=this.getCurrentFile();null!=N&&N.fileReplaced(f)}finally{l.model.endUpdate()}}};EditorUi.prototype.createFileData=function(c,f,l,t,q,D,G,N,L,J,Y,ha,ea){f=+q[0].hasAttribute("name")){this.fileNode=c;this.pages=null!=this.pages?this.pages:[];for(var D=q.length-1;0<=D;D--){var H=this.updatePageRoot(new DiagramPage(q[D]));null==H.getName()&&H.setName(mxResources.get("pageWithNumber",[D+1]));l.model.execute(new ChangePage(this,H,0==D?H:null,0))}}else null==this.fileNode&&(this.fileNode=c.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(c.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",+[1])),l.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(c),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,l.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0)));if(null!=t)for(D=0;D<t.length;D++)l.model.execute(new ChangePage(this,t[D],null));var N=this.getCurrentFile();null!=N&&N.fileReplaced(f)}finally{l.model.endUpdate()}}};EditorUi.prototype.createFileData=function(c,f,l,t,q,D,H,N,L,J,Y,ha,ea){f=null!=f?f:this.editor.graph;q=null!=q?q:!1;L=null!=L?L:!0;Y=null!=Y?Y:!Editor.defaultCompressed;var aa=null;if(null==l||l.getMode()==App.MODE_DEVICE||l.getMode()==App.MODE_BROWSER)var na="_blank";else aa=na=t;if(null==c)return"";var W=c;if("mxfile"!=W.nodeName.toLowerCase()){if(Y){var ba=c.ownerDocument.createElement("diagram");ba.setAttribute("name",mxResources.get("pageWithNumber",[1]));ba.setAttribute("id",Editor.guid());ba.appendChild(c)}else{ba=Graph.zapGremlins(mxUtils.getXml(c));W=Graph.compress(ba);if(Graph.decompress(W)!=ba)return ba;ba=c.ownerDocument.createElement("diagram");ba.setAttribute("name",mxResources.get("pageWithNumber",[1]));ba.setAttribute("id",Editor.guid());mxUtils.setTextContent(ba,W)}W=c.ownerDocument.createElement("mxfile");W.appendChild(ba)}J?(W=W.cloneNode(!0),W.removeAttribute("modified"),W.removeAttribute("host"),W.removeAttribute("agent"),W.removeAttribute("etag"),W.removeAttribute("userAgent"),W.removeAttribute("version"),W.removeAttribute("editor"),W.removeAttribute("type")):(W.removeAttribute("userAgent"),W.removeAttribute("modified"),W.removeAttribute("version"),W.removeAttribute("editor"),W.removeAttribute("pages"),W.removeAttribute("type"),W.removeAttribute("etag"),mxClient.IS_CHROMEAPP?W.setAttribute("host","Chrome"):EditorUi.isElectronApp?W.setAttribute("host","Electron"):W.setAttribute("host",window.location.hostname),W.setAttribute("agent",null!=navigator.userAgent?navigator.userAgent:navigator.appVersion),W.setAttribute("version",EditorUi.VERSION),1<W.getElementsByTagName("diagram").length&&-null!=this.pages&&W.setAttribute("pages",this.pages.length));null!=ha&&(W=W.cloneNode(!0),W.setAttribute("scale",ha));null!=ea&&(W=W.cloneNode(!0),W.setAttribute("border",ea));c=Y?mxUtils.getPrettyXml(W):mxUtils.getXml(W);if(!D&&!q&&(G||null!=l&&/(\.html)$/i.test(l.getTitle())))c=this.getHtml2(mxUtils.getXml(W),f,null!=l?l.getTitle():null,na,aa);else if(D||!q&&null!=l&&/(\.svg)$/i.test(l.getTitle()))null==l||l.getMode()!=App.MODE_DEVICE&&l.getMode()!=App.MODE_BROWSER||(t=null),l=this.getSvgFileProperties(W),+null!=this.pages&&W.setAttribute("pages",this.pages.length));null!=ha&&(W=W.cloneNode(!0),W.setAttribute("scale",ha));null!=ea&&(W=W.cloneNode(!0),W.setAttribute("border",ea));c=Y?mxUtils.getPrettyXml(W):mxUtils.getXml(W);if(!D&&!q&&(H||null!=l&&/(\.html)$/i.test(l.getTitle())))c=this.getHtml2(mxUtils.getXml(W),f,null!=l?l.getTitle():null,na,aa);else if(D||!q&&null!=l&&/(\.svg)$/i.test(l.getTitle()))null==l||l.getMode()!=App.MODE_DEVICE&&l.getMode()!=App.MODE_BROWSER||(t=null),l=this.getSvgFileProperties(W),c=this.getEmbeddedSvg(c,f,t,null,N,L,aa,null,null,l.scale,l.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,f,l,t){c=null!=c?c:!0;f=null!=f?f:!1;l=null!=l?l:!Editor.defaultCompressed;var q=this.editor.getGraphXml(c,t);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(L){var J=L.getElementsByTagName("mxGraphModel"),Y=0<J.length?J[0]:null;J=L;null==Y&&l?(Y=mxUtils.getNodeValue(L),0<Y.length&&(Y=Graph.decompress(Y),null!=Y&&0<Y.length&&(J=L.cloneNode(!1),-J.appendChild(mxUtils.parseXml(Y).documentElement)))):null==Y||l?J=L.cloneNode(!0):(J=L.cloneNode(!1),mxUtils.setTextContent(J,Graph.compressNode(Y)));q.appendChild(J)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(q),q=this.fileNode.cloneNode(!1),f)c(this.currentPage.node);else for(f=0;f<this.pages.length;f++){var D=this.pages[f],G=D.node;if(D!=this.currentPage)if(D.needsUpdate){var N=new mxCodec(mxUtils.createXmlDocument());N=N.encode(new mxGraphModel(D.root));-this.editor.graph.saveViewState(D.viewState,N,null,t);EditorUi.removeChildNodes(G);G.appendChild(N);delete D.needsUpdate}else t&&(this.updatePageRoot(D),null!=D.viewState.backgroundImage&&(null!=D.viewState.backgroundImage.originalSrc?D.viewState.backgroundImage=this.createImageForPageLink(D.viewState.backgroundImage.originalSrc,D):Graph.isPageLink(D.viewState.backgroundImage.src)&&(D.viewState.backgroundImage=this.createImageForPageLink(D.viewState.backgroundImage.src,D))),null!=D.viewState.backgroundImage&&-null!=D.viewState.backgroundImage.originalSrc&&(N=new mxCodec(mxUtils.createXmlDocument()),N=N.encode(new mxGraphModel(D.root)),this.editor.graph.saveViewState(D.viewState,N,null,t),G=G.cloneNode(!1),G.appendChild(N)));c(G)}return q};EditorUi.prototype.anonymizeString=function(c,f){for(var l=[],t=0;t<c.length;t++){var q=c.charAt(t);0<=EditorUi.ignoredAnonymizedChars.indexOf(q)?l.push(q):isNaN(parseInt(q))?q.toLowerCase()!=q?l.push(String.fromCharCode(65+Math.round(25*Math.random()))):q.toUpperCase()!=+J.appendChild(mxUtils.parseXml(Y).documentElement)))):null==Y||l?J=L.cloneNode(!0):(J=L.cloneNode(!1),mxUtils.setTextContent(J,Graph.compressNode(Y)));q.appendChild(J)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(q),q=this.fileNode.cloneNode(!1),f)c(this.currentPage.node);else for(f=0;f<this.pages.length;f++){var D=this.pages[f],H=D.node;if(D!=this.currentPage)if(D.needsUpdate){var N=new mxCodec(mxUtils.createXmlDocument());N=N.encode(new mxGraphModel(D.root));+this.editor.graph.saveViewState(D.viewState,N,null,t);EditorUi.removeChildNodes(H);H.appendChild(N);delete D.needsUpdate}else t&&(this.updatePageRoot(D),null!=D.viewState.backgroundImage&&(null!=D.viewState.backgroundImage.originalSrc?D.viewState.backgroundImage=this.createImageForPageLink(D.viewState.backgroundImage.originalSrc,D):Graph.isPageLink(D.viewState.backgroundImage.src)&&(D.viewState.backgroundImage=this.createImageForPageLink(D.viewState.backgroundImage.src,D))),null!=D.viewState.backgroundImage&&+null!=D.viewState.backgroundImage.originalSrc&&(N=new mxCodec(mxUtils.createXmlDocument()),N=N.encode(new mxGraphModel(D.root)),this.editor.graph.saveViewState(D.viewState,N,null,t),H=H.cloneNode(!1),H.appendChild(N)));c(H)}return q};EditorUi.prototype.anonymizeString=function(c,f){for(var l=[],t=0;t<c.length;t++){var q=c.charAt(t);0<=EditorUi.ignoredAnonymizedChars.indexOf(q)?l.push(q):isNaN(parseInt(q))?q.toLowerCase()!=q?l.push(String.fromCharCode(65+Math.round(25*Math.random()))):q.toUpperCase()!=q?l.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(q)?l.push(" "):l.push("?"):l.push(f?"0":Math.round(9*Math.random()))}return l.join("")};EditorUi.prototype.anonymizePatch=function(c){c=mxUtils.clone(c);if(null!=c[EditorUi.DIFF_INSERT])for(var f=0;f<c[EditorUi.DIFF_INSERT].length;f++)try{var l=mxUtils.parseXml(c[EditorUi.DIFF_INSERT][f].data).documentElement.cloneNode(!1);null!=l.getAttribute("name")&&l.setAttribute("name",this.anonymizeString(l.getAttribute("name")));c[EditorUi.DIFF_INSERT][f].data=-mxUtils.getXml(l)}catch(D){c[EditorUi.DIFF_INSERT][f].data=D.message}if(null!=c[EditorUi.DIFF_UPDATE]){for(var t in c[EditorUi.DIFF_UPDATE]){var q=c[EditorUi.DIFF_UPDATE][t];null!=q.name&&(q.name=this.anonymizeString(q.name));null!=q.cells&&(f=mxUtils.bind(this,function(D){var G=q.cells[D];if(null!=G){for(var N in G)null!=G[N].value&&(G[N].value="["+G[N].value.length+"]"),null!=G[N].xmlValue&&(G[N].xmlValue="["+G[N].xmlValue.length+"]"),null!=G[N].style&&(G[N].style="["+G[N].style.length+"]"),mxUtils.isEmptyObject(G[N])&&-delete G[N];mxUtils.isEmptyObject(G)&&delete q.cells[D]}}),f(EditorUi.DIFF_INSERT),f(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(q.cells)&&delete q.cells);mxUtils.isEmptyObject(q)&&delete c[EditorUi.DIFF_UPDATE][t]}mxUtils.isEmptyObject(c[EditorUi.DIFF_UPDATE])&&delete c[EditorUi.DIFF_UPDATE]}return c};EditorUi.prototype.anonymizeAttributes=function(c,f){if(null!=c.attributes)for(var l=0;l<c.attributes.length;l++)"as"!=c.attributes[l].name&&c.setAttribute(c.attributes[l].name,this.anonymizeString(c.attributes[l].value,+mxUtils.getXml(l)}catch(D){c[EditorUi.DIFF_INSERT][f].data=D.message}if(null!=c[EditorUi.DIFF_UPDATE]){for(var t in c[EditorUi.DIFF_UPDATE]){var q=c[EditorUi.DIFF_UPDATE][t];null!=q.name&&(q.name=this.anonymizeString(q.name));null!=q.cells&&(f=mxUtils.bind(this,function(D){var H=q.cells[D];if(null!=H){for(var N in H)null!=H[N].value&&(H[N].value="["+H[N].value.length+"]"),null!=H[N].xmlValue&&(H[N].xmlValue="["+H[N].xmlValue.length+"]"),null!=H[N].style&&(H[N].style="["+H[N].style.length+"]"),mxUtils.isEmptyObject(H[N])&&+delete H[N];mxUtils.isEmptyObject(H)&&delete q.cells[D]}}),f(EditorUi.DIFF_INSERT),f(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(q.cells)&&delete q.cells);mxUtils.isEmptyObject(q)&&delete c[EditorUi.DIFF_UPDATE][t]}mxUtils.isEmptyObject(c[EditorUi.DIFF_UPDATE])&&delete c[EditorUi.DIFF_UPDATE]}return c};EditorUi.prototype.anonymizeAttributes=function(c,f){if(null!=c.attributes)for(var l=0;l<c.attributes.length;l++)"as"!=c.attributes[l].name&&c.setAttribute(c.attributes[l].name,this.anonymizeString(c.attributes[l].value,f));if(null!=c.childNodes)for(l=0;l<c.childNodes.length;l++)this.anonymizeAttributes(c.childNodes[l],f)};EditorUi.prototype.anonymizeNode=function(c,f){f=c.getElementsByTagName("mxCell");for(var l=0;l<f.length;l++)null!=f[l].getAttribute("value")&&f[l].setAttribute("value","["+f[l].getAttribute("value").length+"]"),null!=f[l].getAttribute("xmlValue")&&f[l].setAttribute("xmlValue","["+f[l].getAttribute("xmlValue").length+"]"),null!=f[l].getAttribute("style")&&f[l].setAttribute("style","["+f[l].getAttribute("style").length+"]"),null!=f[l].parentNode&&"root"!=f[l].parentNode.nodeName&&null!=f[l].parentNode.parentNode&&(f[l].setAttribute("id",f[l].parentNode.getAttribute("id")),f[l].parentNode.parentNode.replaceChild(f[l],f[l].parentNode));return c};EditorUi.prototype.synchronizeCurrentFile=function(c){var f=this.getCurrentFile();null!=f&&(f.savingFile?this.handleError({message:mxResources.get("busy")}):!c&&f.invalidChecksum?f.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&-(f.clearAutosave(),this.clearStatus(),c?f.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){this.spinner.stop();f.handleFileError(l,!0)})):f.synchronizeFile(mxUtils.bind(this,function(){f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){f.handleFileError(l,!0)}))))};EditorUi.prototype.getFileData=function(c,f,l,t,q,D,G,N,L,J,Y,ha,ea){q=null!=q?q:!0;D=null!=D?D:!1;J=null!=J?J:!Editor.defaultCompressed;+(f.clearAutosave(),this.clearStatus(),c?f.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){this.spinner.stop();f.handleFileError(l,!0)})):f.synchronizeFile(mxUtils.bind(this,function(){f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){f.handleFileError(l,!0)}))))};EditorUi.prototype.getFileData=function(c,f,l,t,q,D,H,N,L,J,Y,ha,ea){q=null!=q?q:!0;D=null!=D?D:!1;J=null!=J?J:!Editor.defaultCompressed;var aa=this.editor.graph;if((f||!c&&null!=L&&/(\.svg)$/i.test(L.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var na=aa.getGlobalVariable;aa=this.createTemporaryGraph(aa.getStylesheet());aa.setBackgroundImage=this.editor.graph.setBackgroundImage;aa.background=this.editor.graph.background;var W=null!=this.pages?this.pages[0]:null;null==W||this.currentPage==W?aa.setBackgroundImage(this.editor.graph.backgroundImage):null!=W.viewState&&null!=W.viewState&&aa.setBackgroundImage(W.viewState.backgroundImage);-aa.getGlobalVariable=function(ba){return"page"==ba&&null!=W?W.getName():"pagenumber"==ba?1:na.apply(this,arguments)};document.body.appendChild(aa.container);null!=W&&aa.model.setRoot(W.root)}G=null!=G?G:this.getXmlFileData(q,D,J,Y);L=null!=L?L:this.getCurrentFile();c=this.createFileData(G,aa,L,window.location.href,c,f,l,t,q,N,J,ha,ea);aa!=this.editor.graph&&aa.container.parentNode.removeChild(aa.container);return c};EditorUi.prototype.getHtml=function(c,f,l,t,q,D){D=null!=D?D:!0;var G=null,N=EditorUi.drawHost+-"/js/embed-static.min.js";if(null!=f){G=D?f.getGraphBounds():f.getBoundingBox(f.getSelectionCells());var L=f.view.scale;D=Math.floor(G.x/L-f.view.translate.x);L=Math.floor(G.y/L-f.view.translate.y);G=f.background;null==q&&(f=this.getBasenames().join(";"),0<f.length&&(N=EditorUi.drawHost+"/embed.js?s="+f));c.setAttribute("x0",D);c.setAttribute("y0",L)}null!=c&&(c.setAttribute("pan","1"),c.setAttribute("zoom","1"),c.setAttribute("resize","0"),c.setAttribute("fit","0"),c.setAttribute("border","20"),+aa.getGlobalVariable=function(ba){return"page"==ba&&null!=W?W.getName():"pagenumber"==ba?1:na.apply(this,arguments)};document.body.appendChild(aa.container);null!=W&&aa.model.setRoot(W.root)}H=null!=H?H:this.getXmlFileData(q,D,J,Y);L=null!=L?L:this.getCurrentFile();c=this.createFileData(H,aa,L,window.location.href,c,f,l,t,q,N,J,ha,ea);aa!=this.editor.graph&&aa.container.parentNode.removeChild(aa.container);return c};EditorUi.prototype.getHtml=function(c,f,l,t,q,D){D=null!=D?D:!0;var H=null,N=EditorUi.drawHost++"/js/embed-static.min.js";if(null!=f){H=D?f.getGraphBounds():f.getBoundingBox(f.getSelectionCells());var L=f.view.scale;D=Math.floor(H.x/L-f.view.translate.x);L=Math.floor(H.y/L-f.view.translate.y);H=f.background;null==q&&(f=this.getBasenames().join(";"),0<f.length&&(N=EditorUi.drawHost+"/embed.js?s="+f));c.setAttribute("x0",D);c.setAttribute("y0",L)}null!=c&&(c.setAttribute("pan","1"),c.setAttribute("zoom","1"),c.setAttribute("resize","0"),c.setAttribute("fit","0"),c.setAttribute("border","20"),c.setAttribute("links","1"),null!=t&&c.setAttribute("edit",t));null!=q&&(q=q.replace(/&/g,"&"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";t=Graph.compress(c);Graph.decompress(t)!=c&&(t=encodeURIComponent(c));return(null==q?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=q?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==q?null!=l?"<title>"+mxUtils.htmlEntities(l)+"</title>\n":"":"<title>draw.io</title>\n")+-(null!=q?'<meta http-equiv="refresh" content="0;URL=\''+q+"'\"/>\n":"")+"</head>\n<body"+(null==q&&null!=G&&G!=mxConstants.NONE?' style="background-color:'+G+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+t+"</div>\n</div>\n"+(null==q?'<script type="text/javascript" src="'+N+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+q+'" target="_blank"><img border="0" src="'++(null!=q?'<meta http-equiv="refresh" content="0;URL=\''+q+"'\"/>\n":"")+"</head>\n<body"+(null==q&&null!=H&&H!=mxConstants.NONE?' style="background-color:'+H+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+t+"</div>\n</div>\n"+(null==q?'<script type="text/javascript" src="'+N+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+q+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(c,f,l,t,q){f=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";null!=q&&(q=q.replace(/&/g,"&"));c={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:Graph.zapGremlins(c),toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(c.page=mxUtils.indexOf(this.pages,this.currentPage));return(null==q?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=q?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==q?null!=l?"<title>"+mxUtils.htmlEntities(l)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=q?'<meta http-equiv="refresh" content="0;URL=\''+q+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(c))+'"></div>\n'+(null==q?'<script type="text/javascript" src="'+f+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+q+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.setFileData=function(c){c=this.validateFileData(c);this.pages=this.fileNode=this.currentPage=null;var f=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null,l=Editor.extractParserError(f,mxResources.get("invalidOrMissingFile"));if(l)throw EditorUi.debug("EditorUi.setFileData ParserError",[this],"data",[c],"node",[f],"cause",[l]),Error(mxResources.get("notADiagramFile")+" ("+l+")");c=null!=f?this.editor.extractGraphModel(f,!0):null;null!=c&&(f=c);if(null!=f&&"mxfile"==f.nodeName&&(c=f.getElementsByTagName("diagram"),l={},0<c.length)){var t=this.getHashObject(),q=null;this.fileNode=f;this.pages=[];for(var D=0;D<c.length;D++){null==c[D].getAttribute("id")&&c[D].setAttribute("id",D);f=new DiagramPage(c[D]);null==f.getName()&&f.setName(mxResources.get("pageWithNumber",[D+1]));this.pages.push(f);if(null==t.pageId&&null!=urlParams["page-id"]&&f.getId()==urlParams["page-id"]||null!=t.pageId&&f.getId()==t.pageId)q=f;if(null==l[f.getId()])l[f.getId()]=f;else throw Error(f.getId()+": Duplicate page ID");}this.currentPage=null!=q?q:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];f=this.currentPage.node}null==this.fileNode&&null!=f&&(this.fileNode=f.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(f.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",-[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(f);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,this.currentPage.setDiagramModified(!1),this.scrollToPage());if(null!=urlParams["layer-ids"])try{var G=decodeURIComponent(urlParams["layer-ids"]).split(" ");f={};for(D=0;D<G.length;D++)f[G[D]]=!0;var N=this.editor.graph.getModel(),L=N.getChildren(N.root);for(D=0;D<L.length;D++){var J=L[D];N.setVisible(J,f[J.id]||!1)}}catch(Y){}};EditorUi.prototype.getBaseFilename=+[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(f);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,this.currentPage.setDiagramModified(!1),this.scrollToPage());if(null!=urlParams["layer-ids"])try{var H=decodeURIComponent(urlParams["layer-ids"]).split(" ");f={};for(D=0;D<H.length;D++)f[H[D]]=!0;var N=this.editor.graph.getModel(),L=N.getChildren(N.root);for(D=0;D<L.length;D++){var J=L[D];N.setVisible(J,f[J.id]||!1)}}catch(Y){}};EditorUi.prototype.getBaseFilename=function(c){var f=this.getCurrentFile();f=null!=f&&null!=f.getTitle()?f.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(f)||/(\.html)$/i.test(f)||/(\.svg)$/i.test(f)||/(\.png)$/i.test(f))f=f.substring(0,f.lastIndexOf("."));/(\.drawio)$/i.test(f)&&(f=f.substring(0,f.lastIndexOf(".")));!c&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(f=f+"-"+this.currentPage.getName());return f};EditorUi.prototype.downloadFile=-function(c,f,l,t,q,D,G,N,L,J,Y,ha,ea,aa,na,W){try{t=null!=t?t:this.editor.graph.isSelectionEmpty();var ba=this.getBaseFilename(!q),ja=ba+("xml"==c||"pdf"==c&&Y?".drawio":"")+"."+c;if("xml"==c){var ca=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,t,q,null,null,null,f);this.saveData(ja,c,ca,"text/xml")}else if("html"==c)ca=this.getHtml2(this.getFileData(!0),this.editor.graph,ba),this.saveData(ja,c,ca,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==-c?ja=ba+".png":"jpeg"==c&&(ja=ba+".jpg"),this.saveRequest(ja,c,mxUtils.bind(this,function(I,U){try{return this.createDownloadRequest(I,c,t,U,G,q,N,L,J,Y,ha,void 0,void 0,!D,ea,aa,na,W)}catch(P){this.handleError(P)}}));else{var la=null,Q=mxUtils.bind(this,function(I){I.length<=MAX_REQUEST_SIZE?this.saveData(ja,"svg",I,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(la)}))});if("svg"==c){var k=this.editor.graph.background;-if(G||k==mxConstants.NONE)k=null;var B=this.editor.graph.getSvg(k,null,null,null,null,t);l&&this.editor.graph.addSvgShadow(B);this.editor.convertImages(B,mxUtils.bind(this,mxUtils.bind(this,function(I){this.spinner.stop();Q(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(I))})))}else ja=ba+".svg",la=this.getFileData(!1,!0,null,mxUtils.bind(this,function(I){this.spinner.stop();Q(I)}),t)}}catch(I){this.handleError(I)}};EditorUi.prototype.createDownloadRequest=function(c,f,l,t,q,D,G,N,-L,J,Y,ha,ea,aa,na,W,ba,ja){c=this.downloadRequestBuilder(c,f,l,t,q,D,G,N,L,J,Y,ha,ea,aa,na,W,ba,ja);f="";for(var ca in c)l=c[ca],null!=l&&(f+=ca+"="+encodeURIComponent(l)+"&");return new mxXmlRequest(EXPORT_URL,f)};EditorUi.prototype.downloadRequestBuilder=function(c,f,l,t,q,D,G,N,L,J,Y,ha,ea,aa,na,W,ba,ja){var ca=this.editor.graph,la=ca.getGraphBounds();l=this.getFileData(!0,null,null,null,l,0==D?!1:"xmlpng"!=f,null,null,null,!Editor.defaultCompressed,"pdf"==f);var Q=null,k=null,B=null;if(!EditorUi.isElectronApp&&+function(c,f,l,t,q,D,H,N,L,J,Y,ha,ea,aa,na,W){try{t=null!=t?t:this.editor.graph.isSelectionEmpty();var ba=this.getBaseFilename(!q),ja=ba+("xml"==c||"pdf"==c&&Y?".drawio":"")+"."+c;if("xml"==c){var ca=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,t,q,null,null,null,f);this.saveData(ja,c,ca,"text/xml")}else if("html"==c)ca=this.getHtml2(this.getFileData(!0),this.editor.graph,ba),this.saveData(ja,c,ca,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==+c?ja=ba+".png":"jpeg"==c&&(ja=ba+".jpg"),this.saveRequest(ja,c,mxUtils.bind(this,function(I,U){try{return this.createDownloadRequest(I,c,t,U,H,q,N,L,J,Y,ha,void 0,void 0,!D,ea,aa,na,W)}catch(P){this.handleError(P)}}));else{var la=null,Q=mxUtils.bind(this,function(I){I.length<=MAX_REQUEST_SIZE?this.saveData(ja,"svg",I,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(la)}))});if("svg"==c){var k=this.editor.graph.background;+if(H||k==mxConstants.NONE)k=null;var B=this.editor.graph.getSvg(k,null,null,null,null,t);l&&this.editor.graph.addSvgShadow(B);this.editor.convertImages(B,mxUtils.bind(this,mxUtils.bind(this,function(I){this.spinner.stop();Q(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(I))})))}else ja=ba+".svg",la=this.getFileData(!1,!0,null,mxUtils.bind(this,function(I){this.spinner.stop();Q(I)}),t)}}catch(I){this.handleError(I)}};EditorUi.prototype.createDownloadRequest=function(c,f,l,t,q,D,H,N,+L,J,Y,ha,ea,aa,na,W,ba,ja){c=this.downloadRequestBuilder(c,f,l,t,q,D,H,N,L,J,Y,ha,ea,aa,na,W,ba,ja);f="";for(var ca in c)l=c[ca],null!=l&&(f+=ca+"="+encodeURIComponent(l)+"&");return new mxXmlRequest(EXPORT_URL,f)};EditorUi.prototype.downloadRequestBuilder=function(c,f,l,t,q,D,H,N,L,J,Y,ha,ea,aa,na,W,ba,ja){var ca=this.editor.graph,la=ca.getGraphBounds();l=this.getFileData(!0,null,null,null,l,0==D?!1:"xmlpng"!=f,null,null,null,!Editor.defaultCompressed,"pdf"==f);var Q=null,k=null,B=null;if(!EditorUi.isElectronApp&&(la.width*la.height>MAX_AREA||l.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};J=J?"1":"0";"pdf"==f&&(null!=Y?(Q=Y.from,k=Y.to):0==D&&(B="1"));"xmlpng"==f&&(J="1",f="png");if(("xmlpng"==f||"svg"==f)&&null!=this.pages&&null!=this.currentPage)for(D=0;D<this.pages.length;D++)if(this.pages[D]==this.currentPage){Q=D;break}D=ca.background;"png"!=f&&"pdf"!=f&&"svg"!=f||!q?q||null!=D&&D!=mxConstants.NONE||(D="#ffffff"):D=mxConstants.NONE;q={globalVars:ca.getExportVariables()};-L&&(q.grid={size:ca.gridSize,steps:ca.view.gridSteps,color:Editor.isDarkMode()&&"pdf"==f?mxGraphView.prototype.defaultGridColor:ca.view.gridColor});Graph.translateDiagram&&(q.diagramLanguage=Graph.diagramLanguage);return{format:f,from:Q,to:k,allPages:B,bg:null!=D?D:mxConstants.NONE,base64:t,embedXml:J,xml:l,filename:null!=c?c:"",extras:JSON.stringify(q),scale:G,border:N,pageMargin:na,w:ha&&isFinite(ha)?ha:null,h:ea&&isFinite(ea)?ea:null,crop:null!=aa&&aa?"1":"0",fit:null!=W&&W?"1":"0",sheetsAcross:ba,+L&&(q.grid={size:ca.gridSize,steps:ca.view.gridSteps,color:Editor.isDarkMode()&&"pdf"==f?mxGraphView.prototype.defaultGridColor:ca.view.gridColor});Graph.translateDiagram&&(q.diagramLanguage=Graph.diagramLanguage);return{format:f,from:Q,to:k,allPages:B,bg:null!=D?D:mxConstants.NONE,base64:t,embedXml:J,xml:l,filename:null!=c?c:"",extras:JSON.stringify(q),scale:H,border:N,pageMargin:na,w:ha&&isFinite(ha)?ha:null,h:ea&&isFinite(ea)?ea:null,crop:null!=aa&&aa?"1":"0",fit:null!=W&&W?"1":"0",sheetsAcross:ba,sheetsDown:ja}};EditorUi.prototype.setMode=function(c,f){this.mode=c};EditorUi.prototype.getDiagramId=function(){var c=window.location.hash;null!=c&&0<c.length&&(c=c.substring(1));if(null!=c&&1<c.length){var f=c.indexOf("#");0<=f&&(c=c.substring(0,f))}return c};EditorUi.prototype.getHashObject=function(){var c=window.location.hash,f={};if(null!=c&&0<c.length){var l=c.lastIndexOf("#");if(0<l){c=decodeURIComponent(c.substring(l+1));try{f=JSON.parse(c)}catch(t){}}}return f};EditorUi.prototype.updateHashObject=function(){if(null!=this.currentFile&&null!=this.currentPage&&""!=this.currentFile.getHash()){var c=this.getHashObject();c.pageId=this.currentPage.getId();this.setHashObject(c)}else this.setHashObject(null)};EditorUi.prototype.setHashObject=function(c){if(Editor.enableHashObjects){var f=window.location.hash;if(null==f||""==f)f="#";var l=f.lastIndexOf("#");0<l&&(f=f.substring(0,l));try{null==c||mxUtils.isEmptyObject(c)||(f=f+"#"+encodeURIComponent(JSON.stringify(c)))}catch(t){}0<l&&0<f.lastIndexOf("#")?-window.location.hash=f:window.location.replace(f)}};EditorUi.prototype.loadDescriptor=function(c,f,l){var t=window.location.hash,q=mxUtils.bind(this,function(G){var N=null!=c.data?c.data:"";null!=G&&0<G.length&&(0<N.length&&(N+="\n"),N+=G);G=new LocalFile(this,"csv"!=c.format&&0<N.length?N:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);G.getHash=function(){return t};this.fileLoaded(G);"csv"==c.format&&this.importCsv(N,mxUtils.bind(this,function(ea){this.editor.undoManager.clear();+window.location.hash=f:window.location.replace(f)}};EditorUi.prototype.loadDescriptor=function(c,f,l){var t=window.location.hash,q=mxUtils.bind(this,function(H){var N=null!=c.data?c.data:"";null!=H&&0<H.length&&(0<N.length&&(N+="\n"),N+=H);H=new LocalFile(this,"csv"!=c.format&&0<N.length?N:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);H.getHash=function(){return t};this.fileLoaded(H);"csv"==c.format&&this.importCsv(N,mxUtils.bind(this,function(ea){this.editor.undoManager.clear();this.editor.setModified(!1);this.clearStatus()}));if(null!=c.update){var L=null!=c.interval?parseInt(c.interval):6E4,J=null,Y=mxUtils.bind(this,function(){var ea=this.currentPage;mxUtils.post(c.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(aa){ea===this.currentPage&&(200<=aa.getStatus()&&300>=aa.getStatus()?(this.updateDiagram(aa.getText()),ha()):this.handleError({message:mxResources.get("error")+" "+aa.getStatus()}))}),mxUtils.bind(this,function(aa){this.handleError(aa)}))}),-ha=mxUtils.bind(this,function(){window.clearTimeout(J);J=window.setTimeout(Y,L)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){ha();Y()}));ha();Y()}null!=f&&f()});if(null!=c.url&&0<c.url.length){var D=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(D,mxUtils.bind(this,function(G){q(G)}),mxUtils.bind(this,function(G){null!=l&&l(G)}))}else q("")};EditorUi.prototype.updateDiagram=function(c){function f(la){var Q=new mxCellOverlay(la.image||q.warningImage,la.tooltip,la.align,-la.valign,la.offset);Q.addListener(mxEvent.CLICK,function(k,B){t.alert(la.tooltip)});return Q}var l=null,t=this;if(null!=c&&0<c.length&&(l=mxUtils.parseXml(c),c=null!=l?l.documentElement:null,null!=c&&"updates"==c.nodeName)){var q=this.editor.graph,D=q.getModel();D.beginUpdate();var G=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var N=D.getCell(c.getAttribute("id"));if(null!=N){try{var L=c.getAttribute("value");if(null!=L){var J=mxUtils.parseXml(L).documentElement;if(null!=J)if("1"==+ha=mxUtils.bind(this,function(){window.clearTimeout(J);J=window.setTimeout(Y,L)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){ha();Y()}));ha();Y()}null!=f&&f()});if(null!=c.url&&0<c.url.length){var D=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(D,mxUtils.bind(this,function(H){q(H)}),mxUtils.bind(this,function(H){null!=l&&l(H)}))}else q("")};EditorUi.prototype.updateDiagram=function(c){function f(la){var Q=new mxCellOverlay(la.image||q.warningImage,la.tooltip,la.align,+la.valign,la.offset);Q.addListener(mxEvent.CLICK,function(k,B){t.alert(la.tooltip)});return Q}var l=null,t=this;if(null!=c&&0<c.length&&(l=mxUtils.parseXml(c),c=null!=l?l.documentElement:null,null!=c&&"updates"==c.nodeName)){var q=this.editor.graph,D=q.getModel();D.beginUpdate();var H=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var N=D.getCell(c.getAttribute("id"));if(null!=N){try{var L=c.getAttribute("value");if(null!=L){var J=mxUtils.parseXml(L).documentElement;if(null!=J)if("1"==J.getAttribute("replace-value"))D.setValue(N,J);else for(var Y=J.attributes,ha=0;ha<Y.length;ha++)q.setAttributeForCell(N,Y[ha].nodeName,0<Y[ha].nodeValue.length?Y[ha].nodeValue:null)}}catch(la){null!=window.console&&console.log("Error in value for "+N.id+": "+la)}try{var ea=c.getAttribute("style");null!=ea&&q.model.setStyle(N,ea)}catch(la){null!=window.console&&console.log("Error in style for "+N.id+": "+la)}try{var aa=c.getAttribute("icon");if(null!=aa){var na=0<aa.length?JSON.parse(aa):null;null!=na&&na.append||q.removeCellOverlays(N);null!=na&&q.addCellOverlay(N,f(na))}}catch(la){null!=window.console&&console.log("Error in icon for "+N.id+": "+la)}try{var W=c.getAttribute("geometry");if(null!=W){W=JSON.parse(W);var ba=q.getCellGeometry(N);if(null!=ba){ba=ba.clone();for(key in W){var ja=parseFloat(W[key]);"dx"==key?ba.x+=ja:"dy"==key?ba.y+=ja:"dw"==key?ba.width+=ja:"dh"==key?ba.height+=ja:ba[key]=parseFloat(W[key])}q.model.setGeometry(N,ba)}}}catch(la){null!=window.console&&console.log("Error in icon for "+-N.id+": "+la)}}}else if("model"==c.nodeName){for(var ca=c.firstChild;null!=ca&&ca.nodeType!=mxConstants.NODETYPE_ELEMENT;)ca=ca.nextSibling;null!=ca&&(new mxCodec(c.firstChild)).decode(ca,D)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(q.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))q.view.translate=new mxPoint(parseFloat(c.getAttribute("dx")||0),parseFloat(c.getAttribute("dy")||0))}else"fit"==c.nodeName&&(G=c.hasAttribute("max-scale")?parseFloat(c.getAttribute("max-scale")):-1);c=c.nextSibling}}finally{D.endUpdate()}null!=G&&this.chromelessResize&&this.chromelessResize(!0,G)}return l};EditorUi.prototype.getCopyFilename=function(c,f){var l=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var t=l.lastIndexOf(".");0<=t&&(c=l.substring(t),l=l.substring(0,t));if(f){f=l;var q=new Date;l=q.getFullYear();t=q.getMonth()+1;var D=q.getDate(),G=q.getHours(),N=q.getMinutes();q=q.getSeconds();l=f+(" "+(l+"-"+t+"-"+D+"-"+G+"-"+N+"-"+q))}return l=mxResources.get("copyOf",+N.id+": "+la)}}}else if("model"==c.nodeName){for(var ca=c.firstChild;null!=ca&&ca.nodeType!=mxConstants.NODETYPE_ELEMENT;)ca=ca.nextSibling;null!=ca&&(new mxCodec(c.firstChild)).decode(ca,D)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(q.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))q.view.translate=new mxPoint(parseFloat(c.getAttribute("dx")||0),parseFloat(c.getAttribute("dy")||0))}else"fit"==c.nodeName&&(H=c.hasAttribute("max-scale")?parseFloat(c.getAttribute("max-scale")):+1);c=c.nextSibling}}finally{D.endUpdate()}null!=H&&this.chromelessResize&&this.chromelessResize(!0,H)}return l};EditorUi.prototype.getCopyFilename=function(c,f){var l=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var t=l.lastIndexOf(".");0<=t&&(c=l.substring(t),l=l.substring(0,t));if(f){f=l;var q=new Date;l=q.getFullYear();t=q.getMonth()+1;var D=q.getDate(),H=q.getHours(),N=q.getMinutes();q=q.getSeconds();l=f+(" "+(l+"-"+t+"-"+D+"-"+H+"-"+N+"-"+q))}return l=mxResources.get("copyOf",[l])+c};EditorUi.prototype.logIfModified=function(c,f){try{null!=c&&f&&EditorUi.debug("File.closed",[c])}catch(l){}};EditorUi.prototype.fileLoaded=function(c,f,l){var t=this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrentFile(null);var q=!1;this.hideDialog();null!=t&&(t.removeListener(this.descriptorChangedListener),this.logIfModified(t,!0),t.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var D=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=t&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);!f&&null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fname.innerText="");this.clearStatus();this.updateUi();f||this.showSplash()});if(null!=c)try{this.openingFile=!0;this.setCurrentFile(c);c.addListener("descriptorChanged",this.descriptorChangedListener);c.addListener("contentChanged",this.descriptorChangedListener);c.open();delete this.openingFile;this.setGraphEnabled(!0);this.setMode(c.getMode());this.editor.graph.model.prefix=Editor.guid()+"-";this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();c.isEditable()?c.isModified()?c.addUnsavedStatus():this.clearStatus():this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus('<div class="geStatusBox" title="'+mxUtils.htmlEntities(mxResources.get("readOnly"))+'">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+-"</div>")}));!this.editor.isChromelessView()||this.editor.editable?(this.editor.graph.selectUnlockedLayer(),this.showLayersDialog(),this.restoreLibraries(),window.self!==window.top&&window.focus()):this.editor.graph.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();null!=l&&l();this.editor.fireEvent(new mxEventObject("fileLoaded"));q=!0;if(!this.isOffline()&&null!=c.getMode()){var G="1"==urlParams.sketch?"sketch":uiTheme;if(null==G)G="default";else if("sketch"==G||-"min"==G)G+=Editor.isDarkMode()?"-dark":"-light"}EditorUi.debug("File.opened",[c]);"1"==urlParams.viewerOnlyMsg&&this.showAlert(mxResources.get("viewerOnlyMsg"));if(this.editor.editable&&this.mode==c.getMode()&&c.getMode()!=App.MODE_DEVICE&&null!=c.getMode())try{this.addRecent({id:c.getHash(),title:c.getTitle(),mode:c.getMode()})}catch(N){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(N){}}catch(N){this.fileLoadedError=N;if(null!=c)try{c.close()}catch(L){}c=+"</div>")}));!this.editor.isChromelessView()||this.editor.editable?(this.editor.graph.selectUnlockedLayer(),this.showLayersDialog(),this.restoreLibraries(),window.self!==window.top&&window.focus()):this.editor.graph.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();null!=l&&l();this.editor.fireEvent(new mxEventObject("fileLoaded"));q=!0;if(!this.isOffline()&&null!=c.getMode()){var H="1"==urlParams.sketch?"sketch":uiTheme;if(null==H)H="default";else if("sketch"==H||+"min"==H)H+=Editor.isDarkMode()?"-dark":"-light"}EditorUi.debug("File.opened",[c]);"1"==urlParams.viewerOnlyMsg&&this.showAlert(mxResources.get("viewerOnlyMsg"));if(this.editor.editable&&this.mode==c.getMode()&&c.getMode()!=App.MODE_DEVICE&&null!=c.getMode())try{this.addRecent({id:c.getHash(),title:c.getTitle(),mode:c.getMode()})}catch(N){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(N){}}catch(N){this.fileLoadedError=N;if(null!=c)try{c.close()}catch(L){}c=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=t?this.fileLoaded(t)||D():D()});f?c():(null!=N.fallbackFileData&&(N.alternateAction={label:mxResources.get("makeCopy"),funct:mxUtils.bind(this,function(){this.hideDialog();var L=new LocalFile(this,N.fallbackFileData,this.defaultFilename,!0);this.fileLoaded(L)})}),this.handleError(N,mxResources.get("errorLoadingFile"),c,!0,null,null,-!0))}else D();return q};EditorUi.prototype.getHashValueForPages=function(c,f){var l=0,t=new mxGraphModel,q=new mxCodec;null!=f&&(f.byteCount=0,f.attrCount=0,f.eltCount=0,f.nodeCount=0);for(var D=0;D<c.length;D++){this.updatePageRoot(c[D]);var G=c[D].node.cloneNode(!1);G.removeAttribute("name");t.root=c[D].root;var N=q.encode(t);this.editor.graph.saveViewState(c[D].viewState,N,!0);N.removeAttribute("pageWidth");N.removeAttribute("pageHeight");G.appendChild(N);null!=f&&(f.eltCount+=G.getElementsByTagName("*").length,-f.nodeCount+=G.getElementsByTagName("mxCell").length);l=(l<<5)-l+this.hashValue(G,function(L,J,Y,ha){return!ha||"mxGeometry"!=L.nodeName&&"mxPoint"!=L.nodeName||"x"!=J&&"y"!=J&&"width"!=J&&"height"!=J?ha&&"mxCell"==L.nodeName&&"previous"==J?null:Y:Math.round(Y)},f)<<0}return l};EditorUi.prototype.hashValue=function(c,f,l){var t=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&"string"===typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(t^=this.hashValue(c.nodeName,-f,l));if(null!=c.attributes){null!=l&&(l.attrCount+=c.attributes.length);for(var q=0;q<c.attributes.length;q++){var D=c.attributes[q].name,G=null!=f?f(c,D,c.attributes[q].value,!0):c.attributes[q].value;null!=G&&(t^=this.hashValue(D,f,l)+this.hashValue(G,f,l))}}if(null!=c.childNodes)for(q=0;q<c.childNodes.length;q++)t=(t<<5)-t+this.hashValue(c.childNodes[q],f,l)<<0}else if(null!=c&&"function"!==typeof c){c=String(c);f=0;null!=l&&(l.byteCount+=c.length);for(q=0;q<c.length;q++)f=(f<<5)-f+c.charCodeAt(q)<<-0;t^=f}return t};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,f,l,t,q,D,G){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?StorageFile.getFileContent(this,".scratchpad",mxUtils.bind(this,function(c){null==c&&(c=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,+!0))}else D();return q};EditorUi.prototype.getHashValueForPages=function(c,f){var l=0,t=new mxGraphModel,q=new mxCodec;null!=f&&(f.byteCount=0,f.attrCount=0,f.eltCount=0,f.nodeCount=0);for(var D=0;D<c.length;D++){this.updatePageRoot(c[D]);var H=c[D].node.cloneNode(!1);H.removeAttribute("name");t.root=c[D].root;var N=q.encode(t);this.editor.graph.saveViewState(c[D].viewState,N,!0);N.removeAttribute("pageWidth");N.removeAttribute("pageHeight");H.appendChild(N);null!=f&&(f.eltCount+=H.getElementsByTagName("*").length,+f.nodeCount+=H.getElementsByTagName("mxCell").length);l=(l<<5)-l+this.hashValue(H,function(L,J,Y,ha){return!ha||"mxGeometry"!=L.nodeName&&"mxPoint"!=L.nodeName||"x"!=J&&"y"!=J&&"width"!=J&&"height"!=J?ha&&"mxCell"==L.nodeName&&"previous"==J?null:Y:Math.round(Y)},f)<<0}return l};EditorUi.prototype.hashValue=function(c,f,l){var t=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&"string"===typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(t^=this.hashValue(c.nodeName,+f,l));if(null!=c.attributes){null!=l&&(l.attrCount+=c.attributes.length);for(var q=0;q<c.attributes.length;q++){var D=c.attributes[q].name,H=null!=f?f(c,D,c.attributes[q].value,!0):c.attributes[q].value;null!=H&&(t^=this.hashValue(D,f,l)+this.hashValue(H,f,l))}}if(null!=c.childNodes)for(q=0;q<c.childNodes.length;q++)t=(t<<5)-t+this.hashValue(c.childNodes[q],f,l)<<0}else if(null!=c&&"function"!==typeof c){c=String(c);f=0;null!=l&&(l.byteCount+=c.length);for(q=0;q<c.length;q++)f=(f<<5)-f+c.charCodeAt(q)<<+0;t^=f}return t};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,f,l,t,q,D,H){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?StorageFile.getFileContent(this,".scratchpad",mxUtils.bind(this,function(c){null==c&&(c=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,c,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(c){if(!Editor.defaultCompressed)for(var f=0;f<c.length;f++)null!=c[f].xml&&"<"!=c[f].xml.charAt(0)&&(c[f].xml=mxUtils.trim(Graph.decompress(c[f].xml)));f=mxUtils.createXmlDocument();var l=f.createElement("mxlibrary");mxUtils.setTextContent(l,JSON.stringify(c,null,2));f.appendChild(l);return mxUtils.getXml(f,"\n")};EditorUi.prototype.closeLibrary=function(c){null!=c&&(this.removeLibrarySidebar(c.getHash()),c.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(c.getHash()),".scratchpad"==c.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(c){var f=this.sidebar.palettes[c];if(null!=f){for(var l=0;l<f.length;l++)f[l].parentNode.removeChild(f[l]);delete this.sidebar.palettes[c]}};EditorUi.prototype.repositionLibrary=function(c,f){var l=this.sidebar.getEntryContainer();if(!this.sidebar.appendCustomLibraries||null!=c||!f){null==c&&(f=this.sidebar.palettes["L.scratchpad"],null==f&&(f=this.sidebar.palettes.search),null!=f&&(c=f[f.length-1].nextSibling));c=null!=c?c:l.firstChild.nextSibling.nextSibling;f=l.lastChild;var t=f.previousSibling;l.insertBefore(f,c);l.insertBefore(t,f)}};EditorUi.prototype.loadLibrary=function(c,f){var l=mxUtils.parseXml(c.getData());if("mxlibrary"==l.documentElement.nodeName){var t=JSON.parse(mxUtils.getTextContent(l.documentElement));this.libraryLoaded(c,t,l.documentElement.getAttribute("title"),f)}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(c){return""};EditorUi.prototype.showSidebar=function(){null!=this.sidebarWindow?this.sidebarWindow.window.setVisible(!0):this.toggleShapesPanel(!0)};EditorUi.prototype.libraryLoaded=function(c,f,l,t){if(null!=this.sidebar){c.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(c.getHash());var q=null;if(c.constructor!=StorageLibrary||".scratchpad"!=c.title){null==this.openLibraries&&(this.openLibraries=[]);for(var D=0;D<this.openLibraries.length;D++)if(this.openLibraries[D].file.getHash()==-c.getHash()){mxUtils.remove(this.openLibraries[D],this.openLibraries);break}q={file:c,images:f,title:l,expand:t};this.openLibraries.push(q)}else this.scratchpad=c;D=this.sidebar.palettes[c.getHash()];D=null!=D?D[D.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());var G=null,N=mxUtils.bind(this,function(ja,ca){0==ja.length&&c.isEditable()?(null==G&&(G=document.createElement("div"),G.className="geDropTarget",mxUtils.write(G,mxResources.get("dragElementsHere"))),ca.appendChild(G)):this.addLibraryEntries(ja,+c.getHash()){mxUtils.remove(this.openLibraries[D],this.openLibraries);break}q={file:c,images:f,title:l,expand:t};this.openLibraries.push(q)}else this.scratchpad=c;D=this.sidebar.palettes[c.getHash()];D=null!=D?D[D.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());var H=null,N=mxUtils.bind(this,function(ja,ca){0==ja.length&&c.isEditable()?(null==H&&(H=document.createElement("div"),H.className="geDropTarget",mxUtils.write(H,mxResources.get("dragElementsHere"))),ca.appendChild(H)):this.addLibraryEntries(ja,ca)});null!=this.sidebar&&null!=f&&this.sidebar.addEntries(f);null==l&&(l=c.getTitle(),null!=l&&/(\.xml)$/i.test(l)&&(l=l.substring(0,l.lastIndexOf("."))));var L=this.sidebar.addPalette(c.getHash(),l,null!=t?t:!0,mxUtils.bind(this,function(ja){N(f,ja)}));null!=q&&(q.div=L);this.repositionLibrary(D,"L.scratchpad"!=c.getHash());t=L.parentNode.previousSibling;l=t.getAttribute("title");null!=l&&0<l.length&&".scratchpad"!=c.title&&t.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+l);var J=document.createElement("div");J.style.backgroundColor="inherit";t.style.position="relative";var Y=document.createElement("img");Y.className="geLibraryButton";Y.setAttribute("src",Editor.crossImage);Y.setAttribute("title",mxResources.get("close"));var ha=null;if(".scratchpad"!=c.title||this.closableScratchpad)J.appendChild(Y),mxEvent.addListener(Y,"click",mxUtils.bind(this,function(ja){if(!mxEvent.isConsumed(ja)){var ca=mxUtils.bind(this,function(){null!=q&&mxUtils.remove(q,this.openLibraries);this.closeLibrary(c)});null!=ha?this.confirm(mxResources.get("allChangesLost"),null,ca,mxResources.get("cancel"),mxResources.get("discardChanges")):ca();mxEvent.consume(ja)}}));if(c.isEditable()){var ea=this.editor.graph,aa=null;l=mxUtils.bind(this,function(ja){this.showLibraryDialog(c.getTitle(),L,f,c,c.getMode());mxEvent.consume(ja)});var na=mxUtils.bind(this,function(ja){c.setModified(!0);c.isAutosave()?(null!=aa&&null!=aa.parentNode&&aa.parentNode.removeChild(aa),aa=Y.cloneNode(!1),aa.setAttribute("src",Editor.spinImage),aa.setAttribute("title",mxResources.get("saving")),aa.style.cursor="default",aa.style.marginRight="2px",aa.style.marginTop="-2px",J.insertBefore(aa,J.firstChild),this.saveLibrary(c.getTitle(),f,c,c.getMode(),!0,!0,function(){null!=aa&&null!=aa.parentNode&&aa.parentNode.removeChild(aa)})):null==ha&&(ha=Y.cloneNode(!1),ha.setAttribute("src",Editor.saveImage),ha.setAttribute("title",mxResources.get("save")),J.insertBefore(ha,J.firstChild),mxEvent.addListener(ha,"click",mxUtils.bind(this,function(ca){this.saveLibrary(c.getTitle(),f,c,c.getMode(),c.constructor==LocalLibrary,!0,function(){null==ha||c.isModified()||(ha.parentNode.removeChild(ha),ha=null)});mxEvent.consume(ca)})))}),W=mxUtils.bind(this,function(ja,ca,la,Q){ja=ea.cloneCells(mxUtils.sortCells(ea.model.getTopmostCells(ja)));for(var k=0;k<ja.length;k++){var B=ea.getCellGeometry(ja[k]);null!=B&&B.translate(-ca.x,-ca.y)}L.appendChild(this.sidebar.createVertexTemplateFromCells(ja,ca.width,ca.height,Q||"",!0,null,!1));ja=mxUtils.getXml(this.editor.graph.encodeCells(ja));Editor.defaultCompressed&&(ja=-Graph.compress(ja));ca={xml:ja,w:ca.width,h:ca.height};null!=Q&&(ca.title=Q);f.push(ca);na(la);null!=G&&null!=G.parentNode&&0<f.length&&(G.parentNode.removeChild(G),G=null)}),ba=mxUtils.bind(this,function(ja){if(ea.isSelectionEmpty())ea.getRubberband().isActive()?(ea.getRubberband().execute(ja),ea.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var ca=ea.getSelectionCells(),la=ea.view.getBounds(ca);if(null!=la&&0<la.width&&+Graph.compress(ja));ca={xml:ja,w:ca.width,h:ca.height};null!=Q&&(ca.title=Q);f.push(ca);na(la);null!=H&&null!=H.parentNode&&0<f.length&&(H.parentNode.removeChild(H),H=null)}),ba=mxUtils.bind(this,function(ja){if(ea.isSelectionEmpty())ea.getRubberband().isActive()?(ea.getRubberband().execute(ja),ea.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var ca=ea.getSelectionCells(),la=ea.view.getBounds(ca);if(null!=la&&0<la.width&&0<la.height){var Q=ea.view.scale;la.x/=Q;la.y/=Q;la.width/=Q;la.height/=Q;la.x-=ea.view.translate.x;la.y-=ea.view.translate.y;W(ca,la)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(ja)});mxEvent.addGestureListeners(L,function(){},mxUtils.bind(this,function(ja){ea.isMouseDown&&null!=ea.panningManager&&null!=ea.graphHandler.first&&(ea.graphHandler.suspend(),null!=ea.graphHandler.hint&&(ea.graphHandler.hint.style.visibility="hidden"),L.style.backgroundColor="light-dark(#fefefe, #000000)",L.style.cursor="copy",ea.panningManager.stop(),ea.autoScroll=!1,mxEvent.consume(ja))}),mxUtils.bind(this,function(ja){ea.isMouseDown&&null!=ea.panningManager&&null!=ea.graphHandler&&(L.style.backgroundColor="",L.style.cursor="default",this.sidebar.showTooltips=!0,ea.panningManager.stop(),ea.graphHandler.reset(),ea.isMouseDown=!1,ea.autoScroll=!0,ba(ja),mxEvent.consume(ja))}));mxEvent.addListener(L,"mouseleave",mxUtils.bind(this,function(ja){ea.isMouseDown&&null!=ea.graphHandler.first&&(ea.graphHandler.resume(),null!=ea.graphHandler.hint&&(ea.graphHandler.hint.style.visibility="visible"),L.style.backgroundColor="",L.style.cursor="",ea.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(L,"dragover",mxUtils.bind(this,function(ja){L.style.backgroundColor="light-dark(#fefefe, #000000)";ja.dataTransfer.dropEffect="copy";L.style.cursor="copy";this.sidebar.hideTooltip();ja.stopPropagation();ja.preventDefault()})),mxEvent.addListener(L,"drop",mxUtils.bind(this,function(ja){L.style.cursor="";L.style.backgroundColor="";0<ja.dataTransfer.files.length&&this.importFiles(ja.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(ca,la,Q,k,B,I,U,P,T){if(null!=ca&&"image/"==la.substring(0,6))ca="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(ca),ca=[new mxCell("",new mxGeometry(0,0,B,I),ca)],ca[0].vertex=!0,W(ca,new mxRectangle(0,0,B,I),ja,mxEvent.isAltDown(ja)?null:U.substring(0,U.lastIndexOf(".")).replace(/_/g,-" ")),null!=G&&null!=G.parentNode&&0<f.length&&(G.parentNode.removeChild(G),G=null);else{var X=!1,Z=mxUtils.bind(this,function(ka,va){null!=ka&&"application/pdf"==va&&(va=Editor.extractGraphModelFromPdf(ka),null!=va&&0<va.length&&(ka=va));if(null!=ka)if(ka=mxUtils.parseXml(ka),"mxlibrary"==ka.documentElement.nodeName)try{var ua=JSON.parse(mxUtils.getTextContent(ka.documentElement));N(ua,L);f=f.concat(ua);na(ja);this.spinner.stop();X=!0}catch(La){}else if("mxfile"==ka.documentElement.nodeName)try{var qa=-ka.documentElement.getElementsByTagName("diagram");for(ua=0;ua<qa.length;ua++){var Ba=this.stringToCells(Editor.getDiagramNodeXml(qa[ua])),ya=this.editor.graph.getBoundingBoxFromGeometry(Ba);null!=ya&&W(Ba,new mxRectangle(0,0,ya.width,ya.height),ja)}X=!0}catch(La){null!=window.console&&console.log("error in drop handler:",La)}X||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=G&&null!=G.parentNode&&0<f.length&&(G.parentNode.removeChild(G),G=null)});null!=+" ")),null!=H&&null!=H.parentNode&&0<f.length&&(H.parentNode.removeChild(H),H=null);else{var X=!1,Z=mxUtils.bind(this,function(ka,va){null!=ka&&"application/pdf"==va&&(va=Editor.extractGraphModelFromPdf(ka),null!=va&&0<va.length&&(ka=va));if(null!=ka)if(ka=mxUtils.parseXml(ka),"mxlibrary"==ka.documentElement.nodeName)try{var ua=JSON.parse(mxUtils.getTextContent(ka.documentElement));N(ua,L);f=f.concat(ua);na(ja);this.spinner.stop();X=!0}catch(La){}else if("mxfile"==ka.documentElement.nodeName)try{var qa=+ka.documentElement.getElementsByTagName("diagram");for(ua=0;ua<qa.length;ua++){var Ba=this.stringToCells(Editor.getDiagramNodeXml(qa[ua])),ya=this.editor.graph.getBoundingBoxFromGeometry(Ba);null!=ya&&W(Ba,new mxRectangle(0,0,ya.width,ya.height),ja)}X=!0}catch(La){null!=window.console&&console.log("error in drop handler:",La)}X||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=H&&null!=H.parentNode&&0<f.length&&(H.parentNode.removeChild(H),H=null)});null!=T&&null!=U&&EditorUi.isVisioFilename(U)?this.importVisio(T,function(ka){Z(ka,"text/xml")},null,U):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(ca,U)&&null!=T?this.isExternalDataComms()?this.parseFile(T,mxUtils.bind(this,function(ka){4==ka.readyState&&(this.spinner.stop(),200<=ka.status&&299>=ka.status?Z(ka.responseText,"text/xml"):this.handleError({message:mxResources.get(413==ka.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):Z(ca,la)}}));ja.stopPropagation();ja.preventDefault()})),mxEvent.addListener(L,"dragleave",function(ja){L.style.cursor="";L.style.backgroundColor="";ja.stopPropagation();ja.preventDefault()}));Y=Y.cloneNode(!1);Y.setAttribute("src",Editor.editImage);Y.setAttribute("title",mxResources.get("edit"));J.insertBefore(Y,J.firstChild);mxEvent.addListener(Y,"click",l);l=Y.cloneNode(!1);l.setAttribute("src",Editor.plusImage);l.setAttribute("title",mxResources.get("add"));J.insertBefore(l,J.firstChild);mxEvent.addListener(l,"click",ba);".scratchpad"==c.title&&(this.addSelectionToScratchpad=ba);this.isOffline()||".scratchpad"!=c.title||null==EditorUi.scratchpadHelpLink||(l=this.createHelpIcon(EditorUi.scratchpadHelpLink,!0),l.className="geLibraryButton",J.insertBefore(l,J.firstChild))}t.appendChild(J);this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(c,f){for(var l=0;l<c.length;l++)try{var t=-c[l],q=t.data;if(null!=q){q="data:"==q.substring(0,5)?this.convertDataUri(q):q;var D="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==t.aspect&&(D+="aspect=fixed;");D=D+"image="+q+";";null!=t.style&&(D+=t.style);f.appendChild(this.sidebar.createVertexTemplate(D,t.w,t.h,"",t.title||"",!1,null,!0))}else if(null!=t.xml){var G=this.stringToCells("<"==t.xml.charAt(0)?t.xml:Graph.decompress(t.xml)),N=0==G.length?mxResources.get("drawingEmpty"):null!=t.title?t.title:"";-f.appendChild(this.sidebar.createVertexTemplateFromCells(G,t.w,t.h,N,!0,null,!0))}}catch(L){N=null!=L.message?mxResources.get("error")+": "+L.message:String(L),D=this.sidebar.createVertexTemplateFromCells(null,t.w,t.h,N,!0,null,!0),f.appendChild(D)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||-(Editor.configurationKey=".sketch-configuration",Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=function(c,f,l,t,q,D,G){c=new ImageDialog(this,c,f,l,t,q,D,G);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,f,l,t,q,D){var G=localStorage.getItem(f);c=new TextareaDialog(this,c,null!=G?JSON.stringify(JSON.parse(G),null,2):"",mxUtils.bind(this,function(N){if(null!=-N)try{if(null!=D&&D(N),N==G)this.hideDialog();else{if(0<N.length){var L=JSON.parse(N);localStorage.setItem(f,JSON.stringify(L))}else localStorage.removeItem(f);this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(J){this.handleError(J)}}),null,mxResources.get("close"),null,null,null,!0,null,null,q,l,t);this.showDialog(c.container,660,480,!0,!1);c.init()};EditorUi.prototype.showBackgroundImageDialog=function(c,f,l,t){c=null!=c?c:mxUtils.bind(this,function(q,D,G,N){D||(q=-new ChangePageSetup(this,t?G:null,q),q.ignoreColor=!t,null!=N&&t&&(q.shadowVisible=N),this.editor.graph.model.execute(q))});c=new BackgroundImageDialog(this,c,f,l,t);this.showDialog(c.container,400,t?240:220,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,f,l,t,q){c=new LibraryDialog(this,c,f,l,t,q);this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(D){D&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));c.init()};var g=EditorUi.prototype.createFormat;-EditorUi.prototype.createFormat=function(c){var f=g.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(l){this.editor.graph.isSelectionEmpty()&&f.refresh()}));return f};EditorUi.prototype.handleError=function(c,f,l,t,q,D,G){var N=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},L=null!=c&&null!=c.error?c.error:c;if(null!=c&&("1"==urlParams.test||null!=c.stack)&&null!=c.message)try{G||EditorUi.logError("Caught: "+(""==c.message&&-null!=c.name)?c.name:c.message,c.filename,c.lineNumber,c.columnNumber,c,"INFO"),"1"!=urlParams.test&&!G||null==window.console||console.error("EditorUi.handleError:",c)}catch(ea){}if(null!=L||null!=f){G=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var J=mxResources.get("ok"),Y=null;f=null!=f?f:mxResources.get("error");if(null!=L){null!=L.retry&&(J=mxResources.get("cancel"),Y=function(){N();L.retry()});if(404==L.code||404==L.status||403==L.code){G=403==L.code?null!=L.message?mxUtils.htmlEntities(L.message,+c[l],q=t.data;if(null!=q){q="data:"==q.substring(0,5)?this.convertDataUri(q):q;var D="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==t.aspect&&(D+="aspect=fixed;");D=D+"image="+q+";";null!=t.style&&(D+=t.style);f.appendChild(this.sidebar.createVertexTemplate(D,t.w,t.h,"",t.title||"",!1,null,!0))}else if(null!=t.xml){var H=this.stringToCells("<"==t.xml.charAt(0)?t.xml:Graph.decompress(t.xml)),N=0==H.length?mxResources.get("drawingEmpty"):null!=t.title?t.title:"";+f.appendChild(this.sidebar.createVertexTemplateFromCells(H,t.w,t.h,N,!0,null,!0))}}catch(L){N=null!=L.message?mxResources.get("error")+": "+L.message:String(L),D=this.sidebar.createVertexTemplateFromCells(null,t.w,t.h,N,!0,null,!0),f.appendChild(D)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||+(Editor.configurationKey=".sketch-configuration",Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=function(c,f,l,t,q,D,H){c=new ImageDialog(this,c,f,l,t,q,D,H);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,f,l,t,q,D){var H=localStorage.getItem(f);c=new TextareaDialog(this,c,null!=H?JSON.stringify(JSON.parse(H),null,2):"",mxUtils.bind(this,function(N){if(null!=+N)try{if(null!=D&&D(N),N==H)this.hideDialog();else{if(0<N.length){var L=JSON.parse(N);localStorage.setItem(f,JSON.stringify(L))}else localStorage.removeItem(f);this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(J){this.handleError(J)}}),null,mxResources.get("close"),null,null,null,!0,null,null,q,l,t);this.showDialog(c.container,660,480,!0,!1);c.init()};EditorUi.prototype.showBackgroundImageDialog=function(c,f,l,t){c=null!=c?c:mxUtils.bind(this,function(q,D,H,N){D||(q=+new ChangePageSetup(this,t?H:null,q),q.ignoreColor=!t,null!=N&&t&&(q.shadowVisible=N),this.editor.graph.model.execute(q))});c=new BackgroundImageDialog(this,c,f,l,t);this.showDialog(c.container,400,t?240:220,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,f,l,t,q){c=new LibraryDialog(this,c,f,l,t,q);this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(D){D&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));c.init()};var g=EditorUi.prototype.createFormat;+EditorUi.prototype.createFormat=function(c){var f=g.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(l){this.editor.graph.isSelectionEmpty()&&f.refresh()}));return f};EditorUi.prototype.handleError=function(c,f,l,t,q,D,H){var N=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},L=null!=c&&null!=c.error?c.error:c;if(null!=c&&("1"==urlParams.test||null!=c.stack)&&null!=c.message)try{H||EditorUi.logError("Caught: "+(""==c.message&&+null!=c.name)?c.name:c.message,c.filename,c.lineNumber,c.columnNumber,c,"INFO"),"1"!=urlParams.test&&!H||null==window.console||console.error("EditorUi.handleError:",c)}catch(ea){}if(null!=L||null!=f){H=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var J=mxResources.get("ok"),Y=null;f=null!=f?f:mxResources.get("error");if(null!=L){null!=L.retry&&(J=mxResources.get("cancel"),Y=function(){N();L.retry()});if(404==L.code||404==L.status||403==L.code){H=403==L.code?null!=L.message?mxUtils.htmlEntities(L.message,!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),!1):null!=q?q:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.email+")":""),!1);var ha=null!=q?null:null!=D?D:window.location.hash;if(null!=ha&&("#G"==ha.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==ha.substring(0,45))&&(null!=c&&null!=c.error&&(null!=c.error.errors&&0<c.error.errors.length&&"fileAccess"==c.error.errors[0].reason||null!=c.error.data&&-0<c.error.data.length&&"fileAccess"==c.error.data[0].reason)||404==L.code||404==L.status)){ha="#U"==ha.substring(0,2)?ha.substring(45,ha.lastIndexOf("%26ex")):ha.substring(2);this.showError(f,G,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+ha);null!=t&&t()}),Y,mxResources.get("changeUser"),mxUtils.bind(this,function(){function ea(){ba.innerText="";for(var ja=0;ja<aa.length;ja++){var ca=document.createElement("option");+0<c.error.data.length&&"fileAccess"==c.error.data[0].reason)||404==L.code||404==L.status)){ha="#U"==ha.substring(0,2)?ha.substring(45,ha.lastIndexOf("%26ex")):ha.substring(2);this.showError(f,H,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+ha);null!=t&&t()}),Y,mxResources.get("changeUser"),mxUtils.bind(this,function(){function ea(){ba.innerText="";for(var ja=0;ja<aa.length;ja++){var ca=document.createElement("option");mxUtils.write(ca,aa[ja].displayName);ca.value=ja;ba.appendChild(ca);ca=document.createElement("option");ca.innerHTML=" ";mxUtils.write(ca,"<"+aa[ja].email+">");ca.setAttribute("disabled","disabled");ba.appendChild(ca)}ca=document.createElement("option");mxUtils.write(ca,mxResources.get("addAccount"));ca.value=aa.length;ba.appendChild(ca)}var aa=this.drive.getUsersList(),na=document.createElement("div"),W=document.createElement("div");W.style.marginBottom="6px";mxUtils.write(W,mxResources.get("changeUser")+": ");na.appendChild(W);var ba=document.createElement("select");ba.style.width="100%";ea();mxEvent.addListener(ba,"change",mxUtils.bind(this,function(){var ja=ba.value,ca=aa.length!=ja;ca&&this.drive.setUser(aa[ja]);this.drive.authorize(ca,mxUtils.bind(this,function(){ca||(aa=this.drive.getUsersList(),ea())}),mxUtils.bind(this,function(la){this.handleError(la)}),!0)}));na.appendChild(ba);na=new CustomDialog(this,na,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(na.container,-300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=l&&l()}),520,150);return}}null!=L.message?G=""==L.message&&null!=L.name?mxUtils.htmlEntities(L.name,!1):mxUtils.htmlEntities(L.message,!1):null!=L.response&&null!=L.response.error?G=mxUtils.htmlEntities(L.response.error,!1):"undefined"!==typeof window.App&&(L.code==App.ERROR_TIMEOUT?G=mxUtils.htmlEntities(mxResources.get("timeout"),!1):L.code==App.ERROR_BUSY?G=mxUtils.htmlEntities(mxResources.get("busy"),-!1):"string"===typeof L&&0<L.length&&(G=mxUtils.htmlEntities(L,!1)))}q=c=null;null!=L&&null!=L.helpLink?(c=mxResources.get("help"),q=mxUtils.bind(this,function(){return this.editor.graph.openLink(L.helpLink)})):null!=L&&null!=L.ownerEmail?(c=mxResources.get("contactOwner"),G+=mxUtils.htmlEntities(" ("+c+": "+L.ownerEmail+")",!1),q=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(L.ownerEmail))})):null!=L&&null!=L.alternateAction&&(c=L.alternateAction.label,q=L.alternateAction.funct);-this.showError(f,G,J,l,Y,null,null,c,q,null,null,null,t?l:null)}else null!=l&&l()};EditorUi.prototype.alert=function(c,f,l){c=new ErrorDialog(this,null,c,mxResources.get("ok"),f);this.showDialog(c.container,l||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,f,l,t,q,D){c=null!=c?c:"";var G=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},N=Math.min(220,28*Math.ceil(Math.max(1,c.length)/50));c=new ConfirmDialog(this,c,function(){G();null!=f&&f()},function(){G();-null!=l&&l()},t,q,null,null,null,null,N);this.showDialog(c.container,340,46+N,!0,D);c.init()};EditorUi.prototype.showBanner=function(c,f,l,t,q,D,G,N,L){D=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){G=null!=G?G:"translate(-50%,120%)";N=null!=N?N:"translate(-50%,0%)";var J=q?500:1E3,Y=document.createElement("div");Y.className="geBtn gePrimaryBtn geBanner"+(q?" geSmallBanner":"");Y.style.zIndex=mxPopupMenu.prototype.zIndex;-mxUtils.setPrefixedStyle(Y.style,"transform",G);mxUtils.setPrefixedStyle(Y.style,"transition","all "+J+"ms ease");null!=L&&mxUtils.setPrefixedStyle(Y.style,"transform-origin",L);if(!q){var ha=document.createElement("img");ha.setAttribute("src",IMAGE_PATH+"/logo.png");ha.setAttribute("border","0");ha.setAttribute("align","absmiddle");ha.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;";Y.appendChild(ha);ha=document.createElement("img");ha.setAttribute("src",+300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=l&&l()}),520,150);return}}null!=L.message?H=""==L.message&&null!=L.name?mxUtils.htmlEntities(L.name,!1):mxUtils.htmlEntities(L.message,!1):null!=L.response&&null!=L.response.error?H=mxUtils.htmlEntities(L.response.error,!1):"undefined"!==typeof window.App&&(L.code==App.ERROR_TIMEOUT?H=mxUtils.htmlEntities(mxResources.get("timeout"),!1):L.code==App.ERROR_BUSY?H=mxUtils.htmlEntities(mxResources.get("busy"),+!1):"string"===typeof L&&0<L.length&&(H=mxUtils.htmlEntities(L,!1)))}q=c=null;null!=L&&null!=L.helpLink?(c=mxResources.get("help"),q=mxUtils.bind(this,function(){return this.editor.graph.openLink(L.helpLink)})):null!=L&&null!=L.ownerEmail?(c=mxResources.get("contactOwner"),H+=mxUtils.htmlEntities(" ("+c+": "+L.ownerEmail+")",!1),q=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(L.ownerEmail))})):null!=L&&null!=L.alternateAction&&(c=L.alternateAction.label,q=L.alternateAction.funct);+this.showError(f,H,J,l,Y,null,null,c,q,null,null,null,t?l:null)}else null!=l&&l()};EditorUi.prototype.alert=function(c,f,l){c=new ErrorDialog(this,null,c,mxResources.get("ok"),f);this.showDialog(c.container,l||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,f,l,t,q,D){c=null!=c?c:"";var H=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},N=Math.min(220,28*Math.ceil(Math.max(1,c.length)/50));c=new ConfirmDialog(this,c,function(){H();null!=f&&f()},function(){H();+null!=l&&l()},t,q,null,null,null,null,N);this.showDialog(c.container,340,46+N,!0,D);c.init()};EditorUi.prototype.showBanner=function(c,f,l,t,q,D,H,N,L){D=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){H=null!=H?H:"translate(-50%,120%)";N=null!=N?N:"translate(-50%,0%)";var J=q?500:1E3,Y=document.createElement("div");Y.className="geBtn gePrimaryBtn geBanner"+(q?" geSmallBanner":"");Y.style.zIndex=mxPopupMenu.prototype.zIndex;+mxUtils.setPrefixedStyle(Y.style,"transform",H);mxUtils.setPrefixedStyle(Y.style,"transition","all "+J+"ms ease");null!=L&&mxUtils.setPrefixedStyle(Y.style,"transform-origin",L);if(!q){var ha=document.createElement("img");ha.setAttribute("src",IMAGE_PATH+"/logo.png");ha.setAttribute("border","0");ha.setAttribute("align","absmiddle");ha.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;";Y.appendChild(ha);ha=document.createElement("img");ha.setAttribute("src",Dialog.prototype.closeImage);ha.setAttribute("title",mxResources.get(t?"doNotShowAgain":"close"));ha.setAttribute("border","0");ha.style.cssText=(q?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;";Y.appendChild(ha)}mxUtils.write(Y,f);document.body.appendChild(Y);this.bannerShowing=!0;f=document.createElement("div");f.style.cssText="display:flex;align-items:center;justify-content:center;padding-top:6px;font-size:11px;text-align:center;font-weight:normal;";var ea=document.createElement("input");ea.setAttribute("type","checkbox");ea.setAttribute("id","geDoNotShowAgainCheckbox");ea.style.marginRight="6px";if(!t){f.appendChild(ea);var aa=document.createElement("label");aa.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(aa,mxResources.get("doNotShowAgain"));f.appendChild(aa);Y.style.paddingBottom=q?"16px":"30px";Y.appendChild(f)}var na=mxUtils.bind(this,function(){null!=Y.parentNode&&(Y.parentNode.removeChild(Y),this.bannerShowing=!1,ea.checked||-t)&&(this["hideBanner"+c]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings["close"+c]=Date.now(),mxSettings.save()))});null!=ha&&mxEvent.addListener(ha,"click",mxUtils.bind(this,function(ba){mxEvent.consume(ba);na()}));var W=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(Y.style,"transform",G);window.setTimeout(mxUtils.bind(this,function(){na()}),J)});mxEvent.addListener(Y,"click",mxUtils.bind(this,function(ba){var ja=mxEvent.getSource(ba);ja!=ea&&ja!=aa?(null!=l&&l(),na(),+t)&&(this["hideBanner"+c]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings["close"+c]=Date.now(),mxSettings.save()))});null!=ha&&mxEvent.addListener(ha,"click",mxUtils.bind(this,function(ba){mxEvent.consume(ba);na()}));var W=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(Y.style,"transform",H);window.setTimeout(mxUtils.bind(this,function(){na()}),J)});mxEvent.addListener(Y,"click",mxUtils.bind(this,function(ba){var ja=mxEvent.getSource(ba);ja!=ea&&ja!=aa?(null!=l&&l(),na(),mxEvent.consume(ba)):W()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(Y.style,"transform",N)}),J/2);window.setTimeout(W,q?4E3:3E4);D=!0}return D};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=c};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=function(){return this.editor.isExportToCanvas()};EditorUi.prototype.createImageDataUri=function(c,f,l,t){c=c.toDataURL("image/"+l);if(null!=c&&6<c.length)null!=f&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(f))),0<t&&(c=Editor.writeGraphModelToPng(c,"pHYs","dpi",t));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=function(c,f,l,t,q){var D="jpeg"==l?"jpg":l;t=this.getBaseFilename(t)+(null!=f?".drawio":"")+"."+D;c=this.createImageDataUri(c,f,l,q);this.saveData(t,D,c.substring(c.lastIndexOf(",")+1),"image/"+l,!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||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(c,f){c=new TextareaDialog(this,c,f,null,null,mxResources.get("close"));this.showDialog(c.container,620,460,!0,!0,null,null,null,null,!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(c,f,l,t,q,D){"text/xml"!=l||/(\.drawio)$/i.test(f)||/(\.xml)$/i.test(f)||/(\.svg)$/i.test(f)||/(\.html)$/i.test(f)||(f=f+"."+(null!=D?D:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)c=t?this.base64ToBlob(c,l):new Blob([c],{type:l}),navigator.msSaveOrOpenBlob(c,f);else if(mxClient.IS_IE)l=window.open("about:blank","_blank"),null==l?mxUtils.popup(c,!0):(l.document.write(c),l.document.close(),l.document.execCommand("SaveAs",!0,f),l.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||-null==l||"image/"!=l.substring(0,6)?this.showTextDialog(f+":",c):this.openInNewWindow(c,l,t);else{var G=document.createElement("a");D=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof G.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var N=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);D=65==(N?parseInt(N[2],10):!1)?!1:D}if(D||this.isOffline()){G.href=URL.createObjectURL(t?this.base64ToBlob(c,l):new Blob([c],{type:l}));D?G.download=f:G.setAttribute("target",-"_blank");document.body.appendChild(G);try{window.setTimeout(function(){URL.revokeObjectURL(G.href)},2E4),G.click(),G.parentNode.removeChild(G)}catch(L){}}else this.createEchoRequest(c,f,l,t,q).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,f,l,t,q,D){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,c+(null!=l?"&mime="+l:"")+(null!=q?"&format="+q:"")+(null!=D?"&base64="+D:"")+(null!=f?"&filename="+encodeURIComponent(f):"")+(t?"&binary=1":""))};EditorUi.prototype.saveLocalFile=-function(c,f,l,t,q,D,G,N){D=null!=D?D:!1;G=null!=G?G:"vsdx"!=q&&(!mxClient.IS_IOS||!navigator.standalone);var L=mxUtils.bind(this,function(Y,ha,ea,aa){try{if("_blank"==ha)if(null!=l&&"image/"==l.substring(0,6))this.openInNewWindow(c,l,t);else if(null!=l&&"text/html"==l.substring(0,9)){var na=new EmbedDialog(this,c);this.showDialog(na.container,450,240,!0,!0);na.init()}else{var W=window.open("about:blank");null==W?mxUtils.popup(c,!0):(W.document.write("<pre>"+mxUtils.htmlEntities(c,!1)+"</pre>"),W.document.close())}else if(ha==-App.MODE_DEVICE||"download"==ha)this.doSaveLocalFile(c,Y,l,t,null,N);else if(null!=Y&&0<Y.length){var ba=mxUtils.bind(this,function(ja){try{this.exportFile(c,Y,l,t,ha,ja)}catch(ca){this.handleError(ca)}});null!=aa?ba(aa):this.pickFolder(ha,ba)}}catch(ja){this.handleError(ja)}});q=[];D||q.push(App.MODE_BROWSER);G||q.push("_blank");var J=new SaveDialog(this,f,mxUtils.bind(this,function(Y,ha,ea){L(Y.value,ha,Y,ea);this.hideDialog(null,null,J.container)}),q,c,l,t);this.showDialog(J.container,420,110,+null==l||"image/"!=l.substring(0,6)?this.showTextDialog(f+":",c):this.openInNewWindow(c,l,t);else{var H=document.createElement("a");D=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof H.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var N=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);D=65==(N?parseInt(N[2],10):!1)?!1:D}if(D||this.isOffline()){H.href=URL.createObjectURL(t?this.base64ToBlob(c,l):new Blob([c],{type:l}));D?H.download=f:H.setAttribute("target",+"_blank");document.body.appendChild(H);try{window.setTimeout(function(){URL.revokeObjectURL(H.href)},2E4),H.click(),H.parentNode.removeChild(H)}catch(L){}}else this.createEchoRequest(c,f,l,t,q).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,f,l,t,q,D){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,c+(null!=l?"&mime="+l:"")+(null!=q?"&format="+q:"")+(null!=D?"&base64="+D:"")+(null!=f?"&filename="+encodeURIComponent(f):"")+(t?"&binary=1":""))};EditorUi.prototype.saveLocalFile=+function(c,f,l,t,q,D,H,N){D=null!=D?D:!1;H=null!=H?H:"vsdx"!=q&&(!mxClient.IS_IOS||!navigator.standalone);var L=mxUtils.bind(this,function(Y,ha,ea,aa){try{if("_blank"==ha)if(null!=l&&"image/"==l.substring(0,6))this.openInNewWindow(c,l,t);else if(null!=l&&"text/html"==l.substring(0,9)){var na=new EmbedDialog(this,c);this.showDialog(na.container,450,240,!0,!0);na.init()}else{var W=window.open("about:blank");null==W?mxUtils.popup(c,!0):(W.document.write("<pre>"+mxUtils.htmlEntities(c,!1)+"</pre>"),W.document.close())}else if(ha==+App.MODE_DEVICE||"download"==ha)this.doSaveLocalFile(c,Y,l,t,null,N);else if(null!=Y&&0<Y.length){var ba=mxUtils.bind(this,function(ja){try{this.exportFile(c,Y,l,t,ha,ja)}catch(ca){this.handleError(ca)}});null!=aa?ba(aa):this.pickFolder(ha,ba)}}catch(ja){this.handleError(ja)}});q=[];D||q.push(App.MODE_BROWSER);H||q.push("_blank");var J=new SaveDialog(this,f,mxUtils.bind(this,function(Y,ha,ea){L(Y.value,ha,Y,ea);this.hideDialog(null,null,J.container)}),q,c,l,t);this.showDialog(J.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));J.init()};EditorUi.prototype.openInNewWindow=function(c,f,l){var t=window.open("about:blank");if(null==t||null==t.document)mxUtils.popup(c,!0);else{var q="background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==f){var D=mxUtils.parseXml(c).documentElement.style.backgroundColor;""!=D&&(q="background: "+D+";")}q='<html><head><meta charset="UTF-8"></head><body style="color-scheme: light dark; '+q+'">';"image/svg+xml"!=f||mxClient.IS_SVG?"image/svg+xml"!=f||l?(D=l?c:btoa(unescape(encodeURIComponent(c))),t.document.write(q+'<img style="max-width:100%;" src="data:'+f+";base64,"+D+'"/></body></html>')):t.document.write(q+c+"</body></html>"):t.document.write(q+"<pre>"+mxUtils.htmlEntities(c,!1)+"</pre></body></html>");t.document.close()}};var m=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.isChromelessImageExportEnabled=function(){return"draw.io"!=this.getServiceName()||/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)};EditorUi.prototype.addChromelessToolbarItems=function(c){if(null!=urlParams.tags){this.tagsDialog=this.tagsComponent=null;var f=c(mxUtils.bind(this,function(t){null==this.tagsComponent&&(this.tagsComponent=this.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return null!=this.tagsDialog}),!0),this.tagsComponent.div.getElementsByTagName("div")[0].style.position="",mxUtils.setPrefixedStyle(this.tagsComponent.div.style,"borderRadius","5px"),@@ -3608,130 +3610,130 @@ q.zIndex;document.body.appendChild(this.tagsDialog);this.tagsComponent.refresh()this.layersDialog=null)}));this.editor.addListener("layersDialogShown",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));this.editor.addListener("pageSelected",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null);null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));mxEvent.addListener(this.editor.graph.container,"click",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null);null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));if(this.isExportToCanvas()&&this.isChromelessImageExportEnabled()){this.exportDialog=null;var l=c(mxUtils.bind(this,function(t){var q=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",q);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)q.apply(this);else{this.exportDialog=document.createElement("div");var D=l.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily=Editor.defaultHtmlFont;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,80);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 G=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"light-dark(#000000, #C0C0C0)",-speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});G.spin(this.exportDialog);document.body.appendChild(this.exportDialog);mxEvent.addListener(this.editor.graph.container,"click",q);this.editor.exportToCanvas(mxUtils.bind(this,function(N){G.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var L=this.createImageDataUri(N,null,"png");N=document.createElement("img");N.style.maxWidth="140px";N.style.maxHeight="140px";-N.style.cursor="pointer";N.style.backgroundColor="white";N.setAttribute("title",mxResources.get("openInNewWindow"));N.setAttribute("border","0");N.setAttribute("src",L);this.exportDialog.appendChild(N);mxEvent.addListener(N,"click",mxUtils.bind(this,function(){this.openInNewWindow(L.substring(L.indexOf(",")+1),"image/png",!0);q.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(N){G.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),-this.exportDialog=null);this.handleError(N)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(t)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,f,l,t,q){this.isLocalFileSave()?this.saveLocalFile(l,c,t,q,f):this.saveRequest(c,f,mxUtils.bind(this,function(D,G){return this.createEchoRequest(l,D,t,q,f,G)}),l,q,t)};EditorUi.prototype.saveRequest=function(c,f,l,t,q,D,G){G=null!=G?G:!mxClient.IS_IOS||!navigator.standalone;var N=mxUtils.bind(this,+"50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,80);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 H=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"light-dark(#000000, #C0C0C0)",+speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});H.spin(this.exportDialog);document.body.appendChild(this.exportDialog);mxEvent.addListener(this.editor.graph.container,"click",q);this.editor.exportToCanvas(mxUtils.bind(this,function(N){H.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var L=this.createImageDataUri(N,null,"png");N=document.createElement("img");N.style.maxWidth="140px";N.style.maxHeight="140px";+N.style.cursor="pointer";N.style.backgroundColor="white";N.setAttribute("title",mxResources.get("openInNewWindow"));N.setAttribute("border","0");N.setAttribute("src",L);this.exportDialog.appendChild(N);mxEvent.addListener(N,"click",mxUtils.bind(this,function(){this.openInNewWindow(L.substring(L.indexOf(",")+1),"image/png",!0);q.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(N){H.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),+this.exportDialog=null);this.handleError(N)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(t)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,f,l,t,q){this.isLocalFileSave()?this.saveLocalFile(l,c,t,q,f):this.saveRequest(c,f,mxUtils.bind(this,function(D,H){return this.createEchoRequest(l,D,t,q,f,H)}),l,q,t)};EditorUi.prototype.saveRequest=function(c,f,l,t,q,D,H){H=null!=H?H:!mxClient.IS_IOS||!navigator.standalone;var N=mxUtils.bind(this,function(J,Y,ha,ea){if("_blank"==Y||null!=J&&0<J.length){var aa=l("_blank"==Y?null:J,Y==App.MODE_DEVICE||"download"==Y||null==Y||"_blank"==Y?"0":"1");null!=aa&&(Y==App.MODE_DEVICE||"download"==Y||"_blank"==Y?aa.simulate(document,"_blank"):(ha=mxUtils.bind(this,function(na){D=null!=D?D:"pdf"==f?"application/pdf":"image/"+f;if(null!=t)try{this.exportFile(t,J,D,!0,Y,na)}catch(W){this.handleError(W)}else this.spinner.spin(document.body,mxResources.get("saving"))&&aa.send(mxUtils.bind(this,function(){this.spinner.stop();-if(200<=aa.getStatus()&&299>=aa.getStatus())try{this.exportFile(aa.getText(),J,D,!0,Y,na)}catch(W){this.handleError(W)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(W){this.spinner.stop();this.handleError(W)}))}),null!=ea?ha(ea):this.pickFolder(Y,ha)))}});q=[App.MODE_BROWSER];G||q.push("_blank");var L=new SaveDialog(this,c,mxUtils.bind(this,function(J,Y,ha){N(J.value,Y,J,ha);this.hideDialog(null,null,L.container)}),q,null,"application/pdf");this.showDialog(L.container,+if(200<=aa.getStatus()&&299>=aa.getStatus())try{this.exportFile(aa.getText(),J,D,!0,Y,na)}catch(W){this.handleError(W)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(W){this.spinner.stop();this.handleError(W)}))}),null!=ea?ha(ea):this.pickFolder(Y,ha)))}});q=[App.MODE_BROWSER];H||q.push("_blank");var L=new SaveDialog(this,c,mxUtils.bind(this,function(J,Y,ha){N(J.value,Y,J,ha);this.hideDialog(null,null,L.container)}),q,null,"application/pdf");this.showDialog(L.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));L.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,f,l,t,q,D){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,f,l){f(null)};EditorUi.prototype.exportSvg=function(c,f,l,t,q,D,-G,N,L,J,Y,ha,ea,aa){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(P){Editor.addRetryToError(P,mxUtils.bind(this,function(){this.exportSvg(c,f,l,t,q,D,G,N,L,J,Y,ha,ea,aa)}));this.handleError(P)})))try{var na=this.editor.graph.isSelectionEmpty();l=null!=l?l:na;var W=f?null:this.editor.graph.background;W==mxConstants.NONE&&(W=null);null==W&&0==f&&(W=this.editor.graph.shapeBackgroundColor);var ba=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&-(this.editor.graph.addForeignObjectWarning=function(){});var ja=mxUtils.lightDarkColorSupported,ca=mxUtils.preferDarkColor;if("light"==Y||"dark"==Y)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==Y;var la=this.editor.graph.createSvgImageExport(q),Q=this.editor.graph.getSvg(W,c,G,N,null,l,null,la,"blank"==J?"_blank":"self"==J?"_top":null,null,!ea,Y,ha);mxUtils.lightDarkColorSupported=ja;mxUtils.preferDarkColor=ca;this.editor.graph.addForeignObjectWarning=ba;t&&this.editor.graph.addSvgShadow(Q);-var k=this.getBaseFilename()+(q?".drawio":"")+".svg";aa=null!=aa?aa:mxUtils.bind(this,function(P){this.isLocalFileSave()||P.length<=MAX_REQUEST_SIZE?this.saveData(k,"svg",P,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(P)}))});var B=mxUtils.bind(this,function(P){this.spinner.stop();q&&P.setAttribute("content",this.getFileData(!0,null,null,null,l,L,null,null,null,null,null,c,G));aa(Graph.xmlDeclaration++H,N,L,J,Y,ha,ea,aa){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(P){Editor.addRetryToError(P,mxUtils.bind(this,function(){this.exportSvg(c,f,l,t,q,D,H,N,L,J,Y,ha,ea,aa)}));this.handleError(P)})))try{var na=this.editor.graph.isSelectionEmpty();l=null!=l?l:na;var W=f?null:this.editor.graph.background;W==mxConstants.NONE&&(W=null);null==W&&0==f&&(W=this.editor.graph.shapeBackgroundColor);var ba=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&+(this.editor.graph.addForeignObjectWarning=function(){});var ja=mxUtils.lightDarkColorSupported,ca=mxUtils.preferDarkColor;if("light"==Y||"dark"==Y)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==Y;var la=this.editor.graph.createSvgImageExport(q),Q=this.editor.graph.getSvg(W,c,H,N,null,l,null,la,"blank"==J?"_blank":"self"==J?"_top":null,null,!ea,Y,ha);mxUtils.lightDarkColorSupported=ja;mxUtils.preferDarkColor=ca;this.editor.graph.addForeignObjectWarning=ba;t&&this.editor.graph.addSvgShadow(Q);+var k=this.getBaseFilename()+(q?".drawio":"")+".svg";aa=null!=aa?aa:mxUtils.bind(this,function(P){this.isLocalFileSave()||P.length<=MAX_REQUEST_SIZE?this.saveData(k,"svg",P,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(P)}))});var B=mxUtils.bind(this,function(P){this.spinner.stop();q&&P.setAttribute("content",this.getFileData(!0,null,null,null,l,L,null,null,null,null,null,c,H));aa(Graph.xmlDeclaration+"\n"+(q?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(P))});this.editor.graph.mathEnabled&&this.editor.addMathCss(Q);var I=mxUtils.bind(this,function(P){Editor.replaceSvgDataUris&&D&&EditorUi.embedSvgImages(P);Editor.foreignObjectImages&&ea?this.replaceAlternateContent(P,Y,B):B(P)}),U=mxUtils.bind(this,function(P){D&&!this.isOffline()&&this.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(P,I,this.thumbImageCache)):I(P)});ea?this.embedFonts(Q,-U):(this.editor.addFontCss(Q),U(Q))}catch(P){this.handleError(P)}};EditorUi.prototype.replaceAlternateContent=function(c,f,l){function t(ha,ea,aa,na,W){var ba=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");ba.setAttribute("x",ea);ba.setAttribute("y",aa+.5);ba.setAttribute("width",na.width);ba.setAttribute("height",na.height);null==ba.setAttributeNS?ba.setAttribute("xlink:href",W):ba.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",W);ha.replaceChild(ba,ha.lastChild);N()}function q(){if(G<-Y.length)Y[G++](q)}var D="";f=c.getElementsByTagName("style");for(var G=0;G<f.length;G++)D+=f[G].innerHTML;f=c.getElementsByTagName("switch");counter=f.length;var N=mxUtils.bind(this,function(){counter--;0==counter&&l(c)}),L={},J={},Y=[];for(G=0;G<f.length;G++)mxUtils.bind(this,function(ha){var ea=ha.getElementsByTagName("div");if(0<ea.length)try{var aa=ea[0].cloneNode(!0),na=parseInt(aa.style.marginLeft),W=parseInt(aa.style.paddingTop),ba=aa.getElementsByTagName("div")[1],ja=ea=!1,ca=aa.style.alignItems,+U):(this.editor.addFontCss(Q),U(Q))}catch(P){this.handleError(P)}};EditorUi.prototype.replaceAlternateContent=function(c,f,l){function t(ha,ea,aa,na,W){var ba=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");ba.setAttribute("x",ea);ba.setAttribute("y",aa+.5);ba.setAttribute("width",na.width);ba.setAttribute("height",na.height);null==ba.setAttributeNS?ba.setAttribute("xlink:href",W):ba.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",W);ha.replaceChild(ba,ha.lastChild);N()}function q(){if(H<+Y.length)Y[H++](q)}var D="";f=c.getElementsByTagName("style");for(var H=0;H<f.length;H++)D+=f[H].innerHTML;f=c.getElementsByTagName("switch");counter=f.length;var N=mxUtils.bind(this,function(){counter--;0==counter&&l(c)}),L={},J={},Y=[];for(H=0;H<f.length;H++)mxUtils.bind(this,function(ha){var ea=ha.getElementsByTagName("div");if(0<ea.length)try{var aa=ea[0].cloneNode(!0),na=parseInt(aa.style.marginLeft),W=parseInt(aa.style.paddingTop),ba=aa.getElementsByTagName("div")[1],ja=ea=!1,ca=aa.style.alignItems,la=aa.style.justifyContent;if(null!=aa.style.writingMode){var Q=aa.style.writingMode;ja="vertical-"==Q.substring(0,9);ea="-rl"==Q.substring(Q.length-3)}var k=!ja&&"1px"==aa.style.width||ja&&"1px"==aa.style.height;if(!ja&&"1px"==aa.style.height||ja&&"1px"==aa.style.width)aa.style.alignItems=ja&&ea?"unsafe flex-end":"unsafe flex-start";k&&(aa.style.justifyContent="unsafe flex-start");aa.style.paddingTop="";aa.style.marginLeft="";var B=aa.outerHTML,I=L[B];null==I&&(aa.style.position="absolute",aa.style.visibility="hidden",document.body.appendChild(aa),Q=1,Q="1px"==aa.style.width?ba.offsetWidth:parseInt(aa.style.width),k=1,k="1px"==aa.style.height?ba.offsetHeight:parseInt(aa.style.height),document.body.removeChild(aa),I=new mxRectangle(na,W,Q,k),L[B]=I);"1px"==aa.style.height&&("unsafe center"==ca?W-=I.height/2:"unsafe flex-end"==ca&&(W-=I.height));if("1px"==aa.style.width)if(!ja&&"unsafe center"==la||ja&&"unsafe center"==ca)na-=I.width/2;else if(!ja&&"unsafe flex-end"==la||ja&&(!ea&&"unsafe flex-end"==ca||-ea&&"unsafe flex-start"==ca))na-=I.width;I=new mxRectangle(na,W,I.width,I.height+parseInt(ba.style.fontSize)/4);Y.push(mxUtils.bind(this,function(U){var P=J[B];null==P?Graph.htmlToPng(B,I.width,I.height,mxUtils.bind(this,function(T){t(ha,na,W,I,T);J[B]=T;U()}),D):(t(ha,na,W,I,P),U())}))}catch(U){N()}else N()})(f[G]);0==counter&&l(c);G=0;q()};EditorUi.prototype.addRadiobox=function(c,f,l,t,q,D,G){return this.addCheckbox(c,l,t,q,D,G,!0,f)};EditorUi.prototype.addCheckbox=function(c,f,l,t,q,D,G,N){D=-null!=D?D:!0;var L=document.createElement("input");L.style.marginRight="8px";L.style.marginTop="16px";L.setAttribute("type",G?"radio":"checkbox");G="geCheckbox-"+Editor.guid();L.id=G;null!=N&&L.setAttribute("name",N);l&&(L.setAttribute("checked","checked"),L.defaultChecked=!0);t&&L.setAttribute("disabled","disabled");D&&(c.appendChild(L),l=document.createElement("label"),mxUtils.write(l,f),l.setAttribute("for",G),c.appendChild(l),q||mxUtils.br(c));return L};EditorUi.prototype.addEditButton=function(c,+ea&&"unsafe flex-start"==ca))na-=I.width;I=new mxRectangle(na,W,I.width,I.height+parseInt(ba.style.fontSize)/4);Y.push(mxUtils.bind(this,function(U){var P=J[B];null==P?Graph.htmlToPng(B,I.width,I.height,mxUtils.bind(this,function(T){t(ha,na,W,I,T);J[B]=T;U()}),D):(t(ha,na,W,I,P),U())}))}catch(U){N()}else N()})(f[H]);0==counter&&l(c);H=0;q()};EditorUi.prototype.addRadiobox=function(c,f,l,t,q,D,H){return this.addCheckbox(c,l,t,q,D,H,!0,f)};EditorUi.prototype.addCheckbox=function(c,f,l,t,q,D,H,N){D=+null!=D?D:!0;var L=document.createElement("input");L.style.marginRight="8px";L.style.marginTop="16px";L.setAttribute("type",H?"radio":"checkbox");H="geCheckbox-"+Editor.guid();L.id=H;null!=N&&L.setAttribute("name",N);l&&(L.setAttribute("checked","checked"),L.defaultChecked=!0);t&&L.setAttribute("disabled","disabled");D&&(c.appendChild(L),l=document.createElement("label"),mxUtils.write(l,f),l.setAttribute("for",H),c.appendChild(l),q||mxUtils.br(c));return L};EditorUi.prototype.addEditButton=function(c,f){var l=this.addCheckbox(c,mxResources.get("edit")+":",!0,null,!0);l.style.marginLeft="24px";var t=this.getCurrentFile(),q="";null!=t&&t.getMode()!=App.MODE_DEVICE&&t.getMode()!=App.MODE_BROWSER&&(q=window.location.href);var D=document.createElement("select");D.style.maxWidth="200px";D.style.width="auto";D.style.marginLeft="8px";D.style.marginRight="10px";D.className="geBtn";t=document.createElement("option");t.setAttribute("value","blank");mxUtils.write(t,mxResources.get("makeCopy"));D.appendChild(t);-var G=document.createElement("option");G.setAttribute("value","custom");mxUtils.write(G,mxResources.get("custom")+"...");D.appendChild(G);c.appendChild(D);mxEvent.addListener(D,"change",mxUtils.bind(this,function(){if("custom"==D.value){var N=new FilenameDialog(this,q,mxResources.get("ok"),function(L){null!=L?(q=L,G.setAttribute("title",L)):(D.value="blank",G.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){D.value="blank"});this.showDialog(N.container,300,80,!0,!1);+var H=document.createElement("option");H.setAttribute("value","custom");mxUtils.write(H,mxResources.get("custom")+"...");D.appendChild(H);c.appendChild(D);mxEvent.addListener(D,"change",mxUtils.bind(this,function(){if("custom"==D.value){var N=new FilenameDialog(this,q,mxResources.get("ok"),function(L){null!=L?(q=L,H.setAttribute("title",L)):(D.value="blank",H.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){D.value="blank"});this.showDialog(N.container,300,80,!0,!1);N.init()}}));mxEvent.addListener(l,"change",mxUtils.bind(this,function(){l.checked&&(null==f||f.checked)?D.removeAttribute("disabled"):D.setAttribute("disabled","disabled")}));mxUtils.br(c);return{getLink:function(){return l.checked?"blank"===D.value?"_blank":q:null},getEditInput:function(){return l},getEditSelect:function(){return D}}};EditorUi.prototype.addLinkSection=function(c,f){function l(){var N=document.createElement("div");N.style.width="100%";N.style.height="100%";N.style.boxSizing="border-box";-null!=D&&D!=mxConstants.NONE?(N.style.border="1px solid black",N.style.backgroundColor=D):(N.style.backgroundPosition="center center",N.style.backgroundRepeat="no-repeat",N.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')");G.innerText="";G.appendChild(N)}mxUtils.write(c,mxResources.get("links")+":");var t=document.createElement("select");t.style.width="100px";t.style.padding="0px";t.style.marginLeft="8px";t.style.marginRight="10px";t.className="geBtn";var q=document.createElement("option");+null!=D&&D!=mxConstants.NONE?(N.style.border="1px solid black",N.style.backgroundColor=D):(N.style.backgroundPosition="center center",N.style.backgroundRepeat="no-repeat",N.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')");H.innerText="";H.appendChild(N)}mxUtils.write(c,mxResources.get("links")+":");var t=document.createElement("select");t.style.width="100px";t.style.padding="0px";t.style.marginLeft="8px";t.style.marginRight="10px";t.className="geBtn";var q=document.createElement("option");q.setAttribute("value","auto");mxUtils.write(q,mxResources.get("automatic"));t.appendChild(q);q=document.createElement("option");q.setAttribute("value","blank");mxUtils.write(q,mxResources.get("openInNewWindow"));t.appendChild(q);q=document.createElement("option");q.setAttribute("value","self");mxUtils.write(q,mxResources.get("openInThisWindow"));t.appendChild(q);f&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+-")"),t.appendChild(f));c.appendChild(t);mxUtils.write(c,mxResources.get("borderColor")+":");var D="#0000ff",G=null;G=mxUtils.button("",mxUtils.bind(this,function(N){this.pickColor(D||"none",function(L){D=L;l()});mxEvent.consume(N)}));l();G.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";G.style.marginLeft="4px";G.style.height="22px";G.style.width="22px";G.style.position="relative";G.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";G.className="geColorBtn";c.appendChild(G);+")"),t.appendChild(f));c.appendChild(t);mxUtils.write(c,mxResources.get("borderColor")+":");var D="#0000ff",H=null;H=mxUtils.button("",mxUtils.bind(this,function(N){this.pickColor(D||"none",function(L){D=L;l()});mxEvent.consume(N)}));l();H.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";H.style.marginLeft="4px";H.style.height="22px";H.style.width="22px";H.style.position="relative";H.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";H.className="geColorBtn";c.appendChild(H);mxUtils.br(c);return{getColor:function(){return D},getTarget:function(){return t.value},focus:function(){t.focus()}}};EditorUi.prototype.createUrlParameters=function(c,f,l,t,q,D){D=null!=D?D:[];l&&(D.push("lightbox=1"),"auto"!=c&&D.push("target="+c),null!=f&&f!=mxConstants.NONE&&D.push("highlight="+("#"==f.charAt(0)?f.substring(1):f)),null!=t&&0<t.length&&D.push("edit="+encodeURIComponent(t)),q&&D.push("layers=1"),this.editor.graph.foldingEnabled&&D.push("nav=1"));return D};EditorUi.prototype.createLink=-function(c,f,l,t,q,D,G,N,L,J,Y,ha,ea){var aa=this.getCurrentFile();L=this.createUrlParameters(c,f,t,q,D,L);c=!0;null!=G?l="#U"+encodeURIComponent(G):N||null==aa||""==aa.getHash()?l="#R"+encodeURIComponent(l?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(l="#"+aa.getHash(),c=!1);c&&null!=aa&&null!=aa.getTitle()&&aa.getTitle()!=this.defaultFilename&&L.push("title="+encodeURIComponent(aa.getTitle()));J&&1<l.length&&(L.push("open="+-l.substring(1)),l="");Y&&null!=this.currentPage&&L.push("page-id="+this.currentPage.getId());ha&&L.push("transparent=1");null!=ea&&L.push("dark="+ea);return(t&&(null!=G||null!=aa&&aa.getMode()!=App.MODE_GITHUB&&aa.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<L.length?"?"+L.join("&"):"")+l};EditorUi.prototype.createHtml=function(c,f,l,t,q,D,G,-N,L,J,Y,ha,ea){this.getBasenames();var aa={};""!=q&&q!=mxConstants.NONE&&(aa.highlight=q);"auto"!==t&&(aa.target=t);J||(aa.lightbox=!1);aa.nav=this.editor.graph.foldingEnabled;l=parseInt(l);isNaN(l)||100==l||(aa.zoom=l/100);l=[];G&&(l.push("pages"),aa.resize=!0,null!=this.pages&&null!=this.currentPage&&(aa.page=mxUtils.indexOf(this.pages,this.currentPage)));f&&(l.push("zoom"),aa.resize=!0);N&&l.push("layers");L&&l.push("tags");null!=ea&&(aa["dark-mode"]=ea);0<l.length&&(J&&l.push("lightbox"),aa.toolbar=-l.join(" "));null!=Y&&0<Y.length&&(aa.edit=Y);null!=c?aa.url=c:aa.xml=this.getFileData(!0,null,null,null,null,!G);f='<div class="mxgraph" style="'+(D?"max-width:100%;":"")+(""!=l?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(aa))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";ha(f,'<script type="text/javascript" src="'+(0<c.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+c:"1"==urlParams.dev?-"https://test.draw.io/js/viewer-static.min.js":window.DRAWIO_VIEWER_URL?window.DRAWIO_VIEWER_URL:EditorUi.lightboxHost+"/js/viewer-static.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(c,f,l,t){var q=document.createElement("div");q.style.whiteSpace="nowrap";var D=document.createElement("h3");mxUtils.write(D,mxResources.get("html"));D.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";q.appendChild(D);var G=document.createElement("div");G.style.cssText=-"border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var N=document.createElement("input");N.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";N.setAttribute("value","url");N.setAttribute("type","radio");N.setAttribute("name","type-embedhtmldialog");D=N.cloneNode(!0);D.setAttribute("value","copy");G.appendChild(D);var L=document.createElement("span");mxUtils.write(L,mxResources.get("includeCopyOfMyDiagram"));G.appendChild(L);mxUtils.br(G);G.appendChild(N);L=-document.createElement("span");mxUtils.write(L,mxResources.get("publicDiagramUrl"));G.appendChild(L);var J=this.getCurrentFile();null==l&&null!=J&&J.constructor==window.DriveFile&&(L=document.createElement("a"),L.style.paddingLeft="12px",L.style.color="gray",L.style.cursor="pointer",mxUtils.write(L,mxResources.get("share")),G.appendChild(L),mxEvent.addListener(L,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(J.getId(),J)})));D.setAttribute("checked","checked");null==-l&&N.setAttribute("disabled","disabled");q.appendChild(G);G=380;var Y=this.addLinkSection(q),ha=document.createElement("select");ha.style.maxWidth="260px";ha.style.marginLeft="8px";ha.style.marginTop="16px";L=document.createElement("option");L.setAttribute("value","light");mxUtils.write(L,mxResources.get("light"));ha.appendChild(L);L=document.createElement("option");L.setAttribute("value","dark");mxUtils.write(L,mxResources.get("dark"));ha.appendChild(L);L=document.createElement("option");L.setAttribute("value",-"auto");mxUtils.write(L,mxResources.get("automatic"));L.setAttribute("selected","selected");ha.appendChild(L);L.setAttribute("selected","selected");mxUtils.write(q,mxResources.get("appearance")+":");q.appendChild(ha);mxUtils.br(q);G+=26;var ea=this.addCheckbox(q,mxResources.get("zoom"),!0,null,!0);mxUtils.write(q,":");var aa=document.createElement("input");aa.setAttribute("type","text");aa.style.marginRight="16px";aa.style.width="60px";aa.style.marginLeft="4px";aa.style.marginRight="12px";aa.value=-"100%";q.appendChild(aa);var na=this.addCheckbox(q,mxResources.get("fit"),!0);L=null!=this.pages&&1<this.pages.length;var W=W=this.addCheckbox(q,mxResources.get("allPages"),L,!L),ba=this.addCheckbox(q,mxResources.get("layers"),!0),ja=this.addCheckbox(q,mxResources.get("tags"),!0),ca=this.addCheckbox(q,mxResources.get("lightbox"),!0),la=null;if(EditorUi.enableHtmlEditOption){la=this.addEditButton(q,ca);var Q=la.getEditInput();Q.style.marginBottom="16px";G+=50;mxEvent.addListener(ca,"change",function(){ca.checked?-Q.removeAttribute("disabled"):Q.setAttribute("disabled","disabled");Q.checked&&ca.checked?la.getEditSelect().removeAttribute("disabled"):la.getEditSelect().setAttribute("disabled","disabled")})}c=new CustomDialog(this,q,mxUtils.bind(this,function(){t(N.checked?l:null,ea.checked,aa.value,Y.getTarget(),Y.getColor(),na.checked,W.checked,ba.checked,ja.checked,ca.checked,null!=la?la.getLink():null,null!=ha?ha.value:null)}),null,c,f);this.showDialog(c.container,340,G,!0,!0);D.focus()};EditorUi.prototype.showPublishLinkDialog=-function(c,f,l,t,q,D,G,N,L,J,Y){var ha=document.createElement("div");ha.style.whiteSpace="nowrap";var ea=document.createElement("h3");mxUtils.write(ea,c||mxResources.get("publish"));ea.style.width="100%";ea.style.textAlign="center";ea.style.marginTop="2px";ea.style.marginBottom="20px";ha.appendChild(ea);var aa=document.createElement("select");c=30;aa.className="geBtn";aa.style.marginBottom="8px";aa.style.marginLeft="0px";aa.style.width="100%";aa.style.boxSizing="border-box";if(null==N||""==N.getHash())q=+function(c,f,l,t,q,D,H,N,L,J,Y,ha,ea){var aa=this.getCurrentFile();L=this.createUrlParameters(c,f,t,q,D,L);c=!0;null!=H?l="#U"+encodeURIComponent(H):N||null==aa||""==aa.getHash()?l="#R"+encodeURIComponent(l?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(l="#"+aa.getHash(),c=!1);c&&null!=aa&&null!=aa.getTitle()&&aa.getTitle()!=this.defaultFilename&&L.push("title="+encodeURIComponent(aa.getTitle()));J&&1<l.length&&(L.push("open="++l.substring(1)),l="");Y&&null!=this.currentPage&&L.push("page-id="+this.currentPage.getId());ha&&L.push("transparent=1");null!=ea&&L.push("dark="+ea);return(t&&(null!=H||null!=aa&&aa.getMode()!=App.MODE_GITHUB&&aa.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<L.length?"?"+L.join("&"):"")+l};EditorUi.prototype.createHtml=function(c,f,l,t,q,D,H,+N,L,J,Y,ha,ea){this.getBasenames();var aa={};""!=q&&q!=mxConstants.NONE&&(aa.highlight=q);"auto"!==t&&(aa.target=t);J||(aa.lightbox=!1);aa.nav=this.editor.graph.foldingEnabled;l=parseInt(l);isNaN(l)||100==l||(aa.zoom=l/100);l=[];H&&(l.push("pages"),aa.resize=!0,null!=this.pages&&null!=this.currentPage&&(aa.page=mxUtils.indexOf(this.pages,this.currentPage)));f&&(l.push("zoom"),aa.resize=!0);N&&l.push("layers");L&&l.push("tags");null!=ea&&(aa["dark-mode"]=ea);0<l.length&&(J&&l.push("lightbox"),aa.toolbar=+l.join(" "));null!=Y&&0<Y.length&&(aa.edit=Y);null!=c?aa.url=c:aa.xml=this.getFileData(!0,null,null,null,null,!H);f='<div class="mxgraph" style="'+(D?"max-width:100%;":"")+(""!=l?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(aa))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";ha(f,'<script type="text/javascript" src="'+(0<c.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+c:"1"==urlParams.dev?+"https://test.draw.io/js/viewer-static.min.js":window.DRAWIO_VIEWER_URL?window.DRAWIO_VIEWER_URL:EditorUi.lightboxHost+"/js/viewer-static.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(c,f,l,t){var q=document.createElement("div");q.style.whiteSpace="nowrap";var D=document.createElement("h3");mxUtils.write(D,mxResources.get("html"));D.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";q.appendChild(D);var H=document.createElement("div");H.style.cssText=+"border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var N=document.createElement("input");N.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";N.setAttribute("value","url");N.setAttribute("type","radio");N.setAttribute("name","type-embedhtmldialog");D=N.cloneNode(!0);D.setAttribute("value","copy");H.appendChild(D);var L=document.createElement("span");mxUtils.write(L,mxResources.get("includeCopyOfMyDiagram"));H.appendChild(L);mxUtils.br(H);H.appendChild(N);L=+document.createElement("span");mxUtils.write(L,mxResources.get("publicDiagramUrl"));H.appendChild(L);var J=this.getCurrentFile();null==l&&null!=J&&J.constructor==window.DriveFile&&(L=document.createElement("a"),L.style.paddingLeft="12px",L.style.color="gray",L.style.cursor="pointer",mxUtils.write(L,mxResources.get("share")),H.appendChild(L),mxEvent.addListener(L,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(J.getId(),J)})));D.setAttribute("checked","checked");null==+l&&N.setAttribute("disabled","disabled");q.appendChild(H);H=380;var Y=this.addLinkSection(q),ha=document.createElement("select");ha.style.maxWidth="260px";ha.style.marginLeft="8px";ha.style.marginTop="16px";L=document.createElement("option");L.setAttribute("value","light");mxUtils.write(L,mxResources.get("light"));ha.appendChild(L);L=document.createElement("option");L.setAttribute("value","dark");mxUtils.write(L,mxResources.get("dark"));ha.appendChild(L);L=document.createElement("option");L.setAttribute("value",+"auto");mxUtils.write(L,mxResources.get("automatic"));L.setAttribute("selected","selected");ha.appendChild(L);L.setAttribute("selected","selected");mxUtils.write(q,mxResources.get("appearance")+":");q.appendChild(ha);mxUtils.br(q);H+=26;var ea=this.addCheckbox(q,mxResources.get("zoom"),!0,null,!0);mxUtils.write(q,":");var aa=document.createElement("input");aa.setAttribute("type","text");aa.style.marginRight="16px";aa.style.width="60px";aa.style.marginLeft="4px";aa.style.marginRight="12px";aa.value=+"100%";q.appendChild(aa);var na=this.addCheckbox(q,mxResources.get("fit"),!0);L=null!=this.pages&&1<this.pages.length;var W=W=this.addCheckbox(q,mxResources.get("allPages"),L,!L),ba=this.addCheckbox(q,mxResources.get("layers"),!0),ja=this.addCheckbox(q,mxResources.get("tags"),!0),ca=this.addCheckbox(q,mxResources.get("lightbox"),!0),la=null;if(EditorUi.enableHtmlEditOption){la=this.addEditButton(q,ca);var Q=la.getEditInput();Q.style.marginBottom="16px";H+=50;mxEvent.addListener(ca,"change",function(){ca.checked?+Q.removeAttribute("disabled"):Q.setAttribute("disabled","disabled");Q.checked&&ca.checked?la.getEditSelect().removeAttribute("disabled"):la.getEditSelect().setAttribute("disabled","disabled")})}c=new CustomDialog(this,q,mxUtils.bind(this,function(){t(N.checked?l:null,ea.checked,aa.value,Y.getTarget(),Y.getColor(),na.checked,W.checked,ba.checked,ja.checked,ca.checked,null!=la?la.getLink():null,null!=ha?ha.value:null)}),null,c,f);this.showDialog(c.container,340,H,!0,!0);D.focus()};EditorUi.prototype.showPublishLinkDialog=+function(c,f,l,t,q,D,H,N,L,J,Y){var ha=document.createElement("div");ha.style.whiteSpace="nowrap";var ea=document.createElement("h3");mxUtils.write(ea,c||mxResources.get("publish"));ea.style.width="100%";ea.style.textAlign="center";ea.style.marginTop="2px";ea.style.marginBottom="20px";ha.appendChild(ea);var aa=document.createElement("select");c=30;aa.className="geBtn";aa.style.marginBottom="8px";aa.style.marginLeft="0px";aa.style.width="100%";aa.style.boxSizing="border-box";if(null==N||""==N.getHash())q=null!=q?q:"https://www.drawio.com/doc/faq/publish-diagram-as-link",ea=document.createElement("option"),mxUtils.write(ea,mxResources.get("makeCopy")),ea.setAttribute("value","copy"),aa.appendChild(ea);ea=document.createElement("option");mxUtils.write(ea,mxResources.get("authorizationRequired"));ea.setAttribute("value","auth");aa.appendChild(ea);null!=N&&""!=N.getHash()||ea.setAttribute("disabled","disabled");N=document.createElement("option");N.setAttribute("value","public");aa.appendChild(N);null!=-G?(mxUtils.write(N,mxResources.get("publicDiagramUrl")),N.setAttribute("title",G),aa.value="public"):(mxUtils.write(N,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),N.setAttribute("disabled","disabled"));ha.appendChild(aa);mxUtils.br(ha);aa.focus();var na=null,W=null;if(null!=f||null!=l)c+=30,mxUtils.write(ha,mxResources.get("width")+":"),na=document.createElement("input"),na.setAttribute("type","text"),na.style.marginRight="16px",na.style.width="50px",na.style.marginLeft=+H?(mxUtils.write(N,mxResources.get("publicDiagramUrl")),N.setAttribute("title",H),aa.value="public"):(mxUtils.write(N,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),N.setAttribute("disabled","disabled"));ha.appendChild(aa);mxUtils.br(ha);aa.focus();var na=null,W=null;if(null!=f||null!=l)c+=30,mxUtils.write(ha,mxResources.get("width")+":"),na=document.createElement("input"),na.setAttribute("type","text"),na.style.marginRight="16px",na.style.width="50px",na.style.marginLeft="6px",na.style.marginRight="16px",na.style.marginBottom="10px",na.value="100%",ha.appendChild(na),mxUtils.write(ha,mxResources.get("height")+":"),W=document.createElement("input"),W.setAttribute("type","text"),W.style.width="50px",W.style.marginLeft="6px",W.style.marginBottom="10px",W.value=l+"px",ha.appendChild(W),mxUtils.br(ha);var ba=this.addLinkSection(ha,t),ja=J?this.addCheckbox(ha,mxResources.get("transparentBackground"),!1):null;null!=ja&&(c+=20);var ca=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(c+=30,f=null!=this.currentPage?this.currentPage.getName():"",16<f.length&&(f=f.substring(0,16)+"..."),ca=this.addCheckbox(ha,mxResources.get("selectedPage")+": "+f));var la=document.createElement("select");la.style.maxWidth="260px";la.style.marginLeft="8px";la.style.marginTop="16px";f=document.createElement("option");f.setAttribute("value","0");mxUtils.write(f,mxResources.get("light"));la.appendChild(f);f=document.createElement("option");f.setAttribute("value","1");mxUtils.write(f,mxResources.get("dark"));la.appendChild(f);f=document.createElement("option");f.setAttribute("value","auto");mxUtils.write(f,mxResources.get("automatic"));f.setAttribute("selected","selected");la.appendChild(f);Y&&(mxUtils.write(ha,mxResources.get("appearance")+":"),ha.appendChild(la),mxUtils.br(ha),c+=30);var Q=this.addCheckbox(ha,mxResources.get("lightbox"),!0,null,null,!t),k=this.addEditButton(ha,Q),B=k.getEditInput();t&&(B.style.marginLeft=Q.style.marginLeft,Q.style.display="none",c-=20);var I=this.addCheckbox(ha,mxResources.get("layers"),!0);I.style.marginLeft=B.style.marginLeft;I.style.marginTop="8px";var U=this.addCheckbox(ha,mxResources.get("tags"),!0);U.style.marginLeft=B.style.marginLeft;U.style.marginBottom="16px";U.style.marginTop="16px";mxEvent.addListener(Q,"change",function(){Q.checked?(I.removeAttribute("disabled"),B.removeAttribute("disabled"),U.removeAttribute("disabled")):(I.setAttribute("disabled","disabled"),B.setAttribute("disabled","disabled"),U.setAttribute("disabled","disabled"));B.checked&&Q.checked?k.getEditSelect().removeAttribute("disabled"):k.getEditSelect().setAttribute("disabled","disabled")});t=new CustomDialog(this,ha,mxUtils.bind(this,function(){L(ba.getTarget(),ba.getColor(),null==ca?!1:ca.checked,Q.checked,k.getLink(),I.checked,null!=na?na.value:null,null!=W?W.value:null,U.checked,aa.value,null!=ja?ja.checked:!1,la.value)}),null,mxResources.get("create"),q,D);this.showDialog(t.container,340,296+c,!0,!0);null!=na?(na.focus(),mxClient.IS_GC||mxClient.IS_FF||-5<=document.documentMode?na.select():document.execCommand("selectAll",!1,null)):null==aa.parentNode;ba.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,f,l,t,q){var D=document.createElement("div");D.style.whiteSpace="nowrap";var G=document.createElement("h3");mxUtils.write(G,mxResources.get("image"));G.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(q?"10":"4")+"px";D.appendChild(G);if(q){mxUtils.write(D,mxResources.get("zoom")+":");var N=document.createElement("input");+5<=document.documentMode?na.select():document.execCommand("selectAll",!1,null)):null==aa.parentNode;ba.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,f,l,t,q){var D=document.createElement("div");D.style.whiteSpace="nowrap";var H=document.createElement("h3");mxUtils.write(H,mxResources.get("image"));H.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(q?"10":"4")+"px";D.appendChild(H);if(q){mxUtils.write(D,mxResources.get("zoom")+":");var N=document.createElement("input");N.setAttribute("type","text");N.style.marginRight="16px";N.style.width="60px";N.style.marginLeft="4px";N.style.marginRight="12px";N.value=this.lastExportZoom||"100%";D.appendChild(N);mxUtils.write(D,mxResources.get("borderWidth")+":");var L=document.createElement("input");L.setAttribute("type","text");L.style.marginRight="16px";L.style.width="60px";L.style.marginLeft="4px";L.value=this.lastExportBorder||"0";D.appendChild(L);mxUtils.br(D)}var J=this.addCheckbox(D,mxResources.get("selectionOnly"),!1,-this.editor.graph.isSelectionEmpty()),Y=t?null:this.addCheckbox(D,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);G=this.editor.graph;var ha=t?null:this.addCheckbox(D,mxResources.get("transparentBackground"),G.background==mxConstants.NONE||null==G.background);null!=ha&&(ha.style.marginBottom="16px");c=new CustomDialog(this,D,mxUtils.bind(this,function(){var ea=parseInt(N.value)/100||1,aa=parseInt(L.value)||0;l(!J.checked,null!=Y?Y.checked:!1,null!=ha?ha.checked:!1,ea,aa)}),-null,c,f);this.showDialog(c.container,300,(q?25:0)+(t?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(c,f,l,t,q,D,G,N,L){G=null!=G?G:Editor.defaultIncludeDiagram;var J=document.createElement("div");J.style.whiteSpace="nowrap";var Y=this.editor.graph,ha="jpeg"==N||"webp"==N?220:320,ea=document.createElement("h3");mxUtils.write(ea,c);ea.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";J.appendChild(ea);mxUtils.write(J,mxResources.get("zoom")+":");var aa=document.createElement("input");+this.editor.graph.isSelectionEmpty()),Y=t?null:this.addCheckbox(D,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);H=this.editor.graph;var ha=t?null:this.addCheckbox(D,mxResources.get("transparentBackground"),H.background==mxConstants.NONE||null==H.background);null!=ha&&(ha.style.marginBottom="16px");c=new CustomDialog(this,D,mxUtils.bind(this,function(){var ea=parseInt(N.value)/100||1,aa=parseInt(L.value)||0;l(!J.checked,null!=Y?Y.checked:!1,null!=ha?ha.checked:!1,ea,aa)}),+null,c,f);this.showDialog(c.container,300,(q?25:0)+(t?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(c,f,l,t,q,D,H,N,L){H=null!=H?H:Editor.defaultIncludeDiagram;var J=document.createElement("div");J.style.whiteSpace="nowrap";var Y=this.editor.graph,ha="jpeg"==N||"webp"==N?220:320,ea=document.createElement("h3");mxUtils.write(ea,c);ea.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";J.appendChild(ea);mxUtils.write(J,mxResources.get("zoom")+":");var aa=document.createElement("input");aa.setAttribute("type","text");aa.style.marginRight="16px";aa.style.width="60px";aa.style.marginLeft="4px";aa.style.marginRight="12px";aa.value=this.lastExportZoom||"100%";J.appendChild(aa);mxUtils.write(J,mxResources.get("borderWidth")+":");var na=document.createElement("input");na.setAttribute("type","text");na.style.marginRight="16px";na.style.width="60px";na.style.marginLeft="4px";na.value=this.lastExportBorder||"0";J.appendChild(na);mxUtils.br(J);var W=this.addCheckbox(J,mxResources.get("selectionOnly"),!1,Y.isSelectionEmpty()),ba=document.createElement("input");ba.style.marginTop="16px";ba.style.marginRight="8px";ba.style.marginLeft="24px";ba.setAttribute("disabled","disabled");ba.setAttribute("type","checkbox");var ja=document.createElement("select");ja.style.marginTop="16px";ja.style.marginLeft="8px";c=["selectionOnly","diagram","page"];for(ea=0;ea<c.length;ea++)if(!Y.isSelectionEmpty()||"selectionOnly"!=c[ea]){var ca=document.createElement("option");mxUtils.write(ca,mxResources.get(c[ea]));ca.setAttribute("value",c[ea]);ja.appendChild(ca)}L?(mxUtils.write(J,mxResources.get("size")+":"),J.appendChild(ja),mxUtils.br(J),ha+=26,mxEvent.addListener(ja,"change",function(){"selectionOnly"==ja.value&&(W.checked=!0)})):D&&(J.appendChild(ba),mxUtils.write(J,mxResources.get("crop")),mxUtils.br(J),ha+=30,mxEvent.addListener(W,"change",function(){W.checked?ba.removeAttribute("disabled"):ba.setAttribute("disabled","disabled")}));Y.isSelectionEmpty()?L&&(W.style.display="none",W.nextSibling.style.display="none",W.nextSibling.nextSibling.style.display="none",ha-=30):(ja.value="diagram",ba.setAttribute("checked","checked"),ba.defaultChecked=!0,mxEvent.addListener(W,"change",function(){ja.value=W.checked?"selectionOnly":"diagram"}));var la=this.addCheckbox(J,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=N&&"webp"!=N),Q=document.createElement("select");Q.style.maxWidth="260px";Q.style.marginLeft="8px";Q.style.marginTop="16px";D=document.createElement("option");D.setAttribute("value","light");mxUtils.write(D,mxResources.get("light"));Q.appendChild(D);L=document.createElement("option");L.setAttribute("value","dark");mxUtils.write(L,mxResources.get("dark"));Q.appendChild(L);"svg"==N&&mxUtils.lightDarkColorSupported?(D=document.createElement("option"),D.setAttribute("value","auto"),mxUtils.write(D,mxResources.get("automatic")),D.setAttribute("selected","selected"),Q.appendChild(D)):Editor.isDarkMode()?L.setAttribute("selected","selected"):D.setAttribute("selected","selected");mxUtils.write(J,mxResources.get("appearance")+":");J.appendChild(Q);-mxUtils.br(J);ha+=26;var k=this.addCheckbox(J,mxResources.get("shadow"),Y.shadowVisible),B=null;if("png"==N||"jpeg"==N||"webp"==N)B=this.addCheckbox(J,mxResources.get("grid"),!1,this.isOffline()||!this.canvasSupported,!1,!0),ha+=30;var I=this.addCheckbox(J,mxResources.get("includeCopyOfMyDiagram")+":",G,null,null,"jpeg"!=N&&"webp"!=N),U=document.createElement("select");U.style.maxWidth="260px";U.style.marginLeft="28px";"png"==N||"svg"==N?(G=function(){I.checked?U.removeAttribute("disabled"):U.setAttribute("disabled",-"disabled")},Y=document.createElement("option"),Y.setAttribute("value","allPages"),mxUtils.write(Y,mxResources.get("allPages")),U.appendChild(Y),Y=document.createElement("option"),Y.setAttribute("value","currentPage"),mxUtils.write(Y,mxResources.get("currentPage")),U.appendChild(Y),I.style.marginBottom="12px",U.style.marginBottom="16px",J.appendChild(U),mxUtils.br(J),ha+=20,null!=this.lastEmbedInclude&&(U.value=this.lastEmbedInclude),mxEvent.addListener(I,"change",G),G()):I.style.marginBottom="16px";+mxUtils.br(J);ha+=26;var k=this.addCheckbox(J,mxResources.get("shadow"),Y.shadowVisible),B=null;if("png"==N||"jpeg"==N||"webp"==N)B=this.addCheckbox(J,mxResources.get("grid"),!1,this.isOffline()||!this.canvasSupported,!1,!0),ha+=30;var I=this.addCheckbox(J,mxResources.get("includeCopyOfMyDiagram")+":",H,null,null,"jpeg"!=N&&"webp"!=N),U=document.createElement("select");U.style.maxWidth="260px";U.style.marginLeft="28px";"png"==N||"svg"==N?(H=function(){I.checked?U.removeAttribute("disabled"):U.setAttribute("disabled",+"disabled")},Y=document.createElement("option"),Y.setAttribute("value","allPages"),mxUtils.write(Y,mxResources.get("allPages")),U.appendChild(Y),Y=document.createElement("option"),Y.setAttribute("value","currentPage"),mxUtils.write(Y,mxResources.get("currentPage")),U.appendChild(Y),I.style.marginBottom="12px",U.style.marginBottom="16px",J.appendChild(U),mxUtils.br(J),ha+=20,null!=this.lastEmbedInclude&&(U.value=this.lastEmbedInclude),mxEvent.addListener(I,"change",H),H()):I.style.marginBottom="16px";var P=document.createElement("input");P.style.marginBottom="16px";P.style.marginRight="8px";P.setAttribute("type","checkbox");var T=document.createElement("input");T.style.marginBottom="16px";T.style.marginRight="8px";T.setAttribute("type","checkbox");f&&(P.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,J.appendChild(P),mxUtils.write(J,mxResources.get("embedImages")),mxUtils.br(J),T.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,J.appendChild(T),mxUtils.write(J,mxResources.get("embedFonts")),-mxUtils.br(J),ha+=50);var X=document.createElement("select");X.style.maxWidth="260px";X.style.marginLeft="8px";D=document.createElement("option");D.setAttribute("value","auto");mxUtils.write(D,mxResources.get("automatic"));X.appendChild(D);G=document.createElement("option");G.setAttribute("value","blank");mxUtils.write(G,mxResources.get("openInNewWindow"));X.appendChild(G);G=document.createElement("option");G.setAttribute("value","self");mxUtils.write(G,mxResources.get("openInThisWindow"));X.appendChild(G);-G=document.createElement("div");mxUtils.write(G,mxResources.get("LinksLost"));G.style.margin="7px";G.style.display="none";"svg"==N&&(mxUtils.write(J,mxResources.get("links")+":"),J.appendChild(X),J.appendChild(G),mxUtils.br(J),mxUtils.br(J),ha+=50);l=new CustomDialog(this,J,mxUtils.bind(this,function(){this.lastExportBorder=na.value;this.lastExportZoom=aa.value;this.lastEmbedImages=P.checked;this.lastEmbedFonts=T.checked;this.lastEmbedInclude=U.value;q(aa.value,la.checked,!W.checked,k.checked,I.checked,-P.checked&&f,na.value,ba.checked,("png"==N||"svg"==N)&&"currentPage"==U.value,X.value,null!=B?B.checked:null,null!=Q?Q.value:null,ja.value,T.checked)}),null,l,t);this.showDialog(l.container,340,ha,!0,!0,null,null,null,null,!0);aa.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?aa.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,f,l,t,q){var D=document.createElement("div");D.style.whiteSpace="nowrap";var G=this.editor.graph;if(null!=-f){var N=document.createElement("h3");mxUtils.write(N,f);N.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";D.appendChild(N)}var L=this.addCheckbox(D,mxResources.get("fit"),!0),J=this.addCheckbox(D,mxResources.get("shadow"),G.shadowVisible&&t,!t),Y=this.addCheckbox(D,l),ha=this.addCheckbox(D,mxResources.get("lightbox"),!0),ea=this.addEditButton(D,ha),aa=ea.getEditInput(),na=1<G.model.getChildCount(G.model.getRoot()),W=this.addCheckbox(D,mxResources.get("layers"),na,!na);+mxUtils.br(J),ha+=50);var X=document.createElement("select");X.style.maxWidth="260px";X.style.marginLeft="8px";D=document.createElement("option");D.setAttribute("value","auto");mxUtils.write(D,mxResources.get("automatic"));X.appendChild(D);H=document.createElement("option");H.setAttribute("value","blank");mxUtils.write(H,mxResources.get("openInNewWindow"));X.appendChild(H);H=document.createElement("option");H.setAttribute("value","self");mxUtils.write(H,mxResources.get("openInThisWindow"));X.appendChild(H);+H=document.createElement("div");mxUtils.write(H,mxResources.get("LinksLost"));H.style.margin="7px";H.style.display="none";"svg"==N&&(mxUtils.write(J,mxResources.get("links")+":"),J.appendChild(X),J.appendChild(H),mxUtils.br(J),mxUtils.br(J),ha+=50);l=new CustomDialog(this,J,mxUtils.bind(this,function(){this.lastExportBorder=na.value;this.lastExportZoom=aa.value;this.lastEmbedImages=P.checked;this.lastEmbedFonts=T.checked;this.lastEmbedInclude=U.value;q(aa.value,la.checked,!W.checked,k.checked,I.checked,+P.checked&&f,na.value,ba.checked,("png"==N||"svg"==N)&&"currentPage"==U.value,X.value,null!=B?B.checked:null,null!=Q?Q.value:null,ja.value,T.checked)}),null,l,t);this.showDialog(l.container,340,ha,!0,!0,null,null,null,null,!0);aa.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?aa.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,f,l,t,q){var D=document.createElement("div");D.style.whiteSpace="nowrap";var H=this.editor.graph;if(null!=+f){var N=document.createElement("h3");mxUtils.write(N,f);N.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";D.appendChild(N)}var L=this.addCheckbox(D,mxResources.get("fit"),!0),J=this.addCheckbox(D,mxResources.get("shadow"),H.shadowVisible&&t,!t),Y=this.addCheckbox(D,l),ha=this.addCheckbox(D,mxResources.get("lightbox"),!0),ea=this.addEditButton(D,ha),aa=ea.getEditInput(),na=1<H.model.getChildCount(H.model.getRoot()),W=this.addCheckbox(D,mxResources.get("layers"),na,!na);W.style.marginLeft=aa.style.marginLeft;W.style.marginBottom="12px";W.style.marginTop="8px";mxEvent.addListener(ha,"change",function(){ha.checked?(na&&W.removeAttribute("disabled"),aa.removeAttribute("disabled")):(W.setAttribute("disabled","disabled"),aa.setAttribute("disabled","disabled"));aa.checked&&ha.checked?ea.getEditSelect().removeAttribute("disabled"):ea.getEditSelect().setAttribute("disabled","disabled")});f=new CustomDialog(this,D,mxUtils.bind(this,function(){c(L.checked,J.checked,Y.checked,-ha.checked,ea.getLink(),W.checked)}),null,mxResources.get("embed"),q);this.showDialog(f.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,f,l,t,q,D,G,N){function L(aa){var na=" ",W="";t&&(na=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+-EditorUi.lightboxHost+"/?client=1"+(null!=Y?"&page="+Y:"")+(q?"&edit=_blank":"")+(D?"&layers=1":"")+"');}})(this);\"",W+="cursor:pointer;");c&&(W+="max-width:100%;");var ba="";l&&(ba=' width="'+Math.round(J.width)+'" height="'+Math.round(J.height)+'"');G('<img src="'+aa+'"'+ba+(""!=W?' style="'+W+'"':"")+na+"/>")}var J=this.editor.graph.getGraphBounds(),Y=this.getSelectedPageIndex();if(this.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(aa){var na=t?this.getFileData(!0):+ha.checked,ea.getLink(),W.checked)}),null,mxResources.get("embed"),q);this.showDialog(f.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,f,l,t,q,D,H,N){function L(aa){var na=" ",W="";t&&(na=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"++EditorUi.lightboxHost+"/?client=1"+(null!=Y?"&page="+Y:"")+(q?"&edit=_blank":"")+(D?"&layers=1":"")+"');}})(this);\"",W+="cursor:pointer;");c&&(W+="max-width:100%;");var ba="";l&&(ba=' width="'+Math.round(J.width)+'" height="'+Math.round(J.height)+'"');H('<img src="'+aa+'"'+ba+(""!=W?' style="'+W+'"':"")+na+"/>")}var J=this.editor.graph.getGraphBounds(),Y=this.getSelectedPageIndex();if(this.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(aa){var na=t?this.getFileData(!0):null;aa=this.createImageDataUri(aa,na,"png");L(aa)}),null,null,null,mxUtils.bind(this,function(aa){N({message:mxResources.get("unknownError")})}),null,!0,l?2:1,null,f,null,null,Editor.defaultBorder);else if(f=this.getFileData(!0),J.width*J.height<=MAX_AREA&&f.length<=MAX_REQUEST_SIZE){var ha="";l&&(ha="&w="+Math.round(2*J.width)+"&h="+Math.round(2*J.height));var ea=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(t?"1":"0")+ha+"&xml="+encodeURIComponent(f));ea.send(mxUtils.bind(this,function(){200<=-ea.getStatus()&&299>=ea.getStatus()?L("data:image/png;base64,"+ea.getText()):N({message:mxResources.get("unknownError")})}))}else N({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,f,l,t,q,D,G){var N=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!l,"auto"),L=N.getElementsByTagName("a");if(null!=L)for(var J=0;J<L.length;J++){var Y=L[J].getAttribute("href");null!=Y&&"#"==Y.charAt(0)&&"_blank"==L[J].getAttribute("target")&&L[J].removeAttribute("target")}t&&+ea.getStatus()&&299>=ea.getStatus()?L("data:image/png;base64,"+ea.getText()):N({message:mxResources.get("unknownError")})}))}else N({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,f,l,t,q,D,H){var N=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!l,"auto"),L=N.getElementsByTagName("a");if(null!=L)for(var J=0;J<L.length;J++){var Y=L[J].getAttribute("href");null!=Y&&"#"==Y.charAt(0)&&"_blank"==L[J].getAttribute("target")&&L[J].removeAttribute("target")}t&&N.setAttribute("content",this.getFileData(!0));f&&this.editor.graph.addSvgShadow(N);if(l){var ha=" ",ea="";t&&(ha="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"+(q?"&edit=_blank":"")+(D?"&layers=1":-"")+"');}})(this);\"",ea+="cursor:pointer;");c&&(ea+="max-width:100%;");this.editor.convertImages(N,mxUtils.bind(this,function(aa){G('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(aa))+'"'+(""!=ea?' style="'+ea+'"':"")+ha+"/>")}))}else ea="",t&&(f=this.getSelectedPageIndex(),N.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"+-EditorUi.lightboxHost+"/?client=1"+(null!=f?"&page="+f:"")+(q?"&edit=_blank":"")+(D?"&layers=1":"")+"');}}})(this);"),ea+="cursor:pointer;"),c&&(c=parseInt(N.getAttribute("width")),q=parseInt(N.getAttribute("height")),N.setAttribute("viewBox","-0.5 -0.5 "+c+" "+q),ea+="max-width:100%;max-height:"+q+"px;",N.removeAttribute("height")),""!=ea&&N.setAttribute("style",ea),this.editor.addFontCss(N),this.editor.graph.mathEnabled&&this.editor.addMathCss(N),G(mxUtils.getXml(N))};EditorUi.prototype.timeSince=+"")+"');}})(this);\"",ea+="cursor:pointer;");c&&(ea+="max-width:100%;");this.editor.convertImages(N,mxUtils.bind(this,function(aa){H('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(aa))+'"'+(""!=ea?' style="'+ea+'"':"")+ha+"/>")}))}else ea="",t&&(f=this.getSelectedPageIndex(),N.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"++EditorUi.lightboxHost+"/?client=1"+(null!=f?"&page="+f:"")+(q?"&edit=_blank":"")+(D?"&layers=1":"")+"');}}})(this);"),ea+="cursor:pointer;"),c&&(c=parseInt(N.getAttribute("width")),q=parseInt(N.getAttribute("height")),N.setAttribute("viewBox","-0.5 -0.5 "+c+" "+q),ea+="max-width:100%;max-height:"+q+"px;",N.removeAttribute("height")),""!=ea&&N.setAttribute("style",ea),this.editor.addFontCss(N),this.editor.graph.mathEnabled&&this.editor.addMathCss(N),H(mxUtils.getXml(N))};EditorUi.prototype.timeSince=function(c){c=Math.floor((new Date-c)/1E3);var f=Math.floor(c/31536E3);if(1<f)return f+" "+mxResources.get("years");f=Math.floor(c/2592E3);if(1<f)return f+" "+mxResources.get("months");f=Math.floor(c/86400);if(1<f)return f+" "+mxResources.get("days");f=Math.floor(c/3600);if(1<f)return f+" "+mxResources.get("hours");f=Math.floor(c/60);return 1<f?f+" "+mxResources.get("minutes"):1==f?f+" "+mxResources.get("minute"):null};EditorUi.prototype.decodeNodeIntoGraph=function(c,f){if(null!=c){var l=null;if("diagram"==c.nodeName)l=c;else if("mxfile"==c.nodeName){var t=c.getElementsByTagName("diagram");if(0<t.length){l=t[0];var q=f.getGlobalVariable;f.getGlobalVariable=function(D){return"page"==D?l.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==D?1:q.apply(this,arguments)}}}null!=l&&(c=Editor.parseDiagramNode(l))}t=this.editor.graph;try{this.editor.graph=f,this.editor.setGraphXml(c)}catch(D){}finally{this.editor.graph=t}return c};EditorUi.prototype.getSvgFileProperties=function(c){return this.getPngFileProperties(c)};-EditorUi.prototype.getPngFileProperties=function(c){var f=1,l=0;if(null!=c){if(c.hasAttribute("scale")){var t=parseFloat(c.getAttribute("scale"));!isNaN(t)&&0<t&&(f=t)}c.hasAttribute("border")&&(t=parseInt(c.getAttribute("border")),!isNaN(t)&&0<t&&(l=t))}return{scale:f,border:l}};EditorUi.prototype.getEmbeddedPng=function(c,f,l,t,q){try{var D=this.editor.graph,G=null;if(null!=l&&0<l.length)D=this.createTemporaryGraph(D.getStylesheet()),document.body.appendChild(D.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(l).documentElement,-!0),D),G=l;else if(null!=this.pages&&this.currentPage!=this.pages[0]){D=this.createTemporaryGraph(D.getStylesheet());var N=D.getGlobalVariable;D.setBackgroundImage=this.editor.graph.setBackgroundImage;var L=this.pages[0];this.currentPage==L?D.setBackgroundImage(this.editor.graph.backgroundImage):null!=L.viewState&&null!=L.viewState&&D.setBackgroundImage(L.viewState.backgroundImage);D.getGlobalVariable=function(J){return"page"==J?L.getName():"pagenumber"==J?1:N.apply(this,arguments)};document.body.appendChild(D.container);-D.model.setRoot(L.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(J){try{null==G&&(G=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var Y=J.toDataURL("image/png");Y=Editor.writeGraphModelToPng(Y,"tEXt","mxfile",encodeURIComponent(G));c(Y.substring(Y.lastIndexOf(",")+1));D!=this.editor.graph&&D.container.parentNode.removeChild(D.container)}catch(ha){null!=f&&f(ha)}}),null,null,null,mxUtils.bind(this,function(J){null!=f&&f(J)}),null,null,t,null,D.shadowVisible,null,D,q,-null,null,null,"diagram",null)}catch(J){null!=f&&f(J)}};EditorUi.prototype.getEmbeddedSvg=function(c,f,l,t,q,D,G,N,L,J,Y,ha,ea){N=null!=N?N:!0;Y=null!=Y?Y:0;G=null!=L?L:f.background;G==mxConstants.NONE&&(G=null);null==G&&"none"==f.getAdaptiveColors()&&(G="#ffffff");L=this.editor.graph.createSvgImageExport(null!=c);D=f.getSvg(G,J,Y,null,null,D,null,L,null,f.shadowVisible||ha,null,ea,"diagram");(f.shadowVisible||ha)&&f.addSvgShadow(D,null,null,0==Y);null!=c&&D.setAttribute("content",c);null!=l&&D.setAttribute("resource",+EditorUi.prototype.getPngFileProperties=function(c){var f=1,l=0;if(null!=c){if(c.hasAttribute("scale")){var t=parseFloat(c.getAttribute("scale"));!isNaN(t)&&0<t&&(f=t)}c.hasAttribute("border")&&(t=parseInt(c.getAttribute("border")),!isNaN(t)&&0<t&&(l=t))}return{scale:f,border:l}};EditorUi.prototype.getEmbeddedPng=function(c,f,l,t,q){try{var D=this.editor.graph,H=null;if(null!=l&&0<l.length)D=this.createTemporaryGraph(D.getStylesheet()),document.body.appendChild(D.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(l).documentElement,+!0),D),H=l;else if(null!=this.pages&&this.currentPage!=this.pages[0]){D=this.createTemporaryGraph(D.getStylesheet());var N=D.getGlobalVariable;D.setBackgroundImage=this.editor.graph.setBackgroundImage;var L=this.pages[0];this.currentPage==L?D.setBackgroundImage(this.editor.graph.backgroundImage):null!=L.viewState&&null!=L.viewState&&D.setBackgroundImage(L.viewState.backgroundImage);D.getGlobalVariable=function(J){return"page"==J?L.getName():"pagenumber"==J?1:N.apply(this,arguments)};document.body.appendChild(D.container);+D.model.setRoot(L.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(J){try{null==H&&(H=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var Y=J.toDataURL("image/png");Y=Editor.writeGraphModelToPng(Y,"tEXt","mxfile",encodeURIComponent(H));c(Y.substring(Y.lastIndexOf(",")+1));D!=this.editor.graph&&D.container.parentNode.removeChild(D.container)}catch(ha){null!=f&&f(ha)}}),null,null,null,mxUtils.bind(this,function(J){null!=f&&f(J)}),null,null,t,null,D.shadowVisible,null,D,q,+null,null,null,"diagram",null)}catch(J){null!=f&&f(J)}};EditorUi.prototype.getEmbeddedSvg=function(c,f,l,t,q,D,H,N,L,J,Y,ha,ea){N=null!=N?N:!0;Y=null!=Y?Y:0;H=null!=L?L:f.background;H==mxConstants.NONE&&(H=null);null==H&&"none"==f.getAdaptiveColors()&&(H="#ffffff");L=this.editor.graph.createSvgImageExport(null!=c);D=f.getSvg(H,J,Y,null,null,D,null,L,null,f.shadowVisible||ha,null,ea,"diagram");(f.shadowVisible||ha)&&f.addSvgShadow(D,null,null,0==Y);null!=c&&D.setAttribute("content",c);null!=l&&D.setAttribute("resource",l);var aa=mxUtils.bind(this,function(na){na=(t?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(na);null!=q&&q(na);return na});f.mathEnabled&&this.editor.addMathCss(D);if(null!=q)this.embedFonts(D,mxUtils.bind(this,function(na){N?this.editor.convertImages(na,mxUtils.bind(this,function(W){aa(W)})):aa(na)}));else return aa(D)};EditorUi.prototype.embedFonts=function(c,f){this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=this.editor.resolvedFontCss&&-this.editor.addFontCss(c,this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(l){try{null!=l&&this.editor.addFontCss(c,l),f(c)}catch(t){f(c)}}))}catch(l){f(c)}}))};EditorUi.prototype.exportImage=function(c,f,l,t,q,D,G,N,L,J,Y,ha,ea){L=null!=L?L:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(na){Editor.addRetryToError(na,mxUtils.bind(this,function(){this.exportImage(c,f,l,t,q,D,G,N,L,J,Y,ha,ea)}));this.handleError(na)}))){var aa=-this.editor.graph.isSelectionEmpty();l=null!=l?l:aa;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(na){this.spinner.stop();try{this.saveCanvas(na,q?this.getFileData(!0,null,null,null,l,N,null,null,null,null,null,c,D):null,L,null==this.pages||0==this.pages.length,Y)}catch(W){this.handleError(W)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(na){this.spinner.stop();this.handleError(na)}),null,l,c||1,f,t,null,null,D,G,J,ha,-ea)}catch(na){this.spinner.stop(),this.handleError(na)}}};EditorUi.prototype.isCorsEnabledForUrl=function(c){return this.editor.isCorsEnabledForUrl(c)};EditorUi.prototype.addLocalPagesToMapping=function(c){c=null!=c?c:{};if(null!=this.pages)for(var f=0;f<this.pages.length;f++)c[this.pages[f].getId()]=this.pages[f].getId();return c};EditorUi.prototype.importXml=function(c,f,l,t,q,D,G){f=null!=f?f:0;l=null!=l?l:0;var N=[];try{var L=this.editor.graph;if(null!=c&&0<c.length){L.model.beginUpdate();try{var J=+this.editor.addFontCss(c,this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(l){try{null!=l&&this.editor.addFontCss(c,l),f(c)}catch(t){f(c)}}))}catch(l){f(c)}}))};EditorUi.prototype.exportImage=function(c,f,l,t,q,D,H,N,L,J,Y,ha,ea){L=null!=L?L:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(na){Editor.addRetryToError(na,mxUtils.bind(this,function(){this.exportImage(c,f,l,t,q,D,H,N,L,J,Y,ha,ea)}));this.handleError(na)}))){var aa=+this.editor.graph.isSelectionEmpty();l=null!=l?l:aa;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(na){this.spinner.stop();try{this.saveCanvas(na,q?this.getFileData(!0,null,null,null,l,N,null,null,null,null,null,c,D):null,L,null==this.pages||0==this.pages.length,Y)}catch(W){this.handleError(W)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(na){this.spinner.stop();this.handleError(na)}),null,l,c||1,f,t,null,null,D,H,J,ha,+ea)}catch(na){this.spinner.stop(),this.handleError(na)}}};EditorUi.prototype.isCorsEnabledForUrl=function(c){return this.editor.isCorsEnabledForUrl(c)};EditorUi.prototype.addLocalPagesToMapping=function(c){c=null!=c?c:{};if(null!=this.pages)for(var f=0;f<this.pages.length;f++)c[this.pages[f].getId()]=this.pages[f].getId();return c};EditorUi.prototype.importXml=function(c,f,l,t,q,D,H){f=null!=f?f:0;l=null!=l?l:0;var N=[];try{var L=this.editor.graph;if(null!=c&&0<c.length){L.model.beginUpdate();try{var J=mxUtils.parseXml(c);c={};var Y=this.editor.extractGraphModel(J.documentElement,null!=this.pages);if(null!=Y&&"mxfile"==Y.nodeName&&null!=this.pages){var ha=Y.getElementsByTagName("diagram");if(1==ha.length&&!D){if(Y=Editor.parseDiagramNode(ha[0]),null!=this.currentPage&&(c[ha[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var ea=ha[0].getAttribute("name");null!=ea&&""!=ea&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,ea))}}else if(0<ha.length){D=[];var aa=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(c[ha[0].getAttribute("id")]=this.pages[0].getId(),ea=ha[0].getAttribute("name"),null!=ea&&""!=ea&&this.editor.graph.model.execute(new RenamePage(this,this.pages[0],ea)),Y=Editor.parseDiagramNode(ha[0]),t=!1,aa=1);for(;aa<ha.length;aa++){var na=ha[aa].getAttribute("id");ha[aa].removeAttribute("id");var W=this.updatePageRoot(new DiagramPage(ha[aa]));c[na]=ha[aa].getAttribute("id");var ba=this.pages.length;null==W.getName()&&W.setName(mxResources.get("pageWithNumber",-[ba+1]));L.model.execute(new ChangePage(this,W,W,ba,!0));D.push(W)}this.updatePageLinks(c,D)}}if(null!=Y&&"mxGraphModel"===Y.nodeName){N=L.importGraphModel(Y,f,l,t);if(null!=N)for(this.addLocalPagesToMapping(c),aa=0;aa<N.length;aa++)this.updatePageLinksForCell(c,N[aa]);var ja=L.parseBackgroundImage(Y.getAttribute("backgroundImage"));if(null!=ja&&null!=ja.originalSrc){this.updateBackgroundPageLink(c,ja);var ca=new ChangePageSetup(this,null,ja);ca.ignoreColor=!0;L.model.execute(ca)}}G&&L.pasteCellStyles(L.includeDescendants(N),+[ba+1]));L.model.execute(new ChangePage(this,W,W,ba,!0));D.push(W)}this.updatePageLinks(c,D)}}if(null!=Y&&"mxGraphModel"===Y.nodeName){N=L.importGraphModel(Y,f,l,t);if(null!=N)for(this.addLocalPagesToMapping(c),aa=0;aa<N.length;aa++)this.updatePageLinksForCell(c,N[aa]);var ja=L.parseBackgroundImage(Y.getAttribute("backgroundImage"));if(null!=ja&&null!=ja.originalSrc){this.updateBackgroundPageLink(c,ja);var ca=new ChangePageSetup(this,null,ja);ca.ignoreColor=!0;L.model.execute(ca)}}H&&L.pasteCellStyles(L.includeDescendants(N),L.defaultVertexStyle,L.defaultEdgeStyle)}finally{L.model.endUpdate()}}}catch(la){if(q)throw la;this.handleError(la)}return N};EditorUi.prototype.updatePageLinks=function(c,f){for(var l=0;l<f.length;l++)this.updatePageLinksForCell(c,f[l].root),null!=f[l].viewState&&this.updateBackgroundPageLink(c,f[l].viewState.backgroundImage)};EditorUi.prototype.updateBackgroundPageLink=function(c,f){try{if(null!=f&&Graph.isPageLink(f.originalSrc)){var l=c[f.originalSrc.substring(f.originalSrc.indexOf(",")+1)];null!=-l&&(f.originalSrc="data:page/id,"+l)}}catch(t){}};EditorUi.prototype.updatePageLinksForCell=function(c,f){var l=document.createElement("div"),t=this.editor.graph,q=t.getLinkForCell(f);null!=q&&t.setLinkForCell(f,this.updatePageLink(c,q));if(t.isHtmlLabel(f)){l.innerHTML=Graph.sanitizeHtml(t.getLabel(f));for(var D=l.getElementsByTagName("a"),G=!1,N=0;N<D.length;N++)q=D[N].getAttribute("href"),null!=q&&(D[N].setAttribute("href",this.updatePageLink(c,q)),G=!0);G&&t.labelChanged(f,l.innerHTML)}for(N=-0;N<t.model.getChildCount(f);N++)this.updatePageLinksForCell(c,t.model.getChildAt(f,N))};EditorUi.prototype.updatePageLink=function(c,f){if(Graph.isPageLink(f)){var l=c[f.substring(f.indexOf(",")+1)];f=null!=l?"data:page/id,"+l:null}else if("data:action/json,"==f.substring(0,17))try{var t=JSON.parse(f.substring(17));if(null!=t.actions){for(var q=0;q<t.actions.length;q++){var D=t.actions[q];if(null!=D.open&&Graph.isPageLink(D.open)){var G=D.open.substring(D.open.indexOf(",")+1);l=c[G];null!=l?D.open=-"data:page/id,"+l:null==this.getPageById(G)&&delete D.open}}f="data:action/json,"+JSON.stringify(t)}}catch(N){}return f};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,f,l,t,q){var D=mxUtils.bind(this,function(G){this.loadingExtensions=!1;null!=l?l(G):this.handleError(G)});this.createTimeout(null,mxUtils.bind(this,function(G){t=null!=t?t:c.name;var N=mxUtils.bind(this,function(J){G.clear()&&+l&&(f.originalSrc="data:page/id,"+l)}}catch(t){}};EditorUi.prototype.updatePageLinksForCell=function(c,f){var l=document.createElement("div"),t=this.editor.graph,q=t.getLinkForCell(f);null!=q&&t.setLinkForCell(f,this.updatePageLink(c,q));if(t.isHtmlLabel(f)){l.innerHTML=Graph.sanitizeHtml(t.getLabel(f));for(var D=l.getElementsByTagName("a"),H=!1,N=0;N<D.length;N++)q=D[N].getAttribute("href"),null!=q&&(D[N].setAttribute("href",this.updatePageLink(c,q)),H=!0);H&&t.labelChanged(f,l.innerHTML)}for(N=+0;N<t.model.getChildCount(f);N++)this.updatePageLinksForCell(c,t.model.getChildAt(f,N))};EditorUi.prototype.updatePageLink=function(c,f){if(Graph.isPageLink(f)){var l=c[f.substring(f.indexOf(",")+1)];f=null!=l?"data:page/id,"+l:null}else if("data:action/json,"==f.substring(0,17))try{var t=JSON.parse(f.substring(17));if(null!=t.actions){for(var q=0;q<t.actions.length;q++){var D=t.actions[q];if(null!=D.open&&Graph.isPageLink(D.open)){var H=D.open.substring(D.open.indexOf(",")+1);l=c[H];null!=l?D.open=+"data:page/id,"+l:null==this.getPageById(H)&&delete D.open}}f="data:action/json,"+JSON.stringify(t)}}catch(N){}return f};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,f,l,t,q){var D=mxUtils.bind(this,function(H){this.loadingExtensions=!1;null!=l?l(H):this.handleError(H)});this.createTimeout(null,mxUtils.bind(this,function(H){t=null!=t?t:c.name;var N=mxUtils.bind(this,function(J){H.clear()&&D(J)}),L=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var J=this.isRemoteVisioFormat(t);try{var Y=t.lastIndexOf(".");if(0<=Y&&Y<t.length)t.substring(Y+1).toUpperCase();else{var ha=t.lastIndexOf("/");0<=ha&&ha<t.length&&(t=t.substring(ha+1))}}catch(aa){}if(J)if(null==VSD_CONVERT_URL||this.isOffline())N({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{J=new FormData;J.append("file1",c,t);var ea=-new XMLHttpRequest;ea.open("POST",VSD_CONVERT_URL+(/(\.vss|\.vsx)$/.test(t)?"?stencil=1":""));ea.responseType="blob";this.addRemoteServiceSecurityCheck(ea);null!=q&&ea.setRequestHeader("x-convert-custom",q);ea.onreadystatechange=mxUtils.bind(this,function(){if(4==ea.readyState&&G.clear())if(200<=ea.status&&299>=ea.status)try{var aa=ea.response;if("text/xml"==aa.type){var na=new FileReader;na.onload=mxUtils.bind(this,function(W){try{f(W.target.result)}catch(ba){N({message:mxResources.get("errorLoadingFile")})}});-na.readAsText(aa)}else this.doImportVisio(aa,f,N,t)}catch(W){N(W)}else try{""==ea.responseType||"text"==ea.responseType?N({message:ea.responseText}):(na=new FileReader,na.onload=function(){try{N({message:JSON.parse(na.result).Message})}catch(W){N(W)}},na.readAsText(ea.response))}catch(W){N({})}});ea.send(J)}else if(G.clear())try{this.doImportVisio(c,f,N,t)}catch(aa){N(aa)}}else N({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?-L():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",L,null,null,null,N))}),D)};EditorUi.prototype.importGraphML=function(c,f,l){var t=mxUtils.bind(this,function(q){this.loadingExtensions=!1;null!=l?l(q):this.handleError(q)});this.createTimeout(null,mxUtils.bind(this,function(q){var D=mxUtils.bind(this,function(N){q.clear()&&t(N)}),G=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(q.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,f,t)}catch(N){D(N)}else D({message:mxResources.get("serviceUnavailableOrBlocked")})});-this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?G():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",G,null,null,null,D))}),t)};EditorUi.prototype.exportVisio=function(c){if(this.spinner.spin(document.body,mxResources.get("loading"))){var f=mxUtils.bind(this,function(l){this.loadingExtensions=!1;this.handleError(l)});this.vsdxExportEnabled()?this.createTimeout(null,mxUtils.bind(this,function(l){var t=mxUtils.bind(this,function(D){l.clear()&&f(D)}),+new XMLHttpRequest;ea.open("POST",VSD_CONVERT_URL+(/(\.vss|\.vsx)$/.test(t)?"?stencil=1":""));ea.responseType="blob";this.addRemoteServiceSecurityCheck(ea);null!=q&&ea.setRequestHeader("x-convert-custom",q);ea.onreadystatechange=mxUtils.bind(this,function(){if(4==ea.readyState&&H.clear())if(200<=ea.status&&299>=ea.status)try{var aa=ea.response;if("text/xml"==aa.type){var na=new FileReader;na.onload=mxUtils.bind(this,function(W){try{f(W.target.result)}catch(ba){N({message:mxResources.get("errorLoadingFile")})}});+na.readAsText(aa)}else this.doImportVisio(aa,f,N,t)}catch(W){N(W)}else try{""==ea.responseType||"text"==ea.responseType?N({message:ea.responseText}):(na=new FileReader,na.onload=function(){try{N({message:JSON.parse(na.result).Message})}catch(W){N(W)}},na.readAsText(ea.response))}catch(W){N({})}});ea.send(J)}else if(H.clear())try{this.doImportVisio(c,f,N,t)}catch(aa){N(aa)}}else N({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?+L():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",L,null,null,null,N))}),D)};EditorUi.prototype.importGraphML=function(c,f,l){var t=mxUtils.bind(this,function(q){this.loadingExtensions=!1;null!=l?l(q):this.handleError(q)});this.createTimeout(null,mxUtils.bind(this,function(q){var D=mxUtils.bind(this,function(N){q.clear()&&t(N)}),H=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(q.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,f,t)}catch(N){D(N)}else D({message:mxResources.get("serviceUnavailableOrBlocked")})});+this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?H():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",H,null,null,null,D))}),t)};EditorUi.prototype.exportVisio=function(c){if(this.spinner.spin(document.body,mxResources.get("loading"))){var f=mxUtils.bind(this,function(l){this.loadingExtensions=!1;this.handleError(l)});this.vsdxExportEnabled()?this.createTimeout(null,mxUtils.bind(this,function(l){var t=mxUtils.bind(this,function(D){l.clear()&&f(D)}),q=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(l.clear())if("undefined"!==typeof VsdxExport)try{this.spinner.stop(),(new VsdxExport(this)).exportCurrentDiagrams(c)||t({message:mxResources.get("unknownError")})}catch(D){t(D)}else t({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(q,0):(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",q,null,null,null,-t))}),f):f({message:mxResources.get("serviceUnavailableOrBlocked")})}};EditorUi.prototype.convertLucidChart=function(c,f,l){var t=mxUtils.bind(this,function(q){this.loadingExtensions=!1;null!=l?l(q):this.handleError(q)});this.createTimeout(null,mxUtils.bind(this,function(q){var D=mxUtils.bind(this,function(N){q.clear()&&t(N)}),G=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(q.clear())if("undefined"!==typeof window.LucidImporter)try{var N=JSON.parse(c);f(LucidImporter.importState(N));try{if(null!=+t))}),f):f({message:mxResources.get("serviceUnavailableOrBlocked")})}};EditorUi.prototype.convertLucidChart=function(c,f,l){var t=mxUtils.bind(this,function(q){this.loadingExtensions=!1;null!=l?l(q):this.handleError(q)});this.createTimeout(null,mxUtils.bind(this,function(q){var D=mxUtils.bind(this,function(N){q.clear()&&t(N)}),H=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(q.clear())if("undefined"!==typeof window.LucidImporter)try{var N=JSON.parse(c);f(LucidImporter.importState(N));try{if(null!=window.console&&"1"==urlParams.test){var L=[(new Date).toISOString(),"convertLucidChart",N];null!=N.state&&L.push(JSON.parse(N.state));if(null!=N.svgThumbs)for(var J=0;J<N.svgThumbs.length;J++)L.push(Editor.createSvgDataUri(N.svgThumbs[J]));null!=N.thumb&&L.push(N.thumb);console.log.apply(console,L)}}catch(Y){}}catch(Y){null!=window.console&&console.error(Y),D(Y)}else D({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?-window.setTimeout(G,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",function(){mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",G,null,null,null,D)},null,null,null,D)},null,null,null,D)},null,null,null,D)},null,null,null,D):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",G,null,null,null,D))}),-t)};EditorUi.prototype.createMermaidXml=function(c,f,l,t,q,D){var G=new Graph(document.createElement("div"));l=G.insertVertex(null,null,null,0,0,t,q,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+l+";");G.setAttributeForCell(l,"mermaidData",JSON.stringify({data:c,config:f},null,2));null!=D&&G.setAttributeForCell(l,"templatePrompt",D);c=(new mxCodec).encode(G.getModel());return mxUtils.getXml(c)};EditorUi.prototype.generateOpenAiMermaidDiagram=function(c,f,l){var t=0,q=function(){for(var G=-document.querySelectorAll('div[id*="dgeMermaidOutput-"]'),N=0;N<G.length;N++)null!=G[N].parentNode&&G[N].parentNode.removeChild(G[N])},D=mxUtils.bind(this,function(){this.createTimeout(1E4,mxUtils.bind(this,function(G){var N=new mxXmlRequest("https://www.draw.io/generate/v2",c,"POST"),L=mxUtils.bind(this,function(J){G.clear()&&(q(),l(J))});N.send(mxUtils.bind(this,function(J){if(G.isAlive())if(200<=J.getStatus()&&299>=J.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var ha=mxUtils.trim(J.getText());-this.generateMermaidImage(ha,null,mxUtils.bind(this,function(ea,aa,na){this.tryAndHandle(mxUtils.bind(this,function(){G.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram","\nprompt:",c,"\nresult:",ha),q(),f(ha,ea,aa,na))}),L)}),L,mxUtils.bind(this,function(ea){3>t++?G.clear()&&D():L(ea)}))}),L);else{var Y={message:mxResources.get("error")+" "+J.getStatus()};try{Y=JSON.parse(J.getText()),Y=Y.error}catch(ha){}L(Y)}}),L)}),l)});D()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=+window.setTimeout(H,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",function(){mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",H,null,null,null,D)},null,null,null,D)},null,null,null,D)},null,null,null,D)},null,null,null,D):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",H,null,null,null,D))}),+t)};EditorUi.prototype.createMermaidXml=function(c,f,l,t,q,D){var H=new Graph(document.createElement("div"));l=H.insertVertex(null,null,null,0,0,t,q,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+l+";");H.setAttributeForCell(l,"mermaidData",JSON.stringify({data:c,config:f},null,2));null!=D&&H.setAttributeForCell(l,"templatePrompt",D);c=(new mxCodec).encode(H.getModel());return mxUtils.getXml(c)};EditorUi.prototype.generateOpenAiMermaidDiagram=function(c,f,l){var t=0,q=function(){for(var H=+document.querySelectorAll('div[id*="dgeMermaidOutput-"]'),N=0;N<H.length;N++)null!=H[N].parentNode&&H[N].parentNode.removeChild(H[N])},D=mxUtils.bind(this,function(){this.createTimeout(1E4,mxUtils.bind(this,function(H){var N=new mxXmlRequest("https://www.draw.io/generate/v2",c,"POST"),L=mxUtils.bind(this,function(J){H.clear()&&(q(),l(J))});N.send(mxUtils.bind(this,function(J){if(H.isAlive())if(200<=J.getStatus()&&299>=J.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var ha=mxUtils.trim(J.getText());+this.generateMermaidImage(ha,null,mxUtils.bind(this,function(ea,aa,na){this.tryAndHandle(mxUtils.bind(this,function(){H.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram","\nprompt:",c,"\nresult:",ha),q(),f(ha,ea,aa,na))}),L)}),L,mxUtils.bind(this,function(ea){3>t++?H.clear()&&D():L(ea)}))}),L);else{var Y={message:mxResources.get("error")+" "+J.getStatus()};try{Y=JSON.parse(J.getText()),Y=Y.error}catch(ha){}L(Y)}}),L)}),l)});D()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=mxUtils.trim(c);"o\n\n"==c.substring(0,3)&&(c=c.substring(3));var f=c.split("```");f=1<f.length?f:c.split("<pre>");f=1<f.length?f:c.split("~~~");f=1<f.length?f:c.split("%%");f=1<f.length?f:c.split("(Begins)");c=mxUtils.trim(1>=f.length?c:f[1]);f=c.split("\n");var l=1<f.length?f[1]:null;if(null!=l){var t=l.indexOf("-");0<t&&(l=l.substring(0,t))}if(0<f.length&&"mermaid"==mxUtils.trim(f[0])||null!=l&&0<=mxUtils.indexOf(EditorUi.mermaidDiagramTypes,l))f.shift(),c=mxUtils.trim(f.join("\n")),f=c.split("\n");-l=f[0].split(" ")[0].replace(/:$/,"");t=l.indexOf("-");0<t&&(l=l.substring(0,t));try{"mindmap"==l&&2<f.length&&(c=extractMermaidMindmap(f))}catch(q){}0>mxUtils.indexOf(EditorUi.mermaidDiagramTypes,l)&&(c=null);return c};EditorUi.prototype.generateMermaidImage=function(c,f,l,t,q){var D=mxUtils.bind(this,function(N){this.loadingMermaid=!1;null!=t?t(N):this.handleError(N)}),G=mxUtils.bind(this,function(){try{this.loadingMermaid=!1;f=null!=f?f:mxUtils.clone(EditorUi.defaultMermaidConfig);f.securityLevel=+l=f[0].split(" ")[0].replace(/:$/,"");t=l.indexOf("-");0<t&&(l=l.substring(0,t));try{"mindmap"==l&&2<f.length&&(c=extractMermaidMindmap(f))}catch(q){}0>mxUtils.indexOf(EditorUi.mermaidDiagramTypes,l)&&(c=null);return c};EditorUi.prototype.generateMermaidImage=function(c,f,l,t,q){var D=mxUtils.bind(this,function(N){this.loadingMermaid=!1;null!=t?t(N):this.handleError(N)}),H=mxUtils.bind(this,function(){try{this.loadingMermaid=!1;f=null!=f?f:mxUtils.clone(EditorUi.defaultMermaidConfig);f.securityLevel="strict";f.startOnLoad=!1;f.maxTextSize=9E5;"undefined"!==typeof mxMermaidToDrawio&&f.flowchart&&0<=c.indexOf("$$")&&(f.flowchart.htmlLabels=!0,mxMermaidToDrawio.htmlLabels=!0);Editor.isDarkMode()&&(f.theme="dark");var N=mxUtils.bind(this,function(L){try{if(mxClient.IS_IE||mxClient.IS_IE11)L=L.replace(/ xmlns:\S*="http:\/\/www.w3.org\/XML\/1998\/namespace"/g,"").replace(/ (NS xml|\S*):space="preserve"/g,' xml:space="preserve"');var J=mxUtils.parseXml(L).getElementsByTagName("svg");if(0<J.length&&"error"!=J[0].getAttribute("aria-roledescription")){var Y=parseFloat(J[0].getAttribute("width")),ha=parseFloat(J[0].getAttribute("height"));if(isNaN(Y)||isNaN(ha))try{var ea=J[0].getAttribute("viewBox").split(/\s+/);Y=parseFloat(ea[2]);ha=parseFloat(ea[3])}catch(aa){Y=Y||100,ha=ha||100}l(this.convertDataUri(Editor.createSvgDataUri(L)),Y,ha)}else null!=q?q():t({message:mxResources.get("invalidInput")})}catch(aa){t(aa)}});mermaid.mermaidAPI.initialize(f);mermaid.mermaidAPI.render("geMermaidOutput-"+-(new Date).getTime(),c).then(function(L){N(L.svg)}).catch(function(L){null!=q?q(L):t(L)})}catch(L){t(L)}});"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(G,0):(this.loadingMermaid=!0,"1"==urlParams.dev?("1"==urlParams.mermaidToDrawioTest&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(N){this.importXml(N,null,null,null,null,null,!0)})),mxscript("js/mermaid/mermaid.min.js",G,null,null,null,D)):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",-G,null,null,null,D))};EditorUi.prototype.generatePlantUmlImage=function(c,f,l,t){function q(N,L,J){c1=N>>2;c2=(N&3)<<4|L>>4;c3=(L&15)<<2|J>>6;c4=J&63;r="";r+=D(c1&63);r+=D(c2&63);r+=D(c3&63);return r+=D(c4&63)}function D(N){if(10>N)return String.fromCharCode(48+N);N-=10;if(26>N)return String.fromCharCode(65+N);N-=26;if(26>N)return String.fromCharCode(97+N);N-=26;return 0==N?"-":1==N?"_":"?"}var G=new XMLHttpRequest;G.open("GET",("txt"==f?PLANT_URL+"/txt/":"png"==f?PLANT_URL+"/png/":PLANT_URL+"/svg/")+-function(N){r="";for(i=0;i<N.length;i+=3)r=i+2==N.length?r+q(N.charCodeAt(i),N.charCodeAt(i+1),0):i+1==N.length?r+q(N.charCodeAt(i),0,0):r+q(N.charCodeAt(i),N.charCodeAt(i+1),N.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(c))),!0);"txt"!=f&&(G.responseType="blob");G.onload=function(N){if(200<=this.status&&300>this.status)if("txt"==f)l(this.response);else{var L=new FileReader;L.readAsDataURL(this.response);L.onloadend=function(J){var Y=new Image;Y.onload=function(){try{var ha=-Y.width,ea=Y.height;if(0==ha&&0==ea){var aa=L.result,na=aa.indexOf(","),W=decodeURIComponent(escape(atob(aa.substring(na+1)))),ba=mxUtils.parseXml(W).getElementsByTagName("svg");0<ba.length&&(ha=parseFloat(ba[0].getAttribute("width")),ea=parseFloat(ba[0].getAttribute("height")))}l(L.result,ha,ea)}catch(ja){t(ja)}};Y.src=L.result};L.onerror=function(J){t(J)}}else t(N)};G.onerror=function(N){t(N)};G.send()};EditorUi.prototype.insertAsPreText=function(c,f,l){var t=this.editor.graph,q=null;t.getModel().beginUpdate();-try{q=t.insertVertex(null,null,"<pre>"+c+"</pre>",f,l,1,1,"text;html=1;align=left;verticalAlign=top;"),t.updateCellSize(q,!0)}finally{t.getModel().endUpdate()}return q};EditorUi.prototype.insertTextAt=function(c,f,l,t,q,D,G,N){D=null!=D?D:!0;G=null!=G?G:!0;if(null!=c)if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c))this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(c.replace(/\s+/g," "),mxUtils.bind(this,function(ea){4==+(new Date).getTime(),c).then(function(L){N(L.svg)}).catch(function(L){null!=q?q(L):t(L)})}catch(L){t(L)}});"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(H,0):(this.loadingMermaid=!0,"1"==urlParams.dev?("1"==urlParams.mermaidToDrawioTest&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(N){this.importXml(N,null,null,null,null,null,!0)})),mxscript("js/mermaid/mermaid.min.js",H,null,null,null,D)):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",+H,null,null,null,D))};EditorUi.prototype.generatePlantUmlImage=function(c,f,l,t){function q(N,L,J){c1=N>>2;c2=(N&3)<<4|L>>4;c3=(L&15)<<2|J>>6;c4=J&63;r="";r+=D(c1&63);r+=D(c2&63);r+=D(c3&63);return r+=D(c4&63)}function D(N){if(10>N)return String.fromCharCode(48+N);N-=10;if(26>N)return String.fromCharCode(65+N);N-=26;if(26>N)return String.fromCharCode(97+N);N-=26;return 0==N?"-":1==N?"_":"?"}var H=new XMLHttpRequest;H.open("GET",("txt"==f?PLANT_URL+"/txt/":"png"==f?PLANT_URL+"/png/":PLANT_URL+"/svg/")++function(N){r="";for(i=0;i<N.length;i+=3)r=i+2==N.length?r+q(N.charCodeAt(i),N.charCodeAt(i+1),0):i+1==N.length?r+q(N.charCodeAt(i),0,0):r+q(N.charCodeAt(i),N.charCodeAt(i+1),N.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(c))),!0);"txt"!=f&&(H.responseType="blob");H.onload=function(N){if(200<=this.status&&300>this.status)if("txt"==f)l(this.response);else{var L=new FileReader;L.readAsDataURL(this.response);L.onloadend=function(J){var Y=new Image;Y.onload=function(){try{var ha=+Y.width,ea=Y.height;if(0==ha&&0==ea){var aa=L.result,na=aa.indexOf(","),W=decodeURIComponent(escape(atob(aa.substring(na+1)))),ba=mxUtils.parseXml(W).getElementsByTagName("svg");0<ba.length&&(ha=parseFloat(ba[0].getAttribute("width")),ea=parseFloat(ba[0].getAttribute("height")))}l(L.result,ha,ea)}catch(ja){t(ja)}};Y.src=L.result};L.onerror=function(J){t(J)}}else t(N)};H.onerror=function(N){t(N)};H.send()};EditorUi.prototype.insertAsPreText=function(c,f,l){var t=this.editor.graph,q=null;t.getModel().beginUpdate();+try{q=t.insertVertex(null,null,"<pre>"+c+"</pre>",f,l,1,1,"text;html=1;align=left;verticalAlign=top;"),t.updateCellSize(q,!0)}finally{t.getModel().endUpdate()}return q};EditorUi.prototype.insertTextAt=function(c,f,l,t,q,D,H,N){D=null!=D?D:!0;H=null!=H?H:!0;if(null!=c)if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c))this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(c.replace(/\s+/g," "),mxUtils.bind(this,function(ea){4==ea.readyState&&200<=ea.status&&299>=ea.status&&this.editor.graph.setSelectionCells(this.insertTextAt(ea.responseText,f,l,!0))}));else if("data:"==c.substring(0,5)||!this.isOffline()&&(q||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var L=this.editor.graph;if("data:application/pdf;base64,"==c.substring(0,28)){var J=Editor.extractGraphModelFromPdf(c);if(null!=J&&0<J.length)return this.importXml(J,f,l,D,!0,N)}if(Editor.isPngDataUrl(c)&&(J=Editor.extractGraphModelFromPng(c),null!=J&&0<J.length))return this.importXml(J,f,l,D,!0,N);if("data:image/svg+xml;"==c.substring(0,19))try{J=null;"data:image/svg+xml;base64,"==c.substring(0,26)?(J=c.substring(c.indexOf(",")+1),J=window.atob&&!mxClient.IS_SF?atob(J):Base64.decode(J,!0)):J=decodeURIComponent(c.substring(c.indexOf(",")+1));var Y=this.importXml(J,f,l,D,!0,N);if(0<Y.length)return Y}catch(ea){}this.loadImage(c,mxUtils.bind(this,function(ea){if("data:"==c.substring(0,5))this.resizeImage(ea,c,mxUtils.bind(this,function(W,ba,ja){L.setSelectionCell(L.insertVertex(null,-null,"",L.snap(f),L.snap(l),ba,ja,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(W)+";"))}),G,this.maxImageSize);else{var aa=Math.min(1,Math.min(this.maxImageSize/ea.width,this.maxImageSize/ea.height)),na=Math.round(ea.width*aa);ea=Math.round(ea.height*aa);L.setSelectionCell(L.insertVertex(null,null,"",L.snap(f),L.snap(l),na,ea,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="++null,"",L.snap(f),L.snap(l),ba,ja,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(W)+";"))}),H,this.maxImageSize);else{var aa=Math.min(1,Math.min(this.maxImageSize/ea.width,this.maxImageSize/ea.height)),na=Math.round(ea.width*aa);ea=Math.round(ea.height*aa);L.setSelectionCell(L.insertVertex(null,null,"",L.snap(f),L.snap(l),na,ea,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";"))}}),mxUtils.bind(this,function(){var ea=null;L.getModel().beginUpdate();try{ea=L.insertVertex(L.getDefaultParent(),null,c,L.snap(f),L.snap(l),1,1,"text;"+(t?"html=1;":"")),L.updateCellSize(ea),L.fireEvent(new mxEventObject("textInserted","cells",[ea]))}finally{L.getModel().endUpdate()}L.setSelectionCell(ea)}))}else{c=Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,f,l,D,null,N);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(ea){this.editor.graph.setSelectionCells(this.importXml(ea,f,l,D,null,N))}),mxUtils.bind(this,function(ea){this.handleError(ea)}));else{L=this.editor.graph;q=null;L.getModel().beginUpdate();try{q=L.insertVertex(L.getDefaultParent(),null,"",L.snap(f),L.snap(l),1,1,"text;whiteSpace=wrap;"+(t?"html=1;":""));L.fireEvent(new mxEventObject("textInserted","cells",[q]));t&&(c=L.sanitizeHtml(c));c.length>this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");q.value=c;L.updateCellSize(q);if(0<this.maxTextWidth&&q.geometry.width>this.maxTextWidth){var ha=L.getPreferredSizeForCell(q,this.maxTextWidth);q.geometry.width=ha.width;q.geometry.height=ha.height}Graph.isLink(q.value)&&L.setLinkForCell(q,q.value);q.geometry.width+=L.gridSize;q.geometry.height+=L.gridSize}finally{L.getModel().endUpdate()}return[q]}}return[]};EditorUi.prototype.formatFileSize=function(c){var f=-1;do c/=1024,f++;while(1024<c);return Math.max(c,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[f]};EditorUi.prototype.convertDataUri=function(c){if("data:"==c.substring(0,5)){var f=c.indexOf(";");0<f&&(c=c.substring(0,f)+c.substring(c.indexOf(",",f+1)))}return c};EditorUi.prototype.isRemoteFileFormat=function(c,f){return/("contentType":\s*"application\/gliffy\+json")/.test(c)};EditorUi.prototype.isLucidChartData=function(c){return null!=c&&('{"state":"{\\"Properties\\":'==c.substring(0,26)||'{"Properties":'==c.substring(0,14))};EditorUi.prototype.importLocalFile=function(c,f){if(c&&Graph.fileSupport){if(null==this.importFileInputElt){var l=-document.createElement("input");l.setAttribute("type","file");mxEvent.addListener(l,"change",mxUtils.bind(this,function(){null!=l.files&&(this.importFiles(l.files,null,null,this.maxImageSize),l.type="",l.type="file",l.value="")}));l.style.display="none";document.body.appendChild(l);this.importFileInputElt=l}this.importFileInputElt.click()}else{window.openNew=!1;window.openKey="import";window.listBrowserFiles=mxUtils.bind(this,function(G,N){StorageFile.listFiles(this,"F",G,N)});window.openBrowserFile=-mxUtils.bind(this,function(G,N,L){StorageFile.getFileContent(this,G,N,L)});window.deleteBrowserFile=mxUtils.bind(this,function(G,N,L){StorageFile.deleteFile(this,G,N,L)});if(!f){var t=Editor.useLocalStorage;Editor.useLocalStorage=!c}window.openFile=new OpenFile(mxUtils.bind(this,function(G){this.hideDialog(G)}));window.openFile.setConsumer(mxUtils.bind(this,function(G,N){null!=N&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(N)?(G=new Blob([G],{type:"application/octet-stream"}),this.importVisio(G,-mxUtils.bind(this,function(L){this.importXml(L,0,0,!0)}),null,N)):this.editor.graph.setSelectionCells(this.importXml(G,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null});if(!f){var q=this.dialog,D=q.close;this.dialog.close=mxUtils.bind(this,function(G){Editor.useLocalStorage=t;D.apply(q,arguments);G&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=-function(c,f,l){var t=this,q=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(c).then(function(D){if(mxUtils.isEmptyObject(D.files))l();else{var G=0,N,L=!1;D.forEach(function(J,Y){J=Y.name.toLowerCase();"diagram/diagram.xml"==J?(L=!0,Y.async("string").then(function(ha){0==ha.indexOf("<mxfile ")?f(ha):l()})):0==J.indexOf("versions/")&&(J=parseInt(J.substr(9)),J>G&&(G=J,N=Y))});0<G?N.async("string").then(function(J){(new XMLHttpRequest).upload&&t.isRemoteFileFormat(J,-c.name)?t.isOffline()?t.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,l):t.parseFileData(J,mxUtils.bind(this,function(Y){4==Y.readyState&&(200<=Y.status&&299>=Y.status?f(Y.responseText):l())}),c.name):l()}):L||l()}},function(D){l(D)}):l()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?q():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",q,null,null,null,l))};EditorUi.prototype.importFile=function(c,f,l,t,q,D,G,-N,L,J,Y,ha){J=null!=J?J:!0;var ea=!1,aa=null,na=mxUtils.bind(this,function(W){var ba=null;null!=W&&"<mxlibrary"==W.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,W,G)),this.showSidebar()):ba=this.importXml(W,l,t,J,null,null!=ha?mxEvent.isControlDown(ha):null);null!=N&&N(ba)});"image"==f.substring(0,5)?(L=!1,"image/png"==f.substring(0,9)&&(Y=Y?null:this.extractGraphModelFromPng(c),null!=Y&&0<Y.length&&(aa=this.importXml(Y,l,t,J,null,null!=ha?mxEvent.isControlDown(ha):null),L=!0)),L||(L=this.editor.graph,-Y=c.indexOf(";"),0<Y&&(c=c.substring(0,Y)+c.substring(c.indexOf(",",Y+1))),J&&L.isGridEnabled()&&(l=L.snap(l),t=L.snap(t)),Y="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;","image/svg"==f.substring(0,9)&&(Y+="editableCssRules=.*;"),aa=[L.insertVertex(null,null,"",l,t,q,D,Y+"image="+c+";")])):/(\.*<graphml )/.test(c)?(ea=!0,this.importGraphML(c,na)):null!=L&&null!=G&&EditorUi.isVisioFilename(G)?(ea=!0,this.importVisio(L,na)):(new XMLHttpRequest).upload&&-this.isRemoteFileFormat(c,G)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(ea=!0,f=mxUtils.bind(this,function(W){4==W.readyState&&(200<=W.status&&299>=W.status?na(W.responseText):null!=N&&(N(null),this.showError(mxResources.get("error"),413==W.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),null!=c?this.parseFileData(c,f,G):this.parseFile(L,f,G)):0==c.indexOf("PK")&&null!=L?(ea=!0,this.importZipFile(L,na,mxUtils.bind(this,-function(){aa=this.insertTextAt(this.validateFileData(c),l,t,!0,null,J);N(aa)}))):/(\.v(sd|dx))($|\?)/i.test(G)||/(\.vs(s|x))($|\?)/i.test(G)||(aa=this.insertTextAt(this.validateFileData(c),l,t,!0,null,J,null,null!=ha?mxEvent.isControlDown(ha):null));ea||null==N||N(aa);return aa};EditorUi.prototype.importFiles=function(c,f,l,t,q,D,G,N,L,J,Y,ha,ea){t=null!=t?t:this.maxImageSize;J=null!=J?J:this.maxImageBytes;var aa=null!=f&&null!=l,na=!0;f=null!=f?f:0;l=null!=l?l:0;var W=!1;if(!mxClient.IS_CHROMEAPP&&+document.createElement("input");l.setAttribute("type","file");mxEvent.addListener(l,"change",mxUtils.bind(this,function(){null!=l.files&&(this.importFiles(l.files,null,null,this.maxImageSize),l.type="",l.type="file",l.value="")}));l.style.display="none";document.body.appendChild(l);this.importFileInputElt=l}this.importFileInputElt.click()}else{window.openNew=!1;window.openKey="import";window.listBrowserFiles=mxUtils.bind(this,function(H,N){StorageFile.listFiles(this,"F",H,N)});window.openBrowserFile=+mxUtils.bind(this,function(H,N,L){StorageFile.getFileContent(this,H,N,L)});window.deleteBrowserFile=mxUtils.bind(this,function(H,N,L){StorageFile.deleteFile(this,H,N,L)});if(!f){var t=Editor.useLocalStorage;Editor.useLocalStorage=!c}window.openFile=new OpenFile(mxUtils.bind(this,function(H){this.hideDialog(H)}));window.openFile.setConsumer(mxUtils.bind(this,function(H,N){null!=N&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(N)?(H=new Blob([H],{type:"application/octet-stream"}),this.importVisio(H,+mxUtils.bind(this,function(L){this.importXml(L,0,0,!0)}),null,N)):this.editor.graph.setSelectionCells(this.importXml(H,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null});if(!f){var q=this.dialog,D=q.close;this.dialog.close=mxUtils.bind(this,function(H){Editor.useLocalStorage=t;D.apply(q,arguments);H&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=+function(c,f,l){var t=this,q=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(c).then(function(D){if(mxUtils.isEmptyObject(D.files))l();else{var H=0,N,L=!1;D.forEach(function(J,Y){J=Y.name.toLowerCase();"diagram/diagram.xml"==J?(L=!0,Y.async("string").then(function(ha){0==ha.indexOf("<mxfile ")?f(ha):l()})):0==J.indexOf("versions/")&&(J=parseInt(J.substr(9)),J>H&&(H=J,N=Y))});0<H?N.async("string").then(function(J){(new XMLHttpRequest).upload&&t.isRemoteFileFormat(J,+c.name)?t.isOffline()?t.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,l):t.parseFileData(J,mxUtils.bind(this,function(Y){4==Y.readyState&&(200<=Y.status&&299>=Y.status?f(Y.responseText):l())}),c.name):l()}):L||l()}},function(D){l(D)}):l()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?q():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",q,null,null,null,l))};EditorUi.prototype.importFile=function(c,f,l,t,q,D,H,+N,L,J,Y,ha){J=null!=J?J:!0;var ea=!1,aa=null,na=mxUtils.bind(this,function(W){var ba=null;null!=W&&"<mxlibrary"==W.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,W,H)),this.showSidebar()):ba=this.importXml(W,l,t,J,null,null!=ha?mxEvent.isControlDown(ha):null);null!=N&&N(ba)});"image"==f.substring(0,5)?(L=!1,"image/png"==f.substring(0,9)&&(Y=Y?null:this.extractGraphModelFromPng(c),null!=Y&&0<Y.length&&(aa=this.importXml(Y,l,t,J,null,null!=ha?mxEvent.isControlDown(ha):null),L=!0)),L||(L=this.editor.graph,+Y=c.indexOf(";"),0<Y&&(c=c.substring(0,Y)+c.substring(c.indexOf(",",Y+1))),J&&L.isGridEnabled()&&(l=L.snap(l),t=L.snap(t)),Y="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;","image/svg"==f.substring(0,9)&&(Y+="editableCssRules=.*;"),aa=[L.insertVertex(null,null,"",l,t,q,D,Y+"image="+c+";")])):/(\.*<graphml )/.test(c)?(ea=!0,this.importGraphML(c,na)):null!=L&&null!=H&&EditorUi.isVisioFilename(H)?(ea=!0,this.importVisio(L,na)):(new XMLHttpRequest).upload&&+this.isRemoteFileFormat(c,H)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(ea=!0,f=mxUtils.bind(this,function(W){4==W.readyState&&(200<=W.status&&299>=W.status?na(W.responseText):null!=N&&(N(null),this.showError(mxResources.get("error"),413==W.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),null!=c?this.parseFileData(c,f,H):this.parseFile(L,f,H)):0==c.indexOf("PK")&&null!=L?(ea=!0,this.importZipFile(L,na,mxUtils.bind(this,+function(){aa=this.insertTextAt(this.validateFileData(c),l,t,!0,null,J);N(aa)}))):/(\.v(sd|dx))($|\?)/i.test(H)||/(\.vs(s|x))($|\?)/i.test(H)||(aa=this.insertTextAt(this.validateFileData(c),l,t,!0,null,J,null,null!=ha?mxEvent.isControlDown(ha):null));ea||null==N||N(aa);return aa};EditorUi.prototype.importFiles=function(c,f,l,t,q,D,H,N,L,J,Y,ha,ea){t=null!=t?t:this.maxImageSize;J=null!=J?J:this.maxImageBytes;var aa=null!=f&&null!=l,na=!0;f=null!=f?f:0;l=null!=l?l:0;var W=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var ba=Y||this.resampleThreshold,ja=0;ja<c.length;ja++)if("image/svg"!==c[ja].type.substring(0,9)&&"image/"===c[ja].type.substring(0,6)&&c[ja].size>ba){W=!0;break}var ca=mxUtils.bind(this,function(){var la=this.editor.graph,Q=la.gridSize;q=null!=q?q:mxUtils.bind(this,function(T,X,Z,ka,va,ua,qa,Ba,ya){try{if(null!=T&&"<mxlibrary"==T.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,T,qa)),this.showSidebar(),null;this.isCompatibleString(T)&&1==c.length&&null!=ea&&"drop"==ea.type&&this.isBlankFile()&&!this.canUndo()&&(aa=!1,ka=Z=0);return this.importFile(T,X,Z,ka,va,ua,qa,Ba,ya,aa,ha,ea)}catch(La){return this.handleError(La),null}});D=null!=D?D:mxUtils.bind(this,function(T){la.setSelectionCells(T)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var k=c.length,B=k,I=[],U=mxUtils.bind(this,function(T,X){I[T]=X;if(0==--B){this.spinner.stop();if(null!=N)N(I);else{var Z=[];la.getModel().beginUpdate();try{for(T=0;T<I.length;T++){var ka=I[T]();-null!=ka&&(Z=Z.concat(ka))}}finally{la.getModel().endUpdate()}}D(Z)}}),P=0;P<k;P++)mxUtils.bind(this,function(T){var X=c[T];if(null!=X){var Z=new FileReader;Z.onload=mxUtils.bind(this,function(ka){if(null==G||G(X))try{if("image/"==X.type.substring(0,6))if("image/svg"==X.type.substring(0,9)){var va=Graph.clipSvgDataUri(ka.target.result),ua=va.indexOf(","),qa=decodeURIComponent(escape(atob(va.substring(ua+1)))),Ba=mxUtils.parseXml(qa),ya=Ba.getElementsByTagName("svg");if(0<ya.length){var La=ya[0],za=+null!=ka&&(Z=Z.concat(ka))}}finally{la.getModel().endUpdate()}}D(Z)}}),P=0;P<k;P++)mxUtils.bind(this,function(T){var X=c[T];if(null!=X){var Z=new FileReader;Z.onload=mxUtils.bind(this,function(ka){if(null==H||H(X))try{if("image/"==X.type.substring(0,6))if("image/svg"==X.type.substring(0,9)){var va=Graph.clipSvgDataUri(ka.target.result),ua=va.indexOf(","),qa=decodeURIComponent(escape(atob(va.substring(ua+1)))),Ba=mxUtils.parseXml(qa),ya=Ba.getElementsByTagName("svg");if(0<ya.length){var La=ya[0],za=ha?null:La.getAttribute("content");null!=za&&"<"!=za.charAt(0)&&"%"!=za.charAt(0)&&(za=unescape(window.atob?atob(za):Base64.decode(za,!0)));null!=za&&"%"==za.charAt(0)&&(za=decodeURIComponent(za));null==za||"<mxfile "!==za.substring(0,8)&&"<mxGraphModel "!==za.substring(0,14)?U(T,mxUtils.bind(this,function(){try{if(null!=Ba){var Ca=Ba.getElementsByTagName("svg");if(0<Ca.length){var Aa=Ca[0],wa=Aa.getAttribute("width"),Ya=Aa.getAttribute("height");wa=null!=wa&&"%"!=wa.charAt(wa.length-1)?parseFloat(wa):NaN;Ya=null!=Ya&&"%"!=Ya.charAt(Ya.length-1)?parseFloat(Ya):NaN;var Qa=Aa.getAttribute("viewBox");if(null==Qa||0==Qa.length)Aa.setAttribute("viewBox","0 0 "+wa+" "+Ya);else if(isNaN(wa)||isNaN(Ya)){var Ra=Qa.split(" ");3<Ra.length&&(wa=parseFloat(Ra[2]),Ya=parseFloat(Ra[3]))}va=Editor.createSvgDataUri(mxUtils.getXml(Aa));var Sa=Math.min(1,Math.min(t/Math.max(1,wa)),t/Math.max(1,Ya)),Ha=q(va,X.type,f+T*Q,l+T*Q,Math.max(1,Math.round(wa*Sa)),Math.max(1,Math.round(Ya*Sa)),X.name);if(null!=Ha&&(isNaN(wa)||isNaN(Ya))){var Ma=new Image;Ma.onload=mxUtils.bind(this,function(){wa=Math.max(1,Ma.width);Ya=Math.max(1,Ma.height);Ha[0].geometry.width=wa;Ha[0].geometry.height=Ya;Aa.setAttribute("viewBox","0 0 "+wa+" "+Ya);va=Editor.createSvgDataUri(mxUtils.getXml(Aa));var y=va.indexOf(";");0<y&&(va=va.substring(0,y)+va.substring(va.indexOf(",",y+1)));la.setCellStyles("image",va,[Ha[0]])});Ma.src=Editor.createSvgDataUri(mxUtils.getXml(Aa))}return Ha}}}catch(y){}return null})):U(T,mxUtils.bind(this,function(){return q(za,@@ -3739,21 +3741,21 @@ isNaN(Ya))){var Ma=new Image;Ma.onload=mxUtils.bind(this,function(){wa=Math.max(mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(ka.target.result,mxUtils.bind(this,function(Ca){this.resizeImage(Ca,ka.target.result,mxUtils.bind(this,function(Aa,wa,Ya){U(T,mxUtils.bind(this,function(){if(null!=Aa&&Aa.length<J){var Qa=na&&this.isResampleImageSize(X.size,Y)?Math.min(1,Math.min(t/wa,t/Ya)):1;return q(Aa,X.type,f+T*Q,l+T*Q,Math.round(wa*Qa),Math.round(Ya*Qa),X.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),na,t,Y,X.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else va=ka.target.result,q(va,X.type,f+T*Q,l+T*Q,240,160,X.name,function(Ca){U(T,function(){return Ca})},X)}catch(Ca){U(T,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(Ca,X)}else U(T,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(X.name)?q(null,X.type,f+T*Q,l+T*Q,240,160,X.name,function(ka){U(T,function(){return ka})},X):"image"==X.type.substring(0,5)||"application/pdf"==X.type?Z.readAsDataURL(X):Z.readAsText(X)}})(P)});if(W){W=[];for(ja=0;ja<c.length;ja++)W.push(c[ja]);c=W;this.confirmImageResize(function(la){na=la;ca()},L)}else ca()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=function(c,f){f=null!=f?f:!1;var l=null!=this.spinner&&null!=this.spinner.pause?-this.spinner.pause():function(){},t=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,q=function(D,G){if(D||f)mxSettings.setResizeImages(D?G:null),mxSettings.save();l();c(G)};null==t||f?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(D){q(D,!0)},function(D){q(D,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',+this.spinner.pause():function(){},t=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,q=function(D,H){if(D||f)mxSettings.setResizeImages(D?H:null),mxSettings.save();l();c(H)};null==t||f?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(D){q(D,!0)},function(D){q(D,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?226:200,!0,!0):q(!1,t)};EditorUi.prototype.parseFile=function(c,f,l){l=null!=l?l:c.name;var t=new FileReader;t.onload=mxUtils.bind(this,function(){this.parseFileData(t.result,f,l)});t.readAsText(c)};EditorUi.prototype.parseFileData=function(c,f,l){var t=new XMLHttpRequest;t.open("POST",OPEN_URL);t.setRequestHeader("Content-Type","application/x-www-form-urlencoded");t.onreadystatechange=function(){f(t)};t.send("format=xml&filename="+-encodeURIComponent(l)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(q){}};EditorUi.prototype.isResampleImageSize=function(c,f){f=null!=f?f:this.resampleThreshold;return c>f};EditorUi.prototype.resizeImage=function(c,f,l,t,q,D,G){q=null!=q?q:this.maxImageSize;var N=Math.max(1,c.width),L=Math.max(1,c.height),J=f;if(t&&this.isResampleImageSize(null!=G?G:f.length,D))try{var Y=Math.max(N/q,L/q);if(1<Y){var ha=Math.round(N/Y),ea=Math.round(L/-Y),aa=document.createElement("canvas");aa.width=ha;aa.height=ea;aa.getContext("2d").drawImage(c,0,0,ha,ea);var na=aa.toDataURL();if(na.length<f.length){var W=document.createElement("canvas");W.width=ha;W.height=ea;var ba=W.toDataURL();na!==ba&&(f=na,N=ha,L=ea)}}}catch(ja){}t&&J!=f&&q>this.maxImageSize/2&&f.length>this.maxImageBytes?this.resizeImage(c,f,l,t,q/1.5,D,G):l(f,N,L)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=+encodeURIComponent(l)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(q){}};EditorUi.prototype.isResampleImageSize=function(c,f){f=null!=f?f:this.resampleThreshold;return c>f};EditorUi.prototype.resizeImage=function(c,f,l,t,q,D,H){q=null!=q?q:this.maxImageSize;var N=Math.max(1,c.width),L=Math.max(1,c.height),J=f;if(t&&this.isResampleImageSize(null!=H?H:f.length,D))try{var Y=Math.max(N/q,L/q);if(1<Y){var ha=Math.round(N/Y),ea=Math.round(L/+Y),aa=document.createElement("canvas");aa.width=ha;aa.height=ea;aa.getContext("2d").drawImage(c,0,0,ha,ea);var na=aa.toDataURL();if(na.length<f.length){var W=document.createElement("canvas");W.width=ha;W.height=ea;var ba=W.toDataURL();na!==ba&&(f=na,N=ha,L=ea)}}}catch(ja){}t&&J!=f&&q>this.maxImageSize/2&&f.length>this.maxImageBytes?this.resizeImage(c,f,l,t,q/1.5,D,H):l(f,N,L)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,f,l){try{var t=new Image;t.onload=function(){t.width=0<t.width?t.width:120;t.height=0<t.height?t.height:120;f(t)};null!=l&&(t.onerror=l);t.src=c}catch(q){if(null!=l)l(q);else throw q;}};EditorUi.prototype.getDefaultSketchMode=function(){var c="1"==urlParams.sketch;return"0"!=(null!=urlParams.rough?urlParams.rough:c)};var v=EditorUi.prototype.createUi;EditorUi.prototype.createUi=function(){Editor.isSettingsEnabled()&&(null!=mxSettings.settings.sidebarTitles&&(Sidebar.prototype.sidebarTitles=-mxSettings.settings.sidebarTitles),this.formatWidth=mxSettings.getFormatWidth());v.apply(this,arguments);Editor.isSettingsEnabled()&&this.doSetSketchMode(null!=mxSettings.settings.sketchMode&&null==urlParams.rough&&null==urlParams.sketch?mxSettings.settings.sketchMode:this.getDefaultSketchMode())};var p=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();var c=this,f=this.editor.graph,l=f.isEnabled;f.isEnabled=function(){return l.apply(this,+mxSettings.settings.sidebarTitles),this.formatWidth=mxSettings.getFormatWidth());v.apply(this,arguments);Editor.isSettingsEnabled()&&this.doSetSketchMode(null!=mxSettings.settings.sketchMode&&null==urlParams.rough&&null==urlParams.sketch?mxSettings.settings.sketchMode:this.getDefaultSketchMode())};var n=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();var c=this,f=this.editor.graph,l=f.isEnabled;f.isEnabled=function(){return l.apply(this,arguments)&&!c.isLocked()};Graph.touchStyle&&(f.panningHandler.isPanningTrigger=function(Q){var k=Q.getEvent();return null==Q.getState()&&!mxEvent.isMouseEvent(k)&&!f.freehand.isDrawing()||mxEvent.isPopupTrigger(k)&&(null==Q.getState()||mxEvent.isControlDown(k)||mxEvent.isShiftDown(k))});f.cellEditor.editPlantUmlData=function(Q,k,B){var I=JSON.parse(B);k=new TextareaDialog(c,mxResources.get("plantUml")+":",I.data,function(U){null!=U&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generatePlantUmlImage(U,I.format,function(P,T,X){c.spinner.stop();f.getModel().beginUpdate();try{if("txt"==I.format)f.labelChanged(Q,"<pre>"+P+"</pre>"),f.updateCellSize(Q,!0);else{f.setCellStyles("image",c.convertDataUri(P),[Q]);var Z=f.model.getGeometry(Q);null!=Z&&(Z=Z.clone(),Z.width=T,Z.height=X,f.cellsResized([Q],[Z],!1))}f.setAttributeForCell(Q,"plantUmlData",JSON.stringify({data:U,format:I.format}))}finally{f.getModel().endUpdate()}},function(P){c.handleError(P)})},null,null,400,220);c.showDialog(k.container,420,300,!0,!0);k.init()};f.cellEditor.editMermaidData=function(Q,k,B){var I=JSON.parse(B);k=new TextareaDialog(c,mxResources.get("mermaid")+":",I.data,function(U){null!=U&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generateMermaidImage(U,I.config,function(P,T,X){c.spinner.stop();f.getModel().beginUpdate();try{f.setCellStyles("image",P,[Q]);var Z=f.model.getGeometry(Q);null!=Z&&(Z=Z.clone(),Z.width=Math.max(Z.width,T),Z.height=Math.max(Z.height,X),f.cellsResized([Q],[Z],!1));f.setAttributeForCell(Q,"mermaidData",JSON.stringify({data:U,config:I.config},null,2))}finally{f.getModel().endUpdate()}},function(P){c.handleError(P)})},null,null,400,220);c.showDialog(k.container,420,300,!0,!0);k.init()};var t=f.cellEditor.startEditing;f.cellEditor.startEditing=function(Q,k){try{var B=this.graph.getAttributeForCell(Q,"plantUmlData");if(null!=B)this.editPlantUmlData(Q,k,B);else if(B=this.graph.getAttributeForCell(Q,"mermaidData"),null!=B&&window.isMermaidEnabled)this.editMermaidData(Q,k,B);else{var I=f.getCellStyle(Q);"1"==mxUtils.getValue(I,"metaEdit","0")?c.showDataDialog(Q):t.apply(this,arguments)}}catch(U){c.handleError(U)}};f.getLinkTitle=function(Q){return c.getLinkTitle(Q)};f.customLinkClicked=function(Q,k){var B=!1;try{var I=this.getGraphBounds();c.handleCustomLink(Q,k);B=!0;c.chromelessResize&&!I.equals(this.getGraphBounds())&&(c.chromelessResize(),this.scrollCellToVisible(k))}catch(U){c.handleError(U)}return B};var q=f.parseBackgroundImage;f.parseBackgroundImage=function(Q){var k=q.apply(this,arguments);null!=k&&null!=k.src&&Graph.isPageLink(k.src)&&(k={originalSrc:k.src});return k};var D=f.setBackgroundImage;f.setBackgroundImage=function(Q){null!=Q&&null!=Q.originalSrc&&(Q=c.createImageForPageLink(Q.originalSrc,c.currentPage,this));D.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pagesPatched",mxUtils.bind(this,-function(Q,k){Q=null!=f.backgroundImage?f.backgroundImage.originalSrc:null;if(null!=Q){var B=Q.indexOf(",");if(0<B)for(Q=Q.substring(B+1),k=k.getProperty("patches"),B=0;B<k.length;B++)if(null!=k[B][EditorUi.DIFF_UPDATE]&&null!=k[B][EditorUi.DIFF_UPDATE][Q]||null!=k[B][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(k[B][EditorUi.DIFF_REMOVE],Q)){f.refreshBackgroundImage();break}}}));var G=f.getBackgroundImageObject;f.getBackgroundImageObject=function(Q,k){var B=G.apply(this,arguments);null!=B&&null!=B.originalSrc&&+function(Q,k){Q=null!=f.backgroundImage?f.backgroundImage.originalSrc:null;if(null!=Q){var B=Q.indexOf(",");if(0<B)for(Q=Q.substring(B+1),k=k.getProperty("patches"),B=0;B<k.length;B++)if(null!=k[B][EditorUi.DIFF_UPDATE]&&null!=k[B][EditorUi.DIFF_UPDATE][Q]||null!=k[B][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(k[B][EditorUi.DIFF_REMOVE],Q)){f.refreshBackgroundImage();break}}}));var H=f.getBackgroundImageObject;f.getBackgroundImageObject=function(Q,k){var B=H.apply(this,arguments);null!=B&&null!=B.originalSrc&&(B=k?c.createImageForPageLink(B.originalSrc,null,null,!0):{src:B.originalSrc});return B};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var N=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(Q){Q=null!=Q?Q:"";"1"==-urlParams.dev&&(Q+=(0<Q.length?"&":"?")+"dev=1");return N.apply(this,arguments)};var L=f.addClickHandler;f.addClickHandler=function(Q,k,B){var I=k;k=function(U,P,T){if(null==P){var X=mxEvent.getSource(U);"a"==X.nodeName.toLowerCase()&&(P=X.getAttribute("href"))}null!=P&&f.isCustomLink(P)&&(mxEvent.isTouchEvent(U)||!mxEvent.isPopupTrigger(U))&&f.customLinkClicked(P,T)&&mxEvent.consume(U);null!=I&&I(U,P,T)};L.call(this,Q,k,B)};p.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(f.view.canvas.ownerSVGElement,+urlParams.dev&&(Q+=(0<Q.length?"&":"?")+"dev=1");return N.apply(this,arguments)};var L=f.addClickHandler;f.addClickHandler=function(Q,k,B){var I=k;k=function(U,P,T){if(null==P){var X=mxEvent.getSource(U);"a"==X.nodeName.toLowerCase()&&(P=X.getAttribute("href"))}null!=P&&f.isCustomLink(P)&&(mxEvent.isTouchEvent(U)||!mxEvent.isPopupTrigger(U))&&f.customLinkClicked(P,T)&&mxEvent.consume(U);null!=I&&I(U,P,T)};L.call(this,Q,k,B)};n.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(f.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var J=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(Q,k,B){f.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(Q,["zoomIn","zoomOut","-"],null,B);J.apply(this,arguments);f.isSelectionEmpty()||null==c.addSelectionToScratchpad||this.addMenuItems(Q,["-","addToScratchpad"],null,B);f.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(Q,["-","exitGroup","home"],null,B)};var Y=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(Q,k,B){if(c.editor.graph.isSelectionEmpty())Y.apply(this,arguments),c.menus.addMenuItems(Q,["copyAsImage"],null,B);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(Q,k,B):this.addPopupMenuArrangeItems(Q,k,B),this.addMenuItems(Q,"- cut copy copyAsImage duplicate -".split(" "),null,B),this.isShowCellEditItems()||this.addPopupDeleteItem(Q,k,B),this.addMenuItems(Q,["lockUnlock","-"],null,B),!this.isShowStyleItems()){if(1==f.getSelectionCount()&&!f.isCellLocked(k)&&f.isCellEditable(k)&&(this.addSubmenu("editCell",Q,null,mxResources.get("edit")),Q.addSeparator(),f.getModel().isEdge(k))){this.addSubmenu("line",Q);var I=f.getModel().getGeometry(k);null!=I&&null!=I.points&&0<I.points.length&&this.addMenuItems(Q,["clearWaypoints"],null,B)}1==f.getSelectionCount()&&this.addMenuItems(Q,["enterGroup"],null,B);I=c.getSelectionState();null!=I.mergeCell?this.addMenuItem(Q,"mergeCells"):(1<I.style.colspan||1<I.style.rowspan)&&this.addMenuItem(Q,"unmergeCells")}};this.menus.isShowStyleItems=@@ -3763,8 +3765,8 @@ null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+1:1:"pagecount"==Q?null!=c.if(null==I||!f.isCustomLink(I)||!mxEvent.isTouchEvent(B)&&mxEvent.isPopupTrigger(B))W.apply(this,arguments);else{if(!f.isEnabled()||null!=Q&&f.isCellLocked(Q.cell))f.customLinkClicked(I),f.getRubberband().reset();mxEvent.consume(B)}};this.editor.getOrCreateFilename=function(){var Q=c.defaultFilename,k=c.getCurrentFile();null!=k&&(Q=null!=k.getTitle()?k.getTitle():Q);return Q};var ba=this.actions.get("print");ba.setEnabled(!mxClient.IS_IOS||!navigator.standalone);ba.visible=ba.isEnabled();if(!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(70,!0,"findReplace"),this.keyHandler.bindAction(77,!0,"editGeometry",!0),this.keyHandler.bindAction(75,!0,"tags"),this.keyHandler.bindAction(65,!1,"insertText"),this.keyHandler.bindAction(83,!1,"insertNote"),this.keyHandler.bindAction(68,!1,"insertRectangle"),this.keyHandler.bindAction(70,!1,"insertEllipse"),this.keyHandler.bindAction(76,!1,"insertLink"),this.keyHandler.bindAction(82,!1,"insertRhombus"),this.keyHandler.bindAction(67,!1,"insertEdge"),this.keyHandler.bindAction(88,!1,"insertFreehand"),this.keyHandler.bindAction(75,!0,"toggleShapes",!0),this.keyHandler.bindAction(54,!0,"adaptiveColors",!0),this.altShiftActions[81]="copyStyle",this.altShiftActions[87]="pasteStyle",this.altShiftActions[83]="synchronize","1"==urlParams.embedInline&&(document.body.classList.add("geEmbedInline"),f.addListener(mxEvent.ESCAPE,function(Q,k){null!=k&&f.isEnabled()&&!f.isEditing()&&null!=k.getProperty("event")&&c.actions.get("exit").funct()})),this.installImagePasteHandler(),-this.installNativeClipboardHandler();this.spinner=this.createSpinner(null,null,24);Graph.fileSupport&&f.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(Q){var k=f.cellEditor.text2,B=null;null!=k&&(mxEvent.addListener(k,"dragleave",function(I){null!=B&&(B.parentNode.removeChild(B),B=null);I.stopPropagation();I.preventDefault()}),mxEvent.addListener(k,"dragover",mxUtils.bind(this,function(I){null==B&&(!mxClient.IS_IE||10<document.documentMode)&&(B=this.highlightElement(k));I.stopPropagation();-I.preventDefault()})),mxEvent.addListener(k,"drop",mxUtils.bind(this,function(I){null!=B&&(B.parentNode.removeChild(B),B=null);if(0<I.dataTransfer.files.length)this.importFiles(I.dataTransfer.files,0,0,this.maxImageSize,function(P,T,X,Z,ka,va){f.insertImage(P,ka,va)},function(){},function(P){return"image/"==P.type.substring(0,6)},function(P){for(var T=0;T<P.length;T++)P[T]()},mxEvent.isControlDown(I));else if(0<=mxUtils.indexOf(I.dataTransfer.types,"text/uri-list")){var U=I.dataTransfer.getData("text/uri-list");+this.installNativeClipboardHandler();this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);Graph.fileSupport&&f.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(Q){var k=f.cellEditor.text2,B=null;null!=k&&(mxEvent.addListener(k,"dragleave",function(I){null!=B&&(B.parentNode.removeChild(B),B=null);I.stopPropagation();I.preventDefault()}),mxEvent.addListener(k,"dragover",mxUtils.bind(this,function(I){null==B&&(!mxClient.IS_IE||10<document.documentMode)&&(B=this.highlightElement(k));+I.stopPropagation();I.preventDefault()})),mxEvent.addListener(k,"drop",mxUtils.bind(this,function(I){null!=B&&(B.parentNode.removeChild(B),B=null);if(0<I.dataTransfer.files.length)this.importFiles(I.dataTransfer.files,0,0,this.maxImageSize,function(P,T,X,Z,ka,va){f.insertImage(P,ka,va)},function(){},function(P){return"image/"==P.type.substring(0,6)},function(P){for(var T=0;T<P.length;T++)P[T]()},mxEvent.isControlDown(I));else if(0<=mxUtils.indexOf(I.dataTransfer.types,"text/uri-list")){var U=I.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(U)?this.loadImage(decodeURIComponent(U),mxUtils.bind(this,function(P){var T=Math.max(1,P.width);P=Math.max(1,P.height);var X=this.maxImageSize;X=Math.min(1,Math.min(X/Math.max(1,T)),X/Math.max(1,P));f.insertImage(decodeURIComponent(U),T*X,P*X)})):document.execCommand("insertHTML",!1,I.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(I.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,I.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(I.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,I.dataTransfer.getData("text/plain"));I.stopPropagation();I.preventDefault()})))}));if(Editor.isSettingsEnabled()){ba=this.editor.graph.view;var ja=mxSettings.getUnit();ba.setUnit(ja);Editor.pageSizeUnit=ja==mxConstants.METERS?mxConstants.MILLIMETERS:ja;ba.addListener("unitChanged",function(Q,k){Q=k.getProperty("unit");mxSettings.setUnit(Q);mxSettings.save();Editor.pageSizeUnit=Q==mxConstants.METERS?mxConstants.MILLIMETERS:Q});this.ruler=!this.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,ba.unit);this.refresh()}if("1"==urlParams.styledev){ba=document.getElementById("geFooter");null!=ba&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility=@@ -3783,18 +3785,18 @@ typeof ba?"1"==ba:ba);if(this.isAutoDarkModeSupported())try{window.matchMedia("((null!=mxSettings.settings.pages&&this.setTabContainerVisible(mxSettings.settings.pages),null!=mxSettings.settings.compactMode&&this.isDefaultTheme(Editor.currentTheme)&&this.setCompactMode(mxSettings.settings.compactMode));this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(Q,k){f.enableFlowAnimation=Editor.enableAnimations;f.refresh()}));f.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts();"atlas"==Editor.currentTheme&&document.body.classList.add("geAtlas")};var A=EditorUi.prototype.windowResized;EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,f=Editor.smallScreenWidth;null!=this.lastWindowWidth&&this.lastWindowWidth>=f&&c<f?this.isFormatPanelVisible()&&this.toggleFormatPanel(!1):null!=this.lastWindowWidth&&this.lastWindowWidth<f&&c>=f&&(this.isFormatPanelVisible()||this.toggleFormatPanel(!0));this.lastWindowWidth=c}A.apply(this,arguments)};EditorUi.prototype.initializeInlineEmbedMode=function(){var c=this.sketchFooterMenuElt,f=this.sketchMainMenuElt,l=this.sketchPickerMenuElt,t=this.editor.graph;l.style.transform="";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,function(J){mxEvent.getSource(J)==this.diagramContainer.parentNode&&(this.embedExitPoint=new mxPoint(mxEvent.getClientX(J),mxEvent.getClientY(J)),this.sendEmbeddedSvgExport())}));-document.body.style.cursor="text";var q=document.createElement("div");q.style.position="absolute";q.style.width="10px";q.style.height="10px";q.style.borderRadius="5px";q.style.border="1px solid gray";q.style.background="#ffffff";q.style.cursor="row-resize";this.diagramContainer.parentNode.appendChild(q);this.bottomResizer=q;var D=null,G=null,N=null,L=null;mxEvent.addGestureListeners(q,mxUtils.bind(this,function(J){L=parseInt(this.diagramContainer.style.height);G=mxEvent.getClientY(J);t.popupMenuHandler.hideMenu();+document.body.style.cursor="text";var q=document.createElement("div");q.style.position="absolute";q.style.width="10px";q.style.height="10px";q.style.borderRadius="5px";q.style.border="1px solid gray";q.style.background="#ffffff";q.style.cursor="row-resize";this.diagramContainer.parentNode.appendChild(q);this.bottomResizer=q;var D=null,H=null,N=null,L=null;mxEvent.addGestureListeners(q,mxUtils.bind(this,function(J){L=parseInt(this.diagramContainer.style.height);H=mxEvent.getClientY(J);t.popupMenuHandler.hideMenu();mxEvent.consume(J)}));q=q.cloneNode(!1);q.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(q);this.rightResizer=q;mxEvent.addGestureListeners(q,mxUtils.bind(this,function(J){N=parseInt(this.diagramContainer.style.width);D=mxEvent.getClientX(J);t.popupMenuHandler.hideMenu();mxEvent.consume(J)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(J){var Y=!1;null!=D&&(this.diagramContainer.style.width=Math.max(20,N+mxEvent.getClientX(J)-D)+"px",Y=!0);null!=-G&&(this.diagramContainer.style.height=Math.max(20,L+mxEvent.getClientY(J)-G)+"px",Y=!0);Y&&((window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),function(J){null==D&&null==G||mxEvent.consume(J);G=D=null});document.body.style.backgroundColor="transparent";this.diagramContainer.style.borderRadius="4px";this.bottomResizer.style.visibility="hidden";+H&&(this.diagramContainer.style.height=Math.max(20,L+mxEvent.getClientY(J)-H)+"px",Y=!0);Y&&((window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),function(J){null==D&&null==H||mxEvent.consume(J);H=D=null});document.body.style.backgroundColor="transparent";this.diagramContainer.style.borderRadius="4px";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";this.sketchMenubarElt.style.display="none";f.style.visibility="hidden";c.style.visibility="hidden";l.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(J){this.inlineSizeChanged();this.fitWindows()}));this.addListener("editInlineStop",mxUtils.bind(this,function(J){this.diagramContainer.style.width="10px";this.diagramContainer.style.height="10px";this.diagramContainer.style.border="";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";f.style.visibility="hidden";c.style.visibility="hidden";l.style.display="none"}));this.windowResized=mxUtils.bind(this,function(){});this.inlineSizeChanged()};EditorUi.prototype.installImagePasteHandler=function(){if(!mxClient.IS_IE){var c=this.editor.graph;c.container.addEventListener("paste",mxUtils.bind(this,function(f){if(!mxEvent.isConsumed(f))try{for(var l=f.clipboardData||f.originalEvent.clipboardData,t=!1,q=0;q<l.types.length;q++)if("text/"===l.types[q].substring(0,-5)){t=!0;break}if(!t){var D=l.items;for(index in D){var G=D[index];if("file"===G.kind){if(c.isEditing())this.importFiles([G.getAsFile()],0,0,this.maxImageSize,function(L,J,Y,ha,ea,aa){c.insertImage(L,ea,aa)},function(){},function(L){return"image/"==L.type.substring(0,6)},function(L){for(var J=0;J<L.length;J++)L[J]()});else{var N=this.editor.graph.getInsertPoint();this.importFiles([G.getAsFile()],N.x,N.y,this.maxImageSize);mxEvent.consume(f)}break}}}}catch(L){}}),!1)}};EditorUi.prototype.installNativeClipboardHandler=+5)){t=!0;break}if(!t){var D=l.items;for(index in D){var H=D[index];if("file"===H.kind){if(c.isEditing())this.importFiles([H.getAsFile()],0,0,this.maxImageSize,function(L,J,Y,ha,ea,aa){c.insertImage(L,ea,aa)},function(){},function(L){return"image/"==L.type.substring(0,6)},function(L){for(var J=0;J<L.length;J++)L[J]()});else{var N=this.editor.graph.getInsertPoint();this.importFiles([H.getAsFile()],N.x,N.y,this.maxImageSize);mxEvent.consume(f)}break}}}}catch(L){}}),!1)}};EditorUi.prototype.installNativeClipboardHandler=function(){function c(){window.setTimeout(function(){l.innerHTML=" ";l.focus();document.execCommand("selectAll",!1,null)},0)}var f=this.editor.graph,l=document.createElement("div");l.setAttribute("autocomplete","off");l.setAttribute("autocorrect","off");l.setAttribute("autocapitalize","off");l.setAttribute("spellcheck","false");l.style.textRendering="optimizeSpeed";l.style.fontFamily="monospace";l.style.wordBreak="break-all";l.style.background="transparent";l.style.color="transparent";l.style.position=-"absolute";l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.display="block";l.style.fontSize="1";l.style.zIndex="-1";l.style.resize="none";l.style.outline="none";l.style.width="1px";l.style.height="1px";mxUtils.setOpacity(l,0);l.contentEditable=!0;l.innerHTML=" ";var t=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(D){var G=mxEvent.getSource(D);-null==f.container||!f.isEnabled()||f.isMouseDown||f.isEditing()||null!=this.dialog||"INPUT"==G.nodeName||"TEXTAREA"==G.nodeName||"true"==G.contentEditable||224!=D.keyCode&&(mxClient.IS_MAC||17!=D.keyCode)&&(!mxClient.IS_MAC||91!=D.keyCode&&93!=D.keyCode)||t||(l.style.left=f.container.scrollLeft+10+"px",l.style.top=f.container.scrollTop+10+"px",D=f.container.scrollLeft,G=f.container.scrollTop,f.container.appendChild(l),t=!0,l.focus(),document.execCommand("selectAll",!1,null),f.container.scrollLeft=-D,f.container.scrollTop=G)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(D){var G=D.keyCode;window.setTimeout(mxUtils.bind(this,function(){!t||224!=G&&17!=G&&91!=G&&93!=G||(t=!1,f.isEditing()||null!=this.dialog||null==f.container||f.container.focus(),l.parentNode.removeChild(l),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(l,"copy",mxUtils.bind(this,function(D){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(l),c()}catch(G){this.handleError(G)}}));-mxEvent.addListener(l,"cut",mxUtils.bind(this,function(D){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(l,!0),c()}catch(G){this.handleError(G)}}));mxEvent.addListener(l,"paste",mxUtils.bind(this,function(D){if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{if(l.innerHTML=" ",l.focus(),null!=D.clipboardData&&(Graph.removePasteFormatting(l.firstChild),this.pasteCells(D,l,!0,!0)),!mxEvent.isConsumed(D)){var G=f.container.scrollLeft,N=f.container.scrollTop;window.setTimeout(mxUtils.bind(this,-function(){try{f.container.scrollLeft=G,f.container.scrollTop=N,Graph.removePasteFormatting(l.firstChild),this.pasteCells(D,l,!1,!0)}catch(L){this.handleError(L)}}),0)}}catch(L){this.handleError(L)}}),!0);var q=this.isSelectionAllowed;this.isSelectionAllowed=function(D){return mxEvent.getSource(D)==l?!0:q.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,f){mxSettings.setUi(c);(f=this.doSetCurrentTheme(c)||f)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=+"absolute";l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.display="block";l.style.fontSize="1";l.style.zIndex="-1";l.style.resize="none";l.style.outline="none";l.style.width="1px";l.style.height="1px";mxUtils.setOpacity(l,0);l.contentEditable=!0;l.innerHTML=" ";var t=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(D){var H=mxEvent.getSource(D);+null==f.container||!f.isEnabled()||f.isMouseDown||f.isEditing()||null!=this.dialog||"INPUT"==H.nodeName||"TEXTAREA"==H.nodeName||"true"==H.contentEditable||224!=D.keyCode&&(mxClient.IS_MAC||17!=D.keyCode)&&(!mxClient.IS_MAC||91!=D.keyCode&&93!=D.keyCode)||t||(l.style.left=f.container.scrollLeft+10+"px",l.style.top=f.container.scrollTop+10+"px",D=f.container.scrollLeft,H=f.container.scrollTop,f.container.appendChild(l),t=!0,l.focus(),document.execCommand("selectAll",!1,null),f.container.scrollLeft=+D,f.container.scrollTop=H)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(D){var H=D.keyCode;window.setTimeout(mxUtils.bind(this,function(){!t||224!=H&&17!=H&&91!=H&&93!=H||(t=!1,f.isEditing()||null!=this.dialog||null==f.container||f.container.focus(),l.parentNode.removeChild(l),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(l,"copy",mxUtils.bind(this,function(D){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(l),c()}catch(H){this.handleError(H)}}));+mxEvent.addListener(l,"cut",mxUtils.bind(this,function(D){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(l,!0),c()}catch(H){this.handleError(H)}}));mxEvent.addListener(l,"paste",mxUtils.bind(this,function(D){if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{if(l.innerHTML=" ",l.focus(),null!=D.clipboardData&&(Graph.removePasteFormatting(l.firstChild),this.pasteCells(D,l,!0,!0)),!mxEvent.isConsumed(D)){var H=f.container.scrollLeft,N=f.container.scrollTop;window.setTimeout(mxUtils.bind(this,+function(){try{f.container.scrollLeft=H,f.container.scrollTop=N,Graph.removePasteFormatting(l.firstChild),this.pasteCells(D,l,!1,!0)}catch(L){this.handleError(L)}}),0)}}catch(L){this.handleError(L)}}),!0);var q=this.isSelectionAllowed;this.isSelectionAllowed=function(D){return mxEvent.getSource(D)==l?!0:q.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,f){mxSettings.setUi(c);(f=this.doSetCurrentTheme(c)||f)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=function(c){return""==c||"dark"==c||"default"==c||"kennedy"==c||null==c};EditorUi.prototype.doSetCurrentTheme=function(c,f){if(null==c||""==c)c=App.isSimpleThemePreferred()?"simple":"kennedy";var l="simple"==Editor.currentTheme&&this.isDefaultTheme(c)||this.isDefaultTheme(Editor.currentTheme)&&"simple"==c||c==Editor.currentTheme;if(l||f)f=this.saveScrollState(),this.editor.graph.stopEditing(!1),Editor.currentTheme=c,this.switchTheme(c),this.fireEvent(new mxEventObject("currentThemeChanged")),this.editor.fireEvent(new mxEventObject("statusChanged")),this.restoreScrollState(f);return l};EditorUi.prototype.saveScrollState=function(c){var f=this.editor.graph.view.translate,l=this.diagramContainer.scrollLeft,t=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(l-=this.embedViewport.x,t-=this.embedViewport.y):(l+=this.embedViewport.x,t+=this.embedViewport.y));f={x:l,y:t,tx:f.x,ty:f.y};c&&(f.boundingRect=this.diagramContainer.getBoundingClientRect());return f};EditorUi.prototype.restoreScrollState=function(c){var f=this.editor.graph.view.scale,l=this.editor.graph.view.translate;if(null!=c.boundingRect){var t=this.diagramContainer.getBoundingClientRect();c.x-=c.boundingRect.x-t.x;c.y-=c.boundingRect.y-t.y}this.diagramContainer.scrollLeft=c.x+(l.x-c.tx)*f;this.diagramContainer.scrollTop=c.y+(l.y-c.ty)*f};EditorUi.prototype.installStatusMinimizer=function(c){c=null!=c?c:this.statusContainer.parentNode;var f=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&@@ -3808,55 +3810,55 @@ this.menus.commentsWindow=null))};EditorUi.prototype.switchThemeConstants=functi120;null==urlParams.grid&&(f.defaultGridEnabled=!1);null==urlParams.pv&&(f.defaultPageVisible=!1)}else Editor.fitWindowBorders=null};EditorUi.prototype.isPageMenuVisible=function(){return null!=this.pages&&("0"!=urlParams.pages||1<this.pages.length||Editor.pagesVisible)};EditorUi.prototype.switchCssForTheme=function(c){};EditorUi.prototype.createMainMenuForTheme=function(c){};EditorUi.prototype.createFooterMenuForTheme=function(c){};EditorUi.prototype.createPickerMenuForTheme=function(c){};EditorUi.prototype.getNetworkStatus=function(){var c=null;if(this.isOffline(!0))c=mxResources.get("offline");else{var f=this.getCurrentFile();null!=f&&(f.invalidChecksum?c=mxResources.get("error")+": "+mxResources.get("checksum"):null==f.sync||f.sync.enabled&&f.sync.isRealtimeActive()||"atlassian"==this.getServiceName()?null==f.sync||f.sync.isConnected()?f.isRealtimeEnabled()&&f.isRealtimeSupported()&&1<f.getRealtimeState()&&(c=f.getRealtimeError(),c=mxResources.get("realtimeCollaboration")+": "+(null!=c&&null!=c.message?c.message:mxResources.get("error"))):c=mxResources.get("notConnected"):c=mxResources.get("realtimeCollaboration")+": "+mxResources.get("disabled"))}return c};EditorUi.prototype.createMenubarForTheme=function(c){null!=this.statusContainer&&(this.statusContainer.style.flexGrow="",this.statusContainer.style.flexShrink="",this.statusContainer.style.width="",this.statusContainer.style.marginTop="",this.statusContainer.style.justifyContent="",this.statusContainer.style.opacity="");null!=this.userElement&&this.menubarContainer.appendChild(this.userElement);-null!=this.buttonContainer&&(this.buttonContainer.style.display="",this.menubar.container.appendChild(this.buttonContainer))};EditorUi.prototype.createMenu=function(c,f,l,t){l=null!=l?l:"geButton";var q=this.menus.get(c);t=this.menubar.addMenu(mxResources.get(c),q.funct,null,t);t.className=l;t.setAttribute("title",mxResources.get(c));this.menus.menuCreated(q,t,l);null!=f&&(t.style.backgroundImage="url("+f+")",t.innerText="");return t};EditorUi.prototype.addButton=function(c,f,l,t){c=this.createToolbarButton(c,-f,l);t=null!=t?t:this.container;t.appendChild(c);return c};EditorUi.prototype.createToolbarButton=function(c,f,l){var t=document.createElement("a");t.className="geButton";null!=c&&"data:"==c.substring(0,5)&&(t.style.backgroundImage="url("+c+")");null!=f&&t.setAttribute("title",f);null!=l&&mxEvent.addListener(t,"click",function(q){"disabled"!=t.getAttribute("disabled")&&l(q);mxEvent.consume(q)});mxEvent.preventDefault(t);return t};EditorUi.prototype.createMenuItem=function(c,f,l){var t=this.actions.get(c),-q=null!=t?t.funct:null,D=this.createToolbarButton(f,mxResources.get(c)+(null!=t&&null!=t.shortcut?" ("+t.shortcut+")":""),q);null==t||l||(c=function(){t.isEnabled()?D.removeAttribute("disabled"):D.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",c),t.addListener("stateChanged",c),c());return D};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var c=Math.max(10,this.diagramContainer.parentNode.clientWidth-256),f="1"==urlParams.embedInline?-580:"1"==urlParams.sketch?580:Math.min(566,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,mxResources.get("format"),c,60,240,f,mxUtils.bind(this,function(q){q.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.formatWindow.window.fit()}));var l=this.formatWindow.window.toggleMinimized,t=240;this.formatWindow.window.toggleMinimized=function(){l.apply(this,arguments);this.minimized?(t=parseInt(this.div.style.width),-this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+t-140+"px"):(this.div.style.width=t+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-t+140)+"px");this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(q){mxEvent.getSource(q)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));this.formatWindow.window.minimumSize=-new mxRectangle(0,0,240,80);"sketch"==Editor.currentTheme?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var q=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,D=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>q||690>D)&&this.formatWindow.window.toggleMinimized()}),0)):this.formatWindow.window.setVisible(!1)}};var H=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=-function(c){var f=this.formatWindow;null!=f?f.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):H.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c){if(this.isShapesPanelVisible()!=c){var f=EditorUi.prototype.hsplitPosition;0==f&&(f=this.defaultSidebarWidth);var l=this.hsplitPosition,t=mxUtils.bind(this,function(){this.hsplitPosition=q;this.refresh();this.diagramContainer.scrollLeft-=l-this.hsplitPosition}),q=c?f:0,D=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.sidebarContainer.style,-"transform",0==q?"translateX(0)":"translateX(-100%)");0!=q&&t();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==q?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+D+"s ease-in-out");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin","top left");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition",-null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin",null);0==q&&t()}),1E3*D)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var S=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;return null!=c?c.window.isVisible():S.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(c){var f=mxUtils.bind(this,-function(G,N){var L=this.menus.get(G);G=this.createMenuElement(N,mxUtils.bind(this,function(){L.funct.apply(this,arguments)}));G.setAttribute("title",N);G.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";G.className="geButton";c.parentNode.appendChild(G);return G});if(Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries))if(null!=this.actions.get("newLibrary"))f=document.createElement("div"),f.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;",-f.className="geButton",f.style.left="0px",f.style.right="50%",mxUtils.write(f,mxResources.get("newLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("newLibrary").funct),f=f.cloneNode(!1),f.style.left="50%",f.style.right="0px",mxUtils.write(f,mxResources.get("openLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("openLibrary").funct);else{var l=f("newLibrary","");l.style.left="0px";l.style.right="50%";var t=document.createElement("span");l.appendChild(t);-var q=f("openLibraryFrom","");q.style.borderLeftWidth="1px";q.style.left="50%";q.style.right="0px";var D=document.createElement("span");q.appendChild(D);this.dependsOnLanguage(mxUtils.bind(this,function(){t.innerHTML="";mxUtils.write(t,mxResources.get("newLibrary"));l.setAttribute("title",mxResources.get("newLibrary"));D.innerHTML="";mxUtils.write(D,mxResources.get("openLibraryFrom"));q.setAttribute("title",mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow=-"hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=Math.min(this.diagramContainer.parentNode.clientWidth-10,218),f="1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,650),l="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme;this.sidebarWindow=new WrapperWindow(this,mxResources.get("shapes"),l&&"1"!=urlParams.embedInline?66:10,l&&"1"!=urlParams.embedInline?Math.max(30,(this.diagramContainer.parentNode.clientHeight--f)/2):56,c-6,f-6,mxUtils.bind(this,function(t){this.createShapesPanel(t)}));this.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.sidebarWindow.window.fit()}));this.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90);this.sidebarWindow.window.setVisible(!1)}};EditorUi.prototype.setSketchMode=function(c){this.doSetSketchMode(c);null==urlParams.rough&&(mxSettings.settings.sketchMode=c,mxSettings.save());this.fireEvent(new mxEventObject("sketchModeChanged"))};EditorUi.prototype.setAndPersistDarkMode=-function(c){var f=c;"auto"==c&&(f=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode(f);mxSettings.settings.darkMode=c;mxSettings.save();c=mxSettings.getUi();null==urlParams.ui&&"dark"==c&&this.setCurrentTheme("kennedy",!0)};EditorUi.prototype.setAndPersistLanguage=function(c){this.spinner.spin(document.body,mxResources.get("working"))&&(mxSettings.setLanguage(c),mxSettings.save(),mxClient.language=c,mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE,-null,mxUtils.bind(this,function(){this.spinner.stop();this.fireEvent(new mxEventObject("languageChanged"))})))};EditorUi.prototype.setElementTitle=function(c,f){this.dependsOnLanguage(mxUtils.bind(this,function(){c.setAttribute("title",mxResources.get(f))}))};EditorUi.prototype.dependsOnLanguage=function(c){c();this.addListener("languageChanged",c)};EditorUi.prototype.setAndPersistHighContrast=function(c){this.setHighContrast(c);Editor.isSettingsEnabled()&&(mxSettings.settings.highContrast=c,mxSettings.save())};-EditorUi.prototype.isHighContrast=function(){var c=document.getElementById("high-contrast-stylesheet");return null!=c&&window.matchMedia?(c=c.getAttribute("media"),"all"==c||"not all"!=c&&window.matchMedia("(forced-colors: active)").matches):!1};EditorUi.prototype.setHighContrast=function(c){var f=document.getElementById("high-contrast-stylesheet");if(null!=f&&window.matchMedia){var l=window.matchMedia("(forced-colors: active)").matches,t=f.getAttribute("media");(t="all"==t||"not all"!=t&&l)&&!c?-f.setAttribute("media",l?"not all":"(forced-colors: active)"):!t&&c&&f.setAttribute("media",l?"(forced-colors: active)":"all")}};EditorUi.prototype.isRulerVisible=function(){return null!=this.ruler};EditorUi.prototype.setRulerVisible=function(c){var f=this.getDiagramContainerOffset();mxSettings.setRulerOn(c);mxSettings.save();c||null==this.ruler?c&&null==this.ruler&&(this.ruler=new mxDualRuler(this,this.editor.graph.view.unit)):(this.ruler.destroy(),this.ruler=null);this.fireEvent(new mxEventObject("rulerVisibleChanged"));-c=this.getDiagramContainerOffset();this.diagramContainer.scrollLeft+=c.x-f.x;this.diagramContainer.scrollTop+=c.x-f.x};EditorUi.prototype.isAutoDarkModeSupported=function(){return null!=window.matchMedia};EditorUi.prototype.isAutoDarkMode=function(c){return!c&&"auto"==urlParams.dark||Editor.isSettingsEnabled()&&"auto"==mxSettings.settings.darkMode};EditorUi.prototype.setDarkMode=function(c){mxUtils.lightDarkColorSupported&&(Editor.darkMode=c,c=mxUtils.isAncestorNode(document.body,this.container)||-null==this.editor?this.container:this.editor.graph.container,mxConstants.DROP_TARGET_COLOR=Editor.isDarkMode()?"#00ff00":"#0000ff",null!=c&&(Editor.isDarkMode()?(c.classList.add("geDarkMode"),c.style.colorScheme="dark"):(c.classList.remove("geDarkMode"),c.style.colorScheme="light")),null!=this.ruler&&this.ruler.updateStyle(),this.fireEvent(new mxEventObject("darkModeChanged")))};EditorUi.prototype.setPagesVisible=function(c){Editor.pagesVisible!=c&&(Editor.pagesVisible=c,mxSettings.settings.pagesVisible=-c,mxSettings.save(),this.fireEvent(new mxEventObject("pagesVisibleChanged")))};EditorUi.prototype.setSidebarTitles=function(c,f){this.sidebar.sidebarTitles!=c&&(this.sidebar.sidebarTitles=c,Editor.isSettingsEnabled()&&f&&(mxSettings.settings.sidebarTitles=c,mxSettings.save()),this.fireEvent(new mxEventObject("sidebarTitlesChanged")))};EditorUi.prototype.setInlineFullscreen=function(c){Editor.inlineFullscreen!=c&&(this.diagramContainer.setAttribute("data-scrollState",JSON.stringify(this.saveScrollState(!0))),-(window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:c,rect:this.diagramContainer.getBoundingClientRect()}),"*"))};EditorUi.prototype.inlineSizeChanged=function(){var c=this.sketchFooterMenuElt,f=this.sketchMainMenuElt,l=this.sketchPickerMenuElt;if(Editor.inlineFullscreen)f.style.left="10px",f.style.top="10px",l.style.left="10px",l.style.top="60px",c.style.top="10px",c.style.right="12px",c.style.left="",null==this.diagramContainer.getAttribute("data-bounds")&&(this.diagramContainer.setAttribute("data-bounds",-this.diagramContainer.style.top+" "+this.diagramContainer.style.left+" "+this.diagramContainer.style.width+" "+this.diagramContainer.style.height),this.diagramContainer.style.top="0px",this.diagramContainer.style.left="0px",this.diagramContainer.style.bottom="0px",this.diagramContainer.style.right="0px",this.diagramContainer.style.width="",this.diagramContainer.style.height="");else{var t=this.diagramContainer.getAttribute("data-bounds");if(null!=t){this.diagramContainer.removeAttribute("data-bounds");-var q=t.split(" ");t=mxUtils.getDocumentSize();this.diagramContainer.style.top=q[0];this.diagramContainer.style.left=q[1];var D=parseInt(q[2]);q=parseInt(q[3]);D=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,D):D,t.width-80);q=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,q):q,t.height-80);this.diagramContainer.style.width=D+"px";this.diagramContainer.style.height=q+"px";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";(window.opener||-window.parent).postMessage(JSON.stringify({event:"resize",rect:this.diagramContainer.getBoundingClientRect()}),"*")}f.style.left=this.diagramContainer.offsetLeft+"px";f.style.top=this.diagramContainer.offsetTop-f.offsetHeight-4+"px";l.style.display="";l.style.left=this.diagramContainer.offsetLeft-l.offsetWidth-4+"px";l.style.top=this.diagramContainer.offsetTop+"px";c.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-c.offsetWidth+"px";c.style.top=f.style.top;c.style.right=-"";this.bottomResizer.style.left=this.diagramContainer.offsetLeft+(this.diagramContainer.offsetWidth-this.bottomResizer.offsetWidth)/2+"px";this.bottomResizer.style.top=this.diagramContainer.offsetTop+this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight/2-1+"px";this.rightResizer.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-this.rightResizer.offsetWidth/2-1+"px";this.rightResizer.style.top=this.diagramContainer.offsetTop+(this.diagramContainer.offsetHeight--this.bottomResizer.offsetHeight)/2+"px"}this.bottomResizer.style.visibility=Editor.inlineFullscreen?"hidden":"";this.rightResizer.style.visibility=this.bottomResizer.style.visibility;f.style.visibility="";c.style.visibility=""};EditorUi.prototype.doSetSketchMode=function(c){Editor.sketchMode!=c&&(Editor.sketchMode=c,this.updateDefaultStyles())};EditorUi.prototype.updateDefaultStyles=function(){var c=this.editor.graph;c.defaultVertexStyle=mxUtils.clone(Graph.prototype.defaultVertexStyle);c.defaultEdgeStyle=-mxUtils.clone(Graph.prototype.defaultEdgeStyle);if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.vertexFontSize=16,c.edgeFontSize=c.vertexFontSize-4):"sketch"==Editor.currentTheme?(c.vertexFontSize=20,c.edgeFontSize=c.vertexFontSize-4):(c.vertexFontSize=Graph.prototype.vertexFontSize,c.edgeFontSize=Graph.prototype.edgeFontSize),c.defaultEdgeStyle.fontSize=c.edgeFontSize;if(null==Editor.config||-null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.endSize="8",c.defaultEdgeStyle.startSize="8"):"sketch"==Editor.currentTheme&&(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.jettySize="auto",c.defaultEdgeStyle.orthogonalLoop="1",c.defaultEdgeStyle.endArrow="open",c.defaultEdgeStyle.endSize=-"14",c.defaultEdgeStyle.startSize="14",c.defaultEdgeStyle.sourcePerimeterSpacing="8",c.defaultEdgeStyle.targetPerimeterSpacing="8");if(null==Editor.config||null==Editor.config.defaultFonts){if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle){if("sketch"==Editor.currentTheme&&"1"!=urlParams.embedInline||Editor.sketchMode)c.defaultVertexStyle.fontFamily=Editor.sketchFontFamily,c.defaultVertexStyle.fontSource=Editor.sketchFontSource,c.defaultEdgeStyle.fontFamily=-Editor.sketchFontFamily,c.defaultEdgeStyle.fontSource=Editor.sketchFontSource;Editor.sketchMode&&(c.defaultVertexStyle.sketch="1",c.defaultVertexStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultVertexStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultVertexStyle.hachureGap="4",c.defaultEdgeStyle.sketch="1",c.defaultEdgeStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultEdgeStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultEdgeStyle.hachureGap="4")}this.menus.defaultFonts="sketch"==-Editor.currentTheme?Menus.prototype.defaultFonts.concat(Editor.sketchFonts):Menus.prototype.defaultFonts}c.currentVertexStyle=mxUtils.clone(c.defaultVertexStyle);c.currentEdgeStyle=mxUtils.clone(c.defaultEdgeStyle);this.clearDefaultStyle()};EditorUi.prototype.getLinkTitle=function(c){var f=Graph.prototype.getLinkTitle.apply(this,arguments);if(Graph.isPageLink(c)){var l=c.indexOf(",");0<l&&(f=this.getPageById(c.substring(l+1)),f=null!=f?f.getName():mxResources.get("pageNotFound"))}else"data:"==c.substring(0,-5)&&(f=this.getCustomLinkTitle(c));return f};EditorUi.prototype.getCustomLinkTitle=function(c){var f=mxResources.get("action");if("data:action/json,"==c.substring(0,17))try{var l=JSON.parse(c.substring(17));null!=l&&null!=l.title&&(f=l.title)}catch(t){}return f};EditorUi.prototype.handleCustomLink=function(c,f){if(Graph.isPageLink(c))if(f=c.indexOf(","),c=this.getPageById(c.substring(f+1)))this.selectPage(c);else throw Error(mxResources.get("pageNotFound")||"Page not found");else this.editor.graph.handleCustomLink(c,-f)};EditorUi.prototype.installSettings=function(){if(Editor.isSettingsEnabled()){var c=this.editor.graph;Editor.pagesVisible=mxSettings.settings.pagesVisible;ColorDialog.recentColors=mxSettings.getRecentColors();if(isLocalStorage)try{window.addEventListener("storage",mxUtils.bind(this,function(f){f.key==mxSettings.key&&(mxSettings.load(),ColorDialog.recentColors=mxSettings.getRecentColors(),this.menus.customFonts=mxSettings.getCustomFonts())}),!1)}catch(f){}this.fireEvent(new mxEventObject("styleChanged",-"keys",[],"values",[],"cells",[]));this.menus.customFonts=mxSettings.getCustomFonts();this.addListener("customFontsChanged",mxUtils.bind(this,function(f,l){mxSettings.setCustomFonts(this.menus.customFonts);mxSettings.save()}));c.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(f,l){mxSettings.setCreateTarget(c.connectionHandler.isCreateTarget());mxSettings.save()}));-c.pageFormat=null!=c.defaultPageFormat?c.defaultPageFormat:mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(f,l){mxSettings.setPageFormat(c.pageFormat);mxSettings.save()}));c.view.defaultDarkGridColor=mxSettings.getGridColor(!0);c.view.defaultGridColor=mxSettings.getGridColor(!1);c.view.gridColor="light-dark("+c.view.defaultGridColor+", "+c.view.defaultDarkGridColor+")";this.addListener("gridColorChanged",mxUtils.bind(this,function(f,l){mxSettings.setGridColor(c.view.defaultGridColor,-!1);mxSettings.setGridColor(c.view.defaultDarkGridColor,!0);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(f,l){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();if(!this.editor.chromeless||this.editor.editable)null!=mxSettings.settings.enableAnimations&&(Editor.enableAnimations=mxSettings.settings.enableAnimations),this.addListener("enableAnimationsChanged",-mxUtils.bind(this,function(f,l){mxSettings.settings.enableAnimations=Editor.enableAnimations;mxSettings.save()}));null!=this.sidebar&&(null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes?(this.sidebar.searchShapes(decodeURIComponent(urlParams["search-shapes"])),this.sidebar.showEntries("search")):(this.sidebar.showPalette("search",mxSettings.settings.search),this.editor.chromeless&&!this.editor.editable||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),-mxSettings.save())));this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyImage=function(c,f,l){try{null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(t,q){try{this.spinner.stop();var D=this.createImageDataUri(t,f,"png"),G=parseInt(q.getAttribute("width")),N=parseInt(q.getAttribute("height"));-this.writeImageToClipboard(D,G,N,mxUtils.bind(this,function(L){this.handleError(L)}))}catch(L){this.handleError(L)}}),null,null,null,mxUtils.bind(this,function(t){this.spinner.stop();this.handleError(t)}),null,null,null!=l?l:4,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,null,null,null,10,null,null,!1,null,0<c.length?c:null)}catch(t){this.handleError(t)}};EditorUi.prototype.copyCells=function(c,f){var l=this.editor.graph;if(l.isSelectionEmpty())c.innerText="";-else{var t=mxUtils.sortCells(l.model.getTopmostCells(l.getSelectionCells())),q=mxUtils.getXml(l.encodeCells(t));mxUtils.setTextContent(c,encodeURIComponent(q));f?(l.removeCells(t,!1),l.lastPasteXml=null):(l.lastPasteXml=q,l.pasteCounter=0);c.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var c=null;if(Editor.enableNativeCipboard){var f=this.editor.graph;f.isSelectionEmpty()||(c=mxUtils.sortCells(f.getExportableCells(f.model.getTopmostCells(f.getSelectionCells()))),-f=mxUtils.getXml(f.encodeCells(c)),navigator.clipboard.writeText(f))}return c};EditorUi.prototype.pasteXml=function(c,f,l,t,q){q=null!=q?q:!0;var D=this.editor.graph,G=null;D.lastPasteXml==c?D.pasteCounter++:(D.lastPasteXml=c,D.pasteCounter=0);var N=D.pasteCounter*D.gridSize;if(l||this.isCompatibleString(c))G=this.importXml(c,N,N),D.setSelectionCells(G);else if(f&&1==D.getSelectionCount()){q=D.getStartEditingCell(D.getSelectionCell(),t);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&"image"==D.getCurrentCellStyle(q)[mxConstants.STYLE_SHAPE])D.setCellStyles(mxConstants.STYLE_IMAGE,-c,[q]);else{D.model.beginUpdate();try{D.labelChanged(q,c),Graph.isLink(c)&&D.setLinkForCell(q,c)}finally{D.model.endUpdate()}}D.setSelectionCell(q)}else G=D.getInsertPoint(),D.isMouseInsertPoint()&&(N=0,D.lastPasteXml==c&&0<D.pasteCounter&&D.pasteCounter--),G=this.insertTextAt(c,G.x+N,G.y+N,q),D.setSelectionCells(G);D.isSelectionEmpty()||(D.scrollCellToVisible(D.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(D.view.getState(D.getSelectionCell())));return G};EditorUi.prototype.pasteCells=-function(c,f,l,t){if(!mxEvent.isConsumed(c)){var q=f,D=!1;if(l&&null!=c.clipboardData&&c.clipboardData.getData){var G=c.clipboardData.getData("text/plain"),N=!1;if(null!=G&&0<G.length&&"%3CmxGraphModel%3E"==G.substring(0,18))try{var L=decodeURIComponent(G);this.isCompatibleString(L)&&(N=!0,G=L)}catch(na){}N=N?null:c.clipboardData.getData("text/html");null!=N&&0<N.length?(q=this.parseHtmlData(N),D="text/plain"!=q.getAttribute("data-type")):null!=G&&0<G.length&&(q=document.createElement("div"),mxUtils.setTextContent(q,-N))}G=q.getElementsByTagName("span");if(null!=G&&0<G.length&&"application/vnd.lucid.chart.objects"===G[0].getAttribute("data-lucid-type"))l=G[0].getAttribute("data-lucid-content"),null!=l&&0<l.length&&(this.convertLucidChart(l,mxUtils.bind(this,function(na){var W=this.editor.graph;W.lastPasteXml==na?W.pasteCounter++:(W.lastPasteXml=na,W.pasteCounter=0);var ba=W.pasteCounter*W.gridSize;W.setSelectionCells(this.importXml(na,ba,ba));W.scrollCellToVisible(W.getSelectionCell())}),mxUtils.bind(this,function(na){this.handleError(na)})),-mxEvent.consume(c));else{var J=!1,Y="";Y=D?null!=q.textContent&&"<mxfile"==q.textContent.substring(0,7)&&"</mxfile>"==q.textContent.substring(q.textContent.length-9)||"<mxGraphModel"==q.textContent.substring(0,13)&&"</mxGraphModel>"==q.textContent.substring(q.textContent.length-15)?q.textContent.replace(/\u00a0/g," "):q.innerHTML:mxUtils.trim(null==q.innerText?mxUtils.getTextContent(q):q.innerText);try{var ha=Y.lastIndexOf("%3E");0<=ha&&ha<Y.length-3&&(Y=Y.substring(0,ha+3))}catch(na){}try{G=q.getElementsByTagName("span"),-(L=null!=G&&0<G.length?mxUtils.trim(decodeURIComponent(G[0].textContent)):decodeURIComponent(Y))&&(this.isCompatibleString(L)||0==L.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(J=!0,Y=L)}catch(na){}try{if(null!=Y&&0<Y.length){if(0==Y.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var ea=mxUtils.bind(this,function(){try{Y=(new MiroImporter).importMiroJson(JSON.parse(Y)),this.pasteXml(Y,t,J,c)}catch(na){console.log("Miro import error:",na)}});"undefined"===typeof MiroImporter?+null!=this.buttonContainer&&null!=this.menubar&&(this.buttonContainer.style.display="",this.menubar.container.appendChild(this.buttonContainer))};EditorUi.prototype.createMenu=function(c,f,l,t){l=null!=l?l:"geButton";var q=this.menus.get(c);t=this.menubar.addMenu(mxResources.get(c),q.funct,null,t);t.className=l;t.setAttribute("title",mxResources.get(c));this.menus.menuCreated(q,t,l);null!=f&&(t.style.backgroundImage="url("+f+")",t.innerText="");return t};EditorUi.prototype.addButton=function(c,f,+l,t){c=this.createToolbarButton(c,f,l);t=null!=t?t:this.container;t.appendChild(c);return c};EditorUi.prototype.createToolbarButton=function(c,f,l){var t=document.createElement("a");t.className="geButton";null!=c&&"data:"==c.substring(0,5)&&(t.style.backgroundImage="url("+c+")");null!=f&&t.setAttribute("title",f);null!=l&&mxEvent.addListener(t,"click",function(q){"disabled"!=t.getAttribute("disabled")&&l(q);mxEvent.consume(q)});mxEvent.preventDefault(t);return t};EditorUi.prototype.createMenuItem=+function(c,f,l){var t=this.actions.get(c),q=null!=t?t.funct:null,D=this.createToolbarButton(f,mxResources.get(c)+(null!=t&&null!=t.shortcut?" ("+t.shortcut+")":""),q);null==t||l||(c=function(){t.isEnabled()?D.removeAttribute("disabled"):D.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",c),t.addListener("stateChanged",c),c());return D};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var c=Math.max(10,this.diagramContainer.parentNode.clientWidth-+256),f="1"==urlParams.embedInline?580:"1"==urlParams.sketch?580:Math.min(566,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,mxResources.get("format"),c,60,240,f,mxUtils.bind(this,function(q){q.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.formatWindow.window.fit()}));var l=this.formatWindow.window.toggleMinimized,t=240;this.formatWindow.window.toggleMinimized=function(){l.apply(this,arguments);+this.minimized?(t=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+t-140+"px"):(this.div.style.width=t+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-t+140)+"px");this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(q){mxEvent.getSource(q)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));+this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80);"sketch"==Editor.currentTheme?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var q=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,D=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>q||690>D)&&this.formatWindow.window.toggleMinimized()}),0)):this.formatWindow.window.setVisible(!1)}};var G=EditorUi.prototype.toggleFormatPanel;+EditorUi.prototype.toggleFormatPanel=function(c){var f=this.formatWindow;null!=f?f.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):G.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c){if(this.isShapesPanelVisible()!=c){var f=EditorUi.prototype.hsplitPosition;0==f&&(f=this.defaultSidebarWidth);var l=this.hsplitPosition,t=mxUtils.bind(this,function(){this.hsplitPosition=q;this.refresh();this.diagramContainer.scrollLeft-=l-this.hsplitPosition}),q=c?f:0,D=Editor.transitionDelay;+mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==q?"translateX(0)":"translateX(-100%)");0!=q&&t();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==q?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+D+"s ease-in-out");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin","top left");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,+"transition",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin",null);0==q&&t()}),1E3*D)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var S=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;return null!=c?c.window.isVisible():S.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(c){var f=+mxUtils.bind(this,function(H,N){var L=this.menus.get(H);H=this.createMenuElement(N,mxUtils.bind(this,function(){L.funct.apply(this,arguments)}));H.setAttribute("title",N);H.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";H.className="geButton";c.parentNode.appendChild(H);return H});if(Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries))if(null!=this.actions.get("newLibrary"))f=document.createElement("div"),+f.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;",f.className="geButton",f.style.left="0px",f.style.right="50%",mxUtils.write(f,mxResources.get("newLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("newLibrary").funct),f=f.cloneNode(!1),f.style.left="50%",f.style.right="0px",mxUtils.write(f,mxResources.get("openLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("openLibrary").funct);else{var l=+f("newLibrary","");l.style.left="0px";l.style.right="50%";var t=document.createElement("span");l.appendChild(t);var q=f("openLibraryFrom","");q.style.borderLeftWidth="1px";q.style.left="50%";q.style.right="0px";var D=document.createElement("span");q.appendChild(D);this.dependsOnLanguage(mxUtils.bind(this,function(){t.innerHTML="";mxUtils.write(t,mxResources.get("newLibrary"));l.setAttribute("title",mxResources.get("newLibrary"));D.innerHTML="";mxUtils.write(D,mxResources.get("openLibraryFrom"));q.setAttribute("title",+mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow="hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=Math.min(this.diagramContainer.parentNode.clientWidth-10,218),f="1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,650),l="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme;this.sidebarWindow=new WrapperWindow(this,mxResources.get("shapes"),l&&"1"!=urlParams.embedInline?+66:10,l&&"1"!=urlParams.embedInline?Math.max(30,(this.diagramContainer.parentNode.clientHeight-f)/2):56,c-6,f-6,mxUtils.bind(this,function(t){this.createShapesPanel(t)}));this.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.sidebarWindow.window.fit()}));this.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90);this.sidebarWindow.window.setVisible(!1)}};EditorUi.prototype.setSketchMode=function(c){this.doSetSketchMode(c);null==urlParams.rough&&(mxSettings.settings.sketchMode=+c,mxSettings.save());this.fireEvent(new mxEventObject("sketchModeChanged"))};EditorUi.prototype.setAndPersistDarkMode=function(c){var f=c;"auto"==c&&(f=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode(f);mxSettings.settings.darkMode=c;mxSettings.save();c=mxSettings.getUi();null==urlParams.ui&&"dark"==c&&this.setCurrentTheme("kennedy",!0)};EditorUi.prototype.setAndPersistLanguage=function(c){this.spinner.spin(document.body,mxResources.get("working"))&&+(mxSettings.setLanguage(c),mxSettings.save(),mxClient.language=c,mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE,null,mxUtils.bind(this,function(){this.spinner.stop();this.fireEvent(new mxEventObject("languageChanged"))})))};EditorUi.prototype.setElementTitle=function(c,f){this.dependsOnLanguage(mxUtils.bind(this,function(){c.setAttribute("title",mxResources.get(f))}))};EditorUi.prototype.dependsOnLanguage=function(c){c();this.addListener("languageChanged",c)};EditorUi.prototype.setAndPersistHighContrast=+function(c){this.setHighContrast(c);Editor.isSettingsEnabled()&&(mxSettings.settings.highContrast=c,mxSettings.save())};EditorUi.prototype.isHighContrast=function(){var c=document.getElementById("high-contrast-stylesheet");return null!=c&&window.matchMedia?(c=c.getAttribute("media"),"all"==c||"not all"!=c&&window.matchMedia("(forced-colors: active)").matches):!1};EditorUi.prototype.setHighContrast=function(c){var f=document.getElementById("high-contrast-stylesheet");if(null!=f&&window.matchMedia){var l=+window.matchMedia("(forced-colors: active)").matches,t=f.getAttribute("media");(t="all"==t||"not all"!=t&&l)&&!c?f.setAttribute("media",l?"not all":"(forced-colors: active)"):!t&&c&&f.setAttribute("media",l?"(forced-colors: active)":"all")}};EditorUi.prototype.isRulerVisible=function(){return null!=this.ruler};EditorUi.prototype.setRulerVisible=function(c){var f=this.getDiagramContainerOffset();mxSettings.setRulerOn(c);mxSettings.save();c||null==this.ruler?c&&null==this.ruler&&(this.ruler=new mxDualRuler(this,+this.editor.graph.view.unit)):(this.ruler.destroy(),this.ruler=null);this.fireEvent(new mxEventObject("rulerVisibleChanged"));c=this.getDiagramContainerOffset();this.diagramContainer.scrollLeft+=c.x-f.x;this.diagramContainer.scrollTop+=c.x-f.x};EditorUi.prototype.isAutoDarkModeSupported=function(){return null!=window.matchMedia};EditorUi.prototype.isAutoDarkMode=function(c){return!c&&"auto"==urlParams.dark||Editor.isSettingsEnabled()&&"auto"==mxSettings.settings.darkMode};EditorUi.prototype.setDarkMode=+function(c){mxUtils.lightDarkColorSupported&&(Editor.darkMode=c,c=mxUtils.isAncestorNode(document.body,this.container)||null==this.editor?this.container:this.editor.graph.container,mxConstants.DROP_TARGET_COLOR=Editor.isDarkMode()?"#00ff00":"#0000ff",null!=c&&(Editor.isDarkMode()?(c.classList.add("geDarkMode"),c.style.colorScheme="dark"):(c.classList.remove("geDarkMode"),c.style.colorScheme="light")),null!=this.ruler&&this.ruler.updateStyle(),this.fireEvent(new mxEventObject("darkModeChanged")))};+EditorUi.prototype.setPagesVisible=function(c){Editor.pagesVisible!=c&&(Editor.pagesVisible=c,mxSettings.settings.pagesVisible=c,mxSettings.save(),this.fireEvent(new mxEventObject("pagesVisibleChanged")))};EditorUi.prototype.setSidebarTitles=function(c,f){this.sidebar.sidebarTitles!=c&&(this.sidebar.sidebarTitles=c,Editor.isSettingsEnabled()&&f&&(mxSettings.settings.sidebarTitles=c,mxSettings.save()),this.fireEvent(new mxEventObject("sidebarTitlesChanged")))};EditorUi.prototype.setInlineFullscreen=+function(c){Editor.inlineFullscreen!=c&&(this.diagramContainer.setAttribute("data-scrollState",JSON.stringify(this.saveScrollState(!0))),(window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:c,rect:this.diagramContainer.getBoundingClientRect()}),"*"))};EditorUi.prototype.inlineSizeChanged=function(){var c=this.sketchFooterMenuElt,f=this.sketchMainMenuElt,l=this.sketchPickerMenuElt;if(Editor.inlineFullscreen)f.style.left="10px",f.style.top="10px",l.style.left="10px",+l.style.top="60px",c.style.top="10px",c.style.right="12px",c.style.left="",null==this.diagramContainer.getAttribute("data-bounds")&&(this.diagramContainer.setAttribute("data-bounds",this.diagramContainer.style.top+" "+this.diagramContainer.style.left+" "+this.diagramContainer.style.width+" "+this.diagramContainer.style.height),this.diagramContainer.style.top="0px",this.diagramContainer.style.left="0px",this.diagramContainer.style.bottom="0px",this.diagramContainer.style.right="0px",this.diagramContainer.style.width=+"",this.diagramContainer.style.height="");else{var t=this.diagramContainer.getAttribute("data-bounds");if(null!=t){this.diagramContainer.removeAttribute("data-bounds");var q=t.split(" ");t=mxUtils.getDocumentSize();this.diagramContainer.style.top=q[0];this.diagramContainer.style.left=q[1];var D=parseInt(q[2]);q=parseInt(q[3]);D=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,D):D,t.width-80);q=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,q):q,t.height-80);this.diagramContainer.style.width=+D+"px";this.diagramContainer.style.height=q+"px";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";(window.opener||window.parent).postMessage(JSON.stringify({event:"resize",rect:this.diagramContainer.getBoundingClientRect()}),"*")}f.style.left=this.diagramContainer.offsetLeft+"px";f.style.top=this.diagramContainer.offsetTop-f.offsetHeight-4+"px";l.style.display="";l.style.left=this.diagramContainer.offsetLeft-l.offsetWidth-4+"px";l.style.top=this.diagramContainer.offsetTop++"px";c.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-c.offsetWidth+"px";c.style.top=f.style.top;c.style.right="";this.bottomResizer.style.left=this.diagramContainer.offsetLeft+(this.diagramContainer.offsetWidth-this.bottomResizer.offsetWidth)/2+"px";this.bottomResizer.style.top=this.diagramContainer.offsetTop+this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight/2-1+"px";this.rightResizer.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-+this.rightResizer.offsetWidth/2-1+"px";this.rightResizer.style.top=this.diagramContainer.offsetTop+(this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight)/2+"px"}this.bottomResizer.style.visibility=Editor.inlineFullscreen?"hidden":"";this.rightResizer.style.visibility=this.bottomResizer.style.visibility;f.style.visibility="";c.style.visibility=""};EditorUi.prototype.doSetSketchMode=function(c){Editor.sketchMode!=c&&(Editor.sketchMode=c,this.updateDefaultStyles())};EditorUi.prototype.updateDefaultStyles=+function(){var c=this.editor.graph;c.defaultVertexStyle=mxUtils.clone(Graph.prototype.defaultVertexStyle);c.defaultEdgeStyle=mxUtils.clone(Graph.prototype.defaultEdgeStyle);if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.vertexFontSize=16,c.edgeFontSize=c.vertexFontSize-4):"sketch"==Editor.currentTheme?(c.vertexFontSize=20,c.edgeFontSize=c.vertexFontSize-4):(c.vertexFontSize=Graph.prototype.vertexFontSize,+c.edgeFontSize=Graph.prototype.edgeFontSize),c.defaultEdgeStyle.fontSize=c.edgeFontSize;if(null==Editor.config||null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.endSize="8",c.defaultEdgeStyle.startSize="8"):"sketch"==Editor.currentTheme&&(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.jettySize=+"auto",c.defaultEdgeStyle.orthogonalLoop="1",c.defaultEdgeStyle.endArrow="open",c.defaultEdgeStyle.endSize="14",c.defaultEdgeStyle.startSize="14",c.defaultEdgeStyle.sourcePerimeterSpacing="8",c.defaultEdgeStyle.targetPerimeterSpacing="8");if(null==Editor.config||null==Editor.config.defaultFonts){if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle){if("sketch"==Editor.currentTheme&&"1"!=urlParams.embedInline||Editor.sketchMode)c.defaultVertexStyle.fontFamily=+Editor.sketchFontFamily,c.defaultVertexStyle.fontSource=Editor.sketchFontSource,c.defaultEdgeStyle.fontFamily=Editor.sketchFontFamily,c.defaultEdgeStyle.fontSource=Editor.sketchFontSource;Editor.sketchMode&&(c.defaultVertexStyle.sketch="1",c.defaultVertexStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultVertexStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultVertexStyle.hachureGap="4",c.defaultEdgeStyle.sketch="1",c.defaultEdgeStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultEdgeStyle.jiggle=+Editor.sketchDefaultJiggle,c.defaultEdgeStyle.hachureGap="4")}this.menus.defaultFonts="sketch"==Editor.currentTheme?Menus.prototype.defaultFonts.concat(Editor.sketchFonts):Menus.prototype.defaultFonts}c.currentVertexStyle=mxUtils.clone(c.defaultVertexStyle);c.currentEdgeStyle=mxUtils.clone(c.defaultEdgeStyle);this.clearDefaultStyle()};EditorUi.prototype.getLinkTitle=function(c){var f=Graph.prototype.getLinkTitle.apply(this,arguments);if(Graph.isPageLink(c)){var l=c.indexOf(",");0<l&&(f=this.getPageById(c.substring(l++1)),f=null!=f?f.getName():mxResources.get("pageNotFound"))}else"data:"==c.substring(0,5)&&(f=this.getCustomLinkTitle(c));return f};EditorUi.prototype.getCustomLinkTitle=function(c){var f=mxResources.get("action");if("data:action/json,"==c.substring(0,17))try{var l=JSON.parse(c.substring(17));null!=l&&null!=l.title&&(f=l.title)}catch(t){}return f};EditorUi.prototype.handleCustomLink=function(c,f){if(Graph.isPageLink(c))if(f=c.indexOf(","),c=this.getPageById(c.substring(f+1)))this.selectPage(c);else throw Error(mxResources.get("pageNotFound")||+"Page not found");else this.editor.graph.handleCustomLink(c,f)};EditorUi.prototype.installSettings=function(){if(Editor.isSettingsEnabled()){var c=this.editor.graph;Editor.pagesVisible=mxSettings.settings.pagesVisible;ColorDialog.recentColors=mxSettings.getRecentColors();if(isLocalStorage)try{window.addEventListener("storage",mxUtils.bind(this,function(f){f.key==mxSettings.key&&(mxSettings.load(),ColorDialog.recentColors=mxSettings.getRecentColors(),this.menus.customFonts=mxSettings.getCustomFonts())}),+!1)}catch(f){}this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.menus.customFonts=mxSettings.getCustomFonts();this.addListener("customFontsChanged",mxUtils.bind(this,function(f,l){mxSettings.setCustomFonts(this.menus.customFonts);mxSettings.save()}));c.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(f,l){mxSettings.setCreateTarget(c.connectionHandler.isCreateTarget());+mxSettings.save()}));c.pageFormat=null!=c.defaultPageFormat?c.defaultPageFormat:mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(f,l){mxSettings.setPageFormat(c.pageFormat);mxSettings.save()}));c.view.defaultDarkGridColor=mxSettings.getGridColor(!0);c.view.defaultGridColor=mxSettings.getGridColor(!1);c.view.gridColor="light-dark("+c.view.defaultGridColor+", "+c.view.defaultDarkGridColor+")";this.addListener("gridColorChanged",mxUtils.bind(this,function(f,+l){mxSettings.setGridColor(c.view.defaultGridColor,!1);mxSettings.setGridColor(c.view.defaultDarkGridColor,!0);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(f,l){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();if(!this.editor.chromeless||this.editor.editable)null!=mxSettings.settings.enableAnimations&&(Editor.enableAnimations=mxSettings.settings.enableAnimations),+this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(f,l){mxSettings.settings.enableAnimations=Editor.enableAnimations;mxSettings.save()}));null!=this.sidebar&&(null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes?(this.sidebar.searchShapes(decodeURIComponent(urlParams["search-shapes"])),this.sidebar.showEntries("search")):(this.sidebar.showPalette("search",mxSettings.settings.search),this.editor.chromeless&&!this.editor.editable||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||+0))||(this.toggleScratchpad(),mxSettings.save())));this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyImage=function(c,f,l){try{null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(t,q){try{this.spinner.stop();var D=this.createImageDataUri(t,f,"png"),H=parseInt(q.getAttribute("width")),+N=parseInt(q.getAttribute("height"));this.writeImageToClipboard(D,H,N,mxUtils.bind(this,function(L){this.handleError(L)}))}catch(L){this.handleError(L)}}),null,null,null,mxUtils.bind(this,function(t){this.spinner.stop();this.handleError(t)}),null,null,null!=l?l:4,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,null,null,null,10,null,null,!1,null,0<c.length?c:null)}catch(t){this.handleError(t)}};EditorUi.prototype.copyCells=function(c,f){var l=this.editor.graph;if(l.isSelectionEmpty())c.innerText=+"";else{var t=mxUtils.sortCells(l.model.getTopmostCells(l.getSelectionCells())),q=mxUtils.getXml(l.encodeCells(t));mxUtils.setTextContent(c,encodeURIComponent(q));f?(l.removeCells(t,!1),l.lastPasteXml=null):(l.lastPasteXml=q,l.pasteCounter=0);c.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var c=null;if(Editor.enableNativeCipboard){var f=this.editor.graph;f.isSelectionEmpty()||(c=mxUtils.sortCells(f.getExportableCells(f.model.getTopmostCells(f.getSelectionCells()))),+f=mxUtils.getXml(f.encodeCells(c)),navigator.clipboard.writeText(f))}return c};EditorUi.prototype.pasteXml=function(c,f,l,t,q){q=null!=q?q:!0;var D=this.editor.graph,H=null;D.lastPasteXml==c?D.pasteCounter++:(D.lastPasteXml=c,D.pasteCounter=0);var N=D.pasteCounter*D.gridSize;if(l||this.isCompatibleString(c))H=this.importXml(c,N,N),D.setSelectionCells(H);else if(f&&1==D.getSelectionCount()){q=D.getStartEditingCell(D.getSelectionCell(),t);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&"image"==D.getCurrentCellStyle(q)[mxConstants.STYLE_SHAPE])D.setCellStyles(mxConstants.STYLE_IMAGE,+c,[q]);else{D.model.beginUpdate();try{D.labelChanged(q,c),Graph.isLink(c)&&D.setLinkForCell(q,c)}finally{D.model.endUpdate()}}D.setSelectionCell(q)}else H=D.getInsertPoint(),D.isMouseInsertPoint()&&(N=0,D.lastPasteXml==c&&0<D.pasteCounter&&D.pasteCounter--),H=this.insertTextAt(c,H.x+N,H.y+N,q),D.setSelectionCells(H);D.isSelectionEmpty()||(D.scrollCellToVisible(D.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(D.view.getState(D.getSelectionCell())));return H};EditorUi.prototype.pasteCells=+function(c,f,l,t){if(!mxEvent.isConsumed(c)){var q=f,D=!1;if(l&&null!=c.clipboardData&&c.clipboardData.getData){var H=c.clipboardData.getData("text/plain"),N=!1;if(null!=H&&0<H.length&&"%3CmxGraphModel%3E"==H.substring(0,18))try{var L=decodeURIComponent(H);this.isCompatibleString(L)&&(N=!0,H=L)}catch(na){}N=N?null:c.clipboardData.getData("text/html");null!=N&&0<N.length?(q=this.parseHtmlData(N),D="text/plain"!=q.getAttribute("data-type")):null!=H&&0<H.length&&(q=document.createElement("div"),mxUtils.setTextContent(q,+N))}H=q.getElementsByTagName("span");if(null!=H&&0<H.length&&"application/vnd.lucid.chart.objects"===H[0].getAttribute("data-lucid-type"))l=H[0].getAttribute("data-lucid-content"),null!=l&&0<l.length&&(this.convertLucidChart(l,mxUtils.bind(this,function(na){var W=this.editor.graph;W.lastPasteXml==na?W.pasteCounter++:(W.lastPasteXml=na,W.pasteCounter=0);var ba=W.pasteCounter*W.gridSize;W.setSelectionCells(this.importXml(na,ba,ba));W.scrollCellToVisible(W.getSelectionCell())}),mxUtils.bind(this,function(na){this.handleError(na)})),+mxEvent.consume(c));else{var J=!1,Y="";Y=D?null!=q.textContent&&"<mxfile"==q.textContent.substring(0,7)&&"</mxfile>"==q.textContent.substring(q.textContent.length-9)||"<mxGraphModel"==q.textContent.substring(0,13)&&"</mxGraphModel>"==q.textContent.substring(q.textContent.length-15)?q.textContent.replace(/\u00a0/g," "):q.innerHTML:mxUtils.trim(null==q.innerText?mxUtils.getTextContent(q):q.innerText);try{var ha=Y.lastIndexOf("%3E");0<=ha&&ha<Y.length-3&&(Y=Y.substring(0,ha+3))}catch(na){}try{H=q.getElementsByTagName("span"),+(L=null!=H&&0<H.length?mxUtils.trim(decodeURIComponent(H[0].textContent)):decodeURIComponent(Y))&&(this.isCompatibleString(L)||0==L.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(J=!0,Y=L)}catch(na){}try{if(null!=Y&&0<Y.length){if(0==Y.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var ea=mxUtils.bind(this,function(){try{Y=(new MiroImporter).importMiroJson(JSON.parse(Y)),this.pasteXml(Y,t,J,c)}catch(na){console.log("Miro import error:",na)}});"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",ea):ea()}else this.pasteXml(Y,t,J,c,D);try{mxEvent.consume(c)}catch(na){}}else if(!l){var aa=this.editor.graph;aa.lastPasteXml=null;aa.pasteCounter=0}}catch(na){this.handleError(na)}}}f.innerHTML=" "};EditorUi.prototype.showPrintDialog=function(c,f,l){var t=320;this.editor.graph.isEnabled()&&(t+=40);null!=this.pages&&1<this.pages.length&&(t+=40,this.editor.graph.isEnabled()||(t+=10));null==f||mxClient.IS_CHROMEAPP||"draw.io"!=this.getServiceName()||-(t+=20);this.showDialog((new PrintDialog(this,c,f,l)).container,320,t,!0,!0)};EditorUi.prototype.print=function(c,f){var l=this.editor,t=l.graph,q=this.getPageIndex(this.currentPage),D=null!=q?q+1:1,G=mxUtils.bind(this,function(ba,ja,ca,la){var Q=ba.useCssTransforms,k=ba.currentTranslate,B=ba.currentScale,I=ba.view.translate,U=ba.view.scale;ba.useCssTransforms&&(ba.useCssTransforms=!1,ba.currentTranslate=new mxPoint(0,0),ba.currentScale=1,ba.view.translate=new mxPoint(0,0),ba.view.scale=1);var P=+(t+=20);this.showDialog((new PrintDialog(this,c,f,l)).container,320,t,!0,!0)};EditorUi.prototype.print=function(c,f){var l=this.editor,t=l.graph,q=this.getPageIndex(this.currentPage),D=null!=q?q+1:1,H=mxUtils.bind(this,function(ba,ja,ca,la){var Q=ba.useCssTransforms,k=ba.currentTranslate,B=ba.currentScale,I=ba.view.translate,U=ba.view.scale;ba.useCssTransforms&&(ba.useCssTransforms=!1,ba.currentTranslate=new mxPoint(0,0),ba.currentScale=1,ba.view.translate=new mxPoint(0,0),ba.view.scale=1);var P=ba.getGraphBounds(),T=0,X=0,Z=mxRectangle.fromRectangle(ba.pageFormat),ka=f.fit||f.crop||!ba.pageVisible,va=f.scale;Z.width=Math.ceil(Z.width*ba.pageScale);Z.height=Math.ceil(Z.height*ba.pageScale);var ua=1;if(f.fit){ua=f.sheetsAcross;var qa=f.sheetsDown;isNaN(va)||(Z.width=Math.ceil(Z.width*va),Z.height=Math.ceil(Z.height*va));ua=Math.min(Z.height*qa/(P.height/ba.view.scale),Z.width*ua/(P.width/ba.view.scale))}else ua=isNaN(va)?1:va;ua*=1;!ka&&ba.pageVisible?(va=ba.getPageLayout(),T-=va.x*Z.width,X-=va.y*Z.height):ka=!0;f.crop&&(f.selection&&(P=t.getBoundingBox(t.getSelectionCells())),Z.width=(P.width+1)*ua/ba.view.scale,Z.height=(P.height+1)*ua/ba.view.scale);Z.width=Math.ceil(1*Z.width);Z.height=Math.ceil(1*Z.height);la=null!=la?"page/id,"+la:null;if(null==ja){ja=PrintDialog.createPrintPreview(ba,ua,null,0,T,X,ka);ja.title=this.getBaseFilename(!0);ja.pageSelector=!1;ja.mathEnabled=!1;T=f.border;isNaN(T)||(ja.pageMargin=T);f.selection&&(ja.isCellVisible=function(za){return ba.isCellSelected(za)});var Ba=ja.writeHead;ja.writeHead=function(za){Ba.apply(this,arguments);mxClient.IS_GC&&(za.writeln('<style type="text/css">'),za.writeln("@media print {"),za.writeln(".MathJax svg { shape-rendering: crispEdges; }"),za.writeln("}"),za.writeln("</style>"));null!=l.fontCss&&(za.writeln('<style type="text/css">'),za.writeln(mxUtils.htmlEntities(l.fontCss,!1,!1,!1)),za.writeln("</style>"));for(var Ea=ba.getCustomFonts(),pa=0;pa<Ea.length;pa++){var Ca=Ea[pa].name,Aa=Ea[pa].url;Graph.isCssFontUrl(Aa)?za.writeln('<link rel="stylesheet" href="'+@@ -3866,26 +3868,26 @@ mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(Aa))+'" charset="UTF-8" type="te(ja.wnd.document.writeln('<style type="text/css">'),ja.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(T)+'";\nsrc: url("'+mxUtils.htmlEntities(X)+'");\n}'),ja.wnd.document.writeln("</style>"))}Q&&(ba.useCssTransforms=Q,ba.currentTranslate=k,ba.currentScale=B,ba.view.translate=I,ba.view.scale=U);return ja}),N=f.pagesFrom,L=f.pagesTo,J=!f.allPages;q=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,f);else{J&&(J=f.selection||N==D&&L==D);if(!J&&null!=this.pages&&this.pages.length){J=0;D=this.pages.length-1;f.allPages||(J=parseInt(N)-1,D=parseInt(L)-1);for(var Y=J;Y<=D;Y++){var ha=this.pages[Y];N=ha==this.currentPage?t:null;if(null==N){N=this.createTemporaryGraph(t.stylesheet);N.shapeForegroundColor=t.shapeForegroundColor;N.shapeBackgroundColor=t.shapeBackgroundColor;L=!0;J=!1;var ea=null,aa=null;null==ha.viewState&&null==ha.root&&this.updatePageRoot(ha);null!=ha.viewState&&(L=ha.viewState.pageVisible,J=ha.viewState.mathEnabled,ea=ha.viewState.background,aa=ha.viewState.backgroundImage,N.pageFormat=ha.viewState.pageFormat,N.gridSize=ha.viewState.gridSize);null!=aa&&null!=aa.originalSrc&&(aa=this.createImageForPageLink(aa.originalSrc,ha));N.background=ea;N.backgroundImage=null!=aa?new mxImage(aa.src,aa.width,aa.height,aa.x,aa.y):null;N.pageVisible=L;N.mathEnabled=J;var na=N.getGraphBounds;N.getGraphBounds=function(){var ba=na.apply(this,arguments),ja=this.backgroundImage;if(null!=ja&&null!=ja.width&&null!=ja.height){var ca=this.view.translate,la=this.view.scale;-ba=mxRectangle.fromRectangle(ba);ba.add(new mxRectangle((ca.x+ja.x)*la,(ca.y+ja.y)*la,ja.width*la,ja.height*la))}return ba};var W=N.getGlobalVariable;N.getGlobalVariable=function(ba){return"page"==ba?ha.getName():"pagenumber"==ba?Y+1:"pagecount"==ba?null!=this.pages?this.pages.length:1:W.apply(this,arguments)};document.body.appendChild(N.container);this.updatePageRoot(ha);N.model.setRoot(ha.root)}q=G(N,q,Y!=D,ha.getId());N!=t&&N.container.parentNode.removeChild(N.container)}}else q=G(t);null==q||-null==q.wnd?this.handleError({message:mxResources.get("errorUpdatingPreview")}):(q.mathEnabled&&(G=q.wnd.document,c||(q.wnd.IMMEDIATE_PRINT=!0),G.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>')),q.closeDocument(),Graph.rewritePageLinks(q.wnd.document,!0),q.mathEnabled||c||PrintDialog.printPreview(q));return q}};EditorUi.prototype.addFileDropHandler=function(c){if(Graph.fileSupport)for(var f=null,l=0;l<c.length;l++)mxEvent.addListener(c[l],"dragleave",function(t){null!=+ba=mxRectangle.fromRectangle(ba);ba.add(new mxRectangle((ca.x+ja.x)*la,(ca.y+ja.y)*la,ja.width*la,ja.height*la))}return ba};var W=N.getGlobalVariable;N.getGlobalVariable=function(ba){return"page"==ba?ha.getName():"pagenumber"==ba?Y+1:"pagecount"==ba?null!=this.pages?this.pages.length:1:W.apply(this,arguments)};document.body.appendChild(N.container);this.updatePageRoot(ha);N.model.setRoot(ha.root)}q=H(N,q,Y!=D,ha.getId());N!=t&&N.container.parentNode.removeChild(N.container)}}else q=H(t);null==q||+null==q.wnd?this.handleError({message:mxResources.get("errorUpdatingPreview")}):(q.mathEnabled&&(H=q.wnd.document,c||(q.wnd.IMMEDIATE_PRINT=!0),H.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>')),q.closeDocument(),Graph.rewritePageLinks(q.wnd.document,!0),q.mathEnabled||c||PrintDialog.printPreview(q));return q}};EditorUi.prototype.addFileDropHandler=function(c){if(Graph.fileSupport)for(var f=null,l=0;l<c.length;l++)mxEvent.addListener(c[l],"dragleave",function(t){null!=f&&(f.parentNode.removeChild(f),f=null);t.stopPropagation();t.preventDefault()}),mxEvent.addListener(c[l],"dragover",mxUtils.bind(this,function(t){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==f&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(f=this.highlightElement());t.stopPropagation();t.preventDefault()})),mxEvent.addListener(c[l],"drop",mxUtils.bind(this,function(t){null!=f&&(f.parentNode.removeChild(f),f=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<t.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(t.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)):this.openFiles(t.dataTransfer.files,!0);else{var q=this.extractGraphModelFromEvent(t);if(null==q){var D=null!=t.dataTransfer?t.dataTransfer:t.clipboardData;null!=D&&(10==document.documentMode||11==document.documentMode?q=D.getData("Text"):(q=null,q=0<=mxUtils.indexOf(D.types,"text/uri-list")?t.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(D.types,"text/html")?D.getData("text/html"):null,null!=q&&0<q.length?(D=document.createElement("div"),D.innerHTML=Graph.sanitizeHtml(q),D=D.getElementsByTagName("img"),0<D.length&&(q=D[0].getAttribute("src"))):0<=mxUtils.indexOf(D.types,"text/plain")&&(q=D.getData("text/plain"))),null!=q&&(Editor.isPngDataUrl(q)?(q=Editor.extractGraphModelFromPng(q),null!=q&&0<q.length&&this.openLocalFile(q,null,!0)):this.isRemoteFileFormat(q)?this.isOffline()?this.showError(mxResources.get("error"),-mxResources.get("notInOffline")):(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(q))).send(mxUtils.bind(this,function(G){200<=G.getStatus()&&299>=G.getStatus()?this.openLocalFile(G.getText(),null,!0):this.showError(mxResources.get("error"),413==G.getStatus()?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))})):/^https?:\/\//.test(q)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(q):window.geOpenWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost++mxResources.get("notInOffline")):(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(q))).send(mxUtils.bind(this,function(H){200<=H.getStatus()&&299>=H.getStatus()?this.openLocalFile(H.getText(),null,!0):this.showError(mxResources.get("error"),413==H.getStatus()?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))})):/^https?:\/\//.test(q)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(q):window.geOpenWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost+"/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(q)))))}else this.openLocalFile(q,null,!0)}t.stopPropagation();t.preventDefault()}))};EditorUi.prototype.highlightElement=function(c){var f=0,l=0;if(null==c){var t=document.body;var q=document.documentElement;var D=(t.clientWidth||q.clientWidth)-3;t=Math.max(t.clientHeight||0,q.clientHeight)-3}else f=c.offsetTop,l=c.offsetLeft,D=c.clientWidth,t=c.clientHeight;q=document.createElement("div");q.style.zIndex=mxPopupMenu.prototype.zIndex+2;q.style.border="3px dotted rgb(254, 137, 12)";q.style.pointerEvents="none";q.style.position="absolute";q.style.top=f+"px";q.style.left=l+"px";q.style.width=Math.max(0,D-3)+"px";q.style.height=Math.max(0,t-3)+"px";null!=c&&c.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(q):document.body.appendChild(q);return q};EditorUi.prototype.stringToCells=function(c){c=mxUtils.parseXml(c);var f=this.editor.extractGraphModel(c.documentElement);c=[];if(null!=f){var l=new mxCodec(f.ownerDocument),-t=new mxGraphModel;l.decode(f,t);f=t.getChildAt(t.getRoot(),0);for(l=0;l<t.getChildCount(f);l++)c.push(t.getChildAt(f,l))}return c};EditorUi.prototype.openFileHandle=function(c,f,l,t,q,D){if(null!=f&&0<f.length){if(!this.useCanvasForExport&&/(\.png)$/i.test(f)||/(\.pdf)$/i.test(f))f=f.substring(0,f.length-4),/(\.drawio)$/i.test(f)||(f+=".drawio");var G=mxUtils.bind(this,function(L){f=0<=f.lastIndexOf(".")?f.substring(0,f.lastIndexOf("."))+".drawio":f+".drawio";if("<mxlibrary"==L.substring(0,10)){null==-this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,t);try{this.loadLibrary(new LocalLibrary(this,L,f)),this.showSidebar()}catch(J){this.handleError(J,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(L,f,t)});if(EditorUi.isVisioFilename(f))this.importVisio(l,mxUtils.bind(this,function(L){this.spinner.stop();G(L)}));else if(/(\.*<graphml )/.test(c))this.importGraphML(c,mxUtils.bind(this,function(L){this.spinner.stop();G(L)}));else if(Graph.fileSupport&&-(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,f))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):this.parseFile(l,mxUtils.bind(this,function(L){4==L.readyState&&(this.spinner.stop(),200<=L.status&&299>=L.status?G(L.responseText):this.handleError({message:mxResources.get(413==L.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(c))/(\.json)$/i.test(f)&&(f=f.substring(0,+t=new mxGraphModel;l.decode(f,t);f=t.getChildAt(t.getRoot(),0);for(l=0;l<t.getChildCount(f);l++)c.push(t.getChildAt(f,l))}return c};EditorUi.prototype.openFileHandle=function(c,f,l,t,q,D){if(null!=f&&0<f.length){if(!this.useCanvasForExport&&/(\.png)$/i.test(f)||/(\.pdf)$/i.test(f))f=f.substring(0,f.length-4),/(\.drawio)$/i.test(f)||(f+=".drawio");var H=mxUtils.bind(this,function(L){f=0<=f.lastIndexOf(".")?f.substring(0,f.lastIndexOf("."))+".drawio":f+".drawio";if("<mxlibrary"==L.substring(0,10)){null==+this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,t);try{this.loadLibrary(new LocalLibrary(this,L,f)),this.showSidebar()}catch(J){this.handleError(J,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(L,f,t)});if(EditorUi.isVisioFilename(f))this.importVisio(l,mxUtils.bind(this,function(L){this.spinner.stop();H(L)}));else if(/(\.*<graphml )/.test(c))this.importGraphML(c,mxUtils.bind(this,function(L){this.spinner.stop();H(L)}));else if(Graph.fileSupport&&+(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,f))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):this.parseFile(l,mxUtils.bind(this,function(L){4==L.readyState&&(this.spinner.stop(),200<=L.status&&299>=L.status?H(L.responseText):this.handleError({message:mxResources.get(413==L.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(c))/(\.json)$/i.test(f)&&(f=f.substring(0,f.length-5)+".drawio"),this.convertLucidChart(c,mxUtils.bind(this,function(L){this.spinner.stop();this.openLocalFile(L,f,t)}),mxUtils.bind(this,function(L){this.spinner.stop();this.handleError(L)}));else if("<mxlibrary"==c.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,t);try{this.loadLibrary(new LocalLibrary(this,c,l.name)),this.showSidebar()}catch(L){this.handleError(L,mxResources.get("errorLoadingFile"))}}else if(0==-c.indexOf("PK"))this.importZipFile(l,mxUtils.bind(this,function(L){this.spinner.stop();G(L)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(c,f,t)}));else{if("image/png"==l.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==l.type){var N=Editor.extractGraphModelFromPdf(c);null!=N&&(q=null,t=!0,c=N)}this.spinner.stop();this.openLocalFile(c,f,t,q,null!=q?l:null,D)}}};EditorUi.prototype.openFiles=function(c,f){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var l=-0;l<c.length;l++)mxUtils.bind(this,function(t){var q=new FileReader;q.onload=mxUtils.bind(this,function(D){try{this.openFileHandle(D.target.result,t.name,t,f)}catch(G){this.handleError(G)}});q.onerror=mxUtils.bind(this,function(D){this.spinner.stop();this.handleError(D);window.openFile=null});"image"!==t.type.substring(0,5)&&"application/pdf"!==t.type||"image/svg"===t.type.substring(0,9)?q.readAsText(t):q.readAsDataURL(t)})(c[l])};EditorUi.prototype.openLocalFile=function(c,f,l,t,q,D){var G=this.getCurrentFile(),-N=mxUtils.bind(this,function(){window.openFile=null;if(null==f&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var L=mxUtils.parseXml(c);null!=L&&(this.editor.setGraphXml(L.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,c,f||this.defaultFilename,l,t,q,D))});if(null!=c&&0<c.length)null==G||!G.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=t)?N():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=t)&&null!=G&&G.isModified()?this.confirm(mxResources.get("allChangesLost"),-null,N,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(c,f),window.geOpenWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=G&&G.isModified()?this.confirm(mxResources.get("allChangesLost"),null,N,mxResources.get("cancel"),mxResources.get("discardChanges")):N()})));else throw Error(mxResources.get("notADiagramFile"));};EditorUi.prototype.getBasenames=function(){var c={};if(null!=this.pages)for(var f=-0;f<this.pages.length;f++)this.updatePageRoot(this.pages[f]),this.addBasenamesForCell(this.pages[f].root,c);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),c);f=[];for(var l in c)f.push(l);return f};EditorUi.prototype.addBasenamesForCell=function(c,f){function l(G){if(null!=G){var N=G.lastIndexOf(".");0<N&&(G=G.substring(N+1,G.length));null==f[G]&&(f[G]=!0)}}var t=this.editor.graph,q=t.getCellStyle(c);l(mxStencilRegistry.getBasenameForStencil(q[mxConstants.STYLE_SHAPE]));t.model.isEdge(c)&&+c.indexOf("PK"))this.importZipFile(l,mxUtils.bind(this,function(L){this.spinner.stop();H(L)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(c,f,t)}));else{if("image/png"==l.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==l.type){var N=Editor.extractGraphModelFromPdf(c);null!=N&&(q=null,t=!0,c=N)}this.spinner.stop();this.openLocalFile(c,f,t,q,null!=q?l:null,D)}}};EditorUi.prototype.openFiles=function(c,f){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var l=+0;l<c.length;l++)mxUtils.bind(this,function(t){var q=new FileReader;q.onload=mxUtils.bind(this,function(D){try{this.openFileHandle(D.target.result,t.name,t,f)}catch(H){this.handleError(H)}});q.onerror=mxUtils.bind(this,function(D){this.spinner.stop();this.handleError(D);window.openFile=null});"image"!==t.type.substring(0,5)&&"application/pdf"!==t.type||"image/svg"===t.type.substring(0,9)?q.readAsText(t):q.readAsDataURL(t)})(c[l])};EditorUi.prototype.openLocalFile=function(c,f,l,t,q,D){var H=this.getCurrentFile(),+N=mxUtils.bind(this,function(){window.openFile=null;if(null==f&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var L=mxUtils.parseXml(c);null!=L&&(this.editor.setGraphXml(L.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,c,f||this.defaultFilename,l,t,q,D))});if(null!=c&&0<c.length)null==H||!H.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=t)?N():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=t)&&null!=H&&H.isModified()?this.confirm(mxResources.get("allChangesLost"),+null,N,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(c,f),window.geOpenWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=H&&H.isModified()?this.confirm(mxResources.get("allChangesLost"),null,N,mxResources.get("cancel"),mxResources.get("discardChanges")):N()})));else throw Error(mxResources.get("notADiagramFile"));};EditorUi.prototype.getBasenames=function(){var c={};if(null!=this.pages)for(var f=+0;f<this.pages.length;f++)this.updatePageRoot(this.pages[f]),this.addBasenamesForCell(this.pages[f].root,c);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),c);f=[];for(var l in c)f.push(l);return f};EditorUi.prototype.addBasenamesForCell=function(c,f){function l(H){if(null!=H){var N=H.lastIndexOf(".");0<N&&(H=H.substring(N+1,H.length));null==f[H]&&(f[H]=!0)}}var t=this.editor.graph,q=t.getCellStyle(c);l(mxStencilRegistry.getBasenameForStencil(q[mxConstants.STYLE_SHAPE]));t.model.isEdge(c)&&(l(mxMarker.getPackageForType(q[mxConstants.STYLE_STARTARROW])),l(mxMarker.getPackageForType(q[mxConstants.STYLE_ENDARROW])));q=t.model.getChildCount(c);for(var D=0;D<q;D++)this.addBasenamesForCell(t.model.getChildAt(c,D),f)};EditorUi.prototype.setGraphEnabled=function(c){this.diagramContainer.style.visibility=c?"":"hidden";this.formatContainer.style.visibility=this.diagramContainer.style.visibility;this.sidebarContainer.style.display=c?"":"none";this.hsplit.style.display=this.sidebarContainer.style.display;this.editor.graph.setEnabled(c);null!=this.tabContainer&&(this.tabContainer.style.visibility=this.diagramContainer.style.visibility);c||this.hideWindows();this.editor.graph.sizeDidChange();this.resetScrollbars()};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);if((window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))){var c=!1;this.installMessageHandler(mxUtils.bind(this,function(f,l,t,q){c||(c=!0,this.spinner.stop(),-this.addEmbedButtons(),this.setGraphEnabled(!0));if(null==f||0==f.length)f=this.emptyDiagramXml;this.setCurrentFile(new EmbedFile(this,f,{}));this.mode=App.MODE_EMBED;this.setFileData(f);if(q)try{var D=this.editor.graph;D.setGridEnabled(!1);D.pageVisible=!1;var G=D.model.cells,N;for(N in G){var L=G[N];null!=L&&null!=L.style&&(L.style+=";sketch=1;"+(-1==L.style.indexOf("fontFamily=")||-1<L.style.indexOf("fontFamily=Helvetica;")?"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":+this.addEmbedButtons(),this.setGraphEnabled(!0));if(null==f||0==f.length)f=this.emptyDiagramXml;this.setCurrentFile(new EmbedFile(this,f,{}));this.mode=App.MODE_EMBED;this.setFileData(f);if(q)try{var D=this.editor.graph;D.setGridEnabled(!1);D.pageVisible=!1;var H=D.model.cells,N;for(N in H){var L=H[N];null!=L&&null!=L.style&&(L.style+=";sketch=1;"+(-1==L.style.indexOf("fontFamily=")||-1<L.style.indexOf("fontFamily=Helvetica;")?"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":""))}}catch(J){console.log(J)}this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog();this.chromelessResize&&this.chromelessResize();this.editor.undoManager.clear();this.editor.modified=null!=t?t:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))}};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(c,f){null!=c?this.spinner.spin(document.body,mxResources.get("loading"))&&c.getPublicUrl(mxUtils.bind(this,function(l){this.spinner.stop();f(l)})):f(null)};EditorUi.prototype.createLoadMessage=function(c){var f=this.editor.graph;return{event:c,pageVisible:f.pageVisible,translate:f.view.translate,bounds:f.getGraphBounds(),currentPage:this.getSelectedPageIndex(),scale:f.view.scale,page:f.view.getBackgroundPageBounds()}};EditorUi.prototype.sendEmbeddedSvgExport=function(c){try{var f=this.editor.graph;f.isEditing()&&f.stopEditing(!f.isInvokesStopCellEditing());var l=window.opener||window.parent;if(this.editor.modified){var t=f.background;if(null==t||t==mxConstants.NONE)t=this.embedExportBackground;this.getEmbeddedSvg(this.getFileData(!0,null,null,null,null,null,null,null,null,!1),f,null,!0,mxUtils.bind(this,function(q){l.postMessage(JSON.stringify({event:"export",point:this.embedExitPoint,@@ -3893,62 +3895,62 @@ exit:null!=c?!c:!0,data:Editor.createSvgDataUri(q)}),"*")}),null,null,!0,t,1,thiEditorUi.prototype.installMessageHandler=function(c){var f=null,l=!1,t=!1,q=null,D=mxUtils.bind(this,function(L,J){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified)))})):this.clearStatus()});this.editor.graph.model.addListener(mxEvent.CHANGE,D);mxEvent.addListener(window,"message",mxUtils.bind(this,function(L){if(L.source==(window.opener||window.parent)){var J=L.data,Y=null,ha=mxUtils.bind(this,function(pa){if(null!=pa&&"function"===typeof pa.charAt&&"<"!=pa.charAt(0))try{Editor.isPngDataUrl(pa)?pa=Editor.extractGraphModelFromPng(pa):"data:image/svg+xml;base64,"==pa.substring(0,26)?pa=atob(pa.substring(26)):"data:image/svg+xml;utf8,"==pa.substring(0,24)&&(pa=pa.substring(24)),null!=pa&&(""==pa.trim()?pa=null:"%"==pa.charAt(0)?pa=decodeURIComponent(pa):"<"!=pa.charAt(0)&&(pa=Graph.decompress(pa)))}catch(Ca){}return pa});if("json"==urlParams.proto){var ea=!1;try{J=JSON.parse(J),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[L],"data",[J])}catch(pa){J=null}try{if(null==J)return;if("dialog"==J.action){this.showError(null!=J.titleKey?mxResources.get(J.titleKey):J.title,null!=J.messageKey?mxResources.get(J.messageKey):mxUtils.htmlEntities(J.message),null!=J.buttonKey?mxResources.get(J.buttonKey):J.button);null!=J.modified&&(this.editor.modified=J.modified);return}if("layout"==J.action){this.executeLayouts(this.editor.graph.createLayouts(J.layouts));-return}if("prompt"==J.action){this.spinner.stop();var aa=new FilenameDialog(this,J.defaultValue||"",null!=J.okKey?mxResources.get(J.okKey):J.ok,function(pa){null!=pa?G.postMessage(JSON.stringify({event:"prompt",value:pa,message:J}),"*"):G.postMessage(JSON.stringify({event:"prompt-cancel",message:J}),"*")},null!=J.titleKey?mxResources.get(J.titleKey):J.title,null,null,null,null,function(){G.postMessage(JSON.stringify({event:"prompt-cancel",message:J}),"*")});this.showDialog(aa.container,300,80,!0,-!1);aa.init();return}if("draft"==J.action){var na=ha(J.xml);this.spinner.stop();aa=new DraftDialog(this,mxResources.get("draftFound",[J.name||this.defaultFilename]),na,mxUtils.bind(this,function(){this.hideDialog();G.postMessage(JSON.stringify({event:"draft",result:"edit",message:J}),"*")}),mxUtils.bind(this,function(){this.hideDialog();G.postMessage(JSON.stringify({event:"draft",result:"discard",message:J}),"*")}),J.editKey?mxResources.get(J.editKey):null,J.discardKey?mxResources.get(J.discardKey):-null,J.ignore?mxUtils.bind(this,function(){this.hideDialog();G.postMessage(JSON.stringify({event:"draft",result:"ignore",message:J}),"*")}):null);this.showDialog(aa.container,640,480,!0,!1,mxUtils.bind(this,function(pa){pa&&this.actions.get("exit").funct()}));try{aa.init()}catch(pa){G.postMessage(JSON.stringify({event:"draft",error:pa.toString(),message:J}),"*")}return}if("template"==J.action){this.spinner.stop();var W=1==J.enableRecent,ba=1==J.enableSearch,ja=1==J.enableCustomTemp;aa=new NewDialog(this,-!1,J.templatesOnly?!1:null!=J.callback,mxUtils.bind(this,function(pa,Ca,Aa,wa){pa=pa||this.emptyDiagramXml;null!=J.callback?G.postMessage(JSON.stringify({event:"template",xml:pa,blank:pa==this.emptyDiagramXml,name:Ca,tempUrl:Aa,libs:wa,builtIn:!0,message:J}),"*"):(c(pa,L,pa!=this.emptyDiagramXml,J.toSketch),this.editor.modified||this.clearStatus())}),null,null,null,null,null,null,null,W?mxUtils.bind(this,function(pa){this.remoteInvoke("getRecentDiagrams",[null],null,pa,function(){pa(null,"Network Error!")})}):-null,ba?mxUtils.bind(this,function(pa,Ca){this.remoteInvoke("searchDiagrams",[pa,null],null,Ca,function(){Ca(null,"Network Error!")})}):null,mxUtils.bind(this,function(pa,Ca,Aa){G.postMessage(JSON.stringify({event:"template",docUrl:pa,info:Ca,name:Aa}),"*")}),null,null,ja?mxUtils.bind(this,function(pa){this.remoteInvoke("getCustomTemplates",null,null,pa,function(){pa({},0)})}):null,1==J.withoutType);this.showDialog(aa.container,620,460,!0,!1,mxUtils.bind(this,function(pa){null!=this.sidebar&&this.sidebar.hideTooltip();-pa&&this.actions.get("exit").funct()}));aa.init();return}if("textContent"==J.action){var ca=this.getDiagramTextContent();G.postMessage(JSON.stringify({event:"textContent",data:ca,message:J}),"*");return}if("status"==J.action){this.updateStatus(mxUtils.bind(this,function(){null!=J.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(J.messageKey))):null!=J.message&&this.editor.setStatus(mxUtils.htmlEntities(J.message))}));null!=J.modified&&(this.editor.modified=J.modified);return}if("spinner"==+return}if("prompt"==J.action){this.spinner.stop();var aa=new FilenameDialog(this,J.defaultValue||"",null!=J.okKey?mxResources.get(J.okKey):J.ok,function(pa){null!=pa?H.postMessage(JSON.stringify({event:"prompt",value:pa,message:J}),"*"):H.postMessage(JSON.stringify({event:"prompt-cancel",message:J}),"*")},null!=J.titleKey?mxResources.get(J.titleKey):J.title,null,null,null,null,function(){H.postMessage(JSON.stringify({event:"prompt-cancel",message:J}),"*")});this.showDialog(aa.container,300,80,!0,+!1);aa.init();return}if("draft"==J.action){var na=ha(J.xml);this.spinner.stop();aa=new DraftDialog(this,mxResources.get("draftFound",[J.name||this.defaultFilename]),na,mxUtils.bind(this,function(){this.hideDialog();H.postMessage(JSON.stringify({event:"draft",result:"edit",message:J}),"*")}),mxUtils.bind(this,function(){this.hideDialog();H.postMessage(JSON.stringify({event:"draft",result:"discard",message:J}),"*")}),J.editKey?mxResources.get(J.editKey):null,J.discardKey?mxResources.get(J.discardKey):+null,J.ignore?mxUtils.bind(this,function(){this.hideDialog();H.postMessage(JSON.stringify({event:"draft",result:"ignore",message:J}),"*")}):null);this.showDialog(aa.container,640,480,!0,!1,mxUtils.bind(this,function(pa){pa&&this.actions.get("exit").funct()}));try{aa.init()}catch(pa){H.postMessage(JSON.stringify({event:"draft",error:pa.toString(),message:J}),"*")}return}if("template"==J.action){this.spinner.stop();var W=1==J.enableRecent,ba=1==J.enableSearch,ja=1==J.enableCustomTemp;aa=new NewDialog(this,+!1,J.templatesOnly?!1:null!=J.callback,mxUtils.bind(this,function(pa,Ca,Aa,wa){pa=pa||this.emptyDiagramXml;null!=J.callback?H.postMessage(JSON.stringify({event:"template",xml:pa,blank:pa==this.emptyDiagramXml,name:Ca,tempUrl:Aa,libs:wa,builtIn:!0,message:J}),"*"):(c(pa,L,pa!=this.emptyDiagramXml,J.toSketch),this.editor.modified||this.clearStatus())}),null,null,null,null,null,null,null,W?mxUtils.bind(this,function(pa){this.remoteInvoke("getRecentDiagrams",[null],null,pa,function(){pa(null,"Network Error!")})}):+null,ba?mxUtils.bind(this,function(pa,Ca){this.remoteInvoke("searchDiagrams",[pa,null],null,Ca,function(){Ca(null,"Network Error!")})}):null,mxUtils.bind(this,function(pa,Ca,Aa){H.postMessage(JSON.stringify({event:"template",docUrl:pa,info:Ca,name:Aa}),"*")}),null,null,ja?mxUtils.bind(this,function(pa){this.remoteInvoke("getCustomTemplates",null,null,pa,function(){pa({},0)})}):null,1==J.withoutType);this.showDialog(aa.container,620,460,!0,!1,mxUtils.bind(this,function(pa){null!=this.sidebar&&this.sidebar.hideTooltip();+pa&&this.actions.get("exit").funct()}));aa.init();return}if("textContent"==J.action){var ca=this.getDiagramTextContent();H.postMessage(JSON.stringify({event:"textContent",data:ca,message:J}),"*");return}if("status"==J.action){this.updateStatus(mxUtils.bind(this,function(){null!=J.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(J.messageKey))):null!=J.message&&this.editor.setStatus(mxUtils.htmlEntities(J.message))}));null!=J.modified&&(this.editor.modified=J.modified);return}if("spinner"==J.action){var la=null!=J.messageKey?mxResources.get(J.messageKey):J.message;null==J.show||J.show?this.spinner.spin(document.body,la):this.spinner.stop();return}if("exit"==J.action){this.actions.get("exit").funct();return}if("viewport"==J.action){if(null!=J.viewport){var Q=this.editor.graph,k=Q.view.translate.x,B=Q.view.translate.y;this.embedViewport=J.viewport;Q.refresh();this.diagramContainer.scrollTop-=(B-Q.view.translate.y)*Q.view.scale;this.diagramContainer.scrollLeft-=(k-Q.view.translate.x)*Q.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("fullscreenChanged"==J.action){aa=null;try{var I=this.diagramContainer.getAttribute("data-scrollState");null!=I&&(this.diagramContainer.removeAttribute("data-scrollState"),aa=JSON.parse(I))}catch(pa){}Editor.inlineFullscreen=J.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=aa&&this.restoreScrollState(aa);return}if("snapshot"==J.action){this.sendEmbeddedSvgExport(!0);return}if("export"==J.action){if("png"==J.format||"xmlpng"==J.format){if(null==J.spin&&null==J.spinKey||this.spinner.spin(document.body,null!=J.spinKey?mxResources.get(J.spinKey):J.spin)){var U=null!=J.xml?J.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);Q=this.editor.graph;var P=mxUtils.bind(this,function(pa,Ca){if(J.withSvg)J.withSvg=!1,this.getEmbeddedSvg(U,this.editor.graph,null,!0,function(wa){P(pa,wa)},null,null,J.embedImages,this.editor.graph.background,J.scale,J.border,J.shadow,"auto");else{this.editor.graph.setEnabled(!0);-this.spinner.stop();var Aa=this.createLoadMessage("export");Aa.format=J.format;Aa.message=J;Aa.data=pa;Aa.svg=Ca;Aa.xml=U;G.postMessage(JSON.stringify(Aa),"*")}}),T=mxUtils.bind(this,function(pa){null==pa&&(pa=Editor.blankImage);"xmlpng"==J.format&&(pa=Editor.writeGraphModelToPng(pa,"tEXt","mxfile",encodeURIComponent(U)));Q!=this.editor.graph&&Q.container.parentNode.removeChild(Q.container);P(pa)}),X=J.pageId||(null!=this.pages?J.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.isExportToCanvas()){var Z=+this.spinner.stop();var Aa=this.createLoadMessage("export");Aa.format=J.format;Aa.message=J;Aa.data=pa;Aa.svg=Ca;Aa.xml=U;H.postMessage(JSON.stringify(Aa),"*")}}),T=mxUtils.bind(this,function(pa){null==pa&&(pa=Editor.blankImage);"xmlpng"==J.format&&(pa=Editor.writeGraphModelToPng(pa,"tEXt","mxfile",encodeURIComponent(U)));Q!=this.editor.graph&&Q.container.parentNode.removeChild(Q.container);P(pa)}),X=J.pageId||(null!=this.pages?J.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.isExportToCanvas()){var Z=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=X){var pa=Q.getGlobalVariable;Q=this.createTemporaryGraph(Q.getStylesheet());for(var Ca,Aa=0;Aa<this.pages.length;Aa++)if(this.pages[Aa].getId()==X){Ca=this.updatePageRoot(this.pages[Aa]);break}null==Ca&&(Ca=this.currentPage);Q.getGlobalVariable=function(Ra){return"page"==Ra?Ca.getName():"pagenumber"==Ra?1:pa.apply(this,arguments)};document.body.appendChild(Q.container);Q.model.setRoot(Ca.root)}if(null!=J.layerIds){var wa=Q.model,Ya=wa.getChildCells(wa.getRoot()),Qa={};for(Aa=0;Aa<J.layerIds.length;Aa++)Qa[J.layerIds[Aa]]=!0;for(Aa=0;Aa<Ya.length;Aa++)wa.setVisible(Ya[Aa],Qa[Ya[Aa].id]||!1)}Aa=null;J.keepTheme&&(Aa=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,function(Ra){T(Ra.toDataURL("image/png"))}),J.width,null,J.background,mxUtils.bind(this,function(){T(null)}),null,null,J.scale,J.transparent,J.shadow,null,Q,J.border,null,J.grid,Aa)});null!=J.xml&&0<J.xml.length&&(l=!0,this.setFileData(U),l=!1);Z()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==J.format?"1":"0")+(null!=X?"&pageId="+X:"")+(null!=J.layerIds&&0<J.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:J.layerIds})):"")+(null!=J.scale?"&scale="+J.scale:"")+"&base64=1&xml="+encodeURIComponent(U))).send(mxUtils.bind(this,function(pa){200<=pa.getStatus()&&299>=pa.getStatus()?P("data:image/png;base64,"+pa.getText()):T(null)}),mxUtils.bind(this,function(){T(null)}))}}else if(Z=mxUtils.bind(this,function(){var pa=this.createLoadMessage("export");pa.message=J;if("html2"==J.format||"html"==J.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var Ca=this.getXmlFileData();pa.xml=mxUtils.getXml(Ca);pa.data=this.getFileData(null,null,!0,null,null,null,Ca);pa.format=J.format}else if("html"==J.format)Ca=this.editor.getGraphXml(),pa.data=this.getHtml(Ca,this.editor.graph),pa.xml=mxUtils.getXml(Ca),pa.format=J.format;else{mxSvgCanvas2D.prototype.foAltText=null;Ca=null!=J.background?-J.background:this.editor.graph.background;Ca==mxConstants.NONE&&(Ca=null);pa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);pa.format="svg";var Aa=mxUtils.bind(this,function(Ya){this.editor.graph.setEnabled(!0);this.spinner.stop();pa.data=Editor.createSvgDataUri(Ya);G.postMessage(JSON.stringify(pa),"*")}),wa="auto";J.keepTheme&&(wa=Editor.isDarkMode()?"dark":"light");null!=J.theme&&(wa=J.theme);if("xmlsvg"==J.format){if(null==J.spin&&null==J.spinKey||this.spinner.spin(document.body,+J.background:this.editor.graph.background;Ca==mxConstants.NONE&&(Ca=null);pa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);pa.format="svg";var Aa=mxUtils.bind(this,function(Ya){this.editor.graph.setEnabled(!0);this.spinner.stop();pa.data=Editor.createSvgDataUri(Ya);H.postMessage(JSON.stringify(pa),"*")}),wa="auto";J.keepTheme&&(wa=Editor.isDarkMode()?"dark":"light");null!=J.theme&&(wa=J.theme);if("xmlsvg"==J.format){if(null==J.spin&&null==J.spinKey||this.spinner.spin(document.body,null!=J.spinKey?mxResources.get(J.spinKey):J.spin)){wa=null;if(this.isAutoDarkMode()||Editor.isDarkMode())wa="auto";null!=J.theme&&(wa=J.theme);this.getEmbeddedSvg(pa.xml,this.editor.graph,null,!0,Aa,null,null,J.embedImages,Ca,J.scale,J.border,J.shadow,wa)}}else if(null==J.spin&&null==J.spinKey||this.spinner.spin(document.body,null!=J.spinKey?mxResources.get(J.spinKey):J.spin))this.editor.graph.setEnabled(!1),Ca=this.editor.graph.getSvg(Ca,J.scale,J.border,null,null,null,null,null,null,this.editor.graph.shadowVisible||-J.shadow,null,wa),(this.editor.graph.shadowVisible||J.shadow)&&this.editor.graph.addSvgShadow(Ca),this.embedFonts(Ca,mxUtils.bind(this,function(Ya){J.embedImages||null==J.embedImages?this.editor.convertImages(Ya,mxUtils.bind(this,function(Qa){Aa(mxUtils.getXml(Qa))})):Aa(mxUtils.getXml(Ya))}));return}G.postMessage(JSON.stringify(pa),"*")}),null!=J.xml&&0<J.xml.length){if(this.editor.graph.mathEnabled){var ka=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){ka.apply(this,arguments);Z()}}l=!0;this.setFileData(J.xml);+J.shadow,null,wa),(this.editor.graph.shadowVisible||J.shadow)&&this.editor.graph.addSvgShadow(Ca),this.embedFonts(Ca,mxUtils.bind(this,function(Ya){J.embedImages||null==J.embedImages?this.editor.convertImages(Ya,mxUtils.bind(this,function(Qa){Aa(mxUtils.getXml(Qa))})):Aa(mxUtils.getXml(Ya))}));return}H.postMessage(JSON.stringify(pa),"*")}),null!=J.xml&&0<J.xml.length){if(this.editor.graph.mathEnabled){var ka=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){ka.apply(this,arguments);Z()}}l=!0;this.setFileData(J.xml);l=!1;this.editor.graph.mathEnabled||Z()}else Z();return}if("load"==J.action){ea=J.toSketch;t=1==J.autosave;this.hideDialog();null!=J.modified&&null==urlParams.modified&&(urlParams.modified=J.modified);null!=J.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=J.saveAndExit);if("1"==urlParams.saveAndExit||"1"==urlParams.publishClose)if(this.actions.get("save").shortcut=null,!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(83,!0,"saveAndExit"),"1"!=urlParams.noSaveBtn&&(this.actions.get("save").shortcut=Editor.ctrlKey+"+Shift+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=J.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=J.noSaveBtn);if(null!=J.rough){var va=Editor.sketchMode;this.doSetSketchMode(J.rough);va!=Editor.sketchMode&&this.fireEvent(new mxEventObject("sketchModeChanged"))}null!=J.dark&&this.setDarkMode(J.dark);null!=J.border&&(this.embedExportBorder=J.border);null!=J.theme&&(this.embedExportTheme=J.theme);null!=J.background&&(this.embedExportBackground=J.background);null!=J.viewport&&(this.embedViewport=J.viewport);this.embedExitPoint=null;if(null!=J.rect){var ua=this.embedExportBorder;this.diagramContainer.style.left=Math.max(60,J.rect.left)+"px";this.diagramContainer.style.top=Math.max(40,J.rect.top)+"px";this.minInlineWidth=J.minWidth;this.minInlineHeight=J.minHeight;this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";var qa=J.maxFitScale,Ba=J.rect.width+2*ua,ya=J.rect.height+2*ua;Y=mxUtils.bind(this,function(){var pa=mxUtils.getDocumentSize();Ba=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,Ba):Ba,pa.width-80);pa=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,ya):ya,pa.height-80);this.diagramContainer.style.width=Ba+"px";this.diagramContainer.style.height=pa+"px";var Ca=this.editor.graph;pa=Ca.maxFitScale;Ca.maxFitScale=qa;Ca.fit(2*ua,null,null,null,null,null,ya);this.setPageVisible(!1);if(null!=this.minInlineWidth&&Ca.getGraphBounds().width<this.minInlineWidth){var Aa=Ca.container.scrollTop;this.resetScrollbars();Ca.container.scrollTop=Aa}Ca.maxFitScale=pa;Ca.container.scrollTop-=ua;Ca.container.scrollLeft-=ua;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[J]));Ca.container.focus();null!=this.formatWindow&&null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=Ca.container.style.top);var wa=Ca.getGraphBounds();Ca.container.clientWidth>-wa.width+2*ua&&(Ca.container.scrollLeft=wa.x+(wa.width+ua-Ca.container.clientWidth)/2)}),10)})}null!=J.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=J.noExitBtn);null!=J.title&&null!=this.buttonContainer&&(na=this.createStatusDiv(J.title),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?this.menubarContainer.appendChild(na):this.buttonContainer.appendChild(na),this.embedFilenameSpan=-na);try{J.libs&&this.sidebar.showEntries(J.libs)}catch(pa){}J=null!=J.xmlpng?this.extractGraphModelFromPng(J.xmlpng):null!=J.descriptor?J.descriptor:J.xml}else{if("merge"==J.action){var La=this.getCurrentFile();null!=La&&(na=ha(J.xml),null!=na&&""!=na&&La.mergeFile(new LocalFile(this,na),function(){G.postMessage(JSON.stringify({event:"merge",message:J}),"*")},function(pa){G.postMessage(JSON.stringify({event:"merge",message:J,error:pa}),"*")}))}else"remoteInvokeReady"==J.action?this.handleRemoteInvokeReady(G):-"remoteInvoke"==J.action?this.handleRemoteInvoke(J,L.origin):"remoteInvokeResponse"==J.action?this.handleRemoteInvokeResponse(J):G.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(J)}),"*");return}}catch(pa){this.handleError(pa)}}var za=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),Ea=mxUtils.bind(this,function(pa,Ca){l=!0;try{c(pa,Ca,null,ea)}catch(Aa){this.handleError(Aa)}l=-!1;null!=urlParams.modified&&this.clearStatus();q=za();t&&null==f&&(f=mxUtils.bind(this,function(Aa,wa){Aa=za();Aa==q||l||(wa=this.createLoadMessage("autosave"),wa.xml=Aa,(window.opener||window.parent).postMessage(JSON.stringify(wa),"*"));q=Aa}),this.editor.graph.model.addListener(mxEvent.CHANGE,f),this.editor.graph.addListener("gridSizeChanged",f),this.editor.graph.addListener("shadowVisibleChanged",f),this.addListener("pageFormatChanged",f),this.addListener("pageScaleChanged",f),this.addListener("backgroundColorChanged",-f),this.addListener("backgroundImageChanged",f),this.addListener("foldingEnabledChanged",f),this.addListener("mathEnabledChanged",f),this.addListener("gridEnabledChanged",f),this.addListener("guidesEnabledChanged",f),this.addListener("pageViewChanged",f));if("1"==urlParams.returnbounds||"json"==urlParams.proto)Ca=this.createLoadMessage("load"),Ca.xml=pa,G.postMessage(JSON.stringify(Ca),"*");null!=Y&&Y()});null!=J&&"function"===typeof J.substring&&"data:application/vnd.visio;base64,"==J.substring(0,-34)?(ha="0M8R4KGxGuE"==J.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(J.substring(J.indexOf(",")+1)),function(pa){Ea(pa,L)},mxUtils.bind(this,function(pa){this.handleError(pa)}),ha)):null!=J&&"function"===typeof J.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(J,"")?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(J,mxUtils.bind(this,function(pa){4==pa.readyState&&(200<=pa.status&&299>=pa.status&&-"<mxGraphModel"==pa.responseText.substring(0,13)?Ea(pa.responseText,L):this.handleError({message:413==pa.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")}))}),""):null!=J&&"function"===typeof J.substring&&this.isLucidChartData(J)?this.convertLucidChart(J,mxUtils.bind(this,function(pa){Ea(pa)}),mxUtils.bind(this,function(pa){this.handleError(pa)})):null==J||"object"!==typeof J||null==J.format||null==J.data&&null==J.url?(J=ha(J),Ea(J,L)):this.loadDescriptor(J,mxUtils.bind(this,-function(pa){Ea(za(),L)}),mxUtils.bind(this,function(pa){this.handleError(pa,mxResources.get("errorLoadingFile"))}))}}));var G=window.opener||window.parent;D="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";G.postMessage(D,"*");if("json"==urlParams.proto){var N=this.editor.graph.openLink;this.editor.graph.openLink=function(L,J,Y){N.apply(this,arguments);G.postMessage(JSON.stringify({event:"openLink",href:L,target:J,allowOpener:Y}),"*")}}};EditorUi.prototype.createEmbedButton=-function(c,f,l,t){var q=document.createElement("button");q.className="geEmbedBtn geBtn";q.setAttribute("title",c+(null!=l?" ("+l+")":""));mxUtils.write(q,c);t&&q.classList.add("gePrimaryBtn");mxEvent.addListener(q,"click",f);return q};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,function(){var c=null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode==this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);-"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+Shift+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&-this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct))}))};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,-mxUtils.bind(this,function(c){this.importCsv(c)}),null,null,620,430,null,!0,!0,mxResources.get("import"),this.isOffline()?null:"https://drawio-app.com/import-from-csv-to-drawio/"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,function(){var f=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(l){if(0<l.length)try{var t=-JSON.parse(l);this.executeLayouts(this.editor.graph.createLayouts(t));this.customLayoutConfig=t;this.hideDialog()}catch(q){this.handleError(q)}}),null,null,null,null,mxUtils.bind(this,function(l,t){var q=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var D=t.value;t.value=JSON.stringify(JSON.parse(D));t.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?t.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));-t.value=D}catch(G){this.handleError(G)}}));q.setAttribute("title","copy");q.className="geBtn";l.appendChild(q)}),!0,null,null,"https://www.drawio.com/doc/faq/apply-layouts");this.showDialog(f.container,620,460,!0,!0);f.init()}))};EditorUi.prototype.loadOrgChartLayouts=function(c){this.createTimeout(null,mxUtils.bind(this,function(f){var l=mxUtils.bind(this,function(){this.loadingOrgChart=!1;f.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),t=mxUtils.bind(this,function(q){this.loadingOrgChart=-!1;f.clear()&&this.handleError(q)});"undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0)?l():this.spinner.spin(document.body,mxResources.get("loading"))&&(this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",l,null,null,null,t)},null,null,null,t)},null,null,null,t)},null,null,-null,t):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",l,null,null,null,t))}),onerror)};EditorUi.prototype.importCsv=function(c,f){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,f)}))};EditorUi.prototype.doImportCsv=function(c,f){try{var l=c.split("\n"),t=[],q=[],D=[],G={};if(0<l.length){var N={},L=this.editor.graph,J=null,Y=null,ha=null,ea=null,aa=null,na=null,W=null,ba="whiteSpace=wrap;html=1;",ja=null,ca=null,la="",Q="auto",k="auto",B=!1,I=null,U=null,P=40,T=40,-X=100,Z=0,ka=mxUtils.bind(this,function(){null!=f?f(ra):(L.setSelectionCells(ra),L.scrollCellToVisible(L.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),va=L.getFreeInsertPoint(),ua=va.x,qa=va.y;va=qa;var Ba=null,ya="auto";ca=null;for(var La=[],za=null,Ea=null,pa=0;pa<l.length&&"#"==l[pa].charAt(0);){c=l[pa].replace(/\r$/,"");for(pa++;pa<l.length&&"\\"==c.charAt(c.length-1)&&"#"==l[pa].charAt(0);)c=c.substring(0,c.length--1)+mxUtils.trim(l[pa].substring(1)),pa++;if("#"!=c.charAt(1)){var Ca=c.indexOf(":");if(0<Ca){var Aa=mxUtils.trim(c.substring(1,Ca)),wa=mxUtils.trim(c.substring(Ca+1));"label"==Aa?Ba=Graph.sanitizeHtml(wa):"labelname"==Aa&&0<wa.length&&"-"!=wa?aa=wa:"labels"==Aa&&0<wa.length&&"-"!=wa?W=JSON.parse(wa):"style"==Aa?Y=wa:"parentstyle"==Aa?ba=wa:"unknownStyle"==Aa&&"-"!=wa?na=wa:"stylename"==Aa&&0<wa.length&&"-"!=wa?ea=wa:"styles"==Aa&&0<wa.length&&"-"!=wa?ha=JSON.parse(wa):"vars"==Aa&&0<wa.length&&"-"!=-wa?J=JSON.parse(wa):"identity"==Aa&&0<wa.length&&"-"!=wa?ja=wa:"parent"==Aa&&0<wa.length&&"-"!=wa?ca=wa:"namespace"==Aa&&0<wa.length&&"-"!=wa?la=wa:"width"==Aa?Q=wa:"height"==Aa?k=wa:"collapsed"==Aa&&"-"!=wa?B="true"==wa:"left"==Aa&&0<wa.length?I=wa:"top"==Aa&&0<wa.length?U=wa:"ignore"==Aa?Ea=wa.split(","):"connect"==Aa?La.push(JSON.parse(wa)):"link"==Aa?za=wa:"padding"==Aa?Z=parseFloat(wa):"edgespacing"==Aa?P=parseFloat(wa):"nodespacing"==Aa?T=parseFloat(wa):"levelspacing"==Aa?X=parseFloat(wa):"layout"==-Aa&&(ya=wa)}}}if(null==l[pa])throw Error(mxResources.get("invalidOrMissingFile"));var Ya=this.editor.csvToArray(l[pa].replace(/\r$/,""));Ca=c=null;Aa=[];for(wa=0;wa<Ya.length;wa++)ja==Ya[wa]&&(c=wa),ca==Ya[wa]&&(Ca=wa),Aa.push(mxUtils.trim(Ya[wa]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==Ba&&(Ba="%"+Aa[0]+"%");if(null!=La)for(var Qa=0;Qa<La.length;Qa++)null==N[La[Qa].to]&&(N[La[Qa].to]={});ja=[];for(wa=pa+1;wa<l.length;wa++){var Ra=this.editor.csvToArray(l[wa].replace(/\r$/,-""));if(null==Ra){var Sa=40<l[wa].length?l[wa].substring(0,40)+"...":l[wa];throw Error(Sa+" ("+wa+"):\n"+mxResources.get("containsValidationErrors"));}0<Ra.length&&ja.push(Ra)}L.model.beginUpdate();try{for(wa=0;wa<ja.length;wa++){Ra=ja[wa];var Ha=null,Ma=null!=c?la+Ra[c]:null;l=!1;null!=Ma&&(Ha=L.model.getCell(Ma),l=null==Ha||0<=mxUtils.indexOf(t,Ha));var y=new mxCell(Ba,new mxGeometry(ua,va,0,0),Y||"whiteSpace=wrap;html=1;");y.collapsed=B;y.vertex=!0;y.id=Ma;null==Ha||l||L.model.setCollapsed(Ha,-B);for(var O=0;O<Ra.length;O++)L.setAttributeForCell(y,Aa[O],Ra[O]),null==Ha||l||L.setAttributeForCell(Ha,Aa[O],Ra[O]);if(null!=aa&&null!=W){var R=W[y.getAttribute(aa)];null!=R&&(L.labelChanged(y,R),null==Ha||l||L.cellLabelChanged(Ha,R))}if(null!=ea&&null!=ha){var V=ha[y.getAttribute(ea)];null!=V&&(y.style=V)}L.setAttributeForCell(y,"placeholders","1");y.style=L.replacePlaceholders(y,y.style,J);null==Ha||l?L.fireEvent(new mxEventObject("cellsInserted","cells",[y])):(L.model.setStyle(Ha,y.style),0>-mxUtils.indexOf(D,Ha)&&D.push(Ha),L.fireEvent(new mxEventObject("cellsInserted","cells",[Ha])));l=null!=Ha;Ha=y;if(!l)for(Qa=0;Qa<La.length;Qa++)N[La[Qa].to][Ha.getAttribute(La[Qa].to)]=Ha;null!=za&&"link"!=za&&(L.setLinkForCell(Ha,Ha.getAttribute(za)),L.setAttributeForCell(Ha,za,null));var fa=this.editor.graph.getPreferredSizeForCell(Ha);ca=null!=Ca?L.model.getCell(la+Ra[Ca]):null;if(Ha.vertex){Sa=null!=ca?0:ua;pa=null!=ca?0:qa;null!=I&&null!=Ha.getAttribute(I)&&(Ha.geometry.x=Sa+parseFloat(Ha.getAttribute(I)));-null!=U&&null!=Ha.getAttribute(U)&&(Ha.geometry.y=pa+parseFloat(Ha.getAttribute(U)));var ia="@"==Q.charAt(0)?Ha.getAttribute(Q.substring(1)):null;Ha.geometry.width=null!=ia&&"auto"!=ia?parseFloat(Ha.getAttribute(Q.substring(1))):"auto"==Q||"auto"==ia?fa.width+Z:parseFloat(Q);var oa="@"==k.charAt(0)?Ha.getAttribute(k.substring(1)):null;Ha.geometry.height=null!=oa&&"auto"!=oa&&"width"!=k?parseFloat(oa):"auto"==k||"auto"==oa?fa.height+Z:"width"==k?Ha.geometry.width:parseFloat(k);va+=Ha.geometry.height+-T}l?(null==G[Ma]&&(G[Ma]=[]),G[Ma].push(Ha)):(t.push(Ha),null!=ca?(ca.style=L.replacePlaceholders(ca,ba,J),L.addCell(Ha,ca),q.push(ca)):D.push(L.addCell(Ha)))}for(wa=0;wa<q.length;wa++)ia="@"==Q.charAt(0)?q[wa].getAttribute(Q.substring(1)):null,oa="@"==k.charAt(0)?q[wa].getAttribute(k.substring(1)):null,"auto"!=Q&&"auto"!=ia||"auto"!=k&&"auto"!=oa||L.updateGroupBounds([q[wa]],Z,!0);var ta=D.slice(),ra=D.slice();for(Qa=0;Qa<La.length;Qa++){var xa=La[Qa];for(wa=0;wa<t.length;wa++){Ha=t[wa];var Da=mxUtils.bind(this,-function(kb,pb,fb){var ob=pb.getAttribute(fb.from);if(null!=ob&&""!=ob){ob=ob.split(",");for(var tb=0;tb<ob.length;tb++){var eb=N[fb.to][ob[tb]];if(null==eb&&null!=na){eb=new mxCell(ob[tb],new mxGeometry(ua,qa,0,0),na);eb.style=L.replacePlaceholders(pb,eb.style,J);var nb=this.editor.graph.getPreferredSizeForCell(eb);eb.geometry.width=nb.width+Z;eb.geometry.height=nb.height+Z;N[fb.to][ob[tb]]=eb;eb.vertex=!0;eb.id=ob[tb];D.push(L.addCell(eb))}if(null!=eb){nb=fb.label;null!=fb.fromlabel&&(nb=(pb.getAttribute(fb.fromlabel)||-"")+(nb||""));null!=fb.sourcelabel&&(nb=L.replacePlaceholders(pb,fb.sourcelabel,J)+(nb||""));null!=fb.tolabel&&(nb=(nb||"")+(eb.getAttribute(fb.tolabel)||""));null!=fb.targetlabel&&(nb=(nb||"")+L.replacePlaceholders(eb,fb.targetlabel,J));var mb="target"==fb.placeholders==!fb.invert?eb:kb;mb=null!=fb.style?L.replacePlaceholders(mb,fb.style,J):L.createCurrentEdgeStyle();nb=L.insertEdge(null,null,nb||"",fb.invert?eb:kb,fb.invert?kb:eb,mb);if(null!=fb.labels)for(mb=0;mb<fb.labels.length;mb++){var qb=-fb.labels[mb],ub=new mxCell(qb.label||mb,new mxGeometry(null!=qb.x?qb.x:0,null!=qb.y?qb.y:0,0,0),"resizable=0;html=1;");ub.vertex=!0;ub.connectable=!1;ub.geometry.relative=!0;null!=qb.placeholders&&(ub.value=L.replacePlaceholders("target"==qb.placeholders==!fb.invert?eb:kb,ub.value,J));if(null!=qb.dx||null!=qb.dy)ub.geometry.offset=new mxPoint(null!=qb.dx?qb.dx:0,null!=qb.dy?qb.dy:0);nb.insert(ub)}if(null!=fb.data)for(var zb in fb.data)L.setAttributeForCell(nb,zb,fb.data[zb]);ra.push(nb);mxUtils.remove(fb.invert?-kb:eb,ta)}}}});Da(Ha,Ha,xa);if(null!=G[Ha.id])for(O=0;O<G[Ha.id].length;O++)Da(Ha,G[Ha.id][O],xa)}}if(null!=Ea)for(wa=0;wa<t.length;wa++)for(Ha=t[wa],O=0;O<Ea.length;O++)L.setAttributeForCell(Ha,mxUtils.trim(Ea[O]),null);if(0<D.length){var Ia=new mxParallelEdgeLayout(L);Ia.spacing=P;Ia.checkOverlap=!0;var Xa=function(){0<Ia.spacing&&Ia.execute(L.getDefaultParent());for(var kb=0;kb<D.length;kb++){var pb=L.getCellGeometry(D[kb]);pb.x=Math.round(L.snap(pb.x));pb.y=Math.round(L.snap(pb.y));"auto"==Q&&-(pb.width=Math.round(L.snap(pb.width)));"auto"==k&&(pb.height=Math.round(L.snap(pb.height)))}};if("["==ya.charAt(0)){var Za=ka;L.view.validate();this.executeLayouts(L.createLayouts(JSON.parse(ya)),function(){Xa();Za()});ka=null}else if("circle"==ya){var $a=new mxCircleLayout(L);$a.disableEdgeStyle=!1;$a.resetEdges=!1;var Pa=$a.isVertexIgnored;$a.isVertexIgnored=function(kb){return Pa.apply(this,arguments)||0>mxUtils.indexOf(D,kb)};this.executeLayout(function(){$a.execute(L.getDefaultParent());Xa()},-!0,ka);ka=null}else if("horizontaltree"==ya||"verticaltree"==ya||"auto"==ya&&ra.length==2*D.length-1&&1==ta.length){L.view.validate();var Na=new mxCompactTreeLayout(L,"horizontaltree"==ya);Na.levelDistance=T;Na.edgeRouting=!1;Na.resetEdges=!1;Na.sortEdges=!0;this.executeLayout(function(){Na.execute(L.getDefaultParent(),0<ta.length?ta[0]:null)},!0,ka);ka=null}else if("horizontalflow"==ya||"verticalflow"==ya||"auto"==ya&&1==ta.length){L.view.validate();var jb=new mxHierarchicalLayout(L,"horizontalflow"==-ya?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);jb.intraCellSpacing=T;jb.parallelEdgeSpacing=P;jb.interRankCellSpacing=X;jb.disableEdgeStyle=!1;this.executeLayout(function(){jb.execute(L.getDefaultParent(),ra);L.moveCells(ra,ua,qa)},!0,ka);ka=null}else if("orgchart"==ya){L.view.validate();var cb=new mxOrgChartLayout(L,2,X,T),ab=cb.isVertexIgnored;cb.isVertexIgnored=function(kb){return ab.apply(this,arguments)||0>mxUtils.indexOf(D,kb)};this.executeLayout(function(){cb.execute(L.getDefaultParent());-Xa()},!0,ka);ka=null}else if("organic"==ya||"auto"==ya&&ra.length>D.length){L.view.validate();var db=new mxFastOrganicLayout(L);db.forceConstant=3*T;db.disableEdgeStyle=!1;db.resetEdges=!1;var lb=db.isVertexIgnored;db.isVertexIgnored=function(kb){return lb.apply(this,arguments)||0>mxUtils.indexOf(D,kb)};this.executeLayout(function(){db.execute(L.getDefaultParent());Xa()},!0,ka);ka=null}}this.hideDialog()}finally{L.model.endUpdate()}null!=ka&&ka()}}catch(kb){this.handleError(kb)}};EditorUi.prototype.getSearch=-function(c){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var l="?",t;for(t in urlParams)0>mxUtils.indexOf(c,t)&&null!=urlParams[t]&&(f+=l+t+"="+urlParams[t],l="&")}else f=window.location.search;return f};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var f=0<c.indexOf("?")?1:0;if("1"==urlParams.offline)c+=window.location.search;else{var l="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),+wa.width+2*ua&&(Ca.container.scrollLeft=wa.x+(wa.width+ua-Ca.container.clientWidth)/2)}),10)})}null!=J.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=J.noExitBtn);null!=J.title&&null!=this.buttonContainer&&this.setEmbedTitle(J.title);try{J.libs&&this.sidebar.showEntries(J.libs)}catch(pa){}J=null!=J.xmlpng?this.extractGraphModelFromPng(J.xmlpng):null!=J.descriptor?J.descriptor:J.xml}else{if("merge"==J.action){var La=this.getCurrentFile();null!=La&&(na=ha(J.xml),null!=na&&""!=na&&La.mergeFile(new LocalFile(this,+na),function(){H.postMessage(JSON.stringify({event:"merge",message:J}),"*")},function(pa){H.postMessage(JSON.stringify({event:"merge",message:J,error:pa}),"*")}))}else"remoteInvokeReady"==J.action?this.handleRemoteInvokeReady(H):"remoteInvoke"==J.action?this.handleRemoteInvoke(J,L.origin):"remoteInvokeResponse"==J.action?this.handleRemoteInvokeResponse(J):H.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(J)}),"*");return}}catch(pa){this.handleError(pa)}}var za=mxUtils.bind(this,+function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),Ea=mxUtils.bind(this,function(pa,Ca){l=!0;try{c(pa,Ca,null,ea)}catch(Aa){this.handleError(Aa)}l=!1;null!=urlParams.modified&&this.clearStatus();q=za();t&&null==f&&(f=mxUtils.bind(this,function(Aa,wa){Aa=za();Aa==q||l||(wa=this.createLoadMessage("autosave"),wa.xml=Aa,(window.opener||window.parent).postMessage(JSON.stringify(wa),"*"));q=Aa}),this.editor.graph.model.addListener(mxEvent.CHANGE,+f),this.editor.graph.addListener("gridSizeChanged",f),this.editor.graph.addListener("shadowVisibleChanged",f),this.addListener("pageFormatChanged",f),this.addListener("pageScaleChanged",f),this.addListener("backgroundColorChanged",f),this.addListener("backgroundImageChanged",f),this.addListener("foldingEnabledChanged",f),this.addListener("mathEnabledChanged",f),this.addListener("gridEnabledChanged",f),this.addListener("guidesEnabledChanged",f),this.addListener("pageViewChanged",f));if("1"==urlParams.returnbounds||+"json"==urlParams.proto)Ca=this.createLoadMessage("load"),Ca.xml=pa,H.postMessage(JSON.stringify(Ca),"*");null!=Y&&Y()});null!=J&&"function"===typeof J.substring&&"data:application/vnd.visio;base64,"==J.substring(0,34)?(ha="0M8R4KGxGuE"==J.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(J.substring(J.indexOf(",")+1)),function(pa){Ea(pa,L)},mxUtils.bind(this,function(pa){this.handleError(pa)}),ha)):null!=J&&"function"===typeof J.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(J,+"")?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(J,mxUtils.bind(this,function(pa){4==pa.readyState&&(200<=pa.status&&299>=pa.status&&"<mxGraphModel"==pa.responseText.substring(0,13)?Ea(pa.responseText,L):this.handleError({message:413==pa.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")}))}),""):null!=J&&"function"===typeof J.substring&&this.isLucidChartData(J)?this.convertLucidChart(J,mxUtils.bind(this,function(pa){Ea(pa)}),+mxUtils.bind(this,function(pa){this.handleError(pa)})):null==J||"object"!==typeof J||null==J.format||null==J.data&&null==J.url?(J=ha(J),Ea(J,L)):this.loadDescriptor(J,mxUtils.bind(this,function(pa){Ea(za(),L)}),mxUtils.bind(this,function(pa){this.handleError(pa,mxResources.get("errorLoadingFile"))}))}}));var H=window.opener||window.parent;D="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";H.postMessage(D,"*");if("json"==urlParams.proto){var N=this.editor.graph.openLink;+this.editor.graph.openLink=function(L,J,Y){N.apply(this,arguments);H.postMessage(JSON.stringify({event:"openLink",href:L,target:J,allowOpener:Y}),"*")}}};EditorUi.prototype.createEmbedButton=function(c,f,l,t){var q=document.createElement("button");q.className="geEmbedBtn geBtn";q.setAttribute("title",c+(null!=l?" ("+l+")":""));mxUtils.write(q,c);t&&q.classList.add("gePrimaryBtn");mxEvent.addListener(q,"click",f);return q};EditorUi.prototype.setEmbedTitle=function(c){c=this.createStatusDiv(c);null!=+this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan);"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?this.menubarContainer.appendChild(c):this.buttonContainer.appendChild(c);this.embedFilenameSpan=c};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,function(){var c=null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode==this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);+this.commentsSupported()&&null!=this.commentButton&&this.buttonContainer.appendChild(this.commentButton);"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),+"1"==urlParams.saveAndExit?Editor.ctrlKey+"+Shift+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct))}))};EditorUi.prototype.showImportCsvDialog=function(){null==+this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(c){this.importCsv(c)}),null,null,620,430,null,!0,!0,mxResources.get("import"),this.isOffline()?null:"https://drawio-app.com/import-from-csv-to-drawio/"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,+function(){var f=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(l){if(0<l.length)try{var t=JSON.parse(l);this.executeLayouts(this.editor.graph.createLayouts(t));this.customLayoutConfig=t;this.hideDialog()}catch(q){this.handleError(q)}}),null,null,null,null,mxUtils.bind(this,function(l,t){var q=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var D=t.value;t.value=JSON.stringify(JSON.parse(D));t.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?+t.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));t.value=D}catch(H){this.handleError(H)}}));q.setAttribute("title","copy");q.className="geBtn";l.appendChild(q)}),!0,null,null,"https://www.drawio.com/doc/faq/apply-layouts");this.showDialog(f.container,620,460,!0,!0);f.init()}))};EditorUi.prototype.loadOrgChartLayouts=function(c){this.createTimeout(null,mxUtils.bind(this,function(f){var l=mxUtils.bind(this,function(){this.loadingOrgChart=+!1;f.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),t=mxUtils.bind(this,function(q){this.loadingOrgChart=!1;f.clear()&&this.handleError(q)});"undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0)?l():this.spinner.spin(document.body,mxResources.get("loading"))&&(this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",+function(){mxscript("js/orgchart/mxOrgChartLayout.js",l,null,null,null,t)},null,null,null,t)},null,null,null,t)},null,null,null,t):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",l,null,null,null,t))}),onerror)};EditorUi.prototype.importCsv=function(c,f){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,f)}))};EditorUi.prototype.doImportCsv=function(c,f){try{var l=c.split("\n"),t=[],q=[],D=[],H={};if(0<l.length){var N={},L=this.editor.graph,J=null,Y=null,ha=null,ea=null,+aa=null,na=null,W=null,ba="whiteSpace=wrap;html=1;",ja=null,ca=null,la="",Q="auto",k="auto",B=!1,I=null,U=null,P=40,T=40,X=100,Z=0,ka=mxUtils.bind(this,function(){null!=f?f(ra):(L.setSelectionCells(ra),L.scrollCellToVisible(L.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),va=L.getFreeInsertPoint(),ua=va.x,qa=va.y;va=qa;var Ba=null,ya="auto";ca=null;for(var La=[],za=null,Ea=null,pa=0;pa<l.length&&"#"==l[pa].charAt(0);){c=+l[pa].replace(/\r$/,"");for(pa++;pa<l.length&&"\\"==c.charAt(c.length-1)&&"#"==l[pa].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(l[pa].substring(1)),pa++;if("#"!=c.charAt(1)){var Ca=c.indexOf(":");if(0<Ca){var Aa=mxUtils.trim(c.substring(1,Ca)),wa=mxUtils.trim(c.substring(Ca+1));"label"==Aa?Ba=Graph.sanitizeHtml(wa):"labelname"==Aa&&0<wa.length&&"-"!=wa?aa=wa:"labels"==Aa&&0<wa.length&&"-"!=wa?W=JSON.parse(wa):"style"==Aa?Y=wa:"parentstyle"==Aa?ba=wa:"unknownStyle"==Aa&&"-"!=wa?na=wa:"stylename"==+Aa&&0<wa.length&&"-"!=wa?ea=wa:"styles"==Aa&&0<wa.length&&"-"!=wa?ha=JSON.parse(wa):"vars"==Aa&&0<wa.length&&"-"!=wa?J=JSON.parse(wa):"identity"==Aa&&0<wa.length&&"-"!=wa?ja=wa:"parent"==Aa&&0<wa.length&&"-"!=wa?ca=wa:"namespace"==Aa&&0<wa.length&&"-"!=wa?la=wa:"width"==Aa?Q=wa:"height"==Aa?k=wa:"collapsed"==Aa&&"-"!=wa?B="true"==wa:"left"==Aa&&0<wa.length?I=wa:"top"==Aa&&0<wa.length?U=wa:"ignore"==Aa?Ea=wa.split(","):"connect"==Aa?La.push(JSON.parse(wa)):"link"==Aa?za=wa:"padding"==Aa?Z=parseFloat(wa):+"edgespacing"==Aa?P=parseFloat(wa):"nodespacing"==Aa?T=parseFloat(wa):"levelspacing"==Aa?X=parseFloat(wa):"layout"==Aa&&(ya=wa)}}}if(null==l[pa])throw Error(mxResources.get("invalidOrMissingFile"));var Ya=this.editor.csvToArray(l[pa].replace(/\r$/,""));Ca=c=null;Aa=[];for(wa=0;wa<Ya.length;wa++)ja==Ya[wa]&&(c=wa),ca==Ya[wa]&&(Ca=wa),Aa.push(mxUtils.trim(Ya[wa]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==Ba&&(Ba="%"+Aa[0]+"%");if(null!=La)for(var Qa=0;Qa<La.length;Qa++)null==+N[La[Qa].to]&&(N[La[Qa].to]={});ja=[];for(wa=pa+1;wa<l.length;wa++){var Ra=this.editor.csvToArray(l[wa].replace(/\r$/,""));if(null==Ra){var Sa=40<l[wa].length?l[wa].substring(0,40)+"...":l[wa];throw Error(Sa+" ("+wa+"):\n"+mxResources.get("containsValidationErrors"));}0<Ra.length&&ja.push(Ra)}L.model.beginUpdate();try{for(wa=0;wa<ja.length;wa++){Ra=ja[wa];var Ha=null,Ma=null!=c?la+Ra[c]:null;l=!1;null!=Ma&&(Ha=L.model.getCell(Ma),l=null==Ha||0<=mxUtils.indexOf(t,Ha));var y=new mxCell(Ba,new mxGeometry(ua,+va,0,0),Y||"whiteSpace=wrap;html=1;");y.collapsed=B;y.vertex=!0;y.id=Ma;null==Ha||l||L.model.setCollapsed(Ha,B);for(var O=0;O<Ra.length;O++)L.setAttributeForCell(y,Aa[O],Ra[O]),null==Ha||l||L.setAttributeForCell(Ha,Aa[O],Ra[O]);if(null!=aa&&null!=W){var R=W[y.getAttribute(aa)];null!=R&&(L.labelChanged(y,R),null==Ha||l||L.cellLabelChanged(Ha,R))}if(null!=ea&&null!=ha){var V=ha[y.getAttribute(ea)];null!=V&&(y.style=V)}L.setAttributeForCell(y,"placeholders","1");y.style=L.replacePlaceholders(y,y.style,+J);null==Ha||l?L.fireEvent(new mxEventObject("cellsInserted","cells",[y])):(L.model.setStyle(Ha,y.style),0>mxUtils.indexOf(D,Ha)&&D.push(Ha),L.fireEvent(new mxEventObject("cellsInserted","cells",[Ha])));l=null!=Ha;Ha=y;if(!l)for(Qa=0;Qa<La.length;Qa++)N[La[Qa].to][Ha.getAttribute(La[Qa].to)]=Ha;null!=za&&"link"!=za&&(L.setLinkForCell(Ha,Ha.getAttribute(za)),L.setAttributeForCell(Ha,za,null));var fa=this.editor.graph.getPreferredSizeForCell(Ha);ca=null!=Ca?L.model.getCell(la+Ra[Ca]):null;if(Ha.vertex){Sa=+null!=ca?0:ua;pa=null!=ca?0:qa;null!=I&&null!=Ha.getAttribute(I)&&(Ha.geometry.x=Sa+parseFloat(Ha.getAttribute(I)));null!=U&&null!=Ha.getAttribute(U)&&(Ha.geometry.y=pa+parseFloat(Ha.getAttribute(U)));var ia="@"==Q.charAt(0)?Ha.getAttribute(Q.substring(1)):null;Ha.geometry.width=null!=ia&&"auto"!=ia?parseFloat(Ha.getAttribute(Q.substring(1))):"auto"==Q||"auto"==ia?fa.width+Z:parseFloat(Q);var oa="@"==k.charAt(0)?Ha.getAttribute(k.substring(1)):null;Ha.geometry.height=null!=oa&&"auto"!=oa&&"width"!=+k?parseFloat(oa):"auto"==k||"auto"==oa?fa.height+Z:"width"==k?Ha.geometry.width:parseFloat(k);va+=Ha.geometry.height+T}l?(null==H[Ma]&&(H[Ma]=[]),H[Ma].push(Ha)):(t.push(Ha),null!=ca?(ca.style=L.replacePlaceholders(ca,ba,J),L.addCell(Ha,ca),q.push(ca)):D.push(L.addCell(Ha)))}for(wa=0;wa<q.length;wa++)ia="@"==Q.charAt(0)?q[wa].getAttribute(Q.substring(1)):null,oa="@"==k.charAt(0)?q[wa].getAttribute(k.substring(1)):null,"auto"!=Q&&"auto"!=ia||"auto"!=k&&"auto"!=oa||L.updateGroupBounds([q[wa]],Z,!0);+var ta=D.slice(),ra=D.slice();for(Qa=0;Qa<La.length;Qa++){var xa=La[Qa];for(wa=0;wa<t.length;wa++){Ha=t[wa];var Da=mxUtils.bind(this,function(kb,pb,fb){var ob=pb.getAttribute(fb.from);if(null!=ob&&""!=ob){ob=ob.split(",");for(var tb=0;tb<ob.length;tb++){var eb=N[fb.to][ob[tb]];if(null==eb&&null!=na){eb=new mxCell(ob[tb],new mxGeometry(ua,qa,0,0),na);eb.style=L.replacePlaceholders(pb,eb.style,J);var nb=this.editor.graph.getPreferredSizeForCell(eb);eb.geometry.width=nb.width+Z;eb.geometry.height=nb.height++Z;N[fb.to][ob[tb]]=eb;eb.vertex=!0;eb.id=ob[tb];D.push(L.addCell(eb))}if(null!=eb){nb=fb.label;null!=fb.fromlabel&&(nb=(pb.getAttribute(fb.fromlabel)||"")+(nb||""));null!=fb.sourcelabel&&(nb=L.replacePlaceholders(pb,fb.sourcelabel,J)+(nb||""));null!=fb.tolabel&&(nb=(nb||"")+(eb.getAttribute(fb.tolabel)||""));null!=fb.targetlabel&&(nb=(nb||"")+L.replacePlaceholders(eb,fb.targetlabel,J));var mb="target"==fb.placeholders==!fb.invert?eb:kb;mb=null!=fb.style?L.replacePlaceholders(mb,fb.style,J):L.createCurrentEdgeStyle();+nb=L.insertEdge(null,null,nb||"",fb.invert?eb:kb,fb.invert?kb:eb,mb);if(null!=fb.labels)for(mb=0;mb<fb.labels.length;mb++){var qb=fb.labels[mb],ub=new mxCell(qb.label||mb,new mxGeometry(null!=qb.x?qb.x:0,null!=qb.y?qb.y:0,0,0),"resizable=0;html=1;");ub.vertex=!0;ub.connectable=!1;ub.geometry.relative=!0;null!=qb.placeholders&&(ub.value=L.replacePlaceholders("target"==qb.placeholders==!fb.invert?eb:kb,ub.value,J));if(null!=qb.dx||null!=qb.dy)ub.geometry.offset=new mxPoint(null!=qb.dx?qb.dx:0,null!=+qb.dy?qb.dy:0);nb.insert(ub)}if(null!=fb.data)for(var zb in fb.data)L.setAttributeForCell(nb,zb,fb.data[zb]);ra.push(nb);mxUtils.remove(fb.invert?kb:eb,ta)}}}});Da(Ha,Ha,xa);if(null!=H[Ha.id])for(O=0;O<H[Ha.id].length;O++)Da(Ha,H[Ha.id][O],xa)}}if(null!=Ea)for(wa=0;wa<t.length;wa++)for(Ha=t[wa],O=0;O<Ea.length;O++)L.setAttributeForCell(Ha,mxUtils.trim(Ea[O]),null);if(0<D.length){var Ia=new mxParallelEdgeLayout(L);Ia.spacing=P;Ia.checkOverlap=!0;var Xa=function(){0<Ia.spacing&&Ia.execute(L.getDefaultParent());+for(var kb=0;kb<D.length;kb++){var pb=L.getCellGeometry(D[kb]);pb.x=Math.round(L.snap(pb.x));pb.y=Math.round(L.snap(pb.y));"auto"==Q&&(pb.width=Math.round(L.snap(pb.width)));"auto"==k&&(pb.height=Math.round(L.snap(pb.height)))}};if("["==ya.charAt(0)){var Za=ka;L.view.validate();this.executeLayouts(L.createLayouts(JSON.parse(ya)),function(){Xa();Za()});ka=null}else if("circle"==ya){var $a=new mxCircleLayout(L);$a.disableEdgeStyle=!1;$a.resetEdges=!1;var Pa=$a.isVertexIgnored;$a.isVertexIgnored=function(kb){return Pa.apply(this,+arguments)||0>mxUtils.indexOf(D,kb)};this.executeLayout(function(){$a.execute(L.getDefaultParent());Xa()},!0,ka);ka=null}else if("horizontaltree"==ya||"verticaltree"==ya||"auto"==ya&&ra.length==2*D.length-1&&1==ta.length){L.view.validate();var Na=new mxCompactTreeLayout(L,"horizontaltree"==ya);Na.levelDistance=T;Na.edgeRouting=!1;Na.resetEdges=!1;Na.sortEdges=!0;this.executeLayout(function(){Na.execute(L.getDefaultParent(),0<ta.length?ta[0]:null)},!0,ka);ka=null}else if("horizontalflow"==ya||"verticalflow"==+ya||"auto"==ya&&1==ta.length){L.view.validate();var jb=new mxHierarchicalLayout(L,"horizontalflow"==ya?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);jb.intraCellSpacing=T;jb.parallelEdgeSpacing=P;jb.interRankCellSpacing=X;jb.disableEdgeStyle=!1;this.executeLayout(function(){jb.execute(L.getDefaultParent(),ra);L.moveCells(ra,ua,qa)},!0,ka);ka=null}else if("orgchart"==ya){L.view.validate();var cb=new mxOrgChartLayout(L,2,X,T),ab=cb.isVertexIgnored;cb.isVertexIgnored=function(kb){return ab.apply(this,+arguments)||0>mxUtils.indexOf(D,kb)};this.executeLayout(function(){cb.execute(L.getDefaultParent());Xa()},!0,ka);ka=null}else if("organic"==ya||"auto"==ya&&ra.length>D.length){L.view.validate();var db=new mxFastOrganicLayout(L);db.forceConstant=3*T;db.disableEdgeStyle=!1;db.resetEdges=!1;var lb=db.isVertexIgnored;db.isVertexIgnored=function(kb){return lb.apply(this,arguments)||0>mxUtils.indexOf(D,kb)};this.executeLayout(function(){db.execute(L.getDefaultParent());Xa()},!0,ka);ka=null}}this.hideDialog()}finally{L.model.endUpdate()}null!=+ka&&ka()}}catch(kb){this.handleError(kb)}};EditorUi.prototype.getSearch=function(c){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var l="?",t;for(t in urlParams)0>mxUtils.indexOf(c,t)&&null!=urlParams[t]&&(f+=l+t+"="+urlParams[t],l="&")}else f=window.location.search;return f};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var f=0<c.indexOf("?")?1:0;if("1"==urlParams.offline)c+=window.location.search;else{var l="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),t;for(t in urlParams)0>mxUtils.indexOf(l,t)&&(c=0==f?c+"?":c+"&",null!=urlParams[t]&&(c+=t+"="+urlParams[t],f++))}return c};EditorUi.prototype.showLinkDialog=function(c,f,l,t,q){c=new LinkDialog(this,c,f,l,!0,t,q);this.showDialog(c.container,440,120,!0,!0);c.init()};EditorUi.prototype.getServiceCount=function(c){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++;c&&isLocalStorage&&"1"==urlParams.browser&&f++;return f};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var c=this.getCurrentFile(),f=null!=c||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(f);this.menus.get("viewZoom").setEnabled(f);var l=("1"!=urlParams.embed||"1"==urlParams.embedRT||!this.editor.graph.isEnabled())&&(null==c||c.isRestricted());this.actions.get("makeCopy").setEnabled(!l);this.actions.get("print").setEnabled(!l);this.menus.get("exportAs").setEnabled(!l);this.menus.get("embed").setEnabled(!l);l="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(l);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(l),this.menus.get("newLibrary").setEnabled(l));c="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=c&&c.isEditable();this.actions.get("image").setEnabled(f);this.actions.get("zoomIn").setEnabled(f);this.actions.get("zoomOut").setEnabled(f);@@ -3959,59 +3961,59 @@ this.actions.get("editConnectionPoints").setEnabled(t&&0==l.edges.length&&1==l.vthis.copiedStyle&&t&&0<l.cells.length);this.actions.get("editGeometry").setEnabled(0<l.vertices.length);this.actions.get("createShape").setEnabled(t);this.actions.get("createRevision").setEnabled(t);this.actions.get("moveToFolder").setEnabled(null!=f);this.actions.get("makeCopy").setEnabled(null!=f&&!f.isRestricted());this.actions.get("editDiagram").setEnabled(t&&(null==f||!f.isRestricted()));this.actions.get("publishLink").setEnabled(null!=f&&!f.isRestricted());this.actions.get("removeFormat").setEnabled(c.isEnabled()&&!c.isSelectionEmpty()&&!c.isEditing());this.actions.get("tags").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("layers").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("outline").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("rename").setEnabled(null!=f&&f.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=f);this.actions.get("properties").setEnabled(null!=f);this.menus.get("publish").setEnabled(null!=f&&!f.isRestricted());f=this.actions.get("findReplace");f.setEnabled("none"!=this.diagramContainer.style.display);f.label=mxResources.get("find")+(c.isEnabled()?"/"+mxResources.get("replace"):"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(t&&null!=c&&null!=c.shape&&null!=c.shape.stencil)};var K=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=-null);K.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,f,l,t,q,D,G,N){var L=c.editor.graph;if("xml"==l)c.hideDialog(),c.saveData(f,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");else if("svg"==l)c.hideDialog(),c.saveData(f,"svg",mxUtils.getXml(L.getSvg(t,q,D)),"image/svg+xml");else{var J=c.getFileData(!0,null,null,null,null,!0),Y=L.getGraphBounds(),ha=Math.floor(Y.width*q/L.view.scale),ea=-Math.floor(Y.height*q/L.view.scale);if(J.length<=MAX_REQUEST_SIZE&&ha*ea<MAX_AREA)if(c.hideDialog(),"png"!=l&&"jpg"!=l&&"jpeg"!=l||!c.isExportToCanvas()){var aa={globalVars:L.getExportVariables()};N&&(aa.grid={size:L.gridSize,steps:L.view.gridSteps,color:L.view.gridColor});c.saveRequest(f,l,function(na,W){return new mxXmlRequest(EXPORT_URL,"format="+l+"&base64="+(W||"0")+(null!=na?"&filename="+encodeURIComponent(na):"")+"&extras="+encodeURIComponent(JSON.stringify(aa))+(0<G?"&dpi="+G:"")+"&bg="+(null!=-t?t:"none")+"&w="+ha+"&h="+ea+"&border="+D+"&xml="+encodeURIComponent(J))})}else"png"==l?c.exportImage(q,null==t||"none"==t,!0,!1,!1,D,!0,!1,null,N,G):c.exportImage(q,!1,!0,!1,!1,D,!0,!1,"jpeg",N);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,f="";if(null!=this.pages)for(var l=0;l<this.pages.length;l++){var t=c;this.currentPage!=this.pages[l]&&(t=this.createTemporaryGraph(c.getStylesheet()),+null);K.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,f,l,t,q,D,H,N){var L=c.editor.graph;if("xml"==l)c.hideDialog(),c.saveData(f,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");else if("svg"==l)c.hideDialog(),c.saveData(f,"svg",mxUtils.getXml(L.getSvg(t,q,D)),"image/svg+xml");else{var J=c.getFileData(!0,null,null,null,null,!0),Y=L.getGraphBounds(),ha=Math.floor(Y.width*q/L.view.scale),ea=+Math.floor(Y.height*q/L.view.scale);if(J.length<=MAX_REQUEST_SIZE&&ha*ea<MAX_AREA)if(c.hideDialog(),"png"!=l&&"jpg"!=l&&"jpeg"!=l||!c.isExportToCanvas()){var aa={globalVars:L.getExportVariables()};N&&(aa.grid={size:L.gridSize,steps:L.view.gridSteps,color:L.view.gridColor});c.saveRequest(f,l,function(na,W){return new mxXmlRequest(EXPORT_URL,"format="+l+"&base64="+(W||"0")+(null!=na?"&filename="+encodeURIComponent(na):"")+"&extras="+encodeURIComponent(JSON.stringify(aa))+(0<H?"&dpi="+H:"")+"&bg="+(null!=+t?t:"none")+"&w="+ha+"&h="+ea+"&border="+D+"&xml="+encodeURIComponent(J))})}else"png"==l?c.exportImage(q,null==t||"none"==t,!0,!1,!1,D,!0,!1,null,N,H):c.exportImage(q,!1,!0,!1,!1,D,!0,!1,"jpeg",N);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,f="";if(null!=this.pages)for(var l=0;l<this.pages.length;l++){var t=c;this.currentPage!=this.pages[l]&&(t=this.createTemporaryGraph(c.getStylesheet()),this.updatePageRoot(this.pages[l]),t.model.setRoot(this.pages[l].root));f+=this.pages[l].getName()+" "+t.getIndexableText()+" "}else f=c.getIndexableText();this.editor.graph.setEnabled(!0);return f};EditorUi.prototype.showRemotelyStoredLibrary=function(c){var f={},l=document.createElement("div");l.style.whiteSpace="nowrap";var t=document.createElement("h3");mxUtils.write(t,mxUtils.htmlEntities(c));t.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";l.appendChild(t);var q=-document.createElement("div");q.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";q.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var D={};try{var G=mxSettings.getCustomLibraries();for(c=0;c<G.length;c++){var N=G[c];if("R"==N.substring(0,1)){var L=JSON.parse(decodeURIComponent(N.substring(1)));D[L[0]]={id:L[0],title:L[1],downloadUrl:L[2]}}}}catch(J){}this.remoteInvoke("getCustomLibraries",null,null,function(J){q.innerText="";+document.createElement("div");q.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";q.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var D={};try{var H=mxSettings.getCustomLibraries();for(c=0;c<H.length;c++){var N=H[c];if("R"==N.substring(0,1)){var L=JSON.parse(decodeURIComponent(N.substring(1)));D[L[0]]={id:L[0],title:L[1],downloadUrl:L[2]}}}}catch(J){}this.remoteInvoke("getCustomLibraries",null,null,function(J){q.innerText="";if(0==J.length)q.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var Y=0;Y<J.length;Y++){var ha=J[Y];D[ha.id]&&(f[ha.id]=ha);var ea=this.addCheckbox(q,ha.title,D[ha.id]);(function(aa,na){mxEvent.addListener(na,"change",function(){this.checked?f[aa.id]=aa:delete f[aa.id]})})(ha,ea)}},mxUtils.bind(this,function(J){q.innerText="";var Y=document.createElement("div");Y.style.padding="8px";Y.style.textAlign="center";mxUtils.write(Y,mxResources.get("error")+": ");mxUtils.write(Y,null!=J&&null!=J.message?J.message:mxResources.get("unknownError"));q.appendChild(Y)}));l.appendChild(q);l=new CustomDialog(this,l,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var J=0,Y;for(Y in f)null==D[Y]&&(J++,mxUtils.bind(this,function(ha){this.remoteInvoke("getFileContent",[ha.downloadUrl],null,mxUtils.bind(this,function(ea){J--;0==J&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,ea,ha)),this.showSidebar()}catch(aa){this.handleError(aa,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){J--;0==J&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(f[Y]));for(Y in D)f[Y]||this.closeLibrary(new RemoteLibrary(this,null,D[Y]));0==J&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(l.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 f=0;f<this.remoteInvokeQueue.length;f++)c.postMessage(this.remoteInvokeQueue[f],"*");this.remoteInvokeQueue=-[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var f=c.msgMarkers,l=this.remoteInvokeCallbacks[f.callbackId];if(null==l)throw Error("No callback for "+(null!=f?f.callbackId:"null"));c.error?l.error&&l.error(c.error.errResp):l.callback&&l.callback.apply(this,c.resp);this.remoteInvokeCallbacks[f.callbackId]=null};EditorUi.prototype.remoteInvoke=function(c,f,l,t,q){var D=!0,G=window.setTimeout(mxUtils.bind(this,function(){D=!1;q({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),-this.timeout),N=mxUtils.bind(this,function(){window.clearTimeout(G);D&&t.apply(this,arguments)}),L=mxUtils.bind(this,function(){window.clearTimeout(G);D&&q.apply(this,arguments)});l=l||{};l.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:N,error:L});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:f,msgMarkers:l});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,-f){var l=mxUtils.bind(this,function(J,Y){var ha={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=Y?ha.error={errResp:Y}:null!=J&&(ha.resp=J);this.remoteWin.postMessage(JSON.stringify(ha),"*")});try{var t=c.funtionName,q=this.remoteInvokableFns[t];if(null!=q&&"function"===typeof this[t]){if(q.allowedDomains){for(var D=!1,G=0;G<q.allowedDomains.length;G++)if(f=="https://"+q.allowedDomains[G]){D=!0;break}if(!D){l(null,"Invalid Call: "+t+" is not allowed.");return}}var N=c.functionArgs;Array.isArray(N)||+[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var f=c.msgMarkers,l=this.remoteInvokeCallbacks[f.callbackId];if(null==l)throw Error("No callback for "+(null!=f?f.callbackId:"null"));c.error?l.error&&l.error(c.error.errResp):l.callback&&l.callback.apply(this,c.resp);this.remoteInvokeCallbacks[f.callbackId]=null};EditorUi.prototype.remoteInvoke=function(c,f,l,t,q){var D=!0,H=window.setTimeout(mxUtils.bind(this,function(){D=!1;q({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),+this.timeout),N=mxUtils.bind(this,function(){window.clearTimeout(H);D&&t.apply(this,arguments)}),L=mxUtils.bind(this,function(){window.clearTimeout(H);D&&q.apply(this,arguments)});l=l||{};l.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:N,error:L});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:f,msgMarkers:l});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,+f){var l=mxUtils.bind(this,function(J,Y){var ha={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=Y?ha.error={errResp:Y}:null!=J&&(ha.resp=J);this.remoteWin.postMessage(JSON.stringify(ha),"*")});try{var t=c.funtionName,q=this.remoteInvokableFns[t];if(null!=q&&"function"===typeof this[t]){if(q.allowedDomains){for(var D=!1,H=0;H<q.allowedDomains.length;H++)if(f=="https://"+q.allowedDomains[H]){D=!0;break}if(!D){l(null,"Invalid Call: "+t+" is not allowed.");return}}var N=c.functionArgs;Array.isArray(N)||(N=[]);if(q.isAsync)N.push(function(){l(Array.prototype.slice.apply(arguments))}),N.push(function(J){l(null,J||"Unkown Error")}),this[t].apply(this,N);else{var L=this[t].apply(this,N);l([L])}}else l(null,"Invalid Call: "+t+" is not found.")}catch(J){l(null,"Invalid Call: An error occurred, "+J.message)}};EditorUi.prototype.openDatabase=function(c,f){if(null==this.database){var l=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=l)try{var t=l.open("database",2);t.onupgradeneeded=-function(q){try{var D=t.result;1>q.oldVersion&&D.createObjectStore("objects",{keyPath:"key"});2>q.oldVersion&&(D.createObjectStore("files",{keyPath:"title"}),D.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(G){null!=f&&f(G)}};t.onsuccess=mxUtils.bind(this,function(q){try{var D=t.result;this.database=D;EditorUi.migrateStorageFiles&&(StorageFile.migrate(D),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||-(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(G){if(!G||"1"==urlParams.forceMigration){var N=document.createElement("iframe");N.style.display="none";N.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(N);var L=!0,J=!1,Y,ha=0,ea=mxUtils.bind(this,function(){J=!0;this.setDatabaseItem(".drawioMigrated3",!0);N.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",+function(q){try{var D=t.result;1>q.oldVersion&&D.createObjectStore("objects",{keyPath:"key"});2>q.oldVersion&&(D.createObjectStore("files",{keyPath:"title"}),D.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(H){null!=f&&f(H)}};t.onsuccess=mxUtils.bind(this,function(q){try{var D=t.result;this.database=D;EditorUi.migrateStorageFiles&&(StorageFile.migrate(D),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 N=document.createElement("iframe");N.style.display="none";N.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(N);var L=!0,J=!1,Y,ha=0,ea=mxUtils.bind(this,function(){J=!0;this.setDatabaseItem(".drawioMigrated3",!0);N.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),aa=mxUtils.bind(this,function(){ha++;na()}),na=mxUtils.bind(this,function(){try{if(ha>=Y.length)ea();else{var ba=Y[ha];StorageFile.getFileContent(this,ba,mxUtils.bind(this,function(ja){null==ja||".scratchpad"==ba&&ja==this.emptyLibraryXml?N.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[ba]}),"*"):aa()}),aa)}}catch(ja){console.log(ja)}}),W=mxUtils.bind(this,function(ba){try{this.setDatabaseItem(null,-[{title:ba.title,size:ba.data.length,lastModified:Date.now(),type:ba.isLib?"L":"F"},{title:ba.title,data:ba.data}],aa,aa,["filesInfo","files"])}catch(ja){console.log(ja)}});G=mxUtils.bind(this,function(ba){try{if(ba.source==N.contentWindow){var ja={};try{ja=JSON.parse(ba.data)}catch(ca){}"init"==ja.event?(N.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),N.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=-ja.event||J||(L?null!=ja.resp&&0<ja.resp.length&&null!=ja.resp[0]?(Y=ja.resp[0],L=!1,na()):ea():null!=ja.resp&&0<ja.resp.length&&null!=ja.resp[0]?W(ja.resp[0]):aa())}}catch(ca){console.log(ca)}});window.addEventListener("message",G)}})));c(D);D.onversionchange=function(){D.close()}}catch(G){null!=f?f(G):null!=window.console&&console.warn(G)}});t.onerror=f;t.onblocked=function(){}}catch(q){null!=f?f(q):null!=window.console&&console.error(q)}else null!=f&&f(Error("IndexedDB not supported"))}else c(this.database)};-EditorUi.prototype.setDatabaseItem=function(c,f,l,t,q){this.openDatabase(mxUtils.bind(this,function(D){try{q=q||"objects";Array.isArray(q)||(q=[q],c=[c],f=[f]);var G=D.transaction(q,"readwrite");G.oncomplete=l;G.onerror=t;for(D=0;D<q.length;D++)G.objectStore(q[D]).put(null!=c&&null!=c[D]?{key:c[D],data:f[D]}:f[D])}catch(N){null!=t&&t(N)}}),t)};EditorUi.prototype.removeDatabaseItem=function(c,f,l,t){this.openDatabase(mxUtils.bind(this,function(q){try{t=t||"objects";Array.isArray(t)||(t=[t],c=[c]);-var D=q.transaction(t,"readwrite");D.oncomplete=f;D.onerror=l;for(q=0;q<t.length;q++)D.objectStore(t[q]).delete(c[q])}catch(G){null!=l&&l(G)}}),l)};EditorUi.prototype.getDatabaseItem=function(c,f,l,t){this.openDatabase(mxUtils.bind(this,function(q){try{t=t||"objects";var D=q.transaction([t],"readonly").objectStore(t).get(c);D.onsuccess=function(){f(D.result)};D.onerror=l}catch(G){null!=l&&l(G)}}),l)};EditorUi.prototype.getDatabaseItems=function(c,f,l){this.openDatabase(mxUtils.bind(this,function(t){try{l=-l||"objects";var q=t.transaction([l],"readonly").objectStore(l).openCursor(IDBKeyRange.lowerBound(0)),D=[];q.onsuccess=function(G){null==G.target.result?c(D):(D.push(G.target.result.value),G.target.result.continue())};q.onerror=f}catch(G){null!=f&&f(G)}}),f)};EditorUi.prototype.getDatabaseItemKeys=function(c,f,l){this.openDatabase(mxUtils.bind(this,function(t){try{l=l||"objects";var q=t.transaction([l],"readonly").objectStore(l).getAllKeys();q.onsuccess=function(){c(q.result)};q.onerror=f}catch(D){null!=+[{title:ba.title,size:ba.data.length,lastModified:Date.now(),type:ba.isLib?"L":"F"},{title:ba.title,data:ba.data}],aa,aa,["filesInfo","files"])}catch(ja){console.log(ja)}});H=mxUtils.bind(this,function(ba){try{if(ba.source==N.contentWindow){var ja={};try{ja=JSON.parse(ba.data)}catch(ca){}"init"==ja.event?(N.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),N.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=+ja.event||J||(L?null!=ja.resp&&0<ja.resp.length&&null!=ja.resp[0]?(Y=ja.resp[0],L=!1,na()):ea():null!=ja.resp&&0<ja.resp.length&&null!=ja.resp[0]?W(ja.resp[0]):aa())}}catch(ca){console.log(ca)}});window.addEventListener("message",H)}})));c(D);D.onversionchange=function(){D.close()}}catch(H){null!=f?f(H):null!=window.console&&console.warn(H)}});t.onerror=f;t.onblocked=function(){}}catch(q){null!=f?f(q):null!=window.console&&console.error(q)}else null!=f&&f(Error("IndexedDB not supported"))}else c(this.database)};+EditorUi.prototype.setDatabaseItem=function(c,f,l,t,q){this.openDatabase(mxUtils.bind(this,function(D){try{q=q||"objects";Array.isArray(q)||(q=[q],c=[c],f=[f]);var H=D.transaction(q,"readwrite");H.oncomplete=l;H.onerror=t;for(D=0;D<q.length;D++)H.objectStore(q[D]).put(null!=c&&null!=c[D]?{key:c[D],data:f[D]}:f[D])}catch(N){null!=t&&t(N)}}),t)};EditorUi.prototype.removeDatabaseItem=function(c,f,l,t){this.openDatabase(mxUtils.bind(this,function(q){try{t=t||"objects";Array.isArray(t)||(t=[t],c=[c]);+var D=q.transaction(t,"readwrite");D.oncomplete=f;D.onerror=l;for(q=0;q<t.length;q++)D.objectStore(t[q]).delete(c[q])}catch(H){null!=l&&l(H)}}),l)};EditorUi.prototype.getDatabaseItem=function(c,f,l,t){this.openDatabase(mxUtils.bind(this,function(q){try{t=t||"objects";var D=q.transaction([t],"readonly").objectStore(t).get(c);D.onsuccess=function(){f(D.result)};D.onerror=l}catch(H){null!=l&&l(H)}}),l)};EditorUi.prototype.getDatabaseItems=function(c,f,l){this.openDatabase(mxUtils.bind(this,function(t){try{l=+l||"objects";var q=t.transaction([l],"readonly").objectStore(l).openCursor(IDBKeyRange.lowerBound(0)),D=[];q.onsuccess=function(H){null==H.target.result?c(D):(D.push(H.target.result.value),H.target.result.continue())};q.onerror=f}catch(H){null!=f&&f(H)}}),f)};EditorUi.prototype.getDatabaseItemKeys=function(c,f,l){this.openDatabase(mxUtils.bind(this,function(t){try{l=l||"objects";var q=t.transaction([l],"readonly").objectStore(l).getAllKeys();q.onsuccess=function(){c(q.result)};q.onerror=f}catch(D){null!=f&&f(D)}}),f)};EditorUi.prototype.commentsSupported=function(){var c=this.getCurrentFile();return null!=c?c.commentsSupported():!1};EditorUi.prototype.commentsRefreshNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsSaveNeeded():!1};EditorUi.prototype.getComments=function(c,f){var l=this.getCurrentFile();null!=l?l.getComments(c,f):c([])};EditorUi.prototype.addComment=function(c,f,l){var t=this.getCurrentFile();null!=t?t.addComment(c,f,l):f(Date.now())};EditorUi.prototype.canReplyToReplies=function(){var c=this.getCurrentFile();return null!=c?c.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var c=this.getCurrentFile();return null!=c?c.canComment():!0};EditorUi.prototype.newComment=function(c,f){var l=this.getCurrentFile();return null!=l?l.newComment(c,f):new DrawioComment(this,null,c,Date.now(),Date.now(),!1,f)};EditorUi.prototype.isRevisionHistorySupported=function(){var c=this.getCurrentFile();return null!=c&&c.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(c,f){var l=this.getCurrentFile();null!=l&&l.getRevisions?l.getRevisions(c,f):f({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var c=this.getCurrentFile();return null!=c&&(c.constructor==DriveFile&&c.isEditable()||c.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.vsdxExportEnabled=-function(){return"atlassian"==this.getServiceName()};EditorUi.prototype.addRemoteServiceSecurityCheck=function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,f,l,t,q,D,G,N){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,f,l,t,q,D,G,N)};EditorUi.prototype.loadFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(c)};EditorUi.prototype.createSvgDataUri=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");-return Editor.createSvgDataUri(c)};EditorUi.prototype.embedCssFonts=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,f)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,f,l,t,q,D,G,N,L,J,Y,ha,ea,aa,na,W){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,f,l,t,q,D,-G,N,L,J,Y,ha,ea,aa,na,W)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,f,l,t){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,f,l,t)};EditorUi.prototype.convertImageToDataUri=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,+function(){return"atlassian"==this.getServiceName()};EditorUi.prototype.addRemoteServiceSecurityCheck=function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,f,l,t,q,D,H,N){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,f,l,t,q,D,H,N)};EditorUi.prototype.loadFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(c)};EditorUi.prototype.createSvgDataUri=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");+return Editor.createSvgDataUri(c)};EditorUi.prototype.embedCssFonts=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,f)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,f,l,t,q,D,H,N,L,J,Y,ha,ea,aa,na,W){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,f,l,t,q,D,+H,N,L,J,Y,ha,ea,aa,na,W)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,f,l,t){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,f,l,t)};EditorUi.prototype.convertImageToDataUri=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,f)};EditorUi.prototype.base64Encode=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(c)};EditorUi.prototype.updateCRC=function(c,f,l,t){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,f,l,t)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(c)};EditorUi.prototype.writeGraphModelToPng=function(c,f,l,t,q){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(c,f,l,t,q)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;for(var c=[],f=0;f<localStorage.length;f++){var l=localStorage.key(f),t=localStorage.getItem(l);if(0<l.length&&(".scratchpad"==l||"."!=l.charAt(0))&&0<t.length){var q="<mxfile "===t.substring(0,8)||"<?xml"===t.substring(0,5)||"\x3c!--[if IE]>"===t.substring(0,12);t="<mxlibrary>"===t.substring(0,11);(q||t)&&c.push(l)}}return c};EditorUi.prototype.getLocalStorageFile=function(c){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;var f=localStorage.getItem(c);return{title:c,data:f,isLib:"<mxlibrary>"===f.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();-var CommentsWindow=function(b,e,g,m,v,p){function A(){for(var W=N.getElementsByTagName("div"),ba=0,ja=0;ja<W.length;ja++)"none"!=W[ja].style.display&&W[ja].parentNode==N&&ba++;L.style.display=0==ba?"block":"none"}function H(W,ba,ja,ca){function la(){ba.removeChild(B);ba.removeChild(I);k.style.display="block";Q.style.display="block"}q={div:ba,comment:W,saveCallback:ja,deleteOnCancel:ca};var Q=ba.querySelector(".geCommentTxt"),k=ba.querySelector(".geCommentActionsList"),B=document.createElement("textarea");+var CommentsWindow=function(b,e,g,m,v,n){function A(){for(var W=N.getElementsByTagName("div"),ba=0,ja=0;ja<W.length;ja++)"none"!=W[ja].style.display&&W[ja].parentNode==N&&ba++;L.style.display=0==ba?"block":"none"}function G(W,ba,ja,ca){function la(){ba.removeChild(B);ba.removeChild(I);k.style.display="block";Q.style.display="block"}q={div:ba,comment:W,saveCallback:ja,deleteOnCancel:ca};var Q=ba.querySelector(".geCommentTxt"),k=ba.querySelector(".geCommentActionsList"),B=document.createElement("textarea");B.className="geCommentEditTxtArea";B.style.minHeight=Q.offsetHeight+"px";B.value=W.content;ba.insertBefore(B,Q);var I=document.createElement("div");I.className="geCommentEditBtns";var U=mxUtils.button(mxResources.get("cancel"),function(){ca?(ba.parentNode.removeChild(ba),A()):la();q=null});U.className="geCommentEditBtn";I.appendChild(U);var P=mxUtils.button(mxResources.get("save"),function(){Q.innerText="";W.content=B.value;mxUtils.write(Q,W.content);la();ja(W);q=null});mxEvent.addListener(B,"keydown",mxUtils.bind(this,function(T){mxEvent.isConsumed(T)||((mxEvent.isControlDown(T)||mxClient.IS_MAC&&mxEvent.isMetaDown(T))&&13==T.keyCode?(P.click(),mxEvent.consume(T)):27==T.keyCode&&(U.click(),mxEvent.consume(T)))}));P.focus();P.className="geCommentEditBtn gePrimaryBtn";I.appendChild(P);ba.insertBefore(I,Q);k.style.display="none";Q.style.display="none";B.focus()}function S(W,ba){ba.innerText="";W=new Date(W.modifiedDate);var ja=b.timeSince(W);null==ja&&(ja=mxResources.get("lessThanAMinute"));mxUtils.write(ba,mxResources.get("timeAgo",[ja],"{1} ago"));ba.setAttribute("title",W.toLocaleDateString()+" "+W.toLocaleTimeString())}function F(W){var ba=document.createElement("img");ba.className="geCommentBusyImg";ba.src=IMAGE_PATH+"/spin.gif";W.appendChild(ba);W.busyImg=ba}function K(W){W.style.border="1px solid red";W.busyImg.parentNode==W&&W.removeChild(W.busyImg)}function c(W){W.style.border="";W.busyImg.parentNode==W&&W.removeChild(W.busyImg)}function f(W,ba,ja,ca,la){function Q(Z,ka,va){var ua=document.createElement("li");ua.className="geCommentAction";var qa=document.createElement("a");qa.className="geCommentActionLnk";mxUtils.write(qa,Z);ua.appendChild(qa);mxEvent.addListener(qa,"click",function(Ba){ka(Ba,W);Ba.preventDefault();mxEvent.consume(Ba)});X.appendChild(ua);va&&(ua.style.display="none")}function k(){function Z(ua){ka.push(va);if(null!=ua.replies)for(var qa=0;qa<ua.replies.length;qa++)va=va.nextSibling,Z(ua.replies[qa])}var ka=[],va=I;Z(W);return{pdiv:va,replies:ka}}function B(Z,ka,va,ua,qa){function Ba(){F(Ea);-W.addReply(za,function(pa){za.id=pa;W.replies.push(za);c(Ea);va&&va()},function(pa){ya();K(Ea);b.handleError(pa,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},ua,qa)}function ya(){H(za,Ea,function(pa){Ba()},!0)}var La=k().pdiv,za=b.newComment(Z,b.getCurrentUser());za.pCommentId=W.id;null==W.replies&&(W.replies=[]);var Ea=f(za,W.replies,La,ca+1);ka?ya():Ba()}if(la||!W.isResolved){L.style.display="none";var I=document.createElement("div");I.className="geCommentContainer";I.setAttribute("data-commentId",+W.addReply(za,function(pa){za.id=pa;W.replies.push(za);c(Ea);va&&va()},function(pa){ya();K(Ea);b.handleError(pa,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},ua,qa)}function ya(){G(za,Ea,function(pa){Ba()},!0)}var La=k().pdiv,za=b.newComment(Z,b.getCurrentUser());za.pCommentId=W.id;null==W.replies&&(W.replies=[]);var Ea=f(za,W.replies,La,ca+1);ka?ya():Ba()}if(la||!W.isResolved){L.style.display="none";var I=document.createElement("div");I.className="geCommentContainer";I.setAttribute("data-commentId",W.id);I.style.marginLeft=20*ca+5+"px";W.isResolved&&(D.style.opacity="0.7");var U=document.createElement("div");U.className="geCommentHeader";var P=document.createElement("img");P.className="geCommentUserImg";P.src=null!=W.user&&null!=W.user.pictureUrl?W.user.pictureUrl:Editor.userImage;U.appendChild(P);P=document.createElement("div");P.className="geCommentHeaderTxt";U.appendChild(P);var T=document.createElement("div");T.className="geCommentUsername";mxUtils.write(T,null!=W.user?W.user.displayName:mxResources.get("unknownUser"));P.appendChild(T);T=document.createElement("div");T.className="geCommentDate";T.setAttribute("data-commentId",W.id);S(W,T);P.appendChild(T);I.appendChild(U);U=document.createElement("div");U.className="geCommentTxt";mxUtils.write(U,W.content||"");I.appendChild(U);W.isLocked&&(I.style.opacity="0.5");U=document.createElement("div");U.className="geCommentActions";var X=document.createElement("ul");X.className="geCommentActionsList";U.appendChild(X);l||W.isLocked||0!=ca&&-!t||Q(mxResources.get("reply"),function(){B("",!0)},W.isResolved);P=b.getCurrentUser();null==P||null==W.user||P.id!=W.user.id||l||W.isLocked||(Q(mxResources.get("edit"),function(){function Z(){H(W,I,function(){F(I);W.editComment(W.content,function(){c(I)},function(ka){K(I);Z();b.handleError(ka,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}Z()},W.isResolved),Q(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){F(I);W.deleteComment(function(Z){if(!0===+!t||Q(mxResources.get("reply"),function(){B("",!0)},W.isResolved);P=b.getCurrentUser();null==P||null==W.user||P.id!=W.user.id||l||W.isLocked||(Q(mxResources.get("edit"),function(){function Z(){G(W,I,function(){F(I);W.editComment(W.content,function(){c(I)},function(ka){K(I);Z();b.handleError(ka,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}Z()},W.isResolved),Q(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){F(I);W.deleteComment(function(Z){if(!0===Z){Z=I.querySelector(".geCommentTxt");Z.innerText="";mxUtils.write(Z,mxResources.get("msgDeleted"));var ka=I.querySelectorAll(".geCommentAction");for(Z=0;Z<ka.length;Z++)ka[Z].parentNode.removeChild(ka[Z]);c(I);I.style.opacity="0.5"}else{ka=k(W).replies;for(Z=0;Z<ka.length;Z++)N.removeChild(ka[Z]);for(Z=0;Z<ba.length;Z++)if(ba[Z]==W){ba.splice(Z,1);break}L.style.display=0==N.getElementsByTagName("div").length?"block":"none"}},function(Z){K(I);b.handleError(Z,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},W.isResolved));l||W.isLocked||0!=ca||Q(W.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(Z){function ka(){var va=Z.target;va.innerText="";W.isResolved=!W.isResolved;mxUtils.write(va,W.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var ua=W.isResolved?"none":"",qa=k(W).replies,Ba="light-dark("+(W.isResolved?"ghostWhite":"white")+", transparent)",ya=0;ya<qa.length;ya++){qa[ya].style.backgroundColor=Ba;for(var La=qa[ya].querySelectorAll(".geCommentAction"),-za=0;za<La.length;za++)La[za]!=va.parentNode&&(La[za].style.display=ua);ea||(qa[ya].style.display="none")}A()}W.isResolved?B(mxResources.get("reOpened")+": ",!0,ka,!1,!0):B(mxResources.get("markedAsResolved"),!1,ka,!0)});I.appendChild(U);null!=ja?N.insertBefore(I,ja.nextSibling):N.appendChild(I);for(ja=0;null!=W.replies&&ja<W.replies.length;ja++)U=W.replies[ja],U.isResolved=W.isResolved,f(U,W.replies,null,ca+1,la);null!=q&&(q.comment.id==W.id?(la=W.content,W.content=q.comment.content,H(W,I,q.saveCallback,-q.deleteOnCancel),W.content=la):null==q.comment.id&&q.comment.pCommentId==W.id&&(N.appendChild(q.div),H(q.comment,q.div,q.saveCallback,q.deleteOnCancel)));return I}}var l=!b.canComment(),t=b.canReplyToReplies(),q=null,D=document.createElement("div");D.className="geCommentsWin";var G=EditorUi.compactUi?"26px":"30px",N=document.createElement("div");N.className="geCommentsList";N.style.bottom=parseInt(G)+7+"px";D.appendChild(N);var L=document.createElement("span");L.style.cssText="display:none;padding-top:10px;text-align:center;";-mxUtils.write(L,mxResources.get("noCommentsFound"));var J=document.createElement("div");J.className="geToolbarContainer geCommentsToolbar";J.style.height=G;J.style.padding="3px 4px 4px 4px";G=document.createElement("a");G.className="geButton";if(!l){var Y=G.cloneNode();Y.style.backgroundImage="url("+Editor.plusImage+")";Y.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(Y,"click",function(W){function ba(){H(ja,ca,function(la){F(ca);b.addComment(la,function(Q){la.id=Q;aa.push(la);-c(ca)},function(Q){K(ca);ba();b.handleError(Q,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var ja=b.newComment("",b.getCurrentUser()),ca=f(ja,aa,null,0);ba();W.preventDefault();mxEvent.consume(W)});J.appendChild(Y)}var ha=G.cloneNode();ha.style.backgroundImage="url("+Editor.checkImage+")";ha.setAttribute("title",mxResources.get("showResolved"));var ea=!1;mxEvent.addListener(ha,"click",function(W){(ea=!ea)?ha.classList.add("geActiveItem"):ha.classList.remove("geActiveItem");-na();W.preventDefault();mxEvent.consume(W)});J.appendChild(ha);b.commentsRefreshNeeded()&&(Y=G.cloneNode(),Y.style.backgroundImage="url("+Editor.refreshImage+")",Y.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(Y,"click",function(W){na();W.preventDefault();mxEvent.consume(W)}),J.appendChild(Y));b.commentsSaveNeeded()&&(G=G.cloneNode(),G.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',G.setAttribute("title",mxResources.get("save")),G.className=-"geButton geAdaptiveAsset",mxEvent.addListener(G,"click",function(W){p();W.preventDefault();mxEvent.consume(W)}),J.appendChild(G));D.appendChild(J);var aa=[],na=mxUtils.bind(this,function(){this.hasError=!1;if(null!=q)try{q.div=q.div.cloneNode(!0);var W=q.div.querySelector(".geCommentEditTxtArea"),ba=q.div.querySelector(".geCommentEditBtns");q.comment.content=W.value;W.parentNode.removeChild(W);ba.parentNode.removeChild(ba)}catch(ja){b.handleError(ja)}N.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'++za=0;za<La.length;za++)La[za]!=va.parentNode&&(La[za].style.display=ua);ea||(qa[ya].style.display="none")}A()}W.isResolved?B(mxResources.get("reOpened")+": ",!0,ka,!1,!0):B(mxResources.get("markedAsResolved"),!1,ka,!0)});I.appendChild(U);null!=ja?N.insertBefore(I,ja.nextSibling):N.appendChild(I);for(ja=0;null!=W.replies&&ja<W.replies.length;ja++)U=W.replies[ja],U.isResolved=W.isResolved,f(U,W.replies,null,ca+1,la);null!=q&&(q.comment.id==W.id?(la=W.content,W.content=q.comment.content,G(W,I,q.saveCallback,+q.deleteOnCancel),W.content=la):null==q.comment.id&&q.comment.pCommentId==W.id&&(N.appendChild(q.div),G(q.comment,q.div,q.saveCallback,q.deleteOnCancel)));return I}}var l=!b.canComment(),t=b.canReplyToReplies(),q=null,D=document.createElement("div");D.className="geCommentsWin";var H=EditorUi.compactUi?"26px":"30px",N=document.createElement("div");N.className="geCommentsList";N.style.bottom=parseInt(H)+7+"px";D.appendChild(N);var L=document.createElement("span");L.style.cssText="display:none;padding-top:10px;text-align:center;";+mxUtils.write(L,mxResources.get("noCommentsFound"));var J=document.createElement("div");J.className="geToolbarContainer geCommentsToolbar";J.style.height=H;J.style.padding="3px 4px 4px 4px";H=document.createElement("a");H.className="geButton";if(!l){var Y=H.cloneNode();Y.style.backgroundImage="url("+Editor.plusImage+")";Y.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(Y,"click",function(W){function ba(){G(ja,ca,function(la){F(ca);b.addComment(la,function(Q){la.id=Q;aa.push(la);+c(ca)},function(Q){K(ca);ba();b.handleError(Q,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var ja=b.newComment("",b.getCurrentUser()),ca=f(ja,aa,null,0);ba();W.preventDefault();mxEvent.consume(W)});J.appendChild(Y)}var ha=H.cloneNode();ha.style.backgroundImage="url("+Editor.checkImage+")";ha.setAttribute("title",mxResources.get("showResolved"));var ea=!1;mxEvent.addListener(ha,"click",function(W){(ea=!ea)?ha.classList.add("geActiveItem"):ha.classList.remove("geActiveItem");+na();W.preventDefault();mxEvent.consume(W)});J.appendChild(ha);b.commentsRefreshNeeded()&&(Y=H.cloneNode(),Y.style.backgroundImage="url("+Editor.refreshImage+")",Y.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(Y,"click",function(W){na();W.preventDefault();mxEvent.consume(W)}),J.appendChild(Y));b.commentsSaveNeeded()&&(H=H.cloneNode(),H.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',H.setAttribute("title",mxResources.get("save")),H.className=+"geButton geAdaptiveAsset",mxEvent.addListener(H,"click",function(W){n();W.preventDefault();mxEvent.consume(W)}),J.appendChild(H));D.appendChild(J);var aa=[],na=mxUtils.bind(this,function(){this.hasError=!1;if(null!=q)try{q.div=q.div.cloneNode(!0);var W=q.div.querySelector(".geCommentEditTxtArea"),ba=q.div.querySelector(".geCommentEditBtns");q.comment.content=W.value;W.parentNode.removeChild(W);ba.parentNode.removeChild(ba)}catch(ja){b.handleError(ja)}N.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";t=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(ja){function ca(la){if(null!=la){la.sort(function(k,B){return new Date(k.modifiedDate)-new Date(B.modifiedDate)});for(var Q=0;Q<la.length;Q++)ca(la[Q].replies)}}ja.sort(function(la,Q){return new Date(la.modifiedDate)-new Date(Q.modifiedDate)});N.innerText="";N.appendChild(L);L.style.display="block";aa=ja;for(ja=0;ja<aa.length;ja++)ca(aa[ja].replies),-f(aa[ja],aa,null,0,ea);null!=q&&null==q.comment.id&&null==q.comment.pCommentId&&(N.appendChild(q.div),H(q.comment,q.div,q.saveCallback,q.deleteOnCancel))},mxUtils.bind(this,function(ja){N.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(ja&&ja.message?": "+ja.message:""));this.hasError=!0})):N.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});na();this.refreshComments=na;J=mxUtils.bind(this,function(){function W(Q){var k=ja[Q.id];if(null!=k)for(S(Q,k),k=0;null!=Q.replies&&k<Q.replies.length;k++)W(Q.replies[k])}+f(aa[ja],aa,null,0,ea);null!=q&&null==q.comment.id&&null==q.comment.pCommentId&&(N.appendChild(q.div),G(q.comment,q.div,q.saveCallback,q.deleteOnCancel))},mxUtils.bind(this,function(ja){N.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(ja&&ja.message?": "+ja.message:""));this.hasError=!0})):N.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});na();this.refreshComments=na;J=mxUtils.bind(this,function(){function W(Q){var k=ja[Q.id];if(null!=k)for(S(Q,k),k=0;null!=Q.replies&&k<Q.replies.length;k++)W(Q.replies[k])}if(this.window.isVisible()){for(var ba=N.querySelectorAll(".geCommentDate"),ja={},ca=0;ca<ba.length;ca++){var la=ba[ca];ja[la.getAttribute("data-commentId")]=la}for(ca=0;ca<aa.length;ca++)W(aa[ca])}});setInterval(J,6E4);this.refreshCommentsTime=J;this.window=new mxWindow(mxResources.get("comments"),D,e,g,m,v,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);-this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!0)},ConfirmDialog=function(b,e,g,m,v,p,A,H,S,F,K){var c=document.createElement("div");c.style.textAlign="center";K=null!=K?K:44;var f=document.createElement("div");f.style.padding="6px";f.style.overflow="auto";f.style.maxHeight=K+"px";f.style.lineHeight="1.2em";mxUtils.write(f,e);c.appendChild(f);null!=F&&(f=document.createElement("div"),f.style.padding="6px 0 6px 0",e=document.createElement("img"),-e.setAttribute("src",F),f.appendChild(e),c.appendChild(f));F=document.createElement("div");F.style.textAlign="center";F.style.whiteSpace="nowrap";var l=document.createElement("input");l.setAttribute("type","checkbox");p=mxUtils.button(p||mxResources.get("cancel"),function(){b.hideDialog();null!=m&&m(l.checked)});p.className="geBtn";null!=H&&(p.innerHTML=H+"<br>"+p.innerHTML,p.style.display="inline-block",p.style.paddingBottom="8px",p.style.paddingTop="8px",p.style.height="auto",p.style.width="40%");-b.editor.cancelFirst&&F.appendChild(p);var t=mxUtils.button(v||mxResources.get("ok"),function(){b.hideDialog();null!=g&&g(l.checked)});F.appendChild(t);null!=A?(t.innerHTML=A+"<br>"+t.innerHTML+"<br>",t.style.display="inline-block",t.style.paddingBottom="8px",t.style.paddingTop="8px",t.style.height="auto",t.className="geBtn",t.style.width="40%"):t.className="geBtn gePrimaryBtn";b.editor.cancelFirst||F.appendChild(p);c.appendChild(F);S?(F.style.marginTop="10px",f=document.createElement("p"),f.style.marginTop=+this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!0)},ConfirmDialog=function(b,e,g,m,v,n,A,G,S,F,K){var c=document.createElement("div");c.style.textAlign="center";K=null!=K?K:44;var f=document.createElement("div");f.style.padding="6px";f.style.overflow="auto";f.style.maxHeight=K+"px";f.style.lineHeight="1.2em";mxUtils.write(f,e);c.appendChild(f);null!=F&&(f=document.createElement("div"),f.style.padding="6px 0 6px 0",e=document.createElement("img"),+e.setAttribute("src",F),f.appendChild(e),c.appendChild(f));F=document.createElement("div");F.style.textAlign="center";F.style.whiteSpace="nowrap";var l=document.createElement("input");l.setAttribute("type","checkbox");n=mxUtils.button(n||mxResources.get("cancel"),function(){b.hideDialog();null!=m&&m(l.checked)});n.className="geBtn";null!=G&&(n.innerHTML=G+"<br>"+n.innerHTML,n.style.display="inline-block",n.style.paddingBottom="8px",n.style.paddingTop="8px",n.style.height="auto",n.style.width="40%");+b.editor.cancelFirst&&F.appendChild(n);var t=mxUtils.button(v||mxResources.get("ok"),function(){b.hideDialog();null!=g&&g(l.checked)});F.appendChild(t);null!=A?(t.innerHTML=A+"<br>"+t.innerHTML+"<br>",t.style.display="inline-block",t.style.paddingBottom="8px",t.style.paddingTop="8px",t.style.height="auto",t.className="geBtn",t.style.width="40%"):t.className="geBtn gePrimaryBtn";b.editor.cancelFirst||F.appendChild(n);c.appendChild(F);S?(F.style.marginTop="10px",f=document.createElement("p"),f.style.marginTop="20px",f.style.marginBottom="0px",f.appendChild(l),v=document.createElement("span"),mxUtils.write(v," "+mxResources.get("rememberThisSetting")),f.appendChild(v),c.appendChild(f),mxEvent.addListener(v,"click",function(q){l.checked=!l.checked;mxEvent.consume(q)})):F.style.marginTop="12px";this.init=function(){t.focus()};this.container=c},HeadlessEditorUi=function(){EditorUi.call(this,new Editor(!0),document.createElement("div"),!0)};mxUtils.extend(HeadlessEditorUi,EditorUi);HeadlessEditorUi.prototype.createUi=function(){};HeadlessEditorUi.prototype.addTrees=function(){};HeadlessEditorUi.prototype.onBeforeUnload=function(){};HeadlessEditorUi.prototype.updateActionStates=function(){};function DiagramPage(b,e){this.node=b;null!=e?this.node.setAttribute("id",e):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.diagramModified=!1;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(b){null==b?this.node.removeAttribute("name"):this.node.setAttribute("name",b)};DiagramPage.prototype.setDiagramModified=function(b){this.diagramModified=b};DiagramPage.prototype.isDiagramModified=function(){return this.diagramModified};function RenamePage(b,e,g){this.ui=b;this.page=e;this.previous=this.name=g}@@ -4023,19 +4025,19 @@ ChangePage.prototype.execute=function(){this.ui.editor.fireEvent(new mxEventObjeReplaceDiagram.prototype.execute=function(){var b=this.ui.editor.graph,e=this.ui.editor.getGraphXml();this.ui.editor.readGraphState(this.data);this.ui.editor.updateGraphComponents();var g=new mxCodec(this.data.ownerDocument),m=new mxGraphModel;g.decode(this.data,m);this.data=e;this.ui.currentPage&&(this.ui.currentPage.viewState=b.getViewState(),this.ui.currentPage.root=m.root,null!=this.ui.currentPage.model&&this.ui.currentPage.model.rootChanged(this.ui.currentPage.model.root));b.view.clear(b.model.root,!0);b.model.rootChanged(m.root);b.fireEvent(new mxEventObject(mxEvent.ROOT))};EditorUi.prototype.tabContainerVisible=!0;EditorUi.prototype.setTabContainerVisible=function(b,e){Editor.isSettingsEnabled()&&e&&(mxSettings.settings.pages=b,mxSettings.save());this.tabContainerVisible=b;this.updateTabContainer()};EditorUi.prototype.isTabContainerVisible=function(){return this.tabContainerVisible};EditorUi.prototype.getSelectedPageIndex=function(){return this.getPageIndex(this.currentPage)};EditorUi.prototype.getPageIndex=function(b){var e=null;if(null!=this.pages&&null!=b)for(var g=0;g<this.pages.length;g++)if(this.pages[g]==b){e=g;break}return e};EditorUi.prototype.getPageById=function(b,e){e=null!=e?e:this.pages;if(null!=e)for(var g=0;g<e.length;g++)if(e[g].getId()==b)return e[g];return null};-EditorUi.prototype.createImageForPageLink=function(b,e,g,m){var v=b.indexOf(","),p=null;0<v&&(v=this.getPageById(b.substring(v+1)),null!=v&&v!=e&&(p=this.getImageForPage(v,e,g,m),p.originalSrc=b));null==p&&(p={originalSrc:b});return p};+EditorUi.prototype.createImageForPageLink=function(b,e,g,m){var v=b.indexOf(","),n=null;0<v&&(v=this.getPageById(b.substring(v+1)),null!=v&&v!=e&&(n=this.getImageForPage(v,e,g,m),n.originalSrc=b));null==n&&(n={originalSrc:b});return n};EditorUi.prototype.pageSelected=function(){var b=this.editor.graph,e=this.currentPage;null!=e&&(b.tooltipHandler.hide(),null==e.viewState||null==e.viewState.scrollTop||null==e.viewState.scrollLeft?(b.selectUnlockedLayer(),this.resetScrollbars(),b.isLightboxView()&&this.lightboxFit(),null!=this.chromelessResize&&(b.container.scrollleft=0,b.container.scrollTop=0,this.chromelessResize())):b.setScrollbarPositions(e.viewState,b.view.translate.x,b.view.translate.y),this.updateTabContainer(),this.scrollToPage())};-EditorUi.prototype.getImageForPage=function(b,e,g,m){g=null!=g?g:this.editor.graph;var v=g.getGlobalVariable;g=this.createTemporaryGraph(g.getStylesheet());var p=this.getPageIndex(null!=e?e:this.currentPage);g.getGlobalVariable=function(H){return"pagenumber"==H?p+1:"page"==H&&null!=e?e.getName():v.apply(this,arguments)};document.body.appendChild(g.container);this.updatePageRoot(b);g.setAdaptiveColors(b.viewState.adaptiveColors);g.model.setRoot(b.root);b=Graph.foreignObjectWarningText;Graph.foreignObjectWarningText=+EditorUi.prototype.getImageForPage=function(b,e,g,m){g=null!=g?g:this.editor.graph;var v=g.getGlobalVariable;g=this.createTemporaryGraph(g.getStylesheet());var n=this.getPageIndex(null!=e?e:this.currentPage);g.getGlobalVariable=function(G){return"pagenumber"==G?n+1:"page"==G&&null!=e?e.getName():v.apply(this,arguments)};document.body.appendChild(g.container);this.updatePageRoot(b);g.setAdaptiveColors(b.viewState.adaptiveColors);g.model.setRoot(b.root);b=Graph.foreignObjectWarningText;Graph.foreignObjectWarningText="";m=g.getSvg(null,null,null,null,null,null,null,null,null,null,m,null,null,null,!0,!0);var A=g.getGraphBounds();document.body.removeChild(g.container);Graph.foreignObjectWarningText=b;return new mxImage(Editor.createSvgDataUri(mxUtils.getXml(m)),A.width,A.height,A.x,A.y)};EditorUi.prototype.initPages=function(){if(!this.editor.graph.standalone){this.actions.addAction("previousPage",mxUtils.bind(this,function(){this.selectNextPage(!1)}));this.actions.addAction("nextPage",mxUtils.bind(this,function(){this.selectNextPage(!0)}));this.isPagesEnabled()&&(this.keyHandler.bindAction(33,!0,"previousPage",!0),this.keyHandler.bindAction(34,!0,"nextPage",!0));var b=this.editor.graph,e=b.view.validateBackground;b.view.validateBackground=mxUtils.bind(this,function(){e.apply(b.view,-arguments);null!=b.view.backgroundImage&&EditorUi.embedSvgImages(b.view.backgroundImage.node)});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(A,H){A=H.getProperty("edit").changes;for(H=0;H<A.length;H++)if(A[H]instanceof RenamePage||A[H]instanceof ChangePage||A[H]instanceof mxRootChange){this.updateTabContainer();break}null==this.currentPage||1==A.length&&A[0]instanceof SelectPage||this.currentPage.setDiagramModified(!0)}));var g=b.sizeDidChange,m=null,v=this;b.sizeDidChange=-function(){var A=g.apply(this,arguments);null!=v.currentPage&&m!=v.currentPage&&(m=v.currentPage,v.pageSelected());return A};b.addListener(mxEvent.ROOT,mxUtils.bind(this,function(){b.checkDefaultParent()}));var p=mxUtils.bind(this,function(){this.updateDocumentTitle();this.updateTabContainer()});this.addListener("currentThemeChanged",p);this.editor.addListener("pagesPatched",p);this.editor.addListener("pageRenamed",p);this.editor.addListener("pageMoved",p);this.editor.addListener("fileLoaded",p);-this.editor.addListener("pageSelected",mxUtils.bind(this,function(A,H){this.scrollToPage();this.updateHashObject();this.updateTabContainer();this.updateDocumentTitle()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(A,H){this.scrollToPage();this.updateHashObject()}));mxEvent.addListener(window,"resize",mxUtils.bind(this,function(){this.checkTabScrollerOverflow()}));this.addListener("languageChanged",mxUtils.bind(this,function(){this.updateTabContainer()}))}};+arguments);null!=b.view.backgroundImage&&EditorUi.embedSvgImages(b.view.backgroundImage.node)});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(A,G){A=G.getProperty("edit").changes;for(G=0;G<A.length;G++)if(A[G]instanceof RenamePage||A[G]instanceof ChangePage||A[G]instanceof mxRootChange){this.updateTabContainer();break}null==this.currentPage||1==A.length&&A[0]instanceof SelectPage||this.currentPage.setDiagramModified(!0)}));var g=b.sizeDidChange,m=null,v=this;b.sizeDidChange=+function(){var A=g.apply(this,arguments);null!=v.currentPage&&m!=v.currentPage&&(m=v.currentPage,v.pageSelected());return A};b.addListener(mxEvent.ROOT,mxUtils.bind(this,function(){b.checkDefaultParent()}));var n=mxUtils.bind(this,function(){this.updateDocumentTitle();this.updateTabContainer()});this.addListener("currentThemeChanged",n);this.editor.addListener("pagesPatched",n);this.editor.addListener("pageRenamed",n);this.editor.addListener("pageMoved",n);this.editor.addListener("fileLoaded",n);+this.editor.addListener("pageSelected",mxUtils.bind(this,function(A,G){this.scrollToPage();this.updateHashObject();this.updateTabContainer();this.updateDocumentTitle()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(A,G){this.scrollToPage();this.updateHashObject()}));mxEvent.addListener(window,"resize",mxUtils.bind(this,function(){this.checkTabScrollerOverflow()}));this.addListener("languageChanged",mxUtils.bind(this,function(){this.updateTabContainer()}))}};EditorUi.prototype.scrollToPage=function(b,e){var g=null!=b?this.getPageIndex(b):this.getSelectedPageIndex(),m=null!=b?b:this.currentPage;null!=g&&null!=this.tabScroller&&this.tabScroller.children.length>g&&null!=this.tabScroller.children[g]&&(m!=this.lastScrollPage||e)&&(this.tabScroller.children[g].scrollIntoView({block:"nearest",inline:null!=b?"nearest":"center"}),this.tabScroller.children[g].className="geTab gePageTab geActivePage",this.lastScrollPage=m)};EditorUi.prototype.restoreViewState=function(b,e,g){b=null!=b?this.getPageById(b.getId()):null;var m=this.editor.graph;null!=b&&null!=this.currentPage&&null!=this.pages&&(b!=this.currentPage?this.selectPage(b,!0,e):(m.setViewState(e),this.editor.updateGraphComponents(),m.view.revalidate(),m.sizeDidChange()),m.container.scrollLeft=m.view.translate.x*m.view.scale+e.scrollLeft,m.container.scrollTop=m.view.translate.y*m.view.scale+e.scrollTop,m.restoreSelection(g))};-Graph.prototype.createViewState=function(b){var e=b.getAttribute("page"),g=parseFloat(b.getAttribute("pageScale")),m=parseFloat(b.getAttribute("pageWidth")),v=parseFloat(b.getAttribute("pageHeight")),p=b.getAttribute("background"),A=this.parseBackgroundImage(b.getAttribute("backgroundImage")),H=b.getAttribute("extFonts");if(H)try{H=H.split("|").map(function(S){S=S.split("^");return{name:S[0],url:S[1]}})}catch(S){console.log("ExtFonts format error: "+S.message)}return{gridEnabled:"0"!=b.getAttribute("grid"),-gridSize:parseFloat(b.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=b.getAttribute("guides"),foldingEnabled:"0"!=b.getAttribute("fold"),shadowVisible:"1"==b.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=e?"0"!=e:this.defaultPageVisible,background:null!=p&&0<p.length?p:null,backgroundImage:A,pageScale:isNaN(g)?mxGraph.prototype.pageScale:g,pageFormat:isNaN(m)||isNaN(v)?"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:-mxSettings.getPageFormat():new mxRectangle(0,0,m,v),tooltips:"0"!=b.getAttribute("tooltips"),connect:"0"!=b.getAttribute("connect"),arrows:"0"!=b.getAttribute("arrows"),mathEnabled:"1"==b.getAttribute("math"),adaptiveColors:b.getAttribute("adaptiveColors"),selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1,hiddenTags:[],extFonts:H||[]}};+Graph.prototype.createViewState=function(b){var e=b.getAttribute("page"),g=parseFloat(b.getAttribute("pageScale")),m=parseFloat(b.getAttribute("pageWidth")),v=parseFloat(b.getAttribute("pageHeight")),n=b.getAttribute("background"),A=this.parseBackgroundImage(b.getAttribute("backgroundImage")),G=b.getAttribute("extFonts");if(G)try{G=G.split("|").map(function(S){S=S.split("^");return{name:S[0],url:S[1]}})}catch(S){console.log("ExtFonts format error: "+S.message)}return{gridEnabled:"0"!=b.getAttribute("grid"),+gridSize:parseFloat(b.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=b.getAttribute("guides"),foldingEnabled:"0"!=b.getAttribute("fold"),shadowVisible:"1"==b.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=e?"0"!=e:this.defaultPageVisible,background:null!=n&&0<n.length?n:null,backgroundImage:A,pageScale:isNaN(g)?mxGraph.prototype.pageScale:g,pageFormat:isNaN(m)||isNaN(v)?"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:+mxSettings.getPageFormat():new mxRectangle(0,0,m,v),tooltips:"0"!=b.getAttribute("tooltips"),connect:"0"!=b.getAttribute("connect"),arrows:"0"!=b.getAttribute("arrows"),mathEnabled:"1"==b.getAttribute("math"),adaptiveColors:b.getAttribute("adaptiveColors"),selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1,hiddenTags:[],extFonts:G||[]}};Graph.prototype.saveViewState=function(b,e,g,m){g||(e.setAttribute("grid",(null==b?this.defaultGridEnabled:b.gridEnabled)?"1":"0"),e.setAttribute("page",(null==b?this.defaultPageVisible:b.pageVisible)?"1":"0"),e.setAttribute("gridSize",null!=b?b.gridSize:mxGraph.prototype.gridSize),e.setAttribute("guides",null==b||b.guidesEnabled?"1":"0"),e.setAttribute("tooltips",null==b||b.tooltips?"1":"0"),e.setAttribute("connect",null==b||b.connect?"1":"0"),e.setAttribute("arrows",null==b||b.arrows?"1":"0"),e.setAttribute("fold",null==b||b.foldingEnabled?"1":"0"));e.setAttribute("pageScale",null!=b&&null!=b.pageScale?b.pageScale:mxGraph.prototype.pageScale);g=null!=b?b.pageFormat:"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat();null!=g&&(e.setAttribute("pageWidth",g.width),e.setAttribute("pageHeight",g.height));null!=b&&(null!=b.background&&e.setAttribute("background",b.background),m=this.getBackgroundImageObject(b.backgroundImage,m),null!=m&&e.setAttribute("backgroundImage",JSON.stringify(m)));e.setAttribute("math",(null==b?this.defaultMathEnabled:b.mathEnabled)?"1":"0");e.setAttribute("shadow",null!=b&&b.shadowVisible?"1":"0");null==b||null==b.adaptiveColors?e.removeAttribute("adaptiveColors"):e.setAttribute("adaptiveColors",b.adaptiveColors);null!=b&&null!=b.extFonts&&0<b.extFonts.length&&e.setAttribute("extFonts",b.extFonts.map(function(v){return v.name+"^"+v.url}).join("|"))};@@ -4051,20 +4053,20 @@ m=!0;for(v=0;v<g.length;v++)if(g[v].name==b){m=!1;break}m&&this.extFonts.push({nEditorUi.prototype.updatePageRoot=function(b,e){if(null==b.root){e=this.editor.extractGraphModel(b.node,null,e);var g=Editor.extractParserError(e);if(g)throw Error(g);null!=e?(b.graphModelNode=e,b.viewState=this.editor.graph.createViewState(e),g=new mxCodec(e.ownerDocument),b.root=g.decode(e).root):(b.root=this.editor.graph.model.createRoot(),b.root.setId("0"),b.root.children[0].setId("1"),b.needsUpdate=!0)}else if(null==b.viewState){if(null==b.graphModelNode){e=this.editor.extractGraphModel(b.node);if(g=Editor.extractParserError(e))throw Error(g);null!=e&&(b.graphModelNode=e)}null!=b.graphModelNode&&(b.viewState=this.editor.graph.createViewState(b.graphModelNode))}if(null==b.root.children||0==b.root.children.length)e=new mxCell,e.setId("1"),b.root.insert(e),b.needsUpdate=!0;return b};EditorUi.prototype.getDiagramSnapshot=function(){return{node:this.editor.getGraphXml(),page:this.currentPage}};EditorUi.prototype.updateDiagramData=function(b,e){if(null==this.getPageIndex(b.page))this.insertPage(null,null,e);else{var g=new mxCodec(b.node.ownerDocument),m=new mxGraphModel;g.decode(b.node,m);g=new mxCodec(e.ownerDocument);var v=new mxGraphModel;g.decode(e,v);this.selectPage(b.page);e=this.diffCells(m.root,v.root);this.patchPage(b.page,e,null,!0)}};EditorUi.prototype.replaceDiagramData=function(b){this.editor.graph.model.execute(new ReplaceDiagram(this,mxUtils.parseXml(b).documentElement))};-EditorUi.prototype.selectPage=function(b,e,g){try{if(b!=this.currentPage){var m=this.editor.graph;m.isEditing()&&m.stopEditing(!1);e=null!=e?e:!1;m.isMouseDown=!1;m.reset();var v=m.model.createUndoableEdit();v.ignoreEdit=!0;var p=new SelectPage(this,b,g);p.execute();v.add(p);v.notify();e||m.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",v))}}catch(A){this.handleError(A)}};+EditorUi.prototype.selectPage=function(b,e,g){try{if(b!=this.currentPage){var m=this.editor.graph;m.isEditing()&&m.stopEditing(!1);e=null!=e?e:!1;m.isMouseDown=!1;m.reset();var v=m.model.createUndoableEdit();v.ignoreEdit=!0;var n=new SelectPage(this,b,g);n.execute();v.add(n);v.notify();e||m.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",v))}}catch(A){this.handleError(A)}};EditorUi.prototype.selectNextPage=function(b){var e=this.currentPage;null!=e&&null!=this.pages&&(e=mxUtils.indexOf(this.pages,e),b?this.selectPage(this.pages[mxUtils.mod(e+1,this.pages.length)]):b||this.selectPage(this.pages[mxUtils.mod(e-1,this.pages.length)]))};EditorUi.prototype.insertPage=function(b,e,g){this.editor.graph.isEnabled()&&(this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1),b=null!=b?b:this.createPage(null,this.createPageId(),g),e=null!=e?e:this.pages.length,e=new ChangePage(this,b,b,e),this.editor.graph.model.execute(e));return b};EditorUi.prototype.createPageId=function(){do var b=Editor.guid();while(null!=this.getPageById(b));return b};EditorUi.prototype.createPage=function(b,e,g){e=new DiagramPage((null!=this.fileNode?this.fileNode.ownerDocument:document).createElement("diagram"),e);e.setName(null!=b?b:this.createPageName());this.initDiagramNode(e,g);return e};EditorUi.prototype.createPageName=function(){for(var b={},e=0;e<this.pages.length;e++){var g=this.pages[e].getName();null!=g&&0<g.length&&(b[g]=g)}e=this.pages.length;do g=mxResources.get("pageWithNumber",[++e]);while(null!=b[g]);return g};EditorUi.prototype.removePage=function(b){try{var e=this.editor.graph,g=mxUtils.indexOf(this.pages,b);if(e.isEnabled()&&0<=g){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);e.model.beginUpdate();try{var m=this.currentPage;m==b&&1<this.pages.length?(g==this.pages.length-1?g--:g++,m=this.pages[g]):1>=this.pages.length&&(m=this.insertPage(),e.model.execute(new RenamePage(this,m,mxResources.get("pageWithNumber",[1]))));e.model.execute(new ChangePage(this,b,m))}finally{e.model.endUpdate()}}}catch(v){this.handleError(v)}return b};-EditorUi.prototype.duplicatePage=function(b,e){var g=null;try{var m=this.editor.graph;if(m.isEnabled()){m.isEditing()&&m.stopEditing();var v=b.node.cloneNode(!1);v.removeAttribute("id");var p={},A=m.createCellLookup([m.model.root]);g=new DiagramPage(v);g.root=m.cloneCell(m.model.root,null,p);var H=new mxGraphModel;H.prefix=Editor.guid()+"-";H.setRoot(g.root);m.updateCustomLinks(m.createCellMapping(p,A),[g.root]);g.viewState=b==this.currentPage?m.getViewState():b.viewState;this.initDiagramNode(g);+EditorUi.prototype.duplicatePage=function(b,e){var g=null;try{var m=this.editor.graph;if(m.isEnabled()){m.isEditing()&&m.stopEditing();var v=b.node.cloneNode(!1);v.removeAttribute("id");var n={},A=m.createCellLookup([m.model.root]);g=new DiagramPage(v);g.root=m.cloneCell(m.model.root,null,n);var G=new mxGraphModel;G.prefix=Editor.guid()+"-";G.setRoot(g.root);m.updateCustomLinks(m.createCellMapping(n,A),[g.root]);g.viewState=b==this.currentPage?m.getViewState():b.viewState;this.initDiagramNode(g);g.viewState.scale=1;delete g.viewState.scrollLeft;delete g.viewState.scrollTop;delete g.viewState.currentRoot;delete g.viewState.defaultParent;g.setName(e);g=this.insertPage(g,mxUtils.indexOf(this.pages,b)+1)}}catch(S){this.handleError(S)}return g};EditorUi.prototype.initDiagramNode=function(b,e){null==e&&(e=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b.root)));this.editor.graph.saveViewState(b.viewState,e);EditorUi.removeChildNodes(b.node);b.node.appendChild(e)};EditorUi.prototype.clonePages=function(b){for(var e=[],g=[],m=0;m<b.length;m++)try{g.push(this.clonePage(b[m]))}catch(v){e.push(mxResources.get("pageWithNumber",[m+1])+": "+v.toString())}if(0<e.length){b=Error(e.join("\n"));try{0<g.length&&(b.fallbackFileData=this.getXmlForPages(g))}catch(v){}throw b;}return g};EditorUi.prototype.clonePage=function(b){this.updatePageRoot(b);var e=new DiagramPage(b.node.cloneNode(!0)),g=b==this.currentPage?this.editor.graph.getViewState():b.viewState;e.viewState=mxUtils.clone(g,EditorUi.transientViewStateProperties);e.root=this.editor.graph.model.cloneCell(b.root,null,!0);e.diagramModified=b.diagramModified;return e};EditorUi.prototype.renamePage=function(b){if(this.editor.graph.isEnabled()){var e=new FilenameDialog(this,b.getName(),mxResources.get("rename"),mxUtils.bind(this,function(g){null!=g&&0<g.length&&this.editor.graph.model.execute(new RenamePage(this,b,g))}),mxResources.get("rename"));this.showDialog(e.container,300,80,!0,!0);e.init()}return b};EditorUi.prototype.movePage=function(b,e){this.editor.graph.model.execute(new MovePage(this,b,e))};EditorUi.prototype.createTabContainer=function(){var b=document.createElement("div");b.className="geTabContainer geTabItem";return b};-EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&!this.isTabContainerVisible())this.tabContainer.style.display="none";else if(null!=this.tabContainer&&null!=this.pages){this.tabContainer.style.display="";var b=this.editor.graph,e=document.createElement("div");e.className="geTabScroller";for(var g=null,m=0;m<this.pages.length;m++)mxUtils.bind(this,function(v,p){p.className="geTab gePageTab";this.pages[v]==this.currentPage&&p.classList.add("geActivePage");p.setAttribute("draggable",-"true");mxEvent.addListener(p,"dragstart",mxUtils.bind(this,function(A){b.isEnabled()?(mxClient.IS_FF&&A.dataTransfer.setData("Text","<diagram/>"),g=v):mxEvent.consume(A)}));mxEvent.addListener(p,"dragend",mxUtils.bind(this,function(A){g=null;A.stopPropagation();A.preventDefault()}));mxEvent.addListener(p,"dragover",mxUtils.bind(this,function(A){null!=g&&(A.dataTransfer.dropEffect="move");A.stopPropagation();A.preventDefault()}));mxEvent.addListener(p,"drop",mxUtils.bind(this,function(A){null!=g&&-v!=g&&this.movePage(g,v);A.stopPropagation();A.preventDefault()}));e.appendChild(p)})(m,this.createTabForPage(this.pages[m],m+1));m=null!=this.tabScroller?this.tabScroller.scrollLeft:0;this.tabContainer.innerText="";this.isPageInsertTabVisible()&&this.tabContainer.appendChild(this.createPageInsertTab());"simple"!=Editor.currentTheme&&(this.pageMenuTab=this.createPageMenuTab(),this.tabContainer.appendChild(this.pageMenuTab));this.tabContainer.appendChild(e);this.leftScrollTab=this.createLeftScrollTab();+EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&!this.isTabContainerVisible())this.tabContainer.style.display="none";else if(null!=this.tabContainer&&null!=this.pages){this.tabContainer.style.display="";var b=this.editor.graph,e=document.createElement("div");e.className="geTabScroller";for(var g=null,m=0;m<this.pages.length;m++)mxUtils.bind(this,function(v,n){n.className="geTab gePageTab";this.pages[v]==this.currentPage&&n.classList.add("geActivePage");n.setAttribute("draggable",+"true");mxEvent.addListener(n,"dragstart",mxUtils.bind(this,function(A){b.isEnabled()?(mxClient.IS_FF&&A.dataTransfer.setData("Text","<diagram/>"),g=v):mxEvent.consume(A)}));mxEvent.addListener(n,"dragend",mxUtils.bind(this,function(A){g=null;A.stopPropagation();A.preventDefault()}));mxEvent.addListener(n,"dragover",mxUtils.bind(this,function(A){null!=g&&(A.dataTransfer.dropEffect="move");A.stopPropagation();A.preventDefault()}));mxEvent.addListener(n,"drop",mxUtils.bind(this,function(A){null!=g&&+v!=g&&this.movePage(g,v);A.stopPropagation();A.preventDefault()}));e.appendChild(n)})(m,this.createTabForPage(this.pages[m],m+1));m=null!=this.tabScroller?this.tabScroller.scrollLeft:0;this.tabContainer.innerText="";this.isPageInsertTabVisible()&&this.tabContainer.appendChild(this.createPageInsertTab());"simple"!=Editor.currentTheme&&(this.pageMenuTab=this.createPageMenuTab(),this.tabContainer.appendChild(this.pageMenuTab));this.tabContainer.appendChild(e);this.leftScrollTab=this.createLeftScrollTab();this.tabContainer.appendChild(this.leftScrollTab);this.rightScrollTab=this.createRightScrollTab();this.tabContainer.appendChild(this.rightScrollTab);this.tabScroller=e;this.tabScroller.scrollLeft=m;this.checkTabScrollerOverflow();mxEvent.addListener(this.tabScroller,"scroll",mxUtils.bind(this,function(v){this.checkTabScrollerOverflow()}))}};EditorUi.prototype.checkTabScrollerOverflow=function(){null!=this.tabScroller&&null!=this.tabContainer&&2<this.tabContainer.children.length&&(this.tabScroller.scrollWidth>this.tabScroller.offsetWidth?(this.leftScrollTab.style.display="",this.rightScrollTab.style.display="",0==this.tabScroller.scrollLeft?this.leftScrollTab.classList.add("mxDisabled"):this.leftScrollTab.classList.remove("mxDisabled"),Math.ceil(this.tabScroller.scrollLeft)+this.tabScroller.offsetWidth>=this.tabScroller.scrollWidth?this.rightScrollTab.classList.add("mxDisabled"):this.rightScrollTab.classList.remove("mxDisabled")):(this.leftScrollTab.style.display="none",this.rightScrollTab.style.display="none"))};EditorUi.prototype.isPageInsertTabVisible=function(){return 1==urlParams.embed||null!=this.getCurrentFile()&&this.getCurrentFile().isEditable()};EditorUi.prototype.createTab=function(){var b=document.createElement("div");b.className="geTab";return b};@@ -4072,36 +4074,36 @@ EditorUi.prototype.getShortPageName=function(b){var e=null;null!=b&&(e=b.getNameEditorUi.prototype.createPageInsertTab=function(){return this.createControlTab(mxResources.get("insertPage"),Editor.plusImage,mxUtils.bind(this,function(b){try{this.insertPage()}catch(e){this.handleError(e)}mxEvent.consume(b)}))};EditorUi.prototype.createLeftScrollTab=function(){return this.createControlTab(null,Editor.chevronLeftImage,mxUtils.bind(this,function(b){var e=Math.max(60,this.tabScroller.clientWidth/2);null!=this.tabScroller.scrollBy?this.tabScroller.scrollBy({left:-e,top:0,behavior:"smooth"}):this.tabScroller.scrollLeft-=e;mxEvent.consume(b)}))};EditorUi.prototype.createRightScrollTab=function(){return this.createControlTab(null,Editor.chevronRightImage,mxUtils.bind(this,function(b){var e=Math.max(60,this.tabScroller.clientWidth/2);null!=this.tabScroller.scrollBy?this.tabScroller.scrollBy({left:e,top:0,behavior:"smooth"}):this.tabScroller.scrollLeft+=e;mxEvent.consume(b)}))};-EditorUi.prototype.createPageMenuTab=function(){return this.createControlTab(mxResources.get("pages"),Editor.menuImage,mxUtils.bind(this,function(b){this.editor.graph.popupMenuHandler.hideMenu();var e=new mxPopupMenu(mxUtils.bind(this,function(v,p){this.menus.get("pages").funct(v,p)}));e.smartSeparators=!0;e.showDisabled=!0;e.autoExpand=!0;e.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(e,arguments);e.destroy()});var g=mxEvent.getClientX(b),m=mxEvent.getClientY(b);e.popup(g,+EditorUi.prototype.createPageMenuTab=function(){return this.createControlTab(mxResources.get("pages"),Editor.menuImage,mxUtils.bind(this,function(b){this.editor.graph.popupMenuHandler.hideMenu();var e=new mxPopupMenu(mxUtils.bind(this,function(v,n){this.menus.get("pages").funct(v,n)}));e.smartSeparators=!0;e.showDisabled=!0;e.autoExpand=!0;e.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(e,arguments);e.destroy()});var g=mxEvent.getClientX(b),m=mxEvent.getClientY(b);e.popup(g,m,null,b);this.setCurrentMenu(e);mxEvent.consume(b)}))};EditorUi.prototype.createTabForPage=function(b,e){var g=this.createTab(),m=b.getName()||mxResources.get("untitled"),v=b.getId();g.setAttribute("title",m+(null!=v?" ("+v+")":"")+" ["+e+"]");e=document.createElement("span");e.style.maxWidth="160px";e.style.textOverflow="ellipsis";e.style.overflow="hidden";mxUtils.write(e,m);g.appendChild(e);this.addTabListeners(b,g);return g};-EditorUi.prototype.addTabListeners=function(b,e){mxEvent.disableContextMenu(e);var g=this.editor.graph;mxEvent.addListener(e,"dblclick",mxUtils.bind(this,function(S){this.renamePage(b);mxEvent.consume(S)}));var m=document.createElement("div");m.style.backgroundImage="url("+Editor.thinExpandImage+")";m.className="geButton";e.appendChild(m);var v=!1,p=!1,A=mxUtils.bind(this,function(S){v=null!=this.currentMenu;p=b==this.currentPage;this.scrollToPage(b);g.isMouseDown||p||this.selectPage(b)}),H=mxUtils.bind(this,-function(S){if(!g.isMouseDown&&(p&&(mxEvent.isTouchEvent(S)||mxEvent.getSource(S)==m)||mxEvent.isPopupTrigger(S))&&(g.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(S)||!v)){var F=new mxPopupMenu(this.createPageMenu(b));F.smartSeparators=!0;F.showDisabled=!0;F.autoExpand=!0;F.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(F,arguments);this.resetCurrentMenu();F.destroy()});var K=mxEvent.getClientX(S),c=mxEvent.getClientY(S);F.popup(K,c,null,S);-this.setCurrentMenu(F,e)}mxEvent.consume(S)});mxEvent.addGestureListeners(m,A,null,H);mxEvent.addGestureListeners(e,A,null,H)};+EditorUi.prototype.addTabListeners=function(b,e){mxEvent.disableContextMenu(e);var g=this.editor.graph;mxEvent.addListener(e,"dblclick",mxUtils.bind(this,function(S){this.renamePage(b);mxEvent.consume(S)}));var m=document.createElement("div");m.style.backgroundImage="url("+Editor.thinExpandImage+")";m.className="geButton";e.appendChild(m);var v=!1,n=!1,A=mxUtils.bind(this,function(S){v=null!=this.currentMenu;n=b==this.currentPage;this.scrollToPage(b);g.isMouseDown||n||this.selectPage(b)}),G=mxUtils.bind(this,+function(S){if(!g.isMouseDown&&(n&&(mxEvent.isTouchEvent(S)||mxEvent.getSource(S)==m)||mxEvent.isPopupTrigger(S))&&(g.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(S)||!v)){var F=new mxPopupMenu(this.createPageMenu(b));F.smartSeparators=!0;F.showDisabled=!0;F.autoExpand=!0;F.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(F,arguments);this.resetCurrentMenu();F.destroy()});var K=mxEvent.getClientX(S),c=mxEvent.getClientY(S);F.popup(K,c,null,S);+this.setCurrentMenu(F,e)}mxEvent.consume(S)});mxEvent.addGestureListeners(m,A,null,G);mxEvent.addGestureListeners(e,A,null,G)};EditorUi.prototype.createPageMenu=function(b,e){return mxUtils.bind(this,function(g,m){1!=urlParams.embed&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=this.getServiceName()||g.addItem(mxResources.get("openInNewWindow"),null,mxUtils.bind(this,function(){this.editor.editAsNew(this.getFileData(!0,null,null,null,!0,!0))}),m));this.editor.graph.isEnabled()&&(g.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(b,mxResources.get("copyOf",[b.getName()]))}),m),g.addSeparator(m),this.currentPage==b&&1<this.pages.length&&this.menus.addSubmenu("movePage",g,m,mxResources.get("move")),g.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(b)}),m),g.addItem(mxResources.get("rename")+"...",null,mxUtils.bind(this,function(){this.renamePage(b,e)}),m))})};(function(){mxCodecRegistry.getCodec(ChangePageSetup).exclude.push("page")})();(function(){var b=new mxObjectCodec(new MovePage,["ui"]);b.beforeDecode=function(e,g,m){m.ui=e.ui;return g};b.afterDecode=function(e,g,m){e=m.oldIndex;m.oldIndex=m.newIndex;m.newIndex=e;return m};mxCodecRegistry.register(b)})();(function(){var b=new mxObjectCodec(new RenamePage,["ui","page"]);b.beforeDecode=function(e,g,m){m.ui=e.ui;return g};b.afterDecode=function(e,g,m){e=m.previous;m.previous=m.name;m.name=e;return m};mxCodecRegistry.register(b)})();-(function(){var b=new mxObjectCodec(new ChangePage,["ui","relatedPage","index","page","previousPage"]);b.afterEncode=function(e,g,m){m.setAttribute("relatedPage",g.relatedPage.getId());null==g.index&&(m.setAttribute("name",g.relatedPage.getName()),null!=g.relatedPage.viewState&&m.setAttribute("viewState",JSON.stringify(g.relatedPage.viewState,function(v,p){return 0>mxUtils.indexOf(EditorUi.transientViewStateProperties,v)?p:void 0})),null!=g.relatedPage.root&&e.encodeCell(g.relatedPage.root,m));return m};+(function(){var b=new mxObjectCodec(new ChangePage,["ui","relatedPage","index","page","previousPage"]);b.afterEncode=function(e,g,m){m.setAttribute("relatedPage",g.relatedPage.getId());null==g.index&&(m.setAttribute("name",g.relatedPage.getName()),null!=g.relatedPage.viewState&&m.setAttribute("viewState",JSON.stringify(g.relatedPage.viewState,function(v,n){return 0>mxUtils.indexOf(EditorUi.transientViewStateProperties,v)?n:void 0})),null!=g.relatedPage.root&&e.encodeCell(g.relatedPage.root,m));return m};b.beforeDecode=function(e,g,m){m.ui=e.ui;m.relatedPage=m.ui.getPageById(g.getAttribute("relatedPage"));if(null==m.relatedPage){var v=g.ownerDocument.createElement("diagram");v.setAttribute("id",g.getAttribute("relatedPage"));v.setAttribute("name",g.getAttribute("name"));m.relatedPage=new DiagramPage(v);v=g.getAttribute("viewState");null!=v&&(m.relatedPage.viewState=JSON.parse(v),g.removeAttribute("viewState"));g=g.cloneNode(!0);v=g.firstChild;if(null!=v)for(m.relatedPage.root=e.decodeCell(v,!1),m=-v.nextSibling,v.parentNode.removeChild(v),v=m;null!=v;){m=v.nextSibling;if(v.nodeType==mxConstants.NODETYPE_ELEMENT){var p=v.getAttribute("id");null==e.lookup(p)&&e.decodeCell(v)}v.parentNode.removeChild(v);v=m}}return g};b.afterDecode=function(e,g,m){m.index=m.previousIndex;return m};mxCodecRegistry.register(b)})();(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(m,v,p,A,H){v=null!=v?v:!1;null==p&&(p=this.getFoldableCells(this.getSelectionCells(),m));this.stopEditing();this.model.beginUpdate();try{for(var S=p.slice(),F=0;F<p.length;F++)"1"==mxUtils.getValue(this.getCurrentCellStyle(p[F]),"treeFolding","0")&&this.foldTreeCell(m,p[F]);p=S;p=b.apply(this,arguments)}finally{this.model.endUpdate()}return p};Graph.prototype.foldTreeCell=function(m,v){this.model.beginUpdate();try{var p=-[];this.traverse(v,!0,mxUtils.bind(this,function(H,S){var F=null!=S&&this.isTreeEdge(S);F&&p.push(S);H==v||null!=S&&!F||p.push(H);return(null==S||F)&&(H==v||!this.model.isCollapsed(H))}));this.model.setCollapsed(v,m);for(var A=0;A<p.length;A++)this.model.setVisible(p[A],!m)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(m){return!this.isEdgeIgnored(m)};Graph.prototype.getTreeEdges=function(m,v,p,A,H,S){return this.model.filterCells(this.getEdges(m,v,p,A,H,S),mxUtils.bind(this,-function(F){return this.isTreeEdge(F)}))};Graph.prototype.getIncomingTreeEdges=function(m,v){return this.getTreeEdges(m,v,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(m,v){return this.getTreeEdges(m,v,!1,!0,!1)};var e=EditorUi.prototype.init;EditorUi.prototype.init=function(){e.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function m(ca){return q.isVertex(ca)&&p(ca)}function v(ca){var la=!1;null!=ca&&-(la="1"==t.getCurrentCellStyle(ca).treeMoving);return la}function p(ca){var la=!1;null!=ca&&(ca=q.getParent(ca),la=t.view.getState(ca),la="tree"==(null!=la?la.style:t.getCellStyle(ca)).containerType);return la}function A(ca){var la=!1;null!=ca&&(ca=q.getParent(ca),la=t.view.getState(ca),t.view.getState(ca),la=null!=(null!=la?la.style:t.getCellStyle(ca)).childLayout);return la}function H(ca){ca=t.view.getState(ca);if(null!=ca){var la=t.getIncomingTreeEdges(ca.cell);if(0<la.length&&(la=t.view.getState(la[0]),+v.nextSibling,v.parentNode.removeChild(v),v=m;null!=v;){m=v.nextSibling;if(v.nodeType==mxConstants.NODETYPE_ELEMENT){var n=v.getAttribute("id");null==e.lookup(n)&&e.decodeCell(v)}v.parentNode.removeChild(v);v=m}}return g};b.afterDecode=function(e,g,m){m.index=m.previousIndex;return m};mxCodecRegistry.register(b)})();(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(m,v,n,A,G){v=null!=v?v:!1;null==n&&(n=this.getFoldableCells(this.getSelectionCells(),m));this.stopEditing();this.model.beginUpdate();try{for(var S=n.slice(),F=0;F<n.length;F++)"1"==mxUtils.getValue(this.getCurrentCellStyle(n[F]),"treeFolding","0")&&this.foldTreeCell(m,n[F]);n=S;n=b.apply(this,arguments)}finally{this.model.endUpdate()}return n};Graph.prototype.foldTreeCell=function(m,v){this.model.beginUpdate();try{var n=+[];this.traverse(v,!0,mxUtils.bind(this,function(G,S){var F=null!=S&&this.isTreeEdge(S);F&&n.push(S);G==v||null!=S&&!F||n.push(G);return(null==S||F)&&(G==v||!this.model.isCollapsed(G))}));this.model.setCollapsed(v,m);for(var A=0;A<n.length;A++)this.model.setVisible(n[A],!m)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(m){return!this.isEdgeIgnored(m)};Graph.prototype.getTreeEdges=function(m,v,n,A,G,S){return this.model.filterCells(this.getEdges(m,v,n,A,G,S),mxUtils.bind(this,+function(F){return this.isTreeEdge(F)}))};Graph.prototype.getIncomingTreeEdges=function(m,v){return this.getTreeEdges(m,v,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(m,v){return this.getTreeEdges(m,v,!1,!0,!1)};var e=EditorUi.prototype.init;EditorUi.prototype.init=function(){e.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function m(ca){return q.isVertex(ca)&&n(ca)}function v(ca){var la=!1;null!=ca&&+(la="1"==t.getCurrentCellStyle(ca).treeMoving);return la}function n(ca){var la=!1;null!=ca&&(ca=q.getParent(ca),la=t.view.getState(ca),la="tree"==(null!=la?la.style:t.getCellStyle(ca)).containerType);return la}function A(ca){var la=!1;null!=ca&&(ca=q.getParent(ca),la=t.view.getState(ca),t.view.getState(ca),la=null!=(null!=la?la.style:t.getCellStyle(ca)).childLayout);return la}function G(ca){ca=t.view.getState(ca);if(null!=ca){var la=t.getIncomingTreeEdges(ca.cell);if(0<la.length&&(la=t.view.getState(la[0]),null!=la&&(la=la.absolutePoints,null!=la&&0<la.length&&(la=la[la.length-1],null!=la)))){if(la.y==ca.y&&Math.abs(la.x-ca.getCenterX())<ca.width/2)return mxConstants.DIRECTION_SOUTH;if(la.y==ca.y+ca.height&&Math.abs(la.x-ca.getCenterX())<ca.width/2)return mxConstants.DIRECTION_NORTH;if(la.x>ca.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function S(ca,la){la=null!=la?la:!0;t.model.beginUpdate();try{var Q=t.model.getParent(ca),k=t.getIncomingTreeEdges(ca),B=t.cloneCells([k[0],-ca]);t.model.setTerminal(B[0],t.model.getTerminal(k[0],!0),!0);var I=H(ca),U=Q.geometry;I==mxConstants.DIRECTION_SOUTH||I==mxConstants.DIRECTION_NORTH?B[1].geometry.x+=la?ca.geometry.width+10:-B[1].geometry.width-10:B[1].geometry.y+=la?ca.geometry.height+10:-B[1].geometry.height-10;t.view.currentRoot!=Q&&(B[1].geometry.x-=U.x,B[1].geometry.y-=U.y);var P=t.view.getState(ca),T=t.view.scale;if(null!=P){var X=mxRectangle.fromRectangle(P);I==mxConstants.DIRECTION_SOUTH||I==mxConstants.DIRECTION_NORTH?-X.x+=(la?ca.geometry.width+10:-B[1].geometry.width-10)*T:X.y+=(la?ca.geometry.height+10:-B[1].geometry.height-10)*T;var Z=t.getOutgoingTreeEdges(t.model.getTerminal(k[0],!0));if(null!=Z){for(var ka=I==mxConstants.DIRECTION_SOUTH||I==mxConstants.DIRECTION_NORTH,va=U=k=0;va<Z.length;va++){var ua=t.model.getTerminal(Z[va],!1);if(I==H(ua)){var qa=t.view.getState(ua);ua!=ca&&null!=qa&&(ka&&la!=qa.getCenterX()<P.getCenterX()||!ka&&la!=qa.getCenterY()<P.getCenterY())&&mxUtils.intersects(X,qa)&&(k=10+Math.max(k,-(Math.min(X.x+X.width,qa.x+qa.width)-Math.max(X.x,qa.x))/T),U=10+Math.max(U,(Math.min(X.y+X.height,qa.y+qa.height)-Math.max(X.y,qa.y))/T))}}ka?U=0:k=0;for(va=0;va<Z.length;va++)if(ua=t.model.getTerminal(Z[va],!1),I==H(ua)&&(qa=t.view.getState(ua),ua!=ca&&null!=qa&&(ka&&la!=qa.getCenterX()<P.getCenterX()||!ka&&la!=qa.getCenterY()<P.getCenterY()))){var Ba=[];t.traverse(qa.cell,!0,function(ya,La){var za=null!=La&&t.isTreeEdge(La);za&&Ba.push(La);(null==La||za)&&Ba.push(ya);return null==La||za});t.moveCells(Ba,-(la?1:-1)*k,(la?1:-1)*U)}}}return t.addCells(B,Q)}finally{t.model.endUpdate()}}function F(ca){t.model.beginUpdate();try{var la=H(ca),Q=t.getIncomingTreeEdges(ca),k=t.cloneCells([Q[0],ca]);t.model.setTerminal(Q[0],k[1],!1);t.model.setTerminal(k[0],k[1],!0);t.model.setTerminal(k[0],ca,!1);var B=t.model.getParent(ca),I=B.geometry,U=[];t.view.currentRoot!=B&&(k[1].geometry.x-=I.x,k[1].geometry.y-=I.y);t.traverse(ca,!0,function(X,Z){var ka=null!=Z&&t.isTreeEdge(Z);ka&&U.push(Z);(null==Z||ka)&&U.push(X);-return null==Z||ka});var P=ca.geometry.width+40,T=ca.geometry.height+40;la==mxConstants.DIRECTION_SOUTH?P=0:la==mxConstants.DIRECTION_NORTH?(P=0,T=-T):la==mxConstants.DIRECTION_WEST?(P=-P,T=0):la==mxConstants.DIRECTION_EAST&&(T=0);t.moveCells(U,P,T);return t.addCells(k,B)}finally{t.model.endUpdate()}}function K(ca,la){t.model.beginUpdate();try{var Q=t.model.getParent(ca),k=t.getIncomingTreeEdges(ca),B=H(ca);0==k.length&&(k=[t.createEdge(Q,null,"",null,null,t.createCurrentEdgeStyle())],B=la);var I=+ca]);t.model.setTerminal(B[0],t.model.getTerminal(k[0],!0),!0);var I=G(ca),U=Q.geometry;I==mxConstants.DIRECTION_SOUTH||I==mxConstants.DIRECTION_NORTH?B[1].geometry.x+=la?ca.geometry.width+10:-B[1].geometry.width-10:B[1].geometry.y+=la?ca.geometry.height+10:-B[1].geometry.height-10;t.view.currentRoot!=Q&&(B[1].geometry.x-=U.x,B[1].geometry.y-=U.y);var P=t.view.getState(ca),T=t.view.scale;if(null!=P){var X=mxRectangle.fromRectangle(P);I==mxConstants.DIRECTION_SOUTH||I==mxConstants.DIRECTION_NORTH?+X.x+=(la?ca.geometry.width+10:-B[1].geometry.width-10)*T:X.y+=(la?ca.geometry.height+10:-B[1].geometry.height-10)*T;var Z=t.getOutgoingTreeEdges(t.model.getTerminal(k[0],!0));if(null!=Z){for(var ka=I==mxConstants.DIRECTION_SOUTH||I==mxConstants.DIRECTION_NORTH,va=U=k=0;va<Z.length;va++){var ua=t.model.getTerminal(Z[va],!1);if(I==G(ua)){var qa=t.view.getState(ua);ua!=ca&&null!=qa&&(ka&&la!=qa.getCenterX()<P.getCenterX()||!ka&&la!=qa.getCenterY()<P.getCenterY())&&mxUtils.intersects(X,qa)&&(k=10+Math.max(k,+(Math.min(X.x+X.width,qa.x+qa.width)-Math.max(X.x,qa.x))/T),U=10+Math.max(U,(Math.min(X.y+X.height,qa.y+qa.height)-Math.max(X.y,qa.y))/T))}}ka?U=0:k=0;for(va=0;va<Z.length;va++)if(ua=t.model.getTerminal(Z[va],!1),I==G(ua)&&(qa=t.view.getState(ua),ua!=ca&&null!=qa&&(ka&&la!=qa.getCenterX()<P.getCenterX()||!ka&&la!=qa.getCenterY()<P.getCenterY()))){var Ba=[];t.traverse(qa.cell,!0,function(ya,La){var za=null!=La&&t.isTreeEdge(La);za&&Ba.push(La);(null==La||za)&&Ba.push(ya);return null==La||za});t.moveCells(Ba,+(la?1:-1)*k,(la?1:-1)*U)}}}return t.addCells(B,Q)}finally{t.model.endUpdate()}}function F(ca){t.model.beginUpdate();try{var la=G(ca),Q=t.getIncomingTreeEdges(ca),k=t.cloneCells([Q[0],ca]);t.model.setTerminal(Q[0],k[1],!1);t.model.setTerminal(k[0],k[1],!0);t.model.setTerminal(k[0],ca,!1);var B=t.model.getParent(ca),I=B.geometry,U=[];t.view.currentRoot!=B&&(k[1].geometry.x-=I.x,k[1].geometry.y-=I.y);t.traverse(ca,!0,function(X,Z){var ka=null!=Z&&t.isTreeEdge(Z);ka&&U.push(Z);(null==Z||ka)&&U.push(X);+return null==Z||ka});var P=ca.geometry.width+40,T=ca.geometry.height+40;la==mxConstants.DIRECTION_SOUTH?P=0:la==mxConstants.DIRECTION_NORTH?(P=0,T=-T):la==mxConstants.DIRECTION_WEST?(P=-P,T=0):la==mxConstants.DIRECTION_EAST&&(T=0);t.moveCells(U,P,T);return t.addCells(k,B)}finally{t.model.endUpdate()}}function K(ca,la){t.model.beginUpdate();try{var Q=t.model.getParent(ca),k=t.getIncomingTreeEdges(ca),B=G(ca);0==k.length&&(k=[t.createEdge(Q,null,"",null,null,t.createCurrentEdgeStyle())],B=la);var I=t.cloneCells([k[0],ca]);t.model.setTerminal(I[0],ca,!0);null==t.model.getTerminal(I[0],!1)&&(t.model.setTerminal(I[0],I[1],!1),t.applyNewEdgeStyle(I[1],[I[0]],B));k=t.getOutgoingTreeEdges(ca);var U=Q.geometry;la=[];t.view.currentRoot==Q&&(U=new mxRectangle);for(var P=0;P<k.length;P++){var T=t.model.getTerminal(k[P],!1);null!=T&&la.push(T)}var X=t.view.getBounds(la),Z=t.view.translate,ka=t.view.scale;B==mxConstants.DIRECTION_SOUTH?(I[1].geometry.x=null==X?ca.geometry.x+(ca.geometry.width-I[1].geometry.width)/2:(X.x+X.width)/ka-Z.x-U.x+10,I[1].geometry.y+=I[1].geometry.height-U.y+40):B==mxConstants.DIRECTION_NORTH?(I[1].geometry.x=null==X?ca.geometry.x+(ca.geometry.width-I[1].geometry.width)/2:(X.x+X.width)/ka-Z.x+-U.x+10,I[1].geometry.y-=I[1].geometry.height+U.y+40):(I[1].geometry.x=B==mxConstants.DIRECTION_WEST?I[1].geometry.x-(I[1].geometry.width+U.x+40):I[1].geometry.x+(I[1].geometry.width-U.x+40),I[1].geometry.y=null==X?ca.geometry.y+(ca.geometry.height-I[1].geometry.height)/2:(X.y+X.height)/ka-Z.y+-U.y+10);return t.addCells(I,Q)}finally{t.model.endUpdate()}}function c(ca,la,Q){ca=t.getOutgoingTreeEdges(ca);Q=t.view.getState(Q);var k=[];if(null!=Q&&null!=ca){for(var B=0;B<ca.length;B++){var I=t.view.getState(t.model.getTerminal(ca[B],!1));null!=I&&(!la&&Math.min(I.x+I.width,Q.x+Q.width)>=Math.max(I.x,Q.x)||la&&Math.min(I.y+I.height,Q.y+Q.height)>=Math.max(I.y,Q.y))&&k.push(I)}k.sort(function(U,P){return la?U.x+U.width-P.x-P.width:U.y+U.height-P.y-P.height})}return k}function f(ca,la){var Q=-H(ca),k=la==mxConstants.DIRECTION_EAST||la==mxConstants.DIRECTION_WEST;(Q==mxConstants.DIRECTION_EAST||Q==mxConstants.DIRECTION_WEST)==k&&Q!=la?l.actions.get("selectParent").funct():Q==la?(la=t.getOutgoingTreeEdges(ca),null!=la&&0<la.length&&t.setSelectionCell(t.model.getTerminal(la[0],!1))):(Q=t.getIncomingTreeEdges(ca),null!=Q&&0<Q.length&&(k=c(t.model.getTerminal(Q[0],!0),k,ca),ca=t.view.getState(ca),null!=ca&&(ca=mxUtils.indexOf(k,ca),0<=ca&&(ca+=la==mxConstants.DIRECTION_NORTH||la==mxConstants.DIRECTION_WEST?+G(ca),k=la==mxConstants.DIRECTION_EAST||la==mxConstants.DIRECTION_WEST;(Q==mxConstants.DIRECTION_EAST||Q==mxConstants.DIRECTION_WEST)==k&&Q!=la?l.actions.get("selectParent").funct():Q==la?(la=t.getOutgoingTreeEdges(ca),null!=la&&0<la.length&&t.setSelectionCell(t.model.getTerminal(la[0],!1))):(Q=t.getIncomingTreeEdges(ca),null!=Q&&0<Q.length&&(k=c(t.model.getTerminal(Q[0],!0),k,ca),ca=t.view.getState(ca),null!=ca&&(ca=mxUtils.indexOf(k,ca),0<=ca&&(ca+=la==mxConstants.DIRECTION_NORTH||la==mxConstants.DIRECTION_WEST?-1:1,0<=ca&&ca<=k.length-1&&t.setSelectionCell(k[ca].cell)))))}var l=this,t=l.editor.graph,q=t.getModel(),D=l.menus.createPopupMenu;l.menus.createPopupMenu=function(ca,la,Q){D.apply(this,arguments);if(1==t.getSelectionCount()){la=t.getSelectionCell();var k=t.getOutgoingTreeEdges(la);ca.addSeparator();0<k.length&&(m(t.getSelectionCell())&&this.addMenuItems(ca,["selectChildren"],null,Q),this.addMenuItems(ca,["selectDescendants"],null,Q));m(t.getSelectionCell())?(ca.addSeparator(),0<t.getIncomingTreeEdges(la).length&&this.addMenuItems(ca,["selectSiblings","selectParent"],null,Q)):0<t.model.getEdgeCount(la)&&this.addMenuItems(ca,["selectConnections"],null,Q)}};l.actions.addAction("selectChildren",function(ca){if(t.isEnabled()&&1==t.getSelectionCount()){var la=t.getSelectionCell();ca=mxEvent.isControlDown(ca)?null:t.getOutgoingTreeEdges(la);if(null!=ca&&0<ca.length){la=[];for(var Q=0;Q<ca.length;Q++)la.push(t.model.getTerminal(ca[Q],!1));t.setSelectionCells(la)}else t.setSelectionCells(t.model.getChildren(la))}},null,null,"Alt+Shift+C");l.actions.addAction("selectDescendants",function(ca){var la=t.getSelectionCell();if(t.isEnabled()&&null!=la){var Q=[];mxEvent.isControlDown(ca)||t.traverse(la,!0,function(k,B){var I=null!=B&&t.isTreeEdge(B);I&&mxEvent.isControlDown(ca)&&Q.push(B);(null==B||I)&&Q.push(k);return null==B||I});if(0==Q.length||1==Q.length&&Q[0]==la)Q=t.model.getDescendants(la);t.setSelectionCells(Q)}},null,null,"Alt+Shift+X");l.actions.addAction("selectParent",function(ca){var la=t.getSelectionCell();t.isEnabled()&&null!=la&&(ca=mxEvent.isControlDown(ca)?null:t.getIncomingTreeEdges(la),null!=ca&&0<ca.length?t.setSelectionCell(t.model.getTerminal(ca[0],!0)):t.selectParentCell())},null,null,"Alt+Shift+P");l.actions.addAction("selectSiblings",function(ca){if(t.isEnabled()&&1==t.getSelectionCount()){var la=t.getSelectionCell(),Q=mxEvent.isControlDown(ca)?null:t.getIncomingTreeEdges(la);ca=[];if(null!=Q&&0<Q.length&&(Q=t.getOutgoingTreeEdges(t.model.getTerminal(Q[0],!0)),null!=Q))for(var k=0;k<Q.length;k++)ca.push(t.model.getTerminal(Q[k],-!1));0==ca.length&&(ca=t.model.getChildren(t.model.getParent(la)));t.setSelectionCells(ca)}},null,null,"Alt+Shift+S");var G=t.removeCells;t.removeCells=function(ca,la){la=null!=la?la:!0;null==ca&&(ca=this.getDeletableCells(this.getSelectionCells()));la&&(ca=this.getDeletableCells(this.addAllEdges(ca)));for(var Q=[],k=0;k<ca.length;k++){var B=ca[k];q.isEdge(B)&&p(B)&&(Q.push(B),B=q.getTerminal(B,!1));if(m(B)){var I=[];t.traverse(B,!0,function(U,P){var T=null!=P&&t.isTreeEdge(P);T&&I.push(P);(null==-P||T)&&I.push(U);return null==P||T});0<I.length&&(Q=Q.concat(I),B=t.getIncomingTreeEdges(ca[k]),ca=ca.concat(B))}else null!=B&&Q.push(ca[k])}ca=Q;return G.apply(this,arguments)};l.hoverIcons.getStateAt=function(ca,la,Q){return m(ca.cell)?null:this.graph.view.getState(this.graph.getCellAt(la,Q))};var N=t.duplicateCells;t.duplicateCells=function(ca,la){ca=null!=ca?ca:this.getSelectionCells();for(var Q=ca.slice(0),k=0;k<Q.length;k++){var B=t.view.getState(Q[k]);if(null!=B&&m(B.cell)){var I=t.getIncomingTreeEdges(B.cell);+!1));0==ca.length&&(ca=t.model.getChildren(t.model.getParent(la)));t.setSelectionCells(ca)}},null,null,"Alt+Shift+S");var H=t.removeCells;t.removeCells=function(ca,la){la=null!=la?la:!0;null==ca&&(ca=this.getDeletableCells(this.getSelectionCells()));la&&(ca=this.getDeletableCells(this.addAllEdges(ca)));for(var Q=[],k=0;k<ca.length;k++){var B=ca[k];q.isEdge(B)&&n(B)&&(Q.push(B),B=q.getTerminal(B,!1));if(m(B)){var I=[];t.traverse(B,!0,function(U,P){var T=null!=P&&t.isTreeEdge(P);T&&I.push(P);(null==+P||T)&&I.push(U);return null==P||T});0<I.length&&(Q=Q.concat(I),B=t.getIncomingTreeEdges(ca[k]),ca=ca.concat(B))}else null!=B&&Q.push(ca[k])}ca=Q;return H.apply(this,arguments)};l.hoverIcons.getStateAt=function(ca,la,Q){return m(ca.cell)?null:this.graph.view.getState(this.graph.getCellAt(la,Q))};var N=t.duplicateCells;t.duplicateCells=function(ca,la){ca=null!=ca?ca:this.getSelectionCells();for(var Q=ca.slice(0),k=0;k<Q.length;k++){var B=t.view.getState(Q[k]);if(null!=B&&m(B.cell)){var I=t.getIncomingTreeEdges(B.cell);for(B=0;B<I.length;B++)mxUtils.remove(I[B],ca)}}this.model.beginUpdate();try{var U=N.call(this,ca,la);if(U.length==ca.length)for(k=0;k<ca.length;k++)if(m(ca[k])){var P=t.getIncomingTreeEdges(U[k]);I=t.getIncomingTreeEdges(ca[k]);if(0==P.length&&0<I.length){var T=this.cloneCell(I[0]);this.addEdge(T,t.getDefaultParent(),this.model.getTerminal(I[0],!0),U[k])}}}finally{this.model.endUpdate()}return U};var L=t.moveCells;t.moveCells=function(ca,la,Q,k,B,I,U){for(var P=null,T=[],X=0;X<ca.length;X++)(v(ca[X])||m(ca[X]))&&!A(ca[X])&&this.isCellCollapsed(ca[X])?T=T.concat(this.getSubtree(ca[X])):T.push(ca[X]);ca=mxUtils.removeDuplicates(T);this.model.beginUpdate();try{T=B;var Z=this.getCurrentCellStyle(B);if(null!=ca&&m(B)&&"1"==mxUtils.getValue(Z,"treeFolding","0")){for(X=0;X<ca.length;X++)if(m(ca[X])||t.model.isEdge(ca[X])&&null==t.model.getTerminal(ca[X],!0)){B=t.model.getParent(ca[X]);break}if(null!=T&&B!=T&&null!=this.view.getState(ca[0])){var ka=t.getIncomingTreeEdges(ca[0]);if(0<ka.length){var va=t.view.getState(t.model.getTerminal(ka[0],!0));if(null!=va){var ua=t.view.getState(T);null!=ua&&(la=(ua.getCenterX()-va.getCenterX())/t.view.scale,Q=(ua.getCenterY()-va.getCenterY())/t.view.scale)}}}}P=L.apply(this,arguments);if(null!=P&&null!=ca&&P.length==ca.length)for(X=0;X<P.length;X++)if(this.model.isEdge(P[X]))m(T)&&0>mxUtils.indexOf(P,this.model.getTerminal(P[X],!0))&&this.model.setTerminal(P[X],T,!0);else if(m(ca[X])&&(ka=t.getIncomingTreeEdges(ca[X]),0<ka.length))if(!k)m(T)&&0>mxUtils.indexOf(ca,@@ -4109,29 +4111,29 @@ this.model.getTerminal(ka[0],!0))&&this.model.setTerminal(ka[0],T,!0);else if(0=null==B.getTerminal(I[U],!0)){B.setTerminal(I[U],ca,!0);var P=t.getCellGeometry(I[U]);P.points=null;null!=P.getTerminalPoint(!0)&&P.setTerminalPoint(null,!0)}}finally{B.endUpdate()}return I}}var Y={67:l.actions.get("selectChildren"),88:l.actions.get("selectDescendants"),80:l.actions.get("selectParent"),83:l.actions.get("selectSiblings")},ha={67:l.actions.get("copyStyle"),86:l.actions.get("pasteStyle")},ea=l.onKeyDown;l.onKeyDown=function(ca){try{var la=t.getSelectionCell();if(t.isEnabled()&&!t.isEditing()&&null!=la){var Q=mxEvent.isAltDown(ca)&&mxEvent.isShiftDown(ca)?Y[ca.keyCode]:mxEvent.isAltDown(ca)?ha[ca.keyCode]:null;null!=Q?(Q.funct(ca),mxEvent.consume(ca)):m(la)&&(Q=null,0<t.getIncomingTreeEdges(la).length&&(9==ca.which?Q=mxEvent.isShiftDown(ca)?F(la):K(la):13==ca.which&&(Q=S(la,!mxEvent.isShiftDown(ca)))),null!=Q&&0<Q.length?(1==Q.length&&t.model.isEdge(Q[0])?t.setSelectionCell(t.model.getTerminal(Q[0],!1)):t.setSelectionCell(Q[Q.length-1]),null!=l.hoverIcons&&l.hoverIcons.update(t.view.getState(la)),t.startEditingAtCell(la),mxEvent.consume(ca)):37==ca.keyCode?(f(la,mxConstants.DIRECTION_WEST),mxEvent.consume(ca)):38==ca.keyCode?(f(la,mxConstants.DIRECTION_NORTH),mxEvent.consume(ca)):39==ca.keyCode?(f(la,mxConstants.DIRECTION_EAST),mxEvent.consume(ca)):40==ca.keyCode&&(f(la,mxConstants.DIRECTION_SOUTH),mxEvent.consume(ca)))}}catch(k){l.handleError(k)}mxEvent.isConsumed(ca)||ea.apply(this,arguments)};var aa=t.connectVertex;t.connectVertex=function(ca,la,Q,k,B,I,U){var P=t.getIncomingTreeEdges(ca);-if(m(ca)){var T=H(ca),X=T==mxConstants.DIRECTION_EAST||T==mxConstants.DIRECTION_WEST,Z=la==mxConstants.DIRECTION_EAST||la==mxConstants.DIRECTION_WEST;return T==la||0==P.length?K(ca,la):X==Z?F(ca):S(ca,la!=mxConstants.DIRECTION_NORTH&&la!=mxConstants.DIRECTION_WEST)}return aa.apply(this,arguments)};t.getSubtree=function(ca){var la=[ca];!v(ca)&&!m(ca)||A(ca)||t.traverse(ca,!0,function(Q,k){var B=null!=k&&t.isTreeEdge(k);B&&0>mxUtils.indexOf(la,k)&&la.push(k);(null==k||B)&&0>mxUtils.indexOf(la,Q)&&la.push(Q);+if(m(ca)){var T=G(ca),X=T==mxConstants.DIRECTION_EAST||T==mxConstants.DIRECTION_WEST,Z=la==mxConstants.DIRECTION_EAST||la==mxConstants.DIRECTION_WEST;return T==la||0==P.length?K(ca,la):X==Z?F(ca):S(ca,la!=mxConstants.DIRECTION_NORTH&&la!=mxConstants.DIRECTION_WEST)}return aa.apply(this,arguments)};t.getSubtree=function(ca){var la=[ca];!v(ca)&&!m(ca)||A(ca)||t.traverse(ca,!0,function(Q,k){var B=null!=k&&t.isTreeEdge(k);B&&0>mxUtils.indexOf(la,k)&&la.push(k);(null==k||B)&&0>mxUtils.indexOf(la,Q)&&la.push(Q);return null==k||B});return la};var na=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){na.apply(this,arguments);(v(this.state.cell)||m(this.state.cell))&&!A(this.state.cell)&&0<this.graph.getOutgoingTreeEdges(this.state.cell).length&&!this.graph.isCellCollapsed(this.state.cell)?null==this.moveHandle&&(this.moveHandle=mxUtils.createImage(Editor.moveImage),this.moveHandle.setAttribute("title","Move Subtree"),this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="24px",this.moveHandle.style.height="24px",this.graph.container.appendChild(this.moveHandle),this.redrawMoveHandle(),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(ca){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(ca),mxEvent.getClientY(ca),this.graph.getSubtree(this.state.cell));this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(ca);this.graph.isMouseDown=!0;l.hoverIcons.reset();mxEvent.consume(ca)}))):null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)};var W=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){W.apply(this,arguments);this.redrawMoveHandle()};mxVertexHandler.prototype.redrawMoveHandle=function(){null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var ba=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(ca){ba.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.display=ca?"":"none")};var ja=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(ca,la){ja.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var g=Sidebar.prototype.createAdvancedShapes;-Sidebar.prototype.createAdvancedShapes=function(){var m=g.apply(this,arguments),v=this.graph,p=this;return m.concat([this.addEntry("tree container",function(){var A=new mxCell("Tree Container",new mxGeometry(0,0,400,320),"swimlane;startSize=20;horizontal=1;containerType=tree;");A.vertex=!0;var H=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');H.vertex=!0;var S=-new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');S.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");F.geometry.relative=!0;F.edge=!0;H.insertEdge(F,!0);S.insertEdge(F,!1);A.insert(F);A.insert(H);A.insert(S);return p.createVertexTemplateFromCells([A],-A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var A=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;startSize=20;horizontal=1;containerType=tree;");A.vertex=!0;var H=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-H.vertex=!0;var S=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');S.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");-F.geometry.relative=!0;F.edge=!0;H.insertEdge(F,!0);S.insertEdge(F,!1);var K=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-K.vertex=!0;var c=new mxCell("",new mxGeometry(0,0,0,0),F.style);c.geometry.relative=!0;c.edge=!0;H.insertEdge(c,!0);K.insertEdge(c,!1);var f=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-f.vertex=!0;var l=new mxCell("",new mxGeometry(0,0,0,0),F.style);l.geometry.relative=!0;l.edge=!0;H.insertEdge(l,!0);f.insertEdge(l,!1);var t=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-t.vertex=!0;var q=new mxCell("",new mxGeometry(0,0,0,0),F.style);q.geometry.relative=!0;q.edge=!0;H.insertEdge(q,!0);t.insertEdge(q,!1);A.insert(F);A.insert(c);A.insert(l);A.insert(q);A.insert(H);A.insert(S);A.insert(K);A.insert(f);A.insert(t);return p.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var A=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};treeFolding=1;treeMoving=1;');-A.vertex=!0;return p.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps branch",function(){var A=new mxCell("Branch",new mxGeometry(0,0,80,20),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;recursiveResize=0;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-A.vertex=!0;var H=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");H.geometry.setTerminalPoint(new mxPoint(-40,40),!0);H.geometry.relative=!0;H.edge=!0;A.insertEdge(H,!1);return p.createVertexTemplateFromCells([A,H],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps sub topic",function(){var A=new mxCell("Sub Topic",new mxGeometry(0,0,80,26),-'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');A.vertex=!0;var H=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");-H.geometry.setTerminalPoint(new mxPoint(-40,40),!0);H.geometry.relative=!0;H.edge=!0;A.insertEdge(H,!1);return p.createVertexTemplateFromCells([A,H],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree orgchart organization division",function(){var A=new mxCell("Orgchart",new mxGeometry(0,0,280,220),'swimlane;startSize=20;horizontal=1;containerType=tree;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');A.vertex=!0;var H=new mxCell("Organization",new mxGeometry(80,-40,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');v.setAttributeForCell(H,"treeRoot","1");H.vertex=!0;var S=new mxCell("Division",new mxGeometry(20,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');S.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");-F.geometry.relative=!0;F.edge=!0;H.insertEdge(F,!0);S.insertEdge(F,!1);var K=new mxCell("Division",new mxGeometry(160,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');K.vertex=!0;var c=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");c.geometry.relative=-!0;c.edge=!0;H.insertEdge(c,!0);K.insertEdge(c,!1);A.insert(F);A.insert(c);A.insert(H);A.insert(S);A.insert(K);return p.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree root",function(){var A=new mxCell("Organization",new mxGeometry(0,0,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');v.setAttributeForCell(A,"treeRoot","1");A.vertex=!0;return p.createVertexTemplateFromCells([A],-A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree division",function(){var A=new mxCell("Division",new mxGeometry(20,40,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');A.vertex=!0;var H=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");-H.geometry.setTerminalPoint(new mxPoint(0,0),!0);H.geometry.relative=!0;H.edge=!0;A.insertEdge(H,!1);return p.createVertexTemplateFromCells([A,H],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree sub sections",function(){var A=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");A.vertex=!0;var H=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;curved=0;rounded=0;");-H.geometry.setTerminalPoint(new mxPoint(110,-40),!0);H.geometry.relative=!0;H.edge=!0;A.insertEdge(H,!1);var S=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");S.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),H.style);F.geometry.setTerminalPoint(new mxPoint(110,-40),!0);F.geometry.relative=!0;F.edge=!0;S.insertEdge(F,!1);return p.createVertexTemplateFromCells([H,F,A,S],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;+Sidebar.prototype.createAdvancedShapes=function(){var m=g.apply(this,arguments),v=this.graph,n=this;return m.concat([this.addEntry("tree container",function(){var A=new mxCell("Tree Container",new mxGeometry(0,0,400,320),"swimlane;startSize=20;horizontal=1;containerType=tree;");A.vertex=!0;var G=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');G.vertex=!0;var S=+new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');S.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");F.geometry.relative=!0;F.edge=!0;G.insertEdge(F,!0);S.insertEdge(F,!1);A.insert(F);A.insert(G);A.insert(S);return n.createVertexTemplateFromCells([A],+A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var A=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;startSize=20;horizontal=1;containerType=tree;");A.vertex=!0;var G=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+G.vertex=!0;var S=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');S.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");+F.geometry.relative=!0;F.edge=!0;G.insertEdge(F,!0);S.insertEdge(F,!1);var K=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+K.vertex=!0;var c=new mxCell("",new mxGeometry(0,0,0,0),F.style);c.geometry.relative=!0;c.edge=!0;G.insertEdge(c,!0);K.insertEdge(c,!1);var f=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+f.vertex=!0;var l=new mxCell("",new mxGeometry(0,0,0,0),F.style);l.geometry.relative=!0;l.edge=!0;G.insertEdge(l,!0);f.insertEdge(l,!1);var t=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+t.vertex=!0;var q=new mxCell("",new mxGeometry(0,0,0,0),F.style);q.geometry.relative=!0;q.edge=!0;G.insertEdge(q,!0);t.insertEdge(q,!1);A.insert(F);A.insert(c);A.insert(l);A.insert(q);A.insert(G);A.insert(S);A.insert(K);A.insert(f);A.insert(t);return n.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var A=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};treeFolding=1;treeMoving=1;');+A.vertex=!0;return n.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps branch",function(){var A=new mxCell("Branch",new mxGeometry(0,0,80,20),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;recursiveResize=0;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+A.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");G.geometry.setTerminalPoint(new mxPoint(-40,40),!0);G.geometry.relative=!0;G.edge=!0;A.insertEdge(G,!1);return n.createVertexTemplateFromCells([A,G],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps sub topic",function(){var A=new mxCell("Sub Topic",new mxGeometry(0,0,80,26),+'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');A.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");+G.geometry.setTerminalPoint(new mxPoint(-40,40),!0);G.geometry.relative=!0;G.edge=!0;A.insertEdge(G,!1);return n.createVertexTemplateFromCells([A,G],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree orgchart organization division",function(){var A=new mxCell("Orgchart",new mxGeometry(0,0,280,220),'swimlane;startSize=20;horizontal=1;containerType=tree;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');A.vertex=!0;var G=new mxCell("Organization",new mxGeometry(80,+40,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');v.setAttributeForCell(G,"treeRoot","1");G.vertex=!0;var S=new mxCell("Division",new mxGeometry(20,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');S.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");+F.geometry.relative=!0;F.edge=!0;G.insertEdge(F,!0);S.insertEdge(F,!1);var K=new mxCell("Division",new mxGeometry(160,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');K.vertex=!0;var c=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");c.geometry.relative=+!0;c.edge=!0;G.insertEdge(c,!0);K.insertEdge(c,!1);A.insert(F);A.insert(c);A.insert(G);A.insert(S);A.insert(K);return n.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree root",function(){var A=new mxCell("Organization",new mxGeometry(0,0,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');v.setAttributeForCell(A,"treeRoot","1");A.vertex=!0;return n.createVertexTemplateFromCells([A],+A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree division",function(){var A=new mxCell("Division",new mxGeometry(20,40,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');A.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");+G.geometry.setTerminalPoint(new mxPoint(0,0),!0);G.geometry.relative=!0;G.edge=!0;A.insertEdge(G,!1);return n.createVertexTemplateFromCells([A,G],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree sub sections",function(){var A=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");A.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;curved=0;rounded=0;");+G.geometry.setTerminalPoint(new mxPoint(110,-40),!0);G.geometry.relative=!0;G.edge=!0;A.insertEdge(G,!1);var S=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");S.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),G.style);F.geometry.setTerminalPoint(new mxPoint(110,-40),!0);F.geometry.relative=!0;F.edge=!0;S.insertEdge(F,!1);return n.createVertexTemplateFromCells([G,F,A,S],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;EditorUi.initMinimalTheme=function(){function b(K,c){if(EditorUi.windowed){var f=K.editor.graph;f.popupMenuHandler.hideMenu();null==K.formatWindow?(K.formatWindow=new WrapperWindow(K,"",Math.max(10,K.diagramContainer.clientWidth-248),60,240,Math.min(566,f.container.clientHeight-10),function(l){l.className="geSidebarContainer geFormatContainer";K.createFormat(l).init()}),K.dependsOnLanguage(mxUtils.bind(this,function(){K.formatWindow.window.setTitle(mxResources.get("format"))})),K.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){K.formatWindow.window.fit()})),K.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80)):K.formatWindow.window.setVisible(null!=c?c:!K.formatWindow.window.isVisible())}else null==K.formatElt&&(K.formatElt=K.createSidebarContainer(),K.createFormat(K.formatElt).init(),K.formatElt.style.border="none",K.formatElt.style.width="240px",K.formatElt.style.borderLeftWidth="1px",K.formatElt.style.borderLeftStyle="solid",K.formatElt.style.right="0px"),c=K.diagramContainer.parentNode,null!=K.formatElt.parentNode?(K.formatElt.parentNode.removeChild(K.formatElt),c.style.right="0px"):(c.parentNode.appendChild(K.formatElt),c.style.right=K.formatElt.style.width)}function e(K,c){if(EditorUi.windowed){var f=K.editor.graph;f.popupMenuHandler.hideMenu();null==K.sidebarWindow?(K.sidebarWindow=new WrapperWindow(K,"",10,56,Math.min(f.container.clientWidth-10,218)-6,Math.min(f.container.clientHeight-40,650)-6,function(l){K.createShapesPanel(l)}),K.dependsOnLanguage(mxUtils.bind(this,function(){K.sidebarWindow.window.setTitle(mxResources.get("shapes"))})),@@ -4140,41 +4142,41 @@ K.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){K.sdocument.body.clientWidth}catch(K){}Menus.prototype.autoPopup=!1;mxConstraintHandler.prototype.pointImage=Graph.createSvgImage(5,5,'<path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke-width="2" style="stroke-opacity:0.4" stroke="#ffffff"/><path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke="#29b6f2"/>');mxOutline.prototype.sizerImage=null;mxConstants.VERTEX_SELECTION_COLOR="#C0C0C0";mxConstants.EDGE_SELECTION_COLOR="#C0C0C0";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.DEFAULT_VALID_COLOR="#29b6f2";mxConstants.GUIDE_COLOR="#C0C0C0";mxConstants.OUTLINE_COLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#fff";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowSize="0.6";Graph.prototype.svgShadowBlur="1.2";mxRubberband.prototype.defaultOpacity=50;HoverIcons.prototype.inactiveOpacity=25;EditorUi.prototype.closableScratchpad=!1;Graph.prototype.editAfterInsert=!mxClient.IS_IOS&&!mxClient.IS_ANDROID;Editor.prototype.isChromelessView=function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var m=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){m.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var v=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(K,c){null!=c.shortcut&&900>g&&!mxClient.IS_IOS?K.firstChild.nextSibling.setAttribute("title",c.shortcut):v.apply(this,arguments)};EditorUi.prototype.toggleFormatPanel=-function(K){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=K?K:!this.formatWindow.window.isVisible()):b(this)};EditorUi.prototype.isFormatPanelVisible=function(){return null!=this.formatWindow&&this.formatWindow.window.isVisible()||null==this.formatWindow&&0<this.formatWidth};var p=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.destroyWindows();p.apply(this,arguments)};var A=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(K){A.apply(this,-arguments);if(K){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=c&&null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=c&&this.formatWindow.window.setVisible(!0)}else null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1)};EditorUi.prototype.chromelessWindowResize=function(){};var H=Menus.prototype.init;Menus.prototype.init=function(){H.apply(this,+function(K){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=K?K:!this.formatWindow.window.isVisible()):b(this)};EditorUi.prototype.isFormatPanelVisible=function(){return null!=this.formatWindow&&this.formatWindow.window.isVisible()||null==this.formatWindow&&0<this.formatWidth};var n=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.destroyWindows();n.apply(this,arguments)};var A=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(K){A.apply(this,+arguments);if(K){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=c&&null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=c&&this.formatWindow.window.setVisible(!0)}else null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1)};EditorUi.prototype.chromelessWindowResize=function(){};var G=Menus.prototype.init;Menus.prototype.init=function(){G.apply(this,arguments);var K=this.editorUi;EditorUi.enablePlantUml&&!K.isOffline()&&K.actions.put("plantUml",new Action("plantUml...",function(){var l=new ParseDialog(K,mxResources.get("plantUml")+"...","plantUml");K.showDialog(l.container,620,420,!0,!1);l.init()}));K.actions.put("mermaid",new Action("mermaid...",function(){var l=new ParseDialog(K,mxResources.get("mermaid")+"...","mermaid");K.showDialog(l.container,620,420,!0,!1);l.init()}));var c="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),-f=function(l,t,q,D){l.addItem(q,null,mxUtils.bind(this,function(){var G=new CreateGraphDialog(K,q,D);K.showDialog(G.container,620,420,!0,!1);G.init()}),t)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(l,t){for(var q=0;q<c.length;q++)"-"==c[q]?l.addSeparator(t):f(l,t,mxResources.get(c[q])+"...",c[q])})))};EditorUi.prototype.installFormatToolbar=function(K){var c=this.editor.graph,f=document.createElement("div");f.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";+f=function(l,t,q,D){l.addItem(q,null,mxUtils.bind(this,function(){var H=new CreateGraphDialog(K,q,D);K.showDialog(H.container,620,420,!0,!1);H.init()}),t)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(l,t){for(var q=0;q<c.length;q++)"-"==c[q]?l.addSeparator(t):f(l,t,mxResources.get(c[q])+"...",c[q])})))};EditorUi.prototype.installFormatToolbar=function(K){var c=this.editor.graph,f=document.createElement("div");f.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";c.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(l,t){0<c.getSelectionCount()?(K.appendChild(f),f.innerHTML="Selected: "+c.getSelectionCount()):null!=f.parentNode&&f.parentNode.removeChild(f)}))};var S=!1;EditorUi.prototype.initFormatWindow=function(){if(!S&&null!=this.formatWindow){S=!0;var K=this.formatWindow.window.toggleMinimized,c=240;this.formatWindow.window.toggleMinimized=function(){K.apply(this,arguments);this.minimized?(c=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+c-140+"px"):(this.div.style.width=c+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-c+140)+"px");this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(f){mxEvent.getSource(f)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var F=EditorUi.prototype.init;EditorUi.prototype.init=-function(){function K(B,I,U){var P=q.menus.get(B);I=N.addMenu(mxResources.get(B),mxUtils.bind(this,function(){P.funct.apply(this,arguments)}));I.className="geButton";I.setAttribute("title",mxResources.get(B));q.menus.menuCreated(P,I,"geButton");null!=U&&(I.style.backgroundImage="url("+U+")",I.innerText="");return I}function c(B,I,U,P,T,X){var Z=document.createElement("a");Z.className="geButton";G.appendChild(Z);null!=X?Z.style.backgroundImage="url("+X+")":mxUtils.write(Z,B);mxEvent.addListener(Z,-"click",function(ka){"disabled"!=Z.getAttribute("disabled")&&I(ka);mxEvent.consume(ka)});mxEvent.preventDefault(Z);null!=P&&Z.setAttribute("title",P);null!=T&&(B=function(){T.isEnabled()?Z.removeAttribute("disabled"):Z.setAttribute("disabled","disabled")},T.addListener("stateChanged",B),D.addListener("enabledChanged",B),B());return Z}function f(B,I,U){I=document.createElement("div");I.className="geButtonGroup";for(U=0;U<B.length;U++)null!=B[U]&&I.appendChild(B[U]);G.appendChild(I);return I}function l(){g=-window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;G.innerHTML="";var B=1E3>g,I=K("diagram",null,B?Editor.menuImage:null);f([I,c(mxResources.get("shapes"),q.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),q.actions.get("image"),B?Editor.shapesImage:null),c(mxResources.get("format"),q.actions.get("format").funct,null,mxResources.get("format")+" ("+q.actions.get("format").shortcut+")",q.actions.get("image"),B?Editor.formatImage:null)]);I=K("insert",!0,+function(){function K(B,I,U){var P=q.menus.get(B);I=N.addMenu(mxResources.get(B),mxUtils.bind(this,function(){P.funct.apply(this,arguments)}));I.className="geButton";I.setAttribute("title",mxResources.get(B));q.menus.menuCreated(P,I,"geButton");null!=U&&(I.style.backgroundImage="url("+U+")",I.innerText="");return I}function c(B,I,U,P,T,X){var Z=document.createElement("a");Z.className="geButton";H.appendChild(Z);null!=X?Z.style.backgroundImage="url("+X+")":mxUtils.write(Z,B);mxEvent.addListener(Z,+"click",function(ka){"disabled"!=Z.getAttribute("disabled")&&I(ka);mxEvent.consume(ka)});mxEvent.preventDefault(Z);null!=P&&Z.setAttribute("title",P);null!=T&&(B=function(){T.isEnabled()?Z.removeAttribute("disabled"):Z.setAttribute("disabled","disabled")},T.addListener("stateChanged",B),D.addListener("enabledChanged",B),B());return Z}function f(B,I,U){I=document.createElement("div");I.className="geButtonGroup";for(U=0;U<B.length;U++)null!=B[U]&&I.appendChild(B[U]);H.appendChild(I);return I}function l(){g=+window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;H.innerHTML="";var B=1E3>g,I=K("diagram",null,B?Editor.menuImage:null);f([I,c(mxResources.get("shapes"),q.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),q.actions.get("image"),B?Editor.shapesImage:null),c(mxResources.get("format"),q.actions.get("format").funct,null,mxResources.get("format")+" ("+q.actions.get("format").shortcut+")",q.actions.get("image"),B?Editor.formatImage:null)]);I=K("insert",!0,B?ea:null);f([I,c(mxResources.get("delete"),q.actions.get("delete").funct,null,mxResources.get("delete"),q.actions.get("delete"),B?Editor.trashImage:null)]);D.isEnabled()||I.setAttribute("disabled","disabled");la.setAttribute("title",mxResources.get("undo")+" ("+ja.shortcut+")");Q.setAttribute("title",mxResources.get("redo")+" ("+ca.shortcut+")");k.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");411<=g&&(f([la,Q]),520<=g&&f([k,640<=g?c("",W.funct,!0,mxResources.get("zoomIn")+-" ("+Editor.ctrlKey+" +)",W,Editor.zoomInImage):null,640<=g?c("",ba.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",ba,Editor.zoomOutImage):null]));G.appendChild(q.statusContainer);G.appendChild(q.buttonContainer)}F.apply(this,arguments);var t=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=t&&(t.classList.add("geSimple"),t.classList.add("geMinimal"),t.classList.remove("geClassic"));this.sidebar=this.createSidebar(this.sidebarContainer);-if(1E3<=g||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])e(this,!0),null!=this.sidebar&&null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search"));EditorUi.windowed&&1E3<=g&&(b(this,!0),this.formatWindow.window.setVisible(!0));var q=this,D=q.editor.graph;q.toolbar=this.createToolbar(q.createDiv("geToolbar"));var G=document.createElement("div");G.className="geMenubarContainer";-var N=new Menubar(q,G),L=q.hideCurrentMenu;q.hideCurrentMenu=function(){L.apply(this,arguments);this.editor.graph.popupMenuHandler.hideMenu()};var J=q.descriptorChanged;q.descriptorChanged=function(){J.apply(this,arguments);var B=q.getCurrentFile();if(null!=B&&null!=B.getTitle()){var I=B.getMode();"google"==I?I="googleDrive":"github"==I?I="gitHub":"gitlab"==I?I="gitLab":"onedrive"==I&&(I="oneDrive");I=mxResources.get(I);G.setAttribute("title",B.getTitle()+(null!=I?" ("+I+")":""))}else G.removeAttribute("title")};-q.setStatusText(q.editor.getStatus());G.appendChild(q.statusContainer);q.buttonContainer=this.createButtonContainer();G.appendChild(q.buttonContainer);q.menubarContainer=q.buttonContainer;q.tabContainer=this.createTabContainer();var Y=this.createZoomInput(!0),ha=q.updateTabContainer;q.updateTabContainer=function(){ha.apply(this,arguments);q.tabContainer.appendChild(Y)};var ea=Editor.addBoxImage;if(null!=q.hoverIcons){var aa=q.hoverIcons.update;q.hoverIcons.update=function(){D.freehand.isDrawing()||+" ("+Editor.ctrlKey+" +)",W,Editor.zoomInImage):null,640<=g?c("",ba.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",ba,Editor.zoomOutImage):null]));H.appendChild(q.statusContainer);H.appendChild(q.buttonContainer)}F.apply(this,arguments);var t=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=t&&(t.classList.add("geSimple"),t.classList.add("geMinimal"),t.classList.remove("geClassic"));this.sidebar=this.createSidebar(this.sidebarContainer);+if(1E3<=g||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])e(this,!0),null!=this.sidebar&&null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search"));EditorUi.windowed&&1E3<=g&&(b(this,!0),this.formatWindow.window.setVisible(!0));var q=this,D=q.editor.graph;q.toolbar=this.createToolbar(q.createDiv("geToolbar"));var H=document.createElement("div");H.className="geMenubarContainer";+var N=new Menubar(q,H),L=q.hideCurrentMenu;q.hideCurrentMenu=function(){L.apply(this,arguments);this.editor.graph.popupMenuHandler.hideMenu()};var J=q.descriptorChanged;q.descriptorChanged=function(){J.apply(this,arguments);var B=q.getCurrentFile();if(null!=B&&null!=B.getTitle()){var I=B.getMode();"google"==I?I="googleDrive":"github"==I?I="gitHub":"gitlab"==I?I="gitLab":"onedrive"==I&&(I="oneDrive");I=mxResources.get(I);H.setAttribute("title",B.getTitle()+(null!=I?" ("+I+")":""))}else H.removeAttribute("title")};+q.setStatusText(q.editor.getStatus());H.appendChild(q.statusContainer);q.buttonContainer=this.createButtonContainer();H.appendChild(q.buttonContainer);q.menubarContainer=q.buttonContainer;q.tabContainer=this.createTabContainer();var Y=this.createZoomInput(!0),ha=q.updateTabContainer;q.updateTabContainer=function(){ha.apply(this,arguments);q.tabContainer.appendChild(Y)};var ea=Editor.addBoxImage;if(null!=q.hoverIcons){var aa=q.hoverIcons.update;q.hoverIcons.update=function(){D.freehand.isDrawing()||aa.apply(this,arguments)}}if(null!=D.freehand){var na=D.freehand.createStyle;D.freehand.createStyle=function(B){return na.apply(this,arguments)+"sketch=0;"}}q.editor.addListener("statusChanged",mxUtils.bind(this,function(){q.setStatusText(q.editor.getStatus())}));q.setStatusText(q.editor.getStatus());var W=q.actions.get("zoomIn"),ba=q.actions.get("zoomOut");t=q.actions.get("resetView");var ja=q.actions.get("undo"),ca=q.actions.get("redo"),la=c("",ja.funct,null,"",ja,Editor.undoImage),Q=c("",ca.funct,-null,"",ca,Editor.redoImage),k=c("",function(B){mxEvent.isAltDown(B)?(q.hideCurrentMenu(),q.actions.get("customZoom").funct()):(q.hideCurrentMenu(),q.actions.get("smartFit").funct());mxEvent.consume(B)},!0,"",t,Editor.zoomFitImage);q.container.appendChild(q.tabContainer);q.container.appendChild(G);q.updateTabContainer();!EditorUi.windowed&&1E3<=g&&b(this,!0);l();q.addListener("lockedChanged",l);q.addListener("languageChanged",l);q.editor.graph.addListener("enabledChanged",l);mxEvent.addListener(window,+null,"",ca,Editor.redoImage),k=c("",function(B){mxEvent.isAltDown(B)?(q.hideCurrentMenu(),q.actions.get("customZoom").funct()):(q.hideCurrentMenu(),q.actions.get("smartFit").funct());mxEvent.consume(B)},!0,"",t,Editor.zoomFitImage);q.container.appendChild(q.tabContainer);q.container.appendChild(H);q.updateTabContainer();!EditorUi.windowed&&1E3<=g&&b(this,!0);l();q.addListener("lockedChanged",l);q.addListener("languageChanged",l);q.editor.graph.addListener("enabledChanged",l);mxEvent.addListener(window,"resize",function(){l();null!=q.sidebarWindow&&q.sidebarWindow.window.fit();null!=q.formatWindow&&q.formatWindow.window.fit();null!=q.actions.outlineWindow&&q.actions.outlineWindow.window.fit();null!=q.actions.layersWindow&&q.actions.layersWindow.window.fit();null!=q.menus.chatWindow&&q.menus.chatWindow.window.fit();null!=q.menus.tagsWindow&&q.menus.tagsWindow.window.fit();null!=q.menus.findWindow&&q.menus.findWindow.window.fit();null!=q.menus.findReplaceWindow&&q.menus.findReplaceWindow.window.fit()})}}};-(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var e=EditorUi.initTheme;EditorUi.initTheme=function(){e.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();DrawioComment=function(b,e,g,m,v,p,A){this.file=b;this.id=e;this.content=g;this.modifiedDate=m;this.createdDate=v;this.isResolved=p;this.user=A;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,e,g,m,v){e()};DrawioComment.prototype.editComment=function(b,e,g){e()};DrawioComment.prototype.deleteComment=function(b,e){b()};DrawioUser=function(b,e,g,m,v){this.id=b;this.email=e;this.displayName=g;this.pictureUrl=m;this.locale=v};mxResources.parse('# *DO NOT DIRECTLY EDIT THIS FILE, IT IS AUTOMATICALLY GENERATED AND IT IS BASED ON:*\n# https://docs.google.com/spreadsheet/ccc?key=0AmQEO36liL4FdDJLWVNMaVV2UmRKSnpXU09MYkdGbEE\nabout=About\naboutDrawio=About draw.io\naccessDenied=Access Denied\naccounts=Accounts\naction=Action\nactualSize=Actual Size\nadaptiveColors=Adaptive Colors\nadd=Add\naddAccount=Add account\naddedFile=Added {1}\naddImages=Add Images\naddImageUrl=Add Image URL\naddLayer=Add Layer\naddProperty=Add Property\naddress=Address\naddToExistingDrawing=Add to Existing Drawing\naddToScratchpad=Add to Scratchpad\naddWaypoint=Add Waypoint\nadjustTo=Adjust to\nadvanced=Advanced\nsmartTemplate=Smart Template\nalign=Align\nalignment=Alignment\nallChangesLost=All changes will be lost!\nallPages=All Pages\nallProjects=All Projects\nallSpaces=All Spaces\nallTags=All Tags\nanchor=Anchor\nandroid=Android\nangle=Angle\nanimations=Animations\narc=Arc\nareYouSure=Are you sure?\nensureDataSaved=Please ensure your data is saved before closing.\nallChangesSaved=All changes saved\nallChangesSavedInDrive=All changes saved in Drive\nallowPopups=Allow pop-ups to avoid this dialog.\nallowRelativeUrl=Allow relative URL\nalreadyConnected=Nodes already connected\nappearance=Appearance\napply=Apply\narchiMate21=ArchiMate 2.1\narrange=Arrange\narrow=Arrow\narrows=Arrows\naskMeAnything=Ask me anything\nasNew=As New\natlas=Atlas\nauthor=Author\nauthorizationRequired=Authorization required\nauthorizeThisAppIn=Authorize this app in {1}:\nauthorize=Authorize\nauthorizing=Authorizing\nautomatic=Automatic\nautosave=Autosave\nautosize=Autosize\nattachments=Attachments\naws=AWS\naws3d=AWS 3D\nazure=Azure\nback=Back\nbackground=Background\nbackgroundColor=Background Color\nbackgroundImage=Background Image\nbasic=Basic\nbeta=beta\nblankDrawing=Blank Drawing\nblankDiagram=Blank Diagram\nblock=Block\nblockquote=Blockquote\nblog=Blog\nbold=Bold\nbootstrap=Bootstrap\nborder=Border\nborderColor=Border Color\nborderWidth=Border Width\nbottom=Bottom\nbottomAlign=Bottom Align\nbottomLeft=Bottom Left\nbottomRight=Bottom Right\nbpmn=BPMN\nbringForward=Bring Forward\nbrowser=Browser\nbulletedList=Bulleted List\nbusiness=Business\nbusy=Operation in progress\ncabinets=Cabinets\ncancel=Cancel\ncenter=Center\ncannotLoad=Load attempts failed. Please try again later.\ncannotLogin=Log in attempts failed. Please try again later.\ncannotOpenFile=Cannot open file\nchange=Change\nchangeOrientation=Change Orientation\nchangeUser=Change user\nchangeStorage=Change storage\nchangesNotSaved=Changes have not been saved\nclassDiagram=Class Diagram\nuserJoined={1} has joined\nuserLeft={1} has left\nchatWindowTitle=Chat\nchooseAnOption=Choose an option\nchromeApp=Chrome App\ncollaborativeEditingNotice=Important Notice for Collaborative Editing\ncompare=Compare\ncompressed=Compressed\ncommitMessage=Commit Message\nconfigLinkWarn=This link configures draw.io. Only click OK if you trust whoever gave you it!\nconfigLinkConfirm=Click OK to configure and restart draw.io.\ncontainer=Container\ncsv=CSV\ndark=Dark\ndiagramLanguage=Diagram Language\ndiagramType=Diagram type\ndiagramXmlDesc=XML File\ndiagramHtmlDesc=HTML File\ndiagramPngDesc=Editable Bitmap Image\ndiagramSvgDesc=Editable Vector Image\ndidYouMeanToExportToPdf=Did you mean to export to PDF?\ndisabled=Disabled\ndraftFound=A draft for \'{1}\' has been found. Load it into the editor or discard it to continue.\ndraftRevisionMismatch=There is a different version of this diagram on a shared draft of this page. Please edit the diagram from the draft to ensure you are working with the latest version.\nselectDraft=Select a draft to continue editing:\ndragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?\ndropboxCharsNotAllowed=The following characters are not allowed: / : ? * " |\ncheck=Check\nchecksum=Checksum\ncircle=Circle\ncisco=Cisco\nclassic=Classic\nclearDefaultStyle=Clear Default Style\nclearWaypoints=Clear Waypoints\nclipart=Clipart\nclose=Close\nclosingFile=Closing file\nrealtimeCollaboration=Real-Time Collaboration\ncollaborate=Collaborate\ncollaborator=Collaborator\ncollaborators=Collaborators\ncollapse=Collapse\ncollapseExpand=Collapse/Expand\ncollapse-expand=Click to collapse/expand\nShift-click to move neighbors \nAlt-click to protect group size\ncollapsible=Collapsible\ncomic=Comic\ncomment=Comment\ncommentsNotes=Comments/Notes\ncompress=Compress\nconfiguration=Configuration\nconnect=Connect\nconnecting=Connecting\nconnectWithDrive=Connect with Google Drive\nconnection=Connection\nconnectionArrows=Connection Arrows\nconnectionPoints=Connection Points\nconstrainProportions=Constrain Proportions\ncontainsValidationErrors=Contains validation errors\ncopiedToClipboard=Copied to clipboard\ncopy=Copy\ncopyConnect=Copy on connect\ncopyCreated=A copy of the file was created.\ncopyData=Copy Data\ncopyOf=Copy of {1}\ncopyOfDrawing=Copy of Drawing\ncopySize=Copy Size\ncopyStyle=Copy Style\ncreate=Create\ncreateBlankDiagram=Create Blank Diagram\ncreateNewDiagram=Create New Diagram\ncreateRevision=Create Revision\ncreateShape=Create Shape\ncrop=Crop\ncurved=Curved\ncustom=Custom\ncurrent=Current\ncurrentPage=Current page\ncut=Cut\ndashed=Dashed\ndecideLater=Decide later\ndefault=Default\ndelete=Delete\ndeleteAll=Delete all\ndeleteColumn=Delete column\ndeleteLibrary401=Insufficient permissions to delete this library\ndeleteLibrary404=Selected library could not be found\ndeleteLibrary500=Error deleting library\ndeleteLibraryConfirm=You are about to permanently delete this library. Are you sure you want to do this?\ndeleteRow=Delete Row\ndescription=Description\ndescribeYourDiagram=Describe your diagram\ndevice=Device\ndiagram=Diagram\ndiagramContent=Diagram Content\ndiagramLocked=Diagram has been locked to prevent further data loss.\ndiagramLockedBySince=The diagram is locked by {1} since {2} ago\ndiagramName=Diagram Name\ndiagramIsPublic=Diagram is public\ndiagramIsNotPublic=Diagram is not public\ndiamond=Diamond\ndiamondThin=Diamond (thin)\ndidYouKnow=Did you know...\ndirection=Direction\ndiscard=Discard\ndiscardChangesAndReconnect=Discard Changes and Reconnect\ngoogleDriveMissingClickHere=Google Drive missing? Click here!\ndiscardChanges=Discard Changes\ndisconnected=Disconnected\ndistribute=Distribute\ndone=Done\ndoNotShowAgain=Do not show again\ndotted=Dotted\ndoubleClickOrientation=Doubleclick to change orientation\ndoubleClickTooltip=Doubleclick to insert text\ndoubleClickChangeProperty=Doubleclick to change property name\ndownload=Download\ndownloadDesktop=Get Desktop\ndownloadAs=Download as\nclickHereToSave=Click here to save.\ndpi=DPI\ndraftDiscarded=Draft discarded\ndraftSaved=Draft saved\ndragElementsHere=Drag elements here\ndragImagesHere=Drag images or URLs here\ndragUrlsHere=Drag URLs here\ndraw.io=draw.io\ndrawing=Drawing{1}\ndrawingEmpty=Drawing is empty\ndrawingTooLarge=Drawing is too large\ndrawioForWork=Draw.io for GSuite\ndropbox=Dropbox\nduplicate=Duplicate\nduplicateIt=Duplicate {1}\ndivider=Divider\ndx=Dx\ndy=Dy\neast=East\nedit=Edit\neditData=Edit Data\neditDiagram=Edit Diagram\neditGeometry=Edit Geometry\neditImage=Edit Image\neditImageUrl=Edit Image URL\neditLink=Edit Link\neditShape=Edit Shape\neditStyle=Edit Style\neditText=Edit Text\neditTooltip=Edit Tooltip\nglass=Glass\ngoogleImages=Google Images\nimageSearch=Image Search\neip=EIP\nembed=Embed\nembedFonts=Embed Fonts\nembedImages=Embed Images\nmainEmbedNotice=Paste this into the page\nelectrical=Electrical\nellipse=Ellipse\nembedNotice=Paste this once at the end of the page\nenterGroup=Enter Group\nenterName=Enter Name\nenterPropertyName=Enter Property Name\nenterValue=Enter Value\nentityRelation=Entity Relation\nentityRelationshipDiagram=Entity Relationship Diagram\nerror=Error\nerrorDeletingFile=Error deleting file\nerrorLoadingFile=Error loading file\nerrorRenamingFile=Error renaming file\nerrorRenamingFileNotFound=Error renaming file. File was not found.\nerrorRenamingFileForbidden=Error renaming file. Insufficient access rights.\nerrorSavingDraft=Error saving draft\nerrorSavingFile=Error saving file\nerrorSavingFileUnknown=Error authorizing with Google\'s servers. Please refresh the page to re-attempt.\nerrorSavingFileForbidden=Error saving file. Insufficient access rights.\nerrorSavingFileNameConflict=Could not save diagram. Current page already contains file named \'{1}\'.\nerrorSavingFileNotFound=Error saving file. File was not found.\nerrorSavingFileReadOnlyMode=Could not save diagram while read-only mode is active.\nerrorSavingFileSessionTimeout=Your session has ended. Please <a target=\'_blank\' href=\'{1}\'>{2}</a> and return to this tab to try to save again.\nerrorSendingFeedback=Error sending feedback.\nerrorUpdatingPreview=Error updating preview.\nexit=Exit\nexitGroup=Exit Group\nexpand=Expand\nexplore=Explore\nexport=Export\nexporting=Exporting\nexportAs=Export as\nexportOptionsDisabled=Export options disabled\nexportOptionsDisabledDetails=The owner has disabled options to download, print or copy for commenters and viewers on this file.\nexternalChanges=External Changes\nextras=Extras\nfacebook=Facebook\nfailedToSaveTryReconnect=Failed to save, trying to reconnect\nfeatureRequest=Feature Request\nfeedback=Feedback\nfeedbackSent=Feedback successfully sent.\nfloorplans=Floorplans\nfile=File\nfileChangedOverwriteDialog=The file has been modified. Do you want to save the file and overwrite those changes?\nfileChangedSyncDialog=The file has been modified.\nfileChangedSync=The file has been modified. Click here to synchronize.\noverwrite=Overwrite\nsynchronize=Synchronize\nfilename=Filename\nfileExists=File already exists\nfileMovedToTrash=File was moved to trash\nfileNearlyFullSeeFaq=File nearly full, please see FAQ\nfileNotFound=File not found\nrepositoryNotFound=Repository not found\nfileNotFoundOrDenied=The file was not found. It does not exist or you do not have access.\nfileNotLoaded=File not loaded\nfileNotSaved=File not saved\nfileOpenLocation=How would you like to open these file(s)?\nfiletypeHtml=.html causes file to save as HTML with redirect to cloud URL\nfiletypePng=.png causes file to save as PNG with embedded data\nfiletypeSvg=.svg causes file to save as SVG with embedded data\nfileWillBeSavedInAppFolder={1} will be saved in the app folder.\nfill=Fill\nfillColor=Fill Color\nfilterCards=Filter Cards\nfind=Find\nfit=Fit\nfitContainer=Resize Container\nfitIntoContainer=Fit into Container\nfitPage=Fit Page\nfitPageWidth=Fit Page Width\nfitTo=Fit to\nfitToSheetsAcross=sheet(s) across\nfitToBy=by\nfitToSheetsDown=sheet(s) down\nfitTwoPages=Two Pages\nfitWindow=Fit Window\nflip=Flip\nflipH=Flip Horizontal\nflipV=Flip Vertical\nflowAnimation=Flow Animation\nflowchart=Flowchart\nfolder=Folder\nfont=Font\nfontColor=Font Color\nfontFamily=Font Family\nfontSize=Font Size\nforbidden=You are not authorized to access this file\nformat=Format\nformatPanel=Format Panel\nformatted=Formatted\nformattedText=Formatted Text\nformatPng=PNG\nformatGif=GIF\nformatJpg=JPEG\nformatPdf=PDF\nformatSql=SQL\nformatSvg=SVG\nformatHtmlEmbedded=HTML\nformatSvgEmbedded=SVG (with XML)\nformatVsdx=VSDX\nformatVssx=VSSX\nformatWebp=WebP\nformatXmlPlain=XML (Plain)\nformatXml=XML\nforum=Discussion/Help Forums\nfreehand=Freehand\nfromTemplate=From Template\nfromTemplateUrl=From Template URL\nfromText=From Text\nfromUrl=From URL\nfromThisPage=From this page\nfullscreen=Fullscreen\ngap=Gap\ngcp=GCP\ngeneral=General\ngetNotionChromeExtension=Get the Notion Chrome Extension\ngithub=GitHub\ngitlab=GitLab\ngliffy=Gliffy\nglobal=Global\ngoogleDocs=Google Docs\ngoogleDrive=Google Drive\ngoogleGadget=Google Gadget\ngoogleSharingNotAvailable=Sharing is only available via Google Drive. Please click Open below and share from the more actions menu:\ngoogleSlides=Google Slides\ngoogleSites=Google Sites\ngoogleSheets=Google Sheets\ngradient=Gradient\ngradientColor=Color\ngrid=Grid\ngridColor=Grid Color\ngridSize=Grid Size\ngroup=Group\nguides=Guides\nhateApp=I hate draw.io\nheading=Heading\nheight=Height\nhelp=Help\nhelpTranslate=Help us translate this application\nhide=Hide\nhideIt=Hide {1}\nhidden=Hidden\nhighContrast=High Contrast\nhome=Home\nhorizontal=Horizontal\nhorizontalFlow=Horizontal Flow\nhorizontalTree=Horizontal Tree\nhowTranslate=How good is the translation in your language?\nhtml=HTML\nhtmlText=HTML Text\nid=ID\niframe=IFrame\nignore=Ignore\nimage=Image\nimageUrl=Image URL\nimages=Images\nimagePreviewError=This image couldn\'t be loaded for preview. Please check the URL.\nimageTooBig=Image too big\nimgur=Imgur\nimport=Import\nimportFrom=Import from\nimproveContrast=Improve Contrast\nincludeCopyOfMyDiagram=Include a copy of my diagram\nincreaseIndent=Increase Indent\ndecreaseIndent=Decrease Indent\ninsert=Insert\ninsertColumnBefore=Insert Column Left\ninsertColumnAfter=Insert Column Right\ninsertEllipse=Insert Ellipse\ninsertImage=Insert Image\ninsertHorizontalRule=Insert Horizontal Rule\ninsertLink=Insert Link\ninsertPage=Insert Page\ninsertRectangle=Insert Rectangle\ninsertRhombus=Insert Rhombus\ninsertRowBefore=Insert Row Above\ninsertRowAfter=Insert Row After\ninsertText=Insert Text\ninserting=Inserting\ninstallApp=Install App\ninvalidFilename=Diagram names must not contain the following characters: / | : ; { } < > & + ? = "\ninvalidLicenseSeeThisPage=Your license is invalid, please see this <a target="_blank" href="https://www.drawio.com/doc/faq/license-drawio-confluence-jira-cloud">page</a>.\ninvalidInput=Invalid input\ninvalidName=Invalid name\ninvalidOrMissingFile=Invalid or missing file\ninvalidPublicUrl=Invalid public URL\nisometric=Isometric\nios=iOS\nitalic=Italic\nkennedy=Kennedy\nkeyboardShortcuts=Keyboard Shortcuts\nlabels=Labels\nlayers=Layers\nlandscape=Landscape\nlanguage=Language\nleanMapping=Lean Mapping\nlastChange=Last change {1} ago\nlessThanAMinute=less than a minute\nlicensingError=Licensing Error\nlicenseHasExpired=The license for {1} has expired on {2}. Click here.\nlicenseRequired=This feature requires draw.io to be licensed.\nlicenseWillExpire=The license for {1} will expire on {2}. Click here.\nlight=Light\nlineJumps=Line jumps\nlinkAccountRequired=If the diagram is not public a Google account is required to view the link.\nlinkText=Link Text\nlist=List\nminute=minute\nminutes=minutes\nhours=hours\ndays=days\nmonths=months\nyears=years\nrestartForChangeRequired=Changes will take effect after a restart of the application.\nlaneColor=Lanecolor\nlanguageCode=Language Code\nlastModified=Last modified\nlayout=Layout\nleft=Left\nleftAlign=Left Align\nleftToRight=Left to right\nlibraryTooltip=Drag and drop shapes here or click + to insert. Double click to edit.\nlightbox=Lightbox\nline=Line\nlineend=Line end\nlineheight=Line Height\nlinestart=Line start\nlinewidth=Linewidth\nlink=Link\nlinks=Links\nloading=Loading\nlocked=Locked\nlockUnlock=Lock/Unlock\nloggedOut=Logged Out\nlogIn=log in\nloveIt=I love {1}\nlucidchart=Lucidchart\nmaps=Maps\nmathematicalTypesetting=Mathematical Typesetting\nmakeCopy=Make a Copy\nmanual=Manual\nmerge=Merge\nmermaid=Mermaid\nmicrosoftOffice=Microsoft Office\nmicrosoftExcel=Microsoft Excel\nmicrosoftPowerPoint=Microsoft PowerPoint\nmicrosoftWord=Microsoft Word\nmiddle=Middle\nminimal=Minimal\nmisc=Misc\nmockups=Mockups\nmodern=Modern\nmodificationDate=Modification date\nmodifiedBy=Modified by\nmore=More\nmoreResults=More Results\nmoreShapes=More Shapes\nmove=Move\nmoveToFolder=Move to Folder\nmoving=Moving\nmoveSelectionTo=Move selection to {1}\nmyDrive=My Drive\nmyFiles=My Files\nname=Name\nnavigation=Navigation\nnetwork=Network\nnetworking=Networking\nnew=New\nnewLibrary=New Library\nnextPage=Next Page\nno=No\nnoPickFolder=No, pick folder\nnoAttachments=No attachments found\nnoColor=No Color\nnoFiles=No Files\nnoFileSelected=No file selected\nnoLibraries=No libraries found\nnoMoreResults=No more results\nnone=None\nnoOtherViewers=No other viewers\nnoPlugins=No plugins\nnoPreview=No preview\nnoResponse=No response from server\nnoResultsFor=No results for \'{1}\'\nnoRevisions=No revisions\nnoSearchResults=No search results found\nnoPageContentOrNotSaved=No anchors found on this page or it hasn\'t been saved yet\nnormal=Normal\nnorth=North\nnotADiagramFile=Not a diagram file\nnotALibraryFile=Not a library file\nnotAvailable=Not available\nnotAUtf8File=Not a UTF-8 file\nnotConnected=Not connected\nnote=Note\nnotion=Notion\nnotSatisfiedWithImport=Not satisfied with the import?\nnotUsingService=Not using {1}?\nnumberedList=Numbered list\noffline=Offline\nok=OK\noneDrive=OneDrive\nonline=Online\nopacity=Opacity\nopen=Open\nopenArrow=Open Arrow\nopenExistingDiagram=Open Existing Diagram\nopenFile=Open File\nopenFrom=Open from\nopenLibrary=Open Library\nopenLibraryFrom=Open Library from\nopenLink=Open Link\nopenInNewWindow=Open in New Window\nopenInThisWindow=Open in This Window\nopenIt=Open {1}\nopenRecent=Open Recent\nopenSupported=Supported formats are files saved from this software (.xml), .vsdx and .gliffy\noptions=Options\norganic=Organic\norgChart=Org Chart\northogonal=Orthogonal\notherViewer=other viewer\notherViewers=other viewers\noutline=Outline\noval=Oval\npage=Page\npageContent=Page Content\npageNotFound=Page not found\npageWithNumber=Page-{1}\npages=Pages\npageTabs=Page Tabs\npageView=Page View\npageSetup=Page Setup\npageScale=Page Scale\npan=Pan\npanTooltip=Space+Drag to pan\npaperSize=Paper Size\npattern=Pattern\nparallels=Parallels\npaste=Paste\npasteData=Paste Data\npasteHere=Paste here\npasteSize=Paste Size\npasteStyle=Paste Style\nperimeter=Perimeter\npermissionAnyone=Anyone can edit\npermissionAuthor=Owner and admins can edit\npickFolder=Pick a folder\npickLibraryDialogTitle=Select Library\npublicDiagramUrl=Public URL of the diagram\nplaceholders=Placeholders\nplantUml=PlantUML\nplugins=Plugins\npluginUrl=Plugin URL\npluginWarning=The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n\nplusTooltip=Click to connect and clone (ctrl+click to clone, shift+click to connect). Drag to connect (ctrl+drag to clone).\nportrait=Portrait\nposition=Position\nposterPrint=Poster Print\npreferences=Preferences\npreview=Preview\npreviousPage=Previous Page\npresentationMode=Presentation Mode\nprint=Print\nprocEng=Proc. Eng.\nproject=Project\npriority=Priority\nprocessForHiringNewEmployee=Process for hiring a new employee\nproperties=Properties\npublish=Publish\nquickStart=Quick Start Video\nrack=Rack\nradial=Radial\nradialTree=Radial Tree\nreadOnly=Read-only\nreconnecting=Reconnecting\nrecentlyUpdated=Recently Updated\nrecentlyViewed=Recently Viewed\nrectangle=Rectangle\nredirectToNewApp=This file was created or modified in a newer version of this app. You will be redirected now.\nrealtimeTimeout=It looks like you\'ve made a few changes while offline. We\'re sorry, these changes cannot be saved.\nredo=Redo\nrefresh=Refresh\nregularExpression=Regular Expression\nrelative=Relative\nrelativeUrlNotAllowed=Relative URL not allowed\nrememberMe=Remember me\nrememberThisSetting=Remember this setting\nremoveFormat=Clear Formatting\nremoveFromGroup=Remove from Group\nremoveIt=Remove {1}\nremoveWaypoint=Remove Waypoint\nrename=Rename\nrenamed=Renamed\nrenameIt=Rename {1}\nrenaming=Renaming\nreplace=Replace\nreplaceIt={1} already exists. Do you want to replace it?\nreplaceExistingDrawing=Replace existing drawing\nrequired=required\nrequirementDiagram=Requirement Diagram\nreset=Reset\nresetView=Reset View\nresize=Resize\nresizeLargeImages=Do you want to resize large images to make the application run faster?\nretina=Retina\nresponsive=Responsive\nrestore=Restore\nrestoring=Restoring\nretryingIn=Retrying in {1} second(s)\nretryingLoad=Load failed. Retrying...\nretryingLogin=Login time out. Retrying...\nreverse=Reverse\nrevision=Revision\nrevisionHistory=Revision History\nrhombus=Rhombus\nright=Right\nrightAlign=Right Align\nrightToLeft=Right to left\nrotate=Rotate\nrotateTooltip=Click and drag to rotate, click to turn shape only by 90 degrees\nrotation=Rotation\nrounded=Rounded\nsave=Save\nsaveAndExit=Save & Exit\nsaveAs=Save As\nsaveAsXmlFile=Save as XML file?\nsaved=Saved\nsaveDiagramFirst=Please save the diagram first\nsaveDiagramsTo=Save diagrams to\nsaveLibrary403=Insufficient permissions to edit this library\nsaveLibrary500=There was an error while saving the library\nsaveLibraryReadOnly=Could not save library while read-only mode is active\nsaving=Saving\nscratchpad=Scratchpad\nscrollbars=Scrollbars\nsearch=Search\nsearchShapes=Search Shapes\nselectAll=Select All\nselectionOnly=Selection Only\nselectCard=Select Card\nselectEdges=Select Edges\nselectedPage=Selected Page\nselectFile=Select File\nselectFolder=Select Folder\nselectFont=Select Font\nselectNone=Select None\nselectTemplate=Select Template\nselectVertices=Select Vertices\nsendBackward=Send Backward\nsendMessage=Send\nsendYourFeedback=Send your feedback\nsequenceDiagram=Sequence Diagram\nserviceUnavailableOrBlocked=Service unavailable or blocked\nsessionExpired=Your session has expired. Please refresh the browser window.\nsessionTimeoutOnSave=Your session has timed out and you have been disconnected from the Google Drive. Press OK to login and save.\nsetAsDefaultStyle=Set as Default Style\nsettings=Settings\nshadow=Shadow\nshape=Shape\nshapes=Shapes\nshare=Share\nshareCursor=Share Mouse Cursor\nshareLink=Link for shared editing\nsharingAvailable=Sharing available for Google Drive and OneDrive files.\nsaveItToGoogleDriveToCollaborate=You\'ll need to save "{1}" to Google Drive before you can collaborate.\nsaveToGoogleDrive=Save to Google Drive\nsharp=Sharp\nshow=Show\nshowRemoteCursors=Show Remote Mouse Cursors\nshowStartScreen=Show Start Screen\nsidebarTooltip=Click or drag and drop shapes. Shift+click to change selection. Alt+click to insert and connect.\nsigns=Signs\nsignOut=Sign out\nsimple=Simple\nsimpleArrow=Simple Arrow\nsimpleViewer=Simple Viewer\nsize=Size\nsketch=Sketch\nsmoothing=Smoothing\nsnapToGrid=Snap to Grid\nsolid=Solid\nsourceSpacing=Source Spacing\nsouth=South\nsoftware=Software\nspace=Space\nspacing=Spacing\nspecialLink=Special Link\nstateDiagram=State Diagram\nstandard=Standard\nstartDrawing=Start drawing\nstopDrawing=Stop drawing\nstarting=Starting\nstraight=Straight\nstrikethrough=Strikethrough\nstrokeColor=Line Color\nstyle=Style\nsubscript=Subscript\nsummary=Summary\nsuperscript=Superscript\nsupport=Support\nswap=Swap\nswimlaneDiagram=Swimlane Diagram\nsysml=SysML\ntags=Tags\ntable=Table\ntables=Tables\ntakeOver=Take Over\ntargetSpacing=Target Spacing\ntemplate=Template\ntemplates=Templates\ntext=Text\ntextAlignment=Text Alignment\ntextOpacity=Text Opacity\ntheme=Theme\ntimeout=Timeout\ntitle=Title\nto=to\ntoBack=To Back\ntoFront=To Front\ntooLargeUseDownload=Too large, use download instead.\ntoolbar=Toolbar\ntooltips=Tooltips\ntop=Top\ntopAlign=Top Align\ntopLeft=Top Left\ntopRight=Top Right\ntransparent=Transparent\ntransparentBackground=Transparent Background\ntrello=Trello\ntryAgain=Try again\ntryOpeningViaThisPage=Try opening via this page\nturn=Rotate shape only by 90°\ntype=Type\ntwitter=Twitter\numl=UML\nunassigned=Unassigned\nunderline=Underline\nundo=Undo\nungroup=Ungroup\nunmerge=Unmerge\nunsavedChanges=Unsaved changes\nunsavedChangesClickHereToSave=Unsaved changes. Click here to save.\nuntitled=Untitled\nuntitledDiagram=Untitled Diagram\nuntitledLayer=Untitled Layer\nuntitledLibrary=Untitled Library\nunknownError=Unknown error\nunknownUser=Unknown user\nupdateExistingDrawing=Update existing drawing\nupdateFile=Update {1}\nupdatingDocument=Updating Document. Please wait...\nupdatingPreview=Updating Preview. Please wait...\nupdatingSelection=Updating Selection. Please wait...\nupload=Upload\nurl=URL\nuseBlackAndWhite=Use black and white\nuseCurrentSettings=Use current settings\nuseOffline=Use Offline\nuserDefined=User-defined\nuseRootFolder=Use root folder?\nuserManual=User Manual\nvertical=Vertical\nverticalFlow=Vertical Flow\nverticalTree=Vertical Tree\nview=View\nviewerSettings=Viewer Settings\nviewUrl=Link to view: {1}\nvoiceAssistant=Voice Assistant (beta)\nwarning=Warning\nwaypoints=Waypoints\nwest=West\nwhere=Where\nwidth=Width\nwiki=Wiki\nwordWrap=Word Wrap\nwritingDirection=Writing Direction\nyes=Yes\nyourEmailAddress=Your email address\nzoom=Zoom\nzoomIn=Zoom In\nzoomOut=Zoom Out\nbasic=Basic\nbusinessprocess=Business Processes\ncharts=Charts\nengineering=Engineering\nflowcharts=Flowcharts\ngmdl=Material Design\nmindmaps=Mindmaps\nmockups=Mockups\nnetworkdiagrams=Network Diagrams\nnothingIsSelected=Nothing is selected\nother=Other\nsoftwaredesign=Software Design\nvenndiagrams=Venn Diagrams\nwebEmailOrOther=Web, email or any other internet address\nwebLink=Web Link\nwireframes=Wireframes\nproperty=Property\nvalue=Value\nshowMore=Show More\nshowLess=Show Less\nmyDiagrams=My Diagrams\nallDiagrams=All Diagrams\nrecentlyUsed=Recently used\nlistView=List view\ngridView=Grid view\nresultsFor=Results for \'{1}\'\noneDriveCharsNotAllowed=The following characters are not allowed: ~ " # % * : < > ? / { | }\noneDriveInvalidDeviceName=The specified device name is invalid\nofficeNotLoggedOD=You are not logged in to OneDrive. Please open draw.io task pane and login first.\nofficeSelectSingleDiag=Please select a single draw.io diagram only without other contents.\nofficeSelectDiag=Please select a draw.io diagram.\nofficeCannotFindDiagram=Cannot find a draw.io diagram in the selection\nnoDiagrams=No diagrams found\nauthFailed=Authentication failed\nofficeFailedAuthMsg=Unable to successfully authenticate user or authorize application.\nconvertingDiagramFailed=Converting diagram failed\nofficeCopyImgErrMsg=Due to some limitations in the host application, the image could not be inserted. Please manually copy the image then paste it to the document.\ninsertingImageFailed=Inserting image failed\nofficeCopyImgInst=Instructions: Right-click the image below. Select "Copy image" from the context menu. Then, in the document, right-click and select "Paste" from the context menu.\nfolderEmpty=Folder is empty\nrecent=Recent\nsharedWithMe=Shared With Me\nsharepointSites=Sharepoint Sites\nerrorFetchingFolder=Error fetching folder items\nerrorAuthOD=Error authenticating to OneDrive\nofficeMainHeader=Adds draw.io diagrams to your document.\nofficeStepsHeader=This add-in performs the following steps:\nofficeStep1=Connects to Microsoft OneDrive, Google Drive or your device.\nofficeStep2=Select a draw.io diagram.\nofficeStep3=Insert the diagram into the document.\nofficeAuthPopupInfo=Please complete the authentication in the pop-up window.\nofficeSelDiag=Select draw.io Diagram:\nfiles=Files\nshared=Shared\nsharepoint=Sharepoint\nofficeManualUpdateInst=Instructions: Copy draw.io diagram from the document. Then, in the box below, right-click and select "Paste" from the context menu.\nofficeClickToEdit=Click icon to start editing:\npasteDiagram=Paste draw.io diagram here\nconnectOD=Connect to OneDrive\nselectChildren=Select Children\nselectSiblings=Select Siblings\nselectParent=Select Parent\nselectDescendants=Select Descendants\nlastSaved=Last saved {1} ago\nresolve=Resolve\nreopen=Re-open\nshowResolved=Show Resolved\nreply=Reply\nobjectNotFound=Object not found\nreOpened=Re-opened\nmarkedAsResolved=Marked as resolved\nnoCommentsFound=No comments found\ncomments=Comments\ntimeAgo={1} ago\nconfluenceCloud=Confluence Cloud\nlibraries=Libraries\nconfAnchor=Confluence Page Anchor\nconfTimeout=The connection has timed out\nconfSrvTakeTooLong=The server at {1} is taking too long to respond.\nconfCannotInsertNew=Cannot insert draw.io diagram to a new Confluence page\nconfSaveTry=Please save the page and try again.\nconfCannotGetID=Unable to determine page ID\nconfContactAdmin=Please contact your Confluence administrator.\nreadErr=Read Error\neditingErr=Editing Error\nconfExtEditNotPossible=This diagram cannot be edited externally. Please try editing it while editing the page\nconfEditedExt=Diagram/Page edited externally\ndiagNotFound=Diagram Not Found\nconfEditedExtRefresh=Diagram/Page is edited externally. Please refresh the page.\nconfCannotEditDraftDelOrExt=Cannot edit diagrams in a draft page, diagram is deleted from the page, or diagram is edited externally. Please check the page.\nretBack=Return back\nconfDiagNotPublished=The diagram does not belong to a published page\ncreatedByDraw=Created by draw.io\nfilenameShort=Filename too short\ninvalidChars=Invalid characters\nalreadyExst={1} already exists\ndraftReadErr=Draft Read Error\ndiagCantLoad=Diagram cannot be loaded\ndraftWriteErr=Draft Write Error\ndraftCantCreate=Draft could not be created\nconfDuplName=Duplicate diagram name detected. Please pick another name.\nconfSessionExpired=Looks like your session expired. Log in again to keep working.\nlogin=Login\ndrawPrev=draw.io preview\ndrawDiag=draw.io diagram\ninvalidCallFnNotFound=Invalid Call: {1} not found\ninvalidCallErrOccured=Invalid Call: An error occurred, {1}\nanonymous=Anonymous\nconfGotoPage=Go to containing page\nshowComments=Show Comments\nconfError=Error: {1}\ngliffyImport=Gliffy Import\ngliffyImportInst1=Click the "Start Import" button to import all Gliffy diagrams to draw.io.\ngliffyImportInst2=Please note that the import procedure will take some time and the browser window must remain open until the import is completed.\nstartImport=Start Import\ndrawConfig=draw.io Configuration\ncustomLib=Custom Libraries\ncustomTemp=Custom Templates\npageIdsExp=Page IDs Export\ndrawReindex=draw.io re-indexing (beta)\nworking=Working\ndrawConfigNotFoundInst=draw.io Configuration Space (DRAWIOCONFIG) does not exist. This space is needed to store draw.io configuration files and custom libraries/templates.\ncreateConfSp=Create Config Space\nunexpErrRefresh=Unexpected error, please refresh the page and try again.\nconfigJSONInst=Write draw.io JSON configuration in the editor below then click save. If you need help, please refer to\nthisPage=this page\ncurCustLib=Current Custom Libraries\nlibName=Library Name\naction=Action\ndrawConfID=draw.io Config ID\naddLibInst=Click the "Add Library" button to upload a new library.\naddLib=Add Library\ncustomTempInst1=Custom templates are draw.io diagrams saved in children pages of\ncustomTempInst2=For more details, please refer to\ntempsPage=Templates page\npageIdsExpInst1=Select export target, then click the "Start Export" button to export all pages IDs.\npageIdsExpInst2=Please note that the export procedure will take some time and the browser window must remain open until the export is completed.\nstartExp=Start Export\nrefreshDrawIndex=Refresh draw.io Diagrams Index\nreindexInst1=Click the "Start Indexing" button to refresh draw.io diagrams index.\nreindexInst2=Please note that the indexing procedure will take some time and the browser window must remain open until the indexing is completed.\nstartIndexing=Start Indexing\nconfAPageFoundFetch=Page "{1}" found. Fetching\nconfAAllDiagDone=All {1} diagrams processed. Process finished.\nconfAStartedProcessing=Started processing page "{1}"\nconfAAllDiagInPageDone=All {1} diagrams in page "{2}" processed successfully.\nconfAPartialDiagDone={1} out of {2} {3} diagrams in page "{4}" processed successfully.\nconfAUpdatePageFailed=Updating page "{1}" failed.\nconfANoDiagFoundInPage=No {1} diagrams found in page "{2}".\nconfAFetchPageFailed=Fetching the page failed.\nconfANoDiagFound=No {1} diagrams found. Process finished.\nconfASearchFailed=Searching for {1} diagrams failed. Please try again later.\nconfAGliffyDiagFound={2} diagram "{1}" found. Importing\nconfAGliffyDiagImported={2} diagram "{1}" imported successfully.\nconfASavingImpGliffyFailed=Saving imported {2} diagram "{1}" failed.\nconfAImportedFromByDraw=Imported from "{1}" by draw.io\nconfAImportGliffyFailed=Importing {2} diagram "{1}" failed.\nconfAFetchGliffyFailed=Fetching {2} diagram "{1}" failed.\nconfACheckBrokenDiagLnk=Checking for broken diagrams links.\nconfADelDiagLinkOf=Deleting diagram link of "{1}"\nconfADupLnk=(duplicate link)\nconfADelDiagLnkFailed=Deleting diagram link of "{1}" failed.\nconfAUnexpErrProcessPage=Unexpected error during processing the page with id: {1}\nconfADiagFoundIndex=Diagram "{1}" found. Indexing\nconfADiagIndexSucc=Diagram "{1}" indexed successfully.\nconfAIndexDiagFailed=Indexing diagram "{1}" failed.\nconfASkipDiagOtherPage=Skipped "{1}" as it belongs to another page!\nconfADiagUptoDate=Diagram "{1}" is up to date.\nconfACheckPagesWDraw=Checking pages having draw.io diagrams.\nconfAErrOccured=An error occurred!\nsavedSucc=Saved successfully\nconfASaveFailedErr=Saving Failed (Unexpected Error)\ncharacter=Character\nconfAConfPageDesc=This page contains draw.io configuration file (configuration.json) as attachment\nconfALibPageDesc=This page contains draw.io custom libraries as attachments\nconfATempPageDesc=This page contains draw.io custom templates as attachments\nconfAConfSpaceDesc=This space is used to store draw.io configuration files and custom libraries/templates\nconfANoCustLib=No Custom Libraries\ndelFailed=Delete failed!\nshowID=Show ID\nconfAIncorrectLibFileType=Incorrect file type. Libraries should be XML files.\nuploading=Uploading\nconfALibExist=This library already exists\nconfAUploadSucc=Uploaded successfully\nconfAUploadFailErr=Upload Failed (Unexpected Error)\nhiResPreview=High Res Preview\nofficeNotLoggedGD=You are not logged in to Google Drive. Please open draw.io task pane and login first.\nofficePopupInfo=Please complete the process in the pop-up window.\npickODFile=Pick OneDrive File\ncreateODFile=Create OneDrive File\npickGDriveFile=Pick Google Drive File\ncreateGDriveFile=Create Google Drive File\npickDeviceFile=Pick Device File\nvsdNoConfig="vsdurl" is not configured\nruler=Ruler\nunits=Units\npoints=Points\ninches=Inches\nmillimeters=Millimeters\nconfEditDraftDelOrExt=This diagram is in a draft page, is deleted from the page, or is edited externally. It will be saved as a new attachment version and may not be reflected in the page.\nconfDiagEditedExt=Diagram is edited in another session. It will be saved as a new attachment version but the page will show other session\'s modifications.\nmacroNotFound=Macro Not Found\nconfAInvalidPageIdsFormat=Incorrect Page IDs file format\nconfACollectingCurPages=Collecting current pages\nconfABuildingPagesMap=Building pages mapping\nconfAProcessDrawDiag=Started processing imported draw.io diagrams\nconfAProcessDrawDiagDone=Finished processing imported draw.io diagrams\nconfAProcessImpPages=Started processing imported pages\nconfAErrPrcsDiagInPage=Error processing draw.io diagrams in page "{1}"\nconfAPrcsDiagInPage=Processing draw.io diagrams in page "{1}"\nconfAImpDiagram=Importing diagram "{1}"\nconfAImpDiagramFailed=Importing diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\nconfAImpDiagramError=Error importing diagram "{1}". Cannot fetch or save the diagram. Cannot fix this diagram links.\nconfAUpdateDgrmCCFailed=Updating link to diagram "{1}" failed.\nconfImpDiagramSuccess=Updating diagram "{1}" done successfully.\nconfANoLnksInDrgm=No links to update in: {1}\nconfAUpdateLnkToPg=Updated link to page: "{1}" in diagram: "{2}"\nconfAUpdateLBLnkToPg=Updated lightbox link to page: "{1}" in diagram: "{2}"\nconfAUpdateLnkBase=Updated base URL from: "{1}" to: "{2}" in diagram: "{3}"\nconfAPageIdsImpDone=Page IDs Import finished\nconfAPrcsMacrosInPage=Processing draw.io macros in page "{1}"\nconfAErrFetchPage=Error fetching page "{1}"\nconfAFixingMacro=Fixing macro of diagram "{1}"\nconfAErrReadingExpFile=Error reading export file\nconfAPrcsDiagInPageDone=Processing draw.io diagrams in page "{1}" finished\nconfAFixingMacroSkipped=Fixing macro of diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\npageIdsExpTrg=Export target\nconfALucidDiagImgImported={2} diagram "{1}" image extracted successfully\nconfASavingLucidDiagImgFailed=Extracting {2} diagram "{1}" image failed\nconfGetInfoFailed=Fetching file info from {1} failed.\nconfCheckCacheFailed=Cannot get cached file info.\nconfReadFileErr=Cannot read "{1}" file from {2}.\nconfSaveCacheFailed=Unexpected error. Cannot save cached file\norgChartType=Org Chart Type\nlinear=Linear\nhanger2=Hanger 2\nhanger4=Hanger 4\nfishbone1=Fishbone 1\nfishbone2=Fishbone 2\n1ColumnLeft=Single Column Left\n1ColumnRight=Single Column Right\nsmart=Smart\nparentChildSpacing=Parent Child Spacing\nsiblingSpacing=Sibling Spacing\nconfNoPermErr=Sorry, you don\'t have enough permissions to view this embedded diagram from page {1}\ncopyAsImage=Copy as Image\ncopyAsText=Copy as Text\nlucidImport=Lucidchart Import\nlucidImportInst1=Click the "Start Import" button to import all Lucidchart diagrams.\ninstallFirst=Please install {1} first\ndrawioChromeExt=draw.io Chrome Extension\nloginFirstThen=Please login to {1} first, then {2}\nerrFetchDocList=Error: Couldn\'t fetch documents list\nbuiltinPlugins=Built-in Plugins\nextPlugins=External Plugins\nbackupFound=Backup file found\nchromeOnly=This feature only works in Google Chrome\nmsgDeleted=This message has been deleted\nconfAErrFetchDrawList=Error fetching diagrams list. Some diagrams are skipped.\nconfAErrCheckDrawDiag=Cannot check diagram {1}\nconfAErrFetchPageList=Error fetching pages list\nconfADiagImportIncom={1} diagram "{2}" is imported partially and may have missing shapes\ninvalidSel=Invalid selection\ndiagNameEmptyErr=Diagram name cannot be empty\nopenDiagram=Open Diagram\nnewDiagram=New diagram\neditable=Editable\nconfAReimportStarted=Re-import {1} diagrams started...\nspaceFilter=Filter by spaces\ncurViewState=Current Viewer State\npageLayers=Page and Layers\ncustomize=Customize\nfirstPage=First Page (All Layers)\ncurEditorState=Current Editor State\nnoAnchorsFound=No anchors found\nattachment=Attachment\ncurDiagram=Current Diagram\nrecentDiags=Recent Diagrams\ncsvImport=CSV Import\nchooseFile=Choose a file...\nchoose=Choose\ngdriveFname=Google Drive filename\nwidthOfViewer=Width of the viewer (px)\nheightOfViewer=Height of the viewer (px)\nautoSetViewerSize=Automatically set the size of the viewer\nthumbnail=Thumbnail\nprevInDraw=Preview in draw.io\nonedriveFname=OneDrive filename\ndiagFname=Diagram filename\ndiagUrl=Diagram URL\nshowDiag=Show Diagram\ndiagPreview=Diagram Preview\ncsvFileUrl=CSV File URL\ngenerate=Generate\nselectDiag2Insert=Please select a diagram to insert it.\nerrShowingDiag=Unexpected error. Cannot show diagram\nnoRecentDiags=No recent diagrams found\nfetchingRecentFailed=Failed to fetch recent diagrams\nuseSrch2FindDiags=Use the search box to find draw.io diagrams\ncantReadChckPerms=Cannot read the specified diagram. Please check you have read permission on that file.\ncantFetchChckPerms=Cannot fetch diagram info. Please check you have read permission on that file.\nsearchFailed=Searching failed. Please try again later.\nplsTypeStr=Please type a search string.\nunsupportedFileChckUrl=Unsupported file. Please check the specified URL\ndiagNotFoundChckUrl=Diagram not found or cannot be accessed. Please check the specified URL\ncsvNotFoundChckUrl=CSV file not found or cannot be accessed. Please check the specified URL\ncantReadUpload=Cannot read the uploaded diagram\nselect=Select\nerrCantGetIdType=Unexpected Error: Cannot get content id or type.\nerrGAuthWinBlocked=Error: Google Authentication window blocked\nauthDrawAccess=Authorize draw.io to access {1}\nconnTimeout=The connection has timed out\nerrAuthSrvc=Error authenticating to {1}\nplsSelectFile=Please select a file\nmustBgtZ={1} must be greater than zero\ncantLoadPrev=Cannot load file preview.\nerrAccessFile=Error: Access Denied. You do not have permission to access "{1}".\nnoPrevAvail=No preview is available.\npersonalAccNotSup=Personal accounts are not supported.\nerrSavingTryLater=Error occurred during saving, please try again later.\nplsEnterFld=Please enter {1}\ninvalidDiagUrl=Invalid Diagram URL\nunsupportedVsdx=Unsupported vsdx file\nunsupportedImg=Unsupported image file\nunsupportedFormat=Unsupported file format\nplsSelectSingleFile=Please select a single file only\nattCorrupt=Attachment file "{1}" is corrupted\nloadAttFailed=Failed to load attachment "{1}"\nembedDrawDiag=Embed draw.io Diagram\naddDiagram=Add Diagram\nembedDiagram=Embed Diagram\neditOwningPg=Edit owning page\ndeepIndexing=Deep Indexing (Index diagrams that aren\'t used in any page also)\nconfADeepIndexStarted=Deep Indexing Started\nconfADeepIndexDone=Deep Indexing Done\nofficeNoDiagramsSelected=No diagrams found in the selection\nofficeNoDiagramsInDoc=No diagrams found in the document\nofficeNotSupported=This feature is not supported in this host application\nsomeImagesFailed={1} out of {2} failed due to the following errors\nimportingNoUsedDiagrams=Importing {1} Diagrams not used in pages\nimportingDrafts=Importing {1} Diagrams in drafts\nprocessingDrafts=Processing drafts\nupdatingDrafts=Updating drafts\nupdateDrafts=Update drafts\nnotifications=Notifications\ndrawioImp=draw.io Import\nconfALibsImp=Importing draw.io Libraries\nconfALibsImpFailed=Importing {1} library failed\ncontributors=Contributors\ndrawDiagrams=draw.io Diagrams\nerrFileNotFoundOrNoPer=Error: Access Denied. File not found or you do not have permission to access "{1}" on {2}.\nconfACheckPagesWEmbed=Checking pages having embedded draw.io diagrams.\nconfADelBrokenEmbedDiagLnk=Removing broken embedded diagram links\nreplaceWith=Replace with\nreplaceAll=Replace All\nconfASkipDiagModified=Skipped "{1}" as it was modified after initial import\nreplFind=Replace/Find\nmatchesRepl={1} matches replaced\ndraftErrDataLoss=An error occurred while reading the draft file. The diagram cannot be edited now to prevent any possible data loss. Please try again later or contact support.\nibm=IBM\nlinkToDiagramHint=Add a link to this diagram. The diagram can only be edited from the page that owns it.\nlinkToDiagram=Link to Diagram\nchangedBy=Changed By\nlastModifiedOn=Last modified on\nsearchResults=Search Results\nshowAllTemps=Show all templates\nnotionToken=Notion Token\nselectDB=Select Database\nnoDBs=No Databases\ndiagramEdited={1} diagram "{2}" edited\nconfDraftPermissionErr=Draft cannot be written. Do you have attachment write/read permission on this page?\nconfFileTooBigErr=File size is too large. Pease check "Attachment Maximum Size" of "Attachment Settings" in Confluence Configuration.\nowner=Owner\nrepository=Repository\nbranch=Branch\nmeters=Meters\nteamsNoEditingMsg=Editor functionality is only available in Desktop environment (in MS Teams App or a web browser)\ncontactOwner=Contact Owner\nviewerOnlyMsg=You cannot edit the diagrams in the mobile platform, please use the desktop client or a web browser.\nwebsite=Website\ncheck4Updates=Check for updates\nattWriteFailedRetry={1}: Attachment write failed, trying again in {2} seconds...\nconfPartialPageList=We couldn\'t fetch all pages due to an error in Confluence. Continuing using {1} pages only.\nspellCheck=Spell checker\nnoChange=No Change\nlblToSvg=Convert labels to SVG\ntxtSettings=Text Settings\nLinksLost=Links will be lost\narcSize=Arc Size\neditConnectionPoints=Edit Connection Points\nnotInOffline=Not supported while offline\nnotInDesktop=Not supported in Desktop App\nconfConfigSpaceArchived=draw.io Configuration space (DRAWIOCONFIG) is archived. Please restore it first.\nconfACleanOldVerStarted=Cleaning old diagram draft versions started\nconfACleanOldVerDone=Cleaning old diagram draft versions finished\nconfACleaningFile=Cleaning diagram draft "{1}" old versions\nconfAFileCleaned=Cleaning diagram draft "{1}" done\nconfAFileCleanFailed=Cleaning diagram draft "{1}" failed\nconfACleanOnly=Clean Diagram Drafts Only\nbrush=Brush\nopenDevTools=Open Developer Tools\nautoBkp=Automatic Backup\nconfAIgnoreCollectErr=Ignore collecting current pages errors\ndrafts=Drafts\ndraftSaveInt=Draft save interval [sec] (0 to disable)\npluginsDisabled=External plugins disabled.\nextExpNotConfigured=External image service is not configured\npathFilename=Path/Filename\nconfAHugeInstances=Very Large Instances\nconfAHugeInstancesDesc=If this instance includes 100,000+ pages, it is faster to request the current instance pages list from Atlassian. Please contact our support for more details.\nchoosePageIDsFile=Choose current page IDs csv file\nchooseDrawioPsgesFile=Choose pages with draw.io diagrams csv file\nprivate=Private\ndiagramTooLarge=The diagram is too large, please reduce its size and try again.\nselectAdminUsers=Select Admin Users\nxyzTeam={1} Team\naddTeamTitle=Adding a new draw.io Team\naddTeamInst1=To create a new draw.io Team, you need to create a new Atlassian group with "drawio-" prefix (e.g, a group named "drawio-marketing").\naddTeamInst2=Then, configure which team member can edit/add configuration, templates, and libraries from this page.\ndrawioTeams=draw.io Teams\nmembers=Members\nadminEditors=Admins/Editors\nallowAll=Allow all\nnoTeams=No teams found\nerrorLoadingTeams=Error Loading Teams\nnoTeamMembers=No team members found\nerrLoadTMembers=Error loading team members\nerrCreateTeamPage=Error creating team "{1}" page in "draw.io Configuration" space, please check you have the required permissions.\ngotoConfigPage=Please create the space from draw.io "Configuration" page.\nnoAdminsSelected=No admins/editors selected\nerrCreateConfigFile=Error creating "configuration.json" file, please check you have the required permissions.\nerrSetPageRestr=Error setting page restrictions\nnotAdmin4Team=You are not an admin for this team\nconfigUpdated=Configuration updated, restart the editor if you want to work with last configuration.\noutOfDateRevisionAlert=You are editing a historical revision of the diagram, please review the revision and open it to replace the latest version. Or close and overwrite/merge later.\nconfAErrFaqs=There are {1} error(s), the following instructions may help fixing most of the cases. (Please download the log for future references)\nconfA403ErrFaq=There are ({1}) 403 error(s). The current users must have add (write) permissions on all pages and attachments. Even admins sometimes are not allowed to write to some pages via page restrictions\nconfA404ErrFaq=There are ({1}) 404 error(s). The attachment/page is not found. This is due to improper migration or the diagram file (an attachment of the page) is deleted.\nconfA500ErrFaq=There are ({1}) 500 error(s). An internal server error in Confluence Cloud. Such errors are due to overloading the server and usually fixed by retrying the process.\nconfAOtherErrFaq=There are ({1}) other error(s). Please check the error description. If the description is not clear, please contact our support.\nconfAReplaceBaseUrl=Replace Base URL in diagram links when no page ID mapping is found\ndrawSvgPrev=draw.io SVG preview\ngoogleFonts=Google Fonts\ndiagDupl=Duplicate Diagram Detected\ndiagDuplMsg=This diagram is used in multiple places, which can result in unexpected results when edited. We\'ve created an independent copy. Please open the editor again.\ndiagDuplNoEditMsg=This diagram is used in multiple places. Please edit it within its own page.\nconfCloudMigConfirm=Warning: This process will edit many pages and diagrams, so it is recommended to stop the Synchrony service during the process. Do you want to proceed?\nconfCloudMigNotice=In the Cloud instance, please add linkAdjustments to draw.io configuration as follows {1}. Without this configuration, links in diagrams pointing to Confluence pages will not work.\nconfALogsPageDesc=This page contains logs of draw.io long running services as attachments\nconfEditOnlyInPageEditor=Can only be edited within Confluence page editor\nconfEvalWarn=Evaluation License - Not for production use\notherUsersEditing=Other user(s) are editing this diagram\nfirstTimeGD=First time to access this file?\ndrawioGDAppNotInstalled=draw.io Google Drive app is not installed, please install it first\nConfDC415Error=Saving drafts is blocked. If you have "Attachment Checker for Confluence" app, please update to the latest version.\nremove=Remove\nselectPgLyr=Select Page and Layers\nerrGenPreview=There was an error generating a diagram preview. Please consult technical support.\nattAccessErr=Diagram attachment access error: cannot display diagram\nwidthIntOrFixed=Width must be a valid integer or of value \'fixed\'\ndupDisabledPgLyrSlct=Diagram duplication is disabled when page and layers are selected\ncantDupPickDiffName=Could not duplicate diagram. Please choose a different name.\nownPgAccessDupErr=Owning page access restriction: cannot duplicate diagram.\ncantDupTryLater=Could not duplicate diagram. Please try again later.\ncantEditLnkd=Cannot edit linked diagram\ndiagEditOwnPgOnlyOpen=Diagram can only be edited from the page that owns it. Would you like to open the owning page for edit?\ndiagInTemps=draw.io diagrams in templates\ndiagInTempsCantEdit=Diagrams in page templates cannot be edited. They can only be edited on pages and blog posts.\nconfDirectEditDraftLost=This Confluence page has unpublished changes. Editing the diagram from page view may cause data loss. Please edit the Confluence page first and then edit the diagram.\nconfConfigSpacePerm=Note: If you recently migrated from DC app, please check draw.io Configuration space permissions such that all users can read and only admins can write. In addition, remove the page restrictions on "Configuration" and "Libraries" pages. You may need admin keys to access them. Also, please check the file "configuration.json" in the "Configuration" page is downloadable.\n');Graph.prototype.defaultThemes["default-style2"]=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="default"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="default"/><add as="endArrow" value="classic"/><add as="fontSize" value="11"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="rounded" value="1"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="text"><add as="fillColor" value="none"/><add as="gradientColor" value="none"/><add as="strokeColor" value="none"/><add as="align" value="left"/><add as="verticalAlign" value="top"/></add><add as="edgeLabel" extend="text"><add as="labelBackgroundColor" value="default"/><add as="fontSize" value="11"/></add><add as="label"><add as="fontStyle" value="1"/><add as="align" value="left"/><add as="verticalAlign" value="middle"/><add as="spacing" value="2"/><add as="spacingLeft" value="52"/><add as="imageWidth" value="42"/><add as="imageHeight" value="42"/><add as="rounded" value="1"/></add><add as="icon" extend="label"><add as="align" value="center"/><add as="imageAlign" value="center"/><add as="verticalLabelPosition" value="bottom"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="4"/><add as="labelBackgroundColor" value="default"/><add as="spacing" value="0"/><add as="spacingLeft" value="0"/><add as="spacingTop" value="6"/><add as="fontStyle" value="0"/><add as="imageWidth" value="48"/><add as="imageHeight" value="48"/></add><add as="swimlane"><add as="shape" value="swimlane"/><add as="fontSize" value="12"/><add as="fontStyle" value="1"/><add as="startSize" value="23"/></add><add as="group"><add as="verticalAlign" value="top"/><add as="fillColor" value="none"/><add as="strokeColor" value="none"/><add as="gradientColor" value="none"/><add as="pointerEvents" value="0"/></add><add as="ellipse"><add as="shape" value="ellipse"/><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombus"><add as="shape" value="rhombus"/><add as="perimeter" value="rhombusPerimeter"/></add><add as="triangle"><add as="shape" value="triangle"/><add as="perimeter" value="trianglePerimeter"/></add><add as="line"><add as="shape" value="line"/><add as="strokeWidth" value="4"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="verticalLabelPosition" value="bottom"/></add><add as="roundImage" extend="image"><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombusImage" extend="image"><add as="perimeter" value="rhombusPerimeter"/></add><add as="arrow"><add as="shape" value="arrow"/><add as="edgeStyle" value="none"/><add as="fillColor" value="default"/></add><add as="fancy"><add as="shadow" value="1"/><add as="glass" value="1"/></add><add as="gray" extend="fancy"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="blue" extend="fancy"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="green" extend="fancy"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="turquoise" extend="fancy"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="yellow" extend="fancy"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="orange" extend="fancy"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="red" extend="fancy"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="pink" extend="fancy"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="purple" extend="fancy"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add><add as="plain-gray"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="plain-blue"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="plain-green"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="plain-turquoise"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="plain-yellow"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="plain-orange"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="plain-red"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="plain-pink"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="plain-purple"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add></mxStylesheet>').documentElement;+(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var e=EditorUi.initTheme;EditorUi.initTheme=function(){e.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();DrawioComment=function(b,e,g,m,v,n,A){this.file=b;this.id=e;this.content=g;this.modifiedDate=m;this.createdDate=v;this.isResolved=n;this.user=A;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,e,g,m,v){e()};DrawioComment.prototype.editComment=function(b,e,g){e()};DrawioComment.prototype.deleteComment=function(b,e){b()};DrawioUser=function(b,e,g,m,v){this.id=b;this.email=e;this.displayName=g;this.pictureUrl=m;this.locale=v};mxResources.parse('# *DO NOT DIRECTLY EDIT THIS FILE, IT IS AUTOMATICALLY GENERATED AND IT IS BASED ON:*\n# https://docs.google.com/spreadsheet/ccc?key=0AmQEO36liL4FdDJLWVNMaVV2UmRKSnpXU09MYkdGbEE\nabout=About\naboutDrawio=About draw.io\naccessDenied=Access Denied\naccounts=Accounts\naction=Action\nactualSize=Actual Size\nadaptiveColors=Adaptive Colors\nadd=Add\naddAccount=Add account\naddedFile=Added {1}\naddImages=Add Images\naddImageUrl=Add Image URL\naddLayer=Add Layer\naddProperty=Add Property\naddress=Address\naddToExistingDrawing=Add to Existing Drawing\naddToScratchpad=Add to Scratchpad\naddWaypoint=Add Waypoint\nadjustTo=Adjust to\nadvanced=Advanced\nsmartTemplate=Smart Template\nalign=Align\nalignment=Alignment\nallChangesLost=All changes will be lost!\nallPages=All Pages\nallProjects=All Projects\nallSpaces=All Spaces\nallTags=All Tags\nanchor=Anchor\nandroid=Android\nangle=Angle\nanimations=Animations\narc=Arc\nareYouSure=Are you sure?\nensureDataSaved=Please ensure your data is saved before closing.\nallChangesSaved=All changes saved\nallChangesSavedInDrive=All changes saved in Drive\nallowPopups=Allow pop-ups to avoid this dialog.\nallowRelativeUrl=Allow relative URL\nalreadyConnected=Nodes already connected\nappearance=Appearance\napply=Apply\narchiMate21=ArchiMate 2.1\narrange=Arrange\narrow=Arrow\narrows=Arrows\naskMeAnything=Ask me anything\nasNew=As New\natlas=Atlas\nauthor=Author\nauthorizationRequired=Authorization required\nauthorizeThisAppIn=Authorize this app in {1}:\nauthorize=Authorize\nauthorizing=Authorizing\nautomatic=Automatic\nautosave=Autosave\nautosize=Autosize\nattachments=Attachments\naws=AWS\naws3d=AWS 3D\nazure=Azure\nback=Back\nbackground=Background\nbackgroundColor=Background Color\nbackgroundImage=Background Image\nbasic=Basic\nbeta=beta\nblankDrawing=Blank Drawing\nblankDiagram=Blank Diagram\nblock=Block\nblockquote=Blockquote\nblog=Blog\nbold=Bold\nbootstrap=Bootstrap\nborder=Border\nborderColor=Border Color\nborderWidth=Border Width\nbottom=Bottom\nbottomAlign=Bottom Align\nbottomLeft=Bottom Left\nbottomRight=Bottom Right\nbpmn=BPMN\nbringForward=Bring Forward\nbrowser=Browser\nbulletedList=Bulleted List\nbusiness=Business\nbusy=Operation in progress\ncabinets=Cabinets\ncancel=Cancel\ncenter=Center\ncannotLoad=Load attempts failed. Please try again later.\ncannotLogin=Log in attempts failed. Please try again later.\ncannotOpenFile=Cannot open file\nchange=Change\nchangeOrientation=Change Orientation\nchangeUser=Change user\nchangeStorage=Change storage\nchangesNotSaved=Changes have not been saved\nclassDiagram=Class Diagram\nuserJoined={1} has joined\nuserLeft={1} has left\nchatWindowTitle=Chat\nchooseAnOption=Choose an option\nchromeApp=Chrome App\ncollaborativeEditingNotice=Important Notice for Collaborative Editing\ncompare=Compare\ncompressed=Compressed\ncommitMessage=Commit Message\nconfigLinkWarn=This link configures draw.io. Only click OK if you trust whoever gave you it!\nconfigLinkConfirm=Click OK to configure and restart draw.io.\ncontainer=Container\ncsv=CSV\ndark=Dark\ndiagramLanguage=Diagram Language\ndiagramType=Diagram type\ndiagramXmlDesc=XML File\ndiagramHtmlDesc=HTML File\ndiagramPngDesc=Editable Bitmap Image\ndiagramSvgDesc=Editable Vector Image\ndidYouMeanToExportToPdf=Did you mean to export to PDF?\ndisabled=Disabled\ndraftFound=A draft for \'{1}\' has been found. Load it into the editor or discard it to continue.\ndraftRevisionMismatch=There is a different version of this diagram on a shared draft of this page. Please edit the diagram from the draft to ensure you are working with the latest version.\nselectDraft=Select a draft to continue editing:\ndragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?\ndropboxCharsNotAllowed=The following characters are not allowed: / : ? * " |\ncheck=Check\nchecksum=Checksum\ncircle=Circle\ncisco=Cisco\nclassic=Classic\nclearDefaultStyle=Clear Default Style\nclearWaypoints=Clear Waypoints\nclipart=Clipart\nclose=Close\nclosingFile=Closing file\nrealtimeCollaboration=Real-Time Collaboration\ncollaborate=Collaborate\ncollaborator=Collaborator\ncollaborators=Collaborators\ncollapse=Collapse\ncollapseExpand=Collapse/Expand\ncollapse-expand=Click to collapse/expand\nShift-click to move neighbors \nAlt-click to protect group size\ncollapsible=Collapsible\ncomic=Comic\ncomment=Comment\ncommentsNotes=Comments/Notes\ncompress=Compress\nconfiguration=Configuration\nconnect=Connect\nconnecting=Connecting\nconnectWithDrive=Connect with Google Drive\nconnection=Connection\nconnectionArrows=Connection Arrows\nconnectionPoints=Connection Points\nconstrainProportions=Constrain Proportions\ncontainsValidationErrors=Contains validation errors\ncopiedToClipboard=Copied to clipboard\ncopy=Copy\ncopyConnect=Copy on connect\ncopyCreated=A copy of the file was created.\ncopyData=Copy Data\ncopyOf=Copy of {1}\ncopyOfDrawing=Copy of Drawing\ncopySize=Copy Size\ncopyStyle=Copy Style\ncreate=Create\ncreateBlankDiagram=Create Blank Diagram\ncreateNewDiagram=Create New Diagram\ncreateRevision=Create Revision\ncreateShape=Create Shape\ncrop=Crop\ncurved=Curved\ncustom=Custom\ncurrent=Current\ncurrentPage=Current page\ncut=Cut\ndashed=Dashed\ndecideLater=Decide later\ndefault=Default\ndelete=Delete\ndeleteAll=Delete all\ndeleteColumn=Delete column\ndeleteLibrary401=Insufficient permissions to delete this library\ndeleteLibrary404=Selected library could not be found\ndeleteLibrary500=Error deleting library\ndeleteLibraryConfirm=You are about to permanently delete this library. Are you sure you want to do this?\ndeleteRow=Delete Row\ndescription=Description\ndescribeYourDiagram=Describe your diagram\ndevice=Device\ndiagram=Diagram\ndiagramContent=Diagram Content\ndiagramLocked=Diagram has been locked to prevent further data loss.\ndiagramLockedBySince=The diagram is locked by {1} since {2} ago\ndiagramName=Diagram Name\ndiagramIsPublic=Diagram is public\ndiagramIsNotPublic=Diagram is not public\ndiamond=Diamond\ndiamondThin=Diamond (thin)\ndidYouKnow=Did you know...\ndirection=Direction\ndiscard=Discard\ndiscardChangesAndReconnect=Discard Changes and Reconnect\ngoogleDriveMissingClickHere=Google Drive missing? Click here!\ndiscardChanges=Discard Changes\ndisconnected=Disconnected\ndistribute=Distribute\ndone=Done\ndoNotShowAgain=Do not show again\ndotted=Dotted\ndoubleClickOrientation=Doubleclick to change orientation\ndoubleClickTooltip=Doubleclick to insert text\ndoubleClickChangeProperty=Doubleclick to change property name\ndownload=Download\ndownloadDesktop=Get Desktop\ndownloadAs=Download as\nclickHereToSave=Click here to save.\ndpi=DPI\ndraftDiscarded=Draft discarded\ndraftSaved=Draft saved\ndragElementsHere=Drag elements here\ndragImagesHere=Drag images or URLs here\ndragUrlsHere=Drag URLs here\ndraw.io=draw.io\ndrawing=Drawing{1}\ndrawingEmpty=Drawing is empty\ndrawingTooLarge=Drawing is too large\ndrawioForWork=Draw.io for GSuite\ndropbox=Dropbox\nduplicate=Duplicate\nduplicateIt=Duplicate {1}\ndivider=Divider\ndx=Dx\ndy=Dy\neast=East\nedit=Edit\neditData=Edit Data\neditDiagram=Edit Diagram\neditGeometry=Edit Geometry\neditImage=Edit Image\neditImageUrl=Edit Image URL\neditLink=Edit Link\neditShape=Edit Shape\neditStyle=Edit Style\neditText=Edit Text\neditTooltip=Edit Tooltip\nglass=Glass\ngoogleImages=Google Images\nimageSearch=Image Search\neip=EIP\nembed=Embed\nembedFonts=Embed Fonts\nembedImages=Embed Images\nmainEmbedNotice=Paste this into the page\nelectrical=Electrical\nellipse=Ellipse\nembedNotice=Paste this once at the end of the page\nenterGroup=Enter Group\nenterName=Enter Name\nenterPropertyName=Enter Property Name\nenterValue=Enter Value\nentityRelation=Entity Relation\nentityRelationshipDiagram=Entity Relationship Diagram\nerror=Error\nerrorDeletingFile=Error deleting file\nerrorLoadingFile=Error loading file\nerrorRenamingFile=Error renaming file\nerrorRenamingFileNotFound=Error renaming file. File was not found.\nerrorRenamingFileForbidden=Error renaming file. Insufficient access rights.\nerrorSavingDraft=Error saving draft\nerrorSavingFile=Error saving file\nerrorSavingFileUnknown=Error authorizing with Google\'s servers. Please refresh the page to re-attempt.\nerrorSavingFileForbidden=Error saving file. Insufficient access rights.\nerrorSavingFileNameConflict=Could not save diagram. Current page already contains file named \'{1}\'.\nerrorSavingFileNotFound=Error saving file. File was not found.\nerrorSavingFileReadOnlyMode=Could not save diagram while read-only mode is active.\nerrorSavingFileSessionTimeout=Your session has ended. Please <a target=\'_blank\' href=\'{1}\'>{2}</a> and return to this tab to try to save again.\nerrorSendingFeedback=Error sending feedback.\nerrorUpdatingPreview=Error updating preview.\nexit=Exit\nexitGroup=Exit Group\nexpand=Expand\nexplore=Explore\nexport=Export\nexporting=Exporting\nexportAs=Export as\nexportOptionsDisabled=Export options disabled\nexportOptionsDisabledDetails=The owner has disabled options to download, print or copy for commenters and viewers on this file.\nexternalChanges=External Changes\nextras=Extras\nfacebook=Facebook\nfailedToSaveTryReconnect=Failed to save, trying to reconnect\nfeatureRequest=Feature Request\nfeedback=Feedback\nfeedbackSent=Feedback successfully sent.\nfloorplans=Floorplans\nfile=File\nfileChangedOverwriteDialog=The file has been modified. Do you want to save the file and overwrite those changes?\nfileChangedSyncDialog=The file has been modified.\nfileChangedSync=The file has been modified. Click here to synchronize.\noverwrite=Overwrite\nsynchronize=Synchronize\nfilename=Filename\nfileExists=File already exists\nfileMovedToTrash=File was moved to trash\nfileNearlyFullSeeFaq=File nearly full, please see FAQ\nfileNotFound=File not found\nrepositoryNotFound=Repository not found\nfileNotFoundOrDenied=The file was not found. It does not exist or you do not have access.\nfileNotLoaded=File not loaded\nfileNotSaved=File not saved\nfileOpenLocation=How would you like to open these file(s)?\nfiletypeHtml=.html causes file to save as HTML with redirect to cloud URL\nfiletypePng=.png causes file to save as PNG with embedded data\nfiletypeSvg=.svg causes file to save as SVG with embedded data\nfileWillBeSavedInAppFolder={1} will be saved in the app folder.\nfill=Fill\nfillColor=Fill Color\nfilterCards=Filter Cards\nfind=Find\nfit=Fit\nfitContainer=Resize Container\nfitIntoContainer=Fit into Container\nfitPage=Fit Page\nfitPageWidth=Fit Page Width\nfitTo=Fit to\nfitToSheetsAcross=sheet(s) across\nfitToBy=by\nfitToSheetsDown=sheet(s) down\nfitTwoPages=Two Pages\nfitWindow=Fit Window\nflip=Flip\nflipH=Flip Horizontal\nflipV=Flip Vertical\nflowAnimation=Flow Animation\nflowchart=Flowchart\nfolder=Folder\nfont=Font\nfontColor=Font Color\nfontFamily=Font Family\nfontSize=Font Size\nforbidden=You are not authorized to access this file\nformat=Format\nformatPanel=Format Panel\nformatted=Formatted\nformattedText=Formatted Text\nformatPng=PNG\nformatGif=GIF\nformatJpg=JPEG\nformatPdf=PDF\nformatSql=SQL\nformatSvg=SVG\nformatHtmlEmbedded=HTML\nformatSvgEmbedded=SVG (with XML)\nformatVsdx=VSDX\nformatVssx=VSSX\nformatWebp=WebP\nformatXmlPlain=XML (Plain)\nformatXml=XML\nforum=Discussion/Help Forums\nfreehand=Freehand\nfromTemplate=From Template\nfromTemplateUrl=From Template URL\nfromText=From Text\nfromUrl=From URL\nfromThisPage=From this page\nfullscreen=Fullscreen\ngap=Gap\ngcp=GCP\ngeneral=General\ngetNotionChromeExtension=Get the Notion Chrome Extension\ngithub=GitHub\ngitlab=GitLab\ngliffy=Gliffy\nglobal=Global\ngoogleDocs=Google Docs\ngoogleDrive=Google Drive\ngoogleGadget=Google Gadget\ngoogleSharingNotAvailable=Sharing is only available via Google Drive. Please click Open below and share from the more actions menu:\ngoogleSlides=Google Slides\ngoogleSites=Google Sites\ngoogleSheets=Google Sheets\ngradient=Gradient\ngradientColor=Color\ngrid=Grid\ngridColor=Grid Color\ngridSize=Grid Size\ngroup=Group\nguides=Guides\nhateApp=I hate draw.io\nheading=Heading\nheight=Height\nhelp=Help\nhelpTranslate=Help us translate this application\nhide=Hide\nhideIt=Hide {1}\nhidden=Hidden\nhighContrast=High Contrast\nhome=Home\nhorizontal=Horizontal\nhorizontalFlow=Horizontal Flow\nhorizontalTree=Horizontal Tree\nhowTranslate=How good is the translation in your language?\nhtml=HTML\nhtmlText=HTML Text\nid=ID\niframe=IFrame\nignore=Ignore\nimage=Image\nimageUrl=Image URL\nimages=Images\nimagePreviewError=This image couldn\'t be loaded for preview. Please check the URL.\nimageTooBig=Image too big\nimgur=Imgur\nimport=Import\nimportFrom=Import from\nimproveContrast=Improve Contrast\nincludeCopyOfMyDiagram=Include a copy of my diagram\nincreaseIndent=Increase Indent\ndecreaseIndent=Decrease Indent\ninsert=Insert\ninsertColumnBefore=Insert Column Left\ninsertColumnAfter=Insert Column Right\ninsertEllipse=Insert Ellipse\ninsertImage=Insert Image\ninsertHorizontalRule=Insert Horizontal Rule\ninsertLink=Insert Link\ninsertPage=Insert Page\ninsertRectangle=Insert Rectangle\ninsertRhombus=Insert Rhombus\ninsertRowBefore=Insert Row Above\ninsertRowAfter=Insert Row After\ninsertText=Insert Text\ninserting=Inserting\ninstallApp=Install App\ninvalidFilename=Diagram names must not contain the following characters: / | : ; { } < > & + ? = "\ninvalidLicenseSeeThisPage=Your license is invalid, please see this <a target="_blank" href="https://www.drawio.com/doc/faq/license-drawio-confluence-jira-cloud">page</a>.\ninvalidInput=Invalid input\ninvalidName=Invalid name\ninvalidOrMissingFile=Invalid or missing file\ninvalidPublicUrl=Invalid public URL\nisometric=Isometric\nios=iOS\nitalic=Italic\nkennedy=Kennedy\nkeyboardShortcuts=Keyboard Shortcuts\nlabels=Labels\nlayers=Layers\nlandscape=Landscape\nlanguage=Language\nleanMapping=Lean Mapping\nlastChange=Last change {1} ago\nlessThanAMinute=less than a minute\nlicensingError=Licensing Error\nlicenseHasExpired=The license for {1} has expired on {2}. Click here.\nlicenseRequired=This feature requires draw.io to be licensed.\nlicenseWillExpire=The license for {1} will expire on {2}. Click here.\nlight=Light\nlineJumps=Line jumps\nlinkAccountRequired=If the diagram is not public a Google account is required to view the link.\nlinkText=Link Text\nlist=List\nminute=minute\nminutes=minutes\nhours=hours\ndays=days\nmonths=months\nyears=years\nrestartForChangeRequired=Changes will take effect after a restart of the application.\nlaneColor=Lanecolor\nlanguageCode=Language Code\nlastModified=Last modified\nlayout=Layout\nleft=Left\nleftAlign=Left Align\nleftToRight=Left to right\nlibraryTooltip=Drag and drop shapes here or click + to insert. Double click to edit.\nlightbox=Lightbox\nline=Line\nlineend=Line end\nlineheight=Line Height\nlinestart=Line start\nlinewidth=Linewidth\nlink=Link\nlinks=Links\nloading=Loading\nlocked=Locked\nlockUnlock=Lock/Unlock\nloggedOut=Logged Out\nlogIn=log in\nloveIt=I love {1}\nlucidchart=Lucidchart\nmaps=Maps\nmathematicalTypesetting=Mathematical Typesetting\nmakeCopy=Make a Copy\nmanual=Manual\nmerge=Merge\nmermaid=Mermaid\nmicrosoftOffice=Microsoft Office\nmicrosoftExcel=Microsoft Excel\nmicrosoftPowerPoint=Microsoft PowerPoint\nmicrosoftWord=Microsoft Word\nmiddle=Middle\nminimal=Minimal\nmisc=Misc\nmockups=Mockups\nmodern=Modern\nmodificationDate=Modification date\nmodifiedBy=Modified by\nmore=More\nmoreResults=More Results\nmoreShapes=More Shapes\nmove=Move\nmoveToFolder=Move to Folder\nmoving=Moving\nmoveSelectionTo=Move selection to {1}\nmyDrive=My Drive\nmyFiles=My Files\nname=Name\nnavigation=Navigation\nnetwork=Network\nnetworking=Networking\nnew=New\nnewLibrary=New Library\nnextPage=Next Page\nno=No\nnoPickFolder=No, pick folder\nnoAttachments=No attachments found\nnoColor=No Color\nnoFiles=No Files\nnoFileSelected=No file selected\nnoLibraries=No libraries found\nnoMoreResults=No more results\nnone=None\nnoOtherViewers=No other viewers\nnoPlugins=No plugins\nnoPreview=No preview\nnoResponse=No response from server\nnoResultsFor=No results for \'{1}\'\nnoRevisions=No revisions\nnoSearchResults=No search results found\nnoPageContentOrNotSaved=No anchors found on this page or it hasn\'t been saved yet\nnormal=Normal\nnorth=North\nnotADiagramFile=Not a diagram file\nnotALibraryFile=Not a library file\nnotAvailable=Not available\nnotAUtf8File=Not a UTF-8 file\nnotConnected=Not connected\nnote=Note\nnotion=Notion\nnotSatisfiedWithImport=Not satisfied with the import?\nnotUsingService=Not using {1}?\nnumberedList=Numbered list\noffline=Offline\nok=OK\noneDrive=OneDrive\nonline=Online\nopacity=Opacity\nopen=Open\nopenArrow=Open Arrow\nopenExistingDiagram=Open Existing Diagram\nopenFile=Open File\nopenFrom=Open from\nopenLibrary=Open Library\nopenLibraryFrom=Open Library from\nopenLink=Open Link\nopenInNewWindow=Open in New Window\nopenInThisWindow=Open in This Window\nopenIt=Open {1}\nopenRecent=Open Recent\nopenSupported=Supported formats are files saved from this software (.xml), .vsdx and .gliffy\noptions=Options\norganic=Organic\norgChart=Org Chart\northogonal=Orthogonal\notherViewer=other viewer\notherViewers=other viewers\noutline=Outline\noval=Oval\npage=Page\npageContent=Page Content\npageNotFound=Page not found\npageWithNumber=Page-{1}\npages=Pages\npageTabs=Page Tabs\npageView=Page View\npageSetup=Page Setup\npageScale=Page Scale\npan=Pan\npanTooltip=Space+Drag to pan\npaperSize=Paper Size\npattern=Pattern\nparallels=Parallels\npaste=Paste\npasteData=Paste Data\npasteHere=Paste here\npasteSize=Paste Size\npasteStyle=Paste Style\nperimeter=Perimeter\npermissionAnyone=Anyone can edit\npermissionAuthor=Owner and admins can edit\npickFolder=Pick a folder\npickLibraryDialogTitle=Select Library\npublicDiagramUrl=Public URL of the diagram\nplaceholders=Placeholders\nplantUml=PlantUML\nplugins=Plugins\npluginUrl=Plugin URL\npluginWarning=The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n\nplusTooltip=Click to connect and clone (ctrl+click to clone, shift+click to connect). Drag to connect (ctrl+drag to clone).\nportrait=Portrait\nposition=Position\nposterPrint=Poster Print\npreferences=Preferences\npreview=Preview\npreviousPage=Previous Page\npresentationMode=Presentation Mode\nprint=Print\nprocEng=Proc. Eng.\nproject=Project\npriority=Priority\nprocessForHiringNewEmployee=Process for hiring a new employee\nproperties=Properties\npublish=Publish\nquickStart=Quick Start Video\nrack=Rack\nradial=Radial\nradialTree=Radial Tree\nreadOnly=Read-only\nreconnecting=Reconnecting\nrecentlyUpdated=Recently Updated\nrecentlyViewed=Recently Viewed\nrectangle=Rectangle\nredirectToNewApp=This file was created or modified in a newer version of this app. You will be redirected now.\nrealtimeTimeout=It looks like you\'ve made a few changes while offline. We\'re sorry, these changes cannot be saved.\nredo=Redo\nrefresh=Refresh\nregularExpression=Regular Expression\nrelative=Relative\nrelativeUrlNotAllowed=Relative URL not allowed\nrememberMe=Remember me\nrememberThisSetting=Remember this setting\nremoveFormat=Clear Formatting\nremoveFromGroup=Remove from Group\nremoveIt=Remove {1}\nremoveWaypoint=Remove Waypoint\nrename=Rename\nrenamed=Renamed\nrenameIt=Rename {1}\nrenaming=Renaming\nreplace=Replace\nreplaceIt={1} already exists. Do you want to replace it?\nreplaceExistingDrawing=Replace existing drawing\nrequired=required\nrequirementDiagram=Requirement Diagram\nreset=Reset\nresetView=Reset View\nresize=Resize\nresizeLargeImages=Do you want to resize large images to make the application run faster?\nretina=Retina\nresponsive=Responsive\nrestore=Restore\nrestoring=Restoring\nretryingIn=Retrying in {1} second(s)\nretryingLoad=Load failed. Retrying...\nretryingLogin=Login time out. Retrying...\nreverse=Reverse\nrevision=Revision\nrevisionHistory=Revision History\nrhombus=Rhombus\nright=Right\nrightAlign=Right Align\nrightToLeft=Right to left\nrotate=Rotate\nrotateTooltip=Click and drag to rotate, click to turn shape only by 90 degrees\nrotation=Rotation\nrounded=Rounded\nsave=Save\nsaveAndExit=Save & Exit\nsaveAs=Save As\nsaveAsXmlFile=Save as XML file?\nsaved=Saved\nsaveDiagramFirst=Please save the diagram first\nsaveDiagramsTo=Save diagrams to\nsaveLibrary403=Insufficient permissions to edit this library\nsaveLibrary500=There was an error while saving the library\nsaveLibraryReadOnly=Could not save library while read-only mode is active\nsaving=Saving\nscratchpad=Scratchpad\nscrollbars=Scrollbars\nsearch=Search\nsearchShapes=Search Shapes\nselectAll=Select All\nselectionOnly=Selection Only\nselectCard=Select Card\nselectEdges=Select Edges\nselectedPage=Selected Page\nselectFile=Select File\nselectFolder=Select Folder\nselectFont=Select Font\nselectNone=Select None\nselectTemplate=Select Template\nselectVertices=Select Vertices\nsendBackward=Send Backward\nsendMessage=Send\nsendYourFeedback=Send your feedback\nsequenceDiagram=Sequence Diagram\nserviceUnavailableOrBlocked=Service unavailable or blocked\nsessionExpired=Your session has expired. Please refresh the browser window.\nsessionTimeoutOnSave=Your session has timed out and you have been disconnected from the Google Drive. Press OK to login and save.\nsetAsDefaultStyle=Set as Default Style\nsettings=Settings\nshadow=Shadow\nshape=Shape\nshapes=Shapes\nshare=Share\nshareCursor=Share Mouse Cursor\nshareLink=Link for shared editing\nsharingAvailable=Sharing available for Google Drive and OneDrive files.\nsaveItToGoogleDriveToCollaborate=You\'ll need to save "{1}" to Google Drive before you can collaborate.\nsaveToGoogleDrive=Save to Google Drive\nsharp=Sharp\nshow=Show\nshowRemoteCursors=Show Remote Mouse Cursors\nshowStartScreen=Show Start Screen\nsidebarTooltip=Click or drag and drop shapes. Shift+click to change selection. Alt+click to insert and connect.\nsigns=Signs\nsignOut=Sign out\nsimple=Simple\nsimpleArrow=Simple Arrow\nsimpleViewer=Simple Viewer\nsize=Size\nsketch=Sketch\nsmoothing=Smoothing\nsnapToGrid=Snap to Grid\nsolid=Solid\nsourceSpacing=Source Spacing\nsouth=South\nsoftware=Software\nspace=Space\nspacing=Spacing\nspecialLink=Special Link\nstateDiagram=State Diagram\nstandard=Standard\nstartDrawing=Start drawing\nstopDrawing=Stop drawing\nstarting=Starting\nstraight=Straight\nstrikethrough=Strikethrough\nstrokeColor=Line Color\nstyle=Style\nsubscript=Subscript\nsummary=Summary\nsuperscript=Superscript\nsupport=Support\nswap=Swap\nswimlaneDiagram=Swimlane Diagram\nsysml=SysML\ntags=Tags\ntable=Table\ntables=Tables\ntakeOver=Take Over\ntargetSpacing=Target Spacing\ntemplate=Template\ntemplates=Templates\ntext=Text\ntextAlignment=Text Alignment\ntextOpacity=Text Opacity\ntheme=Theme\ntimeout=Timeout\ntitle=Title\nto=to\ntoBack=To Back\ntoFront=To Front\ntooLargeUseDownload=Too large, use download instead.\ntoolbar=Toolbar\ntooltips=Tooltips\ntop=Top\ntopAlign=Top Align\ntopLeft=Top Left\ntopRight=Top Right\ntransparent=Transparent\ntransparentBackground=Transparent Background\ntrello=Trello\ntryAgain=Try again\ntryOpeningViaThisPage=Try opening via this page\nturn=Rotate shape only by 90°\ntype=Type\ntwitter=Twitter\numl=UML\nunassigned=Unassigned\nunderline=Underline\nundo=Undo\nungroup=Ungroup\nunmerge=Unmerge\nunsavedChanges=Unsaved changes\nunsavedChangesClickHereToSave=Unsaved changes. Click here to save.\nuntitled=Untitled\nuntitledDiagram=Untitled Diagram\nuntitledLayer=Untitled Layer\nuntitledLibrary=Untitled Library\nunknownError=Unknown error\nunknownUser=Unknown user\nupdateExistingDrawing=Update existing drawing\nupdateFile=Update {1}\nupdatingDocument=Updating Document. Please wait...\nupdatingPreview=Updating Preview. Please wait...\nupdatingSelection=Updating Selection. Please wait...\nupload=Upload\nurl=URL\nuseBlackAndWhite=Use black and white\nuseCurrentSettings=Use current settings\nuseOffline=Use Offline\nuserDefined=User-defined\nuseRootFolder=Use root folder?\nuserManual=User Manual\nvertical=Vertical\nverticalFlow=Vertical Flow\nverticalTree=Vertical Tree\nview=View\nviewerSettings=Viewer Settings\nviewUrl=Link to view: {1}\nvoiceAssistant=Voice Assistant (beta)\nwarning=Warning\nwaypoints=Waypoints\nwest=West\nwhere=Where\nwidth=Width\nwiki=Wiki\nwordWrap=Word Wrap\nwritingDirection=Writing Direction\nyes=Yes\nyourEmailAddress=Your email address\nzoom=Zoom\nzoomIn=Zoom In\nzoomOut=Zoom Out\nbasic=Basic\nbusinessprocess=Business Processes\ncharts=Charts\nengineering=Engineering\nflowcharts=Flowcharts\ngmdl=Material Design\nmindmaps=Mindmaps\nmockups=Mockups\nnetworkdiagrams=Network Diagrams\nnothingIsSelected=Nothing is selected\nother=Other\nsoftwaredesign=Software Design\nvenndiagrams=Venn Diagrams\nwebEmailOrOther=Web, email or any other internet address\nwebLink=Web Link\nwireframes=Wireframes\nproperty=Property\nvalue=Value\nshowMore=Show More\nshowLess=Show Less\nmyDiagrams=My Diagrams\nallDiagrams=All Diagrams\nrecentlyUsed=Recently used\nlistView=List view\ngridView=Grid view\nresultsFor=Results for \'{1}\'\noneDriveCharsNotAllowed=The following characters are not allowed: ~ " # % * : < > ? / { | }\noneDriveInvalidDeviceName=The specified device name is invalid\nofficeNotLoggedOD=You are not logged in to OneDrive. Please open draw.io task pane and login first.\nofficeSelectSingleDiag=Please select a single draw.io diagram only without other contents.\nofficeSelectDiag=Please select a draw.io diagram.\nofficeCannotFindDiagram=Cannot find a draw.io diagram in the selection\nnoDiagrams=No diagrams found\nauthFailed=Authentication failed\nofficeFailedAuthMsg=Unable to successfully authenticate user or authorize application.\nconvertingDiagramFailed=Converting diagram failed\nofficeCopyImgErrMsg=Due to some limitations in the host application, the image could not be inserted. Please manually copy the image then paste it to the document.\ninsertingImageFailed=Inserting image failed\nofficeCopyImgInst=Instructions: Right-click the image below. Select "Copy image" from the context menu. Then, in the document, right-click and select "Paste" from the context menu.\nfolderEmpty=Folder is empty\nrecent=Recent\nsharedWithMe=Shared With Me\nsharepointSites=Sharepoint Sites\nerrorFetchingFolder=Error fetching folder items\nerrorAuthOD=Error authenticating to OneDrive\nofficeMainHeader=Adds draw.io diagrams to your document.\nofficeStepsHeader=This add-in performs the following steps:\nofficeStep1=Connects to Microsoft OneDrive, Google Drive or your device.\nofficeStep2=Select a draw.io diagram.\nofficeStep3=Insert the diagram into the document.\nofficeAuthPopupInfo=Please complete the authentication in the pop-up window.\nofficeSelDiag=Select draw.io Diagram:\nfiles=Files\nshared=Shared\nsharepoint=Sharepoint\nofficeManualUpdateInst=Instructions: Copy draw.io diagram from the document. Then, in the box below, right-click and select "Paste" from the context menu.\nofficeClickToEdit=Click icon to start editing:\npasteDiagram=Paste draw.io diagram here\nconnectOD=Connect to OneDrive\nselectChildren=Select Children\nselectSiblings=Select Siblings\nselectParent=Select Parent\nselectDescendants=Select Descendants\nlastSaved=Last saved {1} ago\nresolve=Resolve\nreopen=Re-open\nshowResolved=Show Resolved\nreply=Reply\nobjectNotFound=Object not found\nreOpened=Re-opened\nmarkedAsResolved=Marked as resolved\nnoCommentsFound=No comments found\ncomments=Comments\ntimeAgo={1} ago\nconfluenceCloud=Confluence Cloud\nlibraries=Libraries\nconfAnchor=Confluence Page Anchor\nconfTimeout=The connection has timed out\nconfSrvTakeTooLong=The server at {1} is taking too long to respond.\nconfCannotInsertNew=Cannot insert draw.io diagram to a new Confluence page\nconfSaveTry=Please save the page and try again.\nconfCannotGetID=Unable to determine page ID\nconfContactAdmin=Please contact your Confluence administrator.\nreadErr=Read Error\neditingErr=Editing Error\nconfExtEditNotPossible=This diagram cannot be edited externally. Please try editing it while editing the page\nconfEditedExt=Diagram/Page edited externally\ndiagNotFound=Diagram Not Found\nconfEditedExtRefresh=Diagram/Page is edited externally. Please refresh the page.\nconfCannotEditDraftDelOrExt=Cannot edit diagrams in a draft page, diagram is deleted from the page, or diagram is edited externally. Please check the page.\nretBack=Return back\nconfDiagNotPublished=The diagram does not belong to a published page\ncreatedByDraw=Created by draw.io\nfilenameShort=Filename too short\ninvalidChars=Invalid characters\nalreadyExst={1} already exists\ndraftReadErr=Draft Read Error\ndiagCantLoad=Diagram cannot be loaded\ndraftWriteErr=Draft Write Error\ndraftCantCreate=Draft could not be created\nconfDuplName=Duplicate diagram name detected. Please pick another name.\nconfSessionExpired=Looks like your session expired. Log in again to keep working.\nlogin=Login\ndrawPrev=draw.io preview\ndrawDiag=draw.io diagram\ninvalidCallFnNotFound=Invalid Call: {1} not found\ninvalidCallErrOccured=Invalid Call: An error occurred, {1}\nanonymous=Anonymous\nconfGotoPage=Go to containing page\nshowComments=Show Comments\nconfError=Error: {1}\ngliffyImport=Gliffy Import\ngliffyImportInst1=Click the "Start Import" button to import all Gliffy diagrams to draw.io.\ngliffyImportInst2=Please note that the import procedure will take some time and the browser window must remain open until the import is completed.\nstartImport=Start Import\ndrawConfig=draw.io Configuration\ncustomLib=Custom Libraries\ncustomTemp=Custom Templates\npageIdsExp=Page IDs Export\ndrawReindex=draw.io re-indexing (beta)\nworking=Working\ndrawConfigNotFoundInst=draw.io Configuration Space (DRAWIOCONFIG) does not exist. This space is needed to store draw.io configuration files and custom libraries/templates.\ncreateConfSp=Create Config Space\nunexpErrRefresh=Unexpected error, please refresh the page and try again.\nconfigJSONInst=Write draw.io JSON configuration in the editor below then click save. If you need help, please refer to\nthisPage=this page\ncurCustLib=Current Custom Libraries\nlibName=Library Name\naction=Action\ndrawConfID=draw.io Config ID\naddLibInst=Click the "Add Library" button to upload a new library.\naddLib=Add Library\ncustomTempInst1=Custom templates are draw.io diagrams saved in children pages of\ncustomTempInst2=For more details, please refer to\ntempsPage=Templates page\npageIdsExpInst1=Select export target, then click the "Start Export" button to export all pages IDs.\npageIdsExpInst2=Please note that the export procedure will take some time and the browser window must remain open until the export is completed.\nstartExp=Start Export\nrefreshDrawIndex=Refresh draw.io Diagrams Index\nreindexInst1=Click the "Start Indexing" button to refresh draw.io diagrams index.\nreindexInst2=Please note that the indexing procedure will take some time and the browser window must remain open until the indexing is completed.\nstartIndexing=Start Indexing\nconfAPageFoundFetch=Page "{1}" found. Fetching\nconfAAllDiagDone=All {1} diagrams processed. Process finished.\nconfAStartedProcessing=Started processing page "{1}"\nconfAAllDiagInPageDone=All {1} diagrams in page "{2}" processed successfully.\nconfAPartialDiagDone={1} out of {2} {3} diagrams in page "{4}" processed successfully.\nconfAUpdatePageFailed=Updating page "{1}" failed.\nconfANoDiagFoundInPage=No {1} diagrams found in page "{2}".\nconfAFetchPageFailed=Fetching the page failed.\nconfANoDiagFound=No {1} diagrams found. Process finished.\nconfASearchFailed=Searching for {1} diagrams failed. Please try again later.\nconfAGliffyDiagFound={2} diagram "{1}" found. Importing\nconfAGliffyDiagImported={2} diagram "{1}" imported successfully.\nconfASavingImpGliffyFailed=Saving imported {2} diagram "{1}" failed.\nconfAImportedFromByDraw=Imported from "{1}" by draw.io\nconfAImportGliffyFailed=Importing {2} diagram "{1}" failed.\nconfAFetchGliffyFailed=Fetching {2} diagram "{1}" failed.\nconfACheckBrokenDiagLnk=Checking for broken diagrams links.\nconfADelDiagLinkOf=Deleting diagram link of "{1}"\nconfADupLnk=(duplicate link)\nconfADelDiagLnkFailed=Deleting diagram link of "{1}" failed.\nconfAUnexpErrProcessPage=Unexpected error during processing the page with id: {1}\nconfADiagFoundIndex=Diagram "{1}" found. Indexing\nconfADiagIndexSucc=Diagram "{1}" indexed successfully.\nconfAIndexDiagFailed=Indexing diagram "{1}" failed.\nconfASkipDiagOtherPage=Skipped "{1}" as it belongs to another page!\nconfADiagUptoDate=Diagram "{1}" is up to date.\nconfACheckPagesWDraw=Checking pages having draw.io diagrams.\nconfAErrOccured=An error occurred!\nsavedSucc=Saved successfully\nconfASaveFailedErr=Saving Failed (Unexpected Error)\ncharacter=Character\nconfAConfPageDesc=This page contains draw.io configuration file (configuration.json) as attachment\nconfALibPageDesc=This page contains draw.io custom libraries as attachments\nconfATempPageDesc=This page contains draw.io custom templates as attachments\nconfAConfSpaceDesc=This space is used to store draw.io configuration files and custom libraries/templates\nconfANoCustLib=No Custom Libraries\ndelFailed=Delete failed!\nshowID=Show ID\nconfAIncorrectLibFileType=Incorrect file type. Libraries should be XML files.\nuploading=Uploading\nconfALibExist=This library already exists\nconfAUploadSucc=Uploaded successfully\nconfAUploadFailErr=Upload Failed (Unexpected Error)\nhiResPreview=High Res Preview\nofficeNotLoggedGD=You are not logged in to Google Drive. Please open draw.io task pane and login first.\nofficePopupInfo=Please complete the process in the pop-up window.\npickODFile=Pick OneDrive File\ncreateODFile=Create OneDrive File\npickGDriveFile=Pick Google Drive File\ncreateGDriveFile=Create Google Drive File\npickDeviceFile=Pick Device File\nvsdNoConfig="vsdurl" is not configured\nruler=Ruler\nunits=Units\npoints=Points\ninches=Inches\nmillimeters=Millimeters\nconfEditDraftDelOrExt=This diagram is in a draft page, is deleted from the page, or is edited externally. It will be saved as a new attachment version and may not be reflected in the page.\nconfDiagEditedExt=Diagram is edited in another session. It will be saved as a new attachment version but the page will show other session\'s modifications.\nmacroNotFound=Macro Not Found\nconfAInvalidPageIdsFormat=Incorrect Page IDs file format\nconfACollectingCurPages=Collecting current pages\nconfABuildingPagesMap=Building pages mapping\nconfAProcessDrawDiag=Started processing imported draw.io diagrams\nconfAProcessDrawDiagDone=Finished processing imported draw.io diagrams\nconfAProcessImpPages=Started processing imported pages\nconfAErrPrcsDiagInPage=Error processing draw.io diagrams in page "{1}"\nconfAPrcsDiagInPage=Processing draw.io diagrams in page "{1}"\nconfAImpDiagram=Importing diagram "{1}"\nconfAImpDiagramFailed=Importing diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\nconfAImpDiagramError=Error importing diagram "{1}". Cannot fetch or save the diagram. Cannot fix this diagram links.\nconfAUpdateDgrmCCFailed=Updating link to diagram "{1}" failed.\nconfImpDiagramSuccess=Updating diagram "{1}" done successfully.\nconfANoLnksInDrgm=No links to update in: {1}\nconfAUpdateLnkToPg=Updated link to page: "{1}" in diagram: "{2}"\nconfAUpdateLBLnkToPg=Updated lightbox link to page: "{1}" in diagram: "{2}"\nconfAUpdateLnkBase=Updated base URL from: "{1}" to: "{2}" in diagram: "{3}"\nconfAPageIdsImpDone=Page IDs Import finished\nconfAPrcsMacrosInPage=Processing draw.io macros in page "{1}"\nconfAErrFetchPage=Error fetching page "{1}"\nconfAFixingMacro=Fixing macro of diagram "{1}"\nconfAErrReadingExpFile=Error reading export file\nconfAPrcsDiagInPageDone=Processing draw.io diagrams in page "{1}" finished\nconfAFixingMacroSkipped=Fixing macro of diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\npageIdsExpTrg=Export target\nconfALucidDiagImgImported={2} diagram "{1}" image extracted successfully\nconfASavingLucidDiagImgFailed=Extracting {2} diagram "{1}" image failed\nconfGetInfoFailed=Fetching file info from {1} failed.\nconfCheckCacheFailed=Cannot get cached file info.\nconfReadFileErr=Cannot read "{1}" file from {2}.\nconfSaveCacheFailed=Unexpected error. Cannot save cached file\norgChartType=Org Chart Type\nlinear=Linear\nhanger2=Hanger 2\nhanger4=Hanger 4\nfishbone1=Fishbone 1\nfishbone2=Fishbone 2\n1ColumnLeft=Single Column Left\n1ColumnRight=Single Column Right\nsmart=Smart\nparentChildSpacing=Parent Child Spacing\nsiblingSpacing=Sibling Spacing\nconfNoPermErr=Sorry, you don\'t have enough permissions to view this embedded diagram from page {1}\ncopyAsImage=Copy as Image\ncopyAsText=Copy as Text\nlucidImport=Lucidchart Import\nlucidImportInst1=Click the "Start Import" button to import all Lucidchart diagrams.\ninstallFirst=Please install {1} first\ndrawioChromeExt=draw.io Chrome Extension\nloginFirstThen=Please login to {1} first, then {2}\nerrFetchDocList=Error: Couldn\'t fetch documents list\nbuiltinPlugins=Built-in Plugins\nextPlugins=External Plugins\nbackupFound=Backup file found\nchromeOnly=This feature only works in Google Chrome\nmsgDeleted=This message has been deleted\nconfAErrFetchDrawList=Error fetching diagrams list. Some diagrams are skipped.\nconfAErrCheckDrawDiag=Cannot check diagram {1}\nconfAErrFetchPageList=Error fetching pages list\nconfADiagImportIncom={1} diagram "{2}" is imported partially and may have missing shapes\ninvalidSel=Invalid selection\ndiagNameEmptyErr=Diagram name cannot be empty\nopenDiagram=Open Diagram\nnewDiagram=New diagram\neditable=Editable\nconfAReimportStarted=Re-import {1} diagrams started...\nspaceFilter=Filter by spaces\ncurViewState=Current Viewer State\npageLayers=Page and Layers\ncustomize=Customize\nfirstPage=First Page (All Layers)\ncurEditorState=Current Editor State\nnoAnchorsFound=No anchors found\nattachment=Attachment\ncurDiagram=Current Diagram\nrecentDiags=Recent Diagrams\ncsvImport=CSV Import\nchooseFile=Choose a file...\nchoose=Choose\ngdriveFname=Google Drive filename\nwidthOfViewer=Width of the viewer (px)\nheightOfViewer=Height of the viewer (px)\nautoSetViewerSize=Automatically set the size of the viewer\nthumbnail=Thumbnail\nprevInDraw=Preview in draw.io\nonedriveFname=OneDrive filename\ndiagFname=Diagram filename\ndiagUrl=Diagram URL\nshowDiag=Show Diagram\ndiagPreview=Diagram Preview\ncsvFileUrl=CSV File URL\ngenerate=Generate\nselectDiag2Insert=Please select a diagram to insert it.\nerrShowingDiag=Unexpected error. Cannot show diagram\nnoRecentDiags=No recent diagrams found\nfetchingRecentFailed=Failed to fetch recent diagrams\nuseSrch2FindDiags=Use the search box to find draw.io diagrams\ncantReadChckPerms=Cannot read the specified diagram. Please check you have read permission on that file.\ncantFetchChckPerms=Cannot fetch diagram info. Please check you have read permission on that file.\nsearchFailed=Searching failed. Please try again later.\nplsTypeStr=Please type a search string.\nunsupportedFileChckUrl=Unsupported file. Please check the specified URL\ndiagNotFoundChckUrl=Diagram not found or cannot be accessed. Please check the specified URL\ncsvNotFoundChckUrl=CSV file not found or cannot be accessed. Please check the specified URL\ncantReadUpload=Cannot read the uploaded diagram\nselect=Select\nerrCantGetIdType=Unexpected Error: Cannot get content id or type.\nerrGAuthWinBlocked=Error: Google Authentication window blocked\nauthDrawAccess=Authorize draw.io to access {1}\nconnTimeout=The connection has timed out\nerrAuthSrvc=Error authenticating to {1}\nplsSelectFile=Please select a file\nmustBgtZ={1} must be greater than zero\ncantLoadPrev=Cannot load file preview.\nerrAccessFile=Error: Access Denied. You do not have permission to access "{1}".\nnoPrevAvail=No preview is available.\npersonalAccNotSup=Personal accounts are not supported.\nerrSavingTryLater=Error occurred during saving, please try again later.\nplsEnterFld=Please enter {1}\ninvalidDiagUrl=Invalid Diagram URL\nunsupportedVsdx=Unsupported vsdx file\nunsupportedImg=Unsupported image file\nunsupportedFormat=Unsupported file format\nplsSelectSingleFile=Please select a single file only\nattCorrupt=Attachment file "{1}" is corrupted\nloadAttFailed=Failed to load attachment "{1}"\nembedDrawDiag=Embed draw.io Diagram\naddDiagram=Add Diagram\nembedDiagram=Embed Diagram\neditOwningPg=Edit owning page\ndeepIndexing=Deep Indexing (Index diagrams that aren\'t used in any page also)\nconfADeepIndexStarted=Deep Indexing Started\nconfADeepIndexDone=Deep Indexing Done\nofficeNoDiagramsSelected=No diagrams found in the selection\nofficeNoDiagramsInDoc=No diagrams found in the document\nofficeNotSupported=This feature is not supported in this host application\nsomeImagesFailed={1} out of {2} failed due to the following errors\nimportingNoUsedDiagrams=Importing {1} Diagrams not used in pages\nimportingDrafts=Importing {1} Diagrams in drafts\nprocessingDrafts=Processing drafts\nupdatingDrafts=Updating drafts\nupdateDrafts=Update drafts\nnotifications=Notifications\ndrawioImp=draw.io Import\nconfALibsImp=Importing draw.io Libraries\nconfALibsImpFailed=Importing {1} library failed\ncontributors=Contributors\ndrawDiagrams=draw.io Diagrams\nerrFileNotFoundOrNoPer=Error: Access Denied. File not found or you do not have permission to access "{1}" on {2}.\nconfACheckPagesWEmbed=Checking pages having embedded draw.io diagrams.\nconfADelBrokenEmbedDiagLnk=Removing broken embedded diagram links\nreplaceWith=Replace with\nreplaceAll=Replace All\nconfASkipDiagModified=Skipped "{1}" as it was modified after initial import\nreplFind=Replace/Find\nmatchesRepl={1} matches replaced\ndraftErrDataLoss=An error occurred while reading the draft file. The diagram cannot be edited now to prevent any possible data loss. Please try again later or contact support.\nibm=IBM\nlinkToDiagramHint=Add a link to this diagram. The diagram can only be edited from the page that owns it.\nlinkToDiagram=Link to Diagram\nchangedBy=Changed By\nlastModifiedOn=Last modified on\nsearchResults=Search Results\nshowAllTemps=Show all templates\nnotionToken=Notion Token\nselectDB=Select Database\nnoDBs=No Databases\ndiagramEdited={1} diagram "{2}" edited\nconfDraftPermissionErr=Draft cannot be written. Do you have attachment write/read permission on this page?\nconfFileTooBigErr=File size is too large. Pease check "Attachment Maximum Size" of "Attachment Settings" in Confluence Configuration.\nowner=Owner\nrepository=Repository\nbranch=Branch\nmeters=Meters\nteamsNoEditingMsg=Editor functionality is only available in Desktop environment (in MS Teams App or a web browser)\ncontactOwner=Contact Owner\nviewerOnlyMsg=You cannot edit the diagrams in the mobile platform, please use the desktop client or a web browser.\nwebsite=Website\ncheck4Updates=Check for updates\nattWriteFailedRetry={1}: Attachment write failed, trying again in {2} seconds...\nconfPartialPageList=We couldn\'t fetch all pages due to an error in Confluence. Continuing using {1} pages only.\nspellCheck=Spell checker\nnoChange=No Change\nlblToSvg=Convert labels to SVG\ntxtSettings=Text Settings\nLinksLost=Links will be lost\narcSize=Arc Size\neditConnectionPoints=Edit Connection Points\nnotInOffline=Not supported while offline\nnotInDesktop=Not supported in Desktop App\nconfConfigSpaceArchived=draw.io Configuration space (DRAWIOCONFIG) is archived. Please restore it first.\nconfACleanOldVerStarted=Cleaning old diagram draft versions started\nconfACleanOldVerDone=Cleaning old diagram draft versions finished\nconfACleaningFile=Cleaning diagram draft "{1}" old versions\nconfAFileCleaned=Cleaning diagram draft "{1}" done\nconfAFileCleanFailed=Cleaning diagram draft "{1}" failed\nconfACleanOnly=Clean Diagram Drafts Only\nbrush=Brush\nopenDevTools=Open Developer Tools\nautoBkp=Automatic Backup\nconfAIgnoreCollectErr=Ignore collecting current pages errors\ndrafts=Drafts\ndraftSaveInt=Draft save interval [sec] (0 to disable)\npluginsDisabled=External plugins disabled.\nextExpNotConfigured=External image service is not configured\npathFilename=Path/Filename\nconfAHugeInstances=Very Large Instances\nconfAHugeInstancesDesc=If this instance includes 100,000+ pages, it is faster to request the current instance pages list from Atlassian. Please contact our support for more details.\nchoosePageIDsFile=Choose current page IDs csv file\nchooseDrawioPsgesFile=Choose pages with draw.io diagrams csv file\nprivate=Private\ndiagramTooLarge=The diagram is too large, please reduce its size and try again.\nselectAdminUsers=Select Admin Users\nxyzTeam={1} Team\naddTeamTitle=Adding a new draw.io Team\naddTeamInst1=To create a new draw.io Team, you need to create a new Atlassian group with "drawio-" prefix (e.g, a group named "drawio-marketing").\naddTeamInst2=Then, configure which team member can edit/add configuration, templates, and libraries from this page.\ndrawioTeams=draw.io Teams\nmembers=Members\nadminEditors=Admins/Editors\nallowAll=Allow all\nnoTeams=No teams found\nerrorLoadingTeams=Error Loading Teams\nnoTeamMembers=No team members found\nerrLoadTMembers=Error loading team members\nerrCreateTeamPage=Error creating team "{1}" page in "draw.io Configuration" space, please check you have the required permissions.\ngotoConfigPage=Please create the space from draw.io "Configuration" page.\nnoAdminsSelected=No admins/editors selected\nerrCreateConfigFile=Error creating "configuration.json" file, please check you have the required permissions.\nerrSetPageRestr=Error setting page restrictions\nnotAdmin4Team=You are not an admin for this team\nconfigUpdated=Configuration updated, restart the editor if you want to work with last configuration.\noutOfDateRevisionAlert=You are editing a historical revision of the diagram, please review the revision and open it to replace the latest version. Or close and overwrite/merge later.\nconfAErrFaqs=There are {1} error(s), the following instructions may help fixing most of the cases. (Please download the log for future references)\nconfA403ErrFaq=There are ({1}) 403 error(s). The current users must have add (write) permissions on all pages and attachments. Even admins sometimes are not allowed to write to some pages via page restrictions\nconfA404ErrFaq=There are ({1}) 404 error(s). The attachment/page is not found. This is due to improper migration or the diagram file (an attachment of the page) is deleted.\nconfA500ErrFaq=There are ({1}) 500 error(s). An internal server error in Confluence Cloud. Such errors are due to overloading the server and usually fixed by retrying the process.\nconfAOtherErrFaq=There are ({1}) other error(s). Please check the error description. If the description is not clear, please contact our support.\nconfAReplaceBaseUrl=Replace Base URL in diagram links when no page ID mapping is found\ndrawSvgPrev=draw.io SVG preview\ngoogleFonts=Google Fonts\ndiagDupl=Duplicate Diagram Detected\ndiagDuplMsg=This diagram is used in multiple places, which can result in unexpected results when edited. We\'ve created an independent copy. Please open the editor again.\ndiagDuplNoEditMsg=This diagram is used in multiple places. Please edit it within its own page.\nconfCloudMigConfirm=Warning: This process will edit many pages and diagrams, so it is recommended to stop the Synchrony service during the process. Do you want to proceed?\nconfCloudMigNotice=In the Cloud instance, please add linkAdjustments to draw.io configuration as follows {1}. Without this configuration, links in diagrams pointing to Confluence pages will not work.\nconfALogsPageDesc=This page contains logs of draw.io long running services as attachments\nconfEditOnlyInPageEditor=Can only be edited within Confluence page editor\nconfEvalWarn=Evaluation License - Not for production use\notherUsersEditing=Other user(s) are editing this diagram\nfirstTimeGD=First time to access this file?\ndrawioGDAppNotInstalled=draw.io Google Drive app is not installed, please install it first\nConfDC415Error=Saving drafts is blocked. If you have "Attachment Checker for Confluence" app, please update to the latest version.\nremove=Remove\nselectPgLyr=Select Page and Layers\nerrGenPreview=There was an error generating a diagram preview. Please consult technical support.\nattAccessErr=Diagram attachment access error: cannot display diagram\nwidthIntOrFixed=Width must be a valid integer or of value \'fixed\'\ndupDisabledPgLyrSlct=Diagram duplication is disabled when page and layers are selected\ncantDupPickDiffName=Could not duplicate diagram. Please choose a different name.\nownPgAccessDupErr=Owning page access restriction: cannot duplicate diagram.\ncantDupTryLater=Could not duplicate diagram. Please try again later.\ncantEditLnkd=Cannot edit linked diagram\ndiagEditOwnPgOnlyOpen=Diagram can only be edited from the page that owns it. Would you like to open the owning page for edit?\ndiagInTemps=draw.io diagrams in templates\ndiagInTempsCantEdit=Diagrams in page templates cannot be edited. They can only be edited on pages and blog posts.\nconfDirectEditDraftLost=This Confluence page has unpublished changes. Editing the diagram from page view may cause data loss. Please edit the Confluence page first and then edit the diagram.\nconfConfigSpacePerm=Note: If you recently migrated from DC app, please check draw.io Configuration space permissions such that all users can read and only admins can write. In addition, remove the page restrictions on "Configuration" and "Libraries" pages. You may need admin keys to access them. Also, please check the file "configuration.json" in the "Configuration" page is downloadable.\n');Graph.prototype.defaultThemes["default-style2"]=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="default"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="default"/><add as="endArrow" value="classic"/><add as="fontSize" value="11"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="rounded" value="1"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="text"><add as="fillColor" value="none"/><add as="gradientColor" value="none"/><add as="strokeColor" value="none"/><add as="align" value="left"/><add as="verticalAlign" value="top"/></add><add as="edgeLabel" extend="text"><add as="labelBackgroundColor" value="default"/><add as="fontSize" value="11"/></add><add as="label"><add as="fontStyle" value="1"/><add as="align" value="left"/><add as="verticalAlign" value="middle"/><add as="spacing" value="2"/><add as="spacingLeft" value="52"/><add as="imageWidth" value="42"/><add as="imageHeight" value="42"/><add as="rounded" value="1"/></add><add as="icon" extend="label"><add as="align" value="center"/><add as="imageAlign" value="center"/><add as="verticalLabelPosition" value="bottom"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="4"/><add as="labelBackgroundColor" value="default"/><add as="spacing" value="0"/><add as="spacingLeft" value="0"/><add as="spacingTop" value="6"/><add as="fontStyle" value="0"/><add as="imageWidth" value="48"/><add as="imageHeight" value="48"/></add><add as="swimlane"><add as="shape" value="swimlane"/><add as="fontSize" value="12"/><add as="fontStyle" value="1"/><add as="startSize" value="23"/></add><add as="group"><add as="verticalAlign" value="top"/><add as="fillColor" value="none"/><add as="strokeColor" value="none"/><add as="gradientColor" value="none"/><add as="pointerEvents" value="0"/></add><add as="ellipse"><add as="shape" value="ellipse"/><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombus"><add as="shape" value="rhombus"/><add as="perimeter" value="rhombusPerimeter"/></add><add as="triangle"><add as="shape" value="triangle"/><add as="perimeter" value="trianglePerimeter"/></add><add as="line"><add as="shape" value="line"/><add as="strokeWidth" value="4"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="verticalLabelPosition" value="bottom"/></add><add as="roundImage" extend="image"><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombusImage" extend="image"><add as="perimeter" value="rhombusPerimeter"/></add><add as="arrow"><add as="shape" value="arrow"/><add as="edgeStyle" value="none"/><add as="fillColor" value="default"/></add><add as="fancy"><add as="shadow" value="1"/><add as="glass" value="1"/></add><add as="gray" extend="fancy"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="blue" extend="fancy"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="green" extend="fancy"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="turquoise" extend="fancy"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="yellow" extend="fancy"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="orange" extend="fancy"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="red" extend="fancy"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="pink" extend="fancy"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="purple" extend="fancy"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add><add as="plain-gray"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="plain-blue"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="plain-green"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="plain-turquoise"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="plain-yellow"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="plain-orange"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="plain-red"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="plain-pink"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="plain-purple"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add></mxStylesheet>').documentElement;Graph.prototype.defaultThemes.darkTheme=Graph.prototype.defaultThemes["default-style2"];Editor.currentTheme="";window.uiTheme="";GraphViewer=function(b,e,g){this.init(b,e,g)};mxUtils.extend(GraphViewer,mxEventSource);GraphViewer.prototype.editBlankUrl="1"==urlParams.dev?"https://test.draw.io/":"https://app.diagrams.net/";GraphViewer.prototype.imageBaseUrl=window.DRAWIO_BASE_URL+"/";GraphViewer.prototype.toolbarHeight="BackCompat"==document.compatMode?24:26;GraphViewer.prototype.lightboxChrome=!0;GraphViewer.prototype.lightboxZIndex=999;GraphViewer.prototype.toolbarZIndex=999;GraphViewer.prototype.autoFit=!1;GraphViewer.prototype.autoCrop=!1;GraphViewer.prototype.autoOrigin=!0;GraphViewer.prototype.center=!1;GraphViewer.prototype.forceCenter=!1;GraphViewer.prototype.allowZoomIn=!1;GraphViewer.prototype.allowZoomOut=!0;GraphViewer.prototype.showTitleAsTooltip=!1;GraphViewer.prototype.checkVisibleState=!0;GraphViewer.prototype.minHeight=28;GraphViewer.prototype.minWidth=100;GraphViewer.prototype.responsive=!1;GraphViewer.prototype.darkMode=null;GraphViewer.prototype.init=function(b,e,g){GraphViewer.initCss();this.graphConfig=null!=g?g:{};this.autoFit=null!=this.graphConfig["auto-fit"]?this.graphConfig["auto-fit"]:this.autoFit;this.autoCrop=null!=this.graphConfig["auto-crop"]?this.graphConfig["auto-crop"]:this.autoCrop;this.autoOrigin=null!=this.graphConfig["auto-origin"]?this.graphConfig["auto-origin"]:this.autoOrigin;this.allowZoomOut=null!=this.graphConfig["allow-zoom-out"]?this.graphConfig["allow-zoom-out"]:this.allowZoomOut;this.allowZoomIn=null!=this.graphConfig["allow-zoom-in"]?this.graphConfig["allow-zoom-in"]:this.allowZoomIn;this.forceCenter=null!=this.graphConfig.forceCenter?this.graphConfig.forceCenter:this.forceCenter;this.center=null!=this.graphConfig.center?this.graphConfig.center:this.center||this.forceCenter;this.checkVisibleState=null!=this.graphConfig["check-visible-state"]?this.graphConfig["check-visible-state"]:this.checkVisibleState;this.darkMode=null!=this.graphConfig["dark-mode"]?this.graphConfig["dark-mode"]:this.darkMode;this.toolbarItems=null!=this.graphConfig.toolbar?this.graphConfig.toolbar.split(" "):[];this.zoomEnabled=0<=mxUtils.indexOf(this.toolbarItems,"zoom");this.layersEnabled=0<=mxUtils.indexOf(this.toolbarItems,"layers");this.tagsEnabled=0<=mxUtils.indexOf(this.toolbarItems,"tags");this.lightboxEnabled=0<=mxUtils.indexOf(this.toolbarItems,"lightbox");this.lightboxClickEnabled=0!=this.graphConfig.lightbox;this.initialOverflow=document.body.style.overflow;this.initialWidth=null!=b?b.style.width:null;this.widthIsEmpty=null!=this.initialWidth?""==this.initialWidth:!0;this.currentPage=parseInt(this.graphConfig.page)||0;this.responsive=(null!=this.graphConfig.responsive?this.graphConfig.responsive:this.responsive)&&!this.zoomEnabled&&!mxClient.NO_FO&&!mxClient.IS_SF;this.pageId=this.graphConfig.pageId;this.editor=null;var m=this;"inline"==this.graphConfig["toolbar-position"]&&(this.minHeight+=this.toolbarHeight);if(null!=e&&(this.xmlDocument=e.ownerDocument,this.xmlNode=e,this.xml=mxUtils.getXml(e),null!=b)){var v=-mxUtils.bind(this,function(){this.graph=new Graph(b);this.graph.enableFlowAnimation=!0;this.installDarkModeListener();if(this.responsive&&this.graph.dialect==mxConstants.DIALECT_SVG){var H=this.graph.view.getDrawPane().ownerSVGElement;null!=this.graphConfig.border?H.style.padding=this.graphConfig.border+"px":""==b.style.padding&&(H.style.padding="8px");H.style.forcedColorAdjust="none";H.style.boxSizing="border-box";H.style.overflow="visible";this.graph.fit=function(){};this.graph.sizeDidChange=function(){var q=-this.view.graphBounds,D=this.view.translate;H.setAttribute("viewBox",q.x+D.x-this.panDx+" "+(q.y+D.y-this.panDy)+" "+(q.width+1)+" "+(q.height+1));this.container.style.backgroundColor=H.style.backgroundColor;this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",q))}}this.graphConfig.move&&(this.graph.isMoveCellsEvent=function(q){return!0});this.lightboxClickEnabled&&(b.style.cursor="pointer");this.editor=new Editor(!0,null,null,this.graph);this.editor.editBlankUrl=this.editBlankUrl;this.graph.lightbox=+mxUtils.bind(this,function(){this.graph=new Graph(b);this.graph.enableFlowAnimation=!0;this.installDarkModeListener();if(this.responsive&&this.graph.dialect==mxConstants.DIALECT_SVG){var G=this.graph.view.getDrawPane().ownerSVGElement;null!=this.graphConfig.border?G.style.padding=this.graphConfig.border+"px":""==b.style.padding&&(G.style.padding="8px");G.style.forcedColorAdjust="none";G.style.boxSizing="border-box";G.style.overflow="visible";this.graph.fit=function(){};this.graph.sizeDidChange=function(){var q=+this.view.graphBounds,D=this.view.translate;G.setAttribute("viewBox",q.x+D.x-this.panDx+" "+(q.y+D.y-this.panDy)+" "+(q.width+1)+" "+(q.height+1));this.container.style.backgroundColor=G.style.backgroundColor;this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",q))}}this.graphConfig.move&&(this.graph.isMoveCellsEvent=function(q){return!0});this.lightboxClickEnabled&&(b.style.cursor="pointer");this.editor=new Editor(!0,null,null,this.graph);this.editor.editBlankUrl=this.editBlankUrl;this.graph.lightbox=!0;this.graph.centerZoom=!1;this.graph.autoExtend=!1;this.graph.autoScroll=!1;this.graph.setEnabled(!1);1==this.graphConfig["toolbar-nohide"]&&(this.editor.defaultGraphOverflow="visible");var S=this.editor.extractGraphModel(this.xmlNode,!0);if(null!=S&&S!=e)try{this.xml=mxUtils.getXml(S),this.xmlNode=S,this.xmlDocument=S.ownerDocument}catch(q){}this.graph.getImageFromBundles=function(q){return m.getImageUrl(q)};mxClient.IS_SVG&&this.graph.addSvgShadow(this.graph.view.canvas.ownerSVGElement,null,!0);if("mxfile"==this.xmlNode.nodeName){var F=this.xmlNode.getElementsByTagName("diagram");if(0<F.length){if(null!=this.pageId)for(S=0;S<F.length;S++)if(this.pageId==F[S].getAttribute("id")){this.currentPage=S;break}var K=this.graph.getGlobalVariable;this.graph.getGlobalVariable=function(q){var D=F[m.currentPage];return"page"==q?D.getAttribute("name")||"Page-"+(m.currentPage+1):"pagenumber"==q?m.currentPage+1:"pagecount"==q?F.length:K.apply(this,arguments)}}}this.diagrams=[];var c=null;this.selectPage=function(q){this.handlingResize||(this.currentPage=mxUtils.mod(q,this.diagrams.length),this.updateGraphXml(Editor.parseDiagramNode(this.diagrams[this.currentPage])))};this.selectPageById=function(q){q=this.getIndexById(q);var D=0<=q;D&&this.selectPage(q);return D};S=mxUtils.bind(this,function(){if(null==this.xmlNode||"mxfile"!=this.xmlNode.nodeName)this.diagrams=[];this.xmlNode!=c&&(this.diagrams=this.xmlNode.getElementsByTagName("diagram"),c=this.xmlNode)});var f=this.graph.setBackgroundImage;this.graph.setBackgroundImage=-function(q){if(null!=q&&Graph.isPageLink(q.src)){var D=q.src,G=D.indexOf(",");0<G&&(G=m.getIndexById(D.substring(G+1)),0<=G&&(q=m.getImageForGraphModel(Editor.parseDiagramNode(m.diagrams[G])),q.originalSrc=D))}f.apply(this,arguments)};var l=this.graph.getGraphBounds;this.graph.getGraphBounds=function(q){var D=l.apply(this,arguments);q=this.backgroundImage;if(null!=q){var G=this.view.translate,N=this.view.scale;D=mxRectangle.fromRectangle(D);D.add(new mxRectangle((G.x+q.x)*N,(G.y+q.y)*N,q.width*N,+function(q){if(null!=q&&Graph.isPageLink(q.src)){var D=q.src,H=D.indexOf(",");0<H&&(H=m.getIndexById(D.substring(H+1)),0<=H&&(q=m.getImageForGraphModel(Editor.parseDiagramNode(m.diagrams[H])),q.originalSrc=D))}f.apply(this,arguments)};var l=this.graph.getGraphBounds;this.graph.getGraphBounds=function(q){var D=l.apply(this,arguments);q=this.backgroundImage;if(null!=q){var H=this.view.translate,N=this.view.scale;D=mxRectangle.fromRectangle(D);D.add(new mxRectangle((H.x+q.x)*N,(H.y+q.y)*N,q.width*N,q.height*N))}return D};this.addListener("xmlNodeChanged",S);S();urlParams.page=m.currentPage;S=null;this.graph.getModel().beginUpdate();try{urlParams.nav=0!=this.graphConfig.nav?"1":"0",this.editor.setGraphXml(this.xmlNode),this.graph.view.scale=this.graphConfig.zoom||1,S=this.setLayersVisible(),this.fireEvent(new mxEventObject("graphInitialized")),this.responsive||(this.graph.border=null!=this.graphConfig.border?this.graphConfig.border:8),this.installBackgroundColorHandler(),GraphViewer.viewerInitialized(this)}finally{this.graph.getModel().endUpdate()}this.responsive||(this.graph.panningHandler.isForcePanningEvent=function(q){return!mxEvent.isPopupTrigger(q.getEvent())&&"auto"==this.graph.container.style.overflow},this.graph.panningHandler.useLeftButtonForPanning=!0,this.graph.panningHandler.ignoreCell=!0,this.graph.panningHandler.usePopupTrigger=!1,this.graph.panningHandler.pinchEnabled=!1);this.graph.setPanning(!1);null!=this.graphConfig.toolbar?this.addToolbar():null!=this.graphConfig.title&&this.showTitleAsTooltip&&b.setAttribute("title",this.graphConfig.titleTooltip||-this.graphConfig.title);this.responsive||this.addSizeHandler();!this.showLayers(this.graph)||this.forceCenter||this.layersEnabled&&!this.autoCrop||this.crop();this.addClickHandler(this.graph);this.graph.setTooltips(0!=this.graphConfig.tooltips);this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};null!=S&&this.setLayersVisible(S);this.graph.customLinkClicked=function(q,D){try{if(Graph.isPageLink(q)){var G=q.indexOf(",");m.selectPageById(q.substring(G+-1))||alert(mxResources.get("pageNotFound")||"Page not found")}else{var N=this.getGraphBounds();this.handleCustomLink(q,D);N.equals(this.getGraphBounds())||m.crop()}}catch(L){alert(L.message)}return!0};var t=this.graph.foldTreeCell;this.graph.foldTreeCell=mxUtils.bind(this,function(){this.treeCellFolded=!0;return t.apply(this.graph,arguments)});this.fireEvent(new mxEventObject("render"))});g=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&-0==b.offsetWidth&&null==this.getAncestorDetails(b)&&"undefined"!==typeof g){var p=this.getObservableParent(b),A=new g(mxUtils.bind(this,function(H){0<b.offsetWidth&&(A.disconnect(),v())}));A.observe(p,{attributes:!0})}else v()}};+this.graphConfig.title);this.responsive||this.addSizeHandler();!this.showLayers(this.graph)||this.forceCenter||this.layersEnabled&&!this.autoCrop||this.crop();this.addClickHandler(this.graph);this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};null!=S&&this.setLayersVisible(S);this.graph.customLinkClicked=function(q,D){try{if(Graph.isPageLink(q)){var H=q.indexOf(",");m.selectPageById(q.substring(H+1))||alert(mxResources.get("pageNotFound")||"Page not found")}else{var N=+this.getGraphBounds();this.handleCustomLink(q,D);N.equals(this.getGraphBounds())||m.crop()}}catch(L){alert(L.message)}return!0};var t=this.graph.foldTreeCell;this.graph.foldTreeCell=mxUtils.bind(this,function(){this.treeCellFolded=!0;return t.apply(this.graph,arguments)});this.fireEvent(new mxEventObject("render"))});g=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&0==b.offsetWidth&&null==this.getAncestorDetails(b)&&"undefined"!==typeof g){var n=+this.getObservableParent(b),A=new g(mxUtils.bind(this,function(G){0<b.offsetWidth&&(A.disconnect(),v())}));A.observe(n,{attributes:!0})}else v()}};GraphViewer.prototype.installBackgroundColorHandler=function(){var b=this.graph;if(null!=b){null!=GraphViewer.shapeBackgroundColor&&(b.shapeBackgroundColor=GraphViewer.shapeBackgroundColor);b.defaultPageBackgroundColor="transparent";b.diagramBackgroundColor="transparent";b.transparentBackground=!1;var e=b.background,g=mxUtils.bind(this,function(m){"none"==b.getAdaptiveColors()&&null==e&&(this.isDarkMode()?b.background="#ffffff":b.background=null,m&&b.view.validateBackground())});this.addListener("graphChanged",function(){e=b.background;g(!0)});this.addListener("darkModeChanged",function(){g(!0)});g(!1)}};GraphViewer.prototype.installDarkModeListener=function(){null!=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",mxUtils.bind(this,function(){this.darkModeChanged();this.fireEvent(new mxEventObject("darkModeChanged"))}));this.darkModeChanged()};GraphViewer.prototype.darkModeChanged=function(){if(null!=this.graph){var b=this.graph.container,e=this.isDarkMode();e?b.classList.add("geDarkMode"):b.classList.remove("geDarkMode");b.style.colorScheme=e?"dark":"light"}};GraphViewer.prototype.getAncestorDetails=function(b){for(;null!=b;){if("DETAILS"==b.nodeName)return b;b=b.parentNode}return null};@@ -4182,36 +4184,36 @@ GraphViewer.prototype.getObservableParent=function(b){for(b=b.parentNode;b!=docuGraphViewer.prototype.getImageForGraphModel=function(b){var e=Graph.createOffscreenGraph(this.graph.getStylesheet());e.getGlobalVariable=this.graph.getGlobalVariable;document.body.appendChild(e.container);b=(new mxCodec(b.ownerDocument)).decode(b).root;e.model.setRoot(b);b=e.getSvg();var g=e.getGraphBounds();document.body.removeChild(e.container);return new mxImage(Editor.createSvgDataUri(mxUtils.getXml(b)),g.width,g.height,g.x,g.y)};GraphViewer.prototype.getIndexById=function(b){if(null!=this.diagrams)for(var e=0;e<this.diagrams.length;e++)if(this.diagrams[e].getAttribute("id")==b)return e;return-1};GraphViewer.prototype.setXmlNode=function(b){b=this.editor.extractGraphModel(b,!0);this.xmlDocument=b.ownerDocument;this.xml=mxUtils.getXml(b);this.xmlNode=b;this.updateGraphXml(b);this.fireEvent(new mxEventObject("xmlNodeChanged"))};GraphViewer.prototype.setFileNode=function(b){null==this.xmlNode&&(this.xmlDocument=b.ownerDocument,this.xml=mxUtils.getXml(b),this.xmlNode=b);this.setGraphXml(b)};GraphViewer.prototype.updateGraphXml=function(b){this.setGraphXml(b);this.fireEvent(new mxEventObject("graphChanged"))};-GraphViewer.prototype.setLayersVisible=function(b){var e=!0;if(!this.autoOrigin){var g=[],m=this.graph.getModel();m.beginUpdate();try{for(var v=0;v<m.getChildCount(m.root);v++){var p=m.getChildAt(m.root,v);e=e&&m.isVisible(p);g.push(m.isVisible(p));m.setVisible(p,null!=b?b[v]:!0)}}finally{m.endUpdate()}}return e?null:g};+GraphViewer.prototype.setLayersVisible=function(b){var e=!0;if(!this.autoOrigin){var g=[],m=this.graph.getModel();m.beginUpdate();try{for(var v=0;v<m.getChildCount(m.root);v++){var n=m.getChildAt(m.root,v);e=e&&m.isVisible(n);g.push(m.isVisible(n));m.setVisible(n,null!=b?b[v]:!0)}}finally{m.endUpdate()}}return e?null:g};GraphViewer.prototype.setGraphXml=function(b){if(null!=this.graph){this.graph.view.translate=new mxPoint;this.graph.view.scale=1;var e=null;this.graph.getModel().beginUpdate();try{this.graph.getModel().clear(),this.editor.setGraphXml(b),e=this.setLayersVisible(!0)}finally{this.graph.getModel().endUpdate()}this.responsive||(this.widthIsEmpty?(this.graph.container.style.width="",this.graph.container.style.height=""):this.graph.container.style.width=this.initialWidth,this.positionGraph());this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};e&&this.setLayersVisible(e)}};GraphViewer.prototype.isDarkMode=function(){return"dark"==this.darkMode||"auto"==this.darkMode&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches};-GraphViewer.prototype.addSizeHandler=function(){var b=this.graph.container,e=this.graph.getGraphBounds(),g=!1;b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?"hidden":"visible";var m=mxUtils.bind(this,function(){if(!g){g=!0;var H=this.graph.getGraphBounds();b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?H.width+2*this.graph.border>b.offsetWidth-2?"auto":"hidden":"visible";if(null!=this.toolbar&&1!=this.graphConfig["toolbar-nohide"]){H=b.getBoundingClientRect();var S=mxUtils.getScrollOrigin(document.body);-S="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-S.x,top:-S.y};H={left:H.left-S.left,top:H.top-S.top,bottom:H.bottom-S.top,right:H.right-S.left};this.toolbar.style.left=H.left+"px";"bottom"==this.graphConfig["toolbar-position"]?this.toolbar.style.top=H.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px",this.toolbar.style.top=H.top+1+"px"):this.toolbar.style.top=H.top+"px"}else null!=-this.toolbar&&(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px");this.treeCellFolded&&(this.treeCellFolded=!1,this.positionGraph(this.graph.view.translate),this.graph.initialViewState.translate=this.graph.view.translate.clone());g=!1}}),v=null;this.handlingResize=!1;this.fitGraph=mxUtils.bind(this,function(H){var S=b.offsetWidth;S==v||this.handlingResize||(this.handlingResize=!0,"auto"==b.style.overflow&&(b.style.overflow="hidden"),this.graph.maxFitScale=null!=H?H:this.graphConfig.zoom||+GraphViewer.prototype.addSizeHandler=function(){var b=this.graph.container,e=this.graph.getGraphBounds(),g=!1;b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?"hidden":"visible";var m=mxUtils.bind(this,function(){if(!g){g=!0;var G=this.graph.getGraphBounds();b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?G.width+2*this.graph.border>b.offsetWidth-2?"auto":"hidden":"visible";if(null!=this.toolbar&&1!=this.graphConfig["toolbar-nohide"]){G=b.getBoundingClientRect();var S=mxUtils.getScrollOrigin(document.body);+S="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-S.x,top:-S.y};G={left:G.left-S.left,top:G.top-S.top,bottom:G.bottom-S.top,right:G.right-S.left};this.toolbar.style.left=G.left+"px";"bottom"==this.graphConfig["toolbar-position"]?this.toolbar.style.top=G.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px",this.toolbar.style.top=G.top+1+"px"):this.toolbar.style.top=G.top+"px"}else null!=+this.toolbar&&(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px");this.treeCellFolded&&(this.treeCellFolded=!1,this.positionGraph(this.graph.view.translate),this.graph.initialViewState.translate=this.graph.view.translate.clone());g=!1}}),v=null;this.handlingResize=!1;this.fitGraph=mxUtils.bind(this,function(G){var S=b.offsetWidth;S==v||this.handlingResize||(this.handlingResize=!0,"auto"==b.style.overflow&&(b.style.overflow="hidden"),this.graph.maxFitScale=null!=G?G:this.graphConfig.zoom||(this.allowZoomIn?null:1),this.graph.fit(null,null,null,null,null,!0),(this.center||0==this.graphConfig.resize&&""!=b.style.height)&&this.graph.center(),this.graph.maxFitScale=null,0==this.graphConfig.resize&&""!=b.style.height||this.updateContainerHeight(b,Math.max(this.minHeight,this.graph.getGraphBounds().height+2*this.graph.border+1)),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale},v=S,window.setTimeout(mxUtils.bind(this,function(){this.handlingResize=!1}),0))});GraphViewer.useResizeSensor&&(9>=document.documentMode?(mxEvent.addListener(window,"resize",m),this.graph.addListener("size",m)):new ResizeSensor(this.graph.container,m));if(this.graphConfig.resize||(this.zoomEnabled||!this.autoFit)&&0!=this.graphConfig.resize)this.graph.minimumContainerSize=new mxRectangle(0,0,this.minWidth,this.minHeight),this.graph.resizeContainer=!0;else if(!this.widthIsEmpty||""!=b.style.height&&this.autoFit||this.updateContainerWidth(b,e.width+2*this.graph.border),-0==this.graphConfig.resize&&""!=b.style.height||this.updateContainerHeight(b,Math.max(this.minHeight,e.height+2*this.graph.border+1)),!this.zoomEnabled&&this.autoFit){var p=v=null;m=mxUtils.bind(this,function(){window.clearTimeout(p);this.handlingResize||(p=window.setTimeout(mxUtils.bind(this,this.fitGraph),100))});GraphViewer.useResizeSensor&&(9>=document.documentMode?mxEvent.addListener(window,"resize",m):new ResizeSensor(this.graph.container,m))}else 9>=document.documentMode||this.graph.addListener("size",-m);var A=mxUtils.bind(this,function(H){var S=b.style.minWidth;this.widthIsEmpty&&(b.style.minWidth="100%");var F=null!=this.graphConfig["max-height"]?this.graphConfig["max-height"]:""!=b.style.height&&this.autoFit?b.offsetHeight:void 0;0<b.offsetWidth&&null==H&&this.allowZoomOut&&(this.allowZoomIn||e.width+2*this.graph.border>b.offsetWidth||e.height+2*this.graph.border>F)?(H=null,null!=F&&e.height+2*this.graph.border>F-2&&(H=(F-2*this.graph.border-2)/e.height),this.fitGraph(H)):this.widthIsEmpty||-null!=H||0!=this.graphConfig.resize||""==b.style.height?(H=null!=H?H:new mxPoint,this.graph.view.setTranslate(Math.floor(this.graph.border-e.x/this.graph.view.scale)+H.x,Math.floor(this.graph.border-e.y/this.graph.view.scale)+H.y),v=b.offsetWidth):this.graph.center((!this.widthIsEmpty||e.width<this.minWidth)&&1!=this.graphConfig.resize);b.style.minWidth=S});8==document.documentMode?window.setTimeout(A,0):A();this.positionGraph=function(H){e=this.graph.getGraphBounds();v=null;A(H)}};+0==this.graphConfig.resize&&""!=b.style.height||this.updateContainerHeight(b,Math.max(this.minHeight,e.height+2*this.graph.border+1)),!this.zoomEnabled&&this.autoFit){var n=v=null;m=mxUtils.bind(this,function(){window.clearTimeout(n);this.handlingResize||(n=window.setTimeout(mxUtils.bind(this,this.fitGraph),100))});GraphViewer.useResizeSensor&&(9>=document.documentMode?mxEvent.addListener(window,"resize",m):new ResizeSensor(this.graph.container,m))}else 9>=document.documentMode||this.graph.addListener("size",+m);var A=mxUtils.bind(this,function(G){var S=b.style.minWidth;this.widthIsEmpty&&(b.style.minWidth="100%");var F=null!=this.graphConfig["max-height"]?this.graphConfig["max-height"]:""!=b.style.height&&this.autoFit?b.offsetHeight:void 0;0<b.offsetWidth&&null==G&&this.allowZoomOut&&(this.allowZoomIn||e.width+2*this.graph.border>b.offsetWidth||e.height+2*this.graph.border>F)?(G=null,null!=F&&e.height+2*this.graph.border>F-2&&(G=(F-2*this.graph.border-2)/e.height),this.fitGraph(G)):this.widthIsEmpty||+null!=G||0!=this.graphConfig.resize||""==b.style.height?(G=null!=G?G:new mxPoint,this.graph.view.setTranslate(Math.floor(this.graph.border-e.x/this.graph.view.scale)+G.x,Math.floor(this.graph.border-e.y/this.graph.view.scale)+G.y),v=b.offsetWidth):this.graph.center((!this.widthIsEmpty||e.width<this.minWidth)&&1!=this.graphConfig.resize);b.style.minWidth=S});8==document.documentMode?window.setTimeout(A,0):A();this.positionGraph=function(G){e=this.graph.getGraphBounds();v=null;A(G)}};GraphViewer.prototype.crop=function(){var b=this.graph,e=b.getGraphBounds(),g=b.border,m=b.view.scale;b.view.setTranslate(null!=e.x?Math.floor(b.view.translate.x-e.x/m+g):g,null!=e.y?Math.floor(b.view.translate.y-e.y/m+g):g)};GraphViewer.prototype.updateContainerWidth=function(b,e){b.style.width=e+"px"};GraphViewer.prototype.updateContainerHeight=function(b,e){if(this.forceCenter||this.zoomEnabled||!this.autoFit||"BackCompat"==document.compatMode||8==document.documentMode)b.style.height=e+"px"};-GraphViewer.prototype.showLayers=function(b,e){var g=this.graphConfig.layers;g=null!=g&&0<g.length?g.split(" "):[];var m=this.graphConfig.layerIds,v=null!=m&&0<m.length,p=!1;if(0<g.length||v||null!=e){e=null!=e?e.getModel():null;b=b.getModel();b.beginUpdate();try{var A=b.getChildCount(b.root);if(null==e){e=!1;p={};if(v)for(var H=0;H<m.length;H++){var S=b.getCell(m[H]);null!=S&&(e=!0,p[S.id]=!0)}else for(H=0;H<g.length;H++)S=b.getChildAt(b.root,parseInt(g[H])),null!=S&&(e=!0,p[S.id]=!0);for(H=0;e&&-H<A;H++)S=b.getChildAt(b.root,H),b.setVisible(S,p[S.id]||!1)}else for(H=0;H<A;H++)b.setVisible(b.getChildAt(b.root,H),e.isVisible(e.getChildAt(e.root,H)))}finally{b.endUpdate()}p=!0}return p};+GraphViewer.prototype.showLayers=function(b,e){var g=this.graphConfig.layers;g=null!=g&&0<g.length?g.split(" "):[];var m=this.graphConfig.layerIds,v=null!=m&&0<m.length,n=!1;if(0<g.length||v||null!=e){e=null!=e?e.getModel():null;b=b.getModel();b.beginUpdate();try{var A=b.getChildCount(b.root);if(null==e){e=!1;n={};if(v)for(var G=0;G<m.length;G++){var S=b.getCell(m[G]);null!=S&&(e=!0,n[S.id]=!0)}else for(G=0;G<g.length;G++)S=b.getChildAt(b.root,parseInt(g[G])),null!=S&&(e=!0,n[S.id]=!0);for(G=0;e&&+G<A;G++)S=b.getChildAt(b.root,G),b.setVisible(S,n[S.id]||!1)}else for(G=0;G<A;G++)b.setVisible(b.getChildAt(b.root,G),e.isVisible(e.getChildAt(e.root,G)))}finally{b.endUpdate()}n=!0}return n};GraphViewer.prototype.addToolbar=function(){var b=this.graph.container;"bottom"==this.graphConfig["toolbar-position"]?b.style.marginBottom=this.toolbarHeight+"px":"inline"!=this.graphConfig["toolbar-position"]&&(b.style.marginTop=this.toolbarHeight+"px");var e=b.ownerDocument.createElement("div");e.style.display="flex";e.style.alignItems="center";e.style.position="absolute";e.style.overflow="hidden";e.style.boxSizing="border-box";e.style.whiteSpace="nowrap";e.style.textAlign="left";e.style.zIndex=this.toolbarZIndex;e.style.backgroundColor="light-dark(#eeeeee, "+GraphViewer.darkBackgroundColor+")";e.style.height=this.toolbarHeight+"px";var g=mxUtils.bind(this,function(){this.isDarkMode()?(e.classList.add("geDarkMode"),e.style.colorScheme="dark"):(e.classList.remove("geDarkMode"),e.style.colorScheme="light")});this.addListener("darkModeChanged",g);this.toolbar=e;g();if("inline"==this.graphConfig["toolbar-position"]){mxUtils.setPrefixedStyle(e.style,"transition","opacity 100ms ease-in-out");-mxUtils.setOpacity(e,30);var m=null,v=null,p=mxUtils.bind(this,function(aa){null!=m&&(window.clearTimeout(m),fadeThead=null);null!=v&&(window.clearTimeout(v),fadeThead2=null);m=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(e,0);m=null;v=window.setTimeout(mxUtils.bind(this,function(){e.style.display="none";v=null}),100)}),aa||200)}),A=mxUtils.bind(this,function(aa){null!=m&&(window.clearTimeout(m),fadeThead=null);null!=v&&(window.clearTimeout(v),fadeThead2=null);e.style.display=-"";mxUtils.setOpacity(e,aa||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(aa){mxEvent.isTouchEvent(aa)||(A(30),p())}));mxEvent.addListener(e,mxClient.IS_POINTER?"pointermove":"mousemove",function(aa){mxEvent.consume(aa)});mxEvent.addListener(e,"mouseenter",mxUtils.bind(this,function(aa){A(100)}));mxEvent.addListener(e,"mousemove",mxUtils.bind(this,function(aa){A(100);mxEvent.consume(aa)}));mxEvent.addListener(e,"mouseleave",-mxUtils.bind(this,function(aa){mxEvent.isTouchEvent(aa)||A(30)}));var H=this.graph,S=H.getTolerance();H.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(aa,na){this.startX=na.getGraphX();this.startY=na.getGraphY();this.scrollLeft=H.container.scrollLeft;this.scrollTop=H.container.scrollTop},mouseMove:function(aa,na){},mouseUp:function(aa,na){mxEvent.isTouchEvent(na.getEvent())&&Math.abs(this.scrollLeft-H.container.scrollLeft)<S&&Math.abs(this.scrollTop-H.container.scrollTop)<-S&&Math.abs(this.startX-na.getGraphX())<S&&Math.abs(this.startY-na.getGraphY())<S&&(0<parseFloat(e.style.opacity||0)?p():A(30))}})}g=this.toolbarItems;for(var F=0,K=mxUtils.bind(this,function(aa,na,W,ba){aa=this.createToolbarButton(aa,na,W,ba);e.appendChild(aa);F++;return aa}),c=this.graph.getModel(),f=null,l=null,t=null,q=null,D=0;D<g.length;D++){var G=g[D];if("pages"==G){q=b.ownerDocument.createElement("div");q.style.display="inline-flex";q.style.position="relative";q.style.alignItems="center";+mxUtils.setOpacity(e,30);var m=null,v=null,n=mxUtils.bind(this,function(aa){null!=m&&(window.clearTimeout(m),fadeThead=null);null!=v&&(window.clearTimeout(v),fadeThead2=null);m=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(e,0);m=null;v=window.setTimeout(mxUtils.bind(this,function(){e.style.display="none";v=null}),100)}),aa||200)}),A=mxUtils.bind(this,function(aa){null!=m&&(window.clearTimeout(m),fadeThead=null);null!=v&&(window.clearTimeout(v),fadeThead2=null);e.style.display=+"";mxUtils.setOpacity(e,aa||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(aa){mxEvent.isTouchEvent(aa)||(A(30),n())}));mxEvent.addListener(e,mxClient.IS_POINTER?"pointermove":"mousemove",function(aa){mxEvent.consume(aa)});mxEvent.addListener(e,"mouseenter",mxUtils.bind(this,function(aa){A(100)}));mxEvent.addListener(e,"mousemove",mxUtils.bind(this,function(aa){A(100);mxEvent.consume(aa)}));mxEvent.addListener(e,"mouseleave",+mxUtils.bind(this,function(aa){mxEvent.isTouchEvent(aa)||A(30)}));var G=this.graph,S=G.getTolerance();G.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(aa,na){this.startX=na.getGraphX();this.startY=na.getGraphY();this.scrollLeft=G.container.scrollLeft;this.scrollTop=G.container.scrollTop},mouseMove:function(aa,na){},mouseUp:function(aa,na){mxEvent.isTouchEvent(na.getEvent())&&Math.abs(this.scrollLeft-G.container.scrollLeft)<S&&Math.abs(this.scrollTop-G.container.scrollTop)<+S&&Math.abs(this.startX-na.getGraphX())<S&&Math.abs(this.startY-na.getGraphY())<S&&(0<parseFloat(e.style.opacity||0)?n():A(30))}})}g=this.toolbarItems;for(var F=0,K=mxUtils.bind(this,function(aa,na,W,ba){aa=this.createToolbarButton(aa,na,W,ba);e.appendChild(aa);F++;return aa}),c=this.graph.getModel(),f=null,l=null,t=null,q=null,D=0;D<g.length;D++){var H=g[D];if("pages"==H){q=b.ownerDocument.createElement("div");q.style.display="inline-flex";q.style.position="relative";q.style.alignItems="center";q.style.padding="4px";q.style.fontFamily=GraphViewer.cssFontFamily;q.style.fontSize="12px";q.style.cursor="default";q.style.color="light-dark(#000000, #ffffff)";mxUtils.setOpacity(q,70);var N=K(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.chevronLeftImage,mxResources.get("previousPage")||"Previous Page");N.style.borderRightStyle="none";N.style.paddingLeft="0px";N.style.paddingRight="0px";e.appendChild(q);var L=K(mxUtils.bind(this,function(){this.selectPage(this.currentPage+-1)}),Editor.chevronRightImage,mxResources.get("nextPage")||"Next Page");L.style.paddingLeft="0px";L.style.paddingRight="0px";G=mxUtils.bind(this,function(){q.innerText="";mxUtils.write(q,this.currentPage+1+" / "+this.diagrams.length);q.style.display=1<this.diagrams.length?"inline-flex":"none";N.style.display=q.style.display;L.style.display=q.style.display});this.addListener("graphChanged",G);G()}else if("zoom"==G)this.zoomEnabled&&(K(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage,-mxResources.get("zoomOut")||"Zoom Out"),K(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),K(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==G){if(this.layersEnabled){var J=K(mxUtils.bind(this,function(aa){if(null!=f)f.parentNode.removeChild(f),+1)}),Editor.chevronRightImage,mxResources.get("nextPage")||"Next Page");L.style.paddingLeft="0px";L.style.paddingRight="0px";H=mxUtils.bind(this,function(){q.innerText="";mxUtils.write(q,this.currentPage+1+" / "+this.diagrams.length);q.style.display=1<this.diagrams.length?"inline-flex":"none";N.style.display=q.style.display;L.style.display=q.style.display});this.addListener("graphChanged",H);H()}else if("zoom"==H)this.zoomEnabled&&(K(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage,+mxResources.get("zoomOut")||"Zoom Out"),K(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),K(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==H){if(this.layersEnabled){var J=K(mxUtils.bind(this,function(aa){if(null!=f)f.parentNode.removeChild(f),f=null;else{f=this.graph.createLayersDialog(mxUtils.bind(this,function(){if(this.autoCrop)this.crop();else if(this.autoOrigin){var W=this.graph.getGraphBounds(),ba=this.graph.view;0>W.x||0>W.y?(this.crop(),this.graph.originalViewState=this.graph.initialViewState,this.graph.initialViewState={translate:ba.translate.clone(),scale:ba.scale}):null!=this.graph.originalViewState&&0<W.x/ba.scale+this.graph.originalViewState.translate.x-ba.translate.x&&0<W.y/ba.scale+this.graph.originalViewState.translate.y-ba.translate.y&&(ba.setTranslate(this.graph.originalViewState.translate.x,this.graph.originalViewState.translate.y),this.graph.originalViewState=null,this.graph.initialViewState={translate:ba.translate.clone(),scale:ba.scale})}}));mxEvent.addListener(f,"mouseleave",function(){f.parentNode.removeChild(f);f=null});aa=J.getBoundingClientRect();f.style.width="140px";f.style.padding="2px 0px 2px 0px";f.style.border="1px solid #d0d0d0";f.style.backgroundColor="#eee";f.style.fontFamily=GraphViewer.cssFontFamily;f.style.fontSize="11px";f.style.overflowY="auto";f.style.maxHeight=this.graph.container.clientHeight-this.toolbarHeight-10+"px";f.style.zIndex=this.toolbarZIndex+1;f.style.color="#000";mxUtils.setOpacity(f,85);var na=mxUtils.getDocumentScrollOrigin(document);f.style.left=na.x+aa.left-1+"px";f.style.top=na.y+aa.bottom-2+"px";this.isDarkMode()&&(f.style.filter="invert(93%) hue-rotate(180deg)");document.body.appendChild(f)}}),Editor.layersImage,mxResources.get("layers")||"Layers");c.addListener(mxEvent.CHANGE,-function(){J.style.display=1<c.getChildCount(c.root)?"inline-flex":"none"});J.style.display=1<c.getChildCount(c.root)?"inline-flex":"none"}}else if("tags"==G){if(this.tagsEnabled){var Y=K(mxUtils.bind(this,function(aa){null==l&&(l=this.graph.createTagsDialog(mxUtils.bind(this,function(){return!0})),l.div.getElementsByTagName("div")[0].style.position="",l.div.style.maxHeight="160px",l.div.style.maxWidth="120px",l.div.style.padding="2px",l.div.style.overflow="auto",l.div.style.height="auto",l.div.style.position=+function(){J.style.display=1<c.getChildCount(c.root)?"inline-flex":"none"});J.style.display=1<c.getChildCount(c.root)?"inline-flex":"none"}}else if("tags"==H){if(this.tagsEnabled){var Y=K(mxUtils.bind(this,function(aa){null==l&&(l=this.graph.createTagsDialog(mxUtils.bind(this,function(){return!0})),l.div.getElementsByTagName("div")[0].style.position="",l.div.style.maxHeight="160px",l.div.style.maxWidth="120px",l.div.style.padding="2px",l.div.style.overflow="auto",l.div.style.height="auto",l.div.style.position="fixed",l.div.style.fontFamily=GraphViewer.cssFontFamily,l.div.style.fontSize="11px",l.div.style.backgroundColor="#eee",l.div.style.color="#000",l.div.style.border="1px solid #d0d0d0",l.div.style.zIndex=this.toolbarZIndex+1,this.isDarkMode()&&(l.div.style.filter="invert(93%) hue-rotate(180deg)"),mxUtils.setOpacity(l.div,85));if(null!=t)t.parentNode.removeChild(t),t=null;else{t=l.div;t.style.position="absolute";mxEvent.addListener(t,"mouseleave",function(){null!=t&&(t.parentNode.removeChild(t),t=null)});aa=Y.getBoundingClientRect();var na=mxUtils.getDocumentScrollOrigin(document);t.style.left=na.x+aa.left-1+"px";t.style.top=na.y+aa.bottom-2+"px";document.body.appendChild(t);l.refresh()}}),Editor.tagsImage,mxResources.get("tags")||"Tags");c.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){Y.style.display=0<this.graph.getAllTags().length?"inline-flex":"none";null!=t&&0==this.graph.getAllTags().length&&(t.parentNode.removeChild(t),t=null)}));Y.style.display=0<this.graph.getAllTags().length?"inline-flex":-"none"}}else"lightbox"==G?this.lightboxEnabled&&K(mxUtils.bind(this,function(){try{this.showLightbox()}catch(aa){alert(aa.message)}}),Editor.fullscreenImage,mxResources.get("fullscreen")||"Fullscreen"):null!=this.graphConfig["toolbar-buttons"]&&(G=this.graphConfig["toolbar-buttons"][G],null!=G&&(G.elem=K(null==G.enabled||G.enabled?G.handler:function(){},G.image,G.title,G.enabled)))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*F);null!=this.graphConfig.title&&(g=+"none"}}else"lightbox"==H?this.lightboxEnabled&&K(mxUtils.bind(this,function(){try{this.showLightbox()}catch(aa){alert(aa.message)}}),Editor.fullscreenImage,mxResources.get("fullscreen")||"Fullscreen"):null!=this.graphConfig["toolbar-buttons"]&&(H=this.graphConfig["toolbar-buttons"][H],null!=H&&(H.elem=K(null==H.enabled||H.enabled?H.handler:function(){},H.image,H.title,H.enabled)))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*F);null!=this.graphConfig.title&&(g=b.ownerDocument.createElement("div"),g.style.display="inline-flex",g.style.position="relative",g.style.alignItems="center",g.style.padding="6px",g.style.fontFamily=GraphViewer.cssFontFamily,g.style.fontSize="12px",g.style.cursor="default",g.style.color="light-dark(#000000, #ffffff)",g.setAttribute("title",this.graphConfig.titleTooltip||this.graphConfig.title),mxUtils.write(g,this.graphConfig.title),mxUtils.setOpacity(g,70),e.appendChild(g),this.filename=g);this.minToolbarWidth=34*F;var ha=b.style.border,ea=mxUtils.bind(this,function(){e.style.width="inline"==this.graphConfig["toolbar-position"]?"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";e.style.border="1px solid #d0d0d0";if(1!=this.graphConfig["toolbar-nohide"]){var aa=b.getBoundingClientRect(),na=mxUtils.getScrollOrigin(document.body);na="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-na.x,top:-na.y};aa={left:aa.left-na.left,top:aa.top-na.top,bottom:aa.bottom-na.top,right:aa.right-na.left};e.style.left=aa.left+"px";"bottom"==this.graphConfig["toolbar-position"]?e.style.top=aa.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(e.style.marginTop=-this.toolbarHeight+"px",e.style.top=aa.top+1+"px"):e.style.top=aa.top+"px";"1px solid transparent"==ha&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(e);var W=mxUtils.bind(this,function(){null!=e.parentNode&&e.parentNode.removeChild(e);null!=t&&(t.parentNode.removeChild(t),t=null);null!=f&&(f.parentNode.removeChild(f),f=null);@@ -4219,23 +4221,23 @@ b.style.border=ha});mxEvent.addListener(document,"mousemove",function(ba){for(baGraphViewer.prototype.createToolbarButton=function(b,e,g,m){var v=document.createElement("div");v.style.borderRight="1px solid #d0d0d0";v.style.display="inline-flex";v.style.alignItems="center";v.style.padding="6px";mxEvent.addListener(v,"click",b);null!=g&&v.setAttribute("title",g);b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",e);b.style.width="18px";b.className="geAdaptiveAsset";null==m||m?(mxEvent.addListener(v,"mouseenter",function(){v.style.backgroundColor="light-dark(#dddddd,#333333)"}),mxEvent.addListener(v,"mouseleave",function(){v.style.backgroundColor="transparent"}),mxUtils.setOpacity(b,60),v.style.cursor="pointer"):mxUtils.setOpacity(v,30);v.appendChild(b);return v};GraphViewer.prototype.disableButton=function(b,e){var g=this.graphConfig["toolbar-buttons"]?this.graphConfig["toolbar-buttons"][b]:null;null!=g&&(mxUtils.setOpacity(g.elem,30),mxEvent.removeListener(g.elem,"click",g.handler),mxEvent.addListener(g.elem,"mouseenter",function(){g.elem.style.backgroundColor="#eee"}),e&&g.elem.setAttribute("title",e))};-GraphViewer.prototype.addClickHandler=function(b,e){b.linkPolicy=this.graphConfig.target||b.linkPolicy;b.addClickHandler(this.graphConfig.highlight,mxUtils.bind(this,function(g,m,v){if(null==m)for(var p=mxEvent.getSource(g);p!=b.container&&null!=p&&null==m;)"a"==p.nodeName.toLowerCase()&&(m=p.getAttribute("href")),p=p.parentNode;null!=e?null==m||b.isCustomLink(m)?mxEvent.consume(g):b.isExternalProtocol(m)||b.isBlankLink(m)||window.setTimeout(function(){e.destroy()},0):null!=m&&null==e&&b.isCustomLink(m)&&+GraphViewer.prototype.addClickHandler=function(b,e){b.linkPolicy=this.graphConfig.target||b.linkPolicy;b.addClickHandler(this.graphConfig.highlight,mxUtils.bind(this,function(g,m,v){if(null==m)for(var n=mxEvent.getSource(g);n!=b.container&&null!=n&&null==m;)"a"==n.nodeName.toLowerCase()&&(m=n.getAttribute("href")),n=n.parentNode;null!=e?null==m||b.isCustomLink(m)?mxEvent.consume(g):b.isExternalProtocol(m)||b.isBlankLink(m)||window.setTimeout(function(){e.destroy()},0):null!=m&&null==e&&b.isCustomLink(m)&&(mxEvent.isTouchEvent(g)||!mxEvent.isPopupTrigger(g))&&b.customLinkClicked(m,v)&&(mxUtils.clearSelection(),mxEvent.consume(g))}),mxUtils.bind(this,function(g){if(null==e&&this.lightboxClickEnabled&&(!mxEvent.isTouchEvent(g)||0==this.toolbarItems.length))try{this.showLightbox()}catch(m){alert(m.message)}}))};GraphViewer.prototype.showLightbox=function(b,e,g){if("open"==this.graphConfig.lightbox||window.self!==window.top)if(null==this.lightboxWindow||this.lightboxWindow.closed){b=null!=b?b:null!=this.graphConfig.editable?this.graphConfig.editable:!0;g={client:1,target:null!=g?g:"blank"};b&&(g.edit=this.graphConfig.edit||"_blank");if(null!=e?e:1)g.close=1;this.layersEnabled&&(g.layers=1);this.tagsEnabled&&(g.tags={});null!=this.graphConfig&&0!=this.graphConfig.nav&&(g.nav=1);null!=this.graphConfig&&null!=this.graphConfig.highlight&&(g.highlight=this.graphConfig.highlight.substring(1));null!=this.currentPage&&0<this.currentPage&&(g.page=this.currentPage);"undefined"!==typeof window.postMessage&&(null==document.documentMode||10<=document.documentMode)?null==this.lightboxWindow&&mxEvent.addListener(window,"message",mxUtils.bind(this,function(m){"ready"==m.data&&m.source==this.lightboxWindow&&this.lightboxWindow.postMessage(this.xml,"*")})):g.data=encodeURIComponent(this.xml);"1"==urlParams.dev&&(g.dev="1");this.lightboxWindow=window.open(("1"!=urlParams.dev?EditorUi.lightboxHost:"https://test.draw.io")+"/#P"+encodeURIComponent(JSON.stringify(g)))}else this.lightboxWindow.focus();else this.showLocalLightbox()};GraphViewer.prototype.showLocalLightbox=function(b){var e=document.createElement("div");e.style.position="fixed";e.style.top="0";e.style.left="0";e.style.bottom="0";e.style.right="0";e.style.zIndex=this.lightboxZIndex;e.style.backgroundColor="#000000";mxUtils.setOpacity(e,70);document.body.appendChild(e);var g=document.createElement("img");g.setAttribute("border","0");g.setAttribute("src",Editor.closeBlackImage);g.style.position="fixed";g.style.top="32px";g.style.right="32px";g.style.cursor="pointer";-g.className="geAdaptiveAsset";var m=mxUtils.bind(this,function(){p.setDarkMode(this.isDarkMode())});mxEvent.addListener(g,"click",mxUtils.bind(this,function(){this.removeListener("darkModeChanged",m);p.destroy()}));urlParams.pages="1";urlParams.page=this.currentPage;urlParams["page-id"]=this.graphConfig.pageId;urlParams["layer-ids"]=null!=this.graphConfig.layerIds&&0<this.graphConfig.layerIds.length?this.graphConfig.layerIds.join(" "):null;urlParams.nav=0!=this.graphConfig.nav?"1":"0";urlParams.layers=+g.className="geAdaptiveAsset";var m=mxUtils.bind(this,function(){n.setDarkMode(this.isDarkMode())});mxEvent.addListener(g,"click",mxUtils.bind(this,function(){this.removeListener("darkModeChanged",m);n.destroy()}));urlParams.pages="1";urlParams.page=this.currentPage;urlParams["page-id"]=this.graphConfig.pageId;urlParams["layer-ids"]=null!=this.graphConfig.layerIds&&0<this.graphConfig.layerIds.length?this.graphConfig.layerIds.join(" "):null;urlParams.nav=0!=this.graphConfig.nav?"1":"0";urlParams.layers=this.layersEnabled?"1":"0";urlParams.dark=this.isDarkMode()?"1":"0";this.tagsEnabled&&(urlParams.tags="{}");if(null!=b)try{var v=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));v.noCloseBtn=!0;urlParams["toolbar-config"]=encodeURIComponent(JSON.stringify(v))}catch(l){}if(null==document.documentMode||10<=document.documentMode)Editor.prototype.editButtonLink=this.graphConfig.edit,Editor.prototype.editButtonFunc=this.graphConfig.editFunc;EditorUi.prototype.updateActionStates=function(){};-EditorUi.prototype.addBeforeUnloadListener=function(){};EditorUi.prototype.addChromelessClickHandler=function(){};v=Graph.prototype.shadowId;Graph.prototype.shadowId="lightboxDropShadow";var p=new EditorUi(new Editor(!0),document.createElement("div"),!0);this.addListener("darkModeChanged",m);p.editor.editBlankUrl=this.editBlankUrl;p.editor.graph.shadowId="lightboxDropShadow";Graph.prototype.shadowId=v;p.refresh=function(){};var A=mxUtils.bind(this,function(l){27==l.keyCode&&p.destroy()}),H=this.initialOverflow,-S=p.destroy;p.destroy=function(){null==b&&(mxEvent.removeListener(document.documentElement,"keydown",A),document.body.removeChild(e),document.body.removeChild(g),document.body.style.overflow=H,GraphViewer.resizeSensorEnabled=!0,S.apply(this,arguments))};var F=p.editor.graph,K=F.container;K.style.overflow="hidden";K.style.inset="0";this.lightboxChrome&&null==b?(K.style.border="1px solid #c0c0c0",K.style.margin="40px",mxEvent.addListener(document.documentElement,"keydown",A)):(e.style.display="none",-g.style.display="none");var c=this;F.getImageFromBundles=function(l){return c.getImageUrl(l)};var f=p.createTemporaryGraph;p.createTemporaryGraph=function(){var l=f.apply(this,arguments);l.getImageFromBundles=function(t){return c.getImageUrl(t)};return l};this.graphConfig.move&&(F.isMoveCellsEvent=function(l){return!0});mxUtils.setPrefixedStyle(K.style,"border-radius","4px");K.style.position="fixed";GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow="hidden";this.addClickHandler(F,p);-window.setTimeout(mxUtils.bind(this,function(){try{mxEvent.addListener(e,"click",function(){p.destroy()}),K.style.outline="none",K.style.zIndex=this.lightboxZIndex,g.style.zIndex=this.lightboxZIndex,null!=b?(b.innerHTML="",b.appendChild(K)):(document.body.appendChild(K),document.body.appendChild(g)),p.setFileData(this.xml),mxUtils.setPrefixedStyle(K.style,"transform","rotateY(0deg)"),p.chromelessToolbar.style.bottom="60px",p.chromelessToolbar.style.zIndex=this.lightboxZIndex,(b||document.body).appendChild(p.chromelessToolbar),-p.getEditBlankXml=mxUtils.bind(this,function(){return this.xml}),this.showLayers(F,this.graph),p.lightboxFit(),p.chromelessResize()}catch(l){p.handleError(l,null,function(){p.destroy()})}}),0);return p};Dialog.prototype.getDocumentSize=function(){return new mxRectangle(0,0,Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0))};+EditorUi.prototype.addBeforeUnloadListener=function(){};EditorUi.prototype.addChromelessClickHandler=function(){};v=Graph.prototype.shadowId;Graph.prototype.shadowId="lightboxDropShadow";var n=new EditorUi(new Editor(!0),document.createElement("div"),!0);this.addListener("darkModeChanged",m);n.editor.editBlankUrl=this.editBlankUrl;n.editor.graph.shadowId="lightboxDropShadow";Graph.prototype.shadowId=v;n.refresh=function(){};var A=mxUtils.bind(this,function(l){27==l.keyCode&&n.destroy()}),G=this.initialOverflow,+S=n.destroy;n.destroy=function(){null==b&&(mxEvent.removeListener(document.documentElement,"keydown",A),document.body.removeChild(e),document.body.removeChild(g),document.body.style.overflow=G,GraphViewer.resizeSensorEnabled=!0,S.apply(this,arguments))};var F=n.editor.graph,K=F.container;K.style.overflow="hidden";K.style.inset="0";this.lightboxChrome&&null==b?(K.style.border="1px solid #c0c0c0",K.style.margin="40px",mxEvent.addListener(document.documentElement,"keydown",A)):(e.style.display="none",+g.style.display="none");var c=this;F.getImageFromBundles=function(l){return c.getImageUrl(l)};var f=n.createTemporaryGraph;n.createTemporaryGraph=function(){var l=f.apply(this,arguments);l.getImageFromBundles=function(t){return c.getImageUrl(t)};return l};this.graphConfig.move&&(F.isMoveCellsEvent=function(l){return!0});mxUtils.setPrefixedStyle(K.style,"border-radius","4px");K.style.position="fixed";GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow="hidden";this.addClickHandler(F,n);+window.setTimeout(mxUtils.bind(this,function(){try{mxEvent.addListener(e,"click",function(){n.destroy()}),K.style.outline="none",K.style.zIndex=this.lightboxZIndex,g.style.zIndex=this.lightboxZIndex,null!=b?(b.innerHTML="",b.appendChild(K)):(document.body.appendChild(K),document.body.appendChild(g)),n.setFileData(this.xml),mxUtils.setPrefixedStyle(K.style,"transform","rotateY(0deg)"),n.chromelessToolbar.style.bottom="60px",n.chromelessToolbar.style.zIndex=this.lightboxZIndex,(b||document.body).appendChild(n.chromelessToolbar),+n.getEditBlankXml=mxUtils.bind(this,function(){return this.xml}),this.showLayers(F,this.graph),n.lightboxFit(),n.chromelessResize()}catch(l){n.handleError(l,null,function(){n.destroy()})}}),0);return n};Dialog.prototype.getDocumentSize=function(){return new mxRectangle(0,0,Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0))};GraphViewer.prototype.updateTitle=function(b,e){b=b||"";this.showTitleAsTooltip&&null!=this.graph&&null!=this.graph.container&&this.graph.container.setAttribute("title",e||b);null!=this.filename&&(this.filename.innerText="",mxUtils.write(this.filename,b),this.filename.setAttribute("title",e||b))};GraphViewer.processElements=function(b){mxUtils.forEach(GraphViewer.getElementsByClassName(b||"mxgraph"),function(e){try{e.innerText="",GraphViewer.createViewerForElement(e)}catch(g){e.innerText=g.message,null!=window.console&&console.error(g)}})};GraphViewer.getElementsByClassName=function(b){if(document.getElementsByClassName){var e=document.getElementsByClassName(b);b=[];for(var g=0;g<e.length;g++)b.push(e[g]);return b}var m=document.getElementsByTagName("*");e=[];for(g=0;g<m.length;g++){var v=m[g].className;null!=v&&0<v.length&&(v=v.split(" "),0<=mxUtils.indexOf(v,b)&&e.push(m[g]))}return e};-GraphViewer.createViewerForElement=function(b,e){var g=b.getAttribute("data-mxgraph");if(null!=g){var m=JSON.parse(g),v=function(p){p=mxUtils.parseXml(p);p=new GraphViewer(b,p.documentElement,m);null!=e&&e(p)};null!=m.url?GraphViewer.getUrl(m.url,function(p){v(p)}):v(m.xml)}};+GraphViewer.createViewerForElement=function(b,e){var g=b.getAttribute("data-mxgraph");if(null!=g){var m=JSON.parse(g),v=function(n){n=mxUtils.parseXml(n);n=new GraphViewer(b,n.documentElement,m);null!=e&&e(n)};null!=m.url?GraphViewer.getUrl(m.url,function(n){v(n)}):v(m.xml)}};GraphViewer.blockedAncestorFrames=function(){try{if(window.location.ancestorOrigins&&window.location.hostname&&window.location.ancestorOrigins.length&&0<window.location.ancestorOrigins.length){var b=window.location.hostname;b&&1<b.length&&"/"==b.charAt(b.length-1)&&(b=b.substring(0,b.length-1));for(var e="",g=0;g<window.location.ancestorOrigins.length;g++)if(e+=" -> "+window.location.ancestorOrigins[g],e.endsWith("dan6v7pm1f1a1.cloudfront.net")||e.endsWith("confluence-cloud-excalidraw-ll3likebca-uc.a.run.app"))return!0;(b.endsWith("ac.draw.io")||b.endsWith("aj.draw.io"))&&1==window.location.ancestorOrigins.length&&window.location.ancestorOrigins[0]&&window.location.ancestorOrigins[0].endsWith(".atlassian.net")}}catch(m){}return!1};GraphViewer.darkBackgroundColor=Editor.darkColor;GraphViewer.cssFontFamily=Editor.defaultHtmlFont;GraphViewer.shapeBackgroundColor=null;GraphViewer.viewerInitialized=function(b){};GraphViewer.initCss=function(){try{null==GraphViewer.styleElement&&(GraphViewer.styleElement=document.createElement("style"),GraphViewer.styleElement.setAttribute("type","text/css"),GraphViewer.styleElement.innerHTML=GraphViewer.getCss(),GraphViewer.blockedAncestorFrames()||document.getElementsByTagName("head")[0].appendChild(GraphViewer.styleElement))}catch(b){}};@@ -4245,11 +4247,11 @@ GraphViewer.getCss=function(){return[".geDarkMode img {\n filter: invert(1);\"\t z-index: "+(GraphViewer.prototype.lightboxZIndex+2)+";","}\n.geBackground {"," background-color: light-dark(#ffffff, "+GraphViewer.darkBackgroundColor+");","\t position: fixed;\n left: 0px;\n top: 0px;\n right: 0px;\n bottom: 0px;\n opacity: 0.9;","\t z-index: "+(GraphViewer.prototype.lightboxZIndex+1)+";","}\n.geDialogTitle {\n box-sizing: border-box;\n white-space: nowrap;"," background: light-dark(#f1f3f4, "+GraphViewer.darkBackgroundColor+");"," border-bottom: 1px solid rgb(192, 192, 192);\n font-size: 15px;\n font-weight: bold;\n text-align: center;\n color: rgb(35, 86, 149);\n}\n.geDialogFooter {"," background: light-dark(#f1f3f4, "+GraphViewer.darkBackgroundColor+");"," white-space: nowrap;\n text-align: right;\n box-sizing: border-box;\n border-top: 1px solid #e5e5e5;\n color: darkGray;\n}\n.geHelpIcon {\n width: 16px;\n margin: 0 4px;\n vertical-align: text-bottom;\n}\n.geBtn, .mxWindow .geBtn {\n background-color: light-dark(#eeeeee, #1b1d1e);\n border: 1px solid light-dark(#d8d8d8, #333333);\n color: light-dark(#3f3f3f, #c0c0c0);\n font-size: 13px;\n font-weight: 500;\n border-radius: 4px;\n height: 30px;\n margin: 0 0 0 8px;\n min-width: 72px;\n outline: 0;\n padding: 0 8px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n}\n.geBtn:hover:not(.gePrimaryBtn), .geBtn:focus {\n border: 1px solid light-dark(#c6c6c6, #333333);\n background: light-dark(#dadada, #333333);\n}\n.geBtn:disabled {\n opacity: .5;\n}\n.gePrimaryBtn {\n background: linear-gradient(light-dark(#4d90fe, #003555) 0px, light-dark(#4787ed, #003555) 100%);\n border: 1px solid light-dark(#3079ed, transparent);\n color: light-dark(#ffffff, #c0c0c0);\n}\n.gePrimaryBtn:hover:not([disabled]) {\n background: linear-gradient(light-dark(#4d90fe, #004a77) 0px, light-dark(#357ae8, #004a77) 100%);\n border: 1px solid light-dark(#2f5bb7, transparent);\n}\n.geBtn:disabled {\n opacity: .5;\n}"].join("\n")};GraphViewer.cachedUrls={};GraphViewer.getUrl=function(b,e,g){if(null!=GraphViewer.cachedUrls[b])e(GraphViewer.cachedUrls[b]);else{var m=null!=navigator.userAgent&&0<navigator.userAgent.indexOf("MSIE 9")?new XDomainRequest:new XMLHttpRequest;m.open("GET",b);m.onload=function(){e(null!=m.getText?m.getText():m.responseText)};m.onerror=g;m.send()}};GraphViewer.resizeSensorEnabled=!0;GraphViewer.useResizeObserver=!0;GraphViewer.useResizeSensor=!0;-(function(){var b=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(g){return window.setTimeout(g,20)},e=function(g,m){function v(){this.q=[];this.add=function(q){this.q.push(q)};var l,t;this.call=function(){l=0;for(t=this.q.length;l<t;l++)this.q[l].call()}}function p(l,t){return l.currentStyle?l.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(l,null).getPropertyValue(t):l.style[t]}function A(l,t){if(!l.resizedAttached)l.resizedAttached=+(function(){var b=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(g){return window.setTimeout(g,20)},e=function(g,m){function v(){this.q=[];this.add=function(q){this.q.push(q)};var l,t;this.call=function(){l=0;for(t=this.q.length;l<t;l++)this.q[l].call()}}function n(l,t){return l.currentStyle?l.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(l,null).getPropertyValue(t):l.style[t]}function A(l,t){if(!l.resizedAttached)l.resizedAttached=new v,l.resizedAttached.add(t);else if(l.resizedAttached){l.resizedAttached.add(t);return}l.resizeSensor=document.createElement("div");l.resizeSensor.className="resize-sensor";l.resizeSensor.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;";l.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s;"></div></div><div class="resize-sensor-shrink" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s; width: 200%; height: 200%"></div></div>';-l.appendChild(l.resizeSensor);"static"==p(l,"position")&&(l.style.position="relative");var q=l.resizeSensor.childNodes[0],D=q.childNodes[0],G=l.resizeSensor.childNodes[1],N=function(){D.style.width="100000px";D.style.height="100000px";q.scrollLeft=1E5;q.scrollTop=1E5;G.scrollLeft=1E5;G.scrollTop=1E5};N();var L=!1,J=function(){l.resizedAttached&&(L&&(l.resizedAttached.call(),L=!1),b(J))};b(J);var Y,ha,ea,aa;t=function(){if((ea=l.offsetWidth)!=Y||(aa=l.offsetHeight)!=ha)L=!0,Y=ea,ha=aa;N()};var na=-function(W,ba,ja){W.attachEvent?W.attachEvent("on"+ba,ja):W.addEventListener(ba,ja)};na(q,"scroll",t);na(G,"scroll",t)}var H=function(){GraphViewer.resizeSensorEnabled&&m()};if(GraphViewer.useResizeObserver&&"undefined"!==typeof ResizeObserver){var S=null,F=!1;(new ResizeObserver(function(){F||(null!=S&&window.clearTimeout(S),S=window.setTimeout(function(){F=!0;H();S=null;F=!1},200))})).observe(g)}else{var K=Object.prototype.toString.call(g),c="[object Array]"===K||"[object NodeList]"===K||"[object HTMLCollection]"===-K||"undefined"!==typeof jQuery&&g instanceof jQuery||"undefined"!==typeof Elements&&g instanceof Elements;if(c){K=0;for(var f=g.length;K<f;K++)A(g[K],H)}else A(g,H);this.detach=function(){if(c)for(var l=0,t=g.length;l<t;l++)e.detach(g[l]);else e.detach(g)}}};e.detach=function(g){g.resizeSensor&&(g.removeChild(g.resizeSensor),delete g.resizeSensor,delete g.resizedAttached)};window.ResizeSensor=e})();+l.appendChild(l.resizeSensor);"static"==n(l,"position")&&(l.style.position="relative");var q=l.resizeSensor.childNodes[0],D=q.childNodes[0],H=l.resizeSensor.childNodes[1],N=function(){D.style.width="100000px";D.style.height="100000px";q.scrollLeft=1E5;q.scrollTop=1E5;H.scrollLeft=1E5;H.scrollTop=1E5};N();var L=!1,J=function(){l.resizedAttached&&(L&&(l.resizedAttached.call(),L=!1),b(J))};b(J);var Y,ha,ea,aa;t=function(){if((ea=l.offsetWidth)!=Y||(aa=l.offsetHeight)!=ha)L=!0,Y=ea,ha=aa;N()};var na=+function(W,ba,ja){W.attachEvent?W.attachEvent("on"+ba,ja):W.addEventListener(ba,ja)};na(q,"scroll",t);na(H,"scroll",t)}var G=function(){GraphViewer.resizeSensorEnabled&&m()};if(GraphViewer.useResizeObserver&&"undefined"!==typeof ResizeObserver){var S=null,F=!1;(new ResizeObserver(function(){F||(null!=S&&window.clearTimeout(S),S=window.setTimeout(function(){F=!0;G();S=null;F=!1},200))})).observe(g)}else{var K=Object.prototype.toString.call(g),c="[object Array]"===K||"[object NodeList]"===K||"[object HTMLCollection]"===+K||"undefined"!==typeof jQuery&&g instanceof jQuery||"undefined"!==typeof Elements&&g instanceof Elements;if(c){K=0;for(var f=g.length;K<f;K++)A(g[K],G)}else A(g,G);this.detach=function(){if(c)for(var l=0,t=g.length;l<t;l++)e.detach(g[l]);else e.detach(g)}}};e.detach=function(g){g.resizeSensor&&(g.removeChild(g.resizeSensor),delete g.resizeSensor,delete g.resizedAttached)};window.ResizeSensor=e})();function mxBpmnShape(a,d,e,b){mxShape.call(this);this.bounds=a;this.fill=d;this.stroke=e;this.strokewidth=null!=b?b:1}mxUtils.extend(mxBpmnShape,mxShape);mxBpmnShape.prototype.customProperties=[{name:"symbol",dispName:"Event",type:"enum",defVal:"general",enumList:[{val:"general",dispName:"General"},{val:"message",dispName:"Message"},{val:"timer",dispName:"Timer"},{val:"escalation",dispName:"Escalation"},{val:"conditional",dispName:"Conditional"},{val:"link",dispName:"Link"},{val:"error",dispName:"Error"},{val:"cancel",dispName:"Cancel"},{val:"compensation",dispName:"Compensation"},{val:"signal",dispName:"Signal"},{val:"multiple",dispName:"Multiple"},{val:"parallelMultiple",dispName:"Parallel Multiple"},{val:"terminate",dispName:"Terminate"},{val:"exclusiveGw",dispName:"Exclusive Gw"},{val:"parallelGw",dispName:"Parallel Gw"},{val:"complexGw",dispName:"Complex Gw"}]},{name:"outline",dispName:"Event Type",type:"enum",defVal:"standard",enumList:[{val:"standard",dispName:"Standard"},{val:"eventInt",dispName:"Interrupting"},{val:"eventNonint",dispName:"Non-Interrupting"},{val:"catching",dispName:"Catching"},{val:"boundInt",dispName:"Bound Interrupting"},diff --git a/src/main/webapp/js/viewer.min.js b/src/main/webapp/js/viewer.min.jsindex f2b81a137..6d70b6a9d 100644--- a/src/main/webapp/js/viewer.min.js+++ b/src/main/webapp/js/viewer.min.js@@ -2,8 +2,8 @@ window.PROXY_URL=window.PROXY_URL||"https://viewer.diagrams.net/proxy";window.STwindow.mxImageBasePath=window.mxImageBasePath||"https://viewer.diagrams.net/mxgraph/images";window.mxBasePath=window.mxBasePath||"https://viewer.diagrams.net/mxgraph/";window.mxLoadStylesheets=window.mxLoadStylesheets||!1;//fgnass.github.com/spin.js#v2.0.0!function(a,b){"object"==typeof exports?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Spinner=b()}(this,function(){"use strict";function a(a,b){var c,d=document.createElement(a||"div");for(c in b)d[c]=b[c];return d}function b(a){for(var b=1,c=arguments.length;c>b;b++)a.appendChild(arguments[b]);return a}function c(a,b,c,d){var e=["opacity",b,~~(100*a),c,d].join("-"),f=.01+c/d*100,g=Math.max(1-(1-a)/b*(100-f),a),h=j.substring(0,j.indexOf("Animation")).toLowerCase(),i=h&&"-"+h+"-"||"";return l[e]||(m.insertRule("@"+i+"keyframes "+e+"{0%{opacity:"+g+"}"+f+"%{opacity:"+a+"}"+(f+.01)+"%{opacity:1}"+(f+b)%100+"%{opacity:"+a+"}100%{opacity:"+g+"}}",m.cssRules.length),l[e]=1),e}function d(a,b){var c,d,e=a.style;for(b=b.charAt(0).toUpperCase()+b.slice(1),d=0;d<k.length;d++)if(c=k[d]+b,void 0!==e[c])return c;return void 0!==e[b]?b:void 0}function e(a,b){for(var c in b)a.style[d(a,c)||c]=b[c];return a}function f(a){for(var b=1;b<arguments.length;b++){var c=arguments[b];for(var d in c)void 0===a[d]&&(a[d]=c[d])}return a}function g(a,b){return"string"==typeof a?a:a[b%a.length]}function h(a){this.opts=f(a||{},h.defaults,n)}function i(){function c(b,c){return a("<"+b+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',c)}m.addRule(".spin-vml","behavior:url(#default#VML)"),h.prototype.lines=function(a,d){function f(){return e(c("group",{coordsize:k+" "+k,coordorigin:-j+" "+-j}),{width:k,height:k})}function h(a,h,i){b(m,b(e(f(),{rotation:360/d.lines*a+"deg",left:~~h}),b(e(c("roundrect",{arcsize:d.corners}),{width:j,height:d.width,left:d.radius,top:-d.width>>1,filter:i}),c("fill",{color:g(d.color,a),opacity:d.opacity}),c("stroke",{opacity:0}))))}var i,j=d.length+d.width,k=2*j,l=2*-(d.width+d.length)+"px",m=e(f(),{position:"absolute",top:l,left:l});if(d.shadow)for(i=1;i<=d.lines;i++)h(i,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(i=1;i<=d.lines;i++)h(i);return b(a,m)},h.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d<e.childNodes.length&&(e=e.childNodes[b+d],e=e&&e.firstChild,e=e&&e.firstChild,e&&(e.opacity=c))}}var j,k=["webkit","Moz","ms","O"],l={},m=function(){var c=a("style",{type:"text/css"});return b(document.getElementsByTagName("head")[0],c),c.sheet||c.styleSheet}(),n={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:"#000",direction:1,speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"50%",left:"50%",position:"absolute"};h.defaults={},f(h.prototype,{spin:function(b){this.stop();{var c=this,d=c.opts,f=c.el=e(a(0,{className:d.className}),{position:d.position,width:0,zIndex:d.zIndex});d.radius+d.length+d.width}if(b&&(b.insertBefore(f,b.firstChild||null),e(f,{left:d.left,top:d.top})),f.setAttribute("role","progressbar"),c.lines(f,c.opts),!j){var g,h=0,i=(d.lines-1)*(1-d.direction)/2,k=d.fps,l=k/d.speed,m=(1-d.opacity)/(l*d.trail/100),n=l/d.lines;!function o(){h++;for(var a=0;a<d.lines;a++)g=Math.max(1-(h+(d.lines-a)*n)%l*m,d.opacity),c.opacity(f,a*d.direction+i,g,d);c.timeout=c.el&&setTimeout(o,~~(1e3/k))}()}return c},stop:function(){var a=this.el;return a&&(clearTimeout(this.timeout),a.parentNode&&a.parentNode.removeChild(a),this.el=void 0),this},lines:function(d,f){function h(b,c){return e(a(),{position:"absolute",width:f.length+f.width+"px",height:f.width+"px",background:b,boxShadow:c,transformOrigin:"left",transform:"rotate("+~~(360/f.lines*k+f.rotate)+"deg) translate("+f.radius+"px,0)",borderRadius:(f.corners*f.width>>1)+"px"})}for(var i,k=0,l=(f.lines-1)*(1-f.direction)/2;k<f.lines;k++)i=e(a(),{position:"absolute",top:1+~(f.width/2)+"px",transform:f.hwaccel?"translate3d(0,0,0)":"",opacity:f.opacity,animation:j&&c(f.opacity,f.trail,l+k*f.direction,f.lines)+" "+1/f.speed+"s linear infinite"}),f.shadow&&b(i,e(h("#000","0 0 4px #000"),{top:"2px"})),b(d,b(i,h(g(f.color,k),"0 0 1px rgba(0,0,0,.1)")));return d},opacity:function(a,b,c){b<a.childNodes.length&&(a.childNodes[b].style.opacity=c)}});var o=e(a("group"),{behavior:"url(#default#VML)"});return!d(o,"transform")&&o.adj?i():j=d(o,"animation"),h});-/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */-!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DOMPurify=t()}(this,(function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:r}=Object;let{freeze:i,seal:a,create:l}=Object,{apply:c,construct:s}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),a||(a=function(e){return e}),c||(c=function(e,t,n){return e.apply(t,n)}),s||(s=function(e,t){return new e(...t)});const u=R(Array.prototype.forEach),m=R(Array.prototype.lastIndexOf),p=R(Array.prototype.pop),f=R(Array.prototype.push),d=R(Array.prototype.splice),h=R(String.prototype.toLowerCase),g=R(String.prototype.toString),T=R(String.prototype.match),y=R(String.prototype.replace),E=R(String.prototype.indexOf),A=R(String.prototype.trim),_=R(Object.prototype.hasOwnProperty),S=R(RegExp.prototype.test),b=(N=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(N,t)});var N;function R(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return c(e,t,o)}}function w(e,o){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;t&&t(e,null);let i=o.length;for(;i--;){let t=o[i];if("string"==typeof t){const e=r(t);e!==t&&(n(o)||(o[i]=e),t=e)}e[t]=!0}return e}function O(e){for(let t=0;t<e.length;t++){_(e,t)||(e[t]=null)}return e}function D(t){const n=l(null);for(const[o,r]of e(t)){_(t,o)&&(Array.isArray(r)?n[o]=O(r):r&&"object"==typeof r&&r.constructor===Object?n[o]=D(r):n[o]=r)}return n}function v(e,t){for(;null!==e;){const n=r(e,t);if(n){if(n.get)return R(n.get);if("function"==typeof n.value)return R(n.value)}e=o(e)}return function(){return null}}const L=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),C=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),x=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),M=i(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),k=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),I=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),U=i(["#text"]),z=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),P=i(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),H=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),F=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),W=a(/<%[\w\W]*|[\w\W]*%>/gm),G=a(/\$\{[\w\W]*/gm),Y=a(/^data-[\-\w.\u00B7-\uFFFF]+$/),j=a(/^aria-[\-\w]+$/),X=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),q=a(/^(?:\w+script|data):/i),$=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=a(/^html$/i),V=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var Z=Object.freeze({__proto__:null,ARIA_ATTR:j,ATTR_WHITESPACE:$,CUSTOM_ELEMENT:V,DATA_ATTR:Y,DOCTYPE_NAME:K,ERB_EXPR:W,IS_ALLOWED_URI:X,IS_SCRIPT_OR_DATA:q,MUSTACHE_EXPR:B,TMPLIT_EXPR:G});const J=1,Q=3,ee=7,te=8,ne=9,oe=function(){return"undefined"==typeof window?null:window};var re=function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oe();const o=e=>t(e);if(o.version="3.2.4",o.removed=[],!n||!n.document||n.document.nodeType!==ne||!n.Element)return o.isSupported=!1,o;let{document:r}=n;const a=r,c=a.currentScript,{DocumentFragment:s,HTMLTemplateElement:N,Node:R,Element:O,NodeFilter:B,NamedNodeMap:W=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:G,DOMParser:Y,trustedTypes:j}=n,q=O.prototype,$=v(q,"cloneNode"),V=v(q,"remove"),re=v(q,"nextSibling"),ie=v(q,"childNodes"),ae=v(q,"parentNode");if("function"==typeof N){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let le,ce="";const{implementation:se,createNodeIterator:ue,createDocumentFragment:me,getElementsByTagName:pe}=r,{importNode:fe}=a;let de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};o.isSupported="function"==typeof e&&"function"==typeof ae&&se&&void 0!==se.createHTMLDocument;const{MUSTACHE_EXPR:he,ERB_EXPR:ge,TMPLIT_EXPR:Te,DATA_ATTR:ye,ARIA_ATTR:Ee,IS_SCRIPT_OR_DATA:Ae,ATTR_WHITESPACE:_e,CUSTOM_ELEMENT:Se}=Z;let{IS_ALLOWED_URI:be}=Z,Ne=null;const Re=w({},[...L,...C,...x,...k,...U]);let we=null;const Oe=w({},[...z,...P,...H,...F]);let De=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ve=null,Le=null,Ce=!0,xe=!0,Me=!1,ke=!0,Ie=!1,Ue=!0,ze=!1,Pe=!1,He=!1,Fe=!1,Be=!1,We=!1,Ge=!0,Ye=!1,je=!0,Xe=!1,qe={},$e=null;const Ke=w({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ve=null;const Ze=w({},["audio","video","img","source","image","track"]);let Je=null;const Qe=w({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let ot=nt,rt=!1,it=null;const at=w({},[et,tt,nt],g);let lt=w({},["mi","mo","mn","ms","mtext"]),ct=w({},["annotation-xml"]);const st=w({},["title","style","font","a","script"]);let ut=null;const mt=["application/xhtml+xml","text/html"];let pt=null,ft=null;const dt=r.createElement("form"),ht=function(e){return e instanceof RegExp||e instanceof Function},gt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ft||ft!==e){if(e&&"object"==typeof e||(e={}),e=D(e),ut=-1===mt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,pt="application/xhtml+xml"===ut?g:h,Ne=_(e,"ALLOWED_TAGS")?w({},e.ALLOWED_TAGS,pt):Re,we=_(e,"ALLOWED_ATTR")?w({},e.ALLOWED_ATTR,pt):Oe,it=_(e,"ALLOWED_NAMESPACES")?w({},e.ALLOWED_NAMESPACES,g):at,Je=_(e,"ADD_URI_SAFE_ATTR")?w(D(Qe),e.ADD_URI_SAFE_ATTR,pt):Qe,Ve=_(e,"ADD_DATA_URI_TAGS")?w(D(Ze),e.ADD_DATA_URI_TAGS,pt):Ze,$e=_(e,"FORBID_CONTENTS")?w({},e.FORBID_CONTENTS,pt):Ke,ve=_(e,"FORBID_TAGS")?w({},e.FORBID_TAGS,pt):{},Le=_(e,"FORBID_ATTR")?w({},e.FORBID_ATTR,pt):{},qe=!!_(e,"USE_PROFILES")&&e.USE_PROFILES,Ce=!1!==e.ALLOW_ARIA_ATTR,xe=!1!==e.ALLOW_DATA_ATTR,Me=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ke=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Ie=e.SAFE_FOR_TEMPLATES||!1,Ue=!1!==e.SAFE_FOR_XML,ze=e.WHOLE_DOCUMENT||!1,Fe=e.RETURN_DOM||!1,Be=e.RETURN_DOM_FRAGMENT||!1,We=e.RETURN_TRUSTED_TYPE||!1,He=e.FORCE_BODY||!1,Ge=!1!==e.SANITIZE_DOM,Ye=e.SANITIZE_NAMED_PROPS||!1,je=!1!==e.KEEP_CONTENT,Xe=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||X,ot=e.NAMESPACE||nt,lt=e.MATHML_TEXT_INTEGRATION_POINTS||lt,ct=e.HTML_INTEGRATION_POINTS||ct,De=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(De.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(De.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(De.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ie&&(xe=!1),Be&&(Fe=!0),qe&&(Ne=w({},U),we=[],!0===qe.html&&(w(Ne,L),w(we,z)),!0===qe.svg&&(w(Ne,C),w(we,P),w(we,F)),!0===qe.svgFilters&&(w(Ne,x),w(we,P),w(we,F)),!0===qe.mathMl&&(w(Ne,k),w(we,H),w(we,F))),e.ADD_TAGS&&(Ne===Re&&(Ne=D(Ne)),w(Ne,e.ADD_TAGS,pt)),e.ADD_ATTR&&(we===Oe&&(we=D(we)),w(we,e.ADD_ATTR,pt)),e.ADD_URI_SAFE_ATTR&&w(Je,e.ADD_URI_SAFE_ATTR,pt),e.FORBID_CONTENTS&&($e===Ke&&($e=D($e)),w($e,e.FORBID_CONTENTS,pt)),je&&(Ne["#text"]=!0),ze&&w(Ne,["html","head","body"]),Ne.table&&(w(Ne,["tbody"]),delete ve.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');le=e.TRUSTED_TYPES_POLICY,ce=le.createHTML("")}else void 0===le&&(le=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(j,c)),null!==le&&"string"==typeof ce&&(ce=le.createHTML(""));i&&i(e),ft=e}},Tt=w({},[...C,...x,...M]),yt=w({},[...k,...I]),Et=function(e){f(o.removed,{element:e});try{ae(e).removeChild(e)}catch(t){V(e)}},At=function(e,t){try{f(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Fe||Be)try{Et(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},_t=function(e){let t=null,n=null;if(He)e="<remove></remove>"+e;else{const t=T(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ut&&ot===nt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=le?le.createHTML(e):e;if(ot===nt)try{t=(new Y).parseFromString(o,ut)}catch(e){}if(!t||!t.documentElement){t=se.createDocument(ot,"template",null);try{t.documentElement.innerHTML=rt?ce:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),ot===nt?pe.call(t,ze?"html":"body")[0]:ze?t.documentElement:i},St=function(e){return ue.call(e.ownerDocument||e,e,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT|B.SHOW_PROCESSING_INSTRUCTION|B.SHOW_CDATA_SECTION,null)},bt=function(e){return e instanceof G&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof W)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Nt=function(e){return"function"==typeof R&&e instanceof R};function Rt(e,t,n){u(e,(e=>{e.call(o,t,n,ft)}))}const wt=function(e){let t=null;if(Rt(de.beforeSanitizeElements,e,null),bt(e))return Et(e),!0;const n=pt(e.nodeName);if(Rt(de.uponSanitizeElement,e,{tagName:n,allowedTags:Ne}),e.hasChildNodes()&&!Nt(e.firstElementChild)&&S(/<[/\w]/g,e.innerHTML)&&S(/<[/\w]/g,e.textContent))return Et(e),!0;if(e.nodeType===ee)return Et(e),!0;if(Ue&&e.nodeType===te&&S(/<[/\w]/g,e.data))return Et(e),!0;if(!Ne[n]||ve[n]){if(!ve[n]&&Dt(n)){if(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n))return!1;if(De.tagNameCheck instanceof Function&&De.tagNameCheck(n))return!1}if(je&&!$e[n]){const t=ae(e)||e.parentNode,n=ie(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o){const r=$(n[o],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,re(e))}}}return Et(e),!0}return e instanceof O&&!function(e){let t=ae(e);t&&t.tagName||(t={namespaceURI:ot,tagName:"template"});const n=h(e.tagName),o=h(t.tagName);return!!it[e.namespaceURI]&&(e.namespaceURI===tt?t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===o||lt[o]):Boolean(Tt[n]):e.namespaceURI===et?t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&ct[o]:Boolean(yt[n]):e.namespaceURI===nt?!(t.namespaceURI===tt&&!ct[o])&&!(t.namespaceURI===et&&!lt[o])&&!yt[n]&&(st[n]||!Tt[n]):!("application/xhtml+xml"!==ut||!it[e.namespaceURI]))}(e)?(Et(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!S(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ie&&e.nodeType===Q&&(t=e.textContent,u([he,ge,Te],(e=>{t=y(t,e," ")})),e.textContent!==t&&(f(o.removed,{element:e.cloneNode()}),e.textContent=t)),Rt(de.afterSanitizeElements,e,null),!1):(Et(e),!0)},Ot=function(e,t,n){if(Ge&&("id"===t||"name"===t)&&(n in r||n in dt))return!1;if(xe&&!Le[t]&&S(ye,t));else if(Ce&&S(Ee,t));else if(!we[t]||Le[t]){if(!(Dt(e)&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,e)||De.tagNameCheck instanceof Function&&De.tagNameCheck(e))&&(De.attributeNameCheck instanceof RegExp&&S(De.attributeNameCheck,t)||De.attributeNameCheck instanceof Function&&De.attributeNameCheck(t))||"is"===t&&De.allowCustomizedBuiltInElements&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n)||De.tagNameCheck instanceof Function&&De.tagNameCheck(n))))return!1}else if(Je[t]);else if(S(be,y(n,_e,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==E(n,"data:")||!Ve[e]){if(Me&&!S(Ae,y(n,_e,"")));else if(n)return!1}else;return!0},Dt=function(e){return"annotation-xml"!==e&&T(e,Se)},vt=function(e){Rt(de.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||bt(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:we,forceKeepAttr:void 0};let r=t.length;for(;r--;){const i=t[r],{name:a,namespaceURI:l,value:c}=i,s=pt(a);let m="value"===a?c:A(c);if(n.attrName=s,n.attrValue=m,n.keepAttr=!0,n.forceKeepAttr=void 0,Rt(de.uponSanitizeAttribute,e,n),m=n.attrValue,!Ye||"id"!==s&&"name"!==s||(At(a,e),m="user-content-"+m),Ue&&S(/((--!?|])>)|<\/(style|title)/i,m)){At(a,e);continue}if(n.forceKeepAttr)continue;if(At(a,e),!n.keepAttr)continue;if(!ke&&S(/\/>/i,m)){At(a,e);continue}Ie&&u([he,ge,Te],(e=>{m=y(m,e," ")}));const f=pt(e.nodeName);if(Ot(f,s,m)){if(le&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(l);else switch(j.getAttributeType(f,s)){case"TrustedHTML":m=le.createHTML(m);break;case"TrustedScriptURL":m=le.createScriptURL(m)}try{l?e.setAttributeNS(l,a,m):e.setAttribute(a,m),bt(e)?Et(e):p(o.removed)}catch(e){}}}Rt(de.afterSanitizeAttributes,e,null)},Lt=function e(t){let n=null;const o=St(t);for(Rt(de.beforeSanitizeShadowDOM,t,null);n=o.nextNode();)Rt(de.uponSanitizeShadowNode,n,null),wt(n),vt(n),n.content instanceof s&&e(n.content);Rt(de.afterSanitizeShadowDOM,t,null)};return o.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=null,i=null,l=null;if(rt=!e,rt&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Nt(e)){if("function"!=typeof e.toString)throw b("toString is not a function");if("string"!=typeof(e=e.toString()))throw b("dirty is not a string, aborting")}if(!o.isSupported)return e;if(Pe||gt(t),o.removed=[],"string"==typeof e&&(Xe=!1),Xe){if(e.nodeName){const t=pt(e.nodeName);if(!Ne[t]||ve[t])throw b("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof R)n=_t("\x3c!----\x3e"),r=n.ownerDocument.importNode(e,!0),r.nodeType===J&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(!Fe&&!Ie&&!ze&&-1===e.indexOf("<"))return le&&We?le.createHTML(e):e;if(n=_t(e),!n)return Fe?null:We?ce:""}n&&He&&Et(n.firstChild);const c=St(Xe?e:n);for(;i=c.nextNode();)wt(i),vt(i),i.content instanceof s&&Lt(i.content);if(Xe)return e;if(Fe){if(Be)for(l=me.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(we.shadowroot||we.shadowrootmode)&&(l=fe.call(a,l,!0)),l}let m=ze?n.outerHTML:n.innerHTML;return ze&&Ne["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&S(K,n.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+m),Ie&&u([he,ge,Te],(e=>{m=y(m,e," ")})),le&&We?le.createHTML(m):m},o.setConfig=function(){gt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Pe=!0},o.clearConfig=function(){ft=null,Pe=!1},o.isValidAttribute=function(e,t,n){ft||gt({});const o=pt(e),r=pt(t);return Ot(o,r,n)},o.addHook=function(e,t){"function"==typeof t&&f(de[e],t)},o.removeHook=function(e,t){if(void 0!==t){const n=m(de[e],t);return-1===n?void 0:d(de[e],n,1)[0]}return p(de[e])},o.removeHooks=function(e){de[e]=[]},o.removeAllHooks=function(){de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},o}();return re}));+/*! @license DOMPurify 3.2.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.5/LICENSE */+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DOMPurify=t()}(this,(function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:r}=Object;let{freeze:i,seal:a,create:l}=Object,{apply:c,construct:s}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),a||(a=function(e){return e}),c||(c=function(e,t,n){return e.apply(t,n)}),s||(s=function(e,t){return new e(...t)});const u=R(Array.prototype.forEach),m=R(Array.prototype.lastIndexOf),p=R(Array.prototype.pop),f=R(Array.prototype.push),d=R(Array.prototype.splice),h=R(String.prototype.toLowerCase),g=R(String.prototype.toString),T=R(String.prototype.match),y=R(String.prototype.replace),E=R(String.prototype.indexOf),A=R(String.prototype.trim),_=R(Object.prototype.hasOwnProperty),S=R(RegExp.prototype.test),b=(N=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(N,t)});var N;function R(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return c(e,t,o)}}function w(e,o){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;t&&t(e,null);let i=o.length;for(;i--;){let t=o[i];if("string"==typeof t){const e=r(t);e!==t&&(n(o)||(o[i]=e),t=e)}e[t]=!0}return e}function O(e){for(let t=0;t<e.length;t++){_(e,t)||(e[t]=null)}return e}function D(t){const n=l(null);for(const[o,r]of e(t)){_(t,o)&&(Array.isArray(r)?n[o]=O(r):r&&"object"==typeof r&&r.constructor===Object?n[o]=D(r):n[o]=r)}return n}function v(e,t){for(;null!==e;){const n=r(e,t);if(n){if(n.get)return R(n.get);if("function"==typeof n.value)return R(n.value)}e=o(e)}return function(){return null}}const L=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),C=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),x=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=i(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),M=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),k=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),U=i(["#text"]),z=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),P=i(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),H=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),F=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),W=a(/<%[\w\W]*|[\w\W]*%>/gm),G=a(/\$\{[\w\W]*/gm),Y=a(/^data-[\-\w.\u00B7-\uFFFF]+$/),j=a(/^aria-[\-\w]+$/),X=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),q=a(/^(?:\w+script|data):/i),$=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=a(/^html$/i),V=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var Z=Object.freeze({__proto__:null,ARIA_ATTR:j,ATTR_WHITESPACE:$,CUSTOM_ELEMENT:V,DATA_ATTR:Y,DOCTYPE_NAME:K,ERB_EXPR:W,IS_ALLOWED_URI:X,IS_SCRIPT_OR_DATA:q,MUSTACHE_EXPR:B,TMPLIT_EXPR:G});const J=1,Q=3,ee=7,te=8,ne=9,oe=function(){return"undefined"==typeof window?null:window};var re=function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oe();const o=e=>t(e);if(o.version="3.2.5",o.removed=[],!n||!n.document||n.document.nodeType!==ne||!n.Element)return o.isSupported=!1,o;let{document:r}=n;const a=r,c=a.currentScript,{DocumentFragment:s,HTMLTemplateElement:N,Node:R,Element:O,NodeFilter:B,NamedNodeMap:W=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:G,DOMParser:Y,trustedTypes:j}=n,q=O.prototype,$=v(q,"cloneNode"),V=v(q,"remove"),re=v(q,"nextSibling"),ie=v(q,"childNodes"),ae=v(q,"parentNode");if("function"==typeof N){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let le,ce="";const{implementation:se,createNodeIterator:ue,createDocumentFragment:me,getElementsByTagName:pe}=r,{importNode:fe}=a;let de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};o.isSupported="function"==typeof e&&"function"==typeof ae&&se&&void 0!==se.createHTMLDocument;const{MUSTACHE_EXPR:he,ERB_EXPR:ge,TMPLIT_EXPR:Te,DATA_ATTR:ye,ARIA_ATTR:Ee,IS_SCRIPT_OR_DATA:Ae,ATTR_WHITESPACE:_e,CUSTOM_ELEMENT:Se}=Z;let{IS_ALLOWED_URI:be}=Z,Ne=null;const Re=w({},[...L,...C,...x,...M,...U]);let we=null;const Oe=w({},[...z,...P,...H,...F]);let De=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ve=null,Le=null,Ce=!0,xe=!0,Ie=!1,Me=!0,ke=!1,Ue=!0,ze=!1,Pe=!1,He=!1,Fe=!1,Be=!1,We=!1,Ge=!0,Ye=!1,je=!0,Xe=!1,qe={},$e=null;const Ke=w({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ve=null;const Ze=w({},["audio","video","img","source","image","track"]);let Je=null;const Qe=w({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let ot=nt,rt=!1,it=null;const at=w({},[et,tt,nt],g);let lt=w({},["mi","mo","mn","ms","mtext"]),ct=w({},["annotation-xml"]);const st=w({},["title","style","font","a","script"]);let ut=null;const mt=["application/xhtml+xml","text/html"];let pt=null,ft=null;const dt=r.createElement("form"),ht=function(e){return e instanceof RegExp||e instanceof Function},gt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ft||ft!==e){if(e&&"object"==typeof e||(e={}),e=D(e),ut=-1===mt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,pt="application/xhtml+xml"===ut?g:h,Ne=_(e,"ALLOWED_TAGS")?w({},e.ALLOWED_TAGS,pt):Re,we=_(e,"ALLOWED_ATTR")?w({},e.ALLOWED_ATTR,pt):Oe,it=_(e,"ALLOWED_NAMESPACES")?w({},e.ALLOWED_NAMESPACES,g):at,Je=_(e,"ADD_URI_SAFE_ATTR")?w(D(Qe),e.ADD_URI_SAFE_ATTR,pt):Qe,Ve=_(e,"ADD_DATA_URI_TAGS")?w(D(Ze),e.ADD_DATA_URI_TAGS,pt):Ze,$e=_(e,"FORBID_CONTENTS")?w({},e.FORBID_CONTENTS,pt):Ke,ve=_(e,"FORBID_TAGS")?w({},e.FORBID_TAGS,pt):{},Le=_(e,"FORBID_ATTR")?w({},e.FORBID_ATTR,pt):{},qe=!!_(e,"USE_PROFILES")&&e.USE_PROFILES,Ce=!1!==e.ALLOW_ARIA_ATTR,xe=!1!==e.ALLOW_DATA_ATTR,Ie=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,ke=e.SAFE_FOR_TEMPLATES||!1,Ue=!1!==e.SAFE_FOR_XML,ze=e.WHOLE_DOCUMENT||!1,Fe=e.RETURN_DOM||!1,Be=e.RETURN_DOM_FRAGMENT||!1,We=e.RETURN_TRUSTED_TYPE||!1,He=e.FORCE_BODY||!1,Ge=!1!==e.SANITIZE_DOM,Ye=e.SANITIZE_NAMED_PROPS||!1,je=!1!==e.KEEP_CONTENT,Xe=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||X,ot=e.NAMESPACE||nt,lt=e.MATHML_TEXT_INTEGRATION_POINTS||lt,ct=e.HTML_INTEGRATION_POINTS||ct,De=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(De.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(De.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(De.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ke&&(xe=!1),Be&&(Fe=!0),qe&&(Ne=w({},U),we=[],!0===qe.html&&(w(Ne,L),w(we,z)),!0===qe.svg&&(w(Ne,C),w(we,P),w(we,F)),!0===qe.svgFilters&&(w(Ne,x),w(we,P),w(we,F)),!0===qe.mathMl&&(w(Ne,M),w(we,H),w(we,F))),e.ADD_TAGS&&(Ne===Re&&(Ne=D(Ne)),w(Ne,e.ADD_TAGS,pt)),e.ADD_ATTR&&(we===Oe&&(we=D(we)),w(we,e.ADD_ATTR,pt)),e.ADD_URI_SAFE_ATTR&&w(Je,e.ADD_URI_SAFE_ATTR,pt),e.FORBID_CONTENTS&&($e===Ke&&($e=D($e)),w($e,e.FORBID_CONTENTS,pt)),je&&(Ne["#text"]=!0),ze&&w(Ne,["html","head","body"]),Ne.table&&(w(Ne,["tbody"]),delete ve.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');le=e.TRUSTED_TYPES_POLICY,ce=le.createHTML("")}else void 0===le&&(le=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(j,c)),null!==le&&"string"==typeof ce&&(ce=le.createHTML(""));i&&i(e),ft=e}},Tt=w({},[...C,...x,...I]),yt=w({},[...M,...k]),Et=function(e){f(o.removed,{element:e});try{ae(e).removeChild(e)}catch(t){V(e)}},At=function(e,t){try{f(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Fe||Be)try{Et(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},_t=function(e){let t=null,n=null;if(He)e="<remove></remove>"+e;else{const t=T(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ut&&ot===nt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=le?le.createHTML(e):e;if(ot===nt)try{t=(new Y).parseFromString(o,ut)}catch(e){}if(!t||!t.documentElement){t=se.createDocument(ot,"template",null);try{t.documentElement.innerHTML=rt?ce:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),ot===nt?pe.call(t,ze?"html":"body")[0]:ze?t.documentElement:i},St=function(e){return ue.call(e.ownerDocument||e,e,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT|B.SHOW_PROCESSING_INSTRUCTION|B.SHOW_CDATA_SECTION,null)},bt=function(e){return e instanceof G&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof W)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Nt=function(e){return"function"==typeof R&&e instanceof R};function Rt(e,t,n){u(e,(e=>{e.call(o,t,n,ft)}))}const wt=function(e){let t=null;if(Rt(de.beforeSanitizeElements,e,null),bt(e))return Et(e),!0;const n=pt(e.nodeName);if(Rt(de.uponSanitizeElement,e,{tagName:n,allowedTags:Ne}),e.hasChildNodes()&&!Nt(e.firstElementChild)&&S(/<[/\w!]/g,e.innerHTML)&&S(/<[/\w!]/g,e.textContent))return Et(e),!0;if(e.nodeType===ee)return Et(e),!0;if(Ue&&e.nodeType===te&&S(/<[/\w]/g,e.data))return Et(e),!0;if(!Ne[n]||ve[n]){if(!ve[n]&&Dt(n)){if(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n))return!1;if(De.tagNameCheck instanceof Function&&De.tagNameCheck(n))return!1}if(je&&!$e[n]){const t=ae(e)||e.parentNode,n=ie(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o){const r=$(n[o],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,re(e))}}}return Et(e),!0}return e instanceof O&&!function(e){let t=ae(e);t&&t.tagName||(t={namespaceURI:ot,tagName:"template"});const n=h(e.tagName),o=h(t.tagName);return!!it[e.namespaceURI]&&(e.namespaceURI===tt?t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===o||lt[o]):Boolean(Tt[n]):e.namespaceURI===et?t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&ct[o]:Boolean(yt[n]):e.namespaceURI===nt?!(t.namespaceURI===tt&&!ct[o])&&!(t.namespaceURI===et&&!lt[o])&&!yt[n]&&(st[n]||!Tt[n]):!("application/xhtml+xml"!==ut||!it[e.namespaceURI]))}(e)?(Et(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!S(/<\/no(script|embed|frames)/i,e.innerHTML)?(ke&&e.nodeType===Q&&(t=e.textContent,u([he,ge,Te],(e=>{t=y(t,e," ")})),e.textContent!==t&&(f(o.removed,{element:e.cloneNode()}),e.textContent=t)),Rt(de.afterSanitizeElements,e,null),!1):(Et(e),!0)},Ot=function(e,t,n){if(Ge&&("id"===t||"name"===t)&&(n in r||n in dt))return!1;if(xe&&!Le[t]&&S(ye,t));else if(Ce&&S(Ee,t));else if(!we[t]||Le[t]){if(!(Dt(e)&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,e)||De.tagNameCheck instanceof Function&&De.tagNameCheck(e))&&(De.attributeNameCheck instanceof RegExp&&S(De.attributeNameCheck,t)||De.attributeNameCheck instanceof Function&&De.attributeNameCheck(t))||"is"===t&&De.allowCustomizedBuiltInElements&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n)||De.tagNameCheck instanceof Function&&De.tagNameCheck(n))))return!1}else if(Je[t]);else if(S(be,y(n,_e,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==E(n,"data:")||!Ve[e]){if(Ie&&!S(Ae,y(n,_e,"")));else if(n)return!1}else;return!0},Dt=function(e){return"annotation-xml"!==e&&T(e,Se)},vt=function(e){Rt(de.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||bt(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:we,forceKeepAttr:void 0};let r=t.length;for(;r--;){const i=t[r],{name:a,namespaceURI:l,value:c}=i,s=pt(a);let m="value"===a?c:A(c);if(n.attrName=s,n.attrValue=m,n.keepAttr=!0,n.forceKeepAttr=void 0,Rt(de.uponSanitizeAttribute,e,n),m=n.attrValue,!Ye||"id"!==s&&"name"!==s||(At(a,e),m="user-content-"+m),Ue&&S(/((--!?|])>)|<\/(style|title)/i,m)){At(a,e);continue}if(n.forceKeepAttr)continue;if(At(a,e),!n.keepAttr)continue;if(!Me&&S(/\/>/i,m)){At(a,e);continue}ke&&u([he,ge,Te],(e=>{m=y(m,e," ")}));const f=pt(e.nodeName);if(Ot(f,s,m)){if(le&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(l);else switch(j.getAttributeType(f,s)){case"TrustedHTML":m=le.createHTML(m);break;case"TrustedScriptURL":m=le.createScriptURL(m)}try{l?e.setAttributeNS(l,a,m):e.setAttribute(a,m),bt(e)?Et(e):p(o.removed)}catch(e){}}}Rt(de.afterSanitizeAttributes,e,null)},Lt=function e(t){let n=null;const o=St(t);for(Rt(de.beforeSanitizeShadowDOM,t,null);n=o.nextNode();)Rt(de.uponSanitizeShadowNode,n,null),wt(n),vt(n),n.content instanceof s&&e(n.content);Rt(de.afterSanitizeShadowDOM,t,null)};return o.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=null,i=null,l=null;if(rt=!e,rt&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Nt(e)){if("function"!=typeof e.toString)throw b("toString is not a function");if("string"!=typeof(e=e.toString()))throw b("dirty is not a string, aborting")}if(!o.isSupported)return e;if(Pe||gt(t),o.removed=[],"string"==typeof e&&(Xe=!1),Xe){if(e.nodeName){const t=pt(e.nodeName);if(!Ne[t]||ve[t])throw b("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof R)n=_t("\x3c!----\x3e"),r=n.ownerDocument.importNode(e,!0),r.nodeType===J&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(!Fe&&!ke&&!ze&&-1===e.indexOf("<"))return le&&We?le.createHTML(e):e;if(n=_t(e),!n)return Fe?null:We?ce:""}n&&He&&Et(n.firstChild);const c=St(Xe?e:n);for(;i=c.nextNode();)wt(i),vt(i),i.content instanceof s&&Lt(i.content);if(Xe)return e;if(Fe){if(Be)for(l=me.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(we.shadowroot||we.shadowrootmode)&&(l=fe.call(a,l,!0)),l}let m=ze?n.outerHTML:n.innerHTML;return ze&&Ne["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&S(K,n.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+m),ke&&u([he,ge,Te],(e=>{m=y(m,e," ")})),le&&We?le.createHTML(m):m},o.setConfig=function(){gt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Pe=!0},o.clearConfig=function(){ft=null,Pe=!1},o.isValidAttribute=function(e,t,n){ft||gt({});const o=pt(e),r=pt(t);return Ot(o,r,n)},o.addHook=function(e,t){"function"==typeof t&&f(de[e],t)},o.removeHook=function(e,t){if(void 0!==t){const n=m(de[e],t);return-1===n?void 0:d(de[e],n,1)[0]}return p(de[e])},o.removeHooks=function(e){de[e]=[]},o.removeAllHooks=function(){de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},o}();return re}));/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).pako={})}(this,(function(t){"use strict";function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=256,n=286,i=30,r=15,s=new Uint8Array([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]),o=new Uint8Array([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]),l=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),h=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=new Array(576);e(d);var _=new Array(60);e(_);var f=new Array(512);e(f);var u=new Array(256);e(u);var c=new Array(29);e(c);var w,m,b,g=new Array(i);function p(t,e,a,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}function v(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(g);var k=function(t){return t<256?f[t]:f[256+(t>>>7)]},y=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},x=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,y(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},z=function(t,e,a){x(t,a[2*e],a[2*e+1])},A=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},E=function(t,e,a){var n,i,s=new Array(16),o=0;for(n=1;n<=r;n++)o=o+a[n-1]<<1,s[n]=o;for(i=0;i<=e;i++){var l=t[2*i+1];0!==l&&(t[2*i]=A(s[l]++,l))}},R=function(t){var e;for(e=0;e<n;e++)t.dyn_ltree[2*e]=0;for(e=0;e<i;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},Z=function(t){t.bi_valid>8?y(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},S=function(t,e,a,n){var i=2*e,r=2*a;return t[i]<t[r]||t[i]===t[r]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],i=a<<1;i<=t.heap_len&&(i<t.heap_len&&S(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!S(e,n,t.heap[i],t.depth));)t.heap[a]=t.heap[i],a=i,i<<=1;t.heap[a]=n},D=function(t,e,n){var i,r,l,h,d=0;if(0!==t.sym_next)do{i=255&t.pending_buf[t.sym_buf+d++],i+=(255&t.pending_buf[t.sym_buf+d++])<<8,r=t.pending_buf[t.sym_buf+d++],0===i?z(t,r,e):(l=u[r],z(t,l+a+1,e),0!==(h=s[l])&&(r-=c[l],x(t,r,h)),i--,l=k(i),z(t,l,n),0!==(h=o[l])&&(i-=g[l],x(t,i,h)))}while(d<t.sym_next);z(t,256,e)},T=function(t,e){var a,n,i,s=e.dyn_tree,o=e.stat_desc.static_tree,l=e.stat_desc.has_stree,h=e.stat_desc.elems,d=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<h;a++)0!==s[2*a]?(t.heap[++t.heap_len]=d=a,t.depth[a]=0):s[2*a+1]=0;for(;t.heap_len<2;)s[2*(i=t.heap[++t.heap_len]=d<2?++d:0)]=1,t.depth[i]=0,t.opt_len--,l&&(t.static_len-=o[2*i+1]);for(e.max_code=d,a=t.heap_len>>1;a>=1;a--)U(t,s,a);i=h;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,s,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,s[2*i]=s[2*a]+s[2*n],t.depth[i]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,s[2*a+1]=s[2*n+1]=i,t.heap[1]=i++,U(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,i,s,o,l,h=e.dyn_tree,d=e.max_code,_=e.stat_desc.static_tree,f=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,w=e.stat_desc.max_length,m=0;for(s=0;s<=r;s++)t.bl_count[s]=0;for(h[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(s=h[2*h[2*(n=t.heap[a])+1]+1]+1)>w&&(s=w,m++),h[2*n+1]=s,n>d||(t.bl_count[s]++,o=0,n>=c&&(o=u[n-c]),l=h[2*n],t.opt_len+=l*(s+o),f&&(t.static_len+=l*(_[2*n+1]+o)));if(0!==m){do{for(s=w-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[w]--,m-=2}while(m>0);for(s=w;0!==s;s--)for(n=t.bl_count[s];0!==n;)(i=t.heap[--a])>d||(h[2*i+1]!==s&&(t.opt_len+=(s-h[2*i+1])*h[2*i],h[2*i+1]=s),n--)}}(t,e),E(s,d,t.bl_count)},O=function(t,e,a){var n,i,r=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)i=s,s=e[2*(n+1)+1],++o<l&&i===s||(o<h?t.bl_tree[2*i]+=o:0!==i?(i!==r&&t.bl_tree[2*i]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,r=i,0===s?(l=138,h=3):i===s?(l=6,h=3):(l=7,h=4))},I=function(t,e,a){var n,i,r=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),n=0;n<=a;n++)if(i=s,s=e[2*(n+1)+1],!(++o<l&&i===s)){if(o<h)do{z(t,i,t.bl_tree)}while(0!=--o);else 0!==i?(i!==r&&(z(t,i,t.bl_tree),o--),z(t,16,t.bl_tree),x(t,o-3,2)):o<=10?(z(t,17,t.bl_tree),x(t,o-3,3)):(z(t,18,t.bl_tree),x(t,o-11,7));o=0,r=i,0===s?(l=138,h=3):i===s?(l=6,h=3):(l=7,h=4)}},F=!1,L=function(t,e,a,n){x(t,0+(n?1:0),3),Z(t),y(t,a),y(t,~a),a&&t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a},N=function(t,e,n,i){var r,s,o=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<a;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),T(t,t.l_desc),T(t,t.d_desc),o=function(t){var e;for(O(t,t.dyn_ltree,t.l_desc.max_code),O(t,t.dyn_dtree,t.d_desc.max_code),T(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=r&&(r=s)):r=s=n+5,n+4<=r&&-1!==e?L(t,e,n,i):4===t.strategy||s===r?(x(t,2+(i?1:0),3),D(t,d,_)):(x(t,4+(i?1:0),3),function(t,e,a,n){var i;for(x(t,e-257,5),x(t,a-1,5),x(t,n-4,4),i=0;i<n;i++)x(t,t.bl_tree[2*h[i]+1],3);I(t,t.dyn_ltree,e-1),I(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),D(t,t.dyn_ltree,t.dyn_dtree)),R(t),i&&Z(t)},B={_tr_init:function(t){F||(!function(){var t,e,a,h,v,k=new Array(16);for(a=0,h=0;h<28;h++)for(c[h]=a,t=0;t<1<<s[h];t++)u[a++]=h;for(u[a-1]=h,v=0,h=0;h<16;h++)for(g[h]=v,t=0;t<1<<o[h];t++)f[v++]=h;for(v>>=7;h<i;h++)for(g[h]=v<<7,t=0;t<1<<o[h]-7;t++)f[256+v++]=h;for(e=0;e<=r;e++)k[e]=0;for(t=0;t<=143;)d[2*t+1]=8,t++,k[8]++;for(;t<=255;)d[2*t+1]=9,t++,k[9]++;for(;t<=279;)d[2*t+1]=7,t++,k[7]++;for(;t<=287;)d[2*t+1]=8,t++,k[8]++;for(E(d,287,k),t=0;t<i;t++)_[2*t+1]=5,_[2*t]=A(t,5);w=new p(d,s,257,n,r),m=new p(_,o,0,i,r),b=new p(new Array(0),l,0,19,7)}(),F=!0),t.l_desc=new v(t.dyn_ltree,w),t.d_desc=new v(t.dyn_dtree,m),t.bl_desc=new v(t.bl_tree,b),t.bi_buf=0,t.bi_valid=0,R(t)},_tr_stored_block:L,_tr_flush_block:N,_tr_tally:function(t,e,n){return t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=n,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(u[n]+a+1)]++,t.dyn_dtree[2*k(e)]++),t.sym_next===t.sym_end},_tr_align:function(t){x(t,2,3),z(t,256,d),function(t){16===t.bi_valid?(y(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)}(t)}},C=function(t,e,a,n){for(var i=65535&t|0,r=t>>>16&65535|0,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{r=r+(i=i+e[n++]|0)|0}while(--s);i%=65521,r%=65521}return i|r<<16|0},M=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),H=function(t,e,a,n){var i=M,r=n+a;t^=-1;for(var s=n;s<r;s++)t=t>>>8^i[255&(t^e[s])];return-1^t},j={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"},K={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},P=B._tr_init,Y=B._tr_stored_block,G=B._tr_flush_block,X=B._tr_tally,W=B._tr_align,q=K.Z_NO_FLUSH,J=K.Z_PARTIAL_FLUSH,Q=K.Z_FULL_FLUSH,V=K.Z_FINISH,$=K.Z_BLOCK,tt=K.Z_OK,et=K.Z_STREAM_END,at=K.Z_STREAM_ERROR,nt=K.Z_DATA_ERROR,it=K.Z_BUF_ERROR,rt=K.Z_DEFAULT_COMPRESSION,st=K.Z_FILTERED,ot=K.Z_HUFFMAN_ONLY,lt=K.Z_RLE,ht=K.Z_FIXED,dt=K.Z_DEFAULT_STRATEGY,_t=K.Z_UNKNOWN,ft=K.Z_DEFLATED,ut=258,ct=262,wt=42,mt=113,bt=666,gt=function(t,e){return t.msg=j[e],e},pt=function(t){return 2*t-(t>4?9:0)},vt=function(t){for(var e=t.length;--e>=0;)t[e]=0},kt=function(t){var e,a,n,i=t.w_size;n=e=t.hash_size;do{a=t.head[--n],t.head[n]=a>=i?a-i:0}while(--e);n=e=i;do{a=t.prev[--n],t.prev[n]=a>=i?a-i:0}while(--e)},yt=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},xt=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},zt=function(t,e){G(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,xt(t.strm)},At=function(t,e){t.pending_buf[t.pending++]=e},Et=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Rt=function(t,e,a,n){var i=t.avail_in;return i>n&&(i=n),0===i?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),a),1===t.state.wrap?t.adler=C(t.adler,e,i,a):2===t.state.wrap&&(t.adler=H(t.adler,e,i,a)),t.next_in+=i,t.total_in+=i,i)},Zt=function(t,e){var a,n,i=t.max_chain_length,r=t.strstart,s=t.prev_length,o=t.nice_match,l=t.strstart>t.w_size-ct?t.strstart-(t.w_size-ct):0,h=t.window,d=t.w_mask,_=t.prev,f=t.strstart+ut,u=h[r+s-1],c=h[r+s];t.prev_length>=t.good_match&&(i>>=2),o>t.lookahead&&(o=t.lookahead);do{if(h[(a=e)+s]===c&&h[a+s-1]===u&&h[a]===h[r]&&h[++a]===h[r+1]){r+=2,a++;do{}while(h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&r<f);if(n=ut-(f-r),r=f-ut,n>s){if(t.match_start=e,s=n,n>=o)break;u=h[r+s-1],c=h[r+s]}}}while((e=_[e&d])>l&&0!=--i);return s<=t.lookahead?s:t.lookahead},St=function(t){var e,a,n,i=t.w_size;do{if(a=t.window_size-t.lookahead-t.strstart,t.strstart>=i+(i-ct)&&(t.window.set(t.window.subarray(i,i+i-a),0),t.match_start-=i,t.strstart-=i,t.block_start-=i,t.insert>t.strstart&&(t.insert=t.strstart),kt(t),a+=i),0===t.strm.avail_in)break;if(e=Rt(t.strm,t.window,t.strstart+t.lookahead,a),t.lookahead+=e,t.lookahead+t.insert>=3)for(n=t.strstart-t.insert,t.ins_h=t.window[n],t.ins_h=yt(t,t.ins_h,t.window[n+1]);t.insert&&(t.ins_h=yt(t,t.ins_h,t.window[n+3-1]),t.prev[n&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=n,n++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<ct&&0!==t.strm.avail_in)},Ut=function(t,e){var a,n,i,r=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,s=0,o=t.strm.avail_in;do{if(a=65535,i=t.bi_valid+42>>3,t.strm.avail_out<i)break;if(i=t.strm.avail_out-i,a>(n=t.strstart-t.block_start)+t.strm.avail_in&&(a=n+t.strm.avail_in),a>i&&(a=i),a<r&&(0===a&&e!==V||e===q||a!==n+t.strm.avail_in))break;s=e===V&&a===n+t.strm.avail_in?1:0,Y(t,0,0,s),t.pending_buf[t.pending-4]=a,t.pending_buf[t.pending-3]=a>>8,t.pending_buf[t.pending-2]=~a,t.pending_buf[t.pending-1]=~a>>8,xt(t.strm),n&&(n>a&&(n=a),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+n),t.strm.next_out),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n,t.block_start+=n,a-=n),a&&(Rt(t.strm,t.strm.output,t.strm.next_out,a),t.strm.next_out+=a,t.strm.avail_out-=a,t.strm.total_out+=a)}while(0===s);return(o-=t.strm.avail_in)&&(o>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=o&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-o,t.strm.next_in),t.strstart),t.strstart+=o,t.insert+=o>t.w_size-t.insert?t.w_size-t.insert:o),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),s?4:e!==q&&e!==V&&0===t.strm.avail_in&&t.strstart===t.block_start?2:(i=t.window_size-t.strstart,t.strm.avail_in>i&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,i+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),i>t.strm.avail_in&&(i=t.strm.avail_in),i&&(Rt(t.strm,t.window,t.strstart,i),t.strstart+=i,t.insert+=i>t.w_size-t.insert?t.w_size-t.insert:i),t.high_water<t.strstart&&(t.high_water=t.strstart),i=t.bi_valid+42>>3,r=(i=t.pending_buf_size-i>65535?65535:t.pending_buf_size-i)>t.w_size?t.w_size:i,((n=t.strstart-t.block_start)>=r||(n||e===V)&&e!==q&&0===t.strm.avail_in&&n<=i)&&(a=n>i?i:n,s=e===V&&0===t.strm.avail_in&&a===n?1:0,Y(t,t.block_start,a,s),t.block_start+=a,xt(t.strm)),s?3:1)},Dt=function(t,e){for(var a,n;;){if(t.lookahead<ct){if(St(t),t.lookahead<ct&&e===q)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=yt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-ct&&(t.match_length=Zt(t,a)),t.match_length>=3)if(n=X(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=yt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=yt(t,t.ins_h,t.window[t.strstart+1]);else n=X(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(zt(t,!1),0===t.strm.avail_out)?1:2},Tt=function(t,e){for(var a,n,i;;){if(t.lookahead<ct){if(St(t),t.lookahead<ct&&e===q)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=yt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-ct&&(t.match_length=Zt(t,a),t.match_length<=5&&(t.strategy===st||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,n=X(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=yt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(zt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=X(t,0,t.window[t.strstart-1]))&&zt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=X(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(zt(t,!1),0===t.strm.avail_out)?1:2};function Ot(t,e,a,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=i}var It=[new Ot(0,0,0,0,Ut),new Ot(4,4,8,4,Dt),new Ot(4,5,16,8,Dt),new Ot(4,6,32,32,Dt),new Ot(4,4,16,16,Tt),new Ot(8,16,32,32,Tt),new Ot(8,16,128,128,Tt),new Ot(8,32,128,256,Tt),new Ot(32,128,258,1024,Tt),new Ot(32,258,258,4096,Tt)];function Ft(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ft,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),vt(this.dyn_ltree),vt(this.dyn_dtree),vt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),vt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),vt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Lt=function(t){if(!t)return 1;var e=t.state;return!e||e.strm!==t||e.status!==wt&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&e.status!==mt&&e.status!==bt?1:0},Nt=function(t){if(Lt(t))return gt(t,at);t.total_in=t.total_out=0,t.data_type=_t;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?wt:mt,t.adler=2===e.wrap?0:1,e.last_flush=-2,P(e),tt},Bt=function(t){var e,a=Nt(t);return a===tt&&((e=t.state).window_size=2*e.w_size,vt(e.head),e.max_lazy_match=It[e.level].max_lazy,e.good_match=It[e.level].good_length,e.nice_match=It[e.level].nice_length,e.max_chain_length=It[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),a},Ct=function(t,e,a,n,i,r){if(!t)return at;var s=1;if(e===rt&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),i<1||i>9||a!==ft||n<8||n>15||e<0||e>9||r<0||r>ht||8===n&&1!==s)return gt(t,at);8===n&&(n=9);var o=new Ft;return t.state=o,o.strm=t,o.status=wt,o.wrap=s,o.gzhead=null,o.w_bits=n,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=i+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new Uint8Array(2*o.w_size),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<i+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=3*(o.lit_bufsize-1),o.level=e,o.strategy=r,o.method=a,Bt(t)},Mt={deflateInit:function(t,e){return Ct(t,e,ft,15,8,dt)},deflateInit2:Ct,deflateReset:Bt,deflateResetKeep:Nt,deflateSetHeader:function(t,e){return Lt(t)||2!==t.state.wrap?at:(t.state.gzhead=e,tt)},deflate:function(t,e){if(Lt(t)||e>$||e<0)return t?gt(t,at):at;var a=t.state;if(!t.output||0!==t.avail_in&&!t.input||a.status===bt&&e!==V)return gt(t,0===t.avail_out?it:at);var n=a.last_flush;if(a.last_flush=e,0!==a.pending){if(xt(t),0===t.avail_out)return a.last_flush=-1,tt}else if(0===t.avail_in&&pt(e)<=pt(n)&&e!==V)return gt(t,it);if(a.status===bt&&0!==t.avail_in)return gt(t,it);if(a.status===wt&&0===a.wrap&&(a.status=mt),a.status===wt){var i=ft+(a.w_bits-8<<4)<<8;if(i|=(a.strategy>=ot||a.level<2?0:a.level<6?1:6===a.level?2:3)<<6,0!==a.strstart&&(i|=32),Et(a,i+=31-i%31),0!==a.strstart&&(Et(a,t.adler>>>16),Et(a,65535&t.adler)),t.adler=1,a.status=mt,xt(t),0!==a.pending)return a.last_flush=-1,tt}if(57===a.status)if(t.adler=0,At(a,31),At(a,139),At(a,8),a.gzhead)At(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),At(a,255&a.gzhead.time),At(a,a.gzhead.time>>8&255),At(a,a.gzhead.time>>16&255),At(a,a.gzhead.time>>24&255),At(a,9===a.level?2:a.strategy>=ot||a.level<2?4:0),At(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(At(a,255&a.gzhead.extra.length),At(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(t.adler=H(t.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69;else if(At(a,0),At(a,0),At(a,0),At(a,0),At(a,0),At(a,9===a.level?2:a.strategy>=ot||a.level<2?4:0),At(a,3),a.status=mt,xt(t),0!==a.pending)return a.last_flush=-1,tt;if(69===a.status){if(a.gzhead.extra){for(var r=a.pending,s=(65535&a.gzhead.extra.length)-a.gzindex;a.pending+s>a.pending_buf_size;){var o=a.pending_buf_size-a.pending;if(a.pending_buf.set(a.gzhead.extra.subarray(a.gzindex,a.gzindex+o),a.pending),a.pending=a.pending_buf_size,a.gzhead.hcrc&&a.pending>r&&(t.adler=H(t.adler,a.pending_buf,a.pending-r,r)),a.gzindex+=o,xt(t),0!==a.pending)return a.last_flush=-1,tt;r=0,s-=o}var l=new Uint8Array(a.gzhead.extra);a.pending_buf.set(l.subarray(a.gzindex,a.gzindex+s),a.pending),a.pending+=s,a.gzhead.hcrc&&a.pending>r&&(t.adler=H(t.adler,a.pending_buf,a.pending-r,r)),a.gzindex=0}a.status=73}if(73===a.status){if(a.gzhead.name){var h,d=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>d&&(t.adler=H(t.adler,a.pending_buf,a.pending-d,d)),xt(t),0!==a.pending)return a.last_flush=-1,tt;d=0}h=a.gzindex<a.gzhead.name.length?255&a.gzhead.name.charCodeAt(a.gzindex++):0,At(a,h)}while(0!==h);a.gzhead.hcrc&&a.pending>d&&(t.adler=H(t.adler,a.pending_buf,a.pending-d,d)),a.gzindex=0}a.status=91}if(91===a.status){if(a.gzhead.comment){var _,f=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>f&&(t.adler=H(t.adler,a.pending_buf,a.pending-f,f)),xt(t),0!==a.pending)return a.last_flush=-1,tt;f=0}_=a.gzindex<a.gzhead.comment.length?255&a.gzhead.comment.charCodeAt(a.gzindex++):0,At(a,_)}while(0!==_);a.gzhead.hcrc&&a.pending>f&&(t.adler=H(t.adler,a.pending_buf,a.pending-f,f))}a.status=103}if(103===a.status){if(a.gzhead.hcrc){if(a.pending+2>a.pending_buf_size&&(xt(t),0!==a.pending))return a.last_flush=-1,tt;At(a,255&t.adler),At(a,t.adler>>8&255),t.adler=0}if(a.status=mt,xt(t),0!==a.pending)return a.last_flush=-1,tt}if(0!==t.avail_in||0!==a.lookahead||e!==q&&a.status!==bt){var u=0===a.level?Ut(a,e):a.strategy===ot?function(t,e){for(var a;;){if(0===t.lookahead&&(St(t),0===t.lookahead)){if(e===q)return 1;break}if(t.match_length=0,a=X(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(zt(t,!1),0===t.strm.avail_out)?1:2}(a,e):a.strategy===lt?function(t,e){for(var a,n,i,r,s=t.window;;){if(t.lookahead<=ut){if(St(t),t.lookahead<=ut&&e===q)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[i=t.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){r=t.strstart+ut;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<r);t.match_length=ut-(r-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=X(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=X(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(zt(t,!1),0===t.strm.avail_out)?1:2}(a,e):It[a.level].func(a,e);if(3!==u&&4!==u||(a.status=bt),1===u||3===u)return 0===t.avail_out&&(a.last_flush=-1),tt;if(2===u&&(e===J?W(a):e!==$&&(Y(a,0,0,!1),e===Q&&(vt(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),xt(t),0===t.avail_out))return a.last_flush=-1,tt}return e!==V?tt:a.wrap<=0?et:(2===a.wrap?(At(a,255&t.adler),At(a,t.adler>>8&255),At(a,t.adler>>16&255),At(a,t.adler>>24&255),At(a,255&t.total_in),At(a,t.total_in>>8&255),At(a,t.total_in>>16&255),At(a,t.total_in>>24&255)):(Et(a,t.adler>>>16),Et(a,65535&t.adler)),xt(t),a.wrap>0&&(a.wrap=-a.wrap),0!==a.pending?tt:et)},deflateEnd:function(t){if(Lt(t))return at;var e=t.state.status;return t.state=null,e===mt?gt(t,nt):tt},deflateSetDictionary:function(t,e){var a=e.length;if(Lt(t))return at;var n=t.state,i=n.wrap;if(2===i||1===i&&n.status!==wt||n.lookahead)return at;if(1===i&&(t.adler=C(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===i&&(vt(n.head),n.strstart=0,n.block_start=0,n.insert=0);var r=new Uint8Array(n.w_size);r.set(e.subarray(a-n.w_size,a),0),e=r,a=n.w_size}var s=t.avail_in,o=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,St(n);n.lookahead>=3;){var h=n.strstart,d=n.lookahead-2;do{n.ins_h=yt(n,n.ins_h,n.window[h+3-1]),n.prev[h&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=h,h++}while(--d);n.strstart=h,n.lookahead=2,St(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=o,t.input=l,t.avail_in=s,n.wrap=i,tt},deflateInfo:"pako deflate (from Nodeca project)"};function Ht(t){return Ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ht(t)}var jt=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},Kt=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var a=e.shift();if(a){if("object"!==Ht(a))throw new TypeError(a+"must be non-object");for(var n in a)jt(a,n)&&(t[n]=a[n])}}return t},Pt=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var i=new Uint8Array(e),r=0,s=0,o=t.length;r<o;r++){var l=t[r];i.set(l,s),s+=l.length}return i},Yt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Yt=!1}for(var Gt=new Uint8Array(256),Xt=0;Xt<256;Xt++)Gt[Xt]=Xt>=252?6:Xt>=248?5:Xt>=240?4:Xt>=224?3:Xt>=192?2:1;Gt[254]=Gt[254]=1;var Wt=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);var e,a,n,i,r,s=t.length,o=0;for(i=0;i<s;i++)55296==(64512&(a=t.charCodeAt(i)))&&i+1<s&&56320==(64512&(n=t.charCodeAt(i+1)))&&(a=65536+(a-55296<<10)+(n-56320),i++),o+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(o),r=0,i=0;r<o;i++)55296==(64512&(a=t.charCodeAt(i)))&&i+1<s&&56320==(64512&(n=t.charCodeAt(i+1)))&&(a=65536+(a-55296<<10)+(n-56320),i++),a<128?e[r++]=a:a<2048?(e[r++]=192|a>>>6,e[r++]=128|63&a):a<65536?(e[r++]=224|a>>>12,e[r++]=128|a>>>6&63,e[r++]=128|63&a):(e[r++]=240|a>>>18,e[r++]=128|a>>>12&63,e[r++]=128|a>>>6&63,e[r++]=128|63&a);return e},qt=function(t,e){var a,n,i=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));var r=new Array(2*i);for(n=0,a=0;a<i;){var s=t[a++];if(s<128)r[n++]=s;else{var o=Gt[s];if(o>4)r[n++]=65533,a+=o-1;else{for(s&=2===o?31:3===o?15:7;o>1&&a<i;)s=s<<6|63&t[a++],o--;o>1?r[n++]=65533:s<65536?r[n++]=s:(s-=65536,r[n++]=55296|s>>10&1023,r[n++]=56320|1023&s)}}}return function(t,e){if(e<65534&&t.subarray&&Yt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));for(var a="",n=0;n<e;n++)a+=String.fromCharCode(t[n]);return a}(r,n)},Jt=function(t,e){(e=e||t.length)>t.length&&(e=t.length);for(var a=e-1;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+Gt[t[a]]>e?a:e};var Qt=function(){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},Vt=Object.prototype.toString,$t=K.Z_NO_FLUSH,te=K.Z_SYNC_FLUSH,ee=K.Z_FULL_FLUSH,ae=K.Z_FINISH,ne=K.Z_OK,ie=K.Z_STREAM_END,re=K.Z_DEFAULT_COMPRESSION,se=K.Z_DEFAULT_STRATEGY,oe=K.Z_DEFLATED;function le(t){this.options=Kt({level:re,method:oe,chunkSize:16384,windowBits:15,memLevel:8,strategy:se},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Qt,this.strm.avail_out=0;var a=Mt.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==ne)throw new Error(j[a]);if(e.header&&Mt.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(n="string"==typeof e.dictionary?Wt(e.dictionary):"[object ArrayBuffer]"===Vt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(a=Mt.deflateSetDictionary(this.strm,n))!==ne)throw new Error(j[a]);this._dict_set=!0}}function he(t,e){var a=new le(e);if(a.push(t,!0),a.err)throw a.msg||j[a.err];return a.result}le.prototype.push=function(t,e){var a,n,i=this.strm,r=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?ae:$t,"string"==typeof t?i.input=Wt(t):"[object ArrayBuffer]"===Vt.call(t)?i.input=new Uint8Array(t):i.input=t,i.next_in=0,i.avail_in=i.input.length;;)if(0===i.avail_out&&(i.output=new Uint8Array(r),i.next_out=0,i.avail_out=r),(n===te||n===ee)&&i.avail_out<=6)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else{if((a=Mt.deflate(i,n))===ie)return i.next_out>0&&this.onData(i.output.subarray(0,i.next_out)),a=Mt.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===ne;if(0!==i.avail_out){if(n>0&&i.next_out>0)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else if(0===i.avail_in)break}else this.onData(i.output)}return!0},le.prototype.onData=function(t){this.chunks.push(t)},le.prototype.onEnd=function(t){t===ne&&(this.result=Pt(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var de={Deflate:le,deflate:he,deflateRaw:function(t,e){return(e=e||{}).raw=!0,he(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,he(t,e)},constants:K},_e=16209,fe=function(t,e){var a,n,i,r,s,o,l,h,d,_,f,u,c,w,m,b,g,p,v,k,y,x,z,A,E=t.state;a=t.next_in,z=t.input,n=a+(t.avail_in-5),i=t.next_out,A=t.output,r=i-(e-t.avail_out),s=i+(t.avail_out-257),o=E.dmax,l=E.wsize,h=E.whave,d=E.wnext,_=E.window,f=E.hold,u=E.bits,c=E.lencode,w=E.distcode,m=(1<<E.lenbits)-1,b=(1<<E.distbits)-1;t:do{u<15&&(f+=z[a++]<<u,u+=8,f+=z[a++]<<u,u+=8),g=c[f&m];e:for(;;){if(f>>>=p=g>>>24,u-=p,0===(p=g>>>16&255))A[i++]=65535&g;else{if(!(16&p)){if(0==(64&p)){g=c[(65535&g)+(f&(1<<p)-1)];continue e}if(32&p){E.mode=16191;break t}t.msg="invalid literal/length code",E.mode=_e;break t}v=65535&g,(p&=15)&&(u<p&&(f+=z[a++]<<u,u+=8),v+=f&(1<<p)-1,f>>>=p,u-=p),u<15&&(f+=z[a++]<<u,u+=8,f+=z[a++]<<u,u+=8),g=w[f&b];a:for(;;){if(f>>>=p=g>>>24,u-=p,!(16&(p=g>>>16&255))){if(0==(64&p)){g=w[(65535&g)+(f&(1<<p)-1)];continue a}t.msg="invalid distance code",E.mode=_e;break t}if(k=65535&g,u<(p&=15)&&(f+=z[a++]<<u,(u+=8)<p&&(f+=z[a++]<<u,u+=8)),(k+=f&(1<<p)-1)>o){t.msg="invalid distance too far back",E.mode=_e;break t}if(f>>>=p,u-=p,k>(p=i-r)){if((p=k-p)>h&&E.sane){t.msg="invalid distance too far back",E.mode=_e;break t}if(y=0,x=_,0===d){if(y+=l-p,p<v){v-=p;do{A[i++]=_[y++]}while(--p);y=i-k,x=A}}else if(d<p){if(y+=l+d-p,(p-=d)<v){v-=p;do{A[i++]=_[y++]}while(--p);if(y=0,d<v){v-=p=d;do{A[i++]=_[y++]}while(--p);y=i-k,x=A}}}else if(y+=d-p,p<v){v-=p;do{A[i++]=_[y++]}while(--p);y=i-k,x=A}for(;v>2;)A[i++]=x[y++],A[i++]=x[y++],A[i++]=x[y++],v-=3;v&&(A[i++]=x[y++],v>1&&(A[i++]=x[y++]))}else{y=i-k;do{A[i++]=A[y++],A[i++]=A[y++],A[i++]=A[y++],v-=3}while(v>2);v&&(A[i++]=A[y++],v>1&&(A[i++]=A[y++]))}break}}break}}while(a<n&&i<s);a-=v=u>>3,f&=(1<<(u-=v<<3))-1,t.next_in=a,t.next_out=i,t.avail_in=a<n?n-a+5:5-(a-n),t.avail_out=i<s?s-i+257:257-(i-s),E.hold=f,E.bits=u},ue=15,ce=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),we=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),me=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),be=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),ge=function(t,e,a,n,i,r,s,o){var l,h,d,_,f,u,c,w,m,b=o.bits,g=0,p=0,v=0,k=0,y=0,x=0,z=0,A=0,E=0,R=0,Z=null,S=new Uint16Array(16),U=new Uint16Array(16),D=null;for(g=0;g<=ue;g++)S[g]=0;for(p=0;p<n;p++)S[e[a+p]]++;for(y=b,k=ue;k>=1&&0===S[k];k--);if(y>k&&(y=k),0===k)return i[r++]=20971520,i[r++]=20971520,o.bits=1,0;for(v=1;v<k&&0===S[v];v++);for(y<v&&(y=v),A=1,g=1;g<=ue;g++)if(A<<=1,(A-=S[g])<0)return-1;if(A>0&&(0===t||1!==k))return-1;for(U[1]=0,g=1;g<ue;g++)U[g+1]=U[g]+S[g];for(p=0;p<n;p++)0!==e[a+p]&&(s[U[e[a+p]]++]=p);if(0===t?(Z=D=s,u=20):1===t?(Z=ce,D=we,u=257):(Z=me,D=be,u=0),R=0,p=0,g=v,f=r,x=y,z=0,d=-1,_=(E=1<<y)-1,1===t&&E>852||2===t&&E>592)return 1;for(;;){c=g-z,s[p]+1<u?(w=0,m=s[p]):s[p]>=u?(w=D[s[p]-u],m=Z[s[p]-u]):(w=96,m=0),l=1<<g-z,v=h=1<<x;do{i[f+(R>>z)+(h-=l)]=c<<24|w<<16|m|0}while(0!==h);for(l=1<<g-1;R&l;)l>>=1;if(0!==l?(R&=l-1,R+=l):R=0,p++,0==--S[g]){if(g===k)break;g=e[a+s[p]]}if(g>y&&(R&_)!==d){for(0===z&&(z=y),f+=v,A=1<<(x=g-z);x+z<k&&!((A-=S[x+z])<=0);)x++,A<<=1;if(E+=1<<x,1===t&&E>852||2===t&&E>592)return 1;i[d=R&_]=y<<24|x<<16|f-r|0}}return 0!==R&&(i[f+R]=g-z<<24|64<<16|0),o.bits=y,0},pe=K.Z_FINISH,ve=K.Z_BLOCK,ke=K.Z_TREES,ye=K.Z_OK,xe=K.Z_STREAM_END,ze=K.Z_NEED_DICT,Ae=K.Z_STREAM_ERROR,Ee=K.Z_DATA_ERROR,Re=K.Z_MEM_ERROR,Ze=K.Z_BUF_ERROR,Se=K.Z_DEFLATED,Ue=16180,De=16190,Te=16191,Oe=16192,Ie=16194,Fe=16199,Le=16200,Ne=16206,Be=16209,Ce=function(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)};function Me(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var He,je,Ke=function(t){if(!t)return 1;var e=t.state;return!e||e.strm!==t||e.mode<Ue||e.mode>16211?1:0},Pe=function(t){if(Ke(t))return Ae;var e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=Ue,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,ye},Ye=function(t){if(Ke(t))return Ae;var e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Pe(t)},Ge=function(t,e){var a;if(Ke(t))return Ae;var n=t.state;return e<0?(a=0,e=-e):(a=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?Ae:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=a,n.wbits=e,Ye(t))},Xe=function(t,e){if(!t)return Ae;var a=new Me;t.state=a,a.strm=t,a.window=null,a.mode=Ue;var n=Ge(t,e);return n!==ye&&(t.state=null),n},We=!0,qe=function(t){if(We){He=new Int32Array(512),je=new Int32Array(32);for(var e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ge(1,t.lens,0,288,He,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ge(2,t.lens,0,32,je,0,t.work,{bits:5}),We=!1}t.lencode=He,t.lenbits=9,t.distcode=je,t.distbits=5},Je=function(t,e,a,n){var i,r=t.state;return null===r.window&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new Uint8Array(r.wsize)),n>=r.wsize?(r.window.set(e.subarray(a-r.wsize,a),0),r.wnext=0,r.whave=r.wsize):((i=r.wsize-r.wnext)>n&&(i=n),r.window.set(e.subarray(a-n,a-n+i),r.wnext),(n-=i)?(r.window.set(e.subarray(a-n,a),0),r.wnext=n,r.whave=r.wsize):(r.wnext+=i,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=i))),0},Qe={inflateReset:Ye,inflateReset2:Ge,inflateResetKeep:Pe,inflateInit:function(t){return Xe(t,15)},inflateInit2:Xe,inflate:function(t,e){var a,n,i,r,s,o,l,h,d,_,f,u,c,w,m,b,g,p,v,k,y,x,z,A,E=0,R=new Uint8Array(4),Z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Ke(t)||!t.output||!t.input&&0!==t.avail_in)return Ae;(a=t.state).mode===Te&&(a.mode=Oe),s=t.next_out,i=t.output,l=t.avail_out,r=t.next_in,n=t.input,o=t.avail_in,h=a.hold,d=a.bits,_=o,f=l,x=ye;t:for(;;)switch(a.mode){case Ue:if(0===a.wrap){a.mode=Oe;break}for(;d<16;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(2&a.wrap&&35615===h){0===a.wbits&&(a.wbits=15),a.check=0,R[0]=255&h,R[1]=h>>>8&255,a.check=H(a.check,R,2,0),h=0,d=0,a.mode=16181;break}if(a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",a.mode=Be;break}if((15&h)!==Se){t.msg="unknown compression method",a.mode=Be;break}if(d-=4,y=8+(15&(h>>>=4)),0===a.wbits&&(a.wbits=y),y>15||y>a.wbits){t.msg="invalid window size",a.mode=Be;break}a.dmax=1<<a.wbits,a.flags=0,t.adler=a.check=1,a.mode=512&h?16189:Te,h=0,d=0;break;case 16181:for(;d<16;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(a.flags=h,(255&a.flags)!==Se){t.msg="unknown compression method",a.mode=Be;break}if(57344&a.flags){t.msg="unknown header flags set",a.mode=Be;break}a.head&&(a.head.text=h>>8&1),512&a.flags&&4&a.wrap&&(R[0]=255&h,R[1]=h>>>8&255,a.check=H(a.check,R,2,0)),h=0,d=0,a.mode=16182;case 16182:for(;d<32;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}a.head&&(a.head.time=h),512&a.flags&&4&a.wrap&&(R[0]=255&h,R[1]=h>>>8&255,R[2]=h>>>16&255,R[3]=h>>>24&255,a.check=H(a.check,R,4,0)),h=0,d=0,a.mode=16183;case 16183:for(;d<16;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}a.head&&(a.head.xflags=255&h,a.head.os=h>>8),512&a.flags&&4&a.wrap&&(R[0]=255&h,R[1]=h>>>8&255,a.check=H(a.check,R,2,0)),h=0,d=0,a.mode=16184;case 16184:if(1024&a.flags){for(;d<16;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}a.length=h,a.head&&(a.head.extra_len=h),512&a.flags&&4&a.wrap&&(R[0]=255&h,R[1]=h>>>8&255,a.check=H(a.check,R,2,0)),h=0,d=0}else a.head&&(a.head.extra=null);a.mode=16185;case 16185:if(1024&a.flags&&((u=a.length)>o&&(u=o),u&&(a.head&&(y=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(n.subarray(r,r+u),y)),512&a.flags&&4&a.wrap&&(a.check=H(a.check,n,u,r)),o-=u,r+=u,a.length-=u),a.length))break t;a.length=0,a.mode=16186;case 16186:if(2048&a.flags){if(0===o)break t;u=0;do{y=n[r+u++],a.head&&y&&a.length<65536&&(a.head.name+=String.fromCharCode(y))}while(y&&u<o);if(512&a.flags&&4&a.wrap&&(a.check=H(a.check,n,u,r)),o-=u,r+=u,y)break t}else a.head&&(a.head.name=null);a.length=0,a.mode=16187;case 16187:if(4096&a.flags){if(0===o)break t;u=0;do{y=n[r+u++],a.head&&y&&a.length<65536&&(a.head.comment+=String.fromCharCode(y))}while(y&&u<o);if(512&a.flags&&4&a.wrap&&(a.check=H(a.check,n,u,r)),o-=u,r+=u,y)break t}else a.head&&(a.head.comment=null);a.mode=16188;case 16188:if(512&a.flags){for(;d<16;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(4&a.wrap&&h!==(65535&a.check)){t.msg="header crc mismatch",a.mode=Be;break}h=0,d=0}a.head&&(a.head.hcrc=a.flags>>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=Te;break;case 16189:for(;d<32;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}t.adler=a.check=Ce(h),h=0,d=0,a.mode=De;case De:if(0===a.havedict)return t.next_out=s,t.avail_out=l,t.next_in=r,t.avail_in=o,a.hold=h,a.bits=d,ze;t.adler=a.check=1,a.mode=Te;case Te:if(e===ve||e===ke)break t;case Oe:if(a.last){h>>>=7&d,d-=7&d,a.mode=Ne;break}for(;d<3;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}switch(a.last=1&h,d-=1,3&(h>>>=1)){case 0:a.mode=16193;break;case 1:if(qe(a),a.mode=Fe,e===ke){h>>>=2,d-=2;break t}break;case 2:a.mode=16196;break;case 3:t.msg="invalid block type",a.mode=Be}h>>>=2,d-=2;break;case 16193:for(h>>>=7&d,d-=7&d;d<32;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if((65535&h)!=(h>>>16^65535)){t.msg="invalid stored block lengths",a.mode=Be;break}if(a.length=65535&h,h=0,d=0,a.mode=Ie,e===ke)break t;case Ie:a.mode=16195;case 16195:if(u=a.length){if(u>o&&(u=o),u>l&&(u=l),0===u)break t;i.set(n.subarray(r,r+u),s),o-=u,r+=u,l-=u,s+=u,a.length-=u;break}a.mode=Te;break;case 16196:for(;d<14;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(a.nlen=257+(31&h),h>>>=5,d-=5,a.ndist=1+(31&h),h>>>=5,d-=5,a.ncode=4+(15&h),h>>>=4,d-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=Be;break}a.have=0,a.mode=16197;case 16197:for(;a.have<a.ncode;){for(;d<3;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}a.lens[Z[a.have++]]=7&h,h>>>=3,d-=3}for(;a.have<19;)a.lens[Z[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,z={bits:a.lenbits},x=ge(0,a.lens,0,19,a.lencode,0,a.work,z),a.lenbits=z.bits,x){t.msg="invalid code lengths set",a.mode=Be;break}a.have=0,a.mode=16198;case 16198:for(;a.have<a.nlen+a.ndist;){for(;b=(E=a.lencode[h&(1<<a.lenbits)-1])>>>16&255,g=65535&E,!((m=E>>>24)<=d);){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(g<16)h>>>=m,d-=m,a.lens[a.have++]=g;else{if(16===g){for(A=m+2;d<A;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(h>>>=m,d-=m,0===a.have){t.msg="invalid bit length repeat",a.mode=Be;break}y=a.lens[a.have-1],u=3+(3&h),h>>>=2,d-=2}else if(17===g){for(A=m+3;d<A;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}d-=m,y=0,u=3+(7&(h>>>=m)),h>>>=3,d-=3}else{for(A=m+7;d<A;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}d-=m,y=0,u=11+(127&(h>>>=m)),h>>>=7,d-=7}if(a.have+u>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=Be;break}for(;u--;)a.lens[a.have++]=y}}if(a.mode===Be)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=Be;break}if(a.lenbits=9,z={bits:a.lenbits},x=ge(1,a.lens,0,a.nlen,a.lencode,0,a.work,z),a.lenbits=z.bits,x){t.msg="invalid literal/lengths set",a.mode=Be;break}if(a.distbits=6,a.distcode=a.distdyn,z={bits:a.distbits},x=ge(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,z),a.distbits=z.bits,x){t.msg="invalid distances set",a.mode=Be;break}if(a.mode=Fe,e===ke)break t;case Fe:a.mode=Le;case Le:if(o>=6&&l>=258){t.next_out=s,t.avail_out=l,t.next_in=r,t.avail_in=o,a.hold=h,a.bits=d,fe(t,f),s=t.next_out,i=t.output,l=t.avail_out,r=t.next_in,n=t.input,o=t.avail_in,h=a.hold,d=a.bits,a.mode===Te&&(a.back=-1);break}for(a.back=0;b=(E=a.lencode[h&(1<<a.lenbits)-1])>>>16&255,g=65535&E,!((m=E>>>24)<=d);){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(b&&0==(240&b)){for(p=m,v=b,k=g;b=(E=a.lencode[k+((h&(1<<p+v)-1)>>p)])>>>16&255,g=65535&E,!(p+(m=E>>>24)<=d);){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}h>>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,a.length=g,0===b){a.mode=16205;break}if(32&b){a.back=-1,a.mode=Te;break}if(64&b){t.msg="invalid literal/length code",a.mode=Be;break}a.extra=15&b,a.mode=16201;case 16201:if(a.extra){for(A=a.extra;d<A;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}a.length+=h&(1<<a.extra)-1,h>>>=a.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=16202;case 16202:for(;b=(E=a.distcode[h&(1<<a.distbits)-1])>>>16&255,g=65535&E,!((m=E>>>24)<=d);){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(0==(240&b)){for(p=m,v=b,k=g;b=(E=a.distcode[k+((h&(1<<p+v)-1)>>p)])>>>16&255,g=65535&E,!(p+(m=E>>>24)<=d);){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}h>>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,64&b){t.msg="invalid distance code",a.mode=Be;break}a.offset=g,a.extra=15&b,a.mode=16203;case 16203:if(a.extra){for(A=a.extra;d<A;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}a.offset+=h&(1<<a.extra)-1,h>>>=a.extra,d-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=Be;break}a.mode=16204;case 16204:if(0===l)break t;if(u=f-l,a.offset>u){if((u=a.offset-u)>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=Be;break}u>a.wnext?(u-=a.wnext,c=a.wsize-u):c=a.wnext-u,u>a.length&&(u=a.length),w=a.window}else w=i,c=s-a.offset,u=a.length;u>l&&(u=l),l-=u,a.length-=u;do{i[s++]=w[c++]}while(--u);0===a.length&&(a.mode=Le);break;case 16205:if(0===l)break t;i[s++]=a.length,l--,a.mode=Le;break;case Ne:if(a.wrap){for(;d<32;){if(0===o)break t;o--,h|=n[r++]<<d,d+=8}if(f-=l,t.total_out+=f,a.total+=f,4&a.wrap&&f&&(t.adler=a.check=a.flags?H(a.check,i,f,s-f):C(a.check,i,f,s-f)),f=l,4&a.wrap&&(a.flags?h:Ce(h))!==a.check){t.msg="incorrect data check",a.mode=Be;break}h=0,d=0}a.mode=16207;case 16207:if(a.wrap&&a.flags){for(;d<32;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(4&a.wrap&&h!==(4294967295&a.total)){t.msg="incorrect length check",a.mode=Be;break}h=0,d=0}a.mode=16208;case 16208:x=xe;break t;case Be:x=Ee;break t;case 16210:return Re;default:return Ae}return t.next_out=s,t.avail_out=l,t.next_in=r,t.avail_in=o,a.hold=h,a.bits=d,(a.wsize||f!==t.avail_out&&a.mode<Be&&(a.mode<Ne||e!==pe))&&Je(t,t.output,t.next_out,f-t.avail_out),_-=t.avail_in,f-=t.avail_out,t.total_in+=_,t.total_out+=f,a.total+=f,4&a.wrap&&f&&(t.adler=a.check=a.flags?H(a.check,i,f,t.next_out-f):C(a.check,i,f,t.next_out-f)),t.data_type=a.bits+(a.last?64:0)+(a.mode===Te?128:0)+(a.mode===Fe||a.mode===Ie?256:0),(0===_&&0===f||e===pe)&&x===ye&&(x=Ze),x},inflateEnd:function(t){if(Ke(t))return Ae;var e=t.state;return e.window&&(e.window=null),t.state=null,ye},inflateGetHeader:function(t,e){if(Ke(t))return Ae;var a=t.state;return 0==(2&a.wrap)?Ae:(a.head=e,e.done=!1,ye)},inflateSetDictionary:function(t,e){var a,n=e.length;return Ke(t)||0!==(a=t.state).wrap&&a.mode!==De?Ae:a.mode===De&&C(1,e,n,0)!==a.check?Ee:Je(t,e,n,n)?(a.mode=16210,Re):(a.havedict=1,ye)},inflateInfo:"pako inflate (from Nodeca project)"};var Ve=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},$e=Object.prototype.toString,ta=K.Z_NO_FLUSH,ea=K.Z_FINISH,aa=K.Z_OK,na=K.Z_STREAM_END,ia=K.Z_NEED_DICT,ra=K.Z_STREAM_ERROR,sa=K.Z_DATA_ERROR,oa=K.Z_MEM_ERROR;function la(t){this.options=Kt({chunkSize:65536,windowBits:15,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Qt,this.strm.avail_out=0;var a=Qe.inflateInit2(this.strm,e.windowBits);if(a!==aa)throw new Error(j[a]);if(this.header=new Ve,Qe.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Wt(e.dictionary):"[object ArrayBuffer]"===$e.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=Qe.inflateSetDictionary(this.strm,e.dictionary))!==aa))throw new Error(j[a])}function ha(t,e){var a=new la(e);if(a.push(t),a.err)throw a.msg||j[a.err];return a.result}la.prototype.push=function(t,e){var a,n,i,r=this.strm,s=this.options.chunkSize,o=this.options.dictionary;if(this.ended)return!1;for(n=e===~~e?e:!0===e?ea:ta,"[object ArrayBuffer]"===$e.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(s),r.next_out=0,r.avail_out=s),(a=Qe.inflate(r,n))===ia&&o&&((a=Qe.inflateSetDictionary(r,o))===aa?a=Qe.inflate(r,n):a===sa&&(a=ia));r.avail_in>0&&a===na&&r.state.wrap>0&&0!==t[r.next_in];)Qe.inflateReset(r),a=Qe.inflate(r,n);switch(a){case ra:case sa:case ia:case oa:return this.onEnd(a),this.ended=!0,!1}if(i=r.avail_out,r.next_out&&(0===r.avail_out||a===na))if("string"===this.options.to){var l=Jt(r.output,r.next_out),h=r.next_out-l,d=qt(r.output,l);r.next_out=h,r.avail_out=s-h,h&&r.output.set(r.output.subarray(l,l+h),0),this.onData(d)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(a!==aa||0!==i){if(a===na)return a=Qe.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},la.prototype.onData=function(t){this.chunks.push(t)},la.prototype.onEnd=function(t){t===aa&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Pt(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var da={Inflate:la,inflate:ha,inflateRaw:function(t,e){return(e=e||{}).raw=!0,ha(t,e)},ungzip:ha,constants:K},_a=de.Deflate,fa=de.deflate,ua=de.deflateRaw,ca=de.gzip,wa=da.Inflate,ma=da.inflate,ba=da.inflateRaw,ga=da.ungzip,pa=K,va={Deflate:_a,deflate:fa,deflateRaw:ua,gzip:ca,Inflate:wa,inflate:ma,inflateRaw:ba,ungzip:ga,constants:pa};t.Deflate=_a,t.Inflate=wa,t.constants=pa,t.default=va,t.deflate=fa,t.deflateRaw=ua,t.gzip=ca,t.inflate=ma,t.inflateRaw=ba,t.ungzip=ga,Object.defineProperty(t,"__esModule",{value:!0})}));var rough=function(){"use strict";function t(t,e,s){if(t&&t.length){const[n,o]=e,a=Math.PI/180*s,h=Math.cos(a),r=Math.sin(a);for(const e of t){const[t,s]=e;e[0]=(t-n)*h-(s-o)*r+n,e[1]=(t-n)*r+(s-o)*h+o}}}function e(t,e){return t[0]===e[0]&&t[1]===e[1]}function s(s,n,o,a=1){const h=o,r=Math.max(n,.1),i=s[0]&&s[0][0]&&"number"==typeof s[0][0]?[s]:s,c=[0,0];if(h)for(const e of i)t(e,c,h);const l=function(t,s,n){const o=[];for(const s of t){const t=[...s];e(t[0],t[t.length-1])||t.push([t[0][0],t[0][1]]),t.length>2&&o.push(t)}const a=[];s=Math.max(s,.1);const h=[];for(const t of o)for(let e=0;e<t.length-1;e++){const s=t[e],n=t[e+1];if(s[1]!==n[1]){const t=Math.min(s[1],n[1]);h.push({ymin:t,ymax:Math.max(s[1],n[1]),x:t===s[1]?s[0]:n[0],islope:(n[0]-s[0])/(n[1]-s[1])})}}if(h.sort(((t,e)=>t.ymin<e.ymin?-1:t.ymin>e.ymin?1:t.x<e.x?-1:t.x>e.x?1:t.ymax===e.ymax?0:(t.ymax-e.ymax)/Math.abs(t.ymax-e.ymax))),!h.length)return a;let r=[],i=h[0].ymin,c=0;for(;r.length||h.length;){if(h.length){let t=-1;for(let e=0;e<h.length&&!(h[e].ymin>i);e++)t=e;h.splice(0,t+1).forEach((t=>{r.push({s:i,edge:t})}))}if(r=r.filter((t=>!(t.edge.ymax<=i))),r.sort(((t,e)=>t.edge.x===e.edge.x?0:(t.edge.x-e.edge.x)/Math.abs(t.edge.x-e.edge.x))),(1!==n||c%s==0)&&r.length>1)for(let t=0;t<r.length;t+=2){const e=t+1;if(e>=r.length)break;const s=r[t].edge,n=r[e].edge;a.push([[Math.round(s.x),i],[Math.round(n.x),i]])}i+=n,r.forEach((t=>{t.edge.x=t.edge.x+n*t.edge.islope})),c++}return a}(i,r,a);if(h){for(const e of i)t(e,c,-h);!function(e,s,n){const o=[];e.forEach((t=>o.push(...t))),t(o,s,n)}(l,c,-h)}return l}function n(t,e){var n;const o=e.hachureAngle+90;let a=e.hachureGap;a<0&&(a=4*e.strokeWidth),a=Math.round(Math.max(a,.1));let h=1;return e.roughness>=1&&((null===(n=e.randomizer)||void 0===n?void 0:n.next())||Math.random())>.7&&(h=a),s(t,a,o,h||1)}class o{constructor(t){this.helper=t}fillPolygons(t,e){return this._fillPolygons(t,e)}_fillPolygons(t,e){const s=n(t,e);return{type:"fillSketch",ops:this.renderLines(s,e)}}renderLines(t,e){const s=[];for(const n of t)s.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],e));return s}}function a(t){const e=t[0],s=t[1];return Math.sqrt(Math.pow(e[0]-s[0],2)+Math.pow(e[1]-s[1],2))}class h extends o{fillPolygons(t,e){let s=e.hachureGap;s<0&&(s=4*e.strokeWidth),s=Math.max(s,.1);const o=n(t,Object.assign({},e,{hachureGap:s})),h=Math.PI/180*e.hachureAngle,r=[],i=.5*s*Math.cos(h),c=.5*s*Math.sin(h);for(const[t,e]of o)a([t,e])&&r.push([[t[0]-i,t[1]+c],[...e]],[[t[0]+i,t[1]-c],[...e]]);return{type:"fillSketch",ops:this.renderLines(r,e)}}}class r extends o{fillPolygons(t,e){const s=this._fillPolygons(t,e),n=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),o=this._fillPolygons(t,n);return s.ops=s.ops.concat(o.ops),s}}class i{constructor(t){this.helper=t}fillPolygons(t,e){const s=n(t,e=Object.assign({},e,{hachureAngle:0}));return this.dotsOnLines(s,e)}dotsOnLines(t,e){const s=[];let n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.max(n,.1);let o=e.fillWeight;o<0&&(o=e.strokeWidth/2);const h=n/4;for(const r of t){const t=a(r),i=t/n,c=Math.ceil(i)-1,l=t-c*n,u=(r[0][0]+r[1][0])/2-n/4,p=Math.min(r[0][1],r[1][1]);for(let t=0;t<c;t++){const a=p+l+t*n,r=u-h+2*Math.random()*h,i=a-h+2*Math.random()*h,c=this.helper.ellipse(r,i,o,o,e);s.push(...c.ops)}}return{type:"fillSketch",ops:s}}}class c{constructor(t){this.helper=t}fillPolygons(t,e){const s=n(t,e);return{type:"fillSketch",ops:this.dashedLine(s,e)}}dashedLine(t,e){const s=e.dashOffset<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashOffset,n=e.dashGap<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashGap,o=[];return t.forEach((t=>{const h=a(t),r=Math.floor(h/(s+n)),i=(h+n-r*(s+n))/2;let c=t[0],l=t[1];c[0]>l[0]&&(c=t[1],l=t[0]);const u=Math.atan((l[1]-c[1])/(l[0]-c[0]));for(let t=0;t<r;t++){const a=t*(s+n),h=a+s,r=[c[0]+a*Math.cos(u)+i*Math.cos(u),c[1]+a*Math.sin(u)+i*Math.sin(u)],l=[c[0]+h*Math.cos(u)+i*Math.cos(u),c[1]+h*Math.sin(u)+i*Math.sin(u)];o.push(...this.helper.doubleLineOps(r[0],r[1],l[0],l[1],e))}})),o}}class l{constructor(t){this.helper=t}fillPolygons(t,e){const s=e.hachureGap<0?4*e.strokeWidth:e.hachureGap,o=e.zigzagOffset<0?s:e.zigzagOffset,a=n(t,e=Object.assign({},e,{hachureGap:s+o}));return{type:"fillSketch",ops:this.zigzagLines(a,o,e)}}zigzagLines(t,e,s){const n=[];return t.forEach((t=>{const o=a(t),h=Math.round(o/(2*e));let r=t[0],i=t[1];r[0]>i[0]&&(r=t[1],i=t[0]);const c=Math.atan((i[1]-r[1])/(i[0]-r[0]));for(let t=0;t<h;t++){const o=2*t*e,a=2*(t+1)*e,h=Math.sqrt(2*Math.pow(e,2)),i=[r[0]+o*Math.cos(c),r[1]+o*Math.sin(c)],l=[r[0]+a*Math.cos(c),r[1]+a*Math.sin(c)],u=[i[0]+h*Math.cos(c+Math.PI/4),i[1]+h*Math.sin(c+Math.PI/4)];n.push(...this.helper.doubleLineOps(i[0],i[1],u[0],u[1],s),...this.helper.doubleLineOps(u[0],u[1],l[0],l[1],s))}})),n}}const u={};class p{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const f=0,d=1,g=2,M={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function k(t,e){return t.type===e}function b(t){const e=[],s=function(t){const e=new Array;for(;""!==t;)if(t.match(/^([ \t\r\n,]+)/))t=t.substr(RegExp.$1.length);else if(t.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]={type:f,text:RegExp.$1},t=t.substr(RegExp.$1.length);else{if(!t.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];e[e.length]={type:d,text:`${parseFloat(RegExp.$1)}`},t=t.substr(RegExp.$1.length)}return e[e.length]={type:g,text:""},e}(t);let n="BOD",o=0,a=s[o];for(;!k(a,g);){let h=0;const r=[];if("BOD"===n){if("M"!==a.text&&"m"!==a.text)return b("M0,0"+t);o++,h=M[a.text],n=a.text}else k(a,d)?h=M[n]:(o++,h=M[a.text],n=a.text);if(!(o+h<s.length))throw new Error("Path data ended short");for(let t=o;t<o+h;t++){const e=s[t];if(!k(e,d))throw new Error("Param not a number: "+n+","+e.text);r[r.length]=+e.text}if("number"!=typeof M[n])throw new Error("Bad segment: "+n);{const t={key:n,data:r};e.push(t),o+=h,a=s[o],"M"===n&&(n="L"),"m"===n&&(n="l")}}return e}function y(t){let e=0,s=0,n=0,o=0;const a=[];for(const{key:h,data:r}of t)switch(h){case"M":a.push({key:"M",data:[...r]}),[e,s]=r,[n,o]=r;break;case"m":e+=r[0],s+=r[1],a.push({key:"M",data:[e,s]}),n=e,o=s;break;case"L":a.push({key:"L",data:[...r]}),[e,s]=r;break;case"l":e+=r[0],s+=r[1],a.push({key:"L",data:[e,s]});break;case"C":a.push({key:"C",data:[...r]}),e=r[4],s=r[5];break;case"c":{const t=r.map(((t,n)=>n%2?t+s:t+e));a.push({key:"C",data:t}),e=t[4],s=t[5];break}case"Q":a.push({key:"Q",data:[...r]}),e=r[2],s=r[3];break;case"q":{const t=r.map(((t,n)=>n%2?t+s:t+e));a.push({key:"Q",data:t}),e=t[2],s=t[3];break}case"A":a.push({key:"A",data:[...r]}),e=r[5],s=r[6];break;case"a":e+=r[5],s+=r[6],a.push({key:"A",data:[r[0],r[1],r[2],r[3],r[4],e,s]});break;case"H":a.push({key:"H",data:[...r]}),e=r[0];break;case"h":e+=r[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...r]}),s=r[0];break;case"v":s+=r[0],a.push({key:"V",data:[s]});break;case"S":a.push({key:"S",data:[...r]}),e=r[2],s=r[3];break;case"s":{const t=r.map(((t,n)=>n%2?t+s:t+e));a.push({key:"S",data:t}),e=t[2],s=t[3];break}case"T":a.push({key:"T",data:[...r]}),e=r[0],s=r[1];break;case"t":e+=r[0],s+=r[1],a.push({key:"T",data:[e,s]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=n,s=o}return a}function m(t){const e=[];let s="",n=0,o=0,a=0,h=0,r=0,i=0;for(const{key:c,data:l}of t){switch(c){case"M":e.push({key:"M",data:[...l]}),[n,o]=l,[a,h]=l;break;case"C":e.push({key:"C",data:[...l]}),n=l[4],o=l[5],r=l[2],i=l[3];break;case"L":e.push({key:"L",data:[...l]}),[n,o]=l;break;case"H":n=l[0],e.push({key:"L",data:[n,o]});break;case"V":o=l[0],e.push({key:"L",data:[n,o]});break;case"S":{let t=0,a=0;"C"===s||"S"===s?(t=n+(n-r),a=o+(o-i)):(t=n,a=o),e.push({key:"C",data:[t,a,...l]}),r=l[0],i=l[1],n=l[2],o=l[3];break}case"T":{const[t,a]=l;let h=0,c=0;"Q"===s||"T"===s?(h=n+(n-r),c=o+(o-i)):(h=n,c=o);const u=n+2*(h-n)/3,p=o+2*(c-o)/3,f=t+2*(h-t)/3,d=a+2*(c-a)/3;e.push({key:"C",data:[u,p,f,d,t,a]}),r=h,i=c,n=t,o=a;break}case"Q":{const[t,s,a,h]=l,c=n+2*(t-n)/3,u=o+2*(s-o)/3,p=a+2*(t-a)/3,f=h+2*(s-h)/3;e.push({key:"C",data:[c,u,p,f,a,h]}),r=t,i=s,n=a,o=h;break}case"A":{const t=Math.abs(l[0]),s=Math.abs(l[1]),a=l[2],h=l[3],r=l[4],i=l[5],c=l[6];if(0===t||0===s)e.push({key:"C",data:[n,o,i,c,i,c]}),n=i,o=c;else if(n!==i||o!==c){x(n,o,i,c,t,s,a,h,r).forEach((function(t){e.push({key:"C",data:t})})),n=i,o=c}break}case"Z":e.push({key:"Z",data:[]}),n=a,o=h}s=c}return e}function w(t,e,s){return[t*Math.cos(s)-e*Math.sin(s),t*Math.sin(s)+e*Math.cos(s)]}function x(t,e,s,n,o,a,h,r,i,c){const l=(u=h,Math.PI*u/180);var u;let p=[],f=0,d=0,g=0,M=0;if(c)[f,d,g,M]=c;else{[t,e]=w(t,e,-l),[s,n]=w(s,n,-l);const h=(t-s)/2,c=(e-n)/2;let u=h*h/(o*o)+c*c/(a*a);u>1&&(u=Math.sqrt(u),o*=u,a*=u);const p=o*o,k=a*a,b=p*k-p*c*c-k*h*h,y=p*c*c+k*h*h,m=(r===i?-1:1)*Math.sqrt(Math.abs(b/y));g=m*o*c/a+(t+s)/2,M=m*-a*h/o+(e+n)/2,f=Math.asin(parseFloat(((e-M)/a).toFixed(9))),d=Math.asin(parseFloat(((n-M)/a).toFixed(9))),t<g&&(f=Math.PI-f),s<g&&(d=Math.PI-d),f<0&&(f=2*Math.PI+f),d<0&&(d=2*Math.PI+d),i&&f>d&&(f-=2*Math.PI),!i&&d>f&&(d-=2*Math.PI)}let k=d-f;if(Math.abs(k)>120*Math.PI/180){const t=d,e=s,r=n;d=i&&d>f?f+120*Math.PI/180*1:f+120*Math.PI/180*-1,p=x(s=g+o*Math.cos(d),n=M+a*Math.sin(d),e,r,o,a,h,0,i,[d,t,g,M])}k=d-f;const b=Math.cos(f),y=Math.sin(f),m=Math.cos(d),P=Math.sin(d),v=Math.tan(k/4),S=4/3*o*v,O=4/3*a*v,L=[t,e],T=[t+S*y,e-O*b],D=[s+S*P,n-O*m],A=[s,n];if(T[0]=2*L[0]-T[0],T[1]=2*L[1]-T[1],c)return[T,D,A].concat(p);{p=[T,D,A].concat(p);const t=[];for(let e=0;e<p.length;e+=3){const s=w(p[e][0],p[e][1],l),n=w(p[e+1][0],p[e+1][1],l),o=w(p[e+2][0],p[e+2][1],l);t.push([s[0],s[1],n[0],n[1],o[0],o[1]])}return t}}const P={randOffset:function(t,e){return G(t,e)},randOffsetWithRange:function(t,e,s){return E(t,e,s)},ellipse:function(t,e,s,n,o){const a=T(s,n,o);return D(t,e,o,a).opset},doubleLineOps:function(t,e,s,n,o){return $(t,e,s,n,o,!0)}};function v(t,e,s,n,o){return{type:"path",ops:$(t,e,s,n,o)}}function S(t,e,s){const n=(t||[]).length;if(n>2){const o=[];for(let e=0;e<n-1;e++)o.push(...$(t[e][0],t[e][1],t[e+1][0],t[e+1][1],s));return e&&o.push(...$(t[n-1][0],t[n-1][1],t[0][0],t[0][1],s)),{type:"path",ops:o}}return 2===n?v(t[0][0],t[0][1],t[1][0],t[1][1],s):{type:"path",ops:[]}}function O(t,e,s,n,o){return function(t,e){return S(t,!0,e)}([[t,e],[t+s,e],[t+s,e+n],[t,e+n]],o)}function L(t,e){if(t.length){const s="number"==typeof t[0][0]?[t]:t,n=j(s[0],1*(1+.2*e.roughness),e),o=e.disableMultiStroke?[]:j(s[0],1.5*(1+.22*e.roughness),z(e));for(let t=1;t<s.length;t++){const a=s[t];if(a.length){const t=j(a,1*(1+.2*e.roughness),e),s=e.disableMultiStroke?[]:j(a,1.5*(1+.22*e.roughness),z(e));for(const e of t)"move"!==e.op&&n.push(e);for(const t of s)"move"!==t.op&&o.push(t)}}return{type:"path",ops:n.concat(o)}}return{type:"path",ops:[]}}function T(t,e,s){const n=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(t/2,2)+Math.pow(e/2,2))/2)),o=Math.ceil(Math.max(s.curveStepCount,s.curveStepCount/Math.sqrt(200)*n)),a=2*Math.PI/o;let h=Math.abs(t/2),r=Math.abs(e/2);const i=1-s.curveFitting;return h+=G(h*i,s),r+=G(r*i,s),{increment:a,rx:h,ry:r}}function D(t,e,s,n){const[o,a]=F(n.increment,t,e,n.rx,n.ry,1,n.increment*E(.1,E(.4,1,s),s),s);let h=q(o,null,s);if(!s.disableMultiStroke&&0!==s.roughness){const[o]=F(n.increment,t,e,n.rx,n.ry,1.5,0,s),a=q(o,null,s);h=h.concat(a)}return{estimatedPoints:a,opset:{type:"path",ops:h}}}function A(t,e,s,n,o,a,h,r,i){const c=t,l=e;let u=Math.abs(s/2),p=Math.abs(n/2);u+=G(.01*u,i),p+=G(.01*p,i);let f=o,d=a;for(;f<0;)f+=2*Math.PI,d+=2*Math.PI;d-f>2*Math.PI&&(f=0,d=2*Math.PI);const g=2*Math.PI/i.curveStepCount,M=Math.min(g/2,(d-f)/2),k=V(M,c,l,u,p,f,d,1,i);if(!i.disableMultiStroke){const t=V(M,c,l,u,p,f,d,1.5,i);k.push(...t)}return h&&(r?k.push(...$(c,l,c+u*Math.cos(f),l+p*Math.sin(f),i),...$(c,l,c+u*Math.cos(d),l+p*Math.sin(d),i)):k.push({op:"lineTo",data:[c,l]},{op:"lineTo",data:[c+u*Math.cos(f),l+p*Math.sin(f)]})),{type:"path",ops:k}}function _(t,e){const s=m(y(b(t))),n=[];let o=[0,0],a=[0,0];for(const{key:t,data:h}of s)switch(t){case"M":a=[h[0],h[1]],o=[h[0],h[1]];break;case"L":n.push(...$(a[0],a[1],h[0],h[1],e)),a=[h[0],h[1]];break;case"C":{const[t,s,o,r,i,c]=h;n.push(...Z(t,s,o,r,i,c,a,e)),a=[i,c];break}case"Z":n.push(...$(a[0],a[1],o[0],o[1],e)),a=[o[0],o[1]]}return{type:"path",ops:n}}function I(t,e){const s=[];for(const n of t)if(n.length){const t=e.maxRandomnessOffset||0,o=n.length;if(o>2){s.push({op:"move",data:[n[0][0]+G(t,e),n[0][1]+G(t,e)]});for(let a=1;a<o;a++)s.push({op:"lineTo",data:[n[a][0]+G(t,e),n[a][1]+G(t,e)]})}}return{type:"fillPath",ops:s}}function C(t,e){return function(t,e){let s=t.fillStyle||"hachure";if(!u[s])switch(s){case"zigzag":u[s]||(u[s]=new h(e));break;case"cross-hatch":u[s]||(u[s]=new r(e));break;case"dots":u[s]||(u[s]=new i(e));break;case"dashed":u[s]||(u[s]=new c(e));break;case"zigzag-line":u[s]||(u[s]=new l(e));break;default:s="hachure",u[s]||(u[s]=new o(e))}return u[s]}(e,P).fillPolygons(t,e)}function z(t){const e=Object.assign({},t);return e.randomizer=void 0,t.seed&&(e.seed=t.seed+1),e}function W(t){return t.randomizer||(t.randomizer=new p(t.seed||0)),t.randomizer.next()}function E(t,e,s,n=1){return s.roughness*n*(W(s)*(e-t)+t)}function G(t,e,s=1){return E(-t,t,e,s)}function $(t,e,s,n,o,a=!1){const h=a?o.disableMultiStrokeFill:o.disableMultiStroke,r=R(t,e,s,n,o,!0,!1);if(h)return r;const i=R(t,e,s,n,o,!0,!0);return r.concat(i)}function R(t,e,s,n,o,a,h){const r=Math.pow(t-s,2)+Math.pow(e-n,2),i=Math.sqrt(r);let c=1;c=i<200?1:i>500?.4:-.0016668*i+1.233334;let l=o.maxRandomnessOffset||0;l*l*100>r&&(l=i/10);const u=l/2,p=.2+.2*W(o);let f=o.bowing*o.maxRandomnessOffset*(n-e)/200,d=o.bowing*o.maxRandomnessOffset*(t-s)/200;f=G(f,o,c),d=G(d,o,c);const g=[],M=()=>G(u,o,c),k=()=>G(l,o,c),b=o.preserveVertices;return a&&(h?g.push({op:"move",data:[t+(b?0:M()),e+(b?0:M())]}):g.push({op:"move",data:[t+(b?0:G(l,o,c)),e+(b?0:G(l,o,c))]})),h?g.push({op:"bcurveTo",data:[f+t+(s-t)*p+M(),d+e+(n-e)*p+M(),f+t+2*(s-t)*p+M(),d+e+2*(n-e)*p+M(),s+(b?0:M()),n+(b?0:M())]}):g.push({op:"bcurveTo",data:[f+t+(s-t)*p+k(),d+e+(n-e)*p+k(),f+t+2*(s-t)*p+k(),d+e+2*(n-e)*p+k(),s+(b?0:k()),n+(b?0:k())]}),g}function j(t,e,s){if(!t.length)return[];const n=[];n.push([t[0][0]+G(e,s),t[0][1]+G(e,s)]),n.push([t[0][0]+G(e,s),t[0][1]+G(e,s)]);for(let o=1;o<t.length;o++)n.push([t[o][0]+G(e,s),t[o][1]+G(e,s)]),o===t.length-1&&n.push([t[o][0]+G(e,s),t[o][1]+G(e,s)]);return q(n,null,s)}function q(t,e,s){const n=t.length,o=[];if(n>3){const a=[],h=1-s.curveTightness;o.push({op:"move",data:[t[1][0],t[1][1]]});for(let e=1;e+2<n;e++){const s=t[e];a[0]=[s[0],s[1]],a[1]=[s[0]+(h*t[e+1][0]-h*t[e-1][0])/6,s[1]+(h*t[e+1][1]-h*t[e-1][1])/6],a[2]=[t[e+1][0]+(h*t[e][0]-h*t[e+2][0])/6,t[e+1][1]+(h*t[e][1]-h*t[e+2][1])/6],a[3]=[t[e+1][0],t[e+1][1]],o.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(e&&2===e.length){const t=s.maxRandomnessOffset;o.push({op:"lineTo",data:[e[0]+G(t,s),e[1]+G(t,s)]})}}else 3===n?(o.push({op:"move",data:[t[1][0],t[1][1]]}),o.push({op:"bcurveTo",data:[t[1][0],t[1][1],t[2][0],t[2][1],t[2][0],t[2][1]]})):2===n&&o.push(...R(t[0][0],t[0][1],t[1][0],t[1][1],s,!0,!0));return o}function F(t,e,s,n,o,a,h,r){const i=[],c=[];if(0===r.roughness){t/=4,c.push([e+n*Math.cos(-t),s+o*Math.sin(-t)]);for(let a=0;a<=2*Math.PI;a+=t){const t=[e+n*Math.cos(a),s+o*Math.sin(a)];i.push(t),c.push(t)}c.push([e+n*Math.cos(0),s+o*Math.sin(0)]),c.push([e+n*Math.cos(t),s+o*Math.sin(t)])}else{const l=G(.5,r)-Math.PI/2;c.push([G(a,r)+e+.9*n*Math.cos(l-t),G(a,r)+s+.9*o*Math.sin(l-t)]);const u=2*Math.PI+l-.01;for(let h=l;h<u;h+=t){const t=[G(a,r)+e+n*Math.cos(h),G(a,r)+s+o*Math.sin(h)];i.push(t),c.push(t)}c.push([G(a,r)+e+n*Math.cos(l+2*Math.PI+.5*h),G(a,r)+s+o*Math.sin(l+2*Math.PI+.5*h)]),c.push([G(a,r)+e+.98*n*Math.cos(l+h),G(a,r)+s+.98*o*Math.sin(l+h)]),c.push([G(a,r)+e+.9*n*Math.cos(l+.5*h),G(a,r)+s+.9*o*Math.sin(l+.5*h)])}return[c,i]}function V(t,e,s,n,o,a,h,r,i){const c=a+G(.1,i),l=[];l.push([G(r,i)+e+.9*n*Math.cos(c-t),G(r,i)+s+.9*o*Math.sin(c-t)]);for(let a=c;a<=h;a+=t)l.push([G(r,i)+e+n*Math.cos(a),G(r,i)+s+o*Math.sin(a)]);return l.push([e+n*Math.cos(h),s+o*Math.sin(h)]),l.push([e+n*Math.cos(h),s+o*Math.sin(h)]),q(l,null,i)}function Z(t,e,s,n,o,a,h,r){const i=[],c=[r.maxRandomnessOffset||1,(r.maxRandomnessOffset||1)+.3];let l=[0,0];const u=r.disableMultiStroke?1:2,p=r.preserveVertices;for(let f=0;f<u;f++)0===f?i.push({op:"move",data:[h[0],h[1]]}):i.push({op:"move",data:[h[0]+(p?0:G(c[0],r)),h[1]+(p?0:G(c[0],r))]}),l=p?[o,a]:[o+G(c[f],r),a+G(c[f],r)],i.push({op:"bcurveTo",data:[t+G(c[f],r),e+G(c[f],r),s+G(c[f],r),n+G(c[f],r),l[0],l[1]]});return i}function Q(t){return[...t]}function H(t,e=0){const s=t.length;if(s<3)throw new Error("A curve must have at least three points.");const n=[];if(3===s)n.push(Q(t[0]),Q(t[1]),Q(t[2]),Q(t[2]));else{const s=[];s.push(t[0],t[0]);for(let e=1;e<t.length;e++)s.push(t[e]),e===t.length-1&&s.push(t[e]);const o=[],a=1-e;n.push(Q(s[0]));for(let t=1;t+2<s.length;t++){const e=s[t];o[0]=[e[0],e[1]],o[1]=[e[0]+(a*s[t+1][0]-a*s[t-1][0])/6,e[1]+(a*s[t+1][1]-a*s[t-1][1])/6],o[2]=[s[t+1][0]+(a*s[t][0]-a*s[t+2][0])/6,s[t+1][1]+(a*s[t][1]-a*s[t+2][1])/6],o[3]=[s[t+1][0],s[t+1][1]],n.push(o[1],o[2],o[3])}}return n}function N(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)}function B(t,e,s){const n=N(e,s);if(0===n)return N(t,e);let o=((t[0]-e[0])*(s[0]-e[0])+(t[1]-e[1])*(s[1]-e[1]))/n;return o=Math.max(0,Math.min(1,o)),N(t,J(e,s,o))}function J(t,e,s){return[t[0]+(e[0]-t[0])*s,t[1]+(e[1]-t[1])*s]}function K(t,e,s,n){const o=n||[];if(function(t,e){const s=t[e+0],n=t[e+1],o=t[e+2],a=t[e+3];let h=3*n[0]-2*s[0]-a[0];h*=h;let r=3*n[1]-2*s[1]-a[1];r*=r;let i=3*o[0]-2*a[0]-s[0];i*=i;let c=3*o[1]-2*a[1]-s[1];return c*=c,h<i&&(h=i),r<c&&(r=c),h+r}(t,e)<s){const s=t[e+0];if(o.length){(a=o[o.length-1],h=s,Math.sqrt(N(a,h)))>1&&o.push(s)}else o.push(s);o.push(t[e+3])}else{const n=.5,a=t[e+0],h=t[e+1],r=t[e+2],i=t[e+3],c=J(a,h,n),l=J(h,r,n),u=J(r,i,n),p=J(c,l,n),f=J(l,u,n),d=J(p,f,n);K([a,c,p,d],0,s,o),K([d,f,u,i],0,s,o)}var a,h;return o}function U(t,e){return X(t,0,t.length,e)}function X(t,e,s,n,o){const a=o||[],h=t[e],r=t[s-1];let i=0,c=1;for(let n=e+1;n<s-1;++n){const e=B(t[n],h,r);e>i&&(i=e,c=n)}return Math.sqrt(i)>n?(X(t,e,c+1,n,a),X(t,c,s,n,a)):(a.length||a.push(h),a.push(r)),a}function Y(t,e=.15,s){const n=[],o=(t.length-1)/3;for(let s=0;s<o;s++){K(t,3*s,e,n)}return s&&s>0?X(n,0,n.length,s):n}const tt="none";class et{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,e,s){return{shape:t,sets:e||[],options:s||this.defaultOptions}}line(t,e,s,n,o){const a=this._o(o);return this._d("line",[v(t,e,s,n,a)],a)}rectangle(t,e,s,n,o){const a=this._o(o),h=[],r=O(t,e,s,n,a);if(a.fill){const o=[[t,e],[t+s,e],[t+s,e+n],[t,e+n]];"solid"===a.fillStyle?h.push(I([o],a)):h.push(C([o],a))}return a.stroke!==tt&&h.push(r),this._d("rectangle",h,a)}ellipse(t,e,s,n,o){const a=this._o(o),h=[],r=T(s,n,a),i=D(t,e,a,r);if(a.fill)if("solid"===a.fillStyle){const s=D(t,e,a,r).opset;s.type="fillPath",h.push(s)}else h.push(C([i.estimatedPoints],a));return a.stroke!==tt&&h.push(i.opset),this._d("ellipse",h,a)}circle(t,e,s,n){const o=this.ellipse(t,e,s,s,n);return o.shape="circle",o}linearPath(t,e){const s=this._o(e);return this._d("linearPath",[S(t,!1,s)],s)}arc(t,e,s,n,o,a,h=!1,r){const i=this._o(r),c=[],l=A(t,e,s,n,o,a,h,!0,i);if(h&&i.fill)if("solid"===i.fillStyle){const h=Object.assign({},i);h.disableMultiStroke=!0;const r=A(t,e,s,n,o,a,!0,!1,h);r.type="fillPath",c.push(r)}else c.push(function(t,e,s,n,o,a,h){const r=t,i=e;let c=Math.abs(s/2),l=Math.abs(n/2);c+=G(.01*c,h),l+=G(.01*l,h);let u=o,p=a;for(;u<0;)u+=2*Math.PI,p+=2*Math.PI;p-u>2*Math.PI&&(u=0,p=2*Math.PI);const f=(p-u)/h.curveStepCount,d=[];for(let t=u;t<=p;t+=f)d.push([r+c*Math.cos(t),i+l*Math.sin(t)]);return d.push([r+c*Math.cos(p),i+l*Math.sin(p)]),d.push([r,i]),C([d],h)}(t,e,s,n,o,a,i));return i.stroke!==tt&&c.push(l),this._d("arc",c,i)}curve(t,e){const s=this._o(e),n=[],o=L(t,s);if(s.fill&&s.fill!==tt)if("solid"===s.fillStyle){const e=L(t,Object.assign(Object.assign({},s),{disableMultiStroke:!0,roughness:s.roughness?s.roughness+s.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else{const e=[],o=t;if(o.length){const t="number"==typeof o[0][0]?[o]:o;for(const n of t)n.length<3?e.push(...n):3===n.length?e.push(...Y(H([n[0],n[0],n[1],n[2]]),10,(1+s.roughness)/2)):e.push(...Y(H(n),10,(1+s.roughness)/2))}e.length&&n.push(C([e],s))}return s.stroke!==tt&&n.push(o),this._d("curve",n,s)}polygon(t,e){const s=this._o(e),n=[],o=S(t,!0,s);return s.fill&&("solid"===s.fillStyle?n.push(I([t],s)):n.push(C([t],s))),s.stroke!==tt&&n.push(o),this._d("polygon",n,s)}path(t,e){const s=this._o(e),n=[];if(!t)return this._d("path",n,s);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const o=s.fill&&"transparent"!==s.fill&&s.fill!==tt,a=s.stroke!==tt,h=!!(s.simplification&&s.simplification<1),r=function(t,e,s){const n=m(y(b(t))),o=[];let a=[],h=[0,0],r=[];const i=()=>{r.length>=4&&a.push(...Y(r,e)),r=[]},c=()=>{i(),a.length&&(o.push(a),a=[])};for(const{key:t,data:e}of n)switch(t){case"M":c(),h=[e[0],e[1]],a.push(h);break;case"L":i(),a.push([e[0],e[1]]);break;case"C":if(!r.length){const t=a.length?a[a.length-1]:h;r.push([t[0],t[1]])}r.push([e[0],e[1]]),r.push([e[2],e[3]]),r.push([e[4],e[5]]);break;case"Z":i(),a.push([h[0],h[1]])}if(c(),!s)return o;const l=[];for(const t of o){const e=U(t,s);e.length&&l.push(e)}return l}(t,1,h?4-4*(s.simplification||1):(1+s.roughness)/2),i=_(t,s);if(o)if("solid"===s.fillStyle)if(1===r.length){const e=_(t,Object.assign(Object.assign({},s),{disableMultiStroke:!0,roughness:s.roughness?s.roughness+s.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else n.push(I(r,s));else n.push(C(r,s));return a&&(h?r.forEach((t=>{n.push(S(t,!1,s))})):n.push(i)),this._d("path",n,s)}opsToPath(t,e){let s="";for(const n of t.ops){const t="number"==typeof e&&e>=0?n.data.map((t=>+t.toFixed(e))):n.data;switch(n.op){case"move":s+=`M${t[0]} ${t[1]} `;break;case"bcurveTo":s+=`C${t[0]} ${t[1]}, ${t[2]} ${t[3]}, ${t[4]} ${t[5]} `;break;case"lineTo":s+=`L${t[0]} ${t[1]} `}}return s.trim()}toPaths(t){const e=t.sets||[],s=t.options||this.defaultOptions,n=[];for(const t of e){let e=null;switch(t.type){case"path":e={d:this.opsToPath(t),stroke:s.stroke,strokeWidth:s.strokeWidth,fill:tt};break;case"fillPath":e={d:this.opsToPath(t),stroke:tt,strokeWidth:0,fill:s.fill||tt};break;case"fillSketch":e=this.fillSketch(t,s)}e&&n.push(e)}return n}fillSketch(t,e){let s=e.fillWeight;return s<0&&(s=e.strokeWidth/2),{d:this.opsToPath(t),stroke:e.fill||tt,strokeWidth:s,fill:tt}}_mergedShape(t){return t.filter(((t,e)=>0===e||"move"!==t.op))}}class st{constructor(t,e){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new et(e)}draw(t){const e=t.sets||[],s=t.options||this.getDefaultOptions(),n=this.ctx,o=t.options.fixedDecimalPlaceDigits;for(const a of e)switch(a.type){case"path":n.save(),n.strokeStyle="none"===s.stroke?"transparent":s.stroke,n.lineWidth=s.strokeWidth,s.strokeLineDash&&n.setLineDash(s.strokeLineDash),s.strokeLineDashOffset&&(n.lineDashOffset=s.strokeLineDashOffset),this._drawToContext(n,a,o),n.restore();break;case"fillPath":{n.save(),n.fillStyle=s.fill||"";const e="curve"===t.shape||"polygon"===t.shape||"path"===t.shape?"evenodd":"nonzero";this._drawToContext(n,a,o,e),n.restore();break}case"fillSketch":this.fillSketch(n,a,s)}}fillSketch(t,e,s){let n=s.fillWeight;n<0&&(n=s.strokeWidth/2),t.save(),s.fillLineDash&&t.setLineDash(s.fillLineDash),s.fillLineDashOffset&&(t.lineDashOffset=s.fillLineDashOffset),t.strokeStyle=s.fill||"",t.lineWidth=n,this._drawToContext(t,e,s.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,e,s,n="nonzero"){t.beginPath();for(const n of e.ops){const e="number"==typeof s&&s>=0?n.data.map((t=>+t.toFixed(s))):n.data;switch(n.op){case"move":t.moveTo(e[0],e[1]);break;case"bcurveTo":t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]);break;case"lineTo":t.lineTo(e[0],e[1])}}"fillPath"===e.type?t.fill(n):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,e,s,n,o){const a=this.gen.line(t,e,s,n,o);return this.draw(a),a}rectangle(t,e,s,n,o){const a=this.gen.rectangle(t,e,s,n,o);return this.draw(a),a}ellipse(t,e,s,n,o){const a=this.gen.ellipse(t,e,s,n,o);return this.draw(a),a}circle(t,e,s,n){const o=this.gen.circle(t,e,s,n);return this.draw(o),o}linearPath(t,e){const s=this.gen.linearPath(t,e);return this.draw(s),s}polygon(t,e){const s=this.gen.polygon(t,e);return this.draw(s),s}arc(t,e,s,n,o,a,h=!1,r){const i=this.gen.arc(t,e,s,n,o,a,h,r);return this.draw(i),i}curve(t,e){const s=this.gen.curve(t,e);return this.draw(s),s}path(t,e){const s=this.gen.path(t,e);return this.draw(s),s}}const nt="http://www.w3.org/2000/svg";class ot{constructor(t,e){this.svg=t,this.gen=new et(e)}draw(t){const e=t.sets||[],s=t.options||this.getDefaultOptions(),n=this.svg.ownerDocument||window.document,o=n.createElementNS(nt,"g"),a=t.options.fixedDecimalPlaceDigits;for(const h of e){let e=null;switch(h.type){case"path":e=n.createElementNS(nt,"path"),e.setAttribute("d",this.opsToPath(h,a)),e.setAttribute("stroke",s.stroke),e.setAttribute("stroke-width",s.strokeWidth+""),e.setAttribute("fill","none"),s.strokeLineDash&&e.setAttribute("stroke-dasharray",s.strokeLineDash.join(" ").trim()),s.strokeLineDashOffset&&e.setAttribute("stroke-dashoffset",`${s.strokeLineDashOffset}`);break;case"fillPath":e=n.createElementNS(nt,"path"),e.setAttribute("d",this.opsToPath(h,a)),e.setAttribute("stroke","none"),e.setAttribute("stroke-width","0"),e.setAttribute("fill",s.fill||""),"curve"!==t.shape&&"polygon"!==t.shape||e.setAttribute("fill-rule","evenodd");break;case"fillSketch":e=this.fillSketch(n,h,s)}e&&o.appendChild(e)}return o}fillSketch(t,e,s){let n=s.fillWeight;n<0&&(n=s.strokeWidth/2);const o=t.createElementNS(nt,"path");return o.setAttribute("d",this.opsToPath(e,s.fixedDecimalPlaceDigits)),o.setAttribute("stroke",s.fill||""),o.setAttribute("stroke-width",n+""),o.setAttribute("fill","none"),s.fillLineDash&&o.setAttribute("stroke-dasharray",s.fillLineDash.join(" ").trim()),s.fillLineDashOffset&&o.setAttribute("stroke-dashoffset",`${s.fillLineDashOffset}`),o}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,e){return this.gen.opsToPath(t,e)}line(t,e,s,n,o){const a=this.gen.line(t,e,s,n,o);return this.draw(a)}rectangle(t,e,s,n,o){const a=this.gen.rectangle(t,e,s,n,o);return this.draw(a)}ellipse(t,e,s,n,o){const a=this.gen.ellipse(t,e,s,n,o);return this.draw(a)}circle(t,e,s,n){const o=this.gen.circle(t,e,s,n);return this.draw(o)}linearPath(t,e){const s=this.gen.linearPath(t,e);return this.draw(s)}polygon(t,e){const s=this.gen.polygon(t,e);return this.draw(s)}arc(t,e,s,n,o,a,h=!1,r){const i=this.gen.arc(t,e,s,n,o,a,h,r);return this.draw(i)}curve(t,e){const s=this.gen.curve(t,e);return this.draw(s)}path(t,e){const s=this.gen.path(t,e);return this.draw(s)}}return{canvas:(t,e)=>new st(t,e),svg:(t,e)=>new ot(t,e),generator:t=>new et(t),newSeed:()=>et.newSeed()}}();@@ -28,7 +28,7 @@ if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==url"se.diagrams.net"==window.location.hostname&&(urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.plugins="0",urlParams.mode="google",urlParams.lockdown="1",window.DRAWIO_GOOGLE_APP_ID=window.DRAWIO_GOOGLE_APP_ID||"184079235871",window.DRAWIO_GOOGLE_CLIENT_ID=window.DRAWIO_GOOGLE_CLIENT_ID||"184079235871-pjf5nn0lff27lk8qf0770gmffiv9gt61.apps.googleusercontent.com");"trello"==urlParams.mode&&(urlParams.tr="1");"embed.diagrams.net"==window.location.hostname&&(urlParams.embed="1");(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.open&&(window.location.hash=urlParams.open);"function"!==typeof window.structuredClone&&(window.structuredClone=function(a){return a});window.urlParams=window.urlParams||{};window.DOM_PURIFY_CONFIG=window.DOM_PURIFY_CONFIG||{ADD_TAGS:["use","foreignObject"],FORBID_TAGS:["form"],ALLOWED_URI_REGEXP:/^((?!javascript:).)*$/i,HTML_INTEGRATION_POINTS:{foreignobject:!0},ADD_ATTR:["target","content","pointer-events","requiredFeatures"]};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"mxgraph";-window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"26.2.2",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),+window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"26.2.7",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:0<=navigator.appVersion.indexOf("Android"),IS_IOS:/iP(hone|od|ad)/.test(navigator.platform)||navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&2<navigator.maxTouchPoints,IS_WEBVIEW:/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:-1<navigator.userAgent.toLowerCase().indexOf("firefox"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||@@ -83,73 +83,73 @@ mxUtils.write(c,a);mxEvent.addListener(c,"click",function(e){b(e)});null!=d&&(c.b,c,d,e,f){return mxUtils.link(a,b,function(){c[d](e)},f)},link:function(a,b,c,d){var e=document.createElement("span");e.style.color="blue";e.style.textDecoration="underline";e.style.cursor="pointer";null!=d&&(e.style.paddingLeft=d+"px");mxEvent.addListener(e,"click",c);mxUtils.write(e,b);null!=a&&a.appendChild(e);return e},getDocumentSize:function(){var a=document.body,b=document.documentElement;try{return new mxRectangle(0,0,a.clientWidth||b.clientWidth,Math.max(a.clientHeight||0,b.clientHeight))}catch(c){return new mxRectangle}},fit:function(a,b){b=b||0;var c=mxUtils.getDocumentSize(),d=parseInt(a.offsetLeft),e=parseInt(a.offsetWidth),f=mxUtils.getDocumentScrollOrigin(a.ownerDocument),g=f.x;f=f.y;var k=g+c.width-b;d+e>k&&(a.style.left=Math.max(g+b,k-e)+"px");d=parseInt(a.offsetTop);e=parseInt(a.offsetHeight);c=f+c.height-b;d+e>c&&(a.style.top=Math.max(f+b,c-e)+"px")},load:function(a){a=new mxXmlRequest(a,null,"GET",!1);a.send();return a},get:function(a,b,c,d,e,f,g){a=new mxXmlRequest(a,null,"GET");var k=a.setRequestHeaders;g&&(a.setRequestHeaders=function(l,m){k.apply(this,arguments);for(var n in g)l.setRequestHeader(n,g[n])});null!=d&&a.setBinary(d);a.send(b,c,e,f);return a},getAll:function(a,b,c){for(var d=a.length,e=[],f=0,g=function(){0==f&&null!=c&&c();f++},k=0;k<a.length;k++)(function(l,m){mxUtils.get(l,function(n){var p=n.getStatus();200>p||299<p?g():(e[m]=n,d--,0==d&&b(e))},g)})(a[k],k);0==d&&b(e)},post:function(a,b,c,d){return(new mxXmlRequest(a,b)).send(c,d)},submit:function(a,b,c,d){return(new mxXmlRequest(a,-b)).simulate(c,d)},loadInto:function(a,b,c){mxClient.IS_IE?b.onreadystatechange=function(){4==b.readyState&&c()}:b.addEventListener("load",c,!1);b.load(a)},getValue:function(a,b,c){a=null!=a?a[b]:null;null==a&&(a=c);return a},getNumber:function(a,b,c){a=null!=a?a[b]:null;null==a&&(a=c||0);return Number(a)},isLightDarkColor:function(a){return"string"===typeof a&&"light-dark"==mxUtils.ltrim(a).substring(0,10)},isVarColor:function(a){return mxUtils.varColorRegex.test(a)},isHexColor:function(a){return mxUtils.hexColorRegex.test(a)},-isRgbColor:function(a){return mxUtils.rgbaColorRegex.test(a)},isValidColor:function(a){if(null==a)return!1;a=String(a).replace(/\s/g,"");if(a.toLowerCase()==mxUtils.normalizedValidInvalidColor)return!0;mxUtils.canvasContext.fillStyle=mxUtils.validInvalidColor;mxUtils.canvasContext.fillStyle=a;return mxUtils.canvasContext.fillStyle!=mxUtils.validInvalidColor},isDarkColor:function(a){a=mxUtils.parseColor(a);return null!=a?128>.213*a.r+.715*a.g+.072*a.b:!1},parseLightDarkColor:function(a,b,c){var d=-a,e=null;null!=a&&(a=a.match(mxUtils.lightDarkColorRegex))&&3===a.length&&(d=mxUtils.trim(a[1]),e=mxUtils.trim(a[2]));null==e&&(c||mxUtils.isVarColor(d))&&(e=d);e=null!=e?e:null!=b?b:mxUtils.getInverseColor(d);return{light:d,dark:e}},getInverseColor:function(a,b,c){function d(m){return Math.round(b/100*(255-m)+m*(1-b/100))}function e(m){return Math.round(Math.max(0,Math.min(255,m)))}c=null!=c?c:180;b=null!=b?b:93;var f=0,g=0,k=0;if("transparent"==a.toLowerCase())return a;k=mxUtils.parseColor(a);if(null==-k)return a;f=k.r;g=k.g;k=k.b;f=d(f);g=d(g);k=d(k);a=[1,0,0,0,1,0,0,0,1];var l=Math.cos(c*Math.PI/180);c=Math.sin(c*Math.PI/180);a[0]=.2126+.7874*l-.2126*c;a[1]=.7152-.7152*l-.7152*c;a[2]=.0722-.0722*l+.9278*c;a[3]=.2126-.2126*l+.143*c;a[4]=.7152+(1-.7152)*l+.14*c;a[5]=.0722-.0722*l-.283*c;a[6]=.2126-.2126*l-.7874*c;a[7]=.7152-.7152*l+.7152*c;a[8]=.0722+.9278*l+.0722*c;c=e(a[0]*f+a[1]*g+a[2]*k);l=e(a[3]*f+a[4]*g+a[5]*k);f=e(a[6]*f+a[7]*g+a[8]*k);return"#"+(16777216|c<<16|l<<8|f).toString(16).slice(1)},-addAlphaToColor:function(a,b){null!=b&&null!=a&&"transparent"!=a&&(a=mxUtils.parseColor(a),a="rgba("+a.r+","+a.g+","+a.b+","+b+")");return a},getLightDarkColor:function(a,b,c,d){var e={light:"transparent",dark:"transparent",cssText:"transparent"};null!=a&&a!=mxConstants.NONE&&("string"===typeof a?(a=mxUtils.parseLightDarkColor(a,c,d),e.light=mxUtils.addAlphaToColor(a.light,b),e.dark=mxUtils.addAlphaToColor(a.dark,b),e.cssText=mxUtils.lightDarkColorSupported?e.light==e.dark?e.light:"light-dark("+e.light+-", "+e.dark+")":mxUtils.preferDarkColor?e.dark:e.light):(e.light=a,e.dark=a,e.cssText=a));return e},invertLightDarkColor:function(a){var b={};b.light=a.dark;b.dark=a.light;b.cssText=b.light==b.dark?b.light:"light-dark("+b.light+", "+b.dark+")";return b},getColor:function(a,b,c){a=null!=a?a[b]:null;null==a?a=c:a==mxConstants.NONE&&(a=null);return a},isEmptyObject:function(a){for(var b in a)return!1;return!0},clone:function(a,b,c){c=null!=c?c:!1;var d=null;if(null!=a&&"function"==typeof a.constructor)if(a.constructor===-Element)d=a.cloneNode(null!=c?!c:!1);else{d=new a.constructor;for(var e in a)e!=mxObjectIdentity.FIELD_NAME&&(null==b||0>mxUtils.indexOf(b,e))&&(d[e]=c||"object"!=typeof a[e]?a[e]:mxUtils.clone(a[e]))}return d},equalPoints:function(a,b){if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b)for(var c=0;c<a.length;c++)if(null!=a[c]&&null==b[c]||null==a[c]&&null!=b[c]||null!=a[c]&&null!=b[c]&&(a[c].x!=b[c].x||a[c].y!=b[c].y))return!1;return!0},equalEntries:function(a,-b){var c=0;if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b){for(var d in b)c++;for(d in a)if(c--,!(mxUtils.isNaN(a[d])&&mxUtils.isNaN(b[d])||a[d]==b[d]))return!1}return 0==c},removeDuplicates:function(a){for(var b=new mxDictionary,c=[],d=0;d<a.length;d++)b.get(a[d])||(c.push(a[d]),b.put(a[d],!0));return c},isNaN:function(a){return"number"==typeof a&&isNaN(a)},extend:function(a,b){var c=function(){};c.prototype=b.prototype;a.prototype=new c;-a.prototype.constructor=a},toString:function(a){var b="",c;for(c in a)try{if(null==a[c])b+=c+" = [null]\n";else if("function"==typeof a[c])b+=c+" => [Function]\n";else if("object"==typeof a[c]){var d=mxUtils.getFunctionName(a[c].constructor);b+=c+" => ["+d+"]\n"}else b+=c+" = "+a[c]+"\n"}catch(e){b+=c+"="+e.message}return b},toRadians:function(a){return Math.PI*a/180},toDegree:function(a){return 180*a/Math.PI},arcToCurves:function(a,b,c,d,e,f,g,k,l){k-=a;l-=b;if(0===c||0===d)return A;c=Math.abs(c);-d=Math.abs(d);var m=-k/2,n=-l/2,p=Math.cos(e*Math.PI/180);A=Math.sin(e*Math.PI/180);e=p*m+A*n;m=-1*A*m+p*n;n=e*e;var q=m*m,r=c*c,t=d*d,u=n/r+q/t;1<u?(c*=Math.sqrt(u),d*=Math.sqrt(u),f=0):(u=1,f===g&&(u=-1),f=u*Math.sqrt((r*t-r*q-t*n)/(r*q+t*n)));n=f*c*m/d;q=-1*f*d*e/c;k=p*n-A*q+k/2;l=A*n+p*q+l/2;r=Math.atan2((m-q)/d,(e-n)/c)-Math.atan2(0,1);f=0<=r?r:2*Math.PI+r;r=Math.atan2((-m-q)/d,(-e-n)/c)-Math.atan2((m-q)/d,(e-n)/c);e=0<=r?r:2*Math.PI+r;0==g&&0<e?e-=2*Math.PI:0!=g&&0>e&&(e+=2*Math.PI);g=2*e/Math.PI;-g=Math.ceil(0>g?-1*g:g);e/=g;m=8/3*Math.sin(e/4)*Math.sin(e/4)/Math.sin(e/2);n=p*c;p*=d;c*=A;d*=A;var x=Math.cos(f),y=Math.sin(f);q=-m*(n*y+d*x);r=-m*(c*y-p*x);for(var A=[],z=0;z<g;++z){f+=e;x=Math.cos(f);y=Math.sin(f);t=n*x-d*y+k;u=c*x+p*y+l;var C=-m*(n*y+d*x);x=-m*(c*y-p*x);y=6*z;A[y]=Number(q+a);A[y+1]=Number(r+b);A[y+2]=Number(t-C+a);A[y+3]=Number(u-x+b);A[y+4]=Number(t+a);A[y+5]=Number(u+b);q=t+C;r=u+x}return A},getBoundingBox:function(a,b,c){var d=null;if(null!=a&&null!=b&&0!=b){b=mxUtils.toRadians(b);-d=Math.cos(b);var e=Math.sin(b);c=null!=c?c:new mxPoint(a.x+a.width/2,a.y+a.height/2);var f=new mxPoint(a.x,a.y);b=new mxPoint(a.x+a.width,a.y);var g=new mxPoint(b.x,a.y+a.height);a=new mxPoint(a.x,g.y);f=mxUtils.getRotatedPoint(f,d,e,c);b=mxUtils.getRotatedPoint(b,d,e,c);g=mxUtils.getRotatedPoint(g,d,e,c);a=mxUtils.getRotatedPoint(a,d,e,c);d=new mxRectangle(f.x,f.y,0,0);d.add(new mxRectangle(b.x,b.y,0,0));d.add(new mxRectangle(g.x,g.y,0,0));d.add(new mxRectangle(a.x,a.y,0,0))}return d},getRotatedPoint:function(a,-b,c,d){d=null!=d?d:new mxPoint;var e=a.x-d.x;a=a.y-d.y;return new mxPoint(e*b-a*c+d.x,a*b+e*c+d.y)},getPortConstraints:function(a,b,c,d){b=mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT,mxUtils.getValue(b.style,c?mxConstants.STYLE_SOURCE_PORT_CONSTRAINT:mxConstants.STYLE_TARGET_PORT_CONSTRAINT,null));if(null==b)return d;d=b.toString();b=mxConstants.DIRECTION_MASK_NONE;c=0;1==mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT_ROTATION,0)&&(c=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,-0));a=0;45<c?(a=1,135<=c&&(a=2)):-45>c&&(a=3,-135>=c&&(a=2));if(0<=d.indexOf(mxConstants.DIRECTION_NORTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:b|=mxConstants.DIRECTION_MASK_EAST;break;case 2:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:b|=mxConstants.DIRECTION_MASK_WEST}if(0<=d.indexOf(mxConstants.DIRECTION_WEST))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_WEST;break;case 1:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:b|=mxConstants.DIRECTION_MASK_EAST;break;-case 3:b|=mxConstants.DIRECTION_MASK_SOUTH}if(0<=d.indexOf(mxConstants.DIRECTION_SOUTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:b|=mxConstants.DIRECTION_MASK_WEST;break;case 2:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:b|=mxConstants.DIRECTION_MASK_EAST}if(0<=d.indexOf(mxConstants.DIRECTION_EAST))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_EAST;break;case 1:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:b|=mxConstants.DIRECTION_MASK_WEST;break;case 3:b|=mxConstants.DIRECTION_MASK_NORTH}return b},-reversePortConstraints:function(a){var b=(a&mxConstants.DIRECTION_MASK_WEST)<<3;b|=(a&mxConstants.DIRECTION_MASK_NORTH)<<1;b|=(a&mxConstants.DIRECTION_MASK_SOUTH)>>1;return b|(a&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(a,b,c){var d=-1;if(0<a.absolutePoints.length)for(var e=a.absolutePoints[0],f=null,g=1;g<a.absolutePoints.length;g++){var k=a.absolutePoints[g];e=mxUtils.ptSegDistSq(e.x,e.y,k.x,k.y,b,c);if(null==f||e<f)f=e,d=g-1;e=k}return d},getDirectedBounds:function(a,b,c,-d,e){var f=mxUtils.getValue(c,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);d=null!=d?d:mxUtils.getValue(c,mxConstants.STYLE_FLIPH,!1);e=null!=e?e:mxUtils.getValue(c,mxConstants.STYLE_FLIPV,!1);b.x=Math.round(Math.max(0,Math.min(a.width,b.x)));b.y=Math.round(Math.max(0,Math.min(a.height,b.y)));b.width=Math.round(Math.max(0,Math.min(a.width,b.width)));b.height=Math.round(Math.max(0,Math.min(a.height,b.height)));if(e&&(f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH)||d&&(f==-mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST))c=b.x,b.x=b.width,b.width=c;if(d&&(f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH)||e&&(f==mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST))c=b.y,b.y=b.height,b.height=c;d=mxRectangle.fromRectangle(b);f==mxConstants.DIRECTION_SOUTH?(d.y=b.x,d.x=b.height,d.width=b.y,d.height=b.width):f==mxConstants.DIRECTION_WEST?(d.y=b.height,d.x=b.width,d.width=b.x,d.height=b.y):f==mxConstants.DIRECTION_NORTH&&(d.y=b.width,d.x=b.y,-d.width=b.height,d.height=b.x);return new mxRectangle(a.x+d.x,a.y+d.y,a.width-d.width-d.x,a.height-d.height-d.y)},getPerimeterPoint:function(a,b,c){for(var d=null,e=0;e<a.length-1;e++){var f=mxUtils.intersection(a[e].x,a[e].y,a[e+1].x,a[e+1].y,b.x,b.y,c.x,c.y);if(null!=f){var g=c.x-f.x,k=c.y-f.y;f={p:f,distSq:k*k+g*g};null!=f&&(null==d||d.distSq>f.distSq)&&(d=f)}}return null!=d?d.p:null},intersectsPoints:function(a,b){for(var c=0;c<b.length-1;c++)if(mxUtils.rectangleIntersectsSegment(a,b[c],b[c+1]))return!0;-return!1},rectangleIntersectsSegment:function(a,b,c){var d=a.y,e=a.x,f=d+a.height,g=e+a.width;a=b.x;var k=c.x;b.x>c.x&&(a=c.x,k=b.x);k>g&&(k=g);a<e&&(a=e);if(a>k)return!1;e=b.y;g=c.y;var l=c.x-b.x;1E-7<Math.abs(l)&&(c=(c.y-b.y)/l,b=b.y-c*b.x,e=c*a+b,g=c*k+b);e>g&&(b=g,g=e,e=b);g>f&&(g=f);e<d&&(e=d);return e>g?!1:!0},contains:function(a,b,c){return a.x<=b&&a.x+a.width>=b&&a.y<=c&&a.y+a.height>=c},intersects:function(a,b,c){var d=a.width,e=a.height,f=b.width,g=b.height;if(!c&&(0>=f||0>=g||0>=d||0>=-e))return!1;c=a.x;a=a.y;var k=b.x;b=b.y;f+=k;g+=b;d+=c;e+=a;return(f<k||f>c)&&(g<b||g>a)&&(d<c||d>k)&&(e<a||e>b)},intersectsHotspot:function(a,b,c,d,e,f){d=null!=d?d:1;e=null!=e?e:0;f=null!=f?f:0;if(0<d){var g=a.getCenterX(),k=a.getCenterY(),l=a.width,m=a.height,n=mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE)*a.view.scale;0<n&&(mxUtils.getValue(a.style,mxConstants.STYLE_HORIZONTAL,!0)?(k=a.y+n/2,m=n):(g=a.x+n/2,l=n));l=Math.max(e,l*d);m=Math.max(e,m*d);0<f&&(l=Math.min(l,f),m=Math.min(m,f));-d=new mxRectangle(g-l/2,k-m/2,l,m);g=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)||0);0!=g&&(e=Math.cos(-g),f=Math.sin(-g),g=new mxPoint(a.getCenterX(),a.getCenterY()),a=mxUtils.getRotatedPoint(new mxPoint(b,c),e,f,g),b=a.x,c=a.y);return mxUtils.contains(d,b,c)}return!0},getOffset:function(a,b){for(var c=0,d=0,e=!1,f=a,g=document.body,k=document.documentElement;null!=f&&f!=g&&f!=k&&!e;){var l=mxUtils.getCurrentStyle(f);null!=l&&(e=e||"fixed"==l.position);f=f.parentNode}b||-e||(b=mxUtils.getDocumentScrollOrigin(a.ownerDocument),c+=b.x,d+=b.y);a=a.getBoundingClientRect();null!=a&&(c+=a.left,d+=a.top);return new mxPoint(c,d)},getDocumentScrollOrigin:function(a){a=a.defaultView||a.parentWindow;return new mxPoint(null!=a&&void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,null!=a&&void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)},-getScrollOrigin:function(a,b,c){b=null!=b?b:!1;c=null!=c?c:!0;for(var d=null!=a?a.ownerDocument:document,e=d.body,f=d.documentElement,g=new mxPoint,k=!1;null!=a&&a!=e&&a!=f;){isNaN(a.scrollLeft)||isNaN(a.scrollTop)||(g.x+=a.scrollLeft,g.y+=a.scrollTop);var l=mxUtils.getCurrentStyle(a);null!=l&&(k=k||"fixed"==l.position);a=b?a.parentNode:null}!k&&c&&(a=mxUtils.getDocumentScrollOrigin(d),g.x+=a.x,g.y+=a.y);return g},convertPoint:function(a,b,c){var d=mxUtils.getScrollOrigin(a,!1);a=mxUtils.getOffset(a);-a.x-=d.x;a.y-=d.y;return new mxPoint(b-a.x,c-a.y)},removeJavascriptProtocol:function(a){for(a=null!=a?mxUtils.zapGremlins(a):null;null!=a&&"javascript:"===mxUtils.ltrim(a.toLowerCase()).substring(0,11);)a=a.substring(a.toLowerCase().indexOf(":")+1);return a},zapGremlins:function(a){for(var b=0,c=[],d=0;d<a.length;d++){var e=a.charCodeAt(d);(32<=e||9==e||10==e||13==e)&&65535!=e&&65534!=e||(c.push(a.substring(b,d)),b=d+1)}0<b&&b<a.length&&c.push(a.substring(b));return 0==c.length?a:c.join("")},ltrim:function(a,-b){return null!=a?a.replace(new RegExp("^["+(b||"\\s|\\0")+"]+","g"),""):null},rtrim:function(a,b){return null!=a?a.replace(new RegExp("["+(b||"\\s|\\0")+"]+$","g"),""):null},trim:function(a,b){return mxUtils.ltrim(mxUtils.rtrim(a,b),b)},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)&&("string"!=typeof a||0>a.toLowerCase().indexOf("0x"))},isInteger:function(a){return String(parseInt(a))===String(a)},mod:function(a,b){return(a%b+b)%b},intersection:function(a,b,c,d,e,f,g,k){var l=(k--f)*(c-a)-(g-e)*(d-b);g=((g-e)*(b-f)-(k-f)*(a-e))/l;e=((c-a)*(b-f)-(d-b)*(a-e))/l;return 0<=g&&1>=g&&0<=e&&1>=e?new mxPoint(a+g*(c-a),b+g*(d-b)):null},ptSegDistSq:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;0>=e*c+f*d?c=0:(e=c-e,f=d-f,a=e*c+f*d,c=0>=a?0:a*a/(c*c+d*d));e=e*e+f*f-c;0>e&&(e=0);return e},ptLineDist:function(a,b,c,d,e,f){return Math.abs((d-b)*e-(c-a)*f+c*b-d*a)/Math.sqrt((d-b)*(d-b)+(c-a)*(c-a))},relativeCcw:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;a=e*d-f*c;0==a&&(a=e*c+f*d,0<a&&(a=(e--c)*c+(f-d)*d,0>a&&(a=0)));return 0>a?-1:0<a?1:0},animateChanges:function(a,b){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(a,b,c){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(a,b,c,d,e,f){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(a,b){mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?a.style.filter=100<=b?"":"alpha(opacity="+b+")":a.style.opacity=b/100},createElementNs:function(a,b,c){if(null!=a.createElementNS)return a.createElementNS(b,-c);a=a.createElement(c);null!=namespace&&a.setAttribute("xmlns",b);return a},createImage:function(a){var b=document.createElement("img");b.setAttribute("src",a);b.setAttribute("border","0");return b},sortCells:function(a,b){b=null!=b?b:!0;var c=new mxDictionary;a.sort(function(d,e){var f=c.get(d);null==f&&(f=mxCellPath.create(d).split(mxCellPath.PATH_SEPARATOR),c.put(d,f));d=c.get(e);null==d&&(d=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),c.put(e,d));e=mxCellPath.compare(f,d);return 0==-e?0:0<e==b?1:-1});return a},getStylename:function(a){return null!=a&&(a=a.split(";")[0],0>a.indexOf("="))?a:""},getStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;c<a.length;c++)0>a[c].indexOf("=")&&b.push(a[c])}return b},indexOfStylename:function(a,b){if(null!=a&&null!=b){a=a.split(";");for(var c=0,d=0;d<a.length;d++){if(a[d]==b)return c;c+=a[d].length+1}}return-1},addStylename:function(a,b){0>mxUtils.indexOfStylename(a,b)&&(null==a?a="":0<a.length&&";"!=a.charAt(a.length--1)&&(a+=";"),a+=b);return a},removeStylename:function(a,b){var c=[];if(null!=a){a=a.split(";");for(var d=0;d<a.length;d++)a[d]!=b&&c.push(a[d])}return c.join(";")},removeAllStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;c<a.length;c++)0<=a[c].indexOf("=")&&b.push(a[c])}return b.join(";")},setCellStyles:function(a,b,c,d){if(null!=b&&0<b.length){a.beginUpdate();try{for(var e=0;e<b.length;e++)if(null!=b[e]){var f=mxUtils.setStyle(a.getStyle(b[e]),c,d);a.setStyle(b[e],f)}}finally{a.endUpdate()}}},-parseColor:function(a,b){b=null!=b?b:1;var c=null;if(null!=a&&a!=mxConstants.NONE){if(mxUtils.isRgbColor(a)){a=a.replace(/[^\d,]/g,"").split(",");c=parseInt(a[0]);var d=parseInt(a[1]),e=parseInt(a[2]);4==a.length&&(b=parseFloat(a[3]))}else mxUtils.isHexColor(a)||(a=mxUtils.color2hex(a)),a=a.substring(1),c=parseInt(a.substr(0,2),16),d=parseInt(a.substr(2,2),16),e=parseInt(a.substr(4,2),16),6<a.length&&(b=parseInt(a.substr(6,2),16)/255);c={r:c,g:d,b:e,a:b}}return c},hex2rgb:function(a){var b=mxUtils.parseColor(a);-null!=b&&(a="rgb("+b.r+", "+b.g+", "+b.b+")");return a},hex2rgba:function(a,b){b=mxUtils.parseColor(a,b);null!=b&&(a="rgba("+b.r+", "+b.g+", "+b.b+", "+b.a+")");return a},rgba2hex:function(a){var b=mxUtils.parseColor(a);return null!=b?"#"+("0"+b.r.toString(16)).slice(-2)+("0"+b.g.toString(16)).slice(-2)+("0"+b.b.toString(16)).slice(-2):a},color2hex:function(a,b){b=null!=b?b:"#000000";try{null!=a&&(a=String(a).replace(/\s/g,""),a.toLowerCase()==mxUtils.normalizedValidInvalidColor?b="#000000":(mxUtils.canvasContext.fillStyle=-mxUtils.validInvalidColor,mxUtils.canvasContext.fillStyle=a,mxUtils.canvasContext.fillStyle!=mxUtils.validInvalidColor&&(b=mxUtils.canvasContext.fillStyle)))}catch(c){}return b},setStyle:function(a,b,c){var d=null!=c&&("undefined"==typeof c.length||0<c.length);if(null==a||0==a.length)d&&(a=b+"="+c+";");else if(a.substring(0,b.length+1)==b+"="){var e=a.indexOf(";");a=d?b+"="+c+(0>e?";":a.substring(e)):0>e||e==a.length-1?"":a.substring(e+1)}else{var f=a.indexOf(";"+b+"=");0>f?d&&(d=";"==a.charAt(a.length--1)?"":";",a=a+d+b+"="+c+";"):(e=a.indexOf(";",f+1),a=d?a.substring(0,f+1)+b+"="+c+(0>e?";":a.substring(e)):a.substring(0,f)+(0>e?";":a.substring(e)))}return a},setCellStyleFlags:function(a,b,c,d,e){if(null!=b&&0<b.length){a.beginUpdate();try{for(var f=0;f<b.length;f++)if(null!=b[f]){var g=mxUtils.setStyleFlag(a.getStyle(b[f]),c,d,e);a.setStyle(b[f],g)}}finally{a.endUpdate()}}},setStyleFlag:function(a,b,c,d){if(null==a||0==a.length)a=d||null==d?b+"="+c:b+"=0";else{var e=a.indexOf(b+"=");if(0>e)e=";"==-a.charAt(a.length-1)?"":";",a=d||null==d?a+e+b+"="+c:a+e+b+"=0";else{var f=a.indexOf(";",e),g=0>f?a.substring(e+b.length+1):a.substring(e+b.length+1,f);g=null==d?parseInt(g)^c:d?parseInt(g)|c:parseInt(g)&~c;a=a.substring(0,e)+b+"="+g+(0<=f?a.substring(f):"")}}return a},getAlignmentAsPoint:function(a,b){var c=-.5,d=-.5;a==mxConstants.ALIGN_LEFT?c=0:a==mxConstants.ALIGN_RIGHT&&(c=-1);b==mxConstants.ALIGN_TOP?d=0:b==mxConstants.ALIGN_BOTTOM&&(d=-1);return new mxPoint(c,d)},getSizeForString:function(a,-b,c,d,e){b=null!=b?b:mxConstants.DEFAULT_FONTSIZE;c=null!=c?c:mxConstants.DEFAULT_FONTFAMILY;var f=document.createElement("div");f.style.fontFamily=c;f.style.fontSize=Math.round(b)+"px";f.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?b*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*mxSvgCanvas2D.prototype.lineHeightCorrection;null!=e&&((e&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(f.style.fontWeight="bold"),(e&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(f.style.fontStyle="italic"),-b=[],(e&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&b.push("underline"),(e&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&b.push("line-through"),0<b.length&&(f.style.textDecoration=b.join(" ")));f.style.position="absolute";f.style.visibility="hidden";f.style.display="inline-block";f.style.zoom="1";null!=d?(f.style.width=d+"px",f.style.whiteSpace="normal"):f.style.whiteSpace="nowrap";f.innerHTML=a;document.body.appendChild(f);a=new mxRectangle(0,0,f.offsetWidth,f.offsetHeight);-document.body.removeChild(f);return a},getViewXml:function(a,b,c,d,e){d=null!=d?d:0;e=null!=e?e:0;b=null!=b?b:1;null==c&&(c=[a.getModel().getRoot()]);var f=a.getView(),g=null,k=f.isEventsEnabled();f.setEventsEnabled(!1);var l=f.drawPane,m=f.overlayPane;a.dialect==mxConstants.DIALECT_SVG?(f.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),f.canvas.appendChild(f.drawPane),f.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g")):(f.drawPane=f.drawPane.cloneNode(!1),f.canvas.appendChild(f.drawPane),-f.overlayPane=f.overlayPane.cloneNode(!1));f.canvas.appendChild(f.overlayPane);var n=f.getTranslate();f.translate=new mxPoint(d,e);b=new mxTemporaryCellStates(a.getView(),b,c);try{g=(new mxCodec).encode(a.getView())}finally{b.destroy(),f.translate=n,f.canvas.removeChild(f.drawPane),f.canvas.removeChild(f.overlayPane),f.drawPane=l,f.overlayPane=m,f.setEventsEnabled(k)}return g},getScaleForPageCount:function(a,b,c,d){if(1>a)return 1;c=null!=c?c:mxConstants.PAGE_FORMAT_A4_PORTRAIT;d=null!=d?d:0;var e=-c.width-2*d;c=c.height-2*d;d=mxRectangle.fromRectangle(b.getGraphBounds());b=b.getView().getScale();d.width/=b;d.height/=b;b=d.width;var f=Math.sqrt(a);d=Math.sqrt(b/d.height/(e/c));c=f*d;d=f/d;if(1>c&&d>a){var g=d/a;d=a;c/=g}1>d&&c>a&&(g=c/a,c=a,d/=g);g=Math.ceil(c)*Math.ceil(d);for(f=0;g>a;){g=Math.floor(c)/c;var k=Math.floor(d)/d;1==g&&(g=Math.floor(c-1)/c);1==k&&(k=Math.floor(d-1)/d);g=g>k?g:k;c*=g;d*=g;g=Math.ceil(c)*Math.ceil(d);f++;if(10<f)break}return e*c/b*.99999},show:function(a,b,c,d,e,-f){c=null!=c?c:0;d=null!=d?d:0;null==b?b=window.open().document:b.open();9==document.documentMode&&b.writeln('\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=9"><![endif]--\x3e');var g=a.getGraphBounds(),k=Math.ceil(c-g.x),l=Math.ceil(d-g.y);null==e&&(e=Math.ceil(g.width+c)+Math.ceil(Math.ceil(g.x)-g.x));null==f&&(f=Math.ceil(g.height+d)+Math.ceil(Math.ceil(g.y)-g.y));if(mxClient.IS_IE||11==document.documentMode){d="<html><head>";g=document.getElementsByTagName("base");for(c=0;c<g.length;c++)d+=-g[c].outerHTML;d+="<style>";for(c=0;c<document.styleSheets.length;c++)try{d+=document.styleSheets[c].cssText}catch(m){}d=d+'</style></head><body style="margin:0px;"><div style="position:absolute;overflow:hidden;width:'+(e+"px;height:"+f+'px;"><div style="position:relative;left:'+k+"px;top:"+l+'px;">')+a.container.innerHTML;b.writeln(d+"</div></div></body><html>");b.close()}else{b.writeln("<html><head>");g=document.getElementsByTagName("base");for(c=0;c<g.length;c++)b.writeln(mxUtils.getOuterHtml(g[c]));-d=document.getElementsByTagName("link");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));d=document.getElementsByTagName("style");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));b.writeln('</head><body style="margin:0px;"></body></html>');b.close();c=b.createElement("div");c.position="absolute";c.overflow="hidden";c.style.width=e+"px";c.style.height=f+"px";e=b.createElement("div");e.style.position="absolute";e.style.left=k+"px";e.style.top=l+"px";f=a.container.firstChild;-for(d=null;null!=f;)g=f.cloneNode(!0),f==a.view.drawPane.ownerSVGElement?(c.appendChild(g),d=g):e.appendChild(g),f=f.nextSibling;b.body.appendChild(c);null!=e.firstChild&&b.body.appendChild(e);null!=d&&(d.style.minWidth="",d.style.minHeight="",d.firstChild.setAttribute("transform","translate("+k+","+l+")"))}mxUtils.removeCursors(b.body);return b},printScreen:function(a){var b=window.open();mxUtils.show(a,b.document);a=function(){b.focus();b.print();b.close()};mxClient.IS_GC?b.setTimeout(a,500):a()},-popup:function(a,b){if(b){var c=document.createElement("div");c.style.overflow="scroll";c.style.width="636px";c.style.height="460px";b=document.createElement("pre");b.innerHTML=mxUtils.htmlEntities(a,!1).replace(/\n/g,"<br>").replace(/ /g," ");c.appendChild(b);c=new mxWindow("Popup Window",c,document.body.clientWidth/2-320,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight)/2-240,640,480,!1,!0);c.setClosable(!0);c.setVisible(!0)}else mxClient.IS_NS?(c=window.open(),-c.document.writeln("<pre>"+mxUtils.htmlEntities(a)+"</pre"),c.document.close()):(c=window.open(),b=c.document.createElement("pre"),b.innerHTML=mxUtils.htmlEntities(a,!1).replace(/\n/g,"<br>").replace(/ /g," "),c.document.body.appendChild(b))},alert:function(a){alert(a)},prompt:function(a,b){return prompt(a,null!=b?b:"")},confirm:function(a){return confirm(a)},error:function(a,b,c,d){var e=document.createElement("div");e.style.padding="20px";var f=document.createElement("img");f.setAttribute("src",-d||mxUtils.errorImage);f.setAttribute("valign","bottom");f.style.verticalAlign="middle";e.appendChild(f);e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));mxUtils.write(e,a);a=document.body.clientWidth;d=document.body.clientHeight||document.documentElement.clientHeight;var g=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,e,(a-b)/2,d/4,b,null,!1,!0);c&&(mxUtils.br(e),b=document.createElement("p"),-c=document.createElement("button"),mxClient.IS_IE?c.style.cssText="float:right":c.setAttribute("style","float:right"),mxEvent.addListener(c,"click",function(k){g.destroy()}),mxUtils.write(c,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),b.appendChild(c),e.appendChild(b),mxUtils.br(e),g.setClosable(!0));g.setVisible(!0);return g},makeDraggable:function(a,b,c,d,e,f,g,k,l,m){a=new mxDragSource(a,c);a.dragOffset=new mxPoint(null!=e?e:0,null!=f?f:mxConstants.TOOLTIP_VERTICAL_OFFSET);a.autoscroll=-g;a.setGuidesEnabled(!1);null!=l&&(a.highlightDropTargets=l);null!=m&&(a.getDropTarget=m);a.getGraphForEvent=function(n){return"function"==typeof b?b(n):b};null!=d&&(a.createDragElement=function(){return d.cloneNode(!0)},k&&(a.createPreviewElement=function(n){var p=d.cloneNode(!0),q=parseInt(p.style.width),r=parseInt(p.style.height);p.style.width=Math.round(q*n.view.scale)+"px";p.style.height=Math.round(r*n.view.scale)+"px";return p}));return a},format:function(a){return parseFloat(parseFloat(a).toFixed(2))}},-mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"#808080",VML_SHADOWCOLOR:"#808080",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_BLUR:2,SHADOW_OPACITY:1,-NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",OUTLINE_HIGHLIGHT_COLOR:"#00FF00",OUTLINE_HIGHLIGHT_STROKEWIDTH:5,HIGHLIGHT_STROKEWIDTH:3,HIGHLIGHT_SIZE:2,HIGHLIGHT_OPACITY:100,CURSOR_MOVABLE_VERTEX:"move",-CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_TERMINAL_HANDLE:"pointer",CURSOR_BEND_HANDLE:"crosshair",CURSOR_VIRTUAL_BEND_HANDLE:"crosshair",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,-EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:6,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",DEFAULT_FONTSIZE:11,DEFAULT_TEXT_DIRECTION:"",LINE_HEIGHT:1.2,WORD_WRAP:"normal",-ABSOLUTE_LINE_HEIGHT:!1,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:0,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,827,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,827),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",-STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_PORT_CONSTRAINT_ROTATION:"portConstraintRotation",STYLE_SOURCE_PORT_CONSTRAINT:"sourcePortConstraint",STYLE_TARGET_PORT_CONSTRAINT:"targetPortConstraint",STYLE_OPACITY:"opacity",STYLE_FILL_OPACITY:"fillOpacity",STYLE_FILL_STYLE:"fillStyle",STYLE_STROKE_OPACITY:"strokeOpacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_TEXT_DIRECTION:"textDirection",STYLE_OVERFLOW:"overflow",STYLE_BLOCK_SPACING:"blockSpacing",STYLE_ORTHOGONAL:"orthogonal",-STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_DX:"exitDx",STYLE_EXIT_DY:"exitDy",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_DX:"entryDx",STYLE_ENTRY_DY:"entryDy",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_POINTER_EVENTS:"pointerEvents",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",STYLE_MARGIN:"margin",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",-STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_WIDTH:"labelWidth",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",-STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",-STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_TEXT_SHADOW:"textShadow",STYLE_SHADOW_OFFSET_X:"shadowOffsetX",STYLE_SHADOW_OFFSET_Y:"shadowOffsetY",STYLE_SHADOW_BLUR:"shadowBlur",STYLE_SHADOWCOLOR:"shadowColor",STYLE_SHADOW_OPACITY:"shadowOpacity",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",-STYLE_SWIMLANE_HEAD:"swimlaneHead",STYLE_SWIMLANE_BODY:"swimlaneBody",STYLE_ENDFILL:"endFill",STYLE_ENDFILLCOLOR:"endFillColor",STYLE_STARTFILL:"startFill",STYLE_STARTFILLCOLOR:"startFillColor",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_FIX_DASH:"fixDash",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_ABSOLUTE_ARCSIZE:"absoluteArcSize",STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",-STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ANCHOR_POINT_DIRECTION:"anchorPointDirection",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_ASPECT:"aspect",STYLE_AUTOSIZE:"autosize",STYLE_AUTOSIZE_GRID:"autosizeGrid",STYLE_FIXED_WIDTH:"fixedWidth",-STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BACKGROUND_OUTLINE:"backgroundOutline",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_RESIZE_WIDTH:"resizeWidth",STYLE_RESIZE_HEIGHT:"resizeHeight",STYLE_ROTATABLE:"rotatable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",STYLE_EDGE:"edgeStyle",STYLE_JETTY_SIZE:"jettySize",STYLE_SOURCE_JETTY_SIZE:"sourceJettySize",STYLE_TARGET_JETTY_SIZE:"targetJettySize",STYLE_LOOP:"loopStyle",-STYLE_ORTHOGONAL_LOOP:"orthogonalLoop",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",STYLE_CLIP_PATH:"clipPath",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_STRIKETHROUGH:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",SHAPE_ARROW:"arrow",SHAPE_ARROW_CONNECTOR:"arrowConnector",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",-SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_CLASSIC_THIN:"classicThin",ARROW_BLOCK:"block",ARROW_BLOCK_THIN:"blockThin",ARROW_OPEN:"open",ARROW_OPEN_THIN:"openThin",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",-DIRECTION_WEST:"west",DIRECTION_RADIAL:"radial",TEXT_DIRECTION_DEFAULT:"",TEXT_DIRECTION_AUTO:"auto",TEXT_DIRECTION_LTR:"ltr",TEXT_DIRECTION_RTL:"rtl",TEXT_DIRECTION_VERTICAL_LR:"vertical-lr",TEXT_DIRECTION_VERTICAL_RL:"vertical-rl",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",-EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_HEXAGON:"hexagonPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};+b)).simulate(c,d)},loadInto:function(a,b,c){mxClient.IS_IE?b.onreadystatechange=function(){4==b.readyState&&c()}:b.addEventListener("load",c,!1);b.load(a)},getValue:function(a,b,c){a=null!=a?a[b]:null;null==a&&(a=c);return a},getColorValue:function(a,b,c){a=null!=a?a[b]:null;if(null==a||"default"==a)a=c;return a},getNumber:function(a,b,c){a=null!=a?a[b]:null;null==a&&(a=c||0);return Number(a)},isLightDarkColor:function(a){return"string"===typeof a&&"light-dark"==mxUtils.ltrim(a).substring(0,10)},+isVarColor:function(a){return mxUtils.varColorRegex.test(a)},isHexColor:function(a){return mxUtils.hexColorRegex.test(a)},isRgbColor:function(a){return mxUtils.rgbaColorRegex.test(a)},isValidColor:function(a){if(null==a)return!1;a=String(a).replace(/\s/g,"");if(a.toLowerCase()==mxUtils.normalizedValidInvalidColor)return!0;mxUtils.canvasContext.fillStyle=mxUtils.validInvalidColor;mxUtils.canvasContext.fillStyle=a;return mxUtils.canvasContext.fillStyle!=mxUtils.validInvalidColor},isDarkColor:function(a){a=+mxUtils.parseColor(a);return null!=a?128>.213*a.r+.715*a.g+.072*a.b:!1},parseLightDarkColor:function(a,b,c){var d=a,e=null;null!=a&&(a=a.match(mxUtils.lightDarkColorRegex))&&3===a.length&&(d=mxUtils.trim(a[1]),e=mxUtils.trim(a[2]));null==e&&(c||mxUtils.isVarColor(d))&&(e=d);e=null!=e?e:null!=b?b:mxUtils.getInverseColor(d);return{light:d,dark:e}},getInverseColor:function(a,b,c){function d(m){return Math.round(b/100*(255-m)+m*(1-b/100))}function e(m){return Math.round(Math.max(0,Math.min(255,m)))}c=+null!=c?c:180;b=null!=b?b:93;var f=0,g=0,k=0;if("transparent"==a.toLowerCase())return a;k=mxUtils.parseColor(a);if(null==k)return a;f=k.r;g=k.g;k=k.b;f=d(f);g=d(g);k=d(k);a=[1,0,0,0,1,0,0,0,1];var l=Math.cos(c*Math.PI/180);c=Math.sin(c*Math.PI/180);a[0]=.2126+.7874*l-.2126*c;a[1]=.7152-.7152*l-.7152*c;a[2]=.0722-.0722*l+.9278*c;a[3]=.2126-.2126*l+.143*c;a[4]=.7152+(1-.7152)*l+.14*c;a[5]=.0722-.0722*l-.283*c;a[6]=.2126-.2126*l-.7874*c;a[7]=.7152-.7152*l+.7152*c;a[8]=.0722+.9278*l+.0722*c;c=e(a[0]*+f+a[1]*g+a[2]*k);l=e(a[3]*f+a[4]*g+a[5]*k);f=e(a[6]*f+a[7]*g+a[8]*k);return"#"+(16777216|c<<16|l<<8|f).toString(16).slice(1)},addAlphaToColor:function(a,b){null!=b&&null!=a&&"transparent"!=a&&(a=mxUtils.parseColor(a),a="rgba("+a.r+","+a.g+","+a.b+","+b+")");return a},getLightDarkColor:function(a,b,c,d){var e={light:"transparent",dark:"transparent",cssText:"transparent"};null!=a&&a!=mxConstants.NONE&&("string"===typeof a?(a=mxUtils.parseLightDarkColor(a,c,d),e.light=mxUtils.addAlphaToColor(a.light,+b),e.dark=mxUtils.addAlphaToColor(a.dark,b),e.cssText=mxUtils.lightDarkColorSupported?e.light==e.dark?e.light:"light-dark("+e.light+", "+e.dark+")":mxUtils.preferDarkColor?e.dark:e.light):(e.light=a,e.dark=a,e.cssText=a));return e},invertLightDarkColor:function(a){var b={};b.light=a.dark;b.dark=a.light;b.cssText=b.light==b.dark?b.light:"light-dark("+b.light+", "+b.dark+")";return b},getColor:function(a,b,c){a=null!=a?a[b]:null;null==a?a=c:a==mxConstants.NONE&&(a=null);return a},isEmptyObject:function(a){for(var b in a)return!1;+return!0},clone:function(a,b,c){c=null!=c?c:!1;var d=null;if(null!=a&&"function"==typeof a.constructor)if(a.constructor===Element)d=a.cloneNode(null!=c?!c:!1);else{d=new a.constructor;for(var e in a)e!=mxObjectIdentity.FIELD_NAME&&(null==b||0>mxUtils.indexOf(b,e))&&(d[e]=c||"object"!=typeof a[e]?a[e]:mxUtils.clone(a[e]))}return d},equalPoints:function(a,b){if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b)for(var c=0;c<a.length;c++)if(null!=a[c]&&+null==b[c]||null==a[c]&&null!=b[c]||null!=a[c]&&null!=b[c]&&(a[c].x!=b[c].x||a[c].y!=b[c].y))return!1;return!0},equalEntries:function(a,b){var c=0;if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b){for(var d in b)c++;for(d in a)if(c--,!(mxUtils.isNaN(a[d])&&mxUtils.isNaN(b[d])||a[d]==b[d]))return!1}return 0==c},removeDuplicates:function(a){for(var b=new mxDictionary,c=[],d=0;d<a.length;d++)b.get(a[d])||(c.push(a[d]),b.put(a[d],!0));return c},+isNaN:function(a){return"number"==typeof a&&isNaN(a)},extend:function(a,b){var c=function(){};c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a},toString:function(a){var b="",c;for(c in a)try{if(null==a[c])b+=c+" = [null]\n";else if("function"==typeof a[c])b+=c+" => [Function]\n";else if("object"==typeof a[c]){var d=mxUtils.getFunctionName(a[c].constructor);b+=c+" => ["+d+"]\n"}else b+=c+" = "+a[c]+"\n"}catch(e){b+=c+"="+e.message}return b},toRadians:function(a){return Math.PI*a/+180},toDegree:function(a){return 180*a/Math.PI},arcToCurves:function(a,b,c,d,e,f,g,k,l){k-=a;l-=b;if(0===c||0===d)return A;c=Math.abs(c);d=Math.abs(d);var m=-k/2,n=-l/2,p=Math.cos(e*Math.PI/180);A=Math.sin(e*Math.PI/180);e=p*m+A*n;m=-1*A*m+p*n;n=e*e;var q=m*m,r=c*c,t=d*d,u=n/r+q/t;1<u?(c*=Math.sqrt(u),d*=Math.sqrt(u),f=0):(u=1,f===g&&(u=-1),f=u*Math.sqrt((r*t-r*q-t*n)/(r*q+t*n)));n=f*c*m/d;q=-1*f*d*e/c;k=p*n-A*q+k/2;l=A*n+p*q+l/2;r=Math.atan2((m-q)/d,(e-n)/c)-Math.atan2(0,1);f=0<=r?r:2*Math.PI+r;+r=Math.atan2((-m-q)/d,(-e-n)/c)-Math.atan2((m-q)/d,(e-n)/c);e=0<=r?r:2*Math.PI+r;0==g&&0<e?e-=2*Math.PI:0!=g&&0>e&&(e+=2*Math.PI);g=2*e/Math.PI;g=Math.ceil(0>g?-1*g:g);e/=g;m=8/3*Math.sin(e/4)*Math.sin(e/4)/Math.sin(e/2);n=p*c;p*=d;c*=A;d*=A;var x=Math.cos(f),y=Math.sin(f);q=-m*(n*y+d*x);r=-m*(c*y-p*x);for(var A=[],z=0;z<g;++z){f+=e;x=Math.cos(f);y=Math.sin(f);t=n*x-d*y+k;u=c*x+p*y+l;var C=-m*(n*y+d*x);x=-m*(c*y-p*x);y=6*z;A[y]=Number(q+a);A[y+1]=Number(r+b);A[y+2]=Number(t-C+a);A[y+3]=Number(u-x++b);A[y+4]=Number(t+a);A[y+5]=Number(u+b);q=t+C;r=u+x}return A},getBoundingBox:function(a,b,c){var d=null;if(null!=a&&null!=b&&0!=b){b=mxUtils.toRadians(b);d=Math.cos(b);var e=Math.sin(b);c=null!=c?c:new mxPoint(a.x+a.width/2,a.y+a.height/2);var f=new mxPoint(a.x,a.y);b=new mxPoint(a.x+a.width,a.y);var g=new mxPoint(b.x,a.y+a.height);a=new mxPoint(a.x,g.y);f=mxUtils.getRotatedPoint(f,d,e,c);b=mxUtils.getRotatedPoint(b,d,e,c);g=mxUtils.getRotatedPoint(g,d,e,c);a=mxUtils.getRotatedPoint(a,d,e,c);d=new mxRectangle(f.x,+f.y,0,0);d.add(new mxRectangle(b.x,b.y,0,0));d.add(new mxRectangle(g.x,g.y,0,0));d.add(new mxRectangle(a.x,a.y,0,0))}return d},getRotatedPoint:function(a,b,c,d){d=null!=d?d:new mxPoint;var e=a.x-d.x;a=a.y-d.y;return new mxPoint(e*b-a*c+d.x,a*b+e*c+d.y)},getPortConstraints:function(a,b,c,d){b=mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT,mxUtils.getValue(b.style,c?mxConstants.STYLE_SOURCE_PORT_CONSTRAINT:mxConstants.STYLE_TARGET_PORT_CONSTRAINT,null));if(null==b)return d;d=b.toString();+b=mxConstants.DIRECTION_MASK_NONE;c=0;1==mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT_ROTATION,0)&&(c=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0));a=0;45<c?(a=1,135<=c&&(a=2)):-45>c&&(a=3,-135>=c&&(a=2));if(0<=d.indexOf(mxConstants.DIRECTION_NORTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:b|=mxConstants.DIRECTION_MASK_EAST;break;case 2:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:b|=mxConstants.DIRECTION_MASK_WEST}if(0<=d.indexOf(mxConstants.DIRECTION_WEST))switch(a){case 0:b|=+mxConstants.DIRECTION_MASK_WEST;break;case 1:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:b|=mxConstants.DIRECTION_MASK_EAST;break;case 3:b|=mxConstants.DIRECTION_MASK_SOUTH}if(0<=d.indexOf(mxConstants.DIRECTION_SOUTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:b|=mxConstants.DIRECTION_MASK_WEST;break;case 2:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:b|=mxConstants.DIRECTION_MASK_EAST}if(0<=d.indexOf(mxConstants.DIRECTION_EAST))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_EAST;+break;case 1:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:b|=mxConstants.DIRECTION_MASK_WEST;break;case 3:b|=mxConstants.DIRECTION_MASK_NORTH}return b},reversePortConstraints:function(a){var b=(a&mxConstants.DIRECTION_MASK_WEST)<<3;b|=(a&mxConstants.DIRECTION_MASK_NORTH)<<1;b|=(a&mxConstants.DIRECTION_MASK_SOUTH)>>1;return b|(a&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(a,b,c){var d=-1;if(0<a.absolutePoints.length)for(var e=a.absolutePoints[0],f=null,g=1;g<a.absolutePoints.length;g++){var k=+a.absolutePoints[g];e=mxUtils.ptSegDistSq(e.x,e.y,k.x,k.y,b,c);if(null==f||e<f)f=e,d=g-1;e=k}return d},getDirectedBounds:function(a,b,c,d,e){var f=mxUtils.getValue(c,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);d=null!=d?d:mxUtils.getValue(c,mxConstants.STYLE_FLIPH,!1);e=null!=e?e:mxUtils.getValue(c,mxConstants.STYLE_FLIPV,!1);b.x=Math.round(Math.max(0,Math.min(a.width,b.x)));b.y=Math.round(Math.max(0,Math.min(a.height,b.y)));b.width=Math.round(Math.max(0,Math.min(a.width,b.width)));b.height=+Math.round(Math.max(0,Math.min(a.height,b.height)));if(e&&(f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH)||d&&(f==mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST))c=b.x,b.x=b.width,b.width=c;if(d&&(f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH)||e&&(f==mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST))c=b.y,b.y=b.height,b.height=c;d=mxRectangle.fromRectangle(b);f==mxConstants.DIRECTION_SOUTH?(d.y=b.x,d.x=b.height,d.width=b.y,d.height=b.width):f==+mxConstants.DIRECTION_WEST?(d.y=b.height,d.x=b.width,d.width=b.x,d.height=b.y):f==mxConstants.DIRECTION_NORTH&&(d.y=b.width,d.x=b.y,d.width=b.height,d.height=b.x);return new mxRectangle(a.x+d.x,a.y+d.y,a.width-d.width-d.x,a.height-d.height-d.y)},getPerimeterPoint:function(a,b,c){for(var d=null,e=0;e<a.length-1;e++){var f=mxUtils.intersection(a[e].x,a[e].y,a[e+1].x,a[e+1].y,b.x,b.y,c.x,c.y);if(null!=f){var g=c.x-f.x,k=c.y-f.y;f={p:f,distSq:k*k+g*g};null!=f&&(null==d||d.distSq>f.distSq)&&(d=f)}}return null!=+d?d.p:null},intersectsPoints:function(a,b){for(var c=0;c<b.length-1;c++)if(mxUtils.rectangleIntersectsSegment(a,b[c],b[c+1]))return!0;return!1},rectangleIntersectsSegment:function(a,b,c){var d=a.y,e=a.x,f=d+a.height,g=e+a.width;a=b.x;var k=c.x;b.x>c.x&&(a=c.x,k=b.x);k>g&&(k=g);a<e&&(a=e);if(a>k)return!1;e=b.y;g=c.y;var l=c.x-b.x;1E-7<Math.abs(l)&&(c=(c.y-b.y)/l,b=b.y-c*b.x,e=c*a+b,g=c*k+b);e>g&&(b=g,g=e,e=b);g>f&&(g=f);e<d&&(e=d);return e>g?!1:!0},contains:function(a,b,c){return a.x<=b&&a.x+a.width>=+b&&a.y<=c&&a.y+a.height>=c},intersects:function(a,b,c){var d=a.width,e=a.height,f=b.width,g=b.height;if(!c&&(0>=f||0>=g||0>=d||0>=e))return!1;c=a.x;a=a.y;var k=b.x;b=b.y;f+=k;g+=b;d+=c;e+=a;return(f<k||f>c)&&(g<b||g>a)&&(d<c||d>k)&&(e<a||e>b)},intersectsHotspot:function(a,b,c,d,e,f){d=null!=d?d:1;e=null!=e?e:0;f=null!=f?f:0;if(0<d){var g=a.getCenterX(),k=a.getCenterY(),l=a.width,m=a.height,n=mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE)*a.view.scale;0<n&&(mxUtils.getValue(a.style,mxConstants.STYLE_HORIZONTAL,+!0)?(k=a.y+n/2,m=n):(g=a.x+n/2,l=n));l=Math.max(e,l*d);m=Math.max(e,m*d);0<f&&(l=Math.min(l,f),m=Math.min(m,f));d=new mxRectangle(g-l/2,k-m/2,l,m);g=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)||0);0!=g&&(e=Math.cos(-g),f=Math.sin(-g),g=new mxPoint(a.getCenterX(),a.getCenterY()),a=mxUtils.getRotatedPoint(new mxPoint(b,c),e,f,g),b=a.x,c=a.y);return mxUtils.contains(d,b,c)}return!0},getOffset:function(a,b){for(var c=0,d=0,e=!1,f=a,g=document.body,k=document.documentElement;null!=+f&&f!=g&&f!=k&&!e;){var l=mxUtils.getCurrentStyle(f);null!=l&&(e=e||"fixed"==l.position);f=f.parentNode}b||e||(b=mxUtils.getDocumentScrollOrigin(a.ownerDocument),c+=b.x,d+=b.y);a=a.getBoundingClientRect();null!=a&&(c+=a.left,d+=a.top);return new mxPoint(c,d)},getDocumentScrollOrigin:function(a){a=a.defaultView||a.parentWindow;return new mxPoint(null!=a&&void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,null!=a&&void 0!==window.pageYOffset?+window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)},getScrollOrigin:function(a,b,c){b=null!=b?b:!1;c=null!=c?c:!0;for(var d=null!=a?a.ownerDocument:document,e=d.body,f=d.documentElement,g=new mxPoint,k=!1;null!=a&&a!=e&&a!=f;){isNaN(a.scrollLeft)||isNaN(a.scrollTop)||(g.x+=a.scrollLeft,g.y+=a.scrollTop);var l=mxUtils.getCurrentStyle(a);null!=l&&(k=k||"fixed"==l.position);a=b?a.parentNode:null}!k&&c&&(a=mxUtils.getDocumentScrollOrigin(d),g.x+=a.x,g.y+=+a.y);return g},convertPoint:function(a,b,c){var d=mxUtils.getScrollOrigin(a,!1);a=mxUtils.getOffset(a);a.x-=d.x;a.y-=d.y;return new mxPoint(b-a.x,c-a.y)},removeJavascriptProtocol:function(a){for(a=null!=a?mxUtils.zapGremlins(a):null;null!=a&&"javascript:"===mxUtils.ltrim(a.toLowerCase()).substring(0,11);)a=a.substring(a.toLowerCase().indexOf(":")+1);return a},zapGremlins:function(a){for(var b=0,c=[],d=0;d<a.length;d++){var e=a.charCodeAt(d);(32<=e||9==e||10==e||13==e)&&65535!=e&&65534!=e||(c.push(a.substring(b,+d)),b=d+1)}0<b&&b<a.length&&c.push(a.substring(b));return 0==c.length?a:c.join("")},ltrim:function(a,b){return null!=a?a.replace(new RegExp("^["+(b||"\\s|\\0")+"]+","g"),""):null},rtrim:function(a,b){return null!=a?a.replace(new RegExp("["+(b||"\\s|\\0")+"]+$","g"),""):null},trim:function(a,b){return mxUtils.ltrim(mxUtils.rtrim(a,b),b)},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)&&("string"!=typeof a||0>a.toLowerCase().indexOf("0x"))},isInteger:function(a){return String(parseInt(a))===+String(a)},mod:function(a,b){return(a%b+b)%b},intersection:function(a,b,c,d,e,f,g,k){var l=(k-f)*(c-a)-(g-e)*(d-b);g=((g-e)*(b-f)-(k-f)*(a-e))/l;e=((c-a)*(b-f)-(d-b)*(a-e))/l;return 0<=g&&1>=g&&0<=e&&1>=e?new mxPoint(a+g*(c-a),b+g*(d-b)):null},ptSegDistSq:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;0>=e*c+f*d?c=0:(e=c-e,f=d-f,a=e*c+f*d,c=0>=a?0:a*a/(c*c+d*d));e=e*e+f*f-c;0>e&&(e=0);return e},ptLineDist:function(a,b,c,d,e,f){return Math.abs((d-b)*e-(c-a)*f+c*b-d*a)/Math.sqrt((d-b)*(d-b)+(c-a)*(c-a))},+relativeCcw:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;a=e*d-f*c;0==a&&(a=e*c+f*d,0<a&&(a=(e-c)*c+(f-d)*d,0>a&&(a=0)));return 0>a?-1:0<a?1:0},animateChanges:function(a,b){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(a,b,c){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(a,b,c,d,e,f){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(a,b){mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?a.style.filter=100<=b?+"":"alpha(opacity="+b+")":a.style.opacity=b/100},createElementNs:function(a,b,c){if(null!=a.createElementNS)return a.createElementNS(b,c);a=a.createElement(c);null!=namespace&&a.setAttribute("xmlns",b);return a},createImage:function(a){var b=document.createElement("img");b.setAttribute("src",a);b.setAttribute("border","0");return b},sortCells:function(a,b){b=null!=b?b:!0;var c=new mxDictionary;a.sort(function(d,e){var f=c.get(d);null==f&&(f=mxCellPath.create(d).split(mxCellPath.PATH_SEPARATOR),c.put(d,+f));d=c.get(e);null==d&&(d=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),c.put(e,d));e=mxCellPath.compare(f,d);return 0==e?0:0<e==b?1:-1});return a},getStylename:function(a){return null!=a&&(a=a.split(";")[0],0>a.indexOf("="))?a:""},getStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;c<a.length;c++)0>a[c].indexOf("=")&&b.push(a[c])}return b},indexOfStylename:function(a,b){if(null!=a&&null!=b){a=a.split(";");for(var c=0,d=0;d<a.length;d++){if(a[d]==b)return c;c+=a[d].length++1}}return-1},addStylename:function(a,b){0>mxUtils.indexOfStylename(a,b)&&(null==a?a="":0<a.length&&";"!=a.charAt(a.length-1)&&(a+=";"),a+=b);return a},removeStylename:function(a,b){var c=[];if(null!=a){a=a.split(";");for(var d=0;d<a.length;d++)a[d]!=b&&c.push(a[d])}return c.join(";")},removeAllStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;c<a.length;c++)0<=a[c].indexOf("=")&&b.push(a[c])}return b.join(";")},setCellStyles:function(a,b,c,d){if(null!=b&&0<b.length){a.beginUpdate();+try{for(var e=0;e<b.length;e++)if(null!=b[e]){var f=mxUtils.setStyle(a.getStyle(b[e]),c,d);a.setStyle(b[e],f)}}finally{a.endUpdate()}}},parseColor:function(a,b){b=null!=b?b:1;var c=null;if(null!=a&&a!=mxConstants.NONE){if(mxUtils.isRgbColor(a)){a=a.replace(/[^\d,]/g,"").split(",");c=parseInt(a[0]);var d=parseInt(a[1]),e=parseInt(a[2]);4==a.length&&(b=parseFloat(a[3]))}else mxUtils.isHexColor(a)||(a=mxUtils.color2hex(a)),a=a.substring(1),c=parseInt(a.substr(0,2),16),d=parseInt(a.substr(2,2),16),e=+parseInt(a.substr(4,2),16),6<a.length&&(b=parseInt(a.substr(6,2),16)/255);c={r:c,g:d,b:e,a:b}}return c},hex2rgb:function(a){var b=mxUtils.parseColor(a);null!=b&&(a="rgb("+b.r+", "+b.g+", "+b.b+")");return a},hex2rgba:function(a,b){b=mxUtils.parseColor(a,b);null!=b&&(a="rgba("+b.r+", "+b.g+", "+b.b+", "+b.a+")");return a},rgba2hex:function(a){var b=mxUtils.parseColor(a);return null!=b?"#"+("0"+b.r.toString(16)).slice(-2)+("0"+b.g.toString(16)).slice(-2)+("0"+b.b.toString(16)).slice(-2):a},color2hex:function(a,+b){b=null!=b?b:"#000000";try{null!=a&&(a=String(a).replace(/\s/g,""),a.toLowerCase()==mxUtils.normalizedValidInvalidColor?b="#000000":(mxUtils.canvasContext.fillStyle=mxUtils.validInvalidColor,mxUtils.canvasContext.fillStyle=a,mxUtils.canvasContext.fillStyle!=mxUtils.validInvalidColor&&(b=mxUtils.canvasContext.fillStyle)))}catch(c){}return b},setStyle:function(a,b,c){var d=null!=c&&("undefined"==typeof c.length||0<c.length);if(null==a||0==a.length)d&&(a=b+"="+c+";");else if(a.substring(0,b.length++1)==b+"="){var e=a.indexOf(";");a=d?b+"="+c+(0>e?";":a.substring(e)):0>e||e==a.length-1?"":a.substring(e+1)}else{var f=a.indexOf(";"+b+"=");0>f?d&&(d=";"==a.charAt(a.length-1)?"":";",a=a+d+b+"="+c+";"):(e=a.indexOf(";",f+1),a=d?a.substring(0,f+1)+b+"="+c+(0>e?";":a.substring(e)):a.substring(0,f)+(0>e?";":a.substring(e)))}return a},setCellStyleFlags:function(a,b,c,d,e){if(null!=b&&0<b.length){a.beginUpdate();try{for(var f=0;f<b.length;f++)if(null!=b[f]){var g=mxUtils.setStyleFlag(a.getStyle(b[f]),+c,d,e);a.setStyle(b[f],g)}}finally{a.endUpdate()}}},setStyleFlag:function(a,b,c,d){if(null==a||0==a.length)a=d||null==d?b+"="+c:b+"=0";else{var e=a.indexOf(b+"=");if(0>e)e=";"==a.charAt(a.length-1)?"":";",a=d||null==d?a+e+b+"="+c:a+e+b+"=0";else{var f=a.indexOf(";",e),g=0>f?a.substring(e+b.length+1):a.substring(e+b.length+1,f);g=null==d?parseInt(g)^c:d?parseInt(g)|c:parseInt(g)&~c;a=a.substring(0,e)+b+"="+g+(0<=f?a.substring(f):"")}}return a},getAlignmentAsPoint:function(a,b){var c=-.5,d=-.5;a==mxConstants.ALIGN_LEFT?+c=0:a==mxConstants.ALIGN_RIGHT&&(c=-1);b==mxConstants.ALIGN_TOP?d=0:b==mxConstants.ALIGN_BOTTOM&&(d=-1);return new mxPoint(c,d)},getSizeForString:function(a,b,c,d,e){b=null!=b?b:mxConstants.DEFAULT_FONTSIZE;c=null!=c?c:mxConstants.DEFAULT_FONTFAMILY;var f=document.createElement("div");f.style.fontFamily=c;f.style.fontSize=Math.round(b)+"px";f.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?b*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*mxSvgCanvas2D.prototype.lineHeightCorrection;null!=+e&&((e&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(f.style.fontWeight="bold"),(e&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(f.style.fontStyle="italic"),b=[],(e&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&b.push("underline"),(e&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&b.push("line-through"),0<b.length&&(f.style.textDecoration=b.join(" ")));f.style.position="absolute";f.style.visibility="hidden";f.style.display="inline-block";f.style.zoom="1";null!=+d?(f.style.width=d+"px",f.style.whiteSpace="normal"):f.style.whiteSpace="nowrap";f.innerHTML=a;document.body.appendChild(f);a=new mxRectangle(0,0,f.offsetWidth,f.offsetHeight);document.body.removeChild(f);return a},getViewXml:function(a,b,c,d,e){d=null!=d?d:0;e=null!=e?e:0;b=null!=b?b:1;null==c&&(c=[a.getModel().getRoot()]);var f=a.getView(),g=null,k=f.isEventsEnabled();f.setEventsEnabled(!1);var l=f.drawPane,m=f.overlayPane;a.dialect==mxConstants.DIALECT_SVG?(f.drawPane=document.createElementNS(mxConstants.NS_SVG,+"g"),f.canvas.appendChild(f.drawPane),f.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g")):(f.drawPane=f.drawPane.cloneNode(!1),f.canvas.appendChild(f.drawPane),f.overlayPane=f.overlayPane.cloneNode(!1));f.canvas.appendChild(f.overlayPane);var n=f.getTranslate();f.translate=new mxPoint(d,e);b=new mxTemporaryCellStates(a.getView(),b,c);try{g=(new mxCodec).encode(a.getView())}finally{b.destroy(),f.translate=n,f.canvas.removeChild(f.drawPane),f.canvas.removeChild(f.overlayPane),f.drawPane=+l,f.overlayPane=m,f.setEventsEnabled(k)}return g},getScaleForPageCount:function(a,b,c,d){if(1>a)return 1;c=null!=c?c:mxConstants.PAGE_FORMAT_A4_PORTRAIT;d=null!=d?d:0;var e=c.width-2*d;c=c.height-2*d;d=mxRectangle.fromRectangle(b.getGraphBounds());b=b.getView().getScale();d.width/=b;d.height/=b;b=d.width;var f=Math.sqrt(a);d=Math.sqrt(b/d.height/(e/c));c=f*d;d=f/d;if(1>c&&d>a){var g=d/a;d=a;c/=g}1>d&&c>a&&(g=c/a,c=a,d/=g);g=Math.ceil(c)*Math.ceil(d);for(f=0;g>a;){g=Math.floor(c)/c;var k=Math.floor(d)/+d;1==g&&(g=Math.floor(c-1)/c);1==k&&(k=Math.floor(d-1)/d);g=g>k?g:k;c*=g;d*=g;g=Math.ceil(c)*Math.ceil(d);f++;if(10<f)break}return e*c/b*.99999},show:function(a,b,c,d,e,f){c=null!=c?c:0;d=null!=d?d:0;null==b?b=window.open().document:b.open();9==document.documentMode&&b.writeln('\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=9"><![endif]--\x3e');var g=a.getGraphBounds(),k=Math.ceil(c-g.x),l=Math.ceil(d-g.y);null==e&&(e=Math.ceil(g.width+c)+Math.ceil(Math.ceil(g.x)-g.x));null==f&&(f=+Math.ceil(g.height+d)+Math.ceil(Math.ceil(g.y)-g.y));if(mxClient.IS_IE||11==document.documentMode){d="<html><head>";g=document.getElementsByTagName("base");for(c=0;c<g.length;c++)d+=g[c].outerHTML;d+="<style>";for(c=0;c<document.styleSheets.length;c++)try{d+=document.styleSheets[c].cssText}catch(m){}d=d+'</style></head><body style="margin:0px;"><div style="position:absolute;overflow:hidden;width:'+(e+"px;height:"+f+'px;"><div style="position:relative;left:'+k+"px;top:"+l+'px;">')+a.container.innerHTML;+b.writeln(d+"</div></div></body><html>");b.close()}else{b.writeln("<html><head>");g=document.getElementsByTagName("base");for(c=0;c<g.length;c++)b.writeln(mxUtils.getOuterHtml(g[c]));d=document.getElementsByTagName("link");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));d=document.getElementsByTagName("style");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));b.writeln('</head><body style="margin:0px;"></body></html>');b.close();c=b.createElement("div");c.position="absolute";+c.overflow="hidden";c.style.width=e+"px";c.style.height=f+"px";e=b.createElement("div");e.style.position="absolute";e.style.left=k+"px";e.style.top=l+"px";f=a.container.firstChild;for(d=null;null!=f;)g=f.cloneNode(!0),f==a.view.drawPane.ownerSVGElement?(c.appendChild(g),d=g):e.appendChild(g),f=f.nextSibling;b.body.appendChild(c);null!=e.firstChild&&b.body.appendChild(e);null!=d&&(d.style.minWidth="",d.style.minHeight="",d.firstChild.setAttribute("transform","translate("+k+","+l+")"))}mxUtils.removeCursors(b.body);+return b},printScreen:function(a){var b=window.open();mxUtils.show(a,b.document);a=function(){b.focus();b.print();b.close()};mxClient.IS_GC?b.setTimeout(a,500):a()},popup:function(a,b){if(b){var c=document.createElement("div");c.style.overflow="scroll";c.style.width="636px";c.style.height="460px";b=document.createElement("pre");b.innerHTML=mxUtils.htmlEntities(a,!1).replace(/\n/g,"<br>").replace(/ /g," ");c.appendChild(b);c=new mxWindow("Popup Window",c,document.body.clientWidth/2-320,Math.max(document.body.clientHeight||+0,document.documentElement.clientHeight)/2-240,640,480,!1,!0);c.setClosable(!0);c.setVisible(!0)}else mxClient.IS_NS?(c=window.open(),c.document.writeln("<pre>"+mxUtils.htmlEntities(a)+"</pre"),c.document.close()):(c=window.open(),b=c.document.createElement("pre"),b.innerHTML=mxUtils.htmlEntities(a,!1).replace(/\n/g,"<br>").replace(/ /g," "),c.document.body.appendChild(b))},alert:function(a){alert(a)},prompt:function(a,b){return prompt(a,null!=b?b:"")},confirm:function(a){return confirm(a)},+error:function(a,b,c,d){var e=document.createElement("div");e.style.padding="20px";var f=document.createElement("img");f.setAttribute("src",d||mxUtils.errorImage);f.setAttribute("valign","bottom");f.style.verticalAlign="middle";e.appendChild(f);e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));mxUtils.write(e,a);a=document.body.clientWidth;d=document.body.clientHeight||document.documentElement.clientHeight;var g=new mxWindow(mxResources.get(mxUtils.errorResource)||+mxUtils.errorResource,e,(a-b)/2,d/4,b,null,!1,!0);c&&(mxUtils.br(e),b=document.createElement("p"),c=document.createElement("button"),mxClient.IS_IE?c.style.cssText="float:right":c.setAttribute("style","float:right"),mxEvent.addListener(c,"click",function(k){g.destroy()}),mxUtils.write(c,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),b.appendChild(c),e.appendChild(b),mxUtils.br(e),g.setClosable(!0));g.setVisible(!0);return g},makeDraggable:function(a,b,c,d,e,f,g,k,l,m){a=new mxDragSource(a,+c);a.dragOffset=new mxPoint(null!=e?e:0,null!=f?f:mxConstants.TOOLTIP_VERTICAL_OFFSET);a.autoscroll=g;a.setGuidesEnabled(!1);null!=l&&(a.highlightDropTargets=l);null!=m&&(a.getDropTarget=m);a.getGraphForEvent=function(n){return"function"==typeof b?b(n):b};null!=d&&(a.createDragElement=function(){return d.cloneNode(!0)},k&&(a.createPreviewElement=function(n){var p=d.cloneNode(!0),q=parseInt(p.style.width),r=parseInt(p.style.height);p.style.width=Math.round(q*n.view.scale)+"px";p.style.height=Math.round(r*+n.view.scale)+"px";return p}));return a},format:function(a){return parseFloat(parseFloat(a).toFixed(2))}},mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"#808080",+VML_SHADOWCOLOR:"#808080",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_BLUR:2,SHADOW_OPACITY:1,NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",OUTLINE_HIGHLIGHT_COLOR:"#00FF00",OUTLINE_HIGHLIGHT_STROKEWIDTH:5,+HIGHLIGHT_STROKEWIDTH:3,HIGHLIGHT_SIZE:2,HIGHLIGHT_OPACITY:100,CURSOR_MOVABLE_VERTEX:"move",CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_TERMINAL_HANDLE:"pointer",CURSOR_BEND_HANDLE:"crosshair",CURSOR_VIRTUAL_BEND_HANDLE:"crosshair",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",+VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:6,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",+DEFAULT_FONTSIZE:11,DEFAULT_TEXT_DIRECTION:"",LINE_HEIGHT:1.2,WORD_WRAP:"normal",ABSOLUTE_LINE_HEIGHT:!1,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:0,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,827,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,827),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,+0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_PORT_CONSTRAINT_ROTATION:"portConstraintRotation",STYLE_SOURCE_PORT_CONSTRAINT:"sourcePortConstraint",STYLE_TARGET_PORT_CONSTRAINT:"targetPortConstraint",STYLE_OPACITY:"opacity",STYLE_FILL_OPACITY:"fillOpacity",STYLE_FILL_STYLE:"fillStyle",STYLE_STROKE_OPACITY:"strokeOpacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_TEXT_DIRECTION:"textDirection",+STYLE_OVERFLOW:"overflow",STYLE_BLOCK_SPACING:"blockSpacing",STYLE_ORTHOGONAL:"orthogonal",STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_DX:"exitDx",STYLE_EXIT_DY:"exitDy",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_DX:"entryDx",STYLE_ENTRY_DY:"entryDy",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_POINTER_EVENTS:"pointerEvents",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",+STYLE_MARGIN:"margin",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_WIDTH:"labelWidth",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",+STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",+STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_TEXT_SHADOW:"textShadow",STYLE_SHADOW_OFFSET_X:"shadowOffsetX",STYLE_SHADOW_OFFSET_Y:"shadowOffsetY",STYLE_SHADOW_BLUR:"shadowBlur",STYLE_SHADOWCOLOR:"shadowColor",STYLE_SHADOW_OPACITY:"shadowOpacity",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",+STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_SWIMLANE_HEAD:"swimlaneHead",STYLE_SWIMLANE_BODY:"swimlaneBody",STYLE_ENDFILL:"endFill",STYLE_ENDFILLCOLOR:"endFillColor",STYLE_STARTFILL:"startFill",STYLE_STARTFILLCOLOR:"startFillColor",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_FIX_DASH:"fixDash",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_ABSOLUTE_ARCSIZE:"absoluteArcSize",+STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ANCHOR_POINT_DIRECTION:"anchorPointDirection",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",+STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_ASPECT:"aspect",STYLE_AUTOSIZE:"autosize",STYLE_AUTOSIZE_GRID:"autosizeGrid",STYLE_FIXED_WIDTH:"fixedWidth",STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BACKGROUND_OUTLINE:"backgroundOutline",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_RESIZE_WIDTH:"resizeWidth",STYLE_RESIZE_HEIGHT:"resizeHeight",STYLE_ROTATABLE:"rotatable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",+STYLE_EDGE:"edgeStyle",STYLE_JETTY_SIZE:"jettySize",STYLE_SOURCE_JETTY_SIZE:"sourceJettySize",STYLE_TARGET_JETTY_SIZE:"targetJettySize",STYLE_LOOP:"loopStyle",STYLE_ORTHOGONAL_LOOP:"orthogonalLoop",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",STYLE_CLIP_PATH:"clipPath",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_STRIKETHROUGH:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",+SHAPE_ARROW:"arrow",SHAPE_ARROW_CONNECTOR:"arrowConnector",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_CLASSIC_THIN:"classicThin",ARROW_BLOCK:"block",ARROW_BLOCK_THIN:"blockThin",ARROW_OPEN:"open",ARROW_OPEN_THIN:"openThin",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",+ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",DIRECTION_WEST:"west",DIRECTION_RADIAL:"radial",TEXT_DIRECTION_DEFAULT:"",TEXT_DIRECTION_AUTO:"auto",TEXT_DIRECTION_LTR:"ltr",TEXT_DIRECTION_RTL:"rtl",TEXT_DIRECTION_VERTICAL_LR:"vertical-lr",TEXT_DIRECTION_VERTICAL_RL:"vertical-rl",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,+ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_HEXAGON:"hexagonPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};function mxEventObject(a){this.name=a;this.properties=[];for(var b=1;b<arguments.length;b+=2)null!=arguments[b+1]&&(this.properties[arguments[b]]=arguments[b+1])}mxEventObject.prototype.name=null;mxEventObject.prototype.properties=null;mxEventObject.prototype.consumed=!1;mxEventObject.prototype.getName=function(){return this.name};mxEventObject.prototype.getProperties=function(){return this.properties};mxEventObject.prototype.getProperty=function(a){return this.properties[a]};mxEventObject.prototype.isConsumed=function(){return this.consumed};mxEventObject.prototype.consume=function(){this.consumed=!0};function mxMouseEvent(a,b){this.evt=a;this.sourceState=this.state=b}mxMouseEvent.prototype.consumed=!1;mxMouseEvent.prototype.evt=null;mxMouseEvent.prototype.graphX=null;mxMouseEvent.prototype.graphY=null;mxMouseEvent.prototype.state=null;mxMouseEvent.prototype.sourceState=null;mxMouseEvent.prototype.getEvent=function(){return this.evt};mxMouseEvent.prototype.getSource=function(){return mxEvent.getSource(this.evt)};mxMouseEvent.prototype.isSource=function(a){return null!=a?mxUtils.isAncestorNode(a.node,this.getSource()):!1};mxMouseEvent.prototype.getX=function(){return mxEvent.getClientX(this.getEvent())};mxMouseEvent.prototype.getY=function(){return mxEvent.getClientY(this.getEvent())};mxMouseEvent.prototype.getGraphX=function(){return this.graphX};mxMouseEvent.prototype.getGraphY=function(){return this.graphY};@@ -442,7 +442,7 @@ mxShape.prototype.outline=!1;mxShape.prototype.visible=!0;mxShape.prototype.useSmxShape.prototype.getSvgScreenOffset=function(){return 1==mxUtils.mod(Math.max(1,Math.round((this.stencil&&"inherit"!=this.stencil.strokewidth?Number(this.stencil.strokewidth):this.strokewidth)*this.scale)),2)?.5:0};mxShape.prototype.create=function(a){return null!=a&&null!=a.ownerSVGElement?this.createSvg(a):this.createHtml(a)};mxShape.prototype.createSvg=function(){return document.createElementNS(mxConstants.NS_SVG,"g")};mxShape.prototype.createHtml=function(){var a=document.createElement("div");a.style.position="absolute";return a};mxShape.prototype.reconfigure=function(){this.redraw()};mxShape.prototype.redraw=function(){this.updateBoundsFromPoints();this.visible&&this.checkBounds()?(this.node.style.visibility="visible",this.clear(),"DIV"==this.node.nodeName?this.redrawHtmlShape():this.redrawShape()):(this.node.style.visibility="hidden",this.boundingBox=null)};mxShape.prototype.clear=function(){if(null!=this.node.ownerSVGElement)for(;null!=this.node.lastChild;)this.node.removeChild(this.node.lastChild);else this.node.style.cssText="position:absolute;"+(null!=this.cursor?"cursor:"+this.cursor+";":""),this.node.innerText=""};-mxShape.prototype.updateBoundsFromPoints=function(){var a=this.points;if(null!=a&&0<a.length&&null!=a[0]){this.bounds=new mxRectangle(Number(a[0].x),Number(a[0].y),this.scale,this.scale);for(var b=1;b<this.points.length;b++)null!=a[b]&&this.bounds.add(new mxRectangle(Number(a[b].x),Number(a[b].y),this.scale,this.scale))}};+mxShape.prototype.updateBoundsFromPoints=function(){var a=this.points;if(null!=a&&0<a.length&&null!=a[0]){this.bounds=new mxRectangle(Number(a[0].x),Number(a[0].y),this.scale,this.scale);for(var b=1;b<this.points.length;b++)null!=a[b]&&this.bounds.add(new mxRectangle(Number(a[b].x),Number(a[b].y),this.scale,this.scale))}};mxShape.prototype.styleChanged=function(a,b,c){};mxShape.prototype.getLabelBounds=function(a){var b=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),c=a;b!=mxConstants.DIRECTION_SOUTH&&b!=mxConstants.DIRECTION_NORTH&&null!=this.state&&null!=this.state.text&&this.state.text.isPaintBoundsInverted()&&(c=c.clone(),b=c.width,c.width=c.height,c.height=b);c=this.getLabelMargins(c);if(null!=c){var d="1"==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,!1),e="1"==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,!1);null!=this.state&&null!=this.state.text&&this.state.text.isPaintBoundsInverted()&&(b=c.x,c.x=c.height,c.height=c.width,c.width=c.y,c.y=b,b=d,d=e,e=b);return mxUtils.getDirectedBounds(a,c,this.style,d,e)}return a};mxShape.prototype.getLabelMargins=function(a){return null};mxShape.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&0<this.scale&&null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&0<this.bounds.width&&0<this.bounds.height};@@ -489,10 +489,10 @@ mxStencil.prototype.desc=null;mxStencil.prototype.constraints=null;mxStencil.promxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0];this.bgNode=this.desc.getElementsByTagName("background")[0];this.w0=Number(this.desc.getAttribute("w")||100);this.h0=Number(this.desc.getAttribute("h")||100);var a=this.desc.getAttribute("aspect");this.aspect=null!=a?a:"variable";a=this.desc.getAttribute("strokewidth");this.strokewidth=null!=a?a:"1"};mxStencil.prototype.parseConstraints=function(){var a=this.desc.getElementsByTagName("connections")[0];if(null!=a&&(a=mxUtils.getChildNodes(a),null!=a&&0<a.length)){this.constraints=[];for(var b=0;b<a.length;b++)this.constraints.push(this.parseConstraint(a[b]))}};mxStencil.prototype.parseConstraint=function(a){var b=Number(a.getAttribute("x")),c=Number(a.getAttribute("y")),d="1"==a.getAttribute("perimeter");a=a.getAttribute("name");return new mxConnectionConstraint(new mxPoint(b,c),d,a)};mxStencil.prototype.evaluateTextAttribute=function(a,b,c){b=this.evaluateAttribute(a,b,c);a=a.getAttribute("localized");if(mxStencil.defaultLocalized&&null==a||"1"==a)b=mxResources.get(b);return b};mxStencil.prototype.evaluateAttribute=function(a,b,c){b=a.getAttribute(b);null==b&&(a=mxUtils.getTextContent(a),null!=a&&mxStencil.allowEval&&(a=mxUtils.eval(a),"function"==typeof a&&(b=a(c))));return b};-mxStencil.prototype.drawShape=function(a,b,c,d,e,f,g){var k=a.states.slice(),l=mxUtils.getValue(b.style,mxConstants.STYLE_DIRECTION,null);l=this.computeAspect(b.style,c,d,e,f,l);var m=Math.min(l.width,l.height);m="inherit"==this.strokewidth?Number(mxUtils.getNumber(b.style,mxConstants.STYLE_STROKEWIDTH,1)):Number(this.strokewidth)*m;a.setStrokeWidth(m);null!=b.style&&"1"==mxUtils.getValue(b.style,mxConstants.STYLE_POINTER_EVENTS,"0")&&(a.setStrokeColor(mxConstants.NONE),a.rect(c,d,e,f),a.stroke(),-a.setStrokeColor(b.stroke));this.drawChildren(a,b,c,d,e,f,this.bgNode,l,!1,!0,g);this.drawChildren(a,b,c,d,e,f,this.fgNode,l,!0,!b.outline||null==b.style||0==mxUtils.getValue(b.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0),g);a.states.length!=k.length&&(a.states=k)};mxStencil.prototype.drawChildren=function(a,b,c,d,e,f,g,k,l,m,n){if(null!=g&&0<e&&0<f)for(c=g.firstChild;null!=c;)c.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(a,b,c,k,l,m,n),c=c.nextSibling};+mxStencil.prototype.drawShape=function(a,b,c,d,e,f,g){g=null!=g?g:null!=b&&null!=b.state?b.state.view.graph:null;var k=a.states.slice(),l=mxUtils.getValue(b.style,mxConstants.STYLE_DIRECTION,null);l=this.computeAspect(b.style,c,d,e,f,l);var m=Math.min(l.width,l.height);m="inherit"==this.strokewidth?Number(mxUtils.getNumber(b.style,mxConstants.STYLE_STROKEWIDTH,1)):Number(this.strokewidth)*m;a.setStrokeWidth(m);null!=b.style&&"1"==mxUtils.getValue(b.style,mxConstants.STYLE_POINTER_EVENTS,"0")&&(a.setStrokeColor(mxConstants.NONE),+a.rect(c,d,e,f),a.stroke(),a.setStrokeColor(b.stroke));this.drawChildren(a,b,c,d,e,f,this.bgNode,l,!1,!0,g);this.drawChildren(a,b,c,d,e,f,this.fgNode,l,!0,!b.outline||null==b.style||0==mxUtils.getValue(b.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0),g);a.states.length!=k.length&&(a.states=k)};mxStencil.prototype.drawChildren=function(a,b,c,d,e,f,g,k,l,m,n){if(null!=g&&0<e&&0<f)for(c=g.firstChild;null!=c;)c.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(a,b,c,k,l,m,n),c=c.nextSibling};mxStencil.prototype.computeAspect=function(a,b,c,d,e,f){a=b;b=d/this.w0;var g=e/this.h0;if(f=f==mxConstants.DIRECTION_NORTH||f==mxConstants.DIRECTION_SOUTH){g=d/this.h0;b=e/this.w0;var k=(d-e)/2;a+=k;c-=k}"fixed"==this.aspect&&(b=g=Math.min(b,g),f?(a+=(e-this.w0*b)/2,c+=(d-this.h0*g)/2):(a+=(d-this.w0*b)/2,c+=(e-this.h0*g)/2));return new mxRectangle(a,c,b,g)};-mxStencil.prototype.parseColor=function(a,b,c,d,e){"stroke"==d?d=b.stroke:"fill"==d?d=b.fill:"font"==d&&null!=b.style?d=mxUtils.getValue(b.style,mxConstants.STYLE_FONTCOLOR,"black"):null==b.style||mxUtils.isValidColor(d)||(a=mxUtils.getValue(b.style,d,mxConstants.NONE),"default"==a&&(a="fillcolor"==c.nodeName?e.shapeBackgroundColor:e.shapeForegroundColor),d=a);return d};+mxStencil.prototype.parseColor=function(a,b,c,d,e){"stroke"==d?d=b.stroke:"fill"==d?d=b.fill:"font"==d&&null!=b.style?d=mxUtils.getValue(b.style,mxConstants.STYLE_FONTCOLOR,"black"):null==b.style||mxUtils.isValidColor(d)||(a=mxUtils.getValue(b.style,d,mxConstants.NONE),"default"==a&&(a=null!=e?"fillcolor"==c.nodeName?e.shapeBackgroundColor:e.shapeForegroundColor:"#ffffff"),d=a);return d};mxStencil.prototype.drawNode=function(a,b,c,d,e,f,g){var k=c.nodeName,l=d.x,m=d.y,n=d.width,p=d.height,q=Math.min(n,p);if("save"==k)a.save();else if("restore"==k)a.restore();else if(f){if("path"==k){a.begin();q=!0;if("1"==c.getAttribute("rounded")){q=!1;for(var r=Number(c.getAttribute("arcSize")),t=0,u=[],x=c.firstChild;null!=x;){if(x.nodeType==mxConstants.NODETYPE_ELEMENT){var y=x.nodeName;if("move"==y||"line"==y)"move"!=y&&0!=u.length||u.push([]),u[u.length-1].push(new mxPoint(l+Number(x.getAttribute("x"))*n,m+Number(x.getAttribute("y"))*p)),t++;else{q=!0;break}}x=x.nextSibling}if(!q&&0<t)for(n=0;n<u.length;n++)p=!1,m=u[n][0],l=u[n][u[n].length-1],m.x==l.x&&m.y==l.y&&(u[n].pop(),p=!0),this.addPoints(a,u[n],!0,r,p);else q=!0}if(q)for(x=c.firstChild;null!=x;)x.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(a,b,x,d,e,f,g),x=x.nextSibling}else if("close"==k)a.close();else if("move"==k)a.moveTo(l+Number(c.getAttribute("x"))*n,m+Number(c.getAttribute("y"))*p);else if("line"==k)a.lineTo(l+Number(c.getAttribute("x"))*n,m+Number(c.getAttribute("y"))*p);else if("quad"==k)a.quadTo(l+Number(c.getAttribute("x1"))*n,m+Number(c.getAttribute("y1"))*p,l+Number(c.getAttribute("x2"))*n,m+Number(c.getAttribute("y2"))*p);else if("curve"==k)a.curveTo(l+Number(c.getAttribute("x1"))*n,m+Number(c.getAttribute("y1"))*p,l+Number(c.getAttribute("x2"))*n,m+Number(c.getAttribute("y2"))*p,l+Number(c.getAttribute("x3"))*n,m+Number(c.getAttribute("y3"))*p);else if("arc"==k)a.arcTo(Number(c.getAttribute("rx"))*n,Number(c.getAttribute("ry"))*@@ -1031,8 +1031,8 @@ this.initializeShape(a),this.createCellOverlays(a),this.installListeners(a),a.vinull!=a.shape.indicatorShape&&(a.shape.indicator=new a.shape.indicatorShape,a.shape.indicator.dialect=a.shape.dialect,a.shape.indicator.init(a.node),b=!0));null!=a.shape&&(this.createControl(a),b||this.isShapeInvalid(a,a.shape))&&(null!=a.absolutePoints?(a.shape.points=a.absolutePoints.slice(),a.shape.bounds=null):(a.shape.points=null,a.shape.bounds=new mxRectangle(a.x,a.y,a.width,a.height)),a.shape.scale=a.view.scale,(null==c||c)&&this.doRedrawShape(a),e=!0);return e};mxCellRenderer.prototype.doRedrawShape=function(a){a.shape.redraw()};mxCellRenderer.prototype.isShapeInvalid=function(a,b){return null==b.bounds||b.scale!=a.view.scale||null==a.absolutePoints&&!b.bounds.equals(a)||null!=a.absolutePoints&&!mxUtils.equalPoints(b.points,a.absolutePoints)};mxCellRenderer.prototype.destroy=function(a){null!=a.shape&&(null!=a.text&&(a.text.destroy(),a.text=null),null!=a.overlays&&(a.overlays.visit(function(b,c){c.destroy()}),a.overlays=null),null!=a.control&&(a.control.destroy(),a.control=null),a.shape.destroy(),a.shape=null)};-var mxEdgeStyle={EntityRelation:function(a,b,c,d,e){var f=a.view,g=f.graph;d=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*f.scale;var k=a.absolutePoints,l=k[0],m=k[k.length-1];k=!1;if(null!=b){var n=g.getCellGeometry(b.cell);n.relative?k=.5>=n.x:null!=c&&(k=(null!=m?m.x:c.x+c.width)<(null!=l?l.x:b.x))}if(null!=l)b=new mxCellState,b.x=l.x,b.y=l.y;else if(null!=b){var p=mxUtils.getPortConstraints(b,a,!0,mxConstants.DIRECTION_MASK_NONE);p!=mxConstants.DIRECTION_MASK_NONE&&-p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(k=p==mxConstants.DIRECTION_MASK_WEST)}else return;n=!0;null!=c&&(g=g.getCellGeometry(c.cell),g.relative?n=.5>=g.x:null!=b&&(n=(null!=l?l.x:b.x+b.width)<(null!=m?m.x:c.x)));null!=m?(c=new mxCellState,c.x=m.x,c.y=m.y):null!=c&&(p=mxUtils.getPortConstraints(c,a,!1,mxConstants.DIRECTION_MASK_NONE),p!=mxConstants.DIRECTION_MASK_NONE&&p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(n=p==mxConstants.DIRECTION_MASK_WEST));+var mxEdgeStyle={EntityRelation:function(a,b,c,d,e){var f=a.view,g=f.graph;d=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*f.scale;var k=a.absolutePoints,l=k[0],m=k[k.length-1];k=!1;if(null!=b){var n=g.getCellGeometry(b.cell);null!=n&&n.relative?k=.5>=n.x:null!=c&&(k=(null!=m?m.x:c.x+c.width)<(null!=l?l.x:b.x))}if(null!=l)b=new mxCellState,b.x=l.x,b.y=l.y;else if(null!=b){var p=mxUtils.getPortConstraints(b,a,!0,mxConstants.DIRECTION_MASK_NONE);p!=mxConstants.DIRECTION_MASK_NONE&&+p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(k=p==mxConstants.DIRECTION_MASK_WEST)}else return;n=!0;null!=c&&(g=g.getCellGeometry(c.cell),null!=g&&g.relative?n=.5>=g.x:null!=b&&(n=(null!=l?l.x:b.x+b.width)<(null!=m?m.x:c.x)));null!=m?(c=new mxCellState,c.x=m.x,c.y=m.y):null!=c&&(p=mxUtils.getPortConstraints(c,a,!1,mxConstants.DIRECTION_MASK_NONE),p!=mxConstants.DIRECTION_MASK_NONE&&p!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST&&(n=p==mxConstants.DIRECTION_MASK_WEST));null!=b&&null!=c&&(a=k?b.x:b.x+b.width,b=f.getRoutingCenterY(b),l=n?c.x:c.x+c.width,c=f.getRoutingCenterY(c),f=new mxPoint(a+(k?-d:d),b),g=new mxPoint(l+(n?-d:d),c),k==n?(d=k?Math.min(a,l)-d:Math.max(a,l)+d,e.push(new mxPoint(d,b)),e.push(new mxPoint(d,c))):(f.x<g.x==k?(d=b+(c-b)/2,e.push(f),e.push(new mxPoint(f.x,d)),e.push(new mxPoint(g.x,d))):e.push(f),e.push(g)))},Loop:function(a,b,c,d,e){c=a.absolutePoints;var f=c[c.length-1];if(null!=c[0]&&null!=f){if(null!=d&&0<d.length)for(b=0;b<d.length;b++)c=d[b],c=a.view.transformControlPoint(a,c),e.push(new mxPoint(c.x,c.y))}else if(null!=b){f=a.view;var g=f.graph;c=null!=d&&0<d.length?d[0]:null;null!=c&&(c=f.transformControlPoint(a,c),mxUtils.contains(b,c.x,c.y)&&(c=null));var k=d=0,l=0,m=0;g=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,g.gridSize)*f.scale;a=mxUtils.getValue(a.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST);a==mxConstants.DIRECTION_NORTH||a==mxConstants.DIRECTION_SOUTH?(d=f.getRoutingCenterX(b),k=g):(l=f.getRoutingCenterY(b),m=g);null==c||c.x<b.x||c.x>b.x+b.width?null!=c?(d=c.x,m=Math.max(Math.abs(l-c.y),m)):a==mxConstants.DIRECTION_NORTH?l=b.y-2*k:a==mxConstants.DIRECTION_SOUTH?l=b.y+b.height+2*k:d=a==mxConstants.DIRECTION_EAST?b.x-2*m:b.x+b.width+2*m:null!=c&&(d=f.getRoutingCenterX(b),k=Math.max(Math.abs(d-c.x),m),l=c.y,m=0);e.push(new mxPoint(d-k,l-m));e.push(new mxPoint(d+k,l+m))}},ElbowConnector:function(a,b,c,d,e){var f=null!=d&&0<d.length?d[0]:null,g=!1,k=!1;if(null!=b&&null!=c)if(null!=f){var l=Math.min(b.x,c.x),@@ -1099,8 +1099,8 @@ mxGraphView.prototype.stateValidated=function(a){var b=this.graph.getModel().isEmxGraphView.prototype.updateFixedTerminalPoints=function(a,b,c){this.updateFixedTerminalPoint(a,b,!0,this.graph.getConnectionConstraint(a,b,!0));this.updateFixedTerminalPoint(a,c,!1,this.graph.getConnectionConstraint(a,c,!1))};mxGraphView.prototype.updateFixedTerminalPoint=function(a,b,c,d){a.setAbsoluteTerminalPoint(this.getFixedTerminalPoint(a,b,c,d),c)};mxGraphView.prototype.getFixedTerminalPoint=function(a,b,c,d){var e=null;null!=d&&(e=this.graph.getConnectionPoint(b,d,!1));if(null==e&&null==b){b=this.scale;d=this.translate;var f=a.origin;e=this.graph.getCellGeometry(a.cell).getTerminalPoint(c);null!=e&&(e=new mxPoint(b*(d.x+e.x+f.x),b*(d.y+e.y+f.y)))}return e};mxGraphView.prototype.updateBoundsFromStencil=function(a){var b=null;if(null!=a&&null!=a.shape&&null!=a.shape.stencil&&"fixed"==a.shape.stencil.aspect){b=mxRectangle.fromRectangle(a);var c=a.shape.stencil.computeAspect(a.style,a.x,a.y,a.width,a.height);a.setRect(c.x,c.y,a.shape.stencil.w0*c.width,a.shape.stencil.h0*c.height)}return b};-mxGraphView.prototype.updatePoints=function(a,b,c,d){if(null!=a){var e=[];e.push(a.absolutePoints[0]);var f=this.getEdgeStyle(a,b,c,d);if(null!=f){c=this.getTerminalPort(a,c,!0);d=this.getTerminalPort(a,d,!1);var g=this.updateBoundsFromStencil(c),k=this.updateBoundsFromStencil(d);f(a,c,d,b,e);null!=g&&c.setRect(g.x,g.y,g.width,g.height);null!=k&&d.setRect(k.x,k.y,k.width,k.height)}else if(null!=b)for(f=0;f<b.length;f++)null!=b[f]&&(c=mxUtils.clone(b[f]),e.push(this.transformControlPoint(a,c)));b=-a.absolutePoints;e.push(b[b.length-1]);a.absolutePoints=e}};mxGraphView.prototype.transformControlPoint=function(a,b,c){return null!=a&&null!=b?(a=a.origin,c=c?1:this.scale,new mxPoint(c*(b.x+this.translate.x+a.x),c*(b.y+this.translate.y+a.y))):null};+mxGraphView.prototype.updatePoints=function(a,b,c,d){if(null!=a&&null!=a.absolutePoints&&0<a.absolutePoints.length){var e=[];e.push(a.absolutePoints[0]);var f=this.getEdgeStyle(a,b,c,d);if(null!=f){c=this.getTerminalPort(a,c,!0);d=this.getTerminalPort(a,d,!1);var g=this.updateBoundsFromStencil(c),k=this.updateBoundsFromStencil(d);f(a,c,d,b,e);null!=g&&c.setRect(g.x,g.y,g.width,g.height);null!=k&&d.setRect(k.x,k.y,k.width,k.height)}else if(null!=b)for(f=0;f<b.length;f++)null!=b[f]&&(c=mxUtils.clone(b[f]),+e.push(this.transformControlPoint(a,c)));b=a.absolutePoints;e.push(b[b.length-1]);a.absolutePoints=e}};mxGraphView.prototype.transformControlPoint=function(a,b,c){return null!=a&&null!=b?(a=a.origin,c=c?1:this.scale,new mxPoint(c*(b.x+this.translate.x+a.x),c*(b.y+this.translate.y+a.y))):null};mxGraphView.prototype.isLoopStyleEnabled=function(a,b,c,d){var e=this.graph.getConnectionConstraint(a,c,!0),f=this.graph.getConnectionConstraint(a,d,!1);return!(null==b||2>b.length)||mxUtils.getValue(a.style,mxConstants.STYLE_ORTHOGONAL_LOOP,!1)&&(null!=e&&null!=e.point||null!=f&&null!=f.point)?!1:null!=c&&c==d};mxGraphView.prototype.getEdgeStyle=function(a,b,c,d){a=this.isLoopStyleEnabled(a,b,c,d)?mxUtils.getValue(a.style,mxConstants.STYLE_LOOP,this.graph.defaultLoopStyle):mxUtils.getValue(a.style,mxConstants.STYLE_NOEDGESTYLE,!1)?null:a.style[mxConstants.STYLE_EDGE];"string"==typeof a&&(b=mxStyleRegistry.getValue(a),null==b&&this.isAllowEval()&&(b=mxUtils.eval(a)),a=b);return"function"==typeof a?a:null};mxGraphView.prototype.updateFloatingTerminalPoints=function(a,b,c){var d=a.absolutePoints,e=d[0];null==d[d.length-1]&&null!=c&&this.updateFloatingTerminalPoint(a,c,b,!1);null==e&&null!=b&&this.updateFloatingTerminalPoint(a,b,c,!0)};mxGraphView.prototype.updateFloatingTerminalPoint=function(a,b,c,d){a.setAbsoluteTerminalPoint(this.getFloatingTerminalPoint(a,b,c,d),d)};@@ -1188,7 +1188,8 @@ l),Math.round(f.y+q*f.height))]:[new mxPoint(Math.round(f.x+q*f.width),Math.rounmxGraph.prototype.getCurrentCellStyle=function(a,b){b=b?null:this.view.getState(a);return null!=b?b.style:this.getCellStyle(a)};mxGraph.prototype.getCellStyle=function(a,b){b=null!=b?b:!0;var c=this.model.getStyle(a),d=this.model.isEdge(a)?this.stylesheet.getDefaultEdgeStyle():this.stylesheet.getDefaultVertexStyle();null!=c&&0<c.length?d=this.stylesheet.getCellStyle(c,d,b):null!=d&&(d=mxUtils.clone(d));null==d?d={}:b&&(d=this.postProcessCellStyle(a,d));return d};mxGraph.prototype.postProcessCellStyle=function(a,b){if(null!=b){var c=b[mxConstants.STYLE_IMAGE];a=this.getImageFromBundles(c);null!=a?b[mxConstants.STYLE_IMAGE]=a:a=c;null!=a&&"function"===typeof a.substring&&"data:image/"==a.substring(0,11)&&("data:image/svg+xml,<"==a.substring(0,20)?a=a.substring(0,19)+encodeURIComponent(a.substring(19)):"data:image/svg+xml,%3C"!=a.substring(0,22)&&(c=a.indexOf(","),0<c&&";base64,"!=a.substring(c-7,c+1)&&(a=a.substring(0,c)+";base64,"+a.substring(c+1))),b[mxConstants.STYLE_IMAGE]=a)}return b};mxGraph.prototype.setCellStyle=function(a,b){b=b||this.getSelectionCells();if(null!=b){this.model.beginUpdate();try{for(var c=0;c<b.length;c++)this.model.setStyle(b[c],a)}finally{this.model.endUpdate()}}};mxGraph.prototype.toggleCellStyle=function(a,b,c){c=c||this.getSelectionCell();return this.toggleCellStyles(a,b,[c])};-mxGraph.prototype.toggleCellStyles=function(a,b,c){b=null!=b?b:!1;c=c||this.getEditableCells(this.getSelectionCells());var d=null;null!=c&&0<c.length&&(d=this.getCurrentCellStyle(c[0]),d=mxUtils.getValue(d,a,b)?0:1,this.setCellStyles(a,d,c));return d};mxGraph.prototype.setCellStyles=function(a,b,c){c=c||this.getEditableCells(this.getSelectionCells());mxUtils.setCellStyles(this.model,c,a,b)};mxGraph.prototype.toggleCellStyleFlags=function(a,b,c){this.setCellStyleFlags(a,b,null,c)};+mxGraph.prototype.toggleCellStyles=function(a,b,c){b=null!=b?b:!1;c=c||this.getEditableCells(this.getSelectionCells());var d=null;null!=c&&0<c.length&&(d=this.getCurrentCellStyle(c[0]),d=mxUtils.getValue(d,a,b)?0:1,this.setCellStyles(a,d,c));return d};+mxGraph.prototype.setCellStyles=function(a,b,c){c=c||this.getEditableCells(this.getSelectionCells());this.model.beginUpdate();try{mxUtils.setCellStyles(this.model,c,a,b);for(var d=0;d<c.length;d++){var e=this.view.getState(c[d]);null!=e&&null!=e.shape&&e.shape.styleChanged(a,b,e)}}finally{this.model.endUpdate()}};mxGraph.prototype.toggleCellStyleFlags=function(a,b,c){this.setCellStyleFlags(a,b,null,c)};mxGraph.prototype.setCellStyleFlags=function(a,b,c,d){d=d||this.getEditableCells(this.getSelectionCells());null!=d&&0<d.length&&(null==c&&(c=this.getCurrentCellStyle(d[0]),c=(parseInt(c[a]||0)&b)!=b),mxUtils.setCellStyleFlags(this.model,d,a,b,c))};mxGraph.prototype.getOriginForCell=function(a){a=this.model.getParent(a);for(var b=new mxPoint;null!=a;){var c=this.getCellGeometry(a);null==c||c.relative||(b.x+=c.x,b.y+=c.y);a=this.model.getParent(a)}return b};mxGraph.prototype.alignCells=function(a,b,c){null==b&&(b=this.getMovableCells(this.getSelectionCells()));if(null!=b&&1<b.length){if(null==c)for(var d=0;d<b.length;d++){var e=this.getOriginForCell(b[d]),f=this.getCellGeometry(b[d]);if(!this.model.isEdge(b[d])&&null!=f&&!f.relative)if(null==c)if(a==mxConstants.ALIGN_CENTER){c=e.x+f.x+f.width/2;break}else if(a==mxConstants.ALIGN_RIGHT)c=e.x+f.x+f.width;else if(a==mxConstants.ALIGN_TOP)c=e.y+f.y;else if(a==mxConstants.ALIGN_MIDDLE){c=e.y+f.y+f.height/2;break}else c=a==mxConstants.ALIGN_BOTTOM?e.y+f.y+f.height:e.x+f.x;else c=a==mxConstants.ALIGN_RIGHT?Math.max(c,e.x+f.x+f.width):a==mxConstants.ALIGN_TOP?Math.min(c,e.y+f.y):a==mxConstants.ALIGN_BOTTOM?Math.max(c,e.y+f.y+f.height):Math.min(c,e.x+f.x)}if(null!=c){b=mxUtils.sortCells(b);this.model.beginUpdate();try{for(d=0;d<b.length;d++)e=this.getOriginForCell(b[d]),f=this.getCellGeometry(b[d]),this.model.isEdge(b[d])||null==f||f.relative||(f=f.clone(),a==mxConstants.ALIGN_CENTER?f.x=c-e.x-f.width/@@ -1851,7 +1852,7 @@ mxObjectCodec.prototype.afterEncode=function(a,b,c){return c};mxObjectCodec.protmxObjectCodec.prototype.decodeAttributes=function(a,b,c){b=b.attributes;if(null!=b)for(var d=0;d<b.length;d++)this.decodeAttribute(a,b[d],c)};mxObjectCodec.prototype.isIgnoredAttribute=function(a,b,c){return"as"==b.nodeName||"id"==b.nodeName||"function"===typeof c[b.nodeName]};mxObjectCodec.prototype.decodeAttribute=function(a,b,c){if(!this.isIgnoredAttribute(a,b,c)){var d=b.nodeName;b=this.convertAttributeFromXml(a,b,c);var e=this.getFieldName(d);if(this.isReference(c,e,b,!1)){a=a.getObject(b);if(null==a){mxLog.warn("mxObjectCodec.decode: No object for "+this.getName()+"."+d+"="+b);return}b=a}this.isExcluded(c,d,b,!1)||(c[d]=b)}};mxObjectCodec.prototype.decodeChildren=function(a,b,c){for(b=b.firstChild;null!=b;){var d=b.nextSibling;b.nodeType!=mxConstants.NODETYPE_ELEMENT||this.processInclude(a,b,c)||this.decodeChild(a,b,c);b=d}};-mxObjectCodec.prototype.decodeChild=function(a,b,c){var d=this.getFieldName(b.getAttribute("as"));if(null==d||!this.isExcluded(c,d,b,!1)){var e=this.getFieldTemplate(c,d,b);"add"==b.nodeName?(a=b.getAttribute("value"),null==a&&mxObjectCodec.allowEval&&(a=mxUtils.eval(mxUtils.getTextContent(b)))):a=a.decode(b,e);try{this.addObjectValue(c,d,a,e)}catch(f){throw Error(f.message+" for "+b.nodeName);}}};+mxObjectCodec.prototype.decodeChild=function(a,b,c){var d=this.getFieldName(b.getAttribute("as"));if(null==d||!this.isExcluded(c,d,b,!1)){var e=this.getFieldTemplate(c,d,b);"add"==b.nodeName?(a=b.getAttribute("value"),null==a&&mxObjectCodec.allowEval&&(a=mxUtils.eval(mxUtils.getTextContent(b)))):a=a.decode(b,e);try{this.addObjectValue(c,d,a,e)}catch(f){throw Error(f.message+" "+b.nodeName+(null!=d?" as "+d:""));}}};mxObjectCodec.prototype.getFieldTemplate=function(a,b,c){a=a[b];a instanceof Array&&0<a.length&&(a=null);return a};mxObjectCodec.prototype.addObjectValue=function(a,b,c,d){if(null!=c&&c!=d)if(null!=b&&0<b.length)a[b]=c;else if(a.constructor===Array)a.push(c);else throw Error("Could not add object");};mxObjectCodec.prototype.processInclude=function(a,b,c){if("include"==b.nodeName){b=b.getAttribute("name");if(null!=b)try{var d=mxUtils.load(b).getDocumentElement();null!=d&&a.decode(d,c)}catch(e){}return!0}return!1};mxObjectCodec.prototype.beforeDecode=function(a,b,c){return b};mxObjectCodec.prototype.afterDecode=function(a,b,c){return c};mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]);a.isCellCodec=function(){return!0};a.isNumericAttribute=function(b,c,d){return"value"!==c.nodeName&&mxObjectCodec.prototype.isNumericAttribute.apply(this,arguments)};a.isExcluded=function(b,c,d,e){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||e&&"value"==c&&mxUtils.isNode(d)};a.afterEncode=function(b,c,d){if(null!=c.value&&mxUtils.isNode(c.value)){var e=@@ -1873,8 +1874,8 @@ var mxStylesheetCodec=mxCodecRegistry.register(function(){var a=new mxObjectCodefunction(b,c){b=typeof c;"function"==b?c=mxStyleRegistry.getName(c):"object"==b&&(c=null);return c};a.decode=function(b,c,d){d=d||new this.template.constructor;var e=c.getAttribute("id");null!=e&&(b.objects[e]=d);for(c=c.firstChild;null!=c;){if(!this.processInclude(b,c,d)&&"add"==c.nodeName&&(e=c.getAttribute("as"),null!=e)){var f=c.getAttribute("extend"),g=null!=f?mxUtils.clone(d.styles[f]):null;null==g&&(null!=f&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+f+" not found to extend"),g={});for(f=c.firstChild;null!=f;){if(f.nodeType==mxConstants.NODETYPE_ELEMENT){var k=f.getAttribute("as");if("add"==f.nodeName){var l=mxUtils.getTextContent(f);null!=l&&0<l.length&&mxStylesheetCodec.allowEval?l=mxUtils.eval(l):(l=f.getAttribute("value"),mxUtils.isNumeric(l)&&(l=parseFloat(l)));null!=l&&(g[k]=l)}else"remove"==f.nodeName&&delete g[k]}f=f.nextSibling}d.putCellStyle(e,g)}c=c.nextSibling}return d};return a}());mxStylesheetCodec.allowEval=!1;var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(b){return b.raw=b};$jscomp.createTemplateTagFirstArgWithRaw=function(b,e){b.raw=e;return b};$jscomp.arrayIteratorImpl=function(b){var e=0;return function(){return e<b.length?{done:!1,value:b[e++]}:{done:!0}}};$jscomp.arrayIterator=function(b){return{next:$jscomp.arrayIteratorImpl(b)}};$jscomp.makeIterator=function(b){var e="undefined"!=typeof Symbol&&Symbol.iterator&&b[Symbol.iterator];return e?e.call(b):$jscomp.arrayIterator(b)};-Editor=function(b,e,g,m,v){mxEventSource.call(this);this.chromeless=null!=b?b:this.chromeless;this.initStencilRegistry();this.graph=m||this.createGraph(e,g);this.editable=null!=v?v:!b;this.undoManager=this.createUndoManager();this.status="";this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[Editor.pageCounter])+".xml"};this.getFilename=function(){return this.filename};this.setStatus=function(p,A){this.status=p;this.statusFunction=A;this.fireEvent(new mxEventObject("statusChanged"))};-this.getStatus=function(){return this.status};this.graphChangeListener=function(p,A){p=null!=A?A.getProperty("edit"):null;null!=p&&p.ignoreEdit||this.setModified(!0)};this.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.graphChangeListener.apply(this,arguments)}));this.graph.resetViewOnRootChange=!1;this.init()};mxConstants.POINTS=1;mxConstants.MILLIMETERS=2;mxConstants.INCHES=3;mxConstants.METERS=4;mxConstants.PIXELS_PER_MM=3.937;mxConstants.PIXELS_PER_INCH=100;+Editor=function(b,e,g,m,v){mxEventSource.call(this);this.chromeless=null!=b?b:this.chromeless;this.initStencilRegistry();this.graph=m||this.createGraph(e,g);this.editable=null!=v?v:!b;this.undoManager=this.createUndoManager();this.status="";this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[Editor.pageCounter])+".xml"};this.getFilename=function(){return this.filename};this.setStatus=function(n,A){this.status=n;this.statusFunction=A;this.fireEvent(new mxEventObject("statusChanged"))};+this.getStatus=function(){return this.status};this.graphChangeListener=function(n,A){n=null!=A?A.getProperty("edit"):null;null!=n&&n.ignoreEdit||this.setModified(!0)};this.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.graphChangeListener.apply(this,arguments)}));this.graph.resetViewOnRootChange=!1;this.init()};mxConstants.POINTS=1;mxConstants.MILLIMETERS=2;mxConstants.INCHES=3;mxConstants.METERS=4;mxConstants.PIXELS_PER_MM=3.937;mxConstants.PIXELS_PER_INCH=100;Editor.pageCounter=0;(function(){try{for(var b=window;null!=b.opener&&"undefined"!==typeof b.opener.Editor&&!isNaN(b.opener.Editor.pageCounter)&&b.opener!=b;)b=b.opener;null!=b&&(b.Editor.pageCounter++,Editor.pageCounter=b.Editor.pageCounter)}catch(e){}})();Editor.defaultHtmlFont='-apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", system-ui, ui-sans-serif, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"';Editor.useLocalStorage="undefined"!=typeof Storage&&mxClient.IS_IOS;Editor.smallScreenWidth=1024;Editor.helpImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDc4LTI0MHEyMSAwIDM1LjUtMTQuNVQ1MjgtMjkwcTAtMjEtMTQuNS0zNS41VDQ3OC0zNDBxLTIxIDAtMzUuNSAxNC41VDQyOC0yOTBxMCAyMSAxNC41IDM1LjVUNDc4LTI0MFptLTM2LTE1NGg3NHEwLTMzIDcuNS01MnQ0Mi41LTUycTI2LTI2IDQxLTQ5LjV0MTUtNTYuNXEwLTU2LTQxLTg2dC05Ny0zMHEtNTcgMC05Mi41IDMwVDM0Mi02MThsNjYgMjZxNS0xOCAyMi41LTM5dDUzLjUtMjFxMzIgMCA0OCAxNy41dDE2IDM4LjVxMCAyMC0xMiAzNy41VDUwNi01MjZxLTQ0IDM5LTU0IDU5dC0xMCA3M1ptMzggMzE0cS04MyAwLTE1Ni0zMS41VDE5Ny0xOTdxLTU0LTU0LTg1LjUtMTI3VDgwLTQ4MHEwLTgzIDMxLjUtMTU2VDE5Ny03NjNxNTQtNTQgMTI3LTg1LjVUNDgwLTg4MHE4MyAwIDE1NiAzMS41VDc2My03NjNxNTQgNTQgODUuNSAxMjdUODgwLTQ4MHEwIDgzLTMxLjUgMTU2VDc2My0xOTdxLTU0IDU0LTEyNyA4NS41VDQ4MC04MFptMC04MHExMzQgMCAyMjctOTN0OTMtMjI3cTAtMTM0LTkzLTIyN3QtMjI3LTkzcS0xMzQgMC0yMjcgOTN0LTkzIDIyN3EwIDEzNCA5MyAyMjd0MjI3IDkzWm0wLTMyMFoiLz48L3N2Zz4=";Editor.menuImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTI0MHYtODBoNzIwdjgwSDEyMFptMC0yMDB2LTgwaDcyMHY4MEgxMjBabTAtMjAwdi04MGg3MjB2ODBIMTIwWiIvPjwvc3ZnPg==";Editor.moveImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI4cHgiIGhlaWdodD0iMjhweCI+PGc+PC9nPjxnPjxnPjxnPjxwYXRoIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIuNCwyLjQpc2NhbGUoMC44KXJvdGF0ZSg0NSwxMiwxMikiIHN0cm9rZT0iIzI5YjZmMiIgZmlsbD0iIzI5YjZmMiIgZD0iTTE1LDNsMi4zLDIuM2wtMi44OSwyLjg3bDEuNDIsMS40MkwxOC43LDYuN0wyMSw5VjNIMTV6IE0zLDlsMi4zLTIuM2wyLjg3LDIuODlsMS40Mi0xLjQyTDYuNyw1LjNMOSwzSDNWOXogTTksMjEgbC0yLjMtMi4zbDIuODktMi44N2wtMS40Mi0xLjQyTDUuMywxNy4zTDMsMTV2Nkg5eiBNMjEsMTVsLTIuMywyLjNsLTIuODctMi44OWwtMS40MiwxLjQybDIuODksMi44N0wxNSwyMWg2VjE1eiIvPjwvZz48L2c+PC9nPjwvc3ZnPgo=";@@ -1944,9 +1945,9 @@ Editor.roughFillStyles=[{val:"auto",dispName:"Auto"},{val:"hachure",dispName:"HaEditor.fillStyles=[{val:"auto",dispName:"Auto"},{val:"hatch",dispName:"Hatch"},{val:"solid",dispName:"Solid"},{val:"dots",dispName:"Dots"},{val:"cross-hatch",dispName:"Cross Hatch"},{val:"dashed",dispName:"Dashed"},{val:"zigzag-line",dispName:"ZigZag Line"}];Editor.themes=[];Editor.ctrlKey=mxClient.IS_MAC?"Cmd":"Ctrl";Editor.hintOffset=20;Editor.shapePickerHoverDelay=300;Editor.fitWindowBorders=null;Editor.popupsAllowed=null!=window.urlParams?"1"!=urlParams.noDevice:!0;Editor.simpleLabels=!1;Editor.enableNativeCipboard=window==window.top&&!mxClient.IS_FF&&null!=navigator.clipboard;Editor.sketchMode=!1;Editor.darkMode=!1;Editor.currentTheme=uiTheme;Editor.darkColor="#121212";Editor.darkColorVar="--ge-dark-color";Editor.fontSizeUnit="px";Editor.transitionDelay=.1;Editor.pageSizeUnit=mxConstants.INCHES;Editor.isDarkMode=function(){return Editor.darkMode};Editor.isPngDataUrl=function(b){return null!=b&&"data:image/png;"==b.substring(0,15)};Editor.isPngData=function(b){return 8<b.length&&137==b.charCodeAt(0)&&80==b.charCodeAt(1)&&78==b.charCodeAt(2)&&71==b.charCodeAt(3)&&13==b.charCodeAt(4)&&10==b.charCodeAt(5)&&26==b.charCodeAt(6)&&10==b.charCodeAt(7)};Editor.convertHtmlToText=function(b){if(null!=b){var e=document.createElement("div");e.innerHTML=Graph.sanitizeHtml(b);return mxUtils.extractTextWithWhitespace(e.childNodes)}return null};-Editor.extractGraphModelFromPng=function(b){var e=null;try{var g=b.substring(b.indexOf(",")+1),m=window.atob&&!mxClient.IS_SF?atob(g):Base64.decode(g,!0);EditorUi.parsePng(m,mxUtils.bind(this,function(v,p,A){v=m.substring(v+8,v+8+A);"zTXt"==p?(A=v.indexOf(String.fromCharCode(0)),"mxGraphModel"==v.substring(0,A)&&(v=pako.inflateRaw(Graph.stringToArrayBuffer(v.substring(A+2)),{to:"string"}).replace(/\+/g," "),null!=v&&0<v.length&&(e=v))):"tEXt"==p&&(v=v.split(String.fromCharCode(0)),1<v.length&&("mxGraphModel"==-v[0]||"mxfile"==v[0])&&(e=v[1]));if(null!=e||"IDAT"==p)return!0}))}catch(v){}null!=e&&"%"==e.charAt(0)&&(e=decodeURIComponent(e));null!=e&&"%"==e.charAt(0)&&(e=decodeURIComponent(e));return e};-Editor.soundex=function(b){if(null==b||0==b.length)return"";var e=[],g=1;e[0]=b[0].toUpperCase();for(var m=1,v=b.length;m<v;m++){var p=b[m].toUpperCase().charCodeAt(0)-65;if(0<=p&&25>=p&&"0"!="01230120022455012603010202"[p]&&("01230120022455012603010202"[p]!=e[g-1]&&(e[g]="01230120022455012603010202"[p],g++),3<g))break}if(3>=g)for(;3>=g;)e[g]="0",g++;return e.join("")};+Editor.extractGraphModelFromPng=function(b){var e=null;try{var g=b.substring(b.indexOf(",")+1),m=window.atob&&!mxClient.IS_SF?atob(g):Base64.decode(g,!0);EditorUi.parsePng(m,mxUtils.bind(this,function(v,n,A){v=m.substring(v+8,v+8+A);"zTXt"==n?(A=v.indexOf(String.fromCharCode(0)),"mxGraphModel"==v.substring(0,A)&&(v=pako.inflateRaw(Graph.stringToArrayBuffer(v.substring(A+2)),{to:"string"}).replace(/\+/g," "),null!=v&&0<v.length&&(e=v))):"tEXt"==n&&(v=v.split(String.fromCharCode(0)),1<v.length&&("mxGraphModel"==+v[0]||"mxfile"==v[0])&&(e=v[1]));if(null!=e||"IDAT"==n)return!0}))}catch(v){}null!=e&&"%"==e.charAt(0)&&(e=decodeURIComponent(e));null!=e&&"%"==e.charAt(0)&&(e=decodeURIComponent(e));return e};+Editor.soundex=function(b){if(null==b||0==b.length)return"";var e=[],g=1;e[0]=b[0].toUpperCase();for(var m=1,v=b.length;m<v;m++){var n=b[m].toUpperCase().charCodeAt(0)-65;if(0<=n&&25>=n&&"0"!="01230120022455012603010202"[n]&&("01230120022455012603010202"[n]!=e[g-1]&&(e[g]="01230120022455012603010202"[n],g++),3<g))break}if(3>=g)for(;3>=g;)e[g]="0",g++;return e.join("")};Editor.selectFilename=function(b){var e=b.value.lastIndexOf(".");if(0<e){var g=b.value.substring(e+1);"drawio"!=g&&0<=mxUtils.indexOf(["png","svg","html","xml","pdf"],g)&&(g=b.value.lastIndexOf(".drawio.",e),0<g&&(e=g))}e=0<e?e:b.value.length;Editor.selectSubstring(b,0,e)};Editor.selectSubstring=function(b,e,g){b.focus();"undefined"!=typeof b.selectionStart?(b.selectionStart=e,b.selectionEnd=g):document.selection&&document.selection.createRange&&(b.select(),b=document.selection.createRange(),b.collapse(!0),b.moveEnd("character",g),b.moveStart("character",e),b.select())};Editor.toUnit=function(b,e){return e==mxConstants.INCHES?Math.round(100*b/mxConstants.PIXELS_PER_INCH)/100:e==mxConstants.MILLIMETERS?Math.round(100*b/mxConstants.PIXELS_PER_MM)/100:e==mxConstants.METERS?Math.round(1E3*b/(1E3*mxConstants.PIXELS_PER_MM))/1E3:Math.round(b)};@@ -1966,79 +1967,79 @@ Editor.prototype.getGraphXml=function(b){if(null!=b?b:1){var e=new mxCodec(mxUtithis.graph.isGridEnabled()?"1":"0");b.setAttribute("gridSize",this.graph.gridSize);b.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0");b.setAttribute("tooltips",this.graph.tooltipHandler.isEnabled()?"1":"0");b.setAttribute("connect",this.graph.connectionHandler.isEnabled()?"1":"0");b.setAttribute("arrows",this.graph.connectionArrowsEnabled?"1":"0");b.setAttribute("fold",this.graph.foldingEnabled?"1":"0");b.setAttribute("page",this.graph.pageVisible?"1":"0");b.setAttribute("pageScale",this.graph.pageScale);b.setAttribute("pageWidth",this.graph.pageFormat.width);b.setAttribute("pageHeight",this.graph.pageFormat.height);null!=this.graph.background&&b.setAttribute("background",this.graph.background);return b};Editor.prototype.updateGraphComponents=function(){var b=this.graph;null!=b.container&&(b.view.validateBackground(),b.container.style.overflow=b.scrollbars?"auto":this.defaultGraphOverflow,this.fireEvent(new mxEventObject("updateGraphComponents")))};Editor.prototype.setModified=function(b){this.modified=b};Editor.prototype.setFilename=function(b){this.filename=b};-Editor.prototype.createUndoManager=function(){var b=this.graph,e=new mxUndoManager;this.undoListener=function(m,v){e.undoableEditHappened(v.getProperty("edit"))};var g=mxUtils.bind(this,function(m,v){this.undoListener.apply(this,arguments)});b.getModel().addListener(mxEvent.UNDO,g);b.getView().addListener(mxEvent.UNDO,g);g=function(m,v){m=v.getProperty("edit").changes;m=b.getSelectionCellsForChanges(m);v=!1;if(0<m.length){for(var p=[],A=0;A<m.length;A++)null!=b.view.getState(m[A])&&(p.push(m[A]),-v||(b.scrollCellToVisible(m[A]),v=!0));b.setSelectionCells(p)}};e.addListener(mxEvent.UNDO,g);e.addListener(mxEvent.REDO,g);return e};Editor.prototype.initStencilRegistry=function(){};Editor.prototype.destroy=function(){null!=this.graph&&(this.graph.destroy(),this.graph=null)};OpenFile=function(b){this.consumer=this.producer=null;this.done=b;this.args=null};OpenFile.prototype.setConsumer=function(b){this.consumer=b;this.execute()};OpenFile.prototype.setData=function(){this.args=arguments;this.execute()};+Editor.prototype.createUndoManager=function(){var b=this.graph,e=new mxUndoManager;this.undoListener=function(m,v){e.undoableEditHappened(v.getProperty("edit"))};var g=mxUtils.bind(this,function(m,v){this.undoListener.apply(this,arguments)});b.getModel().addListener(mxEvent.UNDO,g);b.getView().addListener(mxEvent.UNDO,g);g=function(m,v){m=v.getProperty("edit").changes;m=b.getSelectionCellsForChanges(m);v=!1;if(0<m.length){for(var n=[],A=0;A<m.length;A++)null!=b.view.getState(m[A])&&(n.push(m[A]),+v||(b.scrollCellToVisible(m[A]),v=!0));b.setSelectionCells(n)}};e.addListener(mxEvent.UNDO,g);e.addListener(mxEvent.REDO,g);return e};Editor.prototype.initStencilRegistry=function(){};Editor.prototype.destroy=function(){null!=this.graph&&(this.graph.destroy(),this.graph=null)};OpenFile=function(b){this.consumer=this.producer=null;this.done=b;this.args=null};OpenFile.prototype.setConsumer=function(b){this.consumer=b;this.execute()};OpenFile.prototype.setData=function(){this.args=arguments;this.execute()};OpenFile.prototype.error=function(b){this.cancel(!0);mxUtils.alert(b)};OpenFile.prototype.execute=function(){null!=this.consumer&&null!=this.args&&(this.cancel(!1),this.consumer.apply(this,this.args))};OpenFile.prototype.cancel=function(b){null!=this.done&&this.done(null!=b?b:!0)};-function Dialog(b,e,g,m,v,p,A,H,S,F,K){this.editorUi=b;null==this.bg&&(this.bg=b.createDiv("geBackground"));v&&document.body.appendChild(this.bg);v=b.createDiv(S?"geTransDialog":"geDialog");v.style.width=g+60+"px";v.style.height=m+60+"px";"1"!=urlParams.embedInline||Editor.inlineFullscreen||null==b.embedViewport||(v.style.left=b.embedViewport.x+b.embedViewport.width/2+"px",v.style.top=b.embedViewport.y+b.embedViewport.height/2+"px");v.appendChild(e);document.body.appendChild(v);if(p&&(e=document.createElement("div"),+function Dialog(b,e,g,m,v,n,A,G,S,F,K){this.editorUi=b;null==this.bg&&(this.bg=b.createDiv("geBackground"));v&&document.body.appendChild(this.bg);v=b.createDiv(S?"geTransDialog":"geDialog");v.style.width=g+60+"px";v.style.height=m+60+"px";"1"!=urlParams.embedInline||Editor.inlineFullscreen||null==b.embedViewport||(v.style.left=b.embedViewport.x+b.embedViewport.width/2+"px",v.style.top=b.embedViewport.y+b.embedViewport.height/2+"px");v.appendChild(e);document.body.appendChild(v);if(n&&(e=document.createElement("div"),e.className="geButton",e.setAttribute("title",mxResources.get("close")),e.style.backgroundImage="url("+Editor.crossImage+")",e.style.position="absolute",e.style.top="0px",e.style.right="0px",mxEvent.addListener(e,"click",mxUtils.bind(this,function(){b.hideDialog(!0)})),v.appendChild(e),!K)){var c=!1;mxEvent.addGestureListeners(this.bg,mxUtils.bind(this,function(f){c=!0}),null,mxUtils.bind(this,function(f){c&&(b.hideDialog(!0),c=!1)}))}this.onDialogClose=A;this.container=v;b.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.prototype.noColorImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkEzRDlBMUUwODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkEzRDlBMUUxODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTNEOUExREU4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTNEOUExREY4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5xh3fmAAAABlBMVEX////MzMw46qqDAAAAGElEQVR42mJggAJGKGAYIIGBth8KAAIMAEUQAIElnLuQAAAAAElFTkSuQmCC";Dialog.prototype.closeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJAQMAAADaX5RTAAAABlBMVEV7mr3///+wksspAAAAAnRSTlP/AOW3MEoAAAAdSURBVAgdY9jXwCDDwNDRwHCwgeExmASygSL7GgB12QiqNHZZIwAAAABJRU5ErkJggg==";Dialog.prototype.clearImage="data:image/gif;base64,R0lGODlhDQAKAIABAMDAwP///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OUIzOEM1NzI4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OUIzOEM1NzM4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5QjM4QzU3MDg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo5QjM4QzU3MTg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAEAAAEALAAAAAANAAoAAAIXTGCJebD9jEOTqRlttXdrB32PJ2ncyRQAOw==";Dialog.prototype.getDocumentSize=function(){return mxUtils.getDocumentSize()};Dialog.prototype.getPosition=function(b,e){return new mxPoint(b,e)};Dialog.prototype.close=function(b,e){if(null!=this.onDialogClose){if(0==this.onDialogClose(b,e))return!1;this.onDialogClose=null}null!=this.dialogImg&&null!=this.dialogImg.parentNode&&(this.dialogImg.parentNode.removeChild(this.dialogImg),this.dialogImg=null);null!=this.bg&&null!=this.bg.parentNode&&this.bg.parentNode.removeChild(this.bg);null!=this.editorUi.embedViewport?this.editorUi.removeListener(this.resizeListener):mxEvent.removeListener(window,"resize",this.resizeListener);null!=this.container.parentNode&&this.container.parentNode.removeChild(this.container)};-var ErrorDialog=function(b,e,g,m,v,p,A,H,S,F,K){S=null!=S?S:!0;var c=document.createElement("div");c.style.textAlign="center";if(null!=e){var f=document.createElement("div");f.style.padding="0px";f.style.margin="0px";f.style.fontSize="18px";f.style.paddingBottom="16px";f.style.marginBottom="10px";f.style.borderBottom="1px solid #c0c0c0";f.style.color="gray";f.style.whiteSpace="nowrap";f.style.textOverflow="ellipsis";f.style.overflow="hidden";mxUtils.write(f,e);f.setAttribute("title",e);c.appendChild(f)}e=-document.createElement("div");e.style.lineHeight="1.2em";e.style.padding="6px";"string"===typeof g&&(g=g.replace(/\n/g,"<br/>"));e.innerHTML=Graph.sanitizeHtml(g);c.appendChild(e);g=document.createElement("div");g.style.marginTop="12px";g.style.textAlign="center";null!=p&&(e=mxUtils.button(mxResources.get("tryAgain"),function(){b.hideDialog();p()}),e.className="geBtn",g.appendChild(e),g.style.textAlign="center");null!=F&&(F=mxUtils.button(F,function(){null!=K&&K()}),F.className="geBtn",g.appendChild(F));-var l=mxUtils.button(m,function(){S&&b.hideDialog();null!=v&&v()});l.className="geBtn";g.appendChild(l);null!=A&&(m=mxUtils.button(A,function(){S&&b.hideDialog();null!=H&&H()}),m.className="geBtn gePrimaryBtn",g.appendChild(m));this.init=function(){l.focus()};c.appendChild(g);this.container=c},PrintDialog=function(b,e,g,m){this.create(b,e,g,m)};-PrintDialog.prototype.create=function(b){function e(l){var t=A.checked||F.checked,q=parseInt(c.value)/100;isNaN(q)&&(q=1,c.value="100%");mxClient.IS_SF&&(q*=.75);var D=g.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,G=1/g.pageScale;if(t){var N=A.checked?1:parseInt(K.value);isNaN(N)||(G=mxUtils.getScaleForPageCount(N,g,D))}var L=N=0;D=mxRectangle.fromRectangle(D);D.width=Math.ceil(D.width*q);D.height=Math.ceil(D.height*q);G*=q;!t&&g.pageVisible?(q=g.getPageLayout(),N-=q.x*D.width,L-=q.y*D.height):-t=!0;t=PrintDialog.createPrintPreview(g,G,D,0,N,L,t);t.open();l&&PrintDialog.printPreview(t)}var g=b.editor.graph,m=document.createElement("table");m.style.width="100%";m.style.height="100%";var v=document.createElement("tbody");var p=document.createElement("tr");var A=document.createElement("input");A.setAttribute("type","checkbox");var H=document.createElement("td");H.setAttribute("colspan","2");H.style.fontSize="10pt";H.appendChild(A);var S=document.createElement("span");mxUtils.write(S," "+mxResources.get("fitPage"));-H.appendChild(S);mxEvent.addListener(S,"click",function(l){A.checked=!A.checked;F.checked=!A.checked;mxEvent.consume(l)});mxEvent.addListener(A,"change",function(){F.checked=!A.checked});p.appendChild(H);v.appendChild(p);p=p.cloneNode(!1);var F=document.createElement("input");F.setAttribute("type","checkbox");H=document.createElement("td");H.style.fontSize="10pt";H.appendChild(F);S=document.createElement("span");mxUtils.write(S," "+mxResources.get("posterPrint")+":");H.appendChild(S);mxEvent.addListener(S,-"click",function(l){F.checked=!F.checked;A.checked=!F.checked;mxEvent.consume(l)});p.appendChild(H);var K=document.createElement("input");K.setAttribute("value","1");K.setAttribute("type","number");K.setAttribute("min","1");K.setAttribute("size","4");K.setAttribute("disabled","disabled");K.style.width="50px";H=document.createElement("td");H.style.fontSize="10pt";H.appendChild(K);mxUtils.write(H," "+mxResources.get("pages")+" (max)");p.appendChild(H);v.appendChild(p);mxEvent.addListener(F,"change",-function(){F.checked?K.removeAttribute("disabled"):K.setAttribute("disabled","disabled");A.checked=!F.checked});p=p.cloneNode(!1);H=document.createElement("td");mxUtils.write(H,mxResources.get("pageScale")+":");p.appendChild(H);H=document.createElement("td");var c=document.createElement("input");c.setAttribute("value","100 %");c.setAttribute("size","5");c.style.width="50px";H.appendChild(c);p.appendChild(H);v.appendChild(p);p=document.createElement("tr");H=document.createElement("td");H.colSpan=2;-H.style.paddingTop="20px";H.setAttribute("align","right");S=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});S.className="geBtn";b.editor.cancelFirst&&H.appendChild(S);if(PrintDialog.previewEnabled){var f=mxUtils.button(mxResources.get("preview"),function(){b.hideDialog();e(!1)});f.className="geBtn";H.appendChild(f)}f=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){b.hideDialog();e(!0)});f.className="geBtn gePrimaryBtn";H.appendChild(f);b.editor.cancelFirst||-H.appendChild(S);p.appendChild(H);v.appendChild(p);m.appendChild(v);this.container=m};PrintDialog.printPreview=function(b){try{null!=b.wnd&&window.setTimeout(function(){b.wnd.focus();b.wnd.print();b.wnd.close()},500)}catch(e){}};-PrintDialog.createPrintPreview=function(b,e,g,m,v,p,A){e=new mxPrintPreview(b,e,g,m,v,p);e.title=mxResources.get("preview");e.addPageCss=!mxClient.IS_SF;e.printBackgroundImage=!0;e.autoOrigin=A;A=b.background;if(null==A||""==A||A==mxConstants.NONE)A="#ffffff";e.backgroundColor=A;var H=e.isTextLabel;e.isTextLabel=function(F){return"geHint"==!F.className&&H.apply(this,arguments)};var S=e.getLinkForCellState;e.getLinkForCellState=function(F){return b.getAbsoluteUrl(S.apply(this,arguments))};return e};+var ErrorDialog=function(b,e,g,m,v,n,A,G,S,F,K){S=null!=S?S:!0;var c=document.createElement("div");c.style.textAlign="center";if(null!=e){var f=document.createElement("div");f.style.padding="0px";f.style.margin="0px";f.style.fontSize="18px";f.style.paddingBottom="16px";f.style.marginBottom="10px";f.style.borderBottom="1px solid #c0c0c0";f.style.color="gray";f.style.whiteSpace="nowrap";f.style.textOverflow="ellipsis";f.style.overflow="hidden";mxUtils.write(f,e);f.setAttribute("title",e);c.appendChild(f)}e=+document.createElement("div");e.style.lineHeight="1.2em";e.style.padding="6px";"string"===typeof g&&(g=g.replace(/\n/g,"<br/>"));e.innerHTML=Graph.sanitizeHtml(g);c.appendChild(e);g=document.createElement("div");g.style.marginTop="12px";g.style.textAlign="center";null!=n&&(e=mxUtils.button(mxResources.get("tryAgain"),function(){b.hideDialog();n()}),e.className="geBtn",g.appendChild(e),g.style.textAlign="center");null!=F&&(F=mxUtils.button(F,function(){null!=K&&K()}),F.className="geBtn",g.appendChild(F));+var l=mxUtils.button(m,function(){S&&b.hideDialog();null!=v&&v()});l.className="geBtn";g.appendChild(l);null!=A&&(m=mxUtils.button(A,function(){S&&b.hideDialog();null!=G&&G()}),m.className="geBtn gePrimaryBtn",g.appendChild(m));this.init=function(){l.focus()};c.appendChild(g);this.container=c},PrintDialog=function(b,e,g,m){this.create(b,e,g,m)};+PrintDialog.prototype.create=function(b){function e(l){var t=A.checked||F.checked,q=parseInt(c.value)/100;isNaN(q)&&(q=1,c.value="100%");mxClient.IS_SF&&(q*=.75);var D=g.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,H=1/g.pageScale;if(t){var N=A.checked?1:parseInt(K.value);isNaN(N)||(H=mxUtils.getScaleForPageCount(N,g,D))}var L=N=0;D=mxRectangle.fromRectangle(D);D.width=Math.ceil(D.width*q);D.height=Math.ceil(D.height*q);H*=q;!t&&g.pageVisible?(q=g.getPageLayout(),N-=q.x*D.width,L-=q.y*D.height):+t=!0;t=PrintDialog.createPrintPreview(g,H,D,0,N,L,t);t.open();l&&PrintDialog.printPreview(t)}var g=b.editor.graph,m=document.createElement("table");m.style.width="100%";m.style.height="100%";var v=document.createElement("tbody");var n=document.createElement("tr");var A=document.createElement("input");A.setAttribute("type","checkbox");var G=document.createElement("td");G.setAttribute("colspan","2");G.style.fontSize="10pt";G.appendChild(A);var S=document.createElement("span");mxUtils.write(S," "+mxResources.get("fitPage"));+G.appendChild(S);mxEvent.addListener(S,"click",function(l){A.checked=!A.checked;F.checked=!A.checked;mxEvent.consume(l)});mxEvent.addListener(A,"change",function(){F.checked=!A.checked});n.appendChild(G);v.appendChild(n);n=n.cloneNode(!1);var F=document.createElement("input");F.setAttribute("type","checkbox");G=document.createElement("td");G.style.fontSize="10pt";G.appendChild(F);S=document.createElement("span");mxUtils.write(S," "+mxResources.get("posterPrint")+":");G.appendChild(S);mxEvent.addListener(S,+"click",function(l){F.checked=!F.checked;A.checked=!F.checked;mxEvent.consume(l)});n.appendChild(G);var K=document.createElement("input");K.setAttribute("value","1");K.setAttribute("type","number");K.setAttribute("min","1");K.setAttribute("size","4");K.setAttribute("disabled","disabled");K.style.width="50px";G=document.createElement("td");G.style.fontSize="10pt";G.appendChild(K);mxUtils.write(G," "+mxResources.get("pages")+" (max)");n.appendChild(G);v.appendChild(n);mxEvent.addListener(F,"change",+function(){F.checked?K.removeAttribute("disabled"):K.setAttribute("disabled","disabled");A.checked=!F.checked});n=n.cloneNode(!1);G=document.createElement("td");mxUtils.write(G,mxResources.get("pageScale")+":");n.appendChild(G);G=document.createElement("td");var c=document.createElement("input");c.setAttribute("value","100 %");c.setAttribute("size","5");c.style.width="50px";G.appendChild(c);n.appendChild(G);v.appendChild(n);n=document.createElement("tr");G=document.createElement("td");G.colSpan=2;+G.style.paddingTop="20px";G.setAttribute("align","right");S=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});S.className="geBtn";b.editor.cancelFirst&&G.appendChild(S);if(PrintDialog.previewEnabled){var f=mxUtils.button(mxResources.get("preview"),function(){b.hideDialog();e(!1)});f.className="geBtn";G.appendChild(f)}f=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){b.hideDialog();e(!0)});f.className="geBtn gePrimaryBtn";G.appendChild(f);b.editor.cancelFirst||+G.appendChild(S);n.appendChild(G);v.appendChild(n);m.appendChild(v);this.container=m};PrintDialog.printPreview=function(b){try{null!=b.wnd&&window.setTimeout(function(){b.wnd.focus();b.wnd.print();b.wnd.close()},500)}catch(e){}};+PrintDialog.createPrintPreview=function(b,e,g,m,v,n,A){e=new mxPrintPreview(b,e,g,m,v,n);e.title=mxResources.get("preview");e.addPageCss=!mxClient.IS_SF;e.printBackgroundImage=!0;e.autoOrigin=A;A=b.background;if(null==A||""==A||A==mxConstants.NONE)A="#ffffff";e.backgroundColor=A;var G=e.isTextLabel;e.isTextLabel=function(F){return"geHint"==!F.className&&G.apply(this,arguments)};var S=e.getLinkForCellState;e.getLinkForCellState=function(F){return b.getAbsoluteUrl(S.apply(this,arguments))};return e};PrintDialog.previewEnabled=!0;var PageSetupDialog=function(b){function e(){var q=c;null!=q&&null!=q.originalSrc&&(q=b.createImageForPageLink(q.originalSrc,null));null!=q&&null!=q.src?(K.style.backgroundImage="url("+q.src+")",K.style.display="inline-block"):(K.style.backgroundImage="",K.style.display="none");K.style.backgroundColor="";null!=f&&f!=mxConstants.NONE&&(K.style.backgroundColor=f,K.style.display="inline-block")}var g=b.editor.graph,m=document.createElement("table");m.style.width="100%";m.style.height="100%";var v=document.createElement("tbody");-var p=document.createElement("tr");var A=document.createElement("td");A.style.verticalAlign="top";A.style.fontSize="10pt";mxUtils.write(A,mxResources.get("paperSize")+":");p.appendChild(A);A=document.createElement("td");A.style.verticalAlign="top";A.style.fontSize="10pt";var H=PageSetupDialog.addPageFormatPanel(A,"pagesetupdialog",g.pageFormat);p.appendChild(A);v.appendChild(p);p=document.createElement("tr");A=document.createElement("td");mxUtils.write(A,mxResources.get("gridSize")+":");p.appendChild(A);-A=document.createElement("td");A.style.whiteSpace="nowrap";var S=document.createElement("input");S.setAttribute("type","number");S.setAttribute("min","0");S.style.width="40px";S.style.marginLeft="6px";S.value=g.getGridSize();A.appendChild(S);mxEvent.addListener(S,"change",function(){var q=parseInt(S.value);S.value=Math.max(1,isNaN(q)?g.getGridSize():q)});p.appendChild(A);v.appendChild(p);p=document.createElement("tr");A=document.createElement("td");mxUtils.write(A,mxResources.get("background")+":");-p.appendChild(A);A=document.createElement("td");var F=document.createElement("button");F.className="geBtn";F.style.margin="0px";mxUtils.write(F,mxResources.get("change")+"...");var K=document.createElement("div");K.style.display="inline-block";K.style.verticalAlign="middle";K.style.backgroundPosition="center center";K.style.backgroundRepeat="no-repeat";K.style.backgroundSize="contain";K.style.border="1px solid lightGray";K.style.borderRadius="4px";K.style.marginRight="14px";K.style.height="32px";-K.style.width="64px";K.style.cursor="pointer";K.style.padding="4px";var c=g.backgroundImage,f=g.background,l=g.shadowVisible,t=function(q){b.showBackgroundImageDialog(function(D,G,N,L){G||(null!=D&&null!=D.src&&Graph.isPageLink(D.src)&&(D={originalSrc:D.src}),c=D,l=L);f=N;e()},c,f,!0);mxEvent.consume(q)};mxEvent.addListener(F,"click",t);mxEvent.addListener(K,"click",t);e();A.appendChild(K);A.appendChild(F);p.appendChild(A);v.appendChild(p);p=document.createElement("tr");A=document.createElement("td");-A.colSpan=2;A.style.paddingTop="16px";A.setAttribute("align","right");F=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});F.className="geBtn";b.editor.cancelFirst&&A.appendChild(F);t=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();var q=parseInt(S.value);isNaN(q)||g.gridSize===q||g.setGridSize(q);q=new ChangePageSetup(b,f,c,H.get());q.ignoreColor=g.background==f;q.ignoreImage=(null!=g.backgroundImage?g.backgroundImage.src:null)===(null!=c?c.src:null);null!=l&&-(q.shadowVisible=l);g.pageFormat.width==q.previousFormat.width&&g.pageFormat.height==q.previousFormat.height&&q.ignoreColor&&q.ignoreImage&&q.shadowVisible==g.shadowVisible||g.model.execute(q)});t.className="geBtn gePrimaryBtn";A.appendChild(t);b.editor.cancelFirst||A.appendChild(F);p.appendChild(A);v.appendChild(p);m.appendChild(v);this.container=m};-PageSetupDialog.addPageFormatPanel=function(b,e,g,m){e="format-"+e;var v=document.createElement("input");v.setAttribute("name",e);v.setAttribute("type","radio");v.setAttribute("value","portrait");var p=document.createElement("input");p.setAttribute("name",e);p.setAttribute("type","radio");p.setAttribute("value","landscape");var A=document.createElement("select");A.style.position="relative";A.style.marginBottom="4px";A.style.borderRadius="4px";A.style.borderWidth="1px";A.style.borderStyle="solid";-A.style.boxSizing="border-box";A.style.padding="2px";A.style.width="210px";var H=document.createElement("div");H.style.whiteSpace="nowrap";H.style.marginLeft="4px";H.style.width="210px";H.style.height="24px";v.style.marginRight="6px";H.appendChild(v);e=document.createElement("span");e.style.maxWidth="100px";mxUtils.write(e,mxResources.get("portrait"));H.appendChild(e);p.style.marginLeft="10px";p.style.marginRight="6px";H.appendChild(p);var S=document.createElement("span");S.style.width="100px";mxUtils.write(S,-mxResources.get("landscape"));H.appendChild(S);var F=document.createElement("div");F.style.whiteSpace="nowrap";F.style.marginLeft="4px";F.style.fontSize="12px";F.style.width="210px";F.style.height="24px";var K=document.createElement("input");K.setAttribute("size","7");K.setAttribute("title",mxResources.get("width"));K.style.textAlign="right";F.appendChild(K);mxUtils.write(F," x ");var c=document.createElement("input");c.setAttribute("size","7");c.setAttribute("title",mxResources.get("height"));c.style.textAlign=+var n=document.createElement("tr");var A=document.createElement("td");A.style.verticalAlign="top";A.style.fontSize="10pt";mxUtils.write(A,mxResources.get("paperSize")+":");n.appendChild(A);A=document.createElement("td");A.style.verticalAlign="top";A.style.fontSize="10pt";var G=PageSetupDialog.addPageFormatPanel(A,"pagesetupdialog",g.pageFormat);n.appendChild(A);v.appendChild(n);n=document.createElement("tr");A=document.createElement("td");mxUtils.write(A,mxResources.get("gridSize")+":");n.appendChild(A);+A=document.createElement("td");A.style.whiteSpace="nowrap";var S=document.createElement("input");S.setAttribute("type","number");S.setAttribute("min","0");S.style.width="40px";S.style.marginLeft="6px";S.value=g.getGridSize();A.appendChild(S);mxEvent.addListener(S,"change",function(){var q=parseInt(S.value);S.value=Math.max(1,isNaN(q)?g.getGridSize():q)});n.appendChild(A);v.appendChild(n);n=document.createElement("tr");A=document.createElement("td");mxUtils.write(A,mxResources.get("background")+":");+n.appendChild(A);A=document.createElement("td");var F=document.createElement("button");F.className="geBtn";F.style.margin="0px";mxUtils.write(F,mxResources.get("change")+"...");var K=document.createElement("div");K.style.display="inline-block";K.style.verticalAlign="middle";K.style.backgroundPosition="center center";K.style.backgroundRepeat="no-repeat";K.style.backgroundSize="contain";K.style.border="1px solid lightGray";K.style.borderRadius="4px";K.style.marginRight="14px";K.style.height="32px";+K.style.width="64px";K.style.cursor="pointer";K.style.padding="4px";var c=g.backgroundImage,f=g.background,l=g.shadowVisible,t=function(q){b.showBackgroundImageDialog(function(D,H,N,L){H||(null!=D&&null!=D.src&&Graph.isPageLink(D.src)&&(D={originalSrc:D.src}),c=D,l=L);f=N;e()},c,f,!0);mxEvent.consume(q)};mxEvent.addListener(F,"click",t);mxEvent.addListener(K,"click",t);e();A.appendChild(K);A.appendChild(F);n.appendChild(A);v.appendChild(n);n=document.createElement("tr");A=document.createElement("td");+A.colSpan=2;A.style.paddingTop="16px";A.setAttribute("align","right");F=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});F.className="geBtn";b.editor.cancelFirst&&A.appendChild(F);t=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();var q=parseInt(S.value);isNaN(q)||g.gridSize===q||g.setGridSize(q);q=new ChangePageSetup(b,f,c,G.get());q.ignoreColor=g.background==f;q.ignoreImage=(null!=g.backgroundImage?g.backgroundImage.src:null)===(null!=c?c.src:null);null!=l&&+(q.shadowVisible=l);g.pageFormat.width==q.previousFormat.width&&g.pageFormat.height==q.previousFormat.height&&q.ignoreColor&&q.ignoreImage&&q.shadowVisible==g.shadowVisible||g.model.execute(q)});t.className="geBtn gePrimaryBtn";A.appendChild(t);b.editor.cancelFirst||A.appendChild(F);n.appendChild(A);v.appendChild(n);m.appendChild(v);this.container=m};+PageSetupDialog.addPageFormatPanel=function(b,e,g,m){e="format-"+e;var v=document.createElement("input");v.setAttribute("name",e);v.setAttribute("type","radio");v.setAttribute("value","portrait");var n=document.createElement("input");n.setAttribute("name",e);n.setAttribute("type","radio");n.setAttribute("value","landscape");var A=document.createElement("select");A.style.position="relative";A.style.marginBottom="4px";A.style.borderRadius="4px";A.style.borderWidth="1px";A.style.borderStyle="solid";+A.style.boxSizing="border-box";A.style.padding="2px";A.style.width="210px";var G=document.createElement("div");G.style.whiteSpace="nowrap";G.style.marginLeft="4px";G.style.width="210px";G.style.height="24px";v.style.marginRight="6px";G.appendChild(v);e=document.createElement("span");e.style.maxWidth="100px";mxUtils.write(e,mxResources.get("portrait"));G.appendChild(e);n.style.marginLeft="10px";n.style.marginRight="6px";G.appendChild(n);var S=document.createElement("span");S.style.width="100px";mxUtils.write(S,+mxResources.get("landscape"));G.appendChild(S);var F=document.createElement("div");F.style.whiteSpace="nowrap";F.style.marginLeft="4px";F.style.fontSize="12px";F.style.width="210px";F.style.height="24px";var K=document.createElement("input");K.setAttribute("size","7");K.setAttribute("title",mxResources.get("width"));K.style.textAlign="right";F.appendChild(K);mxUtils.write(F," x ");var c=document.createElement("input");c.setAttribute("size","7");c.setAttribute("title",mxResources.get("height"));c.style.textAlign="right";F.appendChild(c);var f=document.createElement("select");f.style.marginLeft="4px";f.style.maxWidth="78px";f.style.width="78px";for(var l=[{label:mxResources.get("points"),unit:mxConstants.POINTS},{label:mxResources.get("inches"),unit:mxConstants.INCHES},{label:mxResources.get("millimeters"),unit:mxConstants.MILLIMETERS}],t=0;t<l.length;t++){var q=document.createElement("option");q.setAttribute("value",l[t].unit);mxUtils.write(q,l[t].label);f.appendChild(q)}f.value=Editor.pageSizeUnit;F.appendChild(f);-H.style.display="none";F.style.display="none";var D={},G=PageSetupDialog.getFormats();for(t=0;t<G.length;t++)l=G[t],D[l.key]=l,q=document.createElement("option"),q.setAttribute("value",l.key),mxUtils.write(q,l.title),A.appendChild(q);var N=function(){A.value="custom";for(var J=0;J<G.length;J++){var Y=G[J];null!=Y.format&&("a4"==Y.key?826==g.width?(g=mxRectangle.fromRectangle(g),g.width=827):826==g.height&&(g=mxRectangle.fromRectangle(g),g.height=827):"a5"==Y.key&&(584==g.width?(g=mxRectangle.fromRectangle(g),-g.width=583):584==g.height&&(g=mxRectangle.fromRectangle(g),g.height=583)),g.width==Y.format.width&&g.height==Y.format.height?(A.value=Y.key,v.setAttribute("checked","checked"),v.defaultChecked=!0,v.checked=!0,p.removeAttribute("checked"),p.defaultChecked=!1,p.checked=!1,detected=!0):g.width==Y.format.height&&g.height==Y.format.width&&(A.value=Y.key,v.removeAttribute("checked"),v.defaultChecked=!1,v.checked=!1,p.setAttribute("checked","checked"),p.defaultChecked=!0,detected=p.checked=!0))}"custom"==-A.value?(K.value=Editor.toUnit(g.width,f.value),c.value=Editor.toUnit(g.height,f.value),v.setAttribute("checked","checked"),A.value="custom",H.style.display="none",F.style.display=""):(H.style.display="",F.style.display="none")};N();b.appendChild(A);mxUtils.br(b);b.appendChild(H);b.appendChild(F);var L=function(J,Y){J=D[A.value];null!=J.format?(K.value=Editor.toUnit(p.checked?J.format.height:J.format.width,f.value),c.value=Editor.toUnit(p.checked?J.format.width:J.format.height,f.value),F.style.display=-"none",H.style.display=""):(H.style.display="none",F.style.display="");J=parseFloat(K.value);if(isNaN(J)||0>=J)K.value=Editor.toUnit(g.width,f.value);J=parseFloat(c.value);if(isNaN(J)||0>=J)c.value=Editor.toUnit(g.height,f.value);J=new mxRectangle(0,0,Math.floor(Editor.fromUnit(parseFloat(K.value),f.value)),Math.floor(Editor.fromUnit(parseFloat(c.value),f.value)));Y||J.width==g.width&&J.height==g.height||(g=J,null!=m&&m(g))};mxEvent.addListener(e,"click",function(J){v.checked=!0;L(J);mxEvent.consume(J)});-mxEvent.addListener(S,"click",function(J){p.checked=!0;L(J);mxEvent.consume(J)});mxEvent.addListener(K,"blur",L);mxEvent.addListener(K,"click",L);mxEvent.addListener(c,"blur",L);mxEvent.addListener(c,"click",L);mxEvent.addListener(p,"change",L);mxEvent.addListener(v,"change",L);mxEvent.addListener(A,"change",function(J){L(J,"custom"==A.value);mxEvent.consume(J)});mxEvent.addListener(f,"change",function(J){K.value=Editor.toUnit(Editor.fromUnit(K.value,Editor.pageSizeUnit),f.value);c.value=Editor.toUnit(Editor.fromUnit(c.value,+G.style.display="none";F.style.display="none";var D={},H=PageSetupDialog.getFormats();for(t=0;t<H.length;t++)l=H[t],D[l.key]=l,q=document.createElement("option"),q.setAttribute("value",l.key),mxUtils.write(q,l.title),A.appendChild(q);var N=function(){A.value="custom";for(var J=0;J<H.length;J++){var Y=H[J];null!=Y.format&&("a4"==Y.key?826==g.width?(g=mxRectangle.fromRectangle(g),g.width=827):826==g.height&&(g=mxRectangle.fromRectangle(g),g.height=827):"a5"==Y.key&&(584==g.width?(g=mxRectangle.fromRectangle(g),+g.width=583):584==g.height&&(g=mxRectangle.fromRectangle(g),g.height=583)),g.width==Y.format.width&&g.height==Y.format.height?(A.value=Y.key,v.setAttribute("checked","checked"),v.defaultChecked=!0,v.checked=!0,n.removeAttribute("checked"),n.defaultChecked=!1,n.checked=!1,detected=!0):g.width==Y.format.height&&g.height==Y.format.width&&(A.value=Y.key,v.removeAttribute("checked"),v.defaultChecked=!1,v.checked=!1,n.setAttribute("checked","checked"),n.defaultChecked=!0,detected=n.checked=!0))}"custom"==+A.value?(K.value=Editor.toUnit(g.width,f.value),c.value=Editor.toUnit(g.height,f.value),v.setAttribute("checked","checked"),A.value="custom",G.style.display="none",F.style.display=""):(G.style.display="",F.style.display="none")};N();b.appendChild(A);mxUtils.br(b);b.appendChild(G);b.appendChild(F);var L=function(J,Y){J=D[A.value];null!=J.format?(K.value=Editor.toUnit(n.checked?J.format.height:J.format.width,f.value),c.value=Editor.toUnit(n.checked?J.format.width:J.format.height,f.value),F.style.display=+"none",G.style.display=""):(G.style.display="none",F.style.display="");J=parseFloat(K.value);if(isNaN(J)||0>=J)K.value=Editor.toUnit(g.width,f.value);J=parseFloat(c.value);if(isNaN(J)||0>=J)c.value=Editor.toUnit(g.height,f.value);J=new mxRectangle(0,0,Math.floor(Editor.fromUnit(parseFloat(K.value),f.value)),Math.floor(Editor.fromUnit(parseFloat(c.value),f.value)));Y||J.width==g.width&&J.height==g.height||(g=J,null!=m&&m(g))};mxEvent.addListener(e,"click",function(J){v.checked=!0;L(J);mxEvent.consume(J)});+mxEvent.addListener(S,"click",function(J){n.checked=!0;L(J);mxEvent.consume(J)});mxEvent.addListener(K,"blur",L);mxEvent.addListener(K,"click",L);mxEvent.addListener(c,"blur",L);mxEvent.addListener(c,"click",L);mxEvent.addListener(n,"change",L);mxEvent.addListener(v,"change",L);mxEvent.addListener(A,"change",function(J){L(J,"custom"==A.value);mxEvent.consume(J)});mxEvent.addListener(f,"change",function(J){K.value=Editor.toUnit(Editor.fromUnit(K.value,Editor.pageSizeUnit),f.value);c.value=Editor.toUnit(Editor.fromUnit(c.value,Editor.pageSizeUnit),f.value);Editor.pageSizeUnit=f.value;L(J,!0);mxEvent.consume(J)});L(null,!0);return{set:function(J){g=J;N(null,null,!0)},get:function(){return g},widthInput:K,heightInput:c}};PageSetupDialog.getFormats=function(){return[{key:"letter",title:'US-Letter (8,5" x 11")',format:mxConstants.PAGE_FORMAT_LETTER_PORTRAIT},{key:"legal",title:'US-Legal (8,5" x 14")',format:new mxRectangle(0,0,850,1400)},{key:"tabloid",title:'US-Tabloid (11" x 17")',format:new mxRectangle(0,0,1100,1700)},{key:"executive",title:'US-Executive (7" x 10")',format:new mxRectangle(0,0,700,1E3)},{key:"a0",title:"A0 (841 mm x 1189 mm)",format:new mxRectangle(0,0,3300,4681)},{key:"a1",title:"A1 (594 mm x 841 mm)",format:new mxRectangle(0,0,2339,3300)},{key:"a2",title:"A2 (420 mm x 594 mm)",format:new mxRectangle(0,0,1654,2336)},{key:"a3",title:"A3 (297 mm x 420 mm)",format:new mxRectangle(0,0,1169,1654)},{key:"a4",title:"A4 (210 mm x 297 mm)",format:mxConstants.PAGE_FORMAT_A4_PORTRAIT},{key:"a5",title:"A5 (148 mm x 210 mm)",format:new mxRectangle(0,0,583,827)},{key:"a6",title:"A6 (105 mm x 148 mm)",format:new mxRectangle(0,0,413,583)},{key:"a7",title:"A7 (74 mm x 105 mm)",format:new mxRectangle(0,0,291,413)},{key:"b4",title:"B4 (250 mm x 353 mm)",format:new mxRectangle(0,0,980,1390)},{key:"b5",title:"B5 (176 mm x 250 mm)",format:new mxRectangle(0,0,690,980)},{key:"16-9",title:"16:9 (1600 x 900)",format:new mxRectangle(0,0,900,1600)},{key:"16-10",title:"16:10 (1920 x 1200)",format:new mxRectangle(0,0,1200,1920)},{key:"4-3",title:"4:3 (1600 x 1200)",format:new mxRectangle(0,0,1200,1600)},{key:"custom",title:mxResources.get("custom"),format:null}]};-var FilenameDialog=function(b,e,g,m,v,p,A,H,S,F,K){S=null!=S?S:!0;var c=document.createElement("div"),f=document.createElement("div");f.style.width="100%";f.style.display="grid";f.style.gap="5px 8px";f.style.gridAutoColumns="auto 1fr";f.style.boxSizing="border-box";f.style.padding="3px";var l=document.createElement("div");l.style.display="inline-flex";l.style.alignItems="center";l.style.justifyContent="flex-end";l.style.minWidth="0";var t=document.createElement("div");t.style.display="inline-block";-t.style.textOverflow="ellipsis";t.style.whiteSpace="nowrap";t.style.overflow="hidden";t.style.fontSize="10pt";t.style.padding="2px 0";t.setAttribute("title",v||mxResources.get("filename"));mxUtils.write(t,(v||mxResources.get("filename"))+":");l.appendChild(t);f.appendChild(l);var q=document.createElement("input");q.setAttribute("value",e||"");q.style.flexGrow="1";var D=mxUtils.button(g,function(){if(null==p||p(q.value))S&&b.hideDialog(),m(q.value)});D.className="geBtn gePrimaryBtn";this.init=function(){if(null!=-v||null==A)if(null!=K?Editor.selectFilename(q):(q.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?q.select():document.execCommand("selectAll",!1,null)),Graph.fileSupport){var G=f.parentNode;if(null!=G){var N=null;mxEvent.addListener(G,"dragleave",function(L){null!=N&&(N.style.backgroundColor="",N=null);L.stopPropagation();L.preventDefault()});mxEvent.addListener(G,"dragover",mxUtils.bind(this,function(L){null==N&&(!mxClient.IS_IE||10<document.documentMode)&&(N=q,N.style.backgroundColor=-"#ebf2f9");L.stopPropagation();L.preventDefault()}));mxEvent.addListener(G,"drop",mxUtils.bind(this,function(L){null!=N&&(N.style.backgroundColor="",N=null);0<=mxUtils.indexOf(L.dataTransfer.types,"text/uri-list")&&(q.value=decodeURIComponent(L.dataTransfer.getData("text/uri-list")),D.click());L.stopPropagation();L.preventDefault()}))}}};l=document.createElement("div");l.style.display="inline-flex";l.style.alignItems="center";l.style.gap="4px";l.style.whiteSpace="nowrap";l.appendChild(q);f.appendChild(l);+var FilenameDialog=function(b,e,g,m,v,n,A,G,S,F,K){S=null!=S?S:!0;var c=document.createElement("div"),f=document.createElement("div");f.style.width="100%";f.style.display="grid";f.style.gap="5px 8px";f.style.gridAutoColumns="auto 1fr";f.style.boxSizing="border-box";f.style.padding="3px";var l=document.createElement("div");l.style.display="inline-flex";l.style.alignItems="center";l.style.justifyContent="flex-end";l.style.minWidth="0";var t=document.createElement("div");t.style.display="inline-block";+t.style.textOverflow="ellipsis";t.style.whiteSpace="nowrap";t.style.overflow="hidden";t.style.fontSize="10pt";t.style.padding="2px 0";t.setAttribute("title",v||mxResources.get("filename"));mxUtils.write(t,(v||mxResources.get("filename"))+":");l.appendChild(t);f.appendChild(l);var q=document.createElement("input");q.setAttribute("value",e||"");q.style.flexGrow="1";var D=mxUtils.button(g,function(){if(null==n||n(q.value))S&&b.hideDialog(),m(q.value)});D.className="geBtn gePrimaryBtn";this.init=function(){if(null!=+v||null==A)if(null!=K?Editor.selectFilename(q):(q.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?q.select():document.execCommand("selectAll",!1,null)),Graph.fileSupport){var H=f.parentNode;if(null!=H){var N=null;mxEvent.addListener(H,"dragleave",function(L){null!=N&&(N.style.backgroundColor="",N=null);L.stopPropagation();L.preventDefault()});mxEvent.addListener(H,"dragover",mxUtils.bind(this,function(L){null==N&&(!mxClient.IS_IE||10<document.documentMode)&&(N=q,N.style.backgroundColor=+"#ebf2f9");L.stopPropagation();L.preventDefault()}));mxEvent.addListener(H,"drop",mxUtils.bind(this,function(L){null!=N&&(N.style.backgroundColor="",N=null);0<=mxUtils.indexOf(L.dataTransfer.types,"text/uri-list")&&(q.value=decodeURIComponent(L.dataTransfer.getData("text/uri-list")),D.click());L.stopPropagation();L.preventDefault()}))}}};l=document.createElement("div");l.style.display="inline-flex";l.style.alignItems="center";l.style.gap="4px";l.style.whiteSpace="nowrap";l.appendChild(q);f.appendChild(l);null==v&&null!=A||null==K||null==b.editor.diagramFileTypes||(l=document.createElement("div"),l.style.display="inline-flex",l.style.alignItems="center",l.style.textOverflow="ellipsis",l.style.justifyContent="flex-end",l.style.fontSize="10pt",mxUtils.write(l,mxResources.get("type")+":"),f.appendChild(l),l=document.createElement("div"),l.style.display="inline-flex",l.style.alignItems="center",l.style.whiteSpace="nowrap",f.appendChild(l),e=FilenameDialog.createFileTypes(b,q,b.editor.diagramFileTypes),-e.style.width="100%",l.appendChild(e));null!=A&&f.appendChild(A);row=document.createElement("div");row.style.gridColumn="1 / span 2";row.style.paddingTop=null!=K?"6px":"14px";row.style.whiteSpace="nowrap";row.style.display="inline-flex";row.style.alignItems="center";row.style.justifyContent="flex-end";row.setAttribute("align","right");l=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=F&&F()});l.className="geBtn";null==H||b.isOffline()||row.appendChild(b.createHelpIcon(H));-b.editor.cancelFirst&&row.appendChild(l);mxEvent.addListener(q,"keypress",function(G){13==G.keyCode&&D.click()});row.appendChild(D);b.editor.cancelFirst||row.appendChild(l);f.appendChild(row);c.appendChild(f);this.container=c};FilenameDialog.filenameHelpLink=null;-FilenameDialog.createFileTypes=function(b,e,g){var m=document.createElement("select");for(b=0;b<g.length;b++){var v=document.createElement("option");v.setAttribute("value",b);mxUtils.write(v,mxResources.get(g[b].description)+" (."+g[b].extension+")");m.appendChild(v)}mxEvent.addListener(m,"change",function(p){p=g[m.value].extension;var A=e.value.lastIndexOf(".drawio.");A=0<A?A:e.value.lastIndexOf(".");"drawio"!=p&&(p="drawio."+p);e.value=0<A?e.value.substring(0,A+1)+p:e.value+"."+p;"createEvent"in-document?(p=document.createEvent("HTMLEvents"),p.initEvent("change",!1,!0),e.dispatchEvent(p)):e.fireEvent("onchange")});b=function(p){p=e.value.toLowerCase();for(var A=0,H=0;H<g.length;H++){var S=g[H].extension,F=null;"drawio"!=S&&(F=S,S=".drawio."+S);if(p.substring(p.length-S.length-1)=="."+S||null!=F&&p.substring(p.length-F.length-1)=="."+F){A=H;break}}m.value=A};mxEvent.addListener(e,"change",b);mxEvent.addListener(e,"keyup",b);b();return m};-var WrapperWindow=function(b,e,g,m,v,p,A,H){H=null!=H?H:document.createElement("div");this.window=new mxWindow(e,H,g,m,v,p,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);b.installResizeHandler(this,!0);A(H)};-(function(){mxGraphView.prototype.validateBackgroundPage=function(){var A=this.graph;if(null!=A.container&&!A.transparentBackground){if(A.pageVisible){var H=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var S=A.container.firstChild;null!=S&&S.nodeType!=mxConstants.NODETYPE_ELEMENT;)S=S.nextSibling;null!=S&&(this.backgroundPageShape=this.createBackgroundPageShape(H),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML,+e.style.width="100%",l.appendChild(e));null!=A&&f.appendChild(A);row=document.createElement("div");row.style.gridColumn="1 / span 2";row.style.paddingTop=null!=K?"6px":"14px";row.style.whiteSpace="nowrap";row.style.display="inline-flex";row.style.alignItems="center";row.style.justifyContent="flex-end";row.setAttribute("align","right");l=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=F&&F()});l.className="geBtn";null==G||b.isOffline()||row.appendChild(b.createHelpIcon(G));+b.editor.cancelFirst&&row.appendChild(l);mxEvent.addListener(q,"keypress",function(H){13==H.keyCode&&D.click()});row.appendChild(D);b.editor.cancelFirst||row.appendChild(l);f.appendChild(row);c.appendChild(f);this.container=c};FilenameDialog.filenameHelpLink=null;+FilenameDialog.createFileTypes=function(b,e,g){var m=document.createElement("select");for(b=0;b<g.length;b++){var v=document.createElement("option");v.setAttribute("value",b);mxUtils.write(v,mxResources.get(g[b].description)+" (."+g[b].extension+")");m.appendChild(v)}mxEvent.addListener(m,"change",function(n){n=g[m.value].extension;var A=e.value.lastIndexOf(".drawio.");A=0<A?A:e.value.lastIndexOf(".");"drawio"!=n&&(n="drawio."+n);e.value=0<A?e.value.substring(0,A+1)+n:e.value+"."+n;"createEvent"in+document?(n=document.createEvent("HTMLEvents"),n.initEvent("change",!1,!0),e.dispatchEvent(n)):e.fireEvent("onchange")});b=function(n){n=e.value.toLowerCase();for(var A=0,G=0;G<g.length;G++){var S=g[G].extension,F=null;"drawio"!=S&&(F=S,S=".drawio."+S);if(n.substring(n.length-S.length-1)=="."+S||null!=F&&n.substring(n.length-F.length-1)=="."+F){A=G;break}}m.value=A};mxEvent.addListener(e,"change",b);mxEvent.addListener(e,"keyup",b);b();return m};+var WrapperWindow=function(b,e,g,m,v,n,A,G){G=null!=G?G:document.createElement("div");this.window=new mxWindow(e,G,g,m,v,n,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);b.installResizeHandler(this,!0);A(G)};+(function(){mxGraphView.prototype.validateBackgroundPage=function(){var A=this.graph;if(null!=A.container&&!A.transparentBackground){if(A.pageVisible){var G=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var S=A.container.firstChild;null!=S&&S.nodeType!=mxConstants.NODETYPE_ELEMENT;)S=S.nextSibling;null!=S&&(this.backgroundPageShape=this.createBackgroundPageShape(G),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML,this.backgroundPageShape.init(A.container),S.style.position="absolute",A.container.insertBefore(this.backgroundPageShape.node,S),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(F){A.dblClick(F)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(F){A.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(F))}),mxUtils.bind(this,function(F){null!=-A.tooltipHandler&&A.tooltipHandler.isHideOnHover()&&A.tooltipHandler.hide();A.isMouseDown&&!mxEvent.isConsumed(F)&&A.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(F))}),mxUtils.bind(this,function(F){A.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(F))})))}else this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=H,this.backgroundPageShape.redraw()}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null);this.validateBackgroundStyles()}};-mxGraphView.prototype.validateBackgroundStyles=function(A,H,S){var F=this.graph;A=null!=A?A:1;var K=mxUtils.getLightDarkColor(null==F.background||F.background==mxConstants.NONE?F.defaultPageBackgroundColor:F.background).cssText,c=mxUtils.getLightDarkColor(F.defaultPageBorderColor).cssText,f=null!=K&&this.gridColor!=K.toLowerCase()?this.gridColor:"#ffffff",l="none",t="";"simple"==F.getAdaptiveColors()&&F.background!=mxConstants.NONE&&null!=F.background&&(K=F.background);if(F.isGridEnabled()||F.gridVisible){t=-10;mxClient.IS_SVG?(l=unescape(encodeURIComponent(this.createSvgGrid(f,A))),l=window.btoa?btoa(l):Base64.encode(l,!0),l="url(data:image/svg+xml;base64,"+l+")",t=F.gridSize*this.scale*this.gridSteps*A):l="url("+this.gridImage+")";var q=f=0;H=null!=H?H-this.translate.x*this.scale:0;S=null!=S?S-this.translate.y*this.scale:0;var D=F.gridSize*this.scale*this.gridSteps,G=H%D;D=S%D;null!=F.view.backgroundPageShape&&(q=this.getBackgroundPageBounds(),f=1+q.x,q=1+q.y);t=-Math.round(t-mxUtils.mod(this.translate.x*-this.scale-f+H,t)+G*A)+"px "+-Math.round(t-mxUtils.mod(this.translate.y*this.scale-q+S,t)+D*A)+"px"}A=F.view.canvas;null!=A.ownerSVGElement&&(A=A.ownerSVGElement);f=!Editor.isDarkMode()&&F.enableDiagramBackground;null!=F.view.backgroundPageShape?(F.view.backgroundPageShape.node.style.backgroundPosition=t,F.view.backgroundPageShape.node.style.backgroundImage=l,F.view.backgroundPageShape.node.style.backgroundColor=K,F.view.backgroundPageShape.node.style.borderColor=c,F.view.backgroundPageShape.node.style.colorScheme=+A.tooltipHandler&&A.tooltipHandler.isHideOnHover()&&A.tooltipHandler.hide();A.isMouseDown&&!mxEvent.isConsumed(F)&&A.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(F))}),mxUtils.bind(this,function(F){A.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(F))})))}else this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=G,this.backgroundPageShape.redraw()}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null);this.validateBackgroundStyles()}};+mxGraphView.prototype.validateBackgroundStyles=function(A,G,S){var F=this.graph;A=null!=A?A:1;var K=mxUtils.getLightDarkColor(null==F.background||F.background==mxConstants.NONE?F.defaultPageBackgroundColor:F.background).cssText,c=mxUtils.getLightDarkColor(F.defaultPageBorderColor).cssText,f=null!=K&&this.gridColor!=K.toLowerCase()?this.gridColor:"#ffffff",l="none",t="";"simple"==F.getAdaptiveColors()&&F.background!=mxConstants.NONE&&null!=F.background&&(K=F.background);if(F.isGridEnabled()||F.gridVisible){t=+10;mxClient.IS_SVG?(l=unescape(encodeURIComponent(this.createSvgGrid(f,A))),l=window.btoa?btoa(l):Base64.encode(l,!0),l="url(data:image/svg+xml;base64,"+l+")",t=F.gridSize*this.scale*this.gridSteps*A):l="url("+this.gridImage+")";var q=f=0;G=null!=G?G-this.translate.x*this.scale:0;S=null!=S?S-this.translate.y*this.scale:0;var D=F.gridSize*this.scale*this.gridSteps,H=G%D;D=S%D;null!=F.view.backgroundPageShape&&(q=this.getBackgroundPageBounds(),f=1+q.x,q=1+q.y);t=-Math.round(t-mxUtils.mod(this.translate.x*+this.scale-f+G,t)+H*A)+"px "+-Math.round(t-mxUtils.mod(this.translate.y*this.scale-q+S,t)+D*A)+"px"}A=F.view.canvas;null!=A.ownerSVGElement&&(A=A.ownerSVGElement);f=!Editor.isDarkMode()&&F.enableDiagramBackground;null!=F.view.backgroundPageShape?(F.view.backgroundPageShape.node.style.backgroundPosition=t,F.view.backgroundPageShape.node.style.backgroundImage=l,F.view.backgroundPageShape.node.style.backgroundColor=K,F.view.backgroundPageShape.node.style.borderColor=c,F.view.backgroundPageShape.node.style.colorScheme="none"==F.getAdaptiveColors()?"light":"",A.style.backgroundImage="none",A.style.backgroundColor="",F.container.style.backgroundColor=f?F.diagramBackgroundColor:""):(A.style.backgroundPosition=t,A.style.backgroundImage=l,"1"==urlParams.transparent?F.container.style.background="transparent":!f||null!=F.background&&F.background!=mxConstants.NONE?A.style.backgroundColor=K:(A.style.backgroundColor=F.diagramBackgroundColor,F.container.style.backgroundColor=""))};mxGraphView.prototype.createSvgGrid=function(A,-H){for(var S=this.graph.gridSize*this.scale*(null!=H?H:1);S<this.minGridSize;)S*=2;H=this.gridSteps*S;for(var F=[],K=1;K<this.gridSteps;K++){var c=K*S;F.push("M 0 "+c+" L "+H+" "+c+" M "+c+" 0 L "+c+" "+H)}A=mxUtils.getLightDarkColor(A);S="color-scheme: light dark;";mxClient.IS_SF&&(S="color-scheme: "+("none"!=this.graph.getAdaptiveColors()&&Editor.isDarkMode()?"dark":"light"));return'<svg style="'+S+'" width="'+H+'" height="'+H+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+-H+'" height="'+H+'" patternUnits="userSpaceOnUse"><path d="'+F.join(" ")+'" fill="none" style="stroke:'+mxUtils.htmlEntities(A.cssText)+';" stroke="'+A.light+'" opacity="0.2" stroke-width="1"/><path d="M '+H+" 0 L 0 0 0 "+H+'" fill="none" style="stroke:'+mxUtils.htmlEntities(A.cssText)+';" stroke="'+A.light+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var b=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(A,H){b.apply(this,arguments);-if(null!=this.shiftPreview1){var S=this.view.canvas;null!=S.ownerSVGElement&&(S=S.ownerSVGElement);var F=this.gridSize*this.view.scale*this.view.gridSteps;F=-Math.round(F-mxUtils.mod(this.view.translate.x*this.view.scale+A,F))+"px "+-Math.round(F-mxUtils.mod(this.view.translate.y*this.view.scale+H,F))+"px";S.style.backgroundPosition=F}};mxGraph.prototype.updatePageBreaks=function(A,H,S){var F=this.view.scale,K=this.view.translate,c=this.pageFormat,f=F*this.pageScale,l=this.view.getBackgroundPageBounds();-H=l.width;S=l.height;var t=new mxRectangle(F*K.x,F*K.y,c.width*f,c.height*f),q=(A=A&&Math.min(t.width,t.height)>this.minPageBreakDist)?Math.ceil(S/t.height)-1:0,D=A?Math.ceil(H/t.width)-1:0,G=l.x+H,N=l.y+S;null==this.horizontalPageBreaks&&0<q&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<D&&(this.verticalPageBreaks=[]);A=mxUtils.bind(this,function(L){if(null!=L){for(var J=L==this.horizontalPageBreaks?q:D,Y=0;Y<=J;Y++){var ha=L==this.horizontalPageBreaks?[new mxPoint(Math.round(l.x),-Math.round(l.y+(Y+1)*t.height)),new mxPoint(Math.round(G),Math.round(l.y+(Y+1)*t.height))]:[new mxPoint(Math.round(l.x+(Y+1)*t.width),Math.round(l.y)),new mxPoint(Math.round(l.x+(Y+1)*t.width),Math.round(N))];null!=L[Y]?(L[Y].points=ha,L[Y].redraw()):(ha=new mxPolyline(ha,this.pageBreakColor),ha.dialect=this.dialect,ha.isDashed=this.pageBreakDashed,ha.pointerEvents=!1,ha.init(this.view.backgroundPane),ha.redraw(),L[Y]=ha)}for(Y=J;Y<L.length;Y++)null!=L[Y]&&L[Y].destroy();L.splice(J,L.length-J)}});-A(this.horizontalPageBreaks);A(this.verticalPageBreaks)};var e=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(A,H,S){for(var F=0;F<H.length;F++){if(this.graph.isTableCell(H[F])||this.graph.isTableRow(H[F]))return!1;if(this.graph.getModel().isVertex(H[F])){var K=this.graph.getCellGeometry(H[F]);if(null!=K&&K.relative)return!1}}return e.apply(this,arguments)};var g=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=-function(){var A=g.apply(this,arguments);A.intersects=mxUtils.bind(this,function(H,S){return this.isConnecting()?!0:mxCellMarker.prototype.intersects.apply(A,arguments)});return A};mxGraphView.prototype.createBackgroundPageShape=function(A){return new mxRectangleShape(A,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var A=this.getGraphBounds(),H=0<A.width?A.x/this.scale-this.translate.x:0,S=0<A.height?A.y/this.scale-this.translate.y:0,F=this.graph.pageFormat,-K=this.graph.pageScale,c=F.width*K;F=F.height*K;K=Math.floor(Math.min(0,H)/c);var f=Math.floor(Math.min(0,S)/F);return new mxRectangle(this.scale*(this.translate.x+K*c),this.scale*(this.translate.y+f*F),this.scale*(Math.ceil(Math.max(1,H+A.width/this.scale)/c)-K)*c,this.scale*(Math.ceil(Math.max(1,S+A.height/this.scale)/F)-f)*F)};var m=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(A,H){m.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||-this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=A+"px",this.view.backgroundPageShape.node.style.marginTop=H+"px")};var v=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(A,H,S,F,K,c){var f=v.apply(this,arguments);null==c||c||mxEvent.addListener(f,"mousedown",function(l){mxEvent.consume(l)});return f};var p=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=-function(A,H,S){var F=this.graph.model.getParent(A);if(H){var K=this.graph.model.isEdge(A)?null:this.graph.getCellGeometry(A);K=!this.graph.model.isEdge(F)&&!this.graph.isSiblingSelected(A)&&(null!=K&&K.relative||!this.graph.isContainer(F)||this.graph.isPart(A))}else if(K=p.apply(this,arguments),this.graph.isTableCell(A)||this.graph.isTableRow(A))K=F,this.graph.isTable(K)||(K=this.graph.model.getParent(K)),K=!this.graph.selectionCellsHandler.isHandled(K)||this.graph.isCellSelected(K)&&this.graph.isToggleEvent(S.getEvent())||-this.graph.isCellSelected(A)&&!this.graph.isToggleEvent(S.getEvent())||this.graph.isTableCell(A)&&this.graph.isCellSelected(F);return K};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(A){A=A.getCell();for(var H=this.graph.getModel(),S=H.getParent(A),F=this.graph.view.getState(S),K=this.graph.isCellSelected(A);null!=F&&(H.isVertex(S)||H.isEdge(S));){var c=this.graph.isCellSelected(S);K=K||c;if(c||!K&&(this.graph.isTableCell(A)||this.graph.isTableRow(A)))A=S;S=H.getParent(S)}return A}})();EditorUi=function(b,e,g){mxEventSource.call(this);this.destroyFunctions=[];this.editor=b||new Editor;this.container=e||document.body;var m=this,v=this.editor.graph;v.lightbox=g;var p=v.getGraphBounds;v.getGraphBounds=function(){var W=p.apply(this,arguments),ba=this.backgroundImage;if(null!=ba&&null!=ba.width&&null!=ba.height){var ja=this.view.translate,ca=this.view.scale;W=mxRectangle.fromRectangle(W);W.add(new mxRectangle((ja.x+ba.x)*ca,(ja.y+ba.y)*ca,ba.width*ca,ba.height*ca))}return W};v.useCssTransforms&&+G){for(var S=this.graph.gridSize*this.scale*(null!=G?G:1);S<this.minGridSize;)S*=2;G=this.gridSteps*S;for(var F=[],K=1;K<this.gridSteps;K++){var c=K*S;F.push("M 0 "+c+" L "+G+" "+c+" M "+c+" 0 L "+c+" "+G)}A=mxUtils.getLightDarkColor(A);S="color-scheme: light dark;";mxClient.IS_SF&&(S="color-scheme: "+("none"!=this.graph.getAdaptiveColors()&&Editor.isDarkMode()?"dark":"light"));return'<svg style="'+S+'" width="'+G+'" height="'+G+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'++G+'" height="'+G+'" patternUnits="userSpaceOnUse"><path d="'+F.join(" ")+'" fill="none" style="stroke:'+mxUtils.htmlEntities(A.cssText)+';" stroke="'+A.light+'" opacity="0.2" stroke-width="1"/><path d="M '+G+" 0 L 0 0 0 "+G+'" fill="none" style="stroke:'+mxUtils.htmlEntities(A.cssText)+';" stroke="'+A.light+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var b=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(A,G){b.apply(this,arguments);+if(null!=this.shiftPreview1){var S=this.view.canvas;null!=S.ownerSVGElement&&(S=S.ownerSVGElement);var F=this.gridSize*this.view.scale*this.view.gridSteps;F=-Math.round(F-mxUtils.mod(this.view.translate.x*this.view.scale+A,F))+"px "+-Math.round(F-mxUtils.mod(this.view.translate.y*this.view.scale+G,F))+"px";S.style.backgroundPosition=F}};mxGraph.prototype.updatePageBreaks=function(A,G,S){var F=this.view.scale,K=this.view.translate,c=this.pageFormat,f=F*this.pageScale,l=this.view.getBackgroundPageBounds();+G=l.width;S=l.height;var t=new mxRectangle(F*K.x,F*K.y,c.width*f,c.height*f),q=(A=A&&Math.min(t.width,t.height)>this.minPageBreakDist)?Math.ceil(S/t.height)-1:0,D=A?Math.ceil(G/t.width)-1:0,H=l.x+G,N=l.y+S;null==this.horizontalPageBreaks&&0<q&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<D&&(this.verticalPageBreaks=[]);A=mxUtils.bind(this,function(L){if(null!=L){for(var J=L==this.horizontalPageBreaks?q:D,Y=0;Y<=J;Y++){var ha=L==this.horizontalPageBreaks?[new mxPoint(Math.round(l.x),+Math.round(l.y+(Y+1)*t.height)),new mxPoint(Math.round(H),Math.round(l.y+(Y+1)*t.height))]:[new mxPoint(Math.round(l.x+(Y+1)*t.width),Math.round(l.y)),new mxPoint(Math.round(l.x+(Y+1)*t.width),Math.round(N))];null!=L[Y]?(L[Y].points=ha,L[Y].redraw()):(ha=new mxPolyline(ha,this.pageBreakColor),ha.dialect=this.dialect,ha.isDashed=this.pageBreakDashed,ha.pointerEvents=!1,ha.init(this.view.backgroundPane),ha.redraw(),L[Y]=ha)}for(Y=J;Y<L.length;Y++)null!=L[Y]&&L[Y].destroy();L.splice(J,L.length-J)}});+A(this.horizontalPageBreaks);A(this.verticalPageBreaks)};var e=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(A,G,S){for(var F=0;F<G.length;F++){if(this.graph.isTableCell(G[F])||this.graph.isTableRow(G[F]))return!1;if(this.graph.getModel().isVertex(G[F])){var K=this.graph.getCellGeometry(G[F]);if(null!=K&&K.relative)return!1}}return e.apply(this,arguments)};var g=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=+function(){var A=g.apply(this,arguments);A.intersects=mxUtils.bind(this,function(G,S){return this.isConnecting()?!0:mxCellMarker.prototype.intersects.apply(A,arguments)});return A};mxGraphView.prototype.createBackgroundPageShape=function(A){return new mxRectangleShape(A,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var A=this.getGraphBounds(),G=0<A.width?A.x/this.scale-this.translate.x:0,S=0<A.height?A.y/this.scale-this.translate.y:0,F=this.graph.pageFormat,+K=this.graph.pageScale,c=F.width*K;F=F.height*K;K=Math.floor(Math.min(0,G)/c);var f=Math.floor(Math.min(0,S)/F);return new mxRectangle(this.scale*(this.translate.x+K*c),this.scale*(this.translate.y+f*F),this.scale*(Math.ceil(Math.max(1,G+A.width/this.scale)/c)-K)*c,this.scale*(Math.ceil(Math.max(1,S+A.height/this.scale)/F)-f)*F)};var m=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(A,G){m.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||+this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=A+"px",this.view.backgroundPageShape.node.style.marginTop=G+"px")};var v=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(A,G,S,F,K,c){var f=v.apply(this,arguments);null==c||c||mxEvent.addListener(f,"mousedown",function(l){mxEvent.consume(l)});return f};var n=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=+function(A,G,S){var F=this.graph.model.getParent(A);if(G){var K=this.graph.model.isEdge(A)?null:this.graph.getCellGeometry(A);K=!this.graph.model.isEdge(F)&&!this.graph.isSiblingSelected(A)&&(null!=K&&K.relative||!this.graph.isContainer(F)||this.graph.isPart(A))}else if(K=n.apply(this,arguments),this.graph.isTableCell(A)||this.graph.isTableRow(A))K=F,this.graph.isTable(K)||(K=this.graph.model.getParent(K)),K=!this.graph.selectionCellsHandler.isHandled(K)||this.graph.isCellSelected(K)&&this.graph.isToggleEvent(S.getEvent())||+this.graph.isCellSelected(A)&&!this.graph.isToggleEvent(S.getEvent())||this.graph.isTableCell(A)&&this.graph.isCellSelected(F);return K};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(A){A=A.getCell();for(var G=this.graph.getModel(),S=G.getParent(A),F=this.graph.view.getState(S),K=this.graph.isCellSelected(A);null!=F&&(G.isVertex(S)||G.isEdge(S));){var c=this.graph.isCellSelected(S);K=K||c;if(c||!K&&(this.graph.isTableCell(A)||this.graph.isTableRow(A)))A=S;S=G.getParent(S)}return A}})();EditorUi=function(b,e,g){mxEventSource.call(this);this.destroyFunctions=[];this.editor=b||new Editor;this.container=e||document.body;var m=this,v=this.editor.graph;v.lightbox=g;var n=v.getGraphBounds;v.getGraphBounds=function(){var W=n.apply(this,arguments),ba=this.backgroundImage;if(null!=ba&&null!=ba.width&&null!=ba.height){var ja=this.view.translate,ca=this.view.scale;W=mxRectangle.fromRectangle(W);W.add(new mxRectangle((ja.x+ba.x)*ca,(ja.y+ba.y)*ca,ba.width*ca,ba.height*ca))}return W};v.useCssTransforms&&(this.lazyZoomDelay=0);this.selectionStateListener=mxUtils.bind(this,function(W,ba){this.clearSelectionState()});v.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionStateListener);v.getModel().addListener(mxEvent.CHANGE,this.selectionStateListener);v.addListener(mxEvent.EDITING_STARTED,this.selectionStateListener);v.addListener(mxEvent.EDITING_STOPPED,this.selectionStateListener);v.getView().addListener("unitChanged",this.selectionStateListener);if(this.editor.chromeless&&!this.editor.editable){v.isEnabled=-function(){return!1};v.panningHandler.isForcePanningEvent=function(W){for(var ba=W.getSource();null!=ba&&ba!=v.container;){if("foreignObject"===ba.nodeName||"text"===ba.nodeName)return!1;ba=ba.parentNode}return!mxEvent.isPopupTrigger(W.getEvent())};var A=v.panningHandler.start;v.panningHandler.start=function(){A.apply(this,arguments);mxUtils.clearSelection()}}this.actions=new Actions(this);this.menus=this.createMenus();if(!v.standalone){var H=!1,S=!1;this.setDefaultStyle=function(W){try{v.getModel().isEdge(W)?-S=v.pasteEdgeStyle=!1:H=!1;var ba=v.getCellStyle(W,!1),ja=[],ca=[],la;for(la in ba)ja.push(ba[la]),ca.push(la);v.getModel().isEdge(W)?v.currentEdgeStyle={}:v.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",ca,"values",ja,"cells",[W],"force",!0));v.getModel().isEdge(W)?S=v.pasteEdgeStyle=!0:H=!0}catch(Q){this.handleError(Q)}};this.clearDefaultStyle=function(){v.currentEdgeStyle=mxUtils.clone(v.defaultEdgeStyle);v.currentVertexStyle=mxUtils.clone(v.defaultVertexStyle);H=+function(){return!1};v.panningHandler.isForcePanningEvent=function(W){for(var ba=W.getSource();null!=ba&&ba!=v.container;){if("foreignObject"===ba.nodeName||"text"===ba.nodeName)return!1;ba=ba.parentNode}return!mxEvent.isPopupTrigger(W.getEvent())};var A=v.panningHandler.start;v.panningHandler.start=function(){A.apply(this,arguments);mxUtils.clearSelection()}}this.actions=new Actions(this);this.menus=this.createMenus();if(!v.standalone){var G=!1,S=!1;this.setDefaultStyle=function(W){try{v.getModel().isEdge(W)?+S=v.pasteEdgeStyle=!1:G=!1;var ba=v.getCellStyle(W,!1),ja=[],ca=[],la;for(la in ba)ja.push(ba[la]),ca.push(la);v.getModel().isEdge(W)?v.currentEdgeStyle={}:v.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",ca,"values",ja,"cells",[W],"force",!0));v.getModel().isEdge(W)?S=v.pasteEdgeStyle=!0:G=!0}catch(Q){this.handleError(Q)}};this.clearDefaultStyle=function(){v.currentEdgeStyle=mxUtils.clone(v.defaultEdgeStyle);v.currentVertexStyle=mxUtils.clone(v.defaultVertexStyle);G=S=v.pasteEdgeStyle=!1;this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};v.addListener("cellsInserted",function(W,ba){v.pasteCellStyles(v.includeDescendants(ba.getProperty("cells")))});v.addListener("textInserted",function(W,ba){v.pasteCellStyles(ba.getProperty("cells"))});this.createDivs();this.createUi();this.refresh();var F=mxUtils.bind(this,function(W){null==W&&(W=window.event);return v.isEditing()||null!=W&&this.isSelectionAllowed(W)});this.container!=document.body||this.editor.chromeless&&!this.editor.editable||(this.menubarContainer.onselectstart=F,this.menubarContainer.onmousedown=F,this.toolbarContainer.onselectstart=F,this.toolbarContainer.onmousedown=F,this.diagramContainer.onselectstart=F,this.diagramContainer.onmousedown=F,this.sidebarContainer.onselectstart=F,this.sidebarContainer.onmousedown=F,this.formatContainer.onselectstart=F,this.formatContainer.onmousedown=F,null!=this.tabContainer&&(this.tabContainer.onselectstart=F),mxClient.IS_IOS&&(e=function(){var W=null;if(/iP(hone|od|ad)/.test(navigator.platform)){var ba=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);try{W=[parseInt(ba[1],10),parseInt(ba[2],10),parseInt(ba[3]||0,10)]}catch(ja){}}return W}(),null!=e&&16<=e[0]&&(mxUtils.setPrefixedStyle(this.menubarContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.diagramContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.sidebarContainer.style,"userSelect","none"),mxUtils.setPrefixedStyle(this.formatContainer.style,"userSelect",@@ -2047,13 +2048,13 @@ null;if(/iP(hone|od|ad)/.test(navigator.platform)){var ba=navigator.appVersion.mba.x-this.diagramContainer.clientWidth||0<mxEvent.getClientY(W)-ba.y-this.diagramContainer.clientHeight?this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var c=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(W,ba){return m.isSpaceDown()||c.apply(this,arguments)};this.keydownHandler=mxUtils.bind(this,function(W){16==W.which?this.shiftDown=!0:32!=W.which||v.isEditing()?mxEvent.isConsumed(W)||27!=W.keyCode||this.hideDialog(null,!0):(this.spaceDown=!0,this.hoverIcons.reset(),v.container.style.cursor="move",v.isEditing()||mxEvent.getSource(W)!=v.container||mxEvent.consume(W))});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(W){v.container.style.cursor="";this.shiftDown=this.spaceDown=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);var f=v.panningHandler.isForcePanningEvent;v.panningHandler.isForcePanningEvent=function(W){return f.apply(this,arguments)||m.isSpaceDown()||mxEvent.isMouseEvent(W.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(W.getEvent()))&&(!mxEvent.isControlDown(W.getEvent())&&mxEvent.isRightMouseButton(W.getEvent())||mxEvent.isMiddleMouseButton(W.getEvent()))};var l=v.cellEditor.isStopEditingEvent;v.cellEditor.isStopEditingEvent=function(W){return l.apply(this,arguments)||13==W.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(W)||mxClient.IS_MAC&&mxEvent.isMetaDown(W)||mxClient.IS_SF&&mxEvent.isShiftDown(W))};-var t=v.isZoomWheelEvent;v.isZoomWheelEvent=function(){return m.isSpaceDown()||t.apply(this,arguments)};var q=mxUtils.bind(this,function(){if(null!=this.toolbar)for(var W=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,ba=this.toolbar.container.firstChild;null!=ba;){var ja=ba.getAttribute("data-min-width");null!=ja&&parseInt(ja)>W?ba.style.display="none":ba.style.display="";ba=ba.nextSibling}}),D=!1,G=null,N=null,L=null,J=mxUtils.bind(this,function(){if(null!=this.toolbar&&-D!=v.cellEditor.isContentEditing()){for(var W=this.toolbar.container.firstChild,ba=[];null!=W;){var ja=W.nextSibling;W.parentNode.removeChild(W);ba.push(W);W=ja}W=this.toolbar.fontMenu;ja=this.toolbar.sizeMenu;if(null==L)this.toolbar.createTextToolbar();else{for(var ca=0;ca<L.length;ca++)this.toolbar.container.appendChild(L[ca]);this.toolbar.fontMenu=G;this.toolbar.sizeMenu=N}D=v.cellEditor.isContentEditing();G=W;N=ja;L=ba;q()}});this.addListener("languageChanged",mxUtils.bind(this,function(){this.destroyWindows(!0);+var t=v.isZoomWheelEvent;v.isZoomWheelEvent=function(){return m.isSpaceDown()||t.apply(this,arguments)};var q=mxUtils.bind(this,function(){if(null!=this.toolbar)for(var W=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,ba=this.toolbar.container.firstChild;null!=ba;){var ja=ba.getAttribute("data-min-width");null!=ja&&parseInt(ja)>W?ba.style.display="none":ba.style.display="";ba=ba.nextSibling}}),D=!1,H=null,N=null,L=null,J=mxUtils.bind(this,function(){if(null!=this.toolbar&&+D!=v.cellEditor.isContentEditing()){for(var W=this.toolbar.container.firstChild,ba=[];null!=W;){var ja=W.nextSibling;W.parentNode.removeChild(W);ba.push(W);W=ja}W=this.toolbar.fontMenu;ja=this.toolbar.sizeMenu;if(null==L)this.toolbar.createTextToolbar();else{for(var ca=0;ca<L.length;ca++)this.toolbar.container.appendChild(L[ca]);this.toolbar.fontMenu=H;this.toolbar.sizeMenu=N}D=v.cellEditor.isContentEditing();H=W;N=ja;L=ba;q()}});this.addListener("languageChanged",mxUtils.bind(this,function(){this.destroyWindows(!0);this.descriptorChanged();this.updateStatusAgain();J()}));this.addListener("currentThemeChanged",q);mxEvent.addListener(window,"resize",q);q();var Y=v.cellEditor.startEditing;v.cellEditor.startEditing=function(){Y.apply(this,arguments);J();if(v.cellEditor.isContentEditing()){var W=!1,ba=function(){W||(W=!0,window.setTimeout(function(){var ja=v.getSelectedEditingElement();null!=ja&&(ja=mxUtils.getCurrentStyle(ja),null!=ja&&null!=m.toolbar&&(m.toolbar.setFontName(mxUtils.getCssFontFamily(ja.fontFamily)),m.toolbar.setFontSize(parseInt(ja.fontSize))));W=!1},0))};mxEvent.addListener(v.cellEditor.textarea,"input",ba);mxEvent.addListener(v.cellEditor.textarea,"touchend",ba);mxEvent.addListener(v.cellEditor.textarea,"mouseup",ba);mxEvent.addListener(v.cellEditor.textarea,"keyup",ba);ba()}};var ha=v.cellEditor.stopEditing;v.cellEditor.stopEditing=function(W,ba){try{ha.apply(this,arguments),J()}catch(ja){m.handleError(ja)}};v.container.setAttribute("tabindex","0");v.container.style.cursor="default";if(window.self===window.top&&null!=v.container.parentNode)try{v.container.focus()}catch(W){}var ea=v.fireMouseEvent;v.fireMouseEvent=function(W,ba,ja){try{W==mxEvent.MOUSE_DOWN&&this.container.focus(),ea.apply(this,arguments)}catch(ca){m.handleError(ca)}};var aa=v.foldCells;v.foldCells=function(W,ba,ja,ca,la){try{aa.apply(this,arguments)}catch(Q){m.handleError(Q)}};v.popupMenuHandler.autoExpand=!0;null!=this.menus&&(v.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(W,ba,ja){this.menus.createPopupMenu(W,ba,ja)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(W){v.popupMenuHandler.hideMenu()}));this.keyHandler=this.createKeyHandler(b);this.getKeyHandler=function(){return keyHandler};v.connectionHandler.addListener(mxEvent.CONNECT,function(W,ba){var ja=[ba.getProperty("cell")];ba.getProperty("terminalInserted")&&(ja.push(ba.getProperty("terminal")),window.setTimeout(function(){null!=m.hoverIcons&&m.hoverIcons.update(v.view.getState(ja[ja.length-1]))},0));v.pasteCellStyles(ja)});this.addListener("styleChanged",-mxUtils.bind(this,function(W,ba){W=ba.getProperty("force");(this.updateDefaultStyle||W)&&v.copyCellStyles(ba.getProperty("cells"),ba.getProperty("keys"),ba.getProperty("values"),v.currentVertexStyle,v.currentEdgeStyle,H,S);null!=this.toolbar&&(this.toolbar.setFontName(v.currentVertexStyle.fontFamily||Menus.prototype.defaultFont),this.toolbar.setFontSize(v.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),null!=this.toolbar.edgeStyleMenu&&("orthogonalEdgeStyle"==v.currentEdgeStyle.edgeStyle&&+mxUtils.bind(this,function(W,ba){W=ba.getProperty("force");(this.updateDefaultStyle||W)&&v.copyCellStyles(ba.getProperty("cells"),ba.getProperty("keys"),ba.getProperty("values"),v.currentVertexStyle,v.currentEdgeStyle,G,S);null!=this.toolbar&&(this.toolbar.setFontName(v.currentVertexStyle.fontFamily||Menus.prototype.defaultFont),this.toolbar.setFontSize(v.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),null!=this.toolbar.edgeStyleMenu&&("orthogonalEdgeStyle"==v.currentEdgeStyle.edgeStyle&&"1"==v.currentEdgeStyle.curved?this.toolbar.setMenuIcon(this.toolbar.edgeStyleMenu,Format.curvedImage.src):"straight"==v.currentEdgeStyle.edgeStyle||"none"==v.currentEdgeStyle.edgeStyle||null==v.currentEdgeStyle.edgeStyle?this.toolbar.setMenuIcon(this.toolbar.edgeStyleMenu,Format.straightImage.src):"entityRelationEdgeStyle"==v.currentEdgeStyle.edgeStyle?this.toolbar.setMenuIcon(this.toolbar.edgeStyleMenu,Format.entityImage.src):"elbowEdgeStyle"==v.currentEdgeStyle.edgeStyle?"vertical"==v.currentEdgeStyle.elbow?this.toolbar.setMenuIcon(this.toolbar.edgeStyleMenu,Format.verticalElbowImage.src):this.toolbar.setMenuIcon(this.toolbar.edgeStyleMenu,Format.horizontalElbowImage.src):"isometricEdgeStyle"==v.currentEdgeStyle.edgeStyle?"vertical"==v.currentEdgeStyle.elbow?this.toolbar.setMenuIcon(this.toolbar.edgeStyleMenu,Format.verticalIsometricImage.src):this.toolbar.setMenuIcon(this.toolbar.edgeStyleMenu,Format.horizontalIsometricImage.src):this.toolbar.setMenuIcon(this.toolbar.edgeStyleMenu,Format.orthogonalImage.src)),null!=this.toolbar.edgeShapeMenu&&("link"==v.currentEdgeStyle.shape?this.toolbar.setMenuIcon(this.toolbar.edgeShapeMenu,Format.linkEdgeImage.src):"flexArrow"==v.currentEdgeStyle.shape?this.toolbar.setMenuIcon(this.toolbar.edgeShapeMenu,Format.arrowImage.src):"arrow"==v.currentEdgeStyle.shape?this.toolbar.setMenuIcon(this.toolbar.edgeShapeMenu,Format.simpleArrowImage.src):this.toolbar.setMenuIcon(this.toolbar.edgeShapeMenu,Format.connectionImage.src)))}));null!=this.toolbar&&(b=mxUtils.bind(this,function(){var W=@@ -2062,45 +2063,48 @@ ba=ba.getProperty("parent");null!=ba&&v.getModel().isLayer(ba)&&!v.isCellVisiblethis.gestureHandler);var na=null;this.resizeHandler=mxUtils.bind(this,function(){null!=na&&window.clearTimeout(na);na=window.setTimeout(mxUtils.bind(this,function(){na=null;this.windowResized()}),100)});mxEvent.addListener(window,"resize",this.resizeHandler);this.orientationChangeHandler=mxUtils.bind(this,function(){this.refresh()});mxEvent.addListener(window,"orientationchange",this.orientationChangeHandler);mxClient.IS_IOS&&!window.navigator.standalone&&"undefined"!==typeof Menus&&(this.scrollHandler=mxUtils.bind(this,function(){window.scrollTo(0,0)}),mxEvent.addListener(window,"scroll",this.scrollHandler));this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.resetScrollbars()}));this.addListener("gridEnabledChanged",mxUtils.bind(this,function(){v.view.validateBackground()}));this.addListener("backgroundColorChanged",mxUtils.bind(this,function(){v.view.validateBackground()}));v.addListener("gridSizeChanged",mxUtils.bind(this,function(){v.isGridEnabled()&&v.view.validateBackground()}));this.editor.resetGraph()}this.init();v.standalone||this.open()};EditorUi.compactUi=!0;-EditorUi.parsePng=function(b,e,g){function m(H,S){var F=p;p+=S;return H.substring(F,p)}function v(H){H=m(H,4);return H.charCodeAt(3)+(H.charCodeAt(2)<<8)+(H.charCodeAt(1)<<16)+(H.charCodeAt(0)<<24)}var p=0;if(m(b,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=g&&g();else if(m(b,4),"IHDR"!=m(b,4))null!=g&&g();else{m(b,17);do{g=v(b);var A=m(b,4);if(null!=e&&e(p-8,A,g))break;value=m(b,g);m(b,4);if("IEND"==A)break}while(g)}};mxUtils.extend(EditorUi,mxEventSource);+EditorUi.parsePng=function(b,e,g){function m(G,S){var F=n;n+=S;return G.substring(F,n)}function v(G){G=m(G,4);return G.charCodeAt(3)+(G.charCodeAt(2)<<8)+(G.charCodeAt(1)<<16)+(G.charCodeAt(0)<<24)}var n=0;if(m(b,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=g&&g();else if(m(b,4),"IHDR"!=m(b,4))null!=g&&g();else{m(b,17);do{g=v(b);var A=m(b,4);if(null!=e&&e(n-8,A,g))break;value=m(b,g);m(b,4);if("IEND"==A)break}while(g)}};mxUtils.extend(EditorUi,mxEventSource);EditorUi.prototype.splitSize=mxClient.IS_TOUCH||mxClient.IS_POINTER?12:8;EditorUi.prototype.formatEnabled=!0;EditorUi.prototype.formatWidth=240;EditorUi.prototype.defaultSidebarWidth=Math.min(screen.width/2,"large"!=urlParams["sidebar-entries"]?218:230);EditorUi.prototype.hsplitPosition=screen.width<=Editor.smallScreenWidth?0:EditorUi.prototype.defaultSidebarWidth;EditorUi.prototype.allowAnimation=!0;EditorUi.prototype.lightboxMaxFitScale=2;EditorUi.prototype.lightboxVerticalDivider=4;EditorUi.prototype.hsplitClickEnabled=!1;EditorUi.prototype.updateDefaultStyle=!1;EditorUi.prototype.spaceDown=!1;EditorUi.prototype.shiftDown=!1;EditorUi.prototype.init=function(){var b=this.editor.graph;if(!b.standalone){"0"!=urlParams["shape-picker"]&&this.installShapePicker();mxEvent.addListener(b.container,"scroll",mxUtils.bind(this,function(){b.tooltipHandler.hide();null!=b.connectionHandler&&null!=b.connectionHandler.constraintHandler&&b.connectionHandler.constraintHandler.reset()}));b.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){b.tooltipHandler.hide();var m=b.getRubberband();null!=m&&m.cancel()}));mxEvent.addListener(b.container,"keydown",mxUtils.bind(this,function(m){this.onKeyDown(m)}));mxEvent.addListener(b.container,"keypress",mxUtils.bind(this,function(m){this.onKeyPress(m)}));this.addUndoListener();this.addBeforeUnloadListener();b.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()}));b.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()}));var e=b.setDefaultParent,g=this;this.editor.graph.setDefaultParent=function(){e.apply(this,arguments);g.updateActionStates()};b.showLinkDialog=mxUtils.bind(g,g.showLinkDialog);b.editLink=g.actions.get("editLink").funct;this.updateActionStates();this.initClipboard();this.initCanvas();null!=this.format&&this.format.init()}};EditorUi.prototype.clearSelectionState=function(){this.selectionState=null};EditorUi.prototype.getSelectionState=function(){null==this.selectionState&&(this.selectionState=this.createSelectionState());return this.selectionState};-EditorUi.prototype.createSelectionState=function(){for(var b=this.editor.graph,e=b.getSelectionCells(),g=this.initSelectionState(),m=!0,v=0;v<e.length;v++){var p=b.getCurrentCellStyle(e[v]);"0"!=mxUtils.getValue(p,mxConstants.STYLE_EDITABLE,"1")&&(this.updateSelectionStateForCell(g,e[v],e,m),m=!1)}this.updateSelectionStateForTableCells(g);return g};+EditorUi.prototype.createSelectionState=function(){for(var b=this.editor.graph,e=b.getSelectionCells(),g=this.initSelectionState(),m=!0,v=0;v<e.length;v++){var n=b.getCurrentCellStyle(e[v]);"0"!=mxUtils.getValue(n,mxConstants.STYLE_EDITABLE,"1")&&(this.updateSelectionStateForCell(g,e[v],e,m),m=!1)}this.updateSelectionStateForTableCells(g);if(Editor.enableCustomProperties&&null!=this.format){g.customProperties={};b=g.vertices;e=g.edges;for(v=0;v<b.length;v++)this.findCommonProperties(b[v],g.customProperties,+0==v,g);for(v=0;v<e.length;v++)this.findCommonProperties(e[v],g.customProperties,0==b.length&&0==v,g)}return g};+EditorUi.prototype.findCommonProperties=function(b,e,g,m){if(null!=e){var v=mxUtils.bind(this,function(A){if(null!=A)if(g)for(var G=0;G<A.length;G++){if("function"!==typeof A[G].isVisible||A[G].isVisible(m,this.format))e[A[G].name]=A[G]}else for(var S in e){var F=!1;for(G=0;G<A.length;G++)if(A[G].name==S&&A[G].type==e[S].type){F=!0;break}F||delete e[S]}}),n=this.editor.graph.view.getState(b);null!=n&&null!=n.shape&&(n.shape.commonCustomPropAdded||(n.shape.commonCustomPropAdded=!0,n.shape.customProperties=+n.shape.customProperties||[],n.cell.vertex?Array.prototype.push.apply(n.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(n.shape.customProperties,Editor.commonEdgeProperties)),v(n.shape.customProperties));b=b.getAttribute("customProperties");if(null!=b)try{v(JSON.parse(b))}catch(A){}}};EditorUi.prototype.initSelectionState=function(){return{vertices:[],edges:[],cells:[],x:null,y:null,width:null,height:null,style:{},containsImage:!1,containsLabel:!1,fill:!0,glass:!0,html:!0,rounded:!0,autoSize:!1,image:!1,shadow:!0,lineJumps:!0,resizable:!0,table:!1,cell:!1,row:!1,movable:!0,rotatable:!0,stroke:!0,swimlane:!1,unlocked:this.editor.graph.isEnabled(),connections:!1}};-EditorUi.prototype.updateSelectionStateForTableCells=function(b){if(1<b.cells.length&&b.cell){var e=mxUtils.sortCells(b.cells),g=this.editor.graph.model,m=g.getParent(e[0]),v=g.getParent(m);if(null!=m&&null!=v){for(var p=m.getIndex(e[0]),A=v.getIndex(m),H=null,S=1,F=1,K=0,c=A<v.getChildCount()-1?g.getChildAt(g.getChildAt(v,A+1),p):null;K<e.length-1;){var f=e[++K];null==c||c!=f||null!=H&&S!=H||(H=S,S=0,F++,m=g.getParent(c),c=A+F<v.getChildCount()?g.getChildAt(g.getChildAt(v,A+F),p):null);var l=this.editor.graph.view.getState(f);-if(f==g.getChildAt(m,p+S)&&null!=l&&1==mxUtils.getValue(l.style,"colspan",1)&&1==mxUtils.getValue(l.style,"rowspan",1))S++;else break}K==F*S-1&&(b.mergeCell=e[0],b.colspan=S,b.rowspan=F)}}};EditorUi.prototype.windowResized=function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor.graph&&this.editor.graph.sizeDidChange()}),0)};-EditorUi.prototype.createTimeout=function(b,e,g){var m=!0,v=null,p=mxUtils.bind(this,function(H){v.clear()&&(m=!1,H=null!=H?H:{code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.createTimeout(b,e,g)})},null!=g?g(H):this.handleError(H))}),A=window.setTimeout(p,null!=b?b:this.timeout);v={clear:function(){window.clearTimeout(A);return m},isAlive:function(){return m}};null!=e&&this.tryAndHandle(mxUtils.bind(this,function(){e(v)}),p);return v};+EditorUi.prototype.updateSelectionStateForTableCells=function(b){if(1<b.cells.length&&b.cell){var e=mxUtils.sortCells(b.cells),g=this.editor.graph.model,m=g.getParent(e[0]),v=g.getParent(m);if(null!=m&&null!=v){for(var n=m.getIndex(e[0]),A=v.getIndex(m),G=null,S=1,F=1,K=0,c=A<v.getChildCount()-1?g.getChildAt(g.getChildAt(v,A+1),n):null;K<e.length-1;){var f=e[++K];null==c||c!=f||null!=G&&S!=G||(G=S,S=0,F++,m=g.getParent(c),c=A+F<v.getChildCount()?g.getChildAt(g.getChildAt(v,A+F),n):null);var l=this.editor.graph.view.getState(f);+if(f==g.getChildAt(m,n+S)&&null!=l&&1==mxUtils.getValue(l.style,"colspan",1)&&1==mxUtils.getValue(l.style,"rowspan",1))S++;else break}K==F*S-1&&(b.mergeCell=e[0],b.colspan=S,b.rowspan=F)}}};EditorUi.prototype.windowResized=function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor.graph&&this.editor.graph.sizeDidChange()}),0)};+EditorUi.prototype.createTimeout=function(b,e,g){var m=!0,v=null,n=mxUtils.bind(this,function(G){v.clear()&&(m=!1,G=null!=G?G:{code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.createTimeout(b,e,g)})},null!=g?g(G):this.handleError(G))}),A=window.setTimeout(n,null!=b?b:this.timeout);v={clear:function(){window.clearTimeout(A);return m},isAlive:function(){return m}};null!=e&&this.tryAndHandle(mxUtils.bind(this,function(){e(v)}),n);return v};EditorUi.prototype.tryAndHandle=function(b,e){try{b()}catch(g){null!=e?e(g):this.handleError(g)}};-EditorUi.prototype.removeUserDefinedDarkColors=function(b,e,g){var m=this.editor.graph;b=null!=b?b:m.getSelectionCells();var v=Graph.colorStyles,p=document.createElement("div");m.model.beginUpdate();try{for(var A=0;A<b.length;A++)if(m.model.isEdge(b[A])||m.model.isVertex(b[A])){var H=m.getCellStyle(b[A],!1);if(null!=H)for(var S=0;S<v.length;S++)try{var F=H[v[S]];if(mxUtils.isLightDarkColor(F)){var K=mxUtils.getLightDarkColor(F);m.setCellStyles(v[S],K.light,[b[A]])}}catch(f){}e&&m.isHtmlLabel(b[A])&&-"0"!=mxUtils.getValue(H,"html","0")&&(p.innerHTML=Graph.sanitizeHtml(m.getLabel(b[A])),Graph.addLightDarkColors(p,null,null,function(f,l,t){return mxUtils.isLightDarkColor(t)?(t=mxUtils.getLightDarkColor(t),f.style.setProperty(l,t.light),!0):!1})&&m.cellLabelChanged(b[A],p.innerHTML))}if(g&&mxUtils.isLightDarkColor(m.background)){K=mxUtils.getLightDarkColor(m.background);var c=new ChangePageSetup(this,K.light);c.ignoreImage=!0;m.model.execute(c)}}finally{m.model.endUpdate()}return b};+EditorUi.prototype.removeUserDefinedDarkColors=function(b,e,g){var m=this.editor.graph;b=null!=b?b:m.getSelectionCells();var v=Graph.colorStyles,n=document.createElement("div");m.model.beginUpdate();try{for(var A=0;A<b.length;A++)if(m.model.isEdge(b[A])||m.model.isVertex(b[A])){var G=m.getCellStyle(b[A],!1);if(null!=G)for(var S=0;S<v.length;S++)try{var F=G[v[S]];if(mxUtils.isLightDarkColor(F)){var K=mxUtils.getLightDarkColor(F);m.setCellStyles(v[S],K.light,[b[A]])}}catch(f){}e&&m.isHtmlLabel(b[A])&&+"0"!=mxUtils.getValue(G,"html","0")&&(n.innerHTML=Graph.sanitizeHtml(m.getLabel(b[A])),Graph.addLightDarkColors(n,null,null,function(f,l,t){return mxUtils.isLightDarkColor(t)?(t=mxUtils.getLightDarkColor(t),f.style.setProperty(l,t.light),!0):!1})&&m.cellLabelChanged(b[A],n.innerHTML))}if(g&&mxUtils.isLightDarkColor(m.background)){K=mxUtils.getLightDarkColor(m.background);var c=new ChangePageSetup(this,K.light);c.ignoreImage=!0;m.model.execute(c)}}finally{m.model.endUpdate()}return b};EditorUi.prototype.updateSelectionStateForCell=function(b,e,g,m){g=this.editor.graph;b.cells.push(e);if(g.getModel().isVertex(e)){b.connections=0<g.model.getEdgeCount(e);b.unlocked=b.unlocked&&!g.isCellLocked(e);b.resizable=b.resizable&&g.isCellResizable(e);b.rotatable=b.rotatable&&g.isCellRotatable(e);b.movable=b.movable&&g.isCellMovable(e)&&!g.isTableRow(e)&&!g.isTableCell(e);b.swimlane=b.swimlane||g.isSwimlane(e);b.table=b.table||g.isTable(e);b.cell=b.cell||g.isTableCell(e);b.row=b.row||g.isTableRow(e);-b.vertices.push(e);var v=g.getCellGeometry(e);if(null!=v&&(0<v.width?null==b.width?b.width=v.width:b.width!=v.width&&(b.width=""):b.containsLabel=!0,0<v.height?null==b.height?b.height=v.height:b.height!=v.height&&(b.height=""):b.containsLabel=!0,!v.relative||null!=v.offset)){var p=v.relative?v.offset.x:v.x;v=v.relative?v.offset.y:v.y;null==b.x?b.x=p:b.x!=p&&(b.x="");null==b.y?b.y=v:b.y!=v&&(b.y="")}}else g.getModel().isEdge(e)&&(b.edges.push(e),b.connections=!0,b.resizable=!1,b.rotatable=!1,b.movable=-!1);p=g.view.getState(e);null!=p&&(b.html=b.html&&g.isHtmlLabel(e),b.autoSize=b.autoSize||g.isAutoSizeState(p),b.glass=b.glass&&g.isGlassState(p),b.rounded=b.rounded&&g.isRoundedState(p),b.lineJumps=b.lineJumps&&g.isLineJumpState(p),b.image=b.image||g.isImageState(p),b.shadow=b.shadow&&g.isShadowState(p),b.fill=b.fill&&g.isFillState(p),b.gradient=b.fill&&g.isGradientState(p),b.stroke=b.stroke&&g.isStrokeState(p),e=mxUtils.getValue(p.style,mxConstants.STYLE_SHAPE,null),b.containsImage=b.containsImage||-"image"==e,g.mergeStyle(p.style,b.style,m))};+b.vertices.push(e);var v=g.getCellGeometry(e);if(null!=v&&(0<v.width?null==b.width?b.width=v.width:b.width!=v.width&&(b.width=""):b.containsLabel=!0,0<v.height?null==b.height?b.height=v.height:b.height!=v.height&&(b.height=""):b.containsLabel=!0,!v.relative||null!=v.offset)){var n=v.relative?v.offset.x:v.x;v=v.relative?v.offset.y:v.y;null==b.x?b.x=n:b.x!=n&&(b.x="");null==b.y?b.y=v:b.y!=v&&(b.y="")}}else g.getModel().isEdge(e)&&(b.edges.push(e),b.connections=!0,b.resizable=!1,b.rotatable=!1,b.movable=+!1);n=g.view.getState(e);null!=n&&(b.html=b.html&&g.isHtmlLabel(e),b.autoSize=b.autoSize||g.isAutoSizeState(n),b.glass=b.glass&&g.isGlassState(n),b.rounded=b.rounded&&g.isRoundedState(n),b.lineJumps=b.lineJumps&&g.isLineJumpState(n),b.image=b.image||g.isImageState(n),b.shadow=b.shadow&&g.isShadowState(n),b.fill=b.fill&&g.isFillState(n),b.gradient=b.fill&&g.isGradientState(n),b.stroke=b.stroke&&g.isStrokeState(n),e=mxUtils.getValue(n.style,mxConstants.STYLE_SHAPE,null),b.containsImage=b.containsImage||+"image"==e,g.mergeStyle(n.style,b.style,m))};EditorUi.prototype.installShapePicker=function(){var b=this.editor.graph,e=this;b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(S,F){"mouseDown"==F.getProperty("eventName")&&e.hideShapePicker()}));var g=mxUtils.bind(this,function(){e.hideShapePicker(!0)});b.addListener("wheel",g);b.addListener(mxEvent.ESCAPE,g);b.view.addListener(mxEvent.SCALE,g);b.view.addListener(mxEvent.SCALE_AND_TRANSLATE,g);b.getSelectionModel().addListener(mxEvent.CHANGE,g);var m=b.popupMenuHandler.isMenuShowing;b.popupMenuHandler.isMenuShowing=function(){return m.apply(this,arguments)||null!=e.shapePicker||null!=e.currentMenu};var v=b.dblClick;b.dblClick=function(S,F){if(this.isEnabled())if(null!=F||null==e.sidebar||mxEvent.isShiftDown(S)||b.isCellLocked(b.getDefaultParent()))v.apply(this,arguments);else{var K=mxUtils.convertPoint(this.container,mxEvent.getClientX(S),mxEvent.getClientY(S));mxEvent.consume(S);window.setTimeout(mxUtils.bind(this,function(){e.showShapePicker(K.x,K.y)}),30)}};if(null!=this.hoverIcons){this.hoverIcons.addListener("reset",-g);var p=this.hoverIcons.drag;this.hoverIcons.drag=function(){e.hideShapePicker();p.apply(this,arguments)};var A=this.hoverIcons.execute;this.hoverIcons.execute=function(S,F,K){var c=K.getEvent();this.graph.isCloneEvent(c)||mxEvent.isShiftDown(c)?A.apply(this,arguments):this.graph.connectVertex(S.cell,F,this.graph.defaultEdgeLength,c,null,null,mxUtils.bind(this,function(f,l,t){var q=b.getCompositeParent(S.cell);f=b.getCellGeometry(q);for(K.consume();null!=q&&b.model.isVertex(q)&&null!=f&&f.relative;)cell=-q,q=b.model.getParent(cell),f=b.getCellGeometry(q);window.setTimeout(mxUtils.bind(this,function(){e.showShapePicker(K.getGraphX(),K.getGraphY(),q,mxUtils.bind(this,function(D){t(D);null!=e.hoverIcons&&e.hoverIcons.update(b.view.getState(D))}),F)}),30)}),mxUtils.bind(this,function(f){this.graph.selectCellsForConnectVertex(f,c,this)}))};var H=null;this.hoverIcons.addListener("focus",mxUtils.bind(this,function(S,F){null!=H&&window.clearTimeout(H);H=window.setTimeout(mxUtils.bind(this,function(){var K=-F.getProperty("arrow"),c=F.getProperty("direction"),f=F.getProperty("event");K=K.getBoundingClientRect();var l=mxUtils.getOffset(b.container),t=b.container.scrollLeft+K.x-l.x;l=b.container.scrollTop+K.y-l.y;var q=b.getCompositeParent(null!=this.hoverIcons.currentState?this.hoverIcons.currentState.cell:null),D=e.showShapePicker(t,l,q,mxUtils.bind(this,function(G){null!=G&&b.connectVertex(q,c,b.defaultEdgeLength,f,!0,!1,function(N,L,J){J(G);null!=e.hoverIcons&&e.hoverIcons.update(b.view.getState(G))},-function(N){b.selectCellsForConnectVertex(N)},f,this.hoverIcons)}),c,!0);null!=D&&(this.centerShapePicker(D,K,t,l,c),mxUtils.setOpacity(D,30),mxEvent.addListener(D,"mouseenter",function(){mxUtils.setOpacity(D,100)}),mxEvent.addListener(D,"mouseleave",function(){e.hideShapePicker()}))}),Editor.shapePickerHoverDelay)}));this.hoverIcons.addListener("blur",mxUtils.bind(this,function(S,F){null!=H&&window.clearTimeout(H)}))}};-EditorUi.prototype.centerShapePicker=function(b,e,g,m,v){if(v==mxConstants.DIRECTION_EAST||v==mxConstants.DIRECTION_WEST)b.style.width="40px";var p=b.getBoundingClientRect();v==mxConstants.DIRECTION_NORTH?(g-=p.width/2-10,m-=p.height+6):v==mxConstants.DIRECTION_SOUTH?(g-=p.width/2-10,m+=e.height+6):v==mxConstants.DIRECTION_WEST?(g-=p.width+6,m-=p.height/2-10):v==mxConstants.DIRECTION_EAST&&(g+=e.width+6,m-=p.height/2-10);b.style.left=g+"px";b.style.top=m+"px"};-EditorUi.prototype.showShapePicker=function(b,e,g,m,v,p,A,H,S){var F=null;this.editor.graph.freehand.isDrawing()||(H=H||null==g,F=this.createShapePicker(b,e,g,m,v,mxUtils.bind(this,function(){this.hideShapePicker()}),this.getCellsForShapePicker(g,p,H),p,A,H,S),null!=F&&(null==this.hoverIcons||p||this.hoverIcons.reset(),b=this.editor.graph,b.popupMenuHandler.hideMenu(),b.tooltipHandler.hideTooltip(),this.hideCurrentMenu(),this.hideShapePicker(),this.shapePickerCallback=m,this.shapePicker=F));return F};-EditorUi.prototype.createShapePicker=function(b,e,g,m,v,p,A,H,S,F,K){K=null!=K?K:!0;var c=this.editor.graph,f=null;S=null!=S?S:function(q){q=q[0];var D=0,G=0,N=q.geometry;null!=N&&(c.model.isEdge(q)&&(q=N.getTerminalPoint(!1),N=new mxRectangle(0,0,q.x,q.y)),D=N.width/2,G=N.height/2);return new mxPoint(c.snap(Math.round(b/c.view.scale)-c.view.translate.x-D),c.snap(Math.round(e/c.view.scale)-c.view.translate.y-G))};if(null!=A&&0<A.length){var l=this;c=this.editor.graph;f=document.createElement("div");-v=c.view.getState(g);var t=null==g||null!=v&&c.isTransparentState(v)?null:c.copyStyle(g);f.className="geShapePicker";f.setAttribute("title",mxResources.get("sidebarTooltip"));f.style.left=Math.round(b)+"px";f.style.top=Math.round(e)+"px";mxClient.IS_POINTER&&(f.style.touchAction="none");H||mxUtils.setPrefixedStyle(f.style,"transform","translate(-22px,-22px)");c.container.appendChild(f);v=mxUtils.bind(this,function(q){var D=document.createElement("a");f.appendChild(D);null!=t&&"1"!=urlParams.sketch?-this.sidebar.graph.pasteStyle(t,[q]):this.sidebar.graph.pasteCellStyles([q],c.currentVertexStyle,c.currentEdgeStyle);var G=q.geometry;c.model.isEdge(q)&&(G=G.getTerminalPoint(!1),G=new mxRectangle(0,0,G.x,G.y));null!=G&&(G=this.sidebar.createVertexTemplateFromCells([q],G.width,G.height,"",!0,!1,null,!1,mxUtils.bind(this,function(N){if(!mxEvent.isShiftDown(N)||null==g&&c.isSelectionEmpty()){var L=c.cloneCell(q);if(null!=m)m(L);else{var J=S([L]);c.model.isEdge(L)?L.geometry.translate(J.x,J.y):(L.geometry.x=-J.x,L.geometry.y=J.y);c.model.beginUpdate();try{c.addCell(L),c.model.isVertex(L)&&c.isAutoSizeCell(L)&&c.updateCellSize(L)}finally{c.model.endUpdate()}c.setSelectionCell(L);c.scrollCellToVisible(L);K&&c.startEditing(L);null!=l.hoverIcons&&l.hoverIcons.update(c.view.getState(L))}}else L=c.getEditableCells(null!=g?[g]:c.getSelectionCells()),c.updateShapes(q,L);null!=p&&p(N);mxEvent.consume(N)}),25,25,null,null,g),G.style.display="flex",G.style.alignItems="center",G.style.justifyContent="center",D.appendChild(G))});-for(F=0;F<(H?Math.min(A.length,4):A.length);F++)v(A[F]);A=f.offsetTop+f.clientHeight-(c.container.scrollTop+c.container.offsetHeight);0<A&&(f.style.top=Math.max(c.container.scrollTop+22,e-A)+"px");A=f.offsetLeft+f.clientWidth-(c.container.scrollLeft+c.container.offsetWidth);0<A&&(f.style.left=Math.max(c.container.scrollLeft+22,b-A)+"px")}return f};-EditorUi.prototype.getCellsForShapePicker=function(b,e,g){var m=this.editor.graph,v=mxUtils.bind(this,function(p,A,H,S){return m.createVertex(null,null,S||"",0,0,A||120,H||60,p,!1)});e=mxUtils.bind(this,function(p,A,H){p=new mxCell(H||"",new mxGeometry(0,0,m.defaultEdgeLength+20,0),p);p.geometry.setTerminalPoint(new mxPoint(0,0),!0);p.geometry.setTerminalPoint(new mxPoint(p.geometry.width,null!=A?A:0),!1);p.geometry.points=null!=A?[new mxPoint(p.geometry.width/2,A)]:[];p.geometry.relative=!0;p.edge=-!0;return p});if(null!=b)try{b=m.cloneCell(b),m.model.isVertex(b)&&null!=b.geometry&&(b.geometry.x=0,b.geometry.y=0)}catch(p){b=null}null==b&&(b=v(m.appendFontSize("text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;",m.vertexFontSize),40,20,"Text"),m.model.isVertex(b)&&m.isAutoSizeCell(b)&&Graph.createOffscreenGraph(m.getStylesheet()).updateCellSize(b));b=[b,v("whiteSpace=wrap;html=1;"),v("ellipse;whiteSpace=wrap;html=1;",80,80),v("rhombus;whiteSpace=wrap;html=1;",+g);var n=this.hoverIcons.drag;this.hoverIcons.drag=function(){e.hideShapePicker();n.apply(this,arguments)};var A=this.hoverIcons.execute;this.hoverIcons.execute=function(S,F,K){var c=K.getEvent();this.graph.isCloneEvent(c)||mxEvent.isShiftDown(c)?A.apply(this,arguments):this.graph.connectVertex(S.cell,F,this.graph.defaultEdgeLength,c,null,null,mxUtils.bind(this,function(f,l,t){var q=b.getCompositeParent(S.cell);f=b.getCellGeometry(q);for(K.consume();null!=q&&b.model.isVertex(q)&&null!=f&&f.relative;)cell=+q,q=b.model.getParent(cell),f=b.getCellGeometry(q);window.setTimeout(mxUtils.bind(this,function(){e.showShapePicker(K.getGraphX(),K.getGraphY(),q,mxUtils.bind(this,function(D){t(D);null!=e.hoverIcons&&e.hoverIcons.update(b.view.getState(D))}),F)}),30)}),mxUtils.bind(this,function(f){this.graph.selectCellsForConnectVertex(f,c,this)}))};var G=null;this.hoverIcons.addListener("focus",mxUtils.bind(this,function(S,F){null!=G&&window.clearTimeout(G);G=window.setTimeout(mxUtils.bind(this,function(){var K=+F.getProperty("arrow"),c=F.getProperty("direction"),f=F.getProperty("event");K=K.getBoundingClientRect();var l=mxUtils.getOffset(b.container),t=b.container.scrollLeft+K.x-l.x;l=b.container.scrollTop+K.y-l.y;var q=b.getCompositeParent(null!=this.hoverIcons.currentState?this.hoverIcons.currentState.cell:null),D=e.showShapePicker(t,l,q,mxUtils.bind(this,function(H){null!=H&&b.connectVertex(q,c,b.defaultEdgeLength,f,!0,!1,function(N,L,J){J(H);null!=e.hoverIcons&&e.hoverIcons.update(b.view.getState(H))},+function(N){b.selectCellsForConnectVertex(N)},f,this.hoverIcons)}),c,!0);null!=D&&(this.centerShapePicker(D,K,t,l,c),mxUtils.setOpacity(D,30),mxEvent.addListener(D,"mouseenter",function(){mxUtils.setOpacity(D,100)}),mxEvent.addListener(D,"mouseleave",function(){e.hideShapePicker()}))}),Editor.shapePickerHoverDelay)}));this.hoverIcons.addListener("blur",mxUtils.bind(this,function(S,F){null!=G&&window.clearTimeout(G)}))}};+EditorUi.prototype.centerShapePicker=function(b,e,g,m,v){if(v==mxConstants.DIRECTION_EAST||v==mxConstants.DIRECTION_WEST)b.style.width="40px";var n=b.getBoundingClientRect();v==mxConstants.DIRECTION_NORTH?(g-=n.width/2-10,m-=n.height+6):v==mxConstants.DIRECTION_SOUTH?(g-=n.width/2-10,m+=e.height+6):v==mxConstants.DIRECTION_WEST?(g-=n.width+6,m-=n.height/2-10):v==mxConstants.DIRECTION_EAST&&(g+=e.width+6,m-=n.height/2-10);b.style.left=g+"px";b.style.top=m+"px"};+EditorUi.prototype.showShapePicker=function(b,e,g,m,v,n,A,G,S){var F=null;this.editor.graph.freehand.isDrawing()||(G=G||null==g,F=this.createShapePicker(b,e,g,m,v,mxUtils.bind(this,function(){this.hideShapePicker()}),this.getCellsForShapePicker(g,n,G),n,A,G,S),null!=F&&(null==this.hoverIcons||n||this.hoverIcons.reset(),b=this.editor.graph,b.popupMenuHandler.hideMenu(),b.tooltipHandler.hideTooltip(),this.hideCurrentMenu(),this.hideShapePicker(),this.shapePickerCallback=m,this.shapePicker=F));return F};+EditorUi.prototype.createShapePicker=function(b,e,g,m,v,n,A,G,S,F,K){K=null!=K?K:!0;var c=this.editor.graph,f=null;S=null!=S?S:function(q){q=q[0];var D=0,H=0,N=q.geometry;null!=N&&(c.model.isEdge(q)&&(q=N.getTerminalPoint(!1),N=new mxRectangle(0,0,q.x,q.y)),D=N.width/2,H=N.height/2);return new mxPoint(c.snap(Math.round(b/c.view.scale)-c.view.translate.x-D),c.snap(Math.round(e/c.view.scale)-c.view.translate.y-H))};if(null!=A&&0<A.length){var l=this;c=this.editor.graph;f=document.createElement("div");+v=c.view.getState(g);var t=null==g||null!=v&&c.isTransparentState(v)?null:c.copyStyle(g);f.className="geShapePicker";f.setAttribute("title",mxResources.get("sidebarTooltip"));f.style.left=Math.round(b)+"px";f.style.top=Math.round(e)+"px";mxClient.IS_POINTER&&(f.style.touchAction="none");G||mxUtils.setPrefixedStyle(f.style,"transform","translate(-22px,-22px)");c.container.appendChild(f);v=mxUtils.bind(this,function(q){var D=document.createElement("a");f.appendChild(D);null!=t&&"1"!=urlParams.sketch?+this.sidebar.graph.pasteStyle(t,[q]):this.sidebar.graph.pasteCellStyles([q],c.currentVertexStyle,c.currentEdgeStyle);var H=q.geometry;c.model.isEdge(q)&&(H=H.getTerminalPoint(!1),H=new mxRectangle(0,0,H.x,H.y));null!=H&&(H=this.sidebar.createVertexTemplateFromCells([q],H.width,H.height,"",!0,!1,null,!1,mxUtils.bind(this,function(N){if(!mxEvent.isShiftDown(N)||null==g&&c.isSelectionEmpty()){var L=c.cloneCell(q);if(null!=m)m(L);else{var J=S([L]);c.model.isEdge(L)?L.geometry.translate(J.x,J.y):(L.geometry.x=+J.x,L.geometry.y=J.y);c.model.beginUpdate();try{c.addCell(L),c.model.isVertex(L)&&c.isAutoSizeCell(L)&&c.updateCellSize(L)}finally{c.model.endUpdate()}c.setSelectionCell(L);c.scrollCellToVisible(L);K&&c.startEditing(L);null!=l.hoverIcons&&l.hoverIcons.update(c.view.getState(L))}}else L=c.getEditableCells(null!=g?[g]:c.getSelectionCells()),c.updateShapes(q,L);null!=n&&n(N);mxEvent.consume(N)}),25,25,null,null,g),H.style.display="flex",H.style.alignItems="center",H.style.justifyContent="center",D.appendChild(H))});+for(F=0;F<(G?Math.min(A.length,4):A.length);F++)v(A[F]);A=f.offsetTop+f.clientHeight-(c.container.scrollTop+c.container.offsetHeight);0<A&&(f.style.top=Math.max(c.container.scrollTop+22,e-A)+"px");A=f.offsetLeft+f.clientWidth-(c.container.scrollLeft+c.container.offsetWidth);0<A&&(f.style.left=Math.max(c.container.scrollLeft+22,b-A)+"px")}return f};+EditorUi.prototype.getCellsForShapePicker=function(b,e,g){var m=this.editor.graph,v=mxUtils.bind(this,function(n,A,G,S){return m.createVertex(null,null,S||"",0,0,A||120,G||60,n,!1)});e=mxUtils.bind(this,function(n,A,G){n=new mxCell(G||"",new mxGeometry(0,0,m.defaultEdgeLength+20,0),n);n.geometry.setTerminalPoint(new mxPoint(0,0),!0);n.geometry.setTerminalPoint(new mxPoint(n.geometry.width,null!=A?A:0),!1);n.geometry.points=null!=A?[new mxPoint(n.geometry.width/2,A)]:[];n.geometry.relative=!0;n.edge=+!0;return n});if(null!=b)try{b=m.cloneCell(b),m.model.isVertex(b)&&null!=b.geometry&&(b.geometry.x=0,b.geometry.y=0)}catch(n){b=null}null==b&&(b=v(m.appendFontSize("text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;",m.vertexFontSize),40,20,"Text"),m.model.isVertex(b)&&m.isAutoSizeCell(b)&&Graph.createOffscreenGraph(m.getStylesheet()).updateCellSize(b));b=[b,v("whiteSpace=wrap;html=1;"),v("ellipse;whiteSpace=wrap;html=1;",80,80),v("rhombus;whiteSpace=wrap;html=1;",80,80),v("rounded=1;whiteSpace=wrap;html=1;"),v("shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;"),v("shape=trapezoid;perimeter=trapezoidPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,60),v("shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;",120,80),v("shape=step;perimeter=stepPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,80),v("shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;"),v("triangle;whiteSpace=wrap;html=1;",60,80),v("shape=document;whiteSpace=wrap;html=1;boundedLbl=1;",120,80),v("shape=tape;whiteSpace=wrap;html=1;",120,100),v("ellipse;shape=cloud;whiteSpace=wrap;html=1;",120,80),v("shape=singleArrow;whiteSpace=wrap;html=1;arrowWidth=0.4;arrowSize=0.4;",80,60),v("shape=waypoint;sketch=0;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;rotatable=0;perimeter=centerPerimeter;snapToPoint=1;",20,20)];g&&(b=b.concat([e("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;"),e("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;startArrow=classic;endSize=8;startSize=8;"),e("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;rounded=1;startSize=8;endSize=8;"),e("edgeStyle=segmentEdgeStyle;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;",this.editor.graph.defaultEdgeLength/2)]));return b};EditorUi.prototype.isShapePickerVisible=function(b){return null!=this.shapePicker};EditorUi.prototype.hideShapePicker=function(b){null!=this.shapePicker&&(this.shapePicker.parentNode.removeChild(this.shapePicker),this.shapePicker=null,b||null==this.shapePickerCallback||this.shapePickerCallback(),this.shapePickerCallback=null)};EditorUi.prototype.isSpaceDown=function(){return this.spaceDown};EditorUi.prototype.isShiftDown=function(){return this.shiftDown};EditorUi.prototype.onKeyDown=function(b){var e=this.editor.graph;if(9==b.which&&e.isEnabled()&&!mxEvent.isControlDown(b)){if(e.isEditing())if(mxEvent.isAltDown(b))e.stopEditing(!1);else try{var g=e.cellEditor.isContentEditing()&&e.cellEditor.isTextSelected();if(window.getSelection&&e.cellEditor.isContentEditing()&&!g&&!mxClient.IS_IE&&!mxClient.IS_IE11){var m=window.getSelection(),v=0<m.rangeCount?m.getRangeAt(0).commonAncestorContainer:null;g=null!=v&&("LI"==v.nodeName||null!=v.parentNode&&"LI"==-v.parentNode.nodeName)}g?document.execCommand(mxEvent.isShiftDown(b)?"outdent":"indent",!1,null):mxEvent.isShiftDown(b)?e.stopEditing(!1):e.cellEditor.insertTab(e.cellEditor.isContentEditing()?null:4)}catch(p){}else mxEvent.isAltDown(b)?e.selectParentCell():e.selectCell(!mxEvent.isShiftDown(b));mxEvent.consume(b)}};+v.parentNode.nodeName)}g?document.execCommand(mxEvent.isShiftDown(b)?"outdent":"indent",!1,null):mxEvent.isShiftDown(b)?e.stopEditing(!1):e.cellEditor.insertTab(e.cellEditor.isContentEditing()?null:4)}catch(n){}else mxEvent.isAltDown(b)?e.selectParentCell():e.selectCell(!mxEvent.isShiftDown(b));mxEvent.consume(b)}};EditorUi.prototype.onKeyPress=function(b){var e=this.editor.graph;!this.isImmediateEditingEvent(b)||e.isEditing()||e.isSelectionEmpty()||0===b.which||27===b.which||mxEvent.isAltDown(b)||mxEvent.isControlDown(b)||mxEvent.isMetaDown(b)||(e.escape(),e.startEditing(null,String.fromCharCode(b.which)))};EditorUi.prototype.isImmediateEditingEvent=function(b){return!0};EditorUi.prototype.updateCssForMarker=function(b,e,g,m,v){g=this.getImageForMarker(m,v,g);b.innerHTML="";null==g?b.innerHTML=mxUtils.htmlEntities(mxResources.get("none")):(m=document.createElement("img"),m.setAttribute("src",g),"end"==e&&mxUtils.setPrefixedStyle(m.style,"transform","scaleX(-1)"),b.appendChild(m))};EditorUi.prototype.getImageForMarker=function(b,e,g){return"flexArrow"==g?null!=b&&b!=mxConstants.NONE?Format.blockMarkerImage.src:null:b==mxConstants.ARROW_CLASSIC?"1"!=e?Format.classicMarkerImage.src:Format.classicFilledMarkerImage.src:b==mxConstants.ARROW_CLASSIC_THIN?"1"!=e?Format.classicThinMarkerImage.src:Format.openThinFilledMarkerImage.src:b==mxConstants.ARROW_OPEN?Format.openFilledMarkerImage.src:b==mxConstants.ARROW_OPEN_THIN?Format.openThinFilledMarkerImage.src:b==mxConstants.ARROW_BLOCK?@@ -2108,9 +2112,9 @@ EditorUi.prototype.getImageForMarker=function(b,e,g){return"flexArrow"==g?null!=b?"1"!=e?Format.doubleBlockMarkerImage.src:Format.doubleBlockFilledMarkerImage.src:"box"==b?Format.boxMarkerImage.src:"halfCircle"==b?Format.halfCircleMarkerImage.src:"openAsync"==b?Format.openAsyncFilledMarkerImage.src:"async"==b?"1"!=e?Format.asyncMarkerImage.src:Format.asyncFilledMarkerImage.src:"dash"==b?Format.dashMarkerImage.src:"baseDash"==b?Format.baseDashMarkerImage.src:"cross"==b?Format.crossMarkerImage.src:"circle"==b?Format.circleMarkerImage.src:"circlePlus"==b?Format.circlePlusMarkerImage.src:"ERone"==b?Format.EROneMarkerImage.src:"ERmandOne"==b?Format.ERmandOneMarkerImage.src:"ERmany"==b?Format.ERmanyMarkerImage.src:"ERoneToMany"==b?Format.ERoneToManyMarkerImage.src:"ERzeroToOne"==b?Format.ERzeroToOneMarkerImage.src:"ERzeroToMany"==b?Format.ERzeroToManyMarkerImage.src:null};EditorUi.prototype.createMenus=function(){return null};EditorUi.prototype.updatePasteActionStates=function(){var b=this.editor.graph,e=this.actions.get("paste"),g=this.actions.get("pasteHere");e.setEnabled(this.editor.graph.cellEditor.isContentEditing()||(!mxClient.IS_FF&&null!=navigator.clipboard||!mxClipboard.isEmpty())&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent()));g.setEnabled(e.isEnabled())};-EditorUi.prototype.initClipboard=function(){var b=this,e=mxClipboard.cut;mxClipboard.cut=function(p){p.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):e.apply(this,arguments);b.updatePasteActionStates()};mxClipboard.copy=function(p){var A=null;if(p.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{A=A||p.getSelectionCells();A=p.getExportableCells(p.model.getTopmostCells(A));for(var H={},S=p.createCellLookup(A),F=p.cloneCells(A,null,H),K=new mxGraphModel,c=K.getChildAt(K.getRoot(),-0),f=0;f<F.length;f++){K.add(c,F[f]);var l=p.view.getState(A[f]);if(null!=l){var t=p.getCellGeometry(F[f]);null!=t&&t.relative&&!K.isEdge(A[f])&&null==S[mxObjectIdentity.get(K.getParent(A[f]))]&&(t.offset=null,t.relative=!1,t.x=l.x/l.view.scale-l.view.translate.x,t.y=l.y/l.view.scale-l.view.translate.y)}}p.updateCustomLinks(p.createCellMapping(H,S),F);mxClipboard.insertCount=1;mxClipboard.setCells(F)}b.updatePasteActionStates();return A};var g=mxClipboard.paste;mxClipboard.paste=function(p){var A=-null;p.cellEditor.isContentEditing()?document.execCommand("paste",!1,null):A=g.apply(this,arguments);b.updatePasteActionStates();return A};var m=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){m.apply(this,arguments);b.updatePasteActionStates()};var v=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(p,A){v.apply(this,arguments);b.updatePasteActionStates()};this.updatePasteActionStates()};+EditorUi.prototype.initClipboard=function(){var b=this,e=mxClipboard.cut;mxClipboard.cut=function(n){n.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):e.apply(this,arguments);b.updatePasteActionStates()};mxClipboard.copy=function(n){var A=null;if(n.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{A=A||n.getSelectionCells();A=n.getExportableCells(n.model.getTopmostCells(A));for(var G={},S=n.createCellLookup(A),F=n.cloneCells(A,null,G),K=new mxGraphModel,c=K.getChildAt(K.getRoot(),+0),f=0;f<F.length;f++){K.add(c,F[f]);var l=n.view.getState(A[f]);if(null!=l){var t=n.getCellGeometry(F[f]);null!=t&&t.relative&&!K.isEdge(A[f])&&null==S[mxObjectIdentity.get(K.getParent(A[f]))]&&(t.offset=null,t.relative=!1,t.x=l.x/l.view.scale-l.view.translate.x,t.y=l.y/l.view.scale-l.view.translate.y)}}n.updateCustomLinks(n.createCellMapping(G,S),F);mxClipboard.insertCount=1;mxClipboard.setCells(F)}b.updatePasteActionStates();return A};var g=mxClipboard.paste;mxClipboard.paste=function(n){var A=+null;n.cellEditor.isContentEditing()?document.execCommand("paste",!1,null):A=g.apply(this,arguments);b.updatePasteActionStates();return A};var m=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){m.apply(this,arguments);b.updatePasteActionStates()};var v=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(n,A){v.apply(this,arguments);b.updatePasteActionStates()};this.updatePasteActionStates()};EditorUi.prototype.lazyZoomDelay=20;EditorUi.prototype.wheelZoomDelay=500;EditorUi.prototype.buttonZoomDelay=600;EditorUi.prototype.initCanvas=function(){var b=this.editor.graph;b.timerAutoScroll=!0;b.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((b.container.offsetWidth-34)/b.view.scale)),Math.max(0,Math.round((b.container.offsetHeight-34)/b.view.scale)))};b.view.getBackgroundPageBounds=function(){var P=this.graph.getPageLayout(),T=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+P.x*T.width),this.scale*(this.translate.y+P.y*T.height),this.scale*P.width*T.width,this.scale*P.height*T.height)};b.getPreferredPageSize=function(P,T,X){P=this.getPageLayout();T=this.getPageSize();return new mxRectangle(0,0,P.width*T.width,P.height*T.height)};var e=null,g=this;if(this.editor.isChromelessView()){this.chromelessResize=e=mxUtils.bind(this,function(P,T,X,Z){if(null!=b.container&&!b.isViewer()){X=null!=X?X:0;Z=null!=Z?Z:0;var ka=b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds(),va=mxUtils.hasScrollbars(b.container),ua=b.view.translate,qa=b.view.scale,@@ -2118,24 +2122,24 @@ Ba=mxRectangle.fromRectangle(ka);Ba.x=Ba.x/qa-ua.x;Ba.y=Ba.y/qa-ua.y;Ba.width/=q0));if(va||ka.width<za||ka.height<La)b.view.scaleAndTranslate(P,Math.floor(T-Ba.x),Math.floor(Ea-Ba.y)),b.container.scrollTop=ua*P/qa,b.container.scrollLeft=ya*P/qa;else if(0!=X||0!=Z)ka=b.view.translate,b.view.setTranslate(Math.floor(ka.x+X/qa),Math.floor(ka.y+Z/qa))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var m=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",m);this.destroyFunctions.push(function(){mxEvent.removeListener(window,"resize",m)});this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(P){b.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(P){b.zoomOut();this.chromelessResize(!1)});if("0"!=urlParams.toolbar){var v=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position="fixed";this.chromelessToolbar.style.overflow="hidden";this.chromelessToolbar.style.boxSizing="border-box";this.chromelessToolbar.style.whiteSpace="nowrap";this.chromelessToolbar.style.padding="10px 10px 8px 10px";this.chromelessToolbar.style.left=b.isViewer()?"0":"50%";mxClient.IS_IE||mxClient.IS_IE11?(this.chromelessToolbar.style.backgroundColor="#ffffff",this.chromelessToolbar.style.border="3px solid black"):this.chromelessToolbar.style.backgroundColor="#000000";mxUtils.setPrefixedStyle(this.chromelessToolbar.style,-"borderRadius","16px");mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out");var p=mxUtils.bind(this,function(){var P=mxUtils.getCurrentStyle(b.container);b.isViewer()?this.chromelessToolbar.style.top="0":this.chromelessToolbar.style.bottom=(null!=P?parseInt(P["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",p);p();var A=0;p=mxUtils.bind(this,function(P,T,X){A++;-var Z=document.createElement("span");Z.style.paddingLeft="8px";Z.style.paddingRight="8px";Z.style.cursor="pointer";mxEvent.addListener(Z,"click",P);null!=X&&Z.setAttribute("title",X);P=document.createElement("img");P.setAttribute("border","0");P.setAttribute("src",T);P.style.width="36px";P.style.filter="invert(100%)";Z.appendChild(P);this.chromelessToolbar.appendChild(Z);return Z});if(null!=v.backBtn){var H=Graph.sanitizeLink(v.backBtn.url);null!=H&&p(mxUtils.bind(this,function(P){window.location.href=-H;mxEvent.consume(P)}),Editor.backImage,mxResources.get("back",null,"Back"))}if(this.isPagesEnabled()){var S=p(mxUtils.bind(this,function(P){this.actions.get("previousPage").funct();mxEvent.consume(P)}),Editor.chevronLeftImage,mxResources.get("previousPage")),F=document.createElement("div");F.style.fontFamily=Editor.defaultHtmlFont;F.style.display="inline-block";F.style.verticalAlign="top";F.style.fontWeight="bold";F.style.marginTop="8px";F.style.fontSize="14px";F.style.cursor="default";F.style.color=-mxClient.IS_IE||mxClient.IS_IE11?"#000000":"#ffffff";this.chromelessToolbar.appendChild(F);var K=p(mxUtils.bind(this,function(P){this.actions.get("nextPage").funct();mxEvent.consume(P)}),Editor.chevronRightImage,mxResources.get("nextPage")),c=mxUtils.bind(this,function(){if(null!=this.pages&&1<this.pages.length&&null!=this.currentPage){F.innerText="";var P=mxUtils.indexOf(this.pages,this.currentPage);mxUtils.write(F,P+1+" / "+this.pages.length);F.setAttribute("title",mxResources.get("currentPage")++"borderRadius","16px");mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out");var n=mxUtils.bind(this,function(){var P=mxUtils.getCurrentStyle(b.container);b.isViewer()?this.chromelessToolbar.style.top="0":this.chromelessToolbar.style.bottom=(null!=P?parseInt(P["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",n);n();var A=0;n=mxUtils.bind(this,function(P,T,X){A++;+var Z=document.createElement("span");Z.style.paddingLeft="8px";Z.style.paddingRight="8px";Z.style.cursor="pointer";mxEvent.addListener(Z,"click",P);null!=X&&Z.setAttribute("title",X);P=document.createElement("img");P.setAttribute("border","0");P.setAttribute("src",T);P.style.width="36px";P.style.filter="invert(100%)";Z.appendChild(P);this.chromelessToolbar.appendChild(Z);return Z});if(null!=v.backBtn){var G=Graph.sanitizeLink(v.backBtn.url);null!=G&&n(mxUtils.bind(this,function(P){window.location.href=+G;mxEvent.consume(P)}),Editor.backImage,mxResources.get("back",null,"Back"))}if(this.isPagesEnabled()){var S=n(mxUtils.bind(this,function(P){this.actions.get("previousPage").funct();mxEvent.consume(P)}),Editor.chevronLeftImage,mxResources.get("previousPage")),F=document.createElement("div");F.style.fontFamily=Editor.defaultHtmlFont;F.style.display="inline-block";F.style.verticalAlign="top";F.style.fontWeight="bold";F.style.marginTop="8px";F.style.fontSize="14px";F.style.cursor="default";F.style.color=+mxClient.IS_IE||mxClient.IS_IE11?"#000000":"#ffffff";this.chromelessToolbar.appendChild(F);var K=n(mxUtils.bind(this,function(P){this.actions.get("nextPage").funct();mxEvent.consume(P)}),Editor.chevronRightImage,mxResources.get("nextPage")),c=mxUtils.bind(this,function(){if(null!=this.pages&&1<this.pages.length&&null!=this.currentPage){F.innerText="";var P=mxUtils.indexOf(this.pages,this.currentPage);mxUtils.write(F,P+1+" / "+this.pages.length);F.setAttribute("title",mxResources.get("currentPage")+": "+this.currentPage.getName());S.setAttribute("title",mxResources.get("previousPage")+": "+this.pages[mxUtils.mod(P-1,this.pages.length)].getName());K.setAttribute("title",mxResources.get("nextPage")+": "+this.pages[mxUtils.mod(P+1,this.pages.length)].getName())}});S.style.paddingLeft="0px";S.style.paddingRight="4px";K.style.paddingLeft="4px";K.style.paddingRight="0px";var f=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(K.style.display="",S.style.display="",F.style.display="inline-block"):(K.style.display="none",S.style.display="none",F.style.display="none");c()});if(null!=this.menus){var l=this.menus.get("pages");null!=l&&mxEvent.addListener(F,"click",mxUtils.bind(this,function(P){var T=new mxPopupMenu(l.funct);T.smartSeparators=!0;T.showDisabled=!0;T.autoExpand=!0;T.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(T,arguments);T.destroy()});var X=mxUtils.getOffset(F);T.popup(X.x,X.y+F.offsetHeight,null,P);mxEvent.addListener(T.div,-"mouseleave",mxUtils.bind(this,function(){T.hideMenu()}))}))}this.editor.addListener("resetGraphView",f);this.editor.addListener("pageSelected",c)}p(mxUtils.bind(this,function(P){this.actions.get("zoomOut").funct();mxEvent.consume(P)}),Editor.zoomOutImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");p(mxUtils.bind(this,function(P){this.actions.get("zoomIn").funct();mxEvent.consume(P)}),Editor.zoomInImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");p(mxUtils.bind(this,function(P){b.isLightboxView()?+"mouseleave",mxUtils.bind(this,function(){T.hideMenu()}))}))}this.editor.addListener("resetGraphView",f);this.editor.addListener("pageSelected",c)}n(mxUtils.bind(this,function(P){this.actions.get("zoomOut").funct();mxEvent.consume(P)}),Editor.zoomOutImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");n(mxUtils.bind(this,function(P){this.actions.get("zoomIn").funct();mxEvent.consume(P)}),Editor.zoomInImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");n(mxUtils.bind(this,function(P){b.isLightboxView()?(1==b.view.scale?this.lightboxFit():b.zoomTo(1),this.chromelessResize(!1)):this.chromelessResize(!0);mxEvent.consume(P)}),Editor.zoomFitImage,mxResources.get("fit"));var t=null,q=null,D=mxUtils.bind(this,function(P){null!=t&&(window.clearTimeout(t),t=null);null!=q&&(window.clearTimeout(q),q=null);t=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);t=null;q=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";q=null}),-600)}),P||200)}),G=mxUtils.bind(this,function(P){null!=t&&(window.clearTimeout(t),t=null);null!=q&&(window.clearTimeout(q),q=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,P||30)});if("1"==urlParams.layers){this.layersDialog=null;var N=p(mxUtils.bind(this,function(P){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=b.createLayersDialog(mxUtils.bind(this,function(){this.chromelessResize&&+600)}),P||200)}),H=mxUtils.bind(this,function(P){null!=t&&(window.clearTimeout(t),t=null);null!=q&&(window.clearTimeout(q),q=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,P||30)});if("1"==urlParams.layers){this.layersDialog=null;var N=n(mxUtils.bind(this,function(P){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=b.createLayersDialog(mxUtils.bind(this,function(){this.chromelessResize&&this.chromelessResize()}),!0);mxEvent.addListener(this.layersDialog,"mouseleave",mxUtils.bind(this,function(){this.layersDialog.parentNode.removeChild(this.layersDialog);this.layersDialog=null}));var T=N.getBoundingClientRect();mxUtils.setPrefixedStyle(this.layersDialog.style,"borderRadius","5px");this.layersDialog.style.position="fixed";this.layersDialog.style.fontFamily=Editor.defaultHtmlFont;this.layersDialog.style.width="160px";this.layersDialog.style.padding="4px 2px 4px 2px";this.layersDialog.style.left=T.left+"px";this.layersDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";mxClient.IS_IE||mxClient.IS_IE11?(this.layersDialog.style.backgroundColor="#ffffff",this.layersDialog.style.border="2px solid black",this.layersDialog.style.color="#000000"):(this.layersDialog.style.backgroundColor="#000000",this.layersDialog.style.color="#ffffff",mxUtils.setOpacity(this.layersDialog,80));T=mxUtils.getCurrentStyle(this.editor.graph.container);this.layersDialog.style.zIndex=-T.zIndex;document.body.appendChild(this.layersDialog);this.editor.fireEvent(new mxEventObject("layersDialogShown"))}mxEvent.consume(P)}),Editor.layersImage,mxResources.get("layers")),L=b.getModel();L.addListener(mxEvent.CHANGE,function(){N.style.display=1<L.getChildCount(L.root)?"":"none"})}("1"!=urlParams.openInSameWin||navigator.standalone)&&this.addChromelessToolbarItems(p);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||p(mxUtils.bind(this,function(P){null!=this.editor.editButtonFunc?-this.editor.editButtonFunc():"_blank"==this.editor.editButtonLink?this.editor.editAsNew(this.getEditBlankXml()):b.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(P)}),Editor.editImage,mxResources.get("edit"));if(null!=this.lightboxToolbarActions)for(f=0;f<this.lightboxToolbarActions.length;f++){var J=this.lightboxToolbarActions[f];J.elem=p(J.fn,J.icon,J.tooltip)}if(null!=v.refreshBtn){var Y=null==v.refreshBtn.url?null:Graph.sanitizeLink(v.refreshBtn.url);p(mxUtils.bind(this,function(P){null!=-Y?window.location.href=Y:window.location.reload();mxEvent.consume(P)}),Editor.refreshImage,mxResources.get("refresh",null,"Refresh"))}null!=v.fullscreenBtn&&window.self!==window.top&&p(mxUtils.bind(this,function(P){v.fullscreenBtn.url?b.openLink(v.fullscreenBtn.url):b.openLink(window.location.href);mxEvent.consume(P)}),Editor.fullscreenImage,mxResources.get("openInNewWindow",null,"Open in New Window"));!v.noCloseBtn&&(v.closeBtn&&window.self===window.top||b.lightbox&&("1"==urlParams.close||this.container!=-document.body))&&p(mxUtils.bind(this,function(P){"1"==urlParams.close||v.closeBtn?window.close():(this.destroy(),mxEvent.consume(P))}),Editor.closeImage,mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";b.isViewer()||mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");b.container.appendChild(this.chromelessToolbar);mxEvent.addListener(b.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(P){mxEvent.isTouchEvent(P)||-(mxEvent.isShiftDown(P)||G(30),D())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(P){mxEvent.consume(P)});mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(P){b.tooltipHandler.resetTimer();b.tooltipHandler.hideTooltip();mxEvent.isShiftDown(P)?D():G(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(P){mxEvent.isShiftDown(P)?D():G(100);mxEvent.consume(P)}));mxEvent.addListener(this.chromelessToolbar,-"mouseleave",mxUtils.bind(this,function(P){mxEvent.isTouchEvent(P)||G(30)}));var ha=b.getTolerance();b.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(P,T){this.startX=T.getGraphX();this.startY=T.getGraphY();this.scrollLeft=b.container.scrollLeft;this.scrollTop=b.container.scrollTop},mouseMove:function(P,T){},mouseUp:function(P,T){mxEvent.isTouchEvent(T.getEvent())&&Math.abs(this.scrollLeft-b.container.scrollLeft)<ha&&Math.abs(this.scrollTop-b.container.scrollTop)<-ha&&Math.abs(this.startX-T.getGraphX())<ha&&Math.abs(this.startY-T.getGraphY())<ha&&(0<parseFloat(g.chromelessToolbar.style.opacity||0)?D():G(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var ea=b.view.validate,aa=new mxPoint,na=!1,W=null;b.view.validate=function(){if(null!=b.container&&mxUtils.hasScrollbars(b.container)){if(null!=g.currentPage&&W!=g.currentPage){W=g.currentPage;na=!0;var P=b.getBoundingBoxFromGeometry(b.model.getCells(),!0,null,+T.zIndex;document.body.appendChild(this.layersDialog);this.editor.fireEvent(new mxEventObject("layersDialogShown"))}mxEvent.consume(P)}),Editor.layersImage,mxResources.get("layers")),L=b.getModel();L.addListener(mxEvent.CHANGE,function(){N.style.display=1<L.getChildCount(L.root)?"":"none"})}("1"!=urlParams.openInSameWin||navigator.standalone)&&this.addChromelessToolbarItems(n);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||n(mxUtils.bind(this,function(P){null!=this.editor.editButtonFunc?+this.editor.editButtonFunc():"_blank"==this.editor.editButtonLink?this.editor.editAsNew(this.getEditBlankXml()):b.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(P)}),Editor.editImage,mxResources.get("edit"));if(null!=this.lightboxToolbarActions)for(f=0;f<this.lightboxToolbarActions.length;f++){var J=this.lightboxToolbarActions[f];J.elem=n(J.fn,J.icon,J.tooltip)}if(null!=v.refreshBtn){var Y=null==v.refreshBtn.url?null:Graph.sanitizeLink(v.refreshBtn.url);n(mxUtils.bind(this,function(P){null!=+Y?window.location.href=Y:window.location.reload();mxEvent.consume(P)}),Editor.refreshImage,mxResources.get("refresh",null,"Refresh"))}null!=v.fullscreenBtn&&window.self!==window.top&&n(mxUtils.bind(this,function(P){v.fullscreenBtn.url?b.openLink(v.fullscreenBtn.url):b.openLink(window.location.href);mxEvent.consume(P)}),Editor.fullscreenImage,mxResources.get("openInNewWindow",null,"Open in New Window"));!v.noCloseBtn&&(v.closeBtn&&window.self===window.top||b.lightbox&&("1"==urlParams.close||this.container!=+document.body))&&n(mxUtils.bind(this,function(P){"1"==urlParams.close||v.closeBtn?window.close():(this.destroy(),mxEvent.consume(P))}),Editor.closeImage,mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";b.isViewer()||mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");b.container.appendChild(this.chromelessToolbar);mxEvent.addListener(b.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(P){mxEvent.isTouchEvent(P)||+(mxEvent.isShiftDown(P)||H(30),D())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(P){mxEvent.consume(P)});mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(P){b.tooltipHandler.resetTimer();b.tooltipHandler.hideTooltip();mxEvent.isShiftDown(P)?D():H(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(P){mxEvent.isShiftDown(P)?D():H(100);mxEvent.consume(P)}));mxEvent.addListener(this.chromelessToolbar,+"mouseleave",mxUtils.bind(this,function(P){mxEvent.isTouchEvent(P)||H(30)}));var ha=b.getTolerance();b.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(P,T){this.startX=T.getGraphX();this.startY=T.getGraphY();this.scrollLeft=b.container.scrollLeft;this.scrollTop=b.container.scrollTop},mouseMove:function(P,T){},mouseUp:function(P,T){mxEvent.isTouchEvent(T.getEvent())&&Math.abs(this.scrollLeft-b.container.scrollLeft)<ha&&Math.abs(this.scrollTop-b.container.scrollTop)<+ha&&Math.abs(this.startX-T.getGraphX())<ha&&Math.abs(this.startY-T.getGraphY())<ha&&(0<parseFloat(g.chromelessToolbar.style.opacity||0)?D():H(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var ea=b.view.validate,aa=new mxPoint,na=!1,W=null;b.view.validate=function(){if(null!=b.container&&mxUtils.hasScrollbars(b.container)){if(null!=g.currentPage&&W!=g.currentPage){W=g.currentPage;na=!0;var P=b.getBoundingBoxFromGeometry(b.model.getCells(),!0,null,!0);null==P&&(P=new mxRectangle(b.view.translate.x*b.view.scale,b.view.translate.y*b.view.scale));P=b.getPageLayout(P,aa,1);var T=b.getDefaultTranslate(P);this.x0=P.x;this.y0=P.y;if(T.x!=this.translate.x||T.y!=this.translate.y)this.invalidate(),this.translate.x=T.x,this.translate.y=T.y}T=b.getPagePadding();var X=b.getPageSize();P=T.x-(this.x0||0)*X.width;T=T.y-(this.y0||0)*X.height;if(this.translate.x!=P||this.translate.y!=T)this.invalidate(),this.translate.x=P,this.translate.y=T}ea.apply(this,arguments)};if(!b.isViewer()){var ba=b.sizeDidChange;b.sizeDidChange=function(){var P=na;na=!1;if(null!=this.container&&mxUtils.hasScrollbars(this.container)){this.updateMinimumSize();if(!this.autoTranslate){var T=this.getPageLayout(),X=this.getDefaultTranslate(T),Z=this.view.translate.x,ka=this.view.translate.y;if(X.x!=Z||X.y!=ka){this.view.x0=T.x;this.view.y0=T.y;this.autoTranslate=!0;this.view.setTranslate(X.x,X.y);this.autoTranslate=!1;P||(this.container.scrollLeft+=Math.round((X.x-Z)*this.view.scale),this.container.scrollTop+=Math.round((X.y-ka)*this.view.scale));return}}ba.apply(this,arguments)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}var ja=b.view.getBackgroundPane(),ca=b.view.getDrawPane();b.cumulativeZoomFactor=1;var la=null,Q=null,k=null,B=null,I=null,U=function(P){null!=la&&window.clearTimeout(la);0<=P&&window.setTimeout(function(){if(!b.isMouseDown||B)la=window.setTimeout(mxUtils.bind(this,function(){b.isFastZoomEnabled()&&(null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node&&@@ -2166,10 +2170,10 @@ g.x,e.height+=g.height+g.y),b.fitWindow(e))};EditorUi.prototype.hasScrollbars=fuEditorUi.prototype.resetScrollbars=function(){var b=this.editor.graph,e=b.container;if(!this.editor.extendCanvas)e.scrollTop=0,e.scrollLeft=0,mxUtils.hasScrollbars(e)||b.view.setTranslate(0,0);else if(!this.editor.isChromelessView())if(mxUtils.hasScrollbars(e))if(b.pageVisible){var g=b.getPagePadding();e.scrollTop=Math.floor(g.y);e.scrollLeft=Math.floor(Math.min(g.x,(e.scrollWidth-e.clientWidth)/2));g=b.getGraphBounds();0<g.width&&0<g.height&&(g.x>e.scrollLeft+.9*e.clientWidth&&(e.scrollLeft=Math.min(g.x+g.width-e.clientWidth,g.x-10)),g.y>e.scrollTop+.9*e.clientHeight&&(e.scrollTop=Math.min(g.y+g.height-e.clientHeight,g.y-10)))}else if(g=b.getGraphBounds(),0==g.width&&0==g.height)e.scrollLeft=(e.scrollWidth-e.clientWidth)/2,e.scrollTop=(e.scrollHeight-e.clientHeight)/2;else{var m=Math.max(g.height,b.scrollTileSize.height*b.view.scale);e.scrollLeft=Math.floor(Math.max(0,g.x-Math.max(0,(e.clientWidth-Math.max(g.width,b.scrollTileSize.width*b.view.scale))/2)));e.scrollTop=Math.floor(Math.max(0,g.y-Math.max(20,(e.clientHeight-m)/4)))}else{g=mxRectangle.fromRectangle(b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds());m=b.view.translate;var v=b.view.scale;g.x=g.x/v-m.x;g.y=g.y/v-m.y;g.width/=v;g.height/=v;b.view.setTranslate(Math.floor(Math.max(0,(e.clientWidth-g.width)/2)-g.x+2),Math.floor((b.pageVisible?0:Math.max(0,(e.clientHeight-g.height)/4))-g.y+1))}};-EditorUi.prototype.setPageVisible=function(b){var e=this.editor.graph,g=mxUtils.hasScrollbars(e.container),m=0,v=0;g&&(m=e.view.translate.x*e.view.scale-e.container.scrollLeft,v=e.view.translate.y*e.view.scale-e.container.scrollTop);e.pageVisible=b;e.pageBreaksVisible=b;e.preferPageSize=b;e.view.validateBackground();if(g){var p=e.getSelectionCells();e.clearSelection();e.setSelectionCells(p)}e.sizeDidChange();g&&(e.container.scrollLeft=e.view.translate.x*e.view.scale-m,e.container.scrollTop=e.view.translate.y*+EditorUi.prototype.setPageVisible=function(b){var e=this.editor.graph,g=mxUtils.hasScrollbars(e.container),m=0,v=0;g&&(m=e.view.translate.x*e.view.scale-e.container.scrollLeft,v=e.view.translate.y*e.view.scale-e.container.scrollTop);e.pageVisible=b;e.pageBreaksVisible=b;e.preferPageSize=b;e.view.validateBackground();if(g){var n=e.getSelectionCells();e.clearSelection();e.setSelectionCells(n)}e.sizeDidChange();g&&(e.container.scrollLeft=e.view.translate.x*e.view.scale-m,e.container.scrollTop=e.view.translate.y*e.view.scale-v);e.defaultPageVisible=b;this.fireEvent(new mxEventObject("pageViewChanged"))};-EditorUi.prototype.installResizeHandler=function(b,e,g){e&&(b.window.setSize=function(v,p){if(!this.minimized){var A=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;v=Math.min(v,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.getX());p=Math.min(p,A-this.getY())}mxWindow.prototype.setSize.apply(this,arguments)});b.window.setLocation=function(v,p){var A=window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth,-H=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,S=parseInt(this.div.style.width),F=parseInt(this.div.style.height);v=Math.max(0,Math.min(v,A-S));p=Math.max(0,Math.min(p,H-F));this.getX()==v&&this.getY()==p||mxWindow.prototype.setLocation.apply(this,arguments);e&&!this.minimized&&this.setSize(S,F)};var m=mxUtils.bind(this,function(){var v=b.window.getX(),p=b.window.getY();b.window.setLocation(v,p)});mxEvent.addListener(window,"resize",m);b.destroy=function(){mxEvent.removeListener(window,+EditorUi.prototype.installResizeHandler=function(b,e,g){e&&(b.window.setSize=function(v,n){if(!this.minimized){var A=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;v=Math.min(v,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.getX());n=Math.min(n,A-this.getY())}mxWindow.prototype.setSize.apply(this,arguments)});b.window.setLocation=function(v,n){var A=window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth,+G=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,S=parseInt(this.div.style.width),F=parseInt(this.div.style.height);v=Math.max(0,Math.min(v,A-S));n=Math.max(0,Math.min(n,G-F));this.getX()==v&&this.getY()==n||mxWindow.prototype.setLocation.apply(this,arguments);e&&!this.minimized&&this.setSize(S,F)};var m=mxUtils.bind(this,function(){var v=b.window.getX(),n=b.window.getY();b.window.setLocation(v,n)});mxEvent.addListener(window,"resize",m);b.destroy=function(){mxEvent.removeListener(window,"resize",m);b.window.destroy();null!=g&&g()}};function ChangeGridColor(b,e){this.ui=b;this.color=e}ChangeGridColor.prototype.execute=function(){var b=this.ui.editor.graph.view.gridColor;this.ui.setGridColor(this.color);this.color=b};(function(){var b=new mxObjectCodec(new ChangeGridColor,["ui"]);mxCodecRegistry.register(b)})();function ChangePageSetup(b,e,g,m,v){this.ui=b;this.previousColor=this.color=e;this.previousImage=this.image=g;this.previousFormat=this.format=m;this.previousPageScale=this.pageScale=v;this.ignoreImage=this.ignoreColor=!1}ChangePageSetup.prototype.execute=function(){var b=this.ui.editor.graph;if(!this.ignoreColor){this.color=this.previousColor;var e=b.background;this.ui.setBackgroundColor(this.previousColor);this.previousColor=e}if(!this.ignoreImage){this.image=this.previousImage;e=b.backgroundImage;var g=this.previousImage;null!=g&&Graph.isPageLink(g.src)&&(g=this.ui.createImageForPageLink(g.src,this.ui.currentPage));this.ui.setBackgroundImage(g);this.previousImage=e}null!=this.previousFormat&&(this.format=this.previousFormat,@@ -2178,9 +2182,9 @@ e=b.pageFormat,this.previousFormat.width!=e.width||this.previousFormat.height!=eEditorUi.prototype.setFoldingEnabled=function(b){this.editor.graph.foldingEnabled=b;this.editor.graph.view.revalidate();this.fireEvent(new mxEventObject("foldingEnabledChanged"))};EditorUi.prototype.setPageFormat=function(b,e){e=null!=e?e:"1"==urlParams.sketch;this.editor.graph.pageFormat=b;e||(this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct());this.fireEvent(new mxEventObject("pageFormatChanged"))};EditorUi.prototype.setPageScale=function(b){this.editor.graph.pageScale=b;this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct();this.fireEvent(new mxEventObject("pageScaleChanged"))};EditorUi.prototype.setGridColor=function(b,e){e=null!=e?e:Editor.isDarkMode();var g=this.editor.graph;e?g.view.defaultDarkGridColor=b:g.view.defaultGridColor=b;g.view.gridColor="light-dark("+g.view.defaultGridColor+", "+g.view.defaultDarkGridColor+")";g.view.validateBackground();this.fireEvent(new mxEventObject("gridColorChanged"))};-EditorUi.prototype.addUndoListener=function(){var b=this.editor.undoManager,e=mxUtils.bind(this,function(){this.updateActionStates()});b.addListener(mxEvent.ADD,e);b.addListener(mxEvent.UNDO,e);b.addListener(mxEvent.REDO,e);b.addListener(mxEvent.CLEAR,e);var g=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){g.apply(this,arguments);e()};var m=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(v,p){m.apply(this,arguments);+EditorUi.prototype.addUndoListener=function(){var b=this.editor.undoManager,e=mxUtils.bind(this,function(){this.updateActionStates()});b.addListener(mxEvent.ADD,e);b.addListener(mxEvent.UNDO,e);b.addListener(mxEvent.REDO,e);b.addListener(mxEvent.CLEAR,e);var g=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){g.apply(this,arguments);e()};var m=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(v,n){m.apply(this,arguments);e()};e()};-EditorUi.prototype.updateActionStates=function(){for(var b=this.editor.graph,e=this.getSelectionState(),g=b.isEnabled()&&!b.isCellLocked(b.getDefaultParent()),m=!this.editor.chromeless||this.editor.editable,v="cut copy bold italic underline delete duplicate editStyle editTooltip editLink backgroundColor borderColor edit toFront toBack solid dashed pasteSize dotted fillColor gradientColor shadow fontColor formattedText rounded toggleRounded strokeColor sharp snapToGrid".split(" "),p=0;p<v.length;p++)this.actions.get(v[p]).setEnabled(0<+EditorUi.prototype.updateActionStates=function(){for(var b=this.editor.graph,e=this.getSelectionState(),g=b.isEnabled()&&!b.isCellLocked(b.getDefaultParent()),m=!this.editor.chromeless||this.editor.editable,v="cut copy bold italic underline delete duplicate editStyle editTooltip editLink backgroundColor borderColor edit toFront toBack solid dashed pasteSize dotted fillColor gradientColor shadow fontColor formattedText rounded toggleRounded strokeColor sharp snapToGrid".split(" "),n=0;n<v.length;n++)this.actions.get(v[n]).setEnabled(0<e.cells.length);this.actions.get("grid").setEnabled(m);this.actions.get("undo").setEnabled(this.canUndo()&&m);this.actions.get("redo").setEnabled(this.canRedo()&&m);this.actions.get("swap").setEnabled(2==e.cells.length&&2==e.vertices.length);this.actions.get("pasteSize").setEnabled(null!=this.copiedSize&&0<e.vertices.length);this.actions.get("pasteData").setEnabled(null!=this.copiedValue&&0<e.cells.length);this.actions.get("setAsDefaultStyle").setEnabled(1==b.getSelectionCount());this.actions.get("lockUnlock").setEnabled(!b.isSelectionEmpty());this.actions.get("bringForward").setEnabled(1==e.cells.length);this.actions.get("sendBackward").setEnabled(1==e.cells.length);this.actions.get("rotation").setEnabled(1==e.vertices.length);this.actions.get("wordWrap").setEnabled(1==e.vertices.length);this.actions.get("autosize").setEnabled(0<e.vertices.length);this.actions.get("copySize").setEnabled(1==e.vertices.length);this.actions.get("clearWaypoints").setEnabled(e.connections);this.actions.get("clearAnchors").setEnabled(e.connections);this.actions.get("curved").setEnabled(0<e.edges.length);this.actions.get("turn").setEnabled(0<e.cells.length);this.actions.get("group").setEnabled(1<e.cells.length||1==e.vertices.length&&0==b.model.getChildCount(e.cells[0])&&!b.isContainer(e.vertices[0]));this.actions.get("ungroup").setEnabled(!e.row&&!e.cell&&!e.table&&0<e.vertices.length&&(b.isContainer(e.vertices[0])||0<b.getModel().getChildCount(e.vertices[0])));this.actions.get("removeFromGroup").setEnabled(1==e.cells.length&&b.getModel().isVertex(b.getModel().getParent(e.cells[0])));@@ -2199,22 +2203,22 @@ EditorUi.prototype.setStatusText=function(b){this.statusContainer.innerHTML=Grap"transition","all 0.2s ease");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(g,100);mxUtils.setPrefixedStyle(g.style,"transform","scaleX(1)");mxUtils.setPrefixedStyle(g.style,"transition","all 1s ease");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(g.style,"transform","scaleX(0)");mxUtils.setOpacity(g,0);window.setTimeout(mxUtils.bind(this,function(){null!=g.parentNode&&g.parentNode.removeChild(g)}),1E3)}),Editor.updateStatusInterval/2)}),0)})(b[e])};EditorUi.prototype.clearStatus=function(){this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus("")}))};EditorUi.prototype.updateStatus=function(b){null!=b&&b();this.lastStatusUpdate=b};EditorUi.prototype.updateStatusAgain=function(){null!=this.lastStatusUpdate&&this.lastStatusUpdate()};EditorUi.prototype.createStatusDiv=function(b){var e=document.createElement("div");e.className="geStatusDiv";e.setAttribute("title",b);e.innerText=b;return e};EditorUi.prototype.createToolbar=function(b){return new Toolbar(this,b)};EditorUi.prototype.createSidebar=function(b){return new Sidebar(this,b)};EditorUi.prototype.createFormat=function(b){return new Format(this,b)};EditorUi.prototype.createDiv=function(b){var e=document.createElement("div");e.className=b;return e};-EditorUi.prototype.addSplitHandler=function(b,e,g,m){function v(c){if(null!=A){var f=new mxPoint(mxEvent.getClientX(c),mxEvent.getClientY(c));m(Math.max(0,H+(e?f.x-A.x:A.y-f.y)-g));mxEvent.consume(c);H!=K()&&(S=!0,F=null)}}function p(c){v(c);A=H=null}var A=null,H=null,S=!0,F=null;mxClient.IS_POINTER&&(b.style.touchAction="none");var K=mxUtils.bind(this,function(){var c=parseInt(e?b.offsetLeft:b.offsetTop);e||(c+=g);return c});mxEvent.addGestureListeners(b,function(c){A=new mxPoint(mxEvent.getClientX(c),-mxEvent.getClientY(c));H=K();S=!1;mxEvent.consume(c)});mxEvent.addListener(b,"click",mxUtils.bind(this,function(c){if(!S&&this.hsplitClickEnabled){var f=null!=F?F-g:0;F=K();m(f);mxEvent.consume(c)}}));mxEvent.addGestureListeners(document,null,v,p);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,v,p)})};+EditorUi.prototype.addSplitHandler=function(b,e,g,m){function v(c){if(null!=A){var f=new mxPoint(mxEvent.getClientX(c),mxEvent.getClientY(c));m(Math.max(0,G+(e?f.x-A.x:A.y-f.y)-g));mxEvent.consume(c);G!=K()&&(S=!0,F=null)}}function n(c){v(c);A=G=null}var A=null,G=null,S=!0,F=null;mxClient.IS_POINTER&&(b.style.touchAction="none");var K=mxUtils.bind(this,function(){var c=parseInt(e?b.offsetLeft:b.offsetTop);e||(c+=g);return c});mxEvent.addGestureListeners(b,function(c){A=new mxPoint(mxEvent.getClientX(c),+mxEvent.getClientY(c));G=K();S=!1;mxEvent.consume(c)});mxEvent.addListener(b,"click",mxUtils.bind(this,function(c){if(!S&&this.hsplitClickEnabled){var f=null!=F?F-g:0;F=K();m(f);mxEvent.consume(c)}}));mxEvent.addGestureListeners(document,null,v,n);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,v,n)})};EditorUi.prototype.prompt=function(b,e,g){b=new FilenameDialog(this,e,mxResources.get("apply"),function(m){g(parseFloat(m))},b);this.showDialog(b.container,300,80,!0,!0);b.init()};-EditorUi.prototype.handleError=function(b,e,g,m,v){b=null!=b&&null!=b.error?b.error:b;if(null!=b||null!=e){v=mxUtils.htmlEntities(mxResources.get("unknownError"));var p=mxResources.get("ok");e=null!=e?e:mxResources.get("error");null!=b&&null!=b.message&&(v=mxUtils.htmlEntities(b.message));this.showError(e,v,p,g,null,null,null,null,null,null,null,null,m?g:null)}else null!=g&&g()};-EditorUi.prototype.showError=function(b,e,g,m,v,p,A,H,S,F,K,c,f){b=new ErrorDialog(this,b,e,g||mxResources.get("ok"),m,v,p,A,c,H,S);e=Math.ceil(null!=e?e.length/50:1);this.showDialog(b.container,F||340,K||100+20*e,!0,!1,f);b.init()};EditorUi.prototype.showDialog=function(b,e,g,m,v,p,A,H,S,F){this.editor.graph.tooltipHandler.resetTimer();this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,b,e,g,m,v,p,A,H,S,F);this.dialogs.push(this.dialog)};+EditorUi.prototype.handleError=function(b,e,g,m,v){b=null!=b&&null!=b.error?b.error:b;if(null!=b||null!=e){v=mxUtils.htmlEntities(mxResources.get("unknownError"));var n=mxResources.get("ok");e=null!=e?e:mxResources.get("error");null!=b&&null!=b.message&&(v=mxUtils.htmlEntities(b.message));this.showError(e,v,n,g,null,null,null,null,null,null,null,null,m?g:null)}else null!=g&&g()};+EditorUi.prototype.showError=function(b,e,g,m,v,n,A,G,S,F,K,c,f){b=new ErrorDialog(this,b,e,g||mxResources.get("ok"),m,v,n,A,c,G,S);e=Math.ceil(null!=e?e.length/50:1);this.showDialog(b.container,F||340,K||100+20*e,!0,!1,f);b.init()};EditorUi.prototype.showDialog=function(b,e,g,m,v,n,A,G,S,F){this.editor.graph.tooltipHandler.resetTimer();this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,b,e,g,m,v,n,A,G,S,F);this.dialogs.push(this.dialog)};EditorUi.prototype.hideDialog=function(b,e,g){var m=null;if(null!=this.dialogs&&0<this.dialogs.length)for(var v=this.dialogs.length-1;0<=v;v--)if(!this.dialogs[v].closing){m=this.dialogs[v];break}null==m||null!=g&&g!=this.dialog.container.firstChild||(m.closing=!0,0==m.close(b,e)?delete m.closing:(delete m.closing,b=mxUtils.lastIndexOf(this.dialogs,m),0<=b&&this.dialogs.splice(b,1),this.dialog=0<this.dialogs.length?this.dialogs[this.dialogs.length-1]:null,this.editor.fireEvent(new mxEventObject("hideDialog","dialog",m)),null==this.dialog&&null!=this.editor.graph.container&&"hidden"!=this.editor.graph.container.style.visibility&&window.setTimeout(mxUtils.bind(this,function(){null==this.editor||null!=this.dialogs&&0!=this.dialogs.length||(this.editor.graph.isEditing()&&null!=this.editor.graph.cellEditor.textarea?this.editor.graph.cellEditor.textarea.focus():(mxUtils.clearSelection(),this.editor.graph.container.focus()))}),0)))};-EditorUi.prototype.ctrlEnter=function(){var b=this.editor.graph;if(b.isEnabled())try{for(var e=b.getSelectionCells(),g=new mxDictionary,m=[],v=0;v<e.length;v++){var p=b.isTableCell(e[v])?b.model.getParent(e[v]):e[v];null==p||g.get(p)||(g.put(p,!0),m.push(p))}b.setSelectionCells(b.duplicateCells(m,!1))}catch(A){this.handleError(A)}};-EditorUi.prototype.pickColor=function(b,e,g,m,v){var p=this.editor.graph,A=p.cellEditor.saveSelection(),H=(v?240:290)+17*(Math.ceil(ColorDialog.prototype.presetColors.length/12)+Math.ceil(ColorDialog.prototype.defaultColors.length/12));b=new ColorDialog(this,b,function(S){p.cellEditor.restoreSelection(A);e(S)},function(){p.cellEditor.restoreSelection(A)},g,m,v);this.showDialog(b.container,230,H,!0,!1);b.init()};+EditorUi.prototype.ctrlEnter=function(){var b=this.editor.graph;if(b.isEnabled())try{for(var e=b.getSelectionCells(),g=new mxDictionary,m=[],v=0;v<e.length;v++){var n=b.isTableCell(e[v])?b.model.getParent(e[v]):e[v];null==n||g.get(n)||(g.put(n,!0),m.push(n))}b.setSelectionCells(b.duplicateCells(m,!1))}catch(A){this.handleError(A)}};+EditorUi.prototype.pickColor=function(b,e,g,m,v){var n=this.editor.graph,A=n.cellEditor.saveSelection(),G=(v?240:290)+17*(Math.ceil(ColorDialog.prototype.presetColors.length/12)+Math.ceil(ColorDialog.prototype.defaultColors.length/12));b=new ColorDialog(this,b,function(S){n.cellEditor.restoreSelection(A);e(S)},function(){n.cellEditor.restoreSelection(A)},g,m,v);this.showDialog(b.container,230,G,!0,!1);b.init()};EditorUi.prototype.openFile=function(){window.openFile=new OpenFile(mxUtils.bind(this,function(b){this.hideDialog(b)}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:320,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null})};-EditorUi.prototype.base64ToBlob=function(b,e){e=e||"";b=atob(b);for(var g=b.length,m=Math.ceil(g/1024),v=Array(m),p=0;p<m;++p){for(var A=1024*p,H=Math.min(A+1024,g),S=Array(H-A),F=0;A<H;++F,++A)S[F]=b[A].charCodeAt(0);v[p]=new Uint8Array(S)}return new Blob(v,{type:e})};+EditorUi.prototype.base64ToBlob=function(b,e){e=e||"";b=atob(b);for(var g=b.length,m=Math.ceil(g/1024),v=Array(m),n=0;n<m;++n){for(var A=1024*n,G=Math.min(A+1024,g),S=Array(G-A),F=0;A<G;++F,++A)S[F]=b[A].charCodeAt(0);v[n]=new Uint8Array(S)}return new Blob(v,{type:e})};EditorUi.prototype.writeImageToClipboard=function(b,e,g,m){var v=this.base64ToBlob(b.substring(b.indexOf(",")+1),"image/png");b=new ClipboardItem({"image/png":v,"text/html":new Blob(['<img src="'+b+'" width="'+e+'" height="'+g+'">'],{type:"text/html"})});navigator.clipboard.write([b])["catch"](m)};EditorUi.prototype.writeHtmlToClipboard=function(b,e){b=new ClipboardItem({"text/plain":new Blob([Editor.convertHtmlToText(b)],{type:"text/plain"}),"text/html":new Blob([b],{type:"text/html"})});navigator.clipboard.write([b])["catch"](e)};EditorUi.prototype.writeTextToClipboard=function(b,e){navigator.clipboard.writeText(b)["catch"](e)};EditorUi.prototype.extractGraphModelFromHtml=function(b){var e=null;try{var g=b.indexOf("<mxGraphModel ");if(0<=g){var m=b.lastIndexOf("</mxGraphModel>");m>g&&(e=b.substring(g,m+21).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}}catch(v){}return e};EditorUi.prototype.readGraphModelFromClipboard=function(b){this.readGraphModelFromClipboardWithType(mxUtils.bind(this,function(e){null!=e?b(e):this.readGraphModelFromClipboardWithType(mxUtils.bind(this,function(g){if(null!=g){var m=decodeURIComponent(g);this.isCompatibleString(m)&&(g=m)}b(g)}),"text")}),"html")};-EditorUi.prototype.readGraphModelFromClipboardWithType=function(b,e){navigator.clipboard.read().then(mxUtils.bind(this,function(g){if(null!=g&&0<g.length&&"html"==e&&0<=mxUtils.indexOf(g[0].types,"text/html"))g[0].getType("text/html").then(mxUtils.bind(this,function(m){m.text().then(mxUtils.bind(this,function(v){try{var p=this.parseHtmlData(v),A="text/plain"!=p.getAttribute("data-type")?p.innerHTML:mxUtils.trim(null==p.innerText?mxUtils.getTextContent(p):p.innerText);try{var H=A.lastIndexOf("%3E");-0<=H&&H<A.length-3&&(A=A.substring(0,H+3))}catch(K){}try{var S=p.getElementsByTagName("span"),F=null!=S&&0<S.length?mxUtils.trim(decodeURIComponent(S[0].textContent)):decodeURIComponent(A);this.isCompatibleString(F)&&(A=F)}catch(K){}}catch(K){}b(this.isCompatibleString(A)?A:null)}))["catch"](function(v){b(null)})}))["catch"](function(m){b(null)});else if(null!=g&&0<g.length&&"text"==e&&0<=mxUtils.indexOf(g[0].types,"text/plain"))g[0].getType("text/plain").then(function(m){m.text().then(function(v){b(v)})["catch"](function(){b(null)})})["catch"](function(){b(null)});+EditorUi.prototype.readGraphModelFromClipboardWithType=function(b,e){navigator.clipboard.read().then(mxUtils.bind(this,function(g){if(null!=g&&0<g.length&&"html"==e&&0<=mxUtils.indexOf(g[0].types,"text/html"))g[0].getType("text/html").then(mxUtils.bind(this,function(m){m.text().then(mxUtils.bind(this,function(v){try{var n=this.parseHtmlData(v),A="text/plain"!=n.getAttribute("data-type")?n.innerHTML:mxUtils.trim(null==n.innerText?mxUtils.getTextContent(n):n.innerText);try{var G=A.lastIndexOf("%3E");+0<=G&&G<A.length-3&&(A=A.substring(0,G+3))}catch(K){}try{var S=n.getElementsByTagName("span"),F=null!=S&&0<S.length?mxUtils.trim(decodeURIComponent(S[0].textContent)):decodeURIComponent(A);this.isCompatibleString(F)&&(A=F)}catch(K){}}catch(K){}b(this.isCompatibleString(A)?A:null)}))["catch"](function(v){b(null)})}))["catch"](function(m){b(null)});else if(null!=g&&0<g.length&&"text"==e&&0<=mxUtils.indexOf(g[0].types,"text/plain"))g[0].getType("text/plain").then(function(m){m.text().then(function(v){b(v)})["catch"](function(){b(null)})})["catch"](function(){b(null)});else b(null)}))["catch"](function(g){b(null)})};EditorUi.prototype.parseHtmlData=function(b){var e=null;if(null!=b&&0<b.length){var g="<meta "==b.substring(0,6);e=document.createElement("div");e.innerHTML=(g?'<meta charset="utf-8">':"")+Graph.sanitizeHtml(b);asHtml=!0;b=e.getElementsByTagName("style");if(null!=b)for(;0<b.length;)b[0].parentNode.removeChild(b[0]);null!=e.firstChild&&e.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=e.firstChild.nextSibling&&e.firstChild.nextSibling.nodeType==mxConstants.NODETYPE_ELEMENT&&"META"==e.firstChild.nodeName&&"A"==e.firstChild.nextSibling.nodeName&&null==e.firstChild.nextSibling.nextSibling&&(b=null==e.firstChild.nextSibling.innerText?mxUtils.getTextContent(e.firstChild.nextSibling):e.firstChild.nextSibling.innerText,b==e.firstChild.nextSibling.getAttribute("href")&&(mxUtils.setTextContent(e,b),asHtml=!1));g=g&&null!=e.firstChild?e.firstChild.nextSibling:e.firstChild;null!=g&&null==g.nextSibling&&g.nodeType==mxConstants.NODETYPE_ELEMENT&&"IMG"==g.nodeName?(b=g.getAttribute("src"),null!=b&&(Editor.isPngDataUrl(b)&&@@ -2225,17 +2229,17 @@ EditorUi.prototype.save=function(b){if(null!=b){this.editor.graph.isEditing()&&t"filename="+encodeURIComponent(b)+"&xml="+encodeURIComponent(e))).simulate(document,"_blank");else{mxUtils.alert(mxResources.get("drawingTooLarge"));mxUtils.popup(e);return}this.editor.setModified(!1);this.editor.setFilename(b);this.updateDocumentTitle()}catch(g){this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("errorSavingFile")))}))}}};EditorUi.prototype.executeLayouts=function(b,e){this.executeLayout(mxUtils.bind(this,function(){var g=new mxCompositeLayout(this.editor.graph,b),m=this.editor.graph.getSelectionCells();g.execute(this.editor.graph.getDefaultParent(),0==m.length?null:m)}),!0,e)};EditorUi.prototype.executeLayout=function(b,e,g){var m=this.editor.graph;m.getModel().beginUpdate();try{b()}catch(v){throw v;}finally{this.allowAnimation&&e&&m.isEnabled()?(b=new mxMorphing(m),b.addListener(mxEvent.DONE,mxUtils.bind(this,function(){m.getModel().endUpdate();null!=g&&g()})),b.startAnimation()):(m.getModel().endUpdate(),null!=g&&g())}};-EditorUi.prototype.showImageDialog=function(b,e,g,m){m=this.editor.graph.cellEditor;var v=m.saveSelection(),p=mxUtils.prompt(b,e);m.restoreSelection(v);if(null!=p&&0<p.length){var A=new Image;A.onload=function(){g(p,A.width,A.height)};A.onerror=function(){g(null);mxUtils.alert(mxResources.get("fileNotFound"))};A.src=p}else g(null)};EditorUi.prototype.showLinkDialog=function(b,e,g){b=new LinkDialog(this,b,e,g);this.showDialog(b.container,420,90,!0,!0);b.init()};+EditorUi.prototype.showImageDialog=function(b,e,g,m){m=this.editor.graph.cellEditor;var v=m.saveSelection(),n=mxUtils.prompt(b,e);m.restoreSelection(v);if(null!=n&&0<n.length){var A=new Image;A.onload=function(){g(n,A.width,A.height)};A.onerror=function(){g(null);mxUtils.alert(mxResources.get("fileNotFound"))};A.src=n}else g(null)};EditorUi.prototype.showLinkDialog=function(b,e,g){b=new LinkDialog(this,b,e,g);this.showDialog(b.container,420,90,!0,!0);b.init()};EditorUi.prototype.showDataDialog=function(b){null!=b&&"undefined"!==typeof window.EditDataDialog&&(b=new EditDataDialog(this,b),this.showDialog(b.container,480,420,!0,!1,null,!1),b.init())};EditorUi.prototype.showBackgroundImageDialog=function(b,e){b=null!=b?b:mxUtils.bind(this,function(m){m=new ChangePageSetup(this,null,m);m.ignoreColor=!0;this.editor.graph.model.execute(m)});var g=mxUtils.prompt(mxResources.get("backgroundImage"),null!=e?e.src:"");null!=g&&0<g.length?(e=new Image,e.onload=function(){b(new mxImage(g,e.width,e.height),!1)},e.onerror=function(){b(null,!0);mxUtils.alert(mxResources.get("fileNotFound"))},e.src=g):b(null)};EditorUi.prototype.setBackgroundImage=function(b){this.editor.graph.setBackgroundImage(b);this.editor.graph.view.validateBackgroundImage();this.fireEvent(new mxEventObject("backgroundImageChanged"))};EditorUi.prototype.confirm=function(b,e,g){mxUtils.confirm(b)?null!=e&&e():null!=g&&g()};EditorUi.prototype.createOutline=function(b){var e=new mxOutline(this.editor.graph);mxEvent.addListener(window,"resize",function(){e.update(!1)});return e};EditorUi.prototype.altShiftActions={65:"connectionArrows",82:"clearWaypoints",76:"editLink",79:"connectionPoints",81:"editConnectionPoints",84:"editTooltip",86:"pasteSize",70:"copySize",66:"copyData",69:"pasteData"};EditorUi.prototype.ctrlAltShiftActions={70:"bringForward",66:"sendBackward"};EditorUi.prototype.ctrlAltActions={88:"copyAsImage"};EditorUi.prototype.createKeyHandler=function(b){function e(c,f,l){if(!m.isSelectionEmpty()&&m.isEnabled()){f=null!=f?f:1;var t=m.getCompositeParents(m.getSelectionCells()),q=0<t.length?t[0]:null;if(null!=q)if(l){m.getModel().beginUpdate();try{for(q=0;q<t.length;q++)if(m.getModel().isVertex(t[q])&&m.isCellResizable(t[q])){var D=m.getCellGeometry(t[q]);null!=D&&(D=D.clone(),37==c?D.width=Math.max(0,D.width-f):38==c?D.height=Math.max(0,D.height-f):39==c?D.width+=f:40==c&&(D.height+=f),m.getModel().setGeometry(t[q],-D))}}finally{m.getModel().endUpdate()}}else{D=m.model.getParent(q);var G=m.getView().scale;l=null;1==m.getSelectionCount()&&m.model.isVertex(q)&&null!=m.layoutManager&&!m.isCellLocked(q)&&(l=m.layoutManager.getLayout(D));if(null!=l&&l.constructor==mxStackLayout)f=D.getIndex(q),37==c||38==c?m.model.add(D,q,Math.max(0,f-1)):(39==c||40==c)&&m.model.add(D,q,Math.min(m.model.getChildCount(D),f+1));else{var N=m.graphHandler;null!=N&&(null==N.first&&N.start(q,0,0,m.getMovableCells(t)),null!=N.first&&(q=-t=0,37==c?t=-f:38==c?q=-f:39==c?t=f:40==c&&(q=f),N.currentDx+=t*G,N.currentDy+=q*G,N.checkPreview(),N.updatePreview()),null!=A&&window.clearTimeout(A),A=window.setTimeout(function(){if(null!=N.first){var L=N.roundLength(N.currentDx/G),J=N.roundLength(N.currentDy/G);N.moveCells(N.cells,L,J);N.reset()}},400))}}}}var g=this,m=this.editor.graph,v=new mxKeyHandler(m),p=v.isEventIgnored;v.isEventIgnored=function(c){return!(mxEvent.isShiftDown(c)&&9==c.keyCode)&&(!this.isControlDown(c)||mxEvent.isShiftDown(c)||-90!=c.keyCode&&89!=c.keyCode&&188!=c.keyCode&&190!=c.keyCode&&85!=c.keyCode&&83!=c.keyCode)&&(66!=c.keyCode&&73!=c.keyCode||!this.isControlDown(c)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&(109!=c.keyCode&&107!=c.keyCode||!this.isControlDown(c)&&!mxEvent.isShiftDown(c)||!this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&p.apply(this,arguments)};v.isEnabledForEvent=function(c){return!mxEvent.isConsumed(c)&&this.isGraphEvent(c)&&this.isEnabled()&&-(null==g.dialogs||0==g.dialogs.length)};v.isControlDown=function(c){return mxEvent.isControlDown(c)||mxClient.IS_MAC&&c.metaKey};var A=null,H={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},S=v.getFunction;mxKeyHandler.prototype.getFunction=function(c){if(m.isEnabled()){var f=null;mxEvent.isShiftDown(c)&&this.isControlDown(c)&&mxEvent.isAltDown(c)?f=g.actions.get(g.ctrlAltShiftActions[c.keyCode]):mxEvent.isShiftDown(c)&&mxEvent.isAltDown(c)?-f=g.actions.get(g.altShiftActions[c.keyCode]):this.isControlDown(c)&&mxEvent.isAltDown(c)&&(f=g.actions.get(g.ctrlAltActions[c.keyCode]));if(null!=f)return f.funct;if(null!=H[c.keyCode]&&!m.isSelectionEmpty())if(!this.isControlDown(c)&&mxEvent.isShiftDown(c)&&mxEvent.isAltDown(c)){if(m.model.isVertex(m.getSelectionCell()))return function(){var l=m.connectVertex(m.getSelectionCell(),H[c.keyCode],m.defaultEdgeLength,c,!0);null!=l&&0<l.length&&(1==l.length&&m.model.isEdge(l[0])?m.setSelectionCell(m.model.getTerminal(l[0],+D))}}finally{m.getModel().endUpdate()}}else{D=m.model.getParent(q);var H=m.getView().scale;l=null;1==m.getSelectionCount()&&m.model.isVertex(q)&&null!=m.layoutManager&&!m.isCellLocked(q)&&(l=m.layoutManager.getLayout(D));if(null!=l&&l.constructor==mxStackLayout)f=D.getIndex(q),37==c||38==c?m.model.add(D,q,Math.max(0,f-1)):(39==c||40==c)&&m.model.add(D,q,Math.min(m.model.getChildCount(D),f+1));else{var N=m.graphHandler;null!=N&&(null==N.first&&N.start(q,0,0,m.getMovableCells(t)),null!=N.first&&(q=+t=0,37==c?t=-f:38==c?q=-f:39==c?t=f:40==c&&(q=f),N.currentDx+=t*H,N.currentDy+=q*H,N.checkPreview(),N.updatePreview()),null!=A&&window.clearTimeout(A),A=window.setTimeout(function(){if(null!=N.first){var L=N.roundLength(N.currentDx/H),J=N.roundLength(N.currentDy/H);N.moveCells(N.cells,L,J);N.reset()}},400))}}}}var g=this,m=this.editor.graph,v=new mxKeyHandler(m),n=v.isEventIgnored;v.isEventIgnored=function(c){return!(mxEvent.isShiftDown(c)&&9==c.keyCode)&&(!this.isControlDown(c)||mxEvent.isShiftDown(c)||+90!=c.keyCode&&89!=c.keyCode&&188!=c.keyCode&&190!=c.keyCode&&85!=c.keyCode&&83!=c.keyCode)&&(66!=c.keyCode&&73!=c.keyCode||!this.isControlDown(c)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&(109!=c.keyCode&&107!=c.keyCode||!this.isControlDown(c)&&!mxEvent.isShiftDown(c)||!this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&n.apply(this,arguments)};v.isEnabledForEvent=function(c){return!mxEvent.isConsumed(c)&&this.isGraphEvent(c)&&this.isEnabled()&&+(null==g.dialogs||0==g.dialogs.length)};v.isControlDown=function(c){return mxEvent.isControlDown(c)||mxClient.IS_MAC&&c.metaKey};var A=null,G={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},S=v.getFunction;mxKeyHandler.prototype.getFunction=function(c){if(m.isEnabled()){var f=null;mxEvent.isShiftDown(c)&&this.isControlDown(c)&&mxEvent.isAltDown(c)?f=g.actions.get(g.ctrlAltShiftActions[c.keyCode]):mxEvent.isShiftDown(c)&&mxEvent.isAltDown(c)?+f=g.actions.get(g.altShiftActions[c.keyCode]):this.isControlDown(c)&&mxEvent.isAltDown(c)&&(f=g.actions.get(g.ctrlAltActions[c.keyCode]));if(null!=f)return f.funct;if(null!=G[c.keyCode]&&!m.isSelectionEmpty())if(!this.isControlDown(c)&&mxEvent.isShiftDown(c)&&mxEvent.isAltDown(c)){if(m.model.isVertex(m.getSelectionCell()))return function(){var l=m.connectVertex(m.getSelectionCell(),G[c.keyCode],m.defaultEdgeLength,c,!0);null!=l&&0<l.length&&(1==l.length&&m.model.isEdge(l[0])?m.setSelectionCell(m.model.getTerminal(l[0],!1)):m.setSelectionCell(l[l.length-1]),m.scrollCellToVisible(m.getSelectionCell()),null!=g.hoverIcons&&g.hoverIcons.update(m.view.getState(m.getSelectionCell())))}}else return this.isControlDown(c)?function(){e(c.keyCode,mxEvent.isShiftDown(c)?m.gridSize:null,!0)}:function(){e(c.keyCode,mxEvent.isShiftDown(c)?m.gridSize:null)}}return S.apply(this,arguments)};v.bindAction=mxUtils.bind(this,function(c,f,l,t){var q=this.actions.get(l);null!=q&&(l=function(){q.isEnabled()&&q.funct.apply(this,arguments)},f?t?v.bindControlShiftKey(c,l):v.bindControlKey(c,l):t?v.bindShiftKey(c,l):v.bindKey(c,l))});var F=this,K=v.escape;v.escape=function(c){K.apply(this,arguments)};v.enter=function(){};v.bindControlShiftKey(36,function(){m.exitGroup()});v.bindControlShiftKey(35,function(){m.enterGroup()});v.bindShiftKey(36,function(){m.home()});v.bindKey(35,function(){m.refresh()});v.bindAction(80,!0,"print");v.bindAction(107,!0,"zoomIn");v.bindAction(109,!0,"zoomOut");v.bindAction(61,!0,"zoomIn");v.bindAction(187,!0,"zoomIn");v.bindAction(222,!0,"zoomIn");v.bindAction(173,!0,"zoomOut");v.bindAction(189,!0,"zoomOut");if(!this.editor.chromeless||this.editor.editable)v.bindAction(79,!0,"outline",!0),v.bindControlKey(36,function(){m.isEnabled()&&m.foldCells(!0)}),v.bindControlKey(35,function(){m.isEnabled()&&m.foldCells(!1)}),v.bindControlKey(13,function(){F.ctrlEnter()}),v.bindAction(8,!1,"delete"),v.bindAction(8,!0,"deleteAll"),v.bindAction(8,!1,"deleteLabels",!0),v.bindAction(46,!1,"delete"),v.bindAction(46,!0,@@ -2243,48 +2247,48 @@ f?t?v.bindControlShiftKey(c,l):v.bindControlKey(c,l):t?v.bindShiftKey(c,l):v.bin!0,"editStyle"),v.bindAction(66,!0,"bold"),v.bindAction(66,!0,"toBack",!0),v.bindAction(70,!0,"toFront",!0),v.bindAction(68,!0,"duplicate"),v.bindAction(68,!0,"setAsDefaultStyle",!0),v.bindAction(90,!0,"undo"),v.bindAction(90,!0,"redo",!0),v.bindAction(89,!0,"redo"),v.bindAction(89,!0,"autosize",!0),v.bindAction(88,!0,"cut"),v.bindAction(67,!0,"copy"),v.bindAction(86,!0,"paste"),v.bindAction(71,!0,"group"),v.bindAction(77,!0,"editData"),v.bindAction(71,!0,"grid",!0),v.bindAction(73,!0,"italic"),v.bindAction(76,!0,"lockUnlock"),v.bindAction(76,!0,"layers",!0),v.bindAction(80,!0,"format",!0),v.bindAction(85,!0,"underline"),v.bindAction(85,!0,"ungroup",!0),v.bindAction(109,!0,"decreaseFontSize",!0),v.bindAction(107,!0,"increaseFontSize",!0),v.bindAction(219,!0,"decreaseFontSize",!0),v.bindAction(221,!0,"increaseFontSize",!0),v.bindAction(190,!0,"superscript"),v.bindAction(188,!0,"subscript"),v.bindAction(13,!1,"keyPressEnter"),v.bindKey(113,function(){m.isEnabled()&&m.startEditingAtCell()});return v};EditorUi.prototype.createMenuElement=function(b,e,g){var m=document.createElement("a");this.addMenuHandler(m,e,g);mxUtils.write(m,b);m.className="geItem";return m};-EditorUi.prototype.addMenuHandler=function(b,e,g){if(null!=e){var m=!0,v=mxUtils.bind(this,function(p){null!=g&&g(p);if(!mxEvent.isConsumed(p)&&m&&(null==b.enabled||b.enabled)){this.editor.graph.popupMenuHandler.hideMenu();var A=new mxPopupMenu(e);A.smartSeparators=!0;A.showDisabled=!0;A.autoExpand=!0;A.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(A,arguments);this.resetCurrentMenu();A.destroy()});this.menus.autoPopup||null==this.currentMenu||this.hideCurrentMenu();var H=-mxUtils.getOffset(b);A.popup(H.x,H.y+b.offsetHeight,null,p);this.setCurrentMenu(A,b)}mxEvent.consume(p)});mxEvent.addListener(b,"mousemove",mxUtils.bind(this,function(p){if(this.menus.autoPopup&&null!=this.currentMenu&&this.currentMenuElt!=b&&null!=this.currentMenuElt){var A=this.currentMenuElt;this.hideCurrentMenu();A.parentNode==b.parentNode&&"INPUT"!=b.nodeName&&v(p)}}));mxEvent.addListener(b,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(p){!this.menus.autoPopup&&null!=-this.currentMenu&&this.currentMenuElt!=b&&mxEvent.isMouseEvent(p)&&this.hideCurrentMenu();m=null==this.currentMenu;"INPUT"!=mxEvent.getSource(p).nodeName?p.preventDefault():p.stopPropagation()}));mxEvent.addListener(b,"click",mxUtils.bind(this,function(p){v(p);m=!0}))}};+EditorUi.prototype.addMenuHandler=function(b,e,g){if(null!=e){var m=!0,v=mxUtils.bind(this,function(n){null!=g&&g(n);if(!mxEvent.isConsumed(n)&&m&&(null==b.enabled||b.enabled)){this.editor.graph.popupMenuHandler.hideMenu();var A=new mxPopupMenu(e);A.smartSeparators=!0;A.showDisabled=!0;A.autoExpand=!0;A.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(A,arguments);this.resetCurrentMenu();A.destroy()});this.menus.autoPopup||null==this.currentMenu||this.hideCurrentMenu();var G=+mxUtils.getOffset(b);A.popup(G.x,G.y+b.offsetHeight,null,n);this.setCurrentMenu(A,b)}mxEvent.consume(n)});mxEvent.addListener(b,"mousemove",mxUtils.bind(this,function(n){if(this.menus.autoPopup&&null!=this.currentMenu&&this.currentMenuElt!=b&&null!=this.currentMenuElt){var A=this.currentMenuElt;this.hideCurrentMenu();A.parentNode==b.parentNode&&"INPUT"!=b.nodeName&&v(n)}}));mxEvent.addListener(b,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(n){!this.menus.autoPopup&&null!=+this.currentMenu&&this.currentMenuElt!=b&&mxEvent.isMouseEvent(n)&&this.hideCurrentMenu();m=null==this.currentMenu;"INPUT"!=mxEvent.getSource(n).nodeName?n.preventDefault():n.stopPropagation()}));mxEvent.addListener(b,"click",mxUtils.bind(this,function(n){v(n);m=!0}))}};EditorUi.prototype.createZoomInput=function(b){var e=document.createElement("input");e.className="geButton geZoomInput";e.style.backgroundImage="url("+Editor.thinExpandImage+")";e.setAttribute("type","text");e.setAttribute("value","100%");var g=this.menus.get("viewZoom");this.dependsOnLanguage(mxUtils.bind(this,function(){e.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)")}));b&&e.setAttribute("readonly","true");var m=!1;mxEvent.addGestureListeners(e,mxUtils.bind(this,function(v){m=!1;mxClient.IS_TOUCH||mxEvent.getSource(v)!=e||document.activeElement==e||(e.focus(),mxClient.IS_GC||mxClient.IS_FF?e.select():document.execCommand("selectAll",!1,null),m=!0)}),mxUtils.bind(this,function(v){mxEvent.getSource(v)==e&&m&&mxEvent.consume(v)}),mxUtils.bind(this,function(v){m&&(mxEvent.consume(v),m=!1)}));this.addMenuHandler(e,g.funct);mxUtils.bind(this,function(v){mxEvent.addListener(v,"click",mxUtils.bind(this,function(A){mxEvent.isAltDown(A)?(this.hideCurrentMenu(),this.actions.get("customZoom").funct(),-mxEvent.consume(A)):mxEvent.isShiftDown(A)&&(this.hideCurrentMenu(),this.actions.get("smartFit").funct(),mxEvent.consume(A))}));var p=mxUtils.bind(this,function(A,H,S){e.value=Math.round(100*this.editor.graph.view.scale*(null!=S?S:1))+"%";document.activeElement==e&&this.editor.graph.container.focus()});mxEvent.addListener(e,"keydown",mxUtils.bind(this,function(A){if(27==A.keyCode||13==A.keyCode||9==A.keyCode)27==A.keyCode||isNaN(parseInt(e.value))?p():this.editor.graph.zoomTo(parseInt(e.value)/100),-this.hideCurrentMenu(),mxEvent.consume(A)}));this.editor.graph.view.addListener(mxEvent.EVENT_SCALE,p);this.editor.addListener("resetGraphView",p);this.editor.addListener("pageSelected",p);mxEvent.addListener(e,"blur",p);this.editor.graph.addListener("zoomPreview",mxUtils.bind(this,function(A,H){p(A,H,H.getProperty("factor"))}))})(e);return e};+mxEvent.consume(A)):mxEvent.isShiftDown(A)&&(this.hideCurrentMenu(),this.actions.get("smartFit").funct(),mxEvent.consume(A))}));var n=mxUtils.bind(this,function(A,G,S){e.value=Math.round(100*this.editor.graph.view.scale*(null!=S?S:1))+"%";document.activeElement==e&&this.editor.graph.container.focus()});mxEvent.addListener(e,"keydown",mxUtils.bind(this,function(A){if(27==A.keyCode||13==A.keyCode||9==A.keyCode)27==A.keyCode||isNaN(parseInt(e.value))?n():this.editor.graph.zoomTo(parseInt(e.value)/100),+this.hideCurrentMenu(),mxEvent.consume(A)}));this.editor.graph.view.addListener(mxEvent.EVENT_SCALE,n);this.editor.addListener("resetGraphView",n);this.editor.addListener("pageSelected",n);mxEvent.addListener(e,"blur",n);this.editor.graph.addListener("zoomPreview",mxUtils.bind(this,function(A,G){n(A,G,G.getProperty("factor"))}))})(e);return e};EditorUi.prototype.createHelpIcon=function(b,e){e=document.createElement("img");e.setAttribute("src",Editor.helpImage);e.setAttribute("title",mxResources.get("help"));e.className="geHelpIcon";mxEvent.addGestureListeners(e,mxUtils.bind(this,function(g){this.hideCurrentMenu();this.openLink(b);mxEvent.consume(g)}));return e};EditorUi.prototype.destroy=function(){var b=this.editor.graph;null!=b&&null!=this.selectionStateListener&&(b.getSelectionModel().removeListener(this.selectionStateListener),b.getModel().removeListener(this.selectionStateListener),b.getView().removeListener(this.selectionStateListener),b.removeListener(this.selectionStateListener),this.selectionStateListener=null);null!=this.editor&&(this.editor.destroy(),this.editor=null);null!=this.menubar&&(this.menubar.destroy(),this.menubar=null);null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null);null!=this.sidebar&&(this.sidebar.destroy(),this.sidebar=null);null!=this.keyHandler&&(this.keyHandler.destroy(),this.keyHandler=null);null!=this.keydownHandler&&(mxEvent.removeListener(document,"keydown",this.keydownHandler),this.keydownHandler=null);null!=this.keyupHandler&&(mxEvent.removeListener(document,"keyup",this.keyupHandler),this.keyupHandler=null);null!=this.resizeHandler&&(mxEvent.removeListener(window,"resize",this.resizeHandler),this.resizeHandler=null);null!=this.gestureHandler&&(mxEvent.removeGestureListeners(document,this.gestureHandler),this.gestureHandler=null);null!=this.orientationChangeHandler&&(mxEvent.removeListener(window,"orientationchange",this.orientationChangeHandler),this.orientationChangeHandler=null);null!=this.scrollHandler&&(mxEvent.removeListener(window,"scroll",this.scrollHandler),this.scrollHandler=null);if(null!=this.destroyFunctions){for(b=0;b<this.destroyFunctions.length;b++)this.destroyFunctions[b]();this.destroyFunctions=-null}var e=[this.menubarContainer,this.toolbarContainer,this.sidebarContainer,this.formatContainer,this.diagramContainer,this.hsplit,this.chromelessToolbar,this.layersDialog];for(b=0;b<e.length;b++)null!=e[b]&&null!=e[b].parentNode&&e[b].parentNode.removeChild(e[b])};(function(){var b=[["nbsp","160"],["shy","173"]],e=mxUtils.parseXml;mxUtils.parseXml=function(m){for(var v=0;v<b.length;v++)m=m.replace(new RegExp("&"+b[v][0]+";","g"),"&#"+b[v][1]+";");return e(m)};var g=mxUtils.getSizeForString;mxUtils.getSizeForString=function(m,v,p,A){return g(Graph.sanitizeHtml(m),v,p,A)}})();+null}var e=[this.menubarContainer,this.toolbarContainer,this.sidebarContainer,this.formatContainer,this.diagramContainer,this.hsplit,this.chromelessToolbar,this.layersDialog];for(b=0;b<e.length;b++)null!=e[b]&&null!=e[b].parentNode&&e[b].parentNode.removeChild(e[b])};(function(){var b=[["nbsp","160"],["shy","173"]],e=mxUtils.parseXml;mxUtils.parseXml=function(m){for(var v=0;v<b.length;v++)m=m.replace(new RegExp("&"+b[v][0]+";","g"),"&#"+b[v][1]+";");return e(m)};var g=mxUtils.getSizeForString;mxUtils.getSizeForString=function(m,v,n,A){return g(Graph.sanitizeHtml(m),v,n,A)}})();Date.prototype.toISOString||function(){function b(e){e=String(e);1===e.length&&(e="0"+e);return e}Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+b(this.getUTCMonth()+1)+"-"+b(this.getUTCDate())+"T"+b(this.getUTCHours())+":"+b(this.getUTCMinutes())+":"+b(this.getUTCSeconds())+"."+String((this.getUTCMilliseconds()/1E3).toFixed(3)).slice(2,5)+"Z"}}();Date.now||(Date.now=function(){return(new Date).getTime()});-Uint8Array.from||(Uint8Array.from=function(){var b=Object.prototype.toString,e=function(m){return"function"===typeof m||"[object Function]"===b.call(m)},g=Math.pow(2,53)-1;return function(m){var v=Object(m);if(null==m)throw new TypeError("Array.from requires an array-like object - not null or undefined");var p=1<arguments.length?arguments[1]:void 0,A;if("undefined"!==typeof p){if(!e(p))throw new TypeError("Array.from: when provided, the second argument must be a function");2<arguments.length&&(A=-arguments[2])}var H=Number(v.length);H=isNaN(H)?0:0!==H&&isFinite(H)?(0<H?1:-1)*Math.floor(Math.abs(H)):H;H=Math.min(Math.max(H,0),g);for(var S=e(this)?Object(new this(H)):Array(H),F=0,K;F<H;)K=v[F],S[F]=p?"undefined"===typeof A?p(K,F):p.call(A,K,F):K,F+=1;S.length=H;return S}}());mxConstants.SHADOW_OPACITY=.25;mxConstants.SHADOWCOLOR="#000000";mxConstants.VML_SHADOWCOLOR="#d0d0d0";mxCodec.allowlist="mxStylesheet Array mxGraphModel mxCell mxGeometry mxRectangle mxPoint mxChildChange mxRootChange mxTerminalChange mxValueChange mxStyleChange mxGeometryChange mxCollapseChange mxVisibleChange mxCellAttributeChange".split(" ");+Uint8Array.from||(Uint8Array.from=function(){var b=Object.prototype.toString,e=function(m){return"function"===typeof m||"[object Function]"===b.call(m)},g=Math.pow(2,53)-1;return function(m){var v=Object(m);if(null==m)throw new TypeError("Array.from requires an array-like object - not null or undefined");var n=1<arguments.length?arguments[1]:void 0,A;if("undefined"!==typeof n){if(!e(n))throw new TypeError("Array.from: when provided, the second argument must be a function");2<arguments.length&&(A=+arguments[2])}var G=Number(v.length);G=isNaN(G)?0:0!==G&&isFinite(G)?(0<G?1:-1)*Math.floor(Math.abs(G)):G;G=Math.min(Math.max(G,0),g);for(var S=e(this)?Object(new this(G)):Array(G),F=0,K;F<G;)K=v[F],S[F]=n?"undefined"===typeof A?n(K,F):n.call(A,K,F):K,F+=1;S.length=G;return S}}());mxConstants.SHADOW_OPACITY=.25;mxConstants.SHADOWCOLOR="#000000";mxConstants.VML_SHADOWCOLOR="#d0d0d0";mxCodec.allowlist="mxStylesheet Array mxGraphModel mxCell mxGeometry mxRectangle mxPoint mxChildChange mxRootChange mxTerminalChange mxValueChange mxStyleChange mxGeometryChange mxCollapseChange mxVisibleChange mxCellAttributeChange".split(" ");mxGraph.prototype.pageBreakColor="#c0c0c0";mxGraph.prototype.pageScale=1;(function(){try{if(null!=navigator&&null!=navigator.language){var b=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===b||"en-ca"===b||"es-mx"===b?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(e){}})();mxText.prototype.baseSpacingTop=5;mxText.prototype.baseSpacingBottom=1;mxGraphModel.prototype.ignoreRelativeEdgeParent=!1;mxGraphView.prototype.gridImage="data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=";mxGraphView.prototype.gridSteps=4;mxGraphView.prototype.minGridSize=4;mxGraphView.prototype.defaultGridColor="#d0d0d0";mxGraphView.prototype.defaultDarkGridColor="#424242";mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultGridColor;mxGraphView.prototype.unit=mxConstants.POINTS;mxGraphView.prototype.setUnit=function(b){this.unit!=b&&(this.unit=b,this.graph.refresh(),this.fireEvent(new mxEventObject("unitChanged","unit",b)))};mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]";mxShape.prototype.getConstraints=function(b,e,g){return null};mxImageShape.prototype.getImageDataUri=function(){var b=String(this.image);if("data:image/svg+xml;base64,"==b.substring(0,26)&&null!=this.style&&"1"==mxUtils.getValue(this.style,"clipSvg","0")){if(null==this.clippedSvg||this.clippedImage!=b)this.clippedSvg=Graph.clipSvgDataUri(b),this.clippedImage=b;b=this.clippedSvg}return b};-(function(){var b=mxStencil.prototype.parseColor;mxStencil.prototype.parseColor=function(e,g,m,v,p){return"default"==v&&null!=p?"fillcolor"==m.nodeName?p.shapeBackgroundColor:p.shapeForegroundColor:b.apply(this,arguments)}})();(function(){var b=mxResources.get;mxResources.get=function(e,g,m){null==m&&(m=e);return b.apply(this,[e,g,m])}})();-(function(){var b=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(e,g,m,v,p,A,H,S){var F=b.apply(this,arguments);if(null!=g){var K=F.getElementsByTagName("img");0<K.length&&(K[0].className="geButton")}return F}})();-Graph=function(b,e,g,m,v,p){mxGraph.call(this,b,e,g,m);this.themes=v||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);this.standalone=null!=p?p:!1;b=this.baseUrl;e=b.indexOf("//");this.domainPathUrl=this.domainUrl="";0<e&&(e=b.indexOf("/",e+2),0<e&&(this.domainUrl=b.substring(0,e)),e=b.lastIndexOf("/"),0<e&&(this.domainPathUrl=b.substring(0,e+1)));this.isHtmlLabel=function(Q){Q=this.getCurrentCellStyle(Q);-return null!=Q?"1"==Q.html||"wrap"==Q[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.immediateHandling){var A=null,H=null,S=null,F=null,K=!1,c=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(Q,k){if("mouseDown"==k.getProperty("eventName")&&this.isEnabled()){Q=k.getProperty("event");var B=Q.getState();k=this.view.scale;if(!mxEvent.isAltDown(Q.getEvent())&&null!=B&&(c=this.isCellSelected(B.cell),!this.panningHandler.isActive()&&!mxEvent.isControlDown(Q.getEvent()))){var I=this.selectionCellsHandler.getHandler(B.cell);+(function(){var b=mxStencil.prototype.parseColor;mxStencil.prototype.parseColor=function(e,g,m,v,n){return"default"==v&&null!=n?"fillcolor"==m.nodeName?n.shapeBackgroundColor:n.shapeForegroundColor:b.apply(this,arguments)}})();(function(){var b=mxResources.get;mxResources.get=function(e,g,m){null==m&&(m=e);return b.apply(this,[e,g,m])}})();+(function(){var b=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(e,g,m,v,n,A,G,S){var F=b.apply(this,arguments);if(null!=g){var K=F.getElementsByTagName("img");0<K.length&&(K[0].className="geButton")}return F}})();+Graph=function(b,e,g,m,v,n){mxGraph.call(this,b,e,g,m);this.themes=v||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);this.standalone=null!=n?n:!1;b=this.baseUrl;e=b.indexOf("//");this.domainPathUrl=this.domainUrl="";0<e&&(e=b.indexOf("/",e+2),0<e&&(this.domainUrl=b.substring(0,e)),e=b.lastIndexOf("/"),0<e&&(this.domainPathUrl=b.substring(0,e+1)));this.isHtmlLabel=function(Q){Q=this.getCurrentCellStyle(Q);+return null!=Q?"1"==Q.html||"wrap"==Q[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.immediateHandling){var A=null,G=null,S=null,F=null,K=!1,c=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(Q,k){if("mouseDown"==k.getProperty("eventName")&&this.isEnabled()){Q=k.getProperty("event");var B=Q.getState();k=this.view.scale;if(!mxEvent.isAltDown(Q.getEvent())&&null!=B&&(c=this.isCellSelected(B.cell),!this.panningHandler.isActive()&&!mxEvent.isControlDown(Q.getEvent()))){var I=this.selectionCellsHandler.getHandler(B.cell);if(null==I||null==I.getHandleForEvent(Q)){var U=new mxRectangle(Q.getGraphX()-1,Q.getGraphY()-1),P=mxEvent.isTouchEvent(Q.getEvent())?mxShape.prototype.svgStrokeTolerance-1:(mxShape.prototype.svgStrokeTolerance+2)/2;I=P+2;U.grow(P);if(this.isTableCell(B.cell)&&this.isCellMovable(B.cell)&&!this.isCellSelected(B.cell)&&!(mxUtils.contains(B,Q.getGraphX()-I,Q.getGraphY()-I)&&mxUtils.contains(B,Q.getGraphX()-I,Q.getGraphY()+I)&&mxUtils.contains(B,Q.getGraphX()+I,Q.getGraphY()+I)&&mxUtils.contains(B,Q.getGraphX()+I,Q.getGraphY()-I))){var T=this.model.getParent(B.cell);I=this.model.getParent(T);if(!this.isCellSelected(I)){P*=k;var X=2*P;if(this.model.getChildAt(I,0)!=T&&mxUtils.intersects(U,new mxRectangle(B.x,B.y-P,B.width,X))||this.model.getChildAt(T,0)!=B.cell&&mxUtils.intersects(U,new mxRectangle(B.x-P,B.y,X,B.height))||mxUtils.intersects(U,new mxRectangle(B.x,B.y+B.height-P,B.width,X))||mxUtils.intersects(U,new mxRectangle(B.x+B.width-P,B.y,X,B.height)))T=this.selectionCellsHandler.isHandled(I),this.selectCellForEvent(I,Q.getEvent()),I=this.selectionCellsHandler.getHandler(I),null!=I&&(P=I.getHandleForEvent(Q),null!=P&&(I.start(Q.getGraphX(),Q.getGraphY(),P),I.blockDelayedSelection=!T,Q.consume()))}}for(;!Q.isConsumed()&&null!=B&&(this.isTableCell(B.cell)||this.isTableRow(B.cell)||this.isTable(B.cell));)this.isSwimlane(B.cell)&&this.isCellMovable(B.cell)&&(I=this.getActualStartSize(B.cell),(0<I.x||0<I.width)&&mxUtils.intersects(U,new mxRectangle(B.x+(I.x-I.width-1)*k+(0==I.x?B.width:0),B.y,1,B.height))||(0<I.y||0<I.height)&&mxUtils.intersects(U,new mxRectangle(B.x,B.y+(I.y-I.height-1)*k+(0==I.y?B.height:0),B.width,1)))&&(this.selectCellForEvent(B.cell,Q.getEvent()),I=this.selectionCellsHandler.getHandler(B.cell),null!=I&&null!=I.customHandles&&(P=mxEvent.CUSTOM_HANDLE-I.customHandles.length+1,I.start(Q.getGraphX(),Q.getGraphY(),P),Q.consume())),B=this.view.getState(this.model.getParent(B.cell))}}}}));this.addListener(mxEvent.CONSUME_MOUSE_EVENT,mxUtils.bind(this,function(Q,k){if("mouseDown"==k.getProperty("eventName")&&-this.isEnabled()){Q=k.getProperty("event");var B=Q.getState();mxEvent.isAltDown(Q.getEvent())||mxEvent.isControlDown(k)||mxEvent.isShiftDown(k)||c||null==B||!this.model.isEdge(B.cell)||(A=new mxPoint(Q.getGraphX(),Q.getGraphY()),K=this.isCellSelected(B.cell),S=B,H=Q,null!=B.text&&null!=B.text.boundingBox&&mxUtils.contains(B.text.boundingBox,Q.getGraphX(),Q.getGraphY())?F=mxEvent.LABEL_HANDLE:(k=this.selectionCellsHandler.getHandler(B.cell),null!=k&&null!=k.bends&&0<k.bends.length&&(F=k.getHandleForEvent(Q))))}}));-this.addMouseListener({mouseDown:function(Q,k){},mouseMove:mxUtils.bind(this,function(Q,k){Q=this.selectionCellsHandler.handlers.map;for(var B in Q)if(null!=Q[B].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isAltDown(k.getEvent())){var I=this.tolerance;if(null!=A&&null!=S&&null!=H){if(B=S,null!=F||Math.abs(A.x-k.getGraphX())>I||Math.abs(A.y-k.getGraphY())>I){var U=null;mxEvent.isShiftDown(k.getEvent())||(U=this.selectionCellsHandler.getHandler(B.cell));if(null!=U&&null!=-U.bends&&0<U.bends.length){U.redrawHandles();var P=null!=F?F:U.getHandleForEvent(H),T=this.view.getEdgeStyle(B),X=T==mxEdgeStyle.EntityRelation;I=B.absolutePoints;K||(P=F);P!=mxEvent.LABEL_HANDLE&&null!=I&&(P=F,null==P&&(Q=new mxRectangle(A.x,A.y),Q.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(Q,I[0].x,I[0].y)?P=0:mxUtils.contains(Q,I[I.length-1].x,I[I.length-1].y)?P=U.bends.length-1:null!=I&&(null==T&&null==P||T==mxEdgeStyle.SegmentConnector||T==mxEdgeStyle.OrthConnector)&&+this.isEnabled()){Q=k.getProperty("event");var B=Q.getState();mxEvent.isAltDown(Q.getEvent())||mxEvent.isControlDown(k)||mxEvent.isShiftDown(k)||c||null==B||!this.model.isEdge(B.cell)||(A=new mxPoint(Q.getGraphX(),Q.getGraphY()),K=this.isCellSelected(B.cell),S=B,G=Q,null!=B.text&&null!=B.text.boundingBox&&mxUtils.contains(B.text.boundingBox,Q.getGraphX(),Q.getGraphY())?F=mxEvent.LABEL_HANDLE:(k=this.selectionCellsHandler.getHandler(B.cell),null!=k&&null!=k.bends&&0<k.bends.length&&(F=k.getHandleForEvent(Q))))}}));+this.addMouseListener({mouseDown:function(Q,k){},mouseMove:mxUtils.bind(this,function(Q,k){Q=this.selectionCellsHandler.handlers.map;for(var B in Q)if(null!=Q[B].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isAltDown(k.getEvent())){var I=this.tolerance;if(null!=A&&null!=S&&null!=G){if(B=S,null!=F||Math.abs(A.x-k.getGraphX())>I||Math.abs(A.y-k.getGraphY())>I){var U=null;mxEvent.isShiftDown(k.getEvent())||(U=this.selectionCellsHandler.getHandler(B.cell));if(null!=U&&null!=+U.bends&&0<U.bends.length){U.redrawHandles();var P=null!=F?F:U.getHandleForEvent(G),T=this.view.getEdgeStyle(B),X=T==mxEdgeStyle.EntityRelation;I=B.absolutePoints;K||(P=F);P!=mxEvent.LABEL_HANDLE&&null!=I&&(P=F,null==P&&(Q=new mxRectangle(A.x,A.y),Q.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(Q,I[0].x,I[0].y)?P=0:mxUtils.contains(Q,I[I.length-1].x,I[I.length-1].y)?P=U.bends.length-1:null!=I&&(null==T&&null==P||T==mxEdgeStyle.SegmentConnector||T==mxEdgeStyle.OrthConnector)&&(null!=T&&(2==I.length||3==I.length&&(0==Math.round(I[0].x-I[1].x)&&0==Math.round(I[1].x-I[2].x)||0==Math.round(I[0].y-I[1].y)&&0==Math.round(I[1].y-I[2].y)))?P=2:(P=mxUtils.findNearestSegment(B,A.x,A.y),P=null==T?mxEvent.VIRTUAL_HANDLE-P:P+1))),null==P&&(P=mxEvent.VIRTUAL_HANDLE));Q=P==mxEvent.LABEL_HANDLE||0==P||P==U.bends.length-1;if(!X&&(null!=B.visibleSourceState||null!=B.visibleTargetState)||Q)U.start(k.getGraphX(),k.getGraphX(),P),k.consume(),this.graphHandler.reset()}null!=U&&(this.selectionCellsHandler.isHandlerActive(U)?-this.isCellSelected(B.cell)||(this.selectionCellsHandler.handlers.put(B.cell,U),this.selectCellForEvent(B.cell,k.getEvent())):this.isCellSelected(B.cell)||U.destroy());K=!1;A=H=S=F=null}}else if(B=k.getState(),null!=B&&this.isCellEditable(B.cell)){Q=this.model.getParent(B.cell);U=null;if(this.model.isEdge(B.cell)&&!this.isCellSelected(B.cell)&&!mxEvent.isAltDown(k.getEvent())&&!mxEvent.isShiftDown(k.getEvent())&&!this.isAncestorSelected(B.cell)&&(this.isSwimlane(Q)||this.model.isLayer(Q)||this.getCurrentRoot()==+this.isCellSelected(B.cell)||(this.selectionCellsHandler.handlers.put(B.cell,U),this.selectCellForEvent(B.cell,k.getEvent())):this.isCellSelected(B.cell)||U.destroy());K=!1;A=G=S=F=null}}else if(B=k.getState(),null!=B&&this.isCellEditable(B.cell)){Q=this.model.getParent(B.cell);U=null;if(this.model.isEdge(B.cell)&&!this.isCellSelected(B.cell)&&!mxEvent.isAltDown(k.getEvent())&&!mxEvent.isShiftDown(k.getEvent())&&!this.isAncestorSelected(B.cell)&&(this.isSwimlane(Q)||this.model.isLayer(Q)||this.getCurrentRoot()==Q)){if(Q=new mxRectangle(k.getGraphX(),k.getGraphY()),Q.grow(mxEdgeHandler.prototype.handleImage.width/2),I=B.absolutePoints,null!=I)null!=B.text&&null!=B.text.boundingBox&&mxUtils.contains(B.text.boundingBox,k.getGraphX(),k.getGraphY())?U="move":mxUtils.contains(Q,I[0].x,I[0].y)||mxUtils.contains(Q,I[I.length-1].x,I[I.length-1].y)?U="pointer":(T=this.view.getEdgeStyle(B),T==mxEdgeStyle.EntityRelation||null==B.visibleSourceState&&null==B.visibleTargetState||(U="crosshair",T!=mxEdgeStyle.SegmentConnector&&T!=mxEdgeStyle.OrthConnector))||(k=mxUtils.findNearestSegment(B,k.getGraphX(),k.getGraphY()),k<I.length-1&&0<=k&&(U=0==Math.round(I[k].x-I[k+1].x)?"col-resize":"row-resize"))}else if(!mxEvent.isControlDown(k.getEvent())){I=mxShape.prototype.svgStrokeTolerance/2;Q=new mxRectangle(k.getGraphX(),k.getGraphY());Q.grow(I);if(this.isTableCell(B.cell)&&this.isCellMovable(B.cell)&&(k=this.model.getParent(B.cell),I=this.model.getParent(k),!this.isCellSelected(I)))if(mxUtils.intersects(Q,new mxRectangle(B.x,B.y-2,B.width,4))&&this.model.getChildAt(I,0)!=k||mxUtils.intersects(Q,new mxRectangle(B.x,B.y+B.height-2,B.width,4)))U="row-resize";else if(mxUtils.intersects(Q,new mxRectangle(B.x-2,B.y,4,B.height))&&this.model.getChildAt(k,0)!=B.cell||mxUtils.intersects(Q,new mxRectangle(B.x+B.width-2,B.y,4,B.height)))U="col-resize";for(k=B;null==U&&null!=k&&(this.isTableCell(k.cell)||this.isTableRow(k.cell)||this.isTable(k.cell));)this.isSwimlane(k.cell)&&this.isCellMovable(k.cell)&&(I=this.getActualStartSize(k.cell),-P=this.view.scale,(0<I.x||0<I.width)&&mxUtils.intersects(Q,new mxRectangle(k.x+(I.x-I.width-1)*P+(0==I.x?k.width*P:0),k.y,1,k.height))?U="col-resize":(0<I.y||0<I.height)&&mxUtils.intersects(Q,new mxRectangle(k.x,k.y+(I.y-I.height-1)*P+(0==I.y?k.height:0),k.width,1))&&(U="row-resize")),k=this.view.getState(this.model.getParent(k.cell))}null!=U&&B.setCursor(U)}}}),mouseUp:mxUtils.bind(this,function(Q,k){F=A=H=S=null})})}this.cellRenderer.minSvgStrokeWidth=.1;var f=document.createElement("div");this.cellRenderer.getLabelValue=+P=this.view.scale,(0<I.x||0<I.width)&&mxUtils.intersects(Q,new mxRectangle(k.x+(I.x-I.width-1)*P+(0==I.x?k.width*P:0),k.y,1,k.height))?U="col-resize":(0<I.y||0<I.height)&&mxUtils.intersects(Q,new mxRectangle(k.x,k.y+(I.y-I.height-1)*P+(0==I.y?k.height:0),k.width,1))&&(U="row-resize")),k=this.view.getState(this.model.getParent(k.cell))}null!=U&&B.setCursor(U)}}}),mouseUp:mxUtils.bind(this,function(Q,k){F=A=G=S=null})})}this.cellRenderer.minSvgStrokeWidth=.1;var f=document.createElement("div");this.cellRenderer.getLabelValue=function(Q){var k=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);Q.view.graph.isHtmlLabel(Q.cell)&&("0"==mxUtils.getValue(Q.style,"html","0")?k=mxUtils.htmlEntities(k,!1):(Q.lastLabelValue!=k&&(Q.lastLabelValue=k,Q.lastSanitizedLabelValue=Graph.sanitizeHtml(k),f.innerHTML=Q.lastSanitizedLabelValue,Graph.addLightDarkColors(f,null,"simple"==Q.view.graph.getAdaptiveColors())&&(Q.lastSanitizedLabelValue=f.innerHTML)),k=Q.lastSanitizedLabelValue));return k};if("undefined"!==typeof mxVertexHandler){this.setConnectable(!0);this.setDropEnabled(!0);this.setPanning(!0);this.setTooltips(!0);this.setAllowLoops(!0);this.allowAutoPanning=!0;this.constrainChildren=this.resetEdgesOnConnect=!1;this.constrainRelativeChildren=!0;this.graphHandler.scrollOnMove=!1;this.graphHandler.scaleGrid=!0;this.connectionHandler.setCreateTarget(!1);this.connectionHandler.insertBeforeSource=!0;this.connectionHandler.isValidSource=function(Q,k){return!1};this.alternateEdgeStyle="vertical";null==m&&this.loadStylesheet();var l=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates=function(){var Q=l.apply(this,arguments);if(this.graph.pageVisible){var k=[],B=this.graph.pageFormat,I=this.graph.pageScale,U=B.width*I;B=B.height*I;I=this.graph.view.translate;for(var P=this.graph.view.scale,T=this.graph.getPageLayout(),X=0;X<T.width;X++)k.push(new mxRectangle(((T.x+X)*U+I.x)*P,(T.y*B+I.y)*P,U*P,B*P));for(X=1;X<T.height;X++)k.push(new mxRectangle((T.x*U+I.x)*P,((T.y+X)*B+I.y)*P,U*P,B*P));Q=k.concat(Q)}return Q};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor=function(Q,k){return null==Q.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(Q){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};var t=this.graphHandler.getCells;this.graphHandler.getCells=function(Q){for(var k=t.apply(this,arguments),B=new mxDictionary,I=[],U=0;U<k.length;U++){var P=this.graph.isTableCell(Q)&&this.graph.isTableCell(k[U])&&this.graph.isCellSelected(k[U])?this.graph.model.getParent(k[U]):this.graph.isTableRow(Q)&&this.graph.isTableRow(k[U])&&this.graph.isCellSelected(k[U])?k[U]:this.graph.getCompositeParent(k[U]);null==P||B.get(P)||(B.put(P,!0),I.push(P))}return I};var q=this.graphHandler.start;this.graphHandler.start=function(Q,k,B,I){var U=!1;this.graph.isTableCell(Q)&&(this.graph.isCellSelected(Q)?U=!0:Q=this.graph.model.getParent(Q));U||this.graph.isTableRow(Q)&&this.graph.isCellSelected(Q)||(Q=this.graph.getCompositeParent(Q));q.apply(this,arguments)};this.connectionHandler.createTargetVertex=function(Q,k){k=this.graph.getCompositeParent(k);return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};this.connectionHandler.insertEdge=function(Q,k,B,I,U,P){var T=mxConnectionHandler.prototype.insertEdge.apply(this,arguments);null!=I&&this.graph.applyNewEdgeStyle(I,[T]);return T};var D=new mxRubberband(this);this.getRubberband=function(){return D};-var G=(new Date).getTime(),N=0,L=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var Q=this.currentState;L.apply(this,arguments);Q!=this.currentState?(G=(new Date).getTime(),N=0):N=(new Date).getTime()-G};var J=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(Q){return mxEvent.isShiftDown(Q.getEvent())&&mxEvent.isAltDown(Q.getEvent())?!1:null!=this.currentState&&Q.getState()==this.currentState&&2E3<N||(null==this.currentState||+var H=(new Date).getTime(),N=0,L=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var Q=this.currentState;L.apply(this,arguments);Q!=this.currentState?(H=(new Date).getTime(),N=0):N=(new Date).getTime()-H};var J=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(Q){return mxEvent.isShiftDown(Q.getEvent())&&mxEvent.isAltDown(Q.getEvent())?!1:null!=this.currentState&&Q.getState()==this.currentState&&2E3<N||(null==this.currentState||"0"!=mxUtils.getValue(this.currentState.style,"outlineConnect","1"))&&J.apply(this,arguments)};var Y=this.isToggleEvent;this.isToggleEvent=function(Q){return Y.apply(this,arguments)||!mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(Q)};var ha=D.isForceRubberbandEvent;D.isForceRubberbandEvent=function(Q){return ha.apply(this,arguments)||mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(Q.getEvent())||mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==Q.getState()&&mxEvent.isTouchEvent(Q.getEvent())};var ea=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&(ea=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&(this.container.style.cursor=ea)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(Q){return mxEvent.isMouseEvent(Q.getEvent())};var aa=this.click;this.click=function(Q){var k=null==Q.state&&null!=Q.sourceState&&this.isCellLocked(this.getLayerForCell(Q.sourceState.cell));if(this.isEnabled()&&!k||Q.isConsumed())return aa.apply(this,arguments);var B=k?Q.sourceState.cell:Q.getCell();if(null!=B){var I=this.getClickableLinkForCell(B);null!=I?this.isCustomLink(I)?this.customLinkClicked(I,B):this.openLink(I):k&&this.clearSelection()}};this.tooltipHandler.getStateForEvent=function(Q){return Q.sourceState};var na=this.tooltipHandler.show;this.tooltipHandler.show=function(){na.apply(this,arguments);@@ -2304,75 +2308,75 @@ Graph.getDefaultAdaptiveColorsKey=function(){return"auto"==Graph.defaultAdaptiveGraph.createOffscreenGraph=function(b){var e=new Graph(document.createElement("div"));e.stylesheet.styles=mxUtils.clone(b.styles);e.resetViewOnRootChange=!1;e.setConnectable(!1);e.gridEnabled=!1;e.autoScroll=!1;e.setTooltips(!1);e.setEnabled(!1);e.container.style.visibility="hidden";e.container.style.position="absolute";e.container.style.overflow="hidden";e.container.style.height="1px";e.container.style.width="1px";return e};Graph.createSvgImage=function(b,e,g,m,v){g=unescape(encodeURIComponent(Graph.svgDoctype+'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+b+'px" height="'+e+'px" '+(null!=m&&null!=v?'viewBox="0 0 '+m+" "+v+'" ':"")+'version="1.1" style="color-scheme: light dark;">'+g+"</svg>"));return new mxImage("data:image/svg+xml;base64,"+(window.btoa?btoa(g):Base64.encode(g,!0)),b,e)};Graph.getSvgFromDataUri=function(b){return null!=b&&"data:image/svg"==b.substring(0,14)?Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+decodeURIComponent(escape(atob(b.substring(b.indexOf(",")+1)))):null};-Graph.createSvgNode=function(b,e,g,m,v){var p=mxUtils.createXmlDocument(),A=null!=p.createElementNS?p.createElementNS(mxConstants.NS_SVG,"svg"):p.createElement("svg");null!=v&&A.setAttribute("style","background: "+v.light+"; background-color: "+v.cssText+";");null==p.createElementNS?(A.setAttribute("xmlns",mxConstants.NS_SVG),A.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):A.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);A.setAttribute("version","1.1");A.setAttribute("width",-g+"px");A.setAttribute("height",m+"px");A.setAttribute("viewBox",b+" "+e+" "+g+" "+m);p.appendChild(A);return A};-Graph.htmlToPng=function(b,e,g,m,v,p){v=null!=v?v:"";p=null!=p?p:Editor.htmlRasterScale;var A=document.createElement("canvas");A.width=e*p;A.height=g*p;var H=document.createElement("img");H.onload=mxUtils.bind(this,function(){try{var F=A.getContext("2d");F.scale(p,p);F.drawImage(H,0,0);m(A.toDataURL())}catch(K){m(null)}});var S=mxUtils.createXmlDocument();S=null!=S.createElementNS?S.createElementNS(mxConstants.NS_SVG,"svg"):S.createElement("svg");b=(new mxSvgCanvas2D(S)).convertHtml(b);H.onerror=-function(F){m(null)};H.src="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'+e+'" height="'+g+'">'+(""!=v?'<defs xmlns="http://www.w3.org/2000/svg"><style type="text/css">'+v+"</style></defs>":"")+'<foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml">'+b+"</div></foreignObject></svg>")};-Graph.addLightDarkColors=function(b,e,g,m){function v(f,l,t){return null!=m?m(f,l,t):mxUtils.isValidColor(t)?(null==A&&null!=e&&(A={}),null!=A&&(A[l]=f.style.getPropertyValue(l)),t=mxUtils.getLightDarkColor(t,null,null,g),f.style.setProperty(l,t.cssText),!0):!1}for(var p=b.getElementsByTagName("*"),A=null,H=!1,S=0;S<p.length;S++)if(p[S]!=b&&null!=p[S].style){A=null;for(var F=0;F<p[S].style.length;F++){var K=p[S].style.item(F),c=p[S].style.getPropertyValue(K);H=v(p[S],K,c)||H}"FONT"==p[S].nodeName&&-""==p[S].style.getPropertyValue("color")&&(c=p[S].getAttribute("color"),H=v(p[S],"color",c)||H);null!=e&&null!=A&&p[S].setAttribute(e,JSON.stringify(A))}return H};Graph.removeLightDarkColors=function(b,e){b=b.getElementsByTagName("*");for(var g=!1,m=0;m<b.length;m++)try{var v=b[m].getAttribute(e);if(null!=v){b[m].removeAttribute(e);var p=JSON.parse(v),A;for(A in p){var H=p[A];""==H?(b[m].style[A]=null,""==b[m].getAttribute("style")&&b[m].removeAttribute("style")):b[m].style[A]=H;g=!0}}}catch(S){}return g};-Graph.getGivenColor=function(b,e){var g=null;if(b.nodeType==mxConstants.NODETYPE_ELEMENT){try{var m=b.getAttribute(Graph.backupStyleAttribute);if(null!=m){var v=JSON.parse(m);null!=v&&null!=v[e]&&("color"==e&&"FONT"==b.nodeName&&""==v[e]&&null!=b.getAttribute("color")?g=b.getAttribute("color"):""!=v[e]&&(g=v[e]))}}catch(p){}null==g&&""!=b.style[e]&&(g=b.style[e])}return g};-Graph.setTextColor=function(b,e,g){for(var m=g?Graph.newColorPlaceholder:Graph.newBackgroundPlaceholder,v=g?"color":"background-color",p=b.getElementsByTagName("*"),A=[],H=0;H<p.length;H++)A.push({node:p[H],value:p[H].style[v]});document.execCommand(g?"forecolor":"backcolor",!1,m);b=b.getElementsByTagName("*");for(H=0;H<b.length;H++){if(H<A.length&&A[H].node==b[H]&&A[H].value!=b[H].style[v]&&""==b[H].style[v])try{if(p=b[H].getAttribute(Graph.backupStyleAttribute),null!=p){var S=JSON.parse(p);S[v]=-"";b[H].setAttribute(Graph.backupStyleAttribute,JSON.stringify(S))}}catch(F){}if(g&&b[H].getAttribute("color")==m||b[H].style[v]==m){g&&b[H].getAttribute("color")==m&&b[H].removeAttribute("color");b[H].style[v]=e!=mxConstants.NONE?mxUtils.getLightDarkColor(e).cssText:null;try{p=b[H].getAttribute(Graph.backupStyleAttribute),S=null!=p?JSON.parse(p):{},S[v]=e!=mxConstants.NONE?e:"",b[H].setAttribute(Graph.backupStyleAttribute,JSON.stringify(S))}catch(F){}if(g&&mxClient.IS_FF){e=b[H];g=e.firstChild;if(null!=+Graph.createSvgNode=function(b,e,g,m,v){var n=mxUtils.createXmlDocument(),A=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"svg"):n.createElement("svg");null!=v&&A.setAttribute("style","background: "+v.light+"; background-color: "+v.cssText+";");null==n.createElementNS?(A.setAttribute("xmlns",mxConstants.NS_SVG),A.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):A.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);A.setAttribute("version","1.1");A.setAttribute("width",+g+"px");A.setAttribute("height",m+"px");A.setAttribute("viewBox",b+" "+e+" "+g+" "+m);n.appendChild(A);return A};+Graph.htmlToPng=function(b,e,g,m,v,n){v=null!=v?v:"";n=null!=n?n:Editor.htmlRasterScale;var A=document.createElement("canvas");A.width=e*n;A.height=g*n;var G=document.createElement("img");G.onload=mxUtils.bind(this,function(){try{var F=A.getContext("2d");F.scale(n,n);F.drawImage(G,0,0);m(A.toDataURL())}catch(K){m(null)}});var S=mxUtils.createXmlDocument();S=null!=S.createElementNS?S.createElementNS(mxConstants.NS_SVG,"svg"):S.createElement("svg");b=(new mxSvgCanvas2D(S)).convertHtml(b);G.onerror=+function(F){m(null)};G.src="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'+e+'" height="'+g+'">'+(""!=v?'<defs xmlns="http://www.w3.org/2000/svg"><style type="text/css">'+v+"</style></defs>":"")+'<foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml">'+b+"</div></foreignObject></svg>")};+Graph.addLightDarkColors=function(b,e,g,m){function v(f,l,t){return null!=m?m(f,l,t):mxUtils.isValidColor(t)?(null==A&&null!=e&&(A={}),null!=A&&(A[l]=f.style.getPropertyValue(l)),t=mxUtils.getLightDarkColor(t,null,null,g),f.style.setProperty(l,t.cssText),!0):!1}for(var n=b.getElementsByTagName("*"),A=null,G=!1,S=0;S<n.length;S++)if(n[S]!=b&&null!=n[S].style){A=null;for(var F=0;F<n[S].style.length;F++){var K=n[S].style.item(F),c=n[S].style.getPropertyValue(K);G=v(n[S],K,c)||G}"FONT"==n[S].nodeName&&+""==n[S].style.getPropertyValue("color")&&(c=n[S].getAttribute("color"),G=v(n[S],"color",c)||G);null!=e&&null!=A&&n[S].setAttribute(e,JSON.stringify(A))}return G};Graph.removeLightDarkColors=function(b,e){b=b.getElementsByTagName("*");for(var g=!1,m=0;m<b.length;m++)try{var v=b[m].getAttribute(e);if(null!=v){b[m].removeAttribute(e);var n=JSON.parse(v),A;for(A in n){var G=n[A];""==G?(b[m].style[A]=null,""==b[m].getAttribute("style")&&b[m].removeAttribute("style")):b[m].style[A]=G;g=!0}}}catch(S){}return g};+Graph.getGivenColor=function(b,e){var g=null;if(b.nodeType==mxConstants.NODETYPE_ELEMENT){try{var m=b.getAttribute(Graph.backupStyleAttribute);if(null!=m){var v=JSON.parse(m);null!=v&&null!=v[e]&&("color"==e&&"FONT"==b.nodeName&&""==v[e]&&null!=b.getAttribute("color")?g=b.getAttribute("color"):""!=v[e]&&(g=v[e]))}}catch(n){}null==g&&""!=b.style[e]&&(g=b.style[e])}return g};+Graph.setTextColor=function(b,e,g){for(var m=g?Graph.newColorPlaceholder:Graph.newBackgroundPlaceholder,v=g?"color":"background-color",n=b.getElementsByTagName("*"),A=[],G=0;G<n.length;G++)A.push({node:n[G],value:n[G].style[v]});document.execCommand(g?"forecolor":"backcolor",!1,m);b=b.getElementsByTagName("*");for(G=0;G<b.length;G++){if(G<A.length&&A[G].node==b[G]&&A[G].value!=b[G].style[v]&&""==b[G].style[v])try{if(n=b[G].getAttribute(Graph.backupStyleAttribute),null!=n){var S=JSON.parse(n);S[v]=+"";b[G].setAttribute(Graph.backupStyleAttribute,JSON.stringify(S))}}catch(F){}if(g&&b[G].getAttribute("color")==m||b[G].style[v]==m){g&&b[G].getAttribute("color")==m&&b[G].removeAttribute("color");b[G].style[v]=e!=mxConstants.NONE?mxUtils.getLightDarkColor(e).cssText:null;try{n=b[G].getAttribute(Graph.backupStyleAttribute),S=null!=n?JSON.parse(n):{},S[v]=e!=mxConstants.NONE?e:"",b[G].setAttribute(Graph.backupStyleAttribute,JSON.stringify(S))}catch(F){}if(g&&mxClient.IS_FF){e=b[G];g=e.firstChild;if(null!=g&&"A"==g.nodeName&&null==g.nextSibling&&null!=g.firstChild){e.parentNode.insertBefore(g,e);for(m=g.firstChild;null!=m;)v=m.nextSibling,e.appendChild(m),m=v;g.appendChild(e)}break}}}};Graph.zapGremlins=function(b){return mxUtils.zapGremlins(b)};Graph.stringToBytes=function(b){for(var e=Array(b.length),g=0;g<b.length;g++)e[g]=b.charCodeAt(g);return e};Graph.bytesToString=function(b){for(var e=Array(b.length),g=0;g<b.length;g++)e[g]=String.fromCharCode(b[g]);return e.join("")};Graph.base64EncodeUnicode=function(b){return btoa(encodeURIComponent(b).replace(/%([0-9A-F]{2})/g,function(e,g){return String.fromCharCode(parseInt(g,16))}))};Graph.base64DecodeUnicode=function(b){return decodeURIComponent(Array.prototype.map.call(atob(b),function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))};Graph.compressNode=function(b,e){b=mxUtils.getXml(b);return Graph.compress(e?b:Graph.zapGremlins(b))};Graph.arrayBufferToString=function(b){var e="";b=new Uint8Array(b);for(var g=b.byteLength,m=0;m<g;m++)e+=String.fromCharCode(b[m]);return e};Graph.stringToArrayBuffer=function(b){return Uint8Array.from(b,function(e){return e.charCodeAt(0)})};-Graph.arrayBufferIndexOfString=function(b,e,g){var m=e.charCodeAt(0),v=1,p=-1;for(g=g||0;g<b.byteLength;g++)if(b[g]==m){p=g;break}for(g=p+1;-1<p&&g<b.byteLength&&g<p+e.length-1;g++){if(b[g]!=e.charCodeAt(v))return Graph.arrayBufferIndexOfString(b,e,p+1);v++}return v==e.length-1?p:-1};Graph.compress=function(b,e){if(null==b||0==b.length||"undefined"===typeof pako)return b;b=e?pako.deflate(encodeURIComponent(b)):pako.deflateRaw(encodeURIComponent(b));return btoa(Graph.arrayBufferToString(new Uint8Array(b)))};+Graph.arrayBufferIndexOfString=function(b,e,g){var m=e.charCodeAt(0),v=1,n=-1;for(g=g||0;g<b.byteLength;g++)if(b[g]==m){n=g;break}for(g=n+1;-1<n&&g<b.byteLength&&g<n+e.length-1;g++){if(b[g]!=e.charCodeAt(v))return Graph.arrayBufferIndexOfString(b,e,n+1);v++}return v==e.length-1?n:-1};Graph.compress=function(b,e){if(null==b||0==b.length||"undefined"===typeof pako)return b;b=e?pako.deflate(encodeURIComponent(b)):pako.deflateRaw(encodeURIComponent(b));return btoa(Graph.arrayBufferToString(new Uint8Array(b)))};Graph.decompress=function(b,e,g){if(null==b||0==b.length||"undefined"===typeof pako)return b;b=Graph.stringToArrayBuffer(atob(b));e=decodeURIComponent(e?pako.inflate(b,{to:"string"}):pako.inflateRaw(b,{to:"string"}));return g?e:Graph.zapGremlins(e)};Graph.fadeNodes=function(b,e,g,m,v){v=null!=v?v:1E3;Graph.setTransitionForNodes(b,null);Graph.setOpacityForNodes(b,e);window.setTimeout(function(){Graph.setTransitionForNodes(b,"all "+v+"ms ease-in-out");Graph.setOpacityForNodes(b,g);window.setTimeout(function(){Graph.setTransitionForNodes(b,null);null!=m&&m()},v)},0)};-Graph.exploreFromCell=function(b,e,g){pageSize=null!=g&&null!=g.pageSize?g.pageSize:8;minSize=null!=g&&null!=g.minSize?g.minSize:180;(function(m,v){function p(K,c){if(K.getModel().isVertex(c)){var f=K.container.scrollWidth/2,l=K.container.scrollHeight/2;K.rootCell=c.referenceCell||c;K.getModel().beginUpdate();try{for(var t=c.referenceCell||c,q=m.model.getCell(t.sourceCellId),D=m.getEdges(q,null,!0,!0,!1,!0),G=[],N=0;N<D.length;N++)null!=D[N].getTerminal(!0)&&null!=D[N].getTerminal(!1)&&m.isCellVisible(D[N])&&-!m.isEdgeIgnored(D[N])&&m.isCellVisible(D[N].getTerminal(!0))&&m.isCellVisible(D[N].getTerminal(!1))&&m.isCellVisible(m.getLayerForCell(D[N]))&&G.push(D[N]);G=D=G;if(null!=c.startIndex||0<pageSize&&D.length>pageSize){var L=c.startIndex||0;G=D.slice(Math.max(0,L),Math.min(D.length,L+pageSize))}G=m.getOpposites(G,q).concat(G);var J=K.cloneCells(G);for(N=0;N<G.length;N++)if(J[N].sourceCellId=G[N].id,K.model.isEdge(J[N]))for(J[N].geometry.x=0,J[N].geometry.y=0,J[N].geometry.points=null,J[N].setStyle(J[N].getStyle()++Graph.exploreFromCell=function(b,e,g){pageSize=null!=g&&null!=g.pageSize?g.pageSize:8;minSize=null!=g&&null!=g.minSize?g.minSize:180;(function(m,v){function n(K,c){if(K.getModel().isVertex(c)){var f=K.container.scrollWidth/2,l=K.container.scrollHeight/2;K.rootCell=c.referenceCell||c;K.getModel().beginUpdate();try{for(var t=c.referenceCell||c,q=m.model.getCell(t.sourceCellId),D=m.getEdges(q,null,!0,!0,!1,!0),H=[],N=0;N<D.length;N++)null!=D[N].getTerminal(!0)&&null!=D[N].getTerminal(!1)&&m.isCellVisible(D[N])&&+!m.isEdgeIgnored(D[N])&&m.isCellVisible(D[N].getTerminal(!0))&&m.isCellVisible(D[N].getTerminal(!1))&&m.isCellVisible(m.getLayerForCell(D[N]))&&H.push(D[N]);H=D=H;if(null!=c.startIndex||0<pageSize&&D.length>pageSize){var L=c.startIndex||0;H=D.slice(Math.max(0,L),Math.min(D.length,L+pageSize))}H=m.getOpposites(H,q).concat(H);var J=K.cloneCells(H);for(N=0;N<H.length;N++)if(J[N].sourceCellId=H[N].id,K.model.isEdge(J[N]))for(J[N].geometry.x=0,J[N].geometry.y=0,J[N].geometry.points=null,J[N].setStyle(J[N].getStyle()+";curved=1;noEdgeStyle=1;entryX=none;entryY=none;exitX=none;exitY=none;labelBackgroundColor=#ffffffc0;textOpacity=100;"),J[N].setTerminal(t,null==J[N].getTerminal(!0)),q=0;q<J[N].getChildCount();q++){var Y=J[N].getChildAt(q);null!=Y.geometry&&Y.geometry.relative&&(Y.setStyle(Y.getStyle()+";labelBackgroundColor=#ffffffc0;textOpacity=100;"),Y.geometry.offset=new mxPoint(0,0),Y.geometry.y=0,Y.geometry.x=.5>Y.geometry.x?-.8:.5<Y.geometry.x?.8:0)}if(0<c.startIndex){var ha=K.createVertex(null,null,mxResources.get("previousPage")+" ("+Math.ceil((c.startIndex||0)/pageSize)+"/"+Math.ceil(D.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");ha.referenceCell=t;ha.startIndex=Math.max(0,(c.startIndex||0)-pageSize);J.splice(0,0,ha)}if(D.length>(c.startIndex||0)+pageSize){var ea=K.createVertex(null,null,mxResources.get("nextPage")+" ("+(Math.ceil((c.startIndex||0)/pageSize)+2)+"/"+Math.ceil(D.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");ea.referenceCell=t;ea.startIndex=(c.startIndex||0)+pageSize;J.splice(0,0,ea)}for(var aa in K.getModel().cells){var na=K.getModel().getCell(aa);na!=K.rootCell&&!K.getModel().isAncestor(K.rootCell,na)&&K.getModel().isVertex(na)&&K.removeCells([na])}K.addCells(J);var W=K.getModel().getGeometry(K.rootCell);null!=W&&(W=W.clone(),W.x=f-W.width/2,W.y=l-W.height/3,K.getModel().setGeometry(K.rootCell,W));c=[];for(aa in K.getModel().cells)na=K.getModel().getCell(aa),na!=K.rootCell&&K.getModel().isVertex(na)&&K.getModel().getParent(na)==K.getDefaultParent()&&(c.push(na),W=K.getModel().getGeometry(na),null!=W&&(W.x=f-W.width/2,W.y=l-W.height/2));var ba=c.length,ja=2*Math.PI/ba,ca=Math.max(minSize,Math.min(K.container.scrollWidth/2.5-80,K.container.scrollHeight/2.5-80));for(f=0;f<ba;f++)W=K.getModel().getGeometry(c[f]),null!=W&&(W=W.clone(),W.x+=ca*Math.sin(f*ja),W.y+=ca*Math.cos(f*ja),K.getModel().setGeometry(c[f],W))}finally{K.getModel().endUpdate()}}}var A=document.createElement("div");A.style.position=-"absolute";A.style.display="block";A.style.background=Editor.isDarkMode()?Editor.darkColor:"#ffffff";A.style.width="100%";A.style.height="100%";A.style.left="0px";A.style.top="0px";A.style.zIndex=2;var H=document.createElement("img");H.setAttribute("src",Editor.closeBlackImage);H.style.position="absolute";H.style.cursor="pointer";H.style.right="10px";H.style.top="10px";A.appendChild(H);var S=document.createElement("div");S.style.position="absolute";S.style.cursor="pointer";S.style.right="38px";S.style.top=-"14px";S.style.textAlign="right";S.style.verticalAlign="top";mxUtils.write(S,mxResources.get("close"));A.appendChild(S);document.body.appendChild(A);var F=function(K){27==K.keyCode&&H.click()};mxEvent.addListener(document,"keydown",F);(function(K){if(mxClient.isBrowserSupported()){var c=new Graph(K);c.keepEdgesInBackground=!0;c.isCellResizable=function(){return!1};c.isCellRotatable=function(){return!1};c.getCursorForCell=function(G){return this.model.isVertex(G)?"pointer":null};c.getFoldingImage=-function(){return null};var f=function(){mxEvent.removeListener(document,"keydown",F);K.parentNode.removeChild(K);m.scrollCellToVisible(v)};mxEvent.addListener(H,"click",f);mxEvent.addListener(S,"click",f);c.setEnabled(!1);var l=c.click;c.click=function(G){var N=G.getCell(),L=null!=N?null!=N.referenceCell?N.referenceCell:N:null;null!=N&&c.rootCell!=N&&0<c.getEdges(L).length?p(c,N):l.apply(this,arguments)};f=c.container.scrollWidth/2;var t=c.container.scrollHeight/3;c.model.beginUpdate();var q=c.importCells([v])[0];-q.sourceCellId=v.id;q.geometry.x=f-q.geometry.width/2;q.geometry.y=t-q.geometry.height/2;c.model.endUpdate();var D=!1;c.getModel().addListener(mxEvent.CHANGE,function(G,N){D||(G=N.getProperty("edit").changes,mxText.prototype.enableBoundingBox=!1,c.labelsVisible=!1,D=!0,mxEffects.animateChanges(c,G,function(){var L=new mxParallelEdgeLayout(c);L.spacing=60;var J=L.layout;L.layout=function(Y){L.spacing=Math.min(60,Math.max(30,60-5*Y.length));J.apply(this,arguments)};L.execute(c.getDefaultParent());mxText.prototype.enableBoundingBox=-!0;c.labelsVisible=!0;c.tooltipHandler.hide();c.refresh();D=!1}))});p(c,q)}else mxUtils.error("Browser is not supported!",200,!1)})(A)})(b,e)};Graph.removeKeys=function(b,e){for(var g in b)e(g)&&delete b[g]};Graph.setTransitionForNodes=function(b,e){for(var g=0;g<b.length;g++)mxUtils.setPrefixedStyle(b[g].style,"transition",e)};Graph.setOpacityForNodes=function(b,e){for(var g=0;g<b.length;g++)b[g].style.opacity=e};+"absolute";A.style.display="block";A.style.background=Editor.isDarkMode()?Editor.darkColor:"#ffffff";A.style.width="100%";A.style.height="100%";A.style.left="0px";A.style.top="0px";A.style.zIndex=2;var G=document.createElement("img");G.setAttribute("src",Editor.closeBlackImage);G.style.position="absolute";G.style.cursor="pointer";G.style.right="10px";G.style.top="10px";A.appendChild(G);var S=document.createElement("div");S.style.position="absolute";S.style.cursor="pointer";S.style.right="38px";S.style.top=+"14px";S.style.textAlign="right";S.style.verticalAlign="top";mxUtils.write(S,mxResources.get("close"));A.appendChild(S);document.body.appendChild(A);var F=function(K){27==K.keyCode&&G.click()};mxEvent.addListener(document,"keydown",F);(function(K){if(mxClient.isBrowserSupported()){var c=new Graph(K);c.keepEdgesInBackground=!0;c.isCellResizable=function(){return!1};c.isCellRotatable=function(){return!1};c.getCursorForCell=function(H){return this.model.isVertex(H)?"pointer":null};c.getFoldingImage=+function(){return null};var f=function(){mxEvent.removeListener(document,"keydown",F);K.parentNode.removeChild(K);m.scrollCellToVisible(v)};mxEvent.addListener(G,"click",f);mxEvent.addListener(S,"click",f);c.setEnabled(!1);var l=c.click;c.click=function(H){var N=H.getCell(),L=null!=N?null!=N.referenceCell?N.referenceCell:N:null;null!=N&&c.rootCell!=N&&0<c.getEdges(L).length?n(c,N):l.apply(this,arguments)};f=c.container.scrollWidth/2;var t=c.container.scrollHeight/3;c.model.beginUpdate();var q=c.importCells([v])[0];+q.sourceCellId=v.id;q.geometry.x=f-q.geometry.width/2;q.geometry.y=t-q.geometry.height/2;c.model.endUpdate();var D=!1;c.getModel().addListener(mxEvent.CHANGE,function(H,N){D||(H=N.getProperty("edit").changes,mxText.prototype.enableBoundingBox=!1,c.labelsVisible=!1,D=!0,mxEffects.animateChanges(c,H,function(){var L=new mxParallelEdgeLayout(c);L.spacing=60;var J=L.layout;L.layout=function(Y){L.spacing=Math.min(60,Math.max(30,60-5*Y.length));J.apply(this,arguments)};L.execute(c.getDefaultParent());mxText.prototype.enableBoundingBox=+!0;c.labelsVisible=!0;c.tooltipHandler.hide();c.refresh();D=!1}))});n(c,q)}else mxUtils.error("Browser is not supported!",200,!1)})(A)})(b,e)};Graph.removeKeys=function(b,e){for(var g in b)e(g)&&delete b[g]};Graph.setTransitionForNodes=function(b,e){for(var g=0;g<b.length;g++)mxUtils.setPrefixedStyle(b[g].style,"transition",e)};Graph.setOpacityForNodes=function(b,e){for(var g=0;g<b.length;g++)b[g].style.opacity=e};Graph.removePasteFormatting=function(b,e){for(;null!=b;){null!=b.firstChild&&Graph.removePasteFormatting(b.firstChild,!0);var g=b.nextSibling;if(b.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=b.style){"#000000"==b.style.color&&(b.style.color="");if("SPAN"==b.nodeName&&"Apple-tab-span"==b.className){var m=Graph.createTabNode(4);b.parentNode.replaceChild(m,b);b=m}if("P"==b.nodeName&&"p1"==b.className){for(;null!=b.firstChild;)b.parentNode.insertBefore(b.firstChild,b);null!=g&&"P"==g.nodeName&&"p1"==g.className&&b.parentNode.insertBefore(b.ownerDocument.createElement("br"),b);b.parentNode.removeChild(b)}!e&&null!=b.innerHTML&&0<=b.innerHTML.indexOf("\t")&&(m=Graph.createTabNode(4),b.innerHTML=b.innerHTML.replace(/\t/g,m.outerHTML))}b=g}};Graph.createTabNode=function(b){var e="\t";if(null!=b)for(e="";0<b;)e+=" ",b--;b=document.createElement("span");b.style.whiteSpace="pre";b.appendChild(document.createTextNode(e));return b};Graph.sanitizeHtml=function(b,e){return Graph.domPurify(b,!1)};Graph.sanitizeLink=function(b){if(null==b)return null;var e=document.createElement("a");e.setAttribute("href",b);Graph.sanitizeNode(e);return e.getAttribute("href")};Graph.sanitizeNode=function(b){return Graph.domPurify(b,!0)};DOMPurify.addHook("afterSanitizeAttributes",function(b){"use"==b.nodeName&&(null!=b.getAttribute("xlink:href")&&!b.getAttribute("xlink:href").startsWith("#")||null!=b.getAttribute("href")&&!b.getAttribute("href").startsWith("#"))&&b.remove()});Graph.domPurify=function(b,e){window.DOM_PURIFY_CONFIG.IN_PLACE=e;return DOMPurify.sanitize(b,window.DOM_PURIFY_CONFIG)};-Graph.clipSvgDataUri=function(b){if(null!=b&&"data:image/svg+xml;base64,"==b.substring(0,26))try{var e=document.createElement("div");e.style.position="absolute";e.style.visibility="hidden";var g=decodeURIComponent(escape(atob(b.substring(26)))),m=g.indexOf("<svg");if(0<=m){e.innerHTML=Graph.sanitizeHtml(g.substring(m));var v=e.getElementsByTagName("svg");if(0<v.length){document.body.appendChild(e);try{m=g=1;var p=v[0].getAttribute("width"),A=v[0].getAttribute("height");p=null!=p&&"%"!=p.charAt(p.length--1)?parseFloat(p):NaN;A=null!=A&&"%"!=A.charAt(A.length-1)?parseFloat(A):NaN;var H=v[0].getAttribute("viewBox");if(null!=H&&!isNaN(p)&&!isNaN(A)){var S=H.split(" ");4<=H.length&&(g=parseFloat(S[2])/p,m=parseFloat(S[3])/A,new mxRectangle(parseFloat(S[0]),parseFloat(S[1]),parseFloat(S[2]),parseFloat(S[3])))}var F=v[0].getBBox();if(0<F.width&&0<F.height){p=0;var K=v[0].querySelectorAll("[stroke-width]");for(A=0;A<K.length;A++)p=Math.max(p,parseFloat(K[A].getAttribute("stroke-width")));F=new mxRectangle(F.x,-F.y,F.width,F.height);F.grow(p/2);e.getElementsByTagName("svg")[0].setAttribute("viewBox",F.x+" "+F.y+" "+F.width+" "+F.height);e.getElementsByTagName("svg")[0].setAttribute("width",F.width/g);e.getElementsByTagName("svg")[0].setAttribute("height",F.height/m)}}catch(c){}finally{document.body.removeChild(e)}b=Editor.createSvgDataUri(mxUtils.getXml(v[0]))}}}catch(c){}return b};+Graph.clipSvgDataUri=function(b){if(null!=b&&"data:image/svg+xml;base64,"==b.substring(0,26))try{var e=document.createElement("div");e.style.position="absolute";e.style.visibility="hidden";var g=decodeURIComponent(escape(atob(b.substring(26)))),m=g.indexOf("<svg");if(0<=m){e.innerHTML=Graph.sanitizeHtml(g.substring(m));var v=e.getElementsByTagName("svg");if(0<v.length){document.body.appendChild(e);try{m=g=1;var n=v[0].getAttribute("width"),A=v[0].getAttribute("height");n=null!=n&&"%"!=n.charAt(n.length-+1)?parseFloat(n):NaN;A=null!=A&&"%"!=A.charAt(A.length-1)?parseFloat(A):NaN;var G=v[0].getAttribute("viewBox");if(null!=G&&!isNaN(n)&&!isNaN(A)){var S=G.split(" ");4<=G.length&&(g=parseFloat(S[2])/n,m=parseFloat(S[3])/A,new mxRectangle(parseFloat(S[0]),parseFloat(S[1]),parseFloat(S[2]),parseFloat(S[3])))}var F=v[0].getBBox();if(0<F.width&&0<F.height){n=0;var K=v[0].querySelectorAll("[stroke-width]");for(A=0;A<K.length;A++)n=Math.max(n,parseFloat(K[A].getAttribute("stroke-width")));F=new mxRectangle(F.x,+F.y,F.width,F.height);F.grow(n/2);e.getElementsByTagName("svg")[0].setAttribute("viewBox",F.x+" "+F.y+" "+F.width+" "+F.height);e.getElementsByTagName("svg")[0].setAttribute("width",F.width/g);e.getElementsByTagName("svg")[0].setAttribute("height",F.height/m)}}catch(c){}finally{document.body.removeChild(e)}b=Editor.createSvgDataUri(mxUtils.getXml(v[0]))}}}catch(c){}return b};Graph.createRemoveIcon=function(b,e){var g=document.createElement("img");g.setAttribute("src",Dialog.prototype.clearImage);g.setAttribute("title",b);g.setAttribute("width","13");g.setAttribute("height","10");g.style.marginLeft="4px";g.style.marginBottom="-1px";g.style.cursor="pointer";mxEvent.addListener(g,"click",e);return g};Graph.isPageLink=function(b){return null!=b&&"data:page/id,"==b.substring(0,13)};-Graph.rewritePageLinks=function(b,e){function g(v,p){var A=v.getAttribute(p);if(null!=A){Graph.isPageLink(A)&&(A="#"+A.substring(A.indexOf(":")+1));var H=p;e&&"xlink:href"==p&&(v.removeAttribute(p),H="href");v.setAttribute(H,A)}}b=b.getElementsByTagName("a");if(null!=b)for(var m=0;m<b.length;m++)g(b[m],"href"),g(b[m],"xlink:href")};Graph.isLink=function(b){return null!=b&&b.match(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g)};+Graph.rewritePageLinks=function(b,e){function g(v,n){var A=v.getAttribute(n);if(null!=A){Graph.isPageLink(A)&&(A="#"+A.substring(A.indexOf(":")+1));var G=n;e&&"xlink:href"==n&&(v.removeAttribute(n),G="href");v.setAttribute(G,A)}}b=b.getElementsByTagName("a");if(null!=b)for(var m=0;m<b.length;m++)g(b[m],"href"),g(b[m],"xlink:href")};Graph.isLink=function(b){return null!=b&&b.match(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g)};mxUtils.extend(Graph,mxGraph);Graph.prototype.minFitScale=null;Graph.prototype.maxFitScale=null;Graph.prototype.linkPolicy="frame"==urlParams.target?"blank":urlParams.target||"auto";Graph.prototype.linkTarget="frame"==urlParams.target?"_self":"_blank";Graph.prototype.linkRelation="nofollow noopener noreferrer";Graph.prototype.defaultScrollbars=!0;Graph.prototype.defaultPageVisible=!0;Graph.prototype.defaultGridEnabled="0"!=urlParams.grid;Graph.prototype.lightbox=!1;Graph.prototype.diagramBackgroundColor="#f0f0f0";Graph.prototype.enableDiagramBackground=!1;Graph.prototype.defaultPageBackgroundColor="1"==urlParams.embedInline?"transparent":"light-dark(#ffffff, "+Editor.darkColor+")";Graph.prototype.defaultPageBorderColor="light-dark(#ffffff, #000000)";Graph.prototype.shapeForegroundColor="light-dark(#000000, #ffffff)";Graph.prototype.shapeBackgroundColor="light-dark(#ffffff, var("+Editor.darkColorVar+", "+Editor.darkColor+"))";Graph.prototype.scrollTileSize=new mxRectangle(0,0,400,400);Graph.prototype.transparentBackground=!0;Graph.prototype.selectParentAfterDelete=!1;Graph.prototype.defaultEdgeLength=80;Graph.prototype.immediateHandling=!0;Graph.prototype.connectionArrowsEnabled=!0;Graph.prototype.placeholderPattern=RegExp("%(date{.*}|[^%^{^}^ ^\"^ '^=^;]+)%","g");Graph.prototype.absoluteUrlPattern=RegExp("^(?:[a-z]+:)?//","i");Graph.prototype.defaultThemeName="default";Graph.prototype.defaultThemes={};Graph.prototype.baseUrl=null!=urlParams.base?mxUtils.removeJavascriptProtocol(decodeURIComponent(urlParams.base)):(window!=window.top?document.referrer:document.location.toString()).split("#")[0];Graph.prototype.editAfterInsert=!1;Graph.prototype.builtInProperties=["label","tooltip","placeholders","placeholder"];Graph.prototype.standalone=!1;Graph.prototype.enableFlowAnimation=!1;Graph.prototype.roundableShapes="label rectangle internalStorage corner parallelogram swimlane triangle trapezoid ext step tee process link rhombus offPageConnector loopLimit hexagon manualInput card curlyBracket singleArrow callout doubleArrow flexArrow umlLifeline".split(" ");Graph.prototype.vertexFontSize=null;Graph.prototype.edgeFontSize=null;Graph.prototype.adaptiveColors="auto";-Graph.prototype.init=function(b){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(g,m){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var v=g.view.graph.tolerance,p=!0,A=null,H=mxUtils.bind(this,function(K){p=!0;A=new mxPoint(mxEvent.getClientX(K),mxEvent.getClientY(K))}),S=mxUtils.bind(this,function(K){p=p&&null!=A&&Math.abs(A.x-mxEvent.getClientX(K))<v&&Math.abs(A.y-mxEvent.getClientY(K))<v}),F=mxUtils.bind(this,function(K){if(p)for(var c=mxEvent.getSource(K);null!=-c&&c!=m.node;){if("a"==c.nodeName.toLowerCase()){g.view.graph.labelLinkClicked(g,c,K);break}c=c.parentNode}});mxEvent.addGestureListeners(m.node,H,S,F);mxEvent.addListener(m.node,"click",function(K){mxEvent.consume(K)})};if(null!=this.tooltipHandler){var e=this.tooltipHandler.init;this.tooltipHandler.init=function(){e.apply(this,arguments);null!=this.div&&mxEvent.addListener(this.div,"click",mxUtils.bind(this,function(g){var m=mxEvent.getSource(g);"A"==m.nodeName&&(m=m.getAttribute("href"),null!=+Graph.prototype.init=function(b){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(g,m){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var v=g.view.graph.tolerance,n=!0,A=null,G=mxUtils.bind(this,function(K){n=!0;A=new mxPoint(mxEvent.getClientX(K),mxEvent.getClientY(K))}),S=mxUtils.bind(this,function(K){n=n&&null!=A&&Math.abs(A.x-mxEvent.getClientX(K))<v&&Math.abs(A.y-mxEvent.getClientY(K))<v}),F=mxUtils.bind(this,function(K){if(n)for(var c=mxEvent.getSource(K);null!=+c&&c!=m.node;){if("a"==c.nodeName.toLowerCase()){g.view.graph.labelLinkClicked(g,c,K);break}c=c.parentNode}});mxEvent.addGestureListeners(m.node,G,S,F);mxEvent.addListener(m.node,"click",function(K){mxEvent.consume(K)})};if(null!=this.tooltipHandler){var e=this.tooltipHandler.init;this.tooltipHandler.init=function(){e.apply(this,arguments);null!=this.div&&mxEvent.addListener(this.div,"click",mxUtils.bind(this,function(g){var m=mxEvent.getSource(g);"A"==m.nodeName&&(m=m.getAttribute("href"),null!=m&&this.graph.isCustomLink(m)&&(mxEvent.isTouchEvent(g)||!mxEvent.isPopupTrigger(g))&&this.graph.customLinkClicked(m)&&mxEvent.consume(g))}))}}this.initLayoutManager()};(function(){Graph.prototype.useCssTransforms=!1;Graph.prototype.currentScale=1;Graph.prototype.currentTranslate=new mxPoint(0,0);Graph.prototype.pasteEdgeStyle=!1;Graph.prototype.isFillState=function(A){return!this.isSpecialColor(A.style[mxConstants.STYLE_FILLCOLOR])&&"1"!=mxUtils.getValue(A.style,"lineShape",null)&&(this.model.isVertex(A.cell)||"arrow"==mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null)||"wire"==mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null)||"filledEdge"==mxUtils.getValue(A.style,-mxConstants.STYLE_SHAPE,null)||"flexArrow"==mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null)||"mxgraph.arrows2.wedgeArrow"==mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null))};Graph.prototype.isGradientState=function(A){return this.isFillState(A)&&"wire"!=mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null)};Graph.prototype.isStrokeState=function(A){return!0};Graph.prototype.getTextColor=function(A,H){for(var S=H?"color":"background-color",F=A==this.cellEditor.textarea&&H?"default":Graph.getGivenColor(A,-S);null==F&&null!=A&&A!=this.cellEditor.textarea.parentNode;)F=A==this.cellEditor.textarea&&H?"default":Graph.getGivenColor(A,S),A=A.parentNode;if("rgba(0, 0, 0, 0)"==F||"transparent"==F)F=mxConstants.NONE;return F};Graph.prototype.isSpecialColor=function(A){return 0<=mxUtils.indexOf([mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_FILLCOLOR,"inherit","swimlane","indicated"],A)};Graph.prototype.isGlassState=function(A){A=mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null);return"label"==A||"rectangle"==-A||"internalStorage"==A||"ext"==A||"umlLifeline"==A||"swimlane"==A||"process"==A};Graph.prototype.isRoundedState=function(A){return null!=A.shape?A.shape.isRoundable():0<=mxUtils.indexOf(this.roundableShapes,mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null))};Graph.prototype.isLineJumpState=function(A){var H=mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null);return!mxUtils.getValue(A.style,mxConstants.STYLE_CURVED,!1)&&("connector"==H||"filledEdge"==H||"wire"==H)};Graph.prototype.isAutoSizeState=-function(A){return"1"==mxUtils.getValue(A.style,mxConstants.STYLE_AUTOSIZE,null)};Graph.prototype.isImageState=function(A){return null!=mxUtils.getValue(A.style,mxConstants.STYLE_IMAGE,null)};Graph.prototype.isShadowState=function(A){return!0};Graph.prototype.getVerticesAndEdges=function(A,H){A=null!=A?A:!0;H=null!=H?H:!0;var S=this.model;return S.filterDescendants(function(F){return A&&S.isVertex(F)||H&&S.isEdge(F)},S.getRoot())};Graph.prototype.applyNewEdgeStyle=function(A,H,S){A=this.getCellStyle(A).newEdgeStyle;-if(null!=A){this.model.beginUpdate();try{var F=JSON.parse(A),K;for(K in F)this.setCellStyles(K,F[K],H),"edgeStyle"==K&&"elbowEdgeStyle"==F[K]&&null!=S&&this.setCellStyles("elbow",S==mxConstants.DIRECTION_SOUTH||S==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",H)}finally{this.model.endUpdate()}}};Graph.prototype.getCommonStyle=function(A){for(var H={},S=0;S<A.length;S++){var F=this.view.getState(A[S]);null!=F&&this.mergeStyle(F.style,H,0==S)}return H};Graph.prototype.mergeStyle=function(A,H,S){if(null!=-A){var F={},K;for(K in A){var c=A[K];null!=c&&(F[K]=!0,null==H[K]&&S?H[K]=c:H[K]!=c&&delete H[K])}for(K in H)F[K]||delete H[K]}};Graph.prototype.getStartEditingCell=function(A,H){H=this.getCellStyle(A);H=parseInt(mxUtils.getValue(H,mxConstants.STYLE_STARTSIZE,0));this.isTable(A)&&(!this.isSwimlane(A)||0==H)&&""==this.getLabel(A)&&0<this.model.getChildCount(A)&&(A=this.model.getChildAt(A,0),H=this.getCellStyle(A),H=parseInt(mxUtils.getValue(H,mxConstants.STYLE_STARTSIZE,0)));if(this.isTableRow(A)&&-(!this.isSwimlane(A)||0==H)&&""==this.getLabel(A)&&0<this.model.getChildCount(A))for(H=0;H<this.model.getChildCount(A);H++){var S=this.model.getChildAt(A,H);if(this.isCellEditable(S)){A=S;break}}return A};Graph.prototype.copyStyle=function(A){return this.getCellStyle(A,!1)};Graph.prototype.pasteStyle=function(A,H,S,F){null!=A&&(F||(S=null!=S?S:Graph.cellStyles,Graph.removeKeys(A,function(K){return 0>mxUtils.indexOf(S,K)})),this.updateCellStyles(A,H))};Graph.prototype.copyCellStyles=function(A,H,S,-F,K,c,f){var l=!1,t=!1;if(0<A.length)for(var q=0;q<A.length&&(l=this.getModel().isVertex(A[q])||l,!(t=this.getModel().isEdge(A[q])||t)||!l);q++);else t=l=!0;l=l&&!c;t=t&&!f;for(q=0;q<H.length;q++)if(A=0<=mxUtils.indexOf(Graph.textStyles,H[q]),"strokeColor"!=H[q]||null!=S[q]&&"none"!=S[q])if(0<=mxUtils.indexOf(Graph.cellStyles,H[q])||"shape"==H[q])if("shape"!=H[q]&&(l||A)&&(null==S[q]?delete F[H[q]]:F[H[q]]=S[q]),t||A)null==S[q]?delete K[H[q]]:K[H[q]]=S[q]};Graph.prototype.includeDescendants=function(A){for(var H=-[],S=0;S<A.length;S++)H=H.concat(this.model.getDescendants(A[S]));return H};Graph.prototype.pasteCellStyles=function(A,H,S,F,K){H=null!=H?H:this.currentVertexStyle;S=null!=S?S:this.currentEdgeStyle;K=null!=K?K:this.pasteEdgeStyle;this.model.beginUpdate();try{for(var c=0;c<A.length;c++){var f=A[c],l=this.model.getStyle(f),t=!1;null!=f.style&&(pairs=f.style.split(";"),t=t||0<=mxUtils.indexOf(pairs,"text"));if(t)var q=Graph.textStyles;else if(q=Graph.cellStyles.slice(),!F)for(var D=null!=l?l.split(";"):-[],G=0;G<D.length;G++){var N=D[G],L=N.indexOf("=");if(0<=L){var J=N.substring(0,L),Y=mxUtils.indexOf(q,J);0<=Y&&q.splice(Y,1);for(t=0;t<Graph.cellStyleGroups.length;t++){var ha=Graph.cellStyleGroups[t];if(0<=mxUtils.indexOf(ha,J))for(var ea=0;ea<ha.length;ea++){var aa=mxUtils.indexOf(q,ha[ea]);0<=aa&&q.splice(aa,1)}}}}var na=this.model.isEdge(f);t=na?S:H;for(G=0;G<q.length;G++){J=q[G];var W=t[J];null!=W&&("edgeStyle"!=J||K)&&(na||!na&&0>mxUtils.indexOf(Graph.edgeStyles,J))&&(l=mxUtils.setStyle(l,-J,W),"fontFamily"==J&&null==t.fontSource&&(l=mxUtils.setStyle(l,"fontSource",null)),na&&"rounded"==J&&"1"==W&&null==t.curved&&(l=mxUtils.setStyle(l,"curved",null)))}Editor.simpleLabels&&(l=mxUtils.setStyle(mxUtils.setStyle(l,"html",null),"whiteSpace",null));this.model.setStyle(f,l)}}finally{this.model.endUpdate()}return A};Graph.prototype.updateCellStyles=function(A,H){this.model.beginUpdate();try{for(var S=0;S<H.length;S++)if(this.model.isVertex(H[S])||this.model.isEdge(H[S])){var F=this.getCellStyle(H[S],-!1),K=F[mxConstants.STYLE_PERIMETER],c=!1;for(l in A){var f=A[l];if(F[l]!=f){if(l==mxConstants.STYLE_SHAPE&&"umlLifeline"==F[l]&&"umlLifeline"!=f){c=!0;var l="participant"}this.setCellStyles(l,f,[H[S]])}}c&&this.setCellStyles(mxConstants.STYLE_PERIMETER,K,[H[S]])}}finally{this.model.endUpdate()}};Graph.prototype.isFastZoomEnabled=function(){return"nocss"!=urlParams.zoom&&!mxClient.NO_FO&&!mxClient.IS_EDGE&&!this.useCssTransforms&&(this.isCssTransformsSupported()||mxClient.IS_IOS)};Graph.prototype.isCssTransformsSupported=-function(){return this.dialect==mxConstants.DIALECT_SVG&&!mxClient.NO_FO&&(!this.lightbox||!mxClient.IS_SF)};Graph.prototype.getCellAt=function(A,H,S,F,K,c){this.useCssTransforms&&(A=A/this.currentScale-this.currentTranslate.x,H=H/this.currentScale-this.currentTranslate.y);return this.getScaledCellAt.apply(this,arguments)};Graph.prototype.getScaledCellAt=function(A,H,S,F,K,c){F=null!=F?F:!0;K=null!=K?K:!0;null==S&&(S=this.getCurrentRoot(),null==S&&(S=this.getModel().getRoot()));if(null!=S)for(var f=-this.model.getChildCount(S)-1;0<=f;f--){var l=this.model.getChildAt(S,f),t=this.getScaledCellAt(A,H,l,F,K,c);if(null!=t)return t;if(this.isCellVisible(l)&&(K&&this.model.isEdge(l)||F&&this.model.isVertex(l))&&(t=this.view.getState(l),null!=t&&(null==c||!c(t,A,H))&&this.intersects(t,A,H)))return l}return null};Graph.prototype.isRecursiveVertexResize=function(A){return!this.isSwimlane(A.cell)&&0<this.model.getChildCount(A.cell)&&!this.isCellCollapsed(A.cell)&&"1"==mxUtils.getValue(A.style,"recursiveResize",-"1")&&null==mxUtils.getValue(A.style,"childLayout",null)};Graph.prototype.getAbsoluteParent=function(A){for(var H=this.getCellGeometry(A);null!=H&&H.relative;)A=this.getModel().getParent(A),H=this.getCellGeometry(A);return A};Graph.prototype.isPart=function(A){return"1"==mxUtils.getValue(this.getCurrentCellStyle(A),"part","0")||this.isTableCell(A)||this.isTableRow(A)};Graph.prototype.getCompositeParents=function(A){for(var H=new mxDictionary,S=[],F=0;F<A.length;F++){var K=this.getCompositeParent(A[F]);-this.isTableCell(K)&&(K=this.graph.model.getParent(K));this.isTableRow(K)&&(K=this.graph.model.getParent(K));null==K||H.get(K)||(H.put(K,!0),S.push(K))}return S};Graph.prototype.getReferenceTerminal=function(A){if(null!=A){var H=this.getCellGeometry(A);null!=H&&H.relative&&(A=this.model.getParent(A))}null!=A&&this.model.isEdge(A)&&(A=this.model.getParent(A));null!=A&&(A=this.getCompositeParent(A));return A};Graph.prototype.getCompositeParent=function(A){for(;this.isPart(A);){var H=this.model.getParent(A);-if(!this.model.isVertex(H))break;A=H}return A};Graph.prototype.filterSelectionCells=function(A){var H=this.getSelectionCells();if(null!=A){for(var S=[],F=0;F<H.length;F++)A(H[F])||S.push(H[F]);H=S}return H};var b=mxGraph.prototype.scrollRectToVisible;Graph.prototype.scrollRectToVisible=function(A){if(this.useCssTransforms){var H=this.currentScale,S=this.currentTranslate;A=new mxRectangle((A.x+2*S.x)*H-S.x,(A.y+2*S.y)*H-S.y,A.width*H,A.height*H)}b.apply(this,arguments)};mxCellHighlight.prototype.getStrokeWidth=-function(A){A=this.strokeWidth;this.graph.useCssTransforms&&(A/=this.graph.currentScale);return A};mxGraphView.prototype.getGraphBounds=function(){var A=this.graphBounds;if(this.graph.useCssTransforms){var H=this.graph.currentTranslate,S=this.graph.currentScale;A=new mxRectangle((A.x+H.x)*S,(A.y+H.y)*S,A.width*S,A.height*S)}return A};mxGraphView.prototype.viewStateChanged=function(){this.graph.useCssTransforms?this.validate():this.revalidate();this.graph.sizeDidChange()};var e=mxGraphView.prototype.validate;+mxConstants.STYLE_SHAPE,null)||"flexArrow"==mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null)||"mxgraph.arrows2.wedgeArrow"==mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null))};Graph.prototype.isGradientState=function(A){return this.isFillState(A)&&"wire"!=mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null)};Graph.prototype.isStrokeState=function(A){return!0};Graph.prototype.getTextColor=function(A,G){for(var S=G?"color":"background-color",F=A==this.cellEditor.textarea&&G?"default":Graph.getGivenColor(A,+S);null==F&&null!=A&&A!=this.cellEditor.textarea.parentNode;)F=A==this.cellEditor.textarea&&G?"default":Graph.getGivenColor(A,S),A=A.parentNode;if("rgba(0, 0, 0, 0)"==F||"transparent"==F)F=mxConstants.NONE;return F};Graph.prototype.isSpecialColor=function(A){return 0<=mxUtils.indexOf([mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_FILLCOLOR,"inherit","swimlane","indicated"],A)};Graph.prototype.isGlassState=function(A){A=mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null);return"label"==A||"rectangle"==+A||"internalStorage"==A||"ext"==A||"umlLifeline"==A||"swimlane"==A||"process"==A};Graph.prototype.isRoundedState=function(A){return null!=A.shape?A.shape.isRoundable():0<=mxUtils.indexOf(this.roundableShapes,mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null))};Graph.prototype.isLineJumpState=function(A){var G=mxUtils.getValue(A.style,mxConstants.STYLE_SHAPE,null);return!mxUtils.getValue(A.style,mxConstants.STYLE_CURVED,!1)&&("connector"==G||"filledEdge"==G||"wire"==G)};Graph.prototype.isAutoSizeState=+function(A){return"1"==mxUtils.getValue(A.style,mxConstants.STYLE_AUTOSIZE,null)};Graph.prototype.isImageState=function(A){return null!=mxUtils.getValue(A.style,mxConstants.STYLE_IMAGE,null)};Graph.prototype.isShadowState=function(A){return!0};Graph.prototype.getVerticesAndEdges=function(A,G){A=null!=A?A:!0;G=null!=G?G:!0;var S=this.model;return S.filterDescendants(function(F){return A&&S.isVertex(F)||G&&S.isEdge(F)},S.getRoot())};Graph.prototype.applyNewEdgeStyle=function(A,G,S){A=this.getCellStyle(A).newEdgeStyle;+if(null!=A){this.model.beginUpdate();try{var F=JSON.parse(A),K;for(K in F)this.setCellStyles(K,F[K],G),"edgeStyle"==K&&"elbowEdgeStyle"==F[K]&&null!=S&&this.setCellStyles("elbow",S==mxConstants.DIRECTION_SOUTH||S==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",G)}finally{this.model.endUpdate()}}};Graph.prototype.getCommonStyle=function(A){for(var G={},S=0;S<A.length;S++){var F=this.view.getState(A[S]);null!=F&&this.mergeStyle(F.style,G,0==S)}return G};Graph.prototype.mergeStyle=function(A,G,S){if(null!=+A){var F={},K;for(K in A){var c=A[K];null!=c&&(F[K]=!0,null==G[K]&&S?G[K]=c:G[K]!=c&&delete G[K])}for(K in G)F[K]||delete G[K]}};Graph.prototype.getStartEditingCell=function(A,G){G=this.getCellStyle(A);G=parseInt(mxUtils.getValue(G,mxConstants.STYLE_STARTSIZE,0));this.isTable(A)&&(!this.isSwimlane(A)||0==G)&&""==this.getLabel(A)&&0<this.model.getChildCount(A)&&(A=this.model.getChildAt(A,0),G=this.getCellStyle(A),G=parseInt(mxUtils.getValue(G,mxConstants.STYLE_STARTSIZE,0)));if(this.isTableRow(A)&&+(!this.isSwimlane(A)||0==G)&&""==this.getLabel(A)&&0<this.model.getChildCount(A))for(G=0;G<this.model.getChildCount(A);G++){var S=this.model.getChildAt(A,G);if(this.isCellEditable(S)){A=S;break}}return A};Graph.prototype.copyStyle=function(A){return this.getCellStyle(A,!1)};Graph.prototype.pasteStyle=function(A,G,S,F){null!=A&&(F||(S=null!=S?S:Graph.cellStyles,Graph.removeKeys(A,function(K){return 0>mxUtils.indexOf(S,K)})),this.updateCellStyles(A,G))};Graph.prototype.copyCellStyles=function(A,G,S,+F,K,c,f){var l=!1,t=!1;if(0<A.length)for(var q=0;q<A.length&&(l=this.getModel().isVertex(A[q])||l,!(t=this.getModel().isEdge(A[q])||t)||!l);q++);else t=l=!0;l=l&&!c;t=t&&!f;for(q=0;q<G.length;q++)if(A=0<=mxUtils.indexOf(Graph.textStyles,G[q]),"strokeColor"!=G[q]||null!=S[q]&&"none"!=S[q])if(0<=mxUtils.indexOf(Graph.cellStyles,G[q])||"shape"==G[q])if("shape"!=G[q]&&(l||A)&&(null==S[q]?delete F[G[q]]:F[G[q]]=S[q]),t||A)null==S[q]?delete K[G[q]]:K[G[q]]=S[q]};Graph.prototype.includeDescendants=function(A){for(var G=+[],S=0;S<A.length;S++)G=G.concat(this.model.getDescendants(A[S]));return G};Graph.prototype.pasteCellStyles=function(A,G,S,F,K){G=null!=G?G:this.currentVertexStyle;S=null!=S?S:this.currentEdgeStyle;K=null!=K?K:this.pasteEdgeStyle;this.model.beginUpdate();try{for(var c=0;c<A.length;c++){var f=A[c],l=this.model.getStyle(f),t=!1;null!=f.style&&(pairs=f.style.split(";"),t=t||0<=mxUtils.indexOf(pairs,"text"));if(t)var q=Graph.textStyles;else if(q=Graph.cellStyles.slice(),!F)for(var D=null!=l?l.split(";"):+[],H=0;H<D.length;H++){var N=D[H],L=N.indexOf("=");if(0<=L){var J=N.substring(0,L),Y=mxUtils.indexOf(q,J);0<=Y&&q.splice(Y,1);for(t=0;t<Graph.cellStyleGroups.length;t++){var ha=Graph.cellStyleGroups[t];if(0<=mxUtils.indexOf(ha,J))for(var ea=0;ea<ha.length;ea++){var aa=mxUtils.indexOf(q,ha[ea]);0<=aa&&q.splice(aa,1)}}}}var na=this.model.isEdge(f);t=na?S:G;for(H=0;H<q.length;H++){J=q[H];var W=t[J];null!=W&&("edgeStyle"!=J||K)&&(na||!na&&0>mxUtils.indexOf(Graph.edgeStyles,J))&&(l=mxUtils.setStyle(l,+J,W),"fontFamily"==J&&null==t.fontSource&&(l=mxUtils.setStyle(l,"fontSource",null)),na&&"rounded"==J&&"1"==W&&null==t.curved&&(l=mxUtils.setStyle(l,"curved",null)))}Editor.simpleLabels&&(l=mxUtils.setStyle(mxUtils.setStyle(l,"html",null),"whiteSpace",null));this.model.setStyle(f,l)}}finally{this.model.endUpdate()}return A};Graph.prototype.updateCellStyles=function(A,G){this.model.beginUpdate();try{for(var S=0;S<G.length;S++)if(this.model.isVertex(G[S])||this.model.isEdge(G[S])){var F=this.getCellStyle(G[S],+!1),K=F[mxConstants.STYLE_PERIMETER],c=!1;for(l in A){var f=A[l];if(F[l]!=f){if(l==mxConstants.STYLE_SHAPE&&"umlLifeline"==F[l]&&"umlLifeline"!=f){c=!0;var l="participant"}this.setCellStyles(l,f,[G[S]])}}c&&this.setCellStyles(mxConstants.STYLE_PERIMETER,K,[G[S]])}}finally{this.model.endUpdate()}};Graph.prototype.isFastZoomEnabled=function(){return"nocss"!=urlParams.zoom&&!mxClient.NO_FO&&!mxClient.IS_EDGE&&!this.useCssTransforms&&(this.isCssTransformsSupported()||mxClient.IS_IOS)};Graph.prototype.isCssTransformsSupported=+function(){return this.dialect==mxConstants.DIALECT_SVG&&!mxClient.NO_FO&&(!this.lightbox||!mxClient.IS_SF)};Graph.prototype.getCellAt=function(A,G,S,F,K,c){this.useCssTransforms&&(A=A/this.currentScale-this.currentTranslate.x,G=G/this.currentScale-this.currentTranslate.y);return this.getScaledCellAt.apply(this,arguments)};Graph.prototype.getScaledCellAt=function(A,G,S,F,K,c){F=null!=F?F:!0;K=null!=K?K:!0;null==S&&(S=this.getCurrentRoot(),null==S&&(S=this.getModel().getRoot()));if(null!=S)for(var f=+this.model.getChildCount(S)-1;0<=f;f--){var l=this.model.getChildAt(S,f),t=this.getScaledCellAt(A,G,l,F,K,c);if(null!=t)return t;if(this.isCellVisible(l)&&(K&&this.model.isEdge(l)||F&&this.model.isVertex(l))&&(t=this.view.getState(l),null!=t&&(null==c||!c(t,A,G))&&this.intersects(t,A,G)))return l}return null};Graph.prototype.isRecursiveVertexResize=function(A){return!this.isSwimlane(A.cell)&&0<this.model.getChildCount(A.cell)&&!this.isCellCollapsed(A.cell)&&"1"==mxUtils.getValue(A.style,"recursiveResize",+"1")&&null==mxUtils.getValue(A.style,"childLayout",null)};Graph.prototype.getAbsoluteParent=function(A){for(var G=this.getCellGeometry(A);null!=G&&G.relative;)A=this.getModel().getParent(A),G=this.getCellGeometry(A);return A};Graph.prototype.isPart=function(A){return"1"==mxUtils.getValue(this.getCurrentCellStyle(A),"part","0")||this.isTableCell(A)||this.isTableRow(A)};Graph.prototype.getCompositeParents=function(A){for(var G=new mxDictionary,S=[],F=0;F<A.length;F++){var K=this.getCompositeParent(A[F]);+this.isTableCell(K)&&(K=this.graph.model.getParent(K));this.isTableRow(K)&&(K=this.graph.model.getParent(K));null==K||G.get(K)||(G.put(K,!0),S.push(K))}return S};Graph.prototype.getReferenceTerminal=function(A){if(null!=A){var G=this.getCellGeometry(A);null!=G&&G.relative&&(A=this.model.getParent(A))}null!=A&&this.model.isEdge(A)&&(A=this.model.getParent(A));null!=A&&(A=this.getCompositeParent(A));return A};Graph.prototype.getCompositeParent=function(A){for(;this.isPart(A);){var G=this.model.getParent(A);+if(!this.model.isVertex(G))break;A=G}return A};Graph.prototype.filterSelectionCells=function(A){var G=this.getSelectionCells();if(null!=A){for(var S=[],F=0;F<G.length;F++)A(G[F])||S.push(G[F]);G=S}return G};var b=mxGraph.prototype.scrollRectToVisible;Graph.prototype.scrollRectToVisible=function(A){if(this.useCssTransforms){var G=this.currentScale,S=this.currentTranslate;A=new mxRectangle((A.x+2*S.x)*G-S.x,(A.y+2*S.y)*G-S.y,A.width*G,A.height*G)}b.apply(this,arguments)};mxCellHighlight.prototype.getStrokeWidth=+function(A){A=this.strokeWidth;this.graph.useCssTransforms&&(A/=this.graph.currentScale);return A};mxGraphView.prototype.getGraphBounds=function(){var A=this.graphBounds;if(this.graph.useCssTransforms){var G=this.graph.currentTranslate,S=this.graph.currentScale;A=new mxRectangle((A.x+G.x)*S,(A.y+G.y)*S,A.width*S,A.height*S)}return A};mxGraphView.prototype.viewStateChanged=function(){this.graph.useCssTransforms?this.validate():this.revalidate();this.graph.sizeDidChange()};var e=mxGraphView.prototype.validate;mxGraphView.prototype.validate=function(A){this.graph.useCssTransforms&&(this.graph.currentScale=this.scale,this.graph.currentTranslate.x=this.translate.x,this.graph.currentTranslate.y=this.translate.y,this.scale=1,this.translate.x=0,this.translate.y=0);e.apply(this,arguments);this.graph.useCssTransforms&&(this.graph.updateCssTransform(),this.scale=this.graph.currentScale,this.translate.x=this.graph.currentTranslate.x,this.translate.y=this.graph.currentTranslate.y)};var g=mxGraph.prototype.getCellsForGroup;-Graph.prototype.getCellsForGroup=function(A){A=g.apply(this,arguments);for(var H=[],S=0;S<A.length;S++)this.isTableRow(A[S])||this.isTableCell(A[S])||H.push(A[S]);return H};var m=mxGraph.prototype.getCellsForUngroup;Graph.prototype.getCellsForUngroup=function(A){A=m.apply(this,arguments);for(var H=[],S=0;S<A.length;S++)this.isTable(A[S])||this.isTableRow(A[S])||this.isTableCell(A[S])||H.push(A[S]);return H};Graph.prototype.updateCssTransform=function(){var A=this.view.getDrawPane();if(null!=A)if(A=-A.parentNode,this.useCssTransforms){var H=A.getAttribute("transform");A.setAttribute("transformOrigin","0 0");var S=Math.round(100*this.currentScale)/100;A.setAttribute("transform","scale("+S+","+S+")translate("+Math.round(100*this.currentTranslate.x)/100+","+Math.round(100*this.currentTranslate.y)/100+")");H!=A.getAttribute("transform")&&this.fireEvent(new mxEventObject("cssTransformChanged"),"transform",A.getAttribute("transform"))}else A.removeAttribute("transformOrigin"),A.removeAttribute("transform")};-var v=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){var A=this.graph.useCssTransforms,H=this.scale,S=this.translate;A&&(this.scale=this.graph.currentScale,this.translate=this.graph.currentTranslate);v.apply(this,arguments);A&&(this.scale=H,this.translate=S)};var p=mxGraph.prototype.updatePageBreaks;mxGraph.prototype.updatePageBreaks=function(A,H,S){var F=this.useCssTransforms,K=this.view.scale,c=this.view.translate;F&&(this.view.scale=1,this.view.translate=-new mxPoint(0,0),this.useCssTransforms=!1);p.apply(this,arguments);F&&(this.view.scale=K,this.view.translate=c,this.useCssTransforms=!0)}})();Graph.prototype.isLightboxView=function(){return this.lightbox};Graph.prototype.isViewer=function(){return!1};+Graph.prototype.getCellsForGroup=function(A){A=g.apply(this,arguments);for(var G=[],S=0;S<A.length;S++)this.isTableRow(A[S])||this.isTableCell(A[S])||G.push(A[S]);return G};var m=mxGraph.prototype.getCellsForUngroup;Graph.prototype.getCellsForUngroup=function(A){A=m.apply(this,arguments);for(var G=[],S=0;S<A.length;S++)this.isTable(A[S])||this.isTableRow(A[S])||this.isTableCell(A[S])||G.push(A[S]);return G};Graph.prototype.updateCssTransform=function(){var A=this.view.getDrawPane();if(null!=A)if(A=+A.parentNode,this.useCssTransforms){var G=A.getAttribute("transform");A.setAttribute("transformOrigin","0 0");var S=Math.round(100*this.currentScale)/100;A.setAttribute("transform","scale("+S+","+S+")translate("+Math.round(100*this.currentTranslate.x)/100+","+Math.round(100*this.currentTranslate.y)/100+")");G!=A.getAttribute("transform")&&this.fireEvent(new mxEventObject("cssTransformChanged"),"transform",A.getAttribute("transform"))}else A.removeAttribute("transformOrigin"),A.removeAttribute("transform")};+var v=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){var A=this.graph.useCssTransforms,G=this.scale,S=this.translate;A&&(this.scale=this.graph.currentScale,this.translate=this.graph.currentTranslate);v.apply(this,arguments);A&&(this.scale=G,this.translate=S)};var n=mxGraph.prototype.updatePageBreaks;mxGraph.prototype.updatePageBreaks=function(A,G,S){var F=this.useCssTransforms,K=this.view.scale,c=this.view.translate;F&&(this.view.scale=1,this.view.translate=+new mxPoint(0,0),this.useCssTransforms=!1);n.apply(this,arguments);F&&(this.view.scale=K,this.view.translate=c,this.useCssTransforms=!0)}})();Graph.prototype.isLightboxView=function(){return this.lightbox};Graph.prototype.isViewer=function(){return!1};Graph.prototype.labelLinkClicked=function(b,e,g){var m=e.getAttribute("href");m!=Graph.sanitizeLink(m)&&Graph.sanitizeNode(e);if(null!=m&&!this.isCustomLink(m)&&(mxEvent.isLeftMouseButton(g)&&!mxEvent.isPopupTrigger(g)||mxEvent.isTouchEvent(g))){if(!this.isEnabled()||this.isCellLocked(b.cell))b=this.isBlankLink(m)?this.linkTarget:"_top",this.openLink(this.getAbsoluteUrl(m),b);mxEvent.consume(g)}};-Graph.prototype.openLink=function(b,e,g){var m=window;try{if(b=Graph.sanitizeLink(b),null!=b)if("_self"==e&&window!=window.top)window.location.href=b;else if(b.substring(0,this.baseUrl.length)==this.baseUrl&&"#"==b.charAt(this.baseUrl.length)&&"_top"==e&&window==window.top){var v=b.split("#")[1];window.location.hash=="#"+v&&(window.location.hash="");window.location.hash=v}else m=window.open(b,null!=e?e:"_blank",g?null:"noopener,noreferrer"),null==m||g||(m.opener=null)}catch(p){}return m};+Graph.prototype.openLink=function(b,e,g){var m=window;try{if(b=Graph.sanitizeLink(b),null!=b)if("_self"==e&&window!=window.top)window.location.href=b;else if(b.substring(0,this.baseUrl.length)==this.baseUrl&&"#"==b.charAt(this.baseUrl.length)&&"_top"==e&&window==window.top){var v=b.split("#")[1];window.location.hash=="#"+v&&(window.location.hash="");window.location.hash=v}else m=window.open(b,null!=e?e:"_blank",g?null:"noopener,noreferrer"),null==m||g||(m.opener=null)}catch(n){}return m};Graph.prototype.getLinkTitle=function(b){return b.substring(b.lastIndexOf("/")+1)};Graph.prototype.isCustomLink=function(b){return"data:"==b.substring(0,5)};Graph.prototype.customLinkClicked=function(b,e){return!1};Graph.prototype.isExternalProtocol=function(b){return"mailto:"===b.substring(0,7)};Graph.prototype.isBlankLink=function(b){return!this.isExternalProtocol(b)&&("blank"===this.linkPolicy||"self"!==this.linkPolicy&&!this.isRelativeUrl(b)&&b.substring(0,this.domainUrl.length)!==this.domainUrl)};Graph.prototype.isRelativeUrl=function(b){return null!=b&&!this.absoluteUrlPattern.test(b)&&"data:"!==b.substring(0,5)&&!this.isExternalProtocol(b)};Graph.prototype.getAbsoluteUrl=function(b){null!=b&&this.isRelativeUrl(b)&&(b="#"==b.charAt(0)?this.baseUrl+b:"/"==b.charAt(0)?this.domainUrl+b:this.domainPathUrl+b);return b};Graph.prototype.initLayoutManager=function(){this.layoutManager=new mxLayoutManager(this);this.layoutManager.hasLayout=function(b){return null!=this.graph.getCellStyle(b).childLayout};this.layoutManager.getLayout=function(b,e){var g=this.graph.model.getParent(b);if(!this.graph.isCellCollapsed(b)&&(e!=mxEvent.BEGIN_UPDATE||this.hasLayout(g,e))){b=this.graph.getCellStyle(b);if("stackLayout"==b.childLayout)return e=new mxStackLayout(this.graph,!0),e.resizeParentMax="1"==mxUtils.getValue(b,"resizeParentMax",@@ -2382,15 +2386,15 @@ b.childLayout)return e=new mxCompactTreeLayout(this.graph),e.horizontal="1"==mxUe.parallelEdgeSpacing=mxUtils.getValue(b,"parallelEdgeSpacing",mxHierarchicalLayout.prototype.parallelEdgeSpacing),e;if("circleLayout"==b.childLayout)return new mxCircleLayout(this.graph);if("organicLayout"==b.childLayout)return new mxFastOrganicLayout(this.graph);if("tableLayout"==b.childLayout)return new TableLayout(this.graph);if(null!=b.childLayout&&"["==String(b.childLayout).charAt(0))try{return new mxCompositeLayout(this.graph,this.graph.createLayouts(JSON.parse(b.childLayout)))}catch(m){null!=window.console&&console.error(m)}}return null}};Graph.prototype.createLayouts=function(b){for(var e=[],g=0;g<b.length;g++)if(0<=mxUtils.indexOf(Graph.layoutNames,b[g].layout)){var m="mxOrgChartLayout"==b[g].layout&&null!=b[g].config?new window[b[g].layout](this,b[g].config.branchOptimizer):new window[b[g].layout](this);if(null!=b[g].config)for(var v in b[g].config)if("mxOrgChartLayout"!=b[g].layout||"branchOptimizer"!=v)m[v]=b[g].config[v];e.push(m)}else throw Error(mxResources.get("invalidCallFnNotFound",[b[g].layout]));return e};-Graph.prototype.getDataForCells=function(b,e){for(var g=[],m=0;m<b.length;m++){var v={};v.id=b[m].id;var p=null!=b[m].value?b[m].value.attributes:null;this.isReplacePlaceholders(b[m])&&e&&(v.value=this.getLabel(b[m]));if(null!=p)for(var A=0;A<p.length;A++)v[p[A].nodeName]=p[A].nodeValue;else v.label=this.convertValueToString(b[m]);g.push(v)}return g};-Graph.prototype.getNodesForCells=function(b){for(var e=[],g=0;g<b.length;g++){var m=this.view.getState(b[g]);if(null!=m){for(var v=this.cellRenderer.getShapesForState(m),p=0;p<v.length;p++)null!=v[p]&&null!=v[p].node&&e.push(v[p].node);null!=m.control&&null!=m.control.node&&e.push(m.control.node)}}return e};+Graph.prototype.getDataForCells=function(b,e){for(var g=[],m=0;m<b.length;m++){var v={};v.id=b[m].id;var n=null!=b[m].value?b[m].value.attributes:null;this.isReplacePlaceholders(b[m])&&e&&(v.value=this.getLabel(b[m]));if(null!=n)for(var A=0;A<n.length;A++)v[n[A].nodeName]=n[A].nodeValue;else v.label=this.convertValueToString(b[m]);g.push(v)}return g};+Graph.prototype.getNodesForCells=function(b){for(var e=[],g=0;g<b.length;g++){var m=this.view.getState(b[g]);if(null!=m){for(var v=this.cellRenderer.getShapesForState(m),n=0;n<v.length;n++)null!=v[n]&&null!=v[n].node&&e.push(v[n].node);null!=m.control&&null!=m.control.node&&e.push(m.control.node)}}return e};Graph.prototype.createWipeAnimations=function(b,e){for(var g=[],m=0;m<b.length;m++){var v=this.view.getState(b[m]);null!=v&&null!=v.shape&&(this.model.isEdge(v.cell)&&null!=v.absolutePoints&&1<v.absolutePoints.length?g.push(this.createEdgeWipeAnimation(v,e)):this.model.isVertex(v.cell)&&null!=v.shape.bounds&&g.push(this.createVertexWipeAnimation(v,e)))}return g};-Graph.prototype.createEdgeWipeAnimation=function(b,e){var g=b.absolutePoints.slice(),m=b.segments,v=b.length,p=g.length;return{execute:mxUtils.bind(this,function(A,H){if(null!=b.shape){var S=[g[0]];H=A/H;e||(H=1-H);for(var F=v*H,K=1;K<p;K++)if(F<=m[K-1]){S.push(new mxPoint(g[K-1].x+(g[K].x-g[K-1].x)*F/m[K-1],g[K-1].y+(g[K].y-g[K-1].y)*F/m[K-1]));break}else F-=m[K-1],S.push(g[K]);b.shape.points=S;b.shape.redraw();0==A&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1);null!=b.text&&null!=-b.text.node&&(b.text.node.style.opacity=H)}}),stop:mxUtils.bind(this,function(){null!=b.shape&&(b.shape.points=g,b.shape.redraw(),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),e?1:0))})}};+Graph.prototype.createEdgeWipeAnimation=function(b,e){var g=b.absolutePoints.slice(),m=b.segments,v=b.length,n=g.length;return{execute:mxUtils.bind(this,function(A,G){if(null!=b.shape){var S=[g[0]];G=A/G;e||(G=1-G);for(var F=v*G,K=1;K<n;K++)if(F<=m[K-1]){S.push(new mxPoint(g[K-1].x+(g[K].x-g[K-1].x)*F/m[K-1],g[K-1].y+(g[K].y-g[K-1].y)*F/m[K-1]));break}else F-=m[K-1],S.push(g[K]);b.shape.points=S;b.shape.redraw();0==A&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1);null!=b.text&&null!=+b.text.node&&(b.text.node.style.opacity=G)}}),stop:mxUtils.bind(this,function(){null!=b.shape&&(b.shape.points=g,b.shape.redraw(),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),e?1:0))})}};Graph.prototype.createVertexWipeAnimation=function(b,e){var g=new mxRectangle.fromRectangle(b.shape.bounds);return{execute:mxUtils.bind(this,function(m,v){null!=b.shape&&(v=m/v,e||(v=1-v),b.shape.bounds=new mxRectangle(g.x,g.y,g.width*v,g.height),b.shape.redraw(),0==m&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=v))}),stop:mxUtils.bind(this,function(){null!=b.shape&&(b.shape.bounds=g,b.shape.redraw(),null!=b.text&&null!=b.text.node&&-(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),e?1:0))})}};Graph.prototype.executeAnimations=function(b,e,g,m){g=null!=g?g:30;m=null!=m?m:30;var v=null,p=0,A=mxUtils.bind(this,function(){if(p==g||this.stoppingCustomActions){window.clearInterval(v);for(var H=0;H<b.length;H++)b[H].stop();null!=e&&e()}else for(H=0;H<b.length;H++)b[H].execute(p,g);p++});v=window.setInterval(A,m);A()};+(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),e?1:0))})}};Graph.prototype.executeAnimations=function(b,e,g,m){g=null!=g?g:30;m=null!=m?m:30;var v=null,n=0,A=mxUtils.bind(this,function(){if(n==g||this.stoppingCustomActions){window.clearInterval(v);for(var G=0;G<b.length;G++)b[G].stop();null!=e&&e()}else for(G=0;G<b.length;G++)b[G].execute(n,g);n++});v=window.setInterval(A,m);A()};Graph.prototype.getPageSize=function(){return this.pageVisible&&null!=this.pageFormat?new mxRectangle(0,0,this.pageFormat.width*this.pageScale,this.pageFormat.height*this.pageScale):this.scrollTileSize};-Graph.prototype.getPageLayout=function(b,e,g){b=null!=b?b:this.getGraphBounds();e=null!=e?e:this.view.translate;g=null!=g?g:this.view.scale;var m=this.getPageSize();if(0==b.width||0==b.height)return new mxRectangle(0,0,1,1);var v=Math.floor(Math.ceil(b.x/g-e.x)/m.width),p=Math.floor(Math.ceil(b.y/g-e.y)/m.height);return new mxRectangle(v,p,Math.ceil((Math.floor((b.x+b.width)/g)-e.x)/m.width)-v,Math.ceil((Math.floor((b.y+b.height)/g)-e.y)/m.height)-p)};+Graph.prototype.getPageLayout=function(b,e,g){b=null!=b?b:this.getGraphBounds();e=null!=e?e:this.view.translate;g=null!=g?g:this.view.scale;var m=this.getPageSize();if(0==b.width||0==b.height)return new mxRectangle(0,0,1,1);var v=Math.floor(Math.ceil(b.x/g-e.x)/m.width),n=Math.floor(Math.ceil(b.y/g-e.y)/m.height);return new mxRectangle(v,n,Math.ceil((Math.floor((b.x+b.width)/g)-e.x)/m.width)-v,Math.ceil((Math.floor((b.y+b.height)/g)-e.y)/m.height)-n)};Graph.prototype.getDefaultTranslate=function(b){var e=this.getPagePadding(),g=this.getPageSize();return new mxPoint(e.x-b.x*g.width,e.y-b.y*g.height)};Graph.prototype.updateMinimumSize=function(){var b=this.getPageLayout(),e=this.getPagePadding(),g=this.getPageSize(),m=Math.ceil(2*e.x+b.width*g.width);b=Math.ceil(2*e.y+b.height*g.height);if(null==this.minimumGraphSize||this.minimumGraphSize.width!=m||this.minimumGraphSize.height!=b)this.minimumGraphSize=new mxRectangle(0,0,m,b)};Graph.prototype.sanitizeHtml=function(b,e){return Graph.sanitizeHtml(b,e)};Graph.prototype.updatePlaceholders=function(){var b=!1,e;for(e in this.model.cells){var g=this.model.cells[e];this.isReplacePlaceholders(g)&&(this.view.invalidate(g,!1,!1),b=!0)}b&&this.view.validate()};Graph.prototype.isReplacePlaceholders=function(b){return null!=b.value&&"object"==typeof b.value&&"1"==b.value.getAttribute("placeholders")};Graph.prototype.isZoomWheelEvent=function(b){return Graph.zoomWheel&&!mxEvent.isShiftDown(b)&&!mxEvent.isMetaDown(b)&&!mxEvent.isAltDown(b)&&(!mxEvent.isControlDown(b)||mxClient.IS_MAC)||!Graph.zoomWheel&&(mxEvent.isAltDown(b)||mxEvent.isControlDown(b))};Graph.prototype.isScrollWheelEvent=function(b){return!this.isZoomWheelEvent(b)};Graph.prototype.isTransparentClickEvent=function(b){return mxEvent.isAltDown(b)||mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(b)};@@ -2399,32 +2403,32 @@ Graph.prototype.isSplitTarget=function(b,e,g){return!this.model.isEdge(e[0])&&!mGraph.prototype.isLabelMovable=function(b){var e=this.getCurrentCellStyle(b);return!this.isCellLocked(b)&&(this.model.isEdge(b)&&this.edgeLabelsMovable||this.model.isVertex(b)&&(this.vertexLabelsMovable||"1"==mxUtils.getValue(e,"labelMovable","0")))};Graph.prototype.setGridSize=function(b){this.gridSize=b;this.fireEvent(new mxEventObject("gridSizeChanged"))};Graph.prototype.setDefaultParent=function(b){this.defaultParent=b;this.fireEvent(new mxEventObject("defaultParentChanged"))};Graph.prototype.getClickableLinkForCell=function(b){do{var e=this.getLinkForCell(b);if(null!=e)return e;b=this.model.getParent(b)}while(null!=b);return null};Graph.prototype.getGlobalVariable=function(b){var e=null;"date"==b?e=(new Date).toLocaleDateString():"time"==b?e=(new Date).toLocaleTimeString():"timestamp"==b?e=(new Date).toLocaleString():"date{"==b.substring(0,5)&&(b=b.substring(5,b.length-1),e=this.formatDate(new Date,b));return e};Graph.prototype.formatDate=function(b,e,g){null==this.dateFormatCache&&(this.dateFormatCache={i18n:{dayNames:"Sun Mon Tue Wed Thu Fri Sat Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),monthNames:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec January February March April May June July August September October November December".split(" ")},masks:{"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",-shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});var m=this.dateFormatCache,v=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,p=/[^-+\dA-Z]/g,A=function(G,N){G=String(G);for(N=N||2;G.length<N;)G="0"+G;return G};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(b)||-/\d/.test(b)||(e=b,b=void 0);b=b?new Date(b):new Date;if(isNaN(b))throw SyntaxError("invalid date");e=String(m.masks[e]||e||m.masks["default"]);"UTC:"==e.slice(0,4)&&(e=e.slice(4),g=!0);var H=g?"getUTC":"get",S=b[H+"Date"](),F=b[H+"Day"](),K=b[H+"Month"](),c=b[H+"FullYear"](),f=b[H+"Hours"](),l=b[H+"Minutes"](),t=b[H+"Seconds"]();H=b[H+"Milliseconds"]();var q=g?0:b.getTimezoneOffset(),D={d:S,dd:A(S),ddd:m.i18n.dayNames[F],dddd:m.i18n.dayNames[F+7],m:K+1,mm:A(K+1),mmm:m.i18n.monthNames[K],mmmm:m.i18n.monthNames[K+-12],yy:String(c).slice(2),yyyy:c,h:f%12||12,hh:A(f%12||12),H:f,HH:A(f),M:l,MM:A(l),s:t,ss:A(t),l:A(H,3),L:A(99<H?Math.round(H/10):H),t:12>f?"a":"p",tt:12>f?"am":"pm",T:12>f?"A":"P",TT:12>f?"AM":"PM",Z:g?"UTC":(String(b).match(v)||[""]).pop().replace(p,""),o:(0<q?"-":"+")+A(100*Math.floor(Math.abs(q)/60)+Math.abs(q)%60,4),S:["th","st","nd","rd"][3<S%10?0:(10!=S%100-S%10)*S%10]};return e.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(G){return G in D?D[G]:G.slice(1,-G.length-1)})};Graph.prototype.getLayerForCell=function(b){for(;null!=b&&!this.model.isLayer(b);)b=this.model.getParent(b);return b};Graph.prototype.getLayerForCells=function(b){var e=null;if(0<b.length){e=this.getLayerForCell(b[0]);for(var g=1;g<b.length;g++)if(!this.model.isAncestor(e,b[g])){e=null;break}}return e};-Graph.prototype.createLayersDialog=function(b,e){var g=document.createElement("div");g.style.position="absolute";for(var m=this.getModel(),v=m.getChildCount(m.root),p=0;p<v;p++)mxUtils.bind(this,function(A){function H(){m.isVisible(A)?(K.setAttribute("src",Editor.visibleImage),mxUtils.setOpacity(F,75)):(K.setAttribute("src",Editor.hiddenImage),mxUtils.setOpacity(F,25))}var S=this.convertValueToString(A)||mxResources.get("background")||"Background",F=document.createElement("div");F.style.overflow=+shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});var m=this.dateFormatCache,v=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,n=/[^-+\dA-Z]/g,A=function(H,N){H=String(H);for(N=N||2;H.length<N;)H="0"+H;return H};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(b)||+/\d/.test(b)||(e=b,b=void 0);b=b?new Date(b):new Date;if(isNaN(b))throw SyntaxError("invalid date");e=String(m.masks[e]||e||m.masks["default"]);"UTC:"==e.slice(0,4)&&(e=e.slice(4),g=!0);var G=g?"getUTC":"get",S=b[G+"Date"](),F=b[G+"Day"](),K=b[G+"Month"](),c=b[G+"FullYear"](),f=b[G+"Hours"](),l=b[G+"Minutes"](),t=b[G+"Seconds"]();G=b[G+"Milliseconds"]();var q=g?0:b.getTimezoneOffset(),D={d:S,dd:A(S),ddd:m.i18n.dayNames[F],dddd:m.i18n.dayNames[F+7],m:K+1,mm:A(K+1),mmm:m.i18n.monthNames[K],mmmm:m.i18n.monthNames[K++12],yy:String(c).slice(2),yyyy:c,h:f%12||12,hh:A(f%12||12),H:f,HH:A(f),M:l,MM:A(l),s:t,ss:A(t),l:A(G,3),L:A(99<G?Math.round(G/10):G),t:12>f?"a":"p",tt:12>f?"am":"pm",T:12>f?"A":"P",TT:12>f?"AM":"PM",Z:g?"UTC":(String(b).match(v)||[""]).pop().replace(n,""),o:(0<q?"-":"+")+A(100*Math.floor(Math.abs(q)/60)+Math.abs(q)%60,4),S:["th","st","nd","rd"][3<S%10?0:(10!=S%100-S%10)*S%10]};return e.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(H){return H in D?D[H]:H.slice(1,+H.length-1)})};Graph.prototype.getLayerForCell=function(b){for(;null!=b&&!this.model.isLayer(b);)b=this.model.getParent(b);return b};Graph.prototype.getLayerForCells=function(b){var e=null;if(0<b.length){e=this.getLayerForCell(b[0]);for(var g=1;g<b.length;g++)if(!this.model.isAncestor(e,b[g])){e=null;break}}return e};+Graph.prototype.createLayersDialog=function(b,e){var g=document.createElement("div");g.style.position="absolute";for(var m=this.getModel(),v=m.getChildCount(m.root),n=0;n<v;n++)mxUtils.bind(this,function(A){function G(){m.isVisible(A)?(K.setAttribute("src",Editor.visibleImage),mxUtils.setOpacity(F,75)):(K.setAttribute("src",Editor.hiddenImage),mxUtils.setOpacity(F,25))}var S=this.convertValueToString(A)||mxResources.get("background")||"Background",F=document.createElement("div");F.style.overflow="hidden";F.style.textOverflow="ellipsis";F.style.padding="2px";F.style.whiteSpace="nowrap";F.style.cursor="pointer";F.setAttribute("title",mxResources.get(m.isVisible(A)?"hideIt":"show",[S]));var K=document.createElement("img");K.setAttribute("draggable","false");K.setAttribute("align","absmiddle");K.setAttribute("border","0");K.style.position="relative";K.style.width="16px";K.style.padding="0px 6px 0 4px";e&&(K.style.filter="invert(100%)",K.style.top="-2px");F.appendChild(K);mxUtils.write(F,S);g.appendChild(F);-mxEvent.addListener(F,"click",function(){m.setVisible(A,!m.isVisible(A));H();null!=b&&b(A)});H()})(m.getChildAt(m.root,p));return g};-Graph.prototype.replacePlaceholders=function(b,e,g,m){m=[];if(null!=e){for(var v=0;match=this.placeholderPattern.exec(e);){var p=match[0];if(2<p.length&&"%label%"!=p&&"%tooltip%"!=p){var A=null;if(match.index>v&&"%"==e.charAt(match.index-1))A=p.substring(1);else{var H=p.substring(1,p.length-1),S={mm:mxConstants.MILLIMETERS,"in":mxConstants.INCHES,m:mxConstants.METERS,current:this.view.unit};if("id"==H)A=b.id;else if("width"===H.substring(0,5)&&this.model.isVertex(b)){var F=this.getCellGeometry(b);-null!=F&&(A=F.width,5<H.length&&(A=Editor.toUnit(A,S[H.substring(6)])))}else if("height"==H.substring(0,6)&&this.model.isVertex(b))F=this.getCellGeometry(b),null!=F&&(A=F.height,6<H.length&&(A=Editor.toUnit(A,S[H.substring(7)])));else if("length"==H.substring(0,6)){for(F=b;null!=F&&!this.model.isEdge(F);)F=this.model.getParent(F);F=this.view.getState(F);null!=F&&(A=Math.round(F.length/this.view.scale),6<H.length&&(A=Editor.toUnit(A,S[H.substring(7)])))}else if(0>H.indexOf("{"))for(S=b;null==A&&null!=-S;)null!=S.value&&"object"==typeof S.value&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(A=S.getAttribute(H+"_"+Graph.diagramLanguage)),null==A&&(A=S.hasAttribute(H)?null!=S.getAttribute(H)?S.getAttribute(H):"":null)),S=this.model.getParent(S);null==A&&(A=this.getGlobalVariable(H));null==A&&null!=g&&(A=g[H])}m.push(e.substring(v,match.index)+(null!=A?A:p));v=match.index+p.length}}m.push(e.substring(v))}return m.join("")};+mxEvent.addListener(F,"click",function(){m.setVisible(A,!m.isVisible(A));G();null!=b&&b(A)});G()})(m.getChildAt(m.root,n));return g};+Graph.prototype.replacePlaceholders=function(b,e,g,m){m=[];if(null!=e){for(var v=0;match=this.placeholderPattern.exec(e);){var n=match[0];if(2<n.length&&"%label%"!=n&&"%tooltip%"!=n){var A=null;if(match.index>v&&"%"==e.charAt(match.index-1))A=n.substring(1);else{var G=n.substring(1,n.length-1),S={mm:mxConstants.MILLIMETERS,"in":mxConstants.INCHES,m:mxConstants.METERS,current:this.view.unit};if("id"==G)A=b.id;else if("width"===G.substring(0,5)&&this.model.isVertex(b)){var F=this.getCellGeometry(b);+null!=F&&(A=F.width,5<G.length&&(A=Editor.toUnit(A,S[G.substring(6)])))}else if("height"==G.substring(0,6)&&this.model.isVertex(b))F=this.getCellGeometry(b),null!=F&&(A=F.height,6<G.length&&(A=Editor.toUnit(A,S[G.substring(7)])));else if("length"==G.substring(0,6)){for(F=b;null!=F&&!this.model.isEdge(F);)F=this.model.getParent(F);F=this.view.getState(F);null!=F&&(A=Math.round(F.length/this.view.scale),6<G.length&&(A=Editor.toUnit(A,S[G.substring(7)])))}else if(0>G.indexOf("{"))for(S=b;null==A&&null!=+S;)null!=S.value&&"object"==typeof S.value&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(A=S.getAttribute(G+"_"+Graph.diagramLanguage)),null==A&&(A=S.hasAttribute(G)?null!=S.getAttribute(G)?S.getAttribute(G):"":null)),S=this.model.getParent(S);null==A&&(A=this.getGlobalVariable(G));null==A&&null!=g&&(A=g[G])}m.push(e.substring(v,match.index)+(null!=A?A:n));v=match.index+n.length}}m.push(e.substring(v))}return m.join("")};Graph.prototype.restoreSelection=function(b){if(null!=b&&0<b.length){for(var e=[],g=0;g<b.length;g++){var m=this.model.getCell(b[g].id);null!=m&&e.push(m)}this.setSelectionCells(e)}else this.clearSelection()};Graph.prototype.selectCellForEvent=function(b,e){mxEvent.isShiftDown(e)&&!this.isSelectionEmpty()&&this.selectTableRange(this.getSelectionCell(),b)||mxGraph.prototype.selectCellForEvent.apply(this,arguments)};-Graph.prototype.selectTableRange=function(b,e){var g=!1;if(this.isTableCell(b)&&this.isTableCell(e)){var m=this.model.getParent(b),v=this.model.getParent(m),p=this.model.getParent(e);if(v==this.model.getParent(p)){b=m.getIndex(b);m=v.getIndex(m);var A=p.getIndex(e),H=v.getIndex(p);p=Math.max(m,H);e=Math.min(b,A);b=Math.max(b,A);A=[];for(m=Math.min(m,H);m<=p;m++){H=this.model.getChildAt(v,m);for(var S=e;S<=b;S++)A.push(this.model.getChildAt(H,S))}0<A.length&&(1<A.length||1<this.getSelectionCount()||+Graph.prototype.selectTableRange=function(b,e){var g=!1;if(this.isTableCell(b)&&this.isTableCell(e)){var m=this.model.getParent(b),v=this.model.getParent(m),n=this.model.getParent(e);if(v==this.model.getParent(n)){b=m.getIndex(b);m=v.getIndex(m);var A=n.getIndex(e),G=v.getIndex(n);n=Math.max(m,G);e=Math.min(b,A);b=Math.max(b,A);A=[];for(m=Math.min(m,G);m<=n;m++){G=this.model.getChildAt(v,m);for(var S=e;S<=b;S++)A.push(this.model.getChildAt(G,S))}0<A.length&&(1<A.length||1<this.getSelectionCount()||!this.isCellSelected(A[0]))&&(this.setSelectionCells(A),g=!0)}}return g};-Graph.prototype.snapCellsToGrid=function(b,e){this.getModel().beginUpdate();try{for(var g=0;g<b.length;g++){var m=b[g],v=this.getCellGeometry(m);if(null!=v){v=v.clone();if(this.getModel().isVertex(m))v.x=Math.round(v.x/e)*e,v.y=Math.round(v.y/e)*e,v.width=Math.round(v.width/e)*e,v.height=Math.round(v.height/e)*e;else if(this.getModel().isEdge(m)&&null!=v.points)for(var p=0;p<v.points.length;p++)v.points[p].x=Math.round(v.points[p].x/e)*e,v.points[p].y=Math.round(v.points[p].y/e)*e;this.getModel().setGeometry(m,+Graph.prototype.snapCellsToGrid=function(b,e){this.getModel().beginUpdate();try{for(var g=0;g<b.length;g++){var m=b[g],v=this.getCellGeometry(m);if(null!=v){v=v.clone();if(this.getModel().isVertex(m))v.x=Math.round(v.x/e)*e,v.y=Math.round(v.y/e)*e,v.width=Math.round(v.width/e)*e,v.height=Math.round(v.height/e)*e;else if(this.getModel().isEdge(m)&&null!=v.points)for(var n=0;n<v.points.length;n++)v.points[n].x=Math.round(v.points[n].x/e)*e,v.points[n].y=Math.round(v.points[n].y/e)*e;this.getModel().setGeometry(m,v)}}}finally{this.getModel().endUpdate()}};Graph.prototype.removeChildCells=function(b){this.model.beginUpdate();try{for(var e=this.model.getChildCount(b);0<=e;e--)this.model.remove(this.model.getChildAt(b,e))}finally{this.model.endUpdate()}};-Graph.prototype.updateShapes=function(b,e,g){this.model.beginUpdate();try{var m=this.model.getStyle(b),v=g?this.stylesheet.getCellStyle(m,{},!1):null;null!=v&&null==v[mxConstants.STYLE_SHAPE]&&(this.model.isVertex(b)?v[mxConstants.STYLE_SHAPE]=this.stylesheet.getDefaultVertexStyle()[mxConstants.STYLE_SHAPE]:this.model.isEdge(b)&&(v[mxConstants.STYLE_SHAPE]=this.stylesheet.getDefaultEdgeStyle()[mxConstants.STYLE_SHAPE]));for(var p=0;p<e.length;p++){if(this.model.isVertex(b)&&this.model.isVertex(e[p])||-this.model.isEdge(b)&&this.model.isEdge(e[p]))if(g){var A=this.model.getStyle(e[p]);if(null!=A){var H=A.split(";");0<H.length&&0>H[0].indexOf("=")&&(H=H.slice(1));this.model.setStyle(e[p],H.join(";"))}this.setCellStyles(mxConstants.STYLE_PERIMETER,null,[e[p]]);this.setCellStyles("points",null,[e[p]]);this.pasteStyle(v,[e[p]],null,!0)}else v=this.copyStyle(e[p]),this.model.setStyle(e[p],m),this.pasteStyle(v,[e[p]]);"1"==mxUtils.getValue(this.getCellStyle(e[p],!1),"composite","0")&&this.removeChildCells(e[p])}}finally{this.model.endUpdate()}};+Graph.prototype.updateShapes=function(b,e,g){this.model.beginUpdate();try{var m=this.model.getStyle(b),v=g?this.stylesheet.getCellStyle(m,{},!1):null;null!=v&&null==v[mxConstants.STYLE_SHAPE]&&(this.model.isVertex(b)?v[mxConstants.STYLE_SHAPE]=this.stylesheet.getDefaultVertexStyle()[mxConstants.STYLE_SHAPE]:this.model.isEdge(b)&&(v[mxConstants.STYLE_SHAPE]=this.stylesheet.getDefaultEdgeStyle()[mxConstants.STYLE_SHAPE]));for(var n=0;n<e.length;n++){if(this.model.isVertex(b)&&this.model.isVertex(e[n])||+this.model.isEdge(b)&&this.model.isEdge(e[n]))if(g){var A=this.model.getStyle(e[n]);if(null!=A){var G=A.split(";");0<G.length&&0>G[0].indexOf("=")&&(G=G.slice(1));this.model.setStyle(e[n],G.join(";"))}this.setCellStyles(mxConstants.STYLE_PERIMETER,null,[e[n]]);this.setCellStyles("points",null,[e[n]]);this.pasteStyle(v,[e[n]],null,!0)}else v=this.copyStyle(e[n]),this.model.setStyle(e[n],m),this.pasteStyle(v,[e[n]]);"1"==mxUtils.getValue(this.getCellStyle(e[n],!1),"composite","0")&&this.removeChildCells(e[n])}}finally{this.model.endUpdate()}};Graph.prototype.selectCellsForConnectVertex=function(b,e,g){2==b.length&&this.model.isVertex(b[1])?(this.setSelectionCell(b[1]),this.scrollCellToVisible(b[1]),null!=g&&(mxEvent.isTouchEvent(e)?g.update(g.getState(this.view.getState(b[1]))):g.reset())):this.setSelectionCells(b)};Graph.prototype.isCloneConnectSource=function(b){var e=null;null!=this.layoutManager&&(e=this.layoutManager.getLayout(this.model.getParent(b)));return this.isTableRow(b)||this.isTableCell(b)||null!=e&&e.constructor==mxStackLayout};Graph.prototype.insertEdgeBeforeCell=function(b,e){for(var g=e;null!=g.parent&&null!=g.geometry&&g.geometry.relative&&g.parent!=b.parent;)g=this.model.getParent(g);null!=g&&null!=g.parent&&g.parent==b.parent&&(e=g.parent.getIndex(g),this.model.add(g.parent,b,e))};-Graph.prototype.connectVertex=function(b,e,g,m,v,p,A,H){p=p?p:!1;if(b.geometry.relative&&this.model.isEdge(b.parent))return[];for(;b.geometry.relative&&this.model.isVertex(b.parent);)b=b.parent;var S=this.isCloneConnectSource(b),F=S?b:this.getCompositeParent(b),K=b.geometry.relative&&null!=b.parent.geometry?new mxPoint(b.parent.geometry.width*b.geometry.x,b.parent.geometry.height*b.geometry.y):new mxPoint(F.geometry.x,F.geometry.y);e==mxConstants.DIRECTION_NORTH?(K.x+=F.geometry.width/2,K.y-=g):e==-mxConstants.DIRECTION_SOUTH?(K.x+=F.geometry.width/2,K.y+=F.geometry.height+g):(K.x=e==mxConstants.DIRECTION_WEST?K.x-g:K.x+(F.geometry.width+g),K.y+=F.geometry.height/2);var c=this.view.getState(this.model.getParent(b));g=this.view.scale;var f=this.view.translate;F=f.x*g;f=f.y*g;null!=c&&this.model.isVertex(c.cell)&&(F=c.x,f=c.y);this.model.isVertex(b.parent)&&b.geometry.relative&&(K.x+=b.parent.geometry.x,K.y+=b.parent.geometry.y);p=p?null:(new mxRectangle(F+K.x*g,f+K.y*g)).grow(40*g);p=null!=p?-this.getCells(0,0,0,0,null,null,p,null,!0):null;c=this.view.getState(b);var l=null,t=null;if(null!=p){p=p.reverse();for(var q=0;q<p.length;q++)if(!this.isCellLocked(p[q])&&!this.model.isEdge(p[q])&&p[q]!=b)if(!this.model.isAncestor(b,p[q])&&this.isContainer(p[q])&&(null==l||p[q]==this.model.getParent(b)))l=p[q];else if(null==t&&this.isCellConnectable(p[q])&&!this.model.isAncestor(p[q],b)&&!this.isSwimlane(p[q])){var D=this.view.getState(p[q]);null==c||null==D||mxUtils.intersects(c,D)||(t=p[q])}}var G=-!mxEvent.isShiftDown(m)||mxEvent.isControlDown(m)||v;G&&("1"!=urlParams.sketch||v)&&(e==mxConstants.DIRECTION_NORTH?K.y-=b.geometry.height/2:e==mxConstants.DIRECTION_SOUTH?K.y+=b.geometry.height/2:K.x=e==mxConstants.DIRECTION_WEST?K.x-b.geometry.width/2:K.x+b.geometry.width/2);var N=[],L=t;t=l;v=mxUtils.bind(this,function(J){if(null==A||null!=J||null==t&&S){this.model.beginUpdate();try{if(null==L&&G){var Y=this.getAbsoluteParent(null!=J?J:b);Y=S?b:this.getCompositeParent(Y);L=null!=J?J:this.duplicateCells([Y],-!1)[0];null!=J&&this.addCells([L],this.model.getParent(b),null,null,null,!0);var ha=this.getCellGeometry(L);null!=ha&&(null!=J&&"1"==urlParams.sketch&&(e==mxConstants.DIRECTION_NORTH?K.y-=ha.height/2:e==mxConstants.DIRECTION_SOUTH?K.y+=ha.height/2:K.x=e==mxConstants.DIRECTION_WEST?K.x-ha.width/2:K.x+ha.width/2),ha.x=K.x-ha.width/2,ha.y=K.y-ha.height/2);null!=l?(this.addCells([L],l,null,null,null,!0),t=null):G&&!S&&this.addCells([L],this.getDefaultParent(),null,null,null,!0)}var ea=mxEvent.isControlDown(m)&&-mxEvent.isShiftDown(m)&&G||null==t&&S?null:this.insertEdge(this.model.getParent(b),null,"",b,L,this.createCurrentEdgeStyle());null!=ea&&(N.push(ea),this.applyNewEdgeStyle(b,[ea],e),this.connectionHandler.insertBeforeSource&&this.insertEdgeBeforeCell(ea,b));if(null==t&&null!=L&&null!=b.parent&&S&&e==mxConstants.DIRECTION_WEST){var aa=b.parent.getIndex(b);this.model.add(b.parent,L,aa)}null==t&&null!=L&&N.push(L);null==L&&null!=ea&&ea.geometry.setTerminalPoint(K,!1);null!=ea&&this.fireEvent(new mxEventObject("cellsInserted",-"cells",[ea]))}finally{this.model.endUpdate()}}if(null!=H)H(N);else return N});if(null==A||null!=L||!G||null==t&&S)return v(L);A(F+K.x*g,f+K.y*g,v)};+Graph.prototype.connectVertex=function(b,e,g,m,v,n,A,G){n=n?n:!1;if(b.geometry.relative&&this.model.isEdge(b.parent))return[];for(;b.geometry.relative&&this.model.isVertex(b.parent);)b=b.parent;var S=this.isCloneConnectSource(b),F=S?b:this.getCompositeParent(b),K=b.geometry.relative&&null!=b.parent.geometry?new mxPoint(b.parent.geometry.width*b.geometry.x,b.parent.geometry.height*b.geometry.y):new mxPoint(F.geometry.x,F.geometry.y);e==mxConstants.DIRECTION_NORTH?(K.x+=F.geometry.width/2,K.y-=g):e==+mxConstants.DIRECTION_SOUTH?(K.x+=F.geometry.width/2,K.y+=F.geometry.height+g):(K.x=e==mxConstants.DIRECTION_WEST?K.x-g:K.x+(F.geometry.width+g),K.y+=F.geometry.height/2);var c=this.view.getState(this.model.getParent(b));g=this.view.scale;var f=this.view.translate;F=f.x*g;f=f.y*g;null!=c&&this.model.isVertex(c.cell)&&(F=c.x,f=c.y);this.model.isVertex(b.parent)&&b.geometry.relative&&(K.x+=b.parent.geometry.x,K.y+=b.parent.geometry.y);n=n?null:(new mxRectangle(F+K.x*g,f+K.y*g)).grow(40*g);n=null!=n?+this.getCells(0,0,0,0,null,null,n,null,!0):null;c=this.view.getState(b);var l=null,t=null;if(null!=n){n=n.reverse();for(var q=0;q<n.length;q++)if(!this.isCellLocked(n[q])&&!this.model.isEdge(n[q])&&n[q]!=b)if(!this.model.isAncestor(b,n[q])&&this.isContainer(n[q])&&(null==l||n[q]==this.model.getParent(b)))l=n[q];else if(null==t&&this.isCellConnectable(n[q])&&!this.model.isAncestor(n[q],b)&&!this.isSwimlane(n[q])){var D=this.view.getState(n[q]);null==c||null==D||mxUtils.intersects(c,D)||(t=n[q])}}var H=+!mxEvent.isShiftDown(m)||mxEvent.isControlDown(m)||v;H&&("1"!=urlParams.sketch||v)&&(e==mxConstants.DIRECTION_NORTH?K.y-=b.geometry.height/2:e==mxConstants.DIRECTION_SOUTH?K.y+=b.geometry.height/2:K.x=e==mxConstants.DIRECTION_WEST?K.x-b.geometry.width/2:K.x+b.geometry.width/2);var N=[],L=t;t=l;v=mxUtils.bind(this,function(J){if(null==A||null!=J||null==t&&S){this.model.beginUpdate();try{if(null==L&&H){var Y=this.getAbsoluteParent(null!=J?J:b);Y=S?b:this.getCompositeParent(Y);L=null!=J?J:this.duplicateCells([Y],+!1)[0];null!=J&&this.addCells([L],this.model.getParent(b),null,null,null,!0);var ha=this.getCellGeometry(L);null!=ha&&(null!=J&&"1"==urlParams.sketch&&(e==mxConstants.DIRECTION_NORTH?K.y-=ha.height/2:e==mxConstants.DIRECTION_SOUTH?K.y+=ha.height/2:K.x=e==mxConstants.DIRECTION_WEST?K.x-ha.width/2:K.x+ha.width/2),ha.x=K.x-ha.width/2,ha.y=K.y-ha.height/2);null!=l?(this.addCells([L],l,null,null,null,!0),t=null):H&&!S&&this.addCells([L],this.getDefaultParent(),null,null,null,!0)}var ea=mxEvent.isControlDown(m)&&+mxEvent.isShiftDown(m)&&H||null==t&&S?null:this.insertEdge(this.model.getParent(b),null,"",b,L,this.createCurrentEdgeStyle());null!=ea&&(N.push(ea),this.applyNewEdgeStyle(b,[ea],e),this.connectionHandler.insertBeforeSource&&this.insertEdgeBeforeCell(ea,b));if(null==t&&null!=L&&null!=b.parent&&S&&e==mxConstants.DIRECTION_WEST){var aa=b.parent.getIndex(b);this.model.add(b.parent,L,aa)}null==t&&null!=L&&N.push(L);null==L&&null!=ea&&ea.geometry.setTerminalPoint(K,!1);null!=ea&&this.fireEvent(new mxEventObject("cellsInserted",+"cells",[ea]))}finally{this.model.endUpdate()}}if(null!=G)G(N);else return N});if(null==A||null!=L||!H||null==t&&S)return v(L);A(F+K.x*g,f+K.y*g,v)};Graph.prototype.getIndexableText=function(b){b=null!=b?b:this.model.getDescendants(this.model.root);for(var e=document.createElement("div"),g=[],m,v=0;v<b.length;v++)if(m=b[v],this.model.isVertex(m)||this.model.isEdge(m))this.isHtmlLabel(m)?(e.innerHTML=Graph.sanitizeHtml(this.getLabel(m)),m=mxUtils.extractTextWithWhitespace([e])):m=this.getLabel(m),m=mxUtils.trim(m.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")),0<m.length&&g.push(m);return g.join(" ")};Graph.prototype.convertValueToString=function(b){var e=this.model.getValue(b);if(null!=e&&"object"==typeof e){var g=null;if(this.isReplacePlaceholders(b)&&null!=b.getAttribute("placeholder")){e=b.getAttribute("placeholder");for(var m=b;null==g&&null!=m;)null!=m.value&&"object"==typeof m.value&&(g=m.hasAttribute(e)?null!=m.getAttribute(e)?m.getAttribute(e):"":null),m=this.model.getParent(m)}else g=null,Graph.translateDiagram&&null!=Graph.diagramLanguage&&(g=e.getAttribute("label_"+Graph.diagramLanguage)),null==g&&(g=e.getAttribute("label")||"");return g||""}return mxGraph.prototype.convertValueToString.apply(this,arguments)};Graph.prototype.getLinksForState=function(b){return null!=b&&null!=b.text&&null!=b.text.node?b.text.node.getElementsByTagName("a"):null};Graph.prototype.getLinkForCell=function(b,e){return null!=b.value&&"object"==typeof b.value?(b=b.value.getAttribute("link"),e||(b=mxUtils.removeJavascriptProtocol(b)),b):null};@@ -2435,23 +2439,23 @@ mxConstants.STYLE_IMAGE_BACKGROUND,b);this.replaceDefaultColor(e,mxConstants.STYGraph.prototype.getDefaultColor=function(b,e,g){e="default"+e.charAt(0).toUpperCase()+e.substring(1);"invert"==b[e]&&(b=mxUtils.getLightDarkColor(g),g="light-dark("+b.dark+", "+b.light+")");return g};Graph.prototype.setAdaptiveColors=function(b){this.adaptiveColors="default"==b?null:b;"1"==urlParams.embedInline?null!=this.container&&(this.container.style.colorScheme="none"==this.getAdaptiveColors()?"light":""):(b=this.view.getDrawPane().ownerSVGElement,null!=b&&(b.style.colorScheme="none"==this.getAdaptiveColors()?"light":""))};Graph.prototype.getAdaptiveColors=function(){return null!=this.adaptiveColors?this.adaptiveColors:Graph.defaultAdaptiveColors};Graph.prototype.updateAlternateBounds=function(b,e,g){if(null!=b&&null!=e&&null!=this.layoutManager&&null!=e.alternateBounds){var m=this.layoutManager.getLayout(this.model.getParent(b));null!=m&&m.constructor==mxStackLayout&&(m.horizontal?e.alternateBounds.height=0:e.alternateBounds.width=0)}mxGraph.prototype.updateAlternateBounds.apply(this,arguments)};Graph.prototype.isMoveCellsEvent=function(b,e){return mxEvent.isShiftDown(b)||"1"==mxUtils.getValue(e.style,"moveCells","0")};-Graph.prototype.foldCells=function(b,e,g,m,v){e=null!=e?e:!1;null==g&&(g=this.getFoldableCells(this.getSelectionCells(),b));if(null!=g){this.model.beginUpdate();try{if(mxGraph.prototype.foldCells.apply(this,arguments),null!=this.layoutManager)for(var p=0;p<g.length;p++){var A=this.view.getState(g[p]),H=this.getCellGeometry(g[p]);if(null!=A&&null!=H){var S=0,F=0;if(H.alternateBounds)S=H.width-H.alternateBounds.width,F=H.height-H.alternateBounds.height;else{var K=this.useCssTransforms?1:this.view.scale;-S=Math.round(H.width-A.width/K);F=Math.round(H.height-A.height/K)}if(0!=F||0!=S){var c=this.model.getParent(g[p]),f=this.layoutManager.getLayout(c);null==f?null!=v&&this.isMoveCellsEvent(v,A)&&this.moveSiblings(A,c,S,F):null!=v&&mxEvent.isAltDown(v)||f.constructor!=mxStackLayout||f.resizeLast||this.resizeParentStacks(c,f,S,F)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(g)}};-Graph.prototype.moveSiblings=function(b,e,g,m){this.model.beginUpdate();try{var v=this.getCellsBeyond(b.x,b.y,e,!0,!0);for(e=0;e<v.length;e++)if(v[e]!=b.cell){var p=this.view.getState(v[e]),A=this.getCellGeometry(v[e]);null!=p&&null!=A&&(A=A.clone(),A.translate(Math.round(g*Math.max(0,Math.min(1,(p.x-b.x)/b.width))),Math.round(m*Math.max(0,Math.min(1,(p.y-b.y)/b.height)))),this.model.setGeometry(v[e],A))}}finally{this.model.endUpdate()}};-Graph.prototype.resizeParentStacks=function(b,e,g,m){if(null!=this.layoutManager&&null!=e&&e.constructor==mxStackLayout&&!e.resizeLast){this.model.beginUpdate();try{for(var v=e.horizontal;null!=b&&null!=e&&e.constructor==mxStackLayout&&e.horizontal==v&&!e.resizeLast;){var p=this.getCellGeometry(b),A=this.view.getState(b);null!=A&&null!=p&&(p=p.clone(),e.horizontal?p.width+=g+Math.min(0,A.width/this.view.scale-p.width):p.height+=m+Math.min(0,A.height/this.view.scale-p.height),this.model.setGeometry(b,-p));b=this.model.getParent(b);e=this.layoutManager.getLayout(b)}}finally{this.model.endUpdate()}}};Graph.prototype.isContainer=function(b){var e=this.getCurrentCellStyle(b);return this.isSwimlane(b)?"0"!=e.container:"1"==e.container};Graph.prototype.isCellConnectable=function(b){var e=this.getCurrentCellStyle(b);return!this.isCellLocked(this.getLayerForCell(b))&&(null!=e.connectable?"0"!=e.connectable:mxGraph.prototype.isCellConnectable.apply(this,arguments))};+Graph.prototype.foldCells=function(b,e,g,m,v){e=null!=e?e:!1;null==g&&(g=this.getFoldableCells(this.getSelectionCells(),b));if(null!=g){this.model.beginUpdate();try{if(mxGraph.prototype.foldCells.apply(this,arguments),null!=this.layoutManager)for(var n=0;n<g.length;n++){var A=this.view.getState(g[n]),G=this.getCellGeometry(g[n]);if(null!=A&&null!=G){var S=0,F=0;if(G.alternateBounds)S=G.width-G.alternateBounds.width,F=G.height-G.alternateBounds.height;else{var K=this.useCssTransforms?1:this.view.scale;+S=Math.round(G.width-A.width/K);F=Math.round(G.height-A.height/K)}if(0!=F||0!=S){var c=this.model.getParent(g[n]),f=this.layoutManager.getLayout(c);null==f?null!=v&&this.isMoveCellsEvent(v,A)&&this.moveSiblings(A,c,S,F):null!=v&&mxEvent.isAltDown(v)||f.constructor!=mxStackLayout||f.resizeLast||this.resizeParentStacks(c,f,S,F)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(g)}};+Graph.prototype.moveSiblings=function(b,e,g,m){this.model.beginUpdate();try{var v=this.getCellsBeyond(b.x,b.y,e,!0,!0);for(e=0;e<v.length;e++)if(v[e]!=b.cell){var n=this.view.getState(v[e]),A=this.getCellGeometry(v[e]);null!=n&&null!=A&&(A=A.clone(),A.translate(Math.round(g*Math.max(0,Math.min(1,(n.x-b.x)/b.width))),Math.round(m*Math.max(0,Math.min(1,(n.y-b.y)/b.height)))),this.model.setGeometry(v[e],A))}}finally{this.model.endUpdate()}};+Graph.prototype.resizeParentStacks=function(b,e,g,m){if(null!=this.layoutManager&&null!=e&&e.constructor==mxStackLayout&&!e.resizeLast){this.model.beginUpdate();try{for(var v=e.horizontal;null!=b&&null!=e&&e.constructor==mxStackLayout&&e.horizontal==v&&!e.resizeLast;){var n=this.getCellGeometry(b),A=this.view.getState(b);null!=A&&null!=n&&(n=n.clone(),e.horizontal?n.width+=g+Math.min(0,A.width/this.view.scale-n.width):n.height+=m+Math.min(0,A.height/this.view.scale-n.height),this.model.setGeometry(b,+n));b=this.model.getParent(b);e=this.layoutManager.getLayout(b)}}finally{this.model.endUpdate()}}};Graph.prototype.isContainer=function(b){var e=this.getCurrentCellStyle(b);return this.isSwimlane(b)?"0"!=e.container:"1"==e.container};Graph.prototype.isCellConnectable=function(b){var e=this.getCurrentCellStyle(b);return!this.isCellLocked(this.getLayerForCell(b))&&(null!=e.connectable?"0"!=e.connectable:mxGraph.prototype.isCellConnectable.apply(this,arguments))};Graph.prototype.isLabelMovable=function(b){var e=this.getCurrentCellStyle(b);return null!=e.movableLabel?"0"!=e.movableLabel:mxGraph.prototype.isLabelMovable.apply(this,arguments)};Graph.prototype.selectAll=function(b){b=b||this.getDefaultParent();this.isCellLocked(b)||mxGraph.prototype.selectAll.apply(this,arguments)};Graph.prototype.selectCells=function(b,e,g){g=g||this.getDefaultParent();this.isCellLocked(g)||mxGraph.prototype.selectCells.apply(this,arguments)};Graph.prototype.getSwimlaneAt=function(b,e,g){var m=mxGraph.prototype.getSwimlaneAt.apply(this,arguments);this.isCellLocked(m)&&(m=null);return m};Graph.prototype.isCellFoldable=function(b){var e=this.getCurrentCellStyle(b);return this.foldingEnabled&&"0"!=mxUtils.getValue(e,mxConstants.STYLE_RESIZABLE,"1")&&("1"==e.treeFolding||!this.isCellLocked(b)&&(this.isContainer(b)&&"0"!=e.collapsible||!this.isContainer(b)&&"1"==e.collapsible))};Graph.prototype.reset=function(){this.isEditing()&&this.stopEditing(!0);this.escape();this.isSelectionEmpty()||this.clearSelection()};Graph.prototype.zoom=function(b,e){b=Math.max(.01,Math.min(this.view.scale*b,160))/this.view.scale;mxGraph.prototype.zoom.apply(this,arguments)};Graph.prototype.zoomIn=function(){.15>this.view.scale?this.zoom((this.view.scale+.01)/this.view.scale):this.zoom(Math.round(this.view.scale*this.zoomFactor*20)/20/this.view.scale)};Graph.prototype.zoomOut=function(){.15>=this.view.scale?this.zoom((this.view.scale-.01)/this.view.scale):this.zoom(Math.round(1/this.zoomFactor*this.view.scale*20)/20/this.view.scale)};-Graph.prototype.fitPages=function(b,e){var g=1;null==b&&(g=this.getPageLayout(),b=g.width,g=g.height);var m=this.pageScale,v=this.pageFormat,p=this.container.clientHeight-10;b=(this.container.clientWidth-10)/(b*v.width)/m;this.zoomTo(Math.floor(20*(e?b:Math.min(b,p/(g*v.height)/m)))/20);mxUtils.hasScrollbars(this.container)&&(b=this.getPagePadding(),this.container.scrollLeft=Math.min(b.x*this.view.scale,(this.container.scrollWidth-this.container.clientWidth)/2),e||(this.container.scrollTop=Math.min(b.y*+Graph.prototype.fitPages=function(b,e){var g=1;null==b&&(g=this.getPageLayout(),b=g.width,g=g.height);var m=this.pageScale,v=this.pageFormat,n=this.container.clientHeight-10;b=(this.container.clientWidth-10)/(b*v.width)/m;this.zoomTo(Math.floor(20*(e?b:Math.min(b,n/(g*v.height)/m)))/20);mxUtils.hasScrollbars(this.container)&&(b=this.getPagePadding(),this.container.scrollLeft=Math.min(b.x*this.view.scale,(this.container.scrollWidth-this.container.clientWidth)/2),e||(this.container.scrollTop=Math.min(b.y*this.view.scale,(this.container.scrollHeight-this.container.clientHeight)/2)))};Graph.prototype.fitWindow=function(b,e){e=null!=e?e:10;var g=this.container.clientWidth-e,m=this.container.clientHeight-e;this.zoomTo(Math.floor(20*Math.min(g/b.width,m/b.height))/20);mxUtils.hasScrollbars(this.container)&&window.setTimeout(mxUtils.bind(this,function(){var v=this.view.translate;this.container.scrollLeft=(b.x+v.x)*this.view.scale-Math.max((g-b.width*this.view.scale)/2+e/2,0);this.container.scrollTop=(b.y+v.y)*this.view.scale-Math.max((m-b.height*this.view.scale)/2+e/2,0)}),0)};Graph.prototype.convertValueToTooltip=function(b){var e=null;mxUtils.isNode(b.value)&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(e=b.value.getAttribute("tooltip_"+Graph.diagramLanguage)),null==e&&(e=b.value.getAttribute("tooltip")),null!=e&&(null!=e&&this.isReplacePlaceholders(b)&&(e=this.replacePlaceholders(b,e)),e=Graph.sanitizeHtml(e)));return e};-Graph.prototype.getTooltipForCell=function(b){var e="";if(mxUtils.isNode(b.value)&&(e=this.convertValueToTooltip(b),null==e)){var g=this.builtInProperties;b=b.value.attributes;var m=[];e="";this.isEnabled()&&(g.push("linkTarget"),g.push("link"));for(var v=0;v<b.length;v++)(Graph.translateDiagram&&"label"==b[v].nodeName||0>mxUtils.indexOf(g,b[v].nodeName))&&0<b[v].nodeValue.length&&m.push({name:b[v].nodeName,value:b[v].nodeValue});m.sort(function(p,A){return p.name<A.name?-1:p.name>A.name?1:0});for(v=+Graph.prototype.getTooltipForCell=function(b){var e="";if(mxUtils.isNode(b.value)&&(e=this.convertValueToTooltip(b),null==e)){var g=this.builtInProperties;b=b.value.attributes;var m=[];e="";this.isEnabled()&&(g.push("linkTarget"),g.push("link"));for(var v=0;v<b.length;v++)(Graph.translateDiagram&&"label"==b[v].nodeName||0>mxUtils.indexOf(g,b[v].nodeName))&&0<b[v].nodeValue.length&&m.push({name:b[v].nodeName,value:b[v].nodeValue});m.sort(function(n,A){return n.name<A.name?-1:n.name>A.name?1:0});for(v=0;v<m.length;v++)"link"==m[v].name&&this.isCustomLink(m[v].value)||(e+=("link"!=m[v].name?"<b>"+mxUtils.htmlEntities(m[v].name)+":</b> ":"")+mxUtils.htmlEntities(m[v].value)+"\n");0<e.length&&(e=e.substring(0,e.length-1),mxClient.IS_SVG&&(e='<div style="max-width:360px;text-overflow:ellipsis;overflow:hidden;">'+e+"</div>"))}return e};-Graph.prototype.addFlowAnimationToNode=function(b,e,g,m){if(null!=b&&null!=m){var v=b.getAttribute("stroke-dasharray");if(""==v||null==v){var p=String(mxUtils.getValue(e,mxConstants.STYLE_DASH_PATTERN,"8")).split(" ");v=1==mxUtils.getValue(e,mxConstants.STYLE_FIX_DASH,!1)||null==e.dashPattern?1:mxUtils.getNumber(e,mxConstants.STYLE_STROKEWIDTH,1);if(0<p.length)for(var A=0;A<p.length;A++)p[A]=Math.round(Number(p[A])*g*v*100)/100;b.setAttribute("stroke-dasharray",p.join(" "))}else p=v.split(" ");if(0<-p.length){for(A=v=0;A<p.length;A++){var H=parseFloat(p[A]);isNaN(H)||(v+=parseFloat(p[A]))}0!=p.length%2&&(v*=2);g=Math.round(v/g/16*parseInt(mxUtils.getValue(e,"flowAnimationDuration",500)));p=mxUtils.getValue(e,"flowAnimationTimingFunction","linear");e=mxUtils.getValue(e,"flowAnimationDirection","normal");b.style.animation=m+" "+g+"ms "+mxUtils.htmlEntities(p)+" infinite "+mxUtils.htmlEntities(e);b.style.strokeDashoffset=v}}};+Graph.prototype.addFlowAnimationToNode=function(b,e,g,m){if(null!=b&&null!=m){var v=b.getAttribute("stroke-dasharray");if(""==v||null==v){var n=String(mxUtils.getValue(e,mxConstants.STYLE_DASH_PATTERN,"8")).split(" ");v=1==mxUtils.getValue(e,mxConstants.STYLE_FIX_DASH,!1)||null==e.dashPattern?1:mxUtils.getNumber(e,mxConstants.STYLE_STROKEWIDTH,1);if(0<n.length)for(var A=0;A<n.length;A++)n[A]=Math.round(Number(n[A])*g*v*100)/100;b.setAttribute("stroke-dasharray",n.join(" "))}else n=v.split(" ");if(0<+n.length){for(A=v=0;A<n.length;A++){var G=parseFloat(n[A]);isNaN(G)||(v+=parseFloat(n[A]))}0!=n.length%2&&(v*=2);g=Math.round(v/g/16*parseInt(mxUtils.getValue(e,"flowAnimationDuration",500)));n=mxUtils.getValue(e,"flowAnimationTimingFunction","linear");e=mxUtils.getValue(e,"flowAnimationDirection","normal");b.style.animation=m+" "+g+"ms "+mxUtils.htmlEntities(n)+" infinite "+mxUtils.htmlEntities(e);b.style.strokeDashoffset=v}}};Graph.prototype.addFlowAnimationStyle=function(){var b=document.getElementsByTagName("head")[0];if(null!=b&&null==this.flowAnimationId){this.flowAnimationId="ge-flow-animation-"+Editor.guid();var e=document.createElement("style");e.innerHTML=this.createFlowAnimationCss(this.flowAnimationId);b.appendChild(e)}return this.flowAnimationId};Graph.prototype.createFlowAnimationCss=function(b){return"@keyframes "+b+" {\n to {\n stroke-dashoffset: 0;\n }\n}"};Graph.prototype.stringToBytes=function(b){return Graph.stringToBytes(b)};Graph.prototype.bytesToString=function(b){return Graph.bytesToString(b)};Graph.prototype.compressNode=function(b){return Graph.compressNode(b)};Graph.prototype.compress=function(b,e){return Graph.compress(b,e)};Graph.prototype.decompress=function(b,e){return Graph.decompress(b,e)};Graph.prototype.zapGremlins=function(b){return Graph.zapGremlins(b)};HoverIcons=function(b){mxEventSource.call(this);this.graph=b;this.init()};mxUtils.extend(HoverIcons,mxEventSource);HoverIcons.prototype.arrowSpacing=2;HoverIcons.prototype.updateDelay=500;HoverIcons.prototype.activationDelay=140;HoverIcons.prototype.currentState=null;HoverIcons.prototype.activeArrow=null;HoverIcons.prototype.inactiveOpacity=15;HoverIcons.prototype.cssCursor="copy";HoverIcons.prototype.checkCollisions=!0;HoverIcons.prototype.arrowFill="#29b6f2";HoverIcons.prototype.triangleUp=Graph.createSvgImage(18,28,'<path d="m 6 26 L 12 26 L 12 12 L 18 12 L 9 1 L 1 12 L 6 12 z" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');@@ -2473,14 +2477,14 @@ HoverIcons.prototype.getDirection=function(){var b=mxConstants.DIRECTION_EAST;thHoverIcons.prototype.setDisplay=function(b){this.visitNodes(function(e){e.style.display=b})};HoverIcons.prototype.isActive=function(){return null!=this.activeArrow&&null!=this.currentState};HoverIcons.prototype.drag=function(b,e,g){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);null!=this.currentState&&(this.graph.connectionHandler.start(this.currentState,e,g),this.graph.isMouseTrigger=mxEvent.isMouseEvent(b),this.graph.isMouseDown=!0,e=this.graph.selectionCellsHandler.getHandler(this.currentState.cell),null!=e&&e.setHandlesVisible(!1),e=this.graph.connectionHandler.edgeState,null!=b&&mxEvent.isShiftDown(b)&&mxEvent.isControlDown(b)&&null!=e&&"orthogonalEdgeStyle"===mxUtils.getValue(e.style,mxConstants.STYLE_EDGE,null)&&(b=this.getDirection(),e.cell.style=mxUtils.setStyle(e.cell.style,"sourcePortConstraint",b),e.style.sourcePortConstraint=b))};HoverIcons.prototype.getStateAt=function(b,e,g){return this.graph.view.getState(this.graph.getCellAt(e,g))};-HoverIcons.prototype.click=function(b,e,g){var m=g.getEvent(),v=g.getGraphX(),p=g.getGraphY();v=this.getStateAt(b,v,p);null==v||!this.graph.model.isEdge(v.cell)||this.graph.isCloneEvent(m)||v.getVisibleTerminalState(!0)!=b&&v.getVisibleTerminalState(!1)!=b?null!=b&&this.execute(b,e,g):(this.graph.setSelectionCell(v.cell),this.reset());g.consume()};+HoverIcons.prototype.click=function(b,e,g){var m=g.getEvent(),v=g.getGraphX(),n=g.getGraphY();v=this.getStateAt(b,v,n);null==v||!this.graph.model.isEdge(v.cell)||this.graph.isCloneEvent(m)||v.getVisibleTerminalState(!0)!=b&&v.getVisibleTerminalState(!1)!=b?null!=b&&this.execute(b,e,g):(this.graph.setSelectionCell(v.cell),this.reset());g.consume()};HoverIcons.prototype.execute=function(b,e,g){g=g.getEvent();this.graph.selectCellsForConnectVertex(this.graph.connectVertex(b.cell,e,this.graph.defaultEdgeLength,g,this.graph.isCloneEvent(g),this.graph.isCloneEvent(g)),g,this)};HoverIcons.prototype.reset=function(b){null!=b&&!b||null==this.updateThread||window.clearTimeout(this.updateThread);this.activeArrow=this.currentState=this.mouseDownPoint=null;this.removeNodes();this.bbox=null;this.fireEvent(new mxEventObject("reset"))};HoverIcons.prototype.repaint=function(){this.bbox=null;if(null!=this.currentState){this.currentState=this.getState(this.currentState);if(null!=this.currentState&&this.graph.model.isVertex(this.currentState.cell)&&this.graph.isCellConnectable(this.currentState.cell)){var b=mxRectangle.fromRectangle(this.currentState);null!=this.currentState.shape&&null!=this.currentState.shape.boundingBox&&(b=mxRectangle.fromRectangle(this.currentState.shape.boundingBox));b.grow(this.graph.tolerance);b.grow(this.arrowSpacing);var e=this.graph.selectionCellsHandler.getHandler(this.currentState.cell);this.graph.isTableRow(this.currentState.cell)&&(e=this.graph.selectionCellsHandler.getHandler(this.graph.model.getParent(this.currentState.cell)));var g=null;null!=e&&(b.x-=e.horizontalOffset/2,b.y-=e.verticalOffset/2,b.width+=e.horizontalOffset,b.height+=e.verticalOffset,null!=e.rotationShape&&null!=e.rotationShape.node&&"hidden"!=e.rotationShape.node.style.visibility&&"none"!=e.rotationShape.node.style.display&&null!=e.rotationShape.boundingBox&&-(g=e.rotationShape.boundingBox));e=mxUtils.bind(this,function(H,S,F){if(null!=g){var K=new mxRectangle(S,F,H.clientWidth,H.clientHeight);mxUtils.intersects(K,g)&&(H==this.arrowUp?F-=K.y+K.height-g.y:H==this.arrowRight?S+=g.x+g.width-K.x:H==this.arrowDown?F+=g.y+g.height-K.y:H==this.arrowLeft&&(S-=K.x+K.width-g.x))}H.style.left=S+"px";H.style.top=F+"px";mxUtils.setOpacity(H,this.inactiveOpacity)});e(this.arrowUp,Math.round(this.currentState.getCenterX()-this.triangleUp.width/2-this.tolerance),Math.round(b.y-+(g=e.rotationShape.boundingBox));e=mxUtils.bind(this,function(G,S,F){if(null!=g){var K=new mxRectangle(S,F,G.clientWidth,G.clientHeight);mxUtils.intersects(K,g)&&(G==this.arrowUp?F-=K.y+K.height-g.y:G==this.arrowRight?S+=g.x+g.width-K.x:G==this.arrowDown?F+=g.y+g.height-K.y:G==this.arrowLeft&&(S-=K.x+K.width-g.x))}G.style.left=S+"px";G.style.top=F+"px";mxUtils.setOpacity(G,this.inactiveOpacity)});e(this.arrowUp,Math.round(this.currentState.getCenterX()-this.triangleUp.width/2-this.tolerance),Math.round(b.y-this.triangleUp.height-this.tolerance));e(this.arrowRight,Math.round(b.x+b.width-this.tolerance),Math.round(this.currentState.getCenterY()-this.triangleRight.height/2-this.tolerance));e(this.arrowDown,parseInt(this.arrowUp.style.left),Math.round(b.y+b.height-this.tolerance));e(this.arrowLeft,Math.round(b.x-this.triangleLeft.width-this.tolerance),parseInt(this.arrowRight.style.top));if(this.checkCollisions){e=this.graph.getCellAt(b.x+b.width+this.triangleRight.width/2,this.currentState.getCenterY());-var m=this.graph.getCellAt(b.x-this.triangleLeft.width/2,this.currentState.getCenterY()),v=this.graph.getCellAt(this.currentState.getCenterX(),b.y-this.triangleUp.height/2);b=this.graph.getCellAt(this.currentState.getCenterX(),b.y+b.height+this.triangleDown.height/2);null!=e&&e==m&&m==v&&v==b&&(b=v=m=e=null);var p=this.graph.getCellGeometry(this.currentState.cell),A=mxUtils.bind(this,function(H,S){var F=this.graph.model.isVertex(H)&&this.graph.getCellGeometry(H);null==H||this.graph.model.isAncestor(H,-this.currentState.cell)||this.graph.isSwimlane(H)||!(null==F||null==p||F.height<3*p.height&&F.width<3*p.width)?S.style.visibility="visible":S.style.visibility="hidden"});A(e,this.arrowRight);A(m,this.arrowLeft);A(v,this.arrowUp);A(b,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")),+var m=this.graph.getCellAt(b.x-this.triangleLeft.width/2,this.currentState.getCenterY()),v=this.graph.getCellAt(this.currentState.getCenterX(),b.y-this.triangleUp.height/2);b=this.graph.getCellAt(this.currentState.getCenterX(),b.y+b.height+this.triangleDown.height/2);null!=e&&e==m&&m==v&&v==b&&(b=v=m=e=null);var n=this.graph.getCellGeometry(this.currentState.cell),A=mxUtils.bind(this,function(G,S){var F=this.graph.model.isVertex(G)&&this.graph.getCellGeometry(G);null==G||this.graph.model.isAncestor(G,+this.currentState.cell)||this.graph.isSwimlane(G)||!(null==F||null==n||F.height<3*n.height&&F.width<3*n.width)?S.style.visibility="visible":S.style.visibility="hidden"});A(e,this.arrowRight);A(m,this.arrowLeft);A(v,this.arrowUp);A(b,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")),this.arrowRight.setAttribute("title",mxResources.get("plusTooltip")),this.arrowUp.setAttribute("title",mxResources.get("plusTooltip")),this.arrowDown.setAttribute("title",mxResources.get("plusTooltip"))):(this.arrowLeft.removeAttribute("title"),this.arrowRight.removeAttribute("title"),this.arrowUp.removeAttribute("title"),this.arrowDown.removeAttribute("title"))}else this.reset();null!=this.currentState&&(this.bbox=this.computeBoundingBox(),null!=this.bbox&&this.bbox.grow(10))}};HoverIcons.prototype.computeBoundingBox=function(){var b=this.graph.model.isEdge(this.currentState.cell)?null:mxRectangle.fromRectangle(this.currentState);this.visitNodes(function(e){null!=e.parentNode&&(e=new mxRectangle(e.offsetLeft,e.offsetTop,e.offsetWidth,e.offsetHeight),null==b?b=e:b.add(e))});return b};HoverIcons.prototype.getState=function(b){if(null!=b)if(b=b.cell,this.graph.getModel().contains(b)){if(this.graph.getModel().isVertex(b)&&!this.graph.isCellConnectable(b)){var e=this.graph.getModel().getParent(b);this.graph.getModel().isVertex(e)&&this.graph.isCellConnectable(e)&&(b=e)}if(this.graph.isCellLocked(b)||this.graph.model.isEdge(b))b=null;b=this.graph.view.getState(b);null!=b&&null==b.style&&(b=null)}else b=null;return b};@@ -2489,59 +2493,59 @@ window.setTimeout(mxUtils.bind(this,function(){this.isActive()||this.graph.isMoub||null==this.bbox||null==e||null==g||!mxUtils.contains(this.bbox,e,g))&&(null!=b&&this.graph.isEnabled()?(this.removeNodes(),this.setCurrentState(b),this.repaint(),this.graph.connectionHandler.constraintHandler.currentFocus!=b&&this.graph.connectionHandler.constraintHandler.reset()):this.reset())}};HoverIcons.prototype.setCurrentState=function(b){"eastwest"!=b.style.portConstraint&&(this.graph.container.appendChild(this.arrowUp),this.graph.container.appendChild(this.arrowDown));this.graph.container.appendChild(this.arrowRight);this.graph.container.appendChild(this.arrowLeft);this.currentState=b};Graph.prototype.removeTextStyleForCell=function(b,e){var g=this.getCurrentCellStyle(b),m=!1;this.getModel().beginUpdate();try{if("1"==mxUtils.getValue(g,"html","0")){var v=this.convertValueToString(b);"0"!=mxUtils.getValue(g,"nl2Br","1")&&(v=v.replace(/\n/g,"").replace(/<br\s*.?>/g,"\n"));v=Editor.convertHtmlToText(v);this.cellLabelChanged(b,v);m=!0}e&&(this.setCellStyles("fontSource",null,[b]),this.setCellStyles(mxConstants.STYLE_FONTFAMILY,null,[b]),this.setCellStyles(mxConstants.STYLE_FONTSIZE,-null,[b]),this.setCellStyles(mxConstants.STYLE_FONTSTYLE,null,[b]),this.setCellStyles(mxConstants.STYLE_FONTCOLOR,null,[b]),this.setCellStyles(mxConstants.STYLE_LABEL_BORDERCOLOR,null,[b]),this.setCellStyles(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null,[b]))}finally{this.getModel().endUpdate()}return m};Graph.prototype.createParent=function(b,e,g,m,v){b=this.cloneCell(b);for(var p=0;p<g;p++){var A=this.cloneCell(e),H=this.getCellGeometry(A);null!=H&&(H.x+=p*m,H.y+=p*v);b.insert(A)}return b};-Graph.prototype.createTable=function(b,e,g,m,v,p,A,H,S){g=null!=g?g:60;m=null!=m?m:40;p=null!=p?p:30;H=null!=H?H:"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;strokeColor=inherit;top=0;left=0;bottom=0;right=0;collapsible=0;dropTarget=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;";S=null!=S?S:"shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;strokeColor=inherit;overflow=hidden;fillColor=none;top=0;left=0;bottom=0;right=0;pointerEvents=1;";return this.createParent(this.createVertex(null,-null,null!=v?v:"",0,0,e*g,b*m+(null!=v?p:0),null!=A?A:"shape=table;startSize="+(null!=v?p:"0")+";container=1;collapsible=0;childLayout=tableLayout;"),this.createParent(this.createVertex(null,null,"",0,0,e*g,m,H),this.createVertex(null,null,"",0,0,g,m,S),e,g,0),b,0,m)};-Graph.prototype.setTableValues=function(b,e,g){for(var m=this.model.getChildCells(b,!0),v=0;v<m.length;v++)if(null!=g&&(m[v].value=g[v]),null!=e)for(var p=this.model.getChildCells(m[v],!0),A=0;A<p.length;A++)null!=e[v][A]&&(p[A].value=e[v][A]);return b};-Graph.prototype.createCrossFunctionalSwimlane=function(b,e,g,m,v,p,A,H,S){g=null!=g?g:120;m=null!=m?m:120;A=null!=A?A:"shape=tableRow;horizontal=0;swimlaneHead=0;swimlaneBody=0;top=0;left=0;strokeColor=inherit;bottom=0;right=0;dropTarget=0;fontStyle=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;startSize=40;collapsible=0;recursiveResize=0;expand=0;";H=null!=H?H:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;strokeColor=inherit;connectable=0;fillColor=none;startSize=40;collapsible=0;recursiveResize=0;expand=0;";-S=null!=S?S:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;connectable=0;strokeColor=inherit;fillColor=none;startSize=0;collapsible=0;recursiveResize=0;expand=0;";v=this.createVertex(null,null,null!=v?v:"",0,0,e*g,b*m,null!=p?p:"shape=table;childLayout=tableLayout;"+(null==v?"startSize=0;fillColor=none;":"startSize=40;")+"collapsible=0;recursiveResize=0;expand=0;");p=mxUtils.getValue(this.getCellStyle(v),mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);v.geometry.width+=p;v.geometry.height+=-p;A=this.createVertex(null,null,"",0,p,e*g+p,m,A);v.insert(this.createParent(A,this.createVertex(null,null,"",p,0,g,m,H),e,g,0));return 1<b?(A.geometry.y=m+p,this.createParent(v,this.createParent(A,this.createVertex(null,null,"",p,0,g,m,S),e,g,0),b-1,0,m)):v};-Graph.prototype.visitTableCells=function(b,e){var g=null,m=this.model.getChildCells(b,!0);b=this.getActualStartSize(b,!0);for(var v=0;v<m.length;v++){for(var p=this.getActualStartSize(m[v],!0),A=this.model.getChildCells(m[v],!0),H=this.getCellStyle(m[v],!0),S=null,F=[],K=0;K<A.length;K++){var c=this.getCellGeometry(A[K]),f={cell:A[K],rospan:1,colspan:1,row:v,col:K,geo:c};c=null!=c.alternateBounds?c.alternateBounds:c;f.point=new mxPoint(c.width+(null!=S?S.point.x:b.x+p.x),c.height+(null!=g&&null!=-g[0]?g[0].point.y:b.y+p.y));f.actual=f;null!=g&&null!=g[K]&&1<g[K].rowspan?(f.rowspan=g[K].rowspan-1,f.colspan=g[K].colspan,f.actual=g[K].actual):null!=S&&1<S.colspan?(f.rowspan=S.rowspan,f.colspan=S.colspan-1,f.actual=S.actual):(S=this.getCurrentCellStyle(A[K],!0),null!=S&&(f.rowspan=parseInt(S.rowspan||1),f.colspan=parseInt(S.colspan||1)));S=1==mxUtils.getValue(H,mxConstants.STYLE_SWIMLANE_HEAD,1)&&mxUtils.getValue(H,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!=mxConstants.NONE;e(f,A.length,-m.length,b.x+(S?p.x:0),b.y+(S?p.y:0));F.push(f);S=f}g=F}};Graph.prototype.getTableLines=function(b,e,g){var m=[],v=[];(e||g)&&this.visitTableCells(b,mxUtils.bind(this,function(p,A,H,S,F){e&&p.row<H-1&&(null==m[p.row]&&(m[p.row]=[new mxPoint(S,p.point.y)]),1<p.rowspan&&m[p.row].push(null),m[p.row].push(p.point));g&&p.col<A-1&&(null==v[p.col]&&(v[p.col]=[new mxPoint(p.point.x,F)]),1<p.colspan&&v[p.col].push(null),v[p.col].push(p.point))}));return m.concat(v)};+null,[b]),this.setCellStyles(mxConstants.STYLE_FONTSTYLE,null,[b]),this.setCellStyles(mxConstants.STYLE_FONTCOLOR,null,[b]),this.setCellStyles(mxConstants.STYLE_LABEL_BORDERCOLOR,null,[b]),this.setCellStyles(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null,[b]))}finally{this.getModel().endUpdate()}return m};Graph.prototype.createParent=function(b,e,g,m,v){b=this.cloneCell(b);for(var n=0;n<g;n++){var A=this.cloneCell(e),G=this.getCellGeometry(A);null!=G&&(G.x+=n*m,G.y+=n*v);b.insert(A)}return b};+Graph.prototype.createTable=function(b,e,g,m,v,n,A,G,S){g=null!=g?g:60;m=null!=m?m:40;n=null!=n?n:30;G=null!=G?G:"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;strokeColor=inherit;top=0;left=0;bottom=0;right=0;collapsible=0;dropTarget=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;";S=null!=S?S:"shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;strokeColor=inherit;overflow=hidden;fillColor=none;top=0;left=0;bottom=0;right=0;pointerEvents=1;";return this.createParent(this.createVertex(null,+null,null!=v?v:"",0,0,e*g,b*m+(null!=v?n:0),null!=A?A:"shape=table;startSize="+(null!=v?n:"0")+";container=1;collapsible=0;childLayout=tableLayout;"),this.createParent(this.createVertex(null,null,"",0,0,e*g,m,G),this.createVertex(null,null,"",0,0,g,m,S),e,g,0),b,0,m)};+Graph.prototype.setTableValues=function(b,e,g){for(var m=this.model.getChildCells(b,!0),v=0;v<m.length;v++)if(null!=g&&(m[v].value=g[v]),null!=e)for(var n=this.model.getChildCells(m[v],!0),A=0;A<n.length;A++)null!=e[v][A]&&(n[A].value=e[v][A]);return b};+Graph.prototype.createCrossFunctionalSwimlane=function(b,e,g,m,v,n,A,G,S){g=null!=g?g:120;m=null!=m?m:120;A=null!=A?A:"shape=tableRow;horizontal=0;swimlaneHead=0;swimlaneBody=0;top=0;left=0;strokeColor=inherit;bottom=0;right=0;dropTarget=0;fontStyle=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;startSize=40;collapsible=0;recursiveResize=0;expand=0;";G=null!=G?G:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;strokeColor=inherit;connectable=0;fillColor=none;startSize=40;collapsible=0;recursiveResize=0;expand=0;";+S=null!=S?S:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;connectable=0;strokeColor=inherit;fillColor=none;startSize=0;collapsible=0;recursiveResize=0;expand=0;";v=this.createVertex(null,null,null!=v?v:"",0,0,e*g,b*m,null!=n?n:"shape=table;childLayout=tableLayout;"+(null==v?"startSize=0;fillColor=none;":"startSize=40;")+"collapsible=0;recursiveResize=0;expand=0;");n=mxUtils.getValue(this.getCellStyle(v),mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);v.geometry.width+=n;v.geometry.height+=+n;A=this.createVertex(null,null,"",0,n,e*g+n,m,A);v.insert(this.createParent(A,this.createVertex(null,null,"",n,0,g,m,G),e,g,0));return 1<b?(A.geometry.y=m+n,this.createParent(v,this.createParent(A,this.createVertex(null,null,"",n,0,g,m,S),e,g,0),b-1,0,m)):v};+Graph.prototype.visitTableCells=function(b,e){var g=null,m=this.model.getChildCells(b,!0);b=this.getActualStartSize(b,!0);for(var v=0;v<m.length;v++){for(var n=this.getActualStartSize(m[v],!0),A=this.model.getChildCells(m[v],!0),G=this.getCellStyle(m[v],!0),S=null,F=[],K=0;K<A.length;K++){var c=this.getCellGeometry(A[K]),f={cell:A[K],rospan:1,colspan:1,row:v,col:K,geo:c};c=null!=c.alternateBounds?c.alternateBounds:c;f.point=new mxPoint(c.width+(null!=S?S.point.x:b.x+n.x),c.height+(null!=g&&null!=+g[0]?g[0].point.y:b.y+n.y));f.actual=f;null!=g&&null!=g[K]&&1<g[K].rowspan?(f.rowspan=g[K].rowspan-1,f.colspan=g[K].colspan,f.actual=g[K].actual):null!=S&&1<S.colspan?(f.rowspan=S.rowspan,f.colspan=S.colspan-1,f.actual=S.actual):(S=this.getCurrentCellStyle(A[K],!0),null!=S&&(f.rowspan=parseInt(S.rowspan||1),f.colspan=parseInt(S.colspan||1)));S=1==mxUtils.getValue(G,mxConstants.STYLE_SWIMLANE_HEAD,1)&&mxUtils.getValue(G,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!=mxConstants.NONE;e(f,A.length,+m.length,b.x+(S?n.x:0),b.y+(S?n.y:0));F.push(f);S=f}g=F}};Graph.prototype.getTableLines=function(b,e,g){var m=[],v=[];(e||g)&&this.visitTableCells(b,mxUtils.bind(this,function(n,A,G,S,F){e&&n.row<G-1&&(null==m[n.row]&&(m[n.row]=[new mxPoint(S,n.point.y)]),1<n.rowspan&&m[n.row].push(null),m[n.row].push(n.point));g&&n.col<A-1&&(null==v[n.col]&&(v[n.col]=[new mxPoint(n.point.x,F)]),1<n.colspan&&v[n.col].push(null),v[n.col].push(n.point))}));return m.concat(v)};Graph.prototype.isTableCell=function(b){return this.model.isVertex(b)&&this.isTableRow(this.model.getParent(b))};Graph.prototype.isTableRow=function(b){return this.model.isVertex(b)&&this.isTable(this.model.getParent(b))};Graph.prototype.isTable=function(b){b=this.getCellStyle(b);return null!=b&&"tableLayout"==b.childLayout};Graph.prototype.isStack=function(b){b=this.getCellStyle(b);return null!=b&&"stackLayout"==b.childLayout};Graph.prototype.isStackChild=function(b){return this.model.isVertex(b)&&this.isStack(this.model.getParent(b))};-Graph.prototype.setTableRowHeight=function(b,e,g){g=null!=g?g:!0;var m=this.getModel();m.beginUpdate();try{var v=this.getCellGeometry(b);if(null!=v){v=v.clone();v.height+=e;m.setGeometry(b,v);var p=m.getParent(b),A=m.getChildCells(p,!0);if(!g){var H=mxUtils.indexOf(A,b);if(H<A.length-1){var S=A[H+1],F=this.getCellGeometry(S);null!=F&&(F=F.clone(),F.y+=e,F.height-=e,m.setGeometry(S,F))}}var K=this.getCellGeometry(p);null!=K&&(g||(g=b==A[A.length-1]),g&&(K=K.clone(),K.height+=e,m.setGeometry(p,K)))}}finally{m.endUpdate()}};-Graph.prototype.setTableColumnWidth=function(b,e,g){g=null!=g?g:!1;var m=this.getModel(),v=m.getParent(b),p=m.getParent(v),A=m.getChildCells(v,!0);b=mxUtils.indexOf(A,b);var H=b==A.length-1;m.beginUpdate();try{for(var S=m.getChildCells(p,!0),F=0;F<S.length;F++){v=S[F];A=m.getChildCells(v,!0);var K=A[b],c=this.getCellGeometry(K);null!=c&&(c=c.clone(),c.width+=e,null!=c.alternateBounds&&(c.alternateBounds.width+=e),m.setGeometry(K,c));b<A.length-1&&(K=A[b+1],c=this.getCellGeometry(K),null!=c&&(c=c.clone(),-c.x+=e,g||(c.width-=e,null!=c.alternateBounds&&(c.alternateBounds.width-=e)),m.setGeometry(K,c)))}if(H||g){var f=this.getCellGeometry(p);null!=f&&(f=f.clone(),f.width+=e,m.setGeometry(p,f))}null!=this.layoutManager&&this.layoutManager.executeLayout(p)}finally{m.endUpdate()}};function TableLayout(b){mxGraphLayout.call(this,b)}TableLayout.prototype=new mxStackLayout;TableLayout.prototype.constructor=TableLayout;TableLayout.prototype.isHorizontal=function(){return!1};+Graph.prototype.setTableRowHeight=function(b,e,g){g=null!=g?g:!0;var m=this.getModel();m.beginUpdate();try{var v=this.getCellGeometry(b);if(null!=v){v=v.clone();v.height+=e;m.setGeometry(b,v);var n=m.getParent(b),A=m.getChildCells(n,!0);if(!g){var G=mxUtils.indexOf(A,b);if(G<A.length-1){var S=A[G+1],F=this.getCellGeometry(S);null!=F&&(F=F.clone(),F.y+=e,F.height-=e,m.setGeometry(S,F))}}var K=this.getCellGeometry(n);null!=K&&(g||(g=b==A[A.length-1]),g&&(K=K.clone(),K.height+=e,m.setGeometry(n,K)))}}finally{m.endUpdate()}};+Graph.prototype.setTableColumnWidth=function(b,e,g){g=null!=g?g:!1;var m=this.getModel(),v=m.getParent(b),n=m.getParent(v),A=m.getChildCells(v,!0);b=mxUtils.indexOf(A,b);var G=b==A.length-1;m.beginUpdate();try{for(var S=m.getChildCells(n,!0),F=0;F<S.length;F++){v=S[F];A=m.getChildCells(v,!0);var K=A[b],c=this.getCellGeometry(K);null!=c&&(c=c.clone(),c.width+=e,null!=c.alternateBounds&&(c.alternateBounds.width+=e),m.setGeometry(K,c));b<A.length-1&&(K=A[b+1],c=this.getCellGeometry(K),null!=c&&(c=c.clone(),+c.x+=e,g||(c.width-=e,null!=c.alternateBounds&&(c.alternateBounds.width-=e)),m.setGeometry(K,c)))}if(G||g){var f=this.getCellGeometry(n);null!=f&&(f=f.clone(),f.width+=e,m.setGeometry(n,f))}null!=this.layoutManager&&this.layoutManager.executeLayout(n)}finally{m.endUpdate()}};function TableLayout(b){mxGraphLayout.call(this,b)}TableLayout.prototype=new mxStackLayout;TableLayout.prototype.constructor=TableLayout;TableLayout.prototype.isHorizontal=function(){return!1};TableLayout.prototype.isVertexIgnored=function(b){return!this.graph.getModel().isVertex(b)||!this.graph.isCellVisible(b)};TableLayout.prototype.getSize=function(b,e){for(var g=0,m=0;m<b.length;m++)if(!this.isVertexIgnored(b[m])){var v=this.graph.getCellGeometry(b[m]);null!=v&&(g+=e?v.width:v.height)}return g};-TableLayout.prototype.getRowLayout=function(b,e){var g=this.graph.model.getChildCells(b,!0),m=this.graph.getActualStartSize(b,!0);b=this.getSize(g,!0);e=e-m.x-m.width;var v=[];m=m.x;for(var p=0;p<g.length;p++){var A=this.graph.getCellGeometry(g[p]);null!=A&&(m+=(null!=A.alternateBounds?A.alternateBounds.width:A.width)*e/b,v.push(Math.round(m)))}return v};-TableLayout.prototype.layoutRow=function(b,e,g,m){var v=this.graph.getModel(),p=v.getChildCells(b,!0);b=this.graph.getActualStartSize(b,!0);var A=b.x,H=0;null!=e&&(e=e.slice(),e.splice(0,0,b.x));for(var S=0;S<p.length;S++){var F=this.graph.getCellGeometry(p[S]);null!=F&&(F=F.clone(),F.y=b.y,F.height=g-b.y-b.height,null!=e?(F.x=e[S],F.width=e[S+1]-F.x,S==p.length-1&&S<e.length-2&&(F.width=m-F.x-b.x-b.width)):(F.x=A,A+=F.width,S==p.length-1?F.width=m-b.x-b.width-H:H+=F.width),F.alternateBounds=new mxRectangle(0,-0,F.width,F.height),v.setGeometry(p[S],F))}return H};-TableLayout.prototype.execute=function(b){if(null!=b){var e=this.graph.getActualStartSize(b,!0),g=this.graph.getCellGeometry(b),m=this.graph.getCellStyle(b),v="1"==mxUtils.getValue(m,"resizeLastRow","0"),p="1"==mxUtils.getValue(m,"resizeLast","0");m="1"==mxUtils.getValue(m,"fixedRows","0");var A=this.graph.getModel(),H=0;A.beginUpdate();try{for(var S=g.height-e.y-e.height,F=g.width-e.x-e.width,K=A.getChildCells(b,!0),c=0;c<K.length;c++)A.setVisible(K[c],!0);var f=this.getSize(K,!1);if(0<S&&0<F&&0<-K.length&&0<f){if(v){var l=this.graph.getCellGeometry(K[K.length-1]);null!=l&&(l=l.clone(),l.height=S-f+l.height,A.setGeometry(K[K.length-1],l))}var t=p?null:this.getRowLayout(K[0],F),q=[],D=e.y;for(c=0;c<K.length;c++)l=this.graph.getCellGeometry(K[c]),null!=l&&(l=l.clone(),l.x=e.x,l.width=F,l.y=Math.round(D),D=v||m?D+l.height:D+l.height/f*S,l.height=Math.round(D)-l.y,A.setGeometry(K[c],l)),H=Math.max(H,this.layoutRow(K[c],t,l.height,F,q));m&&S<f&&(g=g.clone(),g.height=D+e.height,A.setGeometry(b,-g));p&&F<H+Graph.minTableColumnWidth&&(g=g.clone(),g.width=H+e.width+e.x+Graph.minTableColumnWidth,A.setGeometry(b,g));this.graph.visitTableCells(b,mxUtils.bind(this,function(G){A.setVisible(G.cell,G.actual.cell==G.cell);if(G.actual.cell!=G.cell){if(G.actual.row==G.row){var N=null!=G.geo.alternateBounds?G.geo.alternateBounds:G.geo;G.actual.geo.width+=N.width}G.actual.col==G.col&&(N=null!=G.geo.alternateBounds?G.geo.alternateBounds:G.geo,G.actual.geo.height+=N.height)}}))}else for(c=0;c<K.length;c++)A.setVisible(K[c],+TableLayout.prototype.getRowLayout=function(b,e){var g=this.graph.model.getChildCells(b,!0),m=this.graph.getActualStartSize(b,!0);b=this.getSize(g,!0);e=e-m.x-m.width;var v=[];m=m.x;for(var n=0;n<g.length;n++){var A=this.graph.getCellGeometry(g[n]);null!=A&&(m+=(null!=A.alternateBounds?A.alternateBounds.width:A.width)*e/b,v.push(Math.round(m)))}return v};+TableLayout.prototype.layoutRow=function(b,e,g,m){var v=this.graph.getModel(),n=v.getChildCells(b,!0);b=this.graph.getActualStartSize(b,!0);var A=b.x,G=0;null!=e&&(e=e.slice(),e.splice(0,0,b.x));for(var S=0;S<n.length;S++){var F=this.graph.getCellGeometry(n[S]);null!=F&&(F=F.clone(),F.y=b.y,F.height=g-b.y-b.height,null!=e?(F.x=e[S],F.width=e[S+1]-F.x,S==n.length-1&&S<e.length-2&&(F.width=m-F.x-b.x-b.width)):(F.x=A,A+=F.width,S==n.length-1?F.width=m-b.x-b.width-G:G+=F.width),F.alternateBounds=new mxRectangle(0,+0,F.width,F.height),v.setGeometry(n[S],F))}return G};+TableLayout.prototype.execute=function(b){if(null!=b){var e=this.graph.getActualStartSize(b,!0),g=this.graph.getCellGeometry(b),m=this.graph.getCellStyle(b),v="1"==mxUtils.getValue(m,"resizeLastRow","0"),n="1"==mxUtils.getValue(m,"resizeLast","0");m="1"==mxUtils.getValue(m,"fixedRows","0");var A=this.graph.getModel(),G=0;A.beginUpdate();try{for(var S=g.height-e.y-e.height,F=g.width-e.x-e.width,K=A.getChildCells(b,!0),c=0;c<K.length;c++)A.setVisible(K[c],!0);var f=this.getSize(K,!1);if(0<S&&0<F&&0<+K.length&&0<f){if(v){var l=this.graph.getCellGeometry(K[K.length-1]);null!=l&&(l=l.clone(),l.height=S-f+l.height,A.setGeometry(K[K.length-1],l))}var t=n?null:this.getRowLayout(K[0],F),q=[],D=e.y;for(c=0;c<K.length;c++)l=this.graph.getCellGeometry(K[c]),null!=l&&(l=l.clone(),l.x=e.x,l.width=F,l.y=Math.round(D),D=v||m?D+l.height:D+l.height/f*S,l.height=Math.round(D)-l.y,A.setGeometry(K[c],l)),G=Math.max(G,this.layoutRow(K[c],t,l.height,F,q));m&&S<f&&(g=g.clone(),g.height=D+e.height,A.setGeometry(b,+g));n&&F<G+Graph.minTableColumnWidth&&(g=g.clone(),g.width=G+e.width+e.x+Graph.minTableColumnWidth,A.setGeometry(b,g));this.graph.visitTableCells(b,mxUtils.bind(this,function(H){A.setVisible(H.cell,H.actual.cell==H.cell);if(H.actual.cell!=H.cell){if(H.actual.row==H.row){var N=null!=H.geo.alternateBounds?H.geo.alternateBounds:H.geo;H.actual.geo.width+=N.width}H.actual.col==H.col&&(N=null!=H.geo.alternateBounds?H.geo.alternateBounds:H.geo,H.actual.geo.height+=N.height)}}))}else for(c=0;c<K.length;c++)A.setVisible(K[c],!1)}finally{A.endUpdate()}}};(function(){var b=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){b.apply(this,arguments);this.validEdges=[]};var e=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(c,f){f=null!=f?f:!0;var l=this.getState(c);null!=l&&f&&this.graph.model.isEdge(l.cell)&&null!=l.style&&1!=l.style[mxConstants.STYLE_CURVED]&&!l.invalid&&this.updateLineJumps(l)&&this.graph.cellRenderer.redraw(l,!1,this.isRendering());l=e.apply(this,arguments);null!=l&&f&&this.graph.model.isEdge(l.cell)&&null!=l.style&&1!=l.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(l);return l};mxShape.prototype.isFlowAnimationEnabled=function(){return null!=this.state&&this.state.view.graph.enableFlowAnimation&&this.state.view.graph.model.isEdge(this.state.cell)&&"1"==mxUtils.getValue(this.state.style,"flowAnimation","0")};mxShape.prototype.getFlowAnimationPath=function(){var c=null!=this.node?this.node.getElementsByTagName("path"):null;if(null!=c)for(var f=0;f<c.length;f++)if("hidden"!=c[f].getAttribute("visibility"))return c[f];return null};mxShape.prototype.addFlowAnimationToShape=function(){null!=this.state&&this.state.view.graph.addFlowAnimationToNode(this.getFlowAnimationPath(),this.state.style,this.state.view.scale,this.state.view.graph.addFlowAnimationStyle())};var g=mxShape.prototype.paint;mxShape.prototype.paint=function(c){g.apply(this,arguments);this.isFlowAnimationEnabled()&&this.addFlowAnimationToShape()};var m=mxShape.prototype.createSvgCanvas;-mxShape.prototype.createSvgCanvas=function(c){c=m.apply(this,arguments);null!=this.state&&(c.adaptiveColors=this.state.view.graph.getAdaptiveColors());return c};var v=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(c,f){return v.apply(this,arguments)||null!=c.routedPoints&&null!=f.routedPoints&&!mxUtils.equalPoints(f.routedPoints,c.routedPoints)};var p=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(c){p.apply(this,arguments);+mxShape.prototype.createSvgCanvas=function(c){c=m.apply(this,arguments);null!=this.state&&(c.adaptiveColors=this.state.view.graph.getAdaptiveColors());return c};var v=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(c,f){return v.apply(this,arguments)||null!=c.routedPoints&&null!=f.routedPoints&&!mxUtils.equalPoints(f.routedPoints,c.routedPoints)};var n=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(c){n.apply(this,arguments);this.graph.model.isEdge(c.cell)&&1!=c.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(c)};mxGraphView.prototype.updateLineJumps=function(c){var f=c.absolutePoints;if(Graph.lineJumpsEnabled){var l=null!=c.routedPoints,t=null;if(null!=f&&null!=this.validEdges&&"none"!==mxUtils.getValue(c.style,"jumpStyle","none")){var q=function(ca,la,Q){var k=new mxPoint(la,Q);k.type=ca;t.push(k);k=null!=c.routedPoints?c.routedPoints[t.length-1]:null;return null==k||k.type!=ca||k.x!=la||k.y!=Q},D=.5*this.scale;-l=!1;t=[];for(var G=0;G<f.length-1;G++){for(var N=f[G+1],L=f[G],J=[],Y=f[G+2];G<f.length-2&&mxUtils.ptSegDistSq(L.x,L.y,Y.x,Y.y,N.x,N.y)<1*this.scale*this.scale;)N=Y,G++,Y=f[G+2];l=q(0,L.x,L.y)||l;for(var ha=0;ha<this.validEdges.length;ha++){var ea=this.validEdges[ha],aa=ea.absolutePoints;if(null!=aa&&mxUtils.intersects(c,ea)&&"1"!=ea.style.noJump){var na=null;for(ea=0;ea<aa.length-1;ea++){var W=aa[ea+1],ba=aa[ea];for(Y=aa[ea+2];ea<aa.length-2&&mxUtils.ptSegDistSq(ba.x,ba.y,Y.x,Y.y,W.x,W.y)<1*this.scale*+l=!1;t=[];for(var H=0;H<f.length-1;H++){for(var N=f[H+1],L=f[H],J=[],Y=f[H+2];H<f.length-2&&mxUtils.ptSegDistSq(L.x,L.y,Y.x,Y.y,N.x,N.y)<1*this.scale*this.scale;)N=Y,H++,Y=f[H+2];l=q(0,L.x,L.y)||l;for(var ha=0;ha<this.validEdges.length;ha++){var ea=this.validEdges[ha],aa=ea.absolutePoints;if(null!=aa&&mxUtils.intersects(c,ea)&&"1"!=ea.style.noJump){var na=null;for(ea=0;ea<aa.length-1;ea++){var W=aa[ea+1],ba=aa[ea];for(Y=aa[ea+2];ea<aa.length-2&&mxUtils.ptSegDistSq(ba.x,ba.y,Y.x,Y.y,W.x,W.y)<1*this.scale*this.scale;)W=Y,ea++,Y=aa[ea+2];var ja=mxUtils.intersection(L.x,L.y,N.x,N.y,ba.x,ba.y,W.x,W.y);if(null!=ja&&(Math.abs(ja.x-L.x)>D||Math.abs(ja.y-L.y)>D)&&(Math.abs(ja.x-N.x)>D||Math.abs(ja.y-N.y)>D)&&(null==na||mxUtils.ptLineDist(L.x,L.y,N.x,N.y,na.x,na.y)>D||mxUtils.ptLineDist(L.x,L.y,N.x,N.y,ba.x,ba.y)>D)&&(null==Y||mxUtils.ptLineDist(L.x,L.y,N.x,N.y,Y.x,Y.y)>D||mxUtils.ptLineDist(L.x,L.y,N.x,N.y,W.x,W.y)>D)){Y=ja.x-L.x;na=ja.y-L.y;ja={distSq:Y*Y+na*na,x:ja.x,y:ja.y};for(Y=0;Y<J.length;Y++)if(J[Y].distSq>ja.distSq){J.splice(Y,0,ja);ja=null;break}null==ja||0!=J.length&&J[J.length-1].x===ja.x&&J[J.length-1].y===ja.y||J.push(ja)}na=ba}}}for(ea=0;ea<J.length;ea++)l=q(1,J[ea].x,J[ea].y)||l}ja=f[f.length-1];l=q(0,ja.x,ja.y)||l}c.routedPoints=t;return l}return!1};var A=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(c,f,l){this.routedPoints=null!=this.state?this.state.routedPoints:null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)A.apply(this,-arguments);else{var t=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,q=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,D=mxUtils.getValue(this.style,"jumpStyle","none"),G=!0,N=null,L=null,J=[],Y=null;c.begin();for(var ha=0;ha<this.state.routedPoints.length;ha++){var ea=this.state.routedPoints[ha],aa=new mxPoint(ea.x/this.scale,ea.y/this.scale);0==ha?aa=f[0]:ha==this.state.routedPoints.length-1&&(aa=f[f.length-1]);var na=-!1;if(null!=N&&1==ea.type){var W=this.state.routedPoints[ha+1];ea=W.x/this.scale-aa.x;W=W.y/this.scale-aa.y;ea=ea*ea+W*W;null==Y&&(Y=new mxPoint(aa.x-N.x,aa.y-N.y),L=Math.sqrt(Y.x*Y.x+Y.y*Y.y),0<L?(Y.x=Y.x*q/L,Y.y=Y.y*q/L):Y=null);ea>q*q&&0<L&&(ea=N.x-aa.x,W=N.y-aa.y,ea=ea*ea+W*W,ea>q*q&&(na=new mxPoint(aa.x-Y.x,aa.y-Y.y),ea=new mxPoint(aa.x+Y.x,aa.y+Y.y),J.push(na),this.addPoints(c,J,l,t,!1,null,G),J=0>Math.round(Y.x)||0==Math.round(Y.x)&&0>=Math.round(Y.y)?1:-1,G=!1,"sharp"==D?(c.lineTo(na.x-Y.y*-J,na.y+Y.x*J),c.lineTo(ea.x-Y.y*J,ea.y+Y.x*J),c.lineTo(ea.x,ea.y)):"line"==D?(c.moveTo(na.x+Y.y*J,na.y-Y.x*J),c.lineTo(na.x-Y.y*J,na.y+Y.x*J),c.moveTo(ea.x-Y.y*J,ea.y+Y.x*J),c.lineTo(ea.x+Y.y*J,ea.y-Y.x*J),c.moveTo(ea.x,ea.y)):"arc"==D?(J*=1.3,c.curveTo(na.x-Y.y*J,na.y+Y.x*J,ea.x-Y.y*J,ea.y+Y.x*J,ea.x,ea.y)):(c.moveTo(ea.x,ea.y),G=!0),J=[ea],na=!0))}else Y=null;na||(J.push(aa),N=aa)}this.addPoints(c,J,l,t,!1,null,G);c.stroke()}};var H=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=-function(c,f,l,t){return null!=f&&"centerPerimeter"==f.style[mxConstants.STYLE_PERIMETER]?new mxPoint(f.getCenterX(),f.getCenterY()):H.apply(this,arguments)};var S=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(c,f,l,t){if(null==f||null==c||"1"!=f.style.snapToPoint&&"1"!=c.style.snapToPoint)S.apply(this,arguments);else{f=this.getTerminalPort(c,f,t);var q=this.getNextPoint(c,l,t),D=this.graph.isOrthogonal(c),G=mxUtils.toRadians(Number(f.style[mxConstants.STYLE_ROTATION]||-"0")),N=new mxPoint(f.getCenterX(),f.getCenterY());if(0!=G){var L=Math.cos(-G),J=Math.sin(-G);q=mxUtils.getRotatedPoint(q,L,J,N)}L=parseFloat(c.style[mxConstants.STYLE_PERIMETER_SPACING]||0);L+=parseFloat(c.style[t?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);q=this.getPerimeterPoint(f,q,0==G&&D,L);0!=G&&(L=Math.cos(G),J=Math.sin(G),q=mxUtils.getRotatedPoint(q,L,J,N));c.setAbsoluteTerminalPoint(this.snapToAnchorPoint(c,f,l,t,q),t)}};mxGraphView.prototype.snapToAnchorPoint=-function(c,f,l,t,q){if(null!=f&&null!=c){c=this.graph.getAllConnectionConstraints(f);t=l=null;if(null!=c)for(var D=0;D<c.length;D++){var G=this.graph.getConnectionPoint(f,c[D]);if(null!=G){var N=(G.x-q.x)*(G.x-q.x)+(G.y-q.y)*(G.y-q.y);if(null==t||N<t)l=G,t=N}}null!=l&&(q=l)}return q};var F=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(c,f,l){var t=F.apply(this,arguments);"1"==c.getAttribute("placeholders")&&null!=l.state&&(t=l.state.view.graph.replacePlaceholders(l.state.cell,+arguments);else{var t=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,q=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,D=mxUtils.getValue(this.style,"jumpStyle","none"),H=!0,N=null,L=null,J=[],Y=null;c.begin();for(var ha=0;ha<this.state.routedPoints.length;ha++){var ea=this.state.routedPoints[ha],aa=new mxPoint(ea.x/this.scale,ea.y/this.scale);0==ha?aa=f[0]:ha==this.state.routedPoints.length-1&&(aa=f[f.length-1]);var na=+!1;if(null!=N&&1==ea.type){var W=this.state.routedPoints[ha+1];ea=W.x/this.scale-aa.x;W=W.y/this.scale-aa.y;ea=ea*ea+W*W;null==Y&&(Y=new mxPoint(aa.x-N.x,aa.y-N.y),L=Math.sqrt(Y.x*Y.x+Y.y*Y.y),0<L?(Y.x=Y.x*q/L,Y.y=Y.y*q/L):Y=null);ea>q*q&&0<L&&(ea=N.x-aa.x,W=N.y-aa.y,ea=ea*ea+W*W,ea>q*q&&(na=new mxPoint(aa.x-Y.x,aa.y-Y.y),ea=new mxPoint(aa.x+Y.x,aa.y+Y.y),J.push(na),this.addPoints(c,J,l,t,!1,null,H),J=0>Math.round(Y.x)||0==Math.round(Y.x)&&0>=Math.round(Y.y)?1:-1,H=!1,"sharp"==D?(c.lineTo(na.x-Y.y*+J,na.y+Y.x*J),c.lineTo(ea.x-Y.y*J,ea.y+Y.x*J),c.lineTo(ea.x,ea.y)):"line"==D?(c.moveTo(na.x+Y.y*J,na.y-Y.x*J),c.lineTo(na.x-Y.y*J,na.y+Y.x*J),c.moveTo(ea.x-Y.y*J,ea.y+Y.x*J),c.lineTo(ea.x+Y.y*J,ea.y-Y.x*J),c.moveTo(ea.x,ea.y)):"arc"==D?(J*=1.3,c.curveTo(na.x-Y.y*J,na.y+Y.x*J,ea.x-Y.y*J,ea.y+Y.x*J,ea.x,ea.y)):(c.moveTo(ea.x,ea.y),H=!0),J=[ea],na=!0))}else Y=null;na||(J.push(aa),N=aa)}this.addPoints(c,J,l,t,!1,null,H);c.stroke()}};var G=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=+function(c,f,l,t){return null!=f&&"centerPerimeter"==f.style[mxConstants.STYLE_PERIMETER]?new mxPoint(f.getCenterX(),f.getCenterY()):G.apply(this,arguments)};var S=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(c,f,l,t){if(null==f||null==c||"1"!=f.style.snapToPoint&&"1"!=c.style.snapToPoint)S.apply(this,arguments);else{f=this.getTerminalPort(c,f,t);var q=this.getNextPoint(c,l,t),D=this.graph.isOrthogonal(c),H=mxUtils.toRadians(Number(f.style[mxConstants.STYLE_ROTATION]||+"0")),N=new mxPoint(f.getCenterX(),f.getCenterY());if(0!=H){var L=Math.cos(-H),J=Math.sin(-H);q=mxUtils.getRotatedPoint(q,L,J,N)}L=parseFloat(c.style[mxConstants.STYLE_PERIMETER_SPACING]||0);L+=parseFloat(c.style[t?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);q=this.getPerimeterPoint(f,q,0==H&&D,L);0!=H&&(L=Math.cos(H),J=Math.sin(H),q=mxUtils.getRotatedPoint(q,L,J,N));c.setAbsoluteTerminalPoint(this.snapToAnchorPoint(c,f,l,t,q),t)}};mxGraphView.prototype.snapToAnchorPoint=+function(c,f,l,t,q){if(null!=f&&null!=c){c=this.graph.getAllConnectionConstraints(f);t=l=null;if(null!=c)for(var D=0;D<c.length;D++){var H=this.graph.getConnectionPoint(f,c[D]);if(null!=H){var N=(H.x-q.x)*(H.x-q.x)+(H.y-q.y)*(H.y-q.y);if(null==t||N<t)l=H,t=N}}null!=l&&(q=l)}return q};var F=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(c,f,l){var t=F.apply(this,arguments);"1"==c.getAttribute("placeholders")&&null!=l.state&&(t=l.state.view.graph.replacePlaceholders(l.state.cell,t));return t};var K=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(c){if(null!=c.style&&"undefined"!==typeof pako){var f=mxUtils.getValue(c.style,mxConstants.STYLE_SHAPE,null);if(null!=f&&"string"===typeof f&&"stencil("==f.substring(0,8))try{var l=f.substring(8,f.length-1),t=mxUtils.parseXml(Graph.decompress(l));return new mxShape(new mxStencil(t.documentElement))}catch(q){null!=window.console&&console.log("Error in shape: "+q)}}return K.apply(this,arguments)}})();mxStencilRegistry.libraries={};mxStencilRegistry.dynamicLoading=!0;mxStencilRegistry.allowEval=!0;mxStencilRegistry.packages=[];mxStencilRegistry.filesLoaded={};mxStencilRegistry.isFileLoaded=function(b){return!mxClient.IS_FF&&mxStencilRegistry.filesLoaded[b]};mxStencilRegistry.setFileLoaded=function(b){mxStencilRegistry.filesLoaded[b]=!0};mxStencilRegistry.getStencil=function(b){var e=mxStencilRegistry.stencils[b];if(null==e&&null==mxCellRenderer.defaultShapes[b]&&mxStencilRegistry.dynamicLoading){var g=mxStencilRegistry.getBasenameForStencil(b);if(null!=g){e=mxStencilRegistry.libraries[g];if(null!=e){if(null==mxStencilRegistry.packages[g]){for(var m=0;m<e.length;m++){var v=e[m];if(!mxStencilRegistry.isFileLoaded(v))if(mxStencilRegistry.setFileLoaded(v),".xml"==v.toLowerCase().substring(v.length-4,v.length))mxStencilRegistry.loadStencilSet(v,-null);else if(".js"==v.toLowerCase().substring(v.length-3,v.length))try{if(mxStencilRegistry.allowEval){var p=mxUtils.load(v);null!=p&&200<=p.getStatus()&&299>=p.getStatus()&&eval.call(window,p.getText())}}catch(A){null!=window.console&&console.log("error in getStencil:",b,g,e,v,A)}}mxStencilRegistry.packages[g]=1}}else g=g.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+g+".xml",null);e=mxStencilRegistry.stencils[b]}}return e};+null);else if(".js"==v.toLowerCase().substring(v.length-3,v.length))try{if(mxStencilRegistry.allowEval){var n=mxUtils.load(v);null!=n&&200<=n.getStatus()&&299>=n.getStatus()&&eval.call(window,n.getText())}}catch(A){null!=window.console&&console.log("error in getStencil:",b,g,e,v,A)}}mxStencilRegistry.packages[g]=1}}else g=g.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+g+".xml",null);e=mxStencilRegistry.stencils[b]}}return e};mxStencilRegistry.getBasenameForStencil=function(b){var e=null;if(null!=b&&"string"===typeof b&&(b=b.split("."),0<b.length&&"mxgraph"==b[0])){e=b[1];for(var g=2;g<b.length-1;g++)e+="/"+b[g]}return e};-mxStencilRegistry.loadStencilSet=function(b,e,g,m){var v=mxStencilRegistry.packages[b];if(null!=g&&g||null==v){var p=!1;if(null==v)try{if(m){mxStencilRegistry.loadStencil(b,mxUtils.bind(this,function(A){null!=A&&null!=A.documentElement&&(mxStencilRegistry.packages[b]=A,p=!0,mxStencilRegistry.parseStencilSet(A.documentElement,e,p))}));return}v=mxStencilRegistry.loadStencil(b);mxStencilRegistry.packages[b]=v;p=!0}catch(A){null!=window.console&&console.log("error in loadStencilSet:",b,A)}null!=v&&null!=-v.documentElement&&mxStencilRegistry.parseStencilSet(v.documentElement,e,p)}};mxStencilRegistry.loadStencil=function(b,e){if(null!=e)mxUtils.get(b,mxUtils.bind(this,function(g){e(200<=g.getStatus()&&299>=g.getStatus()?g.getXml():null)}),mxUtils.bind(this,function(g){e(null)}));else return mxUtils.load(b).getXml()};mxStencilRegistry.parseStencilSets=function(b){for(var e=0;e<b.length;e++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(b[e]).documentElement)};-mxStencilRegistry.parseStencilSet=function(b,e,g){if("stencils"==b.nodeName)for(var m=b.firstChild;null!=m;)"shapes"==m.nodeName&&mxStencilRegistry.parseStencilSet(m,e,g),m=m.nextSibling;else{g=null!=g?g:!0;m=b.firstChild;var v="";b=b.getAttribute("name");for(null!=b&&(v=b+".");null!=m;){if(m.nodeType==mxConstants.NODETYPE_ELEMENT&&(b=m.getAttribute("name"),null!=b)){v=v.toLowerCase();var p=b.replace(/ /g,"_");g&&mxStencilRegistry.addStencil(v+p.toLowerCase(),new mxStencil(m));if(null!=e){var A=m.getAttribute("w"),-H=m.getAttribute("h");A=null==A?80:parseInt(A,10);H=null==H?80:parseInt(H,10);e(v,p,b,A,H)}}m=m.nextSibling}}};+mxStencilRegistry.loadStencilSet=function(b,e,g,m){var v=mxStencilRegistry.packages[b];if(null!=g&&g||null==v){var n=!1;if(null==v)try{if(m){mxStencilRegistry.loadStencil(b,mxUtils.bind(this,function(A){null!=A&&null!=A.documentElement&&(mxStencilRegistry.packages[b]=A,n=!0,mxStencilRegistry.parseStencilSet(A.documentElement,e,n))}));return}v=mxStencilRegistry.loadStencil(b);mxStencilRegistry.packages[b]=v;n=!0}catch(A){null!=window.console&&console.log("error in loadStencilSet:",b,A)}null!=v&&null!=+v.documentElement&&mxStencilRegistry.parseStencilSet(v.documentElement,e,n)}};mxStencilRegistry.loadStencil=function(b,e){if(null!=e)mxUtils.get(b,mxUtils.bind(this,function(g){e(200<=g.getStatus()&&299>=g.getStatus()?g.getXml():null)}),mxUtils.bind(this,function(g){e(null)}));else return mxUtils.load(b).getXml()};mxStencilRegistry.parseStencilSets=function(b){for(var e=0;e<b.length;e++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(b[e]).documentElement)};+mxStencilRegistry.parseStencilSet=function(b,e,g){if("stencils"==b.nodeName)for(var m=b.firstChild;null!=m;)"shapes"==m.nodeName&&mxStencilRegistry.parseStencilSet(m,e,g),m=m.nextSibling;else{g=null!=g?g:!0;m=b.firstChild;var v="";b=b.getAttribute("name");for(null!=b&&(v=b+".");null!=m;){if(m.nodeType==mxConstants.NODETYPE_ELEMENT&&(b=m.getAttribute("name"),null!=b)){v=v.toLowerCase();var n=b.replace(/ /g,"_");g&&mxStencilRegistry.addStencil(v+n.toLowerCase(),new mxStencil(m));if(null!=e){var A=m.getAttribute("w"),+G=m.getAttribute("h");A=null==A?80:parseInt(A,10);G=null==G?80:parseInt(G,10);e(v,n,b,A,G)}}m=m.nextSibling}}};"undefined"!==typeof mxVertexHandler&&function(){function b(){var y=document.createElement("div");y.className="geHint";y.style.whiteSpace="nowrap";y.style.position="absolute";return y}function e(y,O){switch(O){case mxConstants.POINTS:return y;case mxConstants.MILLIMETERS:return(y/mxConstants.PIXELS_PER_MM).toFixed(1);case mxConstants.METERS:return(y/(1E3*mxConstants.PIXELS_PER_MM)).toFixed(4);case mxConstants.INCHES:return(y/mxConstants.PIXELS_PER_INCH).toFixed(3)}}mxConstants.HANDLE_FILLCOLOR="#29b6f2";mxConstants.HANDLE_STROKECOLOR="#0088cf";mxConstants.VERTEX_SELECTION_COLOR="#00a8ff";mxConstants.OUTLINE_COLOR="#00a8ff";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#99ccff";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#00a8ff";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.EDGE_SELECTION_COLOR="#00a8ff";mxConstants.DEFAULT_VALID_COLOR="#00a8ff";mxConstants.LABEL_HANDLE_FILLCOLOR="#cee7ff";mxConstants.GUIDE_COLOR="#0088cf";mxConstants.HIGHLIGHT_STROKEWIDTH=5;mxConstants.HIGHLIGHT_OPACITY=50;mxConstants.HIGHLIGHT_SIZE=5;mxWindow.prototype.closeImage=Graph.createSvgImage(18,10,'<path d="M 5 1 L 13 9 M 13 1 L 5 9" stroke="#707070" stroke-width="2"/>').src;mxWindow.prototype.minimizeImage=Graph.createSvgImage(14,10,'<path d="M 3 7 L 7 3 L 11 7" stroke="#707070" stroke-width="2" fill="none"/>').src;mxWindow.prototype.normalizeImage=Graph.createSvgImage(14,10,'<path d="M 3 3 L 7 7 L 11 3" stroke="#707070" stroke-width="2" fill="none"/>').src;mxWindow.prototype.resizeImage=Graph.createSvgImage(10,10,'<path d="Z" stroke="#C0C0C0" stroke-width="1" fill="none"/>').src;mxEdgeHandler.prototype.snapToTerminals=!0;mxGraphHandler.prototype.guidesEnabled=!0;mxGraphHandler.prototype.removeEmptyParents=!0;mxRubberband.prototype.fadeOut=!0;mxGuide.prototype.isEnabledForEvent=function(y){return!mxEvent.isAltDown(y)||mxEvent.isShiftDown(y)};var g=mxGraphLayout.prototype.isVertexIgnored;mxGraphLayout.prototype.isVertexIgnored=function(y){return g.apply(this,arguments)||this.graph.isTableRow(y)||this.graph.isTableCell(y)};var m=mxGraphLayout.prototype.isEdgeIgnored;mxGraphLayout.prototype.isEdgeIgnored=function(y){return m.apply(this,arguments)||this.graph.isEdgeIgnored(y)};var v=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(y){return this.graph.isCloneEvent(y)!=v.apply(this,arguments)};mxConstraintHandler.prototype.createHighlightShape=function(){var y=new mxEllipse(null,this.highlightColor,this.highlightColor,0);y.opacity=mxConstants.HIGHLIGHT_OPACITY;return y};mxConnectionHandler.prototype.livePreview=!0;mxConnectionHandler.prototype.cursor="crosshair";mxConnectionHandler.prototype.createEdgeState=function(y){y=this.graph.createCurrentEdgeStyle();y=this.graph.createEdge(null,null,null,null,null,y);y=new mxCellState(this.graph.view,y,this.graph.getCellStyle(y));for(var O in this.graph.currentEdgeStyle)y.style[O]=this.graph.currentEdgeStyle[O];if(null!=this.previous){var R=this.previous.style.newEdgeStyle;if(null!=R)try{var V=JSON.parse(R);for(O in V)y.style[O]=V[O]}catch(fa){}}y.style=this.graph.postProcessCellStyle(y.cell,y.style);return y};-var p=mxConnectionHandler.prototype.createShape;mxConnectionHandler.prototype.createShape=function(){var y=p.apply(this,arguments);y.isDashed="1"==this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED];return y};mxConnectionHandler.prototype.updatePreview=function(y){};var A=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var y=A.apply(this,arguments),O=y.getCell;y.getCell=mxUtils.bind(this,function(R){var V=O.apply(this,arguments);this.error=null;return V});+var n=mxConnectionHandler.prototype.createShape;mxConnectionHandler.prototype.createShape=function(){var y=n.apply(this,arguments);y.isDashed="1"==this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED];return y};mxConnectionHandler.prototype.updatePreview=function(y){};var A=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var y=A.apply(this,arguments),O=y.getCell;y.getCell=mxUtils.bind(this,function(R){var V=O.apply(this,arguments);this.error=null;return V});return y};Graph.prototype.defaultVertexStyle={};Graph.prototype.defaultEdgeStyle={edgeStyle:"orthogonalEdgeStyle",rounded:"0",jettySize:"auto",orthogonalLoop:"1"};Graph.prototype.createCurrentEdgeStyle=function(){for(var y="edgeStyle="+(this.currentEdgeStyle.edgeStyle||"none")+";",O="shape curved rounded comic sketch fillWeight hachureGap hachureAngle jiggle disableMultiStroke disableMultiStrokeFill fillStyle curveFitting simplification comicStyle jumpStyle jumpSize".split(" "),R=0;R<O.length;R++)null!=this.currentEdgeStyle[O[R]]&&(y+=O[R]+"="+this.currentEdgeStyle[O[R]]+";");null!=this.currentEdgeStyle.orthogonalLoop?y+="orthogonalLoop="+this.currentEdgeStyle.orthogonalLoop+";":null!=Graph.prototype.defaultEdgeStyle.orthogonalLoop&&(y+="orthogonalLoop="+Graph.prototype.defaultEdgeStyle.orthogonalLoop+";");null!=this.currentEdgeStyle.jettySize?y+="jettySize="+this.currentEdgeStyle.jettySize+";":null!=Graph.prototype.defaultEdgeStyle.jettySize&&(y+="jettySize="+Graph.prototype.defaultEdgeStyle.jettySize+";");"elbowEdgeStyle"==this.currentEdgeStyle.edgeStyle&&null!=this.currentEdgeStyle.elbow&&(y+="elbow="+this.currentEdgeStyle.elbow+";");return y=null!=this.currentEdgeStyle.html?y+("html="+this.currentEdgeStyle.html+";"):y+"html=1;"};Graph.prototype.getPagePadding=function(){return new mxPoint(0,0)};Graph.prototype.loadStylesheet=function(){var y=null!=this.themes?this.themes[this.defaultThemeName]:mxStyleRegistry.dynamicLoading?mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement():null;null!=@@ -2549,7 +2553,7 @@ y&&(new mxCodec(y.ownerDocument)).decode(y,this.getStylesheet())};Graph.prototypO,R,V){O=null!=O?O:0;R=null!=R?R:0;var fa=new mxCodec(y.ownerDocument),ia=new mxGraphModel;fa.decode(y,ia);y=[];fa={};var oa={},ta=ia.getChildren(this.cloneCell(ia.root,this.isCloneInvalidEdges(),fa));if(null!=ta){var ra=this.createCellLookup([ia.root]);ta=ta.slice();this.model.beginUpdate();try{if(1!=ta.length||this.isCellLocked(this.getDefaultParent()))for(ia=0;ia<ta.length;ia++)xa=this.model.getChildren(this.moveCells([ta[ia]],O,R,!1,this.model.getRoot())[0]),null!=xa&&(y=y.concat(xa));else{var xa=ia.getChildren(ta[0]);null!=xa&&(y=this.moveCells(xa,O,R,!1,this.getDefaultParent()),oa[ia.getChildAt(ia.root,0).getId()]=this.getDefaultParent().getId())}if(null!=y&&(this.createCellMapping(fa,ra,oa),this.updateCustomLinks(oa,y),V)){this.isGridEnabled()&&(O=this.snap(O),R=this.snap(R));var Da=this.getBoundingBoxFromGeometry(y,!0);null!=Da&&this.moveCells(y,O-Da.x,R-Da.y)}}finally{this.model.endUpdate()}}return y};Graph.prototype.encodeCells=function(y){for(var O={},R=this.cloneCells(y,null,O),V=new mxDictionary,fa=0;fa<y.length;fa++)V.put(y[fa],!0);var ia=new mxCodec,oa=new mxGraphModel,ta=oa.getChildAt(oa.getRoot(),0);for(fa=0;fa<R.length;fa++){oa.add(ta,R[fa]);var ra=this.view.getState(y[fa]);if(null!=ra){var xa=this.getCellGeometry(R[fa]);null!=xa&&xa.relative&&!this.model.isEdge(y[fa])&&null==V.get(this.model.getParent(y[fa]))&&(xa.offset=null,xa.relative=!1,xa.x=ra.x/ra.view.scale-ra.view.translate.x,xa.y=ra.y/ra.view.scale-ra.view.translate.y)}}this.updateCustomLinks(this.createCellMapping(O,-this.createCellLookup(y)),R);return ia.encode(oa)};Graph.prototype.isSwimlane=function(y,O){var R=null;null==y||this.model.isEdge(y)||this.model.getParent(y)==this.model.getRoot()||(R=this.getCurrentCellStyle(y,O)[mxConstants.STYLE_SHAPE]);return R==mxConstants.SHAPE_SWIMLANE||"table"==R||"tableRow"==R};var H=Graph.prototype.isCellEditable;Graph.prototype.isCellEditable=function(y){return null!=y&&H.apply(this,arguments)?this.isTableCell(y)||this.isTableRow(y)?this.isCellEditable(this.model.getParent(y)):+this.createCellLookup(y)),R);return ia.encode(oa)};Graph.prototype.isSwimlane=function(y,O){var R=null;null==y||this.model.isEdge(y)||this.model.getParent(y)==this.model.getRoot()||(R=this.getCurrentCellStyle(y,O)[mxConstants.STYLE_SHAPE]);return R==mxConstants.SHAPE_SWIMLANE||"table"==R||"tableRow"==R};var G=Graph.prototype.isCellEditable;Graph.prototype.isCellEditable=function(y){return null!=y&&G.apply(this,arguments)?this.isTableCell(y)||this.isTableRow(y)?this.isCellEditable(this.model.getParent(y)):!0:!1};var S=Graph.prototype.isCellMovable;Graph.prototype.isCellMovable=function(y){return null!=y&&S.apply(this,arguments)?this.isTableCell(y)||this.isTableRow(y)?this.isCellMovable(this.model.getParent(y)):!0:!1};var F=Graph.prototype.isExtendParent;Graph.prototype.isExtendParent=function(y){var O=this.model.getParent(y);if(null!=O){var R=this.getCurrentCellStyle(O);if(null!=R.expand)return"0"!=R.expand}return F.apply(this,arguments)&&(null==O||!this.isTable(O))};var K=Graph.prototype.splitEdge;Graph.prototype.splitEdge=function(y,O,R,V,fa,ia,oa,ta){null==ta&&(ta=this.model.getParent(y),this.isTable(ta)||this.isTableRow(ta))&&(ta=this.getCellAt(ia,oa,null,!0,!1));R=null;this.model.beginUpdate();try{R=K.apply(this,[y,O,R,V,fa,ia,oa,ta]);this.model.setValue(R,"");var ra=this.getChildCells(R,!0);for(O=0;O<ra.length;O++){var xa=this.getCellGeometry(ra[O]);null!=xa&&xa.relative&&0<xa.x&&this.model.remove(ra[O])}var Da=this.getChildCells(y,!0);for(O=0;O<Da.length;O++)xa=this.getCellGeometry(Da[O]),null!=xa&&xa.relative&&0>=xa.x&&this.model.remove(Da[O]);var Ia=this.model.getTerminal(R,!1);if(null!=Ia){var Xa=this.getCurrentCellStyle(Ia);null!=Xa&&"1"==Xa.snapToPoint&&(this.setCellStyles(mxConstants.STYLE_EXIT_X,null,[y]),this.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[y]),this.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[R]),this.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[R]))}}finally{this.model.endUpdate()}return R};var c=Graph.prototype.selectCell;Graph.prototype.selectCell=function(y,@@ -2605,7 +2609,7 @@ null!=oa.createElementNS?oa.createElementNS(mxConstants.NS_SVG,"g"):oa.createEley.width,y.height));return O};Graph.prototype.getBackgroundImageObject=function(y){return y};Graph.prototype.getSvg=function(y,O,R,V,fa,ia,oa,ta,ra,xa,Da,Ia,Xa,Za,$a,Pa){var Na=null;if(null!=Za)for(Na=new mxDictionary,Da=0;Da<Za.length;Da++)Na.put(Za[Da],!0);Za=this.useCssTransforms;var jb=this.enableFlowAnimation;this.enableFlowAnimation=!1;Za&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{O=null!=O?O:1;R=null!=R?R:0;fa=null!=fa?fa:!0;ia=null!=ia?ia:!0;oa=null!=oa?oa:!0;xa=null!=xa?xa:!1;var cb="page"==Xa?this.view.getBackgroundPageBounds():ia&&null==Na||V||"diagram"==Xa?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells()),ab=this.backgroundImage,db=this.view.translate,lb=this.view.scale;"diagram"==Xa&&null!=ab&&null!=ab.width&&null!=ab.height&&(cb=mxRectangle.fromRectangle(cb),cb.add(new mxRectangle((db.x+ab.x)*lb,(db.y+ab.y)*lb,ab.width*lb,ab.height*lb)));if(null==cb)throw Error(mxResources.get("drawingEmpty"));V=O/lb;var kb=Math.max(1,Math.ceil(cb.width*V)+2*R)+(xa&&0==R?5:0),pb=Math.max(1,Math.ceil(cb.height*V)+2*R)+(xa&&0==R?5:0);xa=fa?-.5:0;var fb=mxUtils.getLightDarkColor(y),ob=Graph.createSvgNode(xa,xa,kb,pb,fb),tb=ob.ownerDocument;if(null!=y){var eb=mxUtils.createElementNs(tb,mxConstants.NS_SVG,"rect");eb.setAttribute("fill",fb.light);eb.style.fill=fb.cssText;eb.setAttribute("width","100%");eb.setAttribute("height","100%");eb.setAttribute("x","0");eb.setAttribute("y","0");ob.appendChild(eb)}var nb=mxUtils.createElementNs(tb,mxConstants.NS_SVG,-"g");ob.appendChild(nb);var mb=this.createSvgCanvas(nb);mb.foOffset=fa?-.5:0;mb.textOffset=fa?-.5:0;mb.imageOffset=fa?-.5:0;mb.translate(Math.floor(R/O-cb.x/lb),Math.floor(R/O-cb.y/lb));mb.idPrefix="drawio-svg-"+Editor.guid();var qb=document.createElement("div"),ub=mb.getAlternateText;mb.getAlternateText=function(hb,Ab,sb,wb,yb,rb,Bb,d,n,z,u,x,C){if(null!=rb&&0<this.state.fontSize)try{mxUtils.isNode(rb)?rb=rb.innerText:(qb.innerHTML=rb,rb=mxUtils.extractTextWithWhitespace(qb.childNodes));for(var E=+"g");ob.appendChild(nb);var mb=this.createSvgCanvas(nb);mb.foOffset=fa?-.5:0;mb.textOffset=fa?-.5:0;mb.imageOffset=fa?-.5:0;mb.translate(Math.floor(R/O-cb.x/lb),Math.floor(R/O-cb.y/lb));mb.idPrefix="drawio-svg-"+Editor.guid();var qb=document.createElement("div"),ub=mb.getAlternateText;mb.getAlternateText=function(hb,Ab,sb,wb,yb,rb,Bb,d,p,z,u,x,C){if(null!=rb&&0<this.state.fontSize)try{mxUtils.isNode(rb)?rb=rb.innerText:(qb.innerHTML=rb,rb=mxUtils.extractTextWithWhitespace(qb.childNodes));for(var E=Math.ceil(2*wb/this.state.fontSize),da=[],M=0,sa=0;(0==E||M<E)&&sa<rb.length;){var ma=rb.charCodeAt(sa);if(10==ma||13==ma){if(0<M)break}else da.push(rb.charAt(sa)),255>ma&&M++;sa++}da.length<rb.length&&1<rb.length-da.length&&(rb=mxUtils.trim(da.join(""))+"...");return rb}catch(Wa){return ub.apply(this,arguments)}else return ub.apply(this,arguments)};null!=ab&&null!=ab.width&&null!=ab.height&&(y=lb/O,xa=new mxRectangle((ab.x+db.x)*y,(ab.y+db.y)*y,ab.width*y,ab.height*y),mxUtils.intersects(cb,xa)&&mb.image(ab.x+db.x,ab.y+db.y,ab.width,ab.height,ab.src,!0));mb.scale(V);mb.textEnabled=oa;ta=null!=ta?ta:this.createSvgImageExport();var zb=ta.getLinkForCellState;ta.getLinkForCellState=function(hb,Ab){var sb=hb.view.graph.getAbsoluteUrl(zb.apply(this,arguments));return null==sb||hb.view.graph.isCustomLink(sb)?null:sb};ta.getLinkTargetForCellState=function(hb,Ab){return hb.view.graph.getLinkTargetForCell(hb.cell)};var Cb=ta.drawCellState,xb=null,vb=mxUtils.bind(this,function(){if(null==xb){xb="ge-flow-animation-"+Editor.guid();var hb=null!=tb.createElementNS?tb.createElementNS(mxConstants.NS_SVG,"style"):tb.createElement("style");hb.innerHTML=this.createFlowAnimationCss(xb);tb.getElementsByTagName("defs")[0].appendChild(hb)}return xb});ta.drawCellState=function(hb,Ab){for(var sb=hb.view.graph,wb=null!=Na?Na.get(hb.cell):sb.isCellSelected(hb.cell),yb=sb.model.getParent(hb.cell);!(ia&&null==Na||wb)&&null!=yb;)wb=null!=Na?Na.get(yb):sb.isCellSelected(yb),yb=sb.model.getParent(yb);if(null!=hb.shape)try{var rb=@@ -2638,7 +2642,7 @@ this.popupMenuHandler.popup(oa.getX()+xa.x+1,oa.getY()+xa.y+1,ra,oa.getEvent())}"";window.getSelection?y=window.getSelection():document.getSelection?y=document.getSelection():document.selection&&(y=document.selection.createRange().text);return""!=y};mxCellEditor.prototype.insertTab=function(y){var O=this.textarea.ownerDocument.defaultView.getSelection(),R=O.getRangeAt(0);y=Graph.createTabNode(y);R.insertNode(y);R.setStartAfter(y);R.setEndAfter(y);O.removeAllRanges();O.addRange(R)};mxCellEditor.prototype.alignText=function(y,O){var R=this.graph.getView().getState(this.editingCell);if(null!=R){R=mxUtils.getValue(R.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);var V=null!=R&&"vertical-"==R.substring(0,9),fa=null!=O&&mxEvent.isShiftDown(O);if(fa||null!=window.getSelection&&null!=window.getSelection().containsNode){var ia=!0;this.graph.processElements(this.textarea,function(oa){fa||V||window.getSelection().containsNode(oa,!0)?(oa.removeAttribute("align"),oa.style.textAlign=null):ia=!1});(ia||V)&&this.graph.cellEditor.setAlign(y)}V||document.execCommand("justify"+y.toLowerCase(),!1,null)}};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){var y=window.getSelection();if(y.getRangeAt&&y.rangeCount){for(var O=[],R=0,V=y.rangeCount;R<V;++R)O.push(y.getRangeAt(R));return O}}else if(document.selection&&document.selection.createRange)return document.selection.createRange();return null};mxCellEditor.prototype.restoreSelection=function(y){try{if(y)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var O=0,R=y.length;O<-R;++O)sel.addRange(y[O])}else document.selection&&y.select&&y.select()}catch(V){}};var D=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(y){null!=y.text&&(y.text.replaceLinefeeds="0"!=mxUtils.getValue(y.style,"nl2Br","1"));D.apply(this,arguments)};var G=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(y,O){this.isKeepFocusEvent(y)||!mxEvent.isAltDown(y.getEvent())?G.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=+R;++O)sel.addRange(y[O])}else document.selection&&y.select&&y.select()}catch(V){}};var D=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(y){null!=y.text&&(y.text.replaceLinefeeds="0"!=mxUtils.getValue(y.style,"nl2Br","1"));D.apply(this,arguments)};var H=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(y,O){this.isKeepFocusEvent(y)||!mxEvent.isAltDown(y.getEvent())?H.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(y){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing=!1;var N=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(y,O){y=this.graph.getStartEditingCell(y,O);N.apply(this,arguments);var R=this.graph.view.getState(y);this.textarea.className=null!=R&&1==R.style.html?"mxCellEditor geContentEditable":"mxCellEditor mxPlainTextEditor";this.textarea.style.colorScheme="none"==this.graph.getAdaptiveColors()?"light":"";this.codeViewMode=!1;this.switchSelectionState=null;this.graph.setSelectionCell(y)};mxCellEditor.prototype.toggleViewMode=function(){var y=this.graph.view.getState(this.editingCell);if(null!=y){var O=null!=y&&"0"!=mxUtils.getValue(y.style,"nl2Br","1"),R=this.saveSelection();if(this.codeViewMode){Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);ta=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<ta.length&&"\n"==ta.charAt(ta.length-1)&&(ta=ta.substring(0,ta.length-1));ta=Graph.sanitizeHtml(O?ta.replace(/\n/g,"<br/>"):ta,!0);this.textarea.className="mxCellEditor geContentEditable";ra=mxUtils.getValue(y.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);O=mxUtils.getValue(y.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);var V=mxUtils.getValue(y.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),fa=(mxUtils.getValue(y.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,ia=(mxUtils.getValue(y.style,@@ -2727,249 +2731,249 @@ mxResources.get("rotateTooltip")),this.rotationShape.node.style.display=null!=ththis.state.style[mxConstants.STYLE_ROTATION]||"0"):this.state,O=null!=this.state.text?this.state.text.boundingBox:null,null==R&&(R=this.state),R=R.y+R.height,null!=O&&(R=Math.max(R,O.y+O.height)),this.linkHint.style.left=y.x+y.width/2+"px",this.linkHint.style.top=Math.round(R+this.verticalOffset/2+Editor.hintOffset)+"px",this.linkHint.style.display=1<this.graph.getSelectionCount()?"none":"")};var Ra=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(){Ra.apply(this,arguments);this.destroyMoveHandles();this.destroyCornerHandles();null!=this.linkHint&&(null!=this.linkHint.parentNode&&this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getSelectionModel().removeListener(this.changeHandler),this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null);null!=this.editingHandler&&(this.graph.removeListener(this.editingHandler),this.editingHandler=null)};var Sa=mxEdgeHandler.prototype.redrawHandles;mxEdgeHandler.prototype.redrawHandles=function(){if(null!=this.marker&&(Sa.apply(this),null!=this.state&&null!=this.linkHint)){var y=this.state;null!=this.state.text&&null!=this.state.text.bounds&&(y=new mxRectangle(y.x,y.y,y.width,y.height),y.add(this.state.text.bounds));this.linkHint.style.left=y.x+y.width/2+"px";this.linkHint.style.top=Math.round(y.y+y.height+Editor.hintOffset)+"px";this.linkHint.style.display=1<this.graph.getSelectionCount()?"none":""}};var Ha=mxEdgeHandler.prototype.reset;mxEdgeHandler.prototype.reset=-function(){Ha.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var Ma=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){Ma.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getSelectionModel().removeListener(this.changeHandler),this.changeHandler=null)}}();(function(){function b(d,n,z){mxShape.call(this);this.line=d;this.stroke=n;this.strokewidth=null!=z?z:1;this.updateBoundsFromLine()}function e(){mxSwimlane.call(this)}function g(){mxSwimlane.call(this)}function m(){mxCylinder.call(this)}function v(){mxConnector.call(this)}function p(){mxCylinder.call(this)}function A(){mxActor.call(this)}function H(){mxCylinder.call(this)}function S(){mxCylinder.call(this)}function F(){mxCylinder.call(this)}function K(){mxCylinder.call(this)}function c(){mxShape.call(this)}-function f(){mxShape.call(this)}function l(d,n,z,u){mxShape.call(this);this.bounds=d;this.fill=n;this.stroke=z;this.strokewidth=null!=u?u:1}function t(){mxActor.call(this)}function q(){mxCylinder.call(this)}function D(){mxCylinder.call(this)}function G(){mxActor.call(this)}function N(){mxActor.call(this)}function L(){mxActor.call(this)}function J(){mxActor.call(this)}function Y(){mxActor.call(this)}function ha(){mxActor.call(this)}function ea(){mxActor.call(this)}function aa(d,n){this.canvas=d;this.canvas.setLineJoin("round");-this.canvas.setLineCap("round");this.defaultVariation=n;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,aa.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,aa.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,aa.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,aa.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=+function(){Ha.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var Ma=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){Ma.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getSelectionModel().removeListener(this.changeHandler),this.changeHandler=null)}}();(function(){function b(d,p,z){mxShape.call(this);this.line=d;this.stroke=p;this.strokewidth=null!=z?z:1;this.updateBoundsFromLine()}function e(){mxSwimlane.call(this)}function g(){mxSwimlane.call(this)}function m(){mxCylinder.call(this)}function v(){mxConnector.call(this)}function n(){mxCylinder.call(this)}function A(){mxActor.call(this)}function G(){mxCylinder.call(this)}function S(){mxCylinder.call(this)}function F(){mxCylinder.call(this)}function K(){mxCylinder.call(this)}function c(){mxShape.call(this)}+function f(){mxShape.call(this)}function l(d,p,z,u){mxShape.call(this);this.bounds=d;this.fill=p;this.stroke=z;this.strokewidth=null!=u?u:1}function t(){mxActor.call(this)}function q(){mxCylinder.call(this)}function D(){mxCylinder.call(this)}function H(){mxActor.call(this)}function N(){mxActor.call(this)}function L(){mxActor.call(this)}function J(){mxActor.call(this)}function Y(){mxActor.call(this)}function ha(){mxActor.call(this)}function ea(){mxActor.call(this)}function aa(d,p){this.canvas=d;this.canvas.setLineJoin("round");+this.canvas.setLineCap("round");this.defaultVariation=p;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,aa.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,aa.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,aa.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,aa.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,aa.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,aa.prototype.arcTo)}function na(){mxRectangleShape.call(this)}function W(){mxRectangleShape.call(this)}function ba(){mxActor.call(this)}function ja(){mxActor.call(this)}function ca(){mxActor.call(this)}function la(){mxRectangleShape.call(this)}function Q(){mxRectangleShape.call(this)}function k(){mxCylinder.call(this)}function B(){mxShape.call(this)}function I(){mxShape.call(this)}function U(){mxEllipse.call(this)}function P(){mxShape.call(this)}function T(){mxShape.call(this)}function X(){mxRectangleShape.call(this)}function Z(){mxShape.call(this)}function ka(){mxShape.call(this)}function va(){mxShape.call(this)}function ua(){mxShape.call(this)}function qa(){mxShape.call(this)}function Ba(){mxCylinder.call(this)}function ya(){mxCylinder.call(this)}function La(){mxRectangleShape.call(this)}function za(){mxDoubleEllipse.call(this)}function Ea(){mxDoubleEllipse.call(this)}function pa(){mxArrowConnector.call(this);this.spacing=0}function Ca(){mxArrowConnector.call(this);this.spacing=0}function Aa(){mxActor.call(this)}function wa(){mxRectangleShape.call(this)}function Ya(){mxActor.call(this)}function Qa(){mxActor.call(this)}function Ra(){mxActor.call(this)}function Sa(){mxActor.call(this)}function Ha(){mxActor.call(this)}function Ma(){mxActor.call(this)}function y(){mxActor.call(this)}function O(){mxActor.call(this)}function R(){mxActor.call(this)}function V(){mxActor.call(this)}function fa(){mxEllipse.call(this)}-function ia(){mxEllipse.call(this)}function oa(){mxEllipse.call(this)}function ta(){mxRhombus.call(this)}function ra(){mxEllipse.call(this)}function xa(){mxEllipse.call(this)}function Da(){mxEllipse.call(this)}function Ia(){mxEllipse.call(this)}function Xa(){mxActor.call(this)}function Za(){mxActor.call(this)}function $a(){mxActor.call(this)}function Pa(d,n,z,u){mxShape.call(this);this.bounds=d;this.fill=n;this.stroke=z;this.strokewidth=null!=u?u:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=-!0;this.indent=2;this.rectOutline="single"}function Na(){mxConnector.call(this)}function jb(d,n,z,u,x,C,E,da,M,sa){E+=M;var ma=u.clone();u.x-=x*(2*E+M);u.y-=C*(2*E+M);x*=E+M;C*=E+M;return function(){d.ellipse(ma.x-x-E,ma.y-C-E,2*E,2*E);sa?d.fillAndStroke():d.stroke()}}mxUtils.extend(b,mxShape);b.prototype.updateBoundsFromLine=function(){var d=null;if(null!=this.line)for(var n=0;n<this.line.length;n++){var z=this.line[n];null!=z&&(z=new mxRectangle(z.x,z.y,this.strokewidth,this.strokewidth),null==-d?d=z:d.add(z))}this.bounds=null!=d?d:new mxRectangle};b.prototype.paintVertexShape=function(d,n,z,u,x){this.paintTableLine(d,this.line,0,0)};b.prototype.paintTableLine=function(d,n,z,u){if(null!=n){var x=null;d.begin();for(var C=0;C<n.length;C++){var E=n[C];null!=E&&(null==x?d.moveTo(E.x+z,E.y+u):null!=x&&d.lineTo(E.x+z,E.y+u));x=E}d.end();d.stroke()}};b.prototype.intersectsRectangle=function(d){var n=!1;if(mxShape.prototype.intersectsRectangle.apply(this,arguments)&&null!=this.line)for(var z=null,-u=0;u<this.line.length&&!n;u++){var x=this.line[u];null!=x&&null!=z&&(n=mxUtils.rectangleIntersectsSegment(d,z,x));z=x}return n};mxCellRenderer.registerShape("tableLine",b);mxUtils.extend(e,mxSwimlane);e.prototype.getLabelBounds=function(d){return 0==this.getTitleSize()?mxShape.prototype.getLabelBounds.apply(this,arguments):mxSwimlane.prototype.getLabelBounds.apply(this,arguments)};e.prototype.paintVertexShape=function(d,n,z,u,x){var C=null!=this.state?this.state.view.graph.isCellCollapsed(this.state.cell):-!1,E=this.isHorizontal(),da=this.getTitleSize();0==da||this.outline?Da.prototype.paintVertexShape.apply(this,arguments):(mxSwimlane.prototype.paintVertexShape.apply(this,arguments),d.translate(-n,-z));C||this.outline||!(E&&da<x||!E&&da<u)||this.paintForeground(d,n,z,u,x)};e.prototype.paintForeground=function(d,n,z,u,x){if(null!=this.state){var C=this.flipH,E=this.flipV;if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH){var da=C;C=E;E=da}d.rotate(-this.getShapeRotation(),-C,E,n+u/2,z+x/2);s=this.scale;n=this.bounds.x/s;z=this.bounds.y/s;u=this.bounds.width/s;x=this.bounds.height/s;this.paintTableForeground(d,n,z,u,x)}};e.prototype.paintTableForeground=function(d,n,z,u,x){u=this.state.view.graph.getTableLines(this.state.cell,"0"!=mxUtils.getValue(this.state.style,"rowLines","1"),"0"!=mxUtils.getValue(this.state.style,"columnLines","1"));for(x=0;x<u.length;x++)b.prototype.paintTableLine(d,u[x],n,z)};e.prototype.configurePointerEvents=function(d){0==this.getTitleSize()?-d.pointerEvents=!1:mxSwimlane.prototype.configurePointerEvents.apply(this,arguments)};mxCellRenderer.registerShape("table",e);mxUtils.extend(g,e);g.prototype.paintForeground=function(){};mxCellRenderer.registerShape("tableRow",g);mxUtils.extend(m,mxCylinder);m.prototype.size=20;m.prototype.darkOpacity=0;m.prototype.darkOpacity2=0;m.prototype.paintVertexShape=function(d,n,z,u,x){var C=Math.max(0,Math.min(u,Math.min(x,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),E=Math.max(-1,Math.min(1,-parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity)))),da=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity2",this.darkOpacity2))));d.translate(n,z);d.begin();d.moveTo(0,0);d.lineTo(u-C,0);d.lineTo(u,C);d.lineTo(u,x);d.lineTo(C,x);d.lineTo(0,x-C);d.lineTo(0,0);d.close();d.end();d.fillAndStroke();this.outline||(d.setShadow(!1),0!=E&&(d.setFillAlpha(Math.abs(E)),d.setFillColor(0>E?"#FFFFFF":"#000000"),d.begin(),d.moveTo(0,0),d.lineTo(u-C,0),d.lineTo(u,C),+function ia(){mxEllipse.call(this)}function oa(){mxEllipse.call(this)}function ta(){mxRhombus.call(this)}function ra(){mxEllipse.call(this)}function xa(){mxEllipse.call(this)}function Da(){mxEllipse.call(this)}function Ia(){mxEllipse.call(this)}function Xa(){mxActor.call(this)}function Za(){mxActor.call(this)}function $a(){mxActor.call(this)}function Pa(d,p,z,u){mxShape.call(this);this.bounds=d;this.fill=p;this.stroke=z;this.strokewidth=null!=u?u:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=+!0;this.indent=2;this.rectOutline="single"}function Na(){mxConnector.call(this)}function jb(d,p,z,u,x,C,E,da,M,sa){E+=M;var ma=u.clone();u.x-=x*(2*E+M);u.y-=C*(2*E+M);x*=E+M;C*=E+M;return function(){d.ellipse(ma.x-x-E,ma.y-C-E,2*E,2*E);sa?d.fillAndStroke():d.stroke()}}mxUtils.extend(b,mxShape);b.prototype.updateBoundsFromLine=function(){var d=null;if(null!=this.line)for(var p=0;p<this.line.length;p++){var z=this.line[p];null!=z&&(z=new mxRectangle(z.x,z.y,this.strokewidth,this.strokewidth),null==+d?d=z:d.add(z))}this.bounds=null!=d?d:new mxRectangle};b.prototype.paintVertexShape=function(d,p,z,u,x){this.paintTableLine(d,this.line,0,0)};b.prototype.paintTableLine=function(d,p,z,u){if(null!=p){var x=null;d.begin();for(var C=0;C<p.length;C++){var E=p[C];null!=E&&(null==x?d.moveTo(E.x+z,E.y+u):null!=x&&d.lineTo(E.x+z,E.y+u));x=E}d.end();d.stroke()}};b.prototype.intersectsRectangle=function(d){var p=!1;if(mxShape.prototype.intersectsRectangle.apply(this,arguments)&&null!=this.line)for(var z=null,+u=0;u<this.line.length&&!p;u++){var x=this.line[u];null!=x&&null!=z&&(p=mxUtils.rectangleIntersectsSegment(d,z,x));z=x}return p};mxCellRenderer.registerShape("tableLine",b);mxUtils.extend(e,mxSwimlane);e.prototype.getLabelBounds=function(d){return 0==this.getTitleSize()?mxShape.prototype.getLabelBounds.apply(this,arguments):mxSwimlane.prototype.getLabelBounds.apply(this,arguments)};e.prototype.paintVertexShape=function(d,p,z,u,x){var C=null!=this.state?this.state.view.graph.isCellCollapsed(this.state.cell):+!1,E=this.isHorizontal(),da=this.getTitleSize();0==da||this.outline?Da.prototype.paintVertexShape.apply(this,arguments):(mxSwimlane.prototype.paintVertexShape.apply(this,arguments),d.translate(-p,-z));C||this.outline||!(E&&da<x||!E&&da<u)||this.paintForeground(d,p,z,u,x)};e.prototype.paintForeground=function(d,p,z,u,x){if(null!=this.state){var C=this.flipH,E=this.flipV;if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH){var da=C;C=E;E=da}d.rotate(-this.getShapeRotation(),+C,E,p+u/2,z+x/2);s=this.scale;p=this.bounds.x/s;z=this.bounds.y/s;u=this.bounds.width/s;x=this.bounds.height/s;this.paintTableForeground(d,p,z,u,x)}};e.prototype.paintTableForeground=function(d,p,z,u,x){u=this.state.view.graph.getTableLines(this.state.cell,"0"!=mxUtils.getValue(this.state.style,"rowLines","1"),"0"!=mxUtils.getValue(this.state.style,"columnLines","1"));for(x=0;x<u.length;x++)b.prototype.paintTableLine(d,u[x],p,z)};e.prototype.configurePointerEvents=function(d){0==this.getTitleSize()?+d.pointerEvents=!1:mxSwimlane.prototype.configurePointerEvents.apply(this,arguments)};mxCellRenderer.registerShape("table",e);mxUtils.extend(g,e);g.prototype.paintForeground=function(){};mxCellRenderer.registerShape("tableRow",g);mxUtils.extend(m,mxCylinder);m.prototype.size=20;m.prototype.darkOpacity=0;m.prototype.darkOpacity2=0;m.prototype.paintVertexShape=function(d,p,z,u,x){var C=Math.max(0,Math.min(u,Math.min(x,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),E=Math.max(-1,Math.min(1,+parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity)))),da=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity2",this.darkOpacity2))));d.translate(p,z);d.begin();d.moveTo(0,0);d.lineTo(u-C,0);d.lineTo(u,C);d.lineTo(u,x);d.lineTo(C,x);d.lineTo(0,x-C);d.lineTo(0,0);d.close();d.end();d.fillAndStroke();this.outline||(d.setShadow(!1),0!=E&&(d.setFillAlpha(Math.abs(E)),d.setFillColor(0>E?"#FFFFFF":"#000000"),d.begin(),d.moveTo(0,0),d.lineTo(u-C,0),d.lineTo(u,C),d.lineTo(C,C),d.close(),d.fill()),0!=da&&(d.setFillAlpha(Math.abs(da)),d.setFillColor(0>da?"#FFFFFF":"#000000"),d.begin(),d.moveTo(0,0),d.lineTo(C,C),d.lineTo(C,x),d.lineTo(0,x-C),d.close(),d.fill()),d.begin(),d.moveTo(C,x),d.lineTo(C,C),d.lineTo(0,0),d.moveTo(C,C),d.lineTo(u,C),d.end(),d.stroke())};m.prototype.getLabelMargins=function(d){return mxUtils.getValue(this.style,"boundedLbl",!1)?(d=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(d,d,0,0)):null};mxCellRenderer.registerShape("cube",-m);var cb=Math.tan(mxUtils.toRadians(30)),ab=(.5-cb)/2;mxCellRenderer.registerShape("isoRectangle",A);mxUtils.extend(v,mxConnector);v.prototype.paintEdgeShape=function(d,n){var z=this.createMarker(d,n,!0),u=this.createMarker(d,n,!1);d.setDashed(!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);null!=this.isDashed&&d.setDashed(this.isDashed,null!=this.style?1==mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,!1):!1);d.setShadow(!1);d.setStrokeColor(this.fill);mxPolyline.prototype.paintEdgeShape.apply(this,-arguments);d.setStrokeColor(this.stroke);d.setFillColor(this.stroke);d.setDashed(!1);null!=z&&z();null!=u&&u()};mxCellRenderer.registerShape("wire",v);mxUtils.extend(p,mxCylinder);p.prototype.size=6;p.prototype.paintVertexShape=function(d,n,z,u,x){d.setFillColor(this.stroke);var C=Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size))-2)+2*this.strokewidth;d.ellipse(n+.5*(u-C),z+.5*(x-C),C,C);d.fill();d.setFillColor(mxConstants.NONE);d.rect(n,z,u,x);d.fill()};mxCellRenderer.registerShape("waypoint",-p);mxUtils.extend(A,mxActor);A.prototype.size=20;A.prototype.redrawPath=function(d,n,z,u,x){n=Math.min(u,x/cb);d.translate((u-n)/2,(x-n)/2+n/4);d.moveTo(0,.25*n);d.lineTo(.5*n,n*ab);d.lineTo(n,.25*n);d.lineTo(.5*n,(.5-ab)*n);d.lineTo(0,.25*n);d.close();d.end()};mxCellRenderer.registerShape("isoRectangle",A);mxUtils.extend(H,mxCylinder);H.prototype.size=20;H.prototype.redrawPath=function(d,n,z,u,x,C){n=Math.min(u,x/(.5+cb));C?(d.moveTo(0,.25*n),d.lineTo(.5*n,(.5-ab)*n),d.lineTo(n,.25*n),d.moveTo(.5*-n,(.5-ab)*n),d.lineTo(.5*n,(1-ab)*n)):(d.translate((u-n)/2,(x-n)/2),d.moveTo(0,.25*n),d.lineTo(.5*n,n*ab),d.lineTo(n,.25*n),d.lineTo(n,.75*n),d.lineTo(.5*n,(1-ab)*n),d.lineTo(0,.75*n),d.close());d.end()};mxCellRenderer.registerShape("isoCube",H);mxUtils.extend(S,mxCylinder);S.prototype.redrawPath=function(d,n,z,u,x,C){n=Math.min(x/2,Math.round(x/8)+this.strokewidth-1);if(C&&null!=this.fill||!C&&null==this.fill)d.moveTo(0,n),d.curveTo(0,2*n,u,2*n,u,n),C||(d.stroke(),d.begin()),d.translate(0,n/2),d.moveTo(0,-n),d.curveTo(0,2*n,u,2*n,u,n),C||(d.stroke(),d.begin()),d.translate(0,n/2),d.moveTo(0,n),d.curveTo(0,2*n,u,2*n,u,n),C||(d.stroke(),d.begin()),d.translate(0,-n);C||(d.moveTo(0,n),d.curveTo(0,-n/3,u,-n/3,u,n),d.lineTo(u,x-n),d.curveTo(u,x+n/3,0,x+n/3,0,x-n),d.close())};S.prototype.getLabelMargins=function(d){return new mxRectangle(0,2.5*Math.min(d.height/2,Math.round(d.height/8)+this.strokewidth-1),0,0)};mxCellRenderer.registerShape("datastore",S);mxUtils.extend(F,mxCylinder);F.prototype.size=30;F.prototype.darkOpacity=-0;F.prototype.paintVertexShape=function(d,n,z,u,x){var C=Math.max(0,Math.min(u,Math.min(x,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),E=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity))));d.translate(n,z);d.begin();d.moveTo(0,0);d.lineTo(u-C,0);d.lineTo(u,C);d.lineTo(u,x);d.lineTo(0,x);d.lineTo(0,0);d.close();d.end();d.fillAndStroke();this.outline||(d.setShadow(!1),0!=E&&(d.setFillAlpha(Math.abs(E)),d.setFillColor(0>E?"#FFFFFF":"#000000"),-d.begin(),d.moveTo(u-C,0),d.lineTo(u-C,C),d.lineTo(u,C),d.close(),d.fill()),d.begin(),d.moveTo(u-C,0),d.lineTo(u-C,C),d.lineTo(u,C),d.end(),d.stroke())};mxCellRenderer.registerShape("note",F);mxUtils.extend(K,F);mxCellRenderer.registerShape("note2",K);K.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(d.height*this.scale,n*this.scale),0,0)}return null};mxUtils.extend(c,mxShape);c.prototype.isoAngle=-15;c.prototype.paintVertexShape=function(d,n,z,u,x){var C=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;C=Math.min(u*Math.tan(C),.5*x);d.translate(n,z);d.begin();d.moveTo(.5*u,0);d.lineTo(u,C);d.lineTo(u,x-C);d.lineTo(.5*u,x);d.lineTo(0,x-C);d.lineTo(0,C);d.close();d.fillAndStroke();d.setShadow(!1);d.begin();d.moveTo(0,C);d.lineTo(.5*u,2*C);d.lineTo(u,C);d.moveTo(.5*u,2*C);d.lineTo(.5*u,x);d.stroke()};mxCellRenderer.registerShape("isoCube2",-c);mxUtils.extend(f,mxShape);f.prototype.size=15;f.prototype.paintVertexShape=function(d,n,z,u,x){var C=Math.max(0,Math.min(.5*x,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.translate(n,z);0==C?(d.rect(0,0,u,x),d.fillAndStroke()):(d.begin(),d.moveTo(0,C),d.arcTo(.5*u,C,0,0,1,.5*u,0),d.arcTo(.5*u,C,0,0,1,u,C),d.lineTo(u,x-C),d.arcTo(.5*u,C,0,0,1,.5*u,x),d.arcTo(.5*u,C,0,0,1,0,x-C),d.close(),d.fillAndStroke(),d.setShadow(!1),d.begin(),d.moveTo(u,C),d.arcTo(.5*u,C,0,0,1,.5*u,2*C),d.arcTo(.5*-u,C,0,0,1,0,C),d.stroke())};mxCellRenderer.registerShape("cylinder2",f);mxUtils.extend(l,mxCylinder);l.prototype.size=15;l.prototype.paintVertexShape=function(d,n,z,u,x){var C=Math.max(0,Math.min(.5*x,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),E=mxUtils.getValue(this.style,"lid",!0);d.translate(n,z);0==C?(d.rect(0,0,u,x),d.fillAndStroke()):(d.begin(),E?(d.moveTo(0,C),d.arcTo(.5*u,C,0,0,1,.5*u,0),d.arcTo(.5*u,C,0,0,1,u,C)):(d.moveTo(0,0),d.arcTo(.5*u,C,0,0,0,.5*u,C),d.arcTo(.5*u,C,-0,0,0,u,0)),d.lineTo(u,x-C),d.arcTo(.5*u,C,0,0,1,.5*u,x),d.arcTo(.5*u,C,0,0,1,0,x-C),d.close(),d.fillAndStroke(),d.setShadow(!1),E&&(d.begin(),d.moveTo(u,C),d.arcTo(.5*u,C,0,0,1,.5*u,2*C),d.arcTo(.5*u,C,0,0,1,0,C),d.stroke()))};mxCellRenderer.registerShape("cylinder3",l);mxUtils.extend(t,mxActor);t.prototype.redrawPath=function(d,n,z,u,x){d.moveTo(0,0);d.quadTo(u/2,.5*x,u,0);d.quadTo(.5*u,x/2,u,x);d.quadTo(u/2,.5*x,0,x);d.quadTo(.5*u,x/2,0,0);d.end()};mxCellRenderer.registerShape("switch",t);mxUtils.extend(q,-mxCylinder);q.prototype.tabWidth=60;q.prototype.tabHeight=20;q.prototype.tabPosition="right";q.prototype.arcSize=.1;q.prototype.isRoundable=function(){return!0};q.prototype.paintVertexShape=function(d,n,z,u,x){d.translate(n,z);n=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));z=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var C=mxUtils.getValue(this.style,"tabPosition",this.tabPosition),E=mxUtils.getValue(this.style,-"rounded",!1),da=mxUtils.getValue(this.style,"absoluteArcSize",!1),M=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));da||(M*=Math.min(u,x));M=Math.min(M,.5*u,.5*(x-z));n=Math.max(n,M);n=Math.min(u-M,n);E||(M=0);d.begin();"left"==C?(d.moveTo(Math.max(M,0),z),d.lineTo(Math.max(M,0),0),d.lineTo(n,0),d.lineTo(n,z)):(d.moveTo(u-n,z),d.lineTo(u-n,0),d.lineTo(u-Math.max(M,0),0),d.lineTo(u-Math.max(M,0),z));E?(d.moveTo(0,M+z),d.arcTo(M,M,0,0,1,M,z),d.lineTo(u-M,z),d.arcTo(M,M,0,0,1,u,M+z),-d.lineTo(u,x-M),d.arcTo(M,M,0,0,1,u-M,x),d.lineTo(M,x),d.arcTo(M,M,0,0,1,0,x-M)):(d.moveTo(0,z),d.lineTo(u,z),d.lineTo(u,x),d.lineTo(0,x));d.close();d.fillAndStroke();d.setShadow(!1);"triangle"==mxUtils.getValue(this.style,"folderSymbol",null)&&(d.begin(),d.moveTo(u-30,z+20),d.lineTo(u-20,z+10),d.lineTo(u-10,z+20),d.close(),d.stroke())};mxCellRenderer.registerShape("folder",q);q.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=mxUtils.getValue(this.style,-"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var z=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;n=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var u=mxUtils.getValue(this.style,"rounded",!1),x=mxUtils.getValue(this.style,"absoluteArcSize",!1),C=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));x||(C*=Math.min(d.width,d.height));C=Math.min(C,.5*d.width,.5*(d.height-n));u||(C=0);return"left"==mxUtils.getValue(this.style,"tabPosition",-this.tabPosition)?new mxRectangle(C,0,Math.min(d.width,d.width-z),Math.min(d.height,d.height-n)):new mxRectangle(Math.min(d.width,d.width-z),0,C,Math.min(d.height,d.height-n))}return new mxRectangle(0,Math.min(d.height,n),0,0)}return null};mxUtils.extend(D,mxCylinder);D.prototype.arcSize=.1;D.prototype.paintVertexShape=function(d,n,z,u,x){d.translate(n,z);var C=mxUtils.getValue(this.style,"rounded",!1),E=mxUtils.getValue(this.style,"absoluteArcSize",!1);n=parseFloat(mxUtils.getValue(this.style,"arcSize",-this.arcSize));z=mxUtils.getValue(this.style,"umlStateConnection",null);E||(n*=Math.min(u,x));n=Math.min(n,.5*u,.5*x);C||(n=0);C=0;null!=z&&(C=10);d.begin();d.moveTo(C,n);d.arcTo(n,n,0,0,1,C+n,0);d.lineTo(u-n,0);d.arcTo(n,n,0,0,1,u,n);d.lineTo(u,x-n);d.arcTo(n,n,0,0,1,u-n,x);d.lineTo(C+n,x);d.arcTo(n,n,0,0,1,C,x-n);d.close();d.fillAndStroke();d.setShadow(!1);"collapseState"==mxUtils.getValue(this.style,"umlStateSymbol",null)&&(d.roundrect(u-40,x-20,10,10,3,3),d.stroke(),d.roundrect(u-20,x-20,10,10,+m);var cb=Math.tan(mxUtils.toRadians(30)),ab=(.5-cb)/2;mxCellRenderer.registerShape("isoRectangle",A);mxUtils.extend(v,mxConnector);v.prototype.paintEdgeShape=function(d,p){var z=this.createMarker(d,p,!0),u=this.createMarker(d,p,!1);d.setDashed(!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);null!=this.isDashed&&d.setDashed(this.isDashed,null!=this.style?1==mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,!1):!1);d.setShadow(!1);d.setStrokeColor(this.fill);mxPolyline.prototype.paintEdgeShape.apply(this,+arguments);d.setStrokeColor(this.stroke);d.setFillColor(this.stroke);d.setDashed(!1);null!=z&&z();null!=u&&u()};mxCellRenderer.registerShape("wire",v);mxUtils.extend(n,mxCylinder);n.prototype.size=6;n.prototype.paintVertexShape=function(d,p,z,u,x){d.setFillColor(this.stroke);var C=Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size))-2)+2*this.strokewidth;d.ellipse(p+.5*(u-C),z+.5*(x-C),C,C);d.fill();d.setFillColor(mxConstants.NONE);d.rect(p,z,u,x);d.fill()};mxCellRenderer.registerShape("waypoint",+n);mxUtils.extend(A,mxActor);A.prototype.size=20;A.prototype.redrawPath=function(d,p,z,u,x){p=Math.min(u,x/cb);d.translate((u-p)/2,(x-p)/2+p/4);d.moveTo(0,.25*p);d.lineTo(.5*p,p*ab);d.lineTo(p,.25*p);d.lineTo(.5*p,(.5-ab)*p);d.lineTo(0,.25*p);d.close();d.end()};mxCellRenderer.registerShape("isoRectangle",A);mxUtils.extend(G,mxCylinder);G.prototype.size=20;G.prototype.redrawPath=function(d,p,z,u,x,C){p=Math.min(u,x/(.5+cb));C?(d.moveTo(0,.25*p),d.lineTo(.5*p,(.5-ab)*p),d.lineTo(p,.25*p),d.moveTo(.5*+p,(.5-ab)*p),d.lineTo(.5*p,(1-ab)*p)):(d.translate((u-p)/2,(x-p)/2),d.moveTo(0,.25*p),d.lineTo(.5*p,p*ab),d.lineTo(p,.25*p),d.lineTo(p,.75*p),d.lineTo(.5*p,(1-ab)*p),d.lineTo(0,.75*p),d.close());d.end()};mxCellRenderer.registerShape("isoCube",G);mxUtils.extend(S,mxCylinder);S.prototype.redrawPath=function(d,p,z,u,x,C){p=Math.min(x/2,Math.round(x/8)+this.strokewidth-1);if(C&&null!=this.fill||!C&&null==this.fill)d.moveTo(0,p),d.curveTo(0,2*p,u,2*p,u,p),C||(d.stroke(),d.begin()),d.translate(0,p/2),d.moveTo(0,+p),d.curveTo(0,2*p,u,2*p,u,p),C||(d.stroke(),d.begin()),d.translate(0,p/2),d.moveTo(0,p),d.curveTo(0,2*p,u,2*p,u,p),C||(d.stroke(),d.begin()),d.translate(0,-p);C||(d.moveTo(0,p),d.curveTo(0,-p/3,u,-p/3,u,p),d.lineTo(u,x-p),d.curveTo(u,x+p/3,0,x+p/3,0,x-p),d.close())};S.prototype.getLabelMargins=function(d){return new mxRectangle(0,2.5*Math.min(d.height/2,Math.round(d.height/8)+this.strokewidth-1),0,0)};mxCellRenderer.registerShape("datastore",S);mxUtils.extend(F,mxCylinder);F.prototype.size=30;F.prototype.darkOpacity=+0;F.prototype.paintVertexShape=function(d,p,z,u,x){var C=Math.max(0,Math.min(u,Math.min(x,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),E=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity))));d.translate(p,z);d.begin();d.moveTo(0,0);d.lineTo(u-C,0);d.lineTo(u,C);d.lineTo(u,x);d.lineTo(0,x);d.lineTo(0,0);d.close();d.end();d.fillAndStroke();this.outline||(d.setShadow(!1),0!=E&&(d.setFillAlpha(Math.abs(E)),d.setFillColor(0>E?"#FFFFFF":"#000000"),+d.begin(),d.moveTo(u-C,0),d.lineTo(u-C,C),d.lineTo(u,C),d.close(),d.fill()),d.begin(),d.moveTo(u-C,0),d.lineTo(u-C,C),d.lineTo(u,C),d.end(),d.stroke())};mxCellRenderer.registerShape("note",F);mxUtils.extend(K,F);mxCellRenderer.registerShape("note2",K);K.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var p=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(d.height*this.scale,p*this.scale),0,0)}return null};mxUtils.extend(c,mxShape);c.prototype.isoAngle=+15;c.prototype.paintVertexShape=function(d,p,z,u,x){var C=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;C=Math.min(u*Math.tan(C),.5*x);d.translate(p,z);d.begin();d.moveTo(.5*u,0);d.lineTo(u,C);d.lineTo(u,x-C);d.lineTo(.5*u,x);d.lineTo(0,x-C);d.lineTo(0,C);d.close();d.fillAndStroke();d.setShadow(!1);d.begin();d.moveTo(0,C);d.lineTo(.5*u,2*C);d.lineTo(u,C);d.moveTo(.5*u,2*C);d.lineTo(.5*u,x);d.stroke()};mxCellRenderer.registerShape("isoCube2",+c);mxUtils.extend(f,mxShape);f.prototype.size=15;f.prototype.paintVertexShape=function(d,p,z,u,x){var C=Math.max(0,Math.min(.5*x,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.translate(p,z);0==C?(d.rect(0,0,u,x),d.fillAndStroke()):(d.begin(),d.moveTo(0,C),d.arcTo(.5*u,C,0,0,1,.5*u,0),d.arcTo(.5*u,C,0,0,1,u,C),d.lineTo(u,x-C),d.arcTo(.5*u,C,0,0,1,.5*u,x),d.arcTo(.5*u,C,0,0,1,0,x-C),d.close(),d.fillAndStroke(),d.setShadow(!1),d.begin(),d.moveTo(u,C),d.arcTo(.5*u,C,0,0,1,.5*u,2*C),d.arcTo(.5*+u,C,0,0,1,0,C),d.stroke())};mxCellRenderer.registerShape("cylinder2",f);mxUtils.extend(l,mxCylinder);l.prototype.size=15;l.prototype.paintVertexShape=function(d,p,z,u,x){var C=Math.max(0,Math.min(.5*x,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),E=mxUtils.getValue(this.style,"lid",!0);d.translate(p,z);0==C?(d.rect(0,0,u,x),d.fillAndStroke()):(d.begin(),E?(d.moveTo(0,C),d.arcTo(.5*u,C,0,0,1,.5*u,0),d.arcTo(.5*u,C,0,0,1,u,C)):(d.moveTo(0,0),d.arcTo(.5*u,C,0,0,0,.5*u,C),d.arcTo(.5*u,C,+0,0,0,u,0)),d.lineTo(u,x-C),d.arcTo(.5*u,C,0,0,1,.5*u,x),d.arcTo(.5*u,C,0,0,1,0,x-C),d.close(),d.fillAndStroke(),d.setShadow(!1),E&&(d.begin(),d.moveTo(u,C),d.arcTo(.5*u,C,0,0,1,.5*u,2*C),d.arcTo(.5*u,C,0,0,1,0,C),d.stroke()))};mxCellRenderer.registerShape("cylinder3",l);mxUtils.extend(t,mxActor);t.prototype.redrawPath=function(d,p,z,u,x){d.moveTo(0,0);d.quadTo(u/2,.5*x,u,0);d.quadTo(.5*u,x/2,u,x);d.quadTo(u/2,.5*x,0,x);d.quadTo(.5*u,x/2,0,0);d.end()};mxCellRenderer.registerShape("switch",t);mxUtils.extend(q,+mxCylinder);q.prototype.tabWidth=60;q.prototype.tabHeight=20;q.prototype.tabPosition="right";q.prototype.arcSize=.1;q.prototype.isRoundable=function(){return!0};q.prototype.paintVertexShape=function(d,p,z,u,x){d.translate(p,z);p=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));z=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var C=mxUtils.getValue(this.style,"tabPosition",this.tabPosition),E=mxUtils.getValue(this.style,+"rounded",!1),da=mxUtils.getValue(this.style,"absoluteArcSize",!1),M=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));da||(M*=Math.min(u,x));M=Math.min(M,.5*u,.5*(x-z));p=Math.max(p,M);p=Math.min(u-M,p);E||(M=0);d.begin();"left"==C?(d.moveTo(Math.max(M,0),z),d.lineTo(Math.max(M,0),0),d.lineTo(p,0),d.lineTo(p,z)):(d.moveTo(u-p,z),d.lineTo(u-p,0),d.lineTo(u-Math.max(M,0),0),d.lineTo(u-Math.max(M,0),z));E?(d.moveTo(0,M+z),d.arcTo(M,M,0,0,1,M,z),d.lineTo(u-M,z),d.arcTo(M,M,0,0,1,u,M+z),+d.lineTo(u,x-M),d.arcTo(M,M,0,0,1,u-M,x),d.lineTo(M,x),d.arcTo(M,M,0,0,1,0,x-M)):(d.moveTo(0,z),d.lineTo(u,z),d.lineTo(u,x),d.lineTo(0,x));d.close();d.fillAndStroke();d.setShadow(!1);"triangle"==mxUtils.getValue(this.style,"folderSymbol",null)&&(d.begin(),d.moveTo(u-30,z+20),d.lineTo(u-20,z+10),d.lineTo(u-10,z+20),d.close(),d.stroke())};mxCellRenderer.registerShape("folder",q);q.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var p=mxUtils.getValue(this.style,+"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var z=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;p=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var u=mxUtils.getValue(this.style,"rounded",!1),x=mxUtils.getValue(this.style,"absoluteArcSize",!1),C=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));x||(C*=Math.min(d.width,d.height));C=Math.min(C,.5*d.width,.5*(d.height-p));u||(C=0);return"left"==mxUtils.getValue(this.style,"tabPosition",+this.tabPosition)?new mxRectangle(C,0,Math.min(d.width,d.width-z),Math.min(d.height,d.height-p)):new mxRectangle(Math.min(d.width,d.width-z),0,C,Math.min(d.height,d.height-p))}return new mxRectangle(0,Math.min(d.height,p),0,0)}return null};mxUtils.extend(D,mxCylinder);D.prototype.arcSize=.1;D.prototype.paintVertexShape=function(d,p,z,u,x){d.translate(p,z);var C=mxUtils.getValue(this.style,"rounded",!1),E=mxUtils.getValue(this.style,"absoluteArcSize",!1);p=parseFloat(mxUtils.getValue(this.style,"arcSize",+this.arcSize));z=mxUtils.getValue(this.style,"umlStateConnection",null);E||(p*=Math.min(u,x));p=Math.min(p,.5*u,.5*x);C||(p=0);C=0;null!=z&&(C=10);d.begin();d.moveTo(C,p);d.arcTo(p,p,0,0,1,C+p,0);d.lineTo(u-p,0);d.arcTo(p,p,0,0,1,u,p);d.lineTo(u,x-p);d.arcTo(p,p,0,0,1,u-p,x);d.lineTo(C+p,x);d.arcTo(p,p,0,0,1,C,x-p);d.close();d.fillAndStroke();d.setShadow(!1);"collapseState"==mxUtils.getValue(this.style,"umlStateSymbol",null)&&(d.roundrect(u-40,x-20,10,10,3,3),d.stroke(),d.roundrect(u-20,x-20,10,10,3,3),d.stroke(),d.begin(),d.moveTo(u-30,x-15),d.lineTo(u-20,x-15),d.stroke());"connPointRefEntry"==z?(d.ellipse(0,.5*x-10,20,20),d.fillAndStroke()):"connPointRefExit"==z&&(d.ellipse(0,.5*x-10,20,20),d.fillAndStroke(),d.begin(),d.moveTo(5,.5*x-5),d.lineTo(15,.5*x+5),d.moveTo(15,.5*x-5),d.lineTo(5,.5*x+5),d.stroke())};D.prototype.getLabelMargins=function(d){return mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*this.scale,-0,0,0):null};mxCellRenderer.registerShape("umlState",D);mxUtils.extend(G,mxActor);G.prototype.size=30;G.prototype.isRoundable=function(){return!0};G.prototype.redrawPath=function(d,n,z,u,x){n=Math.max(0,Math.min(u,Math.min(x,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(n,0),new mxPoint(u,0),new mxPoint(u,x),new mxPoint(0,x),new mxPoint(0,n)],this.isRounded,z,!0);d.end()};-mxCellRenderer.registerShape("card",G);mxUtils.extend(N,mxActor);N.prototype.size=.4;N.prototype.redrawPath=function(d,n,z,u,x){n=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.moveTo(0,n/2);d.quadTo(u/4,1.4*n,u/2,n/2);d.quadTo(3*u/4,n*(1-1.4),u,n/2);d.lineTo(u,x-n/2);d.quadTo(3*u/4,x-1.4*n,u/2,x-n/2);d.quadTo(u/4,x-n*(1-1.4),0,x-n/2);d.lineTo(0,n/2);d.close();d.end()};N.prototype.getLabelBounds=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=-mxUtils.getValue(this.style,"size",this.size),z=d.width,u=d.height;if(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return n*=u,new mxRectangle(d.x,d.y+n,z,u-2*n);n*=z;return new mxRectangle(d.x+n,d.y,z-2*n,u)}return d};mxCellRenderer.registerShape("tape",N);mxUtils.extend(L,mxActor);L.prototype.size=.3;L.prototype.getLabelMargins=function(d){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,-"size",this.size))*d.height):null};L.prototype.redrawPath=function(d,n,z,u,x){n=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.moveTo(0,0);d.lineTo(u,0);d.lineTo(u,x-n/2);d.quadTo(3*u/4,x-1.4*n,u/2,x-n/2);d.quadTo(u/4,x-n*(1-1.4),0,x-n/2);d.lineTo(0,n/2);d.close();d.end()};mxCellRenderer.registerShape("document",L);var db=mxCylinder.prototype.getCylinderSize;mxCylinder.prototype.getCylinderSize=function(d,n,z,u){var x=mxUtils.getValue(this.style,"size");return null!=-x?u*Math.max(0,Math.min(1,x)):db.apply(this,arguments)};mxCylinder.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=2*mxUtils.getValue(this.style,"size",.15);return new mxRectangle(0,Math.min(this.maxHeight*this.scale,d.height*n),0,0)}return null};l.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=mxUtils.getValue(this.style,"size",15);mxUtils.getValue(this.style,"lid",!0)||(n/=2);return new mxRectangle(0,Math.min(d.height*-this.scale,2*n*this.scale),0,Math.max(0,.3*n*this.scale))}return null};q.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var z=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;n=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var u=mxUtils.getValue(this.style,"rounded",!1),x=mxUtils.getValue(this.style,"absoluteArcSize",!1),C=parseFloat(mxUtils.getValue(this.style,-"arcSize",this.arcSize));x||(C*=Math.min(d.width,d.height));C=Math.min(C,.5*d.width,.5*(d.height-n));u||(C=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(C,0,Math.min(d.width,d.width-z),Math.min(d.height,d.height-n)):new mxRectangle(Math.min(d.width,d.width-z),0,C,Math.min(d.height,d.height-n))}return new mxRectangle(0,Math.min(d.height,n),0,0)}return null};D.prototype.getLabelMargins=function(d){return mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=-mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*this.scale,0,0,0):null};K.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var n=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(d.height*this.scale,n*this.scale),0,Math.max(0,n*this.scale))}return null};mxUtils.extend(J,mxActor);J.prototype.size=.2;J.prototype.fixedSize=20;J.prototype.isRoundable=function(){return!0};J.prototype.redrawPath=function(d,n,z,u,x){n=-"0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,x),new mxPoint(n,0),new mxPoint(u,0),new mxPoint(u-n,x)],this.isRounded,z,!0);d.end()};mxCellRenderer.registerShape("parallelogram",J);mxUtils.extend(Y,mxActor);Y.prototype.size=-.2;Y.prototype.fixedSize=20;Y.prototype.isRoundable=function(){return!0};Y.prototype.redrawPath=function(d,n,z,u,x){n="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,x),new mxPoint(n,0),new mxPoint(u-n,0),new mxPoint(u,-x)],this.isRounded,z,!0)};mxCellRenderer.registerShape("trapezoid",Y);mxUtils.extend(ha,mxActor);ha.prototype.size=.5;ha.prototype.redrawPath=function(d,n,z,u,x){d.setFillColor(null);n=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(u,0),new mxPoint(n,0),new mxPoint(n,x/2),new mxPoint(0,x/2),new mxPoint(n,x/2),new mxPoint(n,x),new mxPoint(u,x)],this.isRounded,-z,!1);d.end()};mxCellRenderer.registerShape("curlyBracket",ha);mxUtils.extend(ea,mxActor);ea.prototype.redrawPath=function(d,n,z,u,x){d.setStrokeWidth(1);d.setFillColor(this.stroke);n=u/5;d.rect(0,0,n,x);d.fillAndStroke();d.rect(2*n,0,n,x);d.fillAndStroke();d.rect(4*n,0,n,x);d.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",ea);aa.prototype.moveTo=function(d,n){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=n;this.firstX=d;this.firstY=n};aa.prototype.close=-function(){null!=this.firstX&&null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,arguments));this.originalClose.apply(this.canvas,arguments)};aa.prototype.quadTo=function(d,n,z,u){this.originalQuadTo.apply(this.canvas,arguments);this.lastX=z;this.lastY=u};aa.prototype.curveTo=function(d,n,z,u,x,C){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=x;this.lastY=C};aa.prototype.arcTo=function(d,n,z,u,x,C,E){this.originalArcTo.apply(this.canvas,arguments);-this.lastX=C;this.lastY=E};aa.prototype.lineTo=function(d,n){if(null!=this.lastX&&null!=this.lastY){var z=function(ma){return"number"===typeof ma?ma?0>ma?-1:1:ma===ma?0:NaN:NaN},u=Math.abs(d-this.lastX),x=Math.abs(n-this.lastY),C=Math.sqrt(u*u+x*x);if(2>C){this.originalLineTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=n;return}var E=Math.round(C/10),da=this.defaultVariation;5>E&&(E=5,da/=3);var M=z(d-this.lastX)*u/E;z=z(n-this.lastY)*x/E;u/=C;x/=C;for(C=0;C<E;C++){var sa=(Math.random()--.5)*da;this.originalLineTo.call(this.canvas,M*C+this.lastX-sa*x,z*C+this.lastY-sa*u)}this.originalLineTo.call(this.canvas,d,n)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=n};aa.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};var lb=mxShape.prototype.beforePaint;+0,0,0):null};mxCellRenderer.registerShape("umlState",D);mxUtils.extend(H,mxActor);H.prototype.size=30;H.prototype.isRoundable=function(){return!0};H.prototype.redrawPath=function(d,p,z,u,x){p=Math.max(0,Math.min(u,Math.min(x,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(p,0),new mxPoint(u,0),new mxPoint(u,x),new mxPoint(0,x),new mxPoint(0,p)],this.isRounded,z,!0);d.end()};+mxCellRenderer.registerShape("card",H);mxUtils.extend(N,mxActor);N.prototype.size=.4;N.prototype.redrawPath=function(d,p,z,u,x){p=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.moveTo(0,p/2);d.quadTo(u/4,1.4*p,u/2,p/2);d.quadTo(3*u/4,p*(1-1.4),u,p/2);d.lineTo(u,x-p/2);d.quadTo(3*u/4,x-1.4*p,u/2,x-p/2);d.quadTo(u/4,x-p*(1-1.4),0,x-p/2);d.lineTo(0,p/2);d.close();d.end()};N.prototype.getLabelBounds=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var p=+mxUtils.getValue(this.style,"size",this.size),z=d.width,u=d.height;if(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return p*=u,new mxRectangle(d.x,d.y+p,z,u-2*p);p*=z;return new mxRectangle(d.x+p,d.y,z-2*p,u)}return d};mxCellRenderer.registerShape("tape",N);mxUtils.extend(L,mxActor);L.prototype.size=.3;L.prototype.getLabelMargins=function(d){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,+"size",this.size))*d.height):null};L.prototype.redrawPath=function(d,p,z,u,x){p=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.moveTo(0,0);d.lineTo(u,0);d.lineTo(u,x-p/2);d.quadTo(3*u/4,x-1.4*p,u/2,x-p/2);d.quadTo(u/4,x-p*(1-1.4),0,x-p/2);d.lineTo(0,p/2);d.close();d.end()};mxCellRenderer.registerShape("document",L);var db=mxCylinder.prototype.getCylinderSize;mxCylinder.prototype.getCylinderSize=function(d,p,z,u){var x=mxUtils.getValue(this.style,"size");return null!=+x?u*Math.max(0,Math.min(1,x)):db.apply(this,arguments)};mxCylinder.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var p=2*mxUtils.getValue(this.style,"size",.15);return new mxRectangle(0,Math.min(this.maxHeight*this.scale,d.height*p),0,0)}return null};l.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var p=mxUtils.getValue(this.style,"size",15);mxUtils.getValue(this.style,"lid",!0)||(p/=2);return new mxRectangle(0,Math.min(d.height*+this.scale,2*p*this.scale),0,Math.max(0,.3*p*this.scale))}return null};q.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var p=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var z=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;p=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var u=mxUtils.getValue(this.style,"rounded",!1),x=mxUtils.getValue(this.style,"absoluteArcSize",!1),C=parseFloat(mxUtils.getValue(this.style,+"arcSize",this.arcSize));x||(C*=Math.min(d.width,d.height));C=Math.min(C,.5*d.width,.5*(d.height-p));u||(C=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(C,0,Math.min(d.width,d.width-z),Math.min(d.height,d.height-p)):new mxRectangle(Math.min(d.width,d.width-z),0,C,Math.min(d.height,d.height-p))}return new mxRectangle(0,Math.min(d.height,p),0,0)}return null};D.prototype.getLabelMargins=function(d){return mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=+mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*this.scale,0,0,0):null};K.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var p=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(d.height*this.scale,p*this.scale),0,Math.max(0,p*this.scale))}return null};mxUtils.extend(J,mxActor);J.prototype.size=.2;J.prototype.fixedSize=20;J.prototype.isRoundable=function(){return!0};J.prototype.redrawPath=function(d,p,z,u,x){p=+"0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,x),new mxPoint(p,0),new mxPoint(u,0),new mxPoint(u-p,x)],this.isRounded,z,!0);d.end()};mxCellRenderer.registerShape("parallelogram",J);mxUtils.extend(Y,mxActor);Y.prototype.size=+.2;Y.prototype.fixedSize=20;Y.prototype.isRoundable=function(){return!0};Y.prototype.redrawPath=function(d,p,z,u,x){p="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,x),new mxPoint(p,0),new mxPoint(u-p,0),new mxPoint(u,+x)],this.isRounded,z,!0)};mxCellRenderer.registerShape("trapezoid",Y);mxUtils.extend(ha,mxActor);ha.prototype.size=.5;ha.prototype.redrawPath=function(d,p,z,u,x){d.setFillColor(null);p=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(u,0),new mxPoint(p,0),new mxPoint(p,x/2),new mxPoint(0,x/2),new mxPoint(p,x/2),new mxPoint(p,x),new mxPoint(u,x)],this.isRounded,+z,!1);d.end()};mxCellRenderer.registerShape("curlyBracket",ha);mxUtils.extend(ea,mxActor);ea.prototype.redrawPath=function(d,p,z,u,x){d.setStrokeWidth(1);d.setFillColor(this.stroke);p=u/5;d.rect(0,0,p,x);d.fillAndStroke();d.rect(2*p,0,p,x);d.fillAndStroke();d.rect(4*p,0,p,x);d.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",ea);aa.prototype.moveTo=function(d,p){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=p;this.firstX=d;this.firstY=p};aa.prototype.close=+function(){null!=this.firstX&&null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,arguments));this.originalClose.apply(this.canvas,arguments)};aa.prototype.quadTo=function(d,p,z,u){this.originalQuadTo.apply(this.canvas,arguments);this.lastX=z;this.lastY=u};aa.prototype.curveTo=function(d,p,z,u,x,C){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=x;this.lastY=C};aa.prototype.arcTo=function(d,p,z,u,x,C,E){this.originalArcTo.apply(this.canvas,arguments);+this.lastX=C;this.lastY=E};aa.prototype.lineTo=function(d,p){if(null!=this.lastX&&null!=this.lastY){var z=function(ma){return"number"===typeof ma?ma?0>ma?-1:1:ma===ma?0:NaN:NaN},u=Math.abs(d-this.lastX),x=Math.abs(p-this.lastY),C=Math.sqrt(u*u+x*x);if(2>C){this.originalLineTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=p;return}var E=Math.round(C/10),da=this.defaultVariation;5>E&&(E=5,da/=3);var M=z(d-this.lastX)*u/E;z=z(p-this.lastY)*x/E;u/=C;x/=C;for(C=0;C<E;C++){var sa=(Math.random()-+.5)*da;this.originalLineTo.call(this.canvas,M*C+this.lastX-sa*x,z*C+this.lastY-sa*u)}this.originalLineTo.call(this.canvas,d,p)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=p};aa.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};var lb=mxShape.prototype.beforePaint;mxShape.prototype.beforePaint=function(d){lb.apply(this,arguments);null==d.handJiggle&&(d.handJiggle=this.createHandJiggle(d))};var kb=mxShape.prototype.afterPaint;mxShape.prototype.afterPaint=function(d){kb.apply(this,arguments);null!=d.handJiggle&&(d.handJiggle.destroy(),delete d.handJiggle)};mxShape.prototype.createComicCanvas=function(d){return new aa(d,mxUtils.getValue(this.style,"jiggle",Editor.sketchDefaultJiggle))};mxShape.prototype.createHandJiggle=function(d){return this.outline||null==-this.style||"0"==mxUtils.getValue(this.style,"comic","0")?null:this.createComicCanvas(d)};var pb=mxRectangleShape.prototype.isHtmlAllowed;mxRectangleShape.prototype.isHtmlAllowed=function(){return!this.outline&&(null==this.style||"0"==mxUtils.getValue(this.style,"comic","0")&&"0"==mxUtils.getValue(this.style,"sketch","1"==urlParams.rough?"1":"0"))&&pb.apply(this,arguments)};var fb=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(d,n,z,u,x){if(null==d.handJiggle||+this.style||"0"==mxUtils.getValue(this.style,"comic","0")?null:this.createComicCanvas(d)};var pb=mxRectangleShape.prototype.isHtmlAllowed;mxRectangleShape.prototype.isHtmlAllowed=function(){return!this.outline&&(null==this.style||"0"==mxUtils.getValue(this.style,"comic","0")&&"0"==mxUtils.getValue(this.style,"sketch","1"==urlParams.rough?"1":"0"))&&pb.apply(this,arguments)};var fb=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(d,p,z,u,x){if(null==d.handJiggle||d.handJiggle.constructor!=aa)fb.apply(this,arguments);else{var C=!0;null!=this.style&&(C="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(C||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE)C||null!=this.fill&&this.fill!=mxConstants.NONE||(d.pointerEvents=!1),d.begin(),this.isRounded?("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?C=Math.min(u/2,Math.min(x/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,-mxConstants.LINE_ARCSIZE)/2)):(C=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,C=Math.min(u*C,x*C)),d.moveTo(n+C,z),d.lineTo(n+u-C,z),d.quadTo(n+u,z,n+u,z+C),d.lineTo(n+u,z+x-C),d.quadTo(n+u,z+x,n+u-C,z+x),d.lineTo(n+C,z+x),d.quadTo(n,z+x,n,z+x-C),d.lineTo(n,z+C),d.quadTo(n,z,n+C,z)):(d.moveTo(n,z),d.lineTo(n+u,z),d.lineTo(n+u,z+x),d.lineTo(n,z+x),d.lineTo(n,z)),d.close(),d.end(),d.fillAndStroke()}};mxUtils.extend(na,mxRectangleShape);na.prototype.size=-.1;na.prototype.fixedSize=!1;na.prototype.isHtmlAllowed=function(){return!1};na.prototype.getLabelBounds=function(d){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)){var n=d.width,z=d.height;d=new mxRectangle(d.x,d.y,n,z);var u=n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded){var x=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,-100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;u=Math.max(u,Math.min(n*x,z*x))}d.x+=Math.round(u);d.width-=Math.round(2*u);return d}return d};na.prototype.paintForeground=function(d,n,z,u,x){var C=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),E=parseFloat(mxUtils.getValue(this.style,"size",this.size));E=C?Math.max(0,Math.min(u,E)):u*Math.max(0,Math.min(1,E));this.isRounded&&(C=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,E=Math.max(E,-Math.min(u*C,x*C)));E=Math.round(E);d.begin();d.moveTo(n+E,z);d.lineTo(n+E,z+x);d.moveTo(n+u-E,z);d.lineTo(n+u-E,z+x);d.end();d.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("process",na);mxCellRenderer.registerShape("process2",na);mxUtils.extend(W,mxRectangleShape);W.prototype.paintBackground=function(d,n,z,u,x){d.setFillColor(mxConstants.NONE);d.rect(n,z,u,x);d.fill()};W.prototype.paintForeground=function(d,n,z,u,x){};mxCellRenderer.registerShape("transparent",-W);mxUtils.extend(ba,mxHexagon);ba.prototype.size=30;ba.prototype.position=.5;ba.prototype.position2=.5;ba.prototype.base=20;ba.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};ba.prototype.isRoundable=function(){return!0};ba.prototype.redrawPath=function(d,n,z,u,x){n=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;z=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,-"size",this.size))));var C=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),E=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2)))),da=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(d,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,x-z),new mxPoint(Math.min(u,C+da),x-z),new mxPoint(E,x),new mxPoint(Math.max(0,C),x-z),new mxPoint(0,x-z)],this.isRounded,n,!0,[4])};mxCellRenderer.registerShape("callout",-ba);mxUtils.extend(ja,mxActor);ja.prototype.size=.2;ja.prototype.fixedSize=20;ja.prototype.isRoundable=function(){return!0};ja.prototype.redrawPath=function(d,n,z,u,x){n="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,-0),new mxPoint(u-n,0),new mxPoint(u,x/2),new mxPoint(u-n,x),new mxPoint(0,x),new mxPoint(n,x/2)],this.isRounded,z,!0);d.end()};mxCellRenderer.registerShape("step",ja);mxUtils.extend(ca,mxHexagon);ca.prototype.size=.25;ca.prototype.fixedSize=20;ca.prototype.isRoundable=function(){return!0};ca.prototype.redrawPath=function(d,n,z,u,x){n="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,-"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(n,0),new mxPoint(u-n,0),new mxPoint(u,.5*x),new mxPoint(u-n,x),new mxPoint(n,x),new mxPoint(0,.5*x)],this.isRounded,z,!0)};mxCellRenderer.registerShape("hexagon",ca);mxUtils.extend(la,mxRectangleShape);la.prototype.isHtmlAllowed=function(){return!1};la.prototype.paintForeground=function(d,n,z,u,x){var C=Math.min(u/5,x/5)+1;d.begin();d.moveTo(n+u/2,z+C);d.lineTo(n+-u/2,z+x-C);d.moveTo(n+C,z+x/2);d.lineTo(n+u-C,z+x/2);d.end();d.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",la);var ob=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(d){if(1==this.style["double"]){var n=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(d.x+n,d.y+n,d.width-2*n,d.height-2*n)}return d};mxRhombus.prototype.paintVertexShape=-function(d,n,z,u,x){ob.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var C=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);n+=C;z+=C;u-=2*C;x-=2*C;0<u&&0<x&&(d.setShadow(!1),ob.apply(this,[d,n,z,u,x]))}};mxUtils.extend(Q,mxRectangleShape);Q.prototype.isHtmlAllowed=function(){return!1};Q.prototype.getLabelBounds=function(d){if(1==this.style["double"]){var n=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;-return new mxRectangle(d.x+n,d.y+n,d.width-2*n,d.height-2*n)}return d};Q.prototype.paintForeground=function(d,n,z,u,x){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var C=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);n+=C;z+=C;u-=2*C;x-=2*C;0<u&&0<x&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}d.setDashed(!1);C=0;do{var E=mxCellRenderer.defaultShapes[this.style["symbol"+C]];if(null!=E){var da=this.style["symbol"+C+"Align"],-M=this.style["symbol"+C+"VerticalAlign"],sa=this.style["symbol"+C+"Width"],ma=this.style["symbol"+C+"Height"],Wa=this.style["symbol"+C+"Spacing"]||0,gb=this.style["symbol"+C+"VSpacing"]||Wa,bb=this.style["symbol"+C+"ArcSpacing"];null!=bb&&(bb*=this.getArcSize(u+this.strokewidth,x+this.strokewidth),Wa+=bb,gb+=bb);bb=n;var Fa=z;bb=da==mxConstants.ALIGN_CENTER?bb+(u-sa)/2:da==mxConstants.ALIGN_RIGHT?bb+(u-sa-Wa):bb+Wa;Fa=M==mxConstants.ALIGN_MIDDLE?Fa+(x-ma)/2:M==mxConstants.ALIGN_BOTTOM?Fa+(x-ma-gb):-Fa+gb;d.save();da=new E;da.style=this.style;E.prototype.paintVertexShape.call(da,d,bb,Fa,sa,ma);d.restore()}C++}while(null!=E)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",Q);mxUtils.extend(k,mxCylinder);k.prototype.redrawPath=function(d,n,z,u,x,C){C?(d.moveTo(0,0),d.lineTo(u/2,x/2),d.lineTo(u,0),d.end()):(d.moveTo(0,0),d.lineTo(u,0),d.lineTo(u,x),d.lineTo(0,x),d.close())};mxCellRenderer.registerShape("message",k);mxUtils.extend(B,mxShape);B.prototype.paintBackground=-function(d,n,z,u,x){d.translate(n,z);d.ellipse(u/4,0,u/2,x/4);d.fillAndStroke();d.begin();d.moveTo(u/2,x/4);d.lineTo(u/2,2*x/3);d.moveTo(u/2,x/3);d.lineTo(0,x/3);d.moveTo(u/2,x/3);d.lineTo(u,x/3);d.moveTo(u/2,2*x/3);d.lineTo(0,x);d.moveTo(u/2,2*x/3);d.lineTo(u,x);d.end();d.stroke()};mxCellRenderer.registerShape("umlActor",B);mxUtils.extend(I,mxShape);I.prototype.getLabelMargins=function(d){return new mxRectangle(d.width/6,0,0,0)};I.prototype.paintBackground=function(d,n,z,u,x){d.translate(n,z);d.begin();-d.moveTo(0,x/4);d.lineTo(0,3*x/4);d.end();d.stroke();d.begin();d.moveTo(0,x/2);d.lineTo(u/6,x/2);d.end();d.stroke();d.ellipse(u/6,0,5*u/6,x);d.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",I);mxUtils.extend(U,mxEllipse);U.prototype.paintVertexShape=function(d,n,z,u,x){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.begin();d.moveTo(n+u/8,z+x);d.lineTo(n+7*u/8,z+x);d.end();d.stroke()};mxCellRenderer.registerShape("umlEntity",U);mxUtils.extend(P,mxShape);P.prototype.paintVertexShape=-function(d,n,z,u,x){d.translate(n,z);d.begin();d.moveTo(u,0);d.lineTo(0,x);d.moveTo(0,0);d.lineTo(u,x);d.end();d.stroke()};mxCellRenderer.registerShape("umlDestroy",P);mxUtils.extend(T,mxShape);T.prototype.getLabelBounds=function(d){return new mxRectangle(d.x,d.y+d.height/8,d.width,7*d.height/8)};T.prototype.paintBackground=function(d,n,z,u,x){d.translate(n,z);d.begin();d.moveTo(3*u/8,x/8*1.1);d.lineTo(5*u/8,0);d.end();d.stroke();d.ellipse(0,x/8,u,7*x/8);d.fillAndStroke()};T.prototype.paintForeground=-function(d,n,z,u,x){d.begin();d.moveTo(3*u/8,x/8*1.1);d.lineTo(5*u/8,x/4);d.end();d.stroke()};mxCellRenderer.registerShape("umlControl",T);mxUtils.extend(X,mxRectangleShape);X.prototype.size=40;X.prototype.isHtmlAllowed=function(){return!1};X.prototype.getLabelBounds=function(d){var n=Math.max(0,Math.min(d.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(d.x,d.y,d.width,n)};X.prototype.paintBackground=function(d,n,z,u,x){var C=Math.max(0,Math.min(x,-parseFloat(mxUtils.getValue(this.style,"size",this.size)))),E=mxUtils.getValue(this.style,"participant");null==E||null==this.state?mxRectangleShape.prototype.paintBackground.call(this,d,n,z,u,C):(E=this.state.view.graph.cellRenderer.getShape(E),null!=E&&E!=X&&(E=new E,E.apply(this.state),d.save(),E.paintVertexShape(d,n,z,u,C),d.restore()));C<x&&(d.setDashed("1"==mxUtils.getValue(this.style,"lifelineDashed","1")),d.begin(),d.moveTo(n+u/2,z+C),d.lineTo(n+u/2,z+x),d.end(),d.stroke())};X.prototype.paintForeground=-function(d,n,z,u,x){var C=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,d,n,z,u,Math.min(x,C))};mxCellRenderer.registerShape("umlLifeline",X);mxUtils.extend(Z,mxShape);Z.prototype.width=60;Z.prototype.height=30;Z.prototype.corner=10;Z.prototype.configurePointerEvents=function(d){var n=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);null==this.style||null!=n&&n!=mxConstants.NONE&&-0!=this.opacity&&0!=this.fillOpacity||"0"!=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||(d.pointerEvents=!1)};Z.prototype.getLabelMargins=function(d){return new mxRectangle(0,0,d.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),d.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};Z.prototype.paintBackground=function(d,n,z,u,x){var C=this.corner,E=Math.min(u,Math.max(C,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),-da=Math.min(x,Math.max(1.5*C,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),M=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);M!=mxConstants.NONE&&(d.setFillColor(M),d.rect(n,z,u,x),d.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(d,n,z,u,x),d.setGradient(this.fill,this.gradient,n,z,u,x,this.gradientDirection)):d.setFillColor(this.fill);d.pointerEvents=!0;d.begin();d.moveTo(n,-z);d.lineTo(n+E,z);d.lineTo(n+E,z+Math.max(0,da-1.5*C));d.lineTo(n+Math.max(0,E-C),z+da);d.lineTo(n,z+da);d.close();d.fillAndStroke();this.configurePointerEvents(d);d.begin();d.moveTo(n+E,z);d.lineTo(n+u,z);d.lineTo(n+u,z+x);d.lineTo(n,z+x);d.lineTo(n,z+da);d.stroke()};mxCellRenderer.registerShape("umlFrame",Z);mxPerimeter.CenterPerimeter=function(d,n,z,u){return new mxPoint(d.getCenterX(),d.getCenterY())};mxStyleRegistry.putValue("centerPerimeter",mxPerimeter.CenterPerimeter);mxPerimeter.LifelinePerimeter=-function(d,n,z,u){u=X.prototype.size;null!=n&&(u=mxUtils.getValue(n.style,"size",u)*n.view.scale);n=parseFloat(n.style[mxConstants.STYLE_STROKEWIDTH]||1)*n.view.scale/2-1;z.x<d.getCenterX()&&(n=-1*(n+1));return new mxPoint(d.getCenterX()+n,Math.min(d.y+d.height,Math.max(d.y+u,z.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);mxPerimeter.OrthogonalPerimeter=function(d,n,z,u){u=!0;return mxPerimeter.RectanglePerimeter.apply(this,arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",-mxPerimeter.OrthogonalPerimeter);mxPerimeter.BackbonePerimeter=function(d,n,z,u){u=parseFloat(n.style[mxConstants.STYLE_STROKEWIDTH]||1)*n.view.scale/2-1;null!=n.style.backboneSize&&(u+=parseFloat(n.style.backboneSize)*n.view.scale/2-1);if("south"==n.style[mxConstants.STYLE_DIRECTION]||"north"==n.style[mxConstants.STYLE_DIRECTION])return z.x<d.getCenterX()&&(u=-1*(u+1)),new mxPoint(d.getCenterX()+u,Math.min(d.y+d.height,Math.max(d.y,z.y)));z.y<d.getCenterY()&&(u=-1*(u+1));return new mxPoint(Math.min(d.x+-d.width,Math.max(d.x,z.x)),d.getCenterY()+u)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(d,n,z,u){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(d,new mxRectangle(0,0,0,Math.max(0,Math.min(d.height,parseFloat(mxUtils.getValue(n.style,"size",ba.prototype.size))*n.view.scale))),n.style),n,z,u)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);mxPerimeter.ParallelogramPerimeter=function(d,-n,z,u){var x="0"!=mxUtils.getValue(n.style,"fixedSize","0"),C=x?J.prototype.fixedSize:J.prototype.size;null!=n&&(C=mxUtils.getValue(n.style,"size",C));x&&(C*=n.view.scale);var E=d.x,da=d.y,M=d.width,sa=d.height;n=null!=n?mxUtils.getValue(n.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;n==mxConstants.DIRECTION_NORTH||n==mxConstants.DIRECTION_SOUTH?(x=x?Math.max(0,Math.min(sa,C)):sa*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da),new mxPoint(E+M,da+x),new mxPoint(E+-M,da+sa),new mxPoint(E,da+sa-x),new mxPoint(E,da)]):(x=x?Math.max(0,Math.min(.5*M,C)):M*Math.max(0,Math.min(1,C)),da=[new mxPoint(E+x,da),new mxPoint(E+M,da),new mxPoint(E+M-x,da+sa),new mxPoint(E,da+sa),new mxPoint(E+x,da)]);sa=d.getCenterX();d=d.getCenterY();d=new mxPoint(sa,d);u&&(z.x<E||z.x>E+M?d.y=z.y:d.x=z.x);return mxUtils.getPerimeterPoint(da,d,z)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(d,n,z,u){var x="0"!=-mxUtils.getValue(n.style,"fixedSize","0"),C=x?Y.prototype.fixedSize:Y.prototype.size;null!=n&&(C=mxUtils.getValue(n.style,"size",C));x&&(C*=n.view.scale);var E=d.x,da=d.y,M=d.width,sa=d.height;n=null!=n?mxUtils.getValue(n.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;n==mxConstants.DIRECTION_EAST?(x=x?Math.max(0,Math.min(.5*M,C)):M*Math.max(0,Math.min(1,C)),da=[new mxPoint(E+x,da),new mxPoint(E+M-x,da),new mxPoint(E+M,da+sa),new mxPoint(E,da+sa),new mxPoint(E+-x,da)]):n==mxConstants.DIRECTION_WEST?(x=x?Math.max(0,Math.min(M,C)):M*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da),new mxPoint(E+M,da),new mxPoint(E+M-x,da+sa),new mxPoint(E+x,da+sa),new mxPoint(E,da)]):n==mxConstants.DIRECTION_NORTH?(x=x?Math.max(0,Math.min(sa,C)):sa*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da+x),new mxPoint(E+M,da),new mxPoint(E+M,da+sa),new mxPoint(E,da+sa-x),new mxPoint(E,da+x)]):(x=x?Math.max(0,Math.min(sa,C)):sa*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da),new mxPoint(E+-M,da+x),new mxPoint(E+M,da+sa-x),new mxPoint(E,da+sa),new mxPoint(E,da)]);sa=d.getCenterX();d=d.getCenterY();d=new mxPoint(sa,d);u&&(z.x<E||z.x>E+M?d.y=z.y:d.x=z.x);return mxUtils.getPerimeterPoint(da,d,z)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(d,n,z,u){var x="0"!=mxUtils.getValue(n.style,"fixedSize","0"),C=x?ja.prototype.fixedSize:ja.prototype.size;null!=n&&(C=mxUtils.getValue(n.style,"size",C));x&&(C*=n.view.scale);var E=-d.x,da=d.y,M=d.width,sa=d.height,ma=d.getCenterX();d=d.getCenterY();n=null!=n?mxUtils.getValue(n.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;n==mxConstants.DIRECTION_EAST?(x=x?Math.max(0,Math.min(M,C)):M*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da),new mxPoint(E+M-x,da),new mxPoint(E+M,d),new mxPoint(E+M-x,da+sa),new mxPoint(E,da+sa),new mxPoint(E+x,d),new mxPoint(E,da)]):n==mxConstants.DIRECTION_WEST?(x=x?Math.max(0,Math.min(M,C)):M*Math.max(0,Math.min(1,-C)),da=[new mxPoint(E+x,da),new mxPoint(E+M,da),new mxPoint(E+M-x,d),new mxPoint(E+M,da+sa),new mxPoint(E+x,da+sa),new mxPoint(E,d),new mxPoint(E+x,da)]):n==mxConstants.DIRECTION_NORTH?(x=x?Math.max(0,Math.min(sa,C)):sa*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da+x),new mxPoint(ma,da),new mxPoint(E+M,da+x),new mxPoint(E+M,da+sa),new mxPoint(ma,da+sa-x),new mxPoint(E,da+sa),new mxPoint(E,da+x)]):(x=x?Math.max(0,Math.min(sa,C)):sa*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da),new mxPoint(ma,da+-x),new mxPoint(E+M,da),new mxPoint(E+M,da+sa-x),new mxPoint(ma,da+sa),new mxPoint(E,da+sa-x),new mxPoint(E,da)]);ma=new mxPoint(ma,d);u&&(z.x<E||z.x>E+M?ma.y=z.y:ma.x=z.x);return mxUtils.getPerimeterPoint(da,ma,z)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(d,n,z,u){var x="0"!=mxUtils.getValue(n.style,"fixedSize","0"),C=x?ca.prototype.fixedSize:ca.prototype.size;null!=n&&(C=mxUtils.getValue(n.style,"size",C));x&&(C*=n.view.scale);var E=-d.x,da=d.y,M=d.width,sa=d.height,ma=d.getCenterX();d=d.getCenterY();n=null!=n?mxUtils.getValue(n.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;n==mxConstants.DIRECTION_NORTH||n==mxConstants.DIRECTION_SOUTH?(x=x?Math.max(0,Math.min(sa,C)):sa*Math.max(0,Math.min(1,C)),da=[new mxPoint(ma,da),new mxPoint(E+M,da+x),new mxPoint(E+M,da+sa-x),new mxPoint(ma,da+sa),new mxPoint(E,da+sa-x),new mxPoint(E,da+x),new mxPoint(ma,da)]):(x=x?Math.max(0,Math.min(M,C)):M*Math.max(0,-Math.min(1,C)),da=[new mxPoint(E+x,da),new mxPoint(E+M-x,da),new mxPoint(E+M,d),new mxPoint(E+M-x,da+sa),new mxPoint(E+x,da+sa),new mxPoint(E,d),new mxPoint(E+x,da)]);ma=new mxPoint(ma,d);u&&(z.x<E||z.x>E+M?ma.y=z.y:ma.x=z.x);return mxUtils.getPerimeterPoint(da,ma,z)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(ka,mxShape);ka.prototype.size=10;ka.prototype.paintBackground=function(d,n,z,u,x){var C=parseFloat(mxUtils.getValue(this.style,"size",this.size));-d.translate(n,z);d.ellipse((u-C)/2,0,C,C);d.fillAndStroke();d.begin();d.moveTo(u/2,C);d.lineTo(u/2,x);d.end();d.stroke()};mxCellRenderer.registerShape("lollipop",ka);mxUtils.extend(va,mxShape);va.prototype.size=10;va.prototype.inset=2;va.prototype.paintBackground=function(d,n,z,u,x){var C=parseFloat(mxUtils.getValue(this.style,"size",this.size)),E=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;d.translate(n,z);d.begin();d.moveTo(u/2,C+E);d.lineTo(u/2,x);d.end();d.stroke();-d.begin();d.moveTo((u-C)/2-E,C/2);d.quadTo((u-C)/2-E,C+E,u/2,C+E);d.quadTo((u+C)/2+E,C+E,(u+C)/2+E,C/2);d.end();d.stroke()};mxCellRenderer.registerShape("requires",va);mxUtils.extend(ua,mxShape);ua.prototype.paintBackground=function(d,n,z,u,x){d.translate(n,z);d.begin();d.moveTo(0,0);d.quadTo(u,0,u,x/2);d.quadTo(u,x,0,x);d.end();d.stroke()};mxCellRenderer.registerShape("requiredInterface",ua);mxUtils.extend(qa,mxShape);qa.prototype.inset=2;qa.prototype.paintBackground=function(d,n,z,u,x){var C=parseFloat(mxUtils.getValue(this.style,-"inset",this.inset))+this.strokewidth;d.translate(n,z);d.ellipse(0,C,u-2*C,x-2*C);d.fillAndStroke();d.begin();d.moveTo(u/2,0);d.quadTo(u,0,u,x/2);d.quadTo(u,x,u/2,x);d.end();d.stroke()};mxCellRenderer.registerShape("providedRequiredInterface",qa);mxUtils.extend(Ba,mxCylinder);Ba.prototype.jettyWidth=20;Ba.prototype.jettyHeight=10;Ba.prototype.redrawPath=function(d,n,z,u,x,C){var E=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));n=parseFloat(mxUtils.getValue(this.style,"jettyHeight",-this.jettyHeight));z=E/2;E=z+E/2;var da=Math.min(n,x-n),M=Math.min(da+2*n,x-n);C?(d.moveTo(z,da),d.lineTo(E,da),d.lineTo(E,da+n),d.lineTo(z,da+n),d.moveTo(z,M),d.lineTo(E,M),d.lineTo(E,M+n),d.lineTo(z,M+n)):(d.moveTo(z,0),d.lineTo(u,0),d.lineTo(u,x),d.lineTo(z,x),d.lineTo(z,M+n),d.lineTo(0,M+n),d.lineTo(0,M),d.lineTo(z,M),d.lineTo(z,da+n),d.lineTo(0,da+n),d.lineTo(0,da),d.lineTo(z,da),d.close());d.end()};mxCellRenderer.registerShape("module",Ba);mxUtils.extend(ya,mxCylinder);ya.prototype.jettyWidth=-32;ya.prototype.jettyHeight=12;ya.prototype.redrawPath=function(d,n,z,u,x,C){var E=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));n=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));z=E/2;E=z+E/2;var da=.3*x-n/2,M=.7*x-n/2;C?(d.moveTo(z,da),d.lineTo(E,da),d.lineTo(E,da+n),d.lineTo(z,da+n),d.moveTo(z,M),d.lineTo(E,M),d.lineTo(E,M+n),d.lineTo(z,M+n)):(d.moveTo(z,0),d.lineTo(u,0),d.lineTo(u,x),d.lineTo(z,x),d.lineTo(z,M+n),d.lineTo(0,M+n),d.lineTo(0,M),d.lineTo(z,-M),d.lineTo(z,da+n),d.lineTo(0,da+n),d.lineTo(0,da),d.lineTo(z,da),d.close());d.end()};mxCellRenderer.registerShape("component",ya);mxUtils.extend(La,mxRectangleShape);La.prototype.paintForeground=function(d,n,z,u,x){var C=u/2,E=x/2,da=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;d.begin();this.addPoints(d,[new mxPoint(n+C,z),new mxPoint(n+u,z+E),new mxPoint(n+C,z+x),new mxPoint(n,z+E)],this.isRounded,da,!0);d.stroke();mxRectangleShape.prototype.paintForeground.apply(this,-arguments)};mxCellRenderer.registerShape("associativeEntity",La);mxUtils.extend(za,mxDoubleEllipse);za.prototype.outerStroke=!0;za.prototype.paintVertexShape=function(d,n,z,u,x){var C=Math.min(4,Math.min(u/5,x/5));0<u&&0<x&&(d.ellipse(n+C,z+C,u-2*C,x-2*C),d.fillAndStroke());d.setShadow(!1);this.outerStroke&&(d.ellipse(n,z,u,x),d.stroke())};mxCellRenderer.registerShape("endState",za);mxUtils.extend(Ea,za);Ea.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState",Ea);mxUtils.extend(pa,mxArrowConnector);+mxConstants.LINE_ARCSIZE)/2)):(C=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,C=Math.min(u*C,x*C)),d.moveTo(p+C,z),d.lineTo(p+u-C,z),d.quadTo(p+u,z,p+u,z+C),d.lineTo(p+u,z+x-C),d.quadTo(p+u,z+x,p+u-C,z+x),d.lineTo(p+C,z+x),d.quadTo(p,z+x,p,z+x-C),d.lineTo(p,z+C),d.quadTo(p,z,p+C,z)):(d.moveTo(p,z),d.lineTo(p+u,z),d.lineTo(p+u,z+x),d.lineTo(p,z+x),d.lineTo(p,z)),d.close(),d.end(),d.fillAndStroke()}};mxUtils.extend(na,mxRectangleShape);na.prototype.size=+.1;na.prototype.fixedSize=!1;na.prototype.isHtmlAllowed=function(){return!1};na.prototype.getLabelBounds=function(d){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)){var p=d.width,z=d.height;d=new mxRectangle(d.x,d.y,p,z);var u=p*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded){var x=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,+100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;u=Math.max(u,Math.min(p*x,z*x))}d.x+=Math.round(u);d.width-=Math.round(2*u);return d}return d};na.prototype.paintForeground=function(d,p,z,u,x){var C=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),E=parseFloat(mxUtils.getValue(this.style,"size",this.size));E=C?Math.max(0,Math.min(u,E)):u*Math.max(0,Math.min(1,E));this.isRounded&&(C=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,E=Math.max(E,+Math.min(u*C,x*C)));E=Math.round(E);d.begin();d.moveTo(p+E,z);d.lineTo(p+E,z+x);d.moveTo(p+u-E,z);d.lineTo(p+u-E,z+x);d.end();d.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("process",na);mxCellRenderer.registerShape("process2",na);mxUtils.extend(W,mxRectangleShape);W.prototype.paintBackground=function(d,p,z,u,x){d.setFillColor(mxConstants.NONE);d.rect(p,z,u,x);d.fill()};W.prototype.paintForeground=function(d,p,z,u,x){};mxCellRenderer.registerShape("transparent",+W);mxUtils.extend(ba,mxHexagon);ba.prototype.size=30;ba.prototype.position=.5;ba.prototype.position2=.5;ba.prototype.base=20;ba.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};ba.prototype.isRoundable=function(){return!0};ba.prototype.redrawPath=function(d,p,z,u,x){p=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;z=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,+"size",this.size))));var C=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),E=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2)))),da=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(d,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,x-z),new mxPoint(Math.min(u,C+da),x-z),new mxPoint(E,x),new mxPoint(Math.max(0,C),x-z),new mxPoint(0,x-z)],this.isRounded,p,!0,[4])};mxCellRenderer.registerShape("callout",+ba);mxUtils.extend(ja,mxActor);ja.prototype.size=.2;ja.prototype.fixedSize=20;ja.prototype.isRoundable=function(){return!0};ja.prototype.redrawPath=function(d,p,z,u,x){p="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,+0),new mxPoint(u-p,0),new mxPoint(u,x/2),new mxPoint(u-p,x),new mxPoint(0,x),new mxPoint(p,x/2)],this.isRounded,z,!0);d.end()};mxCellRenderer.registerShape("step",ja);mxUtils.extend(ca,mxHexagon);ca.prototype.size=.25;ca.prototype.fixedSize=20;ca.prototype.isRoundable=function(){return!0};ca.prototype.redrawPath=function(d,p,z,u,x){p="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,+"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(p,0),new mxPoint(u-p,0),new mxPoint(u,.5*x),new mxPoint(u-p,x),new mxPoint(p,x),new mxPoint(0,.5*x)],this.isRounded,z,!0)};mxCellRenderer.registerShape("hexagon",ca);mxUtils.extend(la,mxRectangleShape);la.prototype.isHtmlAllowed=function(){return!1};la.prototype.paintForeground=function(d,p,z,u,x){var C=Math.min(u/5,x/5)+1;d.begin();d.moveTo(p+u/2,z+C);d.lineTo(p++u/2,z+x-C);d.moveTo(p+C,z+x/2);d.lineTo(p+u-C,z+x/2);d.end();d.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",la);var ob=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(d){if(1==this.style["double"]){var p=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(d.x+p,d.y+p,d.width-2*p,d.height-2*p)}return d};mxRhombus.prototype.paintVertexShape=+function(d,p,z,u,x){ob.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var C=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);p+=C;z+=C;u-=2*C;x-=2*C;0<u&&0<x&&(d.setShadow(!1),ob.apply(this,[d,p,z,u,x]))}};mxUtils.extend(Q,mxRectangleShape);Q.prototype.isHtmlAllowed=function(){return!1};Q.prototype.getLabelBounds=function(d){if(1==this.style["double"]){var p=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;+return new mxRectangle(d.x+p,d.y+p,d.width-2*p,d.height-2*p)}return d};Q.prototype.paintForeground=function(d,p,z,u,x){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var C=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);p+=C;z+=C;u-=2*C;x-=2*C;0<u&&0<x&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}d.setDashed(!1);C=0;do{var E=mxCellRenderer.defaultShapes[this.style["symbol"+C]];if(null!=E){var da=this.style["symbol"+C+"Align"],+M=this.style["symbol"+C+"VerticalAlign"],sa=this.style["symbol"+C+"Width"],ma=this.style["symbol"+C+"Height"],Wa=this.style["symbol"+C+"Spacing"]||0,gb=this.style["symbol"+C+"VSpacing"]||Wa,bb=this.style["symbol"+C+"ArcSpacing"];null!=bb&&(bb*=this.getArcSize(u+this.strokewidth,x+this.strokewidth),Wa+=bb,gb+=bb);bb=p;var Fa=z;bb=da==mxConstants.ALIGN_CENTER?bb+(u-sa)/2:da==mxConstants.ALIGN_RIGHT?bb+(u-sa-Wa):bb+Wa;Fa=M==mxConstants.ALIGN_MIDDLE?Fa+(x-ma)/2:M==mxConstants.ALIGN_BOTTOM?Fa+(x-ma-gb):+Fa+gb;d.save();da=new E;da.style=this.style;E.prototype.paintVertexShape.call(da,d,bb,Fa,sa,ma);d.restore()}C++}while(null!=E)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",Q);mxUtils.extend(k,mxCylinder);k.prototype.redrawPath=function(d,p,z,u,x,C){C?(d.moveTo(0,0),d.lineTo(u/2,x/2),d.lineTo(u,0),d.end()):(d.moveTo(0,0),d.lineTo(u,0),d.lineTo(u,x),d.lineTo(0,x),d.close())};mxCellRenderer.registerShape("message",k);mxUtils.extend(B,mxShape);B.prototype.paintBackground=+function(d,p,z,u,x){d.translate(p,z);d.ellipse(u/4,0,u/2,x/4);d.fillAndStroke();d.begin();d.moveTo(u/2,x/4);d.lineTo(u/2,2*x/3);d.moveTo(u/2,x/3);d.lineTo(0,x/3);d.moveTo(u/2,x/3);d.lineTo(u,x/3);d.moveTo(u/2,2*x/3);d.lineTo(0,x);d.moveTo(u/2,2*x/3);d.lineTo(u,x);d.end();d.stroke()};mxCellRenderer.registerShape("umlActor",B);mxUtils.extend(I,mxShape);I.prototype.getLabelMargins=function(d){return new mxRectangle(d.width/6,0,0,0)};I.prototype.paintBackground=function(d,p,z,u,x){d.translate(p,z);d.begin();+d.moveTo(0,x/4);d.lineTo(0,3*x/4);d.end();d.stroke();d.begin();d.moveTo(0,x/2);d.lineTo(u/6,x/2);d.end();d.stroke();d.ellipse(u/6,0,5*u/6,x);d.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",I);mxUtils.extend(U,mxEllipse);U.prototype.paintVertexShape=function(d,p,z,u,x){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.begin();d.moveTo(p+u/8,z+x);d.lineTo(p+7*u/8,z+x);d.end();d.stroke()};mxCellRenderer.registerShape("umlEntity",U);mxUtils.extend(P,mxShape);P.prototype.paintVertexShape=+function(d,p,z,u,x){d.translate(p,z);d.begin();d.moveTo(u,0);d.lineTo(0,x);d.moveTo(0,0);d.lineTo(u,x);d.end();d.stroke()};mxCellRenderer.registerShape("umlDestroy",P);mxUtils.extend(T,mxShape);T.prototype.getLabelBounds=function(d){return new mxRectangle(d.x,d.y+d.height/8,d.width,7*d.height/8)};T.prototype.paintBackground=function(d,p,z,u,x){d.translate(p,z);d.begin();d.moveTo(3*u/8,x/8*1.1);d.lineTo(5*u/8,0);d.end();d.stroke();d.ellipse(0,x/8,u,7*x/8);d.fillAndStroke()};T.prototype.paintForeground=+function(d,p,z,u,x){d.begin();d.moveTo(3*u/8,x/8*1.1);d.lineTo(5*u/8,x/4);d.end();d.stroke()};mxCellRenderer.registerShape("umlControl",T);mxUtils.extend(X,mxRectangleShape);X.prototype.size=40;X.prototype.isHtmlAllowed=function(){return!1};X.prototype.getLabelBounds=function(d){var p=Math.max(0,Math.min(d.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(d.x,d.y,d.width,p)};X.prototype.paintBackground=function(d,p,z,u,x){var C=Math.max(0,Math.min(x,+parseFloat(mxUtils.getValue(this.style,"size",this.size)))),E=mxUtils.getValue(this.style,"participant");null==E||null==this.state?mxRectangleShape.prototype.paintBackground.call(this,d,p,z,u,C):(E=this.state.view.graph.cellRenderer.getShape(E),null!=E&&E!=X&&(E=new E,E.apply(this.state),d.save(),E.paintVertexShape(d,p,z,u,C),d.restore()));C<x&&(d.setDashed("1"==mxUtils.getValue(this.style,"lifelineDashed","1")),d.begin(),d.moveTo(p+u/2,z+C),d.lineTo(p+u/2,z+x),d.end(),d.stroke())};X.prototype.paintForeground=+function(d,p,z,u,x){var C=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,d,p,z,u,Math.min(x,C))};mxCellRenderer.registerShape("umlLifeline",X);mxUtils.extend(Z,mxShape);Z.prototype.width=60;Z.prototype.height=30;Z.prototype.corner=10;Z.prototype.configurePointerEvents=function(d){var p=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);null==this.style||null!=p&&p!=mxConstants.NONE&&+0!=this.opacity&&0!=this.fillOpacity||"0"!=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||(d.pointerEvents=!1)};Z.prototype.getLabelMargins=function(d){return new mxRectangle(0,0,d.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),d.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};Z.prototype.paintBackground=function(d,p,z,u,x){var C=this.corner,E=Math.min(u,Math.max(C,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),+da=Math.min(x,Math.max(1.5*C,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),M=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);M!=mxConstants.NONE&&(d.setFillColor(M),d.rect(p,z,u,x),d.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(d,p,z,u,x),d.setGradient(this.fill,this.gradient,p,z,u,x,this.gradientDirection)):d.setFillColor(this.fill);d.pointerEvents=!0;d.begin();d.moveTo(p,+z);d.lineTo(p+E,z);d.lineTo(p+E,z+Math.max(0,da-1.5*C));d.lineTo(p+Math.max(0,E-C),z+da);d.lineTo(p,z+da);d.close();d.fillAndStroke();this.configurePointerEvents(d);d.begin();d.moveTo(p+E,z);d.lineTo(p+u,z);d.lineTo(p+u,z+x);d.lineTo(p,z+x);d.lineTo(p,z+da);d.stroke()};mxCellRenderer.registerShape("umlFrame",Z);mxPerimeter.CenterPerimeter=function(d,p,z,u){return new mxPoint(d.getCenterX(),d.getCenterY())};mxStyleRegistry.putValue("centerPerimeter",mxPerimeter.CenterPerimeter);mxPerimeter.LifelinePerimeter=+function(d,p,z,u){u=X.prototype.size;null!=p&&(u=mxUtils.getValue(p.style,"size",u)*p.view.scale);p=parseFloat(p.style[mxConstants.STYLE_STROKEWIDTH]||1)*p.view.scale/2-1;z.x<d.getCenterX()&&(p=-1*(p+1));return new mxPoint(d.getCenterX()+p,Math.min(d.y+d.height,Math.max(d.y+u,z.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);mxPerimeter.OrthogonalPerimeter=function(d,p,z,u){u=!0;return mxPerimeter.RectanglePerimeter.apply(this,arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",+mxPerimeter.OrthogonalPerimeter);mxPerimeter.BackbonePerimeter=function(d,p,z,u){u=parseFloat(p.style[mxConstants.STYLE_STROKEWIDTH]||1)*p.view.scale/2-1;null!=p.style.backboneSize&&(u+=parseFloat(p.style.backboneSize)*p.view.scale/2-1);if("south"==p.style[mxConstants.STYLE_DIRECTION]||"north"==p.style[mxConstants.STYLE_DIRECTION])return z.x<d.getCenterX()&&(u=-1*(u+1)),new mxPoint(d.getCenterX()+u,Math.min(d.y+d.height,Math.max(d.y,z.y)));z.y<d.getCenterY()&&(u=-1*(u+1));return new mxPoint(Math.min(d.x++d.width,Math.max(d.x,z.x)),d.getCenterY()+u)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(d,p,z,u){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(d,new mxRectangle(0,0,0,Math.max(0,Math.min(d.height,parseFloat(mxUtils.getValue(p.style,"size",ba.prototype.size))*p.view.scale))),p.style),p,z,u)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);mxPerimeter.ParallelogramPerimeter=function(d,+p,z,u){var x="0"!=mxUtils.getValue(p.style,"fixedSize","0"),C=x?J.prototype.fixedSize:J.prototype.size;null!=p&&(C=mxUtils.getValue(p.style,"size",C));x&&(C*=p.view.scale);var E=d.x,da=d.y,M=d.width,sa=d.height;p=null!=p?mxUtils.getValue(p.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;p==mxConstants.DIRECTION_NORTH||p==mxConstants.DIRECTION_SOUTH?(x=x?Math.max(0,Math.min(sa,C)):sa*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da),new mxPoint(E+M,da+x),new mxPoint(E++M,da+sa),new mxPoint(E,da+sa-x),new mxPoint(E,da)]):(x=x?Math.max(0,Math.min(.5*M,C)):M*Math.max(0,Math.min(1,C)),da=[new mxPoint(E+x,da),new mxPoint(E+M,da),new mxPoint(E+M-x,da+sa),new mxPoint(E,da+sa),new mxPoint(E+x,da)]);sa=d.getCenterX();d=d.getCenterY();d=new mxPoint(sa,d);u&&(z.x<E||z.x>E+M?d.y=z.y:d.x=z.x);return mxUtils.getPerimeterPoint(da,d,z)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(d,p,z,u){var x="0"!=+mxUtils.getValue(p.style,"fixedSize","0"),C=x?Y.prototype.fixedSize:Y.prototype.size;null!=p&&(C=mxUtils.getValue(p.style,"size",C));x&&(C*=p.view.scale);var E=d.x,da=d.y,M=d.width,sa=d.height;p=null!=p?mxUtils.getValue(p.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;p==mxConstants.DIRECTION_EAST?(x=x?Math.max(0,Math.min(.5*M,C)):M*Math.max(0,Math.min(1,C)),da=[new mxPoint(E+x,da),new mxPoint(E+M-x,da),new mxPoint(E+M,da+sa),new mxPoint(E,da+sa),new mxPoint(E++x,da)]):p==mxConstants.DIRECTION_WEST?(x=x?Math.max(0,Math.min(M,C)):M*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da),new mxPoint(E+M,da),new mxPoint(E+M-x,da+sa),new mxPoint(E+x,da+sa),new mxPoint(E,da)]):p==mxConstants.DIRECTION_NORTH?(x=x?Math.max(0,Math.min(sa,C)):sa*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da+x),new mxPoint(E+M,da),new mxPoint(E+M,da+sa),new mxPoint(E,da+sa-x),new mxPoint(E,da+x)]):(x=x?Math.max(0,Math.min(sa,C)):sa*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da),new mxPoint(E++M,da+x),new mxPoint(E+M,da+sa-x),new mxPoint(E,da+sa),new mxPoint(E,da)]);sa=d.getCenterX();d=d.getCenterY();d=new mxPoint(sa,d);u&&(z.x<E||z.x>E+M?d.y=z.y:d.x=z.x);return mxUtils.getPerimeterPoint(da,d,z)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(d,p,z,u){var x="0"!=mxUtils.getValue(p.style,"fixedSize","0"),C=x?ja.prototype.fixedSize:ja.prototype.size;null!=p&&(C=mxUtils.getValue(p.style,"size",C));x&&(C*=p.view.scale);var E=+d.x,da=d.y,M=d.width,sa=d.height,ma=d.getCenterX();d=d.getCenterY();p=null!=p?mxUtils.getValue(p.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;p==mxConstants.DIRECTION_EAST?(x=x?Math.max(0,Math.min(M,C)):M*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da),new mxPoint(E+M-x,da),new mxPoint(E+M,d),new mxPoint(E+M-x,da+sa),new mxPoint(E,da+sa),new mxPoint(E+x,d),new mxPoint(E,da)]):p==mxConstants.DIRECTION_WEST?(x=x?Math.max(0,Math.min(M,C)):M*Math.max(0,Math.min(1,+C)),da=[new mxPoint(E+x,da),new mxPoint(E+M,da),new mxPoint(E+M-x,d),new mxPoint(E+M,da+sa),new mxPoint(E+x,da+sa),new mxPoint(E,d),new mxPoint(E+x,da)]):p==mxConstants.DIRECTION_NORTH?(x=x?Math.max(0,Math.min(sa,C)):sa*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da+x),new mxPoint(ma,da),new mxPoint(E+M,da+x),new mxPoint(E+M,da+sa),new mxPoint(ma,da+sa-x),new mxPoint(E,da+sa),new mxPoint(E,da+x)]):(x=x?Math.max(0,Math.min(sa,C)):sa*Math.max(0,Math.min(1,C)),da=[new mxPoint(E,da),new mxPoint(ma,da++x),new mxPoint(E+M,da),new mxPoint(E+M,da+sa-x),new mxPoint(ma,da+sa),new mxPoint(E,da+sa-x),new mxPoint(E,da)]);ma=new mxPoint(ma,d);u&&(z.x<E||z.x>E+M?ma.y=z.y:ma.x=z.x);return mxUtils.getPerimeterPoint(da,ma,z)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(d,p,z,u){var x="0"!=mxUtils.getValue(p.style,"fixedSize","0"),C=x?ca.prototype.fixedSize:ca.prototype.size;null!=p&&(C=mxUtils.getValue(p.style,"size",C));x&&(C*=p.view.scale);var E=+d.x,da=d.y,M=d.width,sa=d.height,ma=d.getCenterX();d=d.getCenterY();p=null!=p?mxUtils.getValue(p.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;p==mxConstants.DIRECTION_NORTH||p==mxConstants.DIRECTION_SOUTH?(x=x?Math.max(0,Math.min(sa,C)):sa*Math.max(0,Math.min(1,C)),da=[new mxPoint(ma,da),new mxPoint(E+M,da+x),new mxPoint(E+M,da+sa-x),new mxPoint(ma,da+sa),new mxPoint(E,da+sa-x),new mxPoint(E,da+x),new mxPoint(ma,da)]):(x=x?Math.max(0,Math.min(M,C)):M*Math.max(0,+Math.min(1,C)),da=[new mxPoint(E+x,da),new mxPoint(E+M-x,da),new mxPoint(E+M,d),new mxPoint(E+M-x,da+sa),new mxPoint(E+x,da+sa),new mxPoint(E,d),new mxPoint(E+x,da)]);ma=new mxPoint(ma,d);u&&(z.x<E||z.x>E+M?ma.y=z.y:ma.x=z.x);return mxUtils.getPerimeterPoint(da,ma,z)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(ka,mxShape);ka.prototype.size=10;ka.prototype.paintBackground=function(d,p,z,u,x){var C=parseFloat(mxUtils.getValue(this.style,"size",this.size));+d.translate(p,z);d.ellipse((u-C)/2,0,C,C);d.fillAndStroke();d.begin();d.moveTo(u/2,C);d.lineTo(u/2,x);d.end();d.stroke()};mxCellRenderer.registerShape("lollipop",ka);mxUtils.extend(va,mxShape);va.prototype.size=10;va.prototype.inset=2;va.prototype.paintBackground=function(d,p,z,u,x){var C=parseFloat(mxUtils.getValue(this.style,"size",this.size)),E=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;d.translate(p,z);d.begin();d.moveTo(u/2,C+E);d.lineTo(u/2,x);d.end();d.stroke();+d.begin();d.moveTo((u-C)/2-E,C/2);d.quadTo((u-C)/2-E,C+E,u/2,C+E);d.quadTo((u+C)/2+E,C+E,(u+C)/2+E,C/2);d.end();d.stroke()};mxCellRenderer.registerShape("requires",va);mxUtils.extend(ua,mxShape);ua.prototype.paintBackground=function(d,p,z,u,x){d.translate(p,z);d.begin();d.moveTo(0,0);d.quadTo(u,0,u,x/2);d.quadTo(u,x,0,x);d.end();d.stroke()};mxCellRenderer.registerShape("requiredInterface",ua);mxUtils.extend(qa,mxShape);qa.prototype.inset=2;qa.prototype.paintBackground=function(d,p,z,u,x){var C=parseFloat(mxUtils.getValue(this.style,+"inset",this.inset))+this.strokewidth;d.translate(p,z);d.ellipse(0,C,u-2*C,x-2*C);d.fillAndStroke();d.begin();d.moveTo(u/2,0);d.quadTo(u,0,u,x/2);d.quadTo(u,x,u/2,x);d.end();d.stroke()};mxCellRenderer.registerShape("providedRequiredInterface",qa);mxUtils.extend(Ba,mxCylinder);Ba.prototype.jettyWidth=20;Ba.prototype.jettyHeight=10;Ba.prototype.redrawPath=function(d,p,z,u,x,C){var E=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));p=parseFloat(mxUtils.getValue(this.style,"jettyHeight",+this.jettyHeight));z=E/2;E=z+E/2;var da=Math.min(p,x-p),M=Math.min(da+2*p,x-p);C?(d.moveTo(z,da),d.lineTo(E,da),d.lineTo(E,da+p),d.lineTo(z,da+p),d.moveTo(z,M),d.lineTo(E,M),d.lineTo(E,M+p),d.lineTo(z,M+p)):(d.moveTo(z,0),d.lineTo(u,0),d.lineTo(u,x),d.lineTo(z,x),d.lineTo(z,M+p),d.lineTo(0,M+p),d.lineTo(0,M),d.lineTo(z,M),d.lineTo(z,da+p),d.lineTo(0,da+p),d.lineTo(0,da),d.lineTo(z,da),d.close());d.end()};mxCellRenderer.registerShape("module",Ba);mxUtils.extend(ya,mxCylinder);ya.prototype.jettyWidth=+32;ya.prototype.jettyHeight=12;ya.prototype.redrawPath=function(d,p,z,u,x,C){var E=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));p=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));z=E/2;E=z+E/2;var da=.3*x-p/2,M=.7*x-p/2;C?(d.moveTo(z,da),d.lineTo(E,da),d.lineTo(E,da+p),d.lineTo(z,da+p),d.moveTo(z,M),d.lineTo(E,M),d.lineTo(E,M+p),d.lineTo(z,M+p)):(d.moveTo(z,0),d.lineTo(u,0),d.lineTo(u,x),d.lineTo(z,x),d.lineTo(z,M+p),d.lineTo(0,M+p),d.lineTo(0,M),d.lineTo(z,+M),d.lineTo(z,da+p),d.lineTo(0,da+p),d.lineTo(0,da),d.lineTo(z,da),d.close());d.end()};mxCellRenderer.registerShape("component",ya);mxUtils.extend(La,mxRectangleShape);La.prototype.paintForeground=function(d,p,z,u,x){var C=u/2,E=x/2,da=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;d.begin();this.addPoints(d,[new mxPoint(p+C,z),new mxPoint(p+u,z+E),new mxPoint(p+C,z+x),new mxPoint(p,z+E)],this.isRounded,da,!0);d.stroke();mxRectangleShape.prototype.paintForeground.apply(this,+arguments)};mxCellRenderer.registerShape("associativeEntity",La);mxUtils.extend(za,mxDoubleEllipse);za.prototype.outerStroke=!0;za.prototype.paintVertexShape=function(d,p,z,u,x){var C=Math.min(4,Math.min(u/5,x/5));0<u&&0<x&&(d.ellipse(p+C,z+C,u-2*C,x-2*C),d.fillAndStroke());d.setShadow(!1);this.outerStroke&&(d.ellipse(p,z,u,x),d.stroke())};mxCellRenderer.registerShape("endState",za);mxUtils.extend(Ea,za);Ea.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState",Ea);mxUtils.extend(pa,mxArrowConnector);pa.prototype.defaultWidth=4;pa.prototype.isOpenEnded=function(){return!0};pa.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};pa.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",pa);mxUtils.extend(Ca,mxArrowConnector);Ca.prototype.defaultWidth=10;Ca.prototype.defaultArrowWidth=20;Ca.prototype.getStartArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,-"startWidth",this.defaultArrowWidth)};Ca.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};Ca.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",Ca);mxUtils.extend(Aa,mxActor);Aa.prototype.size=30;Aa.prototype.isRoundable=function(){return!0};Aa.prototype.redrawPath=function(d,n,z,u,x){n=Math.min(x,parseFloat(mxUtils.getValue(this.style,-"size",this.size)));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,x),new mxPoint(0,n),new mxPoint(u,0),new mxPoint(u,x)],this.isRounded,z,!0);d.end()};mxCellRenderer.registerShape("manualInput",Aa);mxUtils.extend(wa,mxRectangleShape);wa.prototype.dx=20;wa.prototype.dy=20;wa.prototype.isHtmlAllowed=function(){return!1};wa.prototype.paintForeground=function(d,n,z,u,x){mxRectangleShape.prototype.paintForeground.apply(this,arguments);-var C=0;if(this.isRounded){var E=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;C=Math.max(C,Math.min(u*E,x*E))}E=Math.max(C,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));C=Math.max(C,Math.min(x,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));d.begin();d.moveTo(n,z+C);d.lineTo(n+u,z+C);d.end();d.stroke();d.begin();d.moveTo(n+E,z);d.lineTo(n+E,z+x);d.end();d.stroke()};mxCellRenderer.registerShape("internalStorage",wa);-mxUtils.extend(Ya,mxActor);Ya.prototype.dx=20;Ya.prototype.dy=20;Ya.prototype.isRoundable=function(){return!0};Ya.prototype.redrawPath=function(d,n,z,u,x){n=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));z=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var C=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,0),new mxPoint(u,-0),new mxPoint(u,z),new mxPoint(n,z),new mxPoint(n,x),new mxPoint(0,x)],this.isRounded,C,!0);d.end()};mxCellRenderer.registerShape("corner",Ya);mxUtils.extend(Qa,mxActor);Qa.prototype.redrawPath=function(d,n,z,u,x){d.moveTo(0,0);d.lineTo(0,x);d.end();d.moveTo(u,0);d.lineTo(u,x);d.end();d.moveTo(0,x/2);d.lineTo(u,x/2);d.end()};mxCellRenderer.registerShape("crossbar",Qa);mxUtils.extend(Ra,mxActor);Ra.prototype.dx=20;Ra.prototype.dy=20;Ra.prototype.isRoundable=function(){return!0};Ra.prototype.redrawPath=-function(d,n,z,u,x){n=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));z=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var C=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,z),new mxPoint((u+n)/2,z),new mxPoint((u+n)/2,x),new mxPoint((u-n)/2,x),new mxPoint((u-n)/2,z),new mxPoint(0,-z)],this.isRounded,C,!0);d.end()};mxCellRenderer.registerShape("tee",Ra);mxUtils.extend(Sa,mxActor);Sa.prototype.arrowWidth=.3;Sa.prototype.arrowSize=.2;Sa.prototype.isRoundable=function(){return!0};Sa.prototype.redrawPath=function(d,n,z,u,x){var C=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));n=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));z=(x-C)/2;C=z+C;var E=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,-mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,z),new mxPoint(u-n,z),new mxPoint(u-n,0),new mxPoint(u,x/2),new mxPoint(u-n,x),new mxPoint(u-n,C),new mxPoint(0,C)],this.isRounded,E,!0);d.end()};mxCellRenderer.registerShape("singleArrow",Sa);mxUtils.extend(Ha,mxActor);Ha.prototype.isRoundable=function(){return!0};Ha.prototype.redrawPath=function(d,n,z,u,x){var C=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",Sa.prototype.arrowWidth))));n=u*Math.max(0,Math.min(1,-parseFloat(mxUtils.getValue(this.style,"arrowSize",Sa.prototype.arrowSize))));z=(x-C)/2;C=z+C;var E=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,x/2),new mxPoint(n,0),new mxPoint(n,z),new mxPoint(u-n,z),new mxPoint(u-n,0),new mxPoint(u,x/2),new mxPoint(u-n,x),new mxPoint(u-n,C),new mxPoint(n,C),new mxPoint(n,x)],this.isRounded,E,!0);d.end()};mxCellRenderer.registerShape("doubleArrow",Ha);mxUtils.extend(Ma,mxActor);Ma.prototype.size=-.1;Ma.prototype.fixedSize=20;Ma.prototype.redrawPath=function(d,n,z,u,x){n="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.moveTo(n,0);d.lineTo(u,0);d.quadTo(u-2*n,x/2,u,x);d.lineTo(n,x);d.quadTo(n-2*n,x/2,n,0);d.close();d.end()};mxCellRenderer.registerShape("dataStorage",Ma);mxUtils.extend(y,mxActor);y.prototype.redrawPath=-function(d,n,z,u,x){d.moveTo(0,0);d.quadTo(u,0,u,x/2);d.quadTo(u,x,0,x);d.close();d.end()};mxCellRenderer.registerShape("or",y);mxUtils.extend(O,mxActor);O.prototype.redrawPath=function(d,n,z,u,x){d.moveTo(0,0);d.quadTo(u,0,u,x/2);d.quadTo(u,x,0,x);d.quadTo(u/2,x/2,0,0);d.close();d.end()};mxCellRenderer.registerShape("xor",O);mxUtils.extend(R,mxActor);R.prototype.size=20;R.prototype.isRoundable=function(){return!0};R.prototype.redrawPath=function(d,n,z,u,x){n=Math.min(u/2,Math.min(x,parseFloat(mxUtils.getValue(this.style,-"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(n,0),new mxPoint(u-n,0),new mxPoint(u,.8*n),new mxPoint(u,x),new mxPoint(0,x),new mxPoint(0,.8*n)],this.isRounded,z,!0);d.end()};mxCellRenderer.registerShape("loopLimit",R);mxUtils.extend(V,mxActor);V.prototype.size=.375;V.prototype.isRoundable=function(){return!0};V.prototype.redrawPath=function(d,n,z,u,x){n=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,-"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,x-n),new mxPoint(u/2,x),new mxPoint(0,x-n)],this.isRounded,z,!0);d.end()};mxCellRenderer.registerShape("offPageConnector",V);mxUtils.extend(fa,mxEllipse);fa.prototype.paintVertexShape=function(d,n,z,u,x){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.begin();d.moveTo(n+u/2,z+x);d.lineTo(n+u,z+x);d.end();d.stroke()};-mxCellRenderer.registerShape("tapeData",fa);mxUtils.extend(ia,mxEllipse);ia.prototype.paintVertexShape=function(d,n,z,u,x){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.setShadow(!1);d.begin();d.moveTo(n,z+x/2);d.lineTo(n+u,z+x/2);d.end();d.stroke();d.begin();d.moveTo(n+u/2,z);d.lineTo(n+u/2,z+x);d.end();d.stroke()};mxCellRenderer.registerShape("orEllipse",ia);mxUtils.extend(oa,mxEllipse);oa.prototype.paintVertexShape=function(d,n,z,u,x){mxEllipse.prototype.paintVertexShape.apply(this,-arguments);d.setShadow(!1);d.begin();d.moveTo(n+.145*u,z+.145*x);d.lineTo(n+.855*u,z+.855*x);d.end();d.stroke();d.begin();d.moveTo(n+.855*u,z+.145*x);d.lineTo(n+.145*u,z+.855*x);d.end();d.stroke()};mxCellRenderer.registerShape("sumEllipse",oa);mxUtils.extend(ta,mxRhombus);ta.prototype.paintVertexShape=function(d,n,z,u,x){mxRhombus.prototype.paintVertexShape.apply(this,arguments);d.setShadow(!1);d.begin();d.moveTo(n,z+x/2);d.lineTo(n+u,z+x/2);d.end();d.stroke()};mxCellRenderer.registerShape("sortShape",-ta);mxUtils.extend(ra,mxEllipse);ra.prototype.paintVertexShape=function(d,n,z,u,x){d.begin();d.moveTo(n,z);d.lineTo(n+u,z);d.lineTo(n+u/2,z+x/2);d.close();d.fillAndStroke();d.begin();d.moveTo(n,z+x);d.lineTo(n+u,z+x);d.lineTo(n+u/2,z+x/2);d.close();d.fillAndStroke()};mxCellRenderer.registerShape("collate",ra);mxUtils.extend(xa,mxEllipse);xa.prototype.paintVertexShape=function(d,n,z,u,x){var C=d.state.strokeWidth/2,E=10+2*C,da=z+x-E/2;d.begin();d.moveTo(n,z);d.lineTo(n,z+x);d.moveTo(n+C,da);d.lineTo(n+-C+E,da-E/2);d.moveTo(n+C,da);d.lineTo(n+C+E,da+E/2);d.moveTo(n+C,da);d.lineTo(n+u-C,da);d.moveTo(n+u,z);d.lineTo(n+u,z+x);d.moveTo(n+u-C,da);d.lineTo(n+u-E-C,da-E/2);d.moveTo(n+u-C,da);d.lineTo(n+u-E-C,da+E/2);d.end();d.stroke()};mxCellRenderer.registerShape("dimension",xa);mxUtils.extend(Da,mxEllipse);Da.prototype.drawHidden=!0;Da.prototype.paintVertexShape=function(d,n,z,u,x){this.outline||d.setStrokeColor(null);if(null!=this.style){var C=d.pointerEvents,E=null!=this.fill&&this.fill!=mxConstants.NONE;-"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||E||(d.pointerEvents=!1);var da="1"==mxUtils.getValue(this.style,"top","1"),M="1"==mxUtils.getValue(this.style,"left","1"),sa="1"==mxUtils.getValue(this.style,"right","1"),ma="1"==mxUtils.getValue(this.style,"bottom","1");this.drawHidden||E||this.outline||da||sa||ma||M?(d.rect(n,z,u,x),d.fill(),d.pointerEvents=C,d.setStrokeColor(this.stroke),d.setLineCap("square"),d.begin(),d.moveTo(n,z),this.outline||da?d.lineTo(n+u,z):d.moveTo(n+-u,z),this.outline||sa?d.lineTo(n+u,z+x):d.moveTo(n+u,z+x),this.outline||ma?d.lineTo(n,z+x):d.moveTo(n,z+x),(this.outline||M)&&d.lineTo(n,z),d.end(),d.stroke(),d.setLineCap("flat")):d.setStrokeColor(this.stroke)}};mxCellRenderer.registerShape("partialRectangle",Da);mxUtils.extend(Ia,mxEllipse);Ia.prototype.paintVertexShape=function(d,n,z,u,x){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.setShadow(!1);d.begin();"vertical"==mxUtils.getValue(this.style,"line")?(d.moveTo(n+u/2,z),d.lineTo(n+-u/2,z+x)):(d.moveTo(n,z+x/2),d.lineTo(n+u,z+x/2));d.end();d.stroke()};mxCellRenderer.registerShape("lineEllipse",Ia);mxUtils.extend(Xa,mxActor);Xa.prototype.redrawPath=function(d,n,z,u,x){n=Math.min(u,x/2);d.moveTo(0,0);d.lineTo(u-n,0);d.quadTo(u,0,u,x/2);d.quadTo(u,x,u-n,x);d.lineTo(0,x);d.close();d.end()};mxCellRenderer.registerShape("delay",Xa);mxUtils.extend(Za,mxActor);Za.prototype.size=.2;Za.prototype.redrawPath=function(d,n,z,u,x){n=Math.min(x,u);var C=Math.max(0,Math.min(n,n*parseFloat(mxUtils.getValue(this.style,-"size",this.size))));n=(x-C)/2;z=n+C;var E=(u-C)/2;C=E+C;d.moveTo(0,n);d.lineTo(E,n);d.lineTo(E,0);d.lineTo(C,0);d.lineTo(C,n);d.lineTo(u,n);d.lineTo(u,z);d.lineTo(C,z);d.lineTo(C,x);d.lineTo(E,x);d.lineTo(E,z);d.lineTo(0,z);d.close();d.end()};mxCellRenderer.registerShape("cross",Za);mxUtils.extend($a,mxActor);$a.prototype.size=.25;$a.prototype.redrawPath=function(d,n,z,u,x){n=Math.min(u,x/2);z=Math.min(u-n,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*u);d.moveTo(0,x/2);d.lineTo(z,-0);d.lineTo(u-n,0);d.quadTo(u,0,u,x/2);d.quadTo(u,x,u-n,x);d.lineTo(z,x);d.close();d.end()};mxCellRenderer.registerShape("display",$a);mxUtils.extend(Pa,mxActor);Pa.prototype.cst={RECT2:"mxgraph.basic.rect"};Pa.prototype.customProperties=[{name:"rectStyle",dispName:"Style",type:"enum",defVal:"square",enumList:[{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"size",dispName:"Corner Size",+"startWidth",this.defaultArrowWidth)};Ca.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};Ca.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",Ca);mxUtils.extend(Aa,mxActor);Aa.prototype.size=30;Aa.prototype.isRoundable=function(){return!0};Aa.prototype.redrawPath=function(d,p,z,u,x){p=Math.min(x,parseFloat(mxUtils.getValue(this.style,+"size",this.size)));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,x),new mxPoint(0,p),new mxPoint(u,0),new mxPoint(u,x)],this.isRounded,z,!0);d.end()};mxCellRenderer.registerShape("manualInput",Aa);mxUtils.extend(wa,mxRectangleShape);wa.prototype.dx=20;wa.prototype.dy=20;wa.prototype.isHtmlAllowed=function(){return!1};wa.prototype.paintForeground=function(d,p,z,u,x){mxRectangleShape.prototype.paintForeground.apply(this,arguments);+var C=0;if(this.isRounded){var E=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;C=Math.max(C,Math.min(u*E,x*E))}E=Math.max(C,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));C=Math.max(C,Math.min(x,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));d.begin();d.moveTo(p,z+C);d.lineTo(p+u,z+C);d.end();d.stroke();d.begin();d.moveTo(p+E,z);d.lineTo(p+E,z+x);d.end();d.stroke()};mxCellRenderer.registerShape("internalStorage",wa);+mxUtils.extend(Ya,mxActor);Ya.prototype.dx=20;Ya.prototype.dy=20;Ya.prototype.isRoundable=function(){return!0};Ya.prototype.redrawPath=function(d,p,z,u,x){p=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));z=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var C=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,0),new mxPoint(u,+0),new mxPoint(u,z),new mxPoint(p,z),new mxPoint(p,x),new mxPoint(0,x)],this.isRounded,C,!0);d.end()};mxCellRenderer.registerShape("corner",Ya);mxUtils.extend(Qa,mxActor);Qa.prototype.redrawPath=function(d,p,z,u,x){d.moveTo(0,0);d.lineTo(0,x);d.end();d.moveTo(u,0);d.lineTo(u,x);d.end();d.moveTo(0,x/2);d.lineTo(u,x/2);d.end()};mxCellRenderer.registerShape("crossbar",Qa);mxUtils.extend(Ra,mxActor);Ra.prototype.dx=20;Ra.prototype.dy=20;Ra.prototype.isRoundable=function(){return!0};Ra.prototype.redrawPath=+function(d,p,z,u,x){p=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));z=Math.max(0,Math.min(x,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var C=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,z),new mxPoint((u+p)/2,z),new mxPoint((u+p)/2,x),new mxPoint((u-p)/2,x),new mxPoint((u-p)/2,z),new mxPoint(0,+z)],this.isRounded,C,!0);d.end()};mxCellRenderer.registerShape("tee",Ra);mxUtils.extend(Sa,mxActor);Sa.prototype.arrowWidth=.3;Sa.prototype.arrowSize=.2;Sa.prototype.isRoundable=function(){return!0};Sa.prototype.redrawPath=function(d,p,z,u,x){var C=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));p=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));z=(x-C)/2;C=z+C;var E=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,+mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,z),new mxPoint(u-p,z),new mxPoint(u-p,0),new mxPoint(u,x/2),new mxPoint(u-p,x),new mxPoint(u-p,C),new mxPoint(0,C)],this.isRounded,E,!0);d.end()};mxCellRenderer.registerShape("singleArrow",Sa);mxUtils.extend(Ha,mxActor);Ha.prototype.isRoundable=function(){return!0};Ha.prototype.redrawPath=function(d,p,z,u,x){var C=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",Sa.prototype.arrowWidth))));p=u*Math.max(0,Math.min(1,+parseFloat(mxUtils.getValue(this.style,"arrowSize",Sa.prototype.arrowSize))));z=(x-C)/2;C=z+C;var E=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,x/2),new mxPoint(p,0),new mxPoint(p,z),new mxPoint(u-p,z),new mxPoint(u-p,0),new mxPoint(u,x/2),new mxPoint(u-p,x),new mxPoint(u-p,C),new mxPoint(p,C),new mxPoint(p,x)],this.isRounded,E,!0);d.end()};mxCellRenderer.registerShape("doubleArrow",Ha);mxUtils.extend(Ma,mxActor);Ma.prototype.size=+.1;Ma.prototype.fixedSize=20;Ma.prototype.redrawPath=function(d,p,z,u,x){p="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.moveTo(p,0);d.lineTo(u,0);d.quadTo(u-2*p,x/2,u,x);d.lineTo(p,x);d.quadTo(p-2*p,x/2,p,0);d.close();d.end()};mxCellRenderer.registerShape("dataStorage",Ma);mxUtils.extend(y,mxActor);y.prototype.redrawPath=+function(d,p,z,u,x){d.moveTo(0,0);d.quadTo(u,0,u,x/2);d.quadTo(u,x,0,x);d.close();d.end()};mxCellRenderer.registerShape("or",y);mxUtils.extend(O,mxActor);O.prototype.redrawPath=function(d,p,z,u,x){d.moveTo(0,0);d.quadTo(u,0,u,x/2);d.quadTo(u,x,0,x);d.quadTo(u/2,x/2,0,0);d.close();d.end()};mxCellRenderer.registerShape("xor",O);mxUtils.extend(R,mxActor);R.prototype.size=20;R.prototype.isRoundable=function(){return!0};R.prototype.redrawPath=function(d,p,z,u,x){p=Math.min(u/2,Math.min(x,parseFloat(mxUtils.getValue(this.style,+"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(p,0),new mxPoint(u-p,0),new mxPoint(u,.8*p),new mxPoint(u,x),new mxPoint(0,x),new mxPoint(0,.8*p)],this.isRounded,z,!0);d.end()};mxCellRenderer.registerShape("loopLimit",R);mxUtils.extend(V,mxActor);V.prototype.size=.375;V.prototype.isRoundable=function(){return!0};V.prototype.redrawPath=function(d,p,z,u,x){p=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,+"size",this.size))));z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,x-p),new mxPoint(u/2,x),new mxPoint(0,x-p)],this.isRounded,z,!0);d.end()};mxCellRenderer.registerShape("offPageConnector",V);mxUtils.extend(fa,mxEllipse);fa.prototype.paintVertexShape=function(d,p,z,u,x){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.begin();d.moveTo(p+u/2,z+x);d.lineTo(p+u,z+x);d.end();d.stroke()};+mxCellRenderer.registerShape("tapeData",fa);mxUtils.extend(ia,mxEllipse);ia.prototype.paintVertexShape=function(d,p,z,u,x){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.setShadow(!1);d.begin();d.moveTo(p,z+x/2);d.lineTo(p+u,z+x/2);d.end();d.stroke();d.begin();d.moveTo(p+u/2,z);d.lineTo(p+u/2,z+x);d.end();d.stroke()};mxCellRenderer.registerShape("orEllipse",ia);mxUtils.extend(oa,mxEllipse);oa.prototype.paintVertexShape=function(d,p,z,u,x){mxEllipse.prototype.paintVertexShape.apply(this,+arguments);d.setShadow(!1);d.begin();d.moveTo(p+.145*u,z+.145*x);d.lineTo(p+.855*u,z+.855*x);d.end();d.stroke();d.begin();d.moveTo(p+.855*u,z+.145*x);d.lineTo(p+.145*u,z+.855*x);d.end();d.stroke()};mxCellRenderer.registerShape("sumEllipse",oa);mxUtils.extend(ta,mxRhombus);ta.prototype.paintVertexShape=function(d,p,z,u,x){mxRhombus.prototype.paintVertexShape.apply(this,arguments);d.setShadow(!1);d.begin();d.moveTo(p,z+x/2);d.lineTo(p+u,z+x/2);d.end();d.stroke()};mxCellRenderer.registerShape("sortShape",+ta);mxUtils.extend(ra,mxEllipse);ra.prototype.paintVertexShape=function(d,p,z,u,x){d.begin();d.moveTo(p,z);d.lineTo(p+u,z);d.lineTo(p+u/2,z+x/2);d.close();d.fillAndStroke();d.begin();d.moveTo(p,z+x);d.lineTo(p+u,z+x);d.lineTo(p+u/2,z+x/2);d.close();d.fillAndStroke()};mxCellRenderer.registerShape("collate",ra);mxUtils.extend(xa,mxEllipse);xa.prototype.paintVertexShape=function(d,p,z,u,x){var C=d.state.strokeWidth/2,E=10+2*C,da=z+x-E/2;d.begin();d.moveTo(p,z);d.lineTo(p,z+x);d.moveTo(p+C,da);d.lineTo(p++C+E,da-E/2);d.moveTo(p+C,da);d.lineTo(p+C+E,da+E/2);d.moveTo(p+C,da);d.lineTo(p+u-C,da);d.moveTo(p+u,z);d.lineTo(p+u,z+x);d.moveTo(p+u-C,da);d.lineTo(p+u-E-C,da-E/2);d.moveTo(p+u-C,da);d.lineTo(p+u-E-C,da+E/2);d.end();d.stroke()};mxCellRenderer.registerShape("dimension",xa);mxUtils.extend(Da,mxEllipse);Da.prototype.drawHidden=!0;Da.prototype.paintVertexShape=function(d,p,z,u,x){this.outline||d.setStrokeColor(null);if(null!=this.style){var C=d.pointerEvents,E=null!=this.fill&&this.fill!=mxConstants.NONE;+"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||E||(d.pointerEvents=!1);var da="1"==mxUtils.getValue(this.style,"top","1"),M="1"==mxUtils.getValue(this.style,"left","1"),sa="1"==mxUtils.getValue(this.style,"right","1"),ma="1"==mxUtils.getValue(this.style,"bottom","1");this.drawHidden||E||this.outline||da||sa||ma||M?(d.rect(p,z,u,x),d.fill(),d.pointerEvents=C,d.setStrokeColor(this.stroke),d.setLineCap("square"),d.begin(),d.moveTo(p,z),this.outline||da?d.lineTo(p+u,z):d.moveTo(p++u,z),this.outline||sa?d.lineTo(p+u,z+x):d.moveTo(p+u,z+x),this.outline||ma?d.lineTo(p,z+x):d.moveTo(p,z+x),(this.outline||M)&&d.lineTo(p,z),d.end(),d.stroke(),d.setLineCap("flat")):d.setStrokeColor(this.stroke)}};mxCellRenderer.registerShape("partialRectangle",Da);mxUtils.extend(Ia,mxEllipse);Ia.prototype.paintVertexShape=function(d,p,z,u,x){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.setShadow(!1);d.begin();"vertical"==mxUtils.getValue(this.style,"line")?(d.moveTo(p+u/2,z),d.lineTo(p++u/2,z+x)):(d.moveTo(p,z+x/2),d.lineTo(p+u,z+x/2));d.end();d.stroke()};mxCellRenderer.registerShape("lineEllipse",Ia);mxUtils.extend(Xa,mxActor);Xa.prototype.redrawPath=function(d,p,z,u,x){p=Math.min(u,x/2);d.moveTo(0,0);d.lineTo(u-p,0);d.quadTo(u,0,u,x/2);d.quadTo(u,x,u-p,x);d.lineTo(0,x);d.close();d.end()};mxCellRenderer.registerShape("delay",Xa);mxUtils.extend(Za,mxActor);Za.prototype.size=.2;Za.prototype.redrawPath=function(d,p,z,u,x){p=Math.min(x,u);var C=Math.max(0,Math.min(p,p*parseFloat(mxUtils.getValue(this.style,+"size",this.size))));p=(x-C)/2;z=p+C;var E=(u-C)/2;C=E+C;d.moveTo(0,p);d.lineTo(E,p);d.lineTo(E,0);d.lineTo(C,0);d.lineTo(C,p);d.lineTo(u,p);d.lineTo(u,z);d.lineTo(C,z);d.lineTo(C,x);d.lineTo(E,x);d.lineTo(E,z);d.lineTo(0,z);d.close();d.end()};mxCellRenderer.registerShape("cross",Za);mxUtils.extend($a,mxActor);$a.prototype.size=.25;$a.prototype.redrawPath=function(d,p,z,u,x){p=Math.min(u,x/2);z=Math.min(u-p,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*u);d.moveTo(0,x/2);d.lineTo(z,+0);d.lineTo(u-p,0);d.quadTo(u,0,u,x/2);d.quadTo(u,x,u-p,x);d.lineTo(z,x);d.close();d.end()};mxCellRenderer.registerShape("display",$a);mxUtils.extend(Pa,mxActor);Pa.prototype.cst={RECT2:"mxgraph.basic.rect"};Pa.prototype.customProperties=[{name:"rectStyle",dispName:"Style",type:"enum",defVal:"square",enumList:[{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"size",dispName:"Corner Size",type:"float",defVal:10},{name:"absoluteCornerSize",dispName:"Abs. Corner Size",type:"bool",defVal:!0},{name:"indent",dispName:"Indent",type:"float",defVal:2},{name:"rectOutline",dispName:"Outline",type:"enum",defVal:"single",enumList:[{val:"single",dispName:"Single"},{val:"double",dispName:"Double"},{val:"frame",dispName:"Frame"}]},{name:"fillColor2",dispName:"Inside Fill Color",type:"color",defVal:"none"},{name:"gradientColor2",dispName:"Inside Gradient Color",type:"color",defVal:"none"},{name:"gradientDirection2",dispName:"Inside Gradient Direction",type:"enum",defVal:"south",enumList:[{val:"south",dispName:"South"},{val:"west",dispName:"West"},{val:"north",dispName:"North"},{val:"east",dispName:"East"}]},{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"right",dispName:"Right",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left ",type:"bool",defVal:!0},{name:"topLeftStyle",dispName:"Top Left Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"topRightStyle",dispName:"Top Right Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"bottomRightStyle",dispName:"Bottom Right Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",dispName:"Fold"}]},{name:"bottomLeftStyle",dispName:"Bottom Left Style",type:"enum",defVal:"default",enumList:[{val:"default",dispName:"Default"},{val:"square",dispName:"Square"},{val:"rounded",dispName:"Round"},{val:"snip",dispName:"Snip"},{val:"invRound",dispName:"Inv. Round"},{val:"fold",-dispName:"Fold"}]}];Pa.prototype.paintVertexShape=function(d,n,z,u,x){d.translate(n,z);this.strictDrawShape(d,0,0,u,x)};Pa.prototype.strictDrawShape=function(d,n,z,u,x,C){var E=C&&C.rectStyle?C.rectStyle:mxUtils.getValue(this.style,"rectStyle",this.rectStyle),da=C&&C.absoluteCornerSize?C.absoluteCornerSize:mxUtils.getValue(this.style,"absoluteCornerSize",this.absoluteCornerSize),M=C&&C.size?C.size:Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),sa=C&&C.rectOutline?+dispName:"Fold"}]}];Pa.prototype.paintVertexShape=function(d,p,z,u,x){d.translate(p,z);this.strictDrawShape(d,0,0,u,x)};Pa.prototype.strictDrawShape=function(d,p,z,u,x,C){var E=C&&C.rectStyle?C.rectStyle:mxUtils.getValue(this.style,"rectStyle",this.rectStyle),da=C&&C.absoluteCornerSize?C.absoluteCornerSize:mxUtils.getValue(this.style,"absoluteCornerSize",this.absoluteCornerSize),M=C&&C.size?C.size:Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),sa=C&&C.rectOutline?C.rectOutline:mxUtils.getValue(this.style,"rectOutline",this.rectOutline),ma=C&&C.indent?C.indent:Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"indent",this.indent)))),Wa=C&&C.dashed?C.dashed:mxUtils.getValue(this.style,"dashed",!1),gb=C&&C.dashPattern?C.dashPattern:mxUtils.getValue(this.style,"dashPattern",null),bb=C&&C.relIndent?C.relIndent:Math.max(0,Math.min(50,ma)),Fa=C&&C.top?C.top:mxUtils.getValue(this.style,"top",!0),Ka=C&&C.right?C.right:mxUtils.getValue(this.style,"right",!0),Ja=C&&C.bottom?C.bottom:mxUtils.getValue(this.style,"bottom",!0),Ga=C&&C.left?C.left:mxUtils.getValue(this.style,"left",!0),Oa=C&&C.topLeftStyle?C.topLeftStyle:mxUtils.getValue(this.style,"topLeftStyle","default"),Ta=C&&C.topRightStyle?C.topRightStyle:mxUtils.getValue(this.style,"topRightStyle","default"),Ua=C&&C.bottomRightStyle?C.bottomRightStyle:mxUtils.getValue(this.style,"bottomRightStyle","default"),Va=C&&C.bottomLeftStyle?C.bottomLeftStyle:mxUtils.getValue(this.style,"bottomLeftStyle","default"),Fb=C&&C.fillColor?C.fillColor:mxUtils.getValue(this.style,"fillColor","#ffffff");C&&C.strokeColor||mxUtils.getValue(this.style,"strokeColor","#000000");var Gb=C&&C.strokeWidth?C.strokeWidth:mxUtils.getValue(this.style,"strokeWidth","1"),Db=C&&C.fillColor2?C.fillColor2:mxUtils.getValue(this.style,"fillColor2","none"),Eb=C&&C.gradientColor2?C.gradientColor2:mxUtils.getValue(this.style,"gradientColor2","none"),Hb=C&&C.gradientDirection2?C.gradientDirection2:mxUtils.getValue(this.style,"gradientDirection2",-"south"),Ib=C&&C.opacity?C.opacity:mxUtils.getValue(this.style,"opacity","100"),Jb=Math.max(0,Math.min(50,M));C=Pa.prototype;d.setDashed(Wa);gb&&""!=gb&&d.setDashPattern(gb);d.setStrokeWidth(Gb);M=Math.min(.5*x,.5*u,M);da||(M=Jb*Math.min(u,x)/100);M=Math.min(M,.5*Math.min(u,x));da||(ma=Math.min(bb*Math.min(u,x)/100));ma=Math.min(ma,.5*Math.min(u,x)-M);(Fa||Ka||Ja||Ga)&&"frame"!=sa&&(d.begin(),Fa?C.moveNW(d,n,z,u,x,E,Oa,M,Ga):d.moveTo(0,0),Fa&&C.paintNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,-Ta,M,Ka),Ka&&C.paintNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),Ja&&C.paintSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),Ga&&C.paintSW(d,n,z,u,x,E,Va,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),d.close(),d.fill(),d.setShadow(!1),d.setFillColor(Db),Wa=da=Ib,"none"==Db&&(da=0),"none"==Eb&&(Wa=0),d.setGradient(Db,Eb,0,0,u,x,Hb,da,Wa),d.begin(),Fa?C.moveNWInner(d,n,z,u,x,E,Oa,M,ma,Fa,Ga):d.moveTo(ma,0),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga),Ga&&Ja&&C.paintSWInner(d,n,z,u,x,-E,Va,M,ma,Ja),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja),Ja&&Ka&&C.paintSEInner(d,n,z,u,x,E,Ua,M,ma),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka),Ka&&Fa&&C.paintNEInner(d,n,z,u,x,E,Ta,M,ma),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa),Fa&&Ga&&C.paintNWInner(d,n,z,u,x,E,Oa,M,ma),d.fill(),"none"==Fb&&(d.begin(),C.paintFolds(d,n,z,u,x,E,Oa,Ta,Ua,Va,M,Fa,Ka,Ja,Ga),d.stroke()));Fa||Ka||Ja||!Ga?Fa||Ka||!Ja||Ga?!Fa&&!Ka&&Ja&&Ga?"frame"!=sa?(d.begin(),C.moveSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,-x,E,Va,M,Ga),C.paintSW(d,n,z,u,x,E,Va,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),"double"==sa&&(C.moveNWInner(d,n,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga),C.paintSWInner(d,n,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja)),d.stroke()):(d.begin(),C.moveSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),C.paintSW(d,n,z,u,x,E,Va,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),C.lineNWInner(d,n,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga),C.paintSWInner(d,-n,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja),d.close(),d.fillAndStroke()):Fa||!Ka||Ja||Ga?!Fa&&Ka&&!Ja&&Ga?"frame"!=sa?(d.begin(),C.moveSW(d,n,z,u,x,E,Oa,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),"double"==sa&&(C.moveNWInner(d,n,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga)),d.stroke(),d.begin(),C.moveNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),"double"==sa&&(C.moveSEInner(d,n,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka)),-d.stroke()):(d.begin(),C.moveSW(d,n,z,u,x,E,Oa,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),C.lineNWInner(d,n,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga),d.close(),d.fillAndStroke(),d.begin(),C.moveNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),C.lineSEInner(d,n,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka),d.close(),d.fillAndStroke()):!Fa&&Ka&&Ja&&!Ga?"frame"!=sa?(d.begin(),C.moveNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),C.paintSE(d,-n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),"double"==sa&&(C.moveSWInner(d,n,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,n,z,u,x,E,Ua,M,ma),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka)),d.stroke()):(d.begin(),C.moveNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),C.paintSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),C.lineSWInner(d,n,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,n,z,u,x,E,Ua,-M,ma),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka),d.close(),d.fillAndStroke()):!Fa&&Ka&&Ja&&Ga?"frame"!=sa?(d.begin(),C.moveNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),C.paintSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),C.paintSW(d,n,z,u,x,E,Va,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),"double"==sa&&(C.moveNWInner(d,n,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga),C.paintSWInner(d,n,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,-n,z,u,x,E,Ua,M,ma),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka)),d.stroke()):(d.begin(),C.moveNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),C.paintSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),C.paintSW(d,n,z,u,x,E,Va,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),C.lineNWInner(d,n,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga),C.paintSWInner(d,n,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,n,z,u,x,E,Ua,M,ma),C.paintRightInner(d,-n,z,u,x,E,Ta,M,ma,Fa,Ka),d.close(),d.fillAndStroke()):!Fa||Ka||Ja||Ga?Fa&&!Ka&&!Ja&&Ga?"frame"!=sa?(d.begin(),C.moveSW(d,n,z,u,x,E,Va,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),C.paintNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),"double"==sa&&(C.moveNEInner(d,n,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,n,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga)),d.stroke()):(d.begin(),C.moveSW(d,n,z,u,x,E,Va,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),C.paintNW(d,-n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),C.lineNEInner(d,n,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,n,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga),d.close(),d.fillAndStroke()):Fa&&!Ka&&Ja&&!Ga?"frame"!=sa?(d.begin(),C.moveNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),"double"==sa&&(C.moveNEInner(d,n,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa)),d.stroke(),d.begin(),C.moveSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,-n,z,u,x,E,Va,M,Ga),"double"==sa&&(C.moveSWInner(d,n,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja)),d.stroke()):(d.begin(),C.moveNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),C.lineNEInner(d,n,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa),d.close(),d.fillAndStroke(),d.begin(),C.moveSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),C.lineSWInner(d,n,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja),d.close(),d.fillAndStroke()):-Fa&&!Ka&&Ja&&Ga?"frame"!=sa?(d.begin(),C.moveSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),C.paintSW(d,n,z,u,x,E,Va,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),C.paintNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),"double"==sa&&(C.moveNEInner(d,n,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,n,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga),C.paintSWInner(d,n,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja)),d.stroke()):-(d.begin(),C.moveSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),C.paintSW(d,n,z,u,x,E,Va,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),C.paintNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),C.lineNEInner(d,n,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,n,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga),C.paintSWInner(d,n,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja),d.close(),d.fillAndStroke()):Fa&&Ka&&!Ja&&!Ga?"frame"!=-sa?(d.begin(),C.moveNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),C.paintNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),"double"==sa&&(C.moveSEInner(d,n,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,n,z,u,x,E,Ta,M,ma),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa)),d.stroke()):(d.begin(),C.moveNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),C.paintNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),C.lineSEInner(d,n,z,u,x,E,Ua,M,ma,-Ja),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,n,z,u,x,E,Ta,M,ma),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa),d.close(),d.fillAndStroke()):Fa&&Ka&&!Ja&&Ga?"frame"!=sa?(d.begin(),C.moveSW(d,n,z,u,x,E,Va,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),C.paintNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),C.paintNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),"double"==sa&&(C.moveSEInner(d,n,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,-n,z,u,x,E,Ta,M,ma),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,n,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga)),d.stroke()):(d.begin(),C.moveSW(d,n,z,u,x,E,Va,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),C.paintNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),C.paintNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),C.lineSEInner(d,n,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,n,z,u,x,E,Ta,M,ma),C.paintTopInner(d,n,z,u,x,-E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,n,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga),d.close(),d.fillAndStroke()):Fa&&Ka&&Ja&&!Ga?"frame"!=sa?(d.begin(),C.moveNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),C.paintNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),C.paintSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),"double"==sa&&(C.moveSWInner(d,n,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,n,z,u,x,E,Ua,M,ma),C.paintRightInner(d,-n,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,n,z,u,x,E,Ta,M,ma),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa)),d.stroke()):(d.begin(),C.moveNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),C.paintNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),C.paintSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),C.lineSWInner(d,n,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,n,z,u,x,E,Ua,M,ma),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,-n,z,u,x,E,Ta,M,ma),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa),d.close(),d.fillAndStroke()):Fa&&Ka&&Ja&&Ga&&("frame"!=sa?(d.begin(),C.moveNW(d,n,z,u,x,E,Oa,M,Ga),C.paintNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),C.paintNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),C.paintSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),C.paintSW(d,n,z,u,x,E,Va,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),d.close(),"double"==sa&&(C.moveSWInner(d,n,z,u,x,E,Va,M,ma,Ga),C.paintSWInner(d,n,-z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,n,z,u,x,E,Ua,M,ma),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,n,z,u,x,E,Ta,M,ma),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,n,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga),d.close()),d.stroke()):(d.begin(),C.moveNW(d,n,z,u,x,E,Oa,M,Ga),C.paintNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),C.paintNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),C.paintSE(d,-n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),C.paintSW(d,n,z,u,x,E,Va,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),d.close(),C.moveSWInner(d,n,z,u,x,E,Va,M,ma,Ga),C.paintSWInner(d,n,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,n,z,u,x,E,Ua,M,ma),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,n,z,u,x,E,Ta,M,ma),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,n,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga),d.close(),-d.fillAndStroke())):"frame"!=sa?(d.begin(),C.moveNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),"double"==sa&&(C.moveNEInner(d,n,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa)),d.stroke()):(d.begin(),C.moveNW(d,n,z,u,x,E,Oa,M,Ga),C.paintTop(d,n,z,u,x,E,Ta,M,Ka),C.lineNEInner(d,n,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,n,z,u,x,E,Oa,M,ma,Ga,Fa),d.close(),d.fillAndStroke()):"frame"!=sa?(d.begin(),C.moveNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),"double"==sa&&(C.moveSEInner(d,-n,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka)),d.stroke()):(d.begin(),C.moveNE(d,n,z,u,x,E,Ta,M,Fa),C.paintRight(d,n,z,u,x,E,Ua,M,Ja),C.lineSEInner(d,n,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,n,z,u,x,E,Ta,M,ma,Fa,Ka),d.close(),d.fillAndStroke()):"frame"!=sa?(d.begin(),C.moveSE(d,n,z,u,x,E,Ua,M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),"double"==sa&&(C.moveSWInner(d,n,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja)),d.stroke()):(d.begin(),C.moveSE(d,n,z,u,x,E,Ua,-M,Ka),C.paintBottom(d,n,z,u,x,E,Va,M,Ga),C.lineSWInner(d,n,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,n,z,u,x,E,Ua,M,ma,Ka,Ja),d.close(),d.fillAndStroke()):"frame"!=sa?(d.begin(),C.moveSW(d,n,z,u,x,E,Oa,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),"double"==sa&&(C.moveNWInner(d,n,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,n,z,u,x,E,Va,M,ma,Ja,Ga)),d.stroke()):(d.begin(),C.moveSW(d,n,z,u,x,E,Oa,M,Ja),C.paintLeft(d,n,z,u,x,E,Oa,M,Fa),C.lineNWInner(d,n,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,n,z,u,x,E,Va,M,-ma,Ja,Ga),d.close(),d.fillAndStroke());d.begin();C.paintFolds(d,n,z,u,x,E,Oa,Ta,Ua,Va,M,Fa,Ka,Ja,Ga);d.stroke()};Pa.prototype.moveNW=function(d,n,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.moveTo(0,0):d.moveTo(0,da)};Pa.prototype.moveNE=function(d,n,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.moveTo(u,0):d.moveTo(u-da,0)};Pa.prototype.moveSE=function(d,n,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.moveTo(u,x):d.moveTo(u,x-da)};Pa.prototype.moveSW=-function(d,n,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.moveTo(0,x):d.moveTo(da,x)};Pa.prototype.paintNW=function(d,n,z,u,x,C,E,da,M){if(M)if("rounded"==E||"default"==E&&"rounded"==C||"invRound"==E||"default"==E&&"invRound"==C){n=0;if("rounded"==E||"default"==E&&"rounded"==C)n=1;d.arcTo(da,da,0,0,n,da,0)}else("snip"==E||"default"==E&&"snip"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(da,0);else d.lineTo(0,0)};Pa.prototype.paintTop=function(d,n,z,u,x,C,E,da,M){"square"==E||-"default"==E&&"square"==C||!M?d.lineTo(u,0):d.lineTo(u-da,0)};Pa.prototype.paintNE=function(d,n,z,u,x,C,E,da,M){if(M)if("rounded"==E||"default"==E&&"rounded"==C||"invRound"==E||"default"==E&&"invRound"==C){n=0;if("rounded"==E||"default"==E&&"rounded"==C)n=1;d.arcTo(da,da,0,0,n,u,da)}else("snip"==E||"default"==E&&"snip"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(u,da);else d.lineTo(u,0)};Pa.prototype.paintRight=function(d,n,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.lineTo(u,-x):d.lineTo(u,x-da)};Pa.prototype.paintLeft=function(d,n,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.lineTo(0,0):d.lineTo(0,da)};Pa.prototype.paintSE=function(d,n,z,u,x,C,E,da,M){if(M)if("rounded"==E||"default"==E&&"rounded"==C||"invRound"==E||"default"==E&&"invRound"==C){n=0;if("rounded"==E||"default"==E&&"rounded"==C)n=1;d.arcTo(da,da,0,0,n,u-da,x)}else("snip"==E||"default"==E&&"snip"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(u-da,x);else d.lineTo(u,x)};Pa.prototype.paintBottom=-function(d,n,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.lineTo(0,x):d.lineTo(da,x)};Pa.prototype.paintSW=function(d,n,z,u,x,C,E,da,M){if(M)if("rounded"==E||"default"==E&&"rounded"==C||"invRound"==E||"default"==E&&"invRound"==C){n=0;if("rounded"==E||"default"==E&&"rounded"==C)n=1;d.arcTo(da,da,0,0,n,0,x-da)}else("snip"==E||"default"==E&&"snip"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(0,x-da);else d.lineTo(0,x)};Pa.prototype.paintNWInner=function(d,n,z,u,x,C,E,da,M){if("rounded"==-E||"default"==E&&"rounded"==C)d.arcTo(da-.5*M,da-.5*M,0,0,0,M,.5*M+da);else if("invRound"==E||"default"==E&&"invRound"==C)d.arcTo(da+M,da+M,0,0,1,M,M+da);else if("snip"==E||"default"==E&&"snip"==C)d.lineTo(M,.5*M+da);else if("fold"==E||"default"==E&&"fold"==C)d.lineTo(M+da,M+da),d.lineTo(M,M+da)};Pa.prototype.paintTopInner=function(d,n,z,u,x,C,E,da,M,sa,ma){sa||ma?!sa&&ma?d.lineTo(0,M):sa&&!ma?d.lineTo(M,0):sa?"square"==E||"default"==E&&"square"==C?d.lineTo(M,M):"rounded"==E||"default"==E&&"rounded"==-C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(da+.5*M,M):d.lineTo(da+M,M):d.lineTo(0,M):d.lineTo(0,0)};Pa.prototype.paintNEInner=function(d,n,z,u,x,C,E,da,M){if("rounded"==E||"default"==E&&"rounded"==C)d.arcTo(da-.5*M,da-.5*M,0,0,0,u-da-.5*M,M);else if("invRound"==E||"default"==E&&"invRound"==C)d.arcTo(da+M,da+M,0,0,1,u-da-M,M);else if("snip"==E||"default"==E&&"snip"==C)d.lineTo(u-da-.5*M,M);else if("fold"==E||"default"==E&&"fold"==C)d.lineTo(u-da-M,da+M),d.lineTo(u-da-M,M)};Pa.prototype.paintRightInner=-function(d,n,z,u,x,C,E,da,M,sa,ma){sa||ma?!sa&&ma?d.lineTo(u-M,0):sa&&!ma?d.lineTo(u,M):sa?"square"==E||"default"==E&&"square"==C?d.lineTo(u-M,M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(u-M,da+.5*M):d.lineTo(u-M,da+M):d.lineTo(u-M,0):d.lineTo(u,0)};Pa.prototype.paintLeftInner=function(d,n,z,u,x,C,E,da,M,sa,ma){sa||ma?!sa&&ma?d.lineTo(M,x):sa&&!ma?d.lineTo(0,x-M):sa?"square"==E||"default"==E&&"square"==C?d.lineTo(M,x-M):"rounded"==E||"default"==E&&"rounded"==-C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(M,x-da-.5*M):d.lineTo(M,x-da-M):d.lineTo(M,x):d.lineTo(0,x)};Pa.prototype.paintSEInner=function(d,n,z,u,x,C,E,da,M){if("rounded"==E||"default"==E&&"rounded"==C)d.arcTo(da-.5*M,da-.5*M,0,0,0,u-M,x-da-.5*M);else if("invRound"==E||"default"==E&&"invRound"==C)d.arcTo(da+M,da+M,0,0,1,u-M,x-da-M);else if("snip"==E||"default"==E&&"snip"==C)d.lineTo(u-M,x-da-.5*M);else if("fold"==E||"default"==E&&"fold"==C)d.lineTo(u-da-M,x-da-M),d.lineTo(u-M,x-da-M)};Pa.prototype.paintBottomInner=-function(d,n,z,u,x,C,E,da,M,sa,ma){sa||ma?!sa&&ma?d.lineTo(u,x-M):sa&&!ma?d.lineTo(u-M,x):"square"==E||"default"==E&&"square"==C||!sa?d.lineTo(u-M,x-M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(u-da-.5*M,x-M):d.lineTo(u-da-M,x-M):d.lineTo(u,x)};Pa.prototype.paintSWInner=function(d,n,z,u,x,C,E,da,M,sa){if(!sa)d.lineTo(M,x);else if("square"==E||"default"==E&&"square"==C)d.lineTo(M,x-M);else if("rounded"==E||"default"==E&&"rounded"==C)d.arcTo(da-.5*M,da-.5*-M,0,0,0,da+.5*M,x-M);else if("invRound"==E||"default"==E&&"invRound"==C)d.arcTo(da+M,da+M,0,0,1,da+M,x-M);else if("snip"==E||"default"==E&&"snip"==C)d.lineTo(da+.5*M,x-M);else if("fold"==E||"default"==E&&"fold"==C)d.lineTo(M+da,x-da-M),d.lineTo(M+da,x-M)};Pa.prototype.moveSWInner=function(d,n,z,u,x,C,E,da,M,sa){sa?"square"==E||"default"==E&&"square"==C?d.moveTo(M,x-M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.moveTo(M,x-da-.5*M):("invRound"==E||"default"==E&&"invRound"==-C||"fold"==E||"default"==E&&"fold"==C)&&d.moveTo(M,x-da-M):d.moveTo(0,x-M)};Pa.prototype.lineSWInner=function(d,n,z,u,x,C,E,da,M,sa){sa?"square"==E||"default"==E&&"square"==C?d.lineTo(M,x-M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(M,x-da-.5*M):("invRound"==E||"default"==E&&"invRound"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(M,x-da-M):d.lineTo(0,x-M)};Pa.prototype.moveSEInner=function(d,n,z,u,x,C,E,da,M,sa){sa?"square"==E||"default"==E&&"square"==-C?d.moveTo(u-M,x-M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.moveTo(u-M,x-da-.5*M):("invRound"==E||"default"==E&&"invRound"==C||"fold"==E||"default"==E&&"fold"==C)&&d.moveTo(u-M,x-da-M):d.moveTo(u-M,x)};Pa.prototype.lineSEInner=function(d,n,z,u,x,C,E,da,M,sa){sa?"square"==E||"default"==E&&"square"==C?d.lineTo(u-M,x-M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(u-M,x-da-.5*M):("invRound"==E||"default"==E&&"invRound"==-C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(u-M,x-da-M):d.lineTo(u-M,x)};Pa.prototype.moveNEInner=function(d,n,z,u,x,C,E,da,M,sa){sa?"square"==E||"default"==E&&"square"==C||sa?d.moveTo(u-M,M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.moveTo(u-M,da+.5*M):("invRound"==E||"default"==E&&"invRound"==C||"fold"==E||"default"==E&&"fold"==C)&&d.moveTo(u-M,da+M):d.moveTo(u,M)};Pa.prototype.lineNEInner=function(d,n,z,u,x,C,E,da,M,sa){sa?"square"==E||"default"==E&&"square"==-C||sa?d.lineTo(u-M,M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(u-M,da+.5*M):("invRound"==E||"default"==E&&"invRound"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(u-M,da+M):d.lineTo(u,M)};Pa.prototype.moveNWInner=function(d,n,z,u,x,C,E,da,M,sa,ma){sa||ma?!sa&&ma?d.moveTo(M,0):sa&&!ma?d.moveTo(0,M):"square"==E||"default"==E&&"square"==C?d.moveTo(M,M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.moveTo(M,da+.5*M):("invRound"==-E||"default"==E&&"invRound"==C||"fold"==E||"default"==E&&"fold"==C)&&d.moveTo(M,da+M):d.moveTo(0,0)};Pa.prototype.lineNWInner=function(d,n,z,u,x,C,E,da,M,sa,ma){sa||ma?!sa&&ma?d.lineTo(M,0):sa&&!ma?d.lineTo(0,M):"square"==E||"default"==E&&"square"==C?d.lineTo(M,M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(M,da+.5*M):("invRound"==E||"default"==E&&"invRound"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(M,da+M):d.lineTo(0,0)};Pa.prototype.paintFolds=function(d,-n,z,u,x,C,E,da,M,sa,ma,Wa,gb,bb,Fa){if("fold"==C||"fold"==E||"fold"==da||"fold"==M||"fold"==sa)("fold"==E||"default"==E&&"fold"==C)&&Wa&&Fa&&(d.moveTo(0,ma),d.lineTo(ma,ma),d.lineTo(ma,0)),("fold"==da||"default"==da&&"fold"==C)&&Wa&&gb&&(d.moveTo(u-ma,0),d.lineTo(u-ma,ma),d.lineTo(u,ma)),("fold"==M||"default"==M&&"fold"==C)&&bb&&gb&&(d.moveTo(u-ma,x),d.lineTo(u-ma,x-ma),d.lineTo(u,x-ma)),("fold"==sa||"default"==sa&&"fold"==C)&&bb&&Fa&&(d.moveTo(0,x-ma),d.lineTo(ma,x-ma),d.lineTo(ma,x))};mxCellRenderer.registerShape(Pa.prototype.cst.RECT2,-Pa);Pa.prototype.constraints=null;mxUtils.extend(Na,mxConnector);Na.prototype.origPaintEdgeShape=Na.prototype.paintEdgeShape;Na.prototype.paintEdgeShape=function(d,n,z){for(var u=[],x=0;x<n.length;x++)u.push(mxUtils.clone(n[x]));x=d.state.dashed;var C=d.state.fixDash;Na.prototype.origPaintEdgeShape.apply(this,[d,u,z]);3<=d.state.strokeWidth&&(u=mxUtils.getValue(this.style,"fillColor",null),null!=u&&(d.setStrokeColor(u),d.setStrokeWidth(d.state.strokeWidth-2),d.setDashed(x,C),Na.prototype.origPaintEdgeShape.apply(this,-[d,n,z])))};mxCellRenderer.registerShape("filledEdge",Na);"undefined"!==typeof StyleFormatPanel&&function(){var d=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var n=this.editorUi.getSelectionState(),z=d.apply(this,arguments);"umlFrame"==n.style.shape&&z.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return z}}();mxMarker.addMarker("dash",function(d,n,z,u,x,C,E,da,M,sa){var ma=x*(E+M+1),Wa=C*(E+M+1);return function(){d.begin();-d.moveTo(u.x-ma/2-Wa/2,u.y-Wa/2+ma/2);d.lineTo(u.x+Wa/2-3*ma/2,u.y-3*Wa/2-ma/2);d.stroke()}});mxMarker.addMarker("box",function(d,n,z,u,x,C,E,da,M,sa){var ma=x*(E+M+1),Wa=C*(E+M+1),gb=u.x+ma/2,bb=u.y+Wa/2;u.x-=ma;u.y-=Wa;return function(){d.begin();d.moveTo(gb-ma/2-Wa/2,bb-Wa/2+ma/2);d.lineTo(gb-ma/2+Wa/2,bb-Wa/2-ma/2);d.lineTo(gb+Wa/2-3*ma/2,bb-3*Wa/2-ma/2);d.lineTo(gb-Wa/2-3*ma/2,bb-3*Wa/2+ma/2);d.close();sa?d.fillAndStroke():d.stroke()}});mxMarker.addMarker("cross",function(d,n,z,u,x,C,E,da,M,-sa){var ma=x*(E+M+1),Wa=C*(E+M+1);return function(){d.begin();d.moveTo(u.x-ma/2-Wa/2,u.y-Wa/2+ma/2);d.lineTo(u.x+Wa/2-3*ma/2,u.y-3*Wa/2-ma/2);d.moveTo(u.x-ma/2+Wa/2,u.y-Wa/2-ma/2);d.lineTo(u.x-Wa/2-3*ma/2,u.y-3*Wa/2+ma/2);d.stroke()}});mxMarker.addMarker("circle",jb);mxMarker.addMarker("circlePlus",function(d,n,z,u,x,C,E,da,M,sa){var ma=u.clone(),Wa=jb.apply(this,arguments),gb=x*(E+2*M),bb=C*(E+2*M);return function(){Wa.apply(this,arguments);d.begin();d.moveTo(ma.x-x*M,ma.y-C*M);d.lineTo(ma.x-2*gb+-x*M,ma.y-2*bb+C*M);d.moveTo(ma.x-gb-bb+C*M,ma.y-bb+gb-x*M);d.lineTo(ma.x+bb-gb-C*M,ma.y-bb-gb+x*M);d.stroke()}});mxMarker.addMarker("halfCircle",function(d,n,z,u,x,C,E,da,M,sa){var ma=x*(E+M+1),Wa=C*(E+M+1),gb=u.clone();u.x-=ma;u.y-=Wa;return function(){d.begin();d.moveTo(gb.x-Wa,gb.y+ma);d.quadTo(u.x-Wa,u.y+ma,u.x,u.y);d.quadTo(u.x+Wa,u.y-ma,gb.x+Wa,gb.y-ma);d.stroke()}});mxMarker.addMarker("async",function(d,n,z,u,x,C,E,da,M,sa){n=x*M*1.118;z=C*M*1.118;x*=E+M;C*=E+M;var ma=u.clone();ma.x-=n;ma.y-=-z;u.x+=-x-n;u.y+=-C-z;return function(){d.begin();d.moveTo(ma.x,ma.y);da?d.lineTo(ma.x-x-C/2,ma.y-C+x/2):d.lineTo(ma.x+C/2-x,ma.y-C-x/2);d.lineTo(ma.x-x,ma.y-C);d.close();sa?d.fillAndStroke():d.stroke()}});mxMarker.addMarker("openAsync",function(d){d=null!=d?d:2;return function(n,z,u,x,C,E,da,M,sa,ma){C*=da+sa;E*=da+sa;var Wa=x.clone();return function(){n.begin();n.moveTo(Wa.x,Wa.y);M?n.lineTo(Wa.x-C-E/d,Wa.y-E+C/d):n.lineTo(Wa.x+E/d-C,Wa.y-E-C/d);n.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var tb=-function(d,n,z){return eb(d,["width"],n,function(u,x,C,E,da){da=d.shape.getEdgeWidth()*d.view.scale+z;return new mxPoint(E.x+x*u/4+C*da/2,E.y+C*u/4-x*da/2)},function(u,x,C,E,da,M){u=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,da.x,da.y,M.x,M.y));d.style.width=Math.round(2*u)/d.view.scale-z})},eb=function(d,n,z,u,x){return ib(d,n,function(C){var E=d.absolutePoints;if(null!=E&&0<E.length){var da=E.length-1;C=d.view.translate;var M=d.view.scale,sa=z?E[0]:E[da];E=z?E[1]:E[da-1];da=E.x-sa.x;var ma=E.y-sa.y,-Wa=Math.sqrt(da*da+ma*ma);sa=u.call(this,Wa,da/Wa,ma/Wa,sa,E);return new mxPoint(sa.x/M-C.x,sa.y/M-C.y)}return null},function(C,E,da){var M=d.absolutePoints,sa=M.length-1;C=d.view.translate;var ma=d.view.scale,Wa=z?M[0]:M[sa];M=z?M[1]:M[sa-1];sa=M.x-Wa.x;var gb=M.y-Wa.y,bb=Math.sqrt(sa*sa+gb*gb);E.x=(E.x+C.x)*ma;E.y=(E.y+C.y)*ma;x.call(this,bb,sa/bb,gb/bb,Wa,M,E,da)})},nb=function(d,n){return function(z){return[eb(z,["startWidth"],!0,function(u,x,C,E,da){da=mxUtils.getNumber(z.style,"startWidth",-d)*z.view.scale+n;return new mxPoint(E.x+x*u/4+C*da/2,E.y+C*u/4-x*da/2)},function(u,x,C,E,da,M){u=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,da.x,da.y,M.x,M.y));z.style.startWidth=Math.round(2*u)/z.view.scale-n})]}},mb=function(d){return function(n){return[ib(n,["arrowWidth","arrowSize"],function(z){var u=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",Sa.prototype.arrowWidth))),x=Math.max(0,Math.min(d,mxUtils.getValue(this.state.style,"arrowSize",Sa.prototype.arrowSize)));return new mxPoint(z.x+-(1-x)*z.width,z.y+(1-u)*z.height/2)},function(z,u){this.state.style.arrowWidth=Math.max(0,Math.min(1,Math.abs(z.y+z.height/2-u.y)/z.height*2));this.state.style.arrowSize=Math.max(0,Math.min(d,(z.x+z.width-u.x)/z.width))})]}},qb=function(d){return function(n){return[ib(n,["size"],function(z){var u=Math.max(0,Math.min(.5*z.height,parseFloat(mxUtils.getValue(this.state.style,"size",d))));return new mxPoint(z.x,z.y+u)},function(z,u){this.state.style.size=Math.max(0,u.y-z.y)},!0)]}},ub=function(d,n,z){return function(u){var x=-[ib(u,["size"],function(C){var E=Math.max(0,Math.min(C.width,Math.min(C.height,parseFloat(mxUtils.getValue(this.state.style,"size",n)))))*d;return new mxPoint(C.x+E,C.y+E)},function(C,E){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(C.width,E.x-C.x),Math.min(C.height,E.y-C.y)))/d)},!1)];z&&mxUtils.getValue(u.style,mxConstants.STYLE_ROUNDED,!1)&&x.push(vb(u));return x}},zb=function(d,n,z,u,x){z=null!=z?z:.5;return function(C){var E=[ib(C,["size"],function(da){var M=null!=x?"0"!=mxUtils.getValue(this.state.style,-"fixedSize","0"):null,sa=parseFloat(mxUtils.getValue(this.state.style,"size",M?x:d));return new mxPoint(da.x+Math.max(0,Math.min(.5*da.width,sa*(M?1:da.width))),da.getCenterY())},function(da,M,sa){da=null!=x&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?M.x-da.x:Math.max(0,Math.min(z,(M.x-da.x)/da.width));this.state.style.size=da},!1,u)];n&&mxUtils.getValue(C.style,mxConstants.STYLE_ROUNDED,!1)&&E.push(vb(C));return E}},Cb=function(d,n,z){d=null!=d?d:.5;return function(u){var x=[ib(u,["size"],-function(C){var E=null!=z?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,da=Math.max(0,parseFloat(mxUtils.getValue(this.state.style,"size",E?z:n)));return new mxPoint(C.x+Math.min(.75*C.width*d,da*(E?.75:.75*C.width)),C.y+C.height/4)},function(C,E){C=null!=z&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?E.x-C.x:Math.max(0,Math.min(d,(E.x-C.x)/C.width*.75));this.state.style.size=C},!1,!0)];mxUtils.getValue(u.style,mxConstants.STYLE_ROUNDED,!1)&&x.push(vb(u));return x}},xb=-function(){return function(d){var n=[];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&n.push(vb(d));return n}},vb=function(d,n){return ib(d,[mxConstants.STYLE_ARCSIZE],function(z){var u=null!=n?n:z.height/8;if("1"==mxUtils.getValue(d.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var x=mxUtils.getValue(d.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(z.x+z.width-Math.min(z.width/2,x),z.y+u)}x=Math.max(0,parseFloat(mxUtils.getValue(d.style,mxConstants.STYLE_ARCSIZE,-100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100;return new mxPoint(z.x+z.width-Math.min(Math.max(z.width/2,z.height/2),Math.min(z.width,z.height)*x),z.y+u)},function(z,u,x){"1"==mxUtils.getValue(d.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(z.width,2*(z.x+z.width-u.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(z.width-u.x+z.x)/Math.min(z.width,z.height))))})},ib=function(d,n,z,u,-x,C,E){var da=new mxHandle(d,null,mxVertexHandler.prototype.secondaryHandleImage);da.execute=function(sa){for(var ma=0;ma<n.length;ma++)this.copyStyle(n[ma]);E&&E(sa)};da.getPosition=z;da.setPosition=u;da.ignoreGrid=null!=x?x:!0;if(C){var M=da.positionChanged;da.positionChanged=function(){M.apply(this,arguments);d.view.invalidate(this.state.cell);d.view.validate()}}return da},hb={link:function(d){return[tb(d,!0,10),tb(d,!1,10)]},flexArrow:function(d){var n=d.view.graph.gridSize/d.view.scale,z=[];+"south"),Ib=C&&C.opacity?C.opacity:mxUtils.getValue(this.style,"opacity","100"),Jb=Math.max(0,Math.min(50,M));C=Pa.prototype;d.setDashed(Wa);gb&&""!=gb&&d.setDashPattern(gb);d.setStrokeWidth(Gb);M=Math.min(.5*x,.5*u,M);da||(M=Jb*Math.min(u,x)/100);M=Math.min(M,.5*Math.min(u,x));da||(ma=Math.min(bb*Math.min(u,x)/100));ma=Math.min(ma,.5*Math.min(u,x)-M);(Fa||Ka||Ja||Ga)&&"frame"!=sa&&(d.begin(),Fa?C.moveNW(d,p,z,u,x,E,Oa,M,Ga):d.moveTo(0,0),Fa&&C.paintNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,+Ta,M,Ka),Ka&&C.paintNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),Ja&&C.paintSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),Ga&&C.paintSW(d,p,z,u,x,E,Va,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),d.close(),d.fill(),d.setShadow(!1),d.setFillColor(Db),Wa=da=Ib,"none"==Db&&(da=0),"none"==Eb&&(Wa=0),d.setGradient(Db,Eb,0,0,u,x,Hb,da,Wa),d.begin(),Fa?C.moveNWInner(d,p,z,u,x,E,Oa,M,ma,Fa,Ga):d.moveTo(ma,0),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga),Ga&&Ja&&C.paintSWInner(d,p,z,u,x,+E,Va,M,ma,Ja),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja),Ja&&Ka&&C.paintSEInner(d,p,z,u,x,E,Ua,M,ma),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka),Ka&&Fa&&C.paintNEInner(d,p,z,u,x,E,Ta,M,ma),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa),Fa&&Ga&&C.paintNWInner(d,p,z,u,x,E,Oa,M,ma),d.fill(),"none"==Fb&&(d.begin(),C.paintFolds(d,p,z,u,x,E,Oa,Ta,Ua,Va,M,Fa,Ka,Ja,Ga),d.stroke()));Fa||Ka||Ja||!Ga?Fa||Ka||!Ja||Ga?!Fa&&!Ka&&Ja&&Ga?"frame"!=sa?(d.begin(),C.moveSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,+x,E,Va,M,Ga),C.paintSW(d,p,z,u,x,E,Va,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),"double"==sa&&(C.moveNWInner(d,p,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga),C.paintSWInner(d,p,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja)),d.stroke()):(d.begin(),C.moveSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),C.paintSW(d,p,z,u,x,E,Va,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),C.lineNWInner(d,p,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga),C.paintSWInner(d,+p,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja),d.close(),d.fillAndStroke()):Fa||!Ka||Ja||Ga?!Fa&&Ka&&!Ja&&Ga?"frame"!=sa?(d.begin(),C.moveSW(d,p,z,u,x,E,Oa,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),"double"==sa&&(C.moveNWInner(d,p,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga)),d.stroke(),d.begin(),C.moveNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),"double"==sa&&(C.moveSEInner(d,p,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka)),+d.stroke()):(d.begin(),C.moveSW(d,p,z,u,x,E,Oa,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),C.lineNWInner(d,p,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga),d.close(),d.fillAndStroke(),d.begin(),C.moveNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),C.lineSEInner(d,p,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka),d.close(),d.fillAndStroke()):!Fa&&Ka&&Ja&&!Ga?"frame"!=sa?(d.begin(),C.moveNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),C.paintSE(d,+p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),"double"==sa&&(C.moveSWInner(d,p,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,p,z,u,x,E,Ua,M,ma),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka)),d.stroke()):(d.begin(),C.moveNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),C.paintSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),C.lineSWInner(d,p,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,p,z,u,x,E,Ua,+M,ma),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka),d.close(),d.fillAndStroke()):!Fa&&Ka&&Ja&&Ga?"frame"!=sa?(d.begin(),C.moveNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),C.paintSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),C.paintSW(d,p,z,u,x,E,Va,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),"double"==sa&&(C.moveNWInner(d,p,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga),C.paintSWInner(d,p,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,+p,z,u,x,E,Ua,M,ma),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka)),d.stroke()):(d.begin(),C.moveNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),C.paintSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),C.paintSW(d,p,z,u,x,E,Va,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),C.lineNWInner(d,p,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga),C.paintSWInner(d,p,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,p,z,u,x,E,Ua,M,ma),C.paintRightInner(d,+p,z,u,x,E,Ta,M,ma,Fa,Ka),d.close(),d.fillAndStroke()):!Fa||Ka||Ja||Ga?Fa&&!Ka&&!Ja&&Ga?"frame"!=sa?(d.begin(),C.moveSW(d,p,z,u,x,E,Va,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),C.paintNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),"double"==sa&&(C.moveNEInner(d,p,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,p,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga)),d.stroke()):(d.begin(),C.moveSW(d,p,z,u,x,E,Va,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),C.paintNW(d,+p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),C.lineNEInner(d,p,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,p,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga),d.close(),d.fillAndStroke()):Fa&&!Ka&&Ja&&!Ga?"frame"!=sa?(d.begin(),C.moveNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),"double"==sa&&(C.moveNEInner(d,p,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa)),d.stroke(),d.begin(),C.moveSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,+p,z,u,x,E,Va,M,Ga),"double"==sa&&(C.moveSWInner(d,p,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja)),d.stroke()):(d.begin(),C.moveNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),C.lineNEInner(d,p,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa),d.close(),d.fillAndStroke(),d.begin(),C.moveSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),C.lineSWInner(d,p,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja),d.close(),d.fillAndStroke()):+Fa&&!Ka&&Ja&&Ga?"frame"!=sa?(d.begin(),C.moveSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),C.paintSW(d,p,z,u,x,E,Va,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),C.paintNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),"double"==sa&&(C.moveNEInner(d,p,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,p,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga),C.paintSWInner(d,p,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja)),d.stroke()):+(d.begin(),C.moveSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),C.paintSW(d,p,z,u,x,E,Va,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),C.paintNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),C.lineNEInner(d,p,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,p,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga),C.paintSWInner(d,p,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja),d.close(),d.fillAndStroke()):Fa&&Ka&&!Ja&&!Ga?"frame"!=+sa?(d.begin(),C.moveNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),C.paintNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),"double"==sa&&(C.moveSEInner(d,p,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,p,z,u,x,E,Ta,M,ma),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa)),d.stroke()):(d.begin(),C.moveNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),C.paintNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),C.lineSEInner(d,p,z,u,x,E,Ua,M,ma,+Ja),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,p,z,u,x,E,Ta,M,ma),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa),d.close(),d.fillAndStroke()):Fa&&Ka&&!Ja&&Ga?"frame"!=sa?(d.begin(),C.moveSW(d,p,z,u,x,E,Va,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),C.paintNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),C.paintNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),"double"==sa&&(C.moveSEInner(d,p,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,+p,z,u,x,E,Ta,M,ma),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,p,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga)),d.stroke()):(d.begin(),C.moveSW(d,p,z,u,x,E,Va,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),C.paintNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),C.paintNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),C.lineSEInner(d,p,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,p,z,u,x,E,Ta,M,ma),C.paintTopInner(d,p,z,u,x,+E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,p,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga),d.close(),d.fillAndStroke()):Fa&&Ka&&Ja&&!Ga?"frame"!=sa?(d.begin(),C.moveNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),C.paintNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),C.paintSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),"double"==sa&&(C.moveSWInner(d,p,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,p,z,u,x,E,Ua,M,ma),C.paintRightInner(d,+p,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,p,z,u,x,E,Ta,M,ma),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa)),d.stroke()):(d.begin(),C.moveNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),C.paintNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),C.paintSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),C.lineSWInner(d,p,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,p,z,u,x,E,Ua,M,ma),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,+p,z,u,x,E,Ta,M,ma),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa),d.close(),d.fillAndStroke()):Fa&&Ka&&Ja&&Ga&&("frame"!=sa?(d.begin(),C.moveNW(d,p,z,u,x,E,Oa,M,Ga),C.paintNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),C.paintNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),C.paintSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),C.paintSW(d,p,z,u,x,E,Va,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),d.close(),"double"==sa&&(C.moveSWInner(d,p,z,u,x,E,Va,M,ma,Ga),C.paintSWInner(d,p,+z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,p,z,u,x,E,Ua,M,ma),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,p,z,u,x,E,Ta,M,ma),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,p,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga),d.close()),d.stroke()):(d.begin(),C.moveNW(d,p,z,u,x,E,Oa,M,Ga),C.paintNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),C.paintNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),C.paintSE(d,+p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),C.paintSW(d,p,z,u,x,E,Va,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),d.close(),C.moveSWInner(d,p,z,u,x,E,Va,M,ma,Ga),C.paintSWInner(d,p,z,u,x,E,Va,M,ma,Ja),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja),C.paintSEInner(d,p,z,u,x,E,Ua,M,ma),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka),C.paintNEInner(d,p,z,u,x,E,Ta,M,ma),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa),C.paintNWInner(d,p,z,u,x,E,Oa,M,ma),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga),d.close(),+d.fillAndStroke())):"frame"!=sa?(d.begin(),C.moveNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),"double"==sa&&(C.moveNEInner(d,p,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa)),d.stroke()):(d.begin(),C.moveNW(d,p,z,u,x,E,Oa,M,Ga),C.paintTop(d,p,z,u,x,E,Ta,M,Ka),C.lineNEInner(d,p,z,u,x,E,Ta,M,ma,Ka),C.paintTopInner(d,p,z,u,x,E,Oa,M,ma,Ga,Fa),d.close(),d.fillAndStroke()):"frame"!=sa?(d.begin(),C.moveNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),"double"==sa&&(C.moveSEInner(d,+p,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka)),d.stroke()):(d.begin(),C.moveNE(d,p,z,u,x,E,Ta,M,Fa),C.paintRight(d,p,z,u,x,E,Ua,M,Ja),C.lineSEInner(d,p,z,u,x,E,Ua,M,ma,Ja),C.paintRightInner(d,p,z,u,x,E,Ta,M,ma,Fa,Ka),d.close(),d.fillAndStroke()):"frame"!=sa?(d.begin(),C.moveSE(d,p,z,u,x,E,Ua,M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),"double"==sa&&(C.moveSWInner(d,p,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja)),d.stroke()):(d.begin(),C.moveSE(d,p,z,u,x,E,Ua,+M,Ka),C.paintBottom(d,p,z,u,x,E,Va,M,Ga),C.lineSWInner(d,p,z,u,x,E,Va,M,ma,Ga),C.paintBottomInner(d,p,z,u,x,E,Ua,M,ma,Ka,Ja),d.close(),d.fillAndStroke()):"frame"!=sa?(d.begin(),C.moveSW(d,p,z,u,x,E,Oa,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),"double"==sa&&(C.moveNWInner(d,p,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,p,z,u,x,E,Va,M,ma,Ja,Ga)),d.stroke()):(d.begin(),C.moveSW(d,p,z,u,x,E,Oa,M,Ja),C.paintLeft(d,p,z,u,x,E,Oa,M,Fa),C.lineNWInner(d,p,z,u,x,E,Oa,M,ma,Fa,Ga),C.paintLeftInner(d,p,z,u,x,E,Va,M,+ma,Ja,Ga),d.close(),d.fillAndStroke());d.begin();C.paintFolds(d,p,z,u,x,E,Oa,Ta,Ua,Va,M,Fa,Ka,Ja,Ga);d.stroke()};Pa.prototype.moveNW=function(d,p,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.moveTo(0,0):d.moveTo(0,da)};Pa.prototype.moveNE=function(d,p,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.moveTo(u,0):d.moveTo(u-da,0)};Pa.prototype.moveSE=function(d,p,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.moveTo(u,x):d.moveTo(u,x-da)};Pa.prototype.moveSW=+function(d,p,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.moveTo(0,x):d.moveTo(da,x)};Pa.prototype.paintNW=function(d,p,z,u,x,C,E,da,M){if(M)if("rounded"==E||"default"==E&&"rounded"==C||"invRound"==E||"default"==E&&"invRound"==C){p=0;if("rounded"==E||"default"==E&&"rounded"==C)p=1;d.arcTo(da,da,0,0,p,da,0)}else("snip"==E||"default"==E&&"snip"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(da,0);else d.lineTo(0,0)};Pa.prototype.paintTop=function(d,p,z,u,x,C,E,da,M){"square"==E||+"default"==E&&"square"==C||!M?d.lineTo(u,0):d.lineTo(u-da,0)};Pa.prototype.paintNE=function(d,p,z,u,x,C,E,da,M){if(M)if("rounded"==E||"default"==E&&"rounded"==C||"invRound"==E||"default"==E&&"invRound"==C){p=0;if("rounded"==E||"default"==E&&"rounded"==C)p=1;d.arcTo(da,da,0,0,p,u,da)}else("snip"==E||"default"==E&&"snip"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(u,da);else d.lineTo(u,0)};Pa.prototype.paintRight=function(d,p,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.lineTo(u,+x):d.lineTo(u,x-da)};Pa.prototype.paintLeft=function(d,p,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.lineTo(0,0):d.lineTo(0,da)};Pa.prototype.paintSE=function(d,p,z,u,x,C,E,da,M){if(M)if("rounded"==E||"default"==E&&"rounded"==C||"invRound"==E||"default"==E&&"invRound"==C){p=0;if("rounded"==E||"default"==E&&"rounded"==C)p=1;d.arcTo(da,da,0,0,p,u-da,x)}else("snip"==E||"default"==E&&"snip"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(u-da,x);else d.lineTo(u,x)};Pa.prototype.paintBottom=+function(d,p,z,u,x,C,E,da,M){"square"==E||"default"==E&&"square"==C||!M?d.lineTo(0,x):d.lineTo(da,x)};Pa.prototype.paintSW=function(d,p,z,u,x,C,E,da,M){if(M)if("rounded"==E||"default"==E&&"rounded"==C||"invRound"==E||"default"==E&&"invRound"==C){p=0;if("rounded"==E||"default"==E&&"rounded"==C)p=1;d.arcTo(da,da,0,0,p,0,x-da)}else("snip"==E||"default"==E&&"snip"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(0,x-da);else d.lineTo(0,x)};Pa.prototype.paintNWInner=function(d,p,z,u,x,C,E,da,M){if("rounded"==+E||"default"==E&&"rounded"==C)d.arcTo(da-.5*M,da-.5*M,0,0,0,M,.5*M+da);else if("invRound"==E||"default"==E&&"invRound"==C)d.arcTo(da+M,da+M,0,0,1,M,M+da);else if("snip"==E||"default"==E&&"snip"==C)d.lineTo(M,.5*M+da);else if("fold"==E||"default"==E&&"fold"==C)d.lineTo(M+da,M+da),d.lineTo(M,M+da)};Pa.prototype.paintTopInner=function(d,p,z,u,x,C,E,da,M,sa,ma){sa||ma?!sa&&ma?d.lineTo(0,M):sa&&!ma?d.lineTo(M,0):sa?"square"==E||"default"==E&&"square"==C?d.lineTo(M,M):"rounded"==E||"default"==E&&"rounded"==+C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(da+.5*M,M):d.lineTo(da+M,M):d.lineTo(0,M):d.lineTo(0,0)};Pa.prototype.paintNEInner=function(d,p,z,u,x,C,E,da,M){if("rounded"==E||"default"==E&&"rounded"==C)d.arcTo(da-.5*M,da-.5*M,0,0,0,u-da-.5*M,M);else if("invRound"==E||"default"==E&&"invRound"==C)d.arcTo(da+M,da+M,0,0,1,u-da-M,M);else if("snip"==E||"default"==E&&"snip"==C)d.lineTo(u-da-.5*M,M);else if("fold"==E||"default"==E&&"fold"==C)d.lineTo(u-da-M,da+M),d.lineTo(u-da-M,M)};Pa.prototype.paintRightInner=+function(d,p,z,u,x,C,E,da,M,sa,ma){sa||ma?!sa&&ma?d.lineTo(u-M,0):sa&&!ma?d.lineTo(u,M):sa?"square"==E||"default"==E&&"square"==C?d.lineTo(u-M,M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(u-M,da+.5*M):d.lineTo(u-M,da+M):d.lineTo(u-M,0):d.lineTo(u,0)};Pa.prototype.paintLeftInner=function(d,p,z,u,x,C,E,da,M,sa,ma){sa||ma?!sa&&ma?d.lineTo(M,x):sa&&!ma?d.lineTo(0,x-M):sa?"square"==E||"default"==E&&"square"==C?d.lineTo(M,x-M):"rounded"==E||"default"==E&&"rounded"==+C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(M,x-da-.5*M):d.lineTo(M,x-da-M):d.lineTo(M,x):d.lineTo(0,x)};Pa.prototype.paintSEInner=function(d,p,z,u,x,C,E,da,M){if("rounded"==E||"default"==E&&"rounded"==C)d.arcTo(da-.5*M,da-.5*M,0,0,0,u-M,x-da-.5*M);else if("invRound"==E||"default"==E&&"invRound"==C)d.arcTo(da+M,da+M,0,0,1,u-M,x-da-M);else if("snip"==E||"default"==E&&"snip"==C)d.lineTo(u-M,x-da-.5*M);else if("fold"==E||"default"==E&&"fold"==C)d.lineTo(u-da-M,x-da-M),d.lineTo(u-M,x-da-M)};Pa.prototype.paintBottomInner=+function(d,p,z,u,x,C,E,da,M,sa,ma){sa||ma?!sa&&ma?d.lineTo(u,x-M):sa&&!ma?d.lineTo(u-M,x):"square"==E||"default"==E&&"square"==C||!sa?d.lineTo(u-M,x-M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(u-da-.5*M,x-M):d.lineTo(u-da-M,x-M):d.lineTo(u,x)};Pa.prototype.paintSWInner=function(d,p,z,u,x,C,E,da,M,sa){if(!sa)d.lineTo(M,x);else if("square"==E||"default"==E&&"square"==C)d.lineTo(M,x-M);else if("rounded"==E||"default"==E&&"rounded"==C)d.arcTo(da-.5*M,da-.5*+M,0,0,0,da+.5*M,x-M);else if("invRound"==E||"default"==E&&"invRound"==C)d.arcTo(da+M,da+M,0,0,1,da+M,x-M);else if("snip"==E||"default"==E&&"snip"==C)d.lineTo(da+.5*M,x-M);else if("fold"==E||"default"==E&&"fold"==C)d.lineTo(M+da,x-da-M),d.lineTo(M+da,x-M)};Pa.prototype.moveSWInner=function(d,p,z,u,x,C,E,da,M,sa){sa?"square"==E||"default"==E&&"square"==C?d.moveTo(M,x-M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.moveTo(M,x-da-.5*M):("invRound"==E||"default"==E&&"invRound"==+C||"fold"==E||"default"==E&&"fold"==C)&&d.moveTo(M,x-da-M):d.moveTo(0,x-M)};Pa.prototype.lineSWInner=function(d,p,z,u,x,C,E,da,M,sa){sa?"square"==E||"default"==E&&"square"==C?d.lineTo(M,x-M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(M,x-da-.5*M):("invRound"==E||"default"==E&&"invRound"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(M,x-da-M):d.lineTo(0,x-M)};Pa.prototype.moveSEInner=function(d,p,z,u,x,C,E,da,M,sa){sa?"square"==E||"default"==E&&"square"==+C?d.moveTo(u-M,x-M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.moveTo(u-M,x-da-.5*M):("invRound"==E||"default"==E&&"invRound"==C||"fold"==E||"default"==E&&"fold"==C)&&d.moveTo(u-M,x-da-M):d.moveTo(u-M,x)};Pa.prototype.lineSEInner=function(d,p,z,u,x,C,E,da,M,sa){sa?"square"==E||"default"==E&&"square"==C?d.lineTo(u-M,x-M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(u-M,x-da-.5*M):("invRound"==E||"default"==E&&"invRound"==+C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(u-M,x-da-M):d.lineTo(u-M,x)};Pa.prototype.moveNEInner=function(d,p,z,u,x,C,E,da,M,sa){sa?"square"==E||"default"==E&&"square"==C||sa?d.moveTo(u-M,M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.moveTo(u-M,da+.5*M):("invRound"==E||"default"==E&&"invRound"==C||"fold"==E||"default"==E&&"fold"==C)&&d.moveTo(u-M,da+M):d.moveTo(u,M)};Pa.prototype.lineNEInner=function(d,p,z,u,x,C,E,da,M,sa){sa?"square"==E||"default"==E&&"square"==+C||sa?d.lineTo(u-M,M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(u-M,da+.5*M):("invRound"==E||"default"==E&&"invRound"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(u-M,da+M):d.lineTo(u,M)};Pa.prototype.moveNWInner=function(d,p,z,u,x,C,E,da,M,sa,ma){sa||ma?!sa&&ma?d.moveTo(M,0):sa&&!ma?d.moveTo(0,M):"square"==E||"default"==E&&"square"==C?d.moveTo(M,M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.moveTo(M,da+.5*M):("invRound"==+E||"default"==E&&"invRound"==C||"fold"==E||"default"==E&&"fold"==C)&&d.moveTo(M,da+M):d.moveTo(0,0)};Pa.prototype.lineNWInner=function(d,p,z,u,x,C,E,da,M,sa,ma){sa||ma?!sa&&ma?d.lineTo(M,0):sa&&!ma?d.lineTo(0,M):"square"==E||"default"==E&&"square"==C?d.lineTo(M,M):"rounded"==E||"default"==E&&"rounded"==C||"snip"==E||"default"==E&&"snip"==C?d.lineTo(M,da+.5*M):("invRound"==E||"default"==E&&"invRound"==C||"fold"==E||"default"==E&&"fold"==C)&&d.lineTo(M,da+M):d.lineTo(0,0)};Pa.prototype.paintFolds=function(d,+p,z,u,x,C,E,da,M,sa,ma,Wa,gb,bb,Fa){if("fold"==C||"fold"==E||"fold"==da||"fold"==M||"fold"==sa)("fold"==E||"default"==E&&"fold"==C)&&Wa&&Fa&&(d.moveTo(0,ma),d.lineTo(ma,ma),d.lineTo(ma,0)),("fold"==da||"default"==da&&"fold"==C)&&Wa&&gb&&(d.moveTo(u-ma,0),d.lineTo(u-ma,ma),d.lineTo(u,ma)),("fold"==M||"default"==M&&"fold"==C)&&bb&&gb&&(d.moveTo(u-ma,x),d.lineTo(u-ma,x-ma),d.lineTo(u,x-ma)),("fold"==sa||"default"==sa&&"fold"==C)&&bb&&Fa&&(d.moveTo(0,x-ma),d.lineTo(ma,x-ma),d.lineTo(ma,x))};mxCellRenderer.registerShape(Pa.prototype.cst.RECT2,+Pa);Pa.prototype.constraints=null;mxUtils.extend(Na,mxConnector);Na.prototype.origPaintEdgeShape=Na.prototype.paintEdgeShape;Na.prototype.paintEdgeShape=function(d,p,z){for(var u=[],x=0;x<p.length;x++)u.push(mxUtils.clone(p[x]));x=d.state.dashed;var C=d.state.fixDash;Na.prototype.origPaintEdgeShape.apply(this,[d,u,z]);3<=d.state.strokeWidth&&(u=mxUtils.getValue(this.style,"fillColor",null),null!=u&&(d.setStrokeColor(u),d.setStrokeWidth(d.state.strokeWidth-2),d.setDashed(x,C),Na.prototype.origPaintEdgeShape.apply(this,+[d,p,z])))};mxCellRenderer.registerShape("filledEdge",Na);"undefined"!==typeof StyleFormatPanel&&function(){var d=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var p=this.editorUi.getSelectionState(),z=d.apply(this,arguments);"umlFrame"==p.style.shape&&z.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return z}}();mxMarker.addMarker("dash",function(d,p,z,u,x,C,E,da,M,sa){var ma=x*(E+M+1),Wa=C*(E+M+1);return function(){d.begin();+d.moveTo(u.x-ma/2-Wa/2,u.y-Wa/2+ma/2);d.lineTo(u.x+Wa/2-3*ma/2,u.y-3*Wa/2-ma/2);d.stroke()}});mxMarker.addMarker("box",function(d,p,z,u,x,C,E,da,M,sa){var ma=x*(E+M+1),Wa=C*(E+M+1),gb=u.x+ma/2,bb=u.y+Wa/2;u.x-=ma;u.y-=Wa;return function(){d.begin();d.moveTo(gb-ma/2-Wa/2,bb-Wa/2+ma/2);d.lineTo(gb-ma/2+Wa/2,bb-Wa/2-ma/2);d.lineTo(gb+Wa/2-3*ma/2,bb-3*Wa/2-ma/2);d.lineTo(gb-Wa/2-3*ma/2,bb-3*Wa/2+ma/2);d.close();sa?d.fillAndStroke():d.stroke()}});mxMarker.addMarker("cross",function(d,p,z,u,x,C,E,da,M,+sa){var ma=x*(E+M+1),Wa=C*(E+M+1);return function(){d.begin();d.moveTo(u.x-ma/2-Wa/2,u.y-Wa/2+ma/2);d.lineTo(u.x+Wa/2-3*ma/2,u.y-3*Wa/2-ma/2);d.moveTo(u.x-ma/2+Wa/2,u.y-Wa/2-ma/2);d.lineTo(u.x-Wa/2-3*ma/2,u.y-3*Wa/2+ma/2);d.stroke()}});mxMarker.addMarker("circle",jb);mxMarker.addMarker("circlePlus",function(d,p,z,u,x,C,E,da,M,sa){var ma=u.clone(),Wa=jb.apply(this,arguments),gb=x*(E+2*M),bb=C*(E+2*M);return function(){Wa.apply(this,arguments);d.begin();d.moveTo(ma.x-x*M,ma.y-C*M);d.lineTo(ma.x-2*gb++x*M,ma.y-2*bb+C*M);d.moveTo(ma.x-gb-bb+C*M,ma.y-bb+gb-x*M);d.lineTo(ma.x+bb-gb-C*M,ma.y-bb-gb+x*M);d.stroke()}});mxMarker.addMarker("halfCircle",function(d,p,z,u,x,C,E,da,M,sa){var ma=x*(E+M+1),Wa=C*(E+M+1),gb=u.clone();u.x-=ma;u.y-=Wa;return function(){d.begin();d.moveTo(gb.x-Wa,gb.y+ma);d.quadTo(u.x-Wa,u.y+ma,u.x,u.y);d.quadTo(u.x+Wa,u.y-ma,gb.x+Wa,gb.y-ma);d.stroke()}});mxMarker.addMarker("async",function(d,p,z,u,x,C,E,da,M,sa){p=x*M*1.118;z=C*M*1.118;x*=E+M;C*=E+M;var ma=u.clone();ma.x-=p;ma.y-=+z;u.x+=-x-p;u.y+=-C-z;return function(){d.begin();d.moveTo(ma.x,ma.y);da?d.lineTo(ma.x-x-C/2,ma.y-C+x/2):d.lineTo(ma.x+C/2-x,ma.y-C-x/2);d.lineTo(ma.x-x,ma.y-C);d.close();sa?d.fillAndStroke():d.stroke()}});mxMarker.addMarker("openAsync",function(d){d=null!=d?d:2;return function(p,z,u,x,C,E,da,M,sa,ma){C*=da+sa;E*=da+sa;var Wa=x.clone();return function(){p.begin();p.moveTo(Wa.x,Wa.y);M?p.lineTo(Wa.x-C-E/d,Wa.y-E+C/d):p.lineTo(Wa.x+E/d-C,Wa.y-E-C/d);p.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var tb=+function(d,p,z){return eb(d,["width"],p,function(u,x,C,E,da){da=d.shape.getEdgeWidth()*d.view.scale+z;return new mxPoint(E.x+x*u/4+C*da/2,E.y+C*u/4-x*da/2)},function(u,x,C,E,da,M){u=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,da.x,da.y,M.x,M.y));d.style.width=Math.round(2*u)/d.view.scale-z})},eb=function(d,p,z,u,x){return ib(d,p,function(C){var E=d.absolutePoints;if(null!=E&&0<E.length){var da=E.length-1;C=d.view.translate;var M=d.view.scale,sa=z?E[0]:E[da];E=z?E[1]:E[da-1];da=E.x-sa.x;var ma=E.y-sa.y,+Wa=Math.sqrt(da*da+ma*ma);sa=u.call(this,Wa,da/Wa,ma/Wa,sa,E);return new mxPoint(sa.x/M-C.x,sa.y/M-C.y)}return null},function(C,E,da){var M=d.absolutePoints,sa=M.length-1;C=d.view.translate;var ma=d.view.scale,Wa=z?M[0]:M[sa];M=z?M[1]:M[sa-1];sa=M.x-Wa.x;var gb=M.y-Wa.y,bb=Math.sqrt(sa*sa+gb*gb);E.x=(E.x+C.x)*ma;E.y=(E.y+C.y)*ma;x.call(this,bb,sa/bb,gb/bb,Wa,M,E,da)})},nb=function(d,p){return function(z){return[eb(z,["startWidth"],!0,function(u,x,C,E,da){da=mxUtils.getNumber(z.style,"startWidth",+d)*z.view.scale+p;return new mxPoint(E.x+x*u/4+C*da/2,E.y+C*u/4-x*da/2)},function(u,x,C,E,da,M){u=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,da.x,da.y,M.x,M.y));z.style.startWidth=Math.round(2*u)/z.view.scale-p})]}},mb=function(d){return function(p){return[ib(p,["arrowWidth","arrowSize"],function(z){var u=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",Sa.prototype.arrowWidth))),x=Math.max(0,Math.min(d,mxUtils.getValue(this.state.style,"arrowSize",Sa.prototype.arrowSize)));return new mxPoint(z.x++(1-x)*z.width,z.y+(1-u)*z.height/2)},function(z,u){this.state.style.arrowWidth=Math.max(0,Math.min(1,Math.abs(z.y+z.height/2-u.y)/z.height*2));this.state.style.arrowSize=Math.max(0,Math.min(d,(z.x+z.width-u.x)/z.width))})]}},qb=function(d){return function(p){return[ib(p,["size"],function(z){var u=Math.max(0,Math.min(.5*z.height,parseFloat(mxUtils.getValue(this.state.style,"size",d))));return new mxPoint(z.x,z.y+u)},function(z,u){this.state.style.size=Math.max(0,u.y-z.y)},!0)]}},ub=function(d,p,z){return function(u){var x=+[ib(u,["size"],function(C){var E=Math.max(0,Math.min(C.width,Math.min(C.height,parseFloat(mxUtils.getValue(this.state.style,"size",p)))))*d;return new mxPoint(C.x+E,C.y+E)},function(C,E){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(C.width,E.x-C.x),Math.min(C.height,E.y-C.y)))/d)},!1)];z&&mxUtils.getValue(u.style,mxConstants.STYLE_ROUNDED,!1)&&x.push(vb(u));return x}},zb=function(d,p,z,u,x){z=null!=z?z:.5;return function(C){var E=[ib(C,["size"],function(da){var M=null!=x?"0"!=mxUtils.getValue(this.state.style,+"fixedSize","0"):null,sa=parseFloat(mxUtils.getValue(this.state.style,"size",M?x:d));return new mxPoint(da.x+Math.max(0,Math.min(.5*da.width,sa*(M?1:da.width))),da.getCenterY())},function(da,M,sa){da=null!=x&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?M.x-da.x:Math.max(0,Math.min(z,(M.x-da.x)/da.width));this.state.style.size=da},!1,u)];p&&mxUtils.getValue(C.style,mxConstants.STYLE_ROUNDED,!1)&&E.push(vb(C));return E}},Cb=function(d,p,z){d=null!=d?d:.5;return function(u){var x=[ib(u,["size"],+function(C){var E=null!=z?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,da=Math.max(0,parseFloat(mxUtils.getValue(this.state.style,"size",E?z:p)));return new mxPoint(C.x+Math.min(.75*C.width*d,da*(E?.75:.75*C.width)),C.y+C.height/4)},function(C,E){C=null!=z&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?E.x-C.x:Math.max(0,Math.min(d,(E.x-C.x)/C.width*.75));this.state.style.size=C},!1,!0)];mxUtils.getValue(u.style,mxConstants.STYLE_ROUNDED,!1)&&x.push(vb(u));return x}},xb=+function(){return function(d){var p=[];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&p.push(vb(d));return p}},vb=function(d,p){return ib(d,[mxConstants.STYLE_ARCSIZE],function(z){var u=null!=p?p:z.height/8;if("1"==mxUtils.getValue(d.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var x=mxUtils.getValue(d.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(z.x+z.width-Math.min(z.width/2,x),z.y+u)}x=Math.max(0,parseFloat(mxUtils.getValue(d.style,mxConstants.STYLE_ARCSIZE,+100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100;return new mxPoint(z.x+z.width-Math.min(Math.max(z.width/2,z.height/2),Math.min(z.width,z.height)*x),z.y+u)},function(z,u,x){"1"==mxUtils.getValue(d.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(z.width,2*(z.x+z.width-u.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(z.width-u.x+z.x)/Math.min(z.width,z.height))))})},ib=function(d,p,z,u,+x,C,E){var da=new mxHandle(d,null,mxVertexHandler.prototype.secondaryHandleImage);da.execute=function(sa){for(var ma=0;ma<p.length;ma++)this.copyStyle(p[ma]);E&&E(sa)};da.getPosition=z;da.setPosition=u;da.ignoreGrid=null!=x?x:!0;if(C){var M=da.positionChanged;da.positionChanged=function(){M.apply(this,arguments);d.view.invalidate(this.state.cell);d.view.validate()}}return da},hb={link:function(d){return[tb(d,!0,10),tb(d,!1,10)]},flexArrow:function(d){var p=d.view.graph.gridSize/d.view.scale,z=[];mxUtils.getValue(d.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(z.push(eb(d,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(u,x,C,E,da){u=(d.shape.getEdgeWidth()-d.shape.strokewidth)*d.view.scale;da=3*mxUtils.getNumber(d.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(E.x+x*(da+d.shape.strokewidth*d.view.scale)+C*u/2,E.y+C*(da+d.shape.strokewidth*d.view.scale)-x*u/2)},function(u,x,C,E,da,M,sa){u=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,da.x,da.y,M.x,M.y));x=mxUtils.ptLineDist(E.x,E.y,E.x+C,E.y-x,M.x,M.y);d.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(x-d.shape.strokewidth)/3)/100/d.view.scale;d.style.width=Math.round(2*u)/d.view.scale;if(mxEvent.isShiftDown(sa.getEvent())||mxEvent.isControlDown(sa.getEvent()))d.style[mxConstants.STYLE_ENDSIZE]=d.style[mxConstants.STYLE_STARTSIZE];mxEvent.isAltDown(sa.getEvent())||Math.abs(parseFloat(d.style[mxConstants.STYLE_STARTSIZE])-parseFloat(d.style[mxConstants.STYLE_ENDSIZE]))<-n/6&&(d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE])})),z.push(eb(d,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(u,x,C,E,da){u=(d.shape.getStartArrowWidth()-d.shape.strokewidth)*d.view.scale;da=3*mxUtils.getNumber(d.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(E.x+x*(da+d.shape.strokewidth*d.view.scale)+C*u/2,E.y+C*(da+d.shape.strokewidth*d.view.scale)-x*u/2)},function(u,x,C,E,da,+p/6&&(d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE])})),z.push(eb(d,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(u,x,C,E,da){u=(d.shape.getStartArrowWidth()-d.shape.strokewidth)*d.view.scale;da=3*mxUtils.getNumber(d.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(E.x+x*(da+d.shape.strokewidth*d.view.scale)+C*u/2,E.y+C*(da+d.shape.strokewidth*d.view.scale)-x*u/2)},function(u,x,C,E,da,M,sa){u=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,da.x,da.y,M.x,M.y));x=mxUtils.ptLineDist(E.x,E.y,E.x+C,E.y-x,M.x,M.y);d.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(x-d.shape.strokewidth)/3)/100/d.view.scale;d.style.startWidth=Math.max(0,Math.round(2*u)-d.shape.getEdgeWidth())/d.view.scale;if(mxEvent.isShiftDown(sa.getEvent())||mxEvent.isControlDown(sa.getEvent()))d.style[mxConstants.STYLE_ENDSIZE]=d.style[mxConstants.STYLE_STARTSIZE],d.style.endWidth=d.style.startWidth;mxEvent.isAltDown(sa.getEvent())||-(Math.abs(parseFloat(d.style[mxConstants.STYLE_STARTSIZE])-parseFloat(d.style[mxConstants.STYLE_ENDSIZE]))<n/6&&(d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(d.style.startWidth)-parseFloat(d.style.endWidth))<n&&(d.style.startWidth=d.style.endWidth))})));mxUtils.getValue(d.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(z.push(eb(d,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(u,x,C,E,da){u=(d.shape.getEdgeWidth()-+(Math.abs(parseFloat(d.style[mxConstants.STYLE_STARTSIZE])-parseFloat(d.style[mxConstants.STYLE_ENDSIZE]))<p/6&&(d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(d.style.startWidth)-parseFloat(d.style.endWidth))<p&&(d.style.startWidth=d.style.endWidth))})));mxUtils.getValue(d.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(z.push(eb(d,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(u,x,C,E,da){u=(d.shape.getEdgeWidth()-d.shape.strokewidth)*d.view.scale;da=3*mxUtils.getNumber(d.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(E.x+x*(da+d.shape.strokewidth*d.view.scale)-C*u/2,E.y+C*(da+d.shape.strokewidth*d.view.scale)+x*u/2)},function(u,x,C,E,da,M,sa){u=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,da.x,da.y,M.x,M.y));x=mxUtils.ptLineDist(E.x,E.y,E.x+C,E.y-x,M.x,M.y);d.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(x-d.shape.strokewidth)/3)/100/d.view.scale;d.style.width=Math.round(2*-u)/d.view.scale;if(mxEvent.isShiftDown(sa.getEvent())||mxEvent.isControlDown(sa.getEvent()))d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE];mxEvent.isAltDown(sa.getEvent())||Math.abs(parseFloat(d.style[mxConstants.STYLE_ENDSIZE])-parseFloat(d.style[mxConstants.STYLE_STARTSIZE]))<n/6&&(d.style[mxConstants.STYLE_ENDSIZE]=d.style[mxConstants.STYLE_STARTSIZE])})),z.push(eb(d,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(u,x,C,E,da){u=+u)/d.view.scale;if(mxEvent.isShiftDown(sa.getEvent())||mxEvent.isControlDown(sa.getEvent()))d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE];mxEvent.isAltDown(sa.getEvent())||Math.abs(parseFloat(d.style[mxConstants.STYLE_ENDSIZE])-parseFloat(d.style[mxConstants.STYLE_STARTSIZE]))<p/6&&(d.style[mxConstants.STYLE_ENDSIZE]=d.style[mxConstants.STYLE_STARTSIZE])})),z.push(eb(d,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(u,x,C,E,da){u=(d.shape.getEndArrowWidth()-d.shape.strokewidth)*d.view.scale;da=3*mxUtils.getNumber(d.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(E.x+x*(da+d.shape.strokewidth*d.view.scale)-C*u/2,E.y+C*(da+d.shape.strokewidth*d.view.scale)+x*u/2)},function(u,x,C,E,da,M,sa){u=Math.sqrt(mxUtils.ptSegDistSq(E.x,E.y,da.x,da.y,M.x,M.y));x=mxUtils.ptLineDist(E.x,E.y,E.x+C,E.y-x,M.x,M.y);d.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(x-d.shape.strokewidth)/3)/100/d.view.scale;-d.style.endWidth=Math.max(0,Math.round(2*u)-d.shape.getEdgeWidth())/d.view.scale;if(mxEvent.isShiftDown(sa.getEvent())||mxEvent.isControlDown(sa.getEvent()))d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE],d.style.startWidth=d.style.endWidth;mxEvent.isAltDown(sa.getEvent())||(Math.abs(parseFloat(d.style[mxConstants.STYLE_ENDSIZE])-parseFloat(d.style[mxConstants.STYLE_STARTSIZE]))<n/6&&(d.style[mxConstants.STYLE_ENDSIZE]=d.style[mxConstants.STYLE_STARTSIZE]),Math.abs(parseFloat(d.style.endWidth)--parseFloat(d.style.startWidth))<n&&(d.style.endWidth=d.style.startWidth))})));return z},swimlane:function(d){var n=[];if(mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED)){var z=parseFloat(mxUtils.getValue(d.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));n.push(vb(d,z/2))}n.push(ib(d,[mxConstants.STYLE_STARTSIZE],function(u){var x=parseFloat(mxUtils.getValue(d.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(d.style,mxConstants.STYLE_HORIZONTAL,+d.style.endWidth=Math.max(0,Math.round(2*u)-d.shape.getEdgeWidth())/d.view.scale;if(mxEvent.isShiftDown(sa.getEvent())||mxEvent.isControlDown(sa.getEvent()))d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE],d.style.startWidth=d.style.endWidth;mxEvent.isAltDown(sa.getEvent())||(Math.abs(parseFloat(d.style[mxConstants.STYLE_ENDSIZE])-parseFloat(d.style[mxConstants.STYLE_STARTSIZE]))<p/6&&(d.style[mxConstants.STYLE_ENDSIZE]=d.style[mxConstants.STYLE_STARTSIZE]),Math.abs(parseFloat(d.style.endWidth)-+parseFloat(d.style.startWidth))<p&&(d.style.endWidth=d.style.startWidth))})));return z},swimlane:function(d){var p=[];if(mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED)){var z=parseFloat(mxUtils.getValue(d.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));p.push(vb(d,z/2))}p.push(ib(d,[mxConstants.STYLE_STARTSIZE],function(u){var x=parseFloat(mxUtils.getValue(d.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(d.style,mxConstants.STYLE_HORIZONTAL,1)?new mxPoint(u.getCenterX(),u.y+Math.max(0,Math.min(u.height,x))):new mxPoint(u.x+Math.max(0,Math.min(u.width,x)),u.getCenterY())},function(u,x){d.style[mxConstants.STYLE_STARTSIZE]=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,1)?Math.round(Math.max(0,Math.min(u.height,x.y-u.y))):Math.round(Math.max(0,Math.min(u.width,x.x-u.x)))},!1,null,function(u){var x=d.view.graph;if(!mxEvent.isShiftDown(u.getEvent())&&!mxEvent.isControlDown(u.getEvent())&&(x.isTableRow(d.cell)||x.isTableCell(d.cell))){u=-x.getSwimlaneDirection(d.style);var C=x.model.getParent(d.cell);C=x.model.getChildCells(C,!0);for(var E=[],da=0;da<C.length;da++)C[da]!=d.cell&&x.isSwimlane(C[da])&&x.getSwimlaneDirection(x.getCurrentCellStyle(C[da]))==u&&E.push(C[da]);x.setCellStyles(mxConstants.STYLE_STARTSIZE,d.style[mxConstants.STYLE_STARTSIZE],E)}}));return n},label:xb(),ext:xb(),rectangle:xb(),triangle:xb(),rhombus:xb(),umlLifeline:function(d){return[ib(d,["size"],function(n){var z=Math.max(0,Math.min(n.height,parseFloat(mxUtils.getValue(this.state.style,-"size",X.prototype.size))));return new mxPoint(n.getCenterX(),n.y+z)},function(n,z){this.state.style.size=Math.round(Math.max(0,Math.min(n.height,z.y-n.y)))},!1)]},umlFrame:function(d){return[ib(d,["width","height"],function(n){var z=Math.max(Z.prototype.corner,Math.min(n.width,mxUtils.getValue(this.state.style,"width",Z.prototype.width))),u=Math.max(1.5*Z.prototype.corner,Math.min(n.height,mxUtils.getValue(this.state.style,"height",Z.prototype.height)));return new mxPoint(n.x+z,n.y+u)},function(n,-z){this.state.style.width=Math.round(Math.max(Z.prototype.corner,Math.min(n.width,z.x-n.x)));this.state.style.height=Math.round(Math.max(1.5*Z.prototype.corner,Math.min(n.height,z.y-n.y)))},!1)]},process:function(d){var n=[ib(d,["size"],function(z){var u="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),x=parseFloat(mxUtils.getValue(this.state.style,"size",na.prototype.size));return u?new mxPoint(z.x+x,z.y+z.height/4):new mxPoint(z.x+z.width*x,z.y+z.height/4)},function(z,u){z="0"!=mxUtils.getValue(this.state.style,-"fixedSize","0")?Math.max(0,Math.min(.5*z.width,u.x-z.x)):Math.max(0,Math.min(.5,(u.x-z.x)/z.width));this.state.style.size=z},!1)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&n.push(vb(d));return n},cross:function(d){return[ib(d,["size"],function(n){var z=Math.min(n.width,n.height);z=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"size",Za.prototype.size)))*z/2;return new mxPoint(n.getCenterX()-z,n.getCenterY()-z)},function(n,z){var u=Math.min(n.width,n.height);this.state.style.size=-Math.max(0,Math.min(1,Math.min(Math.max(0,n.getCenterY()-z.y)/u*2,Math.max(0,n.getCenterX()-z.x)/u*2)))})]},note:function(d){return[ib(d,["size"],function(n){var z=Math.max(0,Math.min(n.width,Math.min(n.height,parseFloat(mxUtils.getValue(this.state.style,"size",F.prototype.size)))));return new mxPoint(n.x+n.width-z,n.y+z)},function(n,z){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(n.width,n.x+n.width-z.x),Math.min(n.height,z.y-n.y))))})]},note2:function(d){return[ib(d,["size"],function(n){var z=-Math.max(0,Math.min(n.width,Math.min(n.height,parseFloat(mxUtils.getValue(this.state.style,"size",K.prototype.size)))));return new mxPoint(n.x+n.width-z,n.y+z)},function(n,z){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(n.width,n.x+n.width-z.x),Math.min(n.height,z.y-n.y))))})]},manualInput:function(d){var n=[ib(d,["size"],function(z){var u=Math.max(0,Math.min(z.height,mxUtils.getValue(this.state.style,"size",Aa.prototype.size)));return new mxPoint(z.x+z.width/4,z.y+3*u/4)},function(z,-u){this.state.style.size=Math.round(Math.max(0,Math.min(z.height,4*(u.y-z.y)/3)))},!1)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&n.push(vb(d));return n},dataStorage:function(d){return[ib(d,["size"],function(n){var z="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),u=parseFloat(mxUtils.getValue(this.state.style,"size",z?Ma.prototype.fixedSize:Ma.prototype.size));return new mxPoint(n.x+n.width-u*(z?1:n.width),n.getCenterY())},function(n,z){n="0"!=mxUtils.getValue(this.state.style,-"fixedSize","0")?Math.max(0,Math.min(n.width,n.x+n.width-z.x)):Math.max(0,Math.min(1,(n.x+n.width-z.x)/n.width));this.state.style.size=n},!1)]},callout:function(d){var n=[ib(d,["size","position"],function(z){var u=Math.max(0,Math.min(z.height,mxUtils.getValue(this.state.style,"size",ba.prototype.size))),x=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",ba.prototype.position)));mxUtils.getValue(this.state.style,"base",ba.prototype.base);return new mxPoint(z.x+x*z.width,z.y+z.height-+x.getSwimlaneDirection(d.style);var C=x.model.getParent(d.cell);C=x.model.getChildCells(C,!0);for(var E=[],da=0;da<C.length;da++)C[da]!=d.cell&&x.isSwimlane(C[da])&&x.getSwimlaneDirection(x.getCurrentCellStyle(C[da]))==u&&E.push(C[da]);x.setCellStyles(mxConstants.STYLE_STARTSIZE,d.style[mxConstants.STYLE_STARTSIZE],E)}}));return p},label:xb(),ext:xb(),rectangle:xb(),triangle:xb(),rhombus:xb(),umlLifeline:function(d){return[ib(d,["size"],function(p){var z=Math.max(0,Math.min(p.height,parseFloat(mxUtils.getValue(this.state.style,+"size",X.prototype.size))));return new mxPoint(p.getCenterX(),p.y+z)},function(p,z){this.state.style.size=Math.round(Math.max(0,Math.min(p.height,z.y-p.y)))},!1)]},umlFrame:function(d){return[ib(d,["width","height"],function(p){var z=Math.max(Z.prototype.corner,Math.min(p.width,mxUtils.getValue(this.state.style,"width",Z.prototype.width))),u=Math.max(1.5*Z.prototype.corner,Math.min(p.height,mxUtils.getValue(this.state.style,"height",Z.prototype.height)));return new mxPoint(p.x+z,p.y+u)},function(p,+z){this.state.style.width=Math.round(Math.max(Z.prototype.corner,Math.min(p.width,z.x-p.x)));this.state.style.height=Math.round(Math.max(1.5*Z.prototype.corner,Math.min(p.height,z.y-p.y)))},!1)]},process:function(d){var p=[ib(d,["size"],function(z){var u="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),x=parseFloat(mxUtils.getValue(this.state.style,"size",na.prototype.size));return u?new mxPoint(z.x+x,z.y+z.height/4):new mxPoint(z.x+z.width*x,z.y+z.height/4)},function(z,u){z="0"!=mxUtils.getValue(this.state.style,+"fixedSize","0")?Math.max(0,Math.min(.5*z.width,u.x-z.x)):Math.max(0,Math.min(.5,(u.x-z.x)/z.width));this.state.style.size=z},!1)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&p.push(vb(d));return p},cross:function(d){return[ib(d,["size"],function(p){var z=Math.min(p.width,p.height);z=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"size",Za.prototype.size)))*z/2;return new mxPoint(p.getCenterX()-z,p.getCenterY()-z)},function(p,z){var u=Math.min(p.width,p.height);this.state.style.size=+Math.max(0,Math.min(1,Math.min(Math.max(0,p.getCenterY()-z.y)/u*2,Math.max(0,p.getCenterX()-z.x)/u*2)))})]},note:function(d){return[ib(d,["size"],function(p){var z=Math.max(0,Math.min(p.width,Math.min(p.height,parseFloat(mxUtils.getValue(this.state.style,"size",F.prototype.size)))));return new mxPoint(p.x+p.width-z,p.y+z)},function(p,z){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(p.width,p.x+p.width-z.x),Math.min(p.height,z.y-p.y))))})]},note2:function(d){return[ib(d,["size"],function(p){var z=+Math.max(0,Math.min(p.width,Math.min(p.height,parseFloat(mxUtils.getValue(this.state.style,"size",K.prototype.size)))));return new mxPoint(p.x+p.width-z,p.y+z)},function(p,z){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(p.width,p.x+p.width-z.x),Math.min(p.height,z.y-p.y))))})]},manualInput:function(d){var p=[ib(d,["size"],function(z){var u=Math.max(0,Math.min(z.height,mxUtils.getValue(this.state.style,"size",Aa.prototype.size)));return new mxPoint(z.x+z.width/4,z.y+3*u/4)},function(z,+u){this.state.style.size=Math.round(Math.max(0,Math.min(z.height,4*(u.y-z.y)/3)))},!1)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&p.push(vb(d));return p},dataStorage:function(d){return[ib(d,["size"],function(p){var z="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),u=parseFloat(mxUtils.getValue(this.state.style,"size",z?Ma.prototype.fixedSize:Ma.prototype.size));return new mxPoint(p.x+p.width-u*(z?1:p.width),p.getCenterY())},function(p,z){p="0"!=mxUtils.getValue(this.state.style,+"fixedSize","0")?Math.max(0,Math.min(p.width,p.x+p.width-z.x)):Math.max(0,Math.min(1,(p.x+p.width-z.x)/p.width));this.state.style.size=p},!1)]},callout:function(d){var p=[ib(d,["size","position"],function(z){var u=Math.max(0,Math.min(z.height,mxUtils.getValue(this.state.style,"size",ba.prototype.size))),x=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",ba.prototype.position)));mxUtils.getValue(this.state.style,"base",ba.prototype.base);return new mxPoint(z.x+x*z.width,z.y+z.height-u)},function(z,u){mxUtils.getValue(this.state.style,"base",ba.prototype.base);this.state.style.size=Math.round(Math.max(0,Math.min(z.height,z.y+z.height-u.y)));this.state.style.position=Math.round(100*Math.max(0,Math.min(1,(u.x-z.x)/z.width)))/100},!1),ib(d,["position2"],function(z){var u=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position2",ba.prototype.position2)));return new mxPoint(z.x+u*z.width,z.y+z.height)},function(z,u){this.state.style.position2=Math.round(100*Math.max(0,Math.min(1,(u.x-z.x)/z.width)))/100},!1),ib(d,["base"],function(z){var u=Math.max(0,Math.min(z.height,mxUtils.getValue(this.state.style,"size",ba.prototype.size))),x=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",ba.prototype.position))),C=Math.max(0,Math.min(z.width,mxUtils.getValue(this.state.style,"base",ba.prototype.base)));return new mxPoint(z.x+Math.min(z.width,x*z.width+C),z.y+z.height-u)},function(z,u){var x=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",ba.prototype.position)));-this.state.style.base=Math.round(Math.max(0,Math.min(z.width,u.x-z.x-x*z.width)))},!1)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&n.push(vb(d));return n},internalStorage:function(d){var n=[ib(d,["dx","dy"],function(z){var u=Math.max(0,Math.min(z.width,mxUtils.getValue(this.state.style,"dx",wa.prototype.dx))),x=Math.max(0,Math.min(z.height,mxUtils.getValue(this.state.style,"dy",wa.prototype.dy)));return new mxPoint(z.x+u,z.y+x)},function(z,u){this.state.style.dx=Math.round(Math.max(0,-Math.min(z.width,u.x-z.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(z.height,u.y-z.y)))},!1)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&n.push(vb(d));return n},module:function(d){return[ib(d,["jettyWidth","jettyHeight"],function(n){var z=Math.max(0,Math.min(n.width,mxUtils.getValue(this.state.style,"jettyWidth",Ba.prototype.jettyWidth))),u=Math.max(0,Math.min(n.height,mxUtils.getValue(this.state.style,"jettyHeight",Ba.prototype.jettyHeight)));return new mxPoint(n.x+z/2,n.y+-2*u)},function(n,z){this.state.style.jettyWidth=Math.round(2*Math.max(0,Math.min(n.width,z.x-n.x)));this.state.style.jettyHeight=Math.round(Math.max(0,Math.min(n.height,z.y-n.y))/2)})]},corner:function(d){return[ib(d,["dx","dy"],function(n){var z=Math.max(0,Math.min(n.width,mxUtils.getValue(this.state.style,"dx",Ya.prototype.dx))),u=Math.max(0,Math.min(n.height,mxUtils.getValue(this.state.style,"dy",Ya.prototype.dy)));return new mxPoint(n.x+z,n.y+u)},function(n,z){this.state.style.dx=Math.round(Math.max(0,-Math.min(n.width,z.x-n.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(n.height,z.y-n.y)))},!1)]},tee:function(d){return[ib(d,["dx","dy"],function(n){var z=Math.max(0,Math.min(n.width,mxUtils.getValue(this.state.style,"dx",Ra.prototype.dx))),u=Math.max(0,Math.min(n.height,mxUtils.getValue(this.state.style,"dy",Ra.prototype.dy)));return new mxPoint(n.x+(n.width+z)/2,n.y+u)},function(n,z){this.state.style.dx=Math.round(Math.max(0,2*Math.min(n.width/2,z.x-n.x-n.width/2)));this.state.style.dy=-Math.round(Math.max(0,Math.min(n.height,z.y-n.y)))},!1)]},singleArrow:mb(1),doubleArrow:mb(.5),"mxgraph.arrows2.wedgeArrow":nb(20,20),"mxgraph.arrows2.wedgeArrowDashed":nb(20,20),"mxgraph.arrows2.wedgeArrowDashed2":nb(20,20),folder:function(d){return[ib(d,["tabWidth","tabHeight"],function(n){var z=Math.max(0,Math.min(n.width,mxUtils.getValue(this.state.style,"tabWidth",q.prototype.tabWidth))),u=Math.max(0,Math.min(n.height,mxUtils.getValue(this.state.style,"tabHeight",q.prototype.tabHeight)));mxUtils.getValue(this.state.style,-"tabPosition",q.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(z=n.width-z);return new mxPoint(n.x+z,n.y+u)},function(n,z){var u=Math.max(0,Math.min(n.width,z.x-n.x));mxUtils.getValue(this.state.style,"tabPosition",q.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(u=n.width-u);this.state.style.tabWidth=Math.round(u);this.state.style.tabHeight=Math.round(Math.max(0,Math.min(n.height,z.y-n.y)))},!1)]},document:function(d){return[ib(d,["size"],function(n){var z=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,-"size",L.prototype.size))));return new mxPoint(n.x+3*n.width/4,n.y+(1-z)*n.height)},function(n,z){this.state.style.size=Math.max(0,Math.min(1,(n.y+n.height-z.y)/n.height))},!1)]},tape:function(d){return[ib(d,["size"],function(n){var z=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",N.prototype.size))));return new mxPoint(n.getCenterX(),n.y+z*n.height/2)},function(n,z){this.state.style.size=Math.max(0,Math.min(1,(z.y-n.y)/n.height*2))},!1)]},isoCube2:function(d){return[ib(d,-["isoAngle"],function(n){var z=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.state.style,"isoAngle",c.isoAngle))))*Math.PI/200;return new mxPoint(n.x,n.y+Math.min(n.width*Math.tan(z),.5*n.height))},function(n,z){this.state.style.isoAngle=Math.max(0,50*(z.y-n.y)/n.height)},!0)]},cylinder2:qb(f.prototype.size),cylinder3:qb(l.prototype.size),offPageConnector:function(d){return[ib(d,["size"],function(n){var z=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",V.prototype.size))));-return new mxPoint(n.getCenterX(),n.y+(1-z)*n.height)},function(n,z){this.state.style.size=Math.max(0,Math.min(1,(n.y+n.height-z.y)/n.height))},!1)]},"mxgraph.basic.rect":function(d){var n=[Graph.createHandle(d,["size"],function(z){var u=Math.max(0,Math.min(z.width/2,z.height/2,parseFloat(mxUtils.getValue(this.state.style,"size",this.size))));return new mxPoint(z.x+u,z.y+u)},function(z,u){this.state.style.size=Math.round(100*Math.max(0,Math.min(z.height/2,z.width/2,u.x-z.x)))/100})];d=Graph.createHandle(d,-["indent"],function(z){var u=Math.max(0,Math.min(100,parseFloat(mxUtils.getValue(this.state.style,"indent",this.dx2))));return new mxPoint(z.x+.75*z.width,z.y+u*z.height/200)},function(z,u){this.state.style.indent=Math.round(100*Math.max(0,Math.min(100,200*(u.y-z.y)/z.height)))/100});n.push(d);return n},step:zb(ja.prototype.size,!0,null,!0,ja.prototype.fixedSize),hexagon:zb(ca.prototype.size,!0,.5,!0,ca.prototype.fixedSize),curlyBracket:zb(ha.prototype.size,!1),display:zb($a.prototype.size,!1),cube:ub(1,-m.prototype.size,!1),card:ub(.5,G.prototype.size,!0),loopLimit:ub(.5,R.prototype.size,!0),trapezoid:Cb(.5,Y.prototype.size,Y.prototype.fixedSize),parallelogram:Cb(1,J.prototype.size,J.prototype.fixedSize)};Graph.createHandle=ib;Graph.handleFactory=hb;var Ab=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){var d=Ab.apply(this,arguments);if(this.graph.isCellRotatable(this.state.cell)){var n=this.state.style.shape;null==mxCellRenderer.defaultShapes[n]&&-null==mxStencilRegistry.getStencil(n)?n=mxConstants.SHAPE_RECTANGLE:this.state.view.graph.isSwimlane(this.state.cell)&&(n=mxConstants.SHAPE_SWIMLANE);n=hb[n];null==n&&null!=this.state.shape&&this.state.shape.isRoundable()&&(n=hb[mxConstants.SHAPE_RECTANGLE]);null!=n&&(n=n(this.state),null!=n&&(d=null==d?n:d.concat(n)))}return d};mxEdgeHandler.prototype.createCustomHandles=function(){var d=this.state.style.shape;null==mxCellRenderer.defaultShapes[d]&&null==mxStencilRegistry.getStencil(d)&&(d=mxConstants.SHAPE_CONNECTOR);-d=hb[d];return null!=d?d(this.state):null}}else Graph.createHandle=function(){},Graph.handleFactory={};var sb=new mxPoint(1,0),wb=new mxPoint(1,0),yb=mxUtils.toRadians(-30);sb=mxUtils.getRotatedPoint(sb,Math.cos(yb),Math.sin(yb));var rb=mxUtils.toRadians(-150);wb=mxUtils.getRotatedPoint(wb,Math.cos(rb),Math.sin(rb));mxEdgeStyle.IsometricConnector=function(d,n,z,u,x){var C=d.view;u=null!=u&&0<u.length?u[0]:null;var E=d.absolutePoints,da=E[0];E=E[E.length-1];null!=u&&(u=C.transformControlPoint(d,u));-null==da&&null!=n&&(da=new mxPoint(n.getCenterX(),n.getCenterY()));null==E&&null!=z&&(E=new mxPoint(z.getCenterX(),z.getCenterY()));var M=sb.x,sa=sb.y,ma=wb.x,Wa=wb.y,gb="horizontal"==mxUtils.getValue(d.style,"elbow","horizontal");if(null!=E&&null!=da){d=function(Fa,Ka,Ja){Fa-=bb.x;var Ga=Ka-bb.y;Ka=(Wa*Fa-ma*Ga)/(M*Wa-sa*ma);Fa=(sa*Fa-M*Ga)/(sa*ma-M*Wa);gb?(Ja&&(bb=new mxPoint(bb.x+M*Ka,bb.y+sa*Ka),x.push(bb)),bb=new mxPoint(bb.x+ma*Fa,bb.y+Wa*Fa)):(Ja&&(bb=new mxPoint(bb.x+ma*Fa,bb.y+Wa*Fa),x.push(bb)),-bb=new mxPoint(bb.x+M*Ka,bb.y+sa*Ka));x.push(bb)};var bb=da;null==u&&(u=new mxPoint(da.x+(E.x-da.x)/2,da.y+(E.y-da.y)/2));d(u.x,u.y,!0);d(E.x,E.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var Bb=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(d,n){if(n==mxEdgeStyle.IsometricConnector){var z=new mxElbowEdgeHandler(d);z.snapToTerminals=!1;return z}return Bb.apply(this,arguments)};A.prototype.constraints=[];H.prototype.getConstraints=-function(d,n,z){d=[];var u=Math.tan(mxUtils.toRadians(30)),x=(.5-u)/2;u=Math.min(n,z/(.5+u));n=(n-u)/2;z=(z-u)/2;d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,z+.25*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n+.5*u,z+u*x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n+u,z+.25*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n+u,z+.75*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n+.5*u,z+(1-x)*u));d.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,n,z+.75*u));return d};c.prototype.getConstraints=function(d,n,z){d=[];var u=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;u=Math.min(n*Math.tan(u),.5*z);d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,u));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,z-u));d.push(new mxConnectionConstraint(new mxPoint(.5,-1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z-u));d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,u));return d};ba.prototype.getConstraints=function(d,n,z){d=[];mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE);var u=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))));parseFloat(mxUtils.getValue(this.style,"position",this.position));var x=n*Math.max(0,-Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2))));parseFloat(mxUtils.getValue(this.style,"base",this.base));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(.25,0),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(.75,0),!1));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,.5*(z-u)));d.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,n,z-u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z-u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(z-u)));n>=2*u&&d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return d};mxRectangleShape.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,+this.state.style.base=Math.round(Math.max(0,Math.min(z.width,u.x-z.x-x*z.width)))},!1)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&p.push(vb(d));return p},internalStorage:function(d){var p=[ib(d,["dx","dy"],function(z){var u=Math.max(0,Math.min(z.width,mxUtils.getValue(this.state.style,"dx",wa.prototype.dx))),x=Math.max(0,Math.min(z.height,mxUtils.getValue(this.state.style,"dy",wa.prototype.dy)));return new mxPoint(z.x+u,z.y+x)},function(z,u){this.state.style.dx=Math.round(Math.max(0,+Math.min(z.width,u.x-z.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(z.height,u.y-z.y)))},!1)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&p.push(vb(d));return p},module:function(d){return[ib(d,["jettyWidth","jettyHeight"],function(p){var z=Math.max(0,Math.min(p.width,mxUtils.getValue(this.state.style,"jettyWidth",Ba.prototype.jettyWidth))),u=Math.max(0,Math.min(p.height,mxUtils.getValue(this.state.style,"jettyHeight",Ba.prototype.jettyHeight)));return new mxPoint(p.x+z/2,p.y++2*u)},function(p,z){this.state.style.jettyWidth=Math.round(2*Math.max(0,Math.min(p.width,z.x-p.x)));this.state.style.jettyHeight=Math.round(Math.max(0,Math.min(p.height,z.y-p.y))/2)})]},corner:function(d){return[ib(d,["dx","dy"],function(p){var z=Math.max(0,Math.min(p.width,mxUtils.getValue(this.state.style,"dx",Ya.prototype.dx))),u=Math.max(0,Math.min(p.height,mxUtils.getValue(this.state.style,"dy",Ya.prototype.dy)));return new mxPoint(p.x+z,p.y+u)},function(p,z){this.state.style.dx=Math.round(Math.max(0,+Math.min(p.width,z.x-p.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(p.height,z.y-p.y)))},!1)]},tee:function(d){return[ib(d,["dx","dy"],function(p){var z=Math.max(0,Math.min(p.width,mxUtils.getValue(this.state.style,"dx",Ra.prototype.dx))),u=Math.max(0,Math.min(p.height,mxUtils.getValue(this.state.style,"dy",Ra.prototype.dy)));return new mxPoint(p.x+(p.width+z)/2,p.y+u)},function(p,z){this.state.style.dx=Math.round(Math.max(0,2*Math.min(p.width/2,z.x-p.x-p.width/2)));this.state.style.dy=+Math.round(Math.max(0,Math.min(p.height,z.y-p.y)))},!1)]},singleArrow:mb(1),doubleArrow:mb(.5),"mxgraph.arrows2.wedgeArrow":nb(20,20),"mxgraph.arrows2.wedgeArrowDashed":nb(20,20),"mxgraph.arrows2.wedgeArrowDashed2":nb(20,20),folder:function(d){return[ib(d,["tabWidth","tabHeight"],function(p){var z=Math.max(0,Math.min(p.width,mxUtils.getValue(this.state.style,"tabWidth",q.prototype.tabWidth))),u=Math.max(0,Math.min(p.height,mxUtils.getValue(this.state.style,"tabHeight",q.prototype.tabHeight)));mxUtils.getValue(this.state.style,+"tabPosition",q.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(z=p.width-z);return new mxPoint(p.x+z,p.y+u)},function(p,z){var u=Math.max(0,Math.min(p.width,z.x-p.x));mxUtils.getValue(this.state.style,"tabPosition",q.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(u=p.width-u);this.state.style.tabWidth=Math.round(u);this.state.style.tabHeight=Math.round(Math.max(0,Math.min(p.height,z.y-p.y)))},!1)]},document:function(d){return[ib(d,["size"],function(p){var z=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,+"size",L.prototype.size))));return new mxPoint(p.x+3*p.width/4,p.y+(1-z)*p.height)},function(p,z){this.state.style.size=Math.max(0,Math.min(1,(p.y+p.height-z.y)/p.height))},!1)]},tape:function(d){return[ib(d,["size"],function(p){var z=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",N.prototype.size))));return new mxPoint(p.getCenterX(),p.y+z*p.height/2)},function(p,z){this.state.style.size=Math.max(0,Math.min(1,(z.y-p.y)/p.height*2))},!1)]},isoCube2:function(d){return[ib(d,+["isoAngle"],function(p){var z=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.state.style,"isoAngle",c.isoAngle))))*Math.PI/200;return new mxPoint(p.x,p.y+Math.min(p.width*Math.tan(z),.5*p.height))},function(p,z){this.state.style.isoAngle=Math.max(0,50*(z.y-p.y)/p.height)},!0)]},cylinder2:qb(f.prototype.size),cylinder3:qb(l.prototype.size),offPageConnector:function(d){return[ib(d,["size"],function(p){var z=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",V.prototype.size))));+return new mxPoint(p.getCenterX(),p.y+(1-z)*p.height)},function(p,z){this.state.style.size=Math.max(0,Math.min(1,(p.y+p.height-z.y)/p.height))},!1)]},"mxgraph.basic.rect":function(d){var p=[Graph.createHandle(d,["size"],function(z){var u=Math.max(0,Math.min(z.width/2,z.height/2,parseFloat(mxUtils.getValue(this.state.style,"size",this.size))));return new mxPoint(z.x+u,z.y+u)},function(z,u){this.state.style.size=Math.round(100*Math.max(0,Math.min(z.height/2,z.width/2,u.x-z.x)))/100})];d=Graph.createHandle(d,+["indent"],function(z){var u=Math.max(0,Math.min(100,parseFloat(mxUtils.getValue(this.state.style,"indent",this.dx2))));return new mxPoint(z.x+.75*z.width,z.y+u*z.height/200)},function(z,u){this.state.style.indent=Math.round(100*Math.max(0,Math.min(100,200*(u.y-z.y)/z.height)))/100});p.push(d);return p},step:zb(ja.prototype.size,!0,null,!0,ja.prototype.fixedSize),hexagon:zb(ca.prototype.size,!0,.5,!0,ca.prototype.fixedSize),curlyBracket:zb(ha.prototype.size,!1),display:zb($a.prototype.size,!1),cube:ub(1,+m.prototype.size,!1),card:ub(.5,H.prototype.size,!0),loopLimit:ub(.5,R.prototype.size,!0),trapezoid:Cb(.5,Y.prototype.size,Y.prototype.fixedSize),parallelogram:Cb(1,J.prototype.size,J.prototype.fixedSize)};Graph.createHandle=ib;Graph.handleFactory=hb;var Ab=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){var d=Ab.apply(this,arguments);if(this.graph.isCellRotatable(this.state.cell)){var p=this.state.style.shape;null==mxCellRenderer.defaultShapes[p]&&+null==mxStencilRegistry.getStencil(p)?p=mxConstants.SHAPE_RECTANGLE:this.state.view.graph.isSwimlane(this.state.cell)&&(p=mxConstants.SHAPE_SWIMLANE);p=hb[p];null==p&&null!=this.state.shape&&this.state.shape.isRoundable()&&(p=hb[mxConstants.SHAPE_RECTANGLE]);null!=p&&(p=p(this.state),null!=p&&(d=null==d?p:d.concat(p)))}return d};mxEdgeHandler.prototype.createCustomHandles=function(){var d=this.state.style.shape;null==mxCellRenderer.defaultShapes[d]&&null==mxStencilRegistry.getStencil(d)&&(d=mxConstants.SHAPE_CONNECTOR);+d=hb[d];return null!=d?d(this.state):null}}else Graph.createHandle=function(){},Graph.handleFactory={};var sb=new mxPoint(1,0),wb=new mxPoint(1,0),yb=mxUtils.toRadians(-30);sb=mxUtils.getRotatedPoint(sb,Math.cos(yb),Math.sin(yb));var rb=mxUtils.toRadians(-150);wb=mxUtils.getRotatedPoint(wb,Math.cos(rb),Math.sin(rb));mxEdgeStyle.IsometricConnector=function(d,p,z,u,x){var C=d.view;u=null!=u&&0<u.length?u[0]:null;var E=d.absolutePoints,da=E[0];E=E[E.length-1];null!=u&&(u=C.transformControlPoint(d,u));+null==da&&null!=p&&(da=new mxPoint(p.getCenterX(),p.getCenterY()));null==E&&null!=z&&(E=new mxPoint(z.getCenterX(),z.getCenterY()));var M=sb.x,sa=sb.y,ma=wb.x,Wa=wb.y,gb="horizontal"==mxUtils.getValue(d.style,"elbow","horizontal");if(null!=E&&null!=da){d=function(Fa,Ka,Ja){Fa-=bb.x;var Ga=Ka-bb.y;Ka=(Wa*Fa-ma*Ga)/(M*Wa-sa*ma);Fa=(sa*Fa-M*Ga)/(sa*ma-M*Wa);gb?(Ja&&(bb=new mxPoint(bb.x+M*Ka,bb.y+sa*Ka),x.push(bb)),bb=new mxPoint(bb.x+ma*Fa,bb.y+Wa*Fa)):(Ja&&(bb=new mxPoint(bb.x+ma*Fa,bb.y+Wa*Fa),x.push(bb)),+bb=new mxPoint(bb.x+M*Ka,bb.y+sa*Ka));x.push(bb)};var bb=da;null==u&&(u=new mxPoint(da.x+(E.x-da.x)/2,da.y+(E.y-da.y)/2));d(u.x,u.y,!0);d(E.x,E.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var Bb=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(d,p){if(p==mxEdgeStyle.IsometricConnector){var z=new mxElbowEdgeHandler(d);z.snapToTerminals=!1;return z}return Bb.apply(this,arguments)};A.prototype.constraints=[];G.prototype.getConstraints=+function(d,p,z){d=[];var u=Math.tan(mxUtils.toRadians(30)),x=(.5-u)/2;u=Math.min(p,z/(.5+u));p=(p-u)/2;z=(z-u)/2;d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,z+.25*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p+.5*u,z+u*x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p+u,z+.25*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p+u,z+.75*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p+.5*u,z+(1-x)*u));d.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,p,z+.75*u));return d};c.prototype.getConstraints=function(d,p,z){d=[];var u=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;u=Math.min(p*Math.tan(u),.5*z);d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,u));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,z-u));d.push(new mxConnectionConstraint(new mxPoint(.5,+1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z-u));d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,u));return d};ba.prototype.getConstraints=function(d,p,z){d=[];mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE);var u=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))));parseFloat(mxUtils.getValue(this.style,"position",this.position));var x=p*Math.max(0,+Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2))));parseFloat(mxUtils.getValue(this.style,"base",this.base));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(.25,0),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(.75,0),!1));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,.5*(z-u)));d.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,p,z-u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z-u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(z-u)));p>=2*u&&d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return d};mxRectangleShape.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0)];mxEllipse.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(1,.5))];Da.prototype.constraints=mxRectangleShape.prototype.constraints;-mxImageShape.prototype.constraints=mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints=mxRectangleShape.prototype.constraints;la.prototype.constraints=mxRectangleShape.prototype.constraints;mxLabel.prototype.constraints=mxRectangleShape.prototype.constraints;F.prototype.getConstraints=function(d,n,z){d=[];var u=Math.max(0,Math.min(n,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,.5*(n-u),0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-u,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-.5*u,.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,.5*(z+u)));d.push(new mxConnectionConstraint(new mxPoint(1,1),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,-.5),!1));n>=2*u&&d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return d};G.prototype.getConstraints=function(d,n,z){d=[];var u=Math.max(0,Math.min(n,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n+u),0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,0,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(z+u)));d.push(new mxConnectionConstraint(new mxPoint(0,1),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(1,1),!1));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));n>=2*u&&d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return d};m.prototype.getConstraints=function(d,n,z){d=[];var u=Math.max(0,Math.min(n,Math.min(z,parseFloat(mxUtils.getValue(this.style,-"size",this.size)))));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n-u),0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-u,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-.5*u,.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,.5*(z+u)));d.push(new mxConnectionConstraint(new mxPoint(1,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,.5*(n+u),z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,z-.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z-u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(z-u)));return d};l.prototype.getConstraints=function(d,n,z){d=[];n=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,-.5),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,n));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1,null,0,n));d.push(new mxConnectionConstraint(new mxPoint(1,1),!1,null,0,-n));d.push(new mxConnectionConstraint(new mxPoint(0,1),!1,null,0,-n));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,n+.5*(.5*z-n)));d.push(new mxConnectionConstraint(new mxPoint(1,-0),!1,null,0,n+.5*(.5*z-n)));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1,null,0,z-n-.5*(.5*z-n)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z-n-.5*(.5*z-n)));d.push(new mxConnectionConstraint(new mxPoint(.145,0),!1,null,0,.29*n));d.push(new mxConnectionConstraint(new mxPoint(.855,0),!1,null,0,.29*n));d.push(new mxConnectionConstraint(new mxPoint(.855,1),!1,null,0,.29*-n));d.push(new mxConnectionConstraint(new mxPoint(.145,1),!1,null,0,.29*-n));return d};q.prototype.getConstraints=-function(d,n,z){d=[];var u=Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth)))),x=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?(d.push(new mxConnectionConstraint(new mxPoint(0,0),!1)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,0)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,0)),d.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,u,x)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n+u),x))):(d.push(new mxConnectionConstraint(new mxPoint(1,0),!1)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-.5*u,0)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-u,0)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-u,x)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n-u),x)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,x));d.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,n,.25*(z-x)+x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,.5*(z-x)+x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,.75*(z-x)+x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.25*(z-x)+x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(z-x)+x));d.push(new mxConnectionConstraint(new mxPoint(0,+mxImageShape.prototype.constraints=mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints=mxRectangleShape.prototype.constraints;la.prototype.constraints=mxRectangleShape.prototype.constraints;mxLabel.prototype.constraints=mxRectangleShape.prototype.constraints;F.prototype.getConstraints=function(d,p,z){d=[];var u=Math.max(0,Math.min(p,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,.5*(p-u),0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-u,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-.5*u,.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,.5*(z+u)));d.push(new mxConnectionConstraint(new mxPoint(1,1),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,+.5),!1));p>=2*u&&d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return d};H.prototype.getConstraints=function(d,p,z){d=[];var u=Math.max(0,Math.min(p,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p+u),0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,0,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(z+u)));d.push(new mxConnectionConstraint(new mxPoint(0,1),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(1,1),!1));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));p>=2*u&&d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return d};m.prototype.getConstraints=function(d,p,z){d=[];var u=Math.max(0,Math.min(p,Math.min(z,parseFloat(mxUtils.getValue(this.style,+"size",this.size)))));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p-u),0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-u,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-.5*u,.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,.5*(z+u)));d.push(new mxConnectionConstraint(new mxPoint(1,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,.5*(p+u),z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,z-.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z-u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(z-u)));return d};l.prototype.getConstraints=function(d,p,z){d=[];p=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,+.5),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,p));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1,null,0,p));d.push(new mxConnectionConstraint(new mxPoint(1,1),!1,null,0,-p));d.push(new mxConnectionConstraint(new mxPoint(0,1),!1,null,0,-p));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,p+.5*(.5*z-p)));d.push(new mxConnectionConstraint(new mxPoint(1,+0),!1,null,0,p+.5*(.5*z-p)));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1,null,0,z-p-.5*(.5*z-p)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z-p-.5*(.5*z-p)));d.push(new mxConnectionConstraint(new mxPoint(.145,0),!1,null,0,.29*p));d.push(new mxConnectionConstraint(new mxPoint(.855,0),!1,null,0,.29*p));d.push(new mxConnectionConstraint(new mxPoint(.855,1),!1,null,0,.29*-p));d.push(new mxConnectionConstraint(new mxPoint(.145,1),!1,null,0,.29*-p));return d};q.prototype.getConstraints=+function(d,p,z){d=[];var u=Math.max(0,Math.min(p,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth)))),x=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?(d.push(new mxConnectionConstraint(new mxPoint(0,0),!1)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,0)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,0)),d.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,u,x)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p+u),x))):(d.push(new mxConnectionConstraint(new mxPoint(1,0),!1)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-.5*u,0)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-u,0)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-u,x)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p-u),x)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,x));d.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,p,.25*(z-x)+x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,.5*(z-x)+x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,.75*(z-x)+x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.25*(z-x)+x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(z-x)+x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.75*(z-x)+x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z));d.push(new mxConnectionConstraint(new mxPoint(.25,1),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(.75,1),!1));return d};wa.prototype.constraints=mxRectangleShape.prototype.constraints;Ma.prototype.constraints=mxRectangleShape.prototype.constraints;fa.prototype.constraints=mxEllipse.prototype.constraints;ia.prototype.constraints=mxEllipse.prototype.constraints;-oa.prototype.constraints=mxEllipse.prototype.constraints;Ia.prototype.constraints=mxEllipse.prototype.constraints;Aa.prototype.constraints=mxRectangleShape.prototype.constraints;Xa.prototype.constraints=mxRectangleShape.prototype.constraints;$a.prototype.getConstraints=function(d,n,z){d=[];var u=Math.min(n,z/2),x=Math.min(n-u,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*n);d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null));d.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,x,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(x+n-u),0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-u,0));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1,null));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-u,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(x+n-u),z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,z));return d};Ba.prototype.getConstraints=function(d,n,z){n=parseFloat(mxUtils.getValue(d,-"jettyWidth",Ba.prototype.jettyWidth))/2;d=parseFloat(mxUtils.getValue(d,"jettyHeight",Ba.prototype.jettyHeight));var u=[new mxConnectionConstraint(new mxPoint(0,0),!1,null,n),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,-.75),!0),new mxConnectionConstraint(new mxPoint(0,1),!1,null,n),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(z-.5*d,1.5*d)),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(z-.5*d,3.5*d))];z>5*d&&u.push(new mxConnectionConstraint(new mxPoint(0,.75),!1,null,n));z>8*d&&u.push(new mxConnectionConstraint(new mxPoint(0,-.5),!1,null,n));z>15*d&&u.push(new mxConnectionConstraint(new mxPoint(0,.25),!1,null,n));return u};R.prototype.constraints=mxRectangleShape.prototype.constraints;V.prototype.constraints=mxRectangleShape.prototype.constraints;mxCylinder.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.15,.05),!1),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.85,.05),!1),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,+oa.prototype.constraints=mxEllipse.prototype.constraints;Ia.prototype.constraints=mxEllipse.prototype.constraints;Aa.prototype.constraints=mxRectangleShape.prototype.constraints;Xa.prototype.constraints=mxRectangleShape.prototype.constraints;$a.prototype.getConstraints=function(d,p,z){d=[];var u=Math.min(p,z/2),x=Math.min(p-u,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*p);d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null));d.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,x,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(x+p-u),0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-u,0));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1,null));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-u,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(x+p-u),z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,z));return d};Ba.prototype.getConstraints=function(d,p,z){p=parseFloat(mxUtils.getValue(d,+"jettyWidth",Ba.prototype.jettyWidth))/2;d=parseFloat(mxUtils.getValue(d,"jettyHeight",Ba.prototype.jettyHeight));var u=[new mxConnectionConstraint(new mxPoint(0,0),!1,null,p),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,+.75),!0),new mxConnectionConstraint(new mxPoint(0,1),!1,null,p),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(z-.5*d,1.5*d)),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(z-.5*d,3.5*d))];z>5*d&&u.push(new mxConnectionConstraint(new mxPoint(0,.75),!1,null,p));z>8*d&&u.push(new mxConnectionConstraint(new mxPoint(0,+.5),!1,null,p));z>15*d&&u.push(new mxConnectionConstraint(new mxPoint(0,.25),!1,null,p));return u};R.prototype.constraints=mxRectangleShape.prototype.constraints;V.prototype.constraints=mxRectangleShape.prototype.constraints;mxCylinder.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.15,.05),!1),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.85,.05),!1),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.3),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.7),!0),new mxConnectionConstraint(new mxPoint(.15,.95),!1),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.85,.95),!1)];B.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.1),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.75,.1),!1),new mxConnectionConstraint(new mxPoint(0,1/3),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(1,1/3),!1),new mxConnectionConstraint(new mxPoint(1,1),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1)];ya.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];mxActor.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.25,.2),!1),new mxConnectionConstraint(new mxPoint(.1,.5),!1),new mxConnectionConstraint(new mxPoint(0,@@ -2981,117 +2985,117 @@ oa.prototype.constraints=mxEllipse.prototype.constraints;Ia.prototype.constraint.5),!0)];mxHexagon.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.375,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.625,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.375,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.625,1),!0)];mxCloud.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.25),!1),new mxConnectionConstraint(new mxPoint(.4,.1),!1),new mxConnectionConstraint(new mxPoint(.16,.55),!1),new mxConnectionConstraint(new mxPoint(.07,.4),!1),new mxConnectionConstraint(new mxPoint(.31,.8),!1),new mxConnectionConstraint(new mxPoint(.13,.77),!1),new mxConnectionConstraint(new mxPoint(.8,.8),!1),new mxConnectionConstraint(new mxPoint(.55,.95),!1),new mxConnectionConstraint(new mxPoint(.875,.5),!1),new mxConnectionConstraint(new mxPoint(.96,.7),!1),new mxConnectionConstraint(new mxPoint(.625,.2),!1),new mxConnectionConstraint(new mxPoint(.88,.25),!1)];J.prototype.constraints=mxRectangleShape.prototype.constraints;Y.prototype.constraints=mxRectangleShape.prototype.constraints;L.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,-0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)];mxArrow.prototype.constraints=null;Ra.prototype.getConstraints=function(d,n,z){d=[];var u=Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),x=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,-"dy",this.dy))));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,.5*x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.75*n+.25*u,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n+u),x));d.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,.5*(n+u),.5*(z+x)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n+u),z));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n-u),z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n-u),.5*(z+x)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n-u),x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.25*n-.25*u,x));d.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,0,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*x));return d};Ya.prototype.getConstraints=function(d,n,z){d=[];var u=Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),x=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,n,.5*x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n+u),x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,.5*(z+x)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,z));d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,+0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)];mxArrow.prototype.constraints=null;Ra.prototype.getConstraints=function(d,p,z){d=[];var u=Math.max(0,Math.min(p,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),x=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,+"dy",this.dy))));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,.5*x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.75*p+.25*u,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p+u),x));d.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,.5*(p+u),.5*(z+x)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p+u),z));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p-u),z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p-u),.5*(z+x)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p-u),x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.25*p-.25*u,x));d.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,0,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*x));return d};Ya.prototype.getConstraints=function(d,p,z){d=[];var u=Math.max(0,Math.min(p,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),x=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,p,.5*x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p+u),x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,x));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,.5*(z+x)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,z));d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,1),!1));return d};Qa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];Sa.prototype.getConstraints=-function(d,n,z){d=[];var u=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth)))),x=n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));u=(z-u)/2;d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n-x),u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-x,0));d.push(new mxConnectionConstraint(new mxPoint(1,-.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-x,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n-x),z-u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z-u));return d};Ha.prototype.getConstraints=function(d,n,z){d=[];var u=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",Sa.prototype.arrowWidth)))),x=n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Sa.prototype.arrowSize))));u=(z-u)/2;d.push(new mxConnectionConstraint(new mxPoint(0,-.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*n,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-x,0));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n-x,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*n,z-u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,z));return d};Za.prototype.getConstraints=-function(d,n,z){d=[];var u=Math.min(z,n),x=Math.max(0,Math.min(u,u*parseFloat(mxUtils.getValue(this.style,"size",this.size))));u=(z-x)/2;var C=u+x,E=(n-x)/2;x=E+x;d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,E,.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,E,0));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,x,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,E,z-.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,E,z));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,z-.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,C));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n+x),u));d.push(new mxConnectionConstraint(new mxPoint(0,-0),!1,null,n,u));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,n,C));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(n+x),C));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,E,C));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*E,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,u));d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,+function(d,p,z){d=[];var u=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth)))),x=p*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));u=(z-u)/2;d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p-x),u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-x,0));d.push(new mxConnectionConstraint(new mxPoint(1,+.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-x,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p-x),z-u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z-u));return d};Ha.prototype.getConstraints=function(d,p,z){d=[];var u=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",Sa.prototype.arrowWidth)))),x=p*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Sa.prototype.arrowSize))));u=(z-u)/2;d.push(new mxConnectionConstraint(new mxPoint(0,+.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*p,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-x,0));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-x,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*p,z-u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,z));return d};Za.prototype.getConstraints=+function(d,p,z){d=[];var u=Math.min(z,p),x=Math.max(0,Math.min(u,u*parseFloat(mxUtils.getValue(this.style,"size",this.size))));u=(z-x)/2;var C=u+x,E=(p-x)/2;x=E+x;d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,E,.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,E,0));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,x,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,E,z-.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,E,z));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,z-.5*u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,x,C));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p+x),u));d.push(new mxConnectionConstraint(new mxPoint(0,+0),!1,null,p,u));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,C));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p+x),C));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,E,C));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*E,u));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,u));d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,C));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*E,C));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,E,u));return d};X.prototype.constraints=null;y.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];O.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.175,.25),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.175,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];ua.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];qa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)]})();function Actions(b){this.editorUi=b;this.actions={};this.init()}-Actions.prototype.init=function(){function b(F){p.escape();F=p.deleteCells(p.getDeletableCells(p.getSelectionCells()),F);null!=F&&p.setSelectionCells(F)}function e(){if(!p.isSelectionEmpty()){p.getModel().beginUpdate();try{for(var F=p.getSelectionCells(),K=0;K<F.length;K++)p.cellLabelChanged(F[K],"")}finally{p.getModel().endUpdate()}}}function g(F,K,c,f,l){l.getModel().beginUpdate();try{var t=l.getCellGeometry(F);null!=t&&c&&f&&(c/=f,t=t.clone(),1<c?t.height=t.width/c:t.width=t.height*c,l.getModel().setGeometry(F,-t));l.setCellStyles(mxConstants.STYLE_CLIP_PATH,K,[F]);l.setCellStyles(mxConstants.STYLE_ASPECT,"fixed",[F])}finally{l.getModel().endUpdate()}}var m=this.editorUi,v=m.editor,p=v.graph,A=function(){return Action.prototype.isEnabled.apply(this,arguments)&&p.isEnabled()};this.addAction("new...",function(){p.openLink(m.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";m.openFile()});var H=new Action("smartFit",function(){p.popupMenuHandler.hideMenu();var F=p.view.scale,-K=p.container.scrollLeft,c=p.container.scrollTop,f=p.view.translate.x,l=p.view.translate.y;m.actions.get("resetView").funct();1E-5>Math.abs(F-p.view.scale)&&5>Math.abs(K-p.container.scrollLeft)&&5>Math.abs(c-p.container.scrollTop)&&f==p.view.translate.x&&l==p.view.translate.y&&m.actions.get("fitWindow").funct()},null,null,"Enter");H.getTitle=function(){return mxResources.get("fitWindow")+" / "+mxResources.get("resetView")};this.put("smartFit",H);this.addAction("keyPressEnter",function(){p.isSelectionEmpty()?-m.actions.get("smartFit").funct():p.isEnabled()&&p.startEditingAtCell()});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){m.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(F,K){try{var c=mxUtils.parseXml(F);v.graph.setSelectionCells(v.graph.importGraphModel(c.documentElement))}catch(f){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+f.message)}}));m.showDialog((new OpenDialog(this)).container,+Actions.prototype.init=function(){function b(F){n.escape();F=n.deleteCells(n.getDeletableCells(n.getSelectionCells()),F);null!=F&&n.setSelectionCells(F)}function e(){if(!n.isSelectionEmpty()){n.getModel().beginUpdate();try{for(var F=n.getSelectionCells(),K=0;K<F.length;K++)n.cellLabelChanged(F[K],"")}finally{n.getModel().endUpdate()}}}function g(F,K,c,f,l){l.getModel().beginUpdate();try{var t=l.getCellGeometry(F);null!=t&&c&&f&&(c/=f,t=t.clone(),1<c?t.height=t.width/c:t.width=t.height*c,l.getModel().setGeometry(F,+t));l.setCellStyles(mxConstants.STYLE_CLIP_PATH,K,[F]);l.setCellStyles(mxConstants.STYLE_ASPECT,"fixed",[F])}finally{l.getModel().endUpdate()}}var m=this.editorUi,v=m.editor,n=v.graph,A=function(){return Action.prototype.isEnabled.apply(this,arguments)&&n.isEnabled()};this.addAction("new...",function(){n.openLink(m.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";m.openFile()});var G=new Action("smartFit",function(){n.popupMenuHandler.hideMenu();var F=n.view.scale,+K=n.container.scrollLeft,c=n.container.scrollTop,f=n.view.translate.x,l=n.view.translate.y;m.actions.get("resetView").funct();1E-5>Math.abs(F-n.view.scale)&&5>Math.abs(K-n.container.scrollLeft)&&5>Math.abs(c-n.container.scrollTop)&&f==n.view.translate.x&&l==n.view.translate.y&&m.actions.get("fitWindow").funct()},null,null,"Enter");G.getTitle=function(){return mxResources.get("fitWindow")+" / "+mxResources.get("resetView")};this.put("smartFit",G);this.addAction("keyPressEnter",function(){n.isSelectionEmpty()?+m.actions.get("smartFit").funct():n.isEnabled()&&n.startEditingAtCell()});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){m.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(F,K){try{var c=mxUtils.parseXml(F);v.graph.setSelectionCells(v.graph.importGraphModel(c.documentElement))}catch(f){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+f.message)}}));m.showDialog((new OpenDialog(this)).container,320,220,!0,!0,function(){window.openFile=null})}).isEnabled=A;this.addAction("save",function(){m.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=A;this.addAction("saveAs...",function(){m.saveFile(!0)},null,null,Editor.ctrlKey+"+Shift+S");this.addAction("export...",function(){m.showDialog((new ExportDialog(m)).container,300,340,!0,!0)});this.addAction("editDiagram...",function(){var F=new EditDiagramDialog(m);m.showDialog(F.container,620,420,!0,!1);F.init()}).isEnabled=A;this.addAction("pageSetup...",-function(){m.showDialog((new PageSetupDialog(m)).container,320,240,!0,!0)}).isEnabled=A;this.addAction("print...",function(){m.showPrintDialog()},null,"sprite-print",Editor.ctrlKey+"+P");this.addAction("preview",function(){mxUtils.show(p,null,10,10)});this.addAction("undo",function(){m.undo()},null,"sprite-undo",Editor.ctrlKey+"+Z");this.addAction("redo",function(){m.redo()},null,"sprite-redo",mxClient.IS_WIN?Editor.ctrlKey+"+Y":Editor.ctrlKey+"+Shift+Z");this.addAction("cut",function(){var F=null;-try{F=m.copyXml(),null!=F&&p.removeCells(F,!1)}catch(K){}try{null==F&&mxClipboard.cut(p)}catch(K){m.handleError(K)}},null,"sprite-cut",Editor.ctrlKey+"+X");this.addAction("copy",function(){try{m.copyXml()}catch(F){}try{mxClipboard.copy(p)}catch(F){m.handleError(F)}},null,"sprite-copy",Editor.ctrlKey+"+C");this.addAction("paste",function(){if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())){var F=!1;try{Editor.enableNativeCipboard&&(m.readGraphModelFromClipboard(function(K){if(null!=K){p.getModel().beginUpdate();-try{m.pasteXml(K,!0)}finally{p.getModel().endUpdate()}}else mxClipboard.paste(p)}),F=!0)}catch(K){}F||mxClipboard.paste(p)}},!1,"sprite-paste",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(F){function K(f){if(null!=f){for(var l=!0,t=0;t<f.length&&l;t++)l=l&&p.model.isEdge(f[t]);var q=p.view.translate;t=p.view.scale;var D=q.x,G=q.y;q=null;if(1==f.length&&l){var N=p.getCellGeometry(f[0]);null!=N&&(q=N.getTerminalPoint(!0))}q=null!=q?q:p.getBoundingBoxFromGeometry(f,l);null!=q&&(l=Math.round(p.snap(p.popupMenuHandler.triggerX/-t-D)),t=Math.round(p.snap(p.popupMenuHandler.triggerY/t-G)),p.cellsMoved(f,l-q.x,t-q.y))}}function c(){p.getModel().beginUpdate();try{K(mxClipboard.paste(p))}finally{p.getModel().endUpdate()}}if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())){F=!1;try{Editor.enableNativeCipboard&&(m.readGraphModelFromClipboard(function(f){if(null!=f){p.getModel().beginUpdate();try{K(m.pasteXml(f,!0))}finally{p.getModel().endUpdate()}}else c()}),F=!0)}catch(f){}F||c()}});this.addAction("swap",function(){var F=-p.getSelectionCells();2==F.length&&p.swapShapes(F[0],F[1])});this.addAction("copySize",function(){var F=p.getSelectionCell();p.isEnabled()&&null!=F&&p.getModel().isVertex(F)&&(F=p.getCellGeometry(F),null!=F&&(m.copiedSize=new mxRectangle(F.x,F.y,F.width,F.height)))},null,null,"Alt+Shift+F");this.addAction("pasteSize",function(){if(p.isEnabled()&&!p.isSelectionEmpty()&&null!=m.copiedSize){p.getModel().beginUpdate();try{for(var F=p.getResizableCells(p.getSelectionCells()),K=0;K<F.length;K++)if(p.getModel().isVertex(F[K])){var c=-p.getCellGeometry(F[K]);null!=c&&(c=c.clone(),c.width=m.copiedSize.width,c.height=m.copiedSize.height,p.getModel().setGeometry(F[K],c))}}finally{p.getModel().endUpdate()}}},null,null,"Alt+Shift+V");this.addAction("copyData",function(){var F=p.getSelectionCell()||p.getModel().getRoot();p.isEnabled()&&null!=F&&(F=F.cloneValue(),null==F||isNaN(F.nodeType)||(m.copiedValue=F))},null,null,"Alt+Shift+B");this.addAction("copyAsText",function(){var F=p.getSelectionCell();if(p.isEnabled()&&null!=F)try{p.isHtmlLabel(F)?-m.writeHtmlToClipboard(p.getLabel(F),mxUtils.bind(this,function(K){m.handleError(K)})):m.writeTextToClipboard(p.getLabel(F),mxUtils.bind(this,function(K){m.handleError(K)}))}catch(K){m.handleError(K)}});this.addAction("pasteData",function(F,K){function c(t,q){var D=f.getValue(t);q=t.cloneValue(q);q.removeAttribute("placeholders");null==D||isNaN(D.nodeType)||q.setAttribute("placeholders",D.getAttribute("placeholders"));null!=F&&mxEvent.isShiftDown(F)||q.setAttribute("label",p.convertValueToString(t));-f.setValue(t,q)}F=null!=K?K:F;var f=p.getModel();if(p.isEnabled()&&!p.isSelectionEmpty()&&null!=m.copiedValue){f.beginUpdate();try{var l=p.getEditableCells(p.getSelectionCells());if(0==l.length)c(f.getRoot(),m.copiedValue);else for(K=0;K<l.length;K++)c(l[K],m.copiedValue)}finally{f.endUpdate()}}},null,null,"Alt+Shift+E");this.addAction("delete",function(F,K){F=null!=K?K:F;null!=F&&mxEvent.isShiftDown(F)?e():b(null!=F&&(mxEvent.isControlDown(F)||mxEvent.isMetaDown(F)||mxEvent.isAltDown(F)))},null,-null,"Delete");this.addAction("deleteAll",function(){b(!0)});this.addAction("deleteLabels",function(){e()},null,null,Editor.ctrlKey+"+Delete");this.addAction("duplicate",function(){try{p.setSelectionCells(p.duplicateCells()),p.scrollCellToVisible(p.getSelectionCell())}catch(F){m.handleError(F)}},null,null,Editor.ctrlKey+"+D");this.put("mergeCells",new Action("merge",function(){var F=m.getSelectionState();if(null!=F.mergeCell){p.getModel().beginUpdate();try{p.setCellStyles("rowspan",F.rowspan,[F.mergeCell]),-p.setCellStyles("colspan",F.colspan,[F.mergeCell])}finally{p.getModel().endUpdate()}}}));this.put("unmergeCells",new Action("unmerge",function(){var F=m.getSelectionState();if(0<F.cells.length){p.getModel().beginUpdate();try{p.setCellStyles("rowspan",null,F.cells),p.setCellStyles("colspan",null,F.cells)}finally{p.getModel().endUpdate()}}}));H=new Action("turn",function(F,K){F=null!=K?K:F;p.turnShapes(p.getResizableCells(p.getSelectionCells()),null!=F?mxEvent.isShiftDown(F):!1)},null,null,mxClient.IS_SF?-null:Editor.ctrlKey+"+R");H.getTitle=function(){return mxResources.get("turn")+" / "+mxResources.get("reverse")};this.put("turn",H);this.put("selectConnections",new Action("selectEdges",function(F){F=p.getSelectionCell();p.isEnabled()&&null!=F&&p.addSelectionCells(p.getEdges(F))}));this.addAction("selectVertices",function(){p.selectVertices(null,!0)},null,null,Editor.ctrlKey+"+Shift+I");this.addAction("selectEdges",function(){p.selectEdges()},null,null,Editor.ctrlKey+"+Shift+E");this.addAction("selectAll",-function(){p.selectAll(null,!0)},null,null,Editor.ctrlKey+"+A");this.addAction("selectNone",function(){p.clearSelection()},null,null,Editor.ctrlKey+"+Shift+A");this.addAction("lockUnlock",function(){if(!p.isSelectionEmpty()){p.getModel().beginUpdate();try{var F=p.getSelectionCells(),K=p.getCurrentCellStyle(p.getSelectionCell()),c=1==mxUtils.getValue(K,mxConstants.STYLE_EDITABLE,1)?0:1;p.setCellStyles(mxConstants.STYLE_MOVABLE,c,F);p.setCellStyles(mxConstants.STYLE_RESIZABLE,c,F);p.setCellStyles(mxConstants.STYLE_ROTATABLE,-c,F);p.setCellStyles(mxConstants.STYLE_DELETABLE,c,F);p.setCellStyles(mxConstants.STYLE_EDITABLE,c,F);p.setCellStyles("locked",1==c?0:1,F);p.setCellStyles("connectable",c,F)}finally{p.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+L");this.addAction("explore",function(){p.model.isVertex(p.getSelectionCell())&&Graph.exploreFromCell(m.editor.graph,m.editor.graph.getSelectionCell())});this.addAction("home",function(){p.home()},null,null,"Shift+Home");this.addAction("exitGroup",function(){p.exitGroup()},-null,null,Editor.ctrlKey+"+Shift+Home");this.addAction("enterGroup",function(){p.enterGroup()},null,null,Editor.ctrlKey+"+Shift+End");this.addAction("collapse",function(){p.foldCells(!0)},null,null,Editor.ctrlKey+"+Home");this.addAction("expand",function(){p.foldCells(!1)},null,null,Editor.ctrlKey+"+End");this.addAction("toFront",function(){p.orderCells(!1)},null,null,Editor.ctrlKey+"+Shift+F");this.addAction("toBack",function(){p.orderCells(!0)},null,null,Editor.ctrlKey+"+Shift+B");this.addAction("bringForward",-function(F){p.orderCells(!1,null,!0)},null,null,Editor.ctrlKey+"+Alt+Shift+F");this.addAction("sendBackward",function(F){p.orderCells(!0,null,!0)},null,null,Editor.ctrlKey+"+Alt+Shift+B");this.addAction("group",function(){if(p.isEnabled()){var F=mxUtils.sortCells(p.getSelectionCells(),!0);1!=F.length||p.isTable(F[0])||p.isTableRow(F[0])?(F=p.getCellsForGroup(F),1<F.length&&p.setSelectionCell(p.groupCells(null,0,F))):p.setCellStyles("container","1")}},null,null,Editor.ctrlKey+"+G");this.addAction("ungroup",-function(){if(p.isEnabled()){var F=p.getEditableCells(p.getSelectionCells());p.model.beginUpdate();try{var K=p.ungroupCells();if(null!=F)for(var c=0;c<F.length;c++)p.model.contains(F[c])&&(0==p.model.getChildCount(F[c])&&p.model.isVertex(F[c])&&p.setCellStyles("container","0",[F[c]]),K.push(F[c]))}finally{p.model.endUpdate()}0<K.length&&p.setSelectionCells(K)}},null,null,Editor.ctrlKey+"+Shift+U");this.addAction("removeFromGroup",function(){if(p.isEnabled()){var F=p.getSelectionCells();if(null!=F){for(var K=-[],c=0;c<F.length;c++)p.isTableRow(F[c])||p.isTableCell(F[c])||K.push(F[c]);p.removeCellsFromParent(K);0<K.length&&p.scrollCellToVisible(K[0])}}});this.addAction("edit",function(){p.isEnabled()&&p.startEditingAtCell()},null,null,"F2/Enter");this.addAction("editData...",function(){var F=p.getSelectionCell()||p.getModel().getRoot();m.showDataDialog(F)},null,null,Editor.ctrlKey+"+M");this.addAction("editTooltip...",function(){var F=p.getSelectionCell();if(p.isEnabled()&&null!=F&&p.isCellEditable(F)){var K=-"";if(mxUtils.isNode(F.value)){var c=null;Graph.translateDiagram&&null!=Graph.diagramLanguage&&F.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(c=F.value.getAttribute("tooltip_"+Graph.diagramLanguage));null==c&&(c=F.value.getAttribute("tooltip"));null!=c&&(K=c)}K=new TextareaDialog(m,mxResources.get("editTooltip")+":",K,function(f){p.setTooltipForCell(F,f)});m.showDialog(K.container,320,200,!0,!0);K.init()}},null,null,"Alt+Shift+T");this.addAction("openLink",function(){var F=p.getLinkForCell(p.getSelectionCell());-null!=F&&p.openLink(F)});this.addAction("editLink...",function(){var F=p.getSelectionCell();if(p.isEnabled()&&null!=F&&p.isCellEditable(F)){var K=p.getLinkForCell(F,!0)||"";m.showLinkDialog(K,mxResources.get("ok"),function(c,f,l){p.getModel().beginUpdate();try{p.setLinkForCell(F,0<c.length?c:null),p.setAttributeForCell(F,"linkTarget",l)}finally{p.getModel().endUpdate()}},!0,p.getLinkTargetForCell(F))}},null,null,"Alt+Shift+L");this.put("insertImage",new Action("image...",function(){p.isEnabled()&&-!p.isCellLocked(p.getDefaultParent())&&(p.clearSelection(),m.actions.get("image").funct())})).isEnabled=A;this.addAction("editImage...",function(){m.actions.get("image").funct()});this.put("insertLink",new Action("link...",function(){p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&m.showLinkDialog("",mxResources.get("ok"),function(F,K,c){F=mxUtils.trim(F);if(0<F.length){var f=null,l=p.getLinkTitle(F);null!=K&&0<K.length&&(f=K[0].iconUrl,l=K[0].name||K[0].type,l=l.charAt(0).toUpperCase()+l.substring(1),-30<l.length&&(l=l.substring(0,30)+"..."));K=new mxCell(l,new mxGeometry(0,0,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=f?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+f:"spacing=10;"));K.vertex=!0;f=p.getCenterInsertPoint(p.getBoundingBoxFromGeometry([K],!0));K.geometry.x=f.x;K.geometry.y=f.y;p.setAttributeForCell(K,"linkTarget",c);p.setLinkForCell(K,F);p.cellSizeUpdated(K,!0);p.getModel().beginUpdate();try{K=p.addCell(K),p.fireEvent(new mxEventObject("cellsInserted",-"cells",[K]))}finally{p.getModel().endUpdate()}p.setSelectionCell(K);p.scrollCellToVisible(p.getSelectionCell())}},!0)},null,null,"L")).isEnabled=A;this.addAction("link...",mxUtils.bind(this,function(){if(p.isEnabled())if(p.cellEditor.isContentEditing()){var F=p.getSelectedElement(),K=p.getParentByName(F,"A",p.cellEditor.textarea),c="";if(null==K&&null!=F&&null!=F.getElementsByTagName)for(var f=F.getElementsByTagName("a"),l=0;l<f.length&&null==K;l++)f[l].textContent==F.textContent&&(K=f[l]);null!=-K&&"A"==K.nodeName&&(c=K.getAttribute("href")||"",p.selectNode(K));var t=p.cellEditor.saveSelection();m.showLinkDialog(c,mxResources.get("ok"),mxUtils.bind(this,function(q){p.cellEditor.restoreSelection(t);null!=q&&p.insertLink(q)}))}else p.isSelectionEmpty()?this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=A;this.addAction("autosize",function(){var F=p.getSelectionCells();if(null!=F){p.getModel().beginUpdate();try{for(var K=0;K<F.length;K++){var c=F[K];p.getModel().isVertex(c)&&-(0<p.getModel().getChildCount(c)?p.updateGroupBounds([c],0,!0):p.updateCellSize(c))}}finally{p.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+Y");this.addAction("snapToGrid",function(){p.snapCellsToGrid(p.getSelectionCells(),p.gridSize)});this.addAction("formattedText",function(){p.stopEditing();var F=p.getCommonStyle(p.getSelectionCells());F="1"==mxUtils.getValue(F,"html","0")?null:"1";p.getModel().beginUpdate();try{for(var K=p.getEditableCells(p.getSelectionCells()),c=0;c<K.length;c++)if(state=-p.getView().getState(K[c]),null!=state){var f=mxUtils.getValue(state.style,"html","0");if("1"==f&&null==F)p.removeTextStyleForCell(state.cell),p.setCellStyles("html",F,[K[c]]);else if("0"==f&&"1"==F){var l=mxUtils.htmlEntities(p.convertValueToString(state.cell),!1);"0"!=mxUtils.getValue(state.style,"nl2Br","1")&&(l=l.replace(/\n/g,"<br/>"));p.cellLabelChanged(state.cell,Graph.sanitizeHtml(l));p.setCellStyles("html",F,[K[c]])}}m.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=-F?F:"0"],"cells",K))}finally{p.getModel().endUpdate()}});this.addAction("wordWrap",function(){var F=p.getView().getState(p.getSelectionCell()),K="wrap";p.stopEditing();null!=F&&"wrap"==F.style[mxConstants.STYLE_WHITE_SPACE]&&(K=null);p.setCellStyles(mxConstants.STYLE_WHITE_SPACE,K)});this.addAction("rotation",function(){var F="0",K=p.getView().getState(p.getSelectionCell());null!=K&&(F=K.style[mxConstants.STYLE_ROTATION]||F);F=new FilenameDialog(m,F,mxResources.get("apply"),function(c){null!=c&&0<-c.length&&p.setCellStyles(mxConstants.STYLE_ROTATION,c)},mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");m.showDialog(F.container,375,80,!0,!0);F.init()});this.addAction("resetView",function(){p.zoomTo(1);m.resetScrollbars()},null,null,"Enter/Home");this.addAction("zoomIn",function(F){p.isFastZoomEnabled()?p.lazyZoom(!0,!0,m.buttonZoomDelay):p.zoomIn()},null,null,Editor.ctrlKey+" + / Alt+Mousewheel");this.addAction("zoomOut",function(F){p.isFastZoomEnabled()?p.lazyZoom(!1,-!0,m.buttonZoomDelay):p.zoomOut()},null,null,Editor.ctrlKey+" - / Alt+Mousewheel");this.addAction("fitWindow",function(){p.pageVisible&&p.isSelectionEmpty()?p.fitPages():m.fitDiagramToWindow()},null,null,Editor.ctrlKey+"+Shift+H");this.addAction("fitPage",mxUtils.bind(this,function(){p.pageVisible?p.fitPages(1):this.get("pageView").funct()}),null,null,Editor.ctrlKey+"+J");this.addAction("fitTwoPages",mxUtils.bind(this,function(){p.pageVisible?p.fitPages(2):this.get("pageView").funct()}),null,null,-Editor.ctrlKey+"+Shift+J");this.addAction("fitPageWidth",mxUtils.bind(this,function(){p.pageVisible?p.fitPages(1,!0):this.get("pageView").funct()}));this.put("customZoom",new Action("custom...",mxUtils.bind(this,function(){var F=new FilenameDialog(this.editorUi,parseInt(100*p.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(K){K=parseInt(K);!isNaN(K)&&0<K&&p.zoomTo(K/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(F.container,300,80,!0,!0);F.init()}),null,-null,Editor.ctrlKey+"+0"));this.addAction("pageScale...",mxUtils.bind(this,function(){var F=new FilenameDialog(this.editorUi,parseInt(100*p.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(K){K=parseInt(K);!isNaN(K)&&0<K&&(K=new ChangePageSetup(m,null,null,null,K/100),K.ignoreColor=!0,K.ignoreImage=!0,p.model.execute(K))}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(F.container,300,80,!0,!0);F.init()}));H=null;H=this.addAction("grid",function(){p.setGridEnabled(!p.isGridEnabled());-p.defaultGridEnabled=p.isGridEnabled();m.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+Shift+G");H.setToggleAction(!0);H.setSelectedCallback(function(){return p.isGridEnabled()});H.setEnabled(!1);H=this.addAction("guides",function(){p.graphHandler.guidesEnabled=!p.graphHandler.guidesEnabled;m.fireEvent(new mxEventObject("guidesEnabledChanged"))});H.setToggleAction(!0);H.setSelectedCallback(function(){return p.graphHandler.guidesEnabled});H.setEnabled(!1);H=this.addAction("animations",-function(){Editor.enableAnimations=!Editor.enableAnimations;m.fireEvent(new mxEventObject("enableAnimationsChanged"))});H.setToggleAction(!0);H.setSelectedCallback(function(){return Editor.enableAnimations});H=this.addAction("tooltips",function(){p.tooltipHandler.setEnabled(!p.tooltipHandler.isEnabled());m.fireEvent(new mxEventObject("tooltipsEnabledChanged"))});H.setToggleAction(!0);H.setSelectedCallback(function(){return p.tooltipHandler.isEnabled()});H=this.addAction("collapseExpand",function(){var F=-new ChangePageSetup(m);F.ignoreColor=!0;F.ignoreImage=!0;F.foldingEnabled=!p.foldingEnabled;p.model.execute(F)});H.setToggleAction(!0);H.setSelectedCallback(function(){return p.foldingEnabled});H.isEnabled=A;H=this.addAction("pageView",mxUtils.bind(this,function(){m.setPageVisible(!p.pageVisible)}));H.setToggleAction(!0);H.setSelectedCallback(function(){return p.pageVisible});H=this.addAction("connectionArrows",function(){p.connectionArrowsEnabled=!p.connectionArrowsEnabled;m.fireEvent(new mxEventObject("connectionArrowsChanged"))},-null,null,"Alt+Shift+A");H.setToggleAction(!0);H.setSelectedCallback(function(){return p.connectionArrowsEnabled});H=this.addAction("connectionPoints",function(){p.setConnectable(!p.connectionHandler.isEnabled());m.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,"Alt+Shift+O");H.setToggleAction(!0);H.setSelectedCallback(function(){return p.connectionHandler.isEnabled()});H=this.addAction("copyConnect",function(){p.connectionHandler.setCreateTarget(!p.connectionHandler.isCreateTarget());-m.fireEvent(new mxEventObject("copyConnectChanged"))});H.setToggleAction(!0);H.setSelectedCallback(function(){return p.connectionHandler.isCreateTarget()});H.isEnabled=A;H=this.addAction("autosave",function(){m.editor.setAutosave(!m.editor.autosave)});H.setToggleAction(!0);H.setSelectedCallback(function(){return m.editor.autosave});H.isEnabled=A;H.visible=!1;this.addAction("help",function(){var F="";mxResources.isLanguageSupported(mxClient.language)&&(F="_"+mxClient.language);p.openLink(RESOURCES_PATH+-"/help"+F+".html")});var S=!1;H=new Action("about",function(){S||(m.showDialog((new AboutDialog(m)).container,320,280,!0,!0,function(){S=!1}),S=!0)});H.getTitle=function(){return mxResources.get("about")+" Graph Editor..."};this.put("about",H);H=mxUtils.bind(this,function(F,K,c,f){return this.addAction(F,function(){if(null!=c&&p.cellEditor.isContentEditing())c();else{p.stopEditing(!1);p.getModel().beginUpdate();try{var l=p.getEditableCells(p.getSelectionCells());p.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,-K,l);(K&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?p.updateLabelElements(l,function(q){q.style.fontWeight=null;"B"==q.nodeName&&p.replaceElement(q)}):(K&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?p.updateLabelElements(l,function(q){q.style.fontStyle=null;"I"==q.nodeName&&p.replaceElement(q)}):(K&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&p.updateLabelElements(l,function(q){q.style.textDecoration=null;"U"==q.nodeName&&p.replaceElement(q)});for(var t=0;t<l.length;t++)0==p.model.getChildCount(l[t])&&-p.autoSizeCell(l[t],!1)}finally{p.getModel().endUpdate()}}},null,null,f)});H("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");H("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I");H("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){m.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000",-"default",p.shapeForegroundColor)});this.addAction("strokeColor...",function(){m.menus.pickColor(mxConstants.STYLE_STROKECOLOR,null,null,"default",p.shapeForegroundColor)});this.addAction("fillColor...",function(){m.menus.pickColor(mxConstants.STYLE_FILLCOLOR,null,null,"default",p.shapeBackgroundColor)});this.addAction("gradientColor...",function(){m.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR,null,null,"default",p.shapeForegroundColor)});this.addAction("backgroundColor...",function(){m.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,-"backcolor",null,"default",p.shapeBackgroundColor)});this.addAction("borderColor...",function(){m.menus.pickColor(mxConstants.STYLE_LABEL_BORDERCOLOR,null,null,"default",p.shapeForegroundColor)});this.addAction("removeFormat",function(){if(p.isEnabled()&&!p.isSelectionEmpty()&&!p.isEditing()){p.getModel().beginUpdate();try{for(var F=p.getSelectionCells(),K=0;K<F.length;K++)p.removeTextStyleForCell(F[K],!0)}finally{p.getModel().endUpdate()}}});this.addAction("vertical",function(){m.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,-!0)});this.addAction("shadow",function(){m.menus.toggleStyle(mxConstants.STYLE_SHADOW)});this.addAction("solid",function(){p.getModel().beginUpdate();try{p.setCellStyles(mxConstants.STYLE_DASHED,null),p.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",[null,null],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("dashed",function(){p.getModel().beginUpdate();-try{p.setCellStyles(mxConstants.STYLE_DASHED,"1"),p.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1",null],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("dotted",function(){p.getModel().beginUpdate();try{p.setCellStyles(mxConstants.STYLE_DASHED,"1"),p.setCellStyles(mxConstants.STYLE_DASH_PATTERN,"1 4"),m.fireEvent(new mxEventObject("styleChanged",-"keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1","1 4"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("sharp",function(){p.getModel().beginUpdate();try{p.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),p.setCellStyles(mxConstants.STYLE_CURVED,"0"),m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","0"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});-this.addAction("rounded",function(){p.getModel().beginUpdate();try{p.setCellStyles(mxConstants.STYLE_ROUNDED,"1"),p.setCellStyles(mxConstants.STYLE_CURVED,"0"),m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["1","0"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("toggleRounded",function(){if(!p.isSelectionEmpty()&&p.isEnabled()){p.getModel().beginUpdate();try{var F=p.getSelectionCells(),K=p.getCurrentCellStyle(F[0]),-c="1"==mxUtils.getValue(K,mxConstants.STYLE_ROUNDED,"0")?"0":"1";p.setCellStyles(mxConstants.STYLE_ROUNDED,c);p.setCellStyles(mxConstants.STYLE_CURVED,null);m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[c,"0"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}}});this.addAction("curved",function(){p.getModel().beginUpdate();try{p.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),p.setCellStyles(mxConstants.STYLE_CURVED,-"1"),m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","1"],"cells",p.getSelectionCells()))}finally{p.getModel().endUpdate()}});this.addAction("collapsible",function(){var F=p.view.getState(p.getSelectionCell()),K="1";null!=F&&null!=p.getFoldingImage(F)&&(K="0");p.setCellStyles("collapsible",K);m.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[K],"cells",p.getSelectionCells()))});this.addAction("editStyle...",-mxUtils.bind(this,function(){var F=p.getEditableCells(p.getSelectionCells());if(null!=F&&0<F.length){var K=p.getModel();K=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",K.getStyle(F[0])||"",function(c){null!=c&&p.setCellStyle(mxUtils.trim(c),F)},null,null,400,220);this.editorUi.showDialog(K.container,420,300,!0,!0);K.init()}}),null,null,Editor.ctrlKey+"+E");this.addAction("setAsDefaultStyle",function(){p.isEnabled()&&!p.isSelectionEmpty()&&m.setDefaultStyle(p.getSelectionCell())},-null,null,Editor.ctrlKey+"+Shift+D");this.addAction("clearDefaultStyle",function(){p.isEnabled()&&m.clearDefaultStyle()},null,null,Editor.ctrlKey+"+Shift+R");this.addAction("addWaypoint",function(){var F=p.getSelectionCell();if(null!=F&&p.getModel().isEdge(F)){var K=v.graph.selectionCellsHandler.getHandler(F);if(K instanceof mxEdgeHandler){var c=p.view.translate,f=p.view.scale,l=c.x;c=c.y;F=p.getModel().getParent(F);for(var t=p.getCellGeometry(F);p.getModel().isVertex(F)&&null!=t;)l+=t.x,c+=t.y,F=-p.getModel().getParent(F),t=p.getCellGeometry(F);l=Math.round(p.snap(p.popupMenuHandler.triggerX/f-l));f=Math.round(p.snap(p.popupMenuHandler.triggerY/f-c));K.addPointAt(K.state,l,f)}}});this.addAction("removeWaypoint",function(){var F=m.actions.get("removeWaypoint");null!=F.handler&&F.handler.removePoint(F.handler.state,F.index)});this.addAction("clearAnchors",function(){var F=p.getSelectionCells();if(null!=F){F=p.getEditableCells(p.addAllEdges(F));p.getModel().beginUpdate();try{for(var K=0;K<F.length;K++){var c=-F[K];p.getModel().isEdge(c)&&(p.setCellStyles(mxConstants.STYLE_EXIT_X,null,[c]),p.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[c]),p.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[c]),p.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[c]))}}finally{p.getModel().endUpdate()}}});this.addAction("clearWaypoints",function(){var F=p.getSelectionCells();if(null!=F){F=p.getEditableCells(p.addAllEdges(F));p.getModel().beginUpdate();try{for(var K=0;K<F.length;K++){var c=F[K];if(p.getModel().isEdge(c)){var f=p.getCellGeometry(c);-null!=f&&(f=f.clone(),f.points=null,f.x=0,f.y=0,f.offset=null,p.getModel().setGeometry(c,f))}}}finally{p.getModel().endUpdate()}}},null,null,"Alt+Shift+R");H=this.addAction("subscript",mxUtils.bind(this,function(){p.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");H=this.addAction("superscript",mxUtils.bind(this,function(){p.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");H=this.addAction("decreaseFontSize",-mxUtils.bind(this,function(){if(!p.isSelectionEmpty()){var F=p.getCurrentCellStyle(p.getSelectionCell());F=mxUtils.getValue(F,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);p.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.max(1,F-1),p.getSelectionCells())}}),null,null,Editor.ctrlKey+"+Shift + (Numpad)");H=this.addAction("increaseFontSize",mxUtils.bind(this,function(){if(!p.isSelectionEmpty()){var F=p.getCurrentCellStyle(p.getSelectionCell());F=mxUtils.getValue(F,mxConstants.STYLE_FONTSIZE,-mxConstants.DEFAULT_FONTSIZE);p.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.min(100,F+1),p.getSelectionCells())}}),null,null,Editor.ctrlKey+"+Shift - (Numpad)");this.addAction("image...",function(){if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())){var F=mxResources.get("image")+" ("+mxResources.get("url")+"):",K=p.getView().getState(p.getSelectionCell()),c="",f=null;null!=K&&(c=K.style[mxConstants.STYLE_IMAGE]||c,f=K.style[mxConstants.STYLE_CLIP_PATH]||f);var l=p.cellEditor.saveSelection();-m.showImageDialog(F,c,function(t,q,D,G,N,L){if(p.cellEditor.isContentEditing())p.cellEditor.restoreSelection(l),p.insertImage(t,q,D);else{var J=p.getSelectionCells();if(null!=t&&(0<t.length||0<J.length)){var Y=null;p.getModel().beginUpdate();try{if(0==J.length){J=[p.insertVertex(p.getDefaultParent(),null,"",0,0,q,D,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];var ha=p.getCenterInsertPoint(p.getBoundingBoxFromGeometry(J,!0));J[0].geometry.x=ha.x;J[0].geometry.y=-ha.y;null!=G&&g(J[0],G,N,L,p);Y=J;p.fireEvent(new mxEventObject("cellsInserted","cells",Y))}p.setCellStyles(mxConstants.STYLE_IMAGE,0<t.length?t:null,J);var ea=p.getCurrentCellStyle(J[0]);"image"!=ea[mxConstants.STYLE_SHAPE]&&"label"!=ea[mxConstants.STYLE_SHAPE]?p.setCellStyles(mxConstants.STYLE_SHAPE,"image",J):0==t.length&&p.setCellStyles(mxConstants.STYLE_SHAPE,null,J);null==G&&p.setCellStyles(mxConstants.STYLE_CLIP_PATH,null,J);if(null!=q&&null!=D)for(t=0;t<J.length;t++){var aa=J[t];if("0"!=p.getCurrentCellStyle(aa).expand){var na=-p.getModel().getGeometry(aa);null!=na&&(na=na.clone(),na.width=q,na.height=D,p.getModel().setGeometry(aa,na))}null!=G&&g(aa,G,N,L,p)}}finally{p.getModel().endUpdate()}null!=Y&&(p.setSelectionCells(Y),p.scrollCellToVisible(Y[0]))}}},p.cellEditor.isContentEditing(),!p.cellEditor.isContentEditing(),!0,f)}}).isEnabled=A;this.addAction("crop...",function(){var F=p.getSelectionCell();if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&null!=F){var K=p.getCurrentCellStyle(F),c=K[mxConstants.STYLE_IMAGE],-f=K[mxConstants.STYLE_SHAPE];c&&"image"==f&&(K=new CropImageDialog(m,c,K[mxConstants.STYLE_CLIP_PATH],function(l,t,q){g(F,l,t,q,p)}),m.showDialog(K.container,300,390,!0,!0))}}).isEnabled=A;H=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(m,document.body.offsetWidth-280,120,212,200),this.layersWindow.window.addListener("show",mxUtils.bind(this,function(){m.fireEvent(new mxEventObject("layers"))})),this.layersWindow.window.addListener("hide",-function(){m.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),m.fireEvent(new mxEventObject("layers")),this.layersWindow.init()):this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+L");H.setToggleAction(!0);H.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));H=this.addAction("format",mxUtils.bind(this,function(){m.toggleFormatPanel()}),null,-null,Editor.ctrlKey+"+Shift+P");H.setToggleAction(!0);H.setSelectedCallback(mxUtils.bind(this,function(){return m.isFormatPanelVisible()}));H=this.addAction("outline",mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(m,document.body.offsetWidth-260,100,180,180),this.outlineWindow.window.addListener("show",mxUtils.bind(this,function(){m.fireEvent(new mxEventObject("outline"))})),this.outlineWindow.window.addListener("hide",function(){m.fireEvent(new mxEventObject("outline"))}),-this.outlineWindow.window.setVisible(!0),m.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+O");H.setToggleAction(!0);H.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}));this.addAction("editConnectionPoints...",function(){var F=p.getSelectionCell();if(p.isEnabled()&&!p.isCellLocked(p.getDefaultParent())&&null!=F&&null!=F.geometry){var K=-new ConnectionPointsDialog(m,F);m.showDialog(K.container,350,450,!0,!1,function(){K.destroy()});K.init()}},null,null,"Alt+Shift+Q").isEnabled=A};Actions.prototype.addAction=function(b,e,g,m,v){var p=b;"..."==p.substring(p.length-3)&&(p=p.substring(0,p.length-3));return this.put(p,new Action(b,e,g,m,v))};Actions.prototype.put=function(b,e){return this.actions[b]=e};Actions.prototype.get=function(b){return this.actions[b]};+function(){m.showDialog((new PageSetupDialog(m)).container,320,240,!0,!0)}).isEnabled=A;this.addAction("print...",function(){m.showPrintDialog()},null,"sprite-print",Editor.ctrlKey+"+P");this.addAction("preview",function(){mxUtils.show(n,null,10,10)});this.addAction("undo",function(){m.undo()},null,"sprite-undo",Editor.ctrlKey+"+Z");this.addAction("redo",function(){m.redo()},null,"sprite-redo",mxClient.IS_WIN?Editor.ctrlKey+"+Y":Editor.ctrlKey+"+Shift+Z");this.addAction("cut",function(){var F=null;+try{F=m.copyXml(),null!=F&&n.removeCells(F,!1)}catch(K){}try{null==F&&mxClipboard.cut(n)}catch(K){m.handleError(K)}},null,"sprite-cut",Editor.ctrlKey+"+X");this.addAction("copy",function(){try{m.copyXml()}catch(F){}try{mxClipboard.copy(n)}catch(F){m.handleError(F)}},null,"sprite-copy",Editor.ctrlKey+"+C");this.addAction("paste",function(){if(n.isEnabled()&&!n.isCellLocked(n.getDefaultParent())){var F=!1;try{Editor.enableNativeCipboard&&(m.readGraphModelFromClipboard(function(K){if(null!=K){n.getModel().beginUpdate();+try{m.pasteXml(K,!0)}finally{n.getModel().endUpdate()}}else mxClipboard.paste(n)}),F=!0)}catch(K){}F||mxClipboard.paste(n)}},!1,"sprite-paste",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(F){function K(f){if(null!=f){for(var l=!0,t=0;t<f.length&&l;t++)l=l&&n.model.isEdge(f[t]);var q=n.view.translate;t=n.view.scale;var D=q.x,H=q.y;q=null;if(1==f.length&&l){var N=n.getCellGeometry(f[0]);null!=N&&(q=N.getTerminalPoint(!0))}q=null!=q?q:n.getBoundingBoxFromGeometry(f,l);null!=q&&(l=Math.round(n.snap(n.popupMenuHandler.triggerX/+t-D)),t=Math.round(n.snap(n.popupMenuHandler.triggerY/t-H)),n.cellsMoved(f,l-q.x,t-q.y))}}function c(){n.getModel().beginUpdate();try{K(mxClipboard.paste(n))}finally{n.getModel().endUpdate()}}if(n.isEnabled()&&!n.isCellLocked(n.getDefaultParent())){F=!1;try{Editor.enableNativeCipboard&&(m.readGraphModelFromClipboard(function(f){if(null!=f){n.getModel().beginUpdate();try{K(m.pasteXml(f,!0))}finally{n.getModel().endUpdate()}}else c()}),F=!0)}catch(f){}F||c()}});this.addAction("swap",function(){var F=+n.getSelectionCells();2==F.length&&n.swapShapes(F[0],F[1])});this.addAction("copySize",function(){var F=n.getSelectionCell();n.isEnabled()&&null!=F&&n.getModel().isVertex(F)&&(F=n.getCellGeometry(F),null!=F&&(m.copiedSize=new mxRectangle(F.x,F.y,F.width,F.height)))},null,null,"Alt+Shift+F");this.addAction("pasteSize",function(){if(n.isEnabled()&&!n.isSelectionEmpty()&&null!=m.copiedSize){n.getModel().beginUpdate();try{for(var F=n.getResizableCells(n.getSelectionCells()),K=0;K<F.length;K++)if(n.getModel().isVertex(F[K])){var c=+n.getCellGeometry(F[K]);null!=c&&(c=c.clone(),c.width=m.copiedSize.width,c.height=m.copiedSize.height,n.getModel().setGeometry(F[K],c))}}finally{n.getModel().endUpdate()}}},null,null,"Alt+Shift+V");this.addAction("copyData",function(){var F=n.getSelectionCell()||n.getModel().getRoot();n.isEnabled()&&null!=F&&(F=F.cloneValue(),null==F||isNaN(F.nodeType)||(m.copiedValue=F))},null,null,"Alt+Shift+B");this.addAction("copyAsText",function(){var F=n.getSelectionCell();if(n.isEnabled()&&null!=F)try{n.isHtmlLabel(F)?+m.writeHtmlToClipboard(n.getLabel(F),mxUtils.bind(this,function(K){m.handleError(K)})):m.writeTextToClipboard(n.getLabel(F),mxUtils.bind(this,function(K){m.handleError(K)}))}catch(K){m.handleError(K)}});this.addAction("pasteData",function(F,K){function c(t,q){var D=f.getValue(t);q=t.cloneValue(q);q.removeAttribute("placeholders");null==D||isNaN(D.nodeType)||q.setAttribute("placeholders",D.getAttribute("placeholders"));null!=F&&mxEvent.isShiftDown(F)||q.setAttribute("label",n.convertValueToString(t));+f.setValue(t,q)}F=null!=K?K:F;var f=n.getModel();if(n.isEnabled()&&!n.isSelectionEmpty()&&null!=m.copiedValue){f.beginUpdate();try{var l=n.getEditableCells(n.getSelectionCells());if(0==l.length)c(f.getRoot(),m.copiedValue);else for(K=0;K<l.length;K++)c(l[K],m.copiedValue)}finally{f.endUpdate()}}},null,null,"Alt+Shift+E");this.addAction("delete",function(F,K){F=null!=K?K:F;null!=F&&mxEvent.isShiftDown(F)?e():b(null!=F&&(mxEvent.isControlDown(F)||mxEvent.isMetaDown(F)||mxEvent.isAltDown(F)))},null,+null,"Delete");this.addAction("deleteAll",function(){b(!0)});this.addAction("deleteLabels",function(){e()},null,null,Editor.ctrlKey+"+Delete");this.addAction("duplicate",function(){try{n.setSelectionCells(n.duplicateCells()),n.scrollCellToVisible(n.getSelectionCell())}catch(F){m.handleError(F)}},null,null,Editor.ctrlKey+"+D");this.put("mergeCells",new Action("merge",function(){var F=m.getSelectionState();if(null!=F.mergeCell){n.getModel().beginUpdate();try{n.setCellStyles("rowspan",F.rowspan,[F.mergeCell]),+n.setCellStyles("colspan",F.colspan,[F.mergeCell])}finally{n.getModel().endUpdate()}}}));this.put("unmergeCells",new Action("unmerge",function(){var F=m.getSelectionState();if(0<F.cells.length){n.getModel().beginUpdate();try{n.setCellStyles("rowspan",null,F.cells),n.setCellStyles("colspan",null,F.cells)}finally{n.getModel().endUpdate()}}}));G=new Action("turn",function(F,K){F=null!=K?K:F;n.turnShapes(n.getResizableCells(n.getSelectionCells()),null!=F?mxEvent.isShiftDown(F):!1)},null,null,mxClient.IS_SF?+null:Editor.ctrlKey+"+R");G.getTitle=function(){return mxResources.get("turn")+" / "+mxResources.get("reverse")};this.put("turn",G);this.put("selectConnections",new Action("selectEdges",function(F){F=n.getSelectionCell();n.isEnabled()&&null!=F&&n.addSelectionCells(n.getEdges(F))}));this.addAction("selectVertices",function(){n.selectVertices(null,!0)},null,null,Editor.ctrlKey+"+Shift+I");this.addAction("selectEdges",function(){n.selectEdges()},null,null,Editor.ctrlKey+"+Shift+E");this.addAction("selectAll",+function(){n.selectAll(null,!0)},null,null,Editor.ctrlKey+"+A");this.addAction("selectNone",function(){n.clearSelection()},null,null,Editor.ctrlKey+"+Shift+A");this.addAction("lockUnlock",function(){if(!n.isSelectionEmpty()){n.getModel().beginUpdate();try{var F=n.getSelectionCells(),K=n.getCurrentCellStyle(n.getSelectionCell()),c=1==mxUtils.getValue(K,mxConstants.STYLE_EDITABLE,1)?0:1;n.setCellStyles(mxConstants.STYLE_MOVABLE,c,F);n.setCellStyles(mxConstants.STYLE_RESIZABLE,c,F);n.setCellStyles(mxConstants.STYLE_ROTATABLE,+c,F);n.setCellStyles(mxConstants.STYLE_DELETABLE,c,F);n.setCellStyles(mxConstants.STYLE_EDITABLE,c,F);n.setCellStyles("locked",1==c?0:1,F);n.setCellStyles("connectable",c,F)}finally{n.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+L");this.addAction("explore",function(){n.model.isVertex(n.getSelectionCell())&&Graph.exploreFromCell(m.editor.graph,m.editor.graph.getSelectionCell())});this.addAction("home",function(){n.home()},null,null,"Shift+Home");this.addAction("exitGroup",function(){n.exitGroup()},+null,null,Editor.ctrlKey+"+Shift+Home");this.addAction("enterGroup",function(){n.enterGroup()},null,null,Editor.ctrlKey+"+Shift+End");this.addAction("collapse",function(){n.foldCells(!0)},null,null,Editor.ctrlKey+"+Home");this.addAction("expand",function(){n.foldCells(!1)},null,null,Editor.ctrlKey+"+End");this.addAction("toFront",function(){n.orderCells(!1)},null,null,Editor.ctrlKey+"+Shift+F");this.addAction("toBack",function(){n.orderCells(!0)},null,null,Editor.ctrlKey+"+Shift+B");this.addAction("bringForward",+function(F){n.orderCells(!1,null,!0)},null,null,Editor.ctrlKey+"+Alt+Shift+F");this.addAction("sendBackward",function(F){n.orderCells(!0,null,!0)},null,null,Editor.ctrlKey+"+Alt+Shift+B");this.addAction("group",function(){if(n.isEnabled()){var F=mxUtils.sortCells(n.getSelectionCells(),!0);1!=F.length||n.isTable(F[0])||n.isTableRow(F[0])?(F=n.getCellsForGroup(F),1<F.length&&n.setSelectionCell(n.groupCells(null,0,F))):n.setCellStyles("container","1")}},null,null,Editor.ctrlKey+"+G");this.addAction("ungroup",+function(){if(n.isEnabled()){var F=n.getEditableCells(n.getSelectionCells());n.model.beginUpdate();try{var K=n.ungroupCells();if(null!=F)for(var c=0;c<F.length;c++)n.model.contains(F[c])&&(0==n.model.getChildCount(F[c])&&n.model.isVertex(F[c])&&n.setCellStyles("container","0",[F[c]]),K.push(F[c]))}finally{n.model.endUpdate()}0<K.length&&n.setSelectionCells(K)}},null,null,Editor.ctrlKey+"+Shift+U");this.addAction("removeFromGroup",function(){if(n.isEnabled()){var F=n.getSelectionCells();if(null!=F){for(var K=+[],c=0;c<F.length;c++)n.isTableRow(F[c])||n.isTableCell(F[c])||K.push(F[c]);n.removeCellsFromParent(K);0<K.length&&n.scrollCellToVisible(K[0])}}});this.addAction("edit",function(){n.isEnabled()&&n.startEditingAtCell()},null,null,"F2/Enter");this.addAction("editData...",function(){var F=n.getSelectionCell()||n.getModel().getRoot();m.showDataDialog(F)},null,null,Editor.ctrlKey+"+M");this.addAction("editTooltip...",function(){var F=n.getSelectionCell();if(n.isEnabled()&&null!=F&&n.isCellEditable(F)){var K=+"";if(mxUtils.isNode(F.value)){var c=null;Graph.translateDiagram&&null!=Graph.diagramLanguage&&F.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(c=F.value.getAttribute("tooltip_"+Graph.diagramLanguage));null==c&&(c=F.value.getAttribute("tooltip"));null!=c&&(K=c)}K=new TextareaDialog(m,mxResources.get("editTooltip")+":",K,function(f){n.setTooltipForCell(F,f)});m.showDialog(K.container,320,200,!0,!0);K.init()}},null,null,"Alt+Shift+T");this.addAction("openLink",function(){var F=n.getLinkForCell(n.getSelectionCell());+null!=F&&n.openLink(F)});this.addAction("editLink...",function(){var F=n.getSelectionCell();if(n.isEnabled()&&null!=F&&n.isCellEditable(F)){var K=n.getLinkForCell(F,!0)||"";m.showLinkDialog(K,mxResources.get("ok"),function(c,f,l){n.getModel().beginUpdate();try{n.setLinkForCell(F,0<c.length?c:null),n.setAttributeForCell(F,"linkTarget",l)}finally{n.getModel().endUpdate()}},!0,n.getLinkTargetForCell(F))}},null,null,"Alt+Shift+L");this.put("insertImage",new Action("image...",function(){n.isEnabled()&&+!n.isCellLocked(n.getDefaultParent())&&(n.clearSelection(),m.actions.get("image").funct())})).isEnabled=A;this.addAction("editImage...",function(){m.actions.get("image").funct()});this.put("insertLink",new Action("link...",function(){n.isEnabled()&&!n.isCellLocked(n.getDefaultParent())&&m.showLinkDialog("",mxResources.get("ok"),function(F,K,c){F=mxUtils.trim(F);if(0<F.length){var f=null,l=n.getLinkTitle(F);null!=K&&0<K.length&&(f=K[0].iconUrl,l=K[0].name||K[0].type,l=l.charAt(0).toUpperCase()+l.substring(1),+30<l.length&&(l=l.substring(0,30)+"..."));K=new mxCell(l,new mxGeometry(0,0,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=f?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+f:"spacing=10;"));K.vertex=!0;f=n.getCenterInsertPoint(n.getBoundingBoxFromGeometry([K],!0));K.geometry.x=f.x;K.geometry.y=f.y;n.setAttributeForCell(K,"linkTarget",c);n.setLinkForCell(K,F);n.cellSizeUpdated(K,!0);n.getModel().beginUpdate();try{K=n.addCell(K),n.fireEvent(new mxEventObject("cellsInserted",+"cells",[K]))}finally{n.getModel().endUpdate()}n.setSelectionCell(K);n.scrollCellToVisible(n.getSelectionCell())}},!0)},null,null,"L")).isEnabled=A;this.addAction("link...",mxUtils.bind(this,function(){if(n.isEnabled())if(n.cellEditor.isContentEditing()){var F=n.getSelectedElement(),K=n.getParentByName(F,"A",n.cellEditor.textarea),c="";if(null==K&&null!=F&&null!=F.getElementsByTagName)for(var f=F.getElementsByTagName("a"),l=0;l<f.length&&null==K;l++)f[l].textContent==F.textContent&&(K=f[l]);null!=+K&&"A"==K.nodeName&&(c=K.getAttribute("href")||"",n.selectNode(K));var t=n.cellEditor.saveSelection();m.showLinkDialog(c,mxResources.get("ok"),mxUtils.bind(this,function(q){n.cellEditor.restoreSelection(t);null!=q&&n.insertLink(q)}))}else n.isSelectionEmpty()?this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=A;this.addAction("autosize",function(){var F=n.getSelectionCells();if(null!=F){n.getModel().beginUpdate();try{for(var K=0;K<F.length;K++){var c=F[K];n.getModel().isVertex(c)&&+(0<n.getModel().getChildCount(c)?n.updateGroupBounds([c],0,!0):n.updateCellSize(c))}}finally{n.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+Y");this.addAction("snapToGrid",function(){n.snapCellsToGrid(n.getSelectionCells(),n.gridSize)});this.addAction("formattedText",function(){n.stopEditing();var F=n.getCommonStyle(n.getSelectionCells());F="1"==mxUtils.getValue(F,"html","0")?null:"1";n.getModel().beginUpdate();try{for(var K=n.getEditableCells(n.getSelectionCells()),c=0;c<K.length;c++)if(state=+n.getView().getState(K[c]),null!=state){var f=mxUtils.getValue(state.style,"html","0");if("1"==f&&null==F)n.removeTextStyleForCell(state.cell),n.setCellStyles("html",F,[K[c]]);else if("0"==f&&"1"==F){var l=mxUtils.htmlEntities(n.convertValueToString(state.cell),!1);"0"!=mxUtils.getValue(state.style,"nl2Br","1")&&(l=l.replace(/\n/g,"<br/>"));n.cellLabelChanged(state.cell,Graph.sanitizeHtml(l));n.setCellStyles("html",F,[K[c]])}}m.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=+F?F:"0"],"cells",K))}finally{n.getModel().endUpdate()}});this.addAction("wordWrap",function(){var F=n.getView().getState(n.getSelectionCell()),K="wrap";n.stopEditing();null!=F&&"wrap"==F.style[mxConstants.STYLE_WHITE_SPACE]&&(K=null);n.setCellStyles(mxConstants.STYLE_WHITE_SPACE,K)});this.addAction("rotation",function(){var F="0",K=n.getView().getState(n.getSelectionCell());null!=K&&(F=K.style[mxConstants.STYLE_ROTATION]||F);F=new FilenameDialog(m,F,mxResources.get("apply"),function(c){null!=c&&0<+c.length&&n.setCellStyles(mxConstants.STYLE_ROTATION,c)},mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");m.showDialog(F.container,375,80,!0,!0);F.init()});this.addAction("resetView",function(){n.zoomTo(1);m.resetScrollbars()},null,null,"Enter/Home");this.addAction("zoomIn",function(F){n.isFastZoomEnabled()?n.lazyZoom(!0,!0,m.buttonZoomDelay):n.zoomIn()},null,null,Editor.ctrlKey+" + / Alt+Mousewheel");this.addAction("zoomOut",function(F){n.isFastZoomEnabled()?n.lazyZoom(!1,+!0,m.buttonZoomDelay):n.zoomOut()},null,null,Editor.ctrlKey+" - / Alt+Mousewheel");this.addAction("fitWindow",function(){n.pageVisible&&n.isSelectionEmpty()?n.fitPages():m.fitDiagramToWindow()},null,null,Editor.ctrlKey+"+Shift+H");this.addAction("fitPage",mxUtils.bind(this,function(){n.pageVisible?n.fitPages(1):this.get("pageView").funct()}),null,null,Editor.ctrlKey+"+J");this.addAction("fitTwoPages",mxUtils.bind(this,function(){n.pageVisible?n.fitPages(2):this.get("pageView").funct()}),null,null,+Editor.ctrlKey+"+Shift+J");this.addAction("fitPageWidth",mxUtils.bind(this,function(){n.pageVisible?n.fitPages(1,!0):this.get("pageView").funct()}));this.put("customZoom",new Action("custom...",mxUtils.bind(this,function(){var F=new FilenameDialog(this.editorUi,parseInt(100*n.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(K){K=parseInt(K);!isNaN(K)&&0<K&&n.zoomTo(K/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(F.container,300,80,!0,!0);F.init()}),null,+null,Editor.ctrlKey+"+0"));this.addAction("pageScale...",mxUtils.bind(this,function(){var F=new FilenameDialog(this.editorUi,parseInt(100*n.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(K){K=parseInt(K);!isNaN(K)&&0<K&&(K=new ChangePageSetup(m,null,null,null,K/100),K.ignoreColor=!0,K.ignoreImage=!0,n.model.execute(K))}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(F.container,300,80,!0,!0);F.init()}));G=null;G=this.addAction("grid",function(){n.setGridEnabled(!n.isGridEnabled());+n.defaultGridEnabled=n.isGridEnabled();m.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+Shift+G");G.setToggleAction(!0);G.setSelectedCallback(function(){return n.isGridEnabled()});G.setEnabled(!1);G=this.addAction("guides",function(){n.graphHandler.guidesEnabled=!n.graphHandler.guidesEnabled;m.fireEvent(new mxEventObject("guidesEnabledChanged"))});G.setToggleAction(!0);G.setSelectedCallback(function(){return n.graphHandler.guidesEnabled});G.setEnabled(!1);G=this.addAction("animations",+function(){Editor.enableAnimations=!Editor.enableAnimations;m.fireEvent(new mxEventObject("enableAnimationsChanged"))});G.setToggleAction(!0);G.setSelectedCallback(function(){return Editor.enableAnimations});G=this.addAction("tooltips",function(){n.tooltipHandler.setEnabled(!n.tooltipHandler.isEnabled());m.fireEvent(new mxEventObject("tooltipsEnabledChanged"))});G.setToggleAction(!0);G.setSelectedCallback(function(){return n.tooltipHandler.isEnabled()});G=this.addAction("collapseExpand",function(){var F=+new ChangePageSetup(m);F.ignoreColor=!0;F.ignoreImage=!0;F.foldingEnabled=!n.foldingEnabled;n.model.execute(F)});G.setToggleAction(!0);G.setSelectedCallback(function(){return n.foldingEnabled});G.isEnabled=A;G=this.addAction("pageView",mxUtils.bind(this,function(){m.setPageVisible(!n.pageVisible)}));G.setToggleAction(!0);G.setSelectedCallback(function(){return n.pageVisible});G=this.addAction("connectionArrows",function(){n.connectionArrowsEnabled=!n.connectionArrowsEnabled;m.fireEvent(new mxEventObject("connectionArrowsChanged"))},+null,null,"Alt+Shift+A");G.setToggleAction(!0);G.setSelectedCallback(function(){return n.connectionArrowsEnabled});G=this.addAction("connectionPoints",function(){n.setConnectable(!n.connectionHandler.isEnabled());m.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,"Alt+Shift+O");G.setToggleAction(!0);G.setSelectedCallback(function(){return n.connectionHandler.isEnabled()});G=this.addAction("copyConnect",function(){n.connectionHandler.setCreateTarget(!n.connectionHandler.isCreateTarget());+m.fireEvent(new mxEventObject("copyConnectChanged"))});G.setToggleAction(!0);G.setSelectedCallback(function(){return n.connectionHandler.isCreateTarget()});G.isEnabled=A;G=this.addAction("autosave",function(){m.editor.setAutosave(!m.editor.autosave)});G.setToggleAction(!0);G.setSelectedCallback(function(){return m.editor.autosave});G.isEnabled=A;G.visible=!1;this.addAction("help",function(){var F="";mxResources.isLanguageSupported(mxClient.language)&&(F="_"+mxClient.language);n.openLink(RESOURCES_PATH++"/help"+F+".html")});var S=!1;G=new Action("about",function(){S||(m.showDialog((new AboutDialog(m)).container,320,280,!0,!0,function(){S=!1}),S=!0)});G.getTitle=function(){return mxResources.get("about")+" Graph Editor..."};this.put("about",G);G=mxUtils.bind(this,function(F,K,c,f){return this.addAction(F,function(){if(null!=c&&n.cellEditor.isContentEditing())c();else{n.stopEditing(!1);n.getModel().beginUpdate();try{var l=n.getEditableCells(n.getSelectionCells());n.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,+K,l);(K&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?n.updateLabelElements(l,function(q){q.style.fontWeight=null;"B"==q.nodeName&&n.replaceElement(q)}):(K&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?n.updateLabelElements(l,function(q){q.style.fontStyle=null;"I"==q.nodeName&&n.replaceElement(q)}):(K&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&n.updateLabelElements(l,function(q){q.style.textDecoration=null;"U"==q.nodeName&&n.replaceElement(q)});for(var t=0;t<l.length;t++)0==n.model.getChildCount(l[t])&&+n.autoSizeCell(l[t],!1)}finally{n.getModel().endUpdate()}}},null,null,f)});G("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");G("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I");G("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){m.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000",+"default",n.shapeForegroundColor)});this.addAction("strokeColor...",function(){m.menus.pickColor(mxConstants.STYLE_STROKECOLOR,null,null,"default",n.shapeForegroundColor)});this.addAction("fillColor...",function(){m.menus.pickColor(mxConstants.STYLE_FILLCOLOR,null,null,"default",n.shapeBackgroundColor)});this.addAction("gradientColor...",function(){m.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR,null,null,"default",n.shapeForegroundColor)});this.addAction("backgroundColor...",function(){m.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,+"backcolor",null,"default",n.shapeBackgroundColor)});this.addAction("borderColor...",function(){m.menus.pickColor(mxConstants.STYLE_LABEL_BORDERCOLOR,null,null,"default",n.shapeForegroundColor)});this.addAction("removeFormat",function(){if(n.isEnabled()&&!n.isSelectionEmpty()&&!n.isEditing()){n.getModel().beginUpdate();try{for(var F=n.getSelectionCells(),K=0;K<F.length;K++)n.removeTextStyleForCell(F[K],!0)}finally{n.getModel().endUpdate()}}});this.addAction("vertical",function(){m.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,+!0)});this.addAction("shadow",function(){m.menus.toggleStyle(mxConstants.STYLE_SHADOW)});this.addAction("solid",function(){n.getModel().beginUpdate();try{n.setCellStyles(mxConstants.STYLE_DASHED,null),n.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",[null,null],"cells",n.getSelectionCells()))}finally{n.getModel().endUpdate()}});this.addAction("dashed",function(){n.getModel().beginUpdate();+try{n.setCellStyles(mxConstants.STYLE_DASHED,"1"),n.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1",null],"cells",n.getSelectionCells()))}finally{n.getModel().endUpdate()}});this.addAction("dotted",function(){n.getModel().beginUpdate();try{n.setCellStyles(mxConstants.STYLE_DASHED,"1"),n.setCellStyles(mxConstants.STYLE_DASH_PATTERN,"1 4"),m.fireEvent(new mxEventObject("styleChanged",+"keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1","1 4"],"cells",n.getSelectionCells()))}finally{n.getModel().endUpdate()}});this.addAction("sharp",function(){n.getModel().beginUpdate();try{n.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),n.setCellStyles(mxConstants.STYLE_CURVED,"0"),m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","0"],"cells",n.getSelectionCells()))}finally{n.getModel().endUpdate()}});+this.addAction("rounded",function(){n.getModel().beginUpdate();try{n.setCellStyles(mxConstants.STYLE_ROUNDED,"1"),n.setCellStyles(mxConstants.STYLE_CURVED,"0"),m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["1","0"],"cells",n.getSelectionCells()))}finally{n.getModel().endUpdate()}});this.addAction("toggleRounded",function(){if(!n.isSelectionEmpty()&&n.isEnabled()){n.getModel().beginUpdate();try{var F=n.getSelectionCells(),K=n.getCurrentCellStyle(F[0]),+c="1"==mxUtils.getValue(K,mxConstants.STYLE_ROUNDED,"0")?"0":"1";n.setCellStyles(mxConstants.STYLE_ROUNDED,c);n.setCellStyles(mxConstants.STYLE_CURVED,null);m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[c,"0"],"cells",n.getSelectionCells()))}finally{n.getModel().endUpdate()}}});this.addAction("curved",function(){n.getModel().beginUpdate();try{n.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),n.setCellStyles(mxConstants.STYLE_CURVED,+"1"),m.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","1"],"cells",n.getSelectionCells()))}finally{n.getModel().endUpdate()}});this.addAction("collapsible",function(){var F=n.view.getState(n.getSelectionCell()),K="1";null!=F&&null!=n.getFoldingImage(F)&&(K="0");n.setCellStyles("collapsible",K);m.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[K],"cells",n.getSelectionCells()))});this.addAction("editStyle...",+mxUtils.bind(this,function(){var F=n.getEditableCells(n.getSelectionCells());if(null!=F&&0<F.length){var K=n.getModel();K=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",K.getStyle(F[0])||"",function(c){null!=c&&n.setCellStyle(mxUtils.trim(c),F)},null,null,400,220);this.editorUi.showDialog(K.container,420,300,!0,!0);K.init()}}),null,null,Editor.ctrlKey+"+E");this.addAction("setAsDefaultStyle",function(){n.isEnabled()&&!n.isSelectionEmpty()&&m.setDefaultStyle(n.getSelectionCell())},+null,null,Editor.ctrlKey+"+Shift+D");this.addAction("clearDefaultStyle",function(){n.isEnabled()&&m.clearDefaultStyle()},null,null,Editor.ctrlKey+"+Shift+R");this.addAction("addWaypoint",function(){var F=n.getSelectionCell();if(null!=F&&n.getModel().isEdge(F)){var K=v.graph.selectionCellsHandler.getHandler(F);if(K instanceof mxEdgeHandler){var c=n.view.translate,f=n.view.scale,l=c.x;c=c.y;F=n.getModel().getParent(F);for(var t=n.getCellGeometry(F);n.getModel().isVertex(F)&&null!=t;)l+=t.x,c+=t.y,F=+n.getModel().getParent(F),t=n.getCellGeometry(F);l=Math.round(n.snap(n.popupMenuHandler.triggerX/f-l));f=Math.round(n.snap(n.popupMenuHandler.triggerY/f-c));K.addPointAt(K.state,l,f)}}});this.addAction("removeWaypoint",function(){var F=m.actions.get("removeWaypoint");null!=F.handler&&F.handler.removePoint(F.handler.state,F.index)});this.addAction("clearAnchors",function(){var F=n.getSelectionCells();if(null!=F){F=n.getEditableCells(n.addAllEdges(F));n.getModel().beginUpdate();try{for(var K=0;K<F.length;K++){var c=+F[K];n.getModel().isEdge(c)&&(n.setCellStyles(mxConstants.STYLE_EXIT_X,null,[c]),n.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[c]),n.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[c]),n.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[c]))}}finally{n.getModel().endUpdate()}}});this.addAction("clearWaypoints",function(){var F=n.getSelectionCells();if(null!=F){F=n.getEditableCells(n.addAllEdges(F));n.getModel().beginUpdate();try{for(var K=0;K<F.length;K++){var c=F[K];if(n.getModel().isEdge(c)){var f=n.getCellGeometry(c);+null!=f&&(f=f.clone(),f.points=null,f.x=0,f.y=0,f.offset=null,n.getModel().setGeometry(c,f))}}}finally{n.getModel().endUpdate()}}},null,null,"Alt+Shift+R");G=this.addAction("subscript",mxUtils.bind(this,function(){n.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");G=this.addAction("superscript",mxUtils.bind(this,function(){n.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");G=this.addAction("decreaseFontSize",+mxUtils.bind(this,function(){if(!n.isSelectionEmpty()){var F=n.getCurrentCellStyle(n.getSelectionCell());F=mxUtils.getValue(F,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);n.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.max(1,F-1),n.getSelectionCells())}}),null,null,Editor.ctrlKey+"+Shift + (Numpad)");G=this.addAction("increaseFontSize",mxUtils.bind(this,function(){if(!n.isSelectionEmpty()){var F=n.getCurrentCellStyle(n.getSelectionCell());F=mxUtils.getValue(F,mxConstants.STYLE_FONTSIZE,+mxConstants.DEFAULT_FONTSIZE);n.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.min(100,F+1),n.getSelectionCells())}}),null,null,Editor.ctrlKey+"+Shift - (Numpad)");this.addAction("image...",function(){if(n.isEnabled()&&!n.isCellLocked(n.getDefaultParent())){var F=mxResources.get("image")+" ("+mxResources.get("url")+"):",K=n.getView().getState(n.getSelectionCell()),c="",f=null;null!=K&&(c=K.style[mxConstants.STYLE_IMAGE]||c,f=K.style[mxConstants.STYLE_CLIP_PATH]||f);var l=n.cellEditor.saveSelection();+m.showImageDialog(F,c,function(t,q,D,H,N,L){if(n.cellEditor.isContentEditing())n.cellEditor.restoreSelection(l),n.insertImage(t,q,D);else{var J=n.getSelectionCells();if(null!=t&&(0<t.length||0<J.length)){var Y=null;n.getModel().beginUpdate();try{if(0==J.length){J=[n.insertVertex(n.getDefaultParent(),null,"",0,0,q,D,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];var ha=n.getCenterInsertPoint(n.getBoundingBoxFromGeometry(J,!0));J[0].geometry.x=ha.x;J[0].geometry.y=+ha.y;null!=H&&g(J[0],H,N,L,n);Y=J;n.fireEvent(new mxEventObject("cellsInserted","cells",Y))}n.setCellStyles(mxConstants.STYLE_IMAGE,0<t.length?t:null,J);var ea=n.getCurrentCellStyle(J[0]);"image"!=ea[mxConstants.STYLE_SHAPE]&&"label"!=ea[mxConstants.STYLE_SHAPE]?n.setCellStyles(mxConstants.STYLE_SHAPE,"image",J):0==t.length&&n.setCellStyles(mxConstants.STYLE_SHAPE,null,J);null==H&&n.setCellStyles(mxConstants.STYLE_CLIP_PATH,null,J);if(null!=q&&null!=D)for(t=0;t<J.length;t++){var aa=J[t];if("0"!=n.getCurrentCellStyle(aa).expand){var na=+n.getModel().getGeometry(aa);null!=na&&(na=na.clone(),na.width=q,na.height=D,n.getModel().setGeometry(aa,na))}null!=H&&g(aa,H,N,L,n)}}finally{n.getModel().endUpdate()}null!=Y&&(n.setSelectionCells(Y),n.scrollCellToVisible(Y[0]))}}},n.cellEditor.isContentEditing(),!n.cellEditor.isContentEditing(),!0,f)}}).isEnabled=A;this.addAction("crop...",function(){var F=n.getSelectionCell();if(n.isEnabled()&&!n.isCellLocked(n.getDefaultParent())&&null!=F){var K=n.getCurrentCellStyle(F),c=K[mxConstants.STYLE_IMAGE],+f=K[mxConstants.STYLE_SHAPE];c&&"image"==f&&(K=new CropImageDialog(m,c,K[mxConstants.STYLE_CLIP_PATH],function(l,t,q){g(F,l,t,q,n)}),m.showDialog(K.container,300,390,!0,!0))}}).isEnabled=A;G=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(m,document.body.offsetWidth-280,120,212,200),this.layersWindow.window.addListener("show",mxUtils.bind(this,function(){m.fireEvent(new mxEventObject("layers"))})),this.layersWindow.window.addListener("hide",+function(){m.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),m.fireEvent(new mxEventObject("layers")),this.layersWindow.init()):this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+L");G.setToggleAction(!0);G.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));G=this.addAction("format",mxUtils.bind(this,function(){m.toggleFormatPanel()}),null,+null,Editor.ctrlKey+"+Shift+P");G.setToggleAction(!0);G.setSelectedCallback(mxUtils.bind(this,function(){return m.isFormatPanelVisible()}));G=this.addAction("outline",mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(m,document.body.offsetWidth-260,100,180,180),this.outlineWindow.window.addListener("show",mxUtils.bind(this,function(){m.fireEvent(new mxEventObject("outline"))})),this.outlineWindow.window.addListener("hide",function(){m.fireEvent(new mxEventObject("outline"))}),+this.outlineWindow.window.setVisible(!0),m.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+O");G.setToggleAction(!0);G.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}));this.addAction("editConnectionPoints...",function(){var F=n.getSelectionCell();if(n.isEnabled()&&!n.isCellLocked(n.getDefaultParent())&&null!=F&&null!=F.geometry){var K=+new ConnectionPointsDialog(m,F);m.showDialog(K.container,350,450,!0,!1,function(){K.destroy()});K.init()}},null,null,"Alt+Shift+Q").isEnabled=A};Actions.prototype.addAction=function(b,e,g,m,v){var n=b;"..."==n.substring(n.length-3)&&(n=n.substring(0,n.length-3));return this.put(n,new Action(b,e,g,m,v))};Actions.prototype.put=function(b,e){return this.actions[b]=e};Actions.prototype.get=function(b){return this.actions[b]};function Action(b,e,g,m,v){mxEventSource.call(this);this.label=b;this.funct=this.createFunction(e);this.enabled=null!=g?g:!0;this.iconCls=m;this.shortcut=v;this.visible=!0}mxUtils.extend(Action,mxEventSource);Action.prototype.getTitle=function(){var b=this.label;"..."==b.substring(b.length-3)?(b=b.substring(0,b.length-3),b=mxResources.get(b)+"..."):b=mxResources.get(b);return b};Action.prototype.createFunction=function(b){return b};Action.prototype.setEnabled=function(b){this.enabled!=b&&(this.enabled=b,this.fireEvent(new mxEventObject("stateChanged")))};Action.prototype.isEnabled=function(){return this.enabled};Action.prototype.setToggleAction=function(b){this.toggleAction=b};Action.prototype.setSelectedCallback=function(b){this.selectedCallback=b};Action.prototype.isSelected=function(){return this.selectedCallback()};DrawioFile=function(b,e){mxEventSource.call(this);this.ui=b;this.setData(e||"");this.initialData=this.getData();this.created=(new Date).getTime();this.stats={opened:0,merged:0,fileMerged:0,fileReloaded:0,conflicts:0,timeouts:0,saved:0,closed:0,destroyed:0,joined:0,checksumErrors:0,bytesSent:0,bytesReceived:0,msgSent:0,msgReceived:0,cacheHits:0,cacheMiss:0,cacheFail:0}};DrawioFile.SYNC=urlParams.sync||"auto";DrawioFile.LAST_WRITE_WINS=!0;DrawioFile.RESTRICT_EXPORT=!1;mxUtils.extend(DrawioFile,mxEventSource);DrawioFile.prototype.allChangesSavedKey="allChangesSaved";DrawioFile.prototype.savingSpinnerKey="saving";DrawioFile.prototype.savingStatusKey="saving";DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.optimisticSyncDelay=300;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.lastSaved=null;DrawioFile.prototype.lastChanged=null;DrawioFile.prototype.opened=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.shadowModified=!1;DrawioFile.prototype.data=null;DrawioFile.prototype.shadowPages=null;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=3E5;DrawioFile.prototype.inConflictState=!1;DrawioFile.prototype.invalidChecksum=!1;DrawioFile.prototype.ageStart=null;DrawioFile.prototype.getSize=function(){return null!=this.data?this.data.length:0};DrawioFile.prototype.getShadowPages=function(){null==this.shadowPages&&(this.shadowPages=this.ui.getPagesForXml(this.initialData));return this.shadowPages};DrawioFile.prototype.setShadowPages=function(b){this.shadowPages=b};-DrawioFile.prototype.synchronizeFile=function(b,e){if(this.savingFile)null!=e&&e({message:mxResources.get("busy")});else{var g=!0,m=window.setTimeout(mxUtils.bind(this,function(){g=!1;null!=e&&e({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.synchronizeFile(b,e)})})}),this.ui.timeout),v=mxUtils.bind(this,function(A){g&&(window.clearTimeout(m),null!=e&&e(A))}),p=mxUtils.bind(this,function(){return!g});null!=this.sync?this.sync.fileChanged(mxUtils.bind(this,-function(A){g&&(window.clearTimeout(m),this.sync.cleanup(b,e,A))}),v,p):this.updateFile(mxUtils.bind(this,function(){g&&(window.clearTimeout(m),null!=b&&b())}),v,p)}};-DrawioFile.prototype.updateFile=function(b,e,g,m,v){null!=g&&g()||(EditorUi.debug("DrawioFile.updateFile",[this],"immediate",v,"invalidChecksum",this.invalidChecksum),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=e&&e():this.getLatestVersion(mxUtils.bind(this,function(p){try{null!=g&&g()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum,"latestFile",[p]),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=e&&e():null!=p?this.mergeFile(p,b,e,+DrawioFile.prototype.synchronizeFile=function(b,e){if(this.savingFile)null!=e&&e({message:mxResources.get("busy")});else{var g=!0,m=window.setTimeout(mxUtils.bind(this,function(){g=!1;null!=e&&e({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.synchronizeFile(b,e)})})}),this.ui.timeout),v=mxUtils.bind(this,function(A){g&&(window.clearTimeout(m),null!=e&&e(A))}),n=mxUtils.bind(this,function(){return!g});null!=this.sync?this.sync.fileChanged(mxUtils.bind(this,+function(A){g&&(window.clearTimeout(m),this.sync.cleanup(b,e,A))}),v,n):this.updateFile(mxUtils.bind(this,function(){g&&(window.clearTimeout(m),null!=b&&b())}),v,n)}};+DrawioFile.prototype.updateFile=function(b,e,g,m,v){null!=g&&g()||(EditorUi.debug("DrawioFile.updateFile",[this],"immediate",v,"invalidChecksum",this.invalidChecksum),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=e&&e():this.getLatestVersion(mxUtils.bind(this,function(n){try{null!=g&&g()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum,"latestFile",[n]),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=e&&e():null!=n?this.mergeFile(n,b,e,m,v):this.reloadFile(b,e))}catch(A){null!=e&&e(A)}}),e))};-DrawioFile.prototype.mergeFile=function(b,e,g,m,v){try{var p=b.getShadowPages();if(null!=p&&0<p.length){var A=this.getShadowPages(),H=[this.ui.diffPages(null!=m?m:A,p)],S=this.ignorePatches(H);if(S)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",S),null!=e&&e();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var F=this.isModified()?this.ui.diffPages(A,-this.isRealtime()?this.ownPages:this.ui.pages):null,K=this.ui.patchPages(this.ui.clonePages(A),H[0]),c=this.ui.getHashValueForPages(K,{}),f=this.ui.getHashValueForPages(p,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",A,"pages",p,"patched",K,"patches",H,"changes",F,"checksum",c,"current",f,"valid",c==f,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",v);if(null!=c&&c!=f)this.checksumError(g,H,null,null,"mergeFile",-c,f,b.getCurrentRevisionId());else{this.setShadowPages(p);if(null!=this.sync){var l=this.sync.patchRealtime(H,DrawioFile.LAST_WRITE_WINS?F:null,null,v);null==l||mxUtils.isEmptyObject(l)||H.push(l)}this.patch(H,DrawioFile.LAST_WRITE_WINS?F:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());this.descriptorChanged();null!=e&&e()}}catch(D){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=g&&g(D);try{var t=this.getCurrentUser(),q=null!=t?-t.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),q,D)}catch(G){}}}else throw Error(mxResources.get("notADiagramFile"));}catch(D){null!=g&&g(D)}};+DrawioFile.prototype.mergeFile=function(b,e,g,m,v){try{var n=b.getShadowPages();if(null!=n&&0<n.length){var A=this.getShadowPages(),G=[this.ui.diffPages(null!=m?m:A,n)],S=this.ignorePatches(G);if(S)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",S),null!=e&&e();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var F=this.isModified()?this.ui.diffPages(A,+this.isRealtime()?this.ownPages:this.ui.pages):null,K=this.ui.patchPages(this.ui.clonePages(A),G[0]),c=this.ui.getHashValueForPages(K,{}),f=this.ui.getHashValueForPages(n,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",A,"pages",n,"patched",K,"patches",G,"changes",F,"checksum",c,"current",f,"valid",c==f,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",v);if(null!=c&&c!=f)this.checksumError(g,G,null,null,"mergeFile",+c,f,b.getCurrentRevisionId());else{this.setShadowPages(n);if(null!=this.sync){var l=this.sync.patchRealtime(G,DrawioFile.LAST_WRITE_WINS?F:null,null,v);null==l||mxUtils.isEmptyObject(l)||G.push(l)}this.patch(G,DrawioFile.LAST_WRITE_WINS?F:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());this.descriptorChanged();null!=e&&e()}}catch(D){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=g&&g(D);try{var t=this.getCurrentUser(),q=null!=t?+t.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),q,D)}catch(H){}}}else throw Error(mxResources.get("notADiagramFile"));}catch(D){null!=g&&g(D)}};DrawioFile.prototype.getAnonymizedXmlForPages=function(b){var e=new mxCodec(mxUtils.createXmlDocument()),g=e.document.createElement("mxfile");if(null!=b)for(var m=0;m<b.length;m++){var v=e.encode(new mxGraphModel(b[m].root));"1"!=urlParams.dev&&(v=this.ui.anonymizeNode(v,!0));v.setAttribute("id",b[m].getId());b[m].viewState&&this.ui.editor.graph.saveViewState(b[m].viewState,v,!0);g.appendChild(v)}return mxUtils.getPrettyXml(g)};DrawioFile.prototype.compressReportData=function(b,e,g){e=null!=e?e:1E4;null!=g&&null!=b&&b.length>g?b=b.substring(0,g)+"[...]":null!=b&&b.length>e&&(b=Graph.compress(b)+"\n");return b};-DrawioFile.prototype.checksumError=function(b,e,g,m,v,p,A,H){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var S=this.getCurrentUser(),F=null!=S?S.id:"unknown",K=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",c=JSON.stringify(e).length,f=null;if(null!=e&&1E3>c){b=[];for(g=0;g<e.length;g++)b.push(this.ui.anonymizePatch(e[g]));f=JSON.stringify(b);f=null!=f&&1E3>-f.length?Graph.compress(f):null}this.getLatestVersion(mxUtils.bind(this,function(l){try{var t=null!=f?"report":"error",q=this.ui.getHashValueForPages(l.getShadowPages()),D="unknown",G="unknown",N="unknown";try{var L=null!=l.initialData&&0<l.initialData.length?mxUtils.parseXml(l.initialData).documentElement:null;null!=L&&(null!=L.getAttribute("version")&&(D=L.getAttribute("version")),null!=L.getAttribute("agent")&&(G=L.getAttribute("agent")),null!=L.getAttribute("type")&&(N=L.getAttribute("type")))}catch(J){}EditorUi.logError("Checksum "+-t+" in "+v,null,this.getMode()+"."+K,"user_"+F+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+c+"-patches_"+e.length+(null!=f?"-json_"+f:"")+"-size_"+this.getSize()+(null!=p?"-expected_"+p:"")+(null!=A?"-current_"+A:"")+(null!=H?"-rev_"+this.ui.hashValue(H):"")+(null!=q?"-latest_"+q:"")+"-latestRev_"+this.ui.hashValue(l.getCurrentRevisionId())+("-latestVersion_"+D)+("-latestAgent_"+G)+("-latestType_"+N));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+K,action:v,label:"user_"++DrawioFile.prototype.checksumError=function(b,e,g,m,v,n,A,G){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var S=this.getCurrentUser(),F=null!=S?S.id:"unknown",K=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",c=JSON.stringify(e).length,f=null;if(null!=e&&1E3>c){b=[];for(g=0;g<e.length;g++)b.push(this.ui.anonymizePatch(e[g]));f=JSON.stringify(b);f=null!=f&&1E3>+f.length?Graph.compress(f):null}this.getLatestVersion(mxUtils.bind(this,function(l){try{var t=null!=f?"report":"error",q=this.ui.getHashValueForPages(l.getShadowPages()),D="unknown",H="unknown",N="unknown";try{var L=null!=l.initialData&&0<l.initialData.length?mxUtils.parseXml(l.initialData).documentElement:null;null!=L&&(null!=L.getAttribute("version")&&(D=L.getAttribute("version")),null!=L.getAttribute("agent")&&(H=L.getAttribute("agent")),null!=L.getAttribute("type")&&(N=L.getAttribute("type")))}catch(J){}EditorUi.logError("Checksum "++t+" in "+v,null,this.getMode()+"."+K,"user_"+F+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+c+"-patches_"+e.length+(null!=f?"-json_"+f:"")+"-size_"+this.getSize()+(null!=n?"-expected_"+n:"")+(null!=A?"-current_"+A:"")+(null!=G?"-rev_"+this.ui.hashValue(G):"")+(null!=q?"-latest_"+q:"")+"-latestRev_"+this.ui.hashValue(l.getCurrentRevisionId())+("-latestVersion_"+D)+("-latestAgent_"+H)+("-latestType_"+N));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+K,action:v,label:"user_"+F+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+c+"-patches_"+e.length+"-size_"+this.getSize()})}catch(J){}}),function(){})}catch(l){}};-DrawioFile.prototype.sendErrorReport=function(b,e,g,m){try{var v=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),p=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),A=this.getCurrentUser(),H=null!=A?this.ui.hashValue(A.id):"unknown",S=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",F=this.getTitle(),K=F.lastIndexOf(".");A="xml";0<K&&(A=F.substring(K));var c=null!=g?g.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()+-":\n\nAppVersion="+navigator.appVersion+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+A+")\nUser="+H+S+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=e?"\n\n"+e:-"")+(null!=g?"\n\nError: "+g.message:"")+"\n\nStack:\n"+c+"\n\nShadow:\n"+v+"\n\nData:\n"+p,m)}catch(f){}};-DrawioFile.prototype.reloadFile=function(b,e){try{this.stats.fileReloaded++;var g=this.ui.diffPages(this.getShadowPages(),this.isRealtime()?this.ownPages:this.ui.pages),m=this.ui.editor.graph,v=m.getSelectionCells(),p=m.getViewState(),A=this.ui.currentPage;this.getLatestVersion(mxUtils.bind(this,function(H){EditorUi.debug("DrawioFile.reloadFile",[this],"modified",this.isModified(),"rev",this.getCurrentRevisionId(),"changes",[g],"viewState",[p],"latestFile",H);null!=H?(this.ui.replaceFileData(H.getData(),-[g]),this.ui.restoreViewState(A,p,v),this.setDescriptor(H.getDescriptor()),this.descriptorChanged(),null!=b&&b()):(this.ui.spinner.stop(),this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){var S=this.ui.getCurrentFile();null!=S&&(S.stats=this.stats,S.patch([g]),S.fileChanged());this.ui.restoreViewState(A,p,v);null!=b&&b()}else null!=e&&e(this.ui.fileLoadedError)}),!0))}),e)}catch(H){null!=e&&e(H)}};+DrawioFile.prototype.sendErrorReport=function(b,e,g,m){try{var v=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),n=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),A=this.getCurrentUser(),G=null!=A?this.ui.hashValue(A.id):"unknown",S=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",F=this.getTitle(),K=F.lastIndexOf(".");A="xml";0<K&&(A=F.substring(K));var c=null!=g?g.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()++":\n\nAppVersion="+navigator.appVersion+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+A+")\nUser="+G+S+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=e?"\n\n"+e:+"")+(null!=g?"\n\nError: "+g.message:"")+"\n\nStack:\n"+c+"\n\nShadow:\n"+v+"\n\nData:\n"+n,m)}catch(f){}};+DrawioFile.prototype.reloadFile=function(b,e){try{this.stats.fileReloaded++;var g=this.ui.diffPages(this.getShadowPages(),this.isRealtime()?this.ownPages:this.ui.pages),m=this.ui.editor.graph,v=m.getSelectionCells(),n=m.getViewState(),A=this.ui.currentPage;this.getLatestVersion(mxUtils.bind(this,function(G){EditorUi.debug("DrawioFile.reloadFile",[this],"modified",this.isModified(),"rev",this.getCurrentRevisionId(),"changes",[g],"viewState",[n],"latestFile",G);null!=G?(this.ui.replaceFileData(G.getData(),+[g]),this.ui.restoreViewState(A,n,v),this.setDescriptor(G.getDescriptor()),this.descriptorChanged(),null!=b&&b()):(this.ui.spinner.stop(),this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){var S=this.ui.getCurrentFile();null!=S&&(S.stats=this.stats,S.patch([g]),S.fileChanged());this.ui.restoreViewState(A,n,v);null!=b&&b()}else null!=e&&e(this.ui.fileLoadedError)}),!0))}),e)}catch(G){null!=e&&e(G)}};DrawioFile.prototype.copyFile=function(b,e){this.ui.editor.editAsNew(this.ui.getFileData(!0),this.ui.getCopyFilename(this))};DrawioFile.prototype.ignorePatches=function(b){var e=!0;if(null!=b)for(var g=0;g<b.length&&e;g++)e=e&&mxUtils.isEmptyObject(b[g]);return e};-DrawioFile.prototype.patch=function(b,e,g,m){if(null!=b){var v=this.ui.editor.undoManager,p=v.history.slice(),A=v.indexOfNextAdd,H=this.ui.editor.graph;H.container.style.visibility="hidden";var S=this.changeListenerEnabled;this.changeListenerEnabled=g;var F=H.foldingEnabled,K=H.mathEnabled,c=H.cellRenderer.redraw;H.cellRenderer.redraw=function(G){G.view.graph.isEditing(G.cell)&&(G.view.graph.scrollCellToVisible(G.cell),G.view.graph.cellEditor.resize());c.apply(this,arguments)};H.model.beginUpdate();+DrawioFile.prototype.patch=function(b,e,g,m){if(null!=b){var v=this.ui.editor.undoManager,n=v.history.slice(),A=v.indexOfNextAdd,G=this.ui.editor.graph;G.container.style.visibility="hidden";var S=this.changeListenerEnabled;this.changeListenerEnabled=g;var F=G.foldingEnabled,K=G.mathEnabled,c=G.cellRenderer.redraw;G.cellRenderer.redraw=function(H){H.view.graph.isEditing(H.cell)&&(H.view.graph.scrollCellToVisible(H.cell),H.view.graph.cellEditor.resize());c.apply(this,arguments)};G.model.beginUpdate();try{if(g){for(var f=this.ui.pages.slice(),l=this.ui.currentPage,t=this.ui.applyPatches(this.ui.pages,b,!0,e,this.isModified()),q=0;q<t.length;q++){var D=mxUtils.indexOf(this.ui.pages,t[q]);0>D?this.ui.insertPage(t[q],Math.min(q,this.ui.pages.length)):this.ui.movePage(D,q)}for(q=0;q<f.length;q++)0>mxUtils.indexOf(t,f[q])&&this.ui.removePage(f[q]);0<=mxUtils.indexOf(this.ui.pages,l)&&this.ui.selectPage(l,!0)}else this.ui.pages=this.ui.applyPatches(this.ui.pages,b,!0,e,this.isModified());0==this.ui.pages.length&&-this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0);H.checkDefaultParent()}finally{H.container.style.visibility="";H.model.endUpdate();H.cellRenderer.redraw=c;this.changeListenerEnabled=S;g||(v.history=p,v.indexOfNextAdd=A,v.fireEvent(new mxEventObject(mxEvent.CLEAR)));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)K!=H.mathEnabled?(this.ui.editor.updateGraphComponents(),H.refresh()):(F!=H.foldingEnabled?-H.view.revalidate():H.view.validate(),H.sizeDidChange());null!=this.sync&&this.isRealtime()&&!m&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages));this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",[this],"patches",b,"resolver",e,"undoable",g)}return b};-DrawioFile.prototype.save=function(b,e,g,m,v,p){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",m,"overwrite",v,"manual",p,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!v&&this.invalidChecksum)if(null!=g)g({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=e&&e();else if(null!=g)g({message:mxResources.get("readOnly")});+this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0);G.checkDefaultParent()}finally{G.container.style.visibility="";G.model.endUpdate();G.cellRenderer.redraw=c;this.changeListenerEnabled=S;g||(v.history=n,v.indexOfNextAdd=A,v.fireEvent(new mxEventObject(mxEvent.CLEAR)));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)K!=G.mathEnabled?(this.ui.editor.updateGraphComponents(),G.refresh()):(F!=G.foldingEnabled?+G.view.revalidate():G.view.validate(),G.sizeDidChange());null!=this.sync&&this.isRealtime()&&!m&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages));this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",[this],"patches",b,"resolver",e,"undoable",g)}return b};+DrawioFile.prototype.save=function(b,e,g,m,v,n){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",m,"overwrite",v,"manual",n,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!v&&this.invalidChecksum)if(null!=g)g({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=e&&e();else if(null!=g)g({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));}catch(A){if(null!=g)g(A);else throw A;}};DrawioFile.prototype.createData=function(){var b=this.ui.pages;if(this.isRealtime()&&(this.ui.pages=this.ownPages,null!=this.ui.currentPage)){var e=this.ui.getPageById(this.ui.currentPage.getId(),this.ownPages);null!=e&&(e.viewState=this.ui.editor.graph.getViewState(),e.needsUpdate=!0)}e=this.ui.getFileData(null,null,null,null,null,null,null,null,this,!this.isCompressed());this.ui.pages=b;return e};DrawioFile.prototype.updateFileData=function(){null!=this.sync&&this.sync.sendLocalChanges();this.setData(this.createData());null!=this.sync&&this.sync.fileDataUpdated()};DrawioFile.prototype.isCompressedStorage=function(){return Editor.defaultCompressed};DrawioFile.prototype.isCompressed=function(){var b=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("compressed"):null;return null!=b?"false"!=b:this.isCompressedStorage()&&Editor.compressXml};DrawioFile.prototype.setLocked=function(b){this.ui.fileNode.setAttribute("locked",b?"true":"false");this.ui.fireEvent(new mxEventObject("lockedChanged"));this.fileChanged();b&&this.ui.editor.graph.clearSelection()};DrawioFile.prototype.isLocked=function(){var b=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("locked"):null;return null!=b?"true"==b:!1};DrawioFile.prototype.saveAs=function(b,e,g){};DrawioFile.prototype.saveFile=function(b,e,g,m){};DrawioFile.prototype.getFileUrl=function(){return null};@@ -3131,28 +3135,28 @@ DrawioFile.prototype.handleFileSuccess=function(b){this.ui.spinner.stop();this.uthis.ui.updateStatus(mxUtils.bind(this,function(){this.addAllSavedStatus()})),null!=this.sync&&(this.sync.resetUpdateStatusThread(),this.sync.remoteFileChanged&&(this.sync.remoteFileChanged=!1,this.sync.fileChangedNotify()))):this.ui.clearStatus())};DrawioFile.prototype.handleFileError=function(b,e){this.ui.spinner.stop();this.ui.getCurrentFile()==this&&(this.inConflictState?this.handleConflictError(b,e):(this.isModified()&&this.addUnsavedStatus(b),e?this.ui.handleError(b,null!=b?mxResources.get("errorSavingFile"):null):this.isModified()||this.ui.updateStatus(mxUtils.bind(this,function(){var g=this.getErrorMessage(b);null!=g&&60<g.length&&(g=g.substring(0,60)+"...");this.ui.editor.setStatus('<div class="geStatusAlert">'+mxUtils.htmlEntities(mxResources.get("error"))+(null!=g?" ("+mxUtils.htmlEntities(g)+")":"")+"</div>")}))))};-DrawioFile.prototype.handleConflictError=function(b,e){var g=mxUtils.bind(this,function(){this.handleFileSuccess(!0)}),m=mxUtils.bind(this,function(A){this.handleFileError(A,!0)}),v=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get(this.savingSpinnerKey))&&(this.ui.clearStatus(),this.save(!0,g,m,null,!0,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage))}),p=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("updatingDocument"))&&-this.synchronizeFile(mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.spinner.spin(document.body,mxResources.get(this.savingSpinnerKey))&&this.save(!0,g,m,null,null,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage)}),m)});"none"==DrawioFile.SYNC?this.showCopyDialog(g,m,v):this.invalidChecksum&&e?this.showRefreshDialog(g,m,this.getErrorMessage(b)):e?this.showConflictDialog(v,p):this.addConflictStatus(this.getErrorMessage(b),mxUtils.bind(this,function(){this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("updatingDocument")));+DrawioFile.prototype.handleConflictError=function(b,e){var g=mxUtils.bind(this,function(){this.handleFileSuccess(!0)}),m=mxUtils.bind(this,function(A){this.handleFileError(A,!0)}),v=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get(this.savingSpinnerKey))&&(this.ui.clearStatus(),this.save(!0,g,m,null,!0,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage))}),n=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("updatingDocument"))&&+this.synchronizeFile(mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.spinner.spin(document.body,mxResources.get(this.savingSpinnerKey))&&this.save(!0,g,m,null,null,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage)}),m)});"none"==DrawioFile.SYNC?this.showCopyDialog(g,m,v):this.invalidChecksum&&e?this.showRefreshDialog(g,m,this.getErrorMessage(b)):e?this.showConflictDialog(v,n):this.addConflictStatus(this.getErrorMessage(b),mxUtils.bind(this,function(){this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("updatingDocument")));this.synchronizeFile(g,m)}))};DrawioFile.prototype.getErrorMessage=function(b){var e=null!=b?null!=b.error?b.error.message:b.message:null;null==e&&null!=b&&b.code==App.ERROR_TIMEOUT?e=mxResources.get("timeout"):"0"==e&&(e=mxResources.get("noResponse"));return e};DrawioFile.prototype.isOverdue=function(){return null!=this.ageStart&&Date.now()-this.ageStart.getTime()>=this.ui.warnInterval};-DrawioFile.prototype.compressionChanged=function(b){var e=null!=this.ownPages?this.ownPages:this.ui.pages;if(null!=e)for(var g=0;g<e.length;g++){var m=e[g].node;if(null!=m&&(null==this.ui.currentPage||this.ui.currentPage.getId()!=e[g].getId())){var v=m.getElementsByTagName("mxGraphModel");v=0<v.length?v[0]:null;var p=Graph.decompress(mxUtils.getNodeValue(m));b?0==p.length&&null!=v&&(EditorUi.removeChildNodes(m),mxUtils.setTextContent(m,Graph.compressNode(v)),EditorUi.debug("DrawioFile.compressionChanged",-[this],"Page "+g+" compressed")):0<p.length&&null==v&&(EditorUi.removeChildNodes(m),m.appendChild(mxUtils.parseXml(p).documentElement),EditorUi.debug("DrawioFile.compressionChanged",[this],"Page "+g+" decompressed"))}}};DrawioFile.prototype.fileReplaced=function(b){this.inConflictState=this.invalidChecksum=!1;null!=b&&this.patch(b);null!=this.sync&&this.sync.initRealtime();EditorUi.debug("DrawioFile.fileReplaced",[this],"patches",b)};+DrawioFile.prototype.compressionChanged=function(b){var e=null!=this.ownPages?this.ownPages:this.ui.pages;if(null!=e)for(var g=0;g<e.length;g++){var m=e[g].node;if(null!=m&&(null==this.ui.currentPage||this.ui.currentPage.getId()!=e[g].getId())){var v=m.getElementsByTagName("mxGraphModel");v=0<v.length?v[0]:null;var n=Graph.decompress(mxUtils.getNodeValue(m));b?0==n.length&&null!=v&&(EditorUi.removeChildNodes(m),mxUtils.setTextContent(m,Graph.compressNode(v)),EditorUi.debug("DrawioFile.compressionChanged",+[this],"Page "+g+" compressed")):0<n.length&&null==v&&(EditorUi.removeChildNodes(m),m.appendChild(mxUtils.parseXml(n).documentElement),EditorUi.debug("DrawioFile.compressionChanged",[this],"Page "+g+" decompressed"))}}};DrawioFile.prototype.fileReplaced=function(b){this.inConflictState=this.invalidChecksum=!1;null!=b&&this.patch(b);null!=this.sync&&this.sync.initRealtime();EditorUi.debug("DrawioFile.fileReplaced",[this],"patches",b)};DrawioFile.prototype.fileChanged=function(b){b=null!=b?b:!0;this.lastChanged=new Date;this.setModified(!0);EditorUi.debug("DrawioFile.fileChanged",[this],"autosaveDelay",this.autosaveDelay,"autosave",this.isAutosave(),"saving",this.savingFile);this.isAutosave()?(null!=this.savingStatusKey&&this.ui.updateStatus(mxUtils.bind(this,function(){this.addAllSavedStatus(mxUtils.htmlEntities(mxResources.get(this.savingStatusKey))+"...")})),this.ui.scheduleSanityCheck(),null==this.ageStart&&(this.ageStart=new Date),this.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.bind(this,function(e){this.ui.stopSanityCheck();null==this.autosaveThread?(this.handleFileSuccess(!0),this.ageStart=null):this.isModified()&&(this.ui.scheduleSanityCheck(),this.ageStart=this.lastChanged)}),mxUtils.bind(this,function(e){this.handleFileError(e)}))):(this.ageStart=null,this.isAutosaveOptional()&&this.ui.editor.autosave||this.inConflictState||this.addUnsavedStatus());null!=this.sync&&b&&this.sync.localFileChanged()};DrawioFile.prototype.createSecret=function(b){var e=Editor.guid(32);Editor.enableRealtimeCache&&null!=this.sync&&!this.isOptimisticSync()?this.sync.createToken(e,mxUtils.bind(this,function(g){EditorUi.debug("DrawioFile.createSecret",[this],"secret",e,"token",g);b(e,g)}),mxUtils.bind(this,function(){b(e)})):b(e)};DrawioFile.prototype.fileSaving=function(){null!=this.sync&&this.sync.fileSaving()};-DrawioFile.prototype.fileSaved=function(b,e,g,m,v,p,A){this.lastSaved=new Date;this.ageStart=null;this.stats.saved++;try{this.invalidChecksum=this.inConflictState=!1;p=null!=p?p:this.ui.getPagesForXml(b);try{null==this.sync||this.isOptimisticSync()?(this.setShadowPages(p),null!=this.sync&&(this.sync.lastModified=this.getLastModifiedDate(),this.sync.resetUpdateStatusThread(),this.isRealtime()&&this.sync.scheduleCleanup()),null!=g&&g()):this.sync.fileSaved(p,e,g,m,v,A)}catch(F){this.invalidChecksum=-this.inConflictState=!0;this.descriptorChanged();null!=m&&m(F);try{var H=this.getCurrentUser(),S=null!=H?H.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),S,F)}catch(K){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[e],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(F){this.descriptorChanged(),null!=m&&m(F)}};-DrawioFile.prototype.autosave=function(b,e,g,m){null==this.lastAutosave&&(this.lastAutosave=Date.now());var v=Date.now()-this.lastAutosave<e?b:0;this.clearAutosave();var p=window.setTimeout(mxUtils.bind(this,function(){try{if(this.lastAutosave=null,this.autosaveThread==p&&(this.autosaveThread=null),EditorUi.debug("DrawioFile.autosave",[this],"thread",p,"modified",this.isModified(),"now",this.isAutosaveNow(),"saving",this.savingFile),this.isModified()&&this.isAutosaveNow()){var A=this.isAutosaveRevision();-A&&(this.lastAutosaveRevision=(new Date).getTime());this.save(A,mxUtils.bind(this,function(H){this.autosaveCompleted();null!=g&&g(H)}),mxUtils.bind(this,function(H){null!=m&&m(H)}))}else this.isModified()||this.ui.clearStatus(),null!=g&&g(null)}catch(H){null!=m&&m(H)}}),v);this.autosaveThread=p;EditorUi.debug("DrawioFile.autosave",[this],"thread",p,"delay",b,"maxDelay",e,"actualDelay",v,"lastAutosave",this.lastAutosave,"saving",this.savingFile)};DrawioFile.prototype.isAutosaveNow=function(){return!0};+DrawioFile.prototype.fileSaved=function(b,e,g,m,v,n,A){this.lastSaved=new Date;this.ageStart=null;this.stats.saved++;try{this.invalidChecksum=this.inConflictState=!1;n=null!=n?n:this.ui.getPagesForXml(b);try{null==this.sync||this.isOptimisticSync()?(this.setShadowPages(n),null!=this.sync&&(this.sync.lastModified=this.getLastModifiedDate(),this.sync.resetUpdateStatusThread(),this.isRealtime()&&this.sync.scheduleCleanup()),null!=g&&g()):this.sync.fileSaved(n,e,g,m,v,A)}catch(F){this.invalidChecksum=+this.inConflictState=!0;this.descriptorChanged();null!=m&&m(F);try{var G=this.getCurrentUser(),S=null!=G?G.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),S,F)}catch(K){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[e],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(F){this.descriptorChanged(),null!=m&&m(F)}};+DrawioFile.prototype.autosave=function(b,e,g,m){null==this.lastAutosave&&(this.lastAutosave=Date.now());var v=Date.now()-this.lastAutosave<e?b:0;this.clearAutosave();var n=window.setTimeout(mxUtils.bind(this,function(){try{if(this.lastAutosave=null,this.autosaveThread==n&&(this.autosaveThread=null),EditorUi.debug("DrawioFile.autosave",[this],"thread",n,"modified",this.isModified(),"now",this.isAutosaveNow(),"saving",this.savingFile),this.isModified()&&this.isAutosaveNow()){var A=this.isAutosaveRevision();+A&&(this.lastAutosaveRevision=(new Date).getTime());this.save(A,mxUtils.bind(this,function(G){this.autosaveCompleted();null!=g&&g(G)}),mxUtils.bind(this,function(G){null!=m&&m(G)}))}else this.isModified()||this.ui.clearStatus(),null!=g&&g(null)}catch(G){null!=m&&m(G)}}),v);this.autosaveThread=n;EditorUi.debug("DrawioFile.autosave",[this],"thread",n,"delay",b,"maxDelay",e,"actualDelay",v,"lastAutosave",this.lastAutosave,"saving",this.savingFile)};DrawioFile.prototype.isAutosaveNow=function(){return!0};DrawioFile.prototype.autosaveCompleted=function(){};DrawioFile.prototype.clearAutosave=function(){null!=this.autosaveThread&&(window.clearTimeout(this.autosaveThread),this.autosaveThread=null)};DrawioFile.prototype.isAutosaveRevision=function(){var b=(new Date).getTime();return null==this.lastAutosaveRevision||b-this.lastAutosaveRevision>this.maxAutosaveRevisionDelay};DrawioFile.prototype.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))};DrawioFile.prototype.contentChanged=function(){this.fireEvent(new mxEventObject("contentChanged"))};DrawioFile.prototype.close=function(b){try{this.isAutosave()&&this.isModified()&&(this.updateFileData(),this.save(this.isAutosaveRevision(),null,null,b))}catch(e){}this.stats.closed++;this.destroy()};DrawioFile.prototype.hasSameExtension=function(b,e){if(null!=b&&null!=e){var g=b.lastIndexOf(".");b=0<g?b.substring(g):"";g=e.lastIndexOf(".");return b===(0<g?e.substring(g):"")}return b==e};DrawioFile.prototype.removeListeners=function(){null!=this.changeListener&&(this.ui.editor.graph.model.removeListener(this.changeListener),this.ui.editor.graph.removeListener(this.changeListener),this.ui.removeListener(this.changeListener),this.changeListener=null)};DrawioFile.prototype.destroy=function(){this.clearAutosave();this.removeListeners();this.stats.destroyed++;null!=this.sync&&(this.sync.destroy(),this.sync=null)};DrawioFile.prototype.commentsSupported=function(){return!1};-DrawioFile.prototype.commentsRefreshNeeded=function(){return!0};DrawioFile.prototype.commentsSaveNeeded=function(){return!1};DrawioFile.prototype.getComments=function(b,e){b([])};DrawioFile.prototype.addComment=function(b,e,g){e(Date.now())};DrawioFile.prototype.canReplyToReplies=function(){return!0};DrawioFile.prototype.canComment=function(){return!0};DrawioFile.prototype.newComment=function(b,e){return new DrawioComment(this,null,b,Date.now(),Date.now(),!1,e)};LocalFile=function(b,e,g,m,v,p,A){DrawioFile.call(this,b,e);this.title=g;this.mode=m?null:App.MODE_DEVICE;this.fileHandle=v;this.desc=p;this.editable=A};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return null!=this.fileHandle&&!this.invalidFileHandle&&DrawioFile.prototype.isAutosave.apply(this,arguments)};LocalFile.prototype.isAutosaveOptional=function(){return null!=this.fileHandle};LocalFile.prototype.getMode=function(){return this.mode};+DrawioFile.prototype.commentsRefreshNeeded=function(){return!0};DrawioFile.prototype.commentsSaveNeeded=function(){return!1};DrawioFile.prototype.getComments=function(b,e){b([])};DrawioFile.prototype.addComment=function(b,e,g){e(Date.now())};DrawioFile.prototype.canReplyToReplies=function(){return!0};DrawioFile.prototype.canComment=function(){return!0};DrawioFile.prototype.newComment=function(b,e){return new DrawioComment(this,null,b,Date.now(),Date.now(),!1,e)};LocalFile=function(b,e,g,m,v,n,A){DrawioFile.call(this,b,e);this.title=g;this.mode=m?null:App.MODE_DEVICE;this.fileHandle=v;this.desc=n;this.editable=A};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return null!=this.fileHandle&&!this.invalidFileHandle&&DrawioFile.prototype.isAutosave.apply(this,arguments)};LocalFile.prototype.isAutosaveOptional=function(){return null!=this.fileHandle};LocalFile.prototype.getMode=function(){return this.mode};LocalFile.prototype.getTitle=function(){return this.title};LocalFile.prototype.isRenamable=function(){return!0};LocalFile.prototype.isEditable=function(){return DrawioFile.prototype.isEditable.apply(this,arguments)&&(null==this.editable||this.editable)};LocalFile.prototype.setEditable=function(b){this.editable=b;this.descriptorChanged()};LocalFile.prototype.save=function(b,e,g,m,v){this.saveAs(this.title,e,g,m,v)};LocalFile.prototype.saveAs=function(b,e,g,m,v){this.saveFile(b,!1,e,g,null,m,v)};LocalFile.prototype.getDescriptor=function(){return this.desc};LocalFile.prototype.setDescriptor=function(b){this.desc=b};LocalFile.prototype.getLatestVersion=function(b,e){null==this.fileHandle?null!=e&&e({message:mxResources.get("cannotOpenFile")}):this.ui.loadFileSystemEntry(this.fileHandle,b,e)};-LocalFile.prototype.saveFile=function(b,e,g,m,v,p,A){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;v||this.updateFileData();var H=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var S=this.getData(),F=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=g&&g()}),K=mxUtils.bind(this,function(c){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=-!0;var f=mxUtils.bind(this,function(t){this.savingFile=!1;null!=m&&m({error:t})});this.saveDraft(S);this.fileHandle.createWritable().then(mxUtils.bind(this,function(t){this.fileHandle.getFile().then(mxUtils.bind(this,function(q){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[q],"conflict",this.desc.lastModified!=q.lastModified);A||this.desc.lastModified==q.lastModified?t.write(H?this.ui.base64ToBlob(c,"image/png"):c).then(mxUtils.bind(this,function(){t.close().then(mxUtils.bind(this,-function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(D){try{var G=this.desc;this.savingFile=!1;this.desc=D;this.fileSaved(S,G,F,f);this.removeDraft()}catch(N){f(N)}}),f)}),f)}),f):(this.inConflictState=!0,f())}),mxUtils.bind(this,function(q){this.invalidFileHandle=!0;f(q)}))}),f)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(c,b,H?"image/png":"text/xml",H);else if(c.length<MAX_REQUEST_SIZE){var l=b.lastIndexOf(".");l=0<l?b.substring(l+1):"xml";-(new mxXmlRequest(SAVE_URL,"format="+l+"&xml="+encodeURIComponent(c)+"&filename="+encodeURIComponent(b)+(H?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(c)}));F()}});H?(e=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(c){K(c)}),m,this.ui.getCurrentFile()!=this?S:null,e.scale,e.border)):K(S)};+LocalFile.prototype.saveFile=function(b,e,g,m,v,n,A){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;v||this.updateFileData();var G=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var S=this.getData(),F=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=g&&g()}),K=mxUtils.bind(this,function(c){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=+!0;var f=mxUtils.bind(this,function(t){this.savingFile=!1;null!=m&&m({error:t})});this.saveDraft(S);this.fileHandle.createWritable().then(mxUtils.bind(this,function(t){this.fileHandle.getFile().then(mxUtils.bind(this,function(q){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[q],"conflict",this.desc.lastModified!=q.lastModified);A||this.desc.lastModified==q.lastModified?t.write(G?this.ui.base64ToBlob(c,"image/png"):c).then(mxUtils.bind(this,function(){t.close().then(mxUtils.bind(this,+function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(D){try{var H=this.desc;this.savingFile=!1;this.desc=D;this.fileSaved(S,H,F,f);this.removeDraft()}catch(N){f(N)}}),f)}),f)}),f):(this.inConflictState=!0,f())}),mxUtils.bind(this,function(q){this.invalidFileHandle=!0;f(q)}))}),f)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(c,b,G?"image/png":"text/xml",G);else if(c.length<MAX_REQUEST_SIZE){var l=b.lastIndexOf(".");l=0<l?b.substring(l+1):"xml";+(new mxXmlRequest(SAVE_URL,"format="+l+"&xml="+encodeURIComponent(c)+"&filename="+encodeURIComponent(b)+(G?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(c)}));F()}});G?(e=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(c){K(c)}),m,this.ui.getCurrentFile()!=this?S:null,e.scale,e.border)):K(S)};LocalFile.prototype.rename=function(b,e,g){this.title=b;this.descriptorChanged();null!=e&&e()};(function(){"undefined"!==typeof html4&&(html4.ATTRIBS["span::data-lucid-content"]=0,html4.ATTRIBS["span::data-lucid-type"]=0,html4.ATTRIBS["font::data-font-src"]=0);Editor.sketchFontFamily="Architects Daughter";Editor.sketchFontSource="https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter";Editor.sketchFonts=[{fontFamily:Editor.sketchFontFamily,fontUrl:decodeURIComponent(Editor.sketchFontSource)}];Editor.sketchDefaultCurveFitting="1";Editor.sketchDefaultJiggle="2";Editor.thinFormatImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0ibTM2LjUgMTguMzUtNi44NS02Ljg1IDMuMjUtMy4ycS44NS0uODUgMi4wMjUtLjg1IDEuMTc1IDAgMi4wMjUuODVsMi43NSAyLjhxLjg1LjguODUgMnQtLjg1IDJaTTYuODUgNDEuMXYtNi45bDkuNTUtOS41NUw1LjUgMTMuN2w3LjgtNy44NSAxMSAxMSA1LjM1LTUuMzUgNi44NSA2Ljg1LTUuMzUgNS4zNSAxMSAxMS03Ljg1IDcuNzUtMTAuOTUtMTAuOS05LjYgOS41NVptMTEuMi0xOC4wNSA0LjY1LTQuNi00LjA1LTQuMDUtMi4zNSAyLjQtMS42LTEuNiAyLjM1LTIuNC0zLjc1LTMuNzUtNC42IDQuNjVabTE2LjIgMTYuMjUgNC42NS00LjY1LTMuNzUtMy43NS0yLjQgMi40LTEuNi0xLjYgMi40LTIuNC00LjA1LTQtNC42IDQuNjVabS0yNS4xLS40NWgzLjZsMjAuNS0yMC40NS0zLjY1LTMuNjVMOS4xNSAzNS4yWiIvPjwvc3ZnPg==";Editor.thinGestureImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI4IDQxLjZxLTIuNSAwLTQuMDc1LTEuNjUtMS41NzUtMS42NS0xLjU3NS00LjM1IDAtMi4zNSAxLjEtNC4xIDEuMS0xLjc1IDIuODI1LTIuOTUgMS43MjUtMS4yIDMuNy0xLjgyNVQzMy42NSAyNnEtLjE1LTMuMDUtMS4yNS00LjQyNVQyOS4yNSAyMC4ycS0yLjMgMC00LjE3NSAxLjV0LTQuNDI1IDQuOTVxLTIuNjUgMy40NS00LjYgNS4xLTEuOTUgMS42NS00LjM1IDEuNjUtMi4xIDAtMy42NS0xLjM3NVE2LjUgMzAuNjUgNi41IDI3LjQ1cTAtMiAxLjItNC41MjUgMS4yLTIuNTI1IDMuNS02LjE3NSAxLjMtMS44NSAxLjk3NS0zLjIyNXQuNjc1LTIuMzc1cTAtLjctLjM1LTEuMDUtLjM1LS4zNS0xLjA1LS4zNS0uNzUgMC0xLjYuNDc1UTEwIDEwLjcgOSAxMS45TDcgOS44cTEuMzUtMS41NSAyLjcyNS0yLjI3NVExMS4xIDYuOCAxMi41IDYuOHExLjkgMCAzLjEgMS4yNSAxLjIgMS4yNSAxLjIgMy4yIDAgMS44LS45NzUgMy41NzVRMTQuODUgMTYuNiAxMy4wNSAxOS4zcS0xLjk1IDIuOTUtMi43NzUgNC43dC0uODI1IDMuNjVxMCAxLjYuNzUgMi4yLjc1LjYgMS43NS42IDEuNDUgMCAyLjgyNS0xLjMgMS4zNzUtMS4zIDMuNTc1LTQuMTUgMi45NS0zLjggNS41MjUtNS43NzUgMi41NzUtMS45NzUgNS42NzUtMS45NzUgMy4xNSAwIDUgMi4zMjVUMzYuNiAyNS45aDQuOXYyLjk1aC00LjlxLS40NSA3LjM1LTMuMiAxMC4wNS0yLjc1IDIuNy01LjQgMi43Wm0uMS0yLjk1cTEuODUgMCAzLjY1LTIuMjUgMS44LTIuMjUgMi03LjUtMi44LjE1LTUuNjI1IDIuMDI1VDI1LjMgMzUuOXEwIDEuMy43NSAyLjAyNS43NS43MjUgMi4wNS43MjVaIi8+PC9zdmc+";@@ -3312,10 +3316,10 @@ B,I){var U=mxClient.IS_FF?8192:16384;return Math.min(I,Math.min(U/k,U/B))};Editofunction(Aa){try{var wa=new Image;wa.onload=mxUtils.bind(this,function(){try{var Qa=function(){mxClient.IS_SF?window.setTimeout(function(){Ma.drawImage(wa,0,0);k(Ra,Aa)},0):(Ma.drawImage(wa,0,0),k(Ra,Aa))},Ra=document.createElement("canvas"),Sa=parseInt(Aa.getAttribute("width")),Ha=parseInt(Aa.getAttribute("height"));Z=null!=Z?Z:1;null!=B&&(Z=T?Math.min(1,Math.min(3*B/(4*Ha),B/Sa)):B/Sa);Z=this.getMaxCanvasScale(Sa,Ha,Z);Sa=Math.ceil(Z*Sa);Ha=Math.ceil(Z*Ha);Ra.setAttribute("width",Sa);Ra.setAttribute("height",Ha);var Ma=Ra.getContext("2d");if(null!=Ca){var y=mxUtils.getLightDarkColor(Ca);Ma.beginPath();Ma.rect(0,0,Sa,Ha);Ma.fillStyle="dark"==za&&"none"!=qa.getAdaptiveColors()?y.dark:y.light;Ma.fill()}1!=Z&&Ma.scale(Z,Z);if(La){var O=qa.view,R=O.scale;O.scale=1;var V=btoa(unescape(encodeURIComponent(O.createSvgGrid(O.gridColor))));O.scale=R;V="data:image/svg+xml;base64,"+V;var fa=qa.gridSize*O.gridSteps*Z,ia=qa.getGraphBounds(),oa=O.translate.x*R,ta=O.translate.y*R,ra=oa+(ia.x-oa)/R-Ba,xa=ta+(ia.y-ta)/R-Ba,Da=new Image;Da.onload=function(){try{for(var Ia=-Math.round(fa-mxUtils.mod((oa-ra)*Z,fa)),Xa=-Math.round(fa-mxUtils.mod((ta-xa)*Z,fa));Ia<Sa;Ia+=fa)for(var Za=Xa;Za<Ha;Za+=fa)Ma.drawImage(Da,Ia/Z,Za/Z);Qa()}catch($a){null!=P&&P($a)}};Da.onerror=function(Ia){null!=P&&P(Ia)};Da.src=V}else Qa()}catch(Ia){null!=P&&P(Ia)}});wa.onerror=function(Qa){null!=P&&P(Qa)};va&&this.graph.addSvgShadow(Aa);this.graph.mathEnabled&&this.addMathCss(Aa);var Ya=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&-this.addFontCss(Aa,this.resolvedFontCss),wa.src=Editor.createSvgDataUri(mxUtils.getXml(Aa))}catch(Qa){null!=P&&P(Qa)}});this.embedExtFonts(mxUtils.bind(this,function(Qa){try{null!=Qa&&this.addFontCss(Aa,Qa),this.loadFonts(Ya)}catch(Ra){null!=P&&P(Ra)}}))}catch(Qa){null!=P&&P(Qa)}}),I,ua)}catch(Aa){null!=P&&P(Aa)}};Editor.crcTable=[];for(var v=0;256>v;v++)for(var p=v,A=0;8>A;A++)p=1==(p&1)?3988292384^p>>>1:p>>>1,Editor.crcTable[v]=p;Editor.updateCRC=function(k,B,I,U){for(var P=0;P<U;P++)k=Editor.crcTable[(k^+this.addFontCss(Aa,this.resolvedFontCss),wa.src=Editor.createSvgDataUri(mxUtils.getXml(Aa))}catch(Qa){null!=P&&P(Qa)}});this.embedExtFonts(mxUtils.bind(this,function(Qa){try{null!=Qa&&this.addFontCss(Aa,Qa),this.loadFonts(Ya)}catch(Ra){null!=P&&P(Ra)}}))}catch(Qa){null!=P&&P(Qa)}}),I,ua)}catch(Aa){null!=P&&P(Aa)}};Editor.crcTable=[];for(var v=0;256>v;v++)for(var n=v,A=0;8>A;A++)n=1==(n&1)?3988292384^n>>>1:n>>>1,Editor.crcTable[v]=n;Editor.updateCRC=function(k,B,I,U){for(var P=0;P<U;P++)k=Editor.crcTable[(k^B.charCodeAt(I+P))&255]^k>>>8;return k};Editor.crc32=function(k){for(var B=-1,I=0;I<k.length;I++)B=B>>>8^Editor.crcTable[(B^k.charCodeAt(I))&255];return(B^-1)>>>0};Editor.writeGraphModelToPng=function(k,B,I,U,P){function T(ua,qa){var Ba=ka;ka+=qa;return ua.substring(Ba,ka)}function X(ua){ua=T(ua,4);return ua.charCodeAt(3)+(ua.charCodeAt(2)<<8)+(ua.charCodeAt(1)<<16)+(ua.charCodeAt(0)<<24)}function Z(ua){return String.fromCharCode(ua>>24&255,ua>>16&255,ua>>8&255,ua&255)}k=k.substring(k.indexOf(",")+1);k=window.atob?atob(k):Base64.decode(k,!0);var ka=0;if(T(k,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=P&&P();else if(T(k,4),"IHDR"!=T(k,4))null!=P&&P();else{T(k,17);P=k.substring(0,ka);do{var va=X(k);if("IDAT"==T(k,4)){P=k.substring(0,ka-8);"pHYs"==B&&"dpi"==I?(I=Math.round(U/.0254),I=Z(I)+Z(I)+String.fromCharCode(1)):I=I+String.fromCharCode(0)+("zTXt"==B?String.fromCharCode(0):"")+U;U=4294967295;U=Editor.updateCRC(U,B,0,4);U=Editor.updateCRC(U,I,0,I.length);P+=Z(I.length)+-B+I+Z(U^4294967295);P+=k.substring(ka-8,k.length);break}P+=k.substring(ka-8,ka-4+va);T(k,va);T(k,4)}while(va);return"data:image/png;base64,"+(window.btoa?btoa(P):Base64.encode(P,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var H=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(k,B){H.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var S=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=+B+I+Z(U^4294967295);P+=k.substring(ka-8,k.length);break}P+=k.substring(ka-8,ka-4+va);T(k,va);T(k,4)}while(va);return"data:image/png;base64,"+(window.btoa?btoa(P):Base64.encode(P,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var G=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(k,B){G.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var S=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){S.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(k,B){var I=null;null!=k.editor.graph.getModel().getParent(B)?I=B.getId():null!=k.currentPage&&(I=k.currentPage.getId());return I});if(null!=window.StyleFormatPanel){var F=Format.prototype.init;Format.prototype.init=function(){F.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var K=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?K.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(k){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var c=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(k){k=c.apply(this,arguments);var B=this.editorUi,I=B.editor.graph;if(I.isEnabled()){var U=B.getCurrentFile();null!=U&&U.isAutosaveOptional()&&k.appendChild(this.createOption(mxResources.get("autosave"),function(){return B.editor.autosave},function(T){B.editor.setAutosave(T);B.editor.autosave&&U.isModified()&&U.fileChanged()},{install:function(T){this.listener=function(){T(B.editor.autosave)};B.editor.addListener("autosaveChanged",this.listener)},destroy:function(){B.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&I.isEnabled()&&"undefined"!==@@ -3343,141 +3347,139 @@ min:0}];mxCellRenderer.defaultShapes.umlFrame.prototype.customProperties=[{name:stroke:"#9673a6"}],[{fill:"",stroke:""},{fill:"#60a917",stroke:"#2D7600",font:"#ffffff"},{fill:"#008a00",stroke:"#005700",font:"#ffffff"},{fill:"#1ba1e2",stroke:"#006EAF",font:"#ffffff"},{fill:"#0050ef",stroke:"#001DBC",font:"#ffffff"},{fill:"#6a00ff",stroke:"#3700CC",font:"#ffffff"},{fill:"#d80073",stroke:"#A50040",font:"#ffffff"},{fill:"#a20025",stroke:"#6F0000",font:"#ffffff"}],[{fill:"#e51400",stroke:"#B20000",font:"#ffffff"},{fill:"#fa6800",stroke:"#C73500",font:"#000000"},{fill:"#f0a30a",stroke:"#BD7000",font:"#000000"},{fill:"#e3c800",stroke:"#B09500",font:"#000000"},{fill:"#6d8764",stroke:"#3A5431",font:"#ffffff"},{fill:"#647687",stroke:"#314354",font:"#ffffff"},{fill:"#76608a",stroke:"#432D57",font:"#ffffff"},{fill:"#a0522d",stroke:"#6D1F00",font:"#ffffff"}],[{fill:"",stroke:""},{fill:mxConstants.NONE,stroke:""},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",stroke:"#23445d"}],[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[{fill:"",stroke:""},{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},-{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;StyleFormatPanel.prototype.findCommonProperties=function(k,B,I,U){if(null!=B){var P=mxUtils.bind(this,function(X){if(null!=X)if(I)for(var Z=0;Z<X.length;Z++){if("function"!==typeof X[Z].isVisible||X[Z].isVisible(U,this))B[X[Z].name]=X[Z]}else for(var ka in B){var va=!1;for(Z=0;Z<-X.length;Z++)if(X[Z].name==ka&&X[Z].type==B[ka].type){va=!0;break}va||delete B[ka]}}),T=this.editorUi.editor.graph.view.getState(k);null!=T&&null!=T.shape&&(T.shape.commonCustomPropAdded||(T.shape.commonCustomPropAdded=!0,T.shape.customProperties=T.shape.customProperties||[],T.cell.vertex?Array.prototype.push.apply(T.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(T.shape.customProperties,Editor.commonEdgeProperties)),P(T.shape.customProperties));k=k.getAttribute("customProperties");-if(null!=k)try{P(JSON.parse(k))}catch(X){}}};var f=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var k=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&"image"!=k.style.shape&&!k.containsLabel&&0<k.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));f.apply(this,arguments);if(Editor.enableCustomProperties){for(var B={},I=k.vertices,U=k.edges,P=0;P<I.length;P++)this.findCommonProperties(I[P],B,-0==P,k);for(P=0;P<U.length;P++)this.findCommonProperties(U[P],B,0==I.length&&0==P,k);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(B).length&&this.container.appendChild(this.addProperties(this.createPanel(),B,k))}};var l=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(k){var B=this.editorUi.getSelectionState();1==B.cells.length?this.addActions(k,["copyStyle","pasteStyle"]):1<=B.cells.length&&this.addActions(k,["pasteStyle","pasteData"]);l.apply(this,-arguments);return k};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(k,B,I,U){function P(Ma,y,O,R,V){if(null!=O.valueChanged)O.valueChanged(y,V);else{Ba.getModel().beginUpdate();try{V=[];var fa=[];if(null!=O.index){for(var ia=[],oa=O.parentRow.nextSibling;oa&&oa.getAttribute("data-pName")==Ma;)ia.push(oa.getAttribute("data-pValue")),oa=oa.nextSibling;O.index<ia.length?null!=R?ia.splice(R,1):ia[O.index]=y:ia.push(y);null!=O.size&&ia.length>O.size&&(ia=ia.slice(0,-O.size));y=ia.join(",");null!=O.countProperty&&(Ba.setCellStyles(O.countProperty,ia.length,Ba.getSelectionCells()),V.push(O.countProperty),fa.push(ia.length))}Ba.setCellStyles(Ma,y,Ba.getSelectionCells());V.push(Ma);fa.push(y);if(null!=O.dependentProps)for(Ma=0;Ma<O.dependentProps.length;Ma++){var ta=O.dependentPropsDefVal[Ma],ra=O.dependentPropsVals[Ma];if(ra.length>y)ra=ra.slice(0,y);else for(var xa=ra.length;xa<y;xa++)ra.push(ta);ra=ra.join(",");Ba.setCellStyles(O.dependentProps[Ma],ra,Ba.getSelectionCells());-V.push(O.dependentProps[Ma]);fa.push(ra)}if("function"==typeof O.onChange)O.onChange(Ba,y);qa.editorUi.fireEvent(new mxEventObject("styleChanged","keys",V,"values",fa,"cells",Ba.getSelectionCells()))}finally{Ba.getModel().endUpdate()}}}function T(Ma,y,O){var R=mxUtils.getOffset(k,!0),V=mxUtils.getOffset(Ma,!0);y.style.position="absolute";y.style.left=V.x-R.x+"px";y.style.top=V.y-R.y+"px";y.style.width=Ma.offsetWidth+"px";y.style.height=Ma.offsetHeight-(O?4:0)+"px";y.style.zIndex=5}function X(Ma,y,-O){function R(fa){if(null==fa||fa==mxConstants.NONE)V.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==fa)V.style.background="";else{var ia=mxUtils.getLightDarkColor(fa);mxUtils.isLightDarkColor(fa)&&ia.light!=ia.dark?V.style.background="linear-gradient(to right bottom, "+ia.cssText+" 50%, "+mxUtils.invertLightDarkColor(ia).cssText+" 50.3%)":V.style.background=fa}}var V=document.createElement("div");V.style.width="32px";V.style.height="8px";V.style.margin="2px";V.style.borderStyle=-"solid";V.style.borderWidth="1px";R(y);btn=mxUtils.button("",mxUtils.bind(qa,function(fa){this.editorUi.pickColor(y,function(ia){P(Ma,ia,O);R(ia)});mxEvent.consume(fa)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(V);return btn}function Z(Ma,y,O,R,V,fa,ia){null!=y&&(y=y.split(","),ya.push({name:Ma,values:y,type:O,defVal:R,countProperty:V,parentRow:fa,isDeletable:!0,flipBkg:ia}));btn=mxUtils.button("+",-mxUtils.bind(qa,function(oa){for(var ta=fa,ra=0;null!=ta.nextSibling;)if(ta.nextSibling.getAttribute("data-pName")==Ma)ta=ta.nextSibling,ra++;else break;var xa={type:O,parentRow:fa,index:ra,isDeletable:!0,defVal:R,countProperty:V};ra=ua(Ma,"",xa,0==ra%2,ia);P(Ma,R,xa);ta.parentNode.insertBefore(ra,ta.nextSibling);mxEvent.consume(oa)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function ka(Ma,y,O,R,V,fa,ia){if(0<V){var oa=Array(V);y=null!=y?y.split(","):[];-for(var ta=0;ta<V;ta++)oa[ta]=null!=y[ta]?y[ta]:null!=R?R:"";ya.push({name:Ma,values:oa,type:O,defVal:R,parentRow:fa,flipBkg:ia,size:V})}return document.createElement("div")}function va(Ma,y,O){var R=document.createElement("input");R.type="checkbox";R.checked="1"==y;mxEvent.addListener(R,"change",function(){P(Ma,R.checked?"1":"0",O)});return R}function ua(Ma,y,O,R,V){var fa=O.dispName,ia=O.type,oa=document.createElement("tr");oa.className="gePropRow"+(V?"Dark":"")+(R?"Alt":"")+" gePropNonHeaderRow";-oa.setAttribute("data-pName",Ma);oa.setAttribute("data-pValue",y);R=!1;null!=O.index&&(oa.setAttribute("data-index",O.index),fa=(null!=fa?fa:"")+"["+O.index+"]",R=!0);var ta=document.createElement("td");ta.className="gePropRowCell";fa=mxResources.get(fa,null,fa);mxUtils.write(ta,fa);ta.setAttribute("title",fa);R&&(ta.style.textAlign="right");oa.appendChild(ta);ta=document.createElement("td");ta.className="gePropRowCell";ta.setAttribute("title",null!=y?y:mxResources.get("none"));if("color"==ia)ta.appendChild(X(Ma,-y,O));else if("bool"==ia||"boolean"==ia)ta.appendChild(va(Ma,y,O));else if("enum"==ia){var ra=O.enumList;for(V=0;V<ra.length;V++)if(fa=ra[V],fa.val==y){mxUtils.write(ta,mxResources.get(fa.dispName,null,fa.dispName));break}mxEvent.addListener(ta,"click",mxUtils.bind(qa,function(){var xa=document.createElement("select"),Da=null;T(ta,xa);for(var Ia=0;Ia<ra.length;Ia++){var Xa=ra[Ia],Za=document.createElement("option");Za.value=mxUtils.htmlEntities(Xa.val);mxUtils.write(Za,mxResources.get(Xa.dispName,-null,Xa.dispName));xa.appendChild(Za);null==Xa.val&&(Za.value="null",Da=Za)}xa.value=null==y&&null!=Da?"null":y;k.appendChild(xa);mxEvent.addListener(xa,"change",function(){var $a=mxUtils.htmlEntities(xa.value);if(xa[xa.selectedIndex]==Da||"null"==$a.value)$a=null;P(Ma,$a,O)});xa.focus();mxEvent.addListener(xa,"blur",function(){k.removeChild(xa)})}))}else"dynamicArr"==ia?ta.appendChild(Z(Ma,y,O.subType,O.subDefVal,O.countProperty,oa,V)):"staticArr"==ia?ta.appendChild(ka(Ma,y,O.subType,O.subDefVal,-O.size,oa,V)):"readOnly"==ia?(V=document.createElement("input"),V.setAttribute("readonly",""),V.value=y,V.style.borderWidth="0px","id"==Ma?(V.style.width="190px",V.style.position="relative",V.style.right="6px",V.style.float="right",V.style.background="none",V.style.textAlign="right",oa.firstChild.setAttribute("colspan","2"),V.setAttribute("title",y),oa.firstChild.appendChild(V)):(V.style.width="96px",ta.appendChild(V))):(ta.innerHTML=mxUtils.htmlEntities(decodeURIComponent(y)),mxEvent.addListener(ta,-"click",mxUtils.bind(qa,function(){function xa(){var Ia=Da.value;Ia=0==Ia.length&&"string"!=ia&&"numbers"!=ia?0:Ia;O.allowAuto&&(null!=Ia.trim&&"auto"==Ia.trim().toLowerCase()?(Ia="auto",ia="string"):(Ia=parseFloat(Ia),Ia=isNaN(Ia)?0:Ia));null!=O.min&&Ia<O.min?Ia=O.min:null!=O.max&&Ia>O.max&&(Ia=O.max);var Xa=null;try{Xa="numbers"==ia?Ia.match(/\d+/g).map(Number).join(" "):encodeURIComponent(("int"==ia?parseInt(Ia):Ia)+"")}catch(Za){}P(Ma,Xa,O,null,Da)}var Da=document.createElement("input");T(ta,-Da,!0);Da.value=decodeURIComponent(y);Da.className="gePropEditor";"int"!=ia&&"float"!=ia||O.allowAuto||(Da.type="number",Da.step="int"==ia?"1":"any",null!=O.min&&(Da.min=parseFloat(O.min)),null!=O.max&&(Da.max=parseFloat(O.max)));k.appendChild(Da);mxEvent.addListener(Da,"keypress",function(Ia){13==Ia.keyCode&&xa()});Da.focus();mxEvent.addListener(Da,"blur",function(){xa()})})));O.isDeletable&&(V=mxUtils.button("-",mxUtils.bind(qa,function(xa){P(Ma,"",O,O.index);mxEvent.consume(xa)})),V.style.height=-"16px",V.style.width="25px",V.style.float="right",V.className="geColorBtn",ta.appendChild(V));oa.appendChild(ta);return oa}var qa=this,Ba=this.editorUi.editor.graph,ya=[],La=document.createElement("table");La.className="geProperties geFullWidthElement";var za=document.createElement("tr");za.className="gePropHeader";var Ea=document.createElement("th");Ea.className="gePropHeaderCell";Ea.style.paddingLeft="16px";Ea.style.backgroundRepeat="no-repeat";Ea.style.backgroundPosition="-2px 50%";Ea.style.backgroundSize=-"20px";mxUtils.write(Ea,mxResources.get("property"));za.style.cursor="pointer";var pa=function(){var Ma=La.querySelectorAll(".gePropNonHeaderRow");if(qa.editorUi.propertiesCollapsed){Ea.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var y="none";for(var O=k.childNodes.length-1;0<=O;O--)try{var R=k.childNodes[O],V=R.nodeName.toUpperCase();"INPUT"!=V&&"SELECT"!=V||k.removeChild(R)}catch(fa){}}else Ea.style.backgroundImage="url('"+Editor.arrowDownImage+"')",y="";for(O=0;O<Ma.length;O++)Ma[O].style.display=-y};mxEvent.addListener(za,"click",function(){qa.editorUi.propertiesCollapsed=!qa.editorUi.propertiesCollapsed;pa()});za.appendChild(Ea);var Ca=document.createElement("th");Ca.className="gePropHeaderCell";Ca.style.paddingLeft="4px";mxUtils.write(Ca,mxResources.get("value"));za.appendChild(Ca);La.appendChild(za);var Aa=Ca=!1;za=null;1==I.vertices.length&&0==I.edges.length?za=I.vertices[0].id:0==I.vertices.length&&1==I.edges.length&&(za=I.edges[0].id);null==za||U||La.appendChild(ua("id",mxUtils.htmlEntities(za),-{dispName:"id",type:"readOnly"},!0,!1));for(var wa in B)if(U=B[wa],"function"!=typeof U.isVisible||U.isVisible(I,this)){var Ya=null!=U.getValue?U.getValue():null!=I.style[wa]?mxUtils.htmlEntities(I.style[wa]+""):null!=U.getDefaultValue?U.getDefaultValue(I,this):U.defVal;if("separator"==U.type)Aa=!Aa;else{if("staticArr"==U.type)U.size=parseInt(I.style[U.sizeProperty]||B[U.sizeProperty].defVal)||0;else if(null!=U.dependentProps){var Qa=U.dependentProps,Ra=[],Sa=[];for(za=0;za<Qa.length;za++){var Ha=-I.style[Qa[za]];Sa.push(B[Qa[za]].subDefVal);Ra.push(null!=Ha?Ha.split(","):[])}U.dependentPropsDefVal=Sa;U.dependentPropsVals=Ra}La.appendChild(ua(wa,Ya,U,Ca,Aa));Ca=!Ca}}for(za=0;za<ya.length;za++)for(U=ya[za],B=U.parentRow,I=0;I<U.values.length;I++)wa=ua(U.name,U.values[I],{type:U.type,parentRow:U.parentRow,isDeletable:U.isDeletable,index:I,defVal:U.defVal,countProperty:U.countProperty,size:U.size},0==I%2,U.flipBkg),B.parentNode.insertBefore(wa,B.nextSibling),B=wa;k.appendChild(La);pa();return k};-StyleFormatPanel.prototype.addStyles=function(k){if(null!=this.defaultColorSchemes){var B=this.editorUi,I=B.editor.graph,U=document.createElement("div");U.style.padding="6px 20px 0 24px";k.appendChild(U);var P=document.createElement("div");P.className="geSwitcher";P.style.padding="4px 18px 6px 0px";for(var T=[],X=0;X<this.defaultColorSchemes.length;X++){var Z=document.createElement("div");Z.className="geSwitcherDot";mxUtils.bind(this,function(Ba){mxEvent.addListener(Z,"click",mxUtils.bind(this,function(){ka(Ba)}))})(X);-T.push(Z);P.appendChild(Z)}var ka=mxUtils.bind(this,function(Ba){null!=T[Ba]&&(null!=this.format.currentScheme&&null!=T[this.format.currentScheme]&&(T[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=Ba,va(this.defaultColorSchemes[this.format.currentScheme]),T[this.format.currentScheme].style.background="#84d7ff")}),va=mxUtils.bind(this,function(Ba){var ya=mxUtils.clone(I.defaultVertexStyle);ya[mxConstants.STYLE_STROKECOLOR]=null!=ya[mxConstants.STYLE_STROKECOLOR]?-ya[mxConstants.STYLE_STROKECOLOR]:"default";ya[mxConstants.STYLE_FILLCOLOR]=null!=ya[mxConstants.STYLE_FILLCOLOR]?ya[mxConstants.STYLE_FILLCOLOR]:"default";ya[mxConstants.STYLE_FONTCOLOR]=null!=ya[mxConstants.STYLE_FONTCOLOR]?ya[mxConstants.STYLE_FONTCOLOR]:"default";I.replaceDefaultColors(new mxCell,ya);var La=mxUtils.bind(this,function(Ea){var pa=mxUtils.button("",mxUtils.bind(this,function(wa){I.getModel().beginUpdate();try{for(var Ya=B.getSelectionState().cells,Qa=0;Qa<Ya.length;Qa++){var Ra=-I.getModel().getStyle(Ya[Qa]);null!=Ea?(mxEvent.isShiftDown(wa)||(Ra=""==Ea.fill||null==Ea.fill?mxUtils.setStyle(Ra,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(Ra,mxConstants.STYLE_FILLCOLOR,Ea.fill),Ra=""==Ea.gradient||null==Ea.gradient?mxUtils.setStyle(Ra,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(Ra,mxConstants.STYLE_GRADIENTCOLOR,Ea.gradient),mxEvent.isControlDown(wa)||mxClient.IS_MAC&&mxEvent.isMetaDown(wa)||!I.getModel().isVertex(Ya[Qa])||(Ra=""==Ea.font||null==Ea.font?mxUtils.setStyle(Ra,-mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(Ra,mxConstants.STYLE_FONTCOLOR,Ea.font))),mxEvent.isAltDown(wa)||(Ra=""==Ea.stroke||null==Ea.fill?mxUtils.setStyle(Ra,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(Ra,mxConstants.STYLE_STROKECOLOR,Ea.stroke))):(Ra=mxUtils.setStyle(Ra,mxConstants.STYLE_FILLCOLOR,null),Ra=mxUtils.setStyle(Ra,mxConstants.STYLE_STROKECOLOR,null),Ra=mxUtils.setStyle(Ra,mxConstants.STYLE_GRADIENTCOLOR,null),I.getModel().isVertex(Ya[Qa])&&(Ra=mxUtils.setStyle(Ra,-mxConstants.STYLE_FONTCOLOR,null)));I.getModel().setStyle(Ya[Qa],Ra)}}finally{I.getModel().endUpdate()}}));pa.className="geStyleButton";pa.style.width="36px";pa.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";pa.style.margin="0px 6px 6px 0px";if(null!=Ea){var Ca="1px solid";null!=Ea.border&&(Ca=Ea.border);if(null!=Ea.gradient)pa.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(Ea.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(Ea.gradient).cssText+" 100%)";else if(Ea.fill==-mxConstants.NONE)pa.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==Ea.fill||""==Ea.fill)pa.style.backgroundColor=mxUtils.getLightDarkColor(mxUtils.getValue(ya,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var Aa=mxUtils.getLightDarkColor(Ea.fill);pa.style.backgroundImage="linear-gradient(to right bottom, "+Aa.cssText+" 50%, "+Aa.light+" 50.3%)"}null==Ea.stroke||Ea.stroke==mxConstants.NONE?pa.style.border=Ca+" transparent":""==Ea.stroke?pa.style.border="1px solid "+-mxUtils.getLightDarkColor(mxUtils.getValue(ya,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(Aa=mxUtils.getLightDarkColor(Ea.stroke),pa.style.border=Ca+" "+Aa.cssText,pa.style.borderRightColor=Aa.light,pa.style.borderBottomColor=pa.style.borderRightColor);null!=Ea.title&&pa.setAttribute("title",Ea.title)}else Ca=mxUtils.getValue(ya,mxConstants.STYLE_FILLCOLOR,"#ffffff"),Aa=mxUtils.getValue(ya,mxConstants.STYLE_STROKECOLOR,"#000000"),pa.style.backgroundColor=Ca,pa.style.border="1px solid "+Aa;-pa.style.borderRadius="0";U.appendChild(pa);null!=Ea&&null!=Ea.gradient&&(Ca=pa.cloneNode(!1),Ca.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(Ea.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(Ea.gradient).light+") 100%)",Ca.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",Ca.style.backgroundColor="transparent",U.appendChild(Ca),Ca.style.marginLeft="-42px",mxEvent.addListener(Ca,"click",function(){pa.click()}))});U.innerText=-"";if(null!=Ba)for(var za=0;za<Ba.length;za++)0<za&&0==mxUtils.mod(za,4)&&mxUtils.br(U),La(Ba[za])});null==this.format.currentScheme?ka(Math.min(T.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):ka(this.format.currentScheme);X=10>=this.defaultColorSchemes.length?43:23;var ua=document.createElement("div");ua.className="geButton";ua.style.cssText="position:absolute;left:0px;bottom:"+X+"px;width:20px;background-image:url("+Editor.chevronLeftImage+");";mxEvent.addListener(ua,"click",mxUtils.bind(this,-function(){ka(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var qa=document.createElement("div");qa.className="geButton";qa.style.cssText="position:absolute;left:186px;bottom:"+X+"px;width:20px;background-image:url("+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(k.appendChild(ua),k.appendChild(qa));mxEvent.addListener(qa,"click",mxUtils.bind(this,function(){ka(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));va(this.defaultColorSchemes[this.format.currentScheme]);-10>=this.defaultColorSchemes.length&&k.appendChild(P)}return k}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements={};Graph.isGoogleFontUrl=function(k){return k.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||k.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=-function(k){return Graph.isGoogleFontUrl(k)};Graph.rewriteGoogleFontUrl=function(k){null!=k&&k.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(k=Editor.GOOGLE_FONTS_CSS2+k.substring(Editor.GOOGLE_FONTS.length)+":wght@400;500");return k};Graph.createFontElement=function(k,B){var I=Graph.fontMapping[B];null==I&&Graph.isCssFontUrl(B)?(k=document.createElement("link"),k.setAttribute("rel","stylesheet"),k.setAttribute("type","text/css"),k.setAttribute("charset","UTF-8"),k.setAttribute("href",-Graph.rewriteGoogleFontUrl(B))):(null==I&&(I='@font-face {\nfont-family: "'+k+'";\nsrc: url("'+B+'");\n}'),k=document.createElement("style"),mxUtils.write(k,I));return k};Graph.addRecentCustomFont=function(k,B){};Graph.addFont=function(k,B,I){if(null!=k&&0<k.length&&null!=B&&0<B.length){var U=k.toLowerCase();if("helvetica"!=U&&"arial"!=k&&"sans-serif"!=U){var P=Graph.customFontElements[U];null!=P&&P.url!=B&&(P.elt.parentNode.removeChild(P.elt),P=null);null==P?(P=B,"http:"==B.substring(0,5)&&(P=PROXY_URL+-"?url="+encodeURIComponent(B)),P={name:k,url:B,elt:Graph.createFontElement(k,P)},Graph.customFontElements[U]=P,B=document.getElementsByTagName("head")[0],null!=I&&("link"==P.elt.nodeName.toLowerCase()?(P.elt.onload=I,P.elt.onerror=I):I()),null!=B&&B.appendChild(P.elt)):null!=I&&I()}else null!=I&&I()}else null!=I&&I();return k};Graph.getFontUrl=function(k,B){k=Graph.customFontElements[k.toLowerCase()];null!=k&&(B=k.url);return B};Graph.processFontAttributes=function(k){k=k.getElementsByTagName("*");-for(var B=0;B<k.length;B++){var I=k[B].getAttribute("data-font-src");if(null!=I){var U="FONT"==k[B].nodeName?k[B].getAttribute("face"):k[B].style.fontFamily;null!=U&&Graph.addFont(U,I)}}};Graph.processFontStyle=function(k){if(null!=k){var B=mxUtils.getValue(k,"fontSource",null);if(null!=B){var I=mxUtils.getValue(k,mxConstants.STYLE_FONTFAMILY,null);if(null!=I)try{Graph.addFont(I,decodeURIComponent(B))}catch(U){}}}return k};Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=-null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;Graph.prototype.shadowId="drawio-drop-shadow";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var t=Graph.prototype.init;Graph.prototype.init=function(){function k(P){B=P}t.apply(this,arguments);-this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var B=null;mxEvent.addListener(this.container,"mouseenter",k);mxEvent.addListener(this.container,"mousemove",k);mxEvent.addListener(this.container,"mouseleave",function(P){B=null});this.isMouseInsertPoint=function(){return null!=B};var I=this.getInsertPoint;this.getInsertPoint=function(){return null!=B?this.getPointForEvent(B):I.apply(this,arguments)};var U=this.layoutManager.getLayout;this.layoutManager.getLayout=function(P){var T=-this.graph.getCellStyle(P);if(null!=T&&"rack"==T.childLayout){var X=new mxStackLayout(this.graph,!1);X.gridSize=null!=T.rackUnitSize?parseFloat(T.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;X.marginLeft=T.marginLeft||0;X.marginRight=T.marginRight||0;X.marginTop=T.marginTop||0;X.marginBottom=T.marginBottom||0;X.allowGaps=T.allowGaps||0;X.horizontal="1"==mxUtils.getValue(T,"horizontalRack","0");X.resizeParent=!1;X.fill=!0;return X}return U.apply(this,arguments)};this.updateGlobalUrlVariables()};-var q=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(k,B){return Graph.processFontStyle(q.apply(this,arguments))};var D=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(k,B,I,U,P,T,X,Z,ka,va,ua,qa){D.apply(this,arguments);Graph.processFontAttributes(qa)};var G=mxText.prototype.redraw;mxText.prototype.redraw=function(){G.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};-Graph.prototype.createTagsDialog=function(k,B,I,U){function P(){for(var za=Z.getSelectionCells(),Ea=[],pa=0;pa<za.length;pa++)Z.isCellVisible(za[pa])&&Ea.push(za[pa]);Z.setSelectionCells(Ea)}function T(za){Z.setHiddenTags(za?[]:ka.slice());P();Z.refresh()}function X(za,Ea){ua.innerText="";if(0<za.length){var pa=document.createElement("table");pa.setAttribute("cellpadding","2");pa.style.boxSizing="border-box";pa.style.tableLayout="fixed";pa.style.width="100%";var Ca=document.createElement("tbody");-if(null!=za&&0<za.length)for(var Aa=0;Aa<za.length;Aa++)(function(wa){function Ya(){var y=Z.getCellsForTags([wa],null,null,!0);Z.isEnabled()?Z.setSelectionCells(y):Z.highlightCells(y,null,null,70)}var Qa=0>mxUtils.indexOf(Z.hiddenTags,wa),Ra=document.createElement("tr"),Sa=document.createElement("td");Sa.style.align="center";Sa.style.width="16px";var Ha=document.createElement("img");Ha.setAttribute("src",Qa?Editor.visibleImage:Editor.hiddenImage);Ha.setAttribute("title",mxResources.get(Qa?"hideIt":-"show",[wa]));mxUtils.setOpacity(Ha,Qa?75:25);Ha.className="geAdaptiveAsset";Ha.style.verticalAlign="middle";Ha.style.cursor="pointer";Ha.style.width="16px";if(B||Editor.isDarkMode())Ha.style.filter="invert(100%)";Sa.appendChild(Ha);mxEvent.addListener(Ha,"click",function(y){mxEvent.isShiftDown(y)?T(0<=mxUtils.indexOf(Z.hiddenTags,wa)):(Z.toggleHiddenTag(wa),P(),Z.refresh());mxEvent.consume(y)});Ra.appendChild(Sa);Sa=document.createElement("td");Sa.style.align="center";Sa.style.width="16px";Ha=document.createElement("img");-Ha.setAttribute("src",Editor.selectImage);Ha.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Ha,Qa?75:25);Ha.className="geAdaptiveAsset";Ha.style.verticalAlign="middle";Ha.style.cursor="pointer";Ha.style.width="16px";if(B||Editor.isDarkMode())Ha.style.filter="invert(100%)";mxEvent.addListener(Ha,"click",function(y){T(!0);Ya();mxEvent.consume(y)});Sa.appendChild(Ha);Ra.appendChild(Sa);Sa=document.createElement("td");Sa.style.overflow="hidden";Sa.style.whiteSpace="nowrap";Sa.style.textOverflow=-"ellipsis";Sa.style.verticalAlign="middle";Sa.style.cursor="pointer";Sa.setAttribute("title",wa);a=document.createElement("a");mxUtils.write(a,wa);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,Qa?100:40);Sa.appendChild(a);mxEvent.addListener(Sa,"click",function(y){if(mxEvent.isShiftDown(y))T(!0),Ya();else if(Qa&&0<Z.hiddenTags.length)T(!0);else{var O=ka.slice(),R=mxUtils.indexOf(O,wa);O.splice(R,1);Z.setHiddenTags(O);P();Z.refresh()}mxEvent.consume(y)});Ra.appendChild(Sa);-if(Z.isEnabled()){Sa=document.createElement("td");Sa.style.verticalAlign="middle";Sa.style.textAlign="center";Sa.style.width="18px";if(null==Ea){Sa.style.align="center";Sa.style.width="16px";Ha=document.createElement("img");Ha.setAttribute("src",Editor.trashImage);Ha.setAttribute("title",mxResources.get("removeIt",[wa]));mxUtils.setOpacity(Ha,Qa?75:25);Ha.className="geAdaptiveAsset";Ha.style.verticalAlign="middle";Ha.style.cursor="pointer";Ha.style.width="16px";if(B||Editor.isDarkMode())Ha.style.filter=-"invert(100%)";mxEvent.addListener(Ha,"click",function(y){var O=mxUtils.indexOf(ka,wa);0<=O&&ka.splice(O,1);Z.removeTagsForCells(Z.model.getDescendants(Z.model.getRoot()),[wa]);Z.refresh();mxEvent.consume(y)});Sa.appendChild(Ha)}else{var Ma=document.createElement("input");Ma.setAttribute("type","checkbox");Ma.style.margin="0px";Ma.defaultChecked=null!=Ea&&0<=mxUtils.indexOf(Ea,wa);Ma.checked=Ma.defaultChecked;Ma.style.background="transparent";Ma.setAttribute("title",mxResources.get(Ma.defaultChecked?-"removeIt":"add",[wa]));mxEvent.addListener(Ma,"change",function(y){Ma.checked?Z.addTagsForCells(Z.getSelectionCells(),[wa]):Z.removeTagsForCells(Z.getSelectionCells(),[wa]);mxEvent.consume(y)});Sa.appendChild(Ma)}Ra.appendChild(Sa)}Ca.appendChild(Ra)})(za[Aa]);pa.appendChild(Ca);ua.appendChild(pa)}}var Z=this,ka=Z.hiddenTags.slice(),va=document.createElement("div");va.style.userSelect="none";va.style.overflow="hidden";va.style.padding="10px";va.style.height="100%";var ua=document.createElement("div");-ua.style.position="absolute";ua.style.boxSizing="border-box";ua.style.userSelect="none";ua.style.overflow="auto";ua.style.padding="3px";ua.style.left="0px";ua.style.right="0px";ua.style.top="0px";ua.style.bottom="0px";va.appendChild(ua);Z.addListener(mxEvent.ROOT,function(){ka=Z.hiddenTags.slice()});var qa=mxUtils.bind(this,function(za,Ea){if(k()){za=Z.getAllTags();for(Ea=0;Ea<za.length;Ea++)0>mxUtils.indexOf(ka,za[Ea])&&ka.push(za[Ea]);ka.sort();Z.isSelectionEmpty()?X(ka):X(ka,Z.getCommonTagsForCells(Z.getSelectionCells()))}});-Z.selectionModel.addListener(mxEvent.CHANGE,qa);Z.model.addListener(mxEvent.CHANGE,qa);Z.addListener(mxEvent.REFRESH,qa);var Ba=document.createElement("div");Ba.className="geToolbarContainer geDialogToolbar";Ba.style.position="absolute";Ba.style.display="flex";Ba.style.bottom="0px";Ba.style.left="0px";Ba.style.right="0px";Ba.style.height="32px";Ba.style.overflow="hidden";Ba.style.padding="3px 4px 4px 4px";Ba.style.borderWidth="1px 0px 0px 0px";Ba.style.borderStyle="solid";Ba.style.whiteSpace="nowrap";-if(Z.isEnabled()){ua.style.bottom="32px";var ya=document.createElement("a");ya.className="geButton";var La=ya.cloneNode(!1);La.style.backgroundImage="url("+Editor.visibleImage+")";La.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(La,"click",function(za){Z.setHiddenTags([]);mxEvent.isShiftDown(za)||(ka=Z.hiddenTags.slice());P();Z.refresh();mxEvent.consume(za)});Ba.appendChild(La);null!=I&&(ya=ya.cloneNode(!1),ya.style.backgroundImage="url("+Editor.plusImage+")",ya.setAttribute("title",-mxResources.get("add")),mxEvent.addListener(ya,"click",function(za){I(ka,function(Ea){ka=Ea;qa()});mxEvent.consume(za)}),Ba.appendChild(ya));va.appendChild(Ba)}null!=U&&Ba.appendChild(U);return{div:va,refresh:qa}};Graph.prototype.getCustomFonts=function(){var k=this.extFonts;k=null!=k?k.slice():[];for(var B in Graph.customFontElements){var I=Graph.customFontElements[B];k.push({name:I.name,url:I.url})}return k};Graph.prototype.setFont=function(k,B){Graph.addFont(k,B);var I=Editor.guid();document.execCommand("fontname",-!1,I);for(var U=this.cellEditor.textarea.getElementsByTagName("font"),P=!1,T=0;T<U.length;T++)U[T].getAttribute("face")==I&&(P=!0,U[T].setAttribute("face",k),null!=B?U[T].setAttribute("data-font-src",B):U[T].removeAttribute("data-font-src"));P||document.execCommand("fontname",!1,k)};var N=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return N.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=-Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var k=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=k)for(var B in k)this.globalVars[B]=k[B]}catch(I){null!=window.console&&console.log("Error in vars URL parameter: "+I)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var L=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(k){var B=-L.apply(this,arguments);null==B&&null!=this.globalVars&&(B=this.globalVars[k]);return B};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var k=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(k.ownerDocument)).decode(k)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var J=Graph.prototype.getSvg;Graph.prototype.getSvg=function(k,B,I,U,P,T,X,Z,ka,va,ua,qa,Ba,ya,La,za){var Ea=J.apply(this,arguments);if(null!=-qa){var pa=Ea.getAttribute("style");null==pa&&(pa="");qa="auto"==qa||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":qa;Ea.setAttribute("style",pa+(" color-scheme: "+qa+";"))}var Ca=this.getCustomFonts();if(ua&&0<Ca.length){var Aa=Ea.ownerDocument;pa=null!=Aa.createElementNS?Aa.createElementNS(mxConstants.NS_SVG,"style"):Aa.createElement("style");null!=Aa.setAttributeNS?pa.setAttributeNS("type","text/css"):pa.setAttribute("type","text/css");for(var wa="",Ya=-"",Qa=0;Qa<Ca.length;Qa++){var Ra=Ca[Qa].name,Sa=Ca[Qa].url;Graph.isCssFontUrl(Sa)?wa+="@import url("+Graph.rewriteGoogleFontUrl(Sa)+");\n":Ya+='@font-face {\nfont-family: "'+Ra+'";\nsrc: url("'+Sa+'");\n}\n'}pa.appendChild(Aa.createTextNode(wa+Ya));Ea.getElementsByTagName("defs")[0].appendChild(pa)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(Ea);this.mathEnabled&&(document.body.appendChild(Ea),Editor.MathJaxRender(Ea),Ea.parentNode.removeChild(Ea),-pa=Ea.ownerDocument.getElementById("MJX-SVG-styles"),null!=pa&&Ea.getElementsByTagName("defs")[0].appendChild(pa.cloneNode(!0)));return Ea};var Y=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(k){Y.apply(this,arguments);null!=k.secondLabel&&(k.secondLabel.destroy(),k.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(k){return[k.shape,k.text,k.secondLabel,k.control]};var ha=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=-function(){ha.apply(this,arguments);this.enumerationState=0};var ea=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(k){null!=k.shape&&this.redrawEnumerationState(k);return ea.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(k){k=decodeURIComponent(mxUtils.getValue(k.style,"enumerateValue",""));""==k&&(k=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(k)+-"</div>"};mxGraphView.prototype.redrawEnumerationState=function(k){var B="1"==mxUtils.getValue(k.style,"enumerate",0);B&&null==k.secondLabel?(k.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),k.secondLabel.size=12,k.secondLabel.state=k,k.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(k,k.secondLabel)):B||null==k.secondLabel||(k.secondLabel.destroy(),k.secondLabel=null);B=k.secondLabel;if(null!=B){var I=k.view.scale,-U=this.createEnumerationValue(k);k=this.graph.model.isVertex(k.cell)?new mxRectangle(k.x+k.width-4*I,k.y+4*I,0,0):mxRectangle.fromPoint(k.view.getPoint(k));B.bounds.equals(k)&&B.value==U&&B.scale==I||(B.bounds=k,B.value=U,B.scale=I,B.redraw())}};var aa=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();aa.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),-this.view.validateBackgroundImage())};var na=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){na.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(k,B){"data:action/json,"==k.substring(0,17)&&(k=JSON.parse(k.substring(17)),null!=k.actions&&this.executeCustomActions(k.actions,null,B))};Graph.prototype.executeCustomActions=function(k,B,I){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&&-window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=!0;var U=!1,P=0,T=0,X=mxUtils.bind(this,function(){U||(U=!0,this.model.beginUpdate())}),Z=mxUtils.bind(this,function(){U&&(U=!1,this.model.endUpdate())}),ka=mxUtils.bind(this,function(){0<P&&P--;0==P&&va()}),va=mxUtils.bind(this,function(){if(T<k.length){var ua=this.stoppingCustomActions,qa=-k[T++],Ba=[];if(null!=qa.open)if(Z(),this.isCustomLink(qa.open)){if(!this.customLinkClicked(qa.open,I))return}else this.openLink(qa.open);null==qa.wait||ua||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;ka()}),P++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=qa.wait?parseInt(qa.wait):1E3),Z());null!=qa.opacity&&null!=qa.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(qa.opacity,-!0)),qa.opacity.value);null!=qa.fadeIn&&(P++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(qa.fadeIn,!0)),0,1,ka,ua?0:qa.fadeIn.delay));null!=qa.fadeOut&&(P++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(qa.fadeOut,!0)),1,0,ka,ua?0:qa.fadeOut.delay));null!=qa.wipeIn&&(Ba=Ba.concat(this.createWipeAnimations(this.getCellsForAction(qa.wipeIn,!0),!0)));null!=qa.wipeOut&&(Ba=Ba.concat(this.createWipeAnimations(this.getCellsForAction(qa.wipeOut,!0),!1)));null!=qa.toggle&&-(X(),this.toggleCells(this.getCellsForAction(qa.toggle,!0)));if(null!=qa.show){X();var ya=this.getCellsForAction(qa.show,!0);Graph.setOpacityForNodes(this.getNodesForCells(ya),1);this.setCellsVisible(ya,!0)}null!=qa.hide&&(X(),ya=this.getCellsForAction(qa.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(ya),0),this.setCellsVisible(ya,!1));null!=qa.toggleStyle&&null!=qa.toggleStyle.key&&(X(),this.toggleCellStyles(qa.toggleStyle.key,null!=qa.toggleStyle.defaultValue?qa.toggleStyle.defaultValue:-"0",this.getCellsForAction(qa.toggleStyle,!0)));null!=qa.style&&null!=qa.style.key&&(X(),this.setCellStyles(qa.style.key,qa.style.value,this.getCellsForAction(qa.style,!0)));ya=[];null!=qa.select&&this.isEnabled()&&(ya=this.getCellsForAction(qa.select),this.setSelectionCells(ya));null!=qa.highlight&&(ya=this.getCellsForAction(qa.highlight),this.highlightCells(ya,qa.highlight.color,qa.highlight.duration,qa.highlight.opacity));null!=qa.scroll&&(ya=this.getCellsForAction(qa.scroll));null!=qa.viewbox&&-this.fitWindow(qa.viewbox,qa.viewbox.border);0<ya.length&&this.scrollCellToVisible(ya[0]);null!=I&&null!=qa.explore&&Graph.exploreFromCell(this,I,qa.explore);if(null!=qa.tags){if(null!=qa.tags.toggle){var La=qa.tags.toggle;0==La.length&&(La=this.getAllTags());for(ya=0;ya<La.length;ya++)this.toggleHiddenTag(La[ya])}La=null;null!=qa.tags.hidden&&(null==La&&(La=[]),La=La.concat(qa.tags.hidden));if(null!=qa.tags.visible){null==La&&(La=[]);var za=this.getAllTags();for(ya=0;ya<za.length;ya++)0>mxUtils.indexOf(qa.tags.visible,-za[ya])&&0>mxUtils.indexOf(La,za[ya])&&La.push(za[ya])}null!=La&&this.setHiddenTags(La);this.refresh()}0<Ba.length&&(P++,this.executeAnimations(Ba,ka,ua?1:qa.steps,ua?0:qa.delay));0==P?va():Z()}else this.stoppingCustomActions=this.executingCustomActions=!1,Z(),null!=B&&B()});va()}};Graph.prototype.doUpdateCustomLinksForCell=function(k,B){var I=this.getLinkForCell(B);null!=I&&"data:action/json,"==I.substring(0,17)&&this.setLinkForCell(B,this.updateCustomLink(k,I));if(this.isHtmlLabel(B)){var U=document.createElement("div");-U.innerHTML=Graph.sanitizeHtml(this.getLabel(B));for(var P=U.getElementsByTagName("a"),T=!1,X=0;X<P.length;X++)I=P[X].getAttribute("href"),null!=I&&"data:action/json,"==I.substring(0,17)&&(P[X].setAttribute("href",this.updateCustomLink(k,I)),T=!0);T&&this.labelChanged(B,U.innerHTML)}};Graph.prototype.updateCustomLink=function(k,B){if("data:action/json,"==B.substring(0,17))try{var I=JSON.parse(B.substring(17));null!=I.actions&&(this.updateCustomLinkActions(k,I.actions),B="data:action/json,"+JSON.stringify(I))}catch(U){}return B};-Graph.prototype.updateCustomLinkActions=function(k,B){for(var I=0;I<B.length;I++){var U=B[I],P;for(P in U)this.updateCustomLinkAction(k,U[P],"cells"),this.updateCustomLinkAction(k,U[P],"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(k,B,I){if(null!=B&&null!=B[I]){for(var U=[],P=0;P<B[I].length;P++)if("*"==B[I][P])U.push(B[I][P]);else{var T=k[B[I][P]];null!=T?""!=T&&U.push(T):U.push(B[I][P])}B[I]=U}};Graph.prototype.getCellsForAction=function(k,B){B=this.getCellsById(k.cells).concat(this.getCellsForTags(k.tags,-null,B));if(null!=k.excludeCells){for(var I=[],U=0;U<B.length;U++)0>k.excludeCells.indexOf(B[U].id)&&I.push(B[U]);B=I}return B};Graph.prototype.getCellsById=function(k){var B=[];if(null!=k)for(var I=0;I<k.length;I++)if("*"==k[I]){var U=this.model.getRoot();B=B.concat(this.model.filterDescendants(function(T){return T!=U},U))}else{var P=this.model.getCell(k[I]);null!=P&&B.push(P)}return B};var W=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(k){return W.apply(this,arguments)&&-!this.isAllTagsHidden(this.getTagsForCell(k))};Graph.prototype.setHiddenTags=function(k){this.hiddenTags=k;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(k){var B=mxUtils.indexOf(this.hiddenTags,k);0>B?this.hiddenTags.push(k):0<=B&&this.hiddenTags.splice(B,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(k){if(null==k||0==k.length||0==this.hiddenTags.length)return!1;k=k.split(" ");if(k.length>this.hiddenTags.length)return!1;-for(var B=0;B<k.length;B++)if(0>mxUtils.indexOf(this.hiddenTags,k[B]))return!1;return!0};Graph.prototype.getCellsForTags=function(k,B,I,U){var P=[];if(null!=k){B=null!=B?B:this.model.getDescendants(this.model.getRoot());for(var T=0,X={},Z=0;Z<k.length;Z++)0<k[Z].length&&(X[k[Z]]=!0,T++);for(Z=0;Z<B.length;Z++)if(I&&this.model.getParent(B[Z])==this.model.root||this.model.isVertex(B[Z])||this.model.isEdge(B[Z])){var ka=this.getTagsForCell(B[Z]),va=!1;if(0<ka.length&&(ka=ka.split(" "),ka.length>=k.length)){for(var ua=-va=0;ua<ka.length&&va<T;ua++)null!=X[ka[ua]]&&va++;va=va==T}va&&(1!=U||this.isCellVisible(B[Z]))&&P.push(B[Z])}}return P};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(k){for(var B=null,I=[],U=0;U<k.length;U++){var P=this.getTagsForCell(k[U]);I=[];if(0<P.length){P=P.split(" ");for(var T={},X=0;X<P.length;X++)if(null==B||null!=B[P[X]])T[P[X]]=!0,I.push(P[X]);B=T}else return[]}return I};-Graph.prototype.getTagsForCells=function(k){for(var B=[],I={},U=0;U<k.length;U++){var P=this.getTagsForCell(k[U]);if(0<P.length){P=P.split(" ");for(var T=0;T<P.length;T++)null==I[P[T]]&&(I[P[T]]=!0,B.push(P[T]))}}return B};Graph.prototype.getTagsForCell=function(k){return this.getAttributeForCell(k,"tags","")};Graph.prototype.addTagsForCells=function(k,B){if(0<k.length&&0<B.length){this.model.beginUpdate();try{for(var I=0;I<k.length;I++){for(var U=this.getTagsForCell(k[I]),P=U.split(" "),T=!1,X=0;X<-B.length;X++){var Z=mxUtils.trim(B[X]);""!=Z&&0>mxUtils.indexOf(P,Z)&&(U=0<U.length?U+" "+Z:Z,T=!0)}T&&this.setAttributeForCell(k[I],"tags",U)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(k,B){if(0<k.length&&0<B.length){this.model.beginUpdate();try{for(var I=0;I<k.length;I++){var U=this.getTagsForCell(k[I]);if(0<U.length){for(var P=U.split(" "),T=!1,X=0;X<B.length;X++){var Z=mxUtils.indexOf(P,B[X]);0<=Z&&(P.splice(Z,1),T=!0)}T&&this.setAttributeForCell(k[I],"tags",-P.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(k){this.model.beginUpdate();try{for(var B=0;B<k.length;B++)this.model.setVisible(k[B],!this.model.isVisible(k[B]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(k,B){this.model.beginUpdate();try{for(var I=0;I<k.length;I++)this.model.setVisible(k[I],B)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(k,B,I,U){for(var P=0;P<k.length;P++)this.highlightCell(k[P],B,-I,U)};Graph.prototype.highlightCell=function(k,B,I,U,P){B=null!=B?B:mxConstants.DEFAULT_VALID_COLOR;I=null!=I?I:1E3;k=this.view.getState(k);var T=null;null!=k&&(P=null!=P?P:4,P=Math.max(P+1,mxUtils.getValue(k.style,mxConstants.STYLE_STROKEWIDTH,1)+P),T=new mxCellHighlight(this,B,P,!1),null!=U&&(T.opacity=U),T.highlight(k),window.setTimeout(function(){null!=T.shape&&(mxUtils.setPrefixedStyle(T.shape.node.style,"transition","all 1200ms ease-in-out"),T.shape.node.style.opacity=0);window.setTimeout(function(){T.destroy()},-1200)},I));return T};Graph.prototype.addSvgShadow=function(k,B,I,U){I=null!=I?I:!1;U=null!=U?U:!0;var P=k.ownerDocument,T=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"filter"):P.createElement("filter");T.setAttribute("id",this.shadowId);var X=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):P.createElement("feGaussianBlur");X.setAttribute("in","SourceAlpha");X.setAttribute("stdDeviation",this.svgShadowBlur);X.setAttribute("result","blur");T.appendChild(X);-X=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feOffset"):P.createElement("feOffset");X.setAttribute("in","blur");X.setAttribute("dx",this.svgShadowSize);X.setAttribute("dy",this.svgShadowSize);X.setAttribute("result","offsetBlur");T.appendChild(X);X=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feFlood"):P.createElement("feFlood");X.setAttribute("flood-color",this.svgShadowColor);X.setAttribute("flood-opacity",this.svgShadowOpacity);X.setAttribute("result","offsetColor");-T.appendChild(X);X=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feComposite"):P.createElement("feComposite");X.setAttribute("in","offsetColor");X.setAttribute("in2","offsetBlur");X.setAttribute("operator","in");X.setAttribute("result","offsetBlur");T.appendChild(X);X=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feBlend"):P.createElement("feBlend");X.setAttribute("in","SourceGraphic");X.setAttribute("in2","offsetBlur");T.appendChild(X);X=k.getElementsByTagName("defs");-0==X.length?(P=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"defs"):P.createElement("defs"),null!=k.firstChild?k.insertBefore(P,k.firstChild):k.appendChild(P)):P=X[0];P.appendChild(T);I||(B=null!=B?B:k.getElementsByTagName("g")[0],null!=B&&(B.setAttribute("filter","url(#"+this.shadowId+")"),!isNaN(parseInt(k.getAttribute("width")))&&U&&(k.setAttribute("width",parseInt(k.getAttribute("width"))+6),k.setAttribute("height",parseInt(k.getAttribute("height"))+6),B=k.getAttribute("viewBox"),-null!=B&&0<B.length&&(B=B.split(" "),3<B.length&&(w=parseFloat(B[2])+6,h=parseFloat(B[3])+6,k.setAttribute("viewBox",B[0]+" "+B[1]+" "+w+" "+h))))));return T};Graph.prototype.setShadowVisible=function(k,B){mxClient.IS_SVG&&!mxClient.IS_SF&&(B=null!=B?B:!0,(this.shadowVisible=k)?this.view.getDrawPane().setAttribute("filter","url(#"+this.shadowId+")"):this.view.getDrawPane().removeAttribute("filter"),B&&this.fireEvent(new mxEventObject("shadowVisibleChanged")))};Graph.prototype.checkDefaultParent=function(){null==-this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var k=this.model.getChildCount(this.model.root),B=0;do var I=this.model.getChildAt(this.model.root,B);while(B++<k&&"1"==mxUtils.getValue(this.getCellStyle(I),"locked","0"));null!=I&&this.setDefaultParent(I)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=-[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=[SHAPES_PATH+"/mxCisco19.js",STENCIL_PATH+-"/cisco19.xml"];mxStencilRegistry.libraries.cisco_safe=[SHAPES_PATH+"/mxCiscoSafe.js",STENCIL_PATH+"/cisco_safe/architecture.xml",STENCIL_PATH+"/cisco_safe/business_icons.xml",STENCIL_PATH+"/cisco_safe/capability.xml",STENCIL_PATH+"/cisco_safe/design.xml",STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",STENCIL_PATH+"/cisco_safe/people_places_things_icons.xml",STENCIL_PATH+"/cisco_safe/security_icons.xml",STENCIL_PATH+"/cisco_safe/technology_icons.xml",STENCIL_PATH+"/cisco_safe/threat.xml"];mxStencilRegistry.libraries.dfd=-[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.kubernetes=[SHAPES_PATH+"/mxKubernetes.js",STENCIL_PATH+"/kubernetes.xml",STENCIL_PATH+"/kubernetes2.xml"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=-[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/abstract"]=-[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/miscellaneous"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/miscellaneous.xml"];mxStencilRegistry.libraries["electrical/signal_sources"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/signal_sources.xml"];mxStencilRegistry.libraries["electrical/electro-mechanical"]=-[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/electro-mechanical.xml"];mxStencilRegistry.libraries["electrical/transmission"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries.infographic=[SHAPES_PATH+"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries["mockup/containers"]=[SHAPES_PATH+"/mockup/mxMockupContainers.js"];mxStencilRegistry.libraries["mockup/forms"]=-[SHAPES_PATH+"/mockup/mxMockupForms.js"];mxStencilRegistry.libraries["mockup/graphics"]=[SHAPES_PATH+"/mockup/mxMockupGraphics.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/markup"]=[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=-[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.ibm=[SHAPES_PATH+"/mxIBM.js",STENCIL_PATH+-"/ibm.xml"];mxStencilRegistry.libraries.ibmcloud=[STENCIL_PATH+"/ibm_cloud.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=-[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=[SHAPES_PATH+"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];-mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=-[STENCIL_PATH+"/salesforce.xml"];mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(k){var B=null;null!=k&&0<k.length&&("ER"==k.substring(0,2)?B="mxgraph.er":"sysML"==k.substring(0,5)&&(B="mxgraph.sysml"));return B};var ba=mxMarker.createMarker;mxMarker.createMarker=function(k,B,I,U,P,T,X,Z,ka,va){if(null!=I&&null==mxMarker.markers[I]){var ua=this.getPackageForType(I);-null!=ua&&mxStencilRegistry.getStencil(ua)}return ba.apply(this,arguments)};var ja=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(k,B,I,U,P,T){"1"==mxUtils.getValue(B.style,"lineShape",null)&&k.setFillColor(mxUtils.getValue(B.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return ja.apply(this,arguments)};PrintDialog.prototype.create=function(k,B,I,U){function P(){La.value=Math.max(1,Math.min(ua,Math.max(parseInt(La.value),parseInt(ya.value))));ya.value=Math.max(1,Math.min(ua,-Math.min(parseInt(La.value),parseInt(ya.value))))}function T(Da){k.lastPrintPagesRadioChecked=Ba.checked;k.lastPrintSelectionOnlyChecked=Ea.checked;k.lastPrintCropRadioChecked=Ca.checked;k.lastPrintFitRadioChecked=Aa.checked;Ba.checked&&ya.value<La.value?(k.lastPrintPagesFromInput=ya.value,k.lastPrintPagesToInput=La.value):(k.lastPrintPagesFromInput=null,k.lastPrintPagesToInput=null);fa.value=Math.max(1,Math.min(1600,parseInt(fa.value)))+"%";k.lastPrintZoom=fa.value;k.lastPrintBorder=V.value;k.lastPrintGrid=-ia.checked;k.lastPrintTransparent=oa.checked;k.lastPrintInclude=ta.checked;k.lastPrintSheetsAcross=O.value;k.lastPrintSheetsDown=R.value;var Ia={};Ia.border=parseInt(V.value);Ia.scale=parseInt(fa.value)/100;Ia.grid=ia.checked;Ia.transparent=oa.checked;Ia.includeCopy=ta.checked;Ia.sheetsAcross=parseInt(O.value);Ia.sheetsDown=parseInt(R.value);Ia.pagesFrom=parseInt(ya.value);Ia.pagesTo=parseInt(La.value);Ia.allPages=qa.checked;Ia.selection=Ea.checked;Ia.pageView=pa.checked;Ia.crop=Ca.checked;Ia.fit=-Aa.checked;return null!=I?I(!Da,Ia):k.print(!Da,Ia)}var X=k.editor.graph,Z=document.createElement("div"),ka=document.createElement("h3");ka.style.width="100%";ka.style.textAlign="center";ka.style.marginTop="0px";mxUtils.write(ka,B||mxResources.get("print"));Z.appendChild(ka);var va=1,ua=1;ka=document.createElement("div");ka.style.whiteSpace="nowrap";var qa=document.createElement("input");qa.style.marginRight="8px";qa.style.marginBottom="8px";qa.setAttribute("type","radio");qa.setAttribute("name",-"pages-printdialog");ka.appendChild(qa);B=document.createElement("span");mxUtils.write(B,mxResources.get("allPages"));mxEvent.addListener(B,"click",function(){qa.checked=!0});ka.appendChild(B);mxUtils.br(ka);var Ba=qa.cloneNode(!0);ka.appendChild(Ba);B=document.createElement("span");mxUtils.write(B,mxResources.get("pages")+":");ka.appendChild(B);mxEvent.addListener(B,"click",function(){Ba.checked=!0});var ya=document.createElement("input");ya.style.margin="0 4px";ya.setAttribute("value","1");ya.setAttribute("type",-"number");ya.setAttribute("min","1");ya.style.width="40px";ka.appendChild(ya);B=document.createElement("span");mxUtils.write(B,mxResources.get("to"));ka.appendChild(B);var La=ya.cloneNode(!0);ka.appendChild(La);mxEvent.addListener(ya,"focus",function(){Ba.checked=!0});mxEvent.addListener(La,"focus",function(){Ba.checked=!0});mxEvent.addListener(ya,"change",P);mxEvent.addListener(La,"change",P);if(null!=k.pages&&(ua=k.pages.length,null!=k.currentPage))for(var za=0;za<ua;za++)if(k.currentPage==k.pages[za]){va=-za+1;break}null!=k.lastPrintPagesFromInput&&null!=k.lastPrintPagesToInput?(ya.value=Math.min(ua,Math.max(1,k.lastPrintPagesFromInput)),La.value=Math.min(ua,Math.max(1,k.lastPrintPagesToInput))):(ya.value=va,La.value=va);ya.setAttribute("max",ua);La.setAttribute("max",ua);za=mxUtils.button(mxResources.get("currentPage"),function(Da){ya.value=va;La.value=va;Ba.checked=!0});za.setAttribute("title",mxResources.get("currentPage"));za.style.marginLeft="4px";za.style.maxWidth="100px";za.style.overflow="hidden";-za.style.textOverflow="ellipsis";za.style.whiteSpace="nowrap";ka.appendChild(za);1<ua&&Z.appendChild(ka);ka=document.createElement("div");ka.style.borderBottom="1px solid lightGray";ka.style.paddingBottom="12px";ka.style.marginBottom="12px";ka.style.whiteSpace="nowrap";var Ea=document.createElement("input");Ea.setAttribute("name","pages-printdialog");Ea.setAttribute("type",1==ua?"checkbox":"radio");Ea.style.marginRight="8px";X.isSelectionEmpty()&&Ea.setAttribute("disabled","disabled");X.isEnabled()&&-(ka.appendChild(Ea),B=document.createElement("span"),mxUtils.write(B,mxResources.get("selectionOnly")),ka.appendChild(B));(X.isEnabled()||1<ua)&&Z.appendChild(ka);!k.isPagesEnabled()||k.lastPrintPagesRadioChecked?Ba.checked=!0:!X.isSelectionEmpty()&&k.lastPrintSelectionOnlyChecked?Ea.checked=!0:qa.checked=!0;X.isSelectionEmpty()||mxEvent.addListener(B,"click",function(){Ea.checked=!Ea.checked});X=document.createElement("div");X.style.whiteSpace="nowrap";var pa=document.createElement("input");pa.style.marginBottom=-"8px";pa.style.marginRight="8px";pa.setAttribute("type","radio");pa.setAttribute("name","printSize");X.appendChild(pa);B=document.createElement("span");mxUtils.write(B,mxResources.get("pageView"));X.appendChild(B);mxEvent.addListener(X,"click",function(){pa.checked=!0});Z.appendChild(X);X=document.createElement("div");X.style.whiteSpace="nowrap";var Ca=document.createElement("input");Ca.style.marginBottom="8px";Ca.style.marginRight="8px";Ca.setAttribute("type","radio");Ca.setAttribute("name","printSize");-X.appendChild(Ca);B=document.createElement("span");mxUtils.write(B,mxResources.get("crop"));X.appendChild(B);mxEvent.addListener(X,"click",function(){Ca.checked=!0});Z.appendChild(X);X=document.createElement("div");X.style.whiteSpace="nowrap";var Aa=document.createElement("input");Aa.style.marginBottom="8px";Aa.style.marginRight="8px";Aa.setAttribute("type","radio");Aa.setAttribute("name","printSize");B=document.createElement("div");B.style.display="inline-block";B.style.verticalAlign="top";B.style.paddingTop=-"2px";B.appendChild(Aa);X.appendChild(B);ka=document.createElement("table");ka.style.display="inline-block";ka.style.borderSpacing="0";za=document.createElement("tbody");var wa=document.createElement("tr"),Ya=wa.cloneNode(!0),Qa=document.createElement("td"),Ra=Qa.cloneNode(!0),Sa=Qa.cloneNode(!0),Ha=Qa.cloneNode(!0),Ma=Qa.cloneNode(!0),y=Qa.cloneNode(!0);Qa.style.textAlign="right";Ha.style.textAlign="right";mxUtils.write(Qa,mxResources.get("fitTo"));mxEvent.addListener(X,"click",function(Da){mxEvent.getSource(Da)!=-Aa&&(Aa.checked=!Aa.checked)});var O=document.createElement("input");O.style.margin="0 2px";O.style.boxSizing="border-box";O.setAttribute("value",k.lastPrintSheetsAcross||"1");O.setAttribute("min","1");O.setAttribute("type","number");O.style.width="40px";Ra.appendChild(O);B=document.createElement("span");mxUtils.write(B,mxResources.get("fitToSheetsAcross"));Sa.appendChild(B);mxUtils.write(Ha,mxResources.get("fitToBy"));var R=O.cloneNode(!0);R.setAttribute("value",k.lastPrintSheetsDown||"1");Ma.appendChild(R);-mxEvent.addListener(O,"click",function(Da){Aa.checked=!0;mxEvent.consume(Da)});mxEvent.addListener(R,"click",function(Da){Aa.checked=!0;mxEvent.consume(Da)});k.lastPrintCropRadioChecked?Ca.checked=!0:k.lastPrintFitRadioChecked?Aa.checked=!0:pa.checked=!0;B=document.createElement("span");mxUtils.write(B,mxResources.get("fitToSheetsDown"));y.appendChild(B);wa.appendChild(Qa);wa.appendChild(Ra);wa.appendChild(Sa);Ya.appendChild(Ha);Ya.appendChild(Ma);Ya.appendChild(y);za.appendChild(wa);za.appendChild(Ya);-ka.appendChild(za);X.appendChild(ka);Z.appendChild(X);X=document.createElement("div");X.style.borderTop="1px solid lightGray";X.style.whiteSpace="nowrap";X.style.paddingTop="12px";X.style.marginTop="12px";X.style.paddingLeft="8px";mxUtils.write(X,mxResources.get("borderWidth")+":");var V=document.createElement("input");V.setAttribute("type","number");V.setAttribute("min","0");V.style.width="40px";V.style.marginLeft="4px";V.value=null!=k.lastPrintBorder?k.lastPrintBorder:mxPrintPreview.prototype.pageMargin;-X.appendChild(V);B=document.createElement("span");B.style.marginLeft="8px";mxUtils.write(B,mxResources.get("zoom")+":");X.appendChild(B);var fa=document.createElement("input");fa.style.width="60px";fa.style.marginLeft="4px";fa.value=null!=k.lastPrintZoom?k.lastPrintZoom:"100%";X.appendChild(fa);mxUtils.br(X);var ia=document.createElement("input");ia.setAttribute("type","checkbox");ia.style.marginTop="12px";ia.checked=null!=k.lastPrintGrid?k.lastPrintGrid:!1;X.appendChild(ia);B=document.createElement("span");-B.style.marginLeft="4px";B.style.marginRight="8px";mxUtils.write(B,mxResources.get("grid"));X.appendChild(B);mxEvent.addListener(B,"click",function(Da){ia.checked=!0;mxEvent.consume(Da)});var oa=document.createElement("input");oa.setAttribute("type","checkbox");oa.style.marginTop="10px";oa.checked=null!=k.lastPrintTransparent?k.lastPrintTransparent:!1;null!=I&&(X.appendChild(oa),B=document.createElement("span"),B.style.marginLeft="4px",mxUtils.write(B,mxResources.get("transparentBackground")),X.appendChild(B),-mxEvent.addListener(B,"click",function(Da){oa.checked=!0;mxEvent.consume(Da)}));var ta=document.createElement("input");ta.setAttribute("type","checkbox");ta.style.marginTop="10px";ta.checked=null!=k.lastPrintInclude?k.lastPrintInclude:Editor.defaultIncludeDiagram;null==I||mxClient.IS_CHROMEAPP||"draw.io"!=k.getServiceName()||(mxUtils.br(X),X.appendChild(ta),B=document.createElement("span"),B.style.marginLeft="4px",mxUtils.write(B,mxResources.get("includeCopyOfMyDiagram")),X.appendChild(B),mxEvent.addListener(B,-"click",function(Da){ta.checked=!0;mxEvent.consume(Da)}));Z.appendChild(X);B=document.createElement("div");B.style.marginTop="40px";B.style.textAlign="right";B.style.whiteSpace="nowrap";k.isOffline()||null!=I||B.appendChild(k.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));X=mxUtils.button(mxResources.get("cancel"),function(){k.hideDialog()});X.className="geBtn";k.editor.cancelFirst&&B.appendChild(X);PrintDialog.previewEnabled&&null==I&&(ka=mxUtils.button(mxResources.get("preview"),-function(){try{k.hideDialog(),T(!1)}catch(Da){k.handleError(Da)}}),ka.className="geBtn",B.appendChild(ka));U=null!=U?U:null!=I?"export":PrintDialog.previewEnabled?"print":"ok";U=mxUtils.button(mxResources.get(U),function(){try{k.hideDialog(),T(!0)}catch(Da){k.handleError(Da)}});U.className="geBtn gePrimaryBtn";B.appendChild(U);k.editor.cancelFirst||B.appendChild(X);Z.appendChild(B);if(k.editor.isChromelessView()){var ra=function(){Editor.isDarkMode()?(Z.classList.add("geDarkMode"),Z.style.colorScheme=-"dark"):(Z.classList.remove("geDarkMode"),Z.style.colorScheme="light")};k.addListener("darkModeChanged",ra);ra();var xa=function(Da,Ia){Da=Ia.getProperty("dialog");Z.parentNode==Da.container&&(k.editor.removeListener(xa),k.removeListener(ra))};k.editor.addListener("hideDialog",xa)}this.container=Z};var ca=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);if(this.page!=this.ui.currentPage){if(null!=this.page.viewState){this.ignoreColor||-(this.page.viewState.background=this.color);if(!this.ignoreImage){var k=this.image;null!=k&&null!=k.src&&Graph.isPageLink(k.src)&&(k={originalSrc:k.src});this.page.viewState.backgroundImage=k}null!=this.format&&(this.page.viewState.pageFormat=this.format);null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled);null!=this.adaptiveColors&&(this.page.viewState.adaptiveColors=this.adaptiveColors);null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)}}else ca.apply(this,-arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.adaptiveColors&&this.adaptiveColors!=this.ui.editor.graph.adaptiveColors&&(k=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=k?k:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),-this.shadowVisible=!this.shadowVisible)};Editor.prototype.useCanvasForExport=!1;try{var la=document.createElement("canvas"),Q=new Image;Q.onload=function(){try{la.getContext("2d").drawImage(Q,0,0);var k=la.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=k&&6<k.length}catch(B){}};Q.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(k){}Editor.prototype.useCanvasForExport=-!1})();(function(){var b=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);b.beforeDecode=function(e,g,m){m.ui=e.ui;return g};b.afterDecode=function(e,g,m){m.previousColor=m.color;m.previousImage=m.image;m.previousFormat=m.format;m.previousAdaptiveColors=m.adaptiveColors;null!=m.foldingEnabled&&(m.foldingEnabled=!m.foldingEnabled);null!=m.mathEnabled&&(m.mathEnabled=!m.mathEnabled);null!=m.shadowVisible&&(m.shadowVisible=!m.shadowVisible);return m};mxCodecRegistry.register(b)})();-(function(){var b=new mxObjectCodec(new ChangeGridColor,["ui"]);b.beforeDecode=function(e,g,m){m.ui=e.ui;return g};mxCodecRegistry.register(b)})();(function(){EditorUi.VERSION="26.2.2";EditorUi.compactUi="atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&"support.draw.io"!=window.location.hostname&&+{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;var f=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var k=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&"image"!=k.style.shape&&!k.containsLabel&&0<k.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));+f.apply(this,arguments);null!=k.customProperties&&this.container.appendChild(this.addProperties(this.createPanel(),k.customProperties,k))};var l=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(k){var B=this.editorUi.getSelectionState();1==B.cells.length?this.addActions(k,["copyStyle","pasteStyle"]):1<=B.cells.length&&this.addActions(k,["pasteStyle","pasteData"]);l.apply(this,arguments);return k};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=+function(k,B,I,U){function P(Ma,y,O,R,V){if(null!=O.valueChanged)O.valueChanged(y,V);else{Ba.getModel().beginUpdate();try{V=[];var fa=[];if(null!=O.index){for(var ia=[],oa=O.parentRow.nextSibling;oa&&oa.getAttribute("data-pName")==Ma;)ia.push(oa.getAttribute("data-pValue")),oa=oa.nextSibling;O.index<ia.length?null!=R?ia.splice(R,1):ia[O.index]=y:ia.push(y);null!=O.size&&ia.length>O.size&&(ia=ia.slice(0,O.size));y=ia.join(",");null!=O.countProperty&&(Ba.setCellStyles(O.countProperty,ia.length,Ba.getSelectionCells()),+V.push(O.countProperty),fa.push(ia.length))}Ba.setCellStyles(Ma,y,Ba.getSelectionCells());V.push(Ma);fa.push(y);if(null!=O.dependentProps)for(Ma=0;Ma<O.dependentProps.length;Ma++){var ta=O.dependentPropsDefVal[Ma],ra=O.dependentPropsVals[Ma];if(ra.length>y)ra=ra.slice(0,y);else for(var xa=ra.length;xa<y;xa++)ra.push(ta);ra=ra.join(",");Ba.setCellStyles(O.dependentProps[Ma],ra,Ba.getSelectionCells());V.push(O.dependentProps[Ma]);fa.push(ra)}if("function"==typeof O.onChange)O.onChange(Ba,y);qa.editorUi.fireEvent(new mxEventObject("styleChanged",+"keys",V,"values",fa,"cells",Ba.getSelectionCells()))}finally{Ba.getModel().endUpdate()}}}function T(Ma,y,O){var R=mxUtils.getOffset(k,!0),V=mxUtils.getOffset(Ma,!0);y.style.position="absolute";y.style.left=V.x-R.x+"px";y.style.top=V.y-R.y+"px";y.style.width=Ma.offsetWidth+"px";y.style.height=Ma.offsetHeight-(O?4:0)+"px";y.style.zIndex=5}function X(Ma,y,O){function R(fa){if(null==fa||fa==mxConstants.NONE)V.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==fa)V.style.background=+"";else{var ia=mxUtils.getLightDarkColor(fa);mxUtils.isLightDarkColor(fa)&&ia.light!=ia.dark?V.style.background="linear-gradient(to right bottom, "+ia.cssText+" 50%, "+mxUtils.invertLightDarkColor(ia).cssText+" 50.3%)":V.style.background=fa}}var V=document.createElement("div");V.style.width="32px";V.style.height="8px";V.style.margin="2px";V.style.borderStyle="solid";V.style.borderWidth="1px";R(y);btn=mxUtils.button("",mxUtils.bind(qa,function(fa){this.editorUi.pickColor(y,function(ia){P(Ma,ia,O);+R(ia)});mxEvent.consume(fa)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(V);return btn}function Z(Ma,y,O,R,V,fa,ia){null!=y&&(y=y.split(","),ya.push({name:Ma,values:y,type:O,defVal:R,countProperty:V,parentRow:fa,isDeletable:!0,flipBkg:ia}));btn=mxUtils.button("+",mxUtils.bind(qa,function(oa){for(var ta=fa,ra=0;null!=ta.nextSibling;)if(ta.nextSibling.getAttribute("data-pName")==Ma)ta=ta.nextSibling,+ra++;else break;var xa={type:O,parentRow:fa,index:ra,isDeletable:!0,defVal:R,countProperty:V};ra=ua(Ma,"",xa,0==ra%2,ia);P(Ma,R,xa);ta.parentNode.insertBefore(ra,ta.nextSibling);mxEvent.consume(oa)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function ka(Ma,y,O,R,V,fa,ia){if(0<V){var oa=Array(V);y=null!=y?y.split(","):[];for(var ta=0;ta<V;ta++)oa[ta]=null!=y[ta]?y[ta]:null!=R?R:"";ya.push({name:Ma,values:oa,type:O,defVal:R,parentRow:fa,flipBkg:ia,size:V})}return document.createElement("div")}+function va(Ma,y,O){var R=document.createElement("input");R.type="checkbox";R.checked="1"==y;mxEvent.addListener(R,"change",function(){P(Ma,R.checked?"1":"0",O)});return R}function ua(Ma,y,O,R,V){var fa=O.dispName,ia=O.type,oa=document.createElement("tr");oa.className="gePropRow"+(V?"Dark":"")+(R?"Alt":"")+" gePropNonHeaderRow";oa.setAttribute("data-pName",Ma);oa.setAttribute("data-pValue",y);R=!1;null!=O.index&&(oa.setAttribute("data-index",O.index),fa=(null!=fa?fa:"")+"["+O.index+"]",R=!0);var ta=+document.createElement("td");ta.className="gePropRowCell";fa=mxResources.get(fa,null,fa);mxUtils.write(ta,fa);ta.setAttribute("title",fa);R&&(ta.style.textAlign="right");oa.appendChild(ta);ta=document.createElement("td");ta.className="gePropRowCell";ta.setAttribute("title",null!=y?y:mxResources.get("none"));if("color"==ia)ta.appendChild(X(Ma,y,O));else if("bool"==ia||"boolean"==ia)ta.appendChild(va(Ma,y,O));else if("enum"==ia){var ra=O.enumList;for(V=0;V<ra.length;V++)if(fa=ra[V],fa.val==y){mxUtils.write(ta,+mxResources.get(fa.dispName,null,fa.dispName));break}mxEvent.addListener(ta,"click",mxUtils.bind(qa,function(){var xa=document.createElement("select"),Da=null;T(ta,xa);for(var Ia=0;Ia<ra.length;Ia++){var Xa=ra[Ia],Za=document.createElement("option");Za.value=mxUtils.htmlEntities(Xa.val);mxUtils.write(Za,mxResources.get(Xa.dispName,null,Xa.dispName));xa.appendChild(Za);null==Xa.val&&(Za.value="null",Da=Za)}xa.value=null==y&&null!=Da?"null":y;k.appendChild(xa);mxEvent.addListener(xa,"change",function(){var $a=+mxUtils.htmlEntities(xa.value);if(xa[xa.selectedIndex]==Da||"null"==$a.value)$a=null;P(Ma,$a,O)});xa.focus();mxEvent.addListener(xa,"blur",function(){k.removeChild(xa)})}))}else"dynamicArr"==ia?ta.appendChild(Z(Ma,y,O.subType,O.subDefVal,O.countProperty,oa,V)):"staticArr"==ia?ta.appendChild(ka(Ma,y,O.subType,O.subDefVal,O.size,oa,V)):"readOnly"==ia?(V=document.createElement("input"),V.setAttribute("readonly",""),V.value=y,V.style.borderWidth="0px","id"==Ma?(V.style.width="190px",V.style.position=+"relative",V.style.right="6px",V.style.float="right",V.style.background="none",V.style.textAlign="right",oa.firstChild.setAttribute("colspan","2"),V.setAttribute("title",y),oa.firstChild.appendChild(V)):(V.style.width="96px",ta.appendChild(V))):(ta.innerHTML=mxUtils.htmlEntities(decodeURIComponent(y)),mxEvent.addListener(ta,"click",mxUtils.bind(qa,function(){function xa(){var Ia=Da.value;Ia=0==Ia.length&&"string"!=ia&&"numbers"!=ia?0:Ia;O.allowAuto&&(null!=Ia.trim&&"auto"==Ia.trim().toLowerCase()?+(Ia="auto",ia="string"):(Ia=parseFloat(Ia),Ia=isNaN(Ia)?0:Ia));null!=O.min&&Ia<O.min?Ia=O.min:null!=O.max&&Ia>O.max&&(Ia=O.max);var Xa=null;try{Xa="numbers"==ia?Ia.match(/\d+/g).map(Number).join(" "):encodeURIComponent(("int"==ia?parseInt(Ia):Ia)+"")}catch(Za){}P(Ma,Xa,O,null,Da)}var Da=document.createElement("input");T(ta,Da,!0);Da.value=decodeURIComponent(y);Da.className="gePropEditor";"int"!=ia&&"float"!=ia||O.allowAuto||(Da.type="number",Da.step="int"==ia?"1":"any",null!=O.min&&(Da.min=parseFloat(O.min)),+null!=O.max&&(Da.max=parseFloat(O.max)));k.appendChild(Da);mxEvent.addListener(Da,"keypress",function(Ia){13==Ia.keyCode&&xa()});Da.focus();mxEvent.addListener(Da,"blur",function(){xa()})})));O.isDeletable&&(V=mxUtils.button("-",mxUtils.bind(qa,function(xa){P(Ma,"",O,O.index);mxEvent.consume(xa)})),V.style.height="16px",V.style.width="25px",V.style.float="right",V.className="geColorBtn",ta.appendChild(V));oa.appendChild(ta);return oa}var qa=this,Ba=this.editorUi.editor.graph,ya=[],La=document.createElement("table");+La.className="geProperties geFullWidthElement";var za=document.createElement("tr");za.className="gePropHeader";var Ea=document.createElement("th");Ea.className="gePropHeaderCell";Ea.style.paddingLeft="16px";Ea.style.backgroundRepeat="no-repeat";Ea.style.backgroundPosition="-2px 50%";Ea.style.backgroundSize="20px";mxUtils.write(Ea,mxResources.get("property"));za.style.cursor="pointer";var pa=function(){var Ma=La.querySelectorAll(".gePropNonHeaderRow");if(qa.editorUi.propertiesCollapsed){Ea.style.backgroundImage=+"url('"+Editor.arrowRightImage+"')";var y="none";for(var O=k.childNodes.length-1;0<=O;O--)try{var R=k.childNodes[O],V=R.nodeName.toUpperCase();"INPUT"!=V&&"SELECT"!=V||k.removeChild(R)}catch(fa){}}else Ea.style.backgroundImage="url('"+Editor.arrowDownImage+"')",y="";for(O=0;O<Ma.length;O++)Ma[O].style.display=y};mxEvent.addListener(za,"click",function(){qa.editorUi.propertiesCollapsed=!qa.editorUi.propertiesCollapsed;pa()});za.appendChild(Ea);var Ca=document.createElement("th");Ca.className="gePropHeaderCell";+Ca.style.paddingLeft="4px";mxUtils.write(Ca,mxResources.get("value"));za.appendChild(Ca);La.appendChild(za);var Aa=Ca=!1;za=null;1==I.vertices.length&&0==I.edges.length?za=I.vertices[0].id:0==I.vertices.length&&1==I.edges.length&&(za=I.edges[0].id);null==za||U||La.appendChild(ua("id",mxUtils.htmlEntities(za),{dispName:"id",type:"readOnly"},!0,!1));for(var wa in B)if(U=B[wa],!U.primary&&("function"!=typeof U.isVisible||U.isVisible(I,this))){var Ya=null!=U.getValue?U.getValue():null!=I.style[wa]?mxUtils.htmlEntities(I.style[wa]++""):null!=U.getDefaultValue?U.getDefaultValue(I,this):U.defVal;if("separator"==U.type)Aa=!Aa;else{if("staticArr"==U.type)U.size=parseInt(I.style[U.sizeProperty]||B[U.sizeProperty].defVal)||0;else if(null!=U.dependentProps){var Qa=U.dependentProps,Ra=[],Sa=[];for(za=0;za<Qa.length;za++){var Ha=I.style[Qa[za]];Sa.push(B[Qa[za]].subDefVal);Ra.push(null!=Ha?Ha.split(","):[])}U.dependentPropsDefVal=Sa;U.dependentPropsVals=Ra}La.appendChild(ua(wa,Ya,U,Ca,Aa));Ca=!Ca}}for(za=0;za<ya.length;za++)for(U=ya[za],+B=U.parentRow,I=0;I<U.values.length;I++)wa=ua(U.name,U.values[I],{type:U.type,parentRow:U.parentRow,isDeletable:U.isDeletable,index:I,defVal:U.defVal,countProperty:U.countProperty,size:U.size},0==I%2,U.flipBkg),B.parentNode.insertBefore(wa,B.nextSibling),B=wa;k.appendChild(La);pa();return k};StyleFormatPanel.prototype.addStyles=function(k){if(null!=this.defaultColorSchemes){var B=this.editorUi,I=B.editor.graph,U=document.createElement("div");U.style.padding="6px 20px 0 24px";k.appendChild(U);var P=+document.createElement("div");P.className="geSwitcher";P.style.padding="4px 18px 6px 0px";for(var T=[],X=0;X<this.defaultColorSchemes.length;X++){var Z=document.createElement("div");Z.className="geSwitcherDot";mxUtils.bind(this,function(Ba){mxEvent.addListener(Z,"click",mxUtils.bind(this,function(){ka(Ba)}))})(X);T.push(Z);P.appendChild(Z)}var ka=mxUtils.bind(this,function(Ba){null!=T[Ba]&&(null!=this.format.currentScheme&&null!=T[this.format.currentScheme]&&(T[this.format.currentScheme].style.background=+"transparent"),this.format.currentScheme=Ba,va(this.defaultColorSchemes[this.format.currentScheme]),T[this.format.currentScheme].style.background="#84d7ff")}),va=mxUtils.bind(this,function(Ba){var ya=mxUtils.clone(I.defaultVertexStyle);ya[mxConstants.STYLE_STROKECOLOR]=null!=ya[mxConstants.STYLE_STROKECOLOR]?ya[mxConstants.STYLE_STROKECOLOR]:"default";ya[mxConstants.STYLE_FILLCOLOR]=null!=ya[mxConstants.STYLE_FILLCOLOR]?ya[mxConstants.STYLE_FILLCOLOR]:"default";ya[mxConstants.STYLE_FONTCOLOR]=null!=+ya[mxConstants.STYLE_FONTCOLOR]?ya[mxConstants.STYLE_FONTCOLOR]:"default";I.replaceDefaultColors(new mxCell,ya);var La=mxUtils.bind(this,function(Ea){var pa=mxUtils.button("",mxUtils.bind(this,function(wa){I.getModel().beginUpdate();try{for(var Ya=B.getSelectionState().cells,Qa=0;Qa<Ya.length;Qa++){var Ra=I.getModel().getStyle(Ya[Qa]);null!=Ea?(mxEvent.isShiftDown(wa)||(Ra=""==Ea.fill||null==Ea.fill?mxUtils.setStyle(Ra,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(Ra,mxConstants.STYLE_FILLCOLOR,+Ea.fill),Ra=""==Ea.gradient||null==Ea.gradient?mxUtils.setStyle(Ra,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(Ra,mxConstants.STYLE_GRADIENTCOLOR,Ea.gradient),mxEvent.isControlDown(wa)||mxClient.IS_MAC&&mxEvent.isMetaDown(wa)||!I.getModel().isVertex(Ya[Qa])||(Ra=""==Ea.font||null==Ea.font?mxUtils.setStyle(Ra,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(Ra,mxConstants.STYLE_FONTCOLOR,Ea.font))),mxEvent.isAltDown(wa)||(Ra=""==Ea.stroke||null==Ea.fill?mxUtils.setStyle(Ra,mxConstants.STYLE_STROKECOLOR,+null):mxUtils.setStyle(Ra,mxConstants.STYLE_STROKECOLOR,Ea.stroke))):(Ra=mxUtils.setStyle(Ra,mxConstants.STYLE_FILLCOLOR,null),Ra=mxUtils.setStyle(Ra,mxConstants.STYLE_STROKECOLOR,null),Ra=mxUtils.setStyle(Ra,mxConstants.STYLE_GRADIENTCOLOR,null),I.getModel().isVertex(Ya[Qa])&&(Ra=mxUtils.setStyle(Ra,mxConstants.STYLE_FONTCOLOR,null)));I.getModel().setStyle(Ya[Qa],Ra)}}finally{I.getModel().endUpdate()}}));pa.className="geStyleButton";pa.style.width="36px";pa.style.height=10>=this.defaultColorSchemes.length?+"24px":"30px";pa.style.margin="0px 6px 6px 0px";if(null!=Ea){var Ca="1px solid";null!=Ea.border&&(Ca=Ea.border);if(null!=Ea.gradient)pa.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(Ea.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(Ea.gradient).cssText+" 100%)";else if(Ea.fill==mxConstants.NONE)pa.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==Ea.fill||""==Ea.fill)pa.style.backgroundColor=mxUtils.getLightDarkColor(mxUtils.getValue(ya,mxConstants.STYLE_FILLCOLOR,+"#ffffff")).cssText;else{var Aa=mxUtils.getLightDarkColor(Ea.fill);pa.style.backgroundImage="linear-gradient(to right bottom, "+Aa.cssText+" 50%, "+Aa.light+" 50.3%)"}null==Ea.stroke||Ea.stroke==mxConstants.NONE?pa.style.border=Ca+" transparent":""==Ea.stroke?pa.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(ya,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(Aa=mxUtils.getLightDarkColor(Ea.stroke),pa.style.border=Ca+" "+Aa.cssText,pa.style.borderRightColor=Aa.light,pa.style.borderBottomColor=+pa.style.borderRightColor);null!=Ea.title&&pa.setAttribute("title",Ea.title)}else Ca=mxUtils.getValue(ya,mxConstants.STYLE_FILLCOLOR,"#ffffff"),Aa=mxUtils.getValue(ya,mxConstants.STYLE_STROKECOLOR,"#000000"),pa.style.backgroundColor=Ca,pa.style.border="1px solid "+Aa;pa.style.borderRadius="0";U.appendChild(pa);null!=Ea&&null!=Ea.gradient&&(Ca=pa.cloneNode(!1),Ca.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(Ea.fill).light+") 0px, light-dark(transparent, "++mxUtils.getLightDarkColor(Ea.gradient).light+") 100%)",Ca.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",Ca.style.backgroundColor="transparent",U.appendChild(Ca),Ca.style.marginLeft="-42px",mxEvent.addListener(Ca,"click",function(){pa.click()}))});U.innerText="";if(null!=Ba)for(var za=0;za<Ba.length;za++)0<za&&0==mxUtils.mod(za,4)&&mxUtils.br(U),La(Ba[za])});null==this.format.currentScheme?ka(Math.min(T.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):ka(this.format.currentScheme);+X=10>=this.defaultColorSchemes.length?43:23;var ua=document.createElement("div");ua.className="geButton";ua.style.cssText="position:absolute;left:0px;bottom:"+X+"px;width:20px;background-image:url("+Editor.chevronLeftImage+");";mxEvent.addListener(ua,"click",mxUtils.bind(this,function(){ka(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var qa=document.createElement("div");qa.className="geButton";qa.style.cssText="position:absolute;left:186px;bottom:"+X+"px;width:20px;background-image:url("++Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(k.appendChild(ua),k.appendChild(qa));mxEvent.addListener(qa,"click",mxUtils.bind(this,function(){ka(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));va(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&k.appendChild(P)}return k}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('++STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements={};Graph.isGoogleFontUrl=function(k){return k.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||k.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=function(k){return Graph.isGoogleFontUrl(k)};Graph.rewriteGoogleFontUrl=function(k){null!=k&&k.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(k=Editor.GOOGLE_FONTS_CSS2+k.substring(Editor.GOOGLE_FONTS.length)++":wght@400;500");return k};Graph.createFontElement=function(k,B){var I=Graph.fontMapping[B];null==I&&Graph.isCssFontUrl(B)?(k=document.createElement("link"),k.setAttribute("rel","stylesheet"),k.setAttribute("type","text/css"),k.setAttribute("charset","UTF-8"),k.setAttribute("href",Graph.rewriteGoogleFontUrl(B))):(null==I&&(I='@font-face {\nfont-family: "'+k+'";\nsrc: url("'+B+'");\n}'),k=document.createElement("style"),mxUtils.write(k,I));return k};Graph.addRecentCustomFont=function(k,B){};Graph.addFont=+function(k,B,I){if(null!=k&&0<k.length&&null!=B&&0<B.length){var U=k.toLowerCase();if("helvetica"!=U&&"arial"!=k&&"sans-serif"!=U){var P=Graph.customFontElements[U];null!=P&&P.url!=B&&(P.elt.parentNode.removeChild(P.elt),P=null);null==P?(P=B,"http:"==B.substring(0,5)&&(P=PROXY_URL+"?url="+encodeURIComponent(B)),P={name:k,url:B,elt:Graph.createFontElement(k,P)},Graph.customFontElements[U]=P,B=document.getElementsByTagName("head")[0],null!=I&&("link"==P.elt.nodeName.toLowerCase()?(P.elt.onload=I,P.elt.onerror=+I):I()),null!=B&&B.appendChild(P.elt)):null!=I&&I()}else null!=I&&I()}else null!=I&&I();return k};Graph.getFontUrl=function(k,B){k=Graph.customFontElements[k.toLowerCase()];null!=k&&(B=k.url);return B};Graph.processFontAttributes=function(k){k=k.getElementsByTagName("*");for(var B=0;B<k.length;B++){var I=k[B].getAttribute("data-font-src");if(null!=I){var U="FONT"==k[B].nodeName?k[B].getAttribute("face"):k[B].style.fontFamily;null!=U&&Graph.addFont(U,I)}}};Graph.processFontStyle=function(k){if(null!=+k){var B=mxUtils.getValue(k,"fontSource",null);if(null!=B){var I=mxUtils.getValue(k,mxConstants.STYLE_FONTFAMILY,null);if(null!=I)try{Graph.addFont(I,decodeURIComponent(B))}catch(U){}}}return k};Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;Graph.prototype.shadowId="drawio-drop-shadow";Graph.prototype.svgShadowColor="#3D4574";+Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var t=Graph.prototype.init;Graph.prototype.init=function(){function k(P){B=P}t.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var B=null;mxEvent.addListener(this.container,"mouseenter",k);mxEvent.addListener(this.container,"mousemove",k);mxEvent.addListener(this.container,"mouseleave",+function(P){B=null});this.isMouseInsertPoint=function(){return null!=B};var I=this.getInsertPoint;this.getInsertPoint=function(){return null!=B?this.getPointForEvent(B):I.apply(this,arguments)};var U=this.layoutManager.getLayout;this.layoutManager.getLayout=function(P){var T=this.graph.getCellStyle(P);if(null!=T&&"rack"==T.childLayout){var X=new mxStackLayout(this.graph,!1);X.gridSize=null!=T.rackUnitSize?parseFloat(T.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;+X.marginLeft=T.marginLeft||0;X.marginRight=T.marginRight||0;X.marginTop=T.marginTop||0;X.marginBottom=T.marginBottom||0;X.allowGaps=T.allowGaps||0;X.horizontal="1"==mxUtils.getValue(T,"horizontalRack","0");X.resizeParent=!1;X.fill=!0;return X}return U.apply(this,arguments)};this.updateGlobalUrlVariables()};var q=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(k,B){return Graph.processFontStyle(q.apply(this,arguments))};var D=mxSvgCanvas2D.prototype.updateTextNodes;+mxSvgCanvas2D.prototype.updateTextNodes=function(k,B,I,U,P,T,X,Z,ka,va,ua,qa){D.apply(this,arguments);Graph.processFontAttributes(qa)};var H=mxText.prototype.redraw;mxText.prototype.redraw=function(){H.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(k,B,I,U){function P(){for(var za=Z.getSelectionCells(),Ea=[],pa=0;pa<za.length;pa++)Z.isCellVisible(za[pa])&&Ea.push(za[pa]);Z.setSelectionCells(Ea)}function T(za){Z.setHiddenTags(za?+[]:ka.slice());P();Z.refresh()}function X(za,Ea){ua.innerText="";if(0<za.length){var pa=document.createElement("table");pa.setAttribute("cellpadding","2");pa.style.boxSizing="border-box";pa.style.tableLayout="fixed";pa.style.width="100%";var Ca=document.createElement("tbody");if(null!=za&&0<za.length)for(var Aa=0;Aa<za.length;Aa++)(function(wa){function Ya(){var y=Z.getCellsForTags([wa],null,null,!0);Z.isEnabled()?Z.setSelectionCells(y):Z.highlightCells(y,null,null,70)}var Qa=0>mxUtils.indexOf(Z.hiddenTags,+wa),Ra=document.createElement("tr"),Sa=document.createElement("td");Sa.style.align="center";Sa.style.width="16px";var Ha=document.createElement("img");Ha.setAttribute("src",Qa?Editor.visibleImage:Editor.hiddenImage);Ha.setAttribute("title",mxResources.get(Qa?"hideIt":"show",[wa]));mxUtils.setOpacity(Ha,Qa?75:25);Ha.className="geAdaptiveAsset";Ha.style.verticalAlign="middle";Ha.style.cursor="pointer";Ha.style.width="16px";if(B||Editor.isDarkMode())Ha.style.filter="invert(100%)";Sa.appendChild(Ha);+mxEvent.addListener(Ha,"click",function(y){mxEvent.isShiftDown(y)?T(0<=mxUtils.indexOf(Z.hiddenTags,wa)):(Z.toggleHiddenTag(wa),P(),Z.refresh());mxEvent.consume(y)});Ra.appendChild(Sa);Sa=document.createElement("td");Sa.style.align="center";Sa.style.width="16px";Ha=document.createElement("img");Ha.setAttribute("src",Editor.selectImage);Ha.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Ha,Qa?75:25);Ha.className="geAdaptiveAsset";Ha.style.verticalAlign="middle";Ha.style.cursor="pointer";+Ha.style.width="16px";if(B||Editor.isDarkMode())Ha.style.filter="invert(100%)";mxEvent.addListener(Ha,"click",function(y){T(!0);Ya();mxEvent.consume(y)});Sa.appendChild(Ha);Ra.appendChild(Sa);Sa=document.createElement("td");Sa.style.overflow="hidden";Sa.style.whiteSpace="nowrap";Sa.style.textOverflow="ellipsis";Sa.style.verticalAlign="middle";Sa.style.cursor="pointer";Sa.setAttribute("title",wa);a=document.createElement("a");mxUtils.write(a,wa);a.style.textOverflow="ellipsis";a.style.position="relative";+mxUtils.setOpacity(a,Qa?100:40);Sa.appendChild(a);mxEvent.addListener(Sa,"click",function(y){if(mxEvent.isShiftDown(y))T(!0),Ya();else if(Qa&&0<Z.hiddenTags.length)T(!0);else{var O=ka.slice(),R=mxUtils.indexOf(O,wa);O.splice(R,1);Z.setHiddenTags(O);P();Z.refresh()}mxEvent.consume(y)});Ra.appendChild(Sa);if(Z.isEnabled()){Sa=document.createElement("td");Sa.style.verticalAlign="middle";Sa.style.textAlign="center";Sa.style.width="18px";if(null==Ea){Sa.style.align="center";Sa.style.width="16px";Ha=document.createElement("img");+Ha.setAttribute("src",Editor.trashImage);Ha.setAttribute("title",mxResources.get("removeIt",[wa]));mxUtils.setOpacity(Ha,Qa?75:25);Ha.className="geAdaptiveAsset";Ha.style.verticalAlign="middle";Ha.style.cursor="pointer";Ha.style.width="16px";if(B||Editor.isDarkMode())Ha.style.filter="invert(100%)";mxEvent.addListener(Ha,"click",function(y){var O=mxUtils.indexOf(ka,wa);0<=O&&ka.splice(O,1);Z.removeTagsForCells(Z.model.getDescendants(Z.model.getRoot()),[wa]);Z.refresh();mxEvent.consume(y)});Sa.appendChild(Ha)}else{var Ma=+document.createElement("input");Ma.setAttribute("type","checkbox");Ma.style.margin="0px";Ma.defaultChecked=null!=Ea&&0<=mxUtils.indexOf(Ea,wa);Ma.checked=Ma.defaultChecked;Ma.style.background="transparent";Ma.setAttribute("title",mxResources.get(Ma.defaultChecked?"removeIt":"add",[wa]));mxEvent.addListener(Ma,"change",function(y){Ma.checked?Z.addTagsForCells(Z.getSelectionCells(),[wa]):Z.removeTagsForCells(Z.getSelectionCells(),[wa]);mxEvent.consume(y)});Sa.appendChild(Ma)}Ra.appendChild(Sa)}Ca.appendChild(Ra)})(za[Aa]);+pa.appendChild(Ca);ua.appendChild(pa)}}var Z=this,ka=Z.hiddenTags.slice(),va=document.createElement("div");va.style.userSelect="none";va.style.overflow="hidden";va.style.padding="10px";va.style.height="100%";var ua=document.createElement("div");ua.style.position="absolute";ua.style.boxSizing="border-box";ua.style.userSelect="none";ua.style.overflow="auto";ua.style.padding="3px";ua.style.left="0px";ua.style.right="0px";ua.style.top="0px";ua.style.bottom="0px";va.appendChild(ua);Z.addListener(mxEvent.ROOT,+function(){ka=Z.hiddenTags.slice()});var qa=mxUtils.bind(this,function(za,Ea){if(k()){za=Z.getAllTags();for(Ea=0;Ea<za.length;Ea++)0>mxUtils.indexOf(ka,za[Ea])&&ka.push(za[Ea]);ka.sort();Z.isSelectionEmpty()?X(ka):X(ka,Z.getCommonTagsForCells(Z.getSelectionCells()))}});Z.selectionModel.addListener(mxEvent.CHANGE,qa);Z.model.addListener(mxEvent.CHANGE,qa);Z.addListener(mxEvent.REFRESH,qa);var Ba=document.createElement("div");Ba.className="geToolbarContainer geDialogToolbar";Ba.style.position="absolute";+Ba.style.display="flex";Ba.style.bottom="0px";Ba.style.left="0px";Ba.style.right="0px";Ba.style.height="32px";Ba.style.overflow="hidden";Ba.style.padding="3px 4px 4px 4px";Ba.style.borderWidth="1px 0px 0px 0px";Ba.style.borderStyle="solid";Ba.style.whiteSpace="nowrap";if(Z.isEnabled()){ua.style.bottom="32px";var ya=document.createElement("a");ya.className="geButton";var La=ya.cloneNode(!1);La.style.backgroundImage="url("+Editor.visibleImage+")";La.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(La,+"click",function(za){Z.setHiddenTags([]);mxEvent.isShiftDown(za)||(ka=Z.hiddenTags.slice());P();Z.refresh();mxEvent.consume(za)});Ba.appendChild(La);null!=I&&(ya=ya.cloneNode(!1),ya.style.backgroundImage="url("+Editor.plusImage+")",ya.setAttribute("title",mxResources.get("add")),mxEvent.addListener(ya,"click",function(za){I(ka,function(Ea){ka=Ea;qa()});mxEvent.consume(za)}),Ba.appendChild(ya));va.appendChild(Ba)}null!=U&&Ba.appendChild(U);return{div:va,refresh:qa}};Graph.prototype.getCustomFonts=+function(){var k=this.extFonts;k=null!=k?k.slice():[];for(var B in Graph.customFontElements){var I=Graph.customFontElements[B];k.push({name:I.name,url:I.url})}return k};Graph.prototype.setFont=function(k,B){Graph.addFont(k,B);var I=Editor.guid();document.execCommand("fontname",!1,I);for(var U=this.cellEditor.textarea.getElementsByTagName("font"),P=!1,T=0;T<U.length;T++)U[T].getAttribute("face")==I&&(P=!0,U[T].setAttribute("face",k),null!=B?U[T].setAttribute("data-font-src",B):U[T].removeAttribute("data-font-src"));+P||document.execCommand("fontname",!1,k)};var N=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return N.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var k=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=k)for(var B in k)this.globalVars[B]=k[B]}catch(I){null!=+window.console&&console.log("Error in vars URL parameter: "+I)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var L=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(k){var B=L.apply(this,arguments);null==B&&null!=this.globalVars&&(B=this.globalVars[k]);return B};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var k=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(k.ownerDocument)).decode(k)}return this.defaultStylesheet};+Graph.prototype.isViewer=function(){return urlParams.viewer};var J=Graph.prototype.getSvg;Graph.prototype.getSvg=function(k,B,I,U,P,T,X,Z,ka,va,ua,qa,Ba,ya,La,za){var Ea=J.apply(this,arguments);if(null!=qa){var pa=Ea.getAttribute("style");null==pa&&(pa="");qa="auto"==qa||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":qa;Ea.setAttribute("style",pa+(" color-scheme: "+qa+";"))}var Ca=this.getCustomFonts();if(ua&&0<Ca.length){var Aa=Ea.ownerDocument;pa=null!=Aa.createElementNS?+Aa.createElementNS(mxConstants.NS_SVG,"style"):Aa.createElement("style");null!=Aa.setAttributeNS?pa.setAttributeNS("type","text/css"):pa.setAttribute("type","text/css");for(var wa="",Ya="",Qa=0;Qa<Ca.length;Qa++){var Ra=Ca[Qa].name,Sa=Ca[Qa].url;Graph.isCssFontUrl(Sa)?wa+="@import url("+Graph.rewriteGoogleFontUrl(Sa)+");\n":Ya+='@font-face {\nfont-family: "'+Ra+'";\nsrc: url("'+Sa+'");\n}\n'}pa.appendChild(Aa.createTextNode(wa+Ya));Ea.getElementsByTagName("defs")[0].appendChild(pa)}Editor.replaceSvgDataUris&&+null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(Ea);this.mathEnabled&&(document.body.appendChild(Ea),Editor.MathJaxRender(Ea),Ea.parentNode.removeChild(Ea),pa=Ea.ownerDocument.getElementById("MJX-SVG-styles"),null!=pa&&Ea.getElementsByTagName("defs")[0].appendChild(pa.cloneNode(!0)));return Ea};var Y=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(k){Y.apply(this,arguments);null!=k.secondLabel&&(k.secondLabel.destroy(),k.secondLabel=+null)};mxCellRenderer.prototype.getShapesForState=function(k){return[k.shape,k.text,k.secondLabel,k.control]};var ha=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){ha.apply(this,arguments);this.enumerationState=0};var ea=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(k){null!=k.shape&&this.redrawEnumerationState(k);return ea.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(k){k=decodeURIComponent(mxUtils.getValue(k.style,+"enumerateValue",""));""==k&&(k=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(k)+"</div>"};mxGraphView.prototype.redrawEnumerationState=function(k){var B="1"==mxUtils.getValue(k.style,"enumerate",0);B&&null==k.secondLabel?(k.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),k.secondLabel.size=12,k.secondLabel.state=k,k.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,+this.graph.cellRenderer.initializeLabel(k,k.secondLabel)):B||null==k.secondLabel||(k.secondLabel.destroy(),k.secondLabel=null);B=k.secondLabel;if(null!=B){var I=k.view.scale,U=this.createEnumerationValue(k);k=this.graph.model.isVertex(k.cell)?new mxRectangle(k.x+k.width-4*I,k.y+4*I,0,0):mxRectangle.fromPoint(k.view.getPoint(k));B.bounds.equals(k)&&B.value==U&&B.scale==I||(B.bounds=k,B.value=U,B.scale=I,B.redraw())}};var aa=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();+aa.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage),this.view.validateBackgroundImage())};var na=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){na.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(k,B){"data:action/json,"==k.substring(0,17)&&(k=JSON.parse(k.substring(17)),null!=k.actions&&+this.executeCustomActions(k.actions,null,B))};Graph.prototype.executeCustomActions=function(k,B,I){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=!0;var U=!1,P=0,T=0,X=mxUtils.bind(this,function(){U||(U=!0,this.model.beginUpdate())}),Z=mxUtils.bind(this,+function(){U&&(U=!1,this.model.endUpdate())}),ka=mxUtils.bind(this,function(){0<P&&P--;0==P&&va()}),va=mxUtils.bind(this,function(){if(T<k.length){var ua=this.stoppingCustomActions,qa=k[T++],Ba=[];if(null!=qa.open)if(Z(),this.isCustomLink(qa.open)){if(!this.customLinkClicked(qa.open,I))return}else this.openLink(qa.open);null==qa.wait||ua||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;ka()}),P++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,+""!=qa.wait?parseInt(qa.wait):1E3),Z());null!=qa.opacity&&null!=qa.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(qa.opacity,!0)),qa.opacity.value);null!=qa.fadeIn&&(P++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(qa.fadeIn,!0)),0,1,ka,ua?0:qa.fadeIn.delay));null!=qa.fadeOut&&(P++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(qa.fadeOut,!0)),1,0,ka,ua?0:qa.fadeOut.delay));null!=qa.wipeIn&&(Ba=Ba.concat(this.createWipeAnimations(this.getCellsForAction(qa.wipeIn,+!0),!0)));null!=qa.wipeOut&&(Ba=Ba.concat(this.createWipeAnimations(this.getCellsForAction(qa.wipeOut,!0),!1)));null!=qa.toggle&&(X(),this.toggleCells(this.getCellsForAction(qa.toggle,!0)));if(null!=qa.show){X();var ya=this.getCellsForAction(qa.show,!0);Graph.setOpacityForNodes(this.getNodesForCells(ya),1);this.setCellsVisible(ya,!0)}null!=qa.hide&&(X(),ya=this.getCellsForAction(qa.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(ya),0),this.setCellsVisible(ya,!1));null!=qa.toggleStyle&&null!=+qa.toggleStyle.key&&(X(),this.toggleCellStyles(qa.toggleStyle.key,null!=qa.toggleStyle.defaultValue?qa.toggleStyle.defaultValue:"0",this.getCellsForAction(qa.toggleStyle,!0)));null!=qa.style&&null!=qa.style.key&&(X(),this.setCellStyles(qa.style.key,qa.style.value,this.getCellsForAction(qa.style,!0)));ya=[];null!=qa.select&&this.isEnabled()&&(ya=this.getCellsForAction(qa.select),this.setSelectionCells(ya));null!=qa.highlight&&(ya=this.getCellsForAction(qa.highlight),this.highlightCells(ya,qa.highlight.color,+qa.highlight.duration,qa.highlight.opacity));null!=qa.scroll&&(ya=this.getCellsForAction(qa.scroll));null!=qa.viewbox&&this.fitWindow(qa.viewbox,qa.viewbox.border);0<ya.length&&this.scrollCellToVisible(ya[0]);null!=I&&null!=qa.explore&&Graph.exploreFromCell(this,I,qa.explore);if(null!=qa.tags){if(null!=qa.tags.toggle){var La=qa.tags.toggle;0==La.length&&(La=this.getAllTags());for(ya=0;ya<La.length;ya++)this.toggleHiddenTag(La[ya])}La=null;null!=qa.tags.hidden&&(null==La&&(La=[]),La=La.concat(qa.tags.hidden));+if(null!=qa.tags.visible){null==La&&(La=[]);var za=this.getAllTags();for(ya=0;ya<za.length;ya++)0>mxUtils.indexOf(qa.tags.visible,za[ya])&&0>mxUtils.indexOf(La,za[ya])&&La.push(za[ya])}null!=La&&this.setHiddenTags(La);this.refresh()}0<Ba.length&&(P++,this.executeAnimations(Ba,ka,ua?1:qa.steps,ua?0:qa.delay));0==P?va():Z()}else this.stoppingCustomActions=this.executingCustomActions=!1,Z(),null!=B&&B()});va()}};Graph.prototype.doUpdateCustomLinksForCell=function(k,B){var I=this.getLinkForCell(B);null!=+I&&"data:action/json,"==I.substring(0,17)&&this.setLinkForCell(B,this.updateCustomLink(k,I));if(this.isHtmlLabel(B)){var U=document.createElement("div");U.innerHTML=Graph.sanitizeHtml(this.getLabel(B));for(var P=U.getElementsByTagName("a"),T=!1,X=0;X<P.length;X++)I=P[X].getAttribute("href"),null!=I&&"data:action/json,"==I.substring(0,17)&&(P[X].setAttribute("href",this.updateCustomLink(k,I)),T=!0);T&&this.labelChanged(B,U.innerHTML)}};Graph.prototype.updateCustomLink=function(k,B){if("data:action/json,"==+B.substring(0,17))try{var I=JSON.parse(B.substring(17));null!=I.actions&&(this.updateCustomLinkActions(k,I.actions),B="data:action/json,"+JSON.stringify(I))}catch(U){}return B};Graph.prototype.updateCustomLinkActions=function(k,B){for(var I=0;I<B.length;I++){var U=B[I],P;for(P in U)this.updateCustomLinkAction(k,U[P],"cells"),this.updateCustomLinkAction(k,U[P],"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(k,B,I){if(null!=B&&null!=B[I]){for(var U=[],P=0;P<B[I].length;P++)if("*"==+B[I][P])U.push(B[I][P]);else{var T=k[B[I][P]];null!=T?""!=T&&U.push(T):U.push(B[I][P])}B[I]=U}};Graph.prototype.getCellsForAction=function(k,B){B=this.getCellsById(k.cells).concat(this.getCellsForTags(k.tags,null,B));if(null!=k.excludeCells){for(var I=[],U=0;U<B.length;U++)0>k.excludeCells.indexOf(B[U].id)&&I.push(B[U]);B=I}return B};Graph.prototype.getCellsById=function(k){var B=[];if(null!=k)for(var I=0;I<k.length;I++)if("*"==k[I]){var U=this.model.getRoot();B=B.concat(this.model.filterDescendants(function(T){return T!=+U},U))}else{var P=this.model.getCell(k[I]);null!=P&&B.push(P)}return B};var W=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(k){return W.apply(this,arguments)&&!this.isAllTagsHidden(this.getTagsForCell(k))};Graph.prototype.setHiddenTags=function(k){this.hiddenTags=k;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(k){var B=mxUtils.indexOf(this.hiddenTags,k);0>B?this.hiddenTags.push(k):0<=B&&this.hiddenTags.splice(B,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};+Graph.prototype.isAllTagsHidden=function(k){if(null==k||0==k.length||0==this.hiddenTags.length)return!1;k=k.split(" ");if(k.length>this.hiddenTags.length)return!1;for(var B=0;B<k.length;B++)if(0>mxUtils.indexOf(this.hiddenTags,k[B]))return!1;return!0};Graph.prototype.getCellsForTags=function(k,B,I,U){var P=[];if(null!=k){B=null!=B?B:this.model.getDescendants(this.model.getRoot());for(var T=0,X={},Z=0;Z<k.length;Z++)0<k[Z].length&&(X[k[Z]]=!0,T++);for(Z=0;Z<B.length;Z++)if(I&&this.model.getParent(B[Z])==+this.model.root||this.model.isVertex(B[Z])||this.model.isEdge(B[Z])){var ka=this.getTagsForCell(B[Z]),va=!1;if(0<ka.length&&(ka=ka.split(" "),ka.length>=k.length)){for(var ua=va=0;ua<ka.length&&va<T;ua++)null!=X[ka[ua]]&&va++;va=va==T}va&&(1!=U||this.isCellVisible(B[Z]))&&P.push(B[Z])}}return P};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(k){for(var B=null,I=[],U=0;U<k.length;U++){var P=+this.getTagsForCell(k[U]);I=[];if(0<P.length){P=P.split(" ");for(var T={},X=0;X<P.length;X++)if(null==B||null!=B[P[X]])T[P[X]]=!0,I.push(P[X]);B=T}else return[]}return I};Graph.prototype.getTagsForCells=function(k){for(var B=[],I={},U=0;U<k.length;U++){var P=this.getTagsForCell(k[U]);if(0<P.length){P=P.split(" ");for(var T=0;T<P.length;T++)null==I[P[T]]&&(I[P[T]]=!0,B.push(P[T]))}}return B};Graph.prototype.getTagsForCell=function(k){return this.getAttributeForCell(k,"tags","")};Graph.prototype.addTagsForCells=+function(k,B){if(0<k.length&&0<B.length){this.model.beginUpdate();try{for(var I=0;I<k.length;I++){for(var U=this.getTagsForCell(k[I]),P=U.split(" "),T=!1,X=0;X<B.length;X++){var Z=mxUtils.trim(B[X]);""!=Z&&0>mxUtils.indexOf(P,Z)&&(U=0<U.length?U+" "+Z:Z,T=!0)}T&&this.setAttributeForCell(k[I],"tags",U)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(k,B){if(0<k.length&&0<B.length){this.model.beginUpdate();try{for(var I=0;I<k.length;I++){var U=this.getTagsForCell(k[I]);+if(0<U.length){for(var P=U.split(" "),T=!1,X=0;X<B.length;X++){var Z=mxUtils.indexOf(P,B[X]);0<=Z&&(P.splice(Z,1),T=!0)}T&&this.setAttributeForCell(k[I],"tags",P.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(k){this.model.beginUpdate();try{for(var B=0;B<k.length;B++)this.model.setVisible(k[B],!this.model.isVisible(k[B]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(k,B){this.model.beginUpdate();try{for(var I=0;I<k.length;I++)this.model.setVisible(k[I],+B)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(k,B,I,U){for(var P=0;P<k.length;P++)this.highlightCell(k[P],B,I,U)};Graph.prototype.highlightCell=function(k,B,I,U,P){B=null!=B?B:mxConstants.DEFAULT_VALID_COLOR;I=null!=I?I:1E3;k=this.view.getState(k);var T=null;null!=k&&(P=null!=P?P:4,P=Math.max(P+1,mxUtils.getValue(k.style,mxConstants.STYLE_STROKEWIDTH,1)+P),T=new mxCellHighlight(this,B,P,!1),null!=U&&(T.opacity=U),T.highlight(k),window.setTimeout(function(){null!=T.shape&&+(mxUtils.setPrefixedStyle(T.shape.node.style,"transition","all 1200ms ease-in-out"),T.shape.node.style.opacity=0);window.setTimeout(function(){T.destroy()},1200)},I));return T};Graph.prototype.addSvgShadow=function(k,B,I,U){I=null!=I?I:!1;U=null!=U?U:!0;var P=k.ownerDocument,T=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"filter"):P.createElement("filter");T.setAttribute("id",this.shadowId);var X=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):P.createElement("feGaussianBlur");+X.setAttribute("in","SourceAlpha");X.setAttribute("stdDeviation",this.svgShadowBlur);X.setAttribute("result","blur");T.appendChild(X);X=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feOffset"):P.createElement("feOffset");X.setAttribute("in","blur");X.setAttribute("dx",this.svgShadowSize);X.setAttribute("dy",this.svgShadowSize);X.setAttribute("result","offsetBlur");T.appendChild(X);X=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feFlood"):P.createElement("feFlood");+X.setAttribute("flood-color",this.svgShadowColor);X.setAttribute("flood-opacity",this.svgShadowOpacity);X.setAttribute("result","offsetColor");T.appendChild(X);X=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feComposite"):P.createElement("feComposite");X.setAttribute("in","offsetColor");X.setAttribute("in2","offsetBlur");X.setAttribute("operator","in");X.setAttribute("result","offsetBlur");T.appendChild(X);X=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"feBlend"):P.createElement("feBlend");+X.setAttribute("in","SourceGraphic");X.setAttribute("in2","offsetBlur");T.appendChild(X);X=k.getElementsByTagName("defs");0==X.length?(P=null!=P.createElementNS?P.createElementNS(mxConstants.NS_SVG,"defs"):P.createElement("defs"),null!=k.firstChild?k.insertBefore(P,k.firstChild):k.appendChild(P)):P=X[0];P.appendChild(T);I||(B=null!=B?B:k.getElementsByTagName("g")[0],null!=B&&(B.setAttribute("filter","url(#"+this.shadowId+")"),!isNaN(parseInt(k.getAttribute("width")))&&U&&(k.setAttribute("width",parseInt(k.getAttribute("width"))++6),k.setAttribute("height",parseInt(k.getAttribute("height"))+6),B=k.getAttribute("viewBox"),null!=B&&0<B.length&&(B=B.split(" "),3<B.length&&(w=parseFloat(B[2])+6,h=parseFloat(B[3])+6,k.setAttribute("viewBox",B[0]+" "+B[1]+" "+w+" "+h))))));return T};Graph.prototype.setShadowVisible=function(k,B){mxClient.IS_SVG&&!mxClient.IS_SF&&(B=null!=B?B:!0,(this.shadowVisible=k)?this.view.getDrawPane().setAttribute("filter","url(#"+this.shadowId+")"):this.view.getDrawPane().removeAttribute("filter"),B&&this.fireEvent(new mxEventObject("shadowVisibleChanged")))};+Graph.prototype.checkDefaultParent=function(){null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var k=this.model.getChildCount(this.model.root),B=0;do var I=this.model.getChildAt(this.model.root,B);while(B++<k&&"1"==mxUtils.getValue(this.getCellStyle(I),"locked","0"));null!=I&&this.setDefaultParent(I)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH++"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=+[SHAPES_PATH+"/mxCisco19.js",STENCIL_PATH+"/cisco19.xml"];mxStencilRegistry.libraries.cisco_safe=[SHAPES_PATH+"/mxCiscoSafe.js",STENCIL_PATH+"/cisco_safe/architecture.xml",STENCIL_PATH+"/cisco_safe/business_icons.xml",STENCIL_PATH+"/cisco_safe/capability.xml",STENCIL_PATH+"/cisco_safe/design.xml",STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",STENCIL_PATH+"/cisco_safe/people_places_things_icons.xml",STENCIL_PATH+"/cisco_safe/security_icons.xml",STENCIL_PATH+"/cisco_safe/technology_icons.xml",STENCIL_PATH++"/cisco_safe/threat.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.kubernetes=[SHAPES_PATH+"/mxKubernetes.js",STENCIL_PATH+"/kubernetes.xml",STENCIL_PATH+"/kubernetes2.xml"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH++"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=+[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/abstract"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/miscellaneous"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/miscellaneous.xml"];mxStencilRegistry.libraries["electrical/signal_sources"]=+[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/signal_sources.xml"];mxStencilRegistry.libraries["electrical/electro-mechanical"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/electro-mechanical.xml"];mxStencilRegistry.libraries["electrical/transmission"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries.infographic=[SHAPES_PATH+"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];+mxStencilRegistry.libraries["mockup/containers"]=[SHAPES_PATH+"/mockup/mxMockupContainers.js"];mxStencilRegistry.libraries["mockup/forms"]=[SHAPES_PATH+"/mockup/mxMockupForms.js"];mxStencilRegistry.libraries["mockup/graphics"]=[SHAPES_PATH+"/mockup/mxMockupGraphics.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/markup"]=[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];mxStencilRegistry.libraries["mockup/misc"]=[SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];+mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH++"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.ibm=[SHAPES_PATH+"/mxIBM.js",STENCIL_PATH+"/ibm.xml"];mxStencilRegistry.libraries.ibmcloud=[STENCIL_PATH+"/ibm_cloud.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=+[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=[SHAPES_PATH++"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH++"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=[STENCIL_PATH+"/salesforce.xml"];mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=function(k){var B=null;null!=k&&0<k.length&&("ER"==k.substring(0,2)?B="mxgraph.er":"sysML"==k.substring(0,5)&&(B="mxgraph.sysml"));return B};var ba=+mxMarker.createMarker;mxMarker.createMarker=function(k,B,I,U,P,T,X,Z,ka,va){if(null!=I&&null==mxMarker.markers[I]){var ua=this.getPackageForType(I);null!=ua&&mxStencilRegistry.getStencil(ua)}return ba.apply(this,arguments)};var ja=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(k,B,I,U,P,T){"1"==mxUtils.getValue(B.style,"lineShape",null)&&k.setFillColor(mxUtils.getValue(B.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return ja.apply(this,arguments)};PrintDialog.prototype.create=+function(k,B,I,U){function P(){La.value=Math.max(1,Math.min(ua,Math.max(parseInt(La.value),parseInt(ya.value))));ya.value=Math.max(1,Math.min(ua,Math.min(parseInt(La.value),parseInt(ya.value))))}function T(Da){k.lastPrintPagesRadioChecked=Ba.checked;k.lastPrintSelectionOnlyChecked=Ea.checked;k.lastPrintCropRadioChecked=Ca.checked;k.lastPrintFitRadioChecked=Aa.checked;Ba.checked&&ya.value<La.value?(k.lastPrintPagesFromInput=ya.value,k.lastPrintPagesToInput=La.value):(k.lastPrintPagesFromInput=null,+k.lastPrintPagesToInput=null);fa.value=Math.max(1,Math.min(1600,parseInt(fa.value)))+"%";k.lastPrintZoom=fa.value;k.lastPrintBorder=V.value;k.lastPrintGrid=ia.checked;k.lastPrintTransparent=oa.checked;k.lastPrintInclude=ta.checked;k.lastPrintSheetsAcross=O.value;k.lastPrintSheetsDown=R.value;var Ia={};Ia.border=parseInt(V.value);Ia.scale=parseInt(fa.value)/100;Ia.grid=ia.checked;Ia.transparent=oa.checked;Ia.includeCopy=ta.checked;Ia.sheetsAcross=parseInt(O.value);Ia.sheetsDown=parseInt(R.value);Ia.pagesFrom=+parseInt(ya.value);Ia.pagesTo=parseInt(La.value);Ia.allPages=qa.checked;Ia.selection=Ea.checked;Ia.pageView=pa.checked;Ia.crop=Ca.checked;Ia.fit=Aa.checked;return null!=I?I(!Da,Ia):k.print(!Da,Ia)}var X=k.editor.graph,Z=document.createElement("div"),ka=document.createElement("h3");ka.style.width="100%";ka.style.textAlign="center";ka.style.marginTop="0px";mxUtils.write(ka,B||mxResources.get("print"));Z.appendChild(ka);var va=1,ua=1;ka=document.createElement("div");ka.style.whiteSpace="nowrap";var qa=+document.createElement("input");qa.style.marginRight="8px";qa.style.marginBottom="8px";qa.setAttribute("type","radio");qa.setAttribute("name","pages-printdialog");ka.appendChild(qa);B=document.createElement("span");mxUtils.write(B,mxResources.get("allPages"));mxEvent.addListener(B,"click",function(){qa.checked=!0});ka.appendChild(B);mxUtils.br(ka);var Ba=qa.cloneNode(!0);ka.appendChild(Ba);B=document.createElement("span");mxUtils.write(B,mxResources.get("pages")+":");ka.appendChild(B);mxEvent.addListener(B,+"click",function(){Ba.checked=!0});var ya=document.createElement("input");ya.style.margin="0 4px";ya.setAttribute("value","1");ya.setAttribute("type","number");ya.setAttribute("min","1");ya.style.width="40px";ka.appendChild(ya);B=document.createElement("span");mxUtils.write(B,mxResources.get("to"));ka.appendChild(B);var La=ya.cloneNode(!0);ka.appendChild(La);mxEvent.addListener(ya,"focus",function(){Ba.checked=!0});mxEvent.addListener(La,"focus",function(){Ba.checked=!0});mxEvent.addListener(ya,"change",+P);mxEvent.addListener(La,"change",P);if(null!=k.pages&&(ua=k.pages.length,null!=k.currentPage))for(var za=0;za<ua;za++)if(k.currentPage==k.pages[za]){va=za+1;break}null!=k.lastPrintPagesFromInput&&null!=k.lastPrintPagesToInput?(ya.value=Math.min(ua,Math.max(1,k.lastPrintPagesFromInput)),La.value=Math.min(ua,Math.max(1,k.lastPrintPagesToInput))):(ya.value=va,La.value=va);ya.setAttribute("max",ua);La.setAttribute("max",ua);za=mxUtils.button(mxResources.get("currentPage"),function(Da){ya.value=va;La.value=+va;Ba.checked=!0});za.setAttribute("title",mxResources.get("currentPage"));za.style.marginLeft="4px";za.style.maxWidth="100px";za.style.overflow="hidden";za.style.textOverflow="ellipsis";za.style.whiteSpace="nowrap";ka.appendChild(za);1<ua&&Z.appendChild(ka);ka=document.createElement("div");ka.style.borderBottom="1px solid lightGray";ka.style.paddingBottom="12px";ka.style.marginBottom="12px";ka.style.whiteSpace="nowrap";var Ea=document.createElement("input");Ea.setAttribute("name","pages-printdialog");+Ea.setAttribute("type",1==ua?"checkbox":"radio");Ea.style.marginRight="8px";X.isSelectionEmpty()&&Ea.setAttribute("disabled","disabled");X.isEnabled()&&(ka.appendChild(Ea),B=document.createElement("span"),mxUtils.write(B,mxResources.get("selectionOnly")),ka.appendChild(B));(X.isEnabled()||1<ua)&&Z.appendChild(ka);!k.isPagesEnabled()||k.lastPrintPagesRadioChecked?Ba.checked=!0:!X.isSelectionEmpty()&&k.lastPrintSelectionOnlyChecked?Ea.checked=!0:qa.checked=!0;X.isSelectionEmpty()||mxEvent.addListener(B,+"click",function(){Ea.checked=!Ea.checked});X=document.createElement("div");X.style.whiteSpace="nowrap";var pa=document.createElement("input");pa.style.marginBottom="8px";pa.style.marginRight="8px";pa.setAttribute("type","radio");pa.setAttribute("name","printSize");X.appendChild(pa);B=document.createElement("span");mxUtils.write(B,mxResources.get("pageView"));X.appendChild(B);mxEvent.addListener(X,"click",function(){pa.checked=!0});Z.appendChild(X);X=document.createElement("div");X.style.whiteSpace=+"nowrap";var Ca=document.createElement("input");Ca.style.marginBottom="8px";Ca.style.marginRight="8px";Ca.setAttribute("type","radio");Ca.setAttribute("name","printSize");X.appendChild(Ca);B=document.createElement("span");mxUtils.write(B,mxResources.get("crop"));X.appendChild(B);mxEvent.addListener(X,"click",function(){Ca.checked=!0});Z.appendChild(X);X=document.createElement("div");X.style.whiteSpace="nowrap";var Aa=document.createElement("input");Aa.style.marginBottom="8px";Aa.style.marginRight=+"8px";Aa.setAttribute("type","radio");Aa.setAttribute("name","printSize");B=document.createElement("div");B.style.display="inline-block";B.style.verticalAlign="top";B.style.paddingTop="2px";B.appendChild(Aa);X.appendChild(B);ka=document.createElement("table");ka.style.display="inline-block";ka.style.borderSpacing="0";za=document.createElement("tbody");var wa=document.createElement("tr"),Ya=wa.cloneNode(!0),Qa=document.createElement("td"),Ra=Qa.cloneNode(!0),Sa=Qa.cloneNode(!0),Ha=Qa.cloneNode(!0),+Ma=Qa.cloneNode(!0),y=Qa.cloneNode(!0);Qa.style.textAlign="right";Ha.style.textAlign="right";mxUtils.write(Qa,mxResources.get("fitTo"));mxEvent.addListener(X,"click",function(Da){mxEvent.getSource(Da)!=Aa&&(Aa.checked=!Aa.checked)});var O=document.createElement("input");O.style.margin="0 2px";O.style.boxSizing="border-box";O.setAttribute("value",k.lastPrintSheetsAcross||"1");O.setAttribute("min","1");O.setAttribute("type","number");O.style.width="40px";Ra.appendChild(O);B=document.createElement("span");+mxUtils.write(B,mxResources.get("fitToSheetsAcross"));Sa.appendChild(B);mxUtils.write(Ha,mxResources.get("fitToBy"));var R=O.cloneNode(!0);R.setAttribute("value",k.lastPrintSheetsDown||"1");Ma.appendChild(R);mxEvent.addListener(O,"click",function(Da){Aa.checked=!0;mxEvent.consume(Da)});mxEvent.addListener(R,"click",function(Da){Aa.checked=!0;mxEvent.consume(Da)});k.lastPrintCropRadioChecked?Ca.checked=!0:k.lastPrintFitRadioChecked?Aa.checked=!0:pa.checked=!0;B=document.createElement("span");mxUtils.write(B,+mxResources.get("fitToSheetsDown"));y.appendChild(B);wa.appendChild(Qa);wa.appendChild(Ra);wa.appendChild(Sa);Ya.appendChild(Ha);Ya.appendChild(Ma);Ya.appendChild(y);za.appendChild(wa);za.appendChild(Ya);ka.appendChild(za);X.appendChild(ka);Z.appendChild(X);X=document.createElement("div");X.style.borderTop="1px solid lightGray";X.style.whiteSpace="nowrap";X.style.paddingTop="12px";X.style.marginTop="12px";X.style.paddingLeft="8px";mxUtils.write(X,mxResources.get("borderWidth")+":");var V=document.createElement("input");+V.setAttribute("type","number");V.setAttribute("min","0");V.style.width="40px";V.style.marginLeft="4px";V.value=null!=k.lastPrintBorder?k.lastPrintBorder:mxPrintPreview.prototype.pageMargin;X.appendChild(V);B=document.createElement("span");B.style.marginLeft="8px";mxUtils.write(B,mxResources.get("zoom")+":");X.appendChild(B);var fa=document.createElement("input");fa.style.width="60px";fa.style.marginLeft="4px";fa.value=null!=k.lastPrintZoom?k.lastPrintZoom:"100%";X.appendChild(fa);mxUtils.br(X);var ia=+document.createElement("input");ia.setAttribute("type","checkbox");ia.style.marginTop="12px";ia.checked=null!=k.lastPrintGrid?k.lastPrintGrid:!1;X.appendChild(ia);B=document.createElement("span");B.style.marginLeft="4px";B.style.marginRight="8px";mxUtils.write(B,mxResources.get("grid"));X.appendChild(B);mxEvent.addListener(B,"click",function(Da){ia.checked=!0;mxEvent.consume(Da)});var oa=document.createElement("input");oa.setAttribute("type","checkbox");oa.style.marginTop="10px";oa.checked=null!=+k.lastPrintTransparent?k.lastPrintTransparent:!1;null!=I&&(X.appendChild(oa),B=document.createElement("span"),B.style.marginLeft="4px",mxUtils.write(B,mxResources.get("transparentBackground")),X.appendChild(B),mxEvent.addListener(B,"click",function(Da){oa.checked=!0;mxEvent.consume(Da)}));var ta=document.createElement("input");ta.setAttribute("type","checkbox");ta.style.marginTop="10px";ta.checked=null!=k.lastPrintInclude?k.lastPrintInclude:Editor.defaultIncludeDiagram;null==I||mxClient.IS_CHROMEAPP||+"draw.io"!=k.getServiceName()||(mxUtils.br(X),X.appendChild(ta),B=document.createElement("span"),B.style.marginLeft="4px",mxUtils.write(B,mxResources.get("includeCopyOfMyDiagram")),X.appendChild(B),mxEvent.addListener(B,"click",function(Da){ta.checked=!0;mxEvent.consume(Da)}));Z.appendChild(X);B=document.createElement("div");B.style.marginTop="40px";B.style.textAlign="right";B.style.whiteSpace="nowrap";k.isOffline()||null!=I||B.appendChild(k.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));+X=mxUtils.button(mxResources.get("cancel"),function(){k.hideDialog()});X.className="geBtn";k.editor.cancelFirst&&B.appendChild(X);PrintDialog.previewEnabled&&null==I&&(ka=mxUtils.button(mxResources.get("preview"),function(){try{k.hideDialog(),T(!1)}catch(Da){k.handleError(Da)}}),ka.className="geBtn",B.appendChild(ka));U=null!=U?U:null!=I?"export":PrintDialog.previewEnabled?"print":"ok";U=mxUtils.button(mxResources.get(U),function(){try{k.hideDialog(),T(!0)}catch(Da){k.handleError(Da)}});U.className=+"geBtn gePrimaryBtn";B.appendChild(U);k.editor.cancelFirst||B.appendChild(X);Z.appendChild(B);if(k.editor.isChromelessView()){var ra=function(){Editor.isDarkMode()?(Z.classList.add("geDarkMode"),Z.style.colorScheme="dark"):(Z.classList.remove("geDarkMode"),Z.style.colorScheme="light")};k.addListener("darkModeChanged",ra);ra();var xa=function(Da,Ia){Da=Ia.getProperty("dialog");Z.parentNode==Da.container&&(k.editor.removeListener(xa),k.removeListener(ra))};k.editor.addListener("hideDialog",xa)}this.container=+Z};var ca=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);if(this.page!=this.ui.currentPage){if(null!=this.page.viewState){this.ignoreColor||(this.page.viewState.background=this.color);if(!this.ignoreImage){var k=this.image;null!=k&&null!=k.src&&Graph.isPageLink(k.src)&&(k={originalSrc:k.src});this.page.viewState.backgroundImage=k}null!=this.format&&(this.page.viewState.pageFormat=this.format);null!=this.mathEnabled&&+(this.page.viewState.mathEnabled=this.mathEnabled);null!=this.adaptiveColors&&(this.page.viewState.adaptiveColors=this.adaptiveColors);null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)}}else ca.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.adaptiveColors&&this.adaptiveColors!=this.ui.editor.graph.adaptiveColors&&(k=this.ui.editor.graph.adaptiveColors,+this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=k?k:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible)};Editor.prototype.useCanvasForExport=!1;try{var la=document.createElement("canvas"),Q=new Image;Q.onload=function(){try{la.getContext("2d").drawImage(Q,0,0);var k=la.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=k&&+6<k.length}catch(B){}};Q.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(k){}Editor.prototype.useCanvasForExport=!1})();+(function(){var b=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);b.beforeDecode=function(e,g,m){m.ui=e.ui;return g};b.afterDecode=function(e,g,m){m.previousColor=m.color;m.previousImage=m.image;m.previousFormat=m.format;m.previousAdaptiveColors=m.adaptiveColors;null!=m.foldingEnabled&&(m.foldingEnabled=!m.foldingEnabled);null!=m.mathEnabled&&(m.mathEnabled=!m.mathEnabled);null!=m.shadowVisible&&(m.shadowVisible=!m.shadowVisible);return m};mxCodecRegistry.register(b)})();+(function(){var b=new mxObjectCodec(new ChangeGridColor,["ui"]);b.beforeDecode=function(e,g,m){m.ui=e.ui;return g};mxCodecRegistry.register(b)})();(function(){EditorUi.VERSION="26.2.7";EditorUi.compactUi="atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&"support.draw.io"!=window.location.hostname&&"test.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl=window.REALTIME_URL;null==EditorUi.cacheUrl&&"undefined"!==typeof DrawioFile&&(DrawioFile.SYNC="none");Editor.cacheTimeout=1E4;EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.nativeFileSupport=!mxClient.IS_OP&&!EditorUi.isElectronApp&&"1"!=urlParams.extAuth&&"showSaveFilePicker"in window&&"showOpenFilePicker"in window;EditorUi.enableDrafts=!mxClient.IS_CHROMEAPP&&isLocalStorage&&"0"!=urlParams.drafts;EditorUi.scratchpadHelpLink="https://www.drawio.com/doc/faq/scratchpad";EditorUi.enableHtmlEditOption=!0;EditorUi.mermaidDiagramTypes="flowchart classDiagram sequenceDiagram stateDiagram mindmap graph erDiagram requirementDiagram journey gantt pie gitGraph".split(" ");EditorUi.defaultMermaidConfig={theme:"neutral",arrowMarkerAbsolute:!1,flowchart:{htmlLabels:!1},sequence:{diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!0,bottomMarginAdj:1,useMaxWidth:!0,rightAngles:!1,showSequenceNumbers:!1},gantt:{titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,leftPadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:4,axisFormat:"%Y-%m-%d"}};-EditorUi.logError=function(c,f,l,t,q,D,G){if(null!=c){q=null!=q?q:Error(c);q.stack=null!=q.stack?q.stack:"";D=null!=D?D:0>c.indexOf("NetworkError")&&0>c.indexOf("SecurityError")&&0>c.indexOf("NS_ERROR_FAILURE")&&0>c.indexOf("out of memory")?"SEVERE":"CONFIG";try{EditorUi.enableLogging&&"1"!=urlParams.dev&&c!=EditorUi.lastErrorMessage&&0>c.indexOf("extension:")&&0>c.indexOf("ResizeObserver loop completed with undelivered notifications")&&0>q.stack.indexOf("extension:")&&0>q.stack.indexOf("<anonymous>:")&&-0>q.stack.indexOf("/math/es5/")&&(EditorUi.lastErrorMessage=c,(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+D+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(c)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(l)+(null!=t?":colno:"+encodeURIComponent(t):"")+(""!=q.stack?"&stack="+encodeURIComponent(q.stack):""))}catch(N){}try{G||null==window.console||console.error(D,c,f,l,t,q)}catch(N){}}};EditorUi.logEvent=+EditorUi.logError=function(c,f,l,t,q,D,H){if(null!=c){q=null!=q?q:Error(c);q.stack=null!=q.stack?q.stack:"";D=null!=D?D:0>c.indexOf("NetworkError")&&0>c.indexOf("SecurityError")&&0>c.indexOf("NS_ERROR_FAILURE")&&0>c.indexOf("out of memory")?"SEVERE":"CONFIG";try{EditorUi.enableLogging&&"1"!=urlParams.dev&&c!=EditorUi.lastErrorMessage&&0>c.indexOf("extension:")&&0>c.indexOf("ResizeObserver loop completed with undelivered notifications")&&0>q.stack.indexOf("extension:")&&0>q.stack.indexOf("<anonymous>:")&&+0>q.stack.indexOf("/math/es5/")&&(EditorUi.lastErrorMessage=c,(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+D+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(c)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(l)+(null!=t?":colno:"+encodeURIComponent(t):"")+(""!=q.stack?"&stack="+encodeURIComponent(q.stack):""))}catch(N){}try{H||null==window.console||console.error(D,c,f,l,t,q)}catch(N){}}};EditorUi.logEvent=function(c){if("1"==urlParams.dev)EditorUi.debug("logEvent",c);else if(EditorUi.enableLogging)try{var f=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=f+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=c?"&data="+encodeURIComponent(JSON.stringify(c)):"")}catch(l){}};EditorUi.sendReport=function(c,f){if("1"==urlParams.dev)EditorUi.debug("sendReport",c);else if(EditorUi.enableLogging)try{f=null!=f?f:5E4,c.length>f&&(c=c.substring(0,f)+"\n...[SHORTENED]"),mxUtils.post("/email","version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&data="+encodeURIComponent(c))}catch(l){}};EditorUi.debug=function(){try{if(null!=window.console&&"1"==urlParams.test){for(var c=[(new Date).toISOString()],f=0;f<arguments.length;f++)c.push(arguments[f]);console.log.apply(console,c)}}catch(l){}};EditorUi.removeChildNodes=function(c){for(;null!=c.firstChild;)c.removeChild(c.firstChild)};EditorUi.embedSvgImages=function(c){c=c.getElementsByTagName("image");for(var f=[],l=0;l<c.length;l++)f.push(c[l]);for(l=0;l<f.length;l++)EditorUi.replaceSvgImage(f[l])};EditorUi.replaceSvgImage=function(c){try{var f=null;f=null==c.getAttributeNS?c.getAttribute("xlink:href"):c.getAttributeNS(mxConstants.NS_XLINK,"href");var l=EditorUi.getSvgSubtree(f);if(null!=l&&"svg"==l.nodeName){l.setAttribute("x",c.getAttribute("x"));l.setAttribute("y",c.getAttribute("y"));l.setAttribute("width",c.getAttribute("width"));l.setAttribute("height",c.getAttribute("height"));l.style.fontFamily="initial";var t=mxUtils.createElementNs(l.ownerDocument,mxConstants.NS_SVG,"g");t.appendChild(l);c.hasAttribute("transform")&&t.setAttribute("transform",c.getAttribute("transform"));c.parentNode.replaceChild(t,c)}}catch(q){}};EditorUi.getSvgSubtree=function(c){var f=Graph.getSvgFromDataUri(c);c=null;if(null!=f){c=Graph.sanitizeNode(mxUtils.parseXml(f).documentElement);f=c.getElementsByTagName("style");if(0<f.length){var l="svg-image-"+Editor.guid();c.setAttribute("id",l);for(var t=document.implementation.createHTMLDocument(""),-q=document.createElement("style"),D=0;D<f.length;D++){q.textContent=f[D].textContent;t.body.appendChild(q);for(var G="",N=0;N<q.sheet.cssRules.length;N++){var L=q.sheet.cssRules[N];if(null!=L.selectorText){for(var J=L.selectorText.split(","),Y=0;Y<J.length;Y++)J[Y]="#"+l+" "+J[Y];L.selectorText=J.join(",")}G+=L.cssText+"\n"}f[D].textContent=G}}f=c.getElementsByTagName("*");for(l=0;l<f.length;l++)f[l].removeAttribute("data-cell-id")}return c};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';+q=document.createElement("style"),D=0;D<f.length;D++){q.textContent=f[D].textContent;t.body.appendChild(q);for(var H="",N=0;N<q.sheet.cssRules.length;N++){var L=q.sheet.cssRules[N];if(null!=L.selectorText){for(var J=L.selectorText.split(","),Y=0;Y<J.length;Y++)J[Y]="#"+l+" "+J[Y];L.selectorText=J.join(",")}H+=L.cssText+"\n"}f[D].textContent=H}}f=c.getElementsByTagName("*");for(l=0;l<f.length;l++)f[l].removeAttribute("data-cell-id")}return c};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.timeout=Editor.prototype.timeout;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=1200;EditorUi.prototype.maxTextWidth=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=2E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.maxTextBytes=5E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.insertTemplateEnabled=!0;EditorUi.prototype.closableScratchpad=!0;EditorUi.prototype.embedExportBorder=8;EditorUi.prototype.embedExportTheme="auto";EditorUi.prototype.embedExportBackground=null;EditorUi.prototype.shareCursorPosition=!0;EditorUi.prototype.showRemoteCursors=!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;EditorUi.prototype.webpSupported=!1;try{var c=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!c.getContext||!c.getContext("2d"))}catch(q){}try{var f=document.createElement("canvas"),@@ -3487,118 +3489,118 @@ EditorUi.prototype.getLocalData=function(c,f){f(localStorage.getItem(c))};Editorfunction(){return this.shareCursorPosition};EditorUi.prototype.setShowRemoteCursors=function(c){this.showRemoteCursors=c;this.fireEvent(new mxEventObject("showRemoteCursorsChanged"))};EditorUi.prototype.isShowRemoteCursors=function(){return this.showRemoteCursors};EditorUi.prototype.setMathEnabled=function(c){var f=this.editor.graph;f.mathEnabled=c;null!=f.view.backgroundImage&&(f.view.backgroundImage.destroy(),f.view.backgroundImage=null);this.editor.updateGraphComponents();f.refresh();f.defaultMathEnabled=c;this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(c){return this.editor.graph.mathEnabled};EditorUi.prototype.setAdaptiveColors=function(c){this.editor.graph.setAdaptiveColors(c);this.editor.graph.view.clear();this.fireEvent(new mxEventObject("adaptiveColorsChanged"))};EditorUi.prototype.isStandaloneApp=function(){return mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(c){return this.isOfflineApp()||!navigator.onLine||!c&&("1"==urlParams.stealth||"1"==urlParams.lockdown)};EditorUi.prototype.isExternalDataComms=function(){return"1"!=urlParams.offline&&!this.isOffline()&&!this.isOfflineApp()};EditorUi.prototype.createSpinner=function(c,f,l){var t=null==c||null==f;l=null!=l?l:24;var q=new Spinner({lines:12,length:l,width:Math.round(l/3),radius:Math.round(l/2),rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,-hwaccel:!1,zIndex:2E9}),D=this.timeout,G=q.spin,N=null,L=null,J=mxUtils.bind(this,function(ea){null!=ea&&ea()}),Y=this;q.spin=function(ea,aa,na,W){W=null!=W?W:D;var ba=!1;if(!this.active){var ja=Date.now();null!=na&&(N=window.setTimeout(function(){q.stop();N=null;na({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:L})},W));t&&(f=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,c=document.body.clientWidth/2-2);ea==document.body&&"1"==urlParams.embedInline&&-(ea=Y.diagramContainer,c=ea.scrollLeft+ea.clientWidth/2,f=ea.scrollTop+ea.clientHeight/2);G.call(this,ea);"1"==urlParams.embedInline&&null!=q.el&&(q.el.style.marginTop=ea.scrollTop+"px",q.el.style.marginLeft=ea.scrollLeft+"px");this.active=!0;null!=aa&&(ba=document.createElement("div"),ba.className="geSpinnerStatus",ba.style.position="absolute",ba.style.whiteSpace="nowrap",ba.style.background="#4B4243",ba.style.color="white",ba.style.fontFamily=Editor.defaultHtmlFont,ba.style.fontSize="9pt",ba.style.padding=+hwaccel:!1,zIndex:2E9}),D=this.timeout,H=q.spin,N=null,L=null,J=mxUtils.bind(this,function(ea){null!=ea&&ea()}),Y=this;q.spin=function(ea,aa,na,W){W=null!=W?W:D;var ba=!1;if(!this.active){var ja=Date.now();null!=na&&(N=window.setTimeout(function(){q.stop();N=null;na({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:L})},W));t&&(f=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,c=document.body.clientWidth/2-2);ea==document.body&&"1"==urlParams.embedInline&&+(ea=Y.diagramContainer,c=ea.scrollLeft+ea.clientWidth/2,f=ea.scrollTop+ea.clientHeight/2);H.call(this,ea);"1"==urlParams.embedInline&&null!=q.el&&(q.el.style.marginTop=ea.scrollTop+"px",q.el.style.marginLeft=ea.scrollLeft+"px");this.active=!0;null!=aa&&(ba=document.createElement("div"),ba.className="geSpinnerStatus",ba.style.position="absolute",ba.style.whiteSpace="nowrap",ba.style.background="#4B4243",ba.style.color="white",ba.style.fontFamily=Editor.defaultHtmlFont,ba.style.fontSize="9pt",ba.style.padding="6px",ba.style.paddingLeft="10px",ba.style.paddingRight="10px",ba.style.zIndex=2E9,ba.style.left=Math.max(0,c)+"px",ba.style.top=Math.max(0,f+70)+"px",mxUtils.setPrefixedStyle(ba.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(ba.style,"transform","translate(-50%,-50%)"),Editor.isDarkMode()||mxUtils.setPrefixedStyle(ba.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=aa.substring(aa.length-3,aa.length)&&"!"!=aa.charAt(aa.length-1)&&(aa+="..."),ba.innerText=aa,ea.appendChild(ba),q.status=ba);this.pause=mxUtils.bind(this,function(){var ca=J;this.active&&(W=Math.max(0,W-(Date.now()-ja)),ca=mxUtils.bind(this,function(la){this.spin(ea,aa,na,W);if(null!=la)try{la(),L=mxUtils.bind(this,function(){this.spin(ea,aa,na,W);try{la()}catch(Q){null!=na&&na(Q)}})}catch(Q){null!=na&&na(Q)}}));this.stop();return ca});ba=!0}return ba};var ha=q.stop;q.stop=function(){ha.call(this);this.active&&(this.active=!1,null!=N&&(window.clearTimeout(N),N=null),null!=q.status&&null!=q.status.parentNode&&q.status.parentNode.removeChild(q.status),q.status=null)};q.pause=function(){return J};return q};EditorUi.prototype.isCompatibleString=function(c){try{var f=mxUtils.parseXml(c),l=this.editor.extractGraphModel(f.documentElement,!0);return null!=l&&0==l.getElementsByTagName("parsererror").length}catch(t){}return!1};EditorUi.isVisioFilename=function(c){return/(\.v(dx|sdx?))($|\?)/i.test(c)||/(\.vs(x|sx?))($|\?)/i.test(c)};EditorUi.prototype.isVisioData=function(c){return 8<c.length&&(208==c.charCodeAt(0)&&207==c.charCodeAt(1)&&17==c.charCodeAt(2)&&224==c.charCodeAt(3)&&161==c.charCodeAt(4)&&177==c.charCodeAt(5)&&26==c.charCodeAt(6)&&225==c.charCodeAt(7)||80==c.charCodeAt(0)&&75==c.charCodeAt(1)&&3==c.charCodeAt(2)&&4==c.charCodeAt(3)||80==c.charCodeAt(0)&&75==c.charCodeAt(1)&&3==c.charCodeAt(2)&&6==c.charCodeAt(3))};EditorUi.prototype.isRemoteVisioData=function(c){return 8<c.length&&(208==c.charCodeAt(0)&&207==c.charCodeAt(1)&&17==c.charCodeAt(2)&&224==c.charCodeAt(3)&&161==c.charCodeAt(4)&&177==c.charCodeAt(5)&&26==c.charCodeAt(6)&&225==c.charCodeAt(7)||-60==c.charCodeAt(0)&&63==c.charCodeAt(1)&&120==c.charCodeAt(2)&&109==c.charCodeAt(3)&&108==c.charCodeAt(3))};var b=EditorUi.prototype.createKeyHandler;EditorUi.prototype.createKeyHandler=function(c){var f=b.apply(this,arguments);if(!this.editor.chromeless||this.editor.editable){var l=f.getFunction,t=this.editor.graph,q=this;f.getFunction=function(D){if(t.isSelectionEmpty()&&null!=q.pages&&0<q.pages.length){var G=q.getSelectedPageIndex();if(mxEvent.isShiftDown(D)){if(37==D.keyCode)return function(){0<-G&&q.movePage(G,G-1)};if(38==D.keyCode)return function(){0<G&&q.movePage(G,0)};if(39==D.keyCode)return function(){G<q.pages.length-1&&q.movePage(G,G+1)};if(40==D.keyCode)return function(){G<q.pages.length-1&&q.movePage(G,q.pages.length-1)}}else if(mxEvent.isControlDown(D)||mxClient.IS_MAC&&mxEvent.isMetaDown(D)){if(37==D.keyCode)return function(){0<G&&q.selectNextPage(!1)};if(38==D.keyCode)return function(){0<G&&q.selectPage(q.pages[0])};if(39==D.keyCode)return function(){G<q.pages.length-1&&q.selectNextPage(!0)};-if(40==D.keyCode)return function(){G<q.pages.length-1&&q.selectPage(q.pages[q.pages.length-1])}}}return!(65<=D.keyCode&&90>=D.keyCode)||t.isSelectionEmpty()||mxEvent.isAltDown(D)||mxEvent.isShiftDown(D)||mxEvent.isControlDown(D)||mxClient.IS_MAC&&mxEvent.isMetaDown(D)?l.apply(this,arguments):null}}return f};var e=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var f=e.apply(this,arguments);if(null==f)try{var l=c.indexOf("<mxfile ");if(0<=l){var t=-c.lastIndexOf("</mxfile>");t>l&&(f=c.substring(l,t+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else{var q=mxUtils.parseXml(c),D=this.editor.extractGraphModel(q.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility);f=null!=D?mxUtils.getXml(D):""}}catch(G){}return f};EditorUi.prototype.validateFileData=function(c){if(null!=c&&0<c.length){var f=c.indexOf('<meta charset="utf-8">');0<=f&&(c=c.slice(0,f)+'<meta charset="utf-8"/>'++60==c.charCodeAt(0)&&63==c.charCodeAt(1)&&120==c.charCodeAt(2)&&109==c.charCodeAt(3)&&108==c.charCodeAt(3))};var b=EditorUi.prototype.createKeyHandler;EditorUi.prototype.createKeyHandler=function(c){var f=b.apply(this,arguments);if(!this.editor.chromeless||this.editor.editable){var l=f.getFunction,t=this.editor.graph,q=this;f.getFunction=function(D){if(t.isSelectionEmpty()&&null!=q.pages&&0<q.pages.length){var H=q.getSelectedPageIndex();if(mxEvent.isShiftDown(D)){if(37==D.keyCode)return function(){0<+H&&q.movePage(H,H-1)};if(38==D.keyCode)return function(){0<H&&q.movePage(H,0)};if(39==D.keyCode)return function(){H<q.pages.length-1&&q.movePage(H,H+1)};if(40==D.keyCode)return function(){H<q.pages.length-1&&q.movePage(H,q.pages.length-1)}}else if(mxEvent.isControlDown(D)||mxClient.IS_MAC&&mxEvent.isMetaDown(D)){if(37==D.keyCode)return function(){0<H&&q.selectNextPage(!1)};if(38==D.keyCode)return function(){0<H&&q.selectPage(q.pages[0])};if(39==D.keyCode)return function(){H<q.pages.length-1&&q.selectNextPage(!0)};+if(40==D.keyCode)return function(){H<q.pages.length-1&&q.selectPage(q.pages[q.pages.length-1])}}}return!(65<=D.keyCode&&90>=D.keyCode)||t.isSelectionEmpty()||mxEvent.isAltDown(D)||mxEvent.isShiftDown(D)||mxEvent.isControlDown(D)||mxClient.IS_MAC&&mxEvent.isMetaDown(D)?l.apply(this,arguments):null}}return f};var e=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var f=e.apply(this,arguments);if(null==f)try{var l=c.indexOf("<mxfile ");if(0<=l){var t=+c.lastIndexOf("</mxfile>");t>l&&(f=c.substring(l,t+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else{var q=mxUtils.parseXml(c),D=this.editor.extractGraphModel(q.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility);f=null!=D?mxUtils.getXml(D):""}}catch(H){}return f};EditorUi.prototype.validateFileData=function(c){if(null!=c&&0<c.length){var f=c.indexOf('<meta charset="utf-8">');0<=f&&(c=c.slice(0,f)+'<meta charset="utf-8"/>'+c.slice(f+23-1,c.length));c=Graph.zapGremlins(c)}return c};EditorUi.prototype.replaceFileData=function(c,f){EditorUi.debug("EditorUi.replaceFileData",[this],"data",[c],"patches",f);c=this.validateFileData(c);c=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var l=null!=c?this.editor.extractGraphModel(c,!0):null;null!=l&&(c=l);if(null!=c){l=this.editor.graph;l.model.beginUpdate();try{var t=null!=this.pages?this.pages.slice():null,q=c.getElementsByTagName("diagram");if(1<q.length||1==q.length&&-q[0].hasAttribute("name")){this.fileNode=c;this.pages=null!=this.pages?this.pages:[];for(var D=q.length-1;0<=D;D--){var G=this.updatePageRoot(new DiagramPage(q[D]));null==G.getName()&&G.setName(mxResources.get("pageWithNumber",[D+1]));l.model.execute(new ChangePage(this,G,0==D?G:null,0))}}else null==this.fileNode&&(this.fileNode=c.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(c.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",-[1])),l.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(c),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,l.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0)));if(null!=t)for(D=0;D<t.length;D++)l.model.execute(new ChangePage(this,t[D],null));var N=this.getCurrentFile();null!=N&&N.fileReplaced(f)}finally{l.model.endUpdate()}}};EditorUi.prototype.createFileData=function(c,f,l,t,q,D,G,N,L,J,Y,ha,ea){f=+q[0].hasAttribute("name")){this.fileNode=c;this.pages=null!=this.pages?this.pages:[];for(var D=q.length-1;0<=D;D--){var H=this.updatePageRoot(new DiagramPage(q[D]));null==H.getName()&&H.setName(mxResources.get("pageWithNumber",[D+1]));l.model.execute(new ChangePage(this,H,0==D?H:null,0))}}else null==this.fileNode&&(this.fileNode=c.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(c.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",+[1])),l.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(c),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,l.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0)));if(null!=t)for(D=0;D<t.length;D++)l.model.execute(new ChangePage(this,t[D],null));var N=this.getCurrentFile();null!=N&&N.fileReplaced(f)}finally{l.model.endUpdate()}}};EditorUi.prototype.createFileData=function(c,f,l,t,q,D,H,N,L,J,Y,ha,ea){f=null!=f?f:this.editor.graph;q=null!=q?q:!1;L=null!=L?L:!0;Y=null!=Y?Y:!Editor.defaultCompressed;var aa=null;if(null==l||l.getMode()==App.MODE_DEVICE||l.getMode()==App.MODE_BROWSER)var na="_blank";else aa=na=t;if(null==c)return"";var W=c;if("mxfile"!=W.nodeName.toLowerCase()){if(Y){var ba=c.ownerDocument.createElement("diagram");ba.setAttribute("name",mxResources.get("pageWithNumber",[1]));ba.setAttribute("id",Editor.guid());ba.appendChild(c)}else{ba=Graph.zapGremlins(mxUtils.getXml(c));W=Graph.compress(ba);if(Graph.decompress(W)!=ba)return ba;ba=c.ownerDocument.createElement("diagram");ba.setAttribute("name",mxResources.get("pageWithNumber",[1]));ba.setAttribute("id",Editor.guid());mxUtils.setTextContent(ba,W)}W=c.ownerDocument.createElement("mxfile");W.appendChild(ba)}J?(W=W.cloneNode(!0),W.removeAttribute("modified"),W.removeAttribute("host"),W.removeAttribute("agent"),W.removeAttribute("etag"),W.removeAttribute("userAgent"),W.removeAttribute("version"),W.removeAttribute("editor"),W.removeAttribute("type")):(W.removeAttribute("userAgent"),W.removeAttribute("modified"),W.removeAttribute("version"),W.removeAttribute("editor"),W.removeAttribute("pages"),W.removeAttribute("type"),W.removeAttribute("etag"),mxClient.IS_CHROMEAPP?W.setAttribute("host","Chrome"):EditorUi.isElectronApp?W.setAttribute("host","Electron"):W.setAttribute("host",window.location.hostname),W.setAttribute("agent",null!=navigator.userAgent?navigator.userAgent:navigator.appVersion),W.setAttribute("version",EditorUi.VERSION),1<W.getElementsByTagName("diagram").length&&-null!=this.pages&&W.setAttribute("pages",this.pages.length));null!=ha&&(W=W.cloneNode(!0),W.setAttribute("scale",ha));null!=ea&&(W=W.cloneNode(!0),W.setAttribute("border",ea));c=Y?mxUtils.getPrettyXml(W):mxUtils.getXml(W);if(!D&&!q&&(G||null!=l&&/(\.html)$/i.test(l.getTitle())))c=this.getHtml2(mxUtils.getXml(W),f,null!=l?l.getTitle():null,na,aa);else if(D||!q&&null!=l&&/(\.svg)$/i.test(l.getTitle()))null==l||l.getMode()!=App.MODE_DEVICE&&l.getMode()!=App.MODE_BROWSER||(t=null),l=this.getSvgFileProperties(W),+null!=this.pages&&W.setAttribute("pages",this.pages.length));null!=ha&&(W=W.cloneNode(!0),W.setAttribute("scale",ha));null!=ea&&(W=W.cloneNode(!0),W.setAttribute("border",ea));c=Y?mxUtils.getPrettyXml(W):mxUtils.getXml(W);if(!D&&!q&&(H||null!=l&&/(\.html)$/i.test(l.getTitle())))c=this.getHtml2(mxUtils.getXml(W),f,null!=l?l.getTitle():null,na,aa);else if(D||!q&&null!=l&&/(\.svg)$/i.test(l.getTitle()))null==l||l.getMode()!=App.MODE_DEVICE&&l.getMode()!=App.MODE_BROWSER||(t=null),l=this.getSvgFileProperties(W),c=this.getEmbeddedSvg(c,f,t,null,N,L,aa,null,null,l.scale,l.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,f,l,t){c=null!=c?c:!0;f=null!=f?f:!1;l=null!=l?l:!Editor.defaultCompressed;var q=this.editor.getGraphXml(c,t);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(L){var J=L.getElementsByTagName("mxGraphModel"),Y=0<J.length?J[0]:null;J=L;null==Y&&l?(Y=mxUtils.getNodeValue(L),0<Y.length&&(Y=Graph.decompress(Y),null!=Y&&0<Y.length&&(J=L.cloneNode(!1),-J.appendChild(mxUtils.parseXml(Y).documentElement)))):null==Y||l?J=L.cloneNode(!0):(J=L.cloneNode(!1),mxUtils.setTextContent(J,Graph.compressNode(Y)));q.appendChild(J)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(q),q=this.fileNode.cloneNode(!1),f)c(this.currentPage.node);else for(f=0;f<this.pages.length;f++){var D=this.pages[f],G=D.node;if(D!=this.currentPage)if(D.needsUpdate){var N=new mxCodec(mxUtils.createXmlDocument());N=N.encode(new mxGraphModel(D.root));-this.editor.graph.saveViewState(D.viewState,N,null,t);EditorUi.removeChildNodes(G);G.appendChild(N);delete D.needsUpdate}else t&&(this.updatePageRoot(D),null!=D.viewState.backgroundImage&&(null!=D.viewState.backgroundImage.originalSrc?D.viewState.backgroundImage=this.createImageForPageLink(D.viewState.backgroundImage.originalSrc,D):Graph.isPageLink(D.viewState.backgroundImage.src)&&(D.viewState.backgroundImage=this.createImageForPageLink(D.viewState.backgroundImage.src,D))),null!=D.viewState.backgroundImage&&-null!=D.viewState.backgroundImage.originalSrc&&(N=new mxCodec(mxUtils.createXmlDocument()),N=N.encode(new mxGraphModel(D.root)),this.editor.graph.saveViewState(D.viewState,N,null,t),G=G.cloneNode(!1),G.appendChild(N)));c(G)}return q};EditorUi.prototype.anonymizeString=function(c,f){for(var l=[],t=0;t<c.length;t++){var q=c.charAt(t);0<=EditorUi.ignoredAnonymizedChars.indexOf(q)?l.push(q):isNaN(parseInt(q))?q.toLowerCase()!=q?l.push(String.fromCharCode(65+Math.round(25*Math.random()))):q.toUpperCase()!=+J.appendChild(mxUtils.parseXml(Y).documentElement)))):null==Y||l?J=L.cloneNode(!0):(J=L.cloneNode(!1),mxUtils.setTextContent(J,Graph.compressNode(Y)));q.appendChild(J)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(q),q=this.fileNode.cloneNode(!1),f)c(this.currentPage.node);else for(f=0;f<this.pages.length;f++){var D=this.pages[f],H=D.node;if(D!=this.currentPage)if(D.needsUpdate){var N=new mxCodec(mxUtils.createXmlDocument());N=N.encode(new mxGraphModel(D.root));+this.editor.graph.saveViewState(D.viewState,N,null,t);EditorUi.removeChildNodes(H);H.appendChild(N);delete D.needsUpdate}else t&&(this.updatePageRoot(D),null!=D.viewState.backgroundImage&&(null!=D.viewState.backgroundImage.originalSrc?D.viewState.backgroundImage=this.createImageForPageLink(D.viewState.backgroundImage.originalSrc,D):Graph.isPageLink(D.viewState.backgroundImage.src)&&(D.viewState.backgroundImage=this.createImageForPageLink(D.viewState.backgroundImage.src,D))),null!=D.viewState.backgroundImage&&+null!=D.viewState.backgroundImage.originalSrc&&(N=new mxCodec(mxUtils.createXmlDocument()),N=N.encode(new mxGraphModel(D.root)),this.editor.graph.saveViewState(D.viewState,N,null,t),H=H.cloneNode(!1),H.appendChild(N)));c(H)}return q};EditorUi.prototype.anonymizeString=function(c,f){for(var l=[],t=0;t<c.length;t++){var q=c.charAt(t);0<=EditorUi.ignoredAnonymizedChars.indexOf(q)?l.push(q):isNaN(parseInt(q))?q.toLowerCase()!=q?l.push(String.fromCharCode(65+Math.round(25*Math.random()))):q.toUpperCase()!=q?l.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(q)?l.push(" "):l.push("?"):l.push(f?"0":Math.round(9*Math.random()))}return l.join("")};EditorUi.prototype.anonymizePatch=function(c){c=mxUtils.clone(c);if(null!=c[EditorUi.DIFF_INSERT])for(var f=0;f<c[EditorUi.DIFF_INSERT].length;f++)try{var l=mxUtils.parseXml(c[EditorUi.DIFF_INSERT][f].data).documentElement.cloneNode(!1);null!=l.getAttribute("name")&&l.setAttribute("name",this.anonymizeString(l.getAttribute("name")));c[EditorUi.DIFF_INSERT][f].data=-mxUtils.getXml(l)}catch(D){c[EditorUi.DIFF_INSERT][f].data=D.message}if(null!=c[EditorUi.DIFF_UPDATE]){for(var t in c[EditorUi.DIFF_UPDATE]){var q=c[EditorUi.DIFF_UPDATE][t];null!=q.name&&(q.name=this.anonymizeString(q.name));null!=q.cells&&(f=mxUtils.bind(this,function(D){var G=q.cells[D];if(null!=G){for(var N in G)null!=G[N].value&&(G[N].value="["+G[N].value.length+"]"),null!=G[N].xmlValue&&(G[N].xmlValue="["+G[N].xmlValue.length+"]"),null!=G[N].style&&(G[N].style="["+G[N].style.length+"]"),mxUtils.isEmptyObject(G[N])&&-delete G[N];mxUtils.isEmptyObject(G)&&delete q.cells[D]}}),f(EditorUi.DIFF_INSERT),f(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(q.cells)&&delete q.cells);mxUtils.isEmptyObject(q)&&delete c[EditorUi.DIFF_UPDATE][t]}mxUtils.isEmptyObject(c[EditorUi.DIFF_UPDATE])&&delete c[EditorUi.DIFF_UPDATE]}return c};EditorUi.prototype.anonymizeAttributes=function(c,f){if(null!=c.attributes)for(var l=0;l<c.attributes.length;l++)"as"!=c.attributes[l].name&&c.setAttribute(c.attributes[l].name,this.anonymizeString(c.attributes[l].value,+mxUtils.getXml(l)}catch(D){c[EditorUi.DIFF_INSERT][f].data=D.message}if(null!=c[EditorUi.DIFF_UPDATE]){for(var t in c[EditorUi.DIFF_UPDATE]){var q=c[EditorUi.DIFF_UPDATE][t];null!=q.name&&(q.name=this.anonymizeString(q.name));null!=q.cells&&(f=mxUtils.bind(this,function(D){var H=q.cells[D];if(null!=H){for(var N in H)null!=H[N].value&&(H[N].value="["+H[N].value.length+"]"),null!=H[N].xmlValue&&(H[N].xmlValue="["+H[N].xmlValue.length+"]"),null!=H[N].style&&(H[N].style="["+H[N].style.length+"]"),mxUtils.isEmptyObject(H[N])&&+delete H[N];mxUtils.isEmptyObject(H)&&delete q.cells[D]}}),f(EditorUi.DIFF_INSERT),f(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(q.cells)&&delete q.cells);mxUtils.isEmptyObject(q)&&delete c[EditorUi.DIFF_UPDATE][t]}mxUtils.isEmptyObject(c[EditorUi.DIFF_UPDATE])&&delete c[EditorUi.DIFF_UPDATE]}return c};EditorUi.prototype.anonymizeAttributes=function(c,f){if(null!=c.attributes)for(var l=0;l<c.attributes.length;l++)"as"!=c.attributes[l].name&&c.setAttribute(c.attributes[l].name,this.anonymizeString(c.attributes[l].value,f));if(null!=c.childNodes)for(l=0;l<c.childNodes.length;l++)this.anonymizeAttributes(c.childNodes[l],f)};EditorUi.prototype.anonymizeNode=function(c,f){f=c.getElementsByTagName("mxCell");for(var l=0;l<f.length;l++)null!=f[l].getAttribute("value")&&f[l].setAttribute("value","["+f[l].getAttribute("value").length+"]"),null!=f[l].getAttribute("xmlValue")&&f[l].setAttribute("xmlValue","["+f[l].getAttribute("xmlValue").length+"]"),null!=f[l].getAttribute("style")&&f[l].setAttribute("style","["+f[l].getAttribute("style").length+"]"),null!=f[l].parentNode&&"root"!=f[l].parentNode.nodeName&&null!=f[l].parentNode.parentNode&&(f[l].setAttribute("id",f[l].parentNode.getAttribute("id")),f[l].parentNode.parentNode.replaceChild(f[l],f[l].parentNode));return c};EditorUi.prototype.synchronizeCurrentFile=function(c){var f=this.getCurrentFile();null!=f&&(f.savingFile?this.handleError({message:mxResources.get("busy")}):!c&&f.invalidChecksum?f.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&-(f.clearAutosave(),this.clearStatus(),c?f.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){this.spinner.stop();f.handleFileError(l,!0)})):f.synchronizeFile(mxUtils.bind(this,function(){f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){f.handleFileError(l,!0)}))))};EditorUi.prototype.getFileData=function(c,f,l,t,q,D,G,N,L,J,Y,ha,ea){q=null!=q?q:!0;D=null!=D?D:!1;J=null!=J?J:!Editor.defaultCompressed;+(f.clearAutosave(),this.clearStatus(),c?f.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){this.spinner.stop();f.handleFileError(l,!0)})):f.synchronizeFile(mxUtils.bind(this,function(){f.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(l){f.handleFileError(l,!0)}))))};EditorUi.prototype.getFileData=function(c,f,l,t,q,D,H,N,L,J,Y,ha,ea){q=null!=q?q:!0;D=null!=D?D:!1;J=null!=J?J:!Editor.defaultCompressed;var aa=this.editor.graph;if((f||!c&&null!=L&&/(\.svg)$/i.test(L.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var na=aa.getGlobalVariable;aa=this.createTemporaryGraph(aa.getStylesheet());aa.setBackgroundImage=this.editor.graph.setBackgroundImage;aa.background=this.editor.graph.background;var W=null!=this.pages?this.pages[0]:null;null==W||this.currentPage==W?aa.setBackgroundImage(this.editor.graph.backgroundImage):null!=W.viewState&&null!=W.viewState&&aa.setBackgroundImage(W.viewState.backgroundImage);-aa.getGlobalVariable=function(ba){return"page"==ba&&null!=W?W.getName():"pagenumber"==ba?1:na.apply(this,arguments)};document.body.appendChild(aa.container);null!=W&&aa.model.setRoot(W.root)}G=null!=G?G:this.getXmlFileData(q,D,J,Y);L=null!=L?L:this.getCurrentFile();c=this.createFileData(G,aa,L,window.location.href,c,f,l,t,q,N,J,ha,ea);aa!=this.editor.graph&&aa.container.parentNode.removeChild(aa.container);return c};EditorUi.prototype.getHtml=function(c,f,l,t,q,D){D=null!=D?D:!0;var G=null,N=EditorUi.drawHost+-"/js/embed-static.min.js";if(null!=f){G=D?f.getGraphBounds():f.getBoundingBox(f.getSelectionCells());var L=f.view.scale;D=Math.floor(G.x/L-f.view.translate.x);L=Math.floor(G.y/L-f.view.translate.y);G=f.background;null==q&&(f=this.getBasenames().join(";"),0<f.length&&(N=EditorUi.drawHost+"/embed.js?s="+f));c.setAttribute("x0",D);c.setAttribute("y0",L)}null!=c&&(c.setAttribute("pan","1"),c.setAttribute("zoom","1"),c.setAttribute("resize","0"),c.setAttribute("fit","0"),c.setAttribute("border","20"),+aa.getGlobalVariable=function(ba){return"page"==ba&&null!=W?W.getName():"pagenumber"==ba?1:na.apply(this,arguments)};document.body.appendChild(aa.container);null!=W&&aa.model.setRoot(W.root)}H=null!=H?H:this.getXmlFileData(q,D,J,Y);L=null!=L?L:this.getCurrentFile();c=this.createFileData(H,aa,L,window.location.href,c,f,l,t,q,N,J,ha,ea);aa!=this.editor.graph&&aa.container.parentNode.removeChild(aa.container);return c};EditorUi.prototype.getHtml=function(c,f,l,t,q,D){D=null!=D?D:!0;var H=null,N=EditorUi.drawHost++"/js/embed-static.min.js";if(null!=f){H=D?f.getGraphBounds():f.getBoundingBox(f.getSelectionCells());var L=f.view.scale;D=Math.floor(H.x/L-f.view.translate.x);L=Math.floor(H.y/L-f.view.translate.y);H=f.background;null==q&&(f=this.getBasenames().join(";"),0<f.length&&(N=EditorUi.drawHost+"/embed.js?s="+f));c.setAttribute("x0",D);c.setAttribute("y0",L)}null!=c&&(c.setAttribute("pan","1"),c.setAttribute("zoom","1"),c.setAttribute("resize","0"),c.setAttribute("fit","0"),c.setAttribute("border","20"),c.setAttribute("links","1"),null!=t&&c.setAttribute("edit",t));null!=q&&(q=q.replace(/&/g,"&"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";t=Graph.compress(c);Graph.decompress(t)!=c&&(t=encodeURIComponent(c));return(null==q?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=q?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==q?null!=l?"<title>"+mxUtils.htmlEntities(l)+"</title>\n":"":"<title>draw.io</title>\n")+-(null!=q?'<meta http-equiv="refresh" content="0;URL=\''+q+"'\"/>\n":"")+"</head>\n<body"+(null==q&&null!=G&&G!=mxConstants.NONE?' style="background-color:'+G+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+t+"</div>\n</div>\n"+(null==q?'<script type="text/javascript" src="'+N+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+q+'" target="_blank"><img border="0" src="'++(null!=q?'<meta http-equiv="refresh" content="0;URL=\''+q+"'\"/>\n":"")+"</head>\n<body"+(null==q&&null!=H&&H!=mxConstants.NONE?' style="background-color:'+H+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+t+"</div>\n</div>\n"+(null==q?'<script type="text/javascript" src="'+N+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+q+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(c,f,l,t,q){f=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";null!=q&&(q=q.replace(/&/g,"&"));c={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:Graph.zapGremlins(c),toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(c.page=mxUtils.indexOf(this.pages,this.currentPage));return(null==q?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=q?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==q?null!=l?"<title>"+mxUtils.htmlEntities(l)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=q?'<meta http-equiv="refresh" content="0;URL=\''+q+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(c))+'"></div>\n'+(null==q?'<script type="text/javascript" src="'+f+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+q+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.setFileData=function(c){c=this.validateFileData(c);this.pages=this.fileNode=this.currentPage=null;var f=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null,l=Editor.extractParserError(f,mxResources.get("invalidOrMissingFile"));if(l)throw EditorUi.debug("EditorUi.setFileData ParserError",[this],"data",[c],"node",[f],"cause",[l]),Error(mxResources.get("notADiagramFile")+" ("+l+")");c=null!=f?this.editor.extractGraphModel(f,!0):null;null!=c&&(f=c);if(null!=f&&"mxfile"==f.nodeName&&(c=f.getElementsByTagName("diagram"),l={},0<c.length)){var t=this.getHashObject(),q=null;this.fileNode=f;this.pages=[];for(var D=0;D<c.length;D++){null==c[D].getAttribute("id")&&c[D].setAttribute("id",D);f=new DiagramPage(c[D]);null==f.getName()&&f.setName(mxResources.get("pageWithNumber",[D+1]));this.pages.push(f);if(null==t.pageId&&null!=urlParams["page-id"]&&f.getId()==urlParams["page-id"]||null!=t.pageId&&f.getId()==t.pageId)q=f;if(null==l[f.getId()])l[f.getId()]=f;else throw Error(f.getId()+": Duplicate page ID");}this.currentPage=null!=q?q:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];f=this.currentPage.node}null==this.fileNode&&null!=f&&(this.fileNode=f.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(f.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",-[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(f);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,this.currentPage.setDiagramModified(!1),this.scrollToPage());if(null!=urlParams["layer-ids"])try{var G=decodeURIComponent(urlParams["layer-ids"]).split(" ");f={};for(D=0;D<G.length;D++)f[G[D]]=!0;var N=this.editor.graph.getModel(),L=N.getChildren(N.root);for(D=0;D<L.length;D++){var J=L[D];N.setVisible(J,f[J.id]||!1)}}catch(Y){}};EditorUi.prototype.getBaseFilename=+[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(f);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,this.currentPage.setDiagramModified(!1),this.scrollToPage());if(null!=urlParams["layer-ids"])try{var H=decodeURIComponent(urlParams["layer-ids"]).split(" ");f={};for(D=0;D<H.length;D++)f[H[D]]=!0;var N=this.editor.graph.getModel(),L=N.getChildren(N.root);for(D=0;D<L.length;D++){var J=L[D];N.setVisible(J,f[J.id]||!1)}}catch(Y){}};EditorUi.prototype.getBaseFilename=function(c){var f=this.getCurrentFile();f=null!=f&&null!=f.getTitle()?f.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(f)||/(\.html)$/i.test(f)||/(\.svg)$/i.test(f)||/(\.png)$/i.test(f))f=f.substring(0,f.lastIndexOf("."));/(\.drawio)$/i.test(f)&&(f=f.substring(0,f.lastIndexOf(".")));!c&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(f=f+"-"+this.currentPage.getName());return f};EditorUi.prototype.downloadFile=-function(c,f,l,t,q,D,G,N,L,J,Y,ha,ea,aa,na,W){try{t=null!=t?t:this.editor.graph.isSelectionEmpty();var ba=this.getBaseFilename(!q),ja=ba+("xml"==c||"pdf"==c&&Y?".drawio":"")+"."+c;if("xml"==c){var ca=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,t,q,null,null,null,f);this.saveData(ja,c,ca,"text/xml")}else if("html"==c)ca=this.getHtml2(this.getFileData(!0),this.editor.graph,ba),this.saveData(ja,c,ca,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==-c?ja=ba+".png":"jpeg"==c&&(ja=ba+".jpg"),this.saveRequest(ja,c,mxUtils.bind(this,function(I,U){try{return this.createDownloadRequest(I,c,t,U,G,q,N,L,J,Y,ha,void 0,void 0,!D,ea,aa,na,W)}catch(P){this.handleError(P)}}));else{var la=null,Q=mxUtils.bind(this,function(I){I.length<=MAX_REQUEST_SIZE?this.saveData(ja,"svg",I,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(la)}))});if("svg"==c){var k=this.editor.graph.background;-if(G||k==mxConstants.NONE)k=null;var B=this.editor.graph.getSvg(k,null,null,null,null,t);l&&this.editor.graph.addSvgShadow(B);this.editor.convertImages(B,mxUtils.bind(this,mxUtils.bind(this,function(I){this.spinner.stop();Q(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(I))})))}else ja=ba+".svg",la=this.getFileData(!1,!0,null,mxUtils.bind(this,function(I){this.spinner.stop();Q(I)}),t)}}catch(I){this.handleError(I)}};EditorUi.prototype.createDownloadRequest=function(c,f,l,t,q,D,G,N,-L,J,Y,ha,ea,aa,na,W,ba,ja){c=this.downloadRequestBuilder(c,f,l,t,q,D,G,N,L,J,Y,ha,ea,aa,na,W,ba,ja);f="";for(var ca in c)l=c[ca],null!=l&&(f+=ca+"="+encodeURIComponent(l)+"&");return new mxXmlRequest(EXPORT_URL,f)};EditorUi.prototype.downloadRequestBuilder=function(c,f,l,t,q,D,G,N,L,J,Y,ha,ea,aa,na,W,ba,ja){var ca=this.editor.graph,la=ca.getGraphBounds();l=this.getFileData(!0,null,null,null,l,0==D?!1:"xmlpng"!=f,null,null,null,!Editor.defaultCompressed,"pdf"==f);var Q=null,k=null,B=null;if(!EditorUi.isElectronApp&&+function(c,f,l,t,q,D,H,N,L,J,Y,ha,ea,aa,na,W){try{t=null!=t?t:this.editor.graph.isSelectionEmpty();var ba=this.getBaseFilename(!q),ja=ba+("xml"==c||"pdf"==c&&Y?".drawio":"")+"."+c;if("xml"==c){var ca=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,t,q,null,null,null,f);this.saveData(ja,c,ca,"text/xml")}else if("html"==c)ca=this.getHtml2(this.getFileData(!0),this.editor.graph,ba),this.saveData(ja,c,ca,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==+c?ja=ba+".png":"jpeg"==c&&(ja=ba+".jpg"),this.saveRequest(ja,c,mxUtils.bind(this,function(I,U){try{return this.createDownloadRequest(I,c,t,U,H,q,N,L,J,Y,ha,void 0,void 0,!D,ea,aa,na,W)}catch(P){this.handleError(P)}}));else{var la=null,Q=mxUtils.bind(this,function(I){I.length<=MAX_REQUEST_SIZE?this.saveData(ja,"svg",I,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(la)}))});if("svg"==c){var k=this.editor.graph.background;+if(H||k==mxConstants.NONE)k=null;var B=this.editor.graph.getSvg(k,null,null,null,null,t);l&&this.editor.graph.addSvgShadow(B);this.editor.convertImages(B,mxUtils.bind(this,mxUtils.bind(this,function(I){this.spinner.stop();Q(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(I))})))}else ja=ba+".svg",la=this.getFileData(!1,!0,null,mxUtils.bind(this,function(I){this.spinner.stop();Q(I)}),t)}}catch(I){this.handleError(I)}};EditorUi.prototype.createDownloadRequest=function(c,f,l,t,q,D,H,N,+L,J,Y,ha,ea,aa,na,W,ba,ja){c=this.downloadRequestBuilder(c,f,l,t,q,D,H,N,L,J,Y,ha,ea,aa,na,W,ba,ja);f="";for(var ca in c)l=c[ca],null!=l&&(f+=ca+"="+encodeURIComponent(l)+"&");return new mxXmlRequest(EXPORT_URL,f)};EditorUi.prototype.downloadRequestBuilder=function(c,f,l,t,q,D,H,N,L,J,Y,ha,ea,aa,na,W,ba,ja){var ca=this.editor.graph,la=ca.getGraphBounds();l=this.getFileData(!0,null,null,null,l,0==D?!1:"xmlpng"!=f,null,null,null,!Editor.defaultCompressed,"pdf"==f);var Q=null,k=null,B=null;if(!EditorUi.isElectronApp&&(la.width*la.height>MAX_AREA||l.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};J=J?"1":"0";"pdf"==f&&(null!=Y?(Q=Y.from,k=Y.to):0==D&&(B="1"));"xmlpng"==f&&(J="1",f="png");if(("xmlpng"==f||"svg"==f)&&null!=this.pages&&null!=this.currentPage)for(D=0;D<this.pages.length;D++)if(this.pages[D]==this.currentPage){Q=D;break}D=ca.background;"png"!=f&&"pdf"!=f&&"svg"!=f||!q?q||null!=D&&D!=mxConstants.NONE||(D="#ffffff"):D=mxConstants.NONE;q={globalVars:ca.getExportVariables()};-L&&(q.grid={size:ca.gridSize,steps:ca.view.gridSteps,color:Editor.isDarkMode()&&"pdf"==f?mxGraphView.prototype.defaultGridColor:ca.view.gridColor});Graph.translateDiagram&&(q.diagramLanguage=Graph.diagramLanguage);return{format:f,from:Q,to:k,allPages:B,bg:null!=D?D:mxConstants.NONE,base64:t,embedXml:J,xml:l,filename:null!=c?c:"",extras:JSON.stringify(q),scale:G,border:N,pageMargin:na,w:ha&&isFinite(ha)?ha:null,h:ea&&isFinite(ea)?ea:null,crop:null!=aa&&aa?"1":"0",fit:null!=W&&W?"1":"0",sheetsAcross:ba,+L&&(q.grid={size:ca.gridSize,steps:ca.view.gridSteps,color:Editor.isDarkMode()&&"pdf"==f?mxGraphView.prototype.defaultGridColor:ca.view.gridColor});Graph.translateDiagram&&(q.diagramLanguage=Graph.diagramLanguage);return{format:f,from:Q,to:k,allPages:B,bg:null!=D?D:mxConstants.NONE,base64:t,embedXml:J,xml:l,filename:null!=c?c:"",extras:JSON.stringify(q),scale:H,border:N,pageMargin:na,w:ha&&isFinite(ha)?ha:null,h:ea&&isFinite(ea)?ea:null,crop:null!=aa&&aa?"1":"0",fit:null!=W&&W?"1":"0",sheetsAcross:ba,sheetsDown:ja}};EditorUi.prototype.setMode=function(c,f){this.mode=c};EditorUi.prototype.getDiagramId=function(){var c=window.location.hash;null!=c&&0<c.length&&(c=c.substring(1));if(null!=c&&1<c.length){var f=c.indexOf("#");0<=f&&(c=c.substring(0,f))}return c};EditorUi.prototype.getHashObject=function(){var c=window.location.hash,f={};if(null!=c&&0<c.length){var l=c.lastIndexOf("#");if(0<l){c=decodeURIComponent(c.substring(l+1));try{f=JSON.parse(c)}catch(t){}}}return f};EditorUi.prototype.updateHashObject=function(){if(null!=this.currentFile&&null!=this.currentPage&&""!=this.currentFile.getHash()){var c=this.getHashObject();c.pageId=this.currentPage.getId();this.setHashObject(c)}else this.setHashObject(null)};EditorUi.prototype.setHashObject=function(c){if(Editor.enableHashObjects){var f=window.location.hash;if(null==f||""==f)f="#";var l=f.lastIndexOf("#");0<l&&(f=f.substring(0,l));try{null==c||mxUtils.isEmptyObject(c)||(f=f+"#"+encodeURIComponent(JSON.stringify(c)))}catch(t){}0<l&&0<f.lastIndexOf("#")?-window.location.hash=f:window.location.replace(f)}};EditorUi.prototype.loadDescriptor=function(c,f,l){var t=window.location.hash,q=mxUtils.bind(this,function(G){var N=null!=c.data?c.data:"";null!=G&&0<G.length&&(0<N.length&&(N+="\n"),N+=G);G=new LocalFile(this,"csv"!=c.format&&0<N.length?N:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);G.getHash=function(){return t};this.fileLoaded(G);"csv"==c.format&&this.importCsv(N,mxUtils.bind(this,function(ea){this.editor.undoManager.clear();+window.location.hash=f:window.location.replace(f)}};EditorUi.prototype.loadDescriptor=function(c,f,l){var t=window.location.hash,q=mxUtils.bind(this,function(H){var N=null!=c.data?c.data:"";null!=H&&0<H.length&&(0<N.length&&(N+="\n"),N+=H);H=new LocalFile(this,"csv"!=c.format&&0<N.length?N:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);H.getHash=function(){return t};this.fileLoaded(H);"csv"==c.format&&this.importCsv(N,mxUtils.bind(this,function(ea){this.editor.undoManager.clear();this.editor.setModified(!1);this.clearStatus()}));if(null!=c.update){var L=null!=c.interval?parseInt(c.interval):6E4,J=null,Y=mxUtils.bind(this,function(){var ea=this.currentPage;mxUtils.post(c.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(aa){ea===this.currentPage&&(200<=aa.getStatus()&&300>=aa.getStatus()?(this.updateDiagram(aa.getText()),ha()):this.handleError({message:mxResources.get("error")+" "+aa.getStatus()}))}),mxUtils.bind(this,function(aa){this.handleError(aa)}))}),-ha=mxUtils.bind(this,function(){window.clearTimeout(J);J=window.setTimeout(Y,L)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){ha();Y()}));ha();Y()}null!=f&&f()});if(null!=c.url&&0<c.url.length){var D=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(D,mxUtils.bind(this,function(G){q(G)}),mxUtils.bind(this,function(G){null!=l&&l(G)}))}else q("")};EditorUi.prototype.updateDiagram=function(c){function f(la){var Q=new mxCellOverlay(la.image||q.warningImage,la.tooltip,la.align,-la.valign,la.offset);Q.addListener(mxEvent.CLICK,function(k,B){t.alert(la.tooltip)});return Q}var l=null,t=this;if(null!=c&&0<c.length&&(l=mxUtils.parseXml(c),c=null!=l?l.documentElement:null,null!=c&&"updates"==c.nodeName)){var q=this.editor.graph,D=q.getModel();D.beginUpdate();var G=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var N=D.getCell(c.getAttribute("id"));if(null!=N){try{var L=c.getAttribute("value");if(null!=L){var J=mxUtils.parseXml(L).documentElement;if(null!=J)if("1"==+ha=mxUtils.bind(this,function(){window.clearTimeout(J);J=window.setTimeout(Y,L)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){ha();Y()}));ha();Y()}null!=f&&f()});if(null!=c.url&&0<c.url.length){var D=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(D,mxUtils.bind(this,function(H){q(H)}),mxUtils.bind(this,function(H){null!=l&&l(H)}))}else q("")};EditorUi.prototype.updateDiagram=function(c){function f(la){var Q=new mxCellOverlay(la.image||q.warningImage,la.tooltip,la.align,+la.valign,la.offset);Q.addListener(mxEvent.CLICK,function(k,B){t.alert(la.tooltip)});return Q}var l=null,t=this;if(null!=c&&0<c.length&&(l=mxUtils.parseXml(c),c=null!=l?l.documentElement:null,null!=c&&"updates"==c.nodeName)){var q=this.editor.graph,D=q.getModel();D.beginUpdate();var H=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var N=D.getCell(c.getAttribute("id"));if(null!=N){try{var L=c.getAttribute("value");if(null!=L){var J=mxUtils.parseXml(L).documentElement;if(null!=J)if("1"==J.getAttribute("replace-value"))D.setValue(N,J);else for(var Y=J.attributes,ha=0;ha<Y.length;ha++)q.setAttributeForCell(N,Y[ha].nodeName,0<Y[ha].nodeValue.length?Y[ha].nodeValue:null)}}catch(la){null!=window.console&&console.log("Error in value for "+N.id+": "+la)}try{var ea=c.getAttribute("style");null!=ea&&q.model.setStyle(N,ea)}catch(la){null!=window.console&&console.log("Error in style for "+N.id+": "+la)}try{var aa=c.getAttribute("icon");if(null!=aa){var na=0<aa.length?JSON.parse(aa):null;null!=na&&na.append||q.removeCellOverlays(N);null!=na&&q.addCellOverlay(N,f(na))}}catch(la){null!=window.console&&console.log("Error in icon for "+N.id+": "+la)}try{var W=c.getAttribute("geometry");if(null!=W){W=JSON.parse(W);var ba=q.getCellGeometry(N);if(null!=ba){ba=ba.clone();for(key in W){var ja=parseFloat(W[key]);"dx"==key?ba.x+=ja:"dy"==key?ba.y+=ja:"dw"==key?ba.width+=ja:"dh"==key?ba.height+=ja:ba[key]=parseFloat(W[key])}q.model.setGeometry(N,ba)}}}catch(la){null!=window.console&&console.log("Error in icon for "+-N.id+": "+la)}}}else if("model"==c.nodeName){for(var ca=c.firstChild;null!=ca&&ca.nodeType!=mxConstants.NODETYPE_ELEMENT;)ca=ca.nextSibling;null!=ca&&(new mxCodec(c.firstChild)).decode(ca,D)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(q.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))q.view.translate=new mxPoint(parseFloat(c.getAttribute("dx")||0),parseFloat(c.getAttribute("dy")||0))}else"fit"==c.nodeName&&(G=c.hasAttribute("max-scale")?parseFloat(c.getAttribute("max-scale")):-1);c=c.nextSibling}}finally{D.endUpdate()}null!=G&&this.chromelessResize&&this.chromelessResize(!0,G)}return l};EditorUi.prototype.getCopyFilename=function(c,f){var l=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var t=l.lastIndexOf(".");0<=t&&(c=l.substring(t),l=l.substring(0,t));if(f){f=l;var q=new Date;l=q.getFullYear();t=q.getMonth()+1;var D=q.getDate(),G=q.getHours(),N=q.getMinutes();q=q.getSeconds();l=f+(" "+(l+"-"+t+"-"+D+"-"+G+"-"+N+"-"+q))}return l=mxResources.get("copyOf",+N.id+": "+la)}}}else if("model"==c.nodeName){for(var ca=c.firstChild;null!=ca&&ca.nodeType!=mxConstants.NODETYPE_ELEMENT;)ca=ca.nextSibling;null!=ca&&(new mxCodec(c.firstChild)).decode(ca,D)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(q.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))q.view.translate=new mxPoint(parseFloat(c.getAttribute("dx")||0),parseFloat(c.getAttribute("dy")||0))}else"fit"==c.nodeName&&(H=c.hasAttribute("max-scale")?parseFloat(c.getAttribute("max-scale")):+1);c=c.nextSibling}}finally{D.endUpdate()}null!=H&&this.chromelessResize&&this.chromelessResize(!0,H)}return l};EditorUi.prototype.getCopyFilename=function(c,f){var l=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var t=l.lastIndexOf(".");0<=t&&(c=l.substring(t),l=l.substring(0,t));if(f){f=l;var q=new Date;l=q.getFullYear();t=q.getMonth()+1;var D=q.getDate(),H=q.getHours(),N=q.getMinutes();q=q.getSeconds();l=f+(" "+(l+"-"+t+"-"+D+"-"+H+"-"+N+"-"+q))}return l=mxResources.get("copyOf",[l])+c};EditorUi.prototype.logIfModified=function(c,f){try{null!=c&&f&&EditorUi.debug("File.closed",[c])}catch(l){}};EditorUi.prototype.fileLoaded=function(c,f,l){var t=this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrentFile(null);var q=!1;this.hideDialog();null!=t&&(t.removeListener(this.descriptorChangedListener),this.logIfModified(t,!0),t.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var D=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=t&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);!f&&null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fname.innerText="");this.clearStatus();this.updateUi();f||this.showSplash()});if(null!=c)try{this.openingFile=!0;this.setCurrentFile(c);c.addListener("descriptorChanged",this.descriptorChangedListener);c.addListener("contentChanged",this.descriptorChangedListener);c.open();delete this.openingFile;this.setGraphEnabled(!0);this.setMode(c.getMode());this.editor.graph.model.prefix=Editor.guid()+"-";this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();c.isEditable()?c.isModified()?c.addUnsavedStatus():this.clearStatus():this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus('<div class="geStatusBox" title="'+mxUtils.htmlEntities(mxResources.get("readOnly"))+'">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+-"</div>")}));!this.editor.isChromelessView()||this.editor.editable?(this.editor.graph.selectUnlockedLayer(),this.showLayersDialog(),this.restoreLibraries(),window.self!==window.top&&window.focus()):this.editor.graph.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();null!=l&&l();this.editor.fireEvent(new mxEventObject("fileLoaded"));q=!0;if(!this.isOffline()&&null!=c.getMode()){var G="1"==urlParams.sketch?"sketch":uiTheme;if(null==G)G="default";else if("sketch"==G||-"min"==G)G+=Editor.isDarkMode()?"-dark":"-light"}EditorUi.debug("File.opened",[c]);"1"==urlParams.viewerOnlyMsg&&this.showAlert(mxResources.get("viewerOnlyMsg"));if(this.editor.editable&&this.mode==c.getMode()&&c.getMode()!=App.MODE_DEVICE&&null!=c.getMode())try{this.addRecent({id:c.getHash(),title:c.getTitle(),mode:c.getMode()})}catch(N){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(N){}}catch(N){this.fileLoadedError=N;if(null!=c)try{c.close()}catch(L){}c=+"</div>")}));!this.editor.isChromelessView()||this.editor.editable?(this.editor.graph.selectUnlockedLayer(),this.showLayersDialog(),this.restoreLibraries(),window.self!==window.top&&window.focus()):this.editor.graph.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();null!=l&&l();this.editor.fireEvent(new mxEventObject("fileLoaded"));q=!0;if(!this.isOffline()&&null!=c.getMode()){var H="1"==urlParams.sketch?"sketch":uiTheme;if(null==H)H="default";else if("sketch"==H||+"min"==H)H+=Editor.isDarkMode()?"-dark":"-light"}EditorUi.debug("File.opened",[c]);"1"==urlParams.viewerOnlyMsg&&this.showAlert(mxResources.get("viewerOnlyMsg"));if(this.editor.editable&&this.mode==c.getMode()&&c.getMode()!=App.MODE_DEVICE&&null!=c.getMode())try{this.addRecent({id:c.getHash(),title:c.getTitle(),mode:c.getMode()})}catch(N){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(N){}}catch(N){this.fileLoadedError=N;if(null!=c)try{c.close()}catch(L){}c=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=t?this.fileLoaded(t)||D():D()});f?c():(null!=N.fallbackFileData&&(N.alternateAction={label:mxResources.get("makeCopy"),funct:mxUtils.bind(this,function(){this.hideDialog();var L=new LocalFile(this,N.fallbackFileData,this.defaultFilename,!0);this.fileLoaded(L)})}),this.handleError(N,mxResources.get("errorLoadingFile"),c,!0,null,null,-!0))}else D();return q};EditorUi.prototype.getHashValueForPages=function(c,f){var l=0,t=new mxGraphModel,q=new mxCodec;null!=f&&(f.byteCount=0,f.attrCount=0,f.eltCount=0,f.nodeCount=0);for(var D=0;D<c.length;D++){this.updatePageRoot(c[D]);var G=c[D].node.cloneNode(!1);G.removeAttribute("name");t.root=c[D].root;var N=q.encode(t);this.editor.graph.saveViewState(c[D].viewState,N,!0);N.removeAttribute("pageWidth");N.removeAttribute("pageHeight");G.appendChild(N);null!=f&&(f.eltCount+=G.getElementsByTagName("*").length,-f.nodeCount+=G.getElementsByTagName("mxCell").length);l=(l<<5)-l+this.hashValue(G,function(L,J,Y,ha){return!ha||"mxGeometry"!=L.nodeName&&"mxPoint"!=L.nodeName||"x"!=J&&"y"!=J&&"width"!=J&&"height"!=J?ha&&"mxCell"==L.nodeName&&"previous"==J?null:Y:Math.round(Y)},f)<<0}return l};EditorUi.prototype.hashValue=function(c,f,l){var t=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&"string"===typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(t^=this.hashValue(c.nodeName,-f,l));if(null!=c.attributes){null!=l&&(l.attrCount+=c.attributes.length);for(var q=0;q<c.attributes.length;q++){var D=c.attributes[q].name,G=null!=f?f(c,D,c.attributes[q].value,!0):c.attributes[q].value;null!=G&&(t^=this.hashValue(D,f,l)+this.hashValue(G,f,l))}}if(null!=c.childNodes)for(q=0;q<c.childNodes.length;q++)t=(t<<5)-t+this.hashValue(c.childNodes[q],f,l)<<0}else if(null!=c&&"function"!==typeof c){c=String(c);f=0;null!=l&&(l.byteCount+=c.length);for(q=0;q<c.length;q++)f=(f<<5)-f+c.charCodeAt(q)<<-0;t^=f}return t};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,f,l,t,q,D,G){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?StorageFile.getFileContent(this,".scratchpad",mxUtils.bind(this,function(c){null==c&&(c=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,+!0))}else D();return q};EditorUi.prototype.getHashValueForPages=function(c,f){var l=0,t=new mxGraphModel,q=new mxCodec;null!=f&&(f.byteCount=0,f.attrCount=0,f.eltCount=0,f.nodeCount=0);for(var D=0;D<c.length;D++){this.updatePageRoot(c[D]);var H=c[D].node.cloneNode(!1);H.removeAttribute("name");t.root=c[D].root;var N=q.encode(t);this.editor.graph.saveViewState(c[D].viewState,N,!0);N.removeAttribute("pageWidth");N.removeAttribute("pageHeight");H.appendChild(N);null!=f&&(f.eltCount+=H.getElementsByTagName("*").length,+f.nodeCount+=H.getElementsByTagName("mxCell").length);l=(l<<5)-l+this.hashValue(H,function(L,J,Y,ha){return!ha||"mxGeometry"!=L.nodeName&&"mxPoint"!=L.nodeName||"x"!=J&&"y"!=J&&"width"!=J&&"height"!=J?ha&&"mxCell"==L.nodeName&&"previous"==J?null:Y:Math.round(Y)},f)<<0}return l};EditorUi.prototype.hashValue=function(c,f,l){var t=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&"string"===typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(t^=this.hashValue(c.nodeName,+f,l));if(null!=c.attributes){null!=l&&(l.attrCount+=c.attributes.length);for(var q=0;q<c.attributes.length;q++){var D=c.attributes[q].name,H=null!=f?f(c,D,c.attributes[q].value,!0):c.attributes[q].value;null!=H&&(t^=this.hashValue(D,f,l)+this.hashValue(H,f,l))}}if(null!=c.childNodes)for(q=0;q<c.childNodes.length;q++)t=(t<<5)-t+this.hashValue(c.childNodes[q],f,l)<<0}else if(null!=c&&"function"!==typeof c){c=String(c);f=0;null!=l&&(l.byteCount+=c.length);for(q=0;q<c.length;q++)f=(f<<5)-f+c.charCodeAt(q)<<+0;t^=f}return t};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,f,l,t,q,D,H){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?StorageFile.getFileContent(this,".scratchpad",mxUtils.bind(this,function(c){null==c&&(c=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,c,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(c){if(!Editor.defaultCompressed)for(var f=0;f<c.length;f++)null!=c[f].xml&&"<"!=c[f].xml.charAt(0)&&(c[f].xml=mxUtils.trim(Graph.decompress(c[f].xml)));f=mxUtils.createXmlDocument();var l=f.createElement("mxlibrary");mxUtils.setTextContent(l,JSON.stringify(c,null,2));f.appendChild(l);return mxUtils.getXml(f,"\n")};EditorUi.prototype.closeLibrary=function(c){null!=c&&(this.removeLibrarySidebar(c.getHash()),c.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(c.getHash()),".scratchpad"==c.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(c){var f=this.sidebar.palettes[c];if(null!=f){for(var l=0;l<f.length;l++)f[l].parentNode.removeChild(f[l]);delete this.sidebar.palettes[c]}};EditorUi.prototype.repositionLibrary=function(c,f){var l=this.sidebar.getEntryContainer();if(!this.sidebar.appendCustomLibraries||null!=c||!f){null==c&&(f=this.sidebar.palettes["L.scratchpad"],null==f&&(f=this.sidebar.palettes.search),null!=f&&(c=f[f.length-1].nextSibling));c=null!=c?c:l.firstChild.nextSibling.nextSibling;f=l.lastChild;var t=f.previousSibling;l.insertBefore(f,c);l.insertBefore(t,f)}};EditorUi.prototype.loadLibrary=function(c,f){var l=mxUtils.parseXml(c.getData());if("mxlibrary"==l.documentElement.nodeName){var t=JSON.parse(mxUtils.getTextContent(l.documentElement));this.libraryLoaded(c,t,l.documentElement.getAttribute("title"),f)}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(c){return""};EditorUi.prototype.showSidebar=function(){null!=this.sidebarWindow?this.sidebarWindow.window.setVisible(!0):this.toggleShapesPanel(!0)};EditorUi.prototype.libraryLoaded=function(c,f,l,t){if(null!=this.sidebar){c.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(c.getHash());var q=null;if(c.constructor!=StorageLibrary||".scratchpad"!=c.title){null==this.openLibraries&&(this.openLibraries=[]);for(var D=0;D<this.openLibraries.length;D++)if(this.openLibraries[D].file.getHash()==-c.getHash()){mxUtils.remove(this.openLibraries[D],this.openLibraries);break}q={file:c,images:f,title:l,expand:t};this.openLibraries.push(q)}else this.scratchpad=c;D=this.sidebar.palettes[c.getHash()];D=null!=D?D[D.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());var G=null,N=mxUtils.bind(this,function(ja,ca){0==ja.length&&c.isEditable()?(null==G&&(G=document.createElement("div"),G.className="geDropTarget",mxUtils.write(G,mxResources.get("dragElementsHere"))),ca.appendChild(G)):this.addLibraryEntries(ja,+c.getHash()){mxUtils.remove(this.openLibraries[D],this.openLibraries);break}q={file:c,images:f,title:l,expand:t};this.openLibraries.push(q)}else this.scratchpad=c;D=this.sidebar.palettes[c.getHash()];D=null!=D?D[D.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());var H=null,N=mxUtils.bind(this,function(ja,ca){0==ja.length&&c.isEditable()?(null==H&&(H=document.createElement("div"),H.className="geDropTarget",mxUtils.write(H,mxResources.get("dragElementsHere"))),ca.appendChild(H)):this.addLibraryEntries(ja,ca)});null!=this.sidebar&&null!=f&&this.sidebar.addEntries(f);null==l&&(l=c.getTitle(),null!=l&&/(\.xml)$/i.test(l)&&(l=l.substring(0,l.lastIndexOf("."))));var L=this.sidebar.addPalette(c.getHash(),l,null!=t?t:!0,mxUtils.bind(this,function(ja){N(f,ja)}));null!=q&&(q.div=L);this.repositionLibrary(D,"L.scratchpad"!=c.getHash());t=L.parentNode.previousSibling;l=t.getAttribute("title");null!=l&&0<l.length&&".scratchpad"!=c.title&&t.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+l);var J=document.createElement("div");J.style.backgroundColor="inherit";t.style.position="relative";var Y=document.createElement("img");Y.className="geLibraryButton";Y.setAttribute("src",Editor.crossImage);Y.setAttribute("title",mxResources.get("close"));var ha=null;if(".scratchpad"!=c.title||this.closableScratchpad)J.appendChild(Y),mxEvent.addListener(Y,"click",mxUtils.bind(this,function(ja){if(!mxEvent.isConsumed(ja)){var ca=mxUtils.bind(this,function(){null!=q&&mxUtils.remove(q,this.openLibraries);this.closeLibrary(c)});null!=ha?this.confirm(mxResources.get("allChangesLost"),null,ca,mxResources.get("cancel"),mxResources.get("discardChanges")):ca();mxEvent.consume(ja)}}));if(c.isEditable()){var ea=this.editor.graph,aa=null;l=mxUtils.bind(this,function(ja){this.showLibraryDialog(c.getTitle(),L,f,c,c.getMode());mxEvent.consume(ja)});var na=mxUtils.bind(this,function(ja){c.setModified(!0);c.isAutosave()?(null!=aa&&null!=aa.parentNode&&aa.parentNode.removeChild(aa),aa=Y.cloneNode(!1),aa.setAttribute("src",Editor.spinImage),aa.setAttribute("title",mxResources.get("saving")),aa.style.cursor="default",aa.style.marginRight="2px",aa.style.marginTop="-2px",J.insertBefore(aa,J.firstChild),this.saveLibrary(c.getTitle(),f,c,c.getMode(),!0,!0,function(){null!=aa&&null!=aa.parentNode&&aa.parentNode.removeChild(aa)})):null==ha&&(ha=Y.cloneNode(!1),ha.setAttribute("src",Editor.saveImage),ha.setAttribute("title",mxResources.get("save")),J.insertBefore(ha,J.firstChild),mxEvent.addListener(ha,"click",mxUtils.bind(this,function(ca){this.saveLibrary(c.getTitle(),f,c,c.getMode(),c.constructor==LocalLibrary,!0,function(){null==ha||c.isModified()||(ha.parentNode.removeChild(ha),ha=null)});mxEvent.consume(ca)})))}),W=mxUtils.bind(this,function(ja,ca,la,Q){ja=ea.cloneCells(mxUtils.sortCells(ea.model.getTopmostCells(ja)));for(var k=0;k<ja.length;k++){var B=ea.getCellGeometry(ja[k]);null!=B&&B.translate(-ca.x,-ca.y)}L.appendChild(this.sidebar.createVertexTemplateFromCells(ja,ca.width,ca.height,Q||"",!0,null,!1));ja=mxUtils.getXml(this.editor.graph.encodeCells(ja));Editor.defaultCompressed&&(ja=-Graph.compress(ja));ca={xml:ja,w:ca.width,h:ca.height};null!=Q&&(ca.title=Q);f.push(ca);na(la);null!=G&&null!=G.parentNode&&0<f.length&&(G.parentNode.removeChild(G),G=null)}),ba=mxUtils.bind(this,function(ja){if(ea.isSelectionEmpty())ea.getRubberband().isActive()?(ea.getRubberband().execute(ja),ea.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var ca=ea.getSelectionCells(),la=ea.view.getBounds(ca);if(null!=la&&0<la.width&&+Graph.compress(ja));ca={xml:ja,w:ca.width,h:ca.height};null!=Q&&(ca.title=Q);f.push(ca);na(la);null!=H&&null!=H.parentNode&&0<f.length&&(H.parentNode.removeChild(H),H=null)}),ba=mxUtils.bind(this,function(ja){if(ea.isSelectionEmpty())ea.getRubberband().isActive()?(ea.getRubberband().execute(ja),ea.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var ca=ea.getSelectionCells(),la=ea.view.getBounds(ca);if(null!=la&&0<la.width&&0<la.height){var Q=ea.view.scale;la.x/=Q;la.y/=Q;la.width/=Q;la.height/=Q;la.x-=ea.view.translate.x;la.y-=ea.view.translate.y;W(ca,la)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(ja)});mxEvent.addGestureListeners(L,function(){},mxUtils.bind(this,function(ja){ea.isMouseDown&&null!=ea.panningManager&&null!=ea.graphHandler.first&&(ea.graphHandler.suspend(),null!=ea.graphHandler.hint&&(ea.graphHandler.hint.style.visibility="hidden"),L.style.backgroundColor="light-dark(#fefefe, #000000)",L.style.cursor="copy",ea.panningManager.stop(),ea.autoScroll=!1,mxEvent.consume(ja))}),mxUtils.bind(this,function(ja){ea.isMouseDown&&null!=ea.panningManager&&null!=ea.graphHandler&&(L.style.backgroundColor="",L.style.cursor="default",this.sidebar.showTooltips=!0,ea.panningManager.stop(),ea.graphHandler.reset(),ea.isMouseDown=!1,ea.autoScroll=!0,ba(ja),mxEvent.consume(ja))}));mxEvent.addListener(L,"mouseleave",mxUtils.bind(this,function(ja){ea.isMouseDown&&null!=ea.graphHandler.first&&(ea.graphHandler.resume(),null!=ea.graphHandler.hint&&(ea.graphHandler.hint.style.visibility="visible"),L.style.backgroundColor="",L.style.cursor="",ea.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(L,"dragover",mxUtils.bind(this,function(ja){L.style.backgroundColor="light-dark(#fefefe, #000000)";ja.dataTransfer.dropEffect="copy";L.style.cursor="copy";this.sidebar.hideTooltip();ja.stopPropagation();ja.preventDefault()})),mxEvent.addListener(L,"drop",mxUtils.bind(this,function(ja){L.style.cursor="";L.style.backgroundColor="";0<ja.dataTransfer.files.length&&this.importFiles(ja.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(ca,la,Q,k,B,I,U,P,T){if(null!=ca&&"image/"==la.substring(0,6))ca="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(ca),ca=[new mxCell("",new mxGeometry(0,0,B,I),ca)],ca[0].vertex=!0,W(ca,new mxRectangle(0,0,B,I),ja,mxEvent.isAltDown(ja)?null:U.substring(0,U.lastIndexOf(".")).replace(/_/g,-" ")),null!=G&&null!=G.parentNode&&0<f.length&&(G.parentNode.removeChild(G),G=null);else{var X=!1,Z=mxUtils.bind(this,function(ka,va){null!=ka&&"application/pdf"==va&&(va=Editor.extractGraphModelFromPdf(ka),null!=va&&0<va.length&&(ka=va));if(null!=ka)if(ka=mxUtils.parseXml(ka),"mxlibrary"==ka.documentElement.nodeName)try{var ua=JSON.parse(mxUtils.getTextContent(ka.documentElement));N(ua,L);f=f.concat(ua);na(ja);this.spinner.stop();X=!0}catch(La){}else if("mxfile"==ka.documentElement.nodeName)try{var qa=-ka.documentElement.getElementsByTagName("diagram");for(ua=0;ua<qa.length;ua++){var Ba=this.stringToCells(Editor.getDiagramNodeXml(qa[ua])),ya=this.editor.graph.getBoundingBoxFromGeometry(Ba);null!=ya&&W(Ba,new mxRectangle(0,0,ya.width,ya.height),ja)}X=!0}catch(La){null!=window.console&&console.log("error in drop handler:",La)}X||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=G&&null!=G.parentNode&&0<f.length&&(G.parentNode.removeChild(G),G=null)});null!=+" ")),null!=H&&null!=H.parentNode&&0<f.length&&(H.parentNode.removeChild(H),H=null);else{var X=!1,Z=mxUtils.bind(this,function(ka,va){null!=ka&&"application/pdf"==va&&(va=Editor.extractGraphModelFromPdf(ka),null!=va&&0<va.length&&(ka=va));if(null!=ka)if(ka=mxUtils.parseXml(ka),"mxlibrary"==ka.documentElement.nodeName)try{var ua=JSON.parse(mxUtils.getTextContent(ka.documentElement));N(ua,L);f=f.concat(ua);na(ja);this.spinner.stop();X=!0}catch(La){}else if("mxfile"==ka.documentElement.nodeName)try{var qa=+ka.documentElement.getElementsByTagName("diagram");for(ua=0;ua<qa.length;ua++){var Ba=this.stringToCells(Editor.getDiagramNodeXml(qa[ua])),ya=this.editor.graph.getBoundingBoxFromGeometry(Ba);null!=ya&&W(Ba,new mxRectangle(0,0,ya.width,ya.height),ja)}X=!0}catch(La){null!=window.console&&console.log("error in drop handler:",La)}X||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=H&&null!=H.parentNode&&0<f.length&&(H.parentNode.removeChild(H),H=null)});null!=T&&null!=U&&EditorUi.isVisioFilename(U)?this.importVisio(T,function(ka){Z(ka,"text/xml")},null,U):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(ca,U)&&null!=T?this.isExternalDataComms()?this.parseFile(T,mxUtils.bind(this,function(ka){4==ka.readyState&&(this.spinner.stop(),200<=ka.status&&299>=ka.status?Z(ka.responseText,"text/xml"):this.handleError({message:mxResources.get(413==ka.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):Z(ca,la)}}));ja.stopPropagation();ja.preventDefault()})),mxEvent.addListener(L,"dragleave",function(ja){L.style.cursor="";L.style.backgroundColor="";ja.stopPropagation();ja.preventDefault()}));Y=Y.cloneNode(!1);Y.setAttribute("src",Editor.editImage);Y.setAttribute("title",mxResources.get("edit"));J.insertBefore(Y,J.firstChild);mxEvent.addListener(Y,"click",l);l=Y.cloneNode(!1);l.setAttribute("src",Editor.plusImage);l.setAttribute("title",mxResources.get("add"));J.insertBefore(l,J.firstChild);mxEvent.addListener(l,"click",ba);".scratchpad"==c.title&&(this.addSelectionToScratchpad=ba);this.isOffline()||".scratchpad"!=c.title||null==EditorUi.scratchpadHelpLink||(l=this.createHelpIcon(EditorUi.scratchpadHelpLink,!0),l.className="geLibraryButton",J.insertBefore(l,J.firstChild))}t.appendChild(J);this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(c,f){for(var l=0;l<c.length;l++)try{var t=-c[l],q=t.data;if(null!=q){q="data:"==q.substring(0,5)?this.convertDataUri(q):q;var D="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==t.aspect&&(D+="aspect=fixed;");D=D+"image="+q+";";null!=t.style&&(D+=t.style);f.appendChild(this.sidebar.createVertexTemplate(D,t.w,t.h,"",t.title||"",!1,null,!0))}else if(null!=t.xml){var G=this.stringToCells("<"==t.xml.charAt(0)?t.xml:Graph.decompress(t.xml)),N=0==G.length?mxResources.get("drawingEmpty"):null!=t.title?t.title:"";-f.appendChild(this.sidebar.createVertexTemplateFromCells(G,t.w,t.h,N,!0,null,!0))}}catch(L){N=null!=L.message?mxResources.get("error")+": "+L.message:String(L),D=this.sidebar.createVertexTemplateFromCells(null,t.w,t.h,N,!0,null,!0),f.appendChild(D)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||-(Editor.configurationKey=".sketch-configuration",Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=function(c,f,l,t,q,D,G){c=new ImageDialog(this,c,f,l,t,q,D,G);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,f,l,t,q,D){var G=localStorage.getItem(f);c=new TextareaDialog(this,c,null!=G?JSON.stringify(JSON.parse(G),null,2):"",mxUtils.bind(this,function(N){if(null!=-N)try{if(null!=D&&D(N),N==G)this.hideDialog();else{if(0<N.length){var L=JSON.parse(N);localStorage.setItem(f,JSON.stringify(L))}else localStorage.removeItem(f);this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(J){this.handleError(J)}}),null,mxResources.get("close"),null,null,null,!0,null,null,q,l,t);this.showDialog(c.container,660,480,!0,!1);c.init()};EditorUi.prototype.showBackgroundImageDialog=function(c,f,l,t){c=null!=c?c:mxUtils.bind(this,function(q,D,G,N){D||(q=-new ChangePageSetup(this,t?G:null,q),q.ignoreColor=!t,null!=N&&t&&(q.shadowVisible=N),this.editor.graph.model.execute(q))});c=new BackgroundImageDialog(this,c,f,l,t);this.showDialog(c.container,400,t?240:220,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,f,l,t,q){c=new LibraryDialog(this,c,f,l,t,q);this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(D){D&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));c.init()};var g=EditorUi.prototype.createFormat;-EditorUi.prototype.createFormat=function(c){var f=g.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(l){this.editor.graph.isSelectionEmpty()&&f.refresh()}));return f};EditorUi.prototype.handleError=function(c,f,l,t,q,D,G){var N=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},L=null!=c&&null!=c.error?c.error:c;if(null!=c&&("1"==urlParams.test||null!=c.stack)&&null!=c.message)try{G||EditorUi.logError("Caught: "+(""==c.message&&-null!=c.name)?c.name:c.message,c.filename,c.lineNumber,c.columnNumber,c,"INFO"),"1"!=urlParams.test&&!G||null==window.console||console.error("EditorUi.handleError:",c)}catch(ea){}if(null!=L||null!=f){G=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var J=mxResources.get("ok"),Y=null;f=null!=f?f:mxResources.get("error");if(null!=L){null!=L.retry&&(J=mxResources.get("cancel"),Y=function(){N();L.retry()});if(404==L.code||404==L.status||403==L.code){G=403==L.code?null!=L.message?mxUtils.htmlEntities(L.message,+c[l],q=t.data;if(null!=q){q="data:"==q.substring(0,5)?this.convertDataUri(q):q;var D="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==t.aspect&&(D+="aspect=fixed;");D=D+"image="+q+";";null!=t.style&&(D+=t.style);f.appendChild(this.sidebar.createVertexTemplate(D,t.w,t.h,"",t.title||"",!1,null,!0))}else if(null!=t.xml){var H=this.stringToCells("<"==t.xml.charAt(0)?t.xml:Graph.decompress(t.xml)),N=0==H.length?mxResources.get("drawingEmpty"):null!=t.title?t.title:"";+f.appendChild(this.sidebar.createVertexTemplateFromCells(H,t.w,t.h,N,!0,null,!0))}}catch(L){N=null!=L.message?mxResources.get("error")+": "+L.message:String(L),D=this.sidebar.createVertexTemplateFromCells(null,t.w,t.h,N,!0,null,!0),f.appendChild(D)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||+(Editor.configurationKey=".sketch-configuration",Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=function(c,f,l,t,q,D,H){c=new ImageDialog(this,c,f,l,t,q,D,H);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,f,l,t,q,D){var H=localStorage.getItem(f);c=new TextareaDialog(this,c,null!=H?JSON.stringify(JSON.parse(H),null,2):"",mxUtils.bind(this,function(N){if(null!=+N)try{if(null!=D&&D(N),N==H)this.hideDialog();else{if(0<N.length){var L=JSON.parse(N);localStorage.setItem(f,JSON.stringify(L))}else localStorage.removeItem(f);this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(J){this.handleError(J)}}),null,mxResources.get("close"),null,null,null,!0,null,null,q,l,t);this.showDialog(c.container,660,480,!0,!1);c.init()};EditorUi.prototype.showBackgroundImageDialog=function(c,f,l,t){c=null!=c?c:mxUtils.bind(this,function(q,D,H,N){D||(q=+new ChangePageSetup(this,t?H:null,q),q.ignoreColor=!t,null!=N&&t&&(q.shadowVisible=N),this.editor.graph.model.execute(q))});c=new BackgroundImageDialog(this,c,f,l,t);this.showDialog(c.container,400,t?240:220,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,f,l,t,q){c=new LibraryDialog(this,c,f,l,t,q);this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(D){D&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));c.init()};var g=EditorUi.prototype.createFormat;+EditorUi.prototype.createFormat=function(c){var f=g.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(l){this.editor.graph.isSelectionEmpty()&&f.refresh()}));return f};EditorUi.prototype.handleError=function(c,f,l,t,q,D,H){var N=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},L=null!=c&&null!=c.error?c.error:c;if(null!=c&&("1"==urlParams.test||null!=c.stack)&&null!=c.message)try{H||EditorUi.logError("Caught: "+(""==c.message&&+null!=c.name)?c.name:c.message,c.filename,c.lineNumber,c.columnNumber,c,"INFO"),"1"!=urlParams.test&&!H||null==window.console||console.error("EditorUi.handleError:",c)}catch(ea){}if(null!=L||null!=f){H=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var J=mxResources.get("ok"),Y=null;f=null!=f?f:mxResources.get("error");if(null!=L){null!=L.retry&&(J=mxResources.get("cancel"),Y=function(){N();L.retry()});if(404==L.code||404==L.status||403==L.code){H=403==L.code?null!=L.message?mxUtils.htmlEntities(L.message,!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),!1):null!=q?q:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.email+")":""),!1);var ha=null!=q?null:null!=D?D:window.location.hash;if(null!=ha&&("#G"==ha.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==ha.substring(0,45))&&(null!=c&&null!=c.error&&(null!=c.error.errors&&0<c.error.errors.length&&"fileAccess"==c.error.errors[0].reason||null!=c.error.data&&-0<c.error.data.length&&"fileAccess"==c.error.data[0].reason)||404==L.code||404==L.status)){ha="#U"==ha.substring(0,2)?ha.substring(45,ha.lastIndexOf("%26ex")):ha.substring(2);this.showError(f,G,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+ha);null!=t&&t()}),Y,mxResources.get("changeUser"),mxUtils.bind(this,function(){function ea(){ba.innerText="";for(var ja=0;ja<aa.length;ja++){var ca=document.createElement("option");+0<c.error.data.length&&"fileAccess"==c.error.data[0].reason)||404==L.code||404==L.status)){ha="#U"==ha.substring(0,2)?ha.substring(45,ha.lastIndexOf("%26ex")):ha.substring(2);this.showError(f,H,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+ha);null!=t&&t()}),Y,mxResources.get("changeUser"),mxUtils.bind(this,function(){function ea(){ba.innerText="";for(var ja=0;ja<aa.length;ja++){var ca=document.createElement("option");mxUtils.write(ca,aa[ja].displayName);ca.value=ja;ba.appendChild(ca);ca=document.createElement("option");ca.innerHTML=" ";mxUtils.write(ca,"<"+aa[ja].email+">");ca.setAttribute("disabled","disabled");ba.appendChild(ca)}ca=document.createElement("option");mxUtils.write(ca,mxResources.get("addAccount"));ca.value=aa.length;ba.appendChild(ca)}var aa=this.drive.getUsersList(),na=document.createElement("div"),W=document.createElement("div");W.style.marginBottom="6px";mxUtils.write(W,mxResources.get("changeUser")+": ");na.appendChild(W);var ba=document.createElement("select");ba.style.width="100%";ea();mxEvent.addListener(ba,"change",mxUtils.bind(this,function(){var ja=ba.value,ca=aa.length!=ja;ca&&this.drive.setUser(aa[ja]);this.drive.authorize(ca,mxUtils.bind(this,function(){ca||(aa=this.drive.getUsersList(),ea())}),mxUtils.bind(this,function(la){this.handleError(la)}),!0)}));na.appendChild(ba);na=new CustomDialog(this,na,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(na.container,-300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=l&&l()}),520,150);return}}null!=L.message?G=""==L.message&&null!=L.name?mxUtils.htmlEntities(L.name,!1):mxUtils.htmlEntities(L.message,!1):null!=L.response&&null!=L.response.error?G=mxUtils.htmlEntities(L.response.error,!1):"undefined"!==typeof window.App&&(L.code==App.ERROR_TIMEOUT?G=mxUtils.htmlEntities(mxResources.get("timeout"),!1):L.code==App.ERROR_BUSY?G=mxUtils.htmlEntities(mxResources.get("busy"),-!1):"string"===typeof L&&0<L.length&&(G=mxUtils.htmlEntities(L,!1)))}q=c=null;null!=L&&null!=L.helpLink?(c=mxResources.get("help"),q=mxUtils.bind(this,function(){return this.editor.graph.openLink(L.helpLink)})):null!=L&&null!=L.ownerEmail?(c=mxResources.get("contactOwner"),G+=mxUtils.htmlEntities(" ("+c+": "+L.ownerEmail+")",!1),q=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(L.ownerEmail))})):null!=L&&null!=L.alternateAction&&(c=L.alternateAction.label,q=L.alternateAction.funct);-this.showError(f,G,J,l,Y,null,null,c,q,null,null,null,t?l:null)}else null!=l&&l()};EditorUi.prototype.alert=function(c,f,l){c=new ErrorDialog(this,null,c,mxResources.get("ok"),f);this.showDialog(c.container,l||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,f,l,t,q,D){c=null!=c?c:"";var G=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},N=Math.min(220,28*Math.ceil(Math.max(1,c.length)/50));c=new ConfirmDialog(this,c,function(){G();null!=f&&f()},function(){G();-null!=l&&l()},t,q,null,null,null,null,N);this.showDialog(c.container,340,46+N,!0,D);c.init()};EditorUi.prototype.showBanner=function(c,f,l,t,q,D,G,N,L){D=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){G=null!=G?G:"translate(-50%,120%)";N=null!=N?N:"translate(-50%,0%)";var J=q?500:1E3,Y=document.createElement("div");Y.className="geBtn gePrimaryBtn geBanner"+(q?" geSmallBanner":"");Y.style.zIndex=mxPopupMenu.prototype.zIndex;-mxUtils.setPrefixedStyle(Y.style,"transform",G);mxUtils.setPrefixedStyle(Y.style,"transition","all "+J+"ms ease");null!=L&&mxUtils.setPrefixedStyle(Y.style,"transform-origin",L);if(!q){var ha=document.createElement("img");ha.setAttribute("src",IMAGE_PATH+"/logo.png");ha.setAttribute("border","0");ha.setAttribute("align","absmiddle");ha.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;";Y.appendChild(ha);ha=document.createElement("img");ha.setAttribute("src",+300,100,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=l&&l()}),520,150);return}}null!=L.message?H=""==L.message&&null!=L.name?mxUtils.htmlEntities(L.name,!1):mxUtils.htmlEntities(L.message,!1):null!=L.response&&null!=L.response.error?H=mxUtils.htmlEntities(L.response.error,!1):"undefined"!==typeof window.App&&(L.code==App.ERROR_TIMEOUT?H=mxUtils.htmlEntities(mxResources.get("timeout"),!1):L.code==App.ERROR_BUSY?H=mxUtils.htmlEntities(mxResources.get("busy"),+!1):"string"===typeof L&&0<L.length&&(H=mxUtils.htmlEntities(L,!1)))}q=c=null;null!=L&&null!=L.helpLink?(c=mxResources.get("help"),q=mxUtils.bind(this,function(){return this.editor.graph.openLink(L.helpLink)})):null!=L&&null!=L.ownerEmail?(c=mxResources.get("contactOwner"),H+=mxUtils.htmlEntities(" ("+c+": "+L.ownerEmail+")",!1),q=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(L.ownerEmail))})):null!=L&&null!=L.alternateAction&&(c=L.alternateAction.label,q=L.alternateAction.funct);+this.showError(f,H,J,l,Y,null,null,c,q,null,null,null,t?l:null)}else null!=l&&l()};EditorUi.prototype.alert=function(c,f,l){c=new ErrorDialog(this,null,c,mxResources.get("ok"),f);this.showDialog(c.container,l||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,f,l,t,q,D){c=null!=c?c:"";var H=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},N=Math.min(220,28*Math.ceil(Math.max(1,c.length)/50));c=new ConfirmDialog(this,c,function(){H();null!=f&&f()},function(){H();+null!=l&&l()},t,q,null,null,null,null,N);this.showDialog(c.container,340,46+N,!0,D);c.init()};EditorUi.prototype.showBanner=function(c,f,l,t,q,D,H,N,L){D=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){H=null!=H?H:"translate(-50%,120%)";N=null!=N?N:"translate(-50%,0%)";var J=q?500:1E3,Y=document.createElement("div");Y.className="geBtn gePrimaryBtn geBanner"+(q?" geSmallBanner":"");Y.style.zIndex=mxPopupMenu.prototype.zIndex;+mxUtils.setPrefixedStyle(Y.style,"transform",H);mxUtils.setPrefixedStyle(Y.style,"transition","all "+J+"ms ease");null!=L&&mxUtils.setPrefixedStyle(Y.style,"transform-origin",L);if(!q){var ha=document.createElement("img");ha.setAttribute("src",IMAGE_PATH+"/logo.png");ha.setAttribute("border","0");ha.setAttribute("align","absmiddle");ha.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;";Y.appendChild(ha);ha=document.createElement("img");ha.setAttribute("src",Dialog.prototype.closeImage);ha.setAttribute("title",mxResources.get(t?"doNotShowAgain":"close"));ha.setAttribute("border","0");ha.style.cssText=(q?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;";Y.appendChild(ha)}mxUtils.write(Y,f);document.body.appendChild(Y);this.bannerShowing=!0;f=document.createElement("div");f.style.cssText="display:flex;align-items:center;justify-content:center;padding-top:6px;font-size:11px;text-align:center;font-weight:normal;";var ea=document.createElement("input");ea.setAttribute("type","checkbox");ea.setAttribute("id","geDoNotShowAgainCheckbox");ea.style.marginRight="6px";if(!t){f.appendChild(ea);var aa=document.createElement("label");aa.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(aa,mxResources.get("doNotShowAgain"));f.appendChild(aa);Y.style.paddingBottom=q?"16px":"30px";Y.appendChild(f)}var na=mxUtils.bind(this,function(){null!=Y.parentNode&&(Y.parentNode.removeChild(Y),this.bannerShowing=!1,ea.checked||-t)&&(this["hideBanner"+c]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings["close"+c]=Date.now(),mxSettings.save()))});null!=ha&&mxEvent.addListener(ha,"click",mxUtils.bind(this,function(ba){mxEvent.consume(ba);na()}));var W=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(Y.style,"transform",G);window.setTimeout(mxUtils.bind(this,function(){na()}),J)});mxEvent.addListener(Y,"click",mxUtils.bind(this,function(ba){var ja=mxEvent.getSource(ba);ja!=ea&&ja!=aa?(null!=l&&l(),na(),+t)&&(this["hideBanner"+c]=!0,isLocalStorage&&null!=mxSettings.settings&&(mxSettings.settings["close"+c]=Date.now(),mxSettings.save()))});null!=ha&&mxEvent.addListener(ha,"click",mxUtils.bind(this,function(ba){mxEvent.consume(ba);na()}));var W=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(Y.style,"transform",H);window.setTimeout(mxUtils.bind(this,function(){na()}),J)});mxEvent.addListener(Y,"click",mxUtils.bind(this,function(ba){var ja=mxEvent.getSource(ba);ja!=ea&&ja!=aa?(null!=l&&l(),na(),mxEvent.consume(ba)):W()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(Y.style,"transform",N)}),J/2);window.setTimeout(W,q?4E3:3E4);D=!0}return D};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=c};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=function(){return this.editor.isExportToCanvas()};EditorUi.prototype.createImageDataUri=function(c,f,l,t){c=c.toDataURL("image/"+l);if(null!=c&&6<c.length)null!=f&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(f))),0<t&&(c=Editor.writeGraphModelToPng(c,"pHYs","dpi",t));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=function(c,f,l,t,q){var D="jpeg"==l?"jpg":l;t=this.getBaseFilename(t)+(null!=f?".drawio":"")+"."+D;c=this.createImageDataUri(c,f,l,q);this.saveData(t,D,c.substring(c.lastIndexOf(",")+1),"image/"+l,!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||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(c,f){c=new TextareaDialog(this,c,f,null,null,mxResources.get("close"));this.showDialog(c.container,620,460,!0,!0,null,null,null,null,!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(c,f,l,t,q,D){"text/xml"!=l||/(\.drawio)$/i.test(f)||/(\.xml)$/i.test(f)||/(\.svg)$/i.test(f)||/(\.html)$/i.test(f)||(f=f+"."+(null!=D?D:"drawio"));if(window.Blob&&navigator.msSaveOrOpenBlob)c=t?this.base64ToBlob(c,l):new Blob([c],{type:l}),navigator.msSaveOrOpenBlob(c,f);else if(mxClient.IS_IE)l=window.open("about:blank","_blank"),null==l?mxUtils.popup(c,!0):(l.document.write(c),l.document.close(),l.document.execCommand("SaveAs",!0,f),l.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||-null==l||"image/"!=l.substring(0,6)?this.showTextDialog(f+":",c):this.openInNewWindow(c,l,t);else{var G=document.createElement("a");D=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof G.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var N=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);D=65==(N?parseInt(N[2],10):!1)?!1:D}if(D||this.isOffline()){G.href=URL.createObjectURL(t?this.base64ToBlob(c,l):new Blob([c],{type:l}));D?G.download=f:G.setAttribute("target",-"_blank");document.body.appendChild(G);try{window.setTimeout(function(){URL.revokeObjectURL(G.href)},2E4),G.click(),G.parentNode.removeChild(G)}catch(L){}}else this.createEchoRequest(c,f,l,t,q).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,f,l,t,q,D){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,c+(null!=l?"&mime="+l:"")+(null!=q?"&format="+q:"")+(null!=D?"&base64="+D:"")+(null!=f?"&filename="+encodeURIComponent(f):"")+(t?"&binary=1":""))};EditorUi.prototype.saveLocalFile=-function(c,f,l,t,q,D,G,N){D=null!=D?D:!1;G=null!=G?G:"vsdx"!=q&&(!mxClient.IS_IOS||!navigator.standalone);var L=mxUtils.bind(this,function(Y,ha,ea,aa){try{if("_blank"==ha)if(null!=l&&"image/"==l.substring(0,6))this.openInNewWindow(c,l,t);else if(null!=l&&"text/html"==l.substring(0,9)){var na=new EmbedDialog(this,c);this.showDialog(na.container,450,240,!0,!0);na.init()}else{var W=window.open("about:blank");null==W?mxUtils.popup(c,!0):(W.document.write("<pre>"+mxUtils.htmlEntities(c,!1)+"</pre>"),W.document.close())}else if(ha==-App.MODE_DEVICE||"download"==ha)this.doSaveLocalFile(c,Y,l,t,null,N);else if(null!=Y&&0<Y.length){var ba=mxUtils.bind(this,function(ja){try{this.exportFile(c,Y,l,t,ha,ja)}catch(ca){this.handleError(ca)}});null!=aa?ba(aa):this.pickFolder(ha,ba)}}catch(ja){this.handleError(ja)}});q=[];D||q.push(App.MODE_BROWSER);G||q.push("_blank");var J=new SaveDialog(this,f,mxUtils.bind(this,function(Y,ha,ea){L(Y.value,ha,Y,ea);this.hideDialog(null,null,J.container)}),q,c,l,t);this.showDialog(J.container,420,110,+null==l||"image/"!=l.substring(0,6)?this.showTextDialog(f+":",c):this.openInNewWindow(c,l,t);else{var H=document.createElement("a");D=(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof H.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var N=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);D=65==(N?parseInt(N[2],10):!1)?!1:D}if(D||this.isOffline()){H.href=URL.createObjectURL(t?this.base64ToBlob(c,l):new Blob([c],{type:l}));D?H.download=f:H.setAttribute("target",+"_blank");document.body.appendChild(H);try{window.setTimeout(function(){URL.revokeObjectURL(H.href)},2E4),H.click(),H.parentNode.removeChild(H)}catch(L){}}else this.createEchoRequest(c,f,l,t,q).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,f,l,t,q,D){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,c+(null!=l?"&mime="+l:"")+(null!=q?"&format="+q:"")+(null!=D?"&base64="+D:"")+(null!=f?"&filename="+encodeURIComponent(f):"")+(t?"&binary=1":""))};EditorUi.prototype.saveLocalFile=+function(c,f,l,t,q,D,H,N){D=null!=D?D:!1;H=null!=H?H:"vsdx"!=q&&(!mxClient.IS_IOS||!navigator.standalone);var L=mxUtils.bind(this,function(Y,ha,ea,aa){try{if("_blank"==ha)if(null!=l&&"image/"==l.substring(0,6))this.openInNewWindow(c,l,t);else if(null!=l&&"text/html"==l.substring(0,9)){var na=new EmbedDialog(this,c);this.showDialog(na.container,450,240,!0,!0);na.init()}else{var W=window.open("about:blank");null==W?mxUtils.popup(c,!0):(W.document.write("<pre>"+mxUtils.htmlEntities(c,!1)+"</pre>"),W.document.close())}else if(ha==+App.MODE_DEVICE||"download"==ha)this.doSaveLocalFile(c,Y,l,t,null,N);else if(null!=Y&&0<Y.length){var ba=mxUtils.bind(this,function(ja){try{this.exportFile(c,Y,l,t,ha,ja)}catch(ca){this.handleError(ca)}});null!=aa?ba(aa):this.pickFolder(ha,ba)}}catch(ja){this.handleError(ja)}});q=[];D||q.push(App.MODE_BROWSER);H||q.push("_blank");var J=new SaveDialog(this,f,mxUtils.bind(this,function(Y,ha,ea){L(Y.value,ha,Y,ea);this.hideDialog(null,null,J.container)}),q,c,l,t);this.showDialog(J.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));J.init()};EditorUi.prototype.openInNewWindow=function(c,f,l){var t=window.open("about:blank");if(null==t||null==t.document)mxUtils.popup(c,!0);else{var q="background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==f){var D=mxUtils.parseXml(c).documentElement.style.backgroundColor;""!=D&&(q="background: "+D+";")}q='<html><head><meta charset="UTF-8"></head><body style="color-scheme: light dark; '+q+'">';"image/svg+xml"!=f||mxClient.IS_SVG?"image/svg+xml"!=f||l?(D=l?c:btoa(unescape(encodeURIComponent(c))),t.document.write(q+'<img style="max-width:100%;" src="data:'+f+";base64,"+D+'"/></body></html>')):t.document.write(q+c+"</body></html>"):t.document.write(q+"<pre>"+mxUtils.htmlEntities(c,!1)+"</pre></body></html>");t.document.close()}};var m=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.isChromelessImageExportEnabled=function(){return"draw.io"!=this.getServiceName()||/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)};EditorUi.prototype.addChromelessToolbarItems=function(c){if(null!=urlParams.tags){this.tagsDialog=this.tagsComponent=null;var f=c(mxUtils.bind(this,function(t){null==this.tagsComponent&&(this.tagsComponent=this.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return null!=this.tagsDialog}),!0),this.tagsComponent.div.getElementsByTagName("div")[0].style.position="",mxUtils.setPrefixedStyle(this.tagsComponent.div.style,"borderRadius","5px"),@@ -3608,130 +3610,130 @@ q.zIndex;document.body.appendChild(this.tagsDialog);this.tagsComponent.refresh()this.layersDialog=null)}));this.editor.addListener("layersDialogShown",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));this.editor.addListener("pageSelected",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null);null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));mxEvent.addListener(this.editor.graph.container,"click",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null);null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));if(this.isExportToCanvas()&&this.isChromelessImageExportEnabled()){this.exportDialog=null;var l=c(mxUtils.bind(this,function(t){var q=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",q);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)q.apply(this);else{this.exportDialog=document.createElement("div");var D=l.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily=Editor.defaultHtmlFont;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,80);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 G=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"light-dark(#000000, #C0C0C0)",-speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});G.spin(this.exportDialog);document.body.appendChild(this.exportDialog);mxEvent.addListener(this.editor.graph.container,"click",q);this.editor.exportToCanvas(mxUtils.bind(this,function(N){G.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var L=this.createImageDataUri(N,null,"png");N=document.createElement("img");N.style.maxWidth="140px";N.style.maxHeight="140px";-N.style.cursor="pointer";N.style.backgroundColor="white";N.setAttribute("title",mxResources.get("openInNewWindow"));N.setAttribute("border","0");N.setAttribute("src",L);this.exportDialog.appendChild(N);mxEvent.addListener(N,"click",mxUtils.bind(this,function(){this.openInNewWindow(L.substring(L.indexOf(",")+1),"image/png",!0);q.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(N){G.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),-this.exportDialog=null);this.handleError(N)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(t)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,f,l,t,q){this.isLocalFileSave()?this.saveLocalFile(l,c,t,q,f):this.saveRequest(c,f,mxUtils.bind(this,function(D,G){return this.createEchoRequest(l,D,t,q,f,G)}),l,q,t)};EditorUi.prototype.saveRequest=function(c,f,l,t,q,D,G){G=null!=G?G:!mxClient.IS_IOS||!navigator.standalone;var N=mxUtils.bind(this,+"50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,80);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 H=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"light-dark(#000000, #C0C0C0)",+speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});H.spin(this.exportDialog);document.body.appendChild(this.exportDialog);mxEvent.addListener(this.editor.graph.container,"click",q);this.editor.exportToCanvas(mxUtils.bind(this,function(N){H.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var L=this.createImageDataUri(N,null,"png");N=document.createElement("img");N.style.maxWidth="140px";N.style.maxHeight="140px";+N.style.cursor="pointer";N.style.backgroundColor="white";N.setAttribute("title",mxResources.get("openInNewWindow"));N.setAttribute("border","0");N.setAttribute("src",L);this.exportDialog.appendChild(N);mxEvent.addListener(N,"click",mxUtils.bind(this,function(){this.openInNewWindow(L.substring(L.indexOf(",")+1),"image/png",!0);q.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(N){H.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),+this.exportDialog=null);this.handleError(N)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(t)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,f,l,t,q){this.isLocalFileSave()?this.saveLocalFile(l,c,t,q,f):this.saveRequest(c,f,mxUtils.bind(this,function(D,H){return this.createEchoRequest(l,D,t,q,f,H)}),l,q,t)};EditorUi.prototype.saveRequest=function(c,f,l,t,q,D,H){H=null!=H?H:!mxClient.IS_IOS||!navigator.standalone;var N=mxUtils.bind(this,function(J,Y,ha,ea){if("_blank"==Y||null!=J&&0<J.length){var aa=l("_blank"==Y?null:J,Y==App.MODE_DEVICE||"download"==Y||null==Y||"_blank"==Y?"0":"1");null!=aa&&(Y==App.MODE_DEVICE||"download"==Y||"_blank"==Y?aa.simulate(document,"_blank"):(ha=mxUtils.bind(this,function(na){D=null!=D?D:"pdf"==f?"application/pdf":"image/"+f;if(null!=t)try{this.exportFile(t,J,D,!0,Y,na)}catch(W){this.handleError(W)}else this.spinner.spin(document.body,mxResources.get("saving"))&&aa.send(mxUtils.bind(this,function(){this.spinner.stop();-if(200<=aa.getStatus()&&299>=aa.getStatus())try{this.exportFile(aa.getText(),J,D,!0,Y,na)}catch(W){this.handleError(W)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(W){this.spinner.stop();this.handleError(W)}))}),null!=ea?ha(ea):this.pickFolder(Y,ha)))}});q=[App.MODE_BROWSER];G||q.push("_blank");var L=new SaveDialog(this,c,mxUtils.bind(this,function(J,Y,ha){N(J.value,Y,J,ha);this.hideDialog(null,null,L.container)}),q,null,"application/pdf");this.showDialog(L.container,+if(200<=aa.getStatus()&&299>=aa.getStatus())try{this.exportFile(aa.getText(),J,D,!0,Y,na)}catch(W){this.handleError(W)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(W){this.spinner.stop();this.handleError(W)}))}),null!=ea?ha(ea):this.pickFolder(Y,ha)))}});q=[App.MODE_BROWSER];H||q.push("_blank");var L=new SaveDialog(this,c,mxUtils.bind(this,function(J,Y,ha){N(J.value,Y,J,ha);this.hideDialog(null,null,L.container)}),q,null,"application/pdf");this.showDialog(L.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));L.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,f,l,t,q,D){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,f,l){f(null)};EditorUi.prototype.exportSvg=function(c,f,l,t,q,D,-G,N,L,J,Y,ha,ea,aa){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(P){Editor.addRetryToError(P,mxUtils.bind(this,function(){this.exportSvg(c,f,l,t,q,D,G,N,L,J,Y,ha,ea,aa)}));this.handleError(P)})))try{var na=this.editor.graph.isSelectionEmpty();l=null!=l?l:na;var W=f?null:this.editor.graph.background;W==mxConstants.NONE&&(W=null);null==W&&0==f&&(W=this.editor.graph.shapeBackgroundColor);var ba=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&-(this.editor.graph.addForeignObjectWarning=function(){});var ja=mxUtils.lightDarkColorSupported,ca=mxUtils.preferDarkColor;if("light"==Y||"dark"==Y)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==Y;var la=this.editor.graph.createSvgImageExport(q),Q=this.editor.graph.getSvg(W,c,G,N,null,l,null,la,"blank"==J?"_blank":"self"==J?"_top":null,null,!ea,Y,ha);mxUtils.lightDarkColorSupported=ja;mxUtils.preferDarkColor=ca;this.editor.graph.addForeignObjectWarning=ba;t&&this.editor.graph.addSvgShadow(Q);-var k=this.getBaseFilename()+(q?".drawio":"")+".svg";aa=null!=aa?aa:mxUtils.bind(this,function(P){this.isLocalFileSave()||P.length<=MAX_REQUEST_SIZE?this.saveData(k,"svg",P,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(P)}))});var B=mxUtils.bind(this,function(P){this.spinner.stop();q&&P.setAttribute("content",this.getFileData(!0,null,null,null,l,L,null,null,null,null,null,c,G));aa(Graph.xmlDeclaration++H,N,L,J,Y,ha,ea,aa){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(P){Editor.addRetryToError(P,mxUtils.bind(this,function(){this.exportSvg(c,f,l,t,q,D,H,N,L,J,Y,ha,ea,aa)}));this.handleError(P)})))try{var na=this.editor.graph.isSelectionEmpty();l=null!=l?l:na;var W=f?null:this.editor.graph.background;W==mxConstants.NONE&&(W=null);null==W&&0==f&&(W=this.editor.graph.shapeBackgroundColor);var ba=this.editor.graph.addForeignObjectWarning;Editor.foreignObjectImages&&+(this.editor.graph.addForeignObjectWarning=function(){});var ja=mxUtils.lightDarkColorSupported,ca=mxUtils.preferDarkColor;if("light"==Y||"dark"==Y)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==Y;var la=this.editor.graph.createSvgImageExport(q),Q=this.editor.graph.getSvg(W,c,H,N,null,l,null,la,"blank"==J?"_blank":"self"==J?"_top":null,null,!ea,Y,ha);mxUtils.lightDarkColorSupported=ja;mxUtils.preferDarkColor=ca;this.editor.graph.addForeignObjectWarning=ba;t&&this.editor.graph.addSvgShadow(Q);+var k=this.getBaseFilename()+(q?".drawio":"")+".svg";aa=null!=aa?aa:mxUtils.bind(this,function(P){this.isLocalFileSave()||P.length<=MAX_REQUEST_SIZE?this.saveData(k,"svg",P,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(P)}))});var B=mxUtils.bind(this,function(P){this.spinner.stop();q&&P.setAttribute("content",this.getFileData(!0,null,null,null,l,L,null,null,null,null,null,c,H));aa(Graph.xmlDeclaration+"\n"+(q?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(P))});this.editor.graph.mathEnabled&&this.editor.addMathCss(Q);var I=mxUtils.bind(this,function(P){Editor.replaceSvgDataUris&&D&&EditorUi.embedSvgImages(P);Editor.foreignObjectImages&&ea?this.replaceAlternateContent(P,Y,B):B(P)}),U=mxUtils.bind(this,function(P){D&&!this.isOffline()&&this.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(P,I,this.thumbImageCache)):I(P)});ea?this.embedFonts(Q,-U):(this.editor.addFontCss(Q),U(Q))}catch(P){this.handleError(P)}};EditorUi.prototype.replaceAlternateContent=function(c,f,l){function t(ha,ea,aa,na,W){var ba=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");ba.setAttribute("x",ea);ba.setAttribute("y",aa+.5);ba.setAttribute("width",na.width);ba.setAttribute("height",na.height);null==ba.setAttributeNS?ba.setAttribute("xlink:href",W):ba.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",W);ha.replaceChild(ba,ha.lastChild);N()}function q(){if(G<-Y.length)Y[G++](q)}var D="";f=c.getElementsByTagName("style");for(var G=0;G<f.length;G++)D+=f[G].innerHTML;f=c.getElementsByTagName("switch");counter=f.length;var N=mxUtils.bind(this,function(){counter--;0==counter&&l(c)}),L={},J={},Y=[];for(G=0;G<f.length;G++)mxUtils.bind(this,function(ha){var ea=ha.getElementsByTagName("div");if(0<ea.length)try{var aa=ea[0].cloneNode(!0),na=parseInt(aa.style.marginLeft),W=parseInt(aa.style.paddingTop),ba=aa.getElementsByTagName("div")[1],ja=ea=!1,ca=aa.style.alignItems,+U):(this.editor.addFontCss(Q),U(Q))}catch(P){this.handleError(P)}};EditorUi.prototype.replaceAlternateContent=function(c,f,l){function t(ha,ea,aa,na,W){var ba=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");ba.setAttribute("x",ea);ba.setAttribute("y",aa+.5);ba.setAttribute("width",na.width);ba.setAttribute("height",na.height);null==ba.setAttributeNS?ba.setAttribute("xlink:href",W):ba.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",W);ha.replaceChild(ba,ha.lastChild);N()}function q(){if(H<+Y.length)Y[H++](q)}var D="";f=c.getElementsByTagName("style");for(var H=0;H<f.length;H++)D+=f[H].innerHTML;f=c.getElementsByTagName("switch");counter=f.length;var N=mxUtils.bind(this,function(){counter--;0==counter&&l(c)}),L={},J={},Y=[];for(H=0;H<f.length;H++)mxUtils.bind(this,function(ha){var ea=ha.getElementsByTagName("div");if(0<ea.length)try{var aa=ea[0].cloneNode(!0),na=parseInt(aa.style.marginLeft),W=parseInt(aa.style.paddingTop),ba=aa.getElementsByTagName("div")[1],ja=ea=!1,ca=aa.style.alignItems,la=aa.style.justifyContent;if(null!=aa.style.writingMode){var Q=aa.style.writingMode;ja="vertical-"==Q.substring(0,9);ea="-rl"==Q.substring(Q.length-3)}var k=!ja&&"1px"==aa.style.width||ja&&"1px"==aa.style.height;if(!ja&&"1px"==aa.style.height||ja&&"1px"==aa.style.width)aa.style.alignItems=ja&&ea?"unsafe flex-end":"unsafe flex-start";k&&(aa.style.justifyContent="unsafe flex-start");aa.style.paddingTop="";aa.style.marginLeft="";var B=aa.outerHTML,I=L[B];null==I&&(aa.style.position="absolute",aa.style.visibility="hidden",document.body.appendChild(aa),Q=1,Q="1px"==aa.style.width?ba.offsetWidth:parseInt(aa.style.width),k=1,k="1px"==aa.style.height?ba.offsetHeight:parseInt(aa.style.height),document.body.removeChild(aa),I=new mxRectangle(na,W,Q,k),L[B]=I);"1px"==aa.style.height&&("unsafe center"==ca?W-=I.height/2:"unsafe flex-end"==ca&&(W-=I.height));if("1px"==aa.style.width)if(!ja&&"unsafe center"==la||ja&&"unsafe center"==ca)na-=I.width/2;else if(!ja&&"unsafe flex-end"==la||ja&&(!ea&&"unsafe flex-end"==ca||-ea&&"unsafe flex-start"==ca))na-=I.width;I=new mxRectangle(na,W,I.width,I.height+parseInt(ba.style.fontSize)/4);Y.push(mxUtils.bind(this,function(U){var P=J[B];null==P?Graph.htmlToPng(B,I.width,I.height,mxUtils.bind(this,function(T){t(ha,na,W,I,T);J[B]=T;U()}),D):(t(ha,na,W,I,P),U())}))}catch(U){N()}else N()})(f[G]);0==counter&&l(c);G=0;q()};EditorUi.prototype.addRadiobox=function(c,f,l,t,q,D,G){return this.addCheckbox(c,l,t,q,D,G,!0,f)};EditorUi.prototype.addCheckbox=function(c,f,l,t,q,D,G,N){D=-null!=D?D:!0;var L=document.createElement("input");L.style.marginRight="8px";L.style.marginTop="16px";L.setAttribute("type",G?"radio":"checkbox");G="geCheckbox-"+Editor.guid();L.id=G;null!=N&&L.setAttribute("name",N);l&&(L.setAttribute("checked","checked"),L.defaultChecked=!0);t&&L.setAttribute("disabled","disabled");D&&(c.appendChild(L),l=document.createElement("label"),mxUtils.write(l,f),l.setAttribute("for",G),c.appendChild(l),q||mxUtils.br(c));return L};EditorUi.prototype.addEditButton=function(c,+ea&&"unsafe flex-start"==ca))na-=I.width;I=new mxRectangle(na,W,I.width,I.height+parseInt(ba.style.fontSize)/4);Y.push(mxUtils.bind(this,function(U){var P=J[B];null==P?Graph.htmlToPng(B,I.width,I.height,mxUtils.bind(this,function(T){t(ha,na,W,I,T);J[B]=T;U()}),D):(t(ha,na,W,I,P),U())}))}catch(U){N()}else N()})(f[H]);0==counter&&l(c);H=0;q()};EditorUi.prototype.addRadiobox=function(c,f,l,t,q,D,H){return this.addCheckbox(c,l,t,q,D,H,!0,f)};EditorUi.prototype.addCheckbox=function(c,f,l,t,q,D,H,N){D=+null!=D?D:!0;var L=document.createElement("input");L.style.marginRight="8px";L.style.marginTop="16px";L.setAttribute("type",H?"radio":"checkbox");H="geCheckbox-"+Editor.guid();L.id=H;null!=N&&L.setAttribute("name",N);l&&(L.setAttribute("checked","checked"),L.defaultChecked=!0);t&&L.setAttribute("disabled","disabled");D&&(c.appendChild(L),l=document.createElement("label"),mxUtils.write(l,f),l.setAttribute("for",H),c.appendChild(l),q||mxUtils.br(c));return L};EditorUi.prototype.addEditButton=function(c,f){var l=this.addCheckbox(c,mxResources.get("edit")+":",!0,null,!0);l.style.marginLeft="24px";var t=this.getCurrentFile(),q="";null!=t&&t.getMode()!=App.MODE_DEVICE&&t.getMode()!=App.MODE_BROWSER&&(q=window.location.href);var D=document.createElement("select");D.style.maxWidth="200px";D.style.width="auto";D.style.marginLeft="8px";D.style.marginRight="10px";D.className="geBtn";t=document.createElement("option");t.setAttribute("value","blank");mxUtils.write(t,mxResources.get("makeCopy"));D.appendChild(t);-var G=document.createElement("option");G.setAttribute("value","custom");mxUtils.write(G,mxResources.get("custom")+"...");D.appendChild(G);c.appendChild(D);mxEvent.addListener(D,"change",mxUtils.bind(this,function(){if("custom"==D.value){var N=new FilenameDialog(this,q,mxResources.get("ok"),function(L){null!=L?(q=L,G.setAttribute("title",L)):(D.value="blank",G.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){D.value="blank"});this.showDialog(N.container,300,80,!0,!1);+var H=document.createElement("option");H.setAttribute("value","custom");mxUtils.write(H,mxResources.get("custom")+"...");D.appendChild(H);c.appendChild(D);mxEvent.addListener(D,"change",mxUtils.bind(this,function(){if("custom"==D.value){var N=new FilenameDialog(this,q,mxResources.get("ok"),function(L){null!=L?(q=L,H.setAttribute("title",L)):(D.value="blank",H.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){D.value="blank"});this.showDialog(N.container,300,80,!0,!1);N.init()}}));mxEvent.addListener(l,"change",mxUtils.bind(this,function(){l.checked&&(null==f||f.checked)?D.removeAttribute("disabled"):D.setAttribute("disabled","disabled")}));mxUtils.br(c);return{getLink:function(){return l.checked?"blank"===D.value?"_blank":q:null},getEditInput:function(){return l},getEditSelect:function(){return D}}};EditorUi.prototype.addLinkSection=function(c,f){function l(){var N=document.createElement("div");N.style.width="100%";N.style.height="100%";N.style.boxSizing="border-box";-null!=D&&D!=mxConstants.NONE?(N.style.border="1px solid black",N.style.backgroundColor=D):(N.style.backgroundPosition="center center",N.style.backgroundRepeat="no-repeat",N.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')");G.innerText="";G.appendChild(N)}mxUtils.write(c,mxResources.get("links")+":");var t=document.createElement("select");t.style.width="100px";t.style.padding="0px";t.style.marginLeft="8px";t.style.marginRight="10px";t.className="geBtn";var q=document.createElement("option");+null!=D&&D!=mxConstants.NONE?(N.style.border="1px solid black",N.style.backgroundColor=D):(N.style.backgroundPosition="center center",N.style.backgroundRepeat="no-repeat",N.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')");H.innerText="";H.appendChild(N)}mxUtils.write(c,mxResources.get("links")+":");var t=document.createElement("select");t.style.width="100px";t.style.padding="0px";t.style.marginLeft="8px";t.style.marginRight="10px";t.className="geBtn";var q=document.createElement("option");q.setAttribute("value","auto");mxUtils.write(q,mxResources.get("automatic"));t.appendChild(q);q=document.createElement("option");q.setAttribute("value","blank");mxUtils.write(q,mxResources.get("openInNewWindow"));t.appendChild(q);q=document.createElement("option");q.setAttribute("value","self");mxUtils.write(q,mxResources.get("openInThisWindow"));t.appendChild(q);f&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+-")"),t.appendChild(f));c.appendChild(t);mxUtils.write(c,mxResources.get("borderColor")+":");var D="#0000ff",G=null;G=mxUtils.button("",mxUtils.bind(this,function(N){this.pickColor(D||"none",function(L){D=L;l()});mxEvent.consume(N)}));l();G.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";G.style.marginLeft="4px";G.style.height="22px";G.style.width="22px";G.style.position="relative";G.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";G.className="geColorBtn";c.appendChild(G);+")"),t.appendChild(f));c.appendChild(t);mxUtils.write(c,mxResources.get("borderColor")+":");var D="#0000ff",H=null;H=mxUtils.button("",mxUtils.bind(this,function(N){this.pickColor(D||"none",function(L){D=L;l()});mxEvent.consume(N)}));l();H.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";H.style.marginLeft="4px";H.style.height="22px";H.style.width="22px";H.style.position="relative";H.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";H.className="geColorBtn";c.appendChild(H);mxUtils.br(c);return{getColor:function(){return D},getTarget:function(){return t.value},focus:function(){t.focus()}}};EditorUi.prototype.createUrlParameters=function(c,f,l,t,q,D){D=null!=D?D:[];l&&(D.push("lightbox=1"),"auto"!=c&&D.push("target="+c),null!=f&&f!=mxConstants.NONE&&D.push("highlight="+("#"==f.charAt(0)?f.substring(1):f)),null!=t&&0<t.length&&D.push("edit="+encodeURIComponent(t)),q&&D.push("layers=1"),this.editor.graph.foldingEnabled&&D.push("nav=1"));return D};EditorUi.prototype.createLink=-function(c,f,l,t,q,D,G,N,L,J,Y,ha,ea){var aa=this.getCurrentFile();L=this.createUrlParameters(c,f,t,q,D,L);c=!0;null!=G?l="#U"+encodeURIComponent(G):N||null==aa||""==aa.getHash()?l="#R"+encodeURIComponent(l?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(l="#"+aa.getHash(),c=!1);c&&null!=aa&&null!=aa.getTitle()&&aa.getTitle()!=this.defaultFilename&&L.push("title="+encodeURIComponent(aa.getTitle()));J&&1<l.length&&(L.push("open="+-l.substring(1)),l="");Y&&null!=this.currentPage&&L.push("page-id="+this.currentPage.getId());ha&&L.push("transparent=1");null!=ea&&L.push("dark="+ea);return(t&&(null!=G||null!=aa&&aa.getMode()!=App.MODE_GITHUB&&aa.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<L.length?"?"+L.join("&"):"")+l};EditorUi.prototype.createHtml=function(c,f,l,t,q,D,G,-N,L,J,Y,ha,ea){this.getBasenames();var aa={};""!=q&&q!=mxConstants.NONE&&(aa.highlight=q);"auto"!==t&&(aa.target=t);J||(aa.lightbox=!1);aa.nav=this.editor.graph.foldingEnabled;l=parseInt(l);isNaN(l)||100==l||(aa.zoom=l/100);l=[];G&&(l.push("pages"),aa.resize=!0,null!=this.pages&&null!=this.currentPage&&(aa.page=mxUtils.indexOf(this.pages,this.currentPage)));f&&(l.push("zoom"),aa.resize=!0);N&&l.push("layers");L&&l.push("tags");null!=ea&&(aa["dark-mode"]=ea);0<l.length&&(J&&l.push("lightbox"),aa.toolbar=-l.join(" "));null!=Y&&0<Y.length&&(aa.edit=Y);null!=c?aa.url=c:aa.xml=this.getFileData(!0,null,null,null,null,!G);f='<div class="mxgraph" style="'+(D?"max-width:100%;":"")+(""!=l?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(aa))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";ha(f,'<script type="text/javascript" src="'+(0<c.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+c:"1"==urlParams.dev?-"https://test.draw.io/js/viewer-static.min.js":window.DRAWIO_VIEWER_URL?window.DRAWIO_VIEWER_URL:EditorUi.lightboxHost+"/js/viewer-static.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(c,f,l,t){var q=document.createElement("div");q.style.whiteSpace="nowrap";var D=document.createElement("h3");mxUtils.write(D,mxResources.get("html"));D.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";q.appendChild(D);var G=document.createElement("div");G.style.cssText=-"border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var N=document.createElement("input");N.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";N.setAttribute("value","url");N.setAttribute("type","radio");N.setAttribute("name","type-embedhtmldialog");D=N.cloneNode(!0);D.setAttribute("value","copy");G.appendChild(D);var L=document.createElement("span");mxUtils.write(L,mxResources.get("includeCopyOfMyDiagram"));G.appendChild(L);mxUtils.br(G);G.appendChild(N);L=-document.createElement("span");mxUtils.write(L,mxResources.get("publicDiagramUrl"));G.appendChild(L);var J=this.getCurrentFile();null==l&&null!=J&&J.constructor==window.DriveFile&&(L=document.createElement("a"),L.style.paddingLeft="12px",L.style.color="gray",L.style.cursor="pointer",mxUtils.write(L,mxResources.get("share")),G.appendChild(L),mxEvent.addListener(L,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(J.getId(),J)})));D.setAttribute("checked","checked");null==-l&&N.setAttribute("disabled","disabled");q.appendChild(G);G=380;var Y=this.addLinkSection(q),ha=document.createElement("select");ha.style.maxWidth="260px";ha.style.marginLeft="8px";ha.style.marginTop="16px";L=document.createElement("option");L.setAttribute("value","light");mxUtils.write(L,mxResources.get("light"));ha.appendChild(L);L=document.createElement("option");L.setAttribute("value","dark");mxUtils.write(L,mxResources.get("dark"));ha.appendChild(L);L=document.createElement("option");L.setAttribute("value",-"auto");mxUtils.write(L,mxResources.get("automatic"));L.setAttribute("selected","selected");ha.appendChild(L);L.setAttribute("selected","selected");mxUtils.write(q,mxResources.get("appearance")+":");q.appendChild(ha);mxUtils.br(q);G+=26;var ea=this.addCheckbox(q,mxResources.get("zoom"),!0,null,!0);mxUtils.write(q,":");var aa=document.createElement("input");aa.setAttribute("type","text");aa.style.marginRight="16px";aa.style.width="60px";aa.style.marginLeft="4px";aa.style.marginRight="12px";aa.value=-"100%";q.appendChild(aa);var na=this.addCheckbox(q,mxResources.get("fit"),!0);L=null!=this.pages&&1<this.pages.length;var W=W=this.addCheckbox(q,mxResources.get("allPages"),L,!L),ba=this.addCheckbox(q,mxResources.get("layers"),!0),ja=this.addCheckbox(q,mxResources.get("tags"),!0),ca=this.addCheckbox(q,mxResources.get("lightbox"),!0),la=null;if(EditorUi.enableHtmlEditOption){la=this.addEditButton(q,ca);var Q=la.getEditInput();Q.style.marginBottom="16px";G+=50;mxEvent.addListener(ca,"change",function(){ca.checked?-Q.removeAttribute("disabled"):Q.setAttribute("disabled","disabled");Q.checked&&ca.checked?la.getEditSelect().removeAttribute("disabled"):la.getEditSelect().setAttribute("disabled","disabled")})}c=new CustomDialog(this,q,mxUtils.bind(this,function(){t(N.checked?l:null,ea.checked,aa.value,Y.getTarget(),Y.getColor(),na.checked,W.checked,ba.checked,ja.checked,ca.checked,null!=la?la.getLink():null,null!=ha?ha.value:null)}),null,c,f);this.showDialog(c.container,340,G,!0,!0);D.focus()};EditorUi.prototype.showPublishLinkDialog=-function(c,f,l,t,q,D,G,N,L,J,Y){var ha=document.createElement("div");ha.style.whiteSpace="nowrap";var ea=document.createElement("h3");mxUtils.write(ea,c||mxResources.get("publish"));ea.style.width="100%";ea.style.textAlign="center";ea.style.marginTop="2px";ea.style.marginBottom="20px";ha.appendChild(ea);var aa=document.createElement("select");c=30;aa.className="geBtn";aa.style.marginBottom="8px";aa.style.marginLeft="0px";aa.style.width="100%";aa.style.boxSizing="border-box";if(null==N||""==N.getHash())q=+function(c,f,l,t,q,D,H,N,L,J,Y,ha,ea){var aa=this.getCurrentFile();L=this.createUrlParameters(c,f,t,q,D,L);c=!0;null!=H?l="#U"+encodeURIComponent(H):N||null==aa||""==aa.getHash()?l="#R"+encodeURIComponent(l?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(l="#"+aa.getHash(),c=!1);c&&null!=aa&&null!=aa.getTitle()&&aa.getTitle()!=this.defaultFilename&&L.push("title="+encodeURIComponent(aa.getTitle()));J&&1<l.length&&(L.push("open="++l.substring(1)),l="");Y&&null!=this.currentPage&&L.push("page-id="+this.currentPage.getId());ha&&L.push("transparent=1");null!=ea&&L.push("dark="+ea);return(t&&(null!=H||null!=aa&&aa.getMode()!=App.MODE_GITHUB&&aa.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<L.length?"?"+L.join("&"):"")+l};EditorUi.prototype.createHtml=function(c,f,l,t,q,D,H,+N,L,J,Y,ha,ea){this.getBasenames();var aa={};""!=q&&q!=mxConstants.NONE&&(aa.highlight=q);"auto"!==t&&(aa.target=t);J||(aa.lightbox=!1);aa.nav=this.editor.graph.foldingEnabled;l=parseInt(l);isNaN(l)||100==l||(aa.zoom=l/100);l=[];H&&(l.push("pages"),aa.resize=!0,null!=this.pages&&null!=this.currentPage&&(aa.page=mxUtils.indexOf(this.pages,this.currentPage)));f&&(l.push("zoom"),aa.resize=!0);N&&l.push("layers");L&&l.push("tags");null!=ea&&(aa["dark-mode"]=ea);0<l.length&&(J&&l.push("lightbox"),aa.toolbar=+l.join(" "));null!=Y&&0<Y.length&&(aa.edit=Y);null!=c?aa.url=c:aa.xml=this.getFileData(!0,null,null,null,null,!H);f='<div class="mxgraph" style="'+(D?"max-width:100%;":"")+(""!=l?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(aa))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";ha(f,'<script type="text/javascript" src="'+(0<c.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+c:"1"==urlParams.dev?+"https://test.draw.io/js/viewer-static.min.js":window.DRAWIO_VIEWER_URL?window.DRAWIO_VIEWER_URL:EditorUi.lightboxHost+"/js/viewer-static.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(c,f,l,t){var q=document.createElement("div");q.style.whiteSpace="nowrap";var D=document.createElement("h3");mxUtils.write(D,mxResources.get("html"));D.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";q.appendChild(D);var H=document.createElement("div");H.style.cssText=+"border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var N=document.createElement("input");N.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";N.setAttribute("value","url");N.setAttribute("type","radio");N.setAttribute("name","type-embedhtmldialog");D=N.cloneNode(!0);D.setAttribute("value","copy");H.appendChild(D);var L=document.createElement("span");mxUtils.write(L,mxResources.get("includeCopyOfMyDiagram"));H.appendChild(L);mxUtils.br(H);H.appendChild(N);L=+document.createElement("span");mxUtils.write(L,mxResources.get("publicDiagramUrl"));H.appendChild(L);var J=this.getCurrentFile();null==l&&null!=J&&J.constructor==window.DriveFile&&(L=document.createElement("a"),L.style.paddingLeft="12px",L.style.color="gray",L.style.cursor="pointer",mxUtils.write(L,mxResources.get("share")),H.appendChild(L),mxEvent.addListener(L,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(J.getId(),J)})));D.setAttribute("checked","checked");null==+l&&N.setAttribute("disabled","disabled");q.appendChild(H);H=380;var Y=this.addLinkSection(q),ha=document.createElement("select");ha.style.maxWidth="260px";ha.style.marginLeft="8px";ha.style.marginTop="16px";L=document.createElement("option");L.setAttribute("value","light");mxUtils.write(L,mxResources.get("light"));ha.appendChild(L);L=document.createElement("option");L.setAttribute("value","dark");mxUtils.write(L,mxResources.get("dark"));ha.appendChild(L);L=document.createElement("option");L.setAttribute("value",+"auto");mxUtils.write(L,mxResources.get("automatic"));L.setAttribute("selected","selected");ha.appendChild(L);L.setAttribute("selected","selected");mxUtils.write(q,mxResources.get("appearance")+":");q.appendChild(ha);mxUtils.br(q);H+=26;var ea=this.addCheckbox(q,mxResources.get("zoom"),!0,null,!0);mxUtils.write(q,":");var aa=document.createElement("input");aa.setAttribute("type","text");aa.style.marginRight="16px";aa.style.width="60px";aa.style.marginLeft="4px";aa.style.marginRight="12px";aa.value=+"100%";q.appendChild(aa);var na=this.addCheckbox(q,mxResources.get("fit"),!0);L=null!=this.pages&&1<this.pages.length;var W=W=this.addCheckbox(q,mxResources.get("allPages"),L,!L),ba=this.addCheckbox(q,mxResources.get("layers"),!0),ja=this.addCheckbox(q,mxResources.get("tags"),!0),ca=this.addCheckbox(q,mxResources.get("lightbox"),!0),la=null;if(EditorUi.enableHtmlEditOption){la=this.addEditButton(q,ca);var Q=la.getEditInput();Q.style.marginBottom="16px";H+=50;mxEvent.addListener(ca,"change",function(){ca.checked?+Q.removeAttribute("disabled"):Q.setAttribute("disabled","disabled");Q.checked&&ca.checked?la.getEditSelect().removeAttribute("disabled"):la.getEditSelect().setAttribute("disabled","disabled")})}c=new CustomDialog(this,q,mxUtils.bind(this,function(){t(N.checked?l:null,ea.checked,aa.value,Y.getTarget(),Y.getColor(),na.checked,W.checked,ba.checked,ja.checked,ca.checked,null!=la?la.getLink():null,null!=ha?ha.value:null)}),null,c,f);this.showDialog(c.container,340,H,!0,!0);D.focus()};EditorUi.prototype.showPublishLinkDialog=+function(c,f,l,t,q,D,H,N,L,J,Y){var ha=document.createElement("div");ha.style.whiteSpace="nowrap";var ea=document.createElement("h3");mxUtils.write(ea,c||mxResources.get("publish"));ea.style.width="100%";ea.style.textAlign="center";ea.style.marginTop="2px";ea.style.marginBottom="20px";ha.appendChild(ea);var aa=document.createElement("select");c=30;aa.className="geBtn";aa.style.marginBottom="8px";aa.style.marginLeft="0px";aa.style.width="100%";aa.style.boxSizing="border-box";if(null==N||""==N.getHash())q=null!=q?q:"https://www.drawio.com/doc/faq/publish-diagram-as-link",ea=document.createElement("option"),mxUtils.write(ea,mxResources.get("makeCopy")),ea.setAttribute("value","copy"),aa.appendChild(ea);ea=document.createElement("option");mxUtils.write(ea,mxResources.get("authorizationRequired"));ea.setAttribute("value","auth");aa.appendChild(ea);null!=N&&""!=N.getHash()||ea.setAttribute("disabled","disabled");N=document.createElement("option");N.setAttribute("value","public");aa.appendChild(N);null!=-G?(mxUtils.write(N,mxResources.get("publicDiagramUrl")),N.setAttribute("title",G),aa.value="public"):(mxUtils.write(N,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),N.setAttribute("disabled","disabled"));ha.appendChild(aa);mxUtils.br(ha);aa.focus();var na=null,W=null;if(null!=f||null!=l)c+=30,mxUtils.write(ha,mxResources.get("width")+":"),na=document.createElement("input"),na.setAttribute("type","text"),na.style.marginRight="16px",na.style.width="50px",na.style.marginLeft=+H?(mxUtils.write(N,mxResources.get("publicDiagramUrl")),N.setAttribute("title",H),aa.value="public"):(mxUtils.write(N,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+")"),N.setAttribute("disabled","disabled"));ha.appendChild(aa);mxUtils.br(ha);aa.focus();var na=null,W=null;if(null!=f||null!=l)c+=30,mxUtils.write(ha,mxResources.get("width")+":"),na=document.createElement("input"),na.setAttribute("type","text"),na.style.marginRight="16px",na.style.width="50px",na.style.marginLeft="6px",na.style.marginRight="16px",na.style.marginBottom="10px",na.value="100%",ha.appendChild(na),mxUtils.write(ha,mxResources.get("height")+":"),W=document.createElement("input"),W.setAttribute("type","text"),W.style.width="50px",W.style.marginLeft="6px",W.style.marginBottom="10px",W.value=l+"px",ha.appendChild(W),mxUtils.br(ha);var ba=this.addLinkSection(ha,t),ja=J?this.addCheckbox(ha,mxResources.get("transparentBackground"),!1):null;null!=ja&&(c+=20);var ca=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(c+=30,f=null!=this.currentPage?this.currentPage.getName():"",16<f.length&&(f=f.substring(0,16)+"..."),ca=this.addCheckbox(ha,mxResources.get("selectedPage")+": "+f));var la=document.createElement("select");la.style.maxWidth="260px";la.style.marginLeft="8px";la.style.marginTop="16px";f=document.createElement("option");f.setAttribute("value","0");mxUtils.write(f,mxResources.get("light"));la.appendChild(f);f=document.createElement("option");f.setAttribute("value","1");mxUtils.write(f,mxResources.get("dark"));la.appendChild(f);f=document.createElement("option");f.setAttribute("value","auto");mxUtils.write(f,mxResources.get("automatic"));f.setAttribute("selected","selected");la.appendChild(f);Y&&(mxUtils.write(ha,mxResources.get("appearance")+":"),ha.appendChild(la),mxUtils.br(ha),c+=30);var Q=this.addCheckbox(ha,mxResources.get("lightbox"),!0,null,null,!t),k=this.addEditButton(ha,Q),B=k.getEditInput();t&&(B.style.marginLeft=Q.style.marginLeft,Q.style.display="none",c-=20);var I=this.addCheckbox(ha,mxResources.get("layers"),!0);I.style.marginLeft=B.style.marginLeft;I.style.marginTop="8px";var U=this.addCheckbox(ha,mxResources.get("tags"),!0);U.style.marginLeft=B.style.marginLeft;U.style.marginBottom="16px";U.style.marginTop="16px";mxEvent.addListener(Q,"change",function(){Q.checked?(I.removeAttribute("disabled"),B.removeAttribute("disabled"),U.removeAttribute("disabled")):(I.setAttribute("disabled","disabled"),B.setAttribute("disabled","disabled"),U.setAttribute("disabled","disabled"));B.checked&&Q.checked?k.getEditSelect().removeAttribute("disabled"):k.getEditSelect().setAttribute("disabled","disabled")});t=new CustomDialog(this,ha,mxUtils.bind(this,function(){L(ba.getTarget(),ba.getColor(),null==ca?!1:ca.checked,Q.checked,k.getLink(),I.checked,null!=na?na.value:null,null!=W?W.value:null,U.checked,aa.value,null!=ja?ja.checked:!1,la.value)}),null,mxResources.get("create"),q,D);this.showDialog(t.container,340,296+c,!0,!0);null!=na?(na.focus(),mxClient.IS_GC||mxClient.IS_FF||-5<=document.documentMode?na.select():document.execCommand("selectAll",!1,null)):null==aa.parentNode;ba.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,f,l,t,q){var D=document.createElement("div");D.style.whiteSpace="nowrap";var G=document.createElement("h3");mxUtils.write(G,mxResources.get("image"));G.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(q?"10":"4")+"px";D.appendChild(G);if(q){mxUtils.write(D,mxResources.get("zoom")+":");var N=document.createElement("input");+5<=document.documentMode?na.select():document.execCommand("selectAll",!1,null)):null==aa.parentNode;ba.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,f,l,t,q){var D=document.createElement("div");D.style.whiteSpace="nowrap";var H=document.createElement("h3");mxUtils.write(H,mxResources.get("image"));H.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(q?"10":"4")+"px";D.appendChild(H);if(q){mxUtils.write(D,mxResources.get("zoom")+":");var N=document.createElement("input");N.setAttribute("type","text");N.style.marginRight="16px";N.style.width="60px";N.style.marginLeft="4px";N.style.marginRight="12px";N.value=this.lastExportZoom||"100%";D.appendChild(N);mxUtils.write(D,mxResources.get("borderWidth")+":");var L=document.createElement("input");L.setAttribute("type","text");L.style.marginRight="16px";L.style.width="60px";L.style.marginLeft="4px";L.value=this.lastExportBorder||"0";D.appendChild(L);mxUtils.br(D)}var J=this.addCheckbox(D,mxResources.get("selectionOnly"),!1,-this.editor.graph.isSelectionEmpty()),Y=t?null:this.addCheckbox(D,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);G=this.editor.graph;var ha=t?null:this.addCheckbox(D,mxResources.get("transparentBackground"),G.background==mxConstants.NONE||null==G.background);null!=ha&&(ha.style.marginBottom="16px");c=new CustomDialog(this,D,mxUtils.bind(this,function(){var ea=parseInt(N.value)/100||1,aa=parseInt(L.value)||0;l(!J.checked,null!=Y?Y.checked:!1,null!=ha?ha.checked:!1,ea,aa)}),-null,c,f);this.showDialog(c.container,300,(q?25:0)+(t?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(c,f,l,t,q,D,G,N,L){G=null!=G?G:Editor.defaultIncludeDiagram;var J=document.createElement("div");J.style.whiteSpace="nowrap";var Y=this.editor.graph,ha="jpeg"==N||"webp"==N?220:320,ea=document.createElement("h3");mxUtils.write(ea,c);ea.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";J.appendChild(ea);mxUtils.write(J,mxResources.get("zoom")+":");var aa=document.createElement("input");+this.editor.graph.isSelectionEmpty()),Y=t?null:this.addCheckbox(D,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);H=this.editor.graph;var ha=t?null:this.addCheckbox(D,mxResources.get("transparentBackground"),H.background==mxConstants.NONE||null==H.background);null!=ha&&(ha.style.marginBottom="16px");c=new CustomDialog(this,D,mxUtils.bind(this,function(){var ea=parseInt(N.value)/100||1,aa=parseInt(L.value)||0;l(!J.checked,null!=Y?Y.checked:!1,null!=ha?ha.checked:!1,ea,aa)}),+null,c,f);this.showDialog(c.container,300,(q?25:0)+(t?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(c,f,l,t,q,D,H,N,L){H=null!=H?H:Editor.defaultIncludeDiagram;var J=document.createElement("div");J.style.whiteSpace="nowrap";var Y=this.editor.graph,ha="jpeg"==N||"webp"==N?220:320,ea=document.createElement("h3");mxUtils.write(ea,c);ea.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";J.appendChild(ea);mxUtils.write(J,mxResources.get("zoom")+":");var aa=document.createElement("input");aa.setAttribute("type","text");aa.style.marginRight="16px";aa.style.width="60px";aa.style.marginLeft="4px";aa.style.marginRight="12px";aa.value=this.lastExportZoom||"100%";J.appendChild(aa);mxUtils.write(J,mxResources.get("borderWidth")+":");var na=document.createElement("input");na.setAttribute("type","text");na.style.marginRight="16px";na.style.width="60px";na.style.marginLeft="4px";na.value=this.lastExportBorder||"0";J.appendChild(na);mxUtils.br(J);var W=this.addCheckbox(J,mxResources.get("selectionOnly"),!1,Y.isSelectionEmpty()),ba=document.createElement("input");ba.style.marginTop="16px";ba.style.marginRight="8px";ba.style.marginLeft="24px";ba.setAttribute("disabled","disabled");ba.setAttribute("type","checkbox");var ja=document.createElement("select");ja.style.marginTop="16px";ja.style.marginLeft="8px";c=["selectionOnly","diagram","page"];for(ea=0;ea<c.length;ea++)if(!Y.isSelectionEmpty()||"selectionOnly"!=c[ea]){var ca=document.createElement("option");mxUtils.write(ca,mxResources.get(c[ea]));ca.setAttribute("value",c[ea]);ja.appendChild(ca)}L?(mxUtils.write(J,mxResources.get("size")+":"),J.appendChild(ja),mxUtils.br(J),ha+=26,mxEvent.addListener(ja,"change",function(){"selectionOnly"==ja.value&&(W.checked=!0)})):D&&(J.appendChild(ba),mxUtils.write(J,mxResources.get("crop")),mxUtils.br(J),ha+=30,mxEvent.addListener(W,"change",function(){W.checked?ba.removeAttribute("disabled"):ba.setAttribute("disabled","disabled")}));Y.isSelectionEmpty()?L&&(W.style.display="none",W.nextSibling.style.display="none",W.nextSibling.nextSibling.style.display="none",ha-=30):(ja.value="diagram",ba.setAttribute("checked","checked"),ba.defaultChecked=!0,mxEvent.addListener(W,"change",function(){ja.value=W.checked?"selectionOnly":"diagram"}));var la=this.addCheckbox(J,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=N&&"webp"!=N),Q=document.createElement("select");Q.style.maxWidth="260px";Q.style.marginLeft="8px";Q.style.marginTop="16px";D=document.createElement("option");D.setAttribute("value","light");mxUtils.write(D,mxResources.get("light"));Q.appendChild(D);L=document.createElement("option");L.setAttribute("value","dark");mxUtils.write(L,mxResources.get("dark"));Q.appendChild(L);"svg"==N&&mxUtils.lightDarkColorSupported?(D=document.createElement("option"),D.setAttribute("value","auto"),mxUtils.write(D,mxResources.get("automatic")),D.setAttribute("selected","selected"),Q.appendChild(D)):Editor.isDarkMode()?L.setAttribute("selected","selected"):D.setAttribute("selected","selected");mxUtils.write(J,mxResources.get("appearance")+":");J.appendChild(Q);-mxUtils.br(J);ha+=26;var k=this.addCheckbox(J,mxResources.get("shadow"),Y.shadowVisible),B=null;if("png"==N||"jpeg"==N||"webp"==N)B=this.addCheckbox(J,mxResources.get("grid"),!1,this.isOffline()||!this.canvasSupported,!1,!0),ha+=30;var I=this.addCheckbox(J,mxResources.get("includeCopyOfMyDiagram")+":",G,null,null,"jpeg"!=N&&"webp"!=N),U=document.createElement("select");U.style.maxWidth="260px";U.style.marginLeft="28px";"png"==N||"svg"==N?(G=function(){I.checked?U.removeAttribute("disabled"):U.setAttribute("disabled",-"disabled")},Y=document.createElement("option"),Y.setAttribute("value","allPages"),mxUtils.write(Y,mxResources.get("allPages")),U.appendChild(Y),Y=document.createElement("option"),Y.setAttribute("value","currentPage"),mxUtils.write(Y,mxResources.get("currentPage")),U.appendChild(Y),I.style.marginBottom="12px",U.style.marginBottom="16px",J.appendChild(U),mxUtils.br(J),ha+=20,null!=this.lastEmbedInclude&&(U.value=this.lastEmbedInclude),mxEvent.addListener(I,"change",G),G()):I.style.marginBottom="16px";+mxUtils.br(J);ha+=26;var k=this.addCheckbox(J,mxResources.get("shadow"),Y.shadowVisible),B=null;if("png"==N||"jpeg"==N||"webp"==N)B=this.addCheckbox(J,mxResources.get("grid"),!1,this.isOffline()||!this.canvasSupported,!1,!0),ha+=30;var I=this.addCheckbox(J,mxResources.get("includeCopyOfMyDiagram")+":",H,null,null,"jpeg"!=N&&"webp"!=N),U=document.createElement("select");U.style.maxWidth="260px";U.style.marginLeft="28px";"png"==N||"svg"==N?(H=function(){I.checked?U.removeAttribute("disabled"):U.setAttribute("disabled",+"disabled")},Y=document.createElement("option"),Y.setAttribute("value","allPages"),mxUtils.write(Y,mxResources.get("allPages")),U.appendChild(Y),Y=document.createElement("option"),Y.setAttribute("value","currentPage"),mxUtils.write(Y,mxResources.get("currentPage")),U.appendChild(Y),I.style.marginBottom="12px",U.style.marginBottom="16px",J.appendChild(U),mxUtils.br(J),ha+=20,null!=this.lastEmbedInclude&&(U.value=this.lastEmbedInclude),mxEvent.addListener(I,"change",H),H()):I.style.marginBottom="16px";var P=document.createElement("input");P.style.marginBottom="16px";P.style.marginRight="8px";P.setAttribute("type","checkbox");var T=document.createElement("input");T.style.marginBottom="16px";T.style.marginRight="8px";T.setAttribute("type","checkbox");f&&(P.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,J.appendChild(P),mxUtils.write(J,mxResources.get("embedImages")),mxUtils.br(J),T.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,J.appendChild(T),mxUtils.write(J,mxResources.get("embedFonts")),-mxUtils.br(J),ha+=50);var X=document.createElement("select");X.style.maxWidth="260px";X.style.marginLeft="8px";D=document.createElement("option");D.setAttribute("value","auto");mxUtils.write(D,mxResources.get("automatic"));X.appendChild(D);G=document.createElement("option");G.setAttribute("value","blank");mxUtils.write(G,mxResources.get("openInNewWindow"));X.appendChild(G);G=document.createElement("option");G.setAttribute("value","self");mxUtils.write(G,mxResources.get("openInThisWindow"));X.appendChild(G);-G=document.createElement("div");mxUtils.write(G,mxResources.get("LinksLost"));G.style.margin="7px";G.style.display="none";"svg"==N&&(mxUtils.write(J,mxResources.get("links")+":"),J.appendChild(X),J.appendChild(G),mxUtils.br(J),mxUtils.br(J),ha+=50);l=new CustomDialog(this,J,mxUtils.bind(this,function(){this.lastExportBorder=na.value;this.lastExportZoom=aa.value;this.lastEmbedImages=P.checked;this.lastEmbedFonts=T.checked;this.lastEmbedInclude=U.value;q(aa.value,la.checked,!W.checked,k.checked,I.checked,-P.checked&&f,na.value,ba.checked,("png"==N||"svg"==N)&&"currentPage"==U.value,X.value,null!=B?B.checked:null,null!=Q?Q.value:null,ja.value,T.checked)}),null,l,t);this.showDialog(l.container,340,ha,!0,!0,null,null,null,null,!0);aa.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?aa.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,f,l,t,q){var D=document.createElement("div");D.style.whiteSpace="nowrap";var G=this.editor.graph;if(null!=-f){var N=document.createElement("h3");mxUtils.write(N,f);N.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";D.appendChild(N)}var L=this.addCheckbox(D,mxResources.get("fit"),!0),J=this.addCheckbox(D,mxResources.get("shadow"),G.shadowVisible&&t,!t),Y=this.addCheckbox(D,l),ha=this.addCheckbox(D,mxResources.get("lightbox"),!0),ea=this.addEditButton(D,ha),aa=ea.getEditInput(),na=1<G.model.getChildCount(G.model.getRoot()),W=this.addCheckbox(D,mxResources.get("layers"),na,!na);+mxUtils.br(J),ha+=50);var X=document.createElement("select");X.style.maxWidth="260px";X.style.marginLeft="8px";D=document.createElement("option");D.setAttribute("value","auto");mxUtils.write(D,mxResources.get("automatic"));X.appendChild(D);H=document.createElement("option");H.setAttribute("value","blank");mxUtils.write(H,mxResources.get("openInNewWindow"));X.appendChild(H);H=document.createElement("option");H.setAttribute("value","self");mxUtils.write(H,mxResources.get("openInThisWindow"));X.appendChild(H);+H=document.createElement("div");mxUtils.write(H,mxResources.get("LinksLost"));H.style.margin="7px";H.style.display="none";"svg"==N&&(mxUtils.write(J,mxResources.get("links")+":"),J.appendChild(X),J.appendChild(H),mxUtils.br(J),mxUtils.br(J),ha+=50);l=new CustomDialog(this,J,mxUtils.bind(this,function(){this.lastExportBorder=na.value;this.lastExportZoom=aa.value;this.lastEmbedImages=P.checked;this.lastEmbedFonts=T.checked;this.lastEmbedInclude=U.value;q(aa.value,la.checked,!W.checked,k.checked,I.checked,+P.checked&&f,na.value,ba.checked,("png"==N||"svg"==N)&&"currentPage"==U.value,X.value,null!=B?B.checked:null,null!=Q?Q.value:null,ja.value,T.checked)}),null,l,t);this.showDialog(l.container,340,ha,!0,!0,null,null,null,null,!0);aa.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?aa.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,f,l,t,q){var D=document.createElement("div");D.style.whiteSpace="nowrap";var H=this.editor.graph;if(null!=+f){var N=document.createElement("h3");mxUtils.write(N,f);N.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";D.appendChild(N)}var L=this.addCheckbox(D,mxResources.get("fit"),!0),J=this.addCheckbox(D,mxResources.get("shadow"),H.shadowVisible&&t,!t),Y=this.addCheckbox(D,l),ha=this.addCheckbox(D,mxResources.get("lightbox"),!0),ea=this.addEditButton(D,ha),aa=ea.getEditInput(),na=1<H.model.getChildCount(H.model.getRoot()),W=this.addCheckbox(D,mxResources.get("layers"),na,!na);W.style.marginLeft=aa.style.marginLeft;W.style.marginBottom="12px";W.style.marginTop="8px";mxEvent.addListener(ha,"change",function(){ha.checked?(na&&W.removeAttribute("disabled"),aa.removeAttribute("disabled")):(W.setAttribute("disabled","disabled"),aa.setAttribute("disabled","disabled"));aa.checked&&ha.checked?ea.getEditSelect().removeAttribute("disabled"):ea.getEditSelect().setAttribute("disabled","disabled")});f=new CustomDialog(this,D,mxUtils.bind(this,function(){c(L.checked,J.checked,Y.checked,-ha.checked,ea.getLink(),W.checked)}),null,mxResources.get("embed"),q);this.showDialog(f.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,f,l,t,q,D,G,N){function L(aa){var na=" ",W="";t&&(na=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+-EditorUi.lightboxHost+"/?client=1"+(null!=Y?"&page="+Y:"")+(q?"&edit=_blank":"")+(D?"&layers=1":"")+"');}})(this);\"",W+="cursor:pointer;");c&&(W+="max-width:100%;");var ba="";l&&(ba=' width="'+Math.round(J.width)+'" height="'+Math.round(J.height)+'"');G('<img src="'+aa+'"'+ba+(""!=W?' style="'+W+'"':"")+na+"/>")}var J=this.editor.graph.getGraphBounds(),Y=this.getSelectedPageIndex();if(this.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(aa){var na=t?this.getFileData(!0):+ha.checked,ea.getLink(),W.checked)}),null,mxResources.get("embed"),q);this.showDialog(f.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,f,l,t,q,D,H,N){function L(aa){var na=" ",W="";t&&(na=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"++EditorUi.lightboxHost+"/?client=1"+(null!=Y?"&page="+Y:"")+(q?"&edit=_blank":"")+(D?"&layers=1":"")+"');}})(this);\"",W+="cursor:pointer;");c&&(W+="max-width:100%;");var ba="";l&&(ba=' width="'+Math.round(J.width)+'" height="'+Math.round(J.height)+'"');H('<img src="'+aa+'"'+ba+(""!=W?' style="'+W+'"':"")+na+"/>")}var J=this.editor.graph.getGraphBounds(),Y=this.getSelectedPageIndex();if(this.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(aa){var na=t?this.getFileData(!0):null;aa=this.createImageDataUri(aa,na,"png");L(aa)}),null,null,null,mxUtils.bind(this,function(aa){N({message:mxResources.get("unknownError")})}),null,!0,l?2:1,null,f,null,null,Editor.defaultBorder);else if(f=this.getFileData(!0),J.width*J.height<=MAX_AREA&&f.length<=MAX_REQUEST_SIZE){var ha="";l&&(ha="&w="+Math.round(2*J.width)+"&h="+Math.round(2*J.height));var ea=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(t?"1":"0")+ha+"&xml="+encodeURIComponent(f));ea.send(mxUtils.bind(this,function(){200<=-ea.getStatus()&&299>=ea.getStatus()?L("data:image/png;base64,"+ea.getText()):N({message:mxResources.get("unknownError")})}))}else N({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,f,l,t,q,D,G){var N=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!l,"auto"),L=N.getElementsByTagName("a");if(null!=L)for(var J=0;J<L.length;J++){var Y=L[J].getAttribute("href");null!=Y&&"#"==Y.charAt(0)&&"_blank"==L[J].getAttribute("target")&&L[J].removeAttribute("target")}t&&+ea.getStatus()&&299>=ea.getStatus()?L("data:image/png;base64,"+ea.getText()):N({message:mxResources.get("unknownError")})}))}else N({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,f,l,t,q,D,H){var N=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!l,"auto"),L=N.getElementsByTagName("a");if(null!=L)for(var J=0;J<L.length;J++){var Y=L[J].getAttribute("href");null!=Y&&"#"==Y.charAt(0)&&"_blank"==L[J].getAttribute("target")&&L[J].removeAttribute("target")}t&&N.setAttribute("content",this.getFileData(!0));f&&this.editor.graph.addSvgShadow(N);if(l){var ha=" ",ea="";t&&(ha="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"+(q?"&edit=_blank":"")+(D?"&layers=1":-"")+"');}})(this);\"",ea+="cursor:pointer;");c&&(ea+="max-width:100%;");this.editor.convertImages(N,mxUtils.bind(this,function(aa){G('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(aa))+'"'+(""!=ea?' style="'+ea+'"':"")+ha+"/>")}))}else ea="",t&&(f=this.getSelectedPageIndex(),N.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"+-EditorUi.lightboxHost+"/?client=1"+(null!=f?"&page="+f:"")+(q?"&edit=_blank":"")+(D?"&layers=1":"")+"');}}})(this);"),ea+="cursor:pointer;"),c&&(c=parseInt(N.getAttribute("width")),q=parseInt(N.getAttribute("height")),N.setAttribute("viewBox","-0.5 -0.5 "+c+" "+q),ea+="max-width:100%;max-height:"+q+"px;",N.removeAttribute("height")),""!=ea&&N.setAttribute("style",ea),this.editor.addFontCss(N),this.editor.graph.mathEnabled&&this.editor.addMathCss(N),G(mxUtils.getXml(N))};EditorUi.prototype.timeSince=+"")+"');}})(this);\"",ea+="cursor:pointer;");c&&(ea+="max-width:100%;");this.editor.convertImages(N,mxUtils.bind(this,function(aa){H('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(aa))+'"'+(""!=ea?' style="'+ea+'"':"")+ha+"/>")}))}else ea="",t&&(f=this.getSelectedPageIndex(),N.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"++EditorUi.lightboxHost+"/?client=1"+(null!=f?"&page="+f:"")+(q?"&edit=_blank":"")+(D?"&layers=1":"")+"');}}})(this);"),ea+="cursor:pointer;"),c&&(c=parseInt(N.getAttribute("width")),q=parseInt(N.getAttribute("height")),N.setAttribute("viewBox","-0.5 -0.5 "+c+" "+q),ea+="max-width:100%;max-height:"+q+"px;",N.removeAttribute("height")),""!=ea&&N.setAttribute("style",ea),this.editor.addFontCss(N),this.editor.graph.mathEnabled&&this.editor.addMathCss(N),H(mxUtils.getXml(N))};EditorUi.prototype.timeSince=function(c){c=Math.floor((new Date-c)/1E3);var f=Math.floor(c/31536E3);if(1<f)return f+" "+mxResources.get("years");f=Math.floor(c/2592E3);if(1<f)return f+" "+mxResources.get("months");f=Math.floor(c/86400);if(1<f)return f+" "+mxResources.get("days");f=Math.floor(c/3600);if(1<f)return f+" "+mxResources.get("hours");f=Math.floor(c/60);return 1<f?f+" "+mxResources.get("minutes"):1==f?f+" "+mxResources.get("minute"):null};EditorUi.prototype.decodeNodeIntoGraph=function(c,f){if(null!=c){var l=null;if("diagram"==c.nodeName)l=c;else if("mxfile"==c.nodeName){var t=c.getElementsByTagName("diagram");if(0<t.length){l=t[0];var q=f.getGlobalVariable;f.getGlobalVariable=function(D){return"page"==D?l.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==D?1:q.apply(this,arguments)}}}null!=l&&(c=Editor.parseDiagramNode(l))}t=this.editor.graph;try{this.editor.graph=f,this.editor.setGraphXml(c)}catch(D){}finally{this.editor.graph=t}return c};EditorUi.prototype.getSvgFileProperties=function(c){return this.getPngFileProperties(c)};-EditorUi.prototype.getPngFileProperties=function(c){var f=1,l=0;if(null!=c){if(c.hasAttribute("scale")){var t=parseFloat(c.getAttribute("scale"));!isNaN(t)&&0<t&&(f=t)}c.hasAttribute("border")&&(t=parseInt(c.getAttribute("border")),!isNaN(t)&&0<t&&(l=t))}return{scale:f,border:l}};EditorUi.prototype.getEmbeddedPng=function(c,f,l,t,q){try{var D=this.editor.graph,G=null;if(null!=l&&0<l.length)D=this.createTemporaryGraph(D.getStylesheet()),document.body.appendChild(D.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(l).documentElement,-!0),D),G=l;else if(null!=this.pages&&this.currentPage!=this.pages[0]){D=this.createTemporaryGraph(D.getStylesheet());var N=D.getGlobalVariable;D.setBackgroundImage=this.editor.graph.setBackgroundImage;var L=this.pages[0];this.currentPage==L?D.setBackgroundImage(this.editor.graph.backgroundImage):null!=L.viewState&&null!=L.viewState&&D.setBackgroundImage(L.viewState.backgroundImage);D.getGlobalVariable=function(J){return"page"==J?L.getName():"pagenumber"==J?1:N.apply(this,arguments)};document.body.appendChild(D.container);-D.model.setRoot(L.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(J){try{null==G&&(G=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var Y=J.toDataURL("image/png");Y=Editor.writeGraphModelToPng(Y,"tEXt","mxfile",encodeURIComponent(G));c(Y.substring(Y.lastIndexOf(",")+1));D!=this.editor.graph&&D.container.parentNode.removeChild(D.container)}catch(ha){null!=f&&f(ha)}}),null,null,null,mxUtils.bind(this,function(J){null!=f&&f(J)}),null,null,t,null,D.shadowVisible,null,D,q,-null,null,null,"diagram",null)}catch(J){null!=f&&f(J)}};EditorUi.prototype.getEmbeddedSvg=function(c,f,l,t,q,D,G,N,L,J,Y,ha,ea){N=null!=N?N:!0;Y=null!=Y?Y:0;G=null!=L?L:f.background;G==mxConstants.NONE&&(G=null);null==G&&"none"==f.getAdaptiveColors()&&(G="#ffffff");L=this.editor.graph.createSvgImageExport(null!=c);D=f.getSvg(G,J,Y,null,null,D,null,L,null,f.shadowVisible||ha,null,ea,"diagram");(f.shadowVisible||ha)&&f.addSvgShadow(D,null,null,0==Y);null!=c&&D.setAttribute("content",c);null!=l&&D.setAttribute("resource",+EditorUi.prototype.getPngFileProperties=function(c){var f=1,l=0;if(null!=c){if(c.hasAttribute("scale")){var t=parseFloat(c.getAttribute("scale"));!isNaN(t)&&0<t&&(f=t)}c.hasAttribute("border")&&(t=parseInt(c.getAttribute("border")),!isNaN(t)&&0<t&&(l=t))}return{scale:f,border:l}};EditorUi.prototype.getEmbeddedPng=function(c,f,l,t,q){try{var D=this.editor.graph,H=null;if(null!=l&&0<l.length)D=this.createTemporaryGraph(D.getStylesheet()),document.body.appendChild(D.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(l).documentElement,+!0),D),H=l;else if(null!=this.pages&&this.currentPage!=this.pages[0]){D=this.createTemporaryGraph(D.getStylesheet());var N=D.getGlobalVariable;D.setBackgroundImage=this.editor.graph.setBackgroundImage;var L=this.pages[0];this.currentPage==L?D.setBackgroundImage(this.editor.graph.backgroundImage):null!=L.viewState&&null!=L.viewState&&D.setBackgroundImage(L.viewState.backgroundImage);D.getGlobalVariable=function(J){return"page"==J?L.getName():"pagenumber"==J?1:N.apply(this,arguments)};document.body.appendChild(D.container);+D.model.setRoot(L.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(J){try{null==H&&(H=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var Y=J.toDataURL("image/png");Y=Editor.writeGraphModelToPng(Y,"tEXt","mxfile",encodeURIComponent(H));c(Y.substring(Y.lastIndexOf(",")+1));D!=this.editor.graph&&D.container.parentNode.removeChild(D.container)}catch(ha){null!=f&&f(ha)}}),null,null,null,mxUtils.bind(this,function(J){null!=f&&f(J)}),null,null,t,null,D.shadowVisible,null,D,q,+null,null,null,"diagram",null)}catch(J){null!=f&&f(J)}};EditorUi.prototype.getEmbeddedSvg=function(c,f,l,t,q,D,H,N,L,J,Y,ha,ea){N=null!=N?N:!0;Y=null!=Y?Y:0;H=null!=L?L:f.background;H==mxConstants.NONE&&(H=null);null==H&&"none"==f.getAdaptiveColors()&&(H="#ffffff");L=this.editor.graph.createSvgImageExport(null!=c);D=f.getSvg(H,J,Y,null,null,D,null,L,null,f.shadowVisible||ha,null,ea,"diagram");(f.shadowVisible||ha)&&f.addSvgShadow(D,null,null,0==Y);null!=c&&D.setAttribute("content",c);null!=l&&D.setAttribute("resource",l);var aa=mxUtils.bind(this,function(na){na=(t?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(na);null!=q&&q(na);return na});f.mathEnabled&&this.editor.addMathCss(D);if(null!=q)this.embedFonts(D,mxUtils.bind(this,function(na){N?this.editor.convertImages(na,mxUtils.bind(this,function(W){aa(W)})):aa(na)}));else return aa(D)};EditorUi.prototype.embedFonts=function(c,f){this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=this.editor.resolvedFontCss&&-this.editor.addFontCss(c,this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(l){try{null!=l&&this.editor.addFontCss(c,l),f(c)}catch(t){f(c)}}))}catch(l){f(c)}}))};EditorUi.prototype.exportImage=function(c,f,l,t,q,D,G,N,L,J,Y,ha,ea){L=null!=L?L:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(na){Editor.addRetryToError(na,mxUtils.bind(this,function(){this.exportImage(c,f,l,t,q,D,G,N,L,J,Y,ha,ea)}));this.handleError(na)}))){var aa=-this.editor.graph.isSelectionEmpty();l=null!=l?l:aa;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(na){this.spinner.stop();try{this.saveCanvas(na,q?this.getFileData(!0,null,null,null,l,N,null,null,null,null,null,c,D):null,L,null==this.pages||0==this.pages.length,Y)}catch(W){this.handleError(W)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(na){this.spinner.stop();this.handleError(na)}),null,l,c||1,f,t,null,null,D,G,J,ha,-ea)}catch(na){this.spinner.stop(),this.handleError(na)}}};EditorUi.prototype.isCorsEnabledForUrl=function(c){return this.editor.isCorsEnabledForUrl(c)};EditorUi.prototype.addLocalPagesToMapping=function(c){c=null!=c?c:{};if(null!=this.pages)for(var f=0;f<this.pages.length;f++)c[this.pages[f].getId()]=this.pages[f].getId();return c};EditorUi.prototype.importXml=function(c,f,l,t,q,D,G){f=null!=f?f:0;l=null!=l?l:0;var N=[];try{var L=this.editor.graph;if(null!=c&&0<c.length){L.model.beginUpdate();try{var J=+this.editor.addFontCss(c,this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(l){try{null!=l&&this.editor.addFontCss(c,l),f(c)}catch(t){f(c)}}))}catch(l){f(c)}}))};EditorUi.prototype.exportImage=function(c,f,l,t,q,D,H,N,L,J,Y,ha,ea){L=null!=L?L:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(na){Editor.addRetryToError(na,mxUtils.bind(this,function(){this.exportImage(c,f,l,t,q,D,H,N,L,J,Y,ha,ea)}));this.handleError(na)}))){var aa=+this.editor.graph.isSelectionEmpty();l=null!=l?l:aa;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(na){this.spinner.stop();try{this.saveCanvas(na,q?this.getFileData(!0,null,null,null,l,N,null,null,null,null,null,c,D):null,L,null==this.pages||0==this.pages.length,Y)}catch(W){this.handleError(W)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(na){this.spinner.stop();this.handleError(na)}),null,l,c||1,f,t,null,null,D,H,J,ha,+ea)}catch(na){this.spinner.stop(),this.handleError(na)}}};EditorUi.prototype.isCorsEnabledForUrl=function(c){return this.editor.isCorsEnabledForUrl(c)};EditorUi.prototype.addLocalPagesToMapping=function(c){c=null!=c?c:{};if(null!=this.pages)for(var f=0;f<this.pages.length;f++)c[this.pages[f].getId()]=this.pages[f].getId();return c};EditorUi.prototype.importXml=function(c,f,l,t,q,D,H){f=null!=f?f:0;l=null!=l?l:0;var N=[];try{var L=this.editor.graph;if(null!=c&&0<c.length){L.model.beginUpdate();try{var J=mxUtils.parseXml(c);c={};var Y=this.editor.extractGraphModel(J.documentElement,null!=this.pages);if(null!=Y&&"mxfile"==Y.nodeName&&null!=this.pages){var ha=Y.getElementsByTagName("diagram");if(1==ha.length&&!D){if(Y=Editor.parseDiagramNode(ha[0]),null!=this.currentPage&&(c[ha[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var ea=ha[0].getAttribute("name");null!=ea&&""!=ea&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,ea))}}else if(0<ha.length){D=[];var aa=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(c[ha[0].getAttribute("id")]=this.pages[0].getId(),ea=ha[0].getAttribute("name"),null!=ea&&""!=ea&&this.editor.graph.model.execute(new RenamePage(this,this.pages[0],ea)),Y=Editor.parseDiagramNode(ha[0]),t=!1,aa=1);for(;aa<ha.length;aa++){var na=ha[aa].getAttribute("id");ha[aa].removeAttribute("id");var W=this.updatePageRoot(new DiagramPage(ha[aa]));c[na]=ha[aa].getAttribute("id");var ba=this.pages.length;null==W.getName()&&W.setName(mxResources.get("pageWithNumber",-[ba+1]));L.model.execute(new ChangePage(this,W,W,ba,!0));D.push(W)}this.updatePageLinks(c,D)}}if(null!=Y&&"mxGraphModel"===Y.nodeName){N=L.importGraphModel(Y,f,l,t);if(null!=N)for(this.addLocalPagesToMapping(c),aa=0;aa<N.length;aa++)this.updatePageLinksForCell(c,N[aa]);var ja=L.parseBackgroundImage(Y.getAttribute("backgroundImage"));if(null!=ja&&null!=ja.originalSrc){this.updateBackgroundPageLink(c,ja);var ca=new ChangePageSetup(this,null,ja);ca.ignoreColor=!0;L.model.execute(ca)}}G&&L.pasteCellStyles(L.includeDescendants(N),+[ba+1]));L.model.execute(new ChangePage(this,W,W,ba,!0));D.push(W)}this.updatePageLinks(c,D)}}if(null!=Y&&"mxGraphModel"===Y.nodeName){N=L.importGraphModel(Y,f,l,t);if(null!=N)for(this.addLocalPagesToMapping(c),aa=0;aa<N.length;aa++)this.updatePageLinksForCell(c,N[aa]);var ja=L.parseBackgroundImage(Y.getAttribute("backgroundImage"));if(null!=ja&&null!=ja.originalSrc){this.updateBackgroundPageLink(c,ja);var ca=new ChangePageSetup(this,null,ja);ca.ignoreColor=!0;L.model.execute(ca)}}H&&L.pasteCellStyles(L.includeDescendants(N),L.defaultVertexStyle,L.defaultEdgeStyle)}finally{L.model.endUpdate()}}}catch(la){if(q)throw la;this.handleError(la)}return N};EditorUi.prototype.updatePageLinks=function(c,f){for(var l=0;l<f.length;l++)this.updatePageLinksForCell(c,f[l].root),null!=f[l].viewState&&this.updateBackgroundPageLink(c,f[l].viewState.backgroundImage)};EditorUi.prototype.updateBackgroundPageLink=function(c,f){try{if(null!=f&&Graph.isPageLink(f.originalSrc)){var l=c[f.originalSrc.substring(f.originalSrc.indexOf(",")+1)];null!=-l&&(f.originalSrc="data:page/id,"+l)}}catch(t){}};EditorUi.prototype.updatePageLinksForCell=function(c,f){var l=document.createElement("div"),t=this.editor.graph,q=t.getLinkForCell(f);null!=q&&t.setLinkForCell(f,this.updatePageLink(c,q));if(t.isHtmlLabel(f)){l.innerHTML=Graph.sanitizeHtml(t.getLabel(f));for(var D=l.getElementsByTagName("a"),G=!1,N=0;N<D.length;N++)q=D[N].getAttribute("href"),null!=q&&(D[N].setAttribute("href",this.updatePageLink(c,q)),G=!0);G&&t.labelChanged(f,l.innerHTML)}for(N=-0;N<t.model.getChildCount(f);N++)this.updatePageLinksForCell(c,t.model.getChildAt(f,N))};EditorUi.prototype.updatePageLink=function(c,f){if(Graph.isPageLink(f)){var l=c[f.substring(f.indexOf(",")+1)];f=null!=l?"data:page/id,"+l:null}else if("data:action/json,"==f.substring(0,17))try{var t=JSON.parse(f.substring(17));if(null!=t.actions){for(var q=0;q<t.actions.length;q++){var D=t.actions[q];if(null!=D.open&&Graph.isPageLink(D.open)){var G=D.open.substring(D.open.indexOf(",")+1);l=c[G];null!=l?D.open=-"data:page/id,"+l:null==this.getPageById(G)&&delete D.open}}f="data:action/json,"+JSON.stringify(t)}}catch(N){}return f};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,f,l,t,q){var D=mxUtils.bind(this,function(G){this.loadingExtensions=!1;null!=l?l(G):this.handleError(G)});this.createTimeout(null,mxUtils.bind(this,function(G){t=null!=t?t:c.name;var N=mxUtils.bind(this,function(J){G.clear()&&+l&&(f.originalSrc="data:page/id,"+l)}}catch(t){}};EditorUi.prototype.updatePageLinksForCell=function(c,f){var l=document.createElement("div"),t=this.editor.graph,q=t.getLinkForCell(f);null!=q&&t.setLinkForCell(f,this.updatePageLink(c,q));if(t.isHtmlLabel(f)){l.innerHTML=Graph.sanitizeHtml(t.getLabel(f));for(var D=l.getElementsByTagName("a"),H=!1,N=0;N<D.length;N++)q=D[N].getAttribute("href"),null!=q&&(D[N].setAttribute("href",this.updatePageLink(c,q)),H=!0);H&&t.labelChanged(f,l.innerHTML)}for(N=+0;N<t.model.getChildCount(f);N++)this.updatePageLinksForCell(c,t.model.getChildAt(f,N))};EditorUi.prototype.updatePageLink=function(c,f){if(Graph.isPageLink(f)){var l=c[f.substring(f.indexOf(",")+1)];f=null!=l?"data:page/id,"+l:null}else if("data:action/json,"==f.substring(0,17))try{var t=JSON.parse(f.substring(17));if(null!=t.actions){for(var q=0;q<t.actions.length;q++){var D=t.actions[q];if(null!=D.open&&Graph.isPageLink(D.open)){var H=D.open.substring(D.open.indexOf(",")+1);l=c[H];null!=l?D.open=+"data:page/id,"+l:null==this.getPageById(H)&&delete D.open}}f="data:action/json,"+JSON.stringify(t)}}catch(N){}return f};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,f,l,t,q){var D=mxUtils.bind(this,function(H){this.loadingExtensions=!1;null!=l?l(H):this.handleError(H)});this.createTimeout(null,mxUtils.bind(this,function(H){t=null!=t?t:c.name;var N=mxUtils.bind(this,function(J){H.clear()&&D(J)}),L=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var J=this.isRemoteVisioFormat(t);try{var Y=t.lastIndexOf(".");if(0<=Y&&Y<t.length)t.substring(Y+1).toUpperCase();else{var ha=t.lastIndexOf("/");0<=ha&&ha<t.length&&(t=t.substring(ha+1))}}catch(aa){}if(J)if(null==VSD_CONVERT_URL||this.isOffline())N({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{J=new FormData;J.append("file1",c,t);var ea=-new XMLHttpRequest;ea.open("POST",VSD_CONVERT_URL+(/(\.vss|\.vsx)$/.test(t)?"?stencil=1":""));ea.responseType="blob";this.addRemoteServiceSecurityCheck(ea);null!=q&&ea.setRequestHeader("x-convert-custom",q);ea.onreadystatechange=mxUtils.bind(this,function(){if(4==ea.readyState&&G.clear())if(200<=ea.status&&299>=ea.status)try{var aa=ea.response;if("text/xml"==aa.type){var na=new FileReader;na.onload=mxUtils.bind(this,function(W){try{f(W.target.result)}catch(ba){N({message:mxResources.get("errorLoadingFile")})}});-na.readAsText(aa)}else this.doImportVisio(aa,f,N,t)}catch(W){N(W)}else try{""==ea.responseType||"text"==ea.responseType?N({message:ea.responseText}):(na=new FileReader,na.onload=function(){try{N({message:JSON.parse(na.result).Message})}catch(W){N(W)}},na.readAsText(ea.response))}catch(W){N({})}});ea.send(J)}else if(G.clear())try{this.doImportVisio(c,f,N,t)}catch(aa){N(aa)}}else N({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?-L():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",L,null,null,null,N))}),D)};EditorUi.prototype.importGraphML=function(c,f,l){var t=mxUtils.bind(this,function(q){this.loadingExtensions=!1;null!=l?l(q):this.handleError(q)});this.createTimeout(null,mxUtils.bind(this,function(q){var D=mxUtils.bind(this,function(N){q.clear()&&t(N)}),G=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(q.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,f,t)}catch(N){D(N)}else D({message:mxResources.get("serviceUnavailableOrBlocked")})});-this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?G():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",G,null,null,null,D))}),t)};EditorUi.prototype.exportVisio=function(c){if(this.spinner.spin(document.body,mxResources.get("loading"))){var f=mxUtils.bind(this,function(l){this.loadingExtensions=!1;this.handleError(l)});this.vsdxExportEnabled()?this.createTimeout(null,mxUtils.bind(this,function(l){var t=mxUtils.bind(this,function(D){l.clear()&&f(D)}),+new XMLHttpRequest;ea.open("POST",VSD_CONVERT_URL+(/(\.vss|\.vsx)$/.test(t)?"?stencil=1":""));ea.responseType="blob";this.addRemoteServiceSecurityCheck(ea);null!=q&&ea.setRequestHeader("x-convert-custom",q);ea.onreadystatechange=mxUtils.bind(this,function(){if(4==ea.readyState&&H.clear())if(200<=ea.status&&299>=ea.status)try{var aa=ea.response;if("text/xml"==aa.type){var na=new FileReader;na.onload=mxUtils.bind(this,function(W){try{f(W.target.result)}catch(ba){N({message:mxResources.get("errorLoadingFile")})}});+na.readAsText(aa)}else this.doImportVisio(aa,f,N,t)}catch(W){N(W)}else try{""==ea.responseType||"text"==ea.responseType?N({message:ea.responseText}):(na=new FileReader,na.onload=function(){try{N({message:JSON.parse(na.result).Message})}catch(W){N(W)}},na.readAsText(ea.response))}catch(W){N({})}});ea.send(J)}else if(H.clear())try{this.doImportVisio(c,f,N,t)}catch(aa){N(aa)}}else N({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?+L():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",L,null,null,null,N))}),D)};EditorUi.prototype.importGraphML=function(c,f,l){var t=mxUtils.bind(this,function(q){this.loadingExtensions=!1;null!=l?l(q):this.handleError(q)});this.createTimeout(null,mxUtils.bind(this,function(q){var D=mxUtils.bind(this,function(N){q.clear()&&t(N)}),H=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(q.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,f,t)}catch(N){D(N)}else D({message:mxResources.get("serviceUnavailableOrBlocked")})});+this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?H():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",H,null,null,null,D))}),t)};EditorUi.prototype.exportVisio=function(c){if(this.spinner.spin(document.body,mxResources.get("loading"))){var f=mxUtils.bind(this,function(l){this.loadingExtensions=!1;this.handleError(l)});this.vsdxExportEnabled()?this.createTimeout(null,mxUtils.bind(this,function(l){var t=mxUtils.bind(this,function(D){l.clear()&&f(D)}),q=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(l.clear())if("undefined"!==typeof VsdxExport)try{this.spinner.stop(),(new VsdxExport(this)).exportCurrentDiagrams(c)||t({message:mxResources.get("unknownError")})}catch(D){t(D)}else t({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(q,0):(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",q,null,null,null,-t))}),f):f({message:mxResources.get("serviceUnavailableOrBlocked")})}};EditorUi.prototype.convertLucidChart=function(c,f,l){var t=mxUtils.bind(this,function(q){this.loadingExtensions=!1;null!=l?l(q):this.handleError(q)});this.createTimeout(null,mxUtils.bind(this,function(q){var D=mxUtils.bind(this,function(N){q.clear()&&t(N)}),G=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(q.clear())if("undefined"!==typeof window.LucidImporter)try{var N=JSON.parse(c);f(LucidImporter.importState(N));try{if(null!=+t))}),f):f({message:mxResources.get("serviceUnavailableOrBlocked")})}};EditorUi.prototype.convertLucidChart=function(c,f,l){var t=mxUtils.bind(this,function(q){this.loadingExtensions=!1;null!=l?l(q):this.handleError(q)});this.createTimeout(null,mxUtils.bind(this,function(q){var D=mxUtils.bind(this,function(N){q.clear()&&t(N)}),H=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(q.clear())if("undefined"!==typeof window.LucidImporter)try{var N=JSON.parse(c);f(LucidImporter.importState(N));try{if(null!=window.console&&"1"==urlParams.test){var L=[(new Date).toISOString(),"convertLucidChart",N];null!=N.state&&L.push(JSON.parse(N.state));if(null!=N.svgThumbs)for(var J=0;J<N.svgThumbs.length;J++)L.push(Editor.createSvgDataUri(N.svgThumbs[J]));null!=N.thumb&&L.push(N.thumb);console.log.apply(console,L)}}catch(Y){}}catch(Y){null!=window.console&&console.error(Y),D(Y)}else D({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?-window.setTimeout(G,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",function(){mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",G,null,null,null,D)},null,null,null,D)},null,null,null,D)},null,null,null,D)},null,null,null,D):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",G,null,null,null,D))}),-t)};EditorUi.prototype.createMermaidXml=function(c,f,l,t,q,D){var G=new Graph(document.createElement("div"));l=G.insertVertex(null,null,null,0,0,t,q,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+l+";");G.setAttributeForCell(l,"mermaidData",JSON.stringify({data:c,config:f},null,2));null!=D&&G.setAttributeForCell(l,"templatePrompt",D);c=(new mxCodec).encode(G.getModel());return mxUtils.getXml(c)};EditorUi.prototype.generateOpenAiMermaidDiagram=function(c,f,l){var t=0,q=function(){for(var G=-document.querySelectorAll('div[id*="dgeMermaidOutput-"]'),N=0;N<G.length;N++)null!=G[N].parentNode&&G[N].parentNode.removeChild(G[N])},D=mxUtils.bind(this,function(){this.createTimeout(1E4,mxUtils.bind(this,function(G){var N=new mxXmlRequest("https://www.draw.io/generate/v2",c,"POST"),L=mxUtils.bind(this,function(J){G.clear()&&(q(),l(J))});N.send(mxUtils.bind(this,function(J){if(G.isAlive())if(200<=J.getStatus()&&299>=J.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var ha=mxUtils.trim(J.getText());-this.generateMermaidImage(ha,null,mxUtils.bind(this,function(ea,aa,na){this.tryAndHandle(mxUtils.bind(this,function(){G.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram","\nprompt:",c,"\nresult:",ha),q(),f(ha,ea,aa,na))}),L)}),L,mxUtils.bind(this,function(ea){3>t++?G.clear()&&D():L(ea)}))}),L);else{var Y={message:mxResources.get("error")+" "+J.getStatus()};try{Y=JSON.parse(J.getText()),Y=Y.error}catch(ha){}L(Y)}}),L)}),l)});D()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=+window.setTimeout(H,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",function(){mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",H,null,null,null,D)},null,null,null,D)},null,null,null,D)},null,null,null,D)},null,null,null,D):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",H,null,null,null,D))}),+t)};EditorUi.prototype.createMermaidXml=function(c,f,l,t,q,D){var H=new Graph(document.createElement("div"));l=H.insertVertex(null,null,null,0,0,t,q,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+l+";");H.setAttributeForCell(l,"mermaidData",JSON.stringify({data:c,config:f},null,2));null!=D&&H.setAttributeForCell(l,"templatePrompt",D);c=(new mxCodec).encode(H.getModel());return mxUtils.getXml(c)};EditorUi.prototype.generateOpenAiMermaidDiagram=function(c,f,l){var t=0,q=function(){for(var H=+document.querySelectorAll('div[id*="dgeMermaidOutput-"]'),N=0;N<H.length;N++)null!=H[N].parentNode&&H[N].parentNode.removeChild(H[N])},D=mxUtils.bind(this,function(){this.createTimeout(1E4,mxUtils.bind(this,function(H){var N=new mxXmlRequest("https://www.draw.io/generate/v2",c,"POST"),L=mxUtils.bind(this,function(J){H.clear()&&(q(),l(J))});N.send(mxUtils.bind(this,function(J){if(H.isAlive())if(200<=J.getStatus()&&299>=J.getStatus())this.tryAndHandle(mxUtils.bind(this,function(){var ha=mxUtils.trim(J.getText());+this.generateMermaidImage(ha,null,mxUtils.bind(this,function(ea,aa,na){this.tryAndHandle(mxUtils.bind(this,function(){H.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram","\nprompt:",c,"\nresult:",ha),q(),f(ha,ea,aa,na))}),L)}),L,mxUtils.bind(this,function(ea){3>t++?H.clear()&&D():L(ea)}))}),L);else{var Y={message:mxResources.get("error")+" "+J.getStatus()};try{Y=JSON.parse(J.getText()),Y=Y.error}catch(ha){}L(Y)}}),L)}),l)});D()};EditorUi.prototype.extractMermaidDeclaration=function(c){c=mxUtils.trim(c);"o\n\n"==c.substring(0,3)&&(c=c.substring(3));var f=c.split("```");f=1<f.length?f:c.split("<pre>");f=1<f.length?f:c.split("~~~");f=1<f.length?f:c.split("%%");f=1<f.length?f:c.split("(Begins)");c=mxUtils.trim(1>=f.length?c:f[1]);f=c.split("\n");var l=1<f.length?f[1]:null;if(null!=l){var t=l.indexOf("-");0<t&&(l=l.substring(0,t))}if(0<f.length&&"mermaid"==mxUtils.trim(f[0])||null!=l&&0<=mxUtils.indexOf(EditorUi.mermaidDiagramTypes,l))f.shift(),c=mxUtils.trim(f.join("\n")),f=c.split("\n");-l=f[0].split(" ")[0].replace(/:$/,"");t=l.indexOf("-");0<t&&(l=l.substring(0,t));try{"mindmap"==l&&2<f.length&&(c=extractMermaidMindmap(f))}catch(q){}0>mxUtils.indexOf(EditorUi.mermaidDiagramTypes,l)&&(c=null);return c};EditorUi.prototype.generateMermaidImage=function(c,f,l,t,q){var D=mxUtils.bind(this,function(N){this.loadingMermaid=!1;null!=t?t(N):this.handleError(N)}),G=mxUtils.bind(this,function(){try{this.loadingMermaid=!1;f=null!=f?f:mxUtils.clone(EditorUi.defaultMermaidConfig);f.securityLevel=+l=f[0].split(" ")[0].replace(/:$/,"");t=l.indexOf("-");0<t&&(l=l.substring(0,t));try{"mindmap"==l&&2<f.length&&(c=extractMermaidMindmap(f))}catch(q){}0>mxUtils.indexOf(EditorUi.mermaidDiagramTypes,l)&&(c=null);return c};EditorUi.prototype.generateMermaidImage=function(c,f,l,t,q){var D=mxUtils.bind(this,function(N){this.loadingMermaid=!1;null!=t?t(N):this.handleError(N)}),H=mxUtils.bind(this,function(){try{this.loadingMermaid=!1;f=null!=f?f:mxUtils.clone(EditorUi.defaultMermaidConfig);f.securityLevel="strict";f.startOnLoad=!1;f.maxTextSize=9E5;"undefined"!==typeof mxMermaidToDrawio&&f.flowchart&&0<=c.indexOf("$$")&&(f.flowchart.htmlLabels=!0,mxMermaidToDrawio.htmlLabels=!0);Editor.isDarkMode()&&(f.theme="dark");var N=mxUtils.bind(this,function(L){try{if(mxClient.IS_IE||mxClient.IS_IE11)L=L.replace(/ xmlns:\S*="http:\/\/www.w3.org\/XML\/1998\/namespace"/g,"").replace(/ (NS xml|\S*):space="preserve"/g,' xml:space="preserve"');var J=mxUtils.parseXml(L).getElementsByTagName("svg");if(0<J.length&&"error"!=J[0].getAttribute("aria-roledescription")){var Y=parseFloat(J[0].getAttribute("width")),ha=parseFloat(J[0].getAttribute("height"));if(isNaN(Y)||isNaN(ha))try{var ea=J[0].getAttribute("viewBox").split(/\s+/);Y=parseFloat(ea[2]);ha=parseFloat(ea[3])}catch(aa){Y=Y||100,ha=ha||100}l(this.convertDataUri(Editor.createSvgDataUri(L)),Y,ha)}else null!=q?q():t({message:mxResources.get("invalidInput")})}catch(aa){t(aa)}});mermaid.mermaidAPI.initialize(f);mermaid.mermaidAPI.render("geMermaidOutput-"+-(new Date).getTime(),c).then(function(L){N(L.svg)}).catch(function(L){null!=q?q(L):t(L)})}catch(L){t(L)}});"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(G,0):(this.loadingMermaid=!0,"1"==urlParams.dev?("1"==urlParams.mermaidToDrawioTest&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(N){this.importXml(N,null,null,null,null,null,!0)})),mxscript("js/mermaid/mermaid.min.js",G,null,null,null,D)):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",-G,null,null,null,D))};EditorUi.prototype.generatePlantUmlImage=function(c,f,l,t){function q(N,L,J){c1=N>>2;c2=(N&3)<<4|L>>4;c3=(L&15)<<2|J>>6;c4=J&63;r="";r+=D(c1&63);r+=D(c2&63);r+=D(c3&63);return r+=D(c4&63)}function D(N){if(10>N)return String.fromCharCode(48+N);N-=10;if(26>N)return String.fromCharCode(65+N);N-=26;if(26>N)return String.fromCharCode(97+N);N-=26;return 0==N?"-":1==N?"_":"?"}var G=new XMLHttpRequest;G.open("GET",("txt"==f?PLANT_URL+"/txt/":"png"==f?PLANT_URL+"/png/":PLANT_URL+"/svg/")+-function(N){r="";for(i=0;i<N.length;i+=3)r=i+2==N.length?r+q(N.charCodeAt(i),N.charCodeAt(i+1),0):i+1==N.length?r+q(N.charCodeAt(i),0,0):r+q(N.charCodeAt(i),N.charCodeAt(i+1),N.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(c))),!0);"txt"!=f&&(G.responseType="blob");G.onload=function(N){if(200<=this.status&&300>this.status)if("txt"==f)l(this.response);else{var L=new FileReader;L.readAsDataURL(this.response);L.onloadend=function(J){var Y=new Image;Y.onload=function(){try{var ha=-Y.width,ea=Y.height;if(0==ha&&0==ea){var aa=L.result,na=aa.indexOf(","),W=decodeURIComponent(escape(atob(aa.substring(na+1)))),ba=mxUtils.parseXml(W).getElementsByTagName("svg");0<ba.length&&(ha=parseFloat(ba[0].getAttribute("width")),ea=parseFloat(ba[0].getAttribute("height")))}l(L.result,ha,ea)}catch(ja){t(ja)}};Y.src=L.result};L.onerror=function(J){t(J)}}else t(N)};G.onerror=function(N){t(N)};G.send()};EditorUi.prototype.insertAsPreText=function(c,f,l){var t=this.editor.graph,q=null;t.getModel().beginUpdate();-try{q=t.insertVertex(null,null,"<pre>"+c+"</pre>",f,l,1,1,"text;html=1;align=left;verticalAlign=top;"),t.updateCellSize(q,!0)}finally{t.getModel().endUpdate()}return q};EditorUi.prototype.insertTextAt=function(c,f,l,t,q,D,G,N){D=null!=D?D:!0;G=null!=G?G:!0;if(null!=c)if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c))this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(c.replace(/\s+/g," "),mxUtils.bind(this,function(ea){4==+(new Date).getTime(),c).then(function(L){N(L.svg)}).catch(function(L){null!=q?q(L):t(L)})}catch(L){t(L)}});"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(H,0):(this.loadingMermaid=!0,"1"==urlParams.dev?("1"==urlParams.mermaidToDrawioTest&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(N){this.importXml(N,null,null,null,null,null,!0)})),mxscript("js/mermaid/mermaid.min.js",H,null,null,null,D)):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",+H,null,null,null,D))};EditorUi.prototype.generatePlantUmlImage=function(c,f,l,t){function q(N,L,J){c1=N>>2;c2=(N&3)<<4|L>>4;c3=(L&15)<<2|J>>6;c4=J&63;r="";r+=D(c1&63);r+=D(c2&63);r+=D(c3&63);return r+=D(c4&63)}function D(N){if(10>N)return String.fromCharCode(48+N);N-=10;if(26>N)return String.fromCharCode(65+N);N-=26;if(26>N)return String.fromCharCode(97+N);N-=26;return 0==N?"-":1==N?"_":"?"}var H=new XMLHttpRequest;H.open("GET",("txt"==f?PLANT_URL+"/txt/":"png"==f?PLANT_URL+"/png/":PLANT_URL+"/svg/")++function(N){r="";for(i=0;i<N.length;i+=3)r=i+2==N.length?r+q(N.charCodeAt(i),N.charCodeAt(i+1),0):i+1==N.length?r+q(N.charCodeAt(i),0,0):r+q(N.charCodeAt(i),N.charCodeAt(i+1),N.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(c))),!0);"txt"!=f&&(H.responseType="blob");H.onload=function(N){if(200<=this.status&&300>this.status)if("txt"==f)l(this.response);else{var L=new FileReader;L.readAsDataURL(this.response);L.onloadend=function(J){var Y=new Image;Y.onload=function(){try{var ha=+Y.width,ea=Y.height;if(0==ha&&0==ea){var aa=L.result,na=aa.indexOf(","),W=decodeURIComponent(escape(atob(aa.substring(na+1)))),ba=mxUtils.parseXml(W).getElementsByTagName("svg");0<ba.length&&(ha=parseFloat(ba[0].getAttribute("width")),ea=parseFloat(ba[0].getAttribute("height")))}l(L.result,ha,ea)}catch(ja){t(ja)}};Y.src=L.result};L.onerror=function(J){t(J)}}else t(N)};H.onerror=function(N){t(N)};H.send()};EditorUi.prototype.insertAsPreText=function(c,f,l){var t=this.editor.graph,q=null;t.getModel().beginUpdate();+try{q=t.insertVertex(null,null,"<pre>"+c+"</pre>",f,l,1,1,"text;html=1;align=left;verticalAlign=top;"),t.updateCellSize(q,!0)}finally{t.getModel().endUpdate()}return q};EditorUi.prototype.insertTextAt=function(c,f,l,t,q,D,H,N){D=null!=D?D:!0;H=null!=H?H:!0;if(null!=c)if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c))this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(c.replace(/\s+/g," "),mxUtils.bind(this,function(ea){4==ea.readyState&&200<=ea.status&&299>=ea.status&&this.editor.graph.setSelectionCells(this.insertTextAt(ea.responseText,f,l,!0))}));else if("data:"==c.substring(0,5)||!this.isOffline()&&(q||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var L=this.editor.graph;if("data:application/pdf;base64,"==c.substring(0,28)){var J=Editor.extractGraphModelFromPdf(c);if(null!=J&&0<J.length)return this.importXml(J,f,l,D,!0,N)}if(Editor.isPngDataUrl(c)&&(J=Editor.extractGraphModelFromPng(c),null!=J&&0<J.length))return this.importXml(J,f,l,D,!0,N);if("data:image/svg+xml;"==c.substring(0,19))try{J=null;"data:image/svg+xml;base64,"==c.substring(0,26)?(J=c.substring(c.indexOf(",")+1),J=window.atob&&!mxClient.IS_SF?atob(J):Base64.decode(J,!0)):J=decodeURIComponent(c.substring(c.indexOf(",")+1));var Y=this.importXml(J,f,l,D,!0,N);if(0<Y.length)return Y}catch(ea){}this.loadImage(c,mxUtils.bind(this,function(ea){if("data:"==c.substring(0,5))this.resizeImage(ea,c,mxUtils.bind(this,function(W,ba,ja){L.setSelectionCell(L.insertVertex(null,-null,"",L.snap(f),L.snap(l),ba,ja,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(W)+";"))}),G,this.maxImageSize);else{var aa=Math.min(1,Math.min(this.maxImageSize/ea.width,this.maxImageSize/ea.height)),na=Math.round(ea.width*aa);ea=Math.round(ea.height*aa);L.setSelectionCell(L.insertVertex(null,null,"",L.snap(f),L.snap(l),na,ea,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="++null,"",L.snap(f),L.snap(l),ba,ja,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(W)+";"))}),H,this.maxImageSize);else{var aa=Math.min(1,Math.min(this.maxImageSize/ea.width,this.maxImageSize/ea.height)),na=Math.round(ea.width*aa);ea=Math.round(ea.height*aa);L.setSelectionCell(L.insertVertex(null,null,"",L.snap(f),L.snap(l),na,ea,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";"))}}),mxUtils.bind(this,function(){var ea=null;L.getModel().beginUpdate();try{ea=L.insertVertex(L.getDefaultParent(),null,c,L.snap(f),L.snap(l),1,1,"text;"+(t?"html=1;":"")),L.updateCellSize(ea),L.fireEvent(new mxEventObject("textInserted","cells",[ea]))}finally{L.getModel().endUpdate()}L.setSelectionCell(ea)}))}else{c=Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,f,l,D,null,N);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(ea){this.editor.graph.setSelectionCells(this.importXml(ea,f,l,D,null,N))}),mxUtils.bind(this,function(ea){this.handleError(ea)}));else{L=this.editor.graph;q=null;L.getModel().beginUpdate();try{q=L.insertVertex(L.getDefaultParent(),null,"",L.snap(f),L.snap(l),1,1,"text;whiteSpace=wrap;"+(t?"html=1;":""));L.fireEvent(new mxEventObject("textInserted","cells",[q]));t&&(c=L.sanitizeHtml(c));c.length>this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");q.value=c;L.updateCellSize(q);if(0<this.maxTextWidth&&q.geometry.width>this.maxTextWidth){var ha=L.getPreferredSizeForCell(q,this.maxTextWidth);q.geometry.width=ha.width;q.geometry.height=ha.height}Graph.isLink(q.value)&&L.setLinkForCell(q,q.value);q.geometry.width+=L.gridSize;q.geometry.height+=L.gridSize}finally{L.getModel().endUpdate()}return[q]}}return[]};EditorUi.prototype.formatFileSize=function(c){var f=-1;do c/=1024,f++;while(1024<c);return Math.max(c,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[f]};EditorUi.prototype.convertDataUri=function(c){if("data:"==c.substring(0,5)){var f=c.indexOf(";");0<f&&(c=c.substring(0,f)+c.substring(c.indexOf(",",f+1)))}return c};EditorUi.prototype.isRemoteFileFormat=function(c,f){return/("contentType":\s*"application\/gliffy\+json")/.test(c)};EditorUi.prototype.isLucidChartData=function(c){return null!=c&&('{"state":"{\\"Properties\\":'==c.substring(0,26)||'{"Properties":'==c.substring(0,14))};EditorUi.prototype.importLocalFile=function(c,f){if(c&&Graph.fileSupport){if(null==this.importFileInputElt){var l=-document.createElement("input");l.setAttribute("type","file");mxEvent.addListener(l,"change",mxUtils.bind(this,function(){null!=l.files&&(this.importFiles(l.files,null,null,this.maxImageSize),l.type="",l.type="file",l.value="")}));l.style.display="none";document.body.appendChild(l);this.importFileInputElt=l}this.importFileInputElt.click()}else{window.openNew=!1;window.openKey="import";window.listBrowserFiles=mxUtils.bind(this,function(G,N){StorageFile.listFiles(this,"F",G,N)});window.openBrowserFile=-mxUtils.bind(this,function(G,N,L){StorageFile.getFileContent(this,G,N,L)});window.deleteBrowserFile=mxUtils.bind(this,function(G,N,L){StorageFile.deleteFile(this,G,N,L)});if(!f){var t=Editor.useLocalStorage;Editor.useLocalStorage=!c}window.openFile=new OpenFile(mxUtils.bind(this,function(G){this.hideDialog(G)}));window.openFile.setConsumer(mxUtils.bind(this,function(G,N){null!=N&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(N)?(G=new Blob([G],{type:"application/octet-stream"}),this.importVisio(G,-mxUtils.bind(this,function(L){this.importXml(L,0,0,!0)}),null,N)):this.editor.graph.setSelectionCells(this.importXml(G,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null});if(!f){var q=this.dialog,D=q.close;this.dialog.close=mxUtils.bind(this,function(G){Editor.useLocalStorage=t;D.apply(q,arguments);G&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=-function(c,f,l){var t=this,q=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(c).then(function(D){if(mxUtils.isEmptyObject(D.files))l();else{var G=0,N,L=!1;D.forEach(function(J,Y){J=Y.name.toLowerCase();"diagram/diagram.xml"==J?(L=!0,Y.async("string").then(function(ha){0==ha.indexOf("<mxfile ")?f(ha):l()})):0==J.indexOf("versions/")&&(J=parseInt(J.substr(9)),J>G&&(G=J,N=Y))});0<G?N.async("string").then(function(J){(new XMLHttpRequest).upload&&t.isRemoteFileFormat(J,-c.name)?t.isOffline()?t.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,l):t.parseFileData(J,mxUtils.bind(this,function(Y){4==Y.readyState&&(200<=Y.status&&299>=Y.status?f(Y.responseText):l())}),c.name):l()}):L||l()}},function(D){l(D)}):l()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?q():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",q,null,null,null,l))};EditorUi.prototype.importFile=function(c,f,l,t,q,D,G,-N,L,J,Y,ha){J=null!=J?J:!0;var ea=!1,aa=null,na=mxUtils.bind(this,function(W){var ba=null;null!=W&&"<mxlibrary"==W.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,W,G)),this.showSidebar()):ba=this.importXml(W,l,t,J,null,null!=ha?mxEvent.isControlDown(ha):null);null!=N&&N(ba)});"image"==f.substring(0,5)?(L=!1,"image/png"==f.substring(0,9)&&(Y=Y?null:this.extractGraphModelFromPng(c),null!=Y&&0<Y.length&&(aa=this.importXml(Y,l,t,J,null,null!=ha?mxEvent.isControlDown(ha):null),L=!0)),L||(L=this.editor.graph,-Y=c.indexOf(";"),0<Y&&(c=c.substring(0,Y)+c.substring(c.indexOf(",",Y+1))),J&&L.isGridEnabled()&&(l=L.snap(l),t=L.snap(t)),Y="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;","image/svg"==f.substring(0,9)&&(Y+="editableCssRules=.*;"),aa=[L.insertVertex(null,null,"",l,t,q,D,Y+"image="+c+";")])):/(\.*<graphml )/.test(c)?(ea=!0,this.importGraphML(c,na)):null!=L&&null!=G&&EditorUi.isVisioFilename(G)?(ea=!0,this.importVisio(L,na)):(new XMLHttpRequest).upload&&-this.isRemoteFileFormat(c,G)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(ea=!0,f=mxUtils.bind(this,function(W){4==W.readyState&&(200<=W.status&&299>=W.status?na(W.responseText):null!=N&&(N(null),this.showError(mxResources.get("error"),413==W.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),null!=c?this.parseFileData(c,f,G):this.parseFile(L,f,G)):0==c.indexOf("PK")&&null!=L?(ea=!0,this.importZipFile(L,na,mxUtils.bind(this,-function(){aa=this.insertTextAt(this.validateFileData(c),l,t,!0,null,J);N(aa)}))):/(\.v(sd|dx))($|\?)/i.test(G)||/(\.vs(s|x))($|\?)/i.test(G)||(aa=this.insertTextAt(this.validateFileData(c),l,t,!0,null,J,null,null!=ha?mxEvent.isControlDown(ha):null));ea||null==N||N(aa);return aa};EditorUi.prototype.importFiles=function(c,f,l,t,q,D,G,N,L,J,Y,ha,ea){t=null!=t?t:this.maxImageSize;J=null!=J?J:this.maxImageBytes;var aa=null!=f&&null!=l,na=!0;f=null!=f?f:0;l=null!=l?l:0;var W=!1;if(!mxClient.IS_CHROMEAPP&&+document.createElement("input");l.setAttribute("type","file");mxEvent.addListener(l,"change",mxUtils.bind(this,function(){null!=l.files&&(this.importFiles(l.files,null,null,this.maxImageSize),l.type="",l.type="file",l.value="")}));l.style.display="none";document.body.appendChild(l);this.importFileInputElt=l}this.importFileInputElt.click()}else{window.openNew=!1;window.openKey="import";window.listBrowserFiles=mxUtils.bind(this,function(H,N){StorageFile.listFiles(this,"F",H,N)});window.openBrowserFile=+mxUtils.bind(this,function(H,N,L){StorageFile.getFileContent(this,H,N,L)});window.deleteBrowserFile=mxUtils.bind(this,function(H,N,L){StorageFile.deleteFile(this,H,N,L)});if(!f){var t=Editor.useLocalStorage;Editor.useLocalStorage=!c}window.openFile=new OpenFile(mxUtils.bind(this,function(H){this.hideDialog(H)}));window.openFile.setConsumer(mxUtils.bind(this,function(H,N){null!=N&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(N)?(H=new Blob([H],{type:"application/octet-stream"}),this.importVisio(H,+mxUtils.bind(this,function(L){this.importXml(L,0,0,!0)}),null,N)):this.editor.graph.setSelectionCells(this.importXml(H,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null});if(!f){var q=this.dialog,D=q.close;this.dialog.close=mxUtils.bind(this,function(H){Editor.useLocalStorage=t;D.apply(q,arguments);H&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=+function(c,f,l){var t=this,q=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(c).then(function(D){if(mxUtils.isEmptyObject(D.files))l();else{var H=0,N,L=!1;D.forEach(function(J,Y){J=Y.name.toLowerCase();"diagram/diagram.xml"==J?(L=!0,Y.async("string").then(function(ha){0==ha.indexOf("<mxfile ")?f(ha):l()})):0==J.indexOf("versions/")&&(J=parseInt(J.substr(9)),J>H&&(H=J,N=Y))});0<H?N.async("string").then(function(J){(new XMLHttpRequest).upload&&t.isRemoteFileFormat(J,+c.name)?t.isOffline()?t.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,l):t.parseFileData(J,mxUtils.bind(this,function(Y){4==Y.readyState&&(200<=Y.status&&299>=Y.status?f(Y.responseText):l())}),c.name):l()}):L||l()}},function(D){l(D)}):l()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?q():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",q,null,null,null,l))};EditorUi.prototype.importFile=function(c,f,l,t,q,D,H,+N,L,J,Y,ha){J=null!=J?J:!0;var ea=!1,aa=null,na=mxUtils.bind(this,function(W){var ba=null;null!=W&&"<mxlibrary"==W.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,W,H)),this.showSidebar()):ba=this.importXml(W,l,t,J,null,null!=ha?mxEvent.isControlDown(ha):null);null!=N&&N(ba)});"image"==f.substring(0,5)?(L=!1,"image/png"==f.substring(0,9)&&(Y=Y?null:this.extractGraphModelFromPng(c),null!=Y&&0<Y.length&&(aa=this.importXml(Y,l,t,J,null,null!=ha?mxEvent.isControlDown(ha):null),L=!0)),L||(L=this.editor.graph,+Y=c.indexOf(";"),0<Y&&(c=c.substring(0,Y)+c.substring(c.indexOf(",",Y+1))),J&&L.isGridEnabled()&&(l=L.snap(l),t=L.snap(t)),Y="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;","image/svg"==f.substring(0,9)&&(Y+="editableCssRules=.*;"),aa=[L.insertVertex(null,null,"",l,t,q,D,Y+"image="+c+";")])):/(\.*<graphml )/.test(c)?(ea=!0,this.importGraphML(c,na)):null!=L&&null!=H&&EditorUi.isVisioFilename(H)?(ea=!0,this.importVisio(L,na)):(new XMLHttpRequest).upload&&+this.isRemoteFileFormat(c,H)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(ea=!0,f=mxUtils.bind(this,function(W){4==W.readyState&&(200<=W.status&&299>=W.status?na(W.responseText):null!=N&&(N(null),this.showError(mxResources.get("error"),413==W.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),null!=c?this.parseFileData(c,f,H):this.parseFile(L,f,H)):0==c.indexOf("PK")&&null!=L?(ea=!0,this.importZipFile(L,na,mxUtils.bind(this,+function(){aa=this.insertTextAt(this.validateFileData(c),l,t,!0,null,J);N(aa)}))):/(\.v(sd|dx))($|\?)/i.test(H)||/(\.vs(s|x))($|\?)/i.test(H)||(aa=this.insertTextAt(this.validateFileData(c),l,t,!0,null,J,null,null!=ha?mxEvent.isControlDown(ha):null));ea||null==N||N(aa);return aa};EditorUi.prototype.importFiles=function(c,f,l,t,q,D,H,N,L,J,Y,ha,ea){t=null!=t?t:this.maxImageSize;J=null!=J?J:this.maxImageBytes;var aa=null!=f&&null!=l,na=!0;f=null!=f?f:0;l=null!=l?l:0;var W=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var ba=Y||this.resampleThreshold,ja=0;ja<c.length;ja++)if("image/svg"!==c[ja].type.substring(0,9)&&"image/"===c[ja].type.substring(0,6)&&c[ja].size>ba){W=!0;break}var ca=mxUtils.bind(this,function(){var la=this.editor.graph,Q=la.gridSize;q=null!=q?q:mxUtils.bind(this,function(T,X,Z,ka,va,ua,qa,Ba,ya){try{if(null!=T&&"<mxlibrary"==T.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,T,qa)),this.showSidebar(),null;this.isCompatibleString(T)&&1==c.length&&null!=ea&&"drop"==ea.type&&this.isBlankFile()&&!this.canUndo()&&(aa=!1,ka=Z=0);return this.importFile(T,X,Z,ka,va,ua,qa,Ba,ya,aa,ha,ea)}catch(La){return this.handleError(La),null}});D=null!=D?D:mxUtils.bind(this,function(T){la.setSelectionCells(T)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var k=c.length,B=k,I=[],U=mxUtils.bind(this,function(T,X){I[T]=X;if(0==--B){this.spinner.stop();if(null!=N)N(I);else{var Z=[];la.getModel().beginUpdate();try{for(T=0;T<I.length;T++){var ka=I[T]();-null!=ka&&(Z=Z.concat(ka))}}finally{la.getModel().endUpdate()}}D(Z)}}),P=0;P<k;P++)mxUtils.bind(this,function(T){var X=c[T];if(null!=X){var Z=new FileReader;Z.onload=mxUtils.bind(this,function(ka){if(null==G||G(X))try{if("image/"==X.type.substring(0,6))if("image/svg"==X.type.substring(0,9)){var va=Graph.clipSvgDataUri(ka.target.result),ua=va.indexOf(","),qa=decodeURIComponent(escape(atob(va.substring(ua+1)))),Ba=mxUtils.parseXml(qa),ya=Ba.getElementsByTagName("svg");if(0<ya.length){var La=ya[0],za=+null!=ka&&(Z=Z.concat(ka))}}finally{la.getModel().endUpdate()}}D(Z)}}),P=0;P<k;P++)mxUtils.bind(this,function(T){var X=c[T];if(null!=X){var Z=new FileReader;Z.onload=mxUtils.bind(this,function(ka){if(null==H||H(X))try{if("image/"==X.type.substring(0,6))if("image/svg"==X.type.substring(0,9)){var va=Graph.clipSvgDataUri(ka.target.result),ua=va.indexOf(","),qa=decodeURIComponent(escape(atob(va.substring(ua+1)))),Ba=mxUtils.parseXml(qa),ya=Ba.getElementsByTagName("svg");if(0<ya.length){var La=ya[0],za=ha?null:La.getAttribute("content");null!=za&&"<"!=za.charAt(0)&&"%"!=za.charAt(0)&&(za=unescape(window.atob?atob(za):Base64.decode(za,!0)));null!=za&&"%"==za.charAt(0)&&(za=decodeURIComponent(za));null==za||"<mxfile "!==za.substring(0,8)&&"<mxGraphModel "!==za.substring(0,14)?U(T,mxUtils.bind(this,function(){try{if(null!=Ba){var Ca=Ba.getElementsByTagName("svg");if(0<Ca.length){var Aa=Ca[0],wa=Aa.getAttribute("width"),Ya=Aa.getAttribute("height");wa=null!=wa&&"%"!=wa.charAt(wa.length-1)?parseFloat(wa):NaN;Ya=null!=Ya&&"%"!=Ya.charAt(Ya.length-1)?parseFloat(Ya):NaN;var Qa=Aa.getAttribute("viewBox");if(null==Qa||0==Qa.length)Aa.setAttribute("viewBox","0 0 "+wa+" "+Ya);else if(isNaN(wa)||isNaN(Ya)){var Ra=Qa.split(" ");3<Ra.length&&(wa=parseFloat(Ra[2]),Ya=parseFloat(Ra[3]))}va=Editor.createSvgDataUri(mxUtils.getXml(Aa));var Sa=Math.min(1,Math.min(t/Math.max(1,wa)),t/Math.max(1,Ya)),Ha=q(va,X.type,f+T*Q,l+T*Q,Math.max(1,Math.round(wa*Sa)),Math.max(1,Math.round(Ya*Sa)),X.name);if(null!=Ha&&(isNaN(wa)||isNaN(Ya))){var Ma=new Image;Ma.onload=mxUtils.bind(this,function(){wa=Math.max(1,Ma.width);Ya=Math.max(1,Ma.height);Ha[0].geometry.width=wa;Ha[0].geometry.height=Ya;Aa.setAttribute("viewBox","0 0 "+wa+" "+Ya);va=Editor.createSvgDataUri(mxUtils.getXml(Aa));var y=va.indexOf(";");0<y&&(va=va.substring(0,y)+va.substring(va.indexOf(",",y+1)));la.setCellStyles("image",va,[Ha[0]])});Ma.src=Editor.createSvgDataUri(mxUtils.getXml(Aa))}return Ha}}}catch(y){}return null})):U(T,mxUtils.bind(this,function(){return q(za,@@ -3739,21 +3741,21 @@ isNaN(Ya))){var Ma=new Image;Ma.onload=mxUtils.bind(this,function(){wa=Math.max(mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(ka.target.result,mxUtils.bind(this,function(Ca){this.resizeImage(Ca,ka.target.result,mxUtils.bind(this,function(Aa,wa,Ya){U(T,mxUtils.bind(this,function(){if(null!=Aa&&Aa.length<J){var Qa=na&&this.isResampleImageSize(X.size,Y)?Math.min(1,Math.min(t/wa,t/Ya)):1;return q(Aa,X.type,f+T*Q,l+T*Q,Math.round(wa*Qa),Math.round(Ya*Qa),X.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),na,t,Y,X.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else va=ka.target.result,q(va,X.type,f+T*Q,l+T*Q,240,160,X.name,function(Ca){U(T,function(){return Ca})},X)}catch(Ca){U(T,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(Ca,X)}else U(T,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(X.name)?q(null,X.type,f+T*Q,l+T*Q,240,160,X.name,function(ka){U(T,function(){return ka})},X):"image"==X.type.substring(0,5)||"application/pdf"==X.type?Z.readAsDataURL(X):Z.readAsText(X)}})(P)});if(W){W=[];for(ja=0;ja<c.length;ja++)W.push(c[ja]);c=W;this.confirmImageResize(function(la){na=la;ca()},L)}else ca()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=function(c,f){f=null!=f?f:!1;var l=null!=this.spinner&&null!=this.spinner.pause?-this.spinner.pause():function(){},t=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,q=function(D,G){if(D||f)mxSettings.setResizeImages(D?G:null),mxSettings.save();l();c(G)};null==t||f?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(D){q(D,!0)},function(D){q(D,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',+this.spinner.pause():function(){},t=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,q=function(D,H){if(D||f)mxSettings.setResizeImages(D?H:null),mxSettings.save();l();c(H)};null==t||f?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(D){q(D,!0)},function(D){q(D,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?226:200,!0,!0):q(!1,t)};EditorUi.prototype.parseFile=function(c,f,l){l=null!=l?l:c.name;var t=new FileReader;t.onload=mxUtils.bind(this,function(){this.parseFileData(t.result,f,l)});t.readAsText(c)};EditorUi.prototype.parseFileData=function(c,f,l){var t=new XMLHttpRequest;t.open("POST",OPEN_URL);t.setRequestHeader("Content-Type","application/x-www-form-urlencoded");t.onreadystatechange=function(){f(t)};t.send("format=xml&filename="+-encodeURIComponent(l)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(q){}};EditorUi.prototype.isResampleImageSize=function(c,f){f=null!=f?f:this.resampleThreshold;return c>f};EditorUi.prototype.resizeImage=function(c,f,l,t,q,D,G){q=null!=q?q:this.maxImageSize;var N=Math.max(1,c.width),L=Math.max(1,c.height),J=f;if(t&&this.isResampleImageSize(null!=G?G:f.length,D))try{var Y=Math.max(N/q,L/q);if(1<Y){var ha=Math.round(N/Y),ea=Math.round(L/-Y),aa=document.createElement("canvas");aa.width=ha;aa.height=ea;aa.getContext("2d").drawImage(c,0,0,ha,ea);var na=aa.toDataURL();if(na.length<f.length){var W=document.createElement("canvas");W.width=ha;W.height=ea;var ba=W.toDataURL();na!==ba&&(f=na,N=ha,L=ea)}}}catch(ja){}t&&J!=f&&q>this.maxImageSize/2&&f.length>this.maxImageBytes?this.resizeImage(c,f,l,t,q/1.5,D,G):l(f,N,L)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=+encodeURIComponent(l)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+file.size})}catch(q){}};EditorUi.prototype.isResampleImageSize=function(c,f){f=null!=f?f:this.resampleThreshold;return c>f};EditorUi.prototype.resizeImage=function(c,f,l,t,q,D,H){q=null!=q?q:this.maxImageSize;var N=Math.max(1,c.width),L=Math.max(1,c.height),J=f;if(t&&this.isResampleImageSize(null!=H?H:f.length,D))try{var Y=Math.max(N/q,L/q);if(1<Y){var ha=Math.round(N/Y),ea=Math.round(L/+Y),aa=document.createElement("canvas");aa.width=ha;aa.height=ea;aa.getContext("2d").drawImage(c,0,0,ha,ea);var na=aa.toDataURL();if(na.length<f.length){var W=document.createElement("canvas");W.width=ha;W.height=ea;var ba=W.toDataURL();na!==ba&&(f=na,N=ha,L=ea)}}}catch(ja){}t&&J!=f&&q>this.maxImageSize/2&&f.length>this.maxImageBytes?this.resizeImage(c,f,l,t,q/1.5,D,H):l(f,N,L)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,f,l){try{var t=new Image;t.onload=function(){t.width=0<t.width?t.width:120;t.height=0<t.height?t.height:120;f(t)};null!=l&&(t.onerror=l);t.src=c}catch(q){if(null!=l)l(q);else throw q;}};EditorUi.prototype.getDefaultSketchMode=function(){var c="1"==urlParams.sketch;return"0"!=(null!=urlParams.rough?urlParams.rough:c)};var v=EditorUi.prototype.createUi;EditorUi.prototype.createUi=function(){Editor.isSettingsEnabled()&&(null!=mxSettings.settings.sidebarTitles&&(Sidebar.prototype.sidebarTitles=-mxSettings.settings.sidebarTitles),this.formatWidth=mxSettings.getFormatWidth());v.apply(this,arguments);Editor.isSettingsEnabled()&&this.doSetSketchMode(null!=mxSettings.settings.sketchMode&&null==urlParams.rough&&null==urlParams.sketch?mxSettings.settings.sketchMode:this.getDefaultSketchMode())};var p=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();var c=this,f=this.editor.graph,l=f.isEnabled;f.isEnabled=function(){return l.apply(this,+mxSettings.settings.sidebarTitles),this.formatWidth=mxSettings.getFormatWidth());v.apply(this,arguments);Editor.isSettingsEnabled()&&this.doSetSketchMode(null!=mxSettings.settings.sketchMode&&null==urlParams.rough&&null==urlParams.sketch?mxSettings.settings.sketchMode:this.getDefaultSketchMode())};var n=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();var c=this,f=this.editor.graph,l=f.isEnabled;f.isEnabled=function(){return l.apply(this,arguments)&&!c.isLocked()};Graph.touchStyle&&(f.panningHandler.isPanningTrigger=function(Q){var k=Q.getEvent();return null==Q.getState()&&!mxEvent.isMouseEvent(k)&&!f.freehand.isDrawing()||mxEvent.isPopupTrigger(k)&&(null==Q.getState()||mxEvent.isControlDown(k)||mxEvent.isShiftDown(k))});f.cellEditor.editPlantUmlData=function(Q,k,B){var I=JSON.parse(B);k=new TextareaDialog(c,mxResources.get("plantUml")+":",I.data,function(U){null!=U&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generatePlantUmlImage(U,I.format,function(P,T,X){c.spinner.stop();f.getModel().beginUpdate();try{if("txt"==I.format)f.labelChanged(Q,"<pre>"+P+"</pre>"),f.updateCellSize(Q,!0);else{f.setCellStyles("image",c.convertDataUri(P),[Q]);var Z=f.model.getGeometry(Q);null!=Z&&(Z=Z.clone(),Z.width=T,Z.height=X,f.cellsResized([Q],[Z],!1))}f.setAttributeForCell(Q,"plantUmlData",JSON.stringify({data:U,format:I.format}))}finally{f.getModel().endUpdate()}},function(P){c.handleError(P)})},null,null,400,220);c.showDialog(k.container,420,300,!0,!0);k.init()};f.cellEditor.editMermaidData=function(Q,k,B){var I=JSON.parse(B);k=new TextareaDialog(c,mxResources.get("mermaid")+":",I.data,function(U){null!=U&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generateMermaidImage(U,I.config,function(P,T,X){c.spinner.stop();f.getModel().beginUpdate();try{f.setCellStyles("image",P,[Q]);var Z=f.model.getGeometry(Q);null!=Z&&(Z=Z.clone(),Z.width=Math.max(Z.width,T),Z.height=Math.max(Z.height,X),f.cellsResized([Q],[Z],!1));f.setAttributeForCell(Q,"mermaidData",JSON.stringify({data:U,config:I.config},null,2))}finally{f.getModel().endUpdate()}},function(P){c.handleError(P)})},null,null,400,220);c.showDialog(k.container,420,300,!0,!0);k.init()};var t=f.cellEditor.startEditing;f.cellEditor.startEditing=function(Q,k){try{var B=this.graph.getAttributeForCell(Q,"plantUmlData");if(null!=B)this.editPlantUmlData(Q,k,B);else if(B=this.graph.getAttributeForCell(Q,"mermaidData"),null!=B&&window.isMermaidEnabled)this.editMermaidData(Q,k,B);else{var I=f.getCellStyle(Q);"1"==mxUtils.getValue(I,"metaEdit","0")?c.showDataDialog(Q):t.apply(this,arguments)}}catch(U){c.handleError(U)}};f.getLinkTitle=function(Q){return c.getLinkTitle(Q)};f.customLinkClicked=function(Q,k){var B=!1;try{var I=this.getGraphBounds();c.handleCustomLink(Q,k);B=!0;c.chromelessResize&&!I.equals(this.getGraphBounds())&&(c.chromelessResize(),this.scrollCellToVisible(k))}catch(U){c.handleError(U)}return B};var q=f.parseBackgroundImage;f.parseBackgroundImage=function(Q){var k=q.apply(this,arguments);null!=k&&null!=k.src&&Graph.isPageLink(k.src)&&(k={originalSrc:k.src});return k};var D=f.setBackgroundImage;f.setBackgroundImage=function(Q){null!=Q&&null!=Q.originalSrc&&(Q=c.createImageForPageLink(Q.originalSrc,c.currentPage,this));D.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(){f.refreshBackgroundImage()}));this.editor.addListener("pagesPatched",mxUtils.bind(this,-function(Q,k){Q=null!=f.backgroundImage?f.backgroundImage.originalSrc:null;if(null!=Q){var B=Q.indexOf(",");if(0<B)for(Q=Q.substring(B+1),k=k.getProperty("patches"),B=0;B<k.length;B++)if(null!=k[B][EditorUi.DIFF_UPDATE]&&null!=k[B][EditorUi.DIFF_UPDATE][Q]||null!=k[B][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(k[B][EditorUi.DIFF_REMOVE],Q)){f.refreshBackgroundImage();break}}}));var G=f.getBackgroundImageObject;f.getBackgroundImageObject=function(Q,k){var B=G.apply(this,arguments);null!=B&&null!=B.originalSrc&&+function(Q,k){Q=null!=f.backgroundImage?f.backgroundImage.originalSrc:null;if(null!=Q){var B=Q.indexOf(",");if(0<B)for(Q=Q.substring(B+1),k=k.getProperty("patches"),B=0;B<k.length;B++)if(null!=k[B][EditorUi.DIFF_UPDATE]&&null!=k[B][EditorUi.DIFF_UPDATE][Q]||null!=k[B][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(k[B][EditorUi.DIFF_REMOVE],Q)){f.refreshBackgroundImage();break}}}));var H=f.getBackgroundImageObject;f.getBackgroundImageObject=function(Q,k){var B=H.apply(this,arguments);null!=B&&null!=B.originalSrc&&(B=k?c.createImageForPageLink(B.originalSrc,null,null,!0):{src:B.originalSrc});return B};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var N=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(Q){Q=null!=Q?Q:"";"1"==-urlParams.dev&&(Q+=(0<Q.length?"&":"?")+"dev=1");return N.apply(this,arguments)};var L=f.addClickHandler;f.addClickHandler=function(Q,k,B){var I=k;k=function(U,P,T){if(null==P){var X=mxEvent.getSource(U);"a"==X.nodeName.toLowerCase()&&(P=X.getAttribute("href"))}null!=P&&f.isCustomLink(P)&&(mxEvent.isTouchEvent(U)||!mxEvent.isPopupTrigger(U))&&f.customLinkClicked(P,T)&&mxEvent.consume(U);null!=I&&I(U,P,T)};L.call(this,Q,k,B)};p.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(f.view.canvas.ownerSVGElement,+urlParams.dev&&(Q+=(0<Q.length?"&":"?")+"dev=1");return N.apply(this,arguments)};var L=f.addClickHandler;f.addClickHandler=function(Q,k,B){var I=k;k=function(U,P,T){if(null==P){var X=mxEvent.getSource(U);"a"==X.nodeName.toLowerCase()&&(P=X.getAttribute("href"))}null!=P&&f.isCustomLink(P)&&(mxEvent.isTouchEvent(U)||!mxEvent.isPopupTrigger(U))&&f.customLinkClicked(P,T)&&mxEvent.consume(U);null!=I&&I(U,P,T)};L.call(this,Q,k,B)};n.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(f.view.canvas.ownerSVGElement,null,!0);if(null!=this.menus){var J=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(Q,k,B){f.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(Q,["zoomIn","zoomOut","-"],null,B);J.apply(this,arguments);f.isSelectionEmpty()||null==c.addSelectionToScratchpad||this.addMenuItems(Q,["-","addToScratchpad"],null,B);f.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(Q,["-","exitGroup","home"],null,B)};var Y=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=function(Q,k,B){if(c.editor.graph.isSelectionEmpty())Y.apply(this,arguments),c.menus.addMenuItems(Q,["copyAsImage"],null,B);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(Q,k,B):this.addPopupMenuArrangeItems(Q,k,B),this.addMenuItems(Q,"- cut copy copyAsImage duplicate -".split(" "),null,B),this.isShowCellEditItems()||this.addPopupDeleteItem(Q,k,B),this.addMenuItems(Q,["lockUnlock","-"],null,B),!this.isShowStyleItems()){if(1==f.getSelectionCount()&&!f.isCellLocked(k)&&f.isCellEditable(k)&&(this.addSubmenu("editCell",Q,null,mxResources.get("edit")),Q.addSeparator(),f.getModel().isEdge(k))){this.addSubmenu("line",Q);var I=f.getModel().getGeometry(k);null!=I&&null!=I.points&&0<I.points.length&&this.addMenuItems(Q,["clearWaypoints"],null,B)}1==f.getSelectionCount()&&this.addMenuItems(Q,["enterGroup"],null,B);I=c.getSelectionState();null!=I.mergeCell?this.addMenuItem(Q,"mergeCells"):(1<I.style.colspan||1<I.style.rowspan)&&this.addMenuItem(Q,"unmergeCells")}};this.menus.isShowStyleItems=@@ -3763,8 +3765,8 @@ null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+1:1:"pagecount"==Q?null!=c.if(null==I||!f.isCustomLink(I)||!mxEvent.isTouchEvent(B)&&mxEvent.isPopupTrigger(B))W.apply(this,arguments);else{if(!f.isEnabled()||null!=Q&&f.isCellLocked(Q.cell))f.customLinkClicked(I),f.getRubberband().reset();mxEvent.consume(B)}};this.editor.getOrCreateFilename=function(){var Q=c.defaultFilename,k=c.getCurrentFile();null!=k&&(Q=null!=k.getTitle()?k.getTitle():Q);return Q};var ba=this.actions.get("print");ba.setEnabled(!mxClient.IS_IOS||!navigator.standalone);ba.visible=ba.isEnabled();if(!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(70,!0,"findReplace"),this.keyHandler.bindAction(77,!0,"editGeometry",!0),this.keyHandler.bindAction(75,!0,"tags"),this.keyHandler.bindAction(65,!1,"insertText"),this.keyHandler.bindAction(83,!1,"insertNote"),this.keyHandler.bindAction(68,!1,"insertRectangle"),this.keyHandler.bindAction(70,!1,"insertEllipse"),this.keyHandler.bindAction(76,!1,"insertLink"),this.keyHandler.bindAction(82,!1,"insertRhombus"),this.keyHandler.bindAction(67,!1,"insertEdge"),this.keyHandler.bindAction(88,!1,"insertFreehand"),this.keyHandler.bindAction(75,!0,"toggleShapes",!0),this.keyHandler.bindAction(54,!0,"adaptiveColors",!0),this.altShiftActions[81]="copyStyle",this.altShiftActions[87]="pasteStyle",this.altShiftActions[83]="synchronize","1"==urlParams.embedInline&&(document.body.classList.add("geEmbedInline"),f.addListener(mxEvent.ESCAPE,function(Q,k){null!=k&&f.isEnabled()&&!f.isEditing()&&null!=k.getProperty("event")&&c.actions.get("exit").funct()})),this.installImagePasteHandler(),-this.installNativeClipboardHandler();this.spinner=this.createSpinner(null,null,24);Graph.fileSupport&&f.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(Q){var k=f.cellEditor.text2,B=null;null!=k&&(mxEvent.addListener(k,"dragleave",function(I){null!=B&&(B.parentNode.removeChild(B),B=null);I.stopPropagation();I.preventDefault()}),mxEvent.addListener(k,"dragover",mxUtils.bind(this,function(I){null==B&&(!mxClient.IS_IE||10<document.documentMode)&&(B=this.highlightElement(k));I.stopPropagation();-I.preventDefault()})),mxEvent.addListener(k,"drop",mxUtils.bind(this,function(I){null!=B&&(B.parentNode.removeChild(B),B=null);if(0<I.dataTransfer.files.length)this.importFiles(I.dataTransfer.files,0,0,this.maxImageSize,function(P,T,X,Z,ka,va){f.insertImage(P,ka,va)},function(){},function(P){return"image/"==P.type.substring(0,6)},function(P){for(var T=0;T<P.length;T++)P[T]()},mxEvent.isControlDown(I));else if(0<=mxUtils.indexOf(I.dataTransfer.types,"text/uri-list")){var U=I.dataTransfer.getData("text/uri-list");+this.installNativeClipboardHandler();this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);Graph.fileSupport&&f.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(Q){var k=f.cellEditor.text2,B=null;null!=k&&(mxEvent.addListener(k,"dragleave",function(I){null!=B&&(B.parentNode.removeChild(B),B=null);I.stopPropagation();I.preventDefault()}),mxEvent.addListener(k,"dragover",mxUtils.bind(this,function(I){null==B&&(!mxClient.IS_IE||10<document.documentMode)&&(B=this.highlightElement(k));+I.stopPropagation();I.preventDefault()})),mxEvent.addListener(k,"drop",mxUtils.bind(this,function(I){null!=B&&(B.parentNode.removeChild(B),B=null);if(0<I.dataTransfer.files.length)this.importFiles(I.dataTransfer.files,0,0,this.maxImageSize,function(P,T,X,Z,ka,va){f.insertImage(P,ka,va)},function(){},function(P){return"image/"==P.type.substring(0,6)},function(P){for(var T=0;T<P.length;T++)P[T]()},mxEvent.isControlDown(I));else if(0<=mxUtils.indexOf(I.dataTransfer.types,"text/uri-list")){var U=I.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(U)?this.loadImage(decodeURIComponent(U),mxUtils.bind(this,function(P){var T=Math.max(1,P.width);P=Math.max(1,P.height);var X=this.maxImageSize;X=Math.min(1,Math.min(X/Math.max(1,T)),X/Math.max(1,P));f.insertImage(decodeURIComponent(U),T*X,P*X)})):document.execCommand("insertHTML",!1,I.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(I.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,I.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(I.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,I.dataTransfer.getData("text/plain"));I.stopPropagation();I.preventDefault()})))}));if(Editor.isSettingsEnabled()){ba=this.editor.graph.view;var ja=mxSettings.getUnit();ba.setUnit(ja);Editor.pageSizeUnit=ja==mxConstants.METERS?mxConstants.MILLIMETERS:ja;ba.addListener("unitChanged",function(Q,k){Q=k.getProperty("unit");mxSettings.setUnit(Q);mxSettings.save();Editor.pageSizeUnit=Q==mxConstants.METERS?mxConstants.MILLIMETERS:Q});this.ruler=!this.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,ba.unit);this.refresh()}if("1"==urlParams.styledev){ba=document.getElementById("geFooter");null!=ba&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility=@@ -3783,18 +3785,18 @@ typeof ba?"1"==ba:ba);if(this.isAutoDarkModeSupported())try{window.matchMedia("((null!=mxSettings.settings.pages&&this.setTabContainerVisible(mxSettings.settings.pages),null!=mxSettings.settings.compactMode&&this.isDefaultTheme(Editor.currentTheme)&&this.setCompactMode(mxSettings.settings.compactMode));this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(Q,k){f.enableFlowAnimation=Editor.enableAnimations;f.refresh()}));f.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&c.editor.loadFonts();"atlas"==Editor.currentTheme&&document.body.classList.add("geAtlas")};var A=EditorUi.prototype.windowResized;EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,f=Editor.smallScreenWidth;null!=this.lastWindowWidth&&this.lastWindowWidth>=f&&c<f?this.isFormatPanelVisible()&&this.toggleFormatPanel(!1):null!=this.lastWindowWidth&&this.lastWindowWidth<f&&c>=f&&(this.isFormatPanelVisible()||this.toggleFormatPanel(!0));this.lastWindowWidth=c}A.apply(this,arguments)};EditorUi.prototype.initializeInlineEmbedMode=function(){var c=this.sketchFooterMenuElt,f=this.sketchMainMenuElt,l=this.sketchPickerMenuElt,t=this.editor.graph;l.style.transform="";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,function(J){mxEvent.getSource(J)==this.diagramContainer.parentNode&&(this.embedExitPoint=new mxPoint(mxEvent.getClientX(J),mxEvent.getClientY(J)),this.sendEmbeddedSvgExport())}));-document.body.style.cursor="text";var q=document.createElement("div");q.style.position="absolute";q.style.width="10px";q.style.height="10px";q.style.borderRadius="5px";q.style.border="1px solid gray";q.style.background="#ffffff";q.style.cursor="row-resize";this.diagramContainer.parentNode.appendChild(q);this.bottomResizer=q;var D=null,G=null,N=null,L=null;mxEvent.addGestureListeners(q,mxUtils.bind(this,function(J){L=parseInt(this.diagramContainer.style.height);G=mxEvent.getClientY(J);t.popupMenuHandler.hideMenu();+document.body.style.cursor="text";var q=document.createElement("div");q.style.position="absolute";q.style.width="10px";q.style.height="10px";q.style.borderRadius="5px";q.style.border="1px solid gray";q.style.background="#ffffff";q.style.cursor="row-resize";this.diagramContainer.parentNode.appendChild(q);this.bottomResizer=q;var D=null,H=null,N=null,L=null;mxEvent.addGestureListeners(q,mxUtils.bind(this,function(J){L=parseInt(this.diagramContainer.style.height);H=mxEvent.getClientY(J);t.popupMenuHandler.hideMenu();mxEvent.consume(J)}));q=q.cloneNode(!1);q.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(q);this.rightResizer=q;mxEvent.addGestureListeners(q,mxUtils.bind(this,function(J){N=parseInt(this.diagramContainer.style.width);D=mxEvent.getClientX(J);t.popupMenuHandler.hideMenu();mxEvent.consume(J)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(J){var Y=!1;null!=D&&(this.diagramContainer.style.width=Math.max(20,N+mxEvent.getClientX(J)-D)+"px",Y=!0);null!=-G&&(this.diagramContainer.style.height=Math.max(20,L+mxEvent.getClientY(J)-G)+"px",Y=!0);Y&&((window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),function(J){null==D&&null==G||mxEvent.consume(J);G=D=null});document.body.style.backgroundColor="transparent";this.diagramContainer.style.borderRadius="4px";this.bottomResizer.style.visibility="hidden";+H&&(this.diagramContainer.style.height=Math.max(20,L+mxEvent.getClientY(J)-H)+"px",Y=!0);Y&&((window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),function(J){null==D&&null==H||mxEvent.consume(J);H=D=null});document.body.style.backgroundColor="transparent";this.diagramContainer.style.borderRadius="4px";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";this.sketchMenubarElt.style.display="none";f.style.visibility="hidden";c.style.visibility="hidden";l.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(J){this.inlineSizeChanged();this.fitWindows()}));this.addListener("editInlineStop",mxUtils.bind(this,function(J){this.diagramContainer.style.width="10px";this.diagramContainer.style.height="10px";this.diagramContainer.style.border="";this.bottomResizer.style.visibility="hidden";this.rightResizer.style.visibility="hidden";f.style.visibility="hidden";c.style.visibility="hidden";l.style.display="none"}));this.windowResized=mxUtils.bind(this,function(){});this.inlineSizeChanged()};EditorUi.prototype.installImagePasteHandler=function(){if(!mxClient.IS_IE){var c=this.editor.graph;c.container.addEventListener("paste",mxUtils.bind(this,function(f){if(!mxEvent.isConsumed(f))try{for(var l=f.clipboardData||f.originalEvent.clipboardData,t=!1,q=0;q<l.types.length;q++)if("text/"===l.types[q].substring(0,-5)){t=!0;break}if(!t){var D=l.items;for(index in D){var G=D[index];if("file"===G.kind){if(c.isEditing())this.importFiles([G.getAsFile()],0,0,this.maxImageSize,function(L,J,Y,ha,ea,aa){c.insertImage(L,ea,aa)},function(){},function(L){return"image/"==L.type.substring(0,6)},function(L){for(var J=0;J<L.length;J++)L[J]()});else{var N=this.editor.graph.getInsertPoint();this.importFiles([G.getAsFile()],N.x,N.y,this.maxImageSize);mxEvent.consume(f)}break}}}}catch(L){}}),!1)}};EditorUi.prototype.installNativeClipboardHandler=+5)){t=!0;break}if(!t){var D=l.items;for(index in D){var H=D[index];if("file"===H.kind){if(c.isEditing())this.importFiles([H.getAsFile()],0,0,this.maxImageSize,function(L,J,Y,ha,ea,aa){c.insertImage(L,ea,aa)},function(){},function(L){return"image/"==L.type.substring(0,6)},function(L){for(var J=0;J<L.length;J++)L[J]()});else{var N=this.editor.graph.getInsertPoint();this.importFiles([H.getAsFile()],N.x,N.y,this.maxImageSize);mxEvent.consume(f)}break}}}}catch(L){}}),!1)}};EditorUi.prototype.installNativeClipboardHandler=function(){function c(){window.setTimeout(function(){l.innerHTML=" ";l.focus();document.execCommand("selectAll",!1,null)},0)}var f=this.editor.graph,l=document.createElement("div");l.setAttribute("autocomplete","off");l.setAttribute("autocorrect","off");l.setAttribute("autocapitalize","off");l.setAttribute("spellcheck","false");l.style.textRendering="optimizeSpeed";l.style.fontFamily="monospace";l.style.wordBreak="break-all";l.style.background="transparent";l.style.color="transparent";l.style.position=-"absolute";l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.display="block";l.style.fontSize="1";l.style.zIndex="-1";l.style.resize="none";l.style.outline="none";l.style.width="1px";l.style.height="1px";mxUtils.setOpacity(l,0);l.contentEditable=!0;l.innerHTML=" ";var t=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(D){var G=mxEvent.getSource(D);-null==f.container||!f.isEnabled()||f.isMouseDown||f.isEditing()||null!=this.dialog||"INPUT"==G.nodeName||"TEXTAREA"==G.nodeName||"true"==G.contentEditable||224!=D.keyCode&&(mxClient.IS_MAC||17!=D.keyCode)&&(!mxClient.IS_MAC||91!=D.keyCode&&93!=D.keyCode)||t||(l.style.left=f.container.scrollLeft+10+"px",l.style.top=f.container.scrollTop+10+"px",D=f.container.scrollLeft,G=f.container.scrollTop,f.container.appendChild(l),t=!0,l.focus(),document.execCommand("selectAll",!1,null),f.container.scrollLeft=-D,f.container.scrollTop=G)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(D){var G=D.keyCode;window.setTimeout(mxUtils.bind(this,function(){!t||224!=G&&17!=G&&91!=G&&93!=G||(t=!1,f.isEditing()||null!=this.dialog||null==f.container||f.container.focus(),l.parentNode.removeChild(l),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(l,"copy",mxUtils.bind(this,function(D){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(l),c()}catch(G){this.handleError(G)}}));-mxEvent.addListener(l,"cut",mxUtils.bind(this,function(D){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(l,!0),c()}catch(G){this.handleError(G)}}));mxEvent.addListener(l,"paste",mxUtils.bind(this,function(D){if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{if(l.innerHTML=" ",l.focus(),null!=D.clipboardData&&(Graph.removePasteFormatting(l.firstChild),this.pasteCells(D,l,!0,!0)),!mxEvent.isConsumed(D)){var G=f.container.scrollLeft,N=f.container.scrollTop;window.setTimeout(mxUtils.bind(this,-function(){try{f.container.scrollLeft=G,f.container.scrollTop=N,Graph.removePasteFormatting(l.firstChild),this.pasteCells(D,l,!1,!0)}catch(L){this.handleError(L)}}),0)}}catch(L){this.handleError(L)}}),!0);var q=this.isSelectionAllowed;this.isSelectionAllowed=function(D){return mxEvent.getSource(D)==l?!0:q.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,f){mxSettings.setUi(c);(f=this.doSetCurrentTheme(c)||f)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=+"absolute";l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.display="block";l.style.fontSize="1";l.style.zIndex="-1";l.style.resize="none";l.style.outline="none";l.style.width="1px";l.style.height="1px";mxUtils.setOpacity(l,0);l.contentEditable=!0;l.innerHTML=" ";var t=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(D){var H=mxEvent.getSource(D);+null==f.container||!f.isEnabled()||f.isMouseDown||f.isEditing()||null!=this.dialog||"INPUT"==H.nodeName||"TEXTAREA"==H.nodeName||"true"==H.contentEditable||224!=D.keyCode&&(mxClient.IS_MAC||17!=D.keyCode)&&(!mxClient.IS_MAC||91!=D.keyCode&&93!=D.keyCode)||t||(l.style.left=f.container.scrollLeft+10+"px",l.style.top=f.container.scrollTop+10+"px",D=f.container.scrollLeft,H=f.container.scrollTop,f.container.appendChild(l),t=!0,l.focus(),document.execCommand("selectAll",!1,null),f.container.scrollLeft=+D,f.container.scrollTop=H)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(D){var H=D.keyCode;window.setTimeout(mxUtils.bind(this,function(){!t||224!=H&&17!=H&&91!=H&&93!=H||(t=!1,f.isEditing()||null!=this.dialog||null==f.container||f.container.focus(),l.parentNode.removeChild(l),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(l,"copy",mxUtils.bind(this,function(D){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(l),c()}catch(H){this.handleError(H)}}));+mxEvent.addListener(l,"cut",mxUtils.bind(this,function(D){if(f.isEnabled())try{mxClipboard.copy(f),this.copyCells(l,!0),c()}catch(H){this.handleError(H)}}));mxEvent.addListener(l,"paste",mxUtils.bind(this,function(D){if(f.isEnabled()&&!f.isCellLocked(f.getDefaultParent()))try{if(l.innerHTML=" ",l.focus(),null!=D.clipboardData&&(Graph.removePasteFormatting(l.firstChild),this.pasteCells(D,l,!0,!0)),!mxEvent.isConsumed(D)){var H=f.container.scrollLeft,N=f.container.scrollTop;window.setTimeout(mxUtils.bind(this,+function(){try{f.container.scrollLeft=H,f.container.scrollTop=N,Graph.removePasteFormatting(l.firstChild),this.pasteCells(D,l,!1,!0)}catch(L){this.handleError(L)}}),0)}}catch(L){this.handleError(L)}}),!0);var q=this.isSelectionAllowed;this.isSelectionAllowed=function(D){return mxEvent.getSource(D)==l?!0:q.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,f){mxSettings.setUi(c);(f=this.doSetCurrentTheme(c)||f)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=function(c){return""==c||"dark"==c||"default"==c||"kennedy"==c||null==c};EditorUi.prototype.doSetCurrentTheme=function(c,f){if(null==c||""==c)c=App.isSimpleThemePreferred()?"simple":"kennedy";var l="simple"==Editor.currentTheme&&this.isDefaultTheme(c)||this.isDefaultTheme(Editor.currentTheme)&&"simple"==c||c==Editor.currentTheme;if(l||f)f=this.saveScrollState(),this.editor.graph.stopEditing(!1),Editor.currentTheme=c,this.switchTheme(c),this.fireEvent(new mxEventObject("currentThemeChanged")),this.editor.fireEvent(new mxEventObject("statusChanged")),this.restoreScrollState(f);return l};EditorUi.prototype.saveScrollState=function(c){var f=this.editor.graph.view.translate,l=this.diagramContainer.scrollLeft,t=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?(l-=this.embedViewport.x,t-=this.embedViewport.y):(l+=this.embedViewport.x,t+=this.embedViewport.y));f={x:l,y:t,tx:f.x,ty:f.y};c&&(f.boundingRect=this.diagramContainer.getBoundingClientRect());return f};EditorUi.prototype.restoreScrollState=function(c){var f=this.editor.graph.view.scale,l=this.editor.graph.view.translate;if(null!=c.boundingRect){var t=this.diagramContainer.getBoundingClientRect();c.x-=c.boundingRect.x-t.x;c.y-=c.boundingRect.y-t.y}this.diagramContainer.scrollLeft=c.x+(l.x-c.tx)*f;this.diagramContainer.scrollTop=c.y+(l.y-c.ty)*f};EditorUi.prototype.installStatusMinimizer=function(c){c=null!=c?c:this.statusContainer.parentNode;var f=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&@@ -3808,55 +3810,55 @@ this.menus.commentsWindow=null))};EditorUi.prototype.switchThemeConstants=functi120;null==urlParams.grid&&(f.defaultGridEnabled=!1);null==urlParams.pv&&(f.defaultPageVisible=!1)}else Editor.fitWindowBorders=null};EditorUi.prototype.isPageMenuVisible=function(){return null!=this.pages&&("0"!=urlParams.pages||1<this.pages.length||Editor.pagesVisible)};EditorUi.prototype.switchCssForTheme=function(c){};EditorUi.prototype.createMainMenuForTheme=function(c){};EditorUi.prototype.createFooterMenuForTheme=function(c){};EditorUi.prototype.createPickerMenuForTheme=function(c){};EditorUi.prototype.getNetworkStatus=function(){var c=null;if(this.isOffline(!0))c=mxResources.get("offline");else{var f=this.getCurrentFile();null!=f&&(f.invalidChecksum?c=mxResources.get("error")+": "+mxResources.get("checksum"):null==f.sync||f.sync.enabled&&f.sync.isRealtimeActive()||"atlassian"==this.getServiceName()?null==f.sync||f.sync.isConnected()?f.isRealtimeEnabled()&&f.isRealtimeSupported()&&1<f.getRealtimeState()&&(c=f.getRealtimeError(),c=mxResources.get("realtimeCollaboration")+": "+(null!=c&&null!=c.message?c.message:mxResources.get("error"))):c=mxResources.get("notConnected"):c=mxResources.get("realtimeCollaboration")+": "+mxResources.get("disabled"))}return c};EditorUi.prototype.createMenubarForTheme=function(c){null!=this.statusContainer&&(this.statusContainer.style.flexGrow="",this.statusContainer.style.flexShrink="",this.statusContainer.style.width="",this.statusContainer.style.marginTop="",this.statusContainer.style.justifyContent="",this.statusContainer.style.opacity="");null!=this.userElement&&this.menubarContainer.appendChild(this.userElement);-null!=this.buttonContainer&&(this.buttonContainer.style.display="",this.menubar.container.appendChild(this.buttonContainer))};EditorUi.prototype.createMenu=function(c,f,l,t){l=null!=l?l:"geButton";var q=this.menus.get(c);t=this.menubar.addMenu(mxResources.get(c),q.funct,null,t);t.className=l;t.setAttribute("title",mxResources.get(c));this.menus.menuCreated(q,t,l);null!=f&&(t.style.backgroundImage="url("+f+")",t.innerText="");return t};EditorUi.prototype.addButton=function(c,f,l,t){c=this.createToolbarButton(c,-f,l);t=null!=t?t:this.container;t.appendChild(c);return c};EditorUi.prototype.createToolbarButton=function(c,f,l){var t=document.createElement("a");t.className="geButton";null!=c&&"data:"==c.substring(0,5)&&(t.style.backgroundImage="url("+c+")");null!=f&&t.setAttribute("title",f);null!=l&&mxEvent.addListener(t,"click",function(q){"disabled"!=t.getAttribute("disabled")&&l(q);mxEvent.consume(q)});mxEvent.preventDefault(t);return t};EditorUi.prototype.createMenuItem=function(c,f,l){var t=this.actions.get(c),-q=null!=t?t.funct:null,D=this.createToolbarButton(f,mxResources.get(c)+(null!=t&&null!=t.shortcut?" ("+t.shortcut+")":""),q);null==t||l||(c=function(){t.isEnabled()?D.removeAttribute("disabled"):D.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",c),t.addListener("stateChanged",c),c());return D};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var c=Math.max(10,this.diagramContainer.parentNode.clientWidth-256),f="1"==urlParams.embedInline?-580:"1"==urlParams.sketch?580:Math.min(566,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,mxResources.get("format"),c,60,240,f,mxUtils.bind(this,function(q){q.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.formatWindow.window.fit()}));var l=this.formatWindow.window.toggleMinimized,t=240;this.formatWindow.window.toggleMinimized=function(){l.apply(this,arguments);this.minimized?(t=parseInt(this.div.style.width),-this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+t-140+"px"):(this.div.style.width=t+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-t+140)+"px");this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(q){mxEvent.getSource(q)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));this.formatWindow.window.minimumSize=-new mxRectangle(0,0,240,80);"sketch"==Editor.currentTheme?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var q=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,D=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>q||690>D)&&this.formatWindow.window.toggleMinimized()}),0)):this.formatWindow.window.setVisible(!1)}};var H=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=-function(c){var f=this.formatWindow;null!=f?f.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):H.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c){if(this.isShapesPanelVisible()!=c){var f=EditorUi.prototype.hsplitPosition;0==f&&(f=this.defaultSidebarWidth);var l=this.hsplitPosition,t=mxUtils.bind(this,function(){this.hsplitPosition=q;this.refresh();this.diagramContainer.scrollLeft-=l-this.hsplitPosition}),q=c?f:0,D=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.sidebarContainer.style,-"transform",0==q?"translateX(0)":"translateX(-100%)");0!=q&&t();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==q?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+D+"s ease-in-out");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin","top left");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition",-null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin",null);0==q&&t()}),1E3*D)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var S=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;return null!=c?c.window.isVisible():S.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(c){var f=mxUtils.bind(this,-function(G,N){var L=this.menus.get(G);G=this.createMenuElement(N,mxUtils.bind(this,function(){L.funct.apply(this,arguments)}));G.setAttribute("title",N);G.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";G.className="geButton";c.parentNode.appendChild(G);return G});if(Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries))if(null!=this.actions.get("newLibrary"))f=document.createElement("div"),f.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;",-f.className="geButton",f.style.left="0px",f.style.right="50%",mxUtils.write(f,mxResources.get("newLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("newLibrary").funct),f=f.cloneNode(!1),f.style.left="50%",f.style.right="0px",mxUtils.write(f,mxResources.get("openLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("openLibrary").funct);else{var l=f("newLibrary","");l.style.left="0px";l.style.right="50%";var t=document.createElement("span");l.appendChild(t);-var q=f("openLibraryFrom","");q.style.borderLeftWidth="1px";q.style.left="50%";q.style.right="0px";var D=document.createElement("span");q.appendChild(D);this.dependsOnLanguage(mxUtils.bind(this,function(){t.innerHTML="";mxUtils.write(t,mxResources.get("newLibrary"));l.setAttribute("title",mxResources.get("newLibrary"));D.innerHTML="";mxUtils.write(D,mxResources.get("openLibraryFrom"));q.setAttribute("title",mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow=-"hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=Math.min(this.diagramContainer.parentNode.clientWidth-10,218),f="1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,650),l="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme;this.sidebarWindow=new WrapperWindow(this,mxResources.get("shapes"),l&&"1"!=urlParams.embedInline?66:10,l&&"1"!=urlParams.embedInline?Math.max(30,(this.diagramContainer.parentNode.clientHeight--f)/2):56,c-6,f-6,mxUtils.bind(this,function(t){this.createShapesPanel(t)}));this.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.sidebarWindow.window.fit()}));this.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90);this.sidebarWindow.window.setVisible(!1)}};EditorUi.prototype.setSketchMode=function(c){this.doSetSketchMode(c);null==urlParams.rough&&(mxSettings.settings.sketchMode=c,mxSettings.save());this.fireEvent(new mxEventObject("sketchModeChanged"))};EditorUi.prototype.setAndPersistDarkMode=-function(c){var f=c;"auto"==c&&(f=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode(f);mxSettings.settings.darkMode=c;mxSettings.save();c=mxSettings.getUi();null==urlParams.ui&&"dark"==c&&this.setCurrentTheme("kennedy",!0)};EditorUi.prototype.setAndPersistLanguage=function(c){this.spinner.spin(document.body,mxResources.get("working"))&&(mxSettings.setLanguage(c),mxSettings.save(),mxClient.language=c,mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE,-null,mxUtils.bind(this,function(){this.spinner.stop();this.fireEvent(new mxEventObject("languageChanged"))})))};EditorUi.prototype.setElementTitle=function(c,f){this.dependsOnLanguage(mxUtils.bind(this,function(){c.setAttribute("title",mxResources.get(f))}))};EditorUi.prototype.dependsOnLanguage=function(c){c();this.addListener("languageChanged",c)};EditorUi.prototype.setAndPersistHighContrast=function(c){this.setHighContrast(c);Editor.isSettingsEnabled()&&(mxSettings.settings.highContrast=c,mxSettings.save())};-EditorUi.prototype.isHighContrast=function(){var c=document.getElementById("high-contrast-stylesheet");return null!=c&&window.matchMedia?(c=c.getAttribute("media"),"all"==c||"not all"!=c&&window.matchMedia("(forced-colors: active)").matches):!1};EditorUi.prototype.setHighContrast=function(c){var f=document.getElementById("high-contrast-stylesheet");if(null!=f&&window.matchMedia){var l=window.matchMedia("(forced-colors: active)").matches,t=f.getAttribute("media");(t="all"==t||"not all"!=t&&l)&&!c?-f.setAttribute("media",l?"not all":"(forced-colors: active)"):!t&&c&&f.setAttribute("media",l?"(forced-colors: active)":"all")}};EditorUi.prototype.isRulerVisible=function(){return null!=this.ruler};EditorUi.prototype.setRulerVisible=function(c){var f=this.getDiagramContainerOffset();mxSettings.setRulerOn(c);mxSettings.save();c||null==this.ruler?c&&null==this.ruler&&(this.ruler=new mxDualRuler(this,this.editor.graph.view.unit)):(this.ruler.destroy(),this.ruler=null);this.fireEvent(new mxEventObject("rulerVisibleChanged"));-c=this.getDiagramContainerOffset();this.diagramContainer.scrollLeft+=c.x-f.x;this.diagramContainer.scrollTop+=c.x-f.x};EditorUi.prototype.isAutoDarkModeSupported=function(){return null!=window.matchMedia};EditorUi.prototype.isAutoDarkMode=function(c){return!c&&"auto"==urlParams.dark||Editor.isSettingsEnabled()&&"auto"==mxSettings.settings.darkMode};EditorUi.prototype.setDarkMode=function(c){mxUtils.lightDarkColorSupported&&(Editor.darkMode=c,c=mxUtils.isAncestorNode(document.body,this.container)||-null==this.editor?this.container:this.editor.graph.container,mxConstants.DROP_TARGET_COLOR=Editor.isDarkMode()?"#00ff00":"#0000ff",null!=c&&(Editor.isDarkMode()?(c.classList.add("geDarkMode"),c.style.colorScheme="dark"):(c.classList.remove("geDarkMode"),c.style.colorScheme="light")),null!=this.ruler&&this.ruler.updateStyle(),this.fireEvent(new mxEventObject("darkModeChanged")))};EditorUi.prototype.setPagesVisible=function(c){Editor.pagesVisible!=c&&(Editor.pagesVisible=c,mxSettings.settings.pagesVisible=-c,mxSettings.save(),this.fireEvent(new mxEventObject("pagesVisibleChanged")))};EditorUi.prototype.setSidebarTitles=function(c,f){this.sidebar.sidebarTitles!=c&&(this.sidebar.sidebarTitles=c,Editor.isSettingsEnabled()&&f&&(mxSettings.settings.sidebarTitles=c,mxSettings.save()),this.fireEvent(new mxEventObject("sidebarTitlesChanged")))};EditorUi.prototype.setInlineFullscreen=function(c){Editor.inlineFullscreen!=c&&(this.diagramContainer.setAttribute("data-scrollState",JSON.stringify(this.saveScrollState(!0))),-(window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:c,rect:this.diagramContainer.getBoundingClientRect()}),"*"))};EditorUi.prototype.inlineSizeChanged=function(){var c=this.sketchFooterMenuElt,f=this.sketchMainMenuElt,l=this.sketchPickerMenuElt;if(Editor.inlineFullscreen)f.style.left="10px",f.style.top="10px",l.style.left="10px",l.style.top="60px",c.style.top="10px",c.style.right="12px",c.style.left="",null==this.diagramContainer.getAttribute("data-bounds")&&(this.diagramContainer.setAttribute("data-bounds",-this.diagramContainer.style.top+" "+this.diagramContainer.style.left+" "+this.diagramContainer.style.width+" "+this.diagramContainer.style.height),this.diagramContainer.style.top="0px",this.diagramContainer.style.left="0px",this.diagramContainer.style.bottom="0px",this.diagramContainer.style.right="0px",this.diagramContainer.style.width="",this.diagramContainer.style.height="");else{var t=this.diagramContainer.getAttribute("data-bounds");if(null!=t){this.diagramContainer.removeAttribute("data-bounds");-var q=t.split(" ");t=mxUtils.getDocumentSize();this.diagramContainer.style.top=q[0];this.diagramContainer.style.left=q[1];var D=parseInt(q[2]);q=parseInt(q[3]);D=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,D):D,t.width-80);q=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,q):q,t.height-80);this.diagramContainer.style.width=D+"px";this.diagramContainer.style.height=q+"px";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";(window.opener||-window.parent).postMessage(JSON.stringify({event:"resize",rect:this.diagramContainer.getBoundingClientRect()}),"*")}f.style.left=this.diagramContainer.offsetLeft+"px";f.style.top=this.diagramContainer.offsetTop-f.offsetHeight-4+"px";l.style.display="";l.style.left=this.diagramContainer.offsetLeft-l.offsetWidth-4+"px";l.style.top=this.diagramContainer.offsetTop+"px";c.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-c.offsetWidth+"px";c.style.top=f.style.top;c.style.right=-"";this.bottomResizer.style.left=this.diagramContainer.offsetLeft+(this.diagramContainer.offsetWidth-this.bottomResizer.offsetWidth)/2+"px";this.bottomResizer.style.top=this.diagramContainer.offsetTop+this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight/2-1+"px";this.rightResizer.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-this.rightResizer.offsetWidth/2-1+"px";this.rightResizer.style.top=this.diagramContainer.offsetTop+(this.diagramContainer.offsetHeight--this.bottomResizer.offsetHeight)/2+"px"}this.bottomResizer.style.visibility=Editor.inlineFullscreen?"hidden":"";this.rightResizer.style.visibility=this.bottomResizer.style.visibility;f.style.visibility="";c.style.visibility=""};EditorUi.prototype.doSetSketchMode=function(c){Editor.sketchMode!=c&&(Editor.sketchMode=c,this.updateDefaultStyles())};EditorUi.prototype.updateDefaultStyles=function(){var c=this.editor.graph;c.defaultVertexStyle=mxUtils.clone(Graph.prototype.defaultVertexStyle);c.defaultEdgeStyle=-mxUtils.clone(Graph.prototype.defaultEdgeStyle);if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.vertexFontSize=16,c.edgeFontSize=c.vertexFontSize-4):"sketch"==Editor.currentTheme?(c.vertexFontSize=20,c.edgeFontSize=c.vertexFontSize-4):(c.vertexFontSize=Graph.prototype.vertexFontSize,c.edgeFontSize=Graph.prototype.edgeFontSize),c.defaultEdgeStyle.fontSize=c.edgeFontSize;if(null==Editor.config||-null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.endSize="8",c.defaultEdgeStyle.startSize="8"):"sketch"==Editor.currentTheme&&(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.jettySize="auto",c.defaultEdgeStyle.orthogonalLoop="1",c.defaultEdgeStyle.endArrow="open",c.defaultEdgeStyle.endSize=-"14",c.defaultEdgeStyle.startSize="14",c.defaultEdgeStyle.sourcePerimeterSpacing="8",c.defaultEdgeStyle.targetPerimeterSpacing="8");if(null==Editor.config||null==Editor.config.defaultFonts){if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle){if("sketch"==Editor.currentTheme&&"1"!=urlParams.embedInline||Editor.sketchMode)c.defaultVertexStyle.fontFamily=Editor.sketchFontFamily,c.defaultVertexStyle.fontSource=Editor.sketchFontSource,c.defaultEdgeStyle.fontFamily=-Editor.sketchFontFamily,c.defaultEdgeStyle.fontSource=Editor.sketchFontSource;Editor.sketchMode&&(c.defaultVertexStyle.sketch="1",c.defaultVertexStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultVertexStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultVertexStyle.hachureGap="4",c.defaultEdgeStyle.sketch="1",c.defaultEdgeStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultEdgeStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultEdgeStyle.hachureGap="4")}this.menus.defaultFonts="sketch"==-Editor.currentTheme?Menus.prototype.defaultFonts.concat(Editor.sketchFonts):Menus.prototype.defaultFonts}c.currentVertexStyle=mxUtils.clone(c.defaultVertexStyle);c.currentEdgeStyle=mxUtils.clone(c.defaultEdgeStyle);this.clearDefaultStyle()};EditorUi.prototype.getLinkTitle=function(c){var f=Graph.prototype.getLinkTitle.apply(this,arguments);if(Graph.isPageLink(c)){var l=c.indexOf(",");0<l&&(f=this.getPageById(c.substring(l+1)),f=null!=f?f.getName():mxResources.get("pageNotFound"))}else"data:"==c.substring(0,-5)&&(f=this.getCustomLinkTitle(c));return f};EditorUi.prototype.getCustomLinkTitle=function(c){var f=mxResources.get("action");if("data:action/json,"==c.substring(0,17))try{var l=JSON.parse(c.substring(17));null!=l&&null!=l.title&&(f=l.title)}catch(t){}return f};EditorUi.prototype.handleCustomLink=function(c,f){if(Graph.isPageLink(c))if(f=c.indexOf(","),c=this.getPageById(c.substring(f+1)))this.selectPage(c);else throw Error(mxResources.get("pageNotFound")||"Page not found");else this.editor.graph.handleCustomLink(c,-f)};EditorUi.prototype.installSettings=function(){if(Editor.isSettingsEnabled()){var c=this.editor.graph;Editor.pagesVisible=mxSettings.settings.pagesVisible;ColorDialog.recentColors=mxSettings.getRecentColors();if(isLocalStorage)try{window.addEventListener("storage",mxUtils.bind(this,function(f){f.key==mxSettings.key&&(mxSettings.load(),ColorDialog.recentColors=mxSettings.getRecentColors(),this.menus.customFonts=mxSettings.getCustomFonts())}),!1)}catch(f){}this.fireEvent(new mxEventObject("styleChanged",-"keys",[],"values",[],"cells",[]));this.menus.customFonts=mxSettings.getCustomFonts();this.addListener("customFontsChanged",mxUtils.bind(this,function(f,l){mxSettings.setCustomFonts(this.menus.customFonts);mxSettings.save()}));c.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(f,l){mxSettings.setCreateTarget(c.connectionHandler.isCreateTarget());mxSettings.save()}));-c.pageFormat=null!=c.defaultPageFormat?c.defaultPageFormat:mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(f,l){mxSettings.setPageFormat(c.pageFormat);mxSettings.save()}));c.view.defaultDarkGridColor=mxSettings.getGridColor(!0);c.view.defaultGridColor=mxSettings.getGridColor(!1);c.view.gridColor="light-dark("+c.view.defaultGridColor+", "+c.view.defaultDarkGridColor+")";this.addListener("gridColorChanged",mxUtils.bind(this,function(f,l){mxSettings.setGridColor(c.view.defaultGridColor,-!1);mxSettings.setGridColor(c.view.defaultDarkGridColor,!0);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(f,l){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();if(!this.editor.chromeless||this.editor.editable)null!=mxSettings.settings.enableAnimations&&(Editor.enableAnimations=mxSettings.settings.enableAnimations),this.addListener("enableAnimationsChanged",-mxUtils.bind(this,function(f,l){mxSettings.settings.enableAnimations=Editor.enableAnimations;mxSettings.save()}));null!=this.sidebar&&(null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes?(this.sidebar.searchShapes(decodeURIComponent(urlParams["search-shapes"])),this.sidebar.showEntries("search")):(this.sidebar.showPalette("search",mxSettings.settings.search),this.editor.chromeless&&!this.editor.editable||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),-mxSettings.save())));this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyImage=function(c,f,l){try{null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(t,q){try{this.spinner.stop();var D=this.createImageDataUri(t,f,"png"),G=parseInt(q.getAttribute("width")),N=parseInt(q.getAttribute("height"));-this.writeImageToClipboard(D,G,N,mxUtils.bind(this,function(L){this.handleError(L)}))}catch(L){this.handleError(L)}}),null,null,null,mxUtils.bind(this,function(t){this.spinner.stop();this.handleError(t)}),null,null,null!=l?l:4,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,null,null,null,10,null,null,!1,null,0<c.length?c:null)}catch(t){this.handleError(t)}};EditorUi.prototype.copyCells=function(c,f){var l=this.editor.graph;if(l.isSelectionEmpty())c.innerText="";-else{var t=mxUtils.sortCells(l.model.getTopmostCells(l.getSelectionCells())),q=mxUtils.getXml(l.encodeCells(t));mxUtils.setTextContent(c,encodeURIComponent(q));f?(l.removeCells(t,!1),l.lastPasteXml=null):(l.lastPasteXml=q,l.pasteCounter=0);c.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var c=null;if(Editor.enableNativeCipboard){var f=this.editor.graph;f.isSelectionEmpty()||(c=mxUtils.sortCells(f.getExportableCells(f.model.getTopmostCells(f.getSelectionCells()))),-f=mxUtils.getXml(f.encodeCells(c)),navigator.clipboard.writeText(f))}return c};EditorUi.prototype.pasteXml=function(c,f,l,t,q){q=null!=q?q:!0;var D=this.editor.graph,G=null;D.lastPasteXml==c?D.pasteCounter++:(D.lastPasteXml=c,D.pasteCounter=0);var N=D.pasteCounter*D.gridSize;if(l||this.isCompatibleString(c))G=this.importXml(c,N,N),D.setSelectionCells(G);else if(f&&1==D.getSelectionCount()){q=D.getStartEditingCell(D.getSelectionCell(),t);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&"image"==D.getCurrentCellStyle(q)[mxConstants.STYLE_SHAPE])D.setCellStyles(mxConstants.STYLE_IMAGE,-c,[q]);else{D.model.beginUpdate();try{D.labelChanged(q,c),Graph.isLink(c)&&D.setLinkForCell(q,c)}finally{D.model.endUpdate()}}D.setSelectionCell(q)}else G=D.getInsertPoint(),D.isMouseInsertPoint()&&(N=0,D.lastPasteXml==c&&0<D.pasteCounter&&D.pasteCounter--),G=this.insertTextAt(c,G.x+N,G.y+N,q),D.setSelectionCells(G);D.isSelectionEmpty()||(D.scrollCellToVisible(D.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(D.view.getState(D.getSelectionCell())));return G};EditorUi.prototype.pasteCells=-function(c,f,l,t){if(!mxEvent.isConsumed(c)){var q=f,D=!1;if(l&&null!=c.clipboardData&&c.clipboardData.getData){var G=c.clipboardData.getData("text/plain"),N=!1;if(null!=G&&0<G.length&&"%3CmxGraphModel%3E"==G.substring(0,18))try{var L=decodeURIComponent(G);this.isCompatibleString(L)&&(N=!0,G=L)}catch(na){}N=N?null:c.clipboardData.getData("text/html");null!=N&&0<N.length?(q=this.parseHtmlData(N),D="text/plain"!=q.getAttribute("data-type")):null!=G&&0<G.length&&(q=document.createElement("div"),mxUtils.setTextContent(q,-N))}G=q.getElementsByTagName("span");if(null!=G&&0<G.length&&"application/vnd.lucid.chart.objects"===G[0].getAttribute("data-lucid-type"))l=G[0].getAttribute("data-lucid-content"),null!=l&&0<l.length&&(this.convertLucidChart(l,mxUtils.bind(this,function(na){var W=this.editor.graph;W.lastPasteXml==na?W.pasteCounter++:(W.lastPasteXml=na,W.pasteCounter=0);var ba=W.pasteCounter*W.gridSize;W.setSelectionCells(this.importXml(na,ba,ba));W.scrollCellToVisible(W.getSelectionCell())}),mxUtils.bind(this,function(na){this.handleError(na)})),-mxEvent.consume(c));else{var J=!1,Y="";Y=D?null!=q.textContent&&"<mxfile"==q.textContent.substring(0,7)&&"</mxfile>"==q.textContent.substring(q.textContent.length-9)||"<mxGraphModel"==q.textContent.substring(0,13)&&"</mxGraphModel>"==q.textContent.substring(q.textContent.length-15)?q.textContent.replace(/\u00a0/g," "):q.innerHTML:mxUtils.trim(null==q.innerText?mxUtils.getTextContent(q):q.innerText);try{var ha=Y.lastIndexOf("%3E");0<=ha&&ha<Y.length-3&&(Y=Y.substring(0,ha+3))}catch(na){}try{G=q.getElementsByTagName("span"),-(L=null!=G&&0<G.length?mxUtils.trim(decodeURIComponent(G[0].textContent)):decodeURIComponent(Y))&&(this.isCompatibleString(L)||0==L.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(J=!0,Y=L)}catch(na){}try{if(null!=Y&&0<Y.length){if(0==Y.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var ea=mxUtils.bind(this,function(){try{Y=(new MiroImporter).importMiroJson(JSON.parse(Y)),this.pasteXml(Y,t,J,c)}catch(na){console.log("Miro import error:",na)}});"undefined"===typeof MiroImporter?+null!=this.buttonContainer&&null!=this.menubar&&(this.buttonContainer.style.display="",this.menubar.container.appendChild(this.buttonContainer))};EditorUi.prototype.createMenu=function(c,f,l,t){l=null!=l?l:"geButton";var q=this.menus.get(c);t=this.menubar.addMenu(mxResources.get(c),q.funct,null,t);t.className=l;t.setAttribute("title",mxResources.get(c));this.menus.menuCreated(q,t,l);null!=f&&(t.style.backgroundImage="url("+f+")",t.innerText="");return t};EditorUi.prototype.addButton=function(c,f,+l,t){c=this.createToolbarButton(c,f,l);t=null!=t?t:this.container;t.appendChild(c);return c};EditorUi.prototype.createToolbarButton=function(c,f,l){var t=document.createElement("a");t.className="geButton";null!=c&&"data:"==c.substring(0,5)&&(t.style.backgroundImage="url("+c+")");null!=f&&t.setAttribute("title",f);null!=l&&mxEvent.addListener(t,"click",function(q){"disabled"!=t.getAttribute("disabled")&&l(q);mxEvent.consume(q)});mxEvent.preventDefault(t);return t};EditorUi.prototype.createMenuItem=+function(c,f,l){var t=this.actions.get(c),q=null!=t?t.funct:null,D=this.createToolbarButton(f,mxResources.get(c)+(null!=t&&null!=t.shortcut?" ("+t.shortcut+")":""),q);null==t||l||(c=function(){t.isEnabled()?D.removeAttribute("disabled"):D.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",c),t.addListener("stateChanged",c),c());return D};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var c=Math.max(10,this.diagramContainer.parentNode.clientWidth-+256),f="1"==urlParams.embedInline?580:"1"==urlParams.sketch?580:Math.min(566,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,mxResources.get("format"),c,60,240,f,mxUtils.bind(this,function(q){q.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.formatWindow.window.fit()}));var l=this.formatWindow.window.toggleMinimized,t=240;this.formatWindow.window.toggleMinimized=function(){l.apply(this,arguments);+this.minimized?(t=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+t-140+"px"):(this.div.style.width=t+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-t+140)+"px");this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(q){mxEvent.getSource(q)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));+this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80);"sketch"==Editor.currentTheme?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var q=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,D=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>q||690>D)&&this.formatWindow.window.toggleMinimized()}),0)):this.formatWindow.window.setVisible(!1)}};var G=EditorUi.prototype.toggleFormatPanel;+EditorUi.prototype.toggleFormatPanel=function(c){var f=this.formatWindow;null!=f?f.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):G.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c){if(this.isShapesPanelVisible()!=c){var f=EditorUi.prototype.hsplitPosition;0==f&&(f=this.defaultSidebarWidth);var l=this.hsplitPosition,t=mxUtils.bind(this,function(){this.hsplitPosition=q;this.refresh();this.diagramContainer.scrollLeft-=l-this.hsplitPosition}),q=c?f:0,D=Editor.transitionDelay;+mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==q?"translateX(0)":"translateX(-100%)");0!=q&&t();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==q?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+D+"s ease-in-out");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin","top left");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,+"transition",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin",null);0==q&&t()}),1E3*D)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var S=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;return null!=c?c.window.isVisible():S.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(c){var f=+mxUtils.bind(this,function(H,N){var L=this.menus.get(H);H=this.createMenuElement(N,mxUtils.bind(this,function(){L.funct.apply(this,arguments)}));H.setAttribute("title",N);H.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";H.className="geButton";c.parentNode.appendChild(H);return H});if(Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries))if(null!=this.actions.get("newLibrary"))f=document.createElement("div"),+f.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;",f.className="geButton",f.style.left="0px",f.style.right="50%",mxUtils.write(f,mxResources.get("newLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("newLibrary").funct),f=f.cloneNode(!1),f.style.left="50%",f.style.right="0px",mxUtils.write(f,mxResources.get("openLibrary")),c.appendChild(f),mxEvent.addListener(f,"click",this.actions.get("openLibrary").funct);else{var l=+f("newLibrary","");l.style.left="0px";l.style.right="50%";var t=document.createElement("span");l.appendChild(t);var q=f("openLibraryFrom","");q.style.borderLeftWidth="1px";q.style.left="50%";q.style.right="0px";var D=document.createElement("span");q.appendChild(D);this.dependsOnLanguage(mxUtils.bind(this,function(){t.innerHTML="";mxUtils.write(t,mxResources.get("newLibrary"));l.setAttribute("title",mxResources.get("newLibrary"));D.innerHTML="";mxUtils.write(D,mxResources.get("openLibraryFrom"));q.setAttribute("title",+mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow="hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=Math.min(this.diagramContainer.parentNode.clientWidth-10,218),f="1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,650),l="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme;this.sidebarWindow=new WrapperWindow(this,mxResources.get("shapes"),l&&"1"!=urlParams.embedInline?+66:10,l&&"1"!=urlParams.embedInline?Math.max(30,(this.diagramContainer.parentNode.clientHeight-f)/2):56,c-6,f-6,mxUtils.bind(this,function(t){this.createShapesPanel(t)}));this.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.sidebarWindow.window.fit()}));this.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90);this.sidebarWindow.window.setVisible(!1)}};EditorUi.prototype.setSketchMode=function(c){this.doSetSketchMode(c);null==urlParams.rough&&(mxSettings.settings.sketchMode=+c,mxSettings.save());this.fireEvent(new mxEventObject("sketchModeChanged"))};EditorUi.prototype.setAndPersistDarkMode=function(c){var f=c;"auto"==c&&(f=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode(f);mxSettings.settings.darkMode=c;mxSettings.save();c=mxSettings.getUi();null==urlParams.ui&&"dark"==c&&this.setCurrentTheme("kennedy",!0)};EditorUi.prototype.setAndPersistLanguage=function(c){this.spinner.spin(document.body,mxResources.get("working"))&&+(mxSettings.setLanguage(c),mxSettings.save(),mxClient.language=c,mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE,null,mxUtils.bind(this,function(){this.spinner.stop();this.fireEvent(new mxEventObject("languageChanged"))})))};EditorUi.prototype.setElementTitle=function(c,f){this.dependsOnLanguage(mxUtils.bind(this,function(){c.setAttribute("title",mxResources.get(f))}))};EditorUi.prototype.dependsOnLanguage=function(c){c();this.addListener("languageChanged",c)};EditorUi.prototype.setAndPersistHighContrast=+function(c){this.setHighContrast(c);Editor.isSettingsEnabled()&&(mxSettings.settings.highContrast=c,mxSettings.save())};EditorUi.prototype.isHighContrast=function(){var c=document.getElementById("high-contrast-stylesheet");return null!=c&&window.matchMedia?(c=c.getAttribute("media"),"all"==c||"not all"!=c&&window.matchMedia("(forced-colors: active)").matches):!1};EditorUi.prototype.setHighContrast=function(c){var f=document.getElementById("high-contrast-stylesheet");if(null!=f&&window.matchMedia){var l=+window.matchMedia("(forced-colors: active)").matches,t=f.getAttribute("media");(t="all"==t||"not all"!=t&&l)&&!c?f.setAttribute("media",l?"not all":"(forced-colors: active)"):!t&&c&&f.setAttribute("media",l?"(forced-colors: active)":"all")}};EditorUi.prototype.isRulerVisible=function(){return null!=this.ruler};EditorUi.prototype.setRulerVisible=function(c){var f=this.getDiagramContainerOffset();mxSettings.setRulerOn(c);mxSettings.save();c||null==this.ruler?c&&null==this.ruler&&(this.ruler=new mxDualRuler(this,+this.editor.graph.view.unit)):(this.ruler.destroy(),this.ruler=null);this.fireEvent(new mxEventObject("rulerVisibleChanged"));c=this.getDiagramContainerOffset();this.diagramContainer.scrollLeft+=c.x-f.x;this.diagramContainer.scrollTop+=c.x-f.x};EditorUi.prototype.isAutoDarkModeSupported=function(){return null!=window.matchMedia};EditorUi.prototype.isAutoDarkMode=function(c){return!c&&"auto"==urlParams.dark||Editor.isSettingsEnabled()&&"auto"==mxSettings.settings.darkMode};EditorUi.prototype.setDarkMode=+function(c){mxUtils.lightDarkColorSupported&&(Editor.darkMode=c,c=mxUtils.isAncestorNode(document.body,this.container)||null==this.editor?this.container:this.editor.graph.container,mxConstants.DROP_TARGET_COLOR=Editor.isDarkMode()?"#00ff00":"#0000ff",null!=c&&(Editor.isDarkMode()?(c.classList.add("geDarkMode"),c.style.colorScheme="dark"):(c.classList.remove("geDarkMode"),c.style.colorScheme="light")),null!=this.ruler&&this.ruler.updateStyle(),this.fireEvent(new mxEventObject("darkModeChanged")))};+EditorUi.prototype.setPagesVisible=function(c){Editor.pagesVisible!=c&&(Editor.pagesVisible=c,mxSettings.settings.pagesVisible=c,mxSettings.save(),this.fireEvent(new mxEventObject("pagesVisibleChanged")))};EditorUi.prototype.setSidebarTitles=function(c,f){this.sidebar.sidebarTitles!=c&&(this.sidebar.sidebarTitles=c,Editor.isSettingsEnabled()&&f&&(mxSettings.settings.sidebarTitles=c,mxSettings.save()),this.fireEvent(new mxEventObject("sidebarTitlesChanged")))};EditorUi.prototype.setInlineFullscreen=+function(c){Editor.inlineFullscreen!=c&&(this.diagramContainer.setAttribute("data-scrollState",JSON.stringify(this.saveScrollState(!0))),(window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:c,rect:this.diagramContainer.getBoundingClientRect()}),"*"))};EditorUi.prototype.inlineSizeChanged=function(){var c=this.sketchFooterMenuElt,f=this.sketchMainMenuElt,l=this.sketchPickerMenuElt;if(Editor.inlineFullscreen)f.style.left="10px",f.style.top="10px",l.style.left="10px",+l.style.top="60px",c.style.top="10px",c.style.right="12px",c.style.left="",null==this.diagramContainer.getAttribute("data-bounds")&&(this.diagramContainer.setAttribute("data-bounds",this.diagramContainer.style.top+" "+this.diagramContainer.style.left+" "+this.diagramContainer.style.width+" "+this.diagramContainer.style.height),this.diagramContainer.style.top="0px",this.diagramContainer.style.left="0px",this.diagramContainer.style.bottom="0px",this.diagramContainer.style.right="0px",this.diagramContainer.style.width=+"",this.diagramContainer.style.height="");else{var t=this.diagramContainer.getAttribute("data-bounds");if(null!=t){this.diagramContainer.removeAttribute("data-bounds");var q=t.split(" ");t=mxUtils.getDocumentSize();this.diagramContainer.style.top=q[0];this.diagramContainer.style.left=q[1];var D=parseInt(q[2]);q=parseInt(q[3]);D=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,D):D,t.width-80);q=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,q):q,t.height-80);this.diagramContainer.style.width=+D+"px";this.diagramContainer.style.height=q+"px";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";(window.opener||window.parent).postMessage(JSON.stringify({event:"resize",rect:this.diagramContainer.getBoundingClientRect()}),"*")}f.style.left=this.diagramContainer.offsetLeft+"px";f.style.top=this.diagramContainer.offsetTop-f.offsetHeight-4+"px";l.style.display="";l.style.left=this.diagramContainer.offsetLeft-l.offsetWidth-4+"px";l.style.top=this.diagramContainer.offsetTop++"px";c.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-c.offsetWidth+"px";c.style.top=f.style.top;c.style.right="";this.bottomResizer.style.left=this.diagramContainer.offsetLeft+(this.diagramContainer.offsetWidth-this.bottomResizer.offsetWidth)/2+"px";this.bottomResizer.style.top=this.diagramContainer.offsetTop+this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight/2-1+"px";this.rightResizer.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-+this.rightResizer.offsetWidth/2-1+"px";this.rightResizer.style.top=this.diagramContainer.offsetTop+(this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight)/2+"px"}this.bottomResizer.style.visibility=Editor.inlineFullscreen?"hidden":"";this.rightResizer.style.visibility=this.bottomResizer.style.visibility;f.style.visibility="";c.style.visibility=""};EditorUi.prototype.doSetSketchMode=function(c){Editor.sketchMode!=c&&(Editor.sketchMode=c,this.updateDefaultStyles())};EditorUi.prototype.updateDefaultStyles=+function(){var c=this.editor.graph;c.defaultVertexStyle=mxUtils.clone(Graph.prototype.defaultVertexStyle);c.defaultEdgeStyle=mxUtils.clone(Graph.prototype.defaultEdgeStyle);if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.vertexFontSize=16,c.edgeFontSize=c.vertexFontSize-4):"sketch"==Editor.currentTheme?(c.vertexFontSize=20,c.edgeFontSize=c.vertexFontSize-4):(c.vertexFontSize=Graph.prototype.vertexFontSize,+c.edgeFontSize=Graph.prototype.edgeFontSize),c.defaultEdgeStyle.fontSize=c.edgeFontSize;if(null==Editor.config||null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.endSize="8",c.defaultEdgeStyle.startSize="8"):"sketch"==Editor.currentTheme&&(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.jettySize=+"auto",c.defaultEdgeStyle.orthogonalLoop="1",c.defaultEdgeStyle.endArrow="open",c.defaultEdgeStyle.endSize="14",c.defaultEdgeStyle.startSize="14",c.defaultEdgeStyle.sourcePerimeterSpacing="8",c.defaultEdgeStyle.targetPerimeterSpacing="8");if(null==Editor.config||null==Editor.config.defaultFonts){if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle){if("sketch"==Editor.currentTheme&&"1"!=urlParams.embedInline||Editor.sketchMode)c.defaultVertexStyle.fontFamily=+Editor.sketchFontFamily,c.defaultVertexStyle.fontSource=Editor.sketchFontSource,c.defaultEdgeStyle.fontFamily=Editor.sketchFontFamily,c.defaultEdgeStyle.fontSource=Editor.sketchFontSource;Editor.sketchMode&&(c.defaultVertexStyle.sketch="1",c.defaultVertexStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultVertexStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultVertexStyle.hachureGap="4",c.defaultEdgeStyle.sketch="1",c.defaultEdgeStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultEdgeStyle.jiggle=+Editor.sketchDefaultJiggle,c.defaultEdgeStyle.hachureGap="4")}this.menus.defaultFonts="sketch"==Editor.currentTheme?Menus.prototype.defaultFonts.concat(Editor.sketchFonts):Menus.prototype.defaultFonts}c.currentVertexStyle=mxUtils.clone(c.defaultVertexStyle);c.currentEdgeStyle=mxUtils.clone(c.defaultEdgeStyle);this.clearDefaultStyle()};EditorUi.prototype.getLinkTitle=function(c){var f=Graph.prototype.getLinkTitle.apply(this,arguments);if(Graph.isPageLink(c)){var l=c.indexOf(",");0<l&&(f=this.getPageById(c.substring(l++1)),f=null!=f?f.getName():mxResources.get("pageNotFound"))}else"data:"==c.substring(0,5)&&(f=this.getCustomLinkTitle(c));return f};EditorUi.prototype.getCustomLinkTitle=function(c){var f=mxResources.get("action");if("data:action/json,"==c.substring(0,17))try{var l=JSON.parse(c.substring(17));null!=l&&null!=l.title&&(f=l.title)}catch(t){}return f};EditorUi.prototype.handleCustomLink=function(c,f){if(Graph.isPageLink(c))if(f=c.indexOf(","),c=this.getPageById(c.substring(f+1)))this.selectPage(c);else throw Error(mxResources.get("pageNotFound")||+"Page not found");else this.editor.graph.handleCustomLink(c,f)};EditorUi.prototype.installSettings=function(){if(Editor.isSettingsEnabled()){var c=this.editor.graph;Editor.pagesVisible=mxSettings.settings.pagesVisible;ColorDialog.recentColors=mxSettings.getRecentColors();if(isLocalStorage)try{window.addEventListener("storage",mxUtils.bind(this,function(f){f.key==mxSettings.key&&(mxSettings.load(),ColorDialog.recentColors=mxSettings.getRecentColors(),this.menus.customFonts=mxSettings.getCustomFonts())}),+!1)}catch(f){}this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.menus.customFonts=mxSettings.getCustomFonts();this.addListener("customFontsChanged",mxUtils.bind(this,function(f,l){mxSettings.setCustomFonts(this.menus.customFonts);mxSettings.save()}));c.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(f,l){mxSettings.setCreateTarget(c.connectionHandler.isCreateTarget());+mxSettings.save()}));c.pageFormat=null!=c.defaultPageFormat?c.defaultPageFormat:mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(f,l){mxSettings.setPageFormat(c.pageFormat);mxSettings.save()}));c.view.defaultDarkGridColor=mxSettings.getGridColor(!0);c.view.defaultGridColor=mxSettings.getGridColor(!1);c.view.gridColor="light-dark("+c.view.defaultGridColor+", "+c.view.defaultDarkGridColor+")";this.addListener("gridColorChanged",mxUtils.bind(this,function(f,+l){mxSettings.setGridColor(c.view.defaultGridColor,!1);mxSettings.setGridColor(c.view.defaultDarkGridColor,!0);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(f,l){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();if(!this.editor.chromeless||this.editor.editable)null!=mxSettings.settings.enableAnimations&&(Editor.enableAnimations=mxSettings.settings.enableAnimations),+this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(f,l){mxSettings.settings.enableAnimations=Editor.enableAnimations;mxSettings.save()}));null!=this.sidebar&&(null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes?(this.sidebar.searchShapes(decodeURIComponent(urlParams["search-shapes"])),this.sidebar.showEntries("search")):(this.sidebar.showPalette("search",mxSettings.settings.search),this.editor.chromeless&&!this.editor.editable||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||+0))||(this.toggleScratchpad(),mxSettings.save())));this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyImage=function(c,f,l){try{null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(t,q){try{this.spinner.stop();var D=this.createImageDataUri(t,f,"png"),H=parseInt(q.getAttribute("width")),+N=parseInt(q.getAttribute("height"));this.writeImageToClipboard(D,H,N,mxUtils.bind(this,function(L){this.handleError(L)}))}catch(L){this.handleError(L)}}),null,null,null,mxUtils.bind(this,function(t){this.spinner.stop();this.handleError(t)}),null,null,null!=l?l:4,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,null,null,null,10,null,null,!1,null,0<c.length?c:null)}catch(t){this.handleError(t)}};EditorUi.prototype.copyCells=function(c,f){var l=this.editor.graph;if(l.isSelectionEmpty())c.innerText=+"";else{var t=mxUtils.sortCells(l.model.getTopmostCells(l.getSelectionCells())),q=mxUtils.getXml(l.encodeCells(t));mxUtils.setTextContent(c,encodeURIComponent(q));f?(l.removeCells(t,!1),l.lastPasteXml=null):(l.lastPasteXml=q,l.pasteCounter=0);c.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var c=null;if(Editor.enableNativeCipboard){var f=this.editor.graph;f.isSelectionEmpty()||(c=mxUtils.sortCells(f.getExportableCells(f.model.getTopmostCells(f.getSelectionCells()))),+f=mxUtils.getXml(f.encodeCells(c)),navigator.clipboard.writeText(f))}return c};EditorUi.prototype.pasteXml=function(c,f,l,t,q){q=null!=q?q:!0;var D=this.editor.graph,H=null;D.lastPasteXml==c?D.pasteCounter++:(D.lastPasteXml=c,D.pasteCounter=0);var N=D.pasteCounter*D.gridSize;if(l||this.isCompatibleString(c))H=this.importXml(c,N,N),D.setSelectionCells(H);else if(f&&1==D.getSelectionCount()){q=D.getStartEditingCell(D.getSelectionCell(),t);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&"image"==D.getCurrentCellStyle(q)[mxConstants.STYLE_SHAPE])D.setCellStyles(mxConstants.STYLE_IMAGE,+c,[q]);else{D.model.beginUpdate();try{D.labelChanged(q,c),Graph.isLink(c)&&D.setLinkForCell(q,c)}finally{D.model.endUpdate()}}D.setSelectionCell(q)}else H=D.getInsertPoint(),D.isMouseInsertPoint()&&(N=0,D.lastPasteXml==c&&0<D.pasteCounter&&D.pasteCounter--),H=this.insertTextAt(c,H.x+N,H.y+N,q),D.setSelectionCells(H);D.isSelectionEmpty()||(D.scrollCellToVisible(D.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(D.view.getState(D.getSelectionCell())));return H};EditorUi.prototype.pasteCells=+function(c,f,l,t){if(!mxEvent.isConsumed(c)){var q=f,D=!1;if(l&&null!=c.clipboardData&&c.clipboardData.getData){var H=c.clipboardData.getData("text/plain"),N=!1;if(null!=H&&0<H.length&&"%3CmxGraphModel%3E"==H.substring(0,18))try{var L=decodeURIComponent(H);this.isCompatibleString(L)&&(N=!0,H=L)}catch(na){}N=N?null:c.clipboardData.getData("text/html");null!=N&&0<N.length?(q=this.parseHtmlData(N),D="text/plain"!=q.getAttribute("data-type")):null!=H&&0<H.length&&(q=document.createElement("div"),mxUtils.setTextContent(q,+N))}H=q.getElementsByTagName("span");if(null!=H&&0<H.length&&"application/vnd.lucid.chart.objects"===H[0].getAttribute("data-lucid-type"))l=H[0].getAttribute("data-lucid-content"),null!=l&&0<l.length&&(this.convertLucidChart(l,mxUtils.bind(this,function(na){var W=this.editor.graph;W.lastPasteXml==na?W.pasteCounter++:(W.lastPasteXml=na,W.pasteCounter=0);var ba=W.pasteCounter*W.gridSize;W.setSelectionCells(this.importXml(na,ba,ba));W.scrollCellToVisible(W.getSelectionCell())}),mxUtils.bind(this,function(na){this.handleError(na)})),+mxEvent.consume(c));else{var J=!1,Y="";Y=D?null!=q.textContent&&"<mxfile"==q.textContent.substring(0,7)&&"</mxfile>"==q.textContent.substring(q.textContent.length-9)||"<mxGraphModel"==q.textContent.substring(0,13)&&"</mxGraphModel>"==q.textContent.substring(q.textContent.length-15)?q.textContent.replace(/\u00a0/g," "):q.innerHTML:mxUtils.trim(null==q.innerText?mxUtils.getTextContent(q):q.innerText);try{var ha=Y.lastIndexOf("%3E");0<=ha&&ha<Y.length-3&&(Y=Y.substring(0,ha+3))}catch(na){}try{H=q.getElementsByTagName("span"),+(L=null!=H&&0<H.length?mxUtils.trim(decodeURIComponent(H[0].textContent)):decodeURIComponent(Y))&&(this.isCompatibleString(L)||0==L.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(J=!0,Y=L)}catch(na){}try{if(null!=Y&&0<Y.length){if(0==Y.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var ea=mxUtils.bind(this,function(){try{Y=(new MiroImporter).importMiroJson(JSON.parse(Y)),this.pasteXml(Y,t,J,c)}catch(na){console.log("Miro import error:",na)}});"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",ea):ea()}else this.pasteXml(Y,t,J,c,D);try{mxEvent.consume(c)}catch(na){}}else if(!l){var aa=this.editor.graph;aa.lastPasteXml=null;aa.pasteCounter=0}}catch(na){this.handleError(na)}}}f.innerHTML=" "};EditorUi.prototype.showPrintDialog=function(c,f,l){var t=320;this.editor.graph.isEnabled()&&(t+=40);null!=this.pages&&1<this.pages.length&&(t+=40,this.editor.graph.isEnabled()||(t+=10));null==f||mxClient.IS_CHROMEAPP||"draw.io"!=this.getServiceName()||-(t+=20);this.showDialog((new PrintDialog(this,c,f,l)).container,320,t,!0,!0)};EditorUi.prototype.print=function(c,f){var l=this.editor,t=l.graph,q=this.getPageIndex(this.currentPage),D=null!=q?q+1:1,G=mxUtils.bind(this,function(ba,ja,ca,la){var Q=ba.useCssTransforms,k=ba.currentTranslate,B=ba.currentScale,I=ba.view.translate,U=ba.view.scale;ba.useCssTransforms&&(ba.useCssTransforms=!1,ba.currentTranslate=new mxPoint(0,0),ba.currentScale=1,ba.view.translate=new mxPoint(0,0),ba.view.scale=1);var P=+(t+=20);this.showDialog((new PrintDialog(this,c,f,l)).container,320,t,!0,!0)};EditorUi.prototype.print=function(c,f){var l=this.editor,t=l.graph,q=this.getPageIndex(this.currentPage),D=null!=q?q+1:1,H=mxUtils.bind(this,function(ba,ja,ca,la){var Q=ba.useCssTransforms,k=ba.currentTranslate,B=ba.currentScale,I=ba.view.translate,U=ba.view.scale;ba.useCssTransforms&&(ba.useCssTransforms=!1,ba.currentTranslate=new mxPoint(0,0),ba.currentScale=1,ba.view.translate=new mxPoint(0,0),ba.view.scale=1);var P=ba.getGraphBounds(),T=0,X=0,Z=mxRectangle.fromRectangle(ba.pageFormat),ka=f.fit||f.crop||!ba.pageVisible,va=f.scale;Z.width=Math.ceil(Z.width*ba.pageScale);Z.height=Math.ceil(Z.height*ba.pageScale);var ua=1;if(f.fit){ua=f.sheetsAcross;var qa=f.sheetsDown;isNaN(va)||(Z.width=Math.ceil(Z.width*va),Z.height=Math.ceil(Z.height*va));ua=Math.min(Z.height*qa/(P.height/ba.view.scale),Z.width*ua/(P.width/ba.view.scale))}else ua=isNaN(va)?1:va;ua*=1;!ka&&ba.pageVisible?(va=ba.getPageLayout(),T-=va.x*Z.width,X-=va.y*Z.height):ka=!0;f.crop&&(f.selection&&(P=t.getBoundingBox(t.getSelectionCells())),Z.width=(P.width+1)*ua/ba.view.scale,Z.height=(P.height+1)*ua/ba.view.scale);Z.width=Math.ceil(1*Z.width);Z.height=Math.ceil(1*Z.height);la=null!=la?"page/id,"+la:null;if(null==ja){ja=PrintDialog.createPrintPreview(ba,ua,null,0,T,X,ka);ja.title=this.getBaseFilename(!0);ja.pageSelector=!1;ja.mathEnabled=!1;T=f.border;isNaN(T)||(ja.pageMargin=T);f.selection&&(ja.isCellVisible=function(za){return ba.isCellSelected(za)});var Ba=ja.writeHead;ja.writeHead=function(za){Ba.apply(this,arguments);mxClient.IS_GC&&(za.writeln('<style type="text/css">'),za.writeln("@media print {"),za.writeln(".MathJax svg { shape-rendering: crispEdges; }"),za.writeln("}"),za.writeln("</style>"));null!=l.fontCss&&(za.writeln('<style type="text/css">'),za.writeln(mxUtils.htmlEntities(l.fontCss,!1,!1,!1)),za.writeln("</style>"));for(var Ea=ba.getCustomFonts(),pa=0;pa<Ea.length;pa++){var Ca=Ea[pa].name,Aa=Ea[pa].url;Graph.isCssFontUrl(Aa)?za.writeln('<link rel="stylesheet" href="'+@@ -3866,26 +3868,26 @@ mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(Aa))+'" charset="UTF-8" type="te(ja.wnd.document.writeln('<style type="text/css">'),ja.wnd.document.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(T)+'";\nsrc: url("'+mxUtils.htmlEntities(X)+'");\n}'),ja.wnd.document.writeln("</style>"))}Q&&(ba.useCssTransforms=Q,ba.currentTranslate=k,ba.currentScale=B,ba.view.translate=I,ba.view.scale=U);return ja}),N=f.pagesFrom,L=f.pagesTo,J=!f.allPages;q=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,f);else{J&&(J=f.selection||N==D&&L==D);if(!J&&null!=this.pages&&this.pages.length){J=0;D=this.pages.length-1;f.allPages||(J=parseInt(N)-1,D=parseInt(L)-1);for(var Y=J;Y<=D;Y++){var ha=this.pages[Y];N=ha==this.currentPage?t:null;if(null==N){N=this.createTemporaryGraph(t.stylesheet);N.shapeForegroundColor=t.shapeForegroundColor;N.shapeBackgroundColor=t.shapeBackgroundColor;L=!0;J=!1;var ea=null,aa=null;null==ha.viewState&&null==ha.root&&this.updatePageRoot(ha);null!=ha.viewState&&(L=ha.viewState.pageVisible,J=ha.viewState.mathEnabled,ea=ha.viewState.background,aa=ha.viewState.backgroundImage,N.pageFormat=ha.viewState.pageFormat,N.gridSize=ha.viewState.gridSize);null!=aa&&null!=aa.originalSrc&&(aa=this.createImageForPageLink(aa.originalSrc,ha));N.background=ea;N.backgroundImage=null!=aa?new mxImage(aa.src,aa.width,aa.height,aa.x,aa.y):null;N.pageVisible=L;N.mathEnabled=J;var na=N.getGraphBounds;N.getGraphBounds=function(){var ba=na.apply(this,arguments),ja=this.backgroundImage;if(null!=ja&&null!=ja.width&&null!=ja.height){var ca=this.view.translate,la=this.view.scale;-ba=mxRectangle.fromRectangle(ba);ba.add(new mxRectangle((ca.x+ja.x)*la,(ca.y+ja.y)*la,ja.width*la,ja.height*la))}return ba};var W=N.getGlobalVariable;N.getGlobalVariable=function(ba){return"page"==ba?ha.getName():"pagenumber"==ba?Y+1:"pagecount"==ba?null!=this.pages?this.pages.length:1:W.apply(this,arguments)};document.body.appendChild(N.container);this.updatePageRoot(ha);N.model.setRoot(ha.root)}q=G(N,q,Y!=D,ha.getId());N!=t&&N.container.parentNode.removeChild(N.container)}}else q=G(t);null==q||-null==q.wnd?this.handleError({message:mxResources.get("errorUpdatingPreview")}):(q.mathEnabled&&(G=q.wnd.document,c||(q.wnd.IMMEDIATE_PRINT=!0),G.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>')),q.closeDocument(),Graph.rewritePageLinks(q.wnd.document,!0),q.mathEnabled||c||PrintDialog.printPreview(q));return q}};EditorUi.prototype.addFileDropHandler=function(c){if(Graph.fileSupport)for(var f=null,l=0;l<c.length;l++)mxEvent.addListener(c[l],"dragleave",function(t){null!=+ba=mxRectangle.fromRectangle(ba);ba.add(new mxRectangle((ca.x+ja.x)*la,(ca.y+ja.y)*la,ja.width*la,ja.height*la))}return ba};var W=N.getGlobalVariable;N.getGlobalVariable=function(ba){return"page"==ba?ha.getName():"pagenumber"==ba?Y+1:"pagecount"==ba?null!=this.pages?this.pages.length:1:W.apply(this,arguments)};document.body.appendChild(N.container);this.updatePageRoot(ha);N.model.setRoot(ha.root)}q=H(N,q,Y!=D,ha.getId());N!=t&&N.container.parentNode.removeChild(N.container)}}else q=H(t);null==q||+null==q.wnd?this.handleError({message:mxResources.get("errorUpdatingPreview")}):(q.mathEnabled&&(H=q.wnd.document,c||(q.wnd.IMMEDIATE_PRINT=!0),H.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>')),q.closeDocument(),Graph.rewritePageLinks(q.wnd.document,!0),q.mathEnabled||c||PrintDialog.printPreview(q));return q}};EditorUi.prototype.addFileDropHandler=function(c){if(Graph.fileSupport)for(var f=null,l=0;l<c.length;l++)mxEvent.addListener(c[l],"dragleave",function(t){null!=f&&(f.parentNode.removeChild(f),f=null);t.stopPropagation();t.preventDefault()}),mxEvent.addListener(c[l],"dragover",mxUtils.bind(this,function(t){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==f&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(f=this.highlightElement());t.stopPropagation();t.preventDefault()})),mxEvent.addListener(c[l],"drop",mxUtils.bind(this,function(t){null!=f&&(f.parentNode.removeChild(f),f=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<t.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(t.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)):this.openFiles(t.dataTransfer.files,!0);else{var q=this.extractGraphModelFromEvent(t);if(null==q){var D=null!=t.dataTransfer?t.dataTransfer:t.clipboardData;null!=D&&(10==document.documentMode||11==document.documentMode?q=D.getData("Text"):(q=null,q=0<=mxUtils.indexOf(D.types,"text/uri-list")?t.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(D.types,"text/html")?D.getData("text/html"):null,null!=q&&0<q.length?(D=document.createElement("div"),D.innerHTML=Graph.sanitizeHtml(q),D=D.getElementsByTagName("img"),0<D.length&&(q=D[0].getAttribute("src"))):0<=mxUtils.indexOf(D.types,"text/plain")&&(q=D.getData("text/plain"))),null!=q&&(Editor.isPngDataUrl(q)?(q=Editor.extractGraphModelFromPng(q),null!=q&&0<q.length&&this.openLocalFile(q,null,!0)):this.isRemoteFileFormat(q)?this.isOffline()?this.showError(mxResources.get("error"),-mxResources.get("notInOffline")):(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(q))).send(mxUtils.bind(this,function(G){200<=G.getStatus()&&299>=G.getStatus()?this.openLocalFile(G.getText(),null,!0):this.showError(mxResources.get("error"),413==G.getStatus()?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))})):/^https?:\/\//.test(q)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(q):window.geOpenWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost++mxResources.get("notInOffline")):(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(q))).send(mxUtils.bind(this,function(H){200<=H.getStatus()&&299>=H.getStatus()?this.openLocalFile(H.getText(),null,!0):this.showError(mxResources.get("error"),413==H.getStatus()?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))})):/^https?:\/\//.test(q)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(q):window.geOpenWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost+"/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(q)))))}else this.openLocalFile(q,null,!0)}t.stopPropagation();t.preventDefault()}))};EditorUi.prototype.highlightElement=function(c){var f=0,l=0;if(null==c){var t=document.body;var q=document.documentElement;var D=(t.clientWidth||q.clientWidth)-3;t=Math.max(t.clientHeight||0,q.clientHeight)-3}else f=c.offsetTop,l=c.offsetLeft,D=c.clientWidth,t=c.clientHeight;q=document.createElement("div");q.style.zIndex=mxPopupMenu.prototype.zIndex+2;q.style.border="3px dotted rgb(254, 137, 12)";q.style.pointerEvents="none";q.style.position="absolute";q.style.top=f+"px";q.style.left=l+"px";q.style.width=Math.max(0,D-3)+"px";q.style.height=Math.max(0,t-3)+"px";null!=c&&c.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(q):document.body.appendChild(q);return q};EditorUi.prototype.stringToCells=function(c){c=mxUtils.parseXml(c);var f=this.editor.extractGraphModel(c.documentElement);c=[];if(null!=f){var l=new mxCodec(f.ownerDocument),-t=new mxGraphModel;l.decode(f,t);f=t.getChildAt(t.getRoot(),0);for(l=0;l<t.getChildCount(f);l++)c.push(t.getChildAt(f,l))}return c};EditorUi.prototype.openFileHandle=function(c,f,l,t,q,D){if(null!=f&&0<f.length){if(!this.useCanvasForExport&&/(\.png)$/i.test(f)||/(\.pdf)$/i.test(f))f=f.substring(0,f.length-4),/(\.drawio)$/i.test(f)||(f+=".drawio");var G=mxUtils.bind(this,function(L){f=0<=f.lastIndexOf(".")?f.substring(0,f.lastIndexOf("."))+".drawio":f+".drawio";if("<mxlibrary"==L.substring(0,10)){null==-this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,t);try{this.loadLibrary(new LocalLibrary(this,L,f)),this.showSidebar()}catch(J){this.handleError(J,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(L,f,t)});if(EditorUi.isVisioFilename(f))this.importVisio(l,mxUtils.bind(this,function(L){this.spinner.stop();G(L)}));else if(/(\.*<graphml )/.test(c))this.importGraphML(c,mxUtils.bind(this,function(L){this.spinner.stop();G(L)}));else if(Graph.fileSupport&&-(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,f))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):this.parseFile(l,mxUtils.bind(this,function(L){4==L.readyState&&(this.spinner.stop(),200<=L.status&&299>=L.status?G(L.responseText):this.handleError({message:mxResources.get(413==L.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(c))/(\.json)$/i.test(f)&&(f=f.substring(0,+t=new mxGraphModel;l.decode(f,t);f=t.getChildAt(t.getRoot(),0);for(l=0;l<t.getChildCount(f);l++)c.push(t.getChildAt(f,l))}return c};EditorUi.prototype.openFileHandle=function(c,f,l,t,q,D){if(null!=f&&0<f.length){if(!this.useCanvasForExport&&/(\.png)$/i.test(f)||/(\.pdf)$/i.test(f))f=f.substring(0,f.length-4),/(\.drawio)$/i.test(f)||(f+=".drawio");var H=mxUtils.bind(this,function(L){f=0<=f.lastIndexOf(".")?f.substring(0,f.lastIndexOf("."))+".drawio":f+".drawio";if("<mxlibrary"==L.substring(0,10)){null==+this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,t);try{this.loadLibrary(new LocalLibrary(this,L,f)),this.showSidebar()}catch(J){this.handleError(J,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(L,f,t)});if(EditorUi.isVisioFilename(f))this.importVisio(l,mxUtils.bind(this,function(L){this.spinner.stop();H(L)}));else if(/(\.*<graphml )/.test(c))this.importGraphML(c,mxUtils.bind(this,function(L){this.spinner.stop();H(L)}));else if(Graph.fileSupport&&+(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,f))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):this.parseFile(l,mxUtils.bind(this,function(L){4==L.readyState&&(this.spinner.stop(),200<=L.status&&299>=L.status?H(L.responseText):this.handleError({message:mxResources.get(413==L.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(c))/(\.json)$/i.test(f)&&(f=f.substring(0,f.length-5)+".drawio"),this.convertLucidChart(c,mxUtils.bind(this,function(L){this.spinner.stop();this.openLocalFile(L,f,t)}),mxUtils.bind(this,function(L){this.spinner.stop();this.handleError(L)}));else if("<mxlibrary"==c.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,t);try{this.loadLibrary(new LocalLibrary(this,c,l.name)),this.showSidebar()}catch(L){this.handleError(L,mxResources.get("errorLoadingFile"))}}else if(0==-c.indexOf("PK"))this.importZipFile(l,mxUtils.bind(this,function(L){this.spinner.stop();G(L)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(c,f,t)}));else{if("image/png"==l.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==l.type){var N=Editor.extractGraphModelFromPdf(c);null!=N&&(q=null,t=!0,c=N)}this.spinner.stop();this.openLocalFile(c,f,t,q,null!=q?l:null,D)}}};EditorUi.prototype.openFiles=function(c,f){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var l=-0;l<c.length;l++)mxUtils.bind(this,function(t){var q=new FileReader;q.onload=mxUtils.bind(this,function(D){try{this.openFileHandle(D.target.result,t.name,t,f)}catch(G){this.handleError(G)}});q.onerror=mxUtils.bind(this,function(D){this.spinner.stop();this.handleError(D);window.openFile=null});"image"!==t.type.substring(0,5)&&"application/pdf"!==t.type||"image/svg"===t.type.substring(0,9)?q.readAsText(t):q.readAsDataURL(t)})(c[l])};EditorUi.prototype.openLocalFile=function(c,f,l,t,q,D){var G=this.getCurrentFile(),-N=mxUtils.bind(this,function(){window.openFile=null;if(null==f&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var L=mxUtils.parseXml(c);null!=L&&(this.editor.setGraphXml(L.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,c,f||this.defaultFilename,l,t,q,D))});if(null!=c&&0<c.length)null==G||!G.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=t)?N():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=t)&&null!=G&&G.isModified()?this.confirm(mxResources.get("allChangesLost"),-null,N,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(c,f),window.geOpenWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=G&&G.isModified()?this.confirm(mxResources.get("allChangesLost"),null,N,mxResources.get("cancel"),mxResources.get("discardChanges")):N()})));else throw Error(mxResources.get("notADiagramFile"));};EditorUi.prototype.getBasenames=function(){var c={};if(null!=this.pages)for(var f=-0;f<this.pages.length;f++)this.updatePageRoot(this.pages[f]),this.addBasenamesForCell(this.pages[f].root,c);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),c);f=[];for(var l in c)f.push(l);return f};EditorUi.prototype.addBasenamesForCell=function(c,f){function l(G){if(null!=G){var N=G.lastIndexOf(".");0<N&&(G=G.substring(N+1,G.length));null==f[G]&&(f[G]=!0)}}var t=this.editor.graph,q=t.getCellStyle(c);l(mxStencilRegistry.getBasenameForStencil(q[mxConstants.STYLE_SHAPE]));t.model.isEdge(c)&&+c.indexOf("PK"))this.importZipFile(l,mxUtils.bind(this,function(L){this.spinner.stop();H(L)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(c,f,t)}));else{if("image/png"==l.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==l.type){var N=Editor.extractGraphModelFromPdf(c);null!=N&&(q=null,t=!0,c=N)}this.spinner.stop();this.openLocalFile(c,f,t,q,null!=q?l:null,D)}}};EditorUi.prototype.openFiles=function(c,f){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var l=+0;l<c.length;l++)mxUtils.bind(this,function(t){var q=new FileReader;q.onload=mxUtils.bind(this,function(D){try{this.openFileHandle(D.target.result,t.name,t,f)}catch(H){this.handleError(H)}});q.onerror=mxUtils.bind(this,function(D){this.spinner.stop();this.handleError(D);window.openFile=null});"image"!==t.type.substring(0,5)&&"application/pdf"!==t.type||"image/svg"===t.type.substring(0,9)?q.readAsText(t):q.readAsDataURL(t)})(c[l])};EditorUi.prototype.openLocalFile=function(c,f,l,t,q,D){var H=this.getCurrentFile(),+N=mxUtils.bind(this,function(){window.openFile=null;if(null==f&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var L=mxUtils.parseXml(c);null!=L&&(this.editor.setGraphXml(L.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,c,f||this.defaultFilename,l,t,q,D))});if(null!=c&&0<c.length)null==H||!H.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=t)?N():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=t)&&null!=H&&H.isModified()?this.confirm(mxResources.get("allChangesLost"),+null,N,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(c,f),window.geOpenWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=H&&H.isModified()?this.confirm(mxResources.get("allChangesLost"),null,N,mxResources.get("cancel"),mxResources.get("discardChanges")):N()})));else throw Error(mxResources.get("notADiagramFile"));};EditorUi.prototype.getBasenames=function(){var c={};if(null!=this.pages)for(var f=+0;f<this.pages.length;f++)this.updatePageRoot(this.pages[f]),this.addBasenamesForCell(this.pages[f].root,c);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),c);f=[];for(var l in c)f.push(l);return f};EditorUi.prototype.addBasenamesForCell=function(c,f){function l(H){if(null!=H){var N=H.lastIndexOf(".");0<N&&(H=H.substring(N+1,H.length));null==f[H]&&(f[H]=!0)}}var t=this.editor.graph,q=t.getCellStyle(c);l(mxStencilRegistry.getBasenameForStencil(q[mxConstants.STYLE_SHAPE]));t.model.isEdge(c)&&(l(mxMarker.getPackageForType(q[mxConstants.STYLE_STARTARROW])),l(mxMarker.getPackageForType(q[mxConstants.STYLE_ENDARROW])));q=t.model.getChildCount(c);for(var D=0;D<q;D++)this.addBasenamesForCell(t.model.getChildAt(c,D),f)};EditorUi.prototype.setGraphEnabled=function(c){this.diagramContainer.style.visibility=c?"":"hidden";this.formatContainer.style.visibility=this.diagramContainer.style.visibility;this.sidebarContainer.style.display=c?"":"none";this.hsplit.style.display=this.sidebarContainer.style.display;this.editor.graph.setEnabled(c);null!=this.tabContainer&&(this.tabContainer.style.visibility=this.diagramContainer.style.visibility);c||this.hideWindows();this.editor.graph.sizeDidChange();this.resetScrollbars()};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);if((window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))){var c=!1;this.installMessageHandler(mxUtils.bind(this,function(f,l,t,q){c||(c=!0,this.spinner.stop(),-this.addEmbedButtons(),this.setGraphEnabled(!0));if(null==f||0==f.length)f=this.emptyDiagramXml;this.setCurrentFile(new EmbedFile(this,f,{}));this.mode=App.MODE_EMBED;this.setFileData(f);if(q)try{var D=this.editor.graph;D.setGridEnabled(!1);D.pageVisible=!1;var G=D.model.cells,N;for(N in G){var L=G[N];null!=L&&null!=L.style&&(L.style+=";sketch=1;"+(-1==L.style.indexOf("fontFamily=")||-1<L.style.indexOf("fontFamily=Helvetica;")?"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":+this.addEmbedButtons(),this.setGraphEnabled(!0));if(null==f||0==f.length)f=this.emptyDiagramXml;this.setCurrentFile(new EmbedFile(this,f,{}));this.mode=App.MODE_EMBED;this.setFileData(f);if(q)try{var D=this.editor.graph;D.setGridEnabled(!1);D.pageVisible=!1;var H=D.model.cells,N;for(N in H){var L=H[N];null!=L&&null!=L.style&&(L.style+=";sketch=1;"+(-1==L.style.indexOf("fontFamily=")||-1<L.style.indexOf("fontFamily=Helvetica;")?"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":""))}}catch(J){console.log(J)}this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog();this.chromelessResize&&this.chromelessResize();this.editor.undoManager.clear();this.editor.modified=null!=t?t:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))}};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(c,f){null!=c?this.spinner.spin(document.body,mxResources.get("loading"))&&c.getPublicUrl(mxUtils.bind(this,function(l){this.spinner.stop();f(l)})):f(null)};EditorUi.prototype.createLoadMessage=function(c){var f=this.editor.graph;return{event:c,pageVisible:f.pageVisible,translate:f.view.translate,bounds:f.getGraphBounds(),currentPage:this.getSelectedPageIndex(),scale:f.view.scale,page:f.view.getBackgroundPageBounds()}};EditorUi.prototype.sendEmbeddedSvgExport=function(c){try{var f=this.editor.graph;f.isEditing()&&f.stopEditing(!f.isInvokesStopCellEditing());var l=window.opener||window.parent;if(this.editor.modified){var t=f.background;if(null==t||t==mxConstants.NONE)t=this.embedExportBackground;this.getEmbeddedSvg(this.getFileData(!0,null,null,null,null,null,null,null,null,!1),f,null,!0,mxUtils.bind(this,function(q){l.postMessage(JSON.stringify({event:"export",point:this.embedExitPoint,@@ -3893,62 +3895,62 @@ exit:null!=c?!c:!0,data:Editor.createSvgDataUri(q)}),"*")}),null,null,!0,t,1,thiEditorUi.prototype.installMessageHandler=function(c){var f=null,l=!1,t=!1,q=null,D=mxUtils.bind(this,function(L,J){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified)))})):this.clearStatus()});this.editor.graph.model.addListener(mxEvent.CHANGE,D);mxEvent.addListener(window,"message",mxUtils.bind(this,function(L){if(L.source==(window.opener||window.parent)){var J=L.data,Y=null,ha=mxUtils.bind(this,function(pa){if(null!=pa&&"function"===typeof pa.charAt&&"<"!=pa.charAt(0))try{Editor.isPngDataUrl(pa)?pa=Editor.extractGraphModelFromPng(pa):"data:image/svg+xml;base64,"==pa.substring(0,26)?pa=atob(pa.substring(26)):"data:image/svg+xml;utf8,"==pa.substring(0,24)&&(pa=pa.substring(24)),null!=pa&&(""==pa.trim()?pa=null:"%"==pa.charAt(0)?pa=decodeURIComponent(pa):"<"!=pa.charAt(0)&&(pa=Graph.decompress(pa)))}catch(Ca){}return pa});if("json"==urlParams.proto){var ea=!1;try{J=JSON.parse(J),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[L],"data",[J])}catch(pa){J=null}try{if(null==J)return;if("dialog"==J.action){this.showError(null!=J.titleKey?mxResources.get(J.titleKey):J.title,null!=J.messageKey?mxResources.get(J.messageKey):mxUtils.htmlEntities(J.message),null!=J.buttonKey?mxResources.get(J.buttonKey):J.button);null!=J.modified&&(this.editor.modified=J.modified);return}if("layout"==J.action){this.executeLayouts(this.editor.graph.createLayouts(J.layouts));-return}if("prompt"==J.action){this.spinner.stop();var aa=new FilenameDialog(this,J.defaultValue||"",null!=J.okKey?mxResources.get(J.okKey):J.ok,function(pa){null!=pa?G.postMessage(JSON.stringify({event:"prompt",value:pa,message:J}),"*"):G.postMessage(JSON.stringify({event:"prompt-cancel",message:J}),"*")},null!=J.titleKey?mxResources.get(J.titleKey):J.title,null,null,null,null,function(){G.postMessage(JSON.stringify({event:"prompt-cancel",message:J}),"*")});this.showDialog(aa.container,300,80,!0,-!1);aa.init();return}if("draft"==J.action){var na=ha(J.xml);this.spinner.stop();aa=new DraftDialog(this,mxResources.get("draftFound",[J.name||this.defaultFilename]),na,mxUtils.bind(this,function(){this.hideDialog();G.postMessage(JSON.stringify({event:"draft",result:"edit",message:J}),"*")}),mxUtils.bind(this,function(){this.hideDialog();G.postMessage(JSON.stringify({event:"draft",result:"discard",message:J}),"*")}),J.editKey?mxResources.get(J.editKey):null,J.discardKey?mxResources.get(J.discardKey):-null,J.ignore?mxUtils.bind(this,function(){this.hideDialog();G.postMessage(JSON.stringify({event:"draft",result:"ignore",message:J}),"*")}):null);this.showDialog(aa.container,640,480,!0,!1,mxUtils.bind(this,function(pa){pa&&this.actions.get("exit").funct()}));try{aa.init()}catch(pa){G.postMessage(JSON.stringify({event:"draft",error:pa.toString(),message:J}),"*")}return}if("template"==J.action){this.spinner.stop();var W=1==J.enableRecent,ba=1==J.enableSearch,ja=1==J.enableCustomTemp;aa=new NewDialog(this,-!1,J.templatesOnly?!1:null!=J.callback,mxUtils.bind(this,function(pa,Ca,Aa,wa){pa=pa||this.emptyDiagramXml;null!=J.callback?G.postMessage(JSON.stringify({event:"template",xml:pa,blank:pa==this.emptyDiagramXml,name:Ca,tempUrl:Aa,libs:wa,builtIn:!0,message:J}),"*"):(c(pa,L,pa!=this.emptyDiagramXml,J.toSketch),this.editor.modified||this.clearStatus())}),null,null,null,null,null,null,null,W?mxUtils.bind(this,function(pa){this.remoteInvoke("getRecentDiagrams",[null],null,pa,function(){pa(null,"Network Error!")})}):-null,ba?mxUtils.bind(this,function(pa,Ca){this.remoteInvoke("searchDiagrams",[pa,null],null,Ca,function(){Ca(null,"Network Error!")})}):null,mxUtils.bind(this,function(pa,Ca,Aa){G.postMessage(JSON.stringify({event:"template",docUrl:pa,info:Ca,name:Aa}),"*")}),null,null,ja?mxUtils.bind(this,function(pa){this.remoteInvoke("getCustomTemplates",null,null,pa,function(){pa({},0)})}):null,1==J.withoutType);this.showDialog(aa.container,620,460,!0,!1,mxUtils.bind(this,function(pa){null!=this.sidebar&&this.sidebar.hideTooltip();-pa&&this.actions.get("exit").funct()}));aa.init();return}if("textContent"==J.action){var ca=this.getDiagramTextContent();G.postMessage(JSON.stringify({event:"textContent",data:ca,message:J}),"*");return}if("status"==J.action){this.updateStatus(mxUtils.bind(this,function(){null!=J.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(J.messageKey))):null!=J.message&&this.editor.setStatus(mxUtils.htmlEntities(J.message))}));null!=J.modified&&(this.editor.modified=J.modified);return}if("spinner"==+return}if("prompt"==J.action){this.spinner.stop();var aa=new FilenameDialog(this,J.defaultValue||"",null!=J.okKey?mxResources.get(J.okKey):J.ok,function(pa){null!=pa?H.postMessage(JSON.stringify({event:"prompt",value:pa,message:J}),"*"):H.postMessage(JSON.stringify({event:"prompt-cancel",message:J}),"*")},null!=J.titleKey?mxResources.get(J.titleKey):J.title,null,null,null,null,function(){H.postMessage(JSON.stringify({event:"prompt-cancel",message:J}),"*")});this.showDialog(aa.container,300,80,!0,+!1);aa.init();return}if("draft"==J.action){var na=ha(J.xml);this.spinner.stop();aa=new DraftDialog(this,mxResources.get("draftFound",[J.name||this.defaultFilename]),na,mxUtils.bind(this,function(){this.hideDialog();H.postMessage(JSON.stringify({event:"draft",result:"edit",message:J}),"*")}),mxUtils.bind(this,function(){this.hideDialog();H.postMessage(JSON.stringify({event:"draft",result:"discard",message:J}),"*")}),J.editKey?mxResources.get(J.editKey):null,J.discardKey?mxResources.get(J.discardKey):+null,J.ignore?mxUtils.bind(this,function(){this.hideDialog();H.postMessage(JSON.stringify({event:"draft",result:"ignore",message:J}),"*")}):null);this.showDialog(aa.container,640,480,!0,!1,mxUtils.bind(this,function(pa){pa&&this.actions.get("exit").funct()}));try{aa.init()}catch(pa){H.postMessage(JSON.stringify({event:"draft",error:pa.toString(),message:J}),"*")}return}if("template"==J.action){this.spinner.stop();var W=1==J.enableRecent,ba=1==J.enableSearch,ja=1==J.enableCustomTemp;aa=new NewDialog(this,+!1,J.templatesOnly?!1:null!=J.callback,mxUtils.bind(this,function(pa,Ca,Aa,wa){pa=pa||this.emptyDiagramXml;null!=J.callback?H.postMessage(JSON.stringify({event:"template",xml:pa,blank:pa==this.emptyDiagramXml,name:Ca,tempUrl:Aa,libs:wa,builtIn:!0,message:J}),"*"):(c(pa,L,pa!=this.emptyDiagramXml,J.toSketch),this.editor.modified||this.clearStatus())}),null,null,null,null,null,null,null,W?mxUtils.bind(this,function(pa){this.remoteInvoke("getRecentDiagrams",[null],null,pa,function(){pa(null,"Network Error!")})}):+null,ba?mxUtils.bind(this,function(pa,Ca){this.remoteInvoke("searchDiagrams",[pa,null],null,Ca,function(){Ca(null,"Network Error!")})}):null,mxUtils.bind(this,function(pa,Ca,Aa){H.postMessage(JSON.stringify({event:"template",docUrl:pa,info:Ca,name:Aa}),"*")}),null,null,ja?mxUtils.bind(this,function(pa){this.remoteInvoke("getCustomTemplates",null,null,pa,function(){pa({},0)})}):null,1==J.withoutType);this.showDialog(aa.container,620,460,!0,!1,mxUtils.bind(this,function(pa){null!=this.sidebar&&this.sidebar.hideTooltip();+pa&&this.actions.get("exit").funct()}));aa.init();return}if("textContent"==J.action){var ca=this.getDiagramTextContent();H.postMessage(JSON.stringify({event:"textContent",data:ca,message:J}),"*");return}if("status"==J.action){this.updateStatus(mxUtils.bind(this,function(){null!=J.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(J.messageKey))):null!=J.message&&this.editor.setStatus(mxUtils.htmlEntities(J.message))}));null!=J.modified&&(this.editor.modified=J.modified);return}if("spinner"==J.action){var la=null!=J.messageKey?mxResources.get(J.messageKey):J.message;null==J.show||J.show?this.spinner.spin(document.body,la):this.spinner.stop();return}if("exit"==J.action){this.actions.get("exit").funct();return}if("viewport"==J.action){if(null!=J.viewport){var Q=this.editor.graph,k=Q.view.translate.x,B=Q.view.translate.y;this.embedViewport=J.viewport;Q.refresh();this.diagramContainer.scrollTop-=(B-Q.view.translate.y)*Q.view.scale;this.diagramContainer.scrollLeft-=(k-Q.view.translate.x)*Q.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("fullscreenChanged"==J.action){aa=null;try{var I=this.diagramContainer.getAttribute("data-scrollState");null!=I&&(this.diagramContainer.removeAttribute("data-scrollState"),aa=JSON.parse(I))}catch(pa){}Editor.inlineFullscreen=J.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=aa&&this.restoreScrollState(aa);return}if("snapshot"==J.action){this.sendEmbeddedSvgExport(!0);return}if("export"==J.action){if("png"==J.format||"xmlpng"==J.format){if(null==J.spin&&null==J.spinKey||this.spinner.spin(document.body,null!=J.spinKey?mxResources.get(J.spinKey):J.spin)){var U=null!=J.xml?J.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);Q=this.editor.graph;var P=mxUtils.bind(this,function(pa,Ca){if(J.withSvg)J.withSvg=!1,this.getEmbeddedSvg(U,this.editor.graph,null,!0,function(wa){P(pa,wa)},null,null,J.embedImages,this.editor.graph.background,J.scale,J.border,J.shadow,"auto");else{this.editor.graph.setEnabled(!0);-this.spinner.stop();var Aa=this.createLoadMessage("export");Aa.format=J.format;Aa.message=J;Aa.data=pa;Aa.svg=Ca;Aa.xml=U;G.postMessage(JSON.stringify(Aa),"*")}}),T=mxUtils.bind(this,function(pa){null==pa&&(pa=Editor.blankImage);"xmlpng"==J.format&&(pa=Editor.writeGraphModelToPng(pa,"tEXt","mxfile",encodeURIComponent(U)));Q!=this.editor.graph&&Q.container.parentNode.removeChild(Q.container);P(pa)}),X=J.pageId||(null!=this.pages?J.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.isExportToCanvas()){var Z=+this.spinner.stop();var Aa=this.createLoadMessage("export");Aa.format=J.format;Aa.message=J;Aa.data=pa;Aa.svg=Ca;Aa.xml=U;H.postMessage(JSON.stringify(Aa),"*")}}),T=mxUtils.bind(this,function(pa){null==pa&&(pa=Editor.blankImage);"xmlpng"==J.format&&(pa=Editor.writeGraphModelToPng(pa,"tEXt","mxfile",encodeURIComponent(U)));Q!=this.editor.graph&&Q.container.parentNode.removeChild(Q.container);P(pa)}),X=J.pageId||(null!=this.pages?J.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.isExportToCanvas()){var Z=mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=X){var pa=Q.getGlobalVariable;Q=this.createTemporaryGraph(Q.getStylesheet());for(var Ca,Aa=0;Aa<this.pages.length;Aa++)if(this.pages[Aa].getId()==X){Ca=this.updatePageRoot(this.pages[Aa]);break}null==Ca&&(Ca=this.currentPage);Q.getGlobalVariable=function(Ra){return"page"==Ra?Ca.getName():"pagenumber"==Ra?1:pa.apply(this,arguments)};document.body.appendChild(Q.container);Q.model.setRoot(Ca.root)}if(null!=J.layerIds){var wa=Q.model,Ya=wa.getChildCells(wa.getRoot()),Qa={};for(Aa=0;Aa<J.layerIds.length;Aa++)Qa[J.layerIds[Aa]]=!0;for(Aa=0;Aa<Ya.length;Aa++)wa.setVisible(Ya[Aa],Qa[Ya[Aa].id]||!1)}Aa=null;J.keepTheme&&(Aa=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,function(Ra){T(Ra.toDataURL("image/png"))}),J.width,null,J.background,mxUtils.bind(this,function(){T(null)}),null,null,J.scale,J.transparent,J.shadow,null,Q,J.border,null,J.grid,Aa)});null!=J.xml&&0<J.xml.length&&(l=!0,this.setFileData(U),l=!1);Z()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==J.format?"1":"0")+(null!=X?"&pageId="+X:"")+(null!=J.layerIds&&0<J.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:J.layerIds})):"")+(null!=J.scale?"&scale="+J.scale:"")+"&base64=1&xml="+encodeURIComponent(U))).send(mxUtils.bind(this,function(pa){200<=pa.getStatus()&&299>=pa.getStatus()?P("data:image/png;base64,"+pa.getText()):T(null)}),mxUtils.bind(this,function(){T(null)}))}}else if(Z=mxUtils.bind(this,function(){var pa=this.createLoadMessage("export");pa.message=J;if("html2"==J.format||"html"==J.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var Ca=this.getXmlFileData();pa.xml=mxUtils.getXml(Ca);pa.data=this.getFileData(null,null,!0,null,null,null,Ca);pa.format=J.format}else if("html"==J.format)Ca=this.editor.getGraphXml(),pa.data=this.getHtml(Ca,this.editor.graph),pa.xml=mxUtils.getXml(Ca),pa.format=J.format;else{mxSvgCanvas2D.prototype.foAltText=null;Ca=null!=J.background?-J.background:this.editor.graph.background;Ca==mxConstants.NONE&&(Ca=null);pa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);pa.format="svg";var Aa=mxUtils.bind(this,function(Ya){this.editor.graph.setEnabled(!0);this.spinner.stop();pa.data=Editor.createSvgDataUri(Ya);G.postMessage(JSON.stringify(pa),"*")}),wa="auto";J.keepTheme&&(wa=Editor.isDarkMode()?"dark":"light");null!=J.theme&&(wa=J.theme);if("xmlsvg"==J.format){if(null==J.spin&&null==J.spinKey||this.spinner.spin(document.body,+J.background:this.editor.graph.background;Ca==mxConstants.NONE&&(Ca=null);pa.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);pa.format="svg";var Aa=mxUtils.bind(this,function(Ya){this.editor.graph.setEnabled(!0);this.spinner.stop();pa.data=Editor.createSvgDataUri(Ya);H.postMessage(JSON.stringify(pa),"*")}),wa="auto";J.keepTheme&&(wa=Editor.isDarkMode()?"dark":"light");null!=J.theme&&(wa=J.theme);if("xmlsvg"==J.format){if(null==J.spin&&null==J.spinKey||this.spinner.spin(document.body,null!=J.spinKey?mxResources.get(J.spinKey):J.spin)){wa=null;if(this.isAutoDarkMode()||Editor.isDarkMode())wa="auto";null!=J.theme&&(wa=J.theme);this.getEmbeddedSvg(pa.xml,this.editor.graph,null,!0,Aa,null,null,J.embedImages,Ca,J.scale,J.border,J.shadow,wa)}}else if(null==J.spin&&null==J.spinKey||this.spinner.spin(document.body,null!=J.spinKey?mxResources.get(J.spinKey):J.spin))this.editor.graph.setEnabled(!1),Ca=this.editor.graph.getSvg(Ca,J.scale,J.border,null,null,null,null,null,null,this.editor.graph.shadowVisible||-J.shadow,null,wa),(this.editor.graph.shadowVisible||J.shadow)&&this.editor.graph.addSvgShadow(Ca),this.embedFonts(Ca,mxUtils.bind(this,function(Ya){J.embedImages||null==J.embedImages?this.editor.convertImages(Ya,mxUtils.bind(this,function(Qa){Aa(mxUtils.getXml(Qa))})):Aa(mxUtils.getXml(Ya))}));return}G.postMessage(JSON.stringify(pa),"*")}),null!=J.xml&&0<J.xml.length){if(this.editor.graph.mathEnabled){var ka=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){ka.apply(this,arguments);Z()}}l=!0;this.setFileData(J.xml);+J.shadow,null,wa),(this.editor.graph.shadowVisible||J.shadow)&&this.editor.graph.addSvgShadow(Ca),this.embedFonts(Ca,mxUtils.bind(this,function(Ya){J.embedImages||null==J.embedImages?this.editor.convertImages(Ya,mxUtils.bind(this,function(Qa){Aa(mxUtils.getXml(Qa))})):Aa(mxUtils.getXml(Ya))}));return}H.postMessage(JSON.stringify(pa),"*")}),null!=J.xml&&0<J.xml.length){if(this.editor.graph.mathEnabled){var ka=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){ka.apply(this,arguments);Z()}}l=!0;this.setFileData(J.xml);l=!1;this.editor.graph.mathEnabled||Z()}else Z();return}if("load"==J.action){ea=J.toSketch;t=1==J.autosave;this.hideDialog();null!=J.modified&&null==urlParams.modified&&(urlParams.modified=J.modified);null!=J.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=J.saveAndExit);if("1"==urlParams.saveAndExit||"1"==urlParams.publishClose)if(this.actions.get("save").shortcut=null,!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(83,!0,"saveAndExit"),"1"!=urlParams.noSaveBtn&&(this.actions.get("save").shortcut=Editor.ctrlKey+"+Shift+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=J.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=J.noSaveBtn);if(null!=J.rough){var va=Editor.sketchMode;this.doSetSketchMode(J.rough);va!=Editor.sketchMode&&this.fireEvent(new mxEventObject("sketchModeChanged"))}null!=J.dark&&this.setDarkMode(J.dark);null!=J.border&&(this.embedExportBorder=J.border);null!=J.theme&&(this.embedExportTheme=J.theme);null!=J.background&&(this.embedExportBackground=J.background);null!=J.viewport&&(this.embedViewport=J.viewport);this.embedExitPoint=null;if(null!=J.rect){var ua=this.embedExportBorder;this.diagramContainer.style.left=Math.max(60,J.rect.left)+"px";this.diagramContainer.style.top=Math.max(40,J.rect.top)+"px";this.minInlineWidth=J.minWidth;this.minInlineHeight=J.minHeight;this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";var qa=J.maxFitScale,Ba=J.rect.width+2*ua,ya=J.rect.height+2*ua;Y=mxUtils.bind(this,function(){var pa=mxUtils.getDocumentSize();Ba=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,Ba):Ba,pa.width-80);pa=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,ya):ya,pa.height-80);this.diagramContainer.style.width=Ba+"px";this.diagramContainer.style.height=pa+"px";var Ca=this.editor.graph;pa=Ca.maxFitScale;Ca.maxFitScale=qa;Ca.fit(2*ua,null,null,null,null,null,ya);this.setPageVisible(!1);if(null!=this.minInlineWidth&&Ca.getGraphBounds().width<this.minInlineWidth){var Aa=Ca.container.scrollTop;this.resetScrollbars();Ca.container.scrollTop=Aa}Ca.maxFitScale=pa;Ca.container.scrollTop-=ua;Ca.container.scrollLeft-=ua;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[J]));Ca.container.focus();null!=this.formatWindow&&null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=Ca.container.style.top);var wa=Ca.getGraphBounds();Ca.container.clientWidth>-wa.width+2*ua&&(Ca.container.scrollLeft=wa.x+(wa.width+ua-Ca.container.clientWidth)/2)}),10)})}null!=J.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=J.noExitBtn);null!=J.title&&null!=this.buttonContainer&&(na=this.createStatusDiv(J.title),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?this.menubarContainer.appendChild(na):this.buttonContainer.appendChild(na),this.embedFilenameSpan=-na);try{J.libs&&this.sidebar.showEntries(J.libs)}catch(pa){}J=null!=J.xmlpng?this.extractGraphModelFromPng(J.xmlpng):null!=J.descriptor?J.descriptor:J.xml}else{if("merge"==J.action){var La=this.getCurrentFile();null!=La&&(na=ha(J.xml),null!=na&&""!=na&&La.mergeFile(new LocalFile(this,na),function(){G.postMessage(JSON.stringify({event:"merge",message:J}),"*")},function(pa){G.postMessage(JSON.stringify({event:"merge",message:J,error:pa}),"*")}))}else"remoteInvokeReady"==J.action?this.handleRemoteInvokeReady(G):-"remoteInvoke"==J.action?this.handleRemoteInvoke(J,L.origin):"remoteInvokeResponse"==J.action?this.handleRemoteInvokeResponse(J):G.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(J)}),"*");return}}catch(pa){this.handleError(pa)}}var za=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),Ea=mxUtils.bind(this,function(pa,Ca){l=!0;try{c(pa,Ca,null,ea)}catch(Aa){this.handleError(Aa)}l=-!1;null!=urlParams.modified&&this.clearStatus();q=za();t&&null==f&&(f=mxUtils.bind(this,function(Aa,wa){Aa=za();Aa==q||l||(wa=this.createLoadMessage("autosave"),wa.xml=Aa,(window.opener||window.parent).postMessage(JSON.stringify(wa),"*"));q=Aa}),this.editor.graph.model.addListener(mxEvent.CHANGE,f),this.editor.graph.addListener("gridSizeChanged",f),this.editor.graph.addListener("shadowVisibleChanged",f),this.addListener("pageFormatChanged",f),this.addListener("pageScaleChanged",f),this.addListener("backgroundColorChanged",-f),this.addListener("backgroundImageChanged",f),this.addListener("foldingEnabledChanged",f),this.addListener("mathEnabledChanged",f),this.addListener("gridEnabledChanged",f),this.addListener("guidesEnabledChanged",f),this.addListener("pageViewChanged",f));if("1"==urlParams.returnbounds||"json"==urlParams.proto)Ca=this.createLoadMessage("load"),Ca.xml=pa,G.postMessage(JSON.stringify(Ca),"*");null!=Y&&Y()});null!=J&&"function"===typeof J.substring&&"data:application/vnd.visio;base64,"==J.substring(0,-34)?(ha="0M8R4KGxGuE"==J.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(J.substring(J.indexOf(",")+1)),function(pa){Ea(pa,L)},mxUtils.bind(this,function(pa){this.handleError(pa)}),ha)):null!=J&&"function"===typeof J.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(J,"")?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(J,mxUtils.bind(this,function(pa){4==pa.readyState&&(200<=pa.status&&299>=pa.status&&-"<mxGraphModel"==pa.responseText.substring(0,13)?Ea(pa.responseText,L):this.handleError({message:413==pa.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")}))}),""):null!=J&&"function"===typeof J.substring&&this.isLucidChartData(J)?this.convertLucidChart(J,mxUtils.bind(this,function(pa){Ea(pa)}),mxUtils.bind(this,function(pa){this.handleError(pa)})):null==J||"object"!==typeof J||null==J.format||null==J.data&&null==J.url?(J=ha(J),Ea(J,L)):this.loadDescriptor(J,mxUtils.bind(this,-function(pa){Ea(za(),L)}),mxUtils.bind(this,function(pa){this.handleError(pa,mxResources.get("errorLoadingFile"))}))}}));var G=window.opener||window.parent;D="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";G.postMessage(D,"*");if("json"==urlParams.proto){var N=this.editor.graph.openLink;this.editor.graph.openLink=function(L,J,Y){N.apply(this,arguments);G.postMessage(JSON.stringify({event:"openLink",href:L,target:J,allowOpener:Y}),"*")}}};EditorUi.prototype.createEmbedButton=-function(c,f,l,t){var q=document.createElement("button");q.className="geEmbedBtn geBtn";q.setAttribute("title",c+(null!=l?" ("+l+")":""));mxUtils.write(q,c);t&&q.classList.add("gePrimaryBtn");mxEvent.addListener(q,"click",f);return q};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,function(){var c=null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode==this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);-"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+Shift+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&-this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct))}))};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,-mxUtils.bind(this,function(c){this.importCsv(c)}),null,null,620,430,null,!0,!0,mxResources.get("import"),this.isOffline()?null:"https://drawio-app.com/import-from-csv-to-drawio/"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,function(){var f=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(l){if(0<l.length)try{var t=-JSON.parse(l);this.executeLayouts(this.editor.graph.createLayouts(t));this.customLayoutConfig=t;this.hideDialog()}catch(q){this.handleError(q)}}),null,null,null,null,mxUtils.bind(this,function(l,t){var q=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var D=t.value;t.value=JSON.stringify(JSON.parse(D));t.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?t.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));-t.value=D}catch(G){this.handleError(G)}}));q.setAttribute("title","copy");q.className="geBtn";l.appendChild(q)}),!0,null,null,"https://www.drawio.com/doc/faq/apply-layouts");this.showDialog(f.container,620,460,!0,!0);f.init()}))};EditorUi.prototype.loadOrgChartLayouts=function(c){this.createTimeout(null,mxUtils.bind(this,function(f){var l=mxUtils.bind(this,function(){this.loadingOrgChart=!1;f.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),t=mxUtils.bind(this,function(q){this.loadingOrgChart=-!1;f.clear()&&this.handleError(q)});"undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0)?l():this.spinner.spin(document.body,mxResources.get("loading"))&&(this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",l,null,null,null,t)},null,null,null,t)},null,null,null,t)},null,null,-null,t):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",l,null,null,null,t))}),onerror)};EditorUi.prototype.importCsv=function(c,f){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,f)}))};EditorUi.prototype.doImportCsv=function(c,f){try{var l=c.split("\n"),t=[],q=[],D=[],G={};if(0<l.length){var N={},L=this.editor.graph,J=null,Y=null,ha=null,ea=null,aa=null,na=null,W=null,ba="whiteSpace=wrap;html=1;",ja=null,ca=null,la="",Q="auto",k="auto",B=!1,I=null,U=null,P=40,T=40,-X=100,Z=0,ka=mxUtils.bind(this,function(){null!=f?f(ra):(L.setSelectionCells(ra),L.scrollCellToVisible(L.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),va=L.getFreeInsertPoint(),ua=va.x,qa=va.y;va=qa;var Ba=null,ya="auto";ca=null;for(var La=[],za=null,Ea=null,pa=0;pa<l.length&&"#"==l[pa].charAt(0);){c=l[pa].replace(/\r$/,"");for(pa++;pa<l.length&&"\\"==c.charAt(c.length-1)&&"#"==l[pa].charAt(0);)c=c.substring(0,c.length--1)+mxUtils.trim(l[pa].substring(1)),pa++;if("#"!=c.charAt(1)){var Ca=c.indexOf(":");if(0<Ca){var Aa=mxUtils.trim(c.substring(1,Ca)),wa=mxUtils.trim(c.substring(Ca+1));"label"==Aa?Ba=Graph.sanitizeHtml(wa):"labelname"==Aa&&0<wa.length&&"-"!=wa?aa=wa:"labels"==Aa&&0<wa.length&&"-"!=wa?W=JSON.parse(wa):"style"==Aa?Y=wa:"parentstyle"==Aa?ba=wa:"unknownStyle"==Aa&&"-"!=wa?na=wa:"stylename"==Aa&&0<wa.length&&"-"!=wa?ea=wa:"styles"==Aa&&0<wa.length&&"-"!=wa?ha=JSON.parse(wa):"vars"==Aa&&0<wa.length&&"-"!=-wa?J=JSON.parse(wa):"identity"==Aa&&0<wa.length&&"-"!=wa?ja=wa:"parent"==Aa&&0<wa.length&&"-"!=wa?ca=wa:"namespace"==Aa&&0<wa.length&&"-"!=wa?la=wa:"width"==Aa?Q=wa:"height"==Aa?k=wa:"collapsed"==Aa&&"-"!=wa?B="true"==wa:"left"==Aa&&0<wa.length?I=wa:"top"==Aa&&0<wa.length?U=wa:"ignore"==Aa?Ea=wa.split(","):"connect"==Aa?La.push(JSON.parse(wa)):"link"==Aa?za=wa:"padding"==Aa?Z=parseFloat(wa):"edgespacing"==Aa?P=parseFloat(wa):"nodespacing"==Aa?T=parseFloat(wa):"levelspacing"==Aa?X=parseFloat(wa):"layout"==-Aa&&(ya=wa)}}}if(null==l[pa])throw Error(mxResources.get("invalidOrMissingFile"));var Ya=this.editor.csvToArray(l[pa].replace(/\r$/,""));Ca=c=null;Aa=[];for(wa=0;wa<Ya.length;wa++)ja==Ya[wa]&&(c=wa),ca==Ya[wa]&&(Ca=wa),Aa.push(mxUtils.trim(Ya[wa]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==Ba&&(Ba="%"+Aa[0]+"%");if(null!=La)for(var Qa=0;Qa<La.length;Qa++)null==N[La[Qa].to]&&(N[La[Qa].to]={});ja=[];for(wa=pa+1;wa<l.length;wa++){var Ra=this.editor.csvToArray(l[wa].replace(/\r$/,-""));if(null==Ra){var Sa=40<l[wa].length?l[wa].substring(0,40)+"...":l[wa];throw Error(Sa+" ("+wa+"):\n"+mxResources.get("containsValidationErrors"));}0<Ra.length&&ja.push(Ra)}L.model.beginUpdate();try{for(wa=0;wa<ja.length;wa++){Ra=ja[wa];var Ha=null,Ma=null!=c?la+Ra[c]:null;l=!1;null!=Ma&&(Ha=L.model.getCell(Ma),l=null==Ha||0<=mxUtils.indexOf(t,Ha));var y=new mxCell(Ba,new mxGeometry(ua,va,0,0),Y||"whiteSpace=wrap;html=1;");y.collapsed=B;y.vertex=!0;y.id=Ma;null==Ha||l||L.model.setCollapsed(Ha,-B);for(var O=0;O<Ra.length;O++)L.setAttributeForCell(y,Aa[O],Ra[O]),null==Ha||l||L.setAttributeForCell(Ha,Aa[O],Ra[O]);if(null!=aa&&null!=W){var R=W[y.getAttribute(aa)];null!=R&&(L.labelChanged(y,R),null==Ha||l||L.cellLabelChanged(Ha,R))}if(null!=ea&&null!=ha){var V=ha[y.getAttribute(ea)];null!=V&&(y.style=V)}L.setAttributeForCell(y,"placeholders","1");y.style=L.replacePlaceholders(y,y.style,J);null==Ha||l?L.fireEvent(new mxEventObject("cellsInserted","cells",[y])):(L.model.setStyle(Ha,y.style),0>-mxUtils.indexOf(D,Ha)&&D.push(Ha),L.fireEvent(new mxEventObject("cellsInserted","cells",[Ha])));l=null!=Ha;Ha=y;if(!l)for(Qa=0;Qa<La.length;Qa++)N[La[Qa].to][Ha.getAttribute(La[Qa].to)]=Ha;null!=za&&"link"!=za&&(L.setLinkForCell(Ha,Ha.getAttribute(za)),L.setAttributeForCell(Ha,za,null));var fa=this.editor.graph.getPreferredSizeForCell(Ha);ca=null!=Ca?L.model.getCell(la+Ra[Ca]):null;if(Ha.vertex){Sa=null!=ca?0:ua;pa=null!=ca?0:qa;null!=I&&null!=Ha.getAttribute(I)&&(Ha.geometry.x=Sa+parseFloat(Ha.getAttribute(I)));-null!=U&&null!=Ha.getAttribute(U)&&(Ha.geometry.y=pa+parseFloat(Ha.getAttribute(U)));var ia="@"==Q.charAt(0)?Ha.getAttribute(Q.substring(1)):null;Ha.geometry.width=null!=ia&&"auto"!=ia?parseFloat(Ha.getAttribute(Q.substring(1))):"auto"==Q||"auto"==ia?fa.width+Z:parseFloat(Q);var oa="@"==k.charAt(0)?Ha.getAttribute(k.substring(1)):null;Ha.geometry.height=null!=oa&&"auto"!=oa&&"width"!=k?parseFloat(oa):"auto"==k||"auto"==oa?fa.height+Z:"width"==k?Ha.geometry.width:parseFloat(k);va+=Ha.geometry.height+-T}l?(null==G[Ma]&&(G[Ma]=[]),G[Ma].push(Ha)):(t.push(Ha),null!=ca?(ca.style=L.replacePlaceholders(ca,ba,J),L.addCell(Ha,ca),q.push(ca)):D.push(L.addCell(Ha)))}for(wa=0;wa<q.length;wa++)ia="@"==Q.charAt(0)?q[wa].getAttribute(Q.substring(1)):null,oa="@"==k.charAt(0)?q[wa].getAttribute(k.substring(1)):null,"auto"!=Q&&"auto"!=ia||"auto"!=k&&"auto"!=oa||L.updateGroupBounds([q[wa]],Z,!0);var ta=D.slice(),ra=D.slice();for(Qa=0;Qa<La.length;Qa++){var xa=La[Qa];for(wa=0;wa<t.length;wa++){Ha=t[wa];var Da=mxUtils.bind(this,-function(kb,pb,fb){var ob=pb.getAttribute(fb.from);if(null!=ob&&""!=ob){ob=ob.split(",");for(var tb=0;tb<ob.length;tb++){var eb=N[fb.to][ob[tb]];if(null==eb&&null!=na){eb=new mxCell(ob[tb],new mxGeometry(ua,qa,0,0),na);eb.style=L.replacePlaceholders(pb,eb.style,J);var nb=this.editor.graph.getPreferredSizeForCell(eb);eb.geometry.width=nb.width+Z;eb.geometry.height=nb.height+Z;N[fb.to][ob[tb]]=eb;eb.vertex=!0;eb.id=ob[tb];D.push(L.addCell(eb))}if(null!=eb){nb=fb.label;null!=fb.fromlabel&&(nb=(pb.getAttribute(fb.fromlabel)||-"")+(nb||""));null!=fb.sourcelabel&&(nb=L.replacePlaceholders(pb,fb.sourcelabel,J)+(nb||""));null!=fb.tolabel&&(nb=(nb||"")+(eb.getAttribute(fb.tolabel)||""));null!=fb.targetlabel&&(nb=(nb||"")+L.replacePlaceholders(eb,fb.targetlabel,J));var mb="target"==fb.placeholders==!fb.invert?eb:kb;mb=null!=fb.style?L.replacePlaceholders(mb,fb.style,J):L.createCurrentEdgeStyle();nb=L.insertEdge(null,null,nb||"",fb.invert?eb:kb,fb.invert?kb:eb,mb);if(null!=fb.labels)for(mb=0;mb<fb.labels.length;mb++){var qb=-fb.labels[mb],ub=new mxCell(qb.label||mb,new mxGeometry(null!=qb.x?qb.x:0,null!=qb.y?qb.y:0,0,0),"resizable=0;html=1;");ub.vertex=!0;ub.connectable=!1;ub.geometry.relative=!0;null!=qb.placeholders&&(ub.value=L.replacePlaceholders("target"==qb.placeholders==!fb.invert?eb:kb,ub.value,J));if(null!=qb.dx||null!=qb.dy)ub.geometry.offset=new mxPoint(null!=qb.dx?qb.dx:0,null!=qb.dy?qb.dy:0);nb.insert(ub)}if(null!=fb.data)for(var zb in fb.data)L.setAttributeForCell(nb,zb,fb.data[zb]);ra.push(nb);mxUtils.remove(fb.invert?-kb:eb,ta)}}}});Da(Ha,Ha,xa);if(null!=G[Ha.id])for(O=0;O<G[Ha.id].length;O++)Da(Ha,G[Ha.id][O],xa)}}if(null!=Ea)for(wa=0;wa<t.length;wa++)for(Ha=t[wa],O=0;O<Ea.length;O++)L.setAttributeForCell(Ha,mxUtils.trim(Ea[O]),null);if(0<D.length){var Ia=new mxParallelEdgeLayout(L);Ia.spacing=P;Ia.checkOverlap=!0;var Xa=function(){0<Ia.spacing&&Ia.execute(L.getDefaultParent());for(var kb=0;kb<D.length;kb++){var pb=L.getCellGeometry(D[kb]);pb.x=Math.round(L.snap(pb.x));pb.y=Math.round(L.snap(pb.y));"auto"==Q&&-(pb.width=Math.round(L.snap(pb.width)));"auto"==k&&(pb.height=Math.round(L.snap(pb.height)))}};if("["==ya.charAt(0)){var Za=ka;L.view.validate();this.executeLayouts(L.createLayouts(JSON.parse(ya)),function(){Xa();Za()});ka=null}else if("circle"==ya){var $a=new mxCircleLayout(L);$a.disableEdgeStyle=!1;$a.resetEdges=!1;var Pa=$a.isVertexIgnored;$a.isVertexIgnored=function(kb){return Pa.apply(this,arguments)||0>mxUtils.indexOf(D,kb)};this.executeLayout(function(){$a.execute(L.getDefaultParent());Xa()},-!0,ka);ka=null}else if("horizontaltree"==ya||"verticaltree"==ya||"auto"==ya&&ra.length==2*D.length-1&&1==ta.length){L.view.validate();var Na=new mxCompactTreeLayout(L,"horizontaltree"==ya);Na.levelDistance=T;Na.edgeRouting=!1;Na.resetEdges=!1;Na.sortEdges=!0;this.executeLayout(function(){Na.execute(L.getDefaultParent(),0<ta.length?ta[0]:null)},!0,ka);ka=null}else if("horizontalflow"==ya||"verticalflow"==ya||"auto"==ya&&1==ta.length){L.view.validate();var jb=new mxHierarchicalLayout(L,"horizontalflow"==-ya?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);jb.intraCellSpacing=T;jb.parallelEdgeSpacing=P;jb.interRankCellSpacing=X;jb.disableEdgeStyle=!1;this.executeLayout(function(){jb.execute(L.getDefaultParent(),ra);L.moveCells(ra,ua,qa)},!0,ka);ka=null}else if("orgchart"==ya){L.view.validate();var cb=new mxOrgChartLayout(L,2,X,T),ab=cb.isVertexIgnored;cb.isVertexIgnored=function(kb){return ab.apply(this,arguments)||0>mxUtils.indexOf(D,kb)};this.executeLayout(function(){cb.execute(L.getDefaultParent());-Xa()},!0,ka);ka=null}else if("organic"==ya||"auto"==ya&&ra.length>D.length){L.view.validate();var db=new mxFastOrganicLayout(L);db.forceConstant=3*T;db.disableEdgeStyle=!1;db.resetEdges=!1;var lb=db.isVertexIgnored;db.isVertexIgnored=function(kb){return lb.apply(this,arguments)||0>mxUtils.indexOf(D,kb)};this.executeLayout(function(){db.execute(L.getDefaultParent());Xa()},!0,ka);ka=null}}this.hideDialog()}finally{L.model.endUpdate()}null!=ka&&ka()}}catch(kb){this.handleError(kb)}};EditorUi.prototype.getSearch=-function(c){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var l="?",t;for(t in urlParams)0>mxUtils.indexOf(c,t)&&null!=urlParams[t]&&(f+=l+t+"="+urlParams[t],l="&")}else f=window.location.search;return f};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var f=0<c.indexOf("?")?1:0;if("1"==urlParams.offline)c+=window.location.search;else{var l="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),+wa.width+2*ua&&(Ca.container.scrollLeft=wa.x+(wa.width+ua-Ca.container.clientWidth)/2)}),10)})}null!=J.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=J.noExitBtn);null!=J.title&&null!=this.buttonContainer&&this.setEmbedTitle(J.title);try{J.libs&&this.sidebar.showEntries(J.libs)}catch(pa){}J=null!=J.xmlpng?this.extractGraphModelFromPng(J.xmlpng):null!=J.descriptor?J.descriptor:J.xml}else{if("merge"==J.action){var La=this.getCurrentFile();null!=La&&(na=ha(J.xml),null!=na&&""!=na&&La.mergeFile(new LocalFile(this,+na),function(){H.postMessage(JSON.stringify({event:"merge",message:J}),"*")},function(pa){H.postMessage(JSON.stringify({event:"merge",message:J,error:pa}),"*")}))}else"remoteInvokeReady"==J.action?this.handleRemoteInvokeReady(H):"remoteInvoke"==J.action?this.handleRemoteInvoke(J,L.origin):"remoteInvokeResponse"==J.action?this.handleRemoteInvokeResponse(J):H.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(J)}),"*");return}}catch(pa){this.handleError(pa)}}var za=mxUtils.bind(this,+function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),Ea=mxUtils.bind(this,function(pa,Ca){l=!0;try{c(pa,Ca,null,ea)}catch(Aa){this.handleError(Aa)}l=!1;null!=urlParams.modified&&this.clearStatus();q=za();t&&null==f&&(f=mxUtils.bind(this,function(Aa,wa){Aa=za();Aa==q||l||(wa=this.createLoadMessage("autosave"),wa.xml=Aa,(window.opener||window.parent).postMessage(JSON.stringify(wa),"*"));q=Aa}),this.editor.graph.model.addListener(mxEvent.CHANGE,+f),this.editor.graph.addListener("gridSizeChanged",f),this.editor.graph.addListener("shadowVisibleChanged",f),this.addListener("pageFormatChanged",f),this.addListener("pageScaleChanged",f),this.addListener("backgroundColorChanged",f),this.addListener("backgroundImageChanged",f),this.addListener("foldingEnabledChanged",f),this.addListener("mathEnabledChanged",f),this.addListener("gridEnabledChanged",f),this.addListener("guidesEnabledChanged",f),this.addListener("pageViewChanged",f));if("1"==urlParams.returnbounds||+"json"==urlParams.proto)Ca=this.createLoadMessage("load"),Ca.xml=pa,H.postMessage(JSON.stringify(Ca),"*");null!=Y&&Y()});null!=J&&"function"===typeof J.substring&&"data:application/vnd.visio;base64,"==J.substring(0,34)?(ha="0M8R4KGxGuE"==J.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(J.substring(J.indexOf(",")+1)),function(pa){Ea(pa,L)},mxUtils.bind(this,function(pa){this.handleError(pa)}),ha)):null!=J&&"function"===typeof J.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(J,+"")?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(J,mxUtils.bind(this,function(pa){4==pa.readyState&&(200<=pa.status&&299>=pa.status&&"<mxGraphModel"==pa.responseText.substring(0,13)?Ea(pa.responseText,L):this.handleError({message:413==pa.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")}))}),""):null!=J&&"function"===typeof J.substring&&this.isLucidChartData(J)?this.convertLucidChart(J,mxUtils.bind(this,function(pa){Ea(pa)}),+mxUtils.bind(this,function(pa){this.handleError(pa)})):null==J||"object"!==typeof J||null==J.format||null==J.data&&null==J.url?(J=ha(J),Ea(J,L)):this.loadDescriptor(J,mxUtils.bind(this,function(pa){Ea(za(),L)}),mxUtils.bind(this,function(pa){this.handleError(pa,mxResources.get("errorLoadingFile"))}))}}));var H=window.opener||window.parent;D="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";H.postMessage(D,"*");if("json"==urlParams.proto){var N=this.editor.graph.openLink;+this.editor.graph.openLink=function(L,J,Y){N.apply(this,arguments);H.postMessage(JSON.stringify({event:"openLink",href:L,target:J,allowOpener:Y}),"*")}}};EditorUi.prototype.createEmbedButton=function(c,f,l,t){var q=document.createElement("button");q.className="geEmbedBtn geBtn";q.setAttribute("title",c+(null!=l?" ("+l+")":""));mxUtils.write(q,c);t&&q.classList.add("gePrimaryBtn");mxEvent.addListener(q,"click",f);return q};EditorUi.prototype.setEmbedTitle=function(c){c=this.createStatusDiv(c);null!=+this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan);"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?this.menubarContainer.appendChild(c):this.buttonContainer.appendChild(c);this.embedFilenameSpan=c};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,function(){var c=null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode==this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);+this.commentsSupported()&&null!=this.commentButton&&this.buttonContainer.appendChild(this.commentButton);"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),+"1"==urlParams.saveAndExit?Editor.ctrlKey+"+Shift+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct))}))};EditorUi.prototype.showImportCsvDialog=function(){null==+this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(c){this.importCsv(c)}),null,null,620,430,null,!0,!0,mxResources.get("import"),this.isOffline()?null:"https://drawio-app.com/import-from-csv-to-drawio/"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};EditorUi.prototype.showCustomLayoutDialog=function(c){this.loadOrgChartLayouts(mxUtils.bind(this,+function(){var f=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(l){if(0<l.length)try{var t=JSON.parse(l);this.executeLayouts(this.editor.graph.createLayouts(t));this.customLayoutConfig=t;this.hideDialog()}catch(q){this.handleError(q)}}),null,null,null,null,mxUtils.bind(this,function(l,t){var q=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var D=t.value;t.value=JSON.stringify(JSON.parse(D));t.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?+t.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));t.value=D}catch(H){this.handleError(H)}}));q.setAttribute("title","copy");q.className="geBtn";l.appendChild(q)}),!0,null,null,"https://www.drawio.com/doc/faq/apply-layouts");this.showDialog(f.container,620,460,!0,!0);f.init()}))};EditorUi.prototype.loadOrgChartLayouts=function(c){this.createTimeout(null,mxUtils.bind(this,function(f){var l=mxUtils.bind(this,function(){this.loadingOrgChart=+!1;f.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),t=mxUtils.bind(this,function(q){this.loadingOrgChart=!1;f.clear()&&this.handleError(q)});"undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0)?l():this.spinner.spin(document.body,mxResources.get("loading"))&&(this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",+function(){mxscript("js/orgchart/mxOrgChartLayout.js",l,null,null,null,t)},null,null,null,t)},null,null,null,t)},null,null,null,t):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",l,null,null,null,t))}),onerror)};EditorUi.prototype.importCsv=function(c,f){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,f)}))};EditorUi.prototype.doImportCsv=function(c,f){try{var l=c.split("\n"),t=[],q=[],D=[],H={};if(0<l.length){var N={},L=this.editor.graph,J=null,Y=null,ha=null,ea=null,+aa=null,na=null,W=null,ba="whiteSpace=wrap;html=1;",ja=null,ca=null,la="",Q="auto",k="auto",B=!1,I=null,U=null,P=40,T=40,X=100,Z=0,ka=mxUtils.bind(this,function(){null!=f?f(ra):(L.setSelectionCells(ra),L.scrollCellToVisible(L.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),va=L.getFreeInsertPoint(),ua=va.x,qa=va.y;va=qa;var Ba=null,ya="auto";ca=null;for(var La=[],za=null,Ea=null,pa=0;pa<l.length&&"#"==l[pa].charAt(0);){c=+l[pa].replace(/\r$/,"");for(pa++;pa<l.length&&"\\"==c.charAt(c.length-1)&&"#"==l[pa].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(l[pa].substring(1)),pa++;if("#"!=c.charAt(1)){var Ca=c.indexOf(":");if(0<Ca){var Aa=mxUtils.trim(c.substring(1,Ca)),wa=mxUtils.trim(c.substring(Ca+1));"label"==Aa?Ba=Graph.sanitizeHtml(wa):"labelname"==Aa&&0<wa.length&&"-"!=wa?aa=wa:"labels"==Aa&&0<wa.length&&"-"!=wa?W=JSON.parse(wa):"style"==Aa?Y=wa:"parentstyle"==Aa?ba=wa:"unknownStyle"==Aa&&"-"!=wa?na=wa:"stylename"==+Aa&&0<wa.length&&"-"!=wa?ea=wa:"styles"==Aa&&0<wa.length&&"-"!=wa?ha=JSON.parse(wa):"vars"==Aa&&0<wa.length&&"-"!=wa?J=JSON.parse(wa):"identity"==Aa&&0<wa.length&&"-"!=wa?ja=wa:"parent"==Aa&&0<wa.length&&"-"!=wa?ca=wa:"namespace"==Aa&&0<wa.length&&"-"!=wa?la=wa:"width"==Aa?Q=wa:"height"==Aa?k=wa:"collapsed"==Aa&&"-"!=wa?B="true"==wa:"left"==Aa&&0<wa.length?I=wa:"top"==Aa&&0<wa.length?U=wa:"ignore"==Aa?Ea=wa.split(","):"connect"==Aa?La.push(JSON.parse(wa)):"link"==Aa?za=wa:"padding"==Aa?Z=parseFloat(wa):+"edgespacing"==Aa?P=parseFloat(wa):"nodespacing"==Aa?T=parseFloat(wa):"levelspacing"==Aa?X=parseFloat(wa):"layout"==Aa&&(ya=wa)}}}if(null==l[pa])throw Error(mxResources.get("invalidOrMissingFile"));var Ya=this.editor.csvToArray(l[pa].replace(/\r$/,""));Ca=c=null;Aa=[];for(wa=0;wa<Ya.length;wa++)ja==Ya[wa]&&(c=wa),ca==Ya[wa]&&(Ca=wa),Aa.push(mxUtils.trim(Ya[wa]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==Ba&&(Ba="%"+Aa[0]+"%");if(null!=La)for(var Qa=0;Qa<La.length;Qa++)null==+N[La[Qa].to]&&(N[La[Qa].to]={});ja=[];for(wa=pa+1;wa<l.length;wa++){var Ra=this.editor.csvToArray(l[wa].replace(/\r$/,""));if(null==Ra){var Sa=40<l[wa].length?l[wa].substring(0,40)+"...":l[wa];throw Error(Sa+" ("+wa+"):\n"+mxResources.get("containsValidationErrors"));}0<Ra.length&&ja.push(Ra)}L.model.beginUpdate();try{for(wa=0;wa<ja.length;wa++){Ra=ja[wa];var Ha=null,Ma=null!=c?la+Ra[c]:null;l=!1;null!=Ma&&(Ha=L.model.getCell(Ma),l=null==Ha||0<=mxUtils.indexOf(t,Ha));var y=new mxCell(Ba,new mxGeometry(ua,+va,0,0),Y||"whiteSpace=wrap;html=1;");y.collapsed=B;y.vertex=!0;y.id=Ma;null==Ha||l||L.model.setCollapsed(Ha,B);for(var O=0;O<Ra.length;O++)L.setAttributeForCell(y,Aa[O],Ra[O]),null==Ha||l||L.setAttributeForCell(Ha,Aa[O],Ra[O]);if(null!=aa&&null!=W){var R=W[y.getAttribute(aa)];null!=R&&(L.labelChanged(y,R),null==Ha||l||L.cellLabelChanged(Ha,R))}if(null!=ea&&null!=ha){var V=ha[y.getAttribute(ea)];null!=V&&(y.style=V)}L.setAttributeForCell(y,"placeholders","1");y.style=L.replacePlaceholders(y,y.style,+J);null==Ha||l?L.fireEvent(new mxEventObject("cellsInserted","cells",[y])):(L.model.setStyle(Ha,y.style),0>mxUtils.indexOf(D,Ha)&&D.push(Ha),L.fireEvent(new mxEventObject("cellsInserted","cells",[Ha])));l=null!=Ha;Ha=y;if(!l)for(Qa=0;Qa<La.length;Qa++)N[La[Qa].to][Ha.getAttribute(La[Qa].to)]=Ha;null!=za&&"link"!=za&&(L.setLinkForCell(Ha,Ha.getAttribute(za)),L.setAttributeForCell(Ha,za,null));var fa=this.editor.graph.getPreferredSizeForCell(Ha);ca=null!=Ca?L.model.getCell(la+Ra[Ca]):null;if(Ha.vertex){Sa=+null!=ca?0:ua;pa=null!=ca?0:qa;null!=I&&null!=Ha.getAttribute(I)&&(Ha.geometry.x=Sa+parseFloat(Ha.getAttribute(I)));null!=U&&null!=Ha.getAttribute(U)&&(Ha.geometry.y=pa+parseFloat(Ha.getAttribute(U)));var ia="@"==Q.charAt(0)?Ha.getAttribute(Q.substring(1)):null;Ha.geometry.width=null!=ia&&"auto"!=ia?parseFloat(Ha.getAttribute(Q.substring(1))):"auto"==Q||"auto"==ia?fa.width+Z:parseFloat(Q);var oa="@"==k.charAt(0)?Ha.getAttribute(k.substring(1)):null;Ha.geometry.height=null!=oa&&"auto"!=oa&&"width"!=+k?parseFloat(oa):"auto"==k||"auto"==oa?fa.height+Z:"width"==k?Ha.geometry.width:parseFloat(k);va+=Ha.geometry.height+T}l?(null==H[Ma]&&(H[Ma]=[]),H[Ma].push(Ha)):(t.push(Ha),null!=ca?(ca.style=L.replacePlaceholders(ca,ba,J),L.addCell(Ha,ca),q.push(ca)):D.push(L.addCell(Ha)))}for(wa=0;wa<q.length;wa++)ia="@"==Q.charAt(0)?q[wa].getAttribute(Q.substring(1)):null,oa="@"==k.charAt(0)?q[wa].getAttribute(k.substring(1)):null,"auto"!=Q&&"auto"!=ia||"auto"!=k&&"auto"!=oa||L.updateGroupBounds([q[wa]],Z,!0);+var ta=D.slice(),ra=D.slice();for(Qa=0;Qa<La.length;Qa++){var xa=La[Qa];for(wa=0;wa<t.length;wa++){Ha=t[wa];var Da=mxUtils.bind(this,function(kb,pb,fb){var ob=pb.getAttribute(fb.from);if(null!=ob&&""!=ob){ob=ob.split(",");for(var tb=0;tb<ob.length;tb++){var eb=N[fb.to][ob[tb]];if(null==eb&&null!=na){eb=new mxCell(ob[tb],new mxGeometry(ua,qa,0,0),na);eb.style=L.replacePlaceholders(pb,eb.style,J);var nb=this.editor.graph.getPreferredSizeForCell(eb);eb.geometry.width=nb.width+Z;eb.geometry.height=nb.height++Z;N[fb.to][ob[tb]]=eb;eb.vertex=!0;eb.id=ob[tb];D.push(L.addCell(eb))}if(null!=eb){nb=fb.label;null!=fb.fromlabel&&(nb=(pb.getAttribute(fb.fromlabel)||"")+(nb||""));null!=fb.sourcelabel&&(nb=L.replacePlaceholders(pb,fb.sourcelabel,J)+(nb||""));null!=fb.tolabel&&(nb=(nb||"")+(eb.getAttribute(fb.tolabel)||""));null!=fb.targetlabel&&(nb=(nb||"")+L.replacePlaceholders(eb,fb.targetlabel,J));var mb="target"==fb.placeholders==!fb.invert?eb:kb;mb=null!=fb.style?L.replacePlaceholders(mb,fb.style,J):L.createCurrentEdgeStyle();+nb=L.insertEdge(null,null,nb||"",fb.invert?eb:kb,fb.invert?kb:eb,mb);if(null!=fb.labels)for(mb=0;mb<fb.labels.length;mb++){var qb=fb.labels[mb],ub=new mxCell(qb.label||mb,new mxGeometry(null!=qb.x?qb.x:0,null!=qb.y?qb.y:0,0,0),"resizable=0;html=1;");ub.vertex=!0;ub.connectable=!1;ub.geometry.relative=!0;null!=qb.placeholders&&(ub.value=L.replacePlaceholders("target"==qb.placeholders==!fb.invert?eb:kb,ub.value,J));if(null!=qb.dx||null!=qb.dy)ub.geometry.offset=new mxPoint(null!=qb.dx?qb.dx:0,null!=+qb.dy?qb.dy:0);nb.insert(ub)}if(null!=fb.data)for(var zb in fb.data)L.setAttributeForCell(nb,zb,fb.data[zb]);ra.push(nb);mxUtils.remove(fb.invert?kb:eb,ta)}}}});Da(Ha,Ha,xa);if(null!=H[Ha.id])for(O=0;O<H[Ha.id].length;O++)Da(Ha,H[Ha.id][O],xa)}}if(null!=Ea)for(wa=0;wa<t.length;wa++)for(Ha=t[wa],O=0;O<Ea.length;O++)L.setAttributeForCell(Ha,mxUtils.trim(Ea[O]),null);if(0<D.length){var Ia=new mxParallelEdgeLayout(L);Ia.spacing=P;Ia.checkOverlap=!0;var Xa=function(){0<Ia.spacing&&Ia.execute(L.getDefaultParent());+for(var kb=0;kb<D.length;kb++){var pb=L.getCellGeometry(D[kb]);pb.x=Math.round(L.snap(pb.x));pb.y=Math.round(L.snap(pb.y));"auto"==Q&&(pb.width=Math.round(L.snap(pb.width)));"auto"==k&&(pb.height=Math.round(L.snap(pb.height)))}};if("["==ya.charAt(0)){var Za=ka;L.view.validate();this.executeLayouts(L.createLayouts(JSON.parse(ya)),function(){Xa();Za()});ka=null}else if("circle"==ya){var $a=new mxCircleLayout(L);$a.disableEdgeStyle=!1;$a.resetEdges=!1;var Pa=$a.isVertexIgnored;$a.isVertexIgnored=function(kb){return Pa.apply(this,+arguments)||0>mxUtils.indexOf(D,kb)};this.executeLayout(function(){$a.execute(L.getDefaultParent());Xa()},!0,ka);ka=null}else if("horizontaltree"==ya||"verticaltree"==ya||"auto"==ya&&ra.length==2*D.length-1&&1==ta.length){L.view.validate();var Na=new mxCompactTreeLayout(L,"horizontaltree"==ya);Na.levelDistance=T;Na.edgeRouting=!1;Na.resetEdges=!1;Na.sortEdges=!0;this.executeLayout(function(){Na.execute(L.getDefaultParent(),0<ta.length?ta[0]:null)},!0,ka);ka=null}else if("horizontalflow"==ya||"verticalflow"==+ya||"auto"==ya&&1==ta.length){L.view.validate();var jb=new mxHierarchicalLayout(L,"horizontalflow"==ya?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);jb.intraCellSpacing=T;jb.parallelEdgeSpacing=P;jb.interRankCellSpacing=X;jb.disableEdgeStyle=!1;this.executeLayout(function(){jb.execute(L.getDefaultParent(),ra);L.moveCells(ra,ua,qa)},!0,ka);ka=null}else if("orgchart"==ya){L.view.validate();var cb=new mxOrgChartLayout(L,2,X,T),ab=cb.isVertexIgnored;cb.isVertexIgnored=function(kb){return ab.apply(this,+arguments)||0>mxUtils.indexOf(D,kb)};this.executeLayout(function(){cb.execute(L.getDefaultParent());Xa()},!0,ka);ka=null}else if("organic"==ya||"auto"==ya&&ra.length>D.length){L.view.validate();var db=new mxFastOrganicLayout(L);db.forceConstant=3*T;db.disableEdgeStyle=!1;db.resetEdges=!1;var lb=db.isVertexIgnored;db.isVertexIgnored=function(kb){return lb.apply(this,arguments)||0>mxUtils.indexOf(D,kb)};this.executeLayout(function(){db.execute(L.getDefaultParent());Xa()},!0,ka);ka=null}}this.hideDialog()}finally{L.model.endUpdate()}null!=+ka&&ka()}}catch(kb){this.handleError(kb)}};EditorUi.prototype.getSearch=function(c){var f="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var l="?",t;for(t in urlParams)0>mxUtils.indexOf(c,t)&&null!=urlParams[t]&&(f+=l+t+"="+urlParams[t],l="&")}else f=window.location.search;return f};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var f=0<c.indexOf("?")?1:0;if("1"==urlParams.offline)c+=window.location.search;else{var l="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),t;for(t in urlParams)0>mxUtils.indexOf(l,t)&&(c=0==f?c+"?":c+"&",null!=urlParams[t]&&(c+=t+"="+urlParams[t],f++))}return c};EditorUi.prototype.showLinkDialog=function(c,f,l,t,q){c=new LinkDialog(this,c,f,l,!0,t,q);this.showDialog(c.container,440,120,!0,!0);c.init()};EditorUi.prototype.getServiceCount=function(c){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++;c&&isLocalStorage&&"1"==urlParams.browser&&f++;return f};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var c=this.getCurrentFile(),f=null!=c||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(f);this.menus.get("viewZoom").setEnabled(f);var l=("1"!=urlParams.embed||"1"==urlParams.embedRT||!this.editor.graph.isEnabled())&&(null==c||c.isRestricted());this.actions.get("makeCopy").setEnabled(!l);this.actions.get("print").setEnabled(!l);this.menus.get("exportAs").setEnabled(!l);this.menus.get("embed").setEnabled(!l);l="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(l);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(l),this.menus.get("newLibrary").setEnabled(l));c="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=c&&c.isEditable();this.actions.get("image").setEnabled(f);this.actions.get("zoomIn").setEnabled(f);this.actions.get("zoomOut").setEnabled(f);@@ -3959,59 +3961,59 @@ this.actions.get("editConnectionPoints").setEnabled(t&&0==l.edges.length&&1==l.vthis.copiedStyle&&t&&0<l.cells.length);this.actions.get("editGeometry").setEnabled(0<l.vertices.length);this.actions.get("createShape").setEnabled(t);this.actions.get("createRevision").setEnabled(t);this.actions.get("moveToFolder").setEnabled(null!=f);this.actions.get("makeCopy").setEnabled(null!=f&&!f.isRestricted());this.actions.get("editDiagram").setEnabled(t&&(null==f||!f.isRestricted()));this.actions.get("publishLink").setEnabled(null!=f&&!f.isRestricted());this.actions.get("removeFormat").setEnabled(c.isEnabled()&&!c.isSelectionEmpty()&&!c.isEditing());this.actions.get("tags").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("layers").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("outline").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("rename").setEnabled(null!=f&&f.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=f);this.actions.get("properties").setEnabled(null!=f);this.menus.get("publish").setEnabled(null!=f&&!f.isRestricted());f=this.actions.get("findReplace");f.setEnabled("none"!=this.diagramContainer.style.display);f.label=mxResources.get("find")+(c.isEnabled()?"/"+mxResources.get("replace"):"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(t&&null!=c&&null!=c.shape&&null!=c.shape.stencil)};var K=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=-null);K.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,f,l,t,q,D,G,N){var L=c.editor.graph;if("xml"==l)c.hideDialog(),c.saveData(f,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");else if("svg"==l)c.hideDialog(),c.saveData(f,"svg",mxUtils.getXml(L.getSvg(t,q,D)),"image/svg+xml");else{var J=c.getFileData(!0,null,null,null,null,!0),Y=L.getGraphBounds(),ha=Math.floor(Y.width*q/L.view.scale),ea=-Math.floor(Y.height*q/L.view.scale);if(J.length<=MAX_REQUEST_SIZE&&ha*ea<MAX_AREA)if(c.hideDialog(),"png"!=l&&"jpg"!=l&&"jpeg"!=l||!c.isExportToCanvas()){var aa={globalVars:L.getExportVariables()};N&&(aa.grid={size:L.gridSize,steps:L.view.gridSteps,color:L.view.gridColor});c.saveRequest(f,l,function(na,W){return new mxXmlRequest(EXPORT_URL,"format="+l+"&base64="+(W||"0")+(null!=na?"&filename="+encodeURIComponent(na):"")+"&extras="+encodeURIComponent(JSON.stringify(aa))+(0<G?"&dpi="+G:"")+"&bg="+(null!=-t?t:"none")+"&w="+ha+"&h="+ea+"&border="+D+"&xml="+encodeURIComponent(J))})}else"png"==l?c.exportImage(q,null==t||"none"==t,!0,!1,!1,D,!0,!1,null,N,G):c.exportImage(q,!1,!0,!1,!1,D,!0,!1,"jpeg",N);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,f="";if(null!=this.pages)for(var l=0;l<this.pages.length;l++){var t=c;this.currentPage!=this.pages[l]&&(t=this.createTemporaryGraph(c.getStylesheet()),+null);K.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,f,l,t,q,D,H,N){var L=c.editor.graph;if("xml"==l)c.hideDialog(),c.saveData(f,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");else if("svg"==l)c.hideDialog(),c.saveData(f,"svg",mxUtils.getXml(L.getSvg(t,q,D)),"image/svg+xml");else{var J=c.getFileData(!0,null,null,null,null,!0),Y=L.getGraphBounds(),ha=Math.floor(Y.width*q/L.view.scale),ea=+Math.floor(Y.height*q/L.view.scale);if(J.length<=MAX_REQUEST_SIZE&&ha*ea<MAX_AREA)if(c.hideDialog(),"png"!=l&&"jpg"!=l&&"jpeg"!=l||!c.isExportToCanvas()){var aa={globalVars:L.getExportVariables()};N&&(aa.grid={size:L.gridSize,steps:L.view.gridSteps,color:L.view.gridColor});c.saveRequest(f,l,function(na,W){return new mxXmlRequest(EXPORT_URL,"format="+l+"&base64="+(W||"0")+(null!=na?"&filename="+encodeURIComponent(na):"")+"&extras="+encodeURIComponent(JSON.stringify(aa))+(0<H?"&dpi="+H:"")+"&bg="+(null!=+t?t:"none")+"&w="+ha+"&h="+ea+"&border="+D+"&xml="+encodeURIComponent(J))})}else"png"==l?c.exportImage(q,null==t||"none"==t,!0,!1,!1,D,!0,!1,null,N,H):c.exportImage(q,!1,!0,!1,!1,D,!0,!1,"jpeg",N);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,f="";if(null!=this.pages)for(var l=0;l<this.pages.length;l++){var t=c;this.currentPage!=this.pages[l]&&(t=this.createTemporaryGraph(c.getStylesheet()),this.updatePageRoot(this.pages[l]),t.model.setRoot(this.pages[l].root));f+=this.pages[l].getName()+" "+t.getIndexableText()+" "}else f=c.getIndexableText();this.editor.graph.setEnabled(!0);return f};EditorUi.prototype.showRemotelyStoredLibrary=function(c){var f={},l=document.createElement("div");l.style.whiteSpace="nowrap";var t=document.createElement("h3");mxUtils.write(t,mxUtils.htmlEntities(c));t.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";l.appendChild(t);var q=-document.createElement("div");q.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";q.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var D={};try{var G=mxSettings.getCustomLibraries();for(c=0;c<G.length;c++){var N=G[c];if("R"==N.substring(0,1)){var L=JSON.parse(decodeURIComponent(N.substring(1)));D[L[0]]={id:L[0],title:L[1],downloadUrl:L[2]}}}}catch(J){}this.remoteInvoke("getCustomLibraries",null,null,function(J){q.innerText="";+document.createElement("div");q.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";q.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+IMAGE_PATH+'/spin.gif"></div>';var D={};try{var H=mxSettings.getCustomLibraries();for(c=0;c<H.length;c++){var N=H[c];if("R"==N.substring(0,1)){var L=JSON.parse(decodeURIComponent(N.substring(1)));D[L[0]]={id:L[0],title:L[1],downloadUrl:L[2]}}}}catch(J){}this.remoteInvoke("getCustomLibraries",null,null,function(J){q.innerText="";if(0==J.length)q.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var Y=0;Y<J.length;Y++){var ha=J[Y];D[ha.id]&&(f[ha.id]=ha);var ea=this.addCheckbox(q,ha.title,D[ha.id]);(function(aa,na){mxEvent.addListener(na,"change",function(){this.checked?f[aa.id]=aa:delete f[aa.id]})})(ha,ea)}},mxUtils.bind(this,function(J){q.innerText="";var Y=document.createElement("div");Y.style.padding="8px";Y.style.textAlign="center";mxUtils.write(Y,mxResources.get("error")+": ");mxUtils.write(Y,null!=J&&null!=J.message?J.message:mxResources.get("unknownError"));q.appendChild(Y)}));l.appendChild(q);l=new CustomDialog(this,l,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var J=0,Y;for(Y in f)null==D[Y]&&(J++,mxUtils.bind(this,function(ha){this.remoteInvoke("getFileContent",[ha.downloadUrl],null,mxUtils.bind(this,function(ea){J--;0==J&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,ea,ha)),this.showSidebar()}catch(aa){this.handleError(aa,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){J--;0==J&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(f[Y]));for(Y in D)f[Y]||this.closeLibrary(new RemoteLibrary(this,null,D[Y]));0==J&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(l.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 f=0;f<this.remoteInvokeQueue.length;f++)c.postMessage(this.remoteInvokeQueue[f],"*");this.remoteInvokeQueue=-[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var f=c.msgMarkers,l=this.remoteInvokeCallbacks[f.callbackId];if(null==l)throw Error("No callback for "+(null!=f?f.callbackId:"null"));c.error?l.error&&l.error(c.error.errResp):l.callback&&l.callback.apply(this,c.resp);this.remoteInvokeCallbacks[f.callbackId]=null};EditorUi.prototype.remoteInvoke=function(c,f,l,t,q){var D=!0,G=window.setTimeout(mxUtils.bind(this,function(){D=!1;q({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),-this.timeout),N=mxUtils.bind(this,function(){window.clearTimeout(G);D&&t.apply(this,arguments)}),L=mxUtils.bind(this,function(){window.clearTimeout(G);D&&q.apply(this,arguments)});l=l||{};l.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:N,error:L});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:f,msgMarkers:l});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,-f){var l=mxUtils.bind(this,function(J,Y){var ha={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=Y?ha.error={errResp:Y}:null!=J&&(ha.resp=J);this.remoteWin.postMessage(JSON.stringify(ha),"*")});try{var t=c.funtionName,q=this.remoteInvokableFns[t];if(null!=q&&"function"===typeof this[t]){if(q.allowedDomains){for(var D=!1,G=0;G<q.allowedDomains.length;G++)if(f=="https://"+q.allowedDomains[G]){D=!0;break}if(!D){l(null,"Invalid Call: "+t+" is not allowed.");return}}var N=c.functionArgs;Array.isArray(N)||+[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var f=c.msgMarkers,l=this.remoteInvokeCallbacks[f.callbackId];if(null==l)throw Error("No callback for "+(null!=f?f.callbackId:"null"));c.error?l.error&&l.error(c.error.errResp):l.callback&&l.callback.apply(this,c.resp);this.remoteInvokeCallbacks[f.callbackId]=null};EditorUi.prototype.remoteInvoke=function(c,f,l,t,q){var D=!0,H=window.setTimeout(mxUtils.bind(this,function(){D=!1;q({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),+this.timeout),N=mxUtils.bind(this,function(){window.clearTimeout(H);D&&t.apply(this,arguments)}),L=mxUtils.bind(this,function(){window.clearTimeout(H);D&&q.apply(this,arguments)});l=l||{};l.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:N,error:L});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:f,msgMarkers:l});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,+f){var l=mxUtils.bind(this,function(J,Y){var ha={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=Y?ha.error={errResp:Y}:null!=J&&(ha.resp=J);this.remoteWin.postMessage(JSON.stringify(ha),"*")});try{var t=c.funtionName,q=this.remoteInvokableFns[t];if(null!=q&&"function"===typeof this[t]){if(q.allowedDomains){for(var D=!1,H=0;H<q.allowedDomains.length;H++)if(f=="https://"+q.allowedDomains[H]){D=!0;break}if(!D){l(null,"Invalid Call: "+t+" is not allowed.");return}}var N=c.functionArgs;Array.isArray(N)||(N=[]);if(q.isAsync)N.push(function(){l(Array.prototype.slice.apply(arguments))}),N.push(function(J){l(null,J||"Unkown Error")}),this[t].apply(this,N);else{var L=this[t].apply(this,N);l([L])}}else l(null,"Invalid Call: "+t+" is not found.")}catch(J){l(null,"Invalid Call: An error occurred, "+J.message)}};EditorUi.prototype.openDatabase=function(c,f){if(null==this.database){var l=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=l)try{var t=l.open("database",2);t.onupgradeneeded=-function(q){try{var D=t.result;1>q.oldVersion&&D.createObjectStore("objects",{keyPath:"key"});2>q.oldVersion&&(D.createObjectStore("files",{keyPath:"title"}),D.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(G){null!=f&&f(G)}};t.onsuccess=mxUtils.bind(this,function(q){try{var D=t.result;this.database=D;EditorUi.migrateStorageFiles&&(StorageFile.migrate(D),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||-(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(G){if(!G||"1"==urlParams.forceMigration){var N=document.createElement("iframe");N.style.display="none";N.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(N);var L=!0,J=!1,Y,ha=0,ea=mxUtils.bind(this,function(){J=!0;this.setDatabaseItem(".drawioMigrated3",!0);N.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",+function(q){try{var D=t.result;1>q.oldVersion&&D.createObjectStore("objects",{keyPath:"key"});2>q.oldVersion&&(D.createObjectStore("files",{keyPath:"title"}),D.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(H){null!=f&&f(H)}};t.onsuccess=mxUtils.bind(this,function(q){try{var D=t.result;this.database=D;EditorUi.migrateStorageFiles&&(StorageFile.migrate(D),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 N=document.createElement("iframe");N.style.display="none";N.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(N);var L=!0,J=!1,Y,ha=0,ea=mxUtils.bind(this,function(){J=!0;this.setDatabaseItem(".drawioMigrated3",!0);N.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),aa=mxUtils.bind(this,function(){ha++;na()}),na=mxUtils.bind(this,function(){try{if(ha>=Y.length)ea();else{var ba=Y[ha];StorageFile.getFileContent(this,ba,mxUtils.bind(this,function(ja){null==ja||".scratchpad"==ba&&ja==this.emptyLibraryXml?N.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[ba]}),"*"):aa()}),aa)}}catch(ja){console.log(ja)}}),W=mxUtils.bind(this,function(ba){try{this.setDatabaseItem(null,-[{title:ba.title,size:ba.data.length,lastModified:Date.now(),type:ba.isLib?"L":"F"},{title:ba.title,data:ba.data}],aa,aa,["filesInfo","files"])}catch(ja){console.log(ja)}});G=mxUtils.bind(this,function(ba){try{if(ba.source==N.contentWindow){var ja={};try{ja=JSON.parse(ba.data)}catch(ca){}"init"==ja.event?(N.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),N.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=-ja.event||J||(L?null!=ja.resp&&0<ja.resp.length&&null!=ja.resp[0]?(Y=ja.resp[0],L=!1,na()):ea():null!=ja.resp&&0<ja.resp.length&&null!=ja.resp[0]?W(ja.resp[0]):aa())}}catch(ca){console.log(ca)}});window.addEventListener("message",G)}})));c(D);D.onversionchange=function(){D.close()}}catch(G){null!=f?f(G):null!=window.console&&console.warn(G)}});t.onerror=f;t.onblocked=function(){}}catch(q){null!=f?f(q):null!=window.console&&console.error(q)}else null!=f&&f(Error("IndexedDB not supported"))}else c(this.database)};-EditorUi.prototype.setDatabaseItem=function(c,f,l,t,q){this.openDatabase(mxUtils.bind(this,function(D){try{q=q||"objects";Array.isArray(q)||(q=[q],c=[c],f=[f]);var G=D.transaction(q,"readwrite");G.oncomplete=l;G.onerror=t;for(D=0;D<q.length;D++)G.objectStore(q[D]).put(null!=c&&null!=c[D]?{key:c[D],data:f[D]}:f[D])}catch(N){null!=t&&t(N)}}),t)};EditorUi.prototype.removeDatabaseItem=function(c,f,l,t){this.openDatabase(mxUtils.bind(this,function(q){try{t=t||"objects";Array.isArray(t)||(t=[t],c=[c]);-var D=q.transaction(t,"readwrite");D.oncomplete=f;D.onerror=l;for(q=0;q<t.length;q++)D.objectStore(t[q]).delete(c[q])}catch(G){null!=l&&l(G)}}),l)};EditorUi.prototype.getDatabaseItem=function(c,f,l,t){this.openDatabase(mxUtils.bind(this,function(q){try{t=t||"objects";var D=q.transaction([t],"readonly").objectStore(t).get(c);D.onsuccess=function(){f(D.result)};D.onerror=l}catch(G){null!=l&&l(G)}}),l)};EditorUi.prototype.getDatabaseItems=function(c,f,l){this.openDatabase(mxUtils.bind(this,function(t){try{l=-l||"objects";var q=t.transaction([l],"readonly").objectStore(l).openCursor(IDBKeyRange.lowerBound(0)),D=[];q.onsuccess=function(G){null==G.target.result?c(D):(D.push(G.target.result.value),G.target.result.continue())};q.onerror=f}catch(G){null!=f&&f(G)}}),f)};EditorUi.prototype.getDatabaseItemKeys=function(c,f,l){this.openDatabase(mxUtils.bind(this,function(t){try{l=l||"objects";var q=t.transaction([l],"readonly").objectStore(l).getAllKeys();q.onsuccess=function(){c(q.result)};q.onerror=f}catch(D){null!=+[{title:ba.title,size:ba.data.length,lastModified:Date.now(),type:ba.isLib?"L":"F"},{title:ba.title,data:ba.data}],aa,aa,["filesInfo","files"])}catch(ja){console.log(ja)}});H=mxUtils.bind(this,function(ba){try{if(ba.source==N.contentWindow){var ja={};try{ja=JSON.parse(ba.data)}catch(ca){}"init"==ja.event?(N.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),N.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=+ja.event||J||(L?null!=ja.resp&&0<ja.resp.length&&null!=ja.resp[0]?(Y=ja.resp[0],L=!1,na()):ea():null!=ja.resp&&0<ja.resp.length&&null!=ja.resp[0]?W(ja.resp[0]):aa())}}catch(ca){console.log(ca)}});window.addEventListener("message",H)}})));c(D);D.onversionchange=function(){D.close()}}catch(H){null!=f?f(H):null!=window.console&&console.warn(H)}});t.onerror=f;t.onblocked=function(){}}catch(q){null!=f?f(q):null!=window.console&&console.error(q)}else null!=f&&f(Error("IndexedDB not supported"))}else c(this.database)};+EditorUi.prototype.setDatabaseItem=function(c,f,l,t,q){this.openDatabase(mxUtils.bind(this,function(D){try{q=q||"objects";Array.isArray(q)||(q=[q],c=[c],f=[f]);var H=D.transaction(q,"readwrite");H.oncomplete=l;H.onerror=t;for(D=0;D<q.length;D++)H.objectStore(q[D]).put(null!=c&&null!=c[D]?{key:c[D],data:f[D]}:f[D])}catch(N){null!=t&&t(N)}}),t)};EditorUi.prototype.removeDatabaseItem=function(c,f,l,t){this.openDatabase(mxUtils.bind(this,function(q){try{t=t||"objects";Array.isArray(t)||(t=[t],c=[c]);+var D=q.transaction(t,"readwrite");D.oncomplete=f;D.onerror=l;for(q=0;q<t.length;q++)D.objectStore(t[q]).delete(c[q])}catch(H){null!=l&&l(H)}}),l)};EditorUi.prototype.getDatabaseItem=function(c,f,l,t){this.openDatabase(mxUtils.bind(this,function(q){try{t=t||"objects";var D=q.transaction([t],"readonly").objectStore(t).get(c);D.onsuccess=function(){f(D.result)};D.onerror=l}catch(H){null!=l&&l(H)}}),l)};EditorUi.prototype.getDatabaseItems=function(c,f,l){this.openDatabase(mxUtils.bind(this,function(t){try{l=+l||"objects";var q=t.transaction([l],"readonly").objectStore(l).openCursor(IDBKeyRange.lowerBound(0)),D=[];q.onsuccess=function(H){null==H.target.result?c(D):(D.push(H.target.result.value),H.target.result.continue())};q.onerror=f}catch(H){null!=f&&f(H)}}),f)};EditorUi.prototype.getDatabaseItemKeys=function(c,f,l){this.openDatabase(mxUtils.bind(this,function(t){try{l=l||"objects";var q=t.transaction([l],"readonly").objectStore(l).getAllKeys();q.onsuccess=function(){c(q.result)};q.onerror=f}catch(D){null!=f&&f(D)}}),f)};EditorUi.prototype.commentsSupported=function(){var c=this.getCurrentFile();return null!=c?c.commentsSupported():!1};EditorUi.prototype.commentsRefreshNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsSaveNeeded():!1};EditorUi.prototype.getComments=function(c,f){var l=this.getCurrentFile();null!=l?l.getComments(c,f):c([])};EditorUi.prototype.addComment=function(c,f,l){var t=this.getCurrentFile();null!=t?t.addComment(c,f,l):f(Date.now())};EditorUi.prototype.canReplyToReplies=function(){var c=this.getCurrentFile();return null!=c?c.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var c=this.getCurrentFile();return null!=c?c.canComment():!0};EditorUi.prototype.newComment=function(c,f){var l=this.getCurrentFile();return null!=l?l.newComment(c,f):new DrawioComment(this,null,c,Date.now(),Date.now(),!1,f)};EditorUi.prototype.isRevisionHistorySupported=function(){var c=this.getCurrentFile();return null!=c&&c.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(c,f){var l=this.getCurrentFile();null!=l&&l.getRevisions?l.getRevisions(c,f):f({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var c=this.getCurrentFile();return null!=c&&(c.constructor==DriveFile&&c.isEditable()||c.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.vsdxExportEnabled=-function(){return"atlassian"==this.getServiceName()};EditorUi.prototype.addRemoteServiceSecurityCheck=function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,f,l,t,q,D,G,N){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,f,l,t,q,D,G,N)};EditorUi.prototype.loadFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(c)};EditorUi.prototype.createSvgDataUri=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");-return Editor.createSvgDataUri(c)};EditorUi.prototype.embedCssFonts=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,f)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,f,l,t,q,D,G,N,L,J,Y,ha,ea,aa,na,W){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,f,l,t,q,D,-G,N,L,J,Y,ha,ea,aa,na,W)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,f,l,t){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,f,l,t)};EditorUi.prototype.convertImageToDataUri=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,+function(){return"atlassian"==this.getServiceName()};EditorUi.prototype.addRemoteServiceSecurityCheck=function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,f,l,t,q,D,H,N){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,f,l,t,q,D,H,N)};EditorUi.prototype.loadFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(c)};EditorUi.prototype.createSvgDataUri=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");+return Editor.createSvgDataUri(c)};EditorUi.prototype.embedCssFonts=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(c,f)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,f,l,t,q,D,H,N,L,J,Y,ha,ea,aa,na,W){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,f,l,t,q,D,+H,N,L,J,Y,ha,ea,aa,na,W)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,f,l,t){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,f,l,t)};EditorUi.prototype.convertImageToDataUri=function(c,f){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,f)};EditorUi.prototype.base64Encode=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(c)};EditorUi.prototype.updateCRC=function(c,f,l,t){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,f,l,t)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(c)};EditorUi.prototype.writeGraphModelToPng=function(c,f,l,t,q){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(c,f,l,t,q)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;for(var c=[],f=0;f<localStorage.length;f++){var l=localStorage.key(f),t=localStorage.getItem(l);if(0<l.length&&(".scratchpad"==l||"."!=l.charAt(0))&&0<t.length){var q="<mxfile "===t.substring(0,8)||"<?xml"===t.substring(0,5)||"\x3c!--[if IE]>"===t.substring(0,12);t="<mxlibrary>"===t.substring(0,11);(q||t)&&c.push(l)}}return c};EditorUi.prototype.getLocalStorageFile=function(c){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;var f=localStorage.getItem(c);return{title:c,data:f,isLib:"<mxlibrary>"===f.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();-var CommentsWindow=function(b,e,g,m,v,p){function A(){for(var W=N.getElementsByTagName("div"),ba=0,ja=0;ja<W.length;ja++)"none"!=W[ja].style.display&&W[ja].parentNode==N&&ba++;L.style.display=0==ba?"block":"none"}function H(W,ba,ja,ca){function la(){ba.removeChild(B);ba.removeChild(I);k.style.display="block";Q.style.display="block"}q={div:ba,comment:W,saveCallback:ja,deleteOnCancel:ca};var Q=ba.querySelector(".geCommentTxt"),k=ba.querySelector(".geCommentActionsList"),B=document.createElement("textarea");+var CommentsWindow=function(b,e,g,m,v,n){function A(){for(var W=N.getElementsByTagName("div"),ba=0,ja=0;ja<W.length;ja++)"none"!=W[ja].style.display&&W[ja].parentNode==N&&ba++;L.style.display=0==ba?"block":"none"}function G(W,ba,ja,ca){function la(){ba.removeChild(B);ba.removeChild(I);k.style.display="block";Q.style.display="block"}q={div:ba,comment:W,saveCallback:ja,deleteOnCancel:ca};var Q=ba.querySelector(".geCommentTxt"),k=ba.querySelector(".geCommentActionsList"),B=document.createElement("textarea");B.className="geCommentEditTxtArea";B.style.minHeight=Q.offsetHeight+"px";B.value=W.content;ba.insertBefore(B,Q);var I=document.createElement("div");I.className="geCommentEditBtns";var U=mxUtils.button(mxResources.get("cancel"),function(){ca?(ba.parentNode.removeChild(ba),A()):la();q=null});U.className="geCommentEditBtn";I.appendChild(U);var P=mxUtils.button(mxResources.get("save"),function(){Q.innerText="";W.content=B.value;mxUtils.write(Q,W.content);la();ja(W);q=null});mxEvent.addListener(B,"keydown",mxUtils.bind(this,function(T){mxEvent.isConsumed(T)||((mxEvent.isControlDown(T)||mxClient.IS_MAC&&mxEvent.isMetaDown(T))&&13==T.keyCode?(P.click(),mxEvent.consume(T)):27==T.keyCode&&(U.click(),mxEvent.consume(T)))}));P.focus();P.className="geCommentEditBtn gePrimaryBtn";I.appendChild(P);ba.insertBefore(I,Q);k.style.display="none";Q.style.display="none";B.focus()}function S(W,ba){ba.innerText="";W=new Date(W.modifiedDate);var ja=b.timeSince(W);null==ja&&(ja=mxResources.get("lessThanAMinute"));mxUtils.write(ba,mxResources.get("timeAgo",[ja],"{1} ago"));ba.setAttribute("title",W.toLocaleDateString()+" "+W.toLocaleTimeString())}function F(W){var ba=document.createElement("img");ba.className="geCommentBusyImg";ba.src=IMAGE_PATH+"/spin.gif";W.appendChild(ba);W.busyImg=ba}function K(W){W.style.border="1px solid red";W.busyImg.parentNode==W&&W.removeChild(W.busyImg)}function c(W){W.style.border="";W.busyImg.parentNode==W&&W.removeChild(W.busyImg)}function f(W,ba,ja,ca,la){function Q(Z,ka,va){var ua=document.createElement("li");ua.className="geCommentAction";var qa=document.createElement("a");qa.className="geCommentActionLnk";mxUtils.write(qa,Z);ua.appendChild(qa);mxEvent.addListener(qa,"click",function(Ba){ka(Ba,W);Ba.preventDefault();mxEvent.consume(Ba)});X.appendChild(ua);va&&(ua.style.display="none")}function k(){function Z(ua){ka.push(va);if(null!=ua.replies)for(var qa=0;qa<ua.replies.length;qa++)va=va.nextSibling,Z(ua.replies[qa])}var ka=[],va=I;Z(W);return{pdiv:va,replies:ka}}function B(Z,ka,va,ua,qa){function Ba(){F(Ea);-W.addReply(za,function(pa){za.id=pa;W.replies.push(za);c(Ea);va&&va()},function(pa){ya();K(Ea);b.handleError(pa,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},ua,qa)}function ya(){H(za,Ea,function(pa){Ba()},!0)}var La=k().pdiv,za=b.newComment(Z,b.getCurrentUser());za.pCommentId=W.id;null==W.replies&&(W.replies=[]);var Ea=f(za,W.replies,La,ca+1);ka?ya():Ba()}if(la||!W.isResolved){L.style.display="none";var I=document.createElement("div");I.className="geCommentContainer";I.setAttribute("data-commentId",+W.addReply(za,function(pa){za.id=pa;W.replies.push(za);c(Ea);va&&va()},function(pa){ya();K(Ea);b.handleError(pa,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},ua,qa)}function ya(){G(za,Ea,function(pa){Ba()},!0)}var La=k().pdiv,za=b.newComment(Z,b.getCurrentUser());za.pCommentId=W.id;null==W.replies&&(W.replies=[]);var Ea=f(za,W.replies,La,ca+1);ka?ya():Ba()}if(la||!W.isResolved){L.style.display="none";var I=document.createElement("div");I.className="geCommentContainer";I.setAttribute("data-commentId",W.id);I.style.marginLeft=20*ca+5+"px";W.isResolved&&(D.style.opacity="0.7");var U=document.createElement("div");U.className="geCommentHeader";var P=document.createElement("img");P.className="geCommentUserImg";P.src=null!=W.user&&null!=W.user.pictureUrl?W.user.pictureUrl:Editor.userImage;U.appendChild(P);P=document.createElement("div");P.className="geCommentHeaderTxt";U.appendChild(P);var T=document.createElement("div");T.className="geCommentUsername";mxUtils.write(T,null!=W.user?W.user.displayName:mxResources.get("unknownUser"));P.appendChild(T);T=document.createElement("div");T.className="geCommentDate";T.setAttribute("data-commentId",W.id);S(W,T);P.appendChild(T);I.appendChild(U);U=document.createElement("div");U.className="geCommentTxt";mxUtils.write(U,W.content||"");I.appendChild(U);W.isLocked&&(I.style.opacity="0.5");U=document.createElement("div");U.className="geCommentActions";var X=document.createElement("ul");X.className="geCommentActionsList";U.appendChild(X);l||W.isLocked||0!=ca&&-!t||Q(mxResources.get("reply"),function(){B("",!0)},W.isResolved);P=b.getCurrentUser();null==P||null==W.user||P.id!=W.user.id||l||W.isLocked||(Q(mxResources.get("edit"),function(){function Z(){H(W,I,function(){F(I);W.editComment(W.content,function(){c(I)},function(ka){K(I);Z();b.handleError(ka,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}Z()},W.isResolved),Q(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){F(I);W.deleteComment(function(Z){if(!0===+!t||Q(mxResources.get("reply"),function(){B("",!0)},W.isResolved);P=b.getCurrentUser();null==P||null==W.user||P.id!=W.user.id||l||W.isLocked||(Q(mxResources.get("edit"),function(){function Z(){G(W,I,function(){F(I);W.editComment(W.content,function(){c(I)},function(ka){K(I);Z();b.handleError(ka,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}Z()},W.isResolved),Q(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){F(I);W.deleteComment(function(Z){if(!0===Z){Z=I.querySelector(".geCommentTxt");Z.innerText="";mxUtils.write(Z,mxResources.get("msgDeleted"));var ka=I.querySelectorAll(".geCommentAction");for(Z=0;Z<ka.length;Z++)ka[Z].parentNode.removeChild(ka[Z]);c(I);I.style.opacity="0.5"}else{ka=k(W).replies;for(Z=0;Z<ka.length;Z++)N.removeChild(ka[Z]);for(Z=0;Z<ba.length;Z++)if(ba[Z]==W){ba.splice(Z,1);break}L.style.display=0==N.getElementsByTagName("div").length?"block":"none"}},function(Z){K(I);b.handleError(Z,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},W.isResolved));l||W.isLocked||0!=ca||Q(W.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(Z){function ka(){var va=Z.target;va.innerText="";W.isResolved=!W.isResolved;mxUtils.write(va,W.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var ua=W.isResolved?"none":"",qa=k(W).replies,Ba="light-dark("+(W.isResolved?"ghostWhite":"white")+", transparent)",ya=0;ya<qa.length;ya++){qa[ya].style.backgroundColor=Ba;for(var La=qa[ya].querySelectorAll(".geCommentAction"),-za=0;za<La.length;za++)La[za]!=va.parentNode&&(La[za].style.display=ua);ea||(qa[ya].style.display="none")}A()}W.isResolved?B(mxResources.get("reOpened")+": ",!0,ka,!1,!0):B(mxResources.get("markedAsResolved"),!1,ka,!0)});I.appendChild(U);null!=ja?N.insertBefore(I,ja.nextSibling):N.appendChild(I);for(ja=0;null!=W.replies&&ja<W.replies.length;ja++)U=W.replies[ja],U.isResolved=W.isResolved,f(U,W.replies,null,ca+1,la);null!=q&&(q.comment.id==W.id?(la=W.content,W.content=q.comment.content,H(W,I,q.saveCallback,-q.deleteOnCancel),W.content=la):null==q.comment.id&&q.comment.pCommentId==W.id&&(N.appendChild(q.div),H(q.comment,q.div,q.saveCallback,q.deleteOnCancel)));return I}}var l=!b.canComment(),t=b.canReplyToReplies(),q=null,D=document.createElement("div");D.className="geCommentsWin";var G=EditorUi.compactUi?"26px":"30px",N=document.createElement("div");N.className="geCommentsList";N.style.bottom=parseInt(G)+7+"px";D.appendChild(N);var L=document.createElement("span");L.style.cssText="display:none;padding-top:10px;text-align:center;";-mxUtils.write(L,mxResources.get("noCommentsFound"));var J=document.createElement("div");J.className="geToolbarContainer geCommentsToolbar";J.style.height=G;J.style.padding="3px 4px 4px 4px";G=document.createElement("a");G.className="geButton";if(!l){var Y=G.cloneNode();Y.style.backgroundImage="url("+Editor.plusImage+")";Y.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(Y,"click",function(W){function ba(){H(ja,ca,function(la){F(ca);b.addComment(la,function(Q){la.id=Q;aa.push(la);-c(ca)},function(Q){K(ca);ba();b.handleError(Q,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var ja=b.newComment("",b.getCurrentUser()),ca=f(ja,aa,null,0);ba();W.preventDefault();mxEvent.consume(W)});J.appendChild(Y)}var ha=G.cloneNode();ha.style.backgroundImage="url("+Editor.checkImage+")";ha.setAttribute("title",mxResources.get("showResolved"));var ea=!1;mxEvent.addListener(ha,"click",function(W){(ea=!ea)?ha.classList.add("geActiveItem"):ha.classList.remove("geActiveItem");-na();W.preventDefault();mxEvent.consume(W)});J.appendChild(ha);b.commentsRefreshNeeded()&&(Y=G.cloneNode(),Y.style.backgroundImage="url("+Editor.refreshImage+")",Y.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(Y,"click",function(W){na();W.preventDefault();mxEvent.consume(W)}),J.appendChild(Y));b.commentsSaveNeeded()&&(G=G.cloneNode(),G.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',G.setAttribute("title",mxResources.get("save")),G.className=-"geButton geAdaptiveAsset",mxEvent.addListener(G,"click",function(W){p();W.preventDefault();mxEvent.consume(W)}),J.appendChild(G));D.appendChild(J);var aa=[],na=mxUtils.bind(this,function(){this.hasError=!1;if(null!=q)try{q.div=q.div.cloneNode(!0);var W=q.div.querySelector(".geCommentEditTxtArea"),ba=q.div.querySelector(".geCommentEditBtns");q.comment.content=W.value;W.parentNode.removeChild(W);ba.parentNode.removeChild(ba)}catch(ja){b.handleError(ja)}N.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'++za=0;za<La.length;za++)La[za]!=va.parentNode&&(La[za].style.display=ua);ea||(qa[ya].style.display="none")}A()}W.isResolved?B(mxResources.get("reOpened")+": ",!0,ka,!1,!0):B(mxResources.get("markedAsResolved"),!1,ka,!0)});I.appendChild(U);null!=ja?N.insertBefore(I,ja.nextSibling):N.appendChild(I);for(ja=0;null!=W.replies&&ja<W.replies.length;ja++)U=W.replies[ja],U.isResolved=W.isResolved,f(U,W.replies,null,ca+1,la);null!=q&&(q.comment.id==W.id?(la=W.content,W.content=q.comment.content,G(W,I,q.saveCallback,+q.deleteOnCancel),W.content=la):null==q.comment.id&&q.comment.pCommentId==W.id&&(N.appendChild(q.div),G(q.comment,q.div,q.saveCallback,q.deleteOnCancel)));return I}}var l=!b.canComment(),t=b.canReplyToReplies(),q=null,D=document.createElement("div");D.className="geCommentsWin";var H=EditorUi.compactUi?"26px":"30px",N=document.createElement("div");N.className="geCommentsList";N.style.bottom=parseInt(H)+7+"px";D.appendChild(N);var L=document.createElement("span");L.style.cssText="display:none;padding-top:10px;text-align:center;";+mxUtils.write(L,mxResources.get("noCommentsFound"));var J=document.createElement("div");J.className="geToolbarContainer geCommentsToolbar";J.style.height=H;J.style.padding="3px 4px 4px 4px";H=document.createElement("a");H.className="geButton";if(!l){var Y=H.cloneNode();Y.style.backgroundImage="url("+Editor.plusImage+")";Y.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(Y,"click",function(W){function ba(){G(ja,ca,function(la){F(ca);b.addComment(la,function(Q){la.id=Q;aa.push(la);+c(ca)},function(Q){K(ca);ba();b.handleError(Q,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var ja=b.newComment("",b.getCurrentUser()),ca=f(ja,aa,null,0);ba();W.preventDefault();mxEvent.consume(W)});J.appendChild(Y)}var ha=H.cloneNode();ha.style.backgroundImage="url("+Editor.checkImage+")";ha.setAttribute("title",mxResources.get("showResolved"));var ea=!1;mxEvent.addListener(ha,"click",function(W){(ea=!ea)?ha.classList.add("geActiveItem"):ha.classList.remove("geActiveItem");+na();W.preventDefault();mxEvent.consume(W)});J.appendChild(ha);b.commentsRefreshNeeded()&&(Y=H.cloneNode(),Y.style.backgroundImage="url("+Editor.refreshImage+")",Y.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(Y,"click",function(W){na();W.preventDefault();mxEvent.consume(W)}),J.appendChild(Y));b.commentsSaveNeeded()&&(H=H.cloneNode(),H.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',H.setAttribute("title",mxResources.get("save")),H.className=+"geButton geAdaptiveAsset",mxEvent.addListener(H,"click",function(W){n();W.preventDefault();mxEvent.consume(W)}),J.appendChild(H));D.appendChild(J);var aa=[],na=mxUtils.bind(this,function(){this.hasError=!1;if(null!=q)try{q.div=q.div.cloneNode(!0);var W=q.div.querySelector(".geCommentEditTxtArea"),ba=q.div.querySelector(".geCommentEditBtns");q.comment.content=W.value;W.parentNode.removeChild(W);ba.parentNode.removeChild(ba)}catch(ja){b.handleError(ja)}N.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";t=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(ja){function ca(la){if(null!=la){la.sort(function(k,B){return new Date(k.modifiedDate)-new Date(B.modifiedDate)});for(var Q=0;Q<la.length;Q++)ca(la[Q].replies)}}ja.sort(function(la,Q){return new Date(la.modifiedDate)-new Date(Q.modifiedDate)});N.innerText="";N.appendChild(L);L.style.display="block";aa=ja;for(ja=0;ja<aa.length;ja++)ca(aa[ja].replies),-f(aa[ja],aa,null,0,ea);null!=q&&null==q.comment.id&&null==q.comment.pCommentId&&(N.appendChild(q.div),H(q.comment,q.div,q.saveCallback,q.deleteOnCancel))},mxUtils.bind(this,function(ja){N.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(ja&&ja.message?": "+ja.message:""));this.hasError=!0})):N.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});na();this.refreshComments=na;J=mxUtils.bind(this,function(){function W(Q){var k=ja[Q.id];if(null!=k)for(S(Q,k),k=0;null!=Q.replies&&k<Q.replies.length;k++)W(Q.replies[k])}+f(aa[ja],aa,null,0,ea);null!=q&&null==q.comment.id&&null==q.comment.pCommentId&&(N.appendChild(q.div),G(q.comment,q.div,q.saveCallback,q.deleteOnCancel))},mxUtils.bind(this,function(ja){N.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(ja&&ja.message?": "+ja.message:""));this.hasError=!0})):N.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});na();this.refreshComments=na;J=mxUtils.bind(this,function(){function W(Q){var k=ja[Q.id];if(null!=k)for(S(Q,k),k=0;null!=Q.replies&&k<Q.replies.length;k++)W(Q.replies[k])}if(this.window.isVisible()){for(var ba=N.querySelectorAll(".geCommentDate"),ja={},ca=0;ca<ba.length;ca++){var la=ba[ca];ja[la.getAttribute("data-commentId")]=la}for(ca=0;ca<aa.length;ca++)W(aa[ca])}});setInterval(J,6E4);this.refreshCommentsTime=J;this.window=new mxWindow(mxResources.get("comments"),D,e,g,m,v,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);-this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!0)},ConfirmDialog=function(b,e,g,m,v,p,A,H,S,F,K){var c=document.createElement("div");c.style.textAlign="center";K=null!=K?K:44;var f=document.createElement("div");f.style.padding="6px";f.style.overflow="auto";f.style.maxHeight=K+"px";f.style.lineHeight="1.2em";mxUtils.write(f,e);c.appendChild(f);null!=F&&(f=document.createElement("div"),f.style.padding="6px 0 6px 0",e=document.createElement("img"),-e.setAttribute("src",F),f.appendChild(e),c.appendChild(f));F=document.createElement("div");F.style.textAlign="center";F.style.whiteSpace="nowrap";var l=document.createElement("input");l.setAttribute("type","checkbox");p=mxUtils.button(p||mxResources.get("cancel"),function(){b.hideDialog();null!=m&&m(l.checked)});p.className="geBtn";null!=H&&(p.innerHTML=H+"<br>"+p.innerHTML,p.style.display="inline-block",p.style.paddingBottom="8px",p.style.paddingTop="8px",p.style.height="auto",p.style.width="40%");-b.editor.cancelFirst&&F.appendChild(p);var t=mxUtils.button(v||mxResources.get("ok"),function(){b.hideDialog();null!=g&&g(l.checked)});F.appendChild(t);null!=A?(t.innerHTML=A+"<br>"+t.innerHTML+"<br>",t.style.display="inline-block",t.style.paddingBottom="8px",t.style.paddingTop="8px",t.style.height="auto",t.className="geBtn",t.style.width="40%"):t.className="geBtn gePrimaryBtn";b.editor.cancelFirst||F.appendChild(p);c.appendChild(F);S?(F.style.marginTop="10px",f=document.createElement("p"),f.style.marginTop=+this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!0)},ConfirmDialog=function(b,e,g,m,v,n,A,G,S,F,K){var c=document.createElement("div");c.style.textAlign="center";K=null!=K?K:44;var f=document.createElement("div");f.style.padding="6px";f.style.overflow="auto";f.style.maxHeight=K+"px";f.style.lineHeight="1.2em";mxUtils.write(f,e);c.appendChild(f);null!=F&&(f=document.createElement("div"),f.style.padding="6px 0 6px 0",e=document.createElement("img"),+e.setAttribute("src",F),f.appendChild(e),c.appendChild(f));F=document.createElement("div");F.style.textAlign="center";F.style.whiteSpace="nowrap";var l=document.createElement("input");l.setAttribute("type","checkbox");n=mxUtils.button(n||mxResources.get("cancel"),function(){b.hideDialog();null!=m&&m(l.checked)});n.className="geBtn";null!=G&&(n.innerHTML=G+"<br>"+n.innerHTML,n.style.display="inline-block",n.style.paddingBottom="8px",n.style.paddingTop="8px",n.style.height="auto",n.style.width="40%");+b.editor.cancelFirst&&F.appendChild(n);var t=mxUtils.button(v||mxResources.get("ok"),function(){b.hideDialog();null!=g&&g(l.checked)});F.appendChild(t);null!=A?(t.innerHTML=A+"<br>"+t.innerHTML+"<br>",t.style.display="inline-block",t.style.paddingBottom="8px",t.style.paddingTop="8px",t.style.height="auto",t.className="geBtn",t.style.width="40%"):t.className="geBtn gePrimaryBtn";b.editor.cancelFirst||F.appendChild(n);c.appendChild(F);S?(F.style.marginTop="10px",f=document.createElement("p"),f.style.marginTop="20px",f.style.marginBottom="0px",f.appendChild(l),v=document.createElement("span"),mxUtils.write(v," "+mxResources.get("rememberThisSetting")),f.appendChild(v),c.appendChild(f),mxEvent.addListener(v,"click",function(q){l.checked=!l.checked;mxEvent.consume(q)})):F.style.marginTop="12px";this.init=function(){t.focus()};this.container=c},HeadlessEditorUi=function(){EditorUi.call(this,new Editor(!0),document.createElement("div"),!0)};mxUtils.extend(HeadlessEditorUi,EditorUi);HeadlessEditorUi.prototype.createUi=function(){};HeadlessEditorUi.prototype.addTrees=function(){};HeadlessEditorUi.prototype.onBeforeUnload=function(){};HeadlessEditorUi.prototype.updateActionStates=function(){};function DiagramPage(b,e){this.node=b;null!=e?this.node.setAttribute("id",e):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.diagramModified=!1;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(b){null==b?this.node.removeAttribute("name"):this.node.setAttribute("name",b)};DiagramPage.prototype.setDiagramModified=function(b){this.diagramModified=b};DiagramPage.prototype.isDiagramModified=function(){return this.diagramModified};function RenamePage(b,e,g){this.ui=b;this.page=e;this.previous=this.name=g}@@ -4023,19 +4025,19 @@ ChangePage.prototype.execute=function(){this.ui.editor.fireEvent(new mxEventObjeReplaceDiagram.prototype.execute=function(){var b=this.ui.editor.graph,e=this.ui.editor.getGraphXml();this.ui.editor.readGraphState(this.data);this.ui.editor.updateGraphComponents();var g=new mxCodec(this.data.ownerDocument),m=new mxGraphModel;g.decode(this.data,m);this.data=e;this.ui.currentPage&&(this.ui.currentPage.viewState=b.getViewState(),this.ui.currentPage.root=m.root,null!=this.ui.currentPage.model&&this.ui.currentPage.model.rootChanged(this.ui.currentPage.model.root));b.view.clear(b.model.root,!0);b.model.rootChanged(m.root);b.fireEvent(new mxEventObject(mxEvent.ROOT))};EditorUi.prototype.tabContainerVisible=!0;EditorUi.prototype.setTabContainerVisible=function(b,e){Editor.isSettingsEnabled()&&e&&(mxSettings.settings.pages=b,mxSettings.save());this.tabContainerVisible=b;this.updateTabContainer()};EditorUi.prototype.isTabContainerVisible=function(){return this.tabContainerVisible};EditorUi.prototype.getSelectedPageIndex=function(){return this.getPageIndex(this.currentPage)};EditorUi.prototype.getPageIndex=function(b){var e=null;if(null!=this.pages&&null!=b)for(var g=0;g<this.pages.length;g++)if(this.pages[g]==b){e=g;break}return e};EditorUi.prototype.getPageById=function(b,e){e=null!=e?e:this.pages;if(null!=e)for(var g=0;g<e.length;g++)if(e[g].getId()==b)return e[g];return null};-EditorUi.prototype.createImageForPageLink=function(b,e,g,m){var v=b.indexOf(","),p=null;0<v&&(v=this.getPageById(b.substring(v+1)),null!=v&&v!=e&&(p=this.getImageForPage(v,e,g,m),p.originalSrc=b));null==p&&(p={originalSrc:b});return p};+EditorUi.prototype.createImageForPageLink=function(b,e,g,m){var v=b.indexOf(","),n=null;0<v&&(v=this.getPageById(b.substring(v+1)),null!=v&&v!=e&&(n=this.getImageForPage(v,e,g,m),n.originalSrc=b));null==n&&(n={originalSrc:b});return n};EditorUi.prototype.pageSelected=function(){var b=this.editor.graph,e=this.currentPage;null!=e&&(b.tooltipHandler.hide(),null==e.viewState||null==e.viewState.scrollTop||null==e.viewState.scrollLeft?(b.selectUnlockedLayer(),this.resetScrollbars(),b.isLightboxView()&&this.lightboxFit(),null!=this.chromelessResize&&(b.container.scrollleft=0,b.container.scrollTop=0,this.chromelessResize())):b.setScrollbarPositions(e.viewState,b.view.translate.x,b.view.translate.y),this.updateTabContainer(),this.scrollToPage())};-EditorUi.prototype.getImageForPage=function(b,e,g,m){g=null!=g?g:this.editor.graph;var v=g.getGlobalVariable;g=this.createTemporaryGraph(g.getStylesheet());var p=this.getPageIndex(null!=e?e:this.currentPage);g.getGlobalVariable=function(H){return"pagenumber"==H?p+1:"page"==H&&null!=e?e.getName():v.apply(this,arguments)};document.body.appendChild(g.container);this.updatePageRoot(b);g.setAdaptiveColors(b.viewState.adaptiveColors);g.model.setRoot(b.root);b=Graph.foreignObjectWarningText;Graph.foreignObjectWarningText=+EditorUi.prototype.getImageForPage=function(b,e,g,m){g=null!=g?g:this.editor.graph;var v=g.getGlobalVariable;g=this.createTemporaryGraph(g.getStylesheet());var n=this.getPageIndex(null!=e?e:this.currentPage);g.getGlobalVariable=function(G){return"pagenumber"==G?n+1:"page"==G&&null!=e?e.getName():v.apply(this,arguments)};document.body.appendChild(g.container);this.updatePageRoot(b);g.setAdaptiveColors(b.viewState.adaptiveColors);g.model.setRoot(b.root);b=Graph.foreignObjectWarningText;Graph.foreignObjectWarningText="";m=g.getSvg(null,null,null,null,null,null,null,null,null,null,m,null,null,null,!0,!0);var A=g.getGraphBounds();document.body.removeChild(g.container);Graph.foreignObjectWarningText=b;return new mxImage(Editor.createSvgDataUri(mxUtils.getXml(m)),A.width,A.height,A.x,A.y)};EditorUi.prototype.initPages=function(){if(!this.editor.graph.standalone){this.actions.addAction("previousPage",mxUtils.bind(this,function(){this.selectNextPage(!1)}));this.actions.addAction("nextPage",mxUtils.bind(this,function(){this.selectNextPage(!0)}));this.isPagesEnabled()&&(this.keyHandler.bindAction(33,!0,"previousPage",!0),this.keyHandler.bindAction(34,!0,"nextPage",!0));var b=this.editor.graph,e=b.view.validateBackground;b.view.validateBackground=mxUtils.bind(this,function(){e.apply(b.view,-arguments);null!=b.view.backgroundImage&&EditorUi.embedSvgImages(b.view.backgroundImage.node)});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(A,H){A=H.getProperty("edit").changes;for(H=0;H<A.length;H++)if(A[H]instanceof RenamePage||A[H]instanceof ChangePage||A[H]instanceof mxRootChange){this.updateTabContainer();break}null==this.currentPage||1==A.length&&A[0]instanceof SelectPage||this.currentPage.setDiagramModified(!0)}));var g=b.sizeDidChange,m=null,v=this;b.sizeDidChange=-function(){var A=g.apply(this,arguments);null!=v.currentPage&&m!=v.currentPage&&(m=v.currentPage,v.pageSelected());return A};b.addListener(mxEvent.ROOT,mxUtils.bind(this,function(){b.checkDefaultParent()}));var p=mxUtils.bind(this,function(){this.updateDocumentTitle();this.updateTabContainer()});this.addListener("currentThemeChanged",p);this.editor.addListener("pagesPatched",p);this.editor.addListener("pageRenamed",p);this.editor.addListener("pageMoved",p);this.editor.addListener("fileLoaded",p);-this.editor.addListener("pageSelected",mxUtils.bind(this,function(A,H){this.scrollToPage();this.updateHashObject();this.updateTabContainer();this.updateDocumentTitle()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(A,H){this.scrollToPage();this.updateHashObject()}));mxEvent.addListener(window,"resize",mxUtils.bind(this,function(){this.checkTabScrollerOverflow()}));this.addListener("languageChanged",mxUtils.bind(this,function(){this.updateTabContainer()}))}};+arguments);null!=b.view.backgroundImage&&EditorUi.embedSvgImages(b.view.backgroundImage.node)});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(A,G){A=G.getProperty("edit").changes;for(G=0;G<A.length;G++)if(A[G]instanceof RenamePage||A[G]instanceof ChangePage||A[G]instanceof mxRootChange){this.updateTabContainer();break}null==this.currentPage||1==A.length&&A[0]instanceof SelectPage||this.currentPage.setDiagramModified(!0)}));var g=b.sizeDidChange,m=null,v=this;b.sizeDidChange=+function(){var A=g.apply(this,arguments);null!=v.currentPage&&m!=v.currentPage&&(m=v.currentPage,v.pageSelected());return A};b.addListener(mxEvent.ROOT,mxUtils.bind(this,function(){b.checkDefaultParent()}));var n=mxUtils.bind(this,function(){this.updateDocumentTitle();this.updateTabContainer()});this.addListener("currentThemeChanged",n);this.editor.addListener("pagesPatched",n);this.editor.addListener("pageRenamed",n);this.editor.addListener("pageMoved",n);this.editor.addListener("fileLoaded",n);+this.editor.addListener("pageSelected",mxUtils.bind(this,function(A,G){this.scrollToPage();this.updateHashObject();this.updateTabContainer();this.updateDocumentTitle()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(A,G){this.scrollToPage();this.updateHashObject()}));mxEvent.addListener(window,"resize",mxUtils.bind(this,function(){this.checkTabScrollerOverflow()}));this.addListener("languageChanged",mxUtils.bind(this,function(){this.updateTabContainer()}))}};EditorUi.prototype.scrollToPage=function(b,e){var g=null!=b?this.getPageIndex(b):this.getSelectedPageIndex(),m=null!=b?b:this.currentPage;null!=g&&null!=this.tabScroller&&this.tabScroller.children.length>g&&null!=this.tabScroller.children[g]&&(m!=this.lastScrollPage||e)&&(this.tabScroller.children[g].scrollIntoView({block:"nearest",inline:null!=b?"nearest":"center"}),this.tabScroller.children[g].className="geTab gePageTab geActivePage",this.lastScrollPage=m)};EditorUi.prototype.restoreViewState=function(b,e,g){b=null!=b?this.getPageById(b.getId()):null;var m=this.editor.graph;null!=b&&null!=this.currentPage&&null!=this.pages&&(b!=this.currentPage?this.selectPage(b,!0,e):(m.setViewState(e),this.editor.updateGraphComponents(),m.view.revalidate(),m.sizeDidChange()),m.container.scrollLeft=m.view.translate.x*m.view.scale+e.scrollLeft,m.container.scrollTop=m.view.translate.y*m.view.scale+e.scrollTop,m.restoreSelection(g))};-Graph.prototype.createViewState=function(b){var e=b.getAttribute("page"),g=parseFloat(b.getAttribute("pageScale")),m=parseFloat(b.getAttribute("pageWidth")),v=parseFloat(b.getAttribute("pageHeight")),p=b.getAttribute("background"),A=this.parseBackgroundImage(b.getAttribute("backgroundImage")),H=b.getAttribute("extFonts");if(H)try{H=H.split("|").map(function(S){S=S.split("^");return{name:S[0],url:S[1]}})}catch(S){console.log("ExtFonts format error: "+S.message)}return{gridEnabled:"0"!=b.getAttribute("grid"),-gridSize:parseFloat(b.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=b.getAttribute("guides"),foldingEnabled:"0"!=b.getAttribute("fold"),shadowVisible:"1"==b.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=e?"0"!=e:this.defaultPageVisible,background:null!=p&&0<p.length?p:null,backgroundImage:A,pageScale:isNaN(g)?mxGraph.prototype.pageScale:g,pageFormat:isNaN(m)||isNaN(v)?"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:-mxSettings.getPageFormat():new mxRectangle(0,0,m,v),tooltips:"0"!=b.getAttribute("tooltips"),connect:"0"!=b.getAttribute("connect"),arrows:"0"!=b.getAttribute("arrows"),mathEnabled:"1"==b.getAttribute("math"),adaptiveColors:b.getAttribute("adaptiveColors"),selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1,hiddenTags:[],extFonts:H||[]}};+Graph.prototype.createViewState=function(b){var e=b.getAttribute("page"),g=parseFloat(b.getAttribute("pageScale")),m=parseFloat(b.getAttribute("pageWidth")),v=parseFloat(b.getAttribute("pageHeight")),n=b.getAttribute("background"),A=this.parseBackgroundImage(b.getAttribute("backgroundImage")),G=b.getAttribute("extFonts");if(G)try{G=G.split("|").map(function(S){S=S.split("^");return{name:S[0],url:S[1]}})}catch(S){console.log("ExtFonts format error: "+S.message)}return{gridEnabled:"0"!=b.getAttribute("grid"),+gridSize:parseFloat(b.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=b.getAttribute("guides"),foldingEnabled:"0"!=b.getAttribute("fold"),shadowVisible:"1"==b.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=e?"0"!=e:this.defaultPageVisible,background:null!=n&&0<n.length?n:null,backgroundImage:A,pageScale:isNaN(g)?mxGraph.prototype.pageScale:g,pageFormat:isNaN(m)||isNaN(v)?"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:+mxSettings.getPageFormat():new mxRectangle(0,0,m,v),tooltips:"0"!=b.getAttribute("tooltips"),connect:"0"!=b.getAttribute("connect"),arrows:"0"!=b.getAttribute("arrows"),mathEnabled:"1"==b.getAttribute("math"),adaptiveColors:b.getAttribute("adaptiveColors"),selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1,hiddenTags:[],extFonts:G||[]}};Graph.prototype.saveViewState=function(b,e,g,m){g||(e.setAttribute("grid",(null==b?this.defaultGridEnabled:b.gridEnabled)?"1":"0"),e.setAttribute("page",(null==b?this.defaultPageVisible:b.pageVisible)?"1":"0"),e.setAttribute("gridSize",null!=b?b.gridSize:mxGraph.prototype.gridSize),e.setAttribute("guides",null==b||b.guidesEnabled?"1":"0"),e.setAttribute("tooltips",null==b||b.tooltips?"1":"0"),e.setAttribute("connect",null==b||b.connect?"1":"0"),e.setAttribute("arrows",null==b||b.arrows?"1":"0"),e.setAttribute("fold",null==b||b.foldingEnabled?"1":"0"));e.setAttribute("pageScale",null!=b&&null!=b.pageScale?b.pageScale:mxGraph.prototype.pageScale);g=null!=b?b.pageFormat:"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat();null!=g&&(e.setAttribute("pageWidth",g.width),e.setAttribute("pageHeight",g.height));null!=b&&(null!=b.background&&e.setAttribute("background",b.background),m=this.getBackgroundImageObject(b.backgroundImage,m),null!=m&&e.setAttribute("backgroundImage",JSON.stringify(m)));e.setAttribute("math",(null==b?this.defaultMathEnabled:b.mathEnabled)?"1":"0");e.setAttribute("shadow",null!=b&&b.shadowVisible?"1":"0");null==b||null==b.adaptiveColors?e.removeAttribute("adaptiveColors"):e.setAttribute("adaptiveColors",b.adaptiveColors);null!=b&&null!=b.extFonts&&0<b.extFonts.length&&e.setAttribute("extFonts",b.extFonts.map(function(v){return v.name+"^"+v.url}).join("|"))};@@ -4051,20 +4053,20 @@ m=!0;for(v=0;v<g.length;v++)if(g[v].name==b){m=!1;break}m&&this.extFonts.push({nEditorUi.prototype.updatePageRoot=function(b,e){if(null==b.root){e=this.editor.extractGraphModel(b.node,null,e);var g=Editor.extractParserError(e);if(g)throw Error(g);null!=e?(b.graphModelNode=e,b.viewState=this.editor.graph.createViewState(e),g=new mxCodec(e.ownerDocument),b.root=g.decode(e).root):(b.root=this.editor.graph.model.createRoot(),b.root.setId("0"),b.root.children[0].setId("1"),b.needsUpdate=!0)}else if(null==b.viewState){if(null==b.graphModelNode){e=this.editor.extractGraphModel(b.node);if(g=Editor.extractParserError(e))throw Error(g);null!=e&&(b.graphModelNode=e)}null!=b.graphModelNode&&(b.viewState=this.editor.graph.createViewState(b.graphModelNode))}if(null==b.root.children||0==b.root.children.length)e=new mxCell,e.setId("1"),b.root.insert(e),b.needsUpdate=!0;return b};EditorUi.prototype.getDiagramSnapshot=function(){return{node:this.editor.getGraphXml(),page:this.currentPage}};EditorUi.prototype.updateDiagramData=function(b,e){if(null==this.getPageIndex(b.page))this.insertPage(null,null,e);else{var g=new mxCodec(b.node.ownerDocument),m=new mxGraphModel;g.decode(b.node,m);g=new mxCodec(e.ownerDocument);var v=new mxGraphModel;g.decode(e,v);this.selectPage(b.page);e=this.diffCells(m.root,v.root);this.patchPage(b.page,e,null,!0)}};EditorUi.prototype.replaceDiagramData=function(b){this.editor.graph.model.execute(new ReplaceDiagram(this,mxUtils.parseXml(b).documentElement))};-EditorUi.prototype.selectPage=function(b,e,g){try{if(b!=this.currentPage){var m=this.editor.graph;m.isEditing()&&m.stopEditing(!1);e=null!=e?e:!1;m.isMouseDown=!1;m.reset();var v=m.model.createUndoableEdit();v.ignoreEdit=!0;var p=new SelectPage(this,b,g);p.execute();v.add(p);v.notify();e||m.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",v))}}catch(A){this.handleError(A)}};+EditorUi.prototype.selectPage=function(b,e,g){try{if(b!=this.currentPage){var m=this.editor.graph;m.isEditing()&&m.stopEditing(!1);e=null!=e?e:!1;m.isMouseDown=!1;m.reset();var v=m.model.createUndoableEdit();v.ignoreEdit=!0;var n=new SelectPage(this,b,g);n.execute();v.add(n);v.notify();e||m.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",v))}}catch(A){this.handleError(A)}};EditorUi.prototype.selectNextPage=function(b){var e=this.currentPage;null!=e&&null!=this.pages&&(e=mxUtils.indexOf(this.pages,e),b?this.selectPage(this.pages[mxUtils.mod(e+1,this.pages.length)]):b||this.selectPage(this.pages[mxUtils.mod(e-1,this.pages.length)]))};EditorUi.prototype.insertPage=function(b,e,g){this.editor.graph.isEnabled()&&(this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1),b=null!=b?b:this.createPage(null,this.createPageId(),g),e=null!=e?e:this.pages.length,e=new ChangePage(this,b,b,e),this.editor.graph.model.execute(e));return b};EditorUi.prototype.createPageId=function(){do var b=Editor.guid();while(null!=this.getPageById(b));return b};EditorUi.prototype.createPage=function(b,e,g){e=new DiagramPage((null!=this.fileNode?this.fileNode.ownerDocument:document).createElement("diagram"),e);e.setName(null!=b?b:this.createPageName());this.initDiagramNode(e,g);return e};EditorUi.prototype.createPageName=function(){for(var b={},e=0;e<this.pages.length;e++){var g=this.pages[e].getName();null!=g&&0<g.length&&(b[g]=g)}e=this.pages.length;do g=mxResources.get("pageWithNumber",[++e]);while(null!=b[g]);return g};EditorUi.prototype.removePage=function(b){try{var e=this.editor.graph,g=mxUtils.indexOf(this.pages,b);if(e.isEnabled()&&0<=g){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);e.model.beginUpdate();try{var m=this.currentPage;m==b&&1<this.pages.length?(g==this.pages.length-1?g--:g++,m=this.pages[g]):1>=this.pages.length&&(m=this.insertPage(),e.model.execute(new RenamePage(this,m,mxResources.get("pageWithNumber",[1]))));e.model.execute(new ChangePage(this,b,m))}finally{e.model.endUpdate()}}}catch(v){this.handleError(v)}return b};-EditorUi.prototype.duplicatePage=function(b,e){var g=null;try{var m=this.editor.graph;if(m.isEnabled()){m.isEditing()&&m.stopEditing();var v=b.node.cloneNode(!1);v.removeAttribute("id");var p={},A=m.createCellLookup([m.model.root]);g=new DiagramPage(v);g.root=m.cloneCell(m.model.root,null,p);var H=new mxGraphModel;H.prefix=Editor.guid()+"-";H.setRoot(g.root);m.updateCustomLinks(m.createCellMapping(p,A),[g.root]);g.viewState=b==this.currentPage?m.getViewState():b.viewState;this.initDiagramNode(g);+EditorUi.prototype.duplicatePage=function(b,e){var g=null;try{var m=this.editor.graph;if(m.isEnabled()){m.isEditing()&&m.stopEditing();var v=b.node.cloneNode(!1);v.removeAttribute("id");var n={},A=m.createCellLookup([m.model.root]);g=new DiagramPage(v);g.root=m.cloneCell(m.model.root,null,n);var G=new mxGraphModel;G.prefix=Editor.guid()+"-";G.setRoot(g.root);m.updateCustomLinks(m.createCellMapping(n,A),[g.root]);g.viewState=b==this.currentPage?m.getViewState():b.viewState;this.initDiagramNode(g);g.viewState.scale=1;delete g.viewState.scrollLeft;delete g.viewState.scrollTop;delete g.viewState.currentRoot;delete g.viewState.defaultParent;g.setName(e);g=this.insertPage(g,mxUtils.indexOf(this.pages,b)+1)}}catch(S){this.handleError(S)}return g};EditorUi.prototype.initDiagramNode=function(b,e){null==e&&(e=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b.root)));this.editor.graph.saveViewState(b.viewState,e);EditorUi.removeChildNodes(b.node);b.node.appendChild(e)};EditorUi.prototype.clonePages=function(b){for(var e=[],g=[],m=0;m<b.length;m++)try{g.push(this.clonePage(b[m]))}catch(v){e.push(mxResources.get("pageWithNumber",[m+1])+": "+v.toString())}if(0<e.length){b=Error(e.join("\n"));try{0<g.length&&(b.fallbackFileData=this.getXmlForPages(g))}catch(v){}throw b;}return g};EditorUi.prototype.clonePage=function(b){this.updatePageRoot(b);var e=new DiagramPage(b.node.cloneNode(!0)),g=b==this.currentPage?this.editor.graph.getViewState():b.viewState;e.viewState=mxUtils.clone(g,EditorUi.transientViewStateProperties);e.root=this.editor.graph.model.cloneCell(b.root,null,!0);e.diagramModified=b.diagramModified;return e};EditorUi.prototype.renamePage=function(b){if(this.editor.graph.isEnabled()){var e=new FilenameDialog(this,b.getName(),mxResources.get("rename"),mxUtils.bind(this,function(g){null!=g&&0<g.length&&this.editor.graph.model.execute(new RenamePage(this,b,g))}),mxResources.get("rename"));this.showDialog(e.container,300,80,!0,!0);e.init()}return b};EditorUi.prototype.movePage=function(b,e){this.editor.graph.model.execute(new MovePage(this,b,e))};EditorUi.prototype.createTabContainer=function(){var b=document.createElement("div");b.className="geTabContainer geTabItem";return b};-EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&!this.isTabContainerVisible())this.tabContainer.style.display="none";else if(null!=this.tabContainer&&null!=this.pages){this.tabContainer.style.display="";var b=this.editor.graph,e=document.createElement("div");e.className="geTabScroller";for(var g=null,m=0;m<this.pages.length;m++)mxUtils.bind(this,function(v,p){p.className="geTab gePageTab";this.pages[v]==this.currentPage&&p.classList.add("geActivePage");p.setAttribute("draggable",-"true");mxEvent.addListener(p,"dragstart",mxUtils.bind(this,function(A){b.isEnabled()?(mxClient.IS_FF&&A.dataTransfer.setData("Text","<diagram/>"),g=v):mxEvent.consume(A)}));mxEvent.addListener(p,"dragend",mxUtils.bind(this,function(A){g=null;A.stopPropagation();A.preventDefault()}));mxEvent.addListener(p,"dragover",mxUtils.bind(this,function(A){null!=g&&(A.dataTransfer.dropEffect="move");A.stopPropagation();A.preventDefault()}));mxEvent.addListener(p,"drop",mxUtils.bind(this,function(A){null!=g&&-v!=g&&this.movePage(g,v);A.stopPropagation();A.preventDefault()}));e.appendChild(p)})(m,this.createTabForPage(this.pages[m],m+1));m=null!=this.tabScroller?this.tabScroller.scrollLeft:0;this.tabContainer.innerText="";this.isPageInsertTabVisible()&&this.tabContainer.appendChild(this.createPageInsertTab());"simple"!=Editor.currentTheme&&(this.pageMenuTab=this.createPageMenuTab(),this.tabContainer.appendChild(this.pageMenuTab));this.tabContainer.appendChild(e);this.leftScrollTab=this.createLeftScrollTab();+EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&!this.isTabContainerVisible())this.tabContainer.style.display="none";else if(null!=this.tabContainer&&null!=this.pages){this.tabContainer.style.display="";var b=this.editor.graph,e=document.createElement("div");e.className="geTabScroller";for(var g=null,m=0;m<this.pages.length;m++)mxUtils.bind(this,function(v,n){n.className="geTab gePageTab";this.pages[v]==this.currentPage&&n.classList.add("geActivePage");n.setAttribute("draggable",+"true");mxEvent.addListener(n,"dragstart",mxUtils.bind(this,function(A){b.isEnabled()?(mxClient.IS_FF&&A.dataTransfer.setData("Text","<diagram/>"),g=v):mxEvent.consume(A)}));mxEvent.addListener(n,"dragend",mxUtils.bind(this,function(A){g=null;A.stopPropagation();A.preventDefault()}));mxEvent.addListener(n,"dragover",mxUtils.bind(this,function(A){null!=g&&(A.dataTransfer.dropEffect="move");A.stopPropagation();A.preventDefault()}));mxEvent.addListener(n,"drop",mxUtils.bind(this,function(A){null!=g&&+v!=g&&this.movePage(g,v);A.stopPropagation();A.preventDefault()}));e.appendChild(n)})(m,this.createTabForPage(this.pages[m],m+1));m=null!=this.tabScroller?this.tabScroller.scrollLeft:0;this.tabContainer.innerText="";this.isPageInsertTabVisible()&&this.tabContainer.appendChild(this.createPageInsertTab());"simple"!=Editor.currentTheme&&(this.pageMenuTab=this.createPageMenuTab(),this.tabContainer.appendChild(this.pageMenuTab));this.tabContainer.appendChild(e);this.leftScrollTab=this.createLeftScrollTab();this.tabContainer.appendChild(this.leftScrollTab);this.rightScrollTab=this.createRightScrollTab();this.tabContainer.appendChild(this.rightScrollTab);this.tabScroller=e;this.tabScroller.scrollLeft=m;this.checkTabScrollerOverflow();mxEvent.addListener(this.tabScroller,"scroll",mxUtils.bind(this,function(v){this.checkTabScrollerOverflow()}))}};EditorUi.prototype.checkTabScrollerOverflow=function(){null!=this.tabScroller&&null!=this.tabContainer&&2<this.tabContainer.children.length&&(this.tabScroller.scrollWidth>this.tabScroller.offsetWidth?(this.leftScrollTab.style.display="",this.rightScrollTab.style.display="",0==this.tabScroller.scrollLeft?this.leftScrollTab.classList.add("mxDisabled"):this.leftScrollTab.classList.remove("mxDisabled"),Math.ceil(this.tabScroller.scrollLeft)+this.tabScroller.offsetWidth>=this.tabScroller.scrollWidth?this.rightScrollTab.classList.add("mxDisabled"):this.rightScrollTab.classList.remove("mxDisabled")):(this.leftScrollTab.style.display="none",this.rightScrollTab.style.display="none"))};EditorUi.prototype.isPageInsertTabVisible=function(){return 1==urlParams.embed||null!=this.getCurrentFile()&&this.getCurrentFile().isEditable()};EditorUi.prototype.createTab=function(){var b=document.createElement("div");b.className="geTab";return b};@@ -4072,36 +4074,36 @@ EditorUi.prototype.getShortPageName=function(b){var e=null;null!=b&&(e=b.getNameEditorUi.prototype.createPageInsertTab=function(){return this.createControlTab(mxResources.get("insertPage"),Editor.plusImage,mxUtils.bind(this,function(b){try{this.insertPage()}catch(e){this.handleError(e)}mxEvent.consume(b)}))};EditorUi.prototype.createLeftScrollTab=function(){return this.createControlTab(null,Editor.chevronLeftImage,mxUtils.bind(this,function(b){var e=Math.max(60,this.tabScroller.clientWidth/2);null!=this.tabScroller.scrollBy?this.tabScroller.scrollBy({left:-e,top:0,behavior:"smooth"}):this.tabScroller.scrollLeft-=e;mxEvent.consume(b)}))};EditorUi.prototype.createRightScrollTab=function(){return this.createControlTab(null,Editor.chevronRightImage,mxUtils.bind(this,function(b){var e=Math.max(60,this.tabScroller.clientWidth/2);null!=this.tabScroller.scrollBy?this.tabScroller.scrollBy({left:e,top:0,behavior:"smooth"}):this.tabScroller.scrollLeft+=e;mxEvent.consume(b)}))};-EditorUi.prototype.createPageMenuTab=function(){return this.createControlTab(mxResources.get("pages"),Editor.menuImage,mxUtils.bind(this,function(b){this.editor.graph.popupMenuHandler.hideMenu();var e=new mxPopupMenu(mxUtils.bind(this,function(v,p){this.menus.get("pages").funct(v,p)}));e.smartSeparators=!0;e.showDisabled=!0;e.autoExpand=!0;e.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(e,arguments);e.destroy()});var g=mxEvent.getClientX(b),m=mxEvent.getClientY(b);e.popup(g,+EditorUi.prototype.createPageMenuTab=function(){return this.createControlTab(mxResources.get("pages"),Editor.menuImage,mxUtils.bind(this,function(b){this.editor.graph.popupMenuHandler.hideMenu();var e=new mxPopupMenu(mxUtils.bind(this,function(v,n){this.menus.get("pages").funct(v,n)}));e.smartSeparators=!0;e.showDisabled=!0;e.autoExpand=!0;e.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(e,arguments);e.destroy()});var g=mxEvent.getClientX(b),m=mxEvent.getClientY(b);e.popup(g,m,null,b);this.setCurrentMenu(e);mxEvent.consume(b)}))};EditorUi.prototype.createTabForPage=function(b,e){var g=this.createTab(),m=b.getName()||mxResources.get("untitled"),v=b.getId();g.setAttribute("title",m+(null!=v?" ("+v+")":"")+" ["+e+"]");e=document.createElement("span");e.style.maxWidth="160px";e.style.textOverflow="ellipsis";e.style.overflow="hidden";mxUtils.write(e,m);g.appendChild(e);this.addTabListeners(b,g);return g};-EditorUi.prototype.addTabListeners=function(b,e){mxEvent.disableContextMenu(e);var g=this.editor.graph;mxEvent.addListener(e,"dblclick",mxUtils.bind(this,function(S){this.renamePage(b);mxEvent.consume(S)}));var m=document.createElement("div");m.style.backgroundImage="url("+Editor.thinExpandImage+")";m.className="geButton";e.appendChild(m);var v=!1,p=!1,A=mxUtils.bind(this,function(S){v=null!=this.currentMenu;p=b==this.currentPage;this.scrollToPage(b);g.isMouseDown||p||this.selectPage(b)}),H=mxUtils.bind(this,-function(S){if(!g.isMouseDown&&(p&&(mxEvent.isTouchEvent(S)||mxEvent.getSource(S)==m)||mxEvent.isPopupTrigger(S))&&(g.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(S)||!v)){var F=new mxPopupMenu(this.createPageMenu(b));F.smartSeparators=!0;F.showDisabled=!0;F.autoExpand=!0;F.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(F,arguments);this.resetCurrentMenu();F.destroy()});var K=mxEvent.getClientX(S),c=mxEvent.getClientY(S);F.popup(K,c,null,S);-this.setCurrentMenu(F,e)}mxEvent.consume(S)});mxEvent.addGestureListeners(m,A,null,H);mxEvent.addGestureListeners(e,A,null,H)};+EditorUi.prototype.addTabListeners=function(b,e){mxEvent.disableContextMenu(e);var g=this.editor.graph;mxEvent.addListener(e,"dblclick",mxUtils.bind(this,function(S){this.renamePage(b);mxEvent.consume(S)}));var m=document.createElement("div");m.style.backgroundImage="url("+Editor.thinExpandImage+")";m.className="geButton";e.appendChild(m);var v=!1,n=!1,A=mxUtils.bind(this,function(S){v=null!=this.currentMenu;n=b==this.currentPage;this.scrollToPage(b);g.isMouseDown||n||this.selectPage(b)}),G=mxUtils.bind(this,+function(S){if(!g.isMouseDown&&(n&&(mxEvent.isTouchEvent(S)||mxEvent.getSource(S)==m)||mxEvent.isPopupTrigger(S))&&(g.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(S)||!v)){var F=new mxPopupMenu(this.createPageMenu(b));F.smartSeparators=!0;F.showDisabled=!0;F.autoExpand=!0;F.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(F,arguments);this.resetCurrentMenu();F.destroy()});var K=mxEvent.getClientX(S),c=mxEvent.getClientY(S);F.popup(K,c,null,S);+this.setCurrentMenu(F,e)}mxEvent.consume(S)});mxEvent.addGestureListeners(m,A,null,G);mxEvent.addGestureListeners(e,A,null,G)};EditorUi.prototype.createPageMenu=function(b,e){return mxUtils.bind(this,function(g,m){1!=urlParams.embed&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=this.getServiceName()||g.addItem(mxResources.get("openInNewWindow"),null,mxUtils.bind(this,function(){this.editor.editAsNew(this.getFileData(!0,null,null,null,!0,!0))}),m));this.editor.graph.isEnabled()&&(g.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(b,mxResources.get("copyOf",[b.getName()]))}),m),g.addSeparator(m),this.currentPage==b&&1<this.pages.length&&this.menus.addSubmenu("movePage",g,m,mxResources.get("move")),g.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(b)}),m),g.addItem(mxResources.get("rename")+"...",null,mxUtils.bind(this,function(){this.renamePage(b,e)}),m))})};(function(){mxCodecRegistry.getCodec(ChangePageSetup).exclude.push("page")})();(function(){var b=new mxObjectCodec(new MovePage,["ui"]);b.beforeDecode=function(e,g,m){m.ui=e.ui;return g};b.afterDecode=function(e,g,m){e=m.oldIndex;m.oldIndex=m.newIndex;m.newIndex=e;return m};mxCodecRegistry.register(b)})();(function(){var b=new mxObjectCodec(new RenamePage,["ui","page"]);b.beforeDecode=function(e,g,m){m.ui=e.ui;return g};b.afterDecode=function(e,g,m){e=m.previous;m.previous=m.name;m.name=e;return m};mxCodecRegistry.register(b)})();-(function(){var b=new mxObjectCodec(new ChangePage,["ui","relatedPage","index","page","previousPage"]);b.afterEncode=function(e,g,m){m.setAttribute("relatedPage",g.relatedPage.getId());null==g.index&&(m.setAttribute("name",g.relatedPage.getName()),null!=g.relatedPage.viewState&&m.setAttribute("viewState",JSON.stringify(g.relatedPage.viewState,function(v,p){return 0>mxUtils.indexOf(EditorUi.transientViewStateProperties,v)?p:void 0})),null!=g.relatedPage.root&&e.encodeCell(g.relatedPage.root,m));return m};+(function(){var b=new mxObjectCodec(new ChangePage,["ui","relatedPage","index","page","previousPage"]);b.afterEncode=function(e,g,m){m.setAttribute("relatedPage",g.relatedPage.getId());null==g.index&&(m.setAttribute("name",g.relatedPage.getName()),null!=g.relatedPage.viewState&&m.setAttribute("viewState",JSON.stringify(g.relatedPage.viewState,function(v,n){return 0>mxUtils.indexOf(EditorUi.transientViewStateProperties,v)?n:void 0})),null!=g.relatedPage.root&&e.encodeCell(g.relatedPage.root,m));return m};b.beforeDecode=function(e,g,m){m.ui=e.ui;m.relatedPage=m.ui.getPageById(g.getAttribute("relatedPage"));if(null==m.relatedPage){var v=g.ownerDocument.createElement("diagram");v.setAttribute("id",g.getAttribute("relatedPage"));v.setAttribute("name",g.getAttribute("name"));m.relatedPage=new DiagramPage(v);v=g.getAttribute("viewState");null!=v&&(m.relatedPage.viewState=JSON.parse(v),g.removeAttribute("viewState"));g=g.cloneNode(!0);v=g.firstChild;if(null!=v)for(m.relatedPage.root=e.decodeCell(v,!1),m=-v.nextSibling,v.parentNode.removeChild(v),v=m;null!=v;){m=v.nextSibling;if(v.nodeType==mxConstants.NODETYPE_ELEMENT){var p=v.getAttribute("id");null==e.lookup(p)&&e.decodeCell(v)}v.parentNode.removeChild(v);v=m}}return g};b.afterDecode=function(e,g,m){m.index=m.previousIndex;return m};mxCodecRegistry.register(b)})();(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(m,v,p,A,H){v=null!=v?v:!1;null==p&&(p=this.getFoldableCells(this.getSelectionCells(),m));this.stopEditing();this.model.beginUpdate();try{for(var S=p.slice(),F=0;F<p.length;F++)"1"==mxUtils.getValue(this.getCurrentCellStyle(p[F]),"treeFolding","0")&&this.foldTreeCell(m,p[F]);p=S;p=b.apply(this,arguments)}finally{this.model.endUpdate()}return p};Graph.prototype.foldTreeCell=function(m,v){this.model.beginUpdate();try{var p=-[];this.traverse(v,!0,mxUtils.bind(this,function(H,S){var F=null!=S&&this.isTreeEdge(S);F&&p.push(S);H==v||null!=S&&!F||p.push(H);return(null==S||F)&&(H==v||!this.model.isCollapsed(H))}));this.model.setCollapsed(v,m);for(var A=0;A<p.length;A++)this.model.setVisible(p[A],!m)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(m){return!this.isEdgeIgnored(m)};Graph.prototype.getTreeEdges=function(m,v,p,A,H,S){return this.model.filterCells(this.getEdges(m,v,p,A,H,S),mxUtils.bind(this,-function(F){return this.isTreeEdge(F)}))};Graph.prototype.getIncomingTreeEdges=function(m,v){return this.getTreeEdges(m,v,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(m,v){return this.getTreeEdges(m,v,!1,!0,!1)};var e=EditorUi.prototype.init;EditorUi.prototype.init=function(){e.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function m(ca){return q.isVertex(ca)&&p(ca)}function v(ca){var la=!1;null!=ca&&-(la="1"==t.getCurrentCellStyle(ca).treeMoving);return la}function p(ca){var la=!1;null!=ca&&(ca=q.getParent(ca),la=t.view.getState(ca),la="tree"==(null!=la?la.style:t.getCellStyle(ca)).containerType);return la}function A(ca){var la=!1;null!=ca&&(ca=q.getParent(ca),la=t.view.getState(ca),t.view.getState(ca),la=null!=(null!=la?la.style:t.getCellStyle(ca)).childLayout);return la}function H(ca){ca=t.view.getState(ca);if(null!=ca){var la=t.getIncomingTreeEdges(ca.cell);if(0<la.length&&(la=t.view.getState(la[0]),+v.nextSibling,v.parentNode.removeChild(v),v=m;null!=v;){m=v.nextSibling;if(v.nodeType==mxConstants.NODETYPE_ELEMENT){var n=v.getAttribute("id");null==e.lookup(n)&&e.decodeCell(v)}v.parentNode.removeChild(v);v=m}}return g};b.afterDecode=function(e,g,m){m.index=m.previousIndex;return m};mxCodecRegistry.register(b)})();(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(m,v,n,A,G){v=null!=v?v:!1;null==n&&(n=this.getFoldableCells(this.getSelectionCells(),m));this.stopEditing();this.model.beginUpdate();try{for(var S=n.slice(),F=0;F<n.length;F++)"1"==mxUtils.getValue(this.getCurrentCellStyle(n[F]),"treeFolding","0")&&this.foldTreeCell(m,n[F]);n=S;n=b.apply(this,arguments)}finally{this.model.endUpdate()}return n};Graph.prototype.foldTreeCell=function(m,v){this.model.beginUpdate();try{var n=+[];this.traverse(v,!0,mxUtils.bind(this,function(G,S){var F=null!=S&&this.isTreeEdge(S);F&&n.push(S);G==v||null!=S&&!F||n.push(G);return(null==S||F)&&(G==v||!this.model.isCollapsed(G))}));this.model.setCollapsed(v,m);for(var A=0;A<n.length;A++)this.model.setVisible(n[A],!m)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(m){return!this.isEdgeIgnored(m)};Graph.prototype.getTreeEdges=function(m,v,n,A,G,S){return this.model.filterCells(this.getEdges(m,v,n,A,G,S),mxUtils.bind(this,+function(F){return this.isTreeEdge(F)}))};Graph.prototype.getIncomingTreeEdges=function(m,v){return this.getTreeEdges(m,v,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(m,v){return this.getTreeEdges(m,v,!1,!0,!1)};var e=EditorUi.prototype.init;EditorUi.prototype.init=function(){e.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function m(ca){return q.isVertex(ca)&&n(ca)}function v(ca){var la=!1;null!=ca&&+(la="1"==t.getCurrentCellStyle(ca).treeMoving);return la}function n(ca){var la=!1;null!=ca&&(ca=q.getParent(ca),la=t.view.getState(ca),la="tree"==(null!=la?la.style:t.getCellStyle(ca)).containerType);return la}function A(ca){var la=!1;null!=ca&&(ca=q.getParent(ca),la=t.view.getState(ca),t.view.getState(ca),la=null!=(null!=la?la.style:t.getCellStyle(ca)).childLayout);return la}function G(ca){ca=t.view.getState(ca);if(null!=ca){var la=t.getIncomingTreeEdges(ca.cell);if(0<la.length&&(la=t.view.getState(la[0]),null!=la&&(la=la.absolutePoints,null!=la&&0<la.length&&(la=la[la.length-1],null!=la)))){if(la.y==ca.y&&Math.abs(la.x-ca.getCenterX())<ca.width/2)return mxConstants.DIRECTION_SOUTH;if(la.y==ca.y+ca.height&&Math.abs(la.x-ca.getCenterX())<ca.width/2)return mxConstants.DIRECTION_NORTH;if(la.x>ca.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function S(ca,la){la=null!=la?la:!0;t.model.beginUpdate();try{var Q=t.model.getParent(ca),k=t.getIncomingTreeEdges(ca),B=t.cloneCells([k[0],-ca]);t.model.setTerminal(B[0],t.model.getTerminal(k[0],!0),!0);var I=H(ca),U=Q.geometry;I==mxConstants.DIRECTION_SOUTH||I==mxConstants.DIRECTION_NORTH?B[1].geometry.x+=la?ca.geometry.width+10:-B[1].geometry.width-10:B[1].geometry.y+=la?ca.geometry.height+10:-B[1].geometry.height-10;t.view.currentRoot!=Q&&(B[1].geometry.x-=U.x,B[1].geometry.y-=U.y);var P=t.view.getState(ca),T=t.view.scale;if(null!=P){var X=mxRectangle.fromRectangle(P);I==mxConstants.DIRECTION_SOUTH||I==mxConstants.DIRECTION_NORTH?-X.x+=(la?ca.geometry.width+10:-B[1].geometry.width-10)*T:X.y+=(la?ca.geometry.height+10:-B[1].geometry.height-10)*T;var Z=t.getOutgoingTreeEdges(t.model.getTerminal(k[0],!0));if(null!=Z){for(var ka=I==mxConstants.DIRECTION_SOUTH||I==mxConstants.DIRECTION_NORTH,va=U=k=0;va<Z.length;va++){var ua=t.model.getTerminal(Z[va],!1);if(I==H(ua)){var qa=t.view.getState(ua);ua!=ca&&null!=qa&&(ka&&la!=qa.getCenterX()<P.getCenterX()||!ka&&la!=qa.getCenterY()<P.getCenterY())&&mxUtils.intersects(X,qa)&&(k=10+Math.max(k,-(Math.min(X.x+X.width,qa.x+qa.width)-Math.max(X.x,qa.x))/T),U=10+Math.max(U,(Math.min(X.y+X.height,qa.y+qa.height)-Math.max(X.y,qa.y))/T))}}ka?U=0:k=0;for(va=0;va<Z.length;va++)if(ua=t.model.getTerminal(Z[va],!1),I==H(ua)&&(qa=t.view.getState(ua),ua!=ca&&null!=qa&&(ka&&la!=qa.getCenterX()<P.getCenterX()||!ka&&la!=qa.getCenterY()<P.getCenterY()))){var Ba=[];t.traverse(qa.cell,!0,function(ya,La){var za=null!=La&&t.isTreeEdge(La);za&&Ba.push(La);(null==La||za)&&Ba.push(ya);return null==La||za});t.moveCells(Ba,-(la?1:-1)*k,(la?1:-1)*U)}}}return t.addCells(B,Q)}finally{t.model.endUpdate()}}function F(ca){t.model.beginUpdate();try{var la=H(ca),Q=t.getIncomingTreeEdges(ca),k=t.cloneCells([Q[0],ca]);t.model.setTerminal(Q[0],k[1],!1);t.model.setTerminal(k[0],k[1],!0);t.model.setTerminal(k[0],ca,!1);var B=t.model.getParent(ca),I=B.geometry,U=[];t.view.currentRoot!=B&&(k[1].geometry.x-=I.x,k[1].geometry.y-=I.y);t.traverse(ca,!0,function(X,Z){var ka=null!=Z&&t.isTreeEdge(Z);ka&&U.push(Z);(null==Z||ka)&&U.push(X);-return null==Z||ka});var P=ca.geometry.width+40,T=ca.geometry.height+40;la==mxConstants.DIRECTION_SOUTH?P=0:la==mxConstants.DIRECTION_NORTH?(P=0,T=-T):la==mxConstants.DIRECTION_WEST?(P=-P,T=0):la==mxConstants.DIRECTION_EAST&&(T=0);t.moveCells(U,P,T);return t.addCells(k,B)}finally{t.model.endUpdate()}}function K(ca,la){t.model.beginUpdate();try{var Q=t.model.getParent(ca),k=t.getIncomingTreeEdges(ca),B=H(ca);0==k.length&&(k=[t.createEdge(Q,null,"",null,null,t.createCurrentEdgeStyle())],B=la);var I=+ca]);t.model.setTerminal(B[0],t.model.getTerminal(k[0],!0),!0);var I=G(ca),U=Q.geometry;I==mxConstants.DIRECTION_SOUTH||I==mxConstants.DIRECTION_NORTH?B[1].geometry.x+=la?ca.geometry.width+10:-B[1].geometry.width-10:B[1].geometry.y+=la?ca.geometry.height+10:-B[1].geometry.height-10;t.view.currentRoot!=Q&&(B[1].geometry.x-=U.x,B[1].geometry.y-=U.y);var P=t.view.getState(ca),T=t.view.scale;if(null!=P){var X=mxRectangle.fromRectangle(P);I==mxConstants.DIRECTION_SOUTH||I==mxConstants.DIRECTION_NORTH?+X.x+=(la?ca.geometry.width+10:-B[1].geometry.width-10)*T:X.y+=(la?ca.geometry.height+10:-B[1].geometry.height-10)*T;var Z=t.getOutgoingTreeEdges(t.model.getTerminal(k[0],!0));if(null!=Z){for(var ka=I==mxConstants.DIRECTION_SOUTH||I==mxConstants.DIRECTION_NORTH,va=U=k=0;va<Z.length;va++){var ua=t.model.getTerminal(Z[va],!1);if(I==G(ua)){var qa=t.view.getState(ua);ua!=ca&&null!=qa&&(ka&&la!=qa.getCenterX()<P.getCenterX()||!ka&&la!=qa.getCenterY()<P.getCenterY())&&mxUtils.intersects(X,qa)&&(k=10+Math.max(k,+(Math.min(X.x+X.width,qa.x+qa.width)-Math.max(X.x,qa.x))/T),U=10+Math.max(U,(Math.min(X.y+X.height,qa.y+qa.height)-Math.max(X.y,qa.y))/T))}}ka?U=0:k=0;for(va=0;va<Z.length;va++)if(ua=t.model.getTerminal(Z[va],!1),I==G(ua)&&(qa=t.view.getState(ua),ua!=ca&&null!=qa&&(ka&&la!=qa.getCenterX()<P.getCenterX()||!ka&&la!=qa.getCenterY()<P.getCenterY()))){var Ba=[];t.traverse(qa.cell,!0,function(ya,La){var za=null!=La&&t.isTreeEdge(La);za&&Ba.push(La);(null==La||za)&&Ba.push(ya);return null==La||za});t.moveCells(Ba,+(la?1:-1)*k,(la?1:-1)*U)}}}return t.addCells(B,Q)}finally{t.model.endUpdate()}}function F(ca){t.model.beginUpdate();try{var la=G(ca),Q=t.getIncomingTreeEdges(ca),k=t.cloneCells([Q[0],ca]);t.model.setTerminal(Q[0],k[1],!1);t.model.setTerminal(k[0],k[1],!0);t.model.setTerminal(k[0],ca,!1);var B=t.model.getParent(ca),I=B.geometry,U=[];t.view.currentRoot!=B&&(k[1].geometry.x-=I.x,k[1].geometry.y-=I.y);t.traverse(ca,!0,function(X,Z){var ka=null!=Z&&t.isTreeEdge(Z);ka&&U.push(Z);(null==Z||ka)&&U.push(X);+return null==Z||ka});var P=ca.geometry.width+40,T=ca.geometry.height+40;la==mxConstants.DIRECTION_SOUTH?P=0:la==mxConstants.DIRECTION_NORTH?(P=0,T=-T):la==mxConstants.DIRECTION_WEST?(P=-P,T=0):la==mxConstants.DIRECTION_EAST&&(T=0);t.moveCells(U,P,T);return t.addCells(k,B)}finally{t.model.endUpdate()}}function K(ca,la){t.model.beginUpdate();try{var Q=t.model.getParent(ca),k=t.getIncomingTreeEdges(ca),B=G(ca);0==k.length&&(k=[t.createEdge(Q,null,"",null,null,t.createCurrentEdgeStyle())],B=la);var I=t.cloneCells([k[0],ca]);t.model.setTerminal(I[0],ca,!0);null==t.model.getTerminal(I[0],!1)&&(t.model.setTerminal(I[0],I[1],!1),t.applyNewEdgeStyle(I[1],[I[0]],B));k=t.getOutgoingTreeEdges(ca);var U=Q.geometry;la=[];t.view.currentRoot==Q&&(U=new mxRectangle);for(var P=0;P<k.length;P++){var T=t.model.getTerminal(k[P],!1);null!=T&&la.push(T)}var X=t.view.getBounds(la),Z=t.view.translate,ka=t.view.scale;B==mxConstants.DIRECTION_SOUTH?(I[1].geometry.x=null==X?ca.geometry.x+(ca.geometry.width-I[1].geometry.width)/2:(X.x+X.width)/ka-Z.x-U.x+10,I[1].geometry.y+=I[1].geometry.height-U.y+40):B==mxConstants.DIRECTION_NORTH?(I[1].geometry.x=null==X?ca.geometry.x+(ca.geometry.width-I[1].geometry.width)/2:(X.x+X.width)/ka-Z.x+-U.x+10,I[1].geometry.y-=I[1].geometry.height+U.y+40):(I[1].geometry.x=B==mxConstants.DIRECTION_WEST?I[1].geometry.x-(I[1].geometry.width+U.x+40):I[1].geometry.x+(I[1].geometry.width-U.x+40),I[1].geometry.y=null==X?ca.geometry.y+(ca.geometry.height-I[1].geometry.height)/2:(X.y+X.height)/ka-Z.y+-U.y+10);return t.addCells(I,Q)}finally{t.model.endUpdate()}}function c(ca,la,Q){ca=t.getOutgoingTreeEdges(ca);Q=t.view.getState(Q);var k=[];if(null!=Q&&null!=ca){for(var B=0;B<ca.length;B++){var I=t.view.getState(t.model.getTerminal(ca[B],!1));null!=I&&(!la&&Math.min(I.x+I.width,Q.x+Q.width)>=Math.max(I.x,Q.x)||la&&Math.min(I.y+I.height,Q.y+Q.height)>=Math.max(I.y,Q.y))&&k.push(I)}k.sort(function(U,P){return la?U.x+U.width-P.x-P.width:U.y+U.height-P.y-P.height})}return k}function f(ca,la){var Q=-H(ca),k=la==mxConstants.DIRECTION_EAST||la==mxConstants.DIRECTION_WEST;(Q==mxConstants.DIRECTION_EAST||Q==mxConstants.DIRECTION_WEST)==k&&Q!=la?l.actions.get("selectParent").funct():Q==la?(la=t.getOutgoingTreeEdges(ca),null!=la&&0<la.length&&t.setSelectionCell(t.model.getTerminal(la[0],!1))):(Q=t.getIncomingTreeEdges(ca),null!=Q&&0<Q.length&&(k=c(t.model.getTerminal(Q[0],!0),k,ca),ca=t.view.getState(ca),null!=ca&&(ca=mxUtils.indexOf(k,ca),0<=ca&&(ca+=la==mxConstants.DIRECTION_NORTH||la==mxConstants.DIRECTION_WEST?+G(ca),k=la==mxConstants.DIRECTION_EAST||la==mxConstants.DIRECTION_WEST;(Q==mxConstants.DIRECTION_EAST||Q==mxConstants.DIRECTION_WEST)==k&&Q!=la?l.actions.get("selectParent").funct():Q==la?(la=t.getOutgoingTreeEdges(ca),null!=la&&0<la.length&&t.setSelectionCell(t.model.getTerminal(la[0],!1))):(Q=t.getIncomingTreeEdges(ca),null!=Q&&0<Q.length&&(k=c(t.model.getTerminal(Q[0],!0),k,ca),ca=t.view.getState(ca),null!=ca&&(ca=mxUtils.indexOf(k,ca),0<=ca&&(ca+=la==mxConstants.DIRECTION_NORTH||la==mxConstants.DIRECTION_WEST?-1:1,0<=ca&&ca<=k.length-1&&t.setSelectionCell(k[ca].cell)))))}var l=this,t=l.editor.graph,q=t.getModel(),D=l.menus.createPopupMenu;l.menus.createPopupMenu=function(ca,la,Q){D.apply(this,arguments);if(1==t.getSelectionCount()){la=t.getSelectionCell();var k=t.getOutgoingTreeEdges(la);ca.addSeparator();0<k.length&&(m(t.getSelectionCell())&&this.addMenuItems(ca,["selectChildren"],null,Q),this.addMenuItems(ca,["selectDescendants"],null,Q));m(t.getSelectionCell())?(ca.addSeparator(),0<t.getIncomingTreeEdges(la).length&&this.addMenuItems(ca,["selectSiblings","selectParent"],null,Q)):0<t.model.getEdgeCount(la)&&this.addMenuItems(ca,["selectConnections"],null,Q)}};l.actions.addAction("selectChildren",function(ca){if(t.isEnabled()&&1==t.getSelectionCount()){var la=t.getSelectionCell();ca=mxEvent.isControlDown(ca)?null:t.getOutgoingTreeEdges(la);if(null!=ca&&0<ca.length){la=[];for(var Q=0;Q<ca.length;Q++)la.push(t.model.getTerminal(ca[Q],!1));t.setSelectionCells(la)}else t.setSelectionCells(t.model.getChildren(la))}},null,null,"Alt+Shift+C");l.actions.addAction("selectDescendants",function(ca){var la=t.getSelectionCell();if(t.isEnabled()&&null!=la){var Q=[];mxEvent.isControlDown(ca)||t.traverse(la,!0,function(k,B){var I=null!=B&&t.isTreeEdge(B);I&&mxEvent.isControlDown(ca)&&Q.push(B);(null==B||I)&&Q.push(k);return null==B||I});if(0==Q.length||1==Q.length&&Q[0]==la)Q=t.model.getDescendants(la);t.setSelectionCells(Q)}},null,null,"Alt+Shift+X");l.actions.addAction("selectParent",function(ca){var la=t.getSelectionCell();t.isEnabled()&&null!=la&&(ca=mxEvent.isControlDown(ca)?null:t.getIncomingTreeEdges(la),null!=ca&&0<ca.length?t.setSelectionCell(t.model.getTerminal(ca[0],!0)):t.selectParentCell())},null,null,"Alt+Shift+P");l.actions.addAction("selectSiblings",function(ca){if(t.isEnabled()&&1==t.getSelectionCount()){var la=t.getSelectionCell(),Q=mxEvent.isControlDown(ca)?null:t.getIncomingTreeEdges(la);ca=[];if(null!=Q&&0<Q.length&&(Q=t.getOutgoingTreeEdges(t.model.getTerminal(Q[0],!0)),null!=Q))for(var k=0;k<Q.length;k++)ca.push(t.model.getTerminal(Q[k],-!1));0==ca.length&&(ca=t.model.getChildren(t.model.getParent(la)));t.setSelectionCells(ca)}},null,null,"Alt+Shift+S");var G=t.removeCells;t.removeCells=function(ca,la){la=null!=la?la:!0;null==ca&&(ca=this.getDeletableCells(this.getSelectionCells()));la&&(ca=this.getDeletableCells(this.addAllEdges(ca)));for(var Q=[],k=0;k<ca.length;k++){var B=ca[k];q.isEdge(B)&&p(B)&&(Q.push(B),B=q.getTerminal(B,!1));if(m(B)){var I=[];t.traverse(B,!0,function(U,P){var T=null!=P&&t.isTreeEdge(P);T&&I.push(P);(null==-P||T)&&I.push(U);return null==P||T});0<I.length&&(Q=Q.concat(I),B=t.getIncomingTreeEdges(ca[k]),ca=ca.concat(B))}else null!=B&&Q.push(ca[k])}ca=Q;return G.apply(this,arguments)};l.hoverIcons.getStateAt=function(ca,la,Q){return m(ca.cell)?null:this.graph.view.getState(this.graph.getCellAt(la,Q))};var N=t.duplicateCells;t.duplicateCells=function(ca,la){ca=null!=ca?ca:this.getSelectionCells();for(var Q=ca.slice(0),k=0;k<Q.length;k++){var B=t.view.getState(Q[k]);if(null!=B&&m(B.cell)){var I=t.getIncomingTreeEdges(B.cell);+!1));0==ca.length&&(ca=t.model.getChildren(t.model.getParent(la)));t.setSelectionCells(ca)}},null,null,"Alt+Shift+S");var H=t.removeCells;t.removeCells=function(ca,la){la=null!=la?la:!0;null==ca&&(ca=this.getDeletableCells(this.getSelectionCells()));la&&(ca=this.getDeletableCells(this.addAllEdges(ca)));for(var Q=[],k=0;k<ca.length;k++){var B=ca[k];q.isEdge(B)&&n(B)&&(Q.push(B),B=q.getTerminal(B,!1));if(m(B)){var I=[];t.traverse(B,!0,function(U,P){var T=null!=P&&t.isTreeEdge(P);T&&I.push(P);(null==+P||T)&&I.push(U);return null==P||T});0<I.length&&(Q=Q.concat(I),B=t.getIncomingTreeEdges(ca[k]),ca=ca.concat(B))}else null!=B&&Q.push(ca[k])}ca=Q;return H.apply(this,arguments)};l.hoverIcons.getStateAt=function(ca,la,Q){return m(ca.cell)?null:this.graph.view.getState(this.graph.getCellAt(la,Q))};var N=t.duplicateCells;t.duplicateCells=function(ca,la){ca=null!=ca?ca:this.getSelectionCells();for(var Q=ca.slice(0),k=0;k<Q.length;k++){var B=t.view.getState(Q[k]);if(null!=B&&m(B.cell)){var I=t.getIncomingTreeEdges(B.cell);for(B=0;B<I.length;B++)mxUtils.remove(I[B],ca)}}this.model.beginUpdate();try{var U=N.call(this,ca,la);if(U.length==ca.length)for(k=0;k<ca.length;k++)if(m(ca[k])){var P=t.getIncomingTreeEdges(U[k]);I=t.getIncomingTreeEdges(ca[k]);if(0==P.length&&0<I.length){var T=this.cloneCell(I[0]);this.addEdge(T,t.getDefaultParent(),this.model.getTerminal(I[0],!0),U[k])}}}finally{this.model.endUpdate()}return U};var L=t.moveCells;t.moveCells=function(ca,la,Q,k,B,I,U){for(var P=null,T=[],X=0;X<ca.length;X++)(v(ca[X])||m(ca[X]))&&!A(ca[X])&&this.isCellCollapsed(ca[X])?T=T.concat(this.getSubtree(ca[X])):T.push(ca[X]);ca=mxUtils.removeDuplicates(T);this.model.beginUpdate();try{T=B;var Z=this.getCurrentCellStyle(B);if(null!=ca&&m(B)&&"1"==mxUtils.getValue(Z,"treeFolding","0")){for(X=0;X<ca.length;X++)if(m(ca[X])||t.model.isEdge(ca[X])&&null==t.model.getTerminal(ca[X],!0)){B=t.model.getParent(ca[X]);break}if(null!=T&&B!=T&&null!=this.view.getState(ca[0])){var ka=t.getIncomingTreeEdges(ca[0]);if(0<ka.length){var va=t.view.getState(t.model.getTerminal(ka[0],!0));if(null!=va){var ua=t.view.getState(T);null!=ua&&(la=(ua.getCenterX()-va.getCenterX())/t.view.scale,Q=(ua.getCenterY()-va.getCenterY())/t.view.scale)}}}}P=L.apply(this,arguments);if(null!=P&&null!=ca&&P.length==ca.length)for(X=0;X<P.length;X++)if(this.model.isEdge(P[X]))m(T)&&0>mxUtils.indexOf(P,this.model.getTerminal(P[X],!0))&&this.model.setTerminal(P[X],T,!0);else if(m(ca[X])&&(ka=t.getIncomingTreeEdges(ca[X]),0<ka.length))if(!k)m(T)&&0>mxUtils.indexOf(ca,@@ -4109,29 +4111,29 @@ this.model.getTerminal(ka[0],!0))&&this.model.setTerminal(ka[0],T,!0);else if(0=null==B.getTerminal(I[U],!0)){B.setTerminal(I[U],ca,!0);var P=t.getCellGeometry(I[U]);P.points=null;null!=P.getTerminalPoint(!0)&&P.setTerminalPoint(null,!0)}}finally{B.endUpdate()}return I}}var Y={67:l.actions.get("selectChildren"),88:l.actions.get("selectDescendants"),80:l.actions.get("selectParent"),83:l.actions.get("selectSiblings")},ha={67:l.actions.get("copyStyle"),86:l.actions.get("pasteStyle")},ea=l.onKeyDown;l.onKeyDown=function(ca){try{var la=t.getSelectionCell();if(t.isEnabled()&&!t.isEditing()&&null!=la){var Q=mxEvent.isAltDown(ca)&&mxEvent.isShiftDown(ca)?Y[ca.keyCode]:mxEvent.isAltDown(ca)?ha[ca.keyCode]:null;null!=Q?(Q.funct(ca),mxEvent.consume(ca)):m(la)&&(Q=null,0<t.getIncomingTreeEdges(la).length&&(9==ca.which?Q=mxEvent.isShiftDown(ca)?F(la):K(la):13==ca.which&&(Q=S(la,!mxEvent.isShiftDown(ca)))),null!=Q&&0<Q.length?(1==Q.length&&t.model.isEdge(Q[0])?t.setSelectionCell(t.model.getTerminal(Q[0],!1)):t.setSelectionCell(Q[Q.length-1]),null!=l.hoverIcons&&l.hoverIcons.update(t.view.getState(la)),t.startEditingAtCell(la),mxEvent.consume(ca)):37==ca.keyCode?(f(la,mxConstants.DIRECTION_WEST),mxEvent.consume(ca)):38==ca.keyCode?(f(la,mxConstants.DIRECTION_NORTH),mxEvent.consume(ca)):39==ca.keyCode?(f(la,mxConstants.DIRECTION_EAST),mxEvent.consume(ca)):40==ca.keyCode&&(f(la,mxConstants.DIRECTION_SOUTH),mxEvent.consume(ca)))}}catch(k){l.handleError(k)}mxEvent.isConsumed(ca)||ea.apply(this,arguments)};var aa=t.connectVertex;t.connectVertex=function(ca,la,Q,k,B,I,U){var P=t.getIncomingTreeEdges(ca);-if(m(ca)){var T=H(ca),X=T==mxConstants.DIRECTION_EAST||T==mxConstants.DIRECTION_WEST,Z=la==mxConstants.DIRECTION_EAST||la==mxConstants.DIRECTION_WEST;return T==la||0==P.length?K(ca,la):X==Z?F(ca):S(ca,la!=mxConstants.DIRECTION_NORTH&&la!=mxConstants.DIRECTION_WEST)}return aa.apply(this,arguments)};t.getSubtree=function(ca){var la=[ca];!v(ca)&&!m(ca)||A(ca)||t.traverse(ca,!0,function(Q,k){var B=null!=k&&t.isTreeEdge(k);B&&0>mxUtils.indexOf(la,k)&&la.push(k);(null==k||B)&&0>mxUtils.indexOf(la,Q)&&la.push(Q);+if(m(ca)){var T=G(ca),X=T==mxConstants.DIRECTION_EAST||T==mxConstants.DIRECTION_WEST,Z=la==mxConstants.DIRECTION_EAST||la==mxConstants.DIRECTION_WEST;return T==la||0==P.length?K(ca,la):X==Z?F(ca):S(ca,la!=mxConstants.DIRECTION_NORTH&&la!=mxConstants.DIRECTION_WEST)}return aa.apply(this,arguments)};t.getSubtree=function(ca){var la=[ca];!v(ca)&&!m(ca)||A(ca)||t.traverse(ca,!0,function(Q,k){var B=null!=k&&t.isTreeEdge(k);B&&0>mxUtils.indexOf(la,k)&&la.push(k);(null==k||B)&&0>mxUtils.indexOf(la,Q)&&la.push(Q);return null==k||B});return la};var na=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){na.apply(this,arguments);(v(this.state.cell)||m(this.state.cell))&&!A(this.state.cell)&&0<this.graph.getOutgoingTreeEdges(this.state.cell).length&&!this.graph.isCellCollapsed(this.state.cell)?null==this.moveHandle&&(this.moveHandle=mxUtils.createImage(Editor.moveImage),this.moveHandle.setAttribute("title","Move Subtree"),this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="24px",this.moveHandle.style.height="24px",this.graph.container.appendChild(this.moveHandle),this.redrawMoveHandle(),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(ca){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(ca),mxEvent.getClientY(ca),this.graph.getSubtree(this.state.cell));this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(ca);this.graph.isMouseDown=!0;l.hoverIcons.reset();mxEvent.consume(ca)}))):null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)};var W=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){W.apply(this,arguments);this.redrawMoveHandle()};mxVertexHandler.prototype.redrawMoveHandle=function(){null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var ba=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(ca){ba.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.display=ca?"":"none")};var ja=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(ca,la){ja.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var g=Sidebar.prototype.createAdvancedShapes;-Sidebar.prototype.createAdvancedShapes=function(){var m=g.apply(this,arguments),v=this.graph,p=this;return m.concat([this.addEntry("tree container",function(){var A=new mxCell("Tree Container",new mxGeometry(0,0,400,320),"swimlane;startSize=20;horizontal=1;containerType=tree;");A.vertex=!0;var H=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');H.vertex=!0;var S=-new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');S.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");F.geometry.relative=!0;F.edge=!0;H.insertEdge(F,!0);S.insertEdge(F,!1);A.insert(F);A.insert(H);A.insert(S);return p.createVertexTemplateFromCells([A],-A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var A=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;startSize=20;horizontal=1;containerType=tree;");A.vertex=!0;var H=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-H.vertex=!0;var S=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');S.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");-F.geometry.relative=!0;F.edge=!0;H.insertEdge(F,!0);S.insertEdge(F,!1);var K=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-K.vertex=!0;var c=new mxCell("",new mxGeometry(0,0,0,0),F.style);c.geometry.relative=!0;c.edge=!0;H.insertEdge(c,!0);K.insertEdge(c,!1);var f=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-f.vertex=!0;var l=new mxCell("",new mxGeometry(0,0,0,0),F.style);l.geometry.relative=!0;l.edge=!0;H.insertEdge(l,!0);f.insertEdge(l,!1);var t=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-t.vertex=!0;var q=new mxCell("",new mxGeometry(0,0,0,0),F.style);q.geometry.relative=!0;q.edge=!0;H.insertEdge(q,!0);t.insertEdge(q,!1);A.insert(F);A.insert(c);A.insert(l);A.insert(q);A.insert(H);A.insert(S);A.insert(K);A.insert(f);A.insert(t);return p.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var A=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};treeFolding=1;treeMoving=1;');-A.vertex=!0;return p.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps branch",function(){var A=new mxCell("Branch",new mxGeometry(0,0,80,20),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;recursiveResize=0;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');-A.vertex=!0;var H=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");H.geometry.setTerminalPoint(new mxPoint(-40,40),!0);H.geometry.relative=!0;H.edge=!0;A.insertEdge(H,!1);return p.createVertexTemplateFromCells([A,H],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps sub topic",function(){var A=new mxCell("Sub Topic",new mxGeometry(0,0,80,26),-'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');A.vertex=!0;var H=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");-H.geometry.setTerminalPoint(new mxPoint(-40,40),!0);H.geometry.relative=!0;H.edge=!0;A.insertEdge(H,!1);return p.createVertexTemplateFromCells([A,H],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree orgchart organization division",function(){var A=new mxCell("Orgchart",new mxGeometry(0,0,280,220),'swimlane;startSize=20;horizontal=1;containerType=tree;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');A.vertex=!0;var H=new mxCell("Organization",new mxGeometry(80,-40,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');v.setAttributeForCell(H,"treeRoot","1");H.vertex=!0;var S=new mxCell("Division",new mxGeometry(20,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');S.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");-F.geometry.relative=!0;F.edge=!0;H.insertEdge(F,!0);S.insertEdge(F,!1);var K=new mxCell("Division",new mxGeometry(160,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');K.vertex=!0;var c=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");c.geometry.relative=-!0;c.edge=!0;H.insertEdge(c,!0);K.insertEdge(c,!1);A.insert(F);A.insert(c);A.insert(H);A.insert(S);A.insert(K);return p.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree root",function(){var A=new mxCell("Organization",new mxGeometry(0,0,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');v.setAttributeForCell(A,"treeRoot","1");A.vertex=!0;return p.createVertexTemplateFromCells([A],-A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree division",function(){var A=new mxCell("Division",new mxGeometry(20,40,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');A.vertex=!0;var H=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");-H.geometry.setTerminalPoint(new mxPoint(0,0),!0);H.geometry.relative=!0;H.edge=!0;A.insertEdge(H,!1);return p.createVertexTemplateFromCells([A,H],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree sub sections",function(){var A=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");A.vertex=!0;var H=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;curved=0;rounded=0;");-H.geometry.setTerminalPoint(new mxPoint(110,-40),!0);H.geometry.relative=!0;H.edge=!0;A.insertEdge(H,!1);var S=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");S.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),H.style);F.geometry.setTerminalPoint(new mxPoint(110,-40),!0);F.geometry.relative=!0;F.edge=!0;S.insertEdge(F,!1);return p.createVertexTemplateFromCells([H,F,A,S],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;+Sidebar.prototype.createAdvancedShapes=function(){var m=g.apply(this,arguments),v=this.graph,n=this;return m.concat([this.addEntry("tree container",function(){var A=new mxCell("Tree Container",new mxGeometry(0,0,400,320),"swimlane;startSize=20;horizontal=1;containerType=tree;");A.vertex=!0;var G=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');G.vertex=!0;var S=+new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');S.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");F.geometry.relative=!0;F.edge=!0;G.insertEdge(F,!0);S.insertEdge(F,!1);A.insert(F);A.insert(G);A.insert(S);return n.createVertexTemplateFromCells([A],+A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var A=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;startSize=20;horizontal=1;containerType=tree;");A.vertex=!0;var G=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+G.vertex=!0;var S=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');S.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");+F.geometry.relative=!0;F.edge=!0;G.insertEdge(F,!0);S.insertEdge(F,!1);var K=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+K.vertex=!0;var c=new mxCell("",new mxGeometry(0,0,0,0),F.style);c.geometry.relative=!0;c.edge=!0;G.insertEdge(c,!0);K.insertEdge(c,!1);var f=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+f.vertex=!0;var l=new mxCell("",new mxGeometry(0,0,0,0),F.style);l.geometry.relative=!0;l.edge=!0;G.insertEdge(l,!0);f.insertEdge(l,!1);var t=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+t.vertex=!0;var q=new mxCell("",new mxGeometry(0,0,0,0),F.style);q.geometry.relative=!0;q.edge=!0;G.insertEdge(q,!0);t.insertEdge(q,!1);A.insert(F);A.insert(c);A.insert(l);A.insert(q);A.insert(G);A.insert(S);A.insert(K);A.insert(f);A.insert(t);return n.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var A=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};treeFolding=1;treeMoving=1;');+A.vertex=!0;return n.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps branch",function(){var A=new mxCell("Branch",new mxGeometry(0,0,80,20),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;recursiveResize=0;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');+A.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");G.geometry.setTerminalPoint(new mxPoint(-40,40),!0);G.geometry.relative=!0;G.edge=!0;A.insertEdge(G,!1);return n.createVertexTemplateFromCells([A,G],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree mindmap mindmaps sub topic",function(){var A=new mxCell("Sub Topic",new mxGeometry(0,0,80,26),+'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');A.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");+G.geometry.setTerminalPoint(new mxPoint(-40,40),!0);G.geometry.relative=!0;G.edge=!0;A.insertEdge(G,!1);return n.createVertexTemplateFromCells([A,G],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree orgchart organization division",function(){var A=new mxCell("Orgchart",new mxGeometry(0,0,280,220),'swimlane;startSize=20;horizontal=1;containerType=tree;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');A.vertex=!0;var G=new mxCell("Organization",new mxGeometry(80,+40,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');v.setAttributeForCell(G,"treeRoot","1");G.vertex=!0;var S=new mxCell("Division",new mxGeometry(20,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');S.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");+F.geometry.relative=!0;F.edge=!0;G.insertEdge(F,!0);S.insertEdge(F,!1);var K=new mxCell("Division",new mxGeometry(160,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');K.vertex=!0;var c=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");c.geometry.relative=+!0;c.edge=!0;G.insertEdge(c,!0);K.insertEdge(c,!1);A.insert(F);A.insert(c);A.insert(G);A.insert(S);A.insert(K);return n.createVertexTemplateFromCells([A],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree root",function(){var A=new mxCell("Organization",new mxGeometry(0,0,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');v.setAttributeForCell(A,"treeRoot","1");A.vertex=!0;return n.createVertexTemplateFromCells([A],+A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree division",function(){var A=new mxCell("Division",new mxGeometry(20,40,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');A.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");+G.geometry.setTerminalPoint(new mxPoint(0,0),!0);G.geometry.relative=!0;G.edge=!0;A.insertEdge(G,!1);return n.createVertexTemplateFromCells([A,G],A.geometry.width,A.geometry.height,A.value)}),this.addEntry("tree sub sections",function(){var A=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");A.vertex=!0;var G=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;curved=0;rounded=0;");+G.geometry.setTerminalPoint(new mxPoint(110,-40),!0);G.geometry.relative=!0;G.edge=!0;A.insertEdge(G,!1);var S=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");S.vertex=!0;var F=new mxCell("",new mxGeometry(0,0,0,0),G.style);F.geometry.setTerminalPoint(new mxPoint(110,-40),!0);F.geometry.relative=!0;F.edge=!0;S.insertEdge(F,!1);return n.createVertexTemplateFromCells([G,F,A,S],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;EditorUi.initMinimalTheme=function(){function b(K,c){if(EditorUi.windowed){var f=K.editor.graph;f.popupMenuHandler.hideMenu();null==K.formatWindow?(K.formatWindow=new WrapperWindow(K,"",Math.max(10,K.diagramContainer.clientWidth-248),60,240,Math.min(566,f.container.clientHeight-10),function(l){l.className="geSidebarContainer geFormatContainer";K.createFormat(l).init()}),K.dependsOnLanguage(mxUtils.bind(this,function(){K.formatWindow.window.setTitle(mxResources.get("format"))})),K.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){K.formatWindow.window.fit()})),K.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80)):K.formatWindow.window.setVisible(null!=c?c:!K.formatWindow.window.isVisible())}else null==K.formatElt&&(K.formatElt=K.createSidebarContainer(),K.createFormat(K.formatElt).init(),K.formatElt.style.border="none",K.formatElt.style.width="240px",K.formatElt.style.borderLeftWidth="1px",K.formatElt.style.borderLeftStyle="solid",K.formatElt.style.right="0px"),c=K.diagramContainer.parentNode,null!=K.formatElt.parentNode?(K.formatElt.parentNode.removeChild(K.formatElt),c.style.right="0px"):(c.parentNode.appendChild(K.formatElt),c.style.right=K.formatElt.style.width)}function e(K,c){if(EditorUi.windowed){var f=K.editor.graph;f.popupMenuHandler.hideMenu();null==K.sidebarWindow?(K.sidebarWindow=new WrapperWindow(K,"",10,56,Math.min(f.container.clientWidth-10,218)-6,Math.min(f.container.clientHeight-40,650)-6,function(l){K.createShapesPanel(l)}),K.dependsOnLanguage(mxUtils.bind(this,function(){K.sidebarWindow.window.setTitle(mxResources.get("shapes"))})),@@ -4140,41 +4142,41 @@ K.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){K.sdocument.body.clientWidth}catch(K){}Menus.prototype.autoPopup=!1;mxConstraintHandler.prototype.pointImage=Graph.createSvgImage(5,5,'<path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke-width="2" style="stroke-opacity:0.4" stroke="#ffffff"/><path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke="#29b6f2"/>');mxOutline.prototype.sizerImage=null;mxConstants.VERTEX_SELECTION_COLOR="#C0C0C0";mxConstants.EDGE_SELECTION_COLOR="#C0C0C0";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.DEFAULT_VALID_COLOR="#29b6f2";mxConstants.GUIDE_COLOR="#C0C0C0";mxConstants.OUTLINE_COLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#fff";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowSize="0.6";Graph.prototype.svgShadowBlur="1.2";mxRubberband.prototype.defaultOpacity=50;HoverIcons.prototype.inactiveOpacity=25;EditorUi.prototype.closableScratchpad=!1;Graph.prototype.editAfterInsert=!mxClient.IS_IOS&&!mxClient.IS_ANDROID;Editor.prototype.isChromelessView=function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var m=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){m.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var v=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(K,c){null!=c.shortcut&&900>g&&!mxClient.IS_IOS?K.firstChild.nextSibling.setAttribute("title",c.shortcut):v.apply(this,arguments)};EditorUi.prototype.toggleFormatPanel=-function(K){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=K?K:!this.formatWindow.window.isVisible()):b(this)};EditorUi.prototype.isFormatPanelVisible=function(){return null!=this.formatWindow&&this.formatWindow.window.isVisible()||null==this.formatWindow&&0<this.formatWidth};var p=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.destroyWindows();p.apply(this,arguments)};var A=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(K){A.apply(this,-arguments);if(K){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=c&&null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=c&&this.formatWindow.window.setVisible(!0)}else null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1)};EditorUi.prototype.chromelessWindowResize=function(){};var H=Menus.prototype.init;Menus.prototype.init=function(){H.apply(this,+function(K){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=K?K:!this.formatWindow.window.isVisible()):b(this)};EditorUi.prototype.isFormatPanelVisible=function(){return null!=this.formatWindow&&this.formatWindow.window.isVisible()||null==this.formatWindow&&0<this.formatWidth};var n=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.destroyWindows();n.apply(this,arguments)};var A=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(K){A.apply(this,+arguments);if(K){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=c&&null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=c&&this.formatWindow.window.setVisible(!0)}else null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1)};EditorUi.prototype.chromelessWindowResize=function(){};var G=Menus.prototype.init;Menus.prototype.init=function(){G.apply(this,arguments);var K=this.editorUi;EditorUi.enablePlantUml&&!K.isOffline()&&K.actions.put("plantUml",new Action("plantUml...",function(){var l=new ParseDialog(K,mxResources.get("plantUml")+"...","plantUml");K.showDialog(l.container,620,420,!0,!1);l.init()}));K.actions.put("mermaid",new Action("mermaid...",function(){var l=new ParseDialog(K,mxResources.get("mermaid")+"...","mermaid");K.showDialog(l.container,620,420,!0,!1);l.init()}));var c="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),-f=function(l,t,q,D){l.addItem(q,null,mxUtils.bind(this,function(){var G=new CreateGraphDialog(K,q,D);K.showDialog(G.container,620,420,!0,!1);G.init()}),t)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(l,t){for(var q=0;q<c.length;q++)"-"==c[q]?l.addSeparator(t):f(l,t,mxResources.get(c[q])+"...",c[q])})))};EditorUi.prototype.installFormatToolbar=function(K){var c=this.editor.graph,f=document.createElement("div");f.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";+f=function(l,t,q,D){l.addItem(q,null,mxUtils.bind(this,function(){var H=new CreateGraphDialog(K,q,D);K.showDialog(H.container,620,420,!0,!1);H.init()}),t)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(l,t){for(var q=0;q<c.length;q++)"-"==c[q]?l.addSeparator(t):f(l,t,mxResources.get(c[q])+"...",c[q])})))};EditorUi.prototype.installFormatToolbar=function(K){var c=this.editor.graph,f=document.createElement("div");f.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";c.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(l,t){0<c.getSelectionCount()?(K.appendChild(f),f.innerHTML="Selected: "+c.getSelectionCount()):null!=f.parentNode&&f.parentNode.removeChild(f)}))};var S=!1;EditorUi.prototype.initFormatWindow=function(){if(!S&&null!=this.formatWindow){S=!0;var K=this.formatWindow.window.toggleMinimized,c=240;this.formatWindow.window.toggleMinimized=function(){K.apply(this,arguments);this.minimized?(c=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+c-140+"px"):(this.div.style.width=c+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-c+140)+"px");this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(f){mxEvent.getSource(f)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var F=EditorUi.prototype.init;EditorUi.prototype.init=-function(){function K(B,I,U){var P=q.menus.get(B);I=N.addMenu(mxResources.get(B),mxUtils.bind(this,function(){P.funct.apply(this,arguments)}));I.className="geButton";I.setAttribute("title",mxResources.get(B));q.menus.menuCreated(P,I,"geButton");null!=U&&(I.style.backgroundImage="url("+U+")",I.innerText="");return I}function c(B,I,U,P,T,X){var Z=document.createElement("a");Z.className="geButton";G.appendChild(Z);null!=X?Z.style.backgroundImage="url("+X+")":mxUtils.write(Z,B);mxEvent.addListener(Z,-"click",function(ka){"disabled"!=Z.getAttribute("disabled")&&I(ka);mxEvent.consume(ka)});mxEvent.preventDefault(Z);null!=P&&Z.setAttribute("title",P);null!=T&&(B=function(){T.isEnabled()?Z.removeAttribute("disabled"):Z.setAttribute("disabled","disabled")},T.addListener("stateChanged",B),D.addListener("enabledChanged",B),B());return Z}function f(B,I,U){I=document.createElement("div");I.className="geButtonGroup";for(U=0;U<B.length;U++)null!=B[U]&&I.appendChild(B[U]);G.appendChild(I);return I}function l(){g=-window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;G.innerHTML="";var B=1E3>g,I=K("diagram",null,B?Editor.menuImage:null);f([I,c(mxResources.get("shapes"),q.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),q.actions.get("image"),B?Editor.shapesImage:null),c(mxResources.get("format"),q.actions.get("format").funct,null,mxResources.get("format")+" ("+q.actions.get("format").shortcut+")",q.actions.get("image"),B?Editor.formatImage:null)]);I=K("insert",!0,+function(){function K(B,I,U){var P=q.menus.get(B);I=N.addMenu(mxResources.get(B),mxUtils.bind(this,function(){P.funct.apply(this,arguments)}));I.className="geButton";I.setAttribute("title",mxResources.get(B));q.menus.menuCreated(P,I,"geButton");null!=U&&(I.style.backgroundImage="url("+U+")",I.innerText="");return I}function c(B,I,U,P,T,X){var Z=document.createElement("a");Z.className="geButton";H.appendChild(Z);null!=X?Z.style.backgroundImage="url("+X+")":mxUtils.write(Z,B);mxEvent.addListener(Z,+"click",function(ka){"disabled"!=Z.getAttribute("disabled")&&I(ka);mxEvent.consume(ka)});mxEvent.preventDefault(Z);null!=P&&Z.setAttribute("title",P);null!=T&&(B=function(){T.isEnabled()?Z.removeAttribute("disabled"):Z.setAttribute("disabled","disabled")},T.addListener("stateChanged",B),D.addListener("enabledChanged",B),B());return Z}function f(B,I,U){I=document.createElement("div");I.className="geButtonGroup";for(U=0;U<B.length;U++)null!=B[U]&&I.appendChild(B[U]);H.appendChild(I);return I}function l(){g=+window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;H.innerHTML="";var B=1E3>g,I=K("diagram",null,B?Editor.menuImage:null);f([I,c(mxResources.get("shapes"),q.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),q.actions.get("image"),B?Editor.shapesImage:null),c(mxResources.get("format"),q.actions.get("format").funct,null,mxResources.get("format")+" ("+q.actions.get("format").shortcut+")",q.actions.get("image"),B?Editor.formatImage:null)]);I=K("insert",!0,B?ea:null);f([I,c(mxResources.get("delete"),q.actions.get("delete").funct,null,mxResources.get("delete"),q.actions.get("delete"),B?Editor.trashImage:null)]);D.isEnabled()||I.setAttribute("disabled","disabled");la.setAttribute("title",mxResources.get("undo")+" ("+ja.shortcut+")");Q.setAttribute("title",mxResources.get("redo")+" ("+ca.shortcut+")");k.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");411<=g&&(f([la,Q]),520<=g&&f([k,640<=g?c("",W.funct,!0,mxResources.get("zoomIn")+-" ("+Editor.ctrlKey+" +)",W,Editor.zoomInImage):null,640<=g?c("",ba.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",ba,Editor.zoomOutImage):null]));G.appendChild(q.statusContainer);G.appendChild(q.buttonContainer)}F.apply(this,arguments);var t=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=t&&(t.classList.add("geSimple"),t.classList.add("geMinimal"),t.classList.remove("geClassic"));this.sidebar=this.createSidebar(this.sidebarContainer);-if(1E3<=g||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])e(this,!0),null!=this.sidebar&&null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search"));EditorUi.windowed&&1E3<=g&&(b(this,!0),this.formatWindow.window.setVisible(!0));var q=this,D=q.editor.graph;q.toolbar=this.createToolbar(q.createDiv("geToolbar"));var G=document.createElement("div");G.className="geMenubarContainer";-var N=new Menubar(q,G),L=q.hideCurrentMenu;q.hideCurrentMenu=function(){L.apply(this,arguments);this.editor.graph.popupMenuHandler.hideMenu()};var J=q.descriptorChanged;q.descriptorChanged=function(){J.apply(this,arguments);var B=q.getCurrentFile();if(null!=B&&null!=B.getTitle()){var I=B.getMode();"google"==I?I="googleDrive":"github"==I?I="gitHub":"gitlab"==I?I="gitLab":"onedrive"==I&&(I="oneDrive");I=mxResources.get(I);G.setAttribute("title",B.getTitle()+(null!=I?" ("+I+")":""))}else G.removeAttribute("title")};-q.setStatusText(q.editor.getStatus());G.appendChild(q.statusContainer);q.buttonContainer=this.createButtonContainer();G.appendChild(q.buttonContainer);q.menubarContainer=q.buttonContainer;q.tabContainer=this.createTabContainer();var Y=this.createZoomInput(!0),ha=q.updateTabContainer;q.updateTabContainer=function(){ha.apply(this,arguments);q.tabContainer.appendChild(Y)};var ea=Editor.addBoxImage;if(null!=q.hoverIcons){var aa=q.hoverIcons.update;q.hoverIcons.update=function(){D.freehand.isDrawing()||+" ("+Editor.ctrlKey+" +)",W,Editor.zoomInImage):null,640<=g?c("",ba.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",ba,Editor.zoomOutImage):null]));H.appendChild(q.statusContainer);H.appendChild(q.buttonContainer)}F.apply(this,arguments);var t=mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=t&&(t.classList.add("geSimple"),t.classList.add("geMinimal"),t.classList.remove("geClassic"));this.sidebar=this.createSidebar(this.sidebarContainer);+if(1E3<=g||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])e(this,!0),null!=this.sidebar&&null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search"));EditorUi.windowed&&1E3<=g&&(b(this,!0),this.formatWindow.window.setVisible(!0));var q=this,D=q.editor.graph;q.toolbar=this.createToolbar(q.createDiv("geToolbar"));var H=document.createElement("div");H.className="geMenubarContainer";+var N=new Menubar(q,H),L=q.hideCurrentMenu;q.hideCurrentMenu=function(){L.apply(this,arguments);this.editor.graph.popupMenuHandler.hideMenu()};var J=q.descriptorChanged;q.descriptorChanged=function(){J.apply(this,arguments);var B=q.getCurrentFile();if(null!=B&&null!=B.getTitle()){var I=B.getMode();"google"==I?I="googleDrive":"github"==I?I="gitHub":"gitlab"==I?I="gitLab":"onedrive"==I&&(I="oneDrive");I=mxResources.get(I);H.setAttribute("title",B.getTitle()+(null!=I?" ("+I+")":""))}else H.removeAttribute("title")};+q.setStatusText(q.editor.getStatus());H.appendChild(q.statusContainer);q.buttonContainer=this.createButtonContainer();H.appendChild(q.buttonContainer);q.menubarContainer=q.buttonContainer;q.tabContainer=this.createTabContainer();var Y=this.createZoomInput(!0),ha=q.updateTabContainer;q.updateTabContainer=function(){ha.apply(this,arguments);q.tabContainer.appendChild(Y)};var ea=Editor.addBoxImage;if(null!=q.hoverIcons){var aa=q.hoverIcons.update;q.hoverIcons.update=function(){D.freehand.isDrawing()||aa.apply(this,arguments)}}if(null!=D.freehand){var na=D.freehand.createStyle;D.freehand.createStyle=function(B){return na.apply(this,arguments)+"sketch=0;"}}q.editor.addListener("statusChanged",mxUtils.bind(this,function(){q.setStatusText(q.editor.getStatus())}));q.setStatusText(q.editor.getStatus());var W=q.actions.get("zoomIn"),ba=q.actions.get("zoomOut");t=q.actions.get("resetView");var ja=q.actions.get("undo"),ca=q.actions.get("redo"),la=c("",ja.funct,null,"",ja,Editor.undoImage),Q=c("",ca.funct,-null,"",ca,Editor.redoImage),k=c("",function(B){mxEvent.isAltDown(B)?(q.hideCurrentMenu(),q.actions.get("customZoom").funct()):(q.hideCurrentMenu(),q.actions.get("smartFit").funct());mxEvent.consume(B)},!0,"",t,Editor.zoomFitImage);q.container.appendChild(q.tabContainer);q.container.appendChild(G);q.updateTabContainer();!EditorUi.windowed&&1E3<=g&&b(this,!0);l();q.addListener("lockedChanged",l);q.addListener("languageChanged",l);q.editor.graph.addListener("enabledChanged",l);mxEvent.addListener(window,+null,"",ca,Editor.redoImage),k=c("",function(B){mxEvent.isAltDown(B)?(q.hideCurrentMenu(),q.actions.get("customZoom").funct()):(q.hideCurrentMenu(),q.actions.get("smartFit").funct());mxEvent.consume(B)},!0,"",t,Editor.zoomFitImage);q.container.appendChild(q.tabContainer);q.container.appendChild(H);q.updateTabContainer();!EditorUi.windowed&&1E3<=g&&b(this,!0);l();q.addListener("lockedChanged",l);q.addListener("languageChanged",l);q.editor.graph.addListener("enabledChanged",l);mxEvent.addListener(window,"resize",function(){l();null!=q.sidebarWindow&&q.sidebarWindow.window.fit();null!=q.formatWindow&&q.formatWindow.window.fit();null!=q.actions.outlineWindow&&q.actions.outlineWindow.window.fit();null!=q.actions.layersWindow&&q.actions.layersWindow.window.fit();null!=q.menus.chatWindow&&q.menus.chatWindow.window.fit();null!=q.menus.tagsWindow&&q.menus.tagsWindow.window.fit();null!=q.menus.findWindow&&q.menus.findWindow.window.fit();null!=q.menus.findReplaceWindow&&q.menus.findReplaceWindow.window.fit()})}}};-(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var e=EditorUi.initTheme;EditorUi.initTheme=function(){e.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();DrawioComment=function(b,e,g,m,v,p,A){this.file=b;this.id=e;this.content=g;this.modifiedDate=m;this.createdDate=v;this.isResolved=p;this.user=A;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,e,g,m,v){e()};DrawioComment.prototype.editComment=function(b,e,g){e()};DrawioComment.prototype.deleteComment=function(b,e){b()};DrawioUser=function(b,e,g,m,v){this.id=b;this.email=e;this.displayName=g;this.pictureUrl=m;this.locale=v};mxResources.parse('# *DO NOT DIRECTLY EDIT THIS FILE, IT IS AUTOMATICALLY GENERATED AND IT IS BASED ON:*\n# https://docs.google.com/spreadsheet/ccc?key=0AmQEO36liL4FdDJLWVNMaVV2UmRKSnpXU09MYkdGbEE\nabout=About\naboutDrawio=About draw.io\naccessDenied=Access Denied\naccounts=Accounts\naction=Action\nactualSize=Actual Size\nadaptiveColors=Adaptive Colors\nadd=Add\naddAccount=Add account\naddedFile=Added {1}\naddImages=Add Images\naddImageUrl=Add Image URL\naddLayer=Add Layer\naddProperty=Add Property\naddress=Address\naddToExistingDrawing=Add to Existing Drawing\naddToScratchpad=Add to Scratchpad\naddWaypoint=Add Waypoint\nadjustTo=Adjust to\nadvanced=Advanced\nsmartTemplate=Smart Template\nalign=Align\nalignment=Alignment\nallChangesLost=All changes will be lost!\nallPages=All Pages\nallProjects=All Projects\nallSpaces=All Spaces\nallTags=All Tags\nanchor=Anchor\nandroid=Android\nangle=Angle\nanimations=Animations\narc=Arc\nareYouSure=Are you sure?\nensureDataSaved=Please ensure your data is saved before closing.\nallChangesSaved=All changes saved\nallChangesSavedInDrive=All changes saved in Drive\nallowPopups=Allow pop-ups to avoid this dialog.\nallowRelativeUrl=Allow relative URL\nalreadyConnected=Nodes already connected\nappearance=Appearance\napply=Apply\narchiMate21=ArchiMate 2.1\narrange=Arrange\narrow=Arrow\narrows=Arrows\naskMeAnything=Ask me anything\nasNew=As New\natlas=Atlas\nauthor=Author\nauthorizationRequired=Authorization required\nauthorizeThisAppIn=Authorize this app in {1}:\nauthorize=Authorize\nauthorizing=Authorizing\nautomatic=Automatic\nautosave=Autosave\nautosize=Autosize\nattachments=Attachments\naws=AWS\naws3d=AWS 3D\nazure=Azure\nback=Back\nbackground=Background\nbackgroundColor=Background Color\nbackgroundImage=Background Image\nbasic=Basic\nbeta=beta\nblankDrawing=Blank Drawing\nblankDiagram=Blank Diagram\nblock=Block\nblockquote=Blockquote\nblog=Blog\nbold=Bold\nbootstrap=Bootstrap\nborder=Border\nborderColor=Border Color\nborderWidth=Border Width\nbottom=Bottom\nbottomAlign=Bottom Align\nbottomLeft=Bottom Left\nbottomRight=Bottom Right\nbpmn=BPMN\nbringForward=Bring Forward\nbrowser=Browser\nbulletedList=Bulleted List\nbusiness=Business\nbusy=Operation in progress\ncabinets=Cabinets\ncancel=Cancel\ncenter=Center\ncannotLoad=Load attempts failed. Please try again later.\ncannotLogin=Log in attempts failed. Please try again later.\ncannotOpenFile=Cannot open file\nchange=Change\nchangeOrientation=Change Orientation\nchangeUser=Change user\nchangeStorage=Change storage\nchangesNotSaved=Changes have not been saved\nclassDiagram=Class Diagram\nuserJoined={1} has joined\nuserLeft={1} has left\nchatWindowTitle=Chat\nchooseAnOption=Choose an option\nchromeApp=Chrome App\ncollaborativeEditingNotice=Important Notice for Collaborative Editing\ncompare=Compare\ncompressed=Compressed\ncommitMessage=Commit Message\nconfigLinkWarn=This link configures draw.io. Only click OK if you trust whoever gave you it!\nconfigLinkConfirm=Click OK to configure and restart draw.io.\ncontainer=Container\ncsv=CSV\ndark=Dark\ndiagramLanguage=Diagram Language\ndiagramType=Diagram type\ndiagramXmlDesc=XML File\ndiagramHtmlDesc=HTML File\ndiagramPngDesc=Editable Bitmap Image\ndiagramSvgDesc=Editable Vector Image\ndidYouMeanToExportToPdf=Did you mean to export to PDF?\ndisabled=Disabled\ndraftFound=A draft for \'{1}\' has been found. Load it into the editor or discard it to continue.\ndraftRevisionMismatch=There is a different version of this diagram on a shared draft of this page. Please edit the diagram from the draft to ensure you are working with the latest version.\nselectDraft=Select a draft to continue editing:\ndragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?\ndropboxCharsNotAllowed=The following characters are not allowed: / : ? * " |\ncheck=Check\nchecksum=Checksum\ncircle=Circle\ncisco=Cisco\nclassic=Classic\nclearDefaultStyle=Clear Default Style\nclearWaypoints=Clear Waypoints\nclipart=Clipart\nclose=Close\nclosingFile=Closing file\nrealtimeCollaboration=Real-Time Collaboration\ncollaborate=Collaborate\ncollaborator=Collaborator\ncollaborators=Collaborators\ncollapse=Collapse\ncollapseExpand=Collapse/Expand\ncollapse-expand=Click to collapse/expand\nShift-click to move neighbors \nAlt-click to protect group size\ncollapsible=Collapsible\ncomic=Comic\ncomment=Comment\ncommentsNotes=Comments/Notes\ncompress=Compress\nconfiguration=Configuration\nconnect=Connect\nconnecting=Connecting\nconnectWithDrive=Connect with Google Drive\nconnection=Connection\nconnectionArrows=Connection Arrows\nconnectionPoints=Connection Points\nconstrainProportions=Constrain Proportions\ncontainsValidationErrors=Contains validation errors\ncopiedToClipboard=Copied to clipboard\ncopy=Copy\ncopyConnect=Copy on connect\ncopyCreated=A copy of the file was created.\ncopyData=Copy Data\ncopyOf=Copy of {1}\ncopyOfDrawing=Copy of Drawing\ncopySize=Copy Size\ncopyStyle=Copy Style\ncreate=Create\ncreateBlankDiagram=Create Blank Diagram\ncreateNewDiagram=Create New Diagram\ncreateRevision=Create Revision\ncreateShape=Create Shape\ncrop=Crop\ncurved=Curved\ncustom=Custom\ncurrent=Current\ncurrentPage=Current page\ncut=Cut\ndashed=Dashed\ndecideLater=Decide later\ndefault=Default\ndelete=Delete\ndeleteAll=Delete all\ndeleteColumn=Delete column\ndeleteLibrary401=Insufficient permissions to delete this library\ndeleteLibrary404=Selected library could not be found\ndeleteLibrary500=Error deleting library\ndeleteLibraryConfirm=You are about to permanently delete this library. Are you sure you want to do this?\ndeleteRow=Delete Row\ndescription=Description\ndescribeYourDiagram=Describe your diagram\ndevice=Device\ndiagram=Diagram\ndiagramContent=Diagram Content\ndiagramLocked=Diagram has been locked to prevent further data loss.\ndiagramLockedBySince=The diagram is locked by {1} since {2} ago\ndiagramName=Diagram Name\ndiagramIsPublic=Diagram is public\ndiagramIsNotPublic=Diagram is not public\ndiamond=Diamond\ndiamondThin=Diamond (thin)\ndidYouKnow=Did you know...\ndirection=Direction\ndiscard=Discard\ndiscardChangesAndReconnect=Discard Changes and Reconnect\ngoogleDriveMissingClickHere=Google Drive missing? Click here!\ndiscardChanges=Discard Changes\ndisconnected=Disconnected\ndistribute=Distribute\ndone=Done\ndoNotShowAgain=Do not show again\ndotted=Dotted\ndoubleClickOrientation=Doubleclick to change orientation\ndoubleClickTooltip=Doubleclick to insert text\ndoubleClickChangeProperty=Doubleclick to change property name\ndownload=Download\ndownloadDesktop=Get Desktop\ndownloadAs=Download as\nclickHereToSave=Click here to save.\ndpi=DPI\ndraftDiscarded=Draft discarded\ndraftSaved=Draft saved\ndragElementsHere=Drag elements here\ndragImagesHere=Drag images or URLs here\ndragUrlsHere=Drag URLs here\ndraw.io=draw.io\ndrawing=Drawing{1}\ndrawingEmpty=Drawing is empty\ndrawingTooLarge=Drawing is too large\ndrawioForWork=Draw.io for GSuite\ndropbox=Dropbox\nduplicate=Duplicate\nduplicateIt=Duplicate {1}\ndivider=Divider\ndx=Dx\ndy=Dy\neast=East\nedit=Edit\neditData=Edit Data\neditDiagram=Edit Diagram\neditGeometry=Edit Geometry\neditImage=Edit Image\neditImageUrl=Edit Image URL\neditLink=Edit Link\neditShape=Edit Shape\neditStyle=Edit Style\neditText=Edit Text\neditTooltip=Edit Tooltip\nglass=Glass\ngoogleImages=Google Images\nimageSearch=Image Search\neip=EIP\nembed=Embed\nembedFonts=Embed Fonts\nembedImages=Embed Images\nmainEmbedNotice=Paste this into the page\nelectrical=Electrical\nellipse=Ellipse\nembedNotice=Paste this once at the end of the page\nenterGroup=Enter Group\nenterName=Enter Name\nenterPropertyName=Enter Property Name\nenterValue=Enter Value\nentityRelation=Entity Relation\nentityRelationshipDiagram=Entity Relationship Diagram\nerror=Error\nerrorDeletingFile=Error deleting file\nerrorLoadingFile=Error loading file\nerrorRenamingFile=Error renaming file\nerrorRenamingFileNotFound=Error renaming file. File was not found.\nerrorRenamingFileForbidden=Error renaming file. Insufficient access rights.\nerrorSavingDraft=Error saving draft\nerrorSavingFile=Error saving file\nerrorSavingFileUnknown=Error authorizing with Google\'s servers. Please refresh the page to re-attempt.\nerrorSavingFileForbidden=Error saving file. Insufficient access rights.\nerrorSavingFileNameConflict=Could not save diagram. Current page already contains file named \'{1}\'.\nerrorSavingFileNotFound=Error saving file. File was not found.\nerrorSavingFileReadOnlyMode=Could not save diagram while read-only mode is active.\nerrorSavingFileSessionTimeout=Your session has ended. Please <a target=\'_blank\' href=\'{1}\'>{2}</a> and return to this tab to try to save again.\nerrorSendingFeedback=Error sending feedback.\nerrorUpdatingPreview=Error updating preview.\nexit=Exit\nexitGroup=Exit Group\nexpand=Expand\nexplore=Explore\nexport=Export\nexporting=Exporting\nexportAs=Export as\nexportOptionsDisabled=Export options disabled\nexportOptionsDisabledDetails=The owner has disabled options to download, print or copy for commenters and viewers on this file.\nexternalChanges=External Changes\nextras=Extras\nfacebook=Facebook\nfailedToSaveTryReconnect=Failed to save, trying to reconnect\nfeatureRequest=Feature Request\nfeedback=Feedback\nfeedbackSent=Feedback successfully sent.\nfloorplans=Floorplans\nfile=File\nfileChangedOverwriteDialog=The file has been modified. Do you want to save the file and overwrite those changes?\nfileChangedSyncDialog=The file has been modified.\nfileChangedSync=The file has been modified. Click here to synchronize.\noverwrite=Overwrite\nsynchronize=Synchronize\nfilename=Filename\nfileExists=File already exists\nfileMovedToTrash=File was moved to trash\nfileNearlyFullSeeFaq=File nearly full, please see FAQ\nfileNotFound=File not found\nrepositoryNotFound=Repository not found\nfileNotFoundOrDenied=The file was not found. It does not exist or you do not have access.\nfileNotLoaded=File not loaded\nfileNotSaved=File not saved\nfileOpenLocation=How would you like to open these file(s)?\nfiletypeHtml=.html causes file to save as HTML with redirect to cloud URL\nfiletypePng=.png causes file to save as PNG with embedded data\nfiletypeSvg=.svg causes file to save as SVG with embedded data\nfileWillBeSavedInAppFolder={1} will be saved in the app folder.\nfill=Fill\nfillColor=Fill Color\nfilterCards=Filter Cards\nfind=Find\nfit=Fit\nfitContainer=Resize Container\nfitIntoContainer=Fit into Container\nfitPage=Fit Page\nfitPageWidth=Fit Page Width\nfitTo=Fit to\nfitToSheetsAcross=sheet(s) across\nfitToBy=by\nfitToSheetsDown=sheet(s) down\nfitTwoPages=Two Pages\nfitWindow=Fit Window\nflip=Flip\nflipH=Flip Horizontal\nflipV=Flip Vertical\nflowAnimation=Flow Animation\nflowchart=Flowchart\nfolder=Folder\nfont=Font\nfontColor=Font Color\nfontFamily=Font Family\nfontSize=Font Size\nforbidden=You are not authorized to access this file\nformat=Format\nformatPanel=Format Panel\nformatted=Formatted\nformattedText=Formatted Text\nformatPng=PNG\nformatGif=GIF\nformatJpg=JPEG\nformatPdf=PDF\nformatSql=SQL\nformatSvg=SVG\nformatHtmlEmbedded=HTML\nformatSvgEmbedded=SVG (with XML)\nformatVsdx=VSDX\nformatVssx=VSSX\nformatWebp=WebP\nformatXmlPlain=XML (Plain)\nformatXml=XML\nforum=Discussion/Help Forums\nfreehand=Freehand\nfromTemplate=From Template\nfromTemplateUrl=From Template URL\nfromText=From Text\nfromUrl=From URL\nfromThisPage=From this page\nfullscreen=Fullscreen\ngap=Gap\ngcp=GCP\ngeneral=General\ngetNotionChromeExtension=Get the Notion Chrome Extension\ngithub=GitHub\ngitlab=GitLab\ngliffy=Gliffy\nglobal=Global\ngoogleDocs=Google Docs\ngoogleDrive=Google Drive\ngoogleGadget=Google Gadget\ngoogleSharingNotAvailable=Sharing is only available via Google Drive. Please click Open below and share from the more actions menu:\ngoogleSlides=Google Slides\ngoogleSites=Google Sites\ngoogleSheets=Google Sheets\ngradient=Gradient\ngradientColor=Color\ngrid=Grid\ngridColor=Grid Color\ngridSize=Grid Size\ngroup=Group\nguides=Guides\nhateApp=I hate draw.io\nheading=Heading\nheight=Height\nhelp=Help\nhelpTranslate=Help us translate this application\nhide=Hide\nhideIt=Hide {1}\nhidden=Hidden\nhighContrast=High Contrast\nhome=Home\nhorizontal=Horizontal\nhorizontalFlow=Horizontal Flow\nhorizontalTree=Horizontal Tree\nhowTranslate=How good is the translation in your language?\nhtml=HTML\nhtmlText=HTML Text\nid=ID\niframe=IFrame\nignore=Ignore\nimage=Image\nimageUrl=Image URL\nimages=Images\nimagePreviewError=This image couldn\'t be loaded for preview. Please check the URL.\nimageTooBig=Image too big\nimgur=Imgur\nimport=Import\nimportFrom=Import from\nimproveContrast=Improve Contrast\nincludeCopyOfMyDiagram=Include a copy of my diagram\nincreaseIndent=Increase Indent\ndecreaseIndent=Decrease Indent\ninsert=Insert\ninsertColumnBefore=Insert Column Left\ninsertColumnAfter=Insert Column Right\ninsertEllipse=Insert Ellipse\ninsertImage=Insert Image\ninsertHorizontalRule=Insert Horizontal Rule\ninsertLink=Insert Link\ninsertPage=Insert Page\ninsertRectangle=Insert Rectangle\ninsertRhombus=Insert Rhombus\ninsertRowBefore=Insert Row Above\ninsertRowAfter=Insert Row After\ninsertText=Insert Text\ninserting=Inserting\ninstallApp=Install App\ninvalidFilename=Diagram names must not contain the following characters: / | : ; { } < > & + ? = "\ninvalidLicenseSeeThisPage=Your license is invalid, please see this <a target="_blank" href="https://www.drawio.com/doc/faq/license-drawio-confluence-jira-cloud">page</a>.\ninvalidInput=Invalid input\ninvalidName=Invalid name\ninvalidOrMissingFile=Invalid or missing file\ninvalidPublicUrl=Invalid public URL\nisometric=Isometric\nios=iOS\nitalic=Italic\nkennedy=Kennedy\nkeyboardShortcuts=Keyboard Shortcuts\nlabels=Labels\nlayers=Layers\nlandscape=Landscape\nlanguage=Language\nleanMapping=Lean Mapping\nlastChange=Last change {1} ago\nlessThanAMinute=less than a minute\nlicensingError=Licensing Error\nlicenseHasExpired=The license for {1} has expired on {2}. Click here.\nlicenseRequired=This feature requires draw.io to be licensed.\nlicenseWillExpire=The license for {1} will expire on {2}. Click here.\nlight=Light\nlineJumps=Line jumps\nlinkAccountRequired=If the diagram is not public a Google account is required to view the link.\nlinkText=Link Text\nlist=List\nminute=minute\nminutes=minutes\nhours=hours\ndays=days\nmonths=months\nyears=years\nrestartForChangeRequired=Changes will take effect after a restart of the application.\nlaneColor=Lanecolor\nlanguageCode=Language Code\nlastModified=Last modified\nlayout=Layout\nleft=Left\nleftAlign=Left Align\nleftToRight=Left to right\nlibraryTooltip=Drag and drop shapes here or click + to insert. Double click to edit.\nlightbox=Lightbox\nline=Line\nlineend=Line end\nlineheight=Line Height\nlinestart=Line start\nlinewidth=Linewidth\nlink=Link\nlinks=Links\nloading=Loading\nlocked=Locked\nlockUnlock=Lock/Unlock\nloggedOut=Logged Out\nlogIn=log in\nloveIt=I love {1}\nlucidchart=Lucidchart\nmaps=Maps\nmathematicalTypesetting=Mathematical Typesetting\nmakeCopy=Make a Copy\nmanual=Manual\nmerge=Merge\nmermaid=Mermaid\nmicrosoftOffice=Microsoft Office\nmicrosoftExcel=Microsoft Excel\nmicrosoftPowerPoint=Microsoft PowerPoint\nmicrosoftWord=Microsoft Word\nmiddle=Middle\nminimal=Minimal\nmisc=Misc\nmockups=Mockups\nmodern=Modern\nmodificationDate=Modification date\nmodifiedBy=Modified by\nmore=More\nmoreResults=More Results\nmoreShapes=More Shapes\nmove=Move\nmoveToFolder=Move to Folder\nmoving=Moving\nmoveSelectionTo=Move selection to {1}\nmyDrive=My Drive\nmyFiles=My Files\nname=Name\nnavigation=Navigation\nnetwork=Network\nnetworking=Networking\nnew=New\nnewLibrary=New Library\nnextPage=Next Page\nno=No\nnoPickFolder=No, pick folder\nnoAttachments=No attachments found\nnoColor=No Color\nnoFiles=No Files\nnoFileSelected=No file selected\nnoLibraries=No libraries found\nnoMoreResults=No more results\nnone=None\nnoOtherViewers=No other viewers\nnoPlugins=No plugins\nnoPreview=No preview\nnoResponse=No response from server\nnoResultsFor=No results for \'{1}\'\nnoRevisions=No revisions\nnoSearchResults=No search results found\nnoPageContentOrNotSaved=No anchors found on this page or it hasn\'t been saved yet\nnormal=Normal\nnorth=North\nnotADiagramFile=Not a diagram file\nnotALibraryFile=Not a library file\nnotAvailable=Not available\nnotAUtf8File=Not a UTF-8 file\nnotConnected=Not connected\nnote=Note\nnotion=Notion\nnotSatisfiedWithImport=Not satisfied with the import?\nnotUsingService=Not using {1}?\nnumberedList=Numbered list\noffline=Offline\nok=OK\noneDrive=OneDrive\nonline=Online\nopacity=Opacity\nopen=Open\nopenArrow=Open Arrow\nopenExistingDiagram=Open Existing Diagram\nopenFile=Open File\nopenFrom=Open from\nopenLibrary=Open Library\nopenLibraryFrom=Open Library from\nopenLink=Open Link\nopenInNewWindow=Open in New Window\nopenInThisWindow=Open in This Window\nopenIt=Open {1}\nopenRecent=Open Recent\nopenSupported=Supported formats are files saved from this software (.xml), .vsdx and .gliffy\noptions=Options\norganic=Organic\norgChart=Org Chart\northogonal=Orthogonal\notherViewer=other viewer\notherViewers=other viewers\noutline=Outline\noval=Oval\npage=Page\npageContent=Page Content\npageNotFound=Page not found\npageWithNumber=Page-{1}\npages=Pages\npageTabs=Page Tabs\npageView=Page View\npageSetup=Page Setup\npageScale=Page Scale\npan=Pan\npanTooltip=Space+Drag to pan\npaperSize=Paper Size\npattern=Pattern\nparallels=Parallels\npaste=Paste\npasteData=Paste Data\npasteHere=Paste here\npasteSize=Paste Size\npasteStyle=Paste Style\nperimeter=Perimeter\npermissionAnyone=Anyone can edit\npermissionAuthor=Owner and admins can edit\npickFolder=Pick a folder\npickLibraryDialogTitle=Select Library\npublicDiagramUrl=Public URL of the diagram\nplaceholders=Placeholders\nplantUml=PlantUML\nplugins=Plugins\npluginUrl=Plugin URL\npluginWarning=The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n\nplusTooltip=Click to connect and clone (ctrl+click to clone, shift+click to connect). Drag to connect (ctrl+drag to clone).\nportrait=Portrait\nposition=Position\nposterPrint=Poster Print\npreferences=Preferences\npreview=Preview\npreviousPage=Previous Page\npresentationMode=Presentation Mode\nprint=Print\nprocEng=Proc. Eng.\nproject=Project\npriority=Priority\nprocessForHiringNewEmployee=Process for hiring a new employee\nproperties=Properties\npublish=Publish\nquickStart=Quick Start Video\nrack=Rack\nradial=Radial\nradialTree=Radial Tree\nreadOnly=Read-only\nreconnecting=Reconnecting\nrecentlyUpdated=Recently Updated\nrecentlyViewed=Recently Viewed\nrectangle=Rectangle\nredirectToNewApp=This file was created or modified in a newer version of this app. You will be redirected now.\nrealtimeTimeout=It looks like you\'ve made a few changes while offline. We\'re sorry, these changes cannot be saved.\nredo=Redo\nrefresh=Refresh\nregularExpression=Regular Expression\nrelative=Relative\nrelativeUrlNotAllowed=Relative URL not allowed\nrememberMe=Remember me\nrememberThisSetting=Remember this setting\nremoveFormat=Clear Formatting\nremoveFromGroup=Remove from Group\nremoveIt=Remove {1}\nremoveWaypoint=Remove Waypoint\nrename=Rename\nrenamed=Renamed\nrenameIt=Rename {1}\nrenaming=Renaming\nreplace=Replace\nreplaceIt={1} already exists. Do you want to replace it?\nreplaceExistingDrawing=Replace existing drawing\nrequired=required\nrequirementDiagram=Requirement Diagram\nreset=Reset\nresetView=Reset View\nresize=Resize\nresizeLargeImages=Do you want to resize large images to make the application run faster?\nretina=Retina\nresponsive=Responsive\nrestore=Restore\nrestoring=Restoring\nretryingIn=Retrying in {1} second(s)\nretryingLoad=Load failed. Retrying...\nretryingLogin=Login time out. Retrying...\nreverse=Reverse\nrevision=Revision\nrevisionHistory=Revision History\nrhombus=Rhombus\nright=Right\nrightAlign=Right Align\nrightToLeft=Right to left\nrotate=Rotate\nrotateTooltip=Click and drag to rotate, click to turn shape only by 90 degrees\nrotation=Rotation\nrounded=Rounded\nsave=Save\nsaveAndExit=Save & Exit\nsaveAs=Save As\nsaveAsXmlFile=Save as XML file?\nsaved=Saved\nsaveDiagramFirst=Please save the diagram first\nsaveDiagramsTo=Save diagrams to\nsaveLibrary403=Insufficient permissions to edit this library\nsaveLibrary500=There was an error while saving the library\nsaveLibraryReadOnly=Could not save library while read-only mode is active\nsaving=Saving\nscratchpad=Scratchpad\nscrollbars=Scrollbars\nsearch=Search\nsearchShapes=Search Shapes\nselectAll=Select All\nselectionOnly=Selection Only\nselectCard=Select Card\nselectEdges=Select Edges\nselectedPage=Selected Page\nselectFile=Select File\nselectFolder=Select Folder\nselectFont=Select Font\nselectNone=Select None\nselectTemplate=Select Template\nselectVertices=Select Vertices\nsendBackward=Send Backward\nsendMessage=Send\nsendYourFeedback=Send your feedback\nsequenceDiagram=Sequence Diagram\nserviceUnavailableOrBlocked=Service unavailable or blocked\nsessionExpired=Your session has expired. Please refresh the browser window.\nsessionTimeoutOnSave=Your session has timed out and you have been disconnected from the Google Drive. Press OK to login and save.\nsetAsDefaultStyle=Set as Default Style\nsettings=Settings\nshadow=Shadow\nshape=Shape\nshapes=Shapes\nshare=Share\nshareCursor=Share Mouse Cursor\nshareLink=Link for shared editing\nsharingAvailable=Sharing available for Google Drive and OneDrive files.\nsaveItToGoogleDriveToCollaborate=You\'ll need to save "{1}" to Google Drive before you can collaborate.\nsaveToGoogleDrive=Save to Google Drive\nsharp=Sharp\nshow=Show\nshowRemoteCursors=Show Remote Mouse Cursors\nshowStartScreen=Show Start Screen\nsidebarTooltip=Click or drag and drop shapes. Shift+click to change selection. Alt+click to insert and connect.\nsigns=Signs\nsignOut=Sign out\nsimple=Simple\nsimpleArrow=Simple Arrow\nsimpleViewer=Simple Viewer\nsize=Size\nsketch=Sketch\nsmoothing=Smoothing\nsnapToGrid=Snap to Grid\nsolid=Solid\nsourceSpacing=Source Spacing\nsouth=South\nsoftware=Software\nspace=Space\nspacing=Spacing\nspecialLink=Special Link\nstateDiagram=State Diagram\nstandard=Standard\nstartDrawing=Start drawing\nstopDrawing=Stop drawing\nstarting=Starting\nstraight=Straight\nstrikethrough=Strikethrough\nstrokeColor=Line Color\nstyle=Style\nsubscript=Subscript\nsummary=Summary\nsuperscript=Superscript\nsupport=Support\nswap=Swap\nswimlaneDiagram=Swimlane Diagram\nsysml=SysML\ntags=Tags\ntable=Table\ntables=Tables\ntakeOver=Take Over\ntargetSpacing=Target Spacing\ntemplate=Template\ntemplates=Templates\ntext=Text\ntextAlignment=Text Alignment\ntextOpacity=Text Opacity\ntheme=Theme\ntimeout=Timeout\ntitle=Title\nto=to\ntoBack=To Back\ntoFront=To Front\ntooLargeUseDownload=Too large, use download instead.\ntoolbar=Toolbar\ntooltips=Tooltips\ntop=Top\ntopAlign=Top Align\ntopLeft=Top Left\ntopRight=Top Right\ntransparent=Transparent\ntransparentBackground=Transparent Background\ntrello=Trello\ntryAgain=Try again\ntryOpeningViaThisPage=Try opening via this page\nturn=Rotate shape only by 90°\ntype=Type\ntwitter=Twitter\numl=UML\nunassigned=Unassigned\nunderline=Underline\nundo=Undo\nungroup=Ungroup\nunmerge=Unmerge\nunsavedChanges=Unsaved changes\nunsavedChangesClickHereToSave=Unsaved changes. Click here to save.\nuntitled=Untitled\nuntitledDiagram=Untitled Diagram\nuntitledLayer=Untitled Layer\nuntitledLibrary=Untitled Library\nunknownError=Unknown error\nunknownUser=Unknown user\nupdateExistingDrawing=Update existing drawing\nupdateFile=Update {1}\nupdatingDocument=Updating Document. Please wait...\nupdatingPreview=Updating Preview. Please wait...\nupdatingSelection=Updating Selection. Please wait...\nupload=Upload\nurl=URL\nuseBlackAndWhite=Use black and white\nuseCurrentSettings=Use current settings\nuseOffline=Use Offline\nuserDefined=User-defined\nuseRootFolder=Use root folder?\nuserManual=User Manual\nvertical=Vertical\nverticalFlow=Vertical Flow\nverticalTree=Vertical Tree\nview=View\nviewerSettings=Viewer Settings\nviewUrl=Link to view: {1}\nvoiceAssistant=Voice Assistant (beta)\nwarning=Warning\nwaypoints=Waypoints\nwest=West\nwhere=Where\nwidth=Width\nwiki=Wiki\nwordWrap=Word Wrap\nwritingDirection=Writing Direction\nyes=Yes\nyourEmailAddress=Your email address\nzoom=Zoom\nzoomIn=Zoom In\nzoomOut=Zoom Out\nbasic=Basic\nbusinessprocess=Business Processes\ncharts=Charts\nengineering=Engineering\nflowcharts=Flowcharts\ngmdl=Material Design\nmindmaps=Mindmaps\nmockups=Mockups\nnetworkdiagrams=Network Diagrams\nnothingIsSelected=Nothing is selected\nother=Other\nsoftwaredesign=Software Design\nvenndiagrams=Venn Diagrams\nwebEmailOrOther=Web, email or any other internet address\nwebLink=Web Link\nwireframes=Wireframes\nproperty=Property\nvalue=Value\nshowMore=Show More\nshowLess=Show Less\nmyDiagrams=My Diagrams\nallDiagrams=All Diagrams\nrecentlyUsed=Recently used\nlistView=List view\ngridView=Grid view\nresultsFor=Results for \'{1}\'\noneDriveCharsNotAllowed=The following characters are not allowed: ~ " # % * : < > ? / { | }\noneDriveInvalidDeviceName=The specified device name is invalid\nofficeNotLoggedOD=You are not logged in to OneDrive. Please open draw.io task pane and login first.\nofficeSelectSingleDiag=Please select a single draw.io diagram only without other contents.\nofficeSelectDiag=Please select a draw.io diagram.\nofficeCannotFindDiagram=Cannot find a draw.io diagram in the selection\nnoDiagrams=No diagrams found\nauthFailed=Authentication failed\nofficeFailedAuthMsg=Unable to successfully authenticate user or authorize application.\nconvertingDiagramFailed=Converting diagram failed\nofficeCopyImgErrMsg=Due to some limitations in the host application, the image could not be inserted. Please manually copy the image then paste it to the document.\ninsertingImageFailed=Inserting image failed\nofficeCopyImgInst=Instructions: Right-click the image below. Select "Copy image" from the context menu. Then, in the document, right-click and select "Paste" from the context menu.\nfolderEmpty=Folder is empty\nrecent=Recent\nsharedWithMe=Shared With Me\nsharepointSites=Sharepoint Sites\nerrorFetchingFolder=Error fetching folder items\nerrorAuthOD=Error authenticating to OneDrive\nofficeMainHeader=Adds draw.io diagrams to your document.\nofficeStepsHeader=This add-in performs the following steps:\nofficeStep1=Connects to Microsoft OneDrive, Google Drive or your device.\nofficeStep2=Select a draw.io diagram.\nofficeStep3=Insert the diagram into the document.\nofficeAuthPopupInfo=Please complete the authentication in the pop-up window.\nofficeSelDiag=Select draw.io Diagram:\nfiles=Files\nshared=Shared\nsharepoint=Sharepoint\nofficeManualUpdateInst=Instructions: Copy draw.io diagram from the document. Then, in the box below, right-click and select "Paste" from the context menu.\nofficeClickToEdit=Click icon to start editing:\npasteDiagram=Paste draw.io diagram here\nconnectOD=Connect to OneDrive\nselectChildren=Select Children\nselectSiblings=Select Siblings\nselectParent=Select Parent\nselectDescendants=Select Descendants\nlastSaved=Last saved {1} ago\nresolve=Resolve\nreopen=Re-open\nshowResolved=Show Resolved\nreply=Reply\nobjectNotFound=Object not found\nreOpened=Re-opened\nmarkedAsResolved=Marked as resolved\nnoCommentsFound=No comments found\ncomments=Comments\ntimeAgo={1} ago\nconfluenceCloud=Confluence Cloud\nlibraries=Libraries\nconfAnchor=Confluence Page Anchor\nconfTimeout=The connection has timed out\nconfSrvTakeTooLong=The server at {1} is taking too long to respond.\nconfCannotInsertNew=Cannot insert draw.io diagram to a new Confluence page\nconfSaveTry=Please save the page and try again.\nconfCannotGetID=Unable to determine page ID\nconfContactAdmin=Please contact your Confluence administrator.\nreadErr=Read Error\neditingErr=Editing Error\nconfExtEditNotPossible=This diagram cannot be edited externally. Please try editing it while editing the page\nconfEditedExt=Diagram/Page edited externally\ndiagNotFound=Diagram Not Found\nconfEditedExtRefresh=Diagram/Page is edited externally. Please refresh the page.\nconfCannotEditDraftDelOrExt=Cannot edit diagrams in a draft page, diagram is deleted from the page, or diagram is edited externally. Please check the page.\nretBack=Return back\nconfDiagNotPublished=The diagram does not belong to a published page\ncreatedByDraw=Created by draw.io\nfilenameShort=Filename too short\ninvalidChars=Invalid characters\nalreadyExst={1} already exists\ndraftReadErr=Draft Read Error\ndiagCantLoad=Diagram cannot be loaded\ndraftWriteErr=Draft Write Error\ndraftCantCreate=Draft could not be created\nconfDuplName=Duplicate diagram name detected. Please pick another name.\nconfSessionExpired=Looks like your session expired. Log in again to keep working.\nlogin=Login\ndrawPrev=draw.io preview\ndrawDiag=draw.io diagram\ninvalidCallFnNotFound=Invalid Call: {1} not found\ninvalidCallErrOccured=Invalid Call: An error occurred, {1}\nanonymous=Anonymous\nconfGotoPage=Go to containing page\nshowComments=Show Comments\nconfError=Error: {1}\ngliffyImport=Gliffy Import\ngliffyImportInst1=Click the "Start Import" button to import all Gliffy diagrams to draw.io.\ngliffyImportInst2=Please note that the import procedure will take some time and the browser window must remain open until the import is completed.\nstartImport=Start Import\ndrawConfig=draw.io Configuration\ncustomLib=Custom Libraries\ncustomTemp=Custom Templates\npageIdsExp=Page IDs Export\ndrawReindex=draw.io re-indexing (beta)\nworking=Working\ndrawConfigNotFoundInst=draw.io Configuration Space (DRAWIOCONFIG) does not exist. This space is needed to store draw.io configuration files and custom libraries/templates.\ncreateConfSp=Create Config Space\nunexpErrRefresh=Unexpected error, please refresh the page and try again.\nconfigJSONInst=Write draw.io JSON configuration in the editor below then click save. If you need help, please refer to\nthisPage=this page\ncurCustLib=Current Custom Libraries\nlibName=Library Name\naction=Action\ndrawConfID=draw.io Config ID\naddLibInst=Click the "Add Library" button to upload a new library.\naddLib=Add Library\ncustomTempInst1=Custom templates are draw.io diagrams saved in children pages of\ncustomTempInst2=For more details, please refer to\ntempsPage=Templates page\npageIdsExpInst1=Select export target, then click the "Start Export" button to export all pages IDs.\npageIdsExpInst2=Please note that the export procedure will take some time and the browser window must remain open until the export is completed.\nstartExp=Start Export\nrefreshDrawIndex=Refresh draw.io Diagrams Index\nreindexInst1=Click the "Start Indexing" button to refresh draw.io diagrams index.\nreindexInst2=Please note that the indexing procedure will take some time and the browser window must remain open until the indexing is completed.\nstartIndexing=Start Indexing\nconfAPageFoundFetch=Page "{1}" found. Fetching\nconfAAllDiagDone=All {1} diagrams processed. Process finished.\nconfAStartedProcessing=Started processing page "{1}"\nconfAAllDiagInPageDone=All {1} diagrams in page "{2}" processed successfully.\nconfAPartialDiagDone={1} out of {2} {3} diagrams in page "{4}" processed successfully.\nconfAUpdatePageFailed=Updating page "{1}" failed.\nconfANoDiagFoundInPage=No {1} diagrams found in page "{2}".\nconfAFetchPageFailed=Fetching the page failed.\nconfANoDiagFound=No {1} diagrams found. Process finished.\nconfASearchFailed=Searching for {1} diagrams failed. Please try again later.\nconfAGliffyDiagFound={2} diagram "{1}" found. Importing\nconfAGliffyDiagImported={2} diagram "{1}" imported successfully.\nconfASavingImpGliffyFailed=Saving imported {2} diagram "{1}" failed.\nconfAImportedFromByDraw=Imported from "{1}" by draw.io\nconfAImportGliffyFailed=Importing {2} diagram "{1}" failed.\nconfAFetchGliffyFailed=Fetching {2} diagram "{1}" failed.\nconfACheckBrokenDiagLnk=Checking for broken diagrams links.\nconfADelDiagLinkOf=Deleting diagram link of "{1}"\nconfADupLnk=(duplicate link)\nconfADelDiagLnkFailed=Deleting diagram link of "{1}" failed.\nconfAUnexpErrProcessPage=Unexpected error during processing the page with id: {1}\nconfADiagFoundIndex=Diagram "{1}" found. Indexing\nconfADiagIndexSucc=Diagram "{1}" indexed successfully.\nconfAIndexDiagFailed=Indexing diagram "{1}" failed.\nconfASkipDiagOtherPage=Skipped "{1}" as it belongs to another page!\nconfADiagUptoDate=Diagram "{1}" is up to date.\nconfACheckPagesWDraw=Checking pages having draw.io diagrams.\nconfAErrOccured=An error occurred!\nsavedSucc=Saved successfully\nconfASaveFailedErr=Saving Failed (Unexpected Error)\ncharacter=Character\nconfAConfPageDesc=This page contains draw.io configuration file (configuration.json) as attachment\nconfALibPageDesc=This page contains draw.io custom libraries as attachments\nconfATempPageDesc=This page contains draw.io custom templates as attachments\nconfAConfSpaceDesc=This space is used to store draw.io configuration files and custom libraries/templates\nconfANoCustLib=No Custom Libraries\ndelFailed=Delete failed!\nshowID=Show ID\nconfAIncorrectLibFileType=Incorrect file type. Libraries should be XML files.\nuploading=Uploading\nconfALibExist=This library already exists\nconfAUploadSucc=Uploaded successfully\nconfAUploadFailErr=Upload Failed (Unexpected Error)\nhiResPreview=High Res Preview\nofficeNotLoggedGD=You are not logged in to Google Drive. Please open draw.io task pane and login first.\nofficePopupInfo=Please complete the process in the pop-up window.\npickODFile=Pick OneDrive File\ncreateODFile=Create OneDrive File\npickGDriveFile=Pick Google Drive File\ncreateGDriveFile=Create Google Drive File\npickDeviceFile=Pick Device File\nvsdNoConfig="vsdurl" is not configured\nruler=Ruler\nunits=Units\npoints=Points\ninches=Inches\nmillimeters=Millimeters\nconfEditDraftDelOrExt=This diagram is in a draft page, is deleted from the page, or is edited externally. It will be saved as a new attachment version and may not be reflected in the page.\nconfDiagEditedExt=Diagram is edited in another session. It will be saved as a new attachment version but the page will show other session\'s modifications.\nmacroNotFound=Macro Not Found\nconfAInvalidPageIdsFormat=Incorrect Page IDs file format\nconfACollectingCurPages=Collecting current pages\nconfABuildingPagesMap=Building pages mapping\nconfAProcessDrawDiag=Started processing imported draw.io diagrams\nconfAProcessDrawDiagDone=Finished processing imported draw.io diagrams\nconfAProcessImpPages=Started processing imported pages\nconfAErrPrcsDiagInPage=Error processing draw.io diagrams in page "{1}"\nconfAPrcsDiagInPage=Processing draw.io diagrams in page "{1}"\nconfAImpDiagram=Importing diagram "{1}"\nconfAImpDiagramFailed=Importing diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\nconfAImpDiagramError=Error importing diagram "{1}". Cannot fetch or save the diagram. Cannot fix this diagram links.\nconfAUpdateDgrmCCFailed=Updating link to diagram "{1}" failed.\nconfImpDiagramSuccess=Updating diagram "{1}" done successfully.\nconfANoLnksInDrgm=No links to update in: {1}\nconfAUpdateLnkToPg=Updated link to page: "{1}" in diagram: "{2}"\nconfAUpdateLBLnkToPg=Updated lightbox link to page: "{1}" in diagram: "{2}"\nconfAUpdateLnkBase=Updated base URL from: "{1}" to: "{2}" in diagram: "{3}"\nconfAPageIdsImpDone=Page IDs Import finished\nconfAPrcsMacrosInPage=Processing draw.io macros in page "{1}"\nconfAErrFetchPage=Error fetching page "{1}"\nconfAFixingMacro=Fixing macro of diagram "{1}"\nconfAErrReadingExpFile=Error reading export file\nconfAPrcsDiagInPageDone=Processing draw.io diagrams in page "{1}" finished\nconfAFixingMacroSkipped=Fixing macro of diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\npageIdsExpTrg=Export target\nconfALucidDiagImgImported={2} diagram "{1}" image extracted successfully\nconfASavingLucidDiagImgFailed=Extracting {2} diagram "{1}" image failed\nconfGetInfoFailed=Fetching file info from {1} failed.\nconfCheckCacheFailed=Cannot get cached file info.\nconfReadFileErr=Cannot read "{1}" file from {2}.\nconfSaveCacheFailed=Unexpected error. Cannot save cached file\norgChartType=Org Chart Type\nlinear=Linear\nhanger2=Hanger 2\nhanger4=Hanger 4\nfishbone1=Fishbone 1\nfishbone2=Fishbone 2\n1ColumnLeft=Single Column Left\n1ColumnRight=Single Column Right\nsmart=Smart\nparentChildSpacing=Parent Child Spacing\nsiblingSpacing=Sibling Spacing\nconfNoPermErr=Sorry, you don\'t have enough permissions to view this embedded diagram from page {1}\ncopyAsImage=Copy as Image\ncopyAsText=Copy as Text\nlucidImport=Lucidchart Import\nlucidImportInst1=Click the "Start Import" button to import all Lucidchart diagrams.\ninstallFirst=Please install {1} first\ndrawioChromeExt=draw.io Chrome Extension\nloginFirstThen=Please login to {1} first, then {2}\nerrFetchDocList=Error: Couldn\'t fetch documents list\nbuiltinPlugins=Built-in Plugins\nextPlugins=External Plugins\nbackupFound=Backup file found\nchromeOnly=This feature only works in Google Chrome\nmsgDeleted=This message has been deleted\nconfAErrFetchDrawList=Error fetching diagrams list. Some diagrams are skipped.\nconfAErrCheckDrawDiag=Cannot check diagram {1}\nconfAErrFetchPageList=Error fetching pages list\nconfADiagImportIncom={1} diagram "{2}" is imported partially and may have missing shapes\ninvalidSel=Invalid selection\ndiagNameEmptyErr=Diagram name cannot be empty\nopenDiagram=Open Diagram\nnewDiagram=New diagram\neditable=Editable\nconfAReimportStarted=Re-import {1} diagrams started...\nspaceFilter=Filter by spaces\ncurViewState=Current Viewer State\npageLayers=Page and Layers\ncustomize=Customize\nfirstPage=First Page (All Layers)\ncurEditorState=Current Editor State\nnoAnchorsFound=No anchors found\nattachment=Attachment\ncurDiagram=Current Diagram\nrecentDiags=Recent Diagrams\ncsvImport=CSV Import\nchooseFile=Choose a file...\nchoose=Choose\ngdriveFname=Google Drive filename\nwidthOfViewer=Width of the viewer (px)\nheightOfViewer=Height of the viewer (px)\nautoSetViewerSize=Automatically set the size of the viewer\nthumbnail=Thumbnail\nprevInDraw=Preview in draw.io\nonedriveFname=OneDrive filename\ndiagFname=Diagram filename\ndiagUrl=Diagram URL\nshowDiag=Show Diagram\ndiagPreview=Diagram Preview\ncsvFileUrl=CSV File URL\ngenerate=Generate\nselectDiag2Insert=Please select a diagram to insert it.\nerrShowingDiag=Unexpected error. Cannot show diagram\nnoRecentDiags=No recent diagrams found\nfetchingRecentFailed=Failed to fetch recent diagrams\nuseSrch2FindDiags=Use the search box to find draw.io diagrams\ncantReadChckPerms=Cannot read the specified diagram. Please check you have read permission on that file.\ncantFetchChckPerms=Cannot fetch diagram info. Please check you have read permission on that file.\nsearchFailed=Searching failed. Please try again later.\nplsTypeStr=Please type a search string.\nunsupportedFileChckUrl=Unsupported file. Please check the specified URL\ndiagNotFoundChckUrl=Diagram not found or cannot be accessed. Please check the specified URL\ncsvNotFoundChckUrl=CSV file not found or cannot be accessed. Please check the specified URL\ncantReadUpload=Cannot read the uploaded diagram\nselect=Select\nerrCantGetIdType=Unexpected Error: Cannot get content id or type.\nerrGAuthWinBlocked=Error: Google Authentication window blocked\nauthDrawAccess=Authorize draw.io to access {1}\nconnTimeout=The connection has timed out\nerrAuthSrvc=Error authenticating to {1}\nplsSelectFile=Please select a file\nmustBgtZ={1} must be greater than zero\ncantLoadPrev=Cannot load file preview.\nerrAccessFile=Error: Access Denied. You do not have permission to access "{1}".\nnoPrevAvail=No preview is available.\npersonalAccNotSup=Personal accounts are not supported.\nerrSavingTryLater=Error occurred during saving, please try again later.\nplsEnterFld=Please enter {1}\ninvalidDiagUrl=Invalid Diagram URL\nunsupportedVsdx=Unsupported vsdx file\nunsupportedImg=Unsupported image file\nunsupportedFormat=Unsupported file format\nplsSelectSingleFile=Please select a single file only\nattCorrupt=Attachment file "{1}" is corrupted\nloadAttFailed=Failed to load attachment "{1}"\nembedDrawDiag=Embed draw.io Diagram\naddDiagram=Add Diagram\nembedDiagram=Embed Diagram\neditOwningPg=Edit owning page\ndeepIndexing=Deep Indexing (Index diagrams that aren\'t used in any page also)\nconfADeepIndexStarted=Deep Indexing Started\nconfADeepIndexDone=Deep Indexing Done\nofficeNoDiagramsSelected=No diagrams found in the selection\nofficeNoDiagramsInDoc=No diagrams found in the document\nofficeNotSupported=This feature is not supported in this host application\nsomeImagesFailed={1} out of {2} failed due to the following errors\nimportingNoUsedDiagrams=Importing {1} Diagrams not used in pages\nimportingDrafts=Importing {1} Diagrams in drafts\nprocessingDrafts=Processing drafts\nupdatingDrafts=Updating drafts\nupdateDrafts=Update drafts\nnotifications=Notifications\ndrawioImp=draw.io Import\nconfALibsImp=Importing draw.io Libraries\nconfALibsImpFailed=Importing {1} library failed\ncontributors=Contributors\ndrawDiagrams=draw.io Diagrams\nerrFileNotFoundOrNoPer=Error: Access Denied. File not found or you do not have permission to access "{1}" on {2}.\nconfACheckPagesWEmbed=Checking pages having embedded draw.io diagrams.\nconfADelBrokenEmbedDiagLnk=Removing broken embedded diagram links\nreplaceWith=Replace with\nreplaceAll=Replace All\nconfASkipDiagModified=Skipped "{1}" as it was modified after initial import\nreplFind=Replace/Find\nmatchesRepl={1} matches replaced\ndraftErrDataLoss=An error occurred while reading the draft file. The diagram cannot be edited now to prevent any possible data loss. Please try again later or contact support.\nibm=IBM\nlinkToDiagramHint=Add a link to this diagram. The diagram can only be edited from the page that owns it.\nlinkToDiagram=Link to Diagram\nchangedBy=Changed By\nlastModifiedOn=Last modified on\nsearchResults=Search Results\nshowAllTemps=Show all templates\nnotionToken=Notion Token\nselectDB=Select Database\nnoDBs=No Databases\ndiagramEdited={1} diagram "{2}" edited\nconfDraftPermissionErr=Draft cannot be written. Do you have attachment write/read permission on this page?\nconfFileTooBigErr=File size is too large. Pease check "Attachment Maximum Size" of "Attachment Settings" in Confluence Configuration.\nowner=Owner\nrepository=Repository\nbranch=Branch\nmeters=Meters\nteamsNoEditingMsg=Editor functionality is only available in Desktop environment (in MS Teams App or a web browser)\ncontactOwner=Contact Owner\nviewerOnlyMsg=You cannot edit the diagrams in the mobile platform, please use the desktop client or a web browser.\nwebsite=Website\ncheck4Updates=Check for updates\nattWriteFailedRetry={1}: Attachment write failed, trying again in {2} seconds...\nconfPartialPageList=We couldn\'t fetch all pages due to an error in Confluence. Continuing using {1} pages only.\nspellCheck=Spell checker\nnoChange=No Change\nlblToSvg=Convert labels to SVG\ntxtSettings=Text Settings\nLinksLost=Links will be lost\narcSize=Arc Size\neditConnectionPoints=Edit Connection Points\nnotInOffline=Not supported while offline\nnotInDesktop=Not supported in Desktop App\nconfConfigSpaceArchived=draw.io Configuration space (DRAWIOCONFIG) is archived. Please restore it first.\nconfACleanOldVerStarted=Cleaning old diagram draft versions started\nconfACleanOldVerDone=Cleaning old diagram draft versions finished\nconfACleaningFile=Cleaning diagram draft "{1}" old versions\nconfAFileCleaned=Cleaning diagram draft "{1}" done\nconfAFileCleanFailed=Cleaning diagram draft "{1}" failed\nconfACleanOnly=Clean Diagram Drafts Only\nbrush=Brush\nopenDevTools=Open Developer Tools\nautoBkp=Automatic Backup\nconfAIgnoreCollectErr=Ignore collecting current pages errors\ndrafts=Drafts\ndraftSaveInt=Draft save interval [sec] (0 to disable)\npluginsDisabled=External plugins disabled.\nextExpNotConfigured=External image service is not configured\npathFilename=Path/Filename\nconfAHugeInstances=Very Large Instances\nconfAHugeInstancesDesc=If this instance includes 100,000+ pages, it is faster to request the current instance pages list from Atlassian. Please contact our support for more details.\nchoosePageIDsFile=Choose current page IDs csv file\nchooseDrawioPsgesFile=Choose pages with draw.io diagrams csv file\nprivate=Private\ndiagramTooLarge=The diagram is too large, please reduce its size and try again.\nselectAdminUsers=Select Admin Users\nxyzTeam={1} Team\naddTeamTitle=Adding a new draw.io Team\naddTeamInst1=To create a new draw.io Team, you need to create a new Atlassian group with "drawio-" prefix (e.g, a group named "drawio-marketing").\naddTeamInst2=Then, configure which team member can edit/add configuration, templates, and libraries from this page.\ndrawioTeams=draw.io Teams\nmembers=Members\nadminEditors=Admins/Editors\nallowAll=Allow all\nnoTeams=No teams found\nerrorLoadingTeams=Error Loading Teams\nnoTeamMembers=No team members found\nerrLoadTMembers=Error loading team members\nerrCreateTeamPage=Error creating team "{1}" page in "draw.io Configuration" space, please check you have the required permissions.\ngotoConfigPage=Please create the space from draw.io "Configuration" page.\nnoAdminsSelected=No admins/editors selected\nerrCreateConfigFile=Error creating "configuration.json" file, please check you have the required permissions.\nerrSetPageRestr=Error setting page restrictions\nnotAdmin4Team=You are not an admin for this team\nconfigUpdated=Configuration updated, restart the editor if you want to work with last configuration.\noutOfDateRevisionAlert=You are editing a historical revision of the diagram, please review the revision and open it to replace the latest version. Or close and overwrite/merge later.\nconfAErrFaqs=There are {1} error(s), the following instructions may help fixing most of the cases. (Please download the log for future references)\nconfA403ErrFaq=There are ({1}) 403 error(s). The current users must have add (write) permissions on all pages and attachments. Even admins sometimes are not allowed to write to some pages via page restrictions\nconfA404ErrFaq=There are ({1}) 404 error(s). The attachment/page is not found. This is due to improper migration or the diagram file (an attachment of the page) is deleted.\nconfA500ErrFaq=There are ({1}) 500 error(s). An internal server error in Confluence Cloud. Such errors are due to overloading the server and usually fixed by retrying the process.\nconfAOtherErrFaq=There are ({1}) other error(s). Please check the error description. If the description is not clear, please contact our support.\nconfAReplaceBaseUrl=Replace Base URL in diagram links when no page ID mapping is found\ndrawSvgPrev=draw.io SVG preview\ngoogleFonts=Google Fonts\ndiagDupl=Duplicate Diagram Detected\ndiagDuplMsg=This diagram is used in multiple places, which can result in unexpected results when edited. We\'ve created an independent copy. Please open the editor again.\ndiagDuplNoEditMsg=This diagram is used in multiple places. Please edit it within its own page.\nconfCloudMigConfirm=Warning: This process will edit many pages and diagrams, so it is recommended to stop the Synchrony service during the process. Do you want to proceed?\nconfCloudMigNotice=In the Cloud instance, please add linkAdjustments to draw.io configuration as follows {1}. Without this configuration, links in diagrams pointing to Confluence pages will not work.\nconfALogsPageDesc=This page contains logs of draw.io long running services as attachments\nconfEditOnlyInPageEditor=Can only be edited within Confluence page editor\nconfEvalWarn=Evaluation License - Not for production use\notherUsersEditing=Other user(s) are editing this diagram\nfirstTimeGD=First time to access this file?\ndrawioGDAppNotInstalled=draw.io Google Drive app is not installed, please install it first\nConfDC415Error=Saving drafts is blocked. If you have "Attachment Checker for Confluence" app, please update to the latest version.\nremove=Remove\nselectPgLyr=Select Page and Layers\nerrGenPreview=There was an error generating a diagram preview. Please consult technical support.\nattAccessErr=Diagram attachment access error: cannot display diagram\nwidthIntOrFixed=Width must be a valid integer or of value \'fixed\'\ndupDisabledPgLyrSlct=Diagram duplication is disabled when page and layers are selected\ncantDupPickDiffName=Could not duplicate diagram. Please choose a different name.\nownPgAccessDupErr=Owning page access restriction: cannot duplicate diagram.\ncantDupTryLater=Could not duplicate diagram. Please try again later.\ncantEditLnkd=Cannot edit linked diagram\ndiagEditOwnPgOnlyOpen=Diagram can only be edited from the page that owns it. Would you like to open the owning page for edit?\ndiagInTemps=draw.io diagrams in templates\ndiagInTempsCantEdit=Diagrams in page templates cannot be edited. They can only be edited on pages and blog posts.\nconfDirectEditDraftLost=This Confluence page has unpublished changes. Editing the diagram from page view may cause data loss. Please edit the Confluence page first and then edit the diagram.\nconfConfigSpacePerm=Note: If you recently migrated from DC app, please check draw.io Configuration space permissions such that all users can read and only admins can write. In addition, remove the page restrictions on "Configuration" and "Libraries" pages. You may need admin keys to access them. Also, please check the file "configuration.json" in the "Configuration" page is downloadable.\n');Graph.prototype.defaultThemes["default-style2"]=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="default"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="default"/><add as="endArrow" value="classic"/><add as="fontSize" value="11"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="rounded" value="1"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="text"><add as="fillColor" value="none"/><add as="gradientColor" value="none"/><add as="strokeColor" value="none"/><add as="align" value="left"/><add as="verticalAlign" value="top"/></add><add as="edgeLabel" extend="text"><add as="labelBackgroundColor" value="default"/><add as="fontSize" value="11"/></add><add as="label"><add as="fontStyle" value="1"/><add as="align" value="left"/><add as="verticalAlign" value="middle"/><add as="spacing" value="2"/><add as="spacingLeft" value="52"/><add as="imageWidth" value="42"/><add as="imageHeight" value="42"/><add as="rounded" value="1"/></add><add as="icon" extend="label"><add as="align" value="center"/><add as="imageAlign" value="center"/><add as="verticalLabelPosition" value="bottom"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="4"/><add as="labelBackgroundColor" value="default"/><add as="spacing" value="0"/><add as="spacingLeft" value="0"/><add as="spacingTop" value="6"/><add as="fontStyle" value="0"/><add as="imageWidth" value="48"/><add as="imageHeight" value="48"/></add><add as="swimlane"><add as="shape" value="swimlane"/><add as="fontSize" value="12"/><add as="fontStyle" value="1"/><add as="startSize" value="23"/></add><add as="group"><add as="verticalAlign" value="top"/><add as="fillColor" value="none"/><add as="strokeColor" value="none"/><add as="gradientColor" value="none"/><add as="pointerEvents" value="0"/></add><add as="ellipse"><add as="shape" value="ellipse"/><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombus"><add as="shape" value="rhombus"/><add as="perimeter" value="rhombusPerimeter"/></add><add as="triangle"><add as="shape" value="triangle"/><add as="perimeter" value="trianglePerimeter"/></add><add as="line"><add as="shape" value="line"/><add as="strokeWidth" value="4"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="verticalLabelPosition" value="bottom"/></add><add as="roundImage" extend="image"><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombusImage" extend="image"><add as="perimeter" value="rhombusPerimeter"/></add><add as="arrow"><add as="shape" value="arrow"/><add as="edgeStyle" value="none"/><add as="fillColor" value="default"/></add><add as="fancy"><add as="shadow" value="1"/><add as="glass" value="1"/></add><add as="gray" extend="fancy"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="blue" extend="fancy"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="green" extend="fancy"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="turquoise" extend="fancy"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="yellow" extend="fancy"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="orange" extend="fancy"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="red" extend="fancy"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="pink" extend="fancy"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="purple" extend="fancy"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add><add as="plain-gray"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="plain-blue"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="plain-green"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="plain-turquoise"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="plain-yellow"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="plain-orange"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="plain-red"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="plain-pink"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="plain-purple"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add></mxStylesheet>').documentElement;+(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var e=EditorUi.initTheme;EditorUi.initTheme=function(){e.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();DrawioComment=function(b,e,g,m,v,n,A){this.file=b;this.id=e;this.content=g;this.modifiedDate=m;this.createdDate=v;this.isResolved=n;this.user=A;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,e,g,m,v){e()};DrawioComment.prototype.editComment=function(b,e,g){e()};DrawioComment.prototype.deleteComment=function(b,e){b()};DrawioUser=function(b,e,g,m,v){this.id=b;this.email=e;this.displayName=g;this.pictureUrl=m;this.locale=v};mxResources.parse('# *DO NOT DIRECTLY EDIT THIS FILE, IT IS AUTOMATICALLY GENERATED AND IT IS BASED ON:*\n# https://docs.google.com/spreadsheet/ccc?key=0AmQEO36liL4FdDJLWVNMaVV2UmRKSnpXU09MYkdGbEE\nabout=About\naboutDrawio=About draw.io\naccessDenied=Access Denied\naccounts=Accounts\naction=Action\nactualSize=Actual Size\nadaptiveColors=Adaptive Colors\nadd=Add\naddAccount=Add account\naddedFile=Added {1}\naddImages=Add Images\naddImageUrl=Add Image URL\naddLayer=Add Layer\naddProperty=Add Property\naddress=Address\naddToExistingDrawing=Add to Existing Drawing\naddToScratchpad=Add to Scratchpad\naddWaypoint=Add Waypoint\nadjustTo=Adjust to\nadvanced=Advanced\nsmartTemplate=Smart Template\nalign=Align\nalignment=Alignment\nallChangesLost=All changes will be lost!\nallPages=All Pages\nallProjects=All Projects\nallSpaces=All Spaces\nallTags=All Tags\nanchor=Anchor\nandroid=Android\nangle=Angle\nanimations=Animations\narc=Arc\nareYouSure=Are you sure?\nensureDataSaved=Please ensure your data is saved before closing.\nallChangesSaved=All changes saved\nallChangesSavedInDrive=All changes saved in Drive\nallowPopups=Allow pop-ups to avoid this dialog.\nallowRelativeUrl=Allow relative URL\nalreadyConnected=Nodes already connected\nappearance=Appearance\napply=Apply\narchiMate21=ArchiMate 2.1\narrange=Arrange\narrow=Arrow\narrows=Arrows\naskMeAnything=Ask me anything\nasNew=As New\natlas=Atlas\nauthor=Author\nauthorizationRequired=Authorization required\nauthorizeThisAppIn=Authorize this app in {1}:\nauthorize=Authorize\nauthorizing=Authorizing\nautomatic=Automatic\nautosave=Autosave\nautosize=Autosize\nattachments=Attachments\naws=AWS\naws3d=AWS 3D\nazure=Azure\nback=Back\nbackground=Background\nbackgroundColor=Background Color\nbackgroundImage=Background Image\nbasic=Basic\nbeta=beta\nblankDrawing=Blank Drawing\nblankDiagram=Blank Diagram\nblock=Block\nblockquote=Blockquote\nblog=Blog\nbold=Bold\nbootstrap=Bootstrap\nborder=Border\nborderColor=Border Color\nborderWidth=Border Width\nbottom=Bottom\nbottomAlign=Bottom Align\nbottomLeft=Bottom Left\nbottomRight=Bottom Right\nbpmn=BPMN\nbringForward=Bring Forward\nbrowser=Browser\nbulletedList=Bulleted List\nbusiness=Business\nbusy=Operation in progress\ncabinets=Cabinets\ncancel=Cancel\ncenter=Center\ncannotLoad=Load attempts failed. Please try again later.\ncannotLogin=Log in attempts failed. Please try again later.\ncannotOpenFile=Cannot open file\nchange=Change\nchangeOrientation=Change Orientation\nchangeUser=Change user\nchangeStorage=Change storage\nchangesNotSaved=Changes have not been saved\nclassDiagram=Class Diagram\nuserJoined={1} has joined\nuserLeft={1} has left\nchatWindowTitle=Chat\nchooseAnOption=Choose an option\nchromeApp=Chrome App\ncollaborativeEditingNotice=Important Notice for Collaborative Editing\ncompare=Compare\ncompressed=Compressed\ncommitMessage=Commit Message\nconfigLinkWarn=This link configures draw.io. Only click OK if you trust whoever gave you it!\nconfigLinkConfirm=Click OK to configure and restart draw.io.\ncontainer=Container\ncsv=CSV\ndark=Dark\ndiagramLanguage=Diagram Language\ndiagramType=Diagram type\ndiagramXmlDesc=XML File\ndiagramHtmlDesc=HTML File\ndiagramPngDesc=Editable Bitmap Image\ndiagramSvgDesc=Editable Vector Image\ndidYouMeanToExportToPdf=Did you mean to export to PDF?\ndisabled=Disabled\ndraftFound=A draft for \'{1}\' has been found. Load it into the editor or discard it to continue.\ndraftRevisionMismatch=There is a different version of this diagram on a shared draft of this page. Please edit the diagram from the draft to ensure you are working with the latest version.\nselectDraft=Select a draft to continue editing:\ndragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?\ndropboxCharsNotAllowed=The following characters are not allowed: / : ? * " |\ncheck=Check\nchecksum=Checksum\ncircle=Circle\ncisco=Cisco\nclassic=Classic\nclearDefaultStyle=Clear Default Style\nclearWaypoints=Clear Waypoints\nclipart=Clipart\nclose=Close\nclosingFile=Closing file\nrealtimeCollaboration=Real-Time Collaboration\ncollaborate=Collaborate\ncollaborator=Collaborator\ncollaborators=Collaborators\ncollapse=Collapse\ncollapseExpand=Collapse/Expand\ncollapse-expand=Click to collapse/expand\nShift-click to move neighbors \nAlt-click to protect group size\ncollapsible=Collapsible\ncomic=Comic\ncomment=Comment\ncommentsNotes=Comments/Notes\ncompress=Compress\nconfiguration=Configuration\nconnect=Connect\nconnecting=Connecting\nconnectWithDrive=Connect with Google Drive\nconnection=Connection\nconnectionArrows=Connection Arrows\nconnectionPoints=Connection Points\nconstrainProportions=Constrain Proportions\ncontainsValidationErrors=Contains validation errors\ncopiedToClipboard=Copied to clipboard\ncopy=Copy\ncopyConnect=Copy on connect\ncopyCreated=A copy of the file was created.\ncopyData=Copy Data\ncopyOf=Copy of {1}\ncopyOfDrawing=Copy of Drawing\ncopySize=Copy Size\ncopyStyle=Copy Style\ncreate=Create\ncreateBlankDiagram=Create Blank Diagram\ncreateNewDiagram=Create New Diagram\ncreateRevision=Create Revision\ncreateShape=Create Shape\ncrop=Crop\ncurved=Curved\ncustom=Custom\ncurrent=Current\ncurrentPage=Current page\ncut=Cut\ndashed=Dashed\ndecideLater=Decide later\ndefault=Default\ndelete=Delete\ndeleteAll=Delete all\ndeleteColumn=Delete column\ndeleteLibrary401=Insufficient permissions to delete this library\ndeleteLibrary404=Selected library could not be found\ndeleteLibrary500=Error deleting library\ndeleteLibraryConfirm=You are about to permanently delete this library. Are you sure you want to do this?\ndeleteRow=Delete Row\ndescription=Description\ndescribeYourDiagram=Describe your diagram\ndevice=Device\ndiagram=Diagram\ndiagramContent=Diagram Content\ndiagramLocked=Diagram has been locked to prevent further data loss.\ndiagramLockedBySince=The diagram is locked by {1} since {2} ago\ndiagramName=Diagram Name\ndiagramIsPublic=Diagram is public\ndiagramIsNotPublic=Diagram is not public\ndiamond=Diamond\ndiamondThin=Diamond (thin)\ndidYouKnow=Did you know...\ndirection=Direction\ndiscard=Discard\ndiscardChangesAndReconnect=Discard Changes and Reconnect\ngoogleDriveMissingClickHere=Google Drive missing? Click here!\ndiscardChanges=Discard Changes\ndisconnected=Disconnected\ndistribute=Distribute\ndone=Done\ndoNotShowAgain=Do not show again\ndotted=Dotted\ndoubleClickOrientation=Doubleclick to change orientation\ndoubleClickTooltip=Doubleclick to insert text\ndoubleClickChangeProperty=Doubleclick to change property name\ndownload=Download\ndownloadDesktop=Get Desktop\ndownloadAs=Download as\nclickHereToSave=Click here to save.\ndpi=DPI\ndraftDiscarded=Draft discarded\ndraftSaved=Draft saved\ndragElementsHere=Drag elements here\ndragImagesHere=Drag images or URLs here\ndragUrlsHere=Drag URLs here\ndraw.io=draw.io\ndrawing=Drawing{1}\ndrawingEmpty=Drawing is empty\ndrawingTooLarge=Drawing is too large\ndrawioForWork=Draw.io for GSuite\ndropbox=Dropbox\nduplicate=Duplicate\nduplicateIt=Duplicate {1}\ndivider=Divider\ndx=Dx\ndy=Dy\neast=East\nedit=Edit\neditData=Edit Data\neditDiagram=Edit Diagram\neditGeometry=Edit Geometry\neditImage=Edit Image\neditImageUrl=Edit Image URL\neditLink=Edit Link\neditShape=Edit Shape\neditStyle=Edit Style\neditText=Edit Text\neditTooltip=Edit Tooltip\nglass=Glass\ngoogleImages=Google Images\nimageSearch=Image Search\neip=EIP\nembed=Embed\nembedFonts=Embed Fonts\nembedImages=Embed Images\nmainEmbedNotice=Paste this into the page\nelectrical=Electrical\nellipse=Ellipse\nembedNotice=Paste this once at the end of the page\nenterGroup=Enter Group\nenterName=Enter Name\nenterPropertyName=Enter Property Name\nenterValue=Enter Value\nentityRelation=Entity Relation\nentityRelationshipDiagram=Entity Relationship Diagram\nerror=Error\nerrorDeletingFile=Error deleting file\nerrorLoadingFile=Error loading file\nerrorRenamingFile=Error renaming file\nerrorRenamingFileNotFound=Error renaming file. File was not found.\nerrorRenamingFileForbidden=Error renaming file. Insufficient access rights.\nerrorSavingDraft=Error saving draft\nerrorSavingFile=Error saving file\nerrorSavingFileUnknown=Error authorizing with Google\'s servers. Please refresh the page to re-attempt.\nerrorSavingFileForbidden=Error saving file. Insufficient access rights.\nerrorSavingFileNameConflict=Could not save diagram. Current page already contains file named \'{1}\'.\nerrorSavingFileNotFound=Error saving file. File was not found.\nerrorSavingFileReadOnlyMode=Could not save diagram while read-only mode is active.\nerrorSavingFileSessionTimeout=Your session has ended. Please <a target=\'_blank\' href=\'{1}\'>{2}</a> and return to this tab to try to save again.\nerrorSendingFeedback=Error sending feedback.\nerrorUpdatingPreview=Error updating preview.\nexit=Exit\nexitGroup=Exit Group\nexpand=Expand\nexplore=Explore\nexport=Export\nexporting=Exporting\nexportAs=Export as\nexportOptionsDisabled=Export options disabled\nexportOptionsDisabledDetails=The owner has disabled options to download, print or copy for commenters and viewers on this file.\nexternalChanges=External Changes\nextras=Extras\nfacebook=Facebook\nfailedToSaveTryReconnect=Failed to save, trying to reconnect\nfeatureRequest=Feature Request\nfeedback=Feedback\nfeedbackSent=Feedback successfully sent.\nfloorplans=Floorplans\nfile=File\nfileChangedOverwriteDialog=The file has been modified. Do you want to save the file and overwrite those changes?\nfileChangedSyncDialog=The file has been modified.\nfileChangedSync=The file has been modified. Click here to synchronize.\noverwrite=Overwrite\nsynchronize=Synchronize\nfilename=Filename\nfileExists=File already exists\nfileMovedToTrash=File was moved to trash\nfileNearlyFullSeeFaq=File nearly full, please see FAQ\nfileNotFound=File not found\nrepositoryNotFound=Repository not found\nfileNotFoundOrDenied=The file was not found. It does not exist or you do not have access.\nfileNotLoaded=File not loaded\nfileNotSaved=File not saved\nfileOpenLocation=How would you like to open these file(s)?\nfiletypeHtml=.html causes file to save as HTML with redirect to cloud URL\nfiletypePng=.png causes file to save as PNG with embedded data\nfiletypeSvg=.svg causes file to save as SVG with embedded data\nfileWillBeSavedInAppFolder={1} will be saved in the app folder.\nfill=Fill\nfillColor=Fill Color\nfilterCards=Filter Cards\nfind=Find\nfit=Fit\nfitContainer=Resize Container\nfitIntoContainer=Fit into Container\nfitPage=Fit Page\nfitPageWidth=Fit Page Width\nfitTo=Fit to\nfitToSheetsAcross=sheet(s) across\nfitToBy=by\nfitToSheetsDown=sheet(s) down\nfitTwoPages=Two Pages\nfitWindow=Fit Window\nflip=Flip\nflipH=Flip Horizontal\nflipV=Flip Vertical\nflowAnimation=Flow Animation\nflowchart=Flowchart\nfolder=Folder\nfont=Font\nfontColor=Font Color\nfontFamily=Font Family\nfontSize=Font Size\nforbidden=You are not authorized to access this file\nformat=Format\nformatPanel=Format Panel\nformatted=Formatted\nformattedText=Formatted Text\nformatPng=PNG\nformatGif=GIF\nformatJpg=JPEG\nformatPdf=PDF\nformatSql=SQL\nformatSvg=SVG\nformatHtmlEmbedded=HTML\nformatSvgEmbedded=SVG (with XML)\nformatVsdx=VSDX\nformatVssx=VSSX\nformatWebp=WebP\nformatXmlPlain=XML (Plain)\nformatXml=XML\nforum=Discussion/Help Forums\nfreehand=Freehand\nfromTemplate=From Template\nfromTemplateUrl=From Template URL\nfromText=From Text\nfromUrl=From URL\nfromThisPage=From this page\nfullscreen=Fullscreen\ngap=Gap\ngcp=GCP\ngeneral=General\ngetNotionChromeExtension=Get the Notion Chrome Extension\ngithub=GitHub\ngitlab=GitLab\ngliffy=Gliffy\nglobal=Global\ngoogleDocs=Google Docs\ngoogleDrive=Google Drive\ngoogleGadget=Google Gadget\ngoogleSharingNotAvailable=Sharing is only available via Google Drive. Please click Open below and share from the more actions menu:\ngoogleSlides=Google Slides\ngoogleSites=Google Sites\ngoogleSheets=Google Sheets\ngradient=Gradient\ngradientColor=Color\ngrid=Grid\ngridColor=Grid Color\ngridSize=Grid Size\ngroup=Group\nguides=Guides\nhateApp=I hate draw.io\nheading=Heading\nheight=Height\nhelp=Help\nhelpTranslate=Help us translate this application\nhide=Hide\nhideIt=Hide {1}\nhidden=Hidden\nhighContrast=High Contrast\nhome=Home\nhorizontal=Horizontal\nhorizontalFlow=Horizontal Flow\nhorizontalTree=Horizontal Tree\nhowTranslate=How good is the translation in your language?\nhtml=HTML\nhtmlText=HTML Text\nid=ID\niframe=IFrame\nignore=Ignore\nimage=Image\nimageUrl=Image URL\nimages=Images\nimagePreviewError=This image couldn\'t be loaded for preview. Please check the URL.\nimageTooBig=Image too big\nimgur=Imgur\nimport=Import\nimportFrom=Import from\nimproveContrast=Improve Contrast\nincludeCopyOfMyDiagram=Include a copy of my diagram\nincreaseIndent=Increase Indent\ndecreaseIndent=Decrease Indent\ninsert=Insert\ninsertColumnBefore=Insert Column Left\ninsertColumnAfter=Insert Column Right\ninsertEllipse=Insert Ellipse\ninsertImage=Insert Image\ninsertHorizontalRule=Insert Horizontal Rule\ninsertLink=Insert Link\ninsertPage=Insert Page\ninsertRectangle=Insert Rectangle\ninsertRhombus=Insert Rhombus\ninsertRowBefore=Insert Row Above\ninsertRowAfter=Insert Row After\ninsertText=Insert Text\ninserting=Inserting\ninstallApp=Install App\ninvalidFilename=Diagram names must not contain the following characters: / | : ; { } < > & + ? = "\ninvalidLicenseSeeThisPage=Your license is invalid, please see this <a target="_blank" href="https://www.drawio.com/doc/faq/license-drawio-confluence-jira-cloud">page</a>.\ninvalidInput=Invalid input\ninvalidName=Invalid name\ninvalidOrMissingFile=Invalid or missing file\ninvalidPublicUrl=Invalid public URL\nisometric=Isometric\nios=iOS\nitalic=Italic\nkennedy=Kennedy\nkeyboardShortcuts=Keyboard Shortcuts\nlabels=Labels\nlayers=Layers\nlandscape=Landscape\nlanguage=Language\nleanMapping=Lean Mapping\nlastChange=Last change {1} ago\nlessThanAMinute=less than a minute\nlicensingError=Licensing Error\nlicenseHasExpired=The license for {1} has expired on {2}. Click here.\nlicenseRequired=This feature requires draw.io to be licensed.\nlicenseWillExpire=The license for {1} will expire on {2}. Click here.\nlight=Light\nlineJumps=Line jumps\nlinkAccountRequired=If the diagram is not public a Google account is required to view the link.\nlinkText=Link Text\nlist=List\nminute=minute\nminutes=minutes\nhours=hours\ndays=days\nmonths=months\nyears=years\nrestartForChangeRequired=Changes will take effect after a restart of the application.\nlaneColor=Lanecolor\nlanguageCode=Language Code\nlastModified=Last modified\nlayout=Layout\nleft=Left\nleftAlign=Left Align\nleftToRight=Left to right\nlibraryTooltip=Drag and drop shapes here or click + to insert. Double click to edit.\nlightbox=Lightbox\nline=Line\nlineend=Line end\nlineheight=Line Height\nlinestart=Line start\nlinewidth=Linewidth\nlink=Link\nlinks=Links\nloading=Loading\nlocked=Locked\nlockUnlock=Lock/Unlock\nloggedOut=Logged Out\nlogIn=log in\nloveIt=I love {1}\nlucidchart=Lucidchart\nmaps=Maps\nmathematicalTypesetting=Mathematical Typesetting\nmakeCopy=Make a Copy\nmanual=Manual\nmerge=Merge\nmermaid=Mermaid\nmicrosoftOffice=Microsoft Office\nmicrosoftExcel=Microsoft Excel\nmicrosoftPowerPoint=Microsoft PowerPoint\nmicrosoftWord=Microsoft Word\nmiddle=Middle\nminimal=Minimal\nmisc=Misc\nmockups=Mockups\nmodern=Modern\nmodificationDate=Modification date\nmodifiedBy=Modified by\nmore=More\nmoreResults=More Results\nmoreShapes=More Shapes\nmove=Move\nmoveToFolder=Move to Folder\nmoving=Moving\nmoveSelectionTo=Move selection to {1}\nmyDrive=My Drive\nmyFiles=My Files\nname=Name\nnavigation=Navigation\nnetwork=Network\nnetworking=Networking\nnew=New\nnewLibrary=New Library\nnextPage=Next Page\nno=No\nnoPickFolder=No, pick folder\nnoAttachments=No attachments found\nnoColor=No Color\nnoFiles=No Files\nnoFileSelected=No file selected\nnoLibraries=No libraries found\nnoMoreResults=No more results\nnone=None\nnoOtherViewers=No other viewers\nnoPlugins=No plugins\nnoPreview=No preview\nnoResponse=No response from server\nnoResultsFor=No results for \'{1}\'\nnoRevisions=No revisions\nnoSearchResults=No search results found\nnoPageContentOrNotSaved=No anchors found on this page or it hasn\'t been saved yet\nnormal=Normal\nnorth=North\nnotADiagramFile=Not a diagram file\nnotALibraryFile=Not a library file\nnotAvailable=Not available\nnotAUtf8File=Not a UTF-8 file\nnotConnected=Not connected\nnote=Note\nnotion=Notion\nnotSatisfiedWithImport=Not satisfied with the import?\nnotUsingService=Not using {1}?\nnumberedList=Numbered list\noffline=Offline\nok=OK\noneDrive=OneDrive\nonline=Online\nopacity=Opacity\nopen=Open\nopenArrow=Open Arrow\nopenExistingDiagram=Open Existing Diagram\nopenFile=Open File\nopenFrom=Open from\nopenLibrary=Open Library\nopenLibraryFrom=Open Library from\nopenLink=Open Link\nopenInNewWindow=Open in New Window\nopenInThisWindow=Open in This Window\nopenIt=Open {1}\nopenRecent=Open Recent\nopenSupported=Supported formats are files saved from this software (.xml), .vsdx and .gliffy\noptions=Options\norganic=Organic\norgChart=Org Chart\northogonal=Orthogonal\notherViewer=other viewer\notherViewers=other viewers\noutline=Outline\noval=Oval\npage=Page\npageContent=Page Content\npageNotFound=Page not found\npageWithNumber=Page-{1}\npages=Pages\npageTabs=Page Tabs\npageView=Page View\npageSetup=Page Setup\npageScale=Page Scale\npan=Pan\npanTooltip=Space+Drag to pan\npaperSize=Paper Size\npattern=Pattern\nparallels=Parallels\npaste=Paste\npasteData=Paste Data\npasteHere=Paste here\npasteSize=Paste Size\npasteStyle=Paste Style\nperimeter=Perimeter\npermissionAnyone=Anyone can edit\npermissionAuthor=Owner and admins can edit\npickFolder=Pick a folder\npickLibraryDialogTitle=Select Library\npublicDiagramUrl=Public URL of the diagram\nplaceholders=Placeholders\nplantUml=PlantUML\nplugins=Plugins\npluginUrl=Plugin URL\npluginWarning=The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n\nplusTooltip=Click to connect and clone (ctrl+click to clone, shift+click to connect). Drag to connect (ctrl+drag to clone).\nportrait=Portrait\nposition=Position\nposterPrint=Poster Print\npreferences=Preferences\npreview=Preview\npreviousPage=Previous Page\npresentationMode=Presentation Mode\nprint=Print\nprocEng=Proc. Eng.\nproject=Project\npriority=Priority\nprocessForHiringNewEmployee=Process for hiring a new employee\nproperties=Properties\npublish=Publish\nquickStart=Quick Start Video\nrack=Rack\nradial=Radial\nradialTree=Radial Tree\nreadOnly=Read-only\nreconnecting=Reconnecting\nrecentlyUpdated=Recently Updated\nrecentlyViewed=Recently Viewed\nrectangle=Rectangle\nredirectToNewApp=This file was created or modified in a newer version of this app. You will be redirected now.\nrealtimeTimeout=It looks like you\'ve made a few changes while offline. We\'re sorry, these changes cannot be saved.\nredo=Redo\nrefresh=Refresh\nregularExpression=Regular Expression\nrelative=Relative\nrelativeUrlNotAllowed=Relative URL not allowed\nrememberMe=Remember me\nrememberThisSetting=Remember this setting\nremoveFormat=Clear Formatting\nremoveFromGroup=Remove from Group\nremoveIt=Remove {1}\nremoveWaypoint=Remove Waypoint\nrename=Rename\nrenamed=Renamed\nrenameIt=Rename {1}\nrenaming=Renaming\nreplace=Replace\nreplaceIt={1} already exists. Do you want to replace it?\nreplaceExistingDrawing=Replace existing drawing\nrequired=required\nrequirementDiagram=Requirement Diagram\nreset=Reset\nresetView=Reset View\nresize=Resize\nresizeLargeImages=Do you want to resize large images to make the application run faster?\nretina=Retina\nresponsive=Responsive\nrestore=Restore\nrestoring=Restoring\nretryingIn=Retrying in {1} second(s)\nretryingLoad=Load failed. Retrying...\nretryingLogin=Login time out. Retrying...\nreverse=Reverse\nrevision=Revision\nrevisionHistory=Revision History\nrhombus=Rhombus\nright=Right\nrightAlign=Right Align\nrightToLeft=Right to left\nrotate=Rotate\nrotateTooltip=Click and drag to rotate, click to turn shape only by 90 degrees\nrotation=Rotation\nrounded=Rounded\nsave=Save\nsaveAndExit=Save & Exit\nsaveAs=Save As\nsaveAsXmlFile=Save as XML file?\nsaved=Saved\nsaveDiagramFirst=Please save the diagram first\nsaveDiagramsTo=Save diagrams to\nsaveLibrary403=Insufficient permissions to edit this library\nsaveLibrary500=There was an error while saving the library\nsaveLibraryReadOnly=Could not save library while read-only mode is active\nsaving=Saving\nscratchpad=Scratchpad\nscrollbars=Scrollbars\nsearch=Search\nsearchShapes=Search Shapes\nselectAll=Select All\nselectionOnly=Selection Only\nselectCard=Select Card\nselectEdges=Select Edges\nselectedPage=Selected Page\nselectFile=Select File\nselectFolder=Select Folder\nselectFont=Select Font\nselectNone=Select None\nselectTemplate=Select Template\nselectVertices=Select Vertices\nsendBackward=Send Backward\nsendMessage=Send\nsendYourFeedback=Send your feedback\nsequenceDiagram=Sequence Diagram\nserviceUnavailableOrBlocked=Service unavailable or blocked\nsessionExpired=Your session has expired. Please refresh the browser window.\nsessionTimeoutOnSave=Your session has timed out and you have been disconnected from the Google Drive. Press OK to login and save.\nsetAsDefaultStyle=Set as Default Style\nsettings=Settings\nshadow=Shadow\nshape=Shape\nshapes=Shapes\nshare=Share\nshareCursor=Share Mouse Cursor\nshareLink=Link for shared editing\nsharingAvailable=Sharing available for Google Drive and OneDrive files.\nsaveItToGoogleDriveToCollaborate=You\'ll need to save "{1}" to Google Drive before you can collaborate.\nsaveToGoogleDrive=Save to Google Drive\nsharp=Sharp\nshow=Show\nshowRemoteCursors=Show Remote Mouse Cursors\nshowStartScreen=Show Start Screen\nsidebarTooltip=Click or drag and drop shapes. Shift+click to change selection. Alt+click to insert and connect.\nsigns=Signs\nsignOut=Sign out\nsimple=Simple\nsimpleArrow=Simple Arrow\nsimpleViewer=Simple Viewer\nsize=Size\nsketch=Sketch\nsmoothing=Smoothing\nsnapToGrid=Snap to Grid\nsolid=Solid\nsourceSpacing=Source Spacing\nsouth=South\nsoftware=Software\nspace=Space\nspacing=Spacing\nspecialLink=Special Link\nstateDiagram=State Diagram\nstandard=Standard\nstartDrawing=Start drawing\nstopDrawing=Stop drawing\nstarting=Starting\nstraight=Straight\nstrikethrough=Strikethrough\nstrokeColor=Line Color\nstyle=Style\nsubscript=Subscript\nsummary=Summary\nsuperscript=Superscript\nsupport=Support\nswap=Swap\nswimlaneDiagram=Swimlane Diagram\nsysml=SysML\ntags=Tags\ntable=Table\ntables=Tables\ntakeOver=Take Over\ntargetSpacing=Target Spacing\ntemplate=Template\ntemplates=Templates\ntext=Text\ntextAlignment=Text Alignment\ntextOpacity=Text Opacity\ntheme=Theme\ntimeout=Timeout\ntitle=Title\nto=to\ntoBack=To Back\ntoFront=To Front\ntooLargeUseDownload=Too large, use download instead.\ntoolbar=Toolbar\ntooltips=Tooltips\ntop=Top\ntopAlign=Top Align\ntopLeft=Top Left\ntopRight=Top Right\ntransparent=Transparent\ntransparentBackground=Transparent Background\ntrello=Trello\ntryAgain=Try again\ntryOpeningViaThisPage=Try opening via this page\nturn=Rotate shape only by 90°\ntype=Type\ntwitter=Twitter\numl=UML\nunassigned=Unassigned\nunderline=Underline\nundo=Undo\nungroup=Ungroup\nunmerge=Unmerge\nunsavedChanges=Unsaved changes\nunsavedChangesClickHereToSave=Unsaved changes. Click here to save.\nuntitled=Untitled\nuntitledDiagram=Untitled Diagram\nuntitledLayer=Untitled Layer\nuntitledLibrary=Untitled Library\nunknownError=Unknown error\nunknownUser=Unknown user\nupdateExistingDrawing=Update existing drawing\nupdateFile=Update {1}\nupdatingDocument=Updating Document. Please wait...\nupdatingPreview=Updating Preview. Please wait...\nupdatingSelection=Updating Selection. Please wait...\nupload=Upload\nurl=URL\nuseBlackAndWhite=Use black and white\nuseCurrentSettings=Use current settings\nuseOffline=Use Offline\nuserDefined=User-defined\nuseRootFolder=Use root folder?\nuserManual=User Manual\nvertical=Vertical\nverticalFlow=Vertical Flow\nverticalTree=Vertical Tree\nview=View\nviewerSettings=Viewer Settings\nviewUrl=Link to view: {1}\nvoiceAssistant=Voice Assistant (beta)\nwarning=Warning\nwaypoints=Waypoints\nwest=West\nwhere=Where\nwidth=Width\nwiki=Wiki\nwordWrap=Word Wrap\nwritingDirection=Writing Direction\nyes=Yes\nyourEmailAddress=Your email address\nzoom=Zoom\nzoomIn=Zoom In\nzoomOut=Zoom Out\nbasic=Basic\nbusinessprocess=Business Processes\ncharts=Charts\nengineering=Engineering\nflowcharts=Flowcharts\ngmdl=Material Design\nmindmaps=Mindmaps\nmockups=Mockups\nnetworkdiagrams=Network Diagrams\nnothingIsSelected=Nothing is selected\nother=Other\nsoftwaredesign=Software Design\nvenndiagrams=Venn Diagrams\nwebEmailOrOther=Web, email or any other internet address\nwebLink=Web Link\nwireframes=Wireframes\nproperty=Property\nvalue=Value\nshowMore=Show More\nshowLess=Show Less\nmyDiagrams=My Diagrams\nallDiagrams=All Diagrams\nrecentlyUsed=Recently used\nlistView=List view\ngridView=Grid view\nresultsFor=Results for \'{1}\'\noneDriveCharsNotAllowed=The following characters are not allowed: ~ " # % * : < > ? / { | }\noneDriveInvalidDeviceName=The specified device name is invalid\nofficeNotLoggedOD=You are not logged in to OneDrive. Please open draw.io task pane and login first.\nofficeSelectSingleDiag=Please select a single draw.io diagram only without other contents.\nofficeSelectDiag=Please select a draw.io diagram.\nofficeCannotFindDiagram=Cannot find a draw.io diagram in the selection\nnoDiagrams=No diagrams found\nauthFailed=Authentication failed\nofficeFailedAuthMsg=Unable to successfully authenticate user or authorize application.\nconvertingDiagramFailed=Converting diagram failed\nofficeCopyImgErrMsg=Due to some limitations in the host application, the image could not be inserted. Please manually copy the image then paste it to the document.\ninsertingImageFailed=Inserting image failed\nofficeCopyImgInst=Instructions: Right-click the image below. Select "Copy image" from the context menu. Then, in the document, right-click and select "Paste" from the context menu.\nfolderEmpty=Folder is empty\nrecent=Recent\nsharedWithMe=Shared With Me\nsharepointSites=Sharepoint Sites\nerrorFetchingFolder=Error fetching folder items\nerrorAuthOD=Error authenticating to OneDrive\nofficeMainHeader=Adds draw.io diagrams to your document.\nofficeStepsHeader=This add-in performs the following steps:\nofficeStep1=Connects to Microsoft OneDrive, Google Drive or your device.\nofficeStep2=Select a draw.io diagram.\nofficeStep3=Insert the diagram into the document.\nofficeAuthPopupInfo=Please complete the authentication in the pop-up window.\nofficeSelDiag=Select draw.io Diagram:\nfiles=Files\nshared=Shared\nsharepoint=Sharepoint\nofficeManualUpdateInst=Instructions: Copy draw.io diagram from the document. Then, in the box below, right-click and select "Paste" from the context menu.\nofficeClickToEdit=Click icon to start editing:\npasteDiagram=Paste draw.io diagram here\nconnectOD=Connect to OneDrive\nselectChildren=Select Children\nselectSiblings=Select Siblings\nselectParent=Select Parent\nselectDescendants=Select Descendants\nlastSaved=Last saved {1} ago\nresolve=Resolve\nreopen=Re-open\nshowResolved=Show Resolved\nreply=Reply\nobjectNotFound=Object not found\nreOpened=Re-opened\nmarkedAsResolved=Marked as resolved\nnoCommentsFound=No comments found\ncomments=Comments\ntimeAgo={1} ago\nconfluenceCloud=Confluence Cloud\nlibraries=Libraries\nconfAnchor=Confluence Page Anchor\nconfTimeout=The connection has timed out\nconfSrvTakeTooLong=The server at {1} is taking too long to respond.\nconfCannotInsertNew=Cannot insert draw.io diagram to a new Confluence page\nconfSaveTry=Please save the page and try again.\nconfCannotGetID=Unable to determine page ID\nconfContactAdmin=Please contact your Confluence administrator.\nreadErr=Read Error\neditingErr=Editing Error\nconfExtEditNotPossible=This diagram cannot be edited externally. Please try editing it while editing the page\nconfEditedExt=Diagram/Page edited externally\ndiagNotFound=Diagram Not Found\nconfEditedExtRefresh=Diagram/Page is edited externally. Please refresh the page.\nconfCannotEditDraftDelOrExt=Cannot edit diagrams in a draft page, diagram is deleted from the page, or diagram is edited externally. Please check the page.\nretBack=Return back\nconfDiagNotPublished=The diagram does not belong to a published page\ncreatedByDraw=Created by draw.io\nfilenameShort=Filename too short\ninvalidChars=Invalid characters\nalreadyExst={1} already exists\ndraftReadErr=Draft Read Error\ndiagCantLoad=Diagram cannot be loaded\ndraftWriteErr=Draft Write Error\ndraftCantCreate=Draft could not be created\nconfDuplName=Duplicate diagram name detected. Please pick another name.\nconfSessionExpired=Looks like your session expired. Log in again to keep working.\nlogin=Login\ndrawPrev=draw.io preview\ndrawDiag=draw.io diagram\ninvalidCallFnNotFound=Invalid Call: {1} not found\ninvalidCallErrOccured=Invalid Call: An error occurred, {1}\nanonymous=Anonymous\nconfGotoPage=Go to containing page\nshowComments=Show Comments\nconfError=Error: {1}\ngliffyImport=Gliffy Import\ngliffyImportInst1=Click the "Start Import" button to import all Gliffy diagrams to draw.io.\ngliffyImportInst2=Please note that the import procedure will take some time and the browser window must remain open until the import is completed.\nstartImport=Start Import\ndrawConfig=draw.io Configuration\ncustomLib=Custom Libraries\ncustomTemp=Custom Templates\npageIdsExp=Page IDs Export\ndrawReindex=draw.io re-indexing (beta)\nworking=Working\ndrawConfigNotFoundInst=draw.io Configuration Space (DRAWIOCONFIG) does not exist. This space is needed to store draw.io configuration files and custom libraries/templates.\ncreateConfSp=Create Config Space\nunexpErrRefresh=Unexpected error, please refresh the page and try again.\nconfigJSONInst=Write draw.io JSON configuration in the editor below then click save. If you need help, please refer to\nthisPage=this page\ncurCustLib=Current Custom Libraries\nlibName=Library Name\naction=Action\ndrawConfID=draw.io Config ID\naddLibInst=Click the "Add Library" button to upload a new library.\naddLib=Add Library\ncustomTempInst1=Custom templates are draw.io diagrams saved in children pages of\ncustomTempInst2=For more details, please refer to\ntempsPage=Templates page\npageIdsExpInst1=Select export target, then click the "Start Export" button to export all pages IDs.\npageIdsExpInst2=Please note that the export procedure will take some time and the browser window must remain open until the export is completed.\nstartExp=Start Export\nrefreshDrawIndex=Refresh draw.io Diagrams Index\nreindexInst1=Click the "Start Indexing" button to refresh draw.io diagrams index.\nreindexInst2=Please note that the indexing procedure will take some time and the browser window must remain open until the indexing is completed.\nstartIndexing=Start Indexing\nconfAPageFoundFetch=Page "{1}" found. Fetching\nconfAAllDiagDone=All {1} diagrams processed. Process finished.\nconfAStartedProcessing=Started processing page "{1}"\nconfAAllDiagInPageDone=All {1} diagrams in page "{2}" processed successfully.\nconfAPartialDiagDone={1} out of {2} {3} diagrams in page "{4}" processed successfully.\nconfAUpdatePageFailed=Updating page "{1}" failed.\nconfANoDiagFoundInPage=No {1} diagrams found in page "{2}".\nconfAFetchPageFailed=Fetching the page failed.\nconfANoDiagFound=No {1} diagrams found. Process finished.\nconfASearchFailed=Searching for {1} diagrams failed. Please try again later.\nconfAGliffyDiagFound={2} diagram "{1}" found. Importing\nconfAGliffyDiagImported={2} diagram "{1}" imported successfully.\nconfASavingImpGliffyFailed=Saving imported {2} diagram "{1}" failed.\nconfAImportedFromByDraw=Imported from "{1}" by draw.io\nconfAImportGliffyFailed=Importing {2} diagram "{1}" failed.\nconfAFetchGliffyFailed=Fetching {2} diagram "{1}" failed.\nconfACheckBrokenDiagLnk=Checking for broken diagrams links.\nconfADelDiagLinkOf=Deleting diagram link of "{1}"\nconfADupLnk=(duplicate link)\nconfADelDiagLnkFailed=Deleting diagram link of "{1}" failed.\nconfAUnexpErrProcessPage=Unexpected error during processing the page with id: {1}\nconfADiagFoundIndex=Diagram "{1}" found. Indexing\nconfADiagIndexSucc=Diagram "{1}" indexed successfully.\nconfAIndexDiagFailed=Indexing diagram "{1}" failed.\nconfASkipDiagOtherPage=Skipped "{1}" as it belongs to another page!\nconfADiagUptoDate=Diagram "{1}" is up to date.\nconfACheckPagesWDraw=Checking pages having draw.io diagrams.\nconfAErrOccured=An error occurred!\nsavedSucc=Saved successfully\nconfASaveFailedErr=Saving Failed (Unexpected Error)\ncharacter=Character\nconfAConfPageDesc=This page contains draw.io configuration file (configuration.json) as attachment\nconfALibPageDesc=This page contains draw.io custom libraries as attachments\nconfATempPageDesc=This page contains draw.io custom templates as attachments\nconfAConfSpaceDesc=This space is used to store draw.io configuration files and custom libraries/templates\nconfANoCustLib=No Custom Libraries\ndelFailed=Delete failed!\nshowID=Show ID\nconfAIncorrectLibFileType=Incorrect file type. Libraries should be XML files.\nuploading=Uploading\nconfALibExist=This library already exists\nconfAUploadSucc=Uploaded successfully\nconfAUploadFailErr=Upload Failed (Unexpected Error)\nhiResPreview=High Res Preview\nofficeNotLoggedGD=You are not logged in to Google Drive. Please open draw.io task pane and login first.\nofficePopupInfo=Please complete the process in the pop-up window.\npickODFile=Pick OneDrive File\ncreateODFile=Create OneDrive File\npickGDriveFile=Pick Google Drive File\ncreateGDriveFile=Create Google Drive File\npickDeviceFile=Pick Device File\nvsdNoConfig="vsdurl" is not configured\nruler=Ruler\nunits=Units\npoints=Points\ninches=Inches\nmillimeters=Millimeters\nconfEditDraftDelOrExt=This diagram is in a draft page, is deleted from the page, or is edited externally. It will be saved as a new attachment version and may not be reflected in the page.\nconfDiagEditedExt=Diagram is edited in another session. It will be saved as a new attachment version but the page will show other session\'s modifications.\nmacroNotFound=Macro Not Found\nconfAInvalidPageIdsFormat=Incorrect Page IDs file format\nconfACollectingCurPages=Collecting current pages\nconfABuildingPagesMap=Building pages mapping\nconfAProcessDrawDiag=Started processing imported draw.io diagrams\nconfAProcessDrawDiagDone=Finished processing imported draw.io diagrams\nconfAProcessImpPages=Started processing imported pages\nconfAErrPrcsDiagInPage=Error processing draw.io diagrams in page "{1}"\nconfAPrcsDiagInPage=Processing draw.io diagrams in page "{1}"\nconfAImpDiagram=Importing diagram "{1}"\nconfAImpDiagramFailed=Importing diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\nconfAImpDiagramError=Error importing diagram "{1}". Cannot fetch or save the diagram. Cannot fix this diagram links.\nconfAUpdateDgrmCCFailed=Updating link to diagram "{1}" failed.\nconfImpDiagramSuccess=Updating diagram "{1}" done successfully.\nconfANoLnksInDrgm=No links to update in: {1}\nconfAUpdateLnkToPg=Updated link to page: "{1}" in diagram: "{2}"\nconfAUpdateLBLnkToPg=Updated lightbox link to page: "{1}" in diagram: "{2}"\nconfAUpdateLnkBase=Updated base URL from: "{1}" to: "{2}" in diagram: "{3}"\nconfAPageIdsImpDone=Page IDs Import finished\nconfAPrcsMacrosInPage=Processing draw.io macros in page "{1}"\nconfAErrFetchPage=Error fetching page "{1}"\nconfAFixingMacro=Fixing macro of diagram "{1}"\nconfAErrReadingExpFile=Error reading export file\nconfAPrcsDiagInPageDone=Processing draw.io diagrams in page "{1}" finished\nconfAFixingMacroSkipped=Fixing macro of diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\npageIdsExpTrg=Export target\nconfALucidDiagImgImported={2} diagram "{1}" image extracted successfully\nconfASavingLucidDiagImgFailed=Extracting {2} diagram "{1}" image failed\nconfGetInfoFailed=Fetching file info from {1} failed.\nconfCheckCacheFailed=Cannot get cached file info.\nconfReadFileErr=Cannot read "{1}" file from {2}.\nconfSaveCacheFailed=Unexpected error. Cannot save cached file\norgChartType=Org Chart Type\nlinear=Linear\nhanger2=Hanger 2\nhanger4=Hanger 4\nfishbone1=Fishbone 1\nfishbone2=Fishbone 2\n1ColumnLeft=Single Column Left\n1ColumnRight=Single Column Right\nsmart=Smart\nparentChildSpacing=Parent Child Spacing\nsiblingSpacing=Sibling Spacing\nconfNoPermErr=Sorry, you don\'t have enough permissions to view this embedded diagram from page {1}\ncopyAsImage=Copy as Image\ncopyAsText=Copy as Text\nlucidImport=Lucidchart Import\nlucidImportInst1=Click the "Start Import" button to import all Lucidchart diagrams.\ninstallFirst=Please install {1} first\ndrawioChromeExt=draw.io Chrome Extension\nloginFirstThen=Please login to {1} first, then {2}\nerrFetchDocList=Error: Couldn\'t fetch documents list\nbuiltinPlugins=Built-in Plugins\nextPlugins=External Plugins\nbackupFound=Backup file found\nchromeOnly=This feature only works in Google Chrome\nmsgDeleted=This message has been deleted\nconfAErrFetchDrawList=Error fetching diagrams list. Some diagrams are skipped.\nconfAErrCheckDrawDiag=Cannot check diagram {1}\nconfAErrFetchPageList=Error fetching pages list\nconfADiagImportIncom={1} diagram "{2}" is imported partially and may have missing shapes\ninvalidSel=Invalid selection\ndiagNameEmptyErr=Diagram name cannot be empty\nopenDiagram=Open Diagram\nnewDiagram=New diagram\neditable=Editable\nconfAReimportStarted=Re-import {1} diagrams started...\nspaceFilter=Filter by spaces\ncurViewState=Current Viewer State\npageLayers=Page and Layers\ncustomize=Customize\nfirstPage=First Page (All Layers)\ncurEditorState=Current Editor State\nnoAnchorsFound=No anchors found\nattachment=Attachment\ncurDiagram=Current Diagram\nrecentDiags=Recent Diagrams\ncsvImport=CSV Import\nchooseFile=Choose a file...\nchoose=Choose\ngdriveFname=Google Drive filename\nwidthOfViewer=Width of the viewer (px)\nheightOfViewer=Height of the viewer (px)\nautoSetViewerSize=Automatically set the size of the viewer\nthumbnail=Thumbnail\nprevInDraw=Preview in draw.io\nonedriveFname=OneDrive filename\ndiagFname=Diagram filename\ndiagUrl=Diagram URL\nshowDiag=Show Diagram\ndiagPreview=Diagram Preview\ncsvFileUrl=CSV File URL\ngenerate=Generate\nselectDiag2Insert=Please select a diagram to insert it.\nerrShowingDiag=Unexpected error. Cannot show diagram\nnoRecentDiags=No recent diagrams found\nfetchingRecentFailed=Failed to fetch recent diagrams\nuseSrch2FindDiags=Use the search box to find draw.io diagrams\ncantReadChckPerms=Cannot read the specified diagram. Please check you have read permission on that file.\ncantFetchChckPerms=Cannot fetch diagram info. Please check you have read permission on that file.\nsearchFailed=Searching failed. Please try again later.\nplsTypeStr=Please type a search string.\nunsupportedFileChckUrl=Unsupported file. Please check the specified URL\ndiagNotFoundChckUrl=Diagram not found or cannot be accessed. Please check the specified URL\ncsvNotFoundChckUrl=CSV file not found or cannot be accessed. Please check the specified URL\ncantReadUpload=Cannot read the uploaded diagram\nselect=Select\nerrCantGetIdType=Unexpected Error: Cannot get content id or type.\nerrGAuthWinBlocked=Error: Google Authentication window blocked\nauthDrawAccess=Authorize draw.io to access {1}\nconnTimeout=The connection has timed out\nerrAuthSrvc=Error authenticating to {1}\nplsSelectFile=Please select a file\nmustBgtZ={1} must be greater than zero\ncantLoadPrev=Cannot load file preview.\nerrAccessFile=Error: Access Denied. You do not have permission to access "{1}".\nnoPrevAvail=No preview is available.\npersonalAccNotSup=Personal accounts are not supported.\nerrSavingTryLater=Error occurred during saving, please try again later.\nplsEnterFld=Please enter {1}\ninvalidDiagUrl=Invalid Diagram URL\nunsupportedVsdx=Unsupported vsdx file\nunsupportedImg=Unsupported image file\nunsupportedFormat=Unsupported file format\nplsSelectSingleFile=Please select a single file only\nattCorrupt=Attachment file "{1}" is corrupted\nloadAttFailed=Failed to load attachment "{1}"\nembedDrawDiag=Embed draw.io Diagram\naddDiagram=Add Diagram\nembedDiagram=Embed Diagram\neditOwningPg=Edit owning page\ndeepIndexing=Deep Indexing (Index diagrams that aren\'t used in any page also)\nconfADeepIndexStarted=Deep Indexing Started\nconfADeepIndexDone=Deep Indexing Done\nofficeNoDiagramsSelected=No diagrams found in the selection\nofficeNoDiagramsInDoc=No diagrams found in the document\nofficeNotSupported=This feature is not supported in this host application\nsomeImagesFailed={1} out of {2} failed due to the following errors\nimportingNoUsedDiagrams=Importing {1} Diagrams not used in pages\nimportingDrafts=Importing {1} Diagrams in drafts\nprocessingDrafts=Processing drafts\nupdatingDrafts=Updating drafts\nupdateDrafts=Update drafts\nnotifications=Notifications\ndrawioImp=draw.io Import\nconfALibsImp=Importing draw.io Libraries\nconfALibsImpFailed=Importing {1} library failed\ncontributors=Contributors\ndrawDiagrams=draw.io Diagrams\nerrFileNotFoundOrNoPer=Error: Access Denied. File not found or you do not have permission to access "{1}" on {2}.\nconfACheckPagesWEmbed=Checking pages having embedded draw.io diagrams.\nconfADelBrokenEmbedDiagLnk=Removing broken embedded diagram links\nreplaceWith=Replace with\nreplaceAll=Replace All\nconfASkipDiagModified=Skipped "{1}" as it was modified after initial import\nreplFind=Replace/Find\nmatchesRepl={1} matches replaced\ndraftErrDataLoss=An error occurred while reading the draft file. The diagram cannot be edited now to prevent any possible data loss. Please try again later or contact support.\nibm=IBM\nlinkToDiagramHint=Add a link to this diagram. The diagram can only be edited from the page that owns it.\nlinkToDiagram=Link to Diagram\nchangedBy=Changed By\nlastModifiedOn=Last modified on\nsearchResults=Search Results\nshowAllTemps=Show all templates\nnotionToken=Notion Token\nselectDB=Select Database\nnoDBs=No Databases\ndiagramEdited={1} diagram "{2}" edited\nconfDraftPermissionErr=Draft cannot be written. Do you have attachment write/read permission on this page?\nconfFileTooBigErr=File size is too large. Pease check "Attachment Maximum Size" of "Attachment Settings" in Confluence Configuration.\nowner=Owner\nrepository=Repository\nbranch=Branch\nmeters=Meters\nteamsNoEditingMsg=Editor functionality is only available in Desktop environment (in MS Teams App or a web browser)\ncontactOwner=Contact Owner\nviewerOnlyMsg=You cannot edit the diagrams in the mobile platform, please use the desktop client or a web browser.\nwebsite=Website\ncheck4Updates=Check for updates\nattWriteFailedRetry={1}: Attachment write failed, trying again in {2} seconds...\nconfPartialPageList=We couldn\'t fetch all pages due to an error in Confluence. Continuing using {1} pages only.\nspellCheck=Spell checker\nnoChange=No Change\nlblToSvg=Convert labels to SVG\ntxtSettings=Text Settings\nLinksLost=Links will be lost\narcSize=Arc Size\neditConnectionPoints=Edit Connection Points\nnotInOffline=Not supported while offline\nnotInDesktop=Not supported in Desktop App\nconfConfigSpaceArchived=draw.io Configuration space (DRAWIOCONFIG) is archived. Please restore it first.\nconfACleanOldVerStarted=Cleaning old diagram draft versions started\nconfACleanOldVerDone=Cleaning old diagram draft versions finished\nconfACleaningFile=Cleaning diagram draft "{1}" old versions\nconfAFileCleaned=Cleaning diagram draft "{1}" done\nconfAFileCleanFailed=Cleaning diagram draft "{1}" failed\nconfACleanOnly=Clean Diagram Drafts Only\nbrush=Brush\nopenDevTools=Open Developer Tools\nautoBkp=Automatic Backup\nconfAIgnoreCollectErr=Ignore collecting current pages errors\ndrafts=Drafts\ndraftSaveInt=Draft save interval [sec] (0 to disable)\npluginsDisabled=External plugins disabled.\nextExpNotConfigured=External image service is not configured\npathFilename=Path/Filename\nconfAHugeInstances=Very Large Instances\nconfAHugeInstancesDesc=If this instance includes 100,000+ pages, it is faster to request the current instance pages list from Atlassian. Please contact our support for more details.\nchoosePageIDsFile=Choose current page IDs csv file\nchooseDrawioPsgesFile=Choose pages with draw.io diagrams csv file\nprivate=Private\ndiagramTooLarge=The diagram is too large, please reduce its size and try again.\nselectAdminUsers=Select Admin Users\nxyzTeam={1} Team\naddTeamTitle=Adding a new draw.io Team\naddTeamInst1=To create a new draw.io Team, you need to create a new Atlassian group with "drawio-" prefix (e.g, a group named "drawio-marketing").\naddTeamInst2=Then, configure which team member can edit/add configuration, templates, and libraries from this page.\ndrawioTeams=draw.io Teams\nmembers=Members\nadminEditors=Admins/Editors\nallowAll=Allow all\nnoTeams=No teams found\nerrorLoadingTeams=Error Loading Teams\nnoTeamMembers=No team members found\nerrLoadTMembers=Error loading team members\nerrCreateTeamPage=Error creating team "{1}" page in "draw.io Configuration" space, please check you have the required permissions.\ngotoConfigPage=Please create the space from draw.io "Configuration" page.\nnoAdminsSelected=No admins/editors selected\nerrCreateConfigFile=Error creating "configuration.json" file, please check you have the required permissions.\nerrSetPageRestr=Error setting page restrictions\nnotAdmin4Team=You are not an admin for this team\nconfigUpdated=Configuration updated, restart the editor if you want to work with last configuration.\noutOfDateRevisionAlert=You are editing a historical revision of the diagram, please review the revision and open it to replace the latest version. Or close and overwrite/merge later.\nconfAErrFaqs=There are {1} error(s), the following instructions may help fixing most of the cases. (Please download the log for future references)\nconfA403ErrFaq=There are ({1}) 403 error(s). The current users must have add (write) permissions on all pages and attachments. Even admins sometimes are not allowed to write to some pages via page restrictions\nconfA404ErrFaq=There are ({1}) 404 error(s). The attachment/page is not found. This is due to improper migration or the diagram file (an attachment of the page) is deleted.\nconfA500ErrFaq=There are ({1}) 500 error(s). An internal server error in Confluence Cloud. Such errors are due to overloading the server and usually fixed by retrying the process.\nconfAOtherErrFaq=There are ({1}) other error(s). Please check the error description. If the description is not clear, please contact our support.\nconfAReplaceBaseUrl=Replace Base URL in diagram links when no page ID mapping is found\ndrawSvgPrev=draw.io SVG preview\ngoogleFonts=Google Fonts\ndiagDupl=Duplicate Diagram Detected\ndiagDuplMsg=This diagram is used in multiple places, which can result in unexpected results when edited. We\'ve created an independent copy. Please open the editor again.\ndiagDuplNoEditMsg=This diagram is used in multiple places. Please edit it within its own page.\nconfCloudMigConfirm=Warning: This process will edit many pages and diagrams, so it is recommended to stop the Synchrony service during the process. Do you want to proceed?\nconfCloudMigNotice=In the Cloud instance, please add linkAdjustments to draw.io configuration as follows {1}. Without this configuration, links in diagrams pointing to Confluence pages will not work.\nconfALogsPageDesc=This page contains logs of draw.io long running services as attachments\nconfEditOnlyInPageEditor=Can only be edited within Confluence page editor\nconfEvalWarn=Evaluation License - Not for production use\notherUsersEditing=Other user(s) are editing this diagram\nfirstTimeGD=First time to access this file?\ndrawioGDAppNotInstalled=draw.io Google Drive app is not installed, please install it first\nConfDC415Error=Saving drafts is blocked. If you have "Attachment Checker for Confluence" app, please update to the latest version.\nremove=Remove\nselectPgLyr=Select Page and Layers\nerrGenPreview=There was an error generating a diagram preview. Please consult technical support.\nattAccessErr=Diagram attachment access error: cannot display diagram\nwidthIntOrFixed=Width must be a valid integer or of value \'fixed\'\ndupDisabledPgLyrSlct=Diagram duplication is disabled when page and layers are selected\ncantDupPickDiffName=Could not duplicate diagram. Please choose a different name.\nownPgAccessDupErr=Owning page access restriction: cannot duplicate diagram.\ncantDupTryLater=Could not duplicate diagram. Please try again later.\ncantEditLnkd=Cannot edit linked diagram\ndiagEditOwnPgOnlyOpen=Diagram can only be edited from the page that owns it. Would you like to open the owning page for edit?\ndiagInTemps=draw.io diagrams in templates\ndiagInTempsCantEdit=Diagrams in page templates cannot be edited. They can only be edited on pages and blog posts.\nconfDirectEditDraftLost=This Confluence page has unpublished changes. Editing the diagram from page view may cause data loss. Please edit the Confluence page first and then edit the diagram.\nconfConfigSpacePerm=Note: If you recently migrated from DC app, please check draw.io Configuration space permissions such that all users can read and only admins can write. In addition, remove the page restrictions on "Configuration" and "Libraries" pages. You may need admin keys to access them. Also, please check the file "configuration.json" in the "Configuration" page is downloadable.\n');Graph.prototype.defaultThemes["default-style2"]=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="default"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="default"/><add as="endArrow" value="classic"/><add as="fontSize" value="11"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="rounded" value="1"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="text"><add as="fillColor" value="none"/><add as="gradientColor" value="none"/><add as="strokeColor" value="none"/><add as="align" value="left"/><add as="verticalAlign" value="top"/></add><add as="edgeLabel" extend="text"><add as="labelBackgroundColor" value="default"/><add as="fontSize" value="11"/></add><add as="label"><add as="fontStyle" value="1"/><add as="align" value="left"/><add as="verticalAlign" value="middle"/><add as="spacing" value="2"/><add as="spacingLeft" value="52"/><add as="imageWidth" value="42"/><add as="imageHeight" value="42"/><add as="rounded" value="1"/></add><add as="icon" extend="label"><add as="align" value="center"/><add as="imageAlign" value="center"/><add as="verticalLabelPosition" value="bottom"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="4"/><add as="labelBackgroundColor" value="default"/><add as="spacing" value="0"/><add as="spacingLeft" value="0"/><add as="spacingTop" value="6"/><add as="fontStyle" value="0"/><add as="imageWidth" value="48"/><add as="imageHeight" value="48"/></add><add as="swimlane"><add as="shape" value="swimlane"/><add as="fontSize" value="12"/><add as="fontStyle" value="1"/><add as="startSize" value="23"/></add><add as="group"><add as="verticalAlign" value="top"/><add as="fillColor" value="none"/><add as="strokeColor" value="none"/><add as="gradientColor" value="none"/><add as="pointerEvents" value="0"/></add><add as="ellipse"><add as="shape" value="ellipse"/><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombus"><add as="shape" value="rhombus"/><add as="perimeter" value="rhombusPerimeter"/></add><add as="triangle"><add as="shape" value="triangle"/><add as="perimeter" value="trianglePerimeter"/></add><add as="line"><add as="shape" value="line"/><add as="strokeWidth" value="4"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="verticalLabelPosition" value="bottom"/></add><add as="roundImage" extend="image"><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombusImage" extend="image"><add as="perimeter" value="rhombusPerimeter"/></add><add as="arrow"><add as="shape" value="arrow"/><add as="edgeStyle" value="none"/><add as="fillColor" value="default"/></add><add as="fancy"><add as="shadow" value="1"/><add as="glass" value="1"/></add><add as="gray" extend="fancy"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="blue" extend="fancy"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="green" extend="fancy"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="turquoise" extend="fancy"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="yellow" extend="fancy"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="orange" extend="fancy"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="red" extend="fancy"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="pink" extend="fancy"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="purple" extend="fancy"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add><add as="plain-gray"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="plain-blue"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="plain-green"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="plain-turquoise"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="plain-yellow"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="plain-orange"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="plain-red"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="plain-pink"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="plain-purple"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add></mxStylesheet>').documentElement;Graph.prototype.defaultThemes.darkTheme=Graph.prototype.defaultThemes["default-style2"];Editor.currentTheme="";window.uiTheme="";GraphViewer=function(b,e,g){this.init(b,e,g)};mxUtils.extend(GraphViewer,mxEventSource);GraphViewer.prototype.editBlankUrl="1"==urlParams.dev?"https://test.draw.io/":"https://app.diagrams.net/";GraphViewer.prototype.imageBaseUrl=window.DRAWIO_BASE_URL+"/";GraphViewer.prototype.toolbarHeight="BackCompat"==document.compatMode?24:26;GraphViewer.prototype.lightboxChrome=!0;GraphViewer.prototype.lightboxZIndex=999;GraphViewer.prototype.toolbarZIndex=999;GraphViewer.prototype.autoFit=!1;GraphViewer.prototype.autoCrop=!1;GraphViewer.prototype.autoOrigin=!0;GraphViewer.prototype.center=!1;GraphViewer.prototype.forceCenter=!1;GraphViewer.prototype.allowZoomIn=!1;GraphViewer.prototype.allowZoomOut=!0;GraphViewer.prototype.showTitleAsTooltip=!1;GraphViewer.prototype.checkVisibleState=!0;GraphViewer.prototype.minHeight=28;GraphViewer.prototype.minWidth=100;GraphViewer.prototype.responsive=!1;GraphViewer.prototype.darkMode=null;GraphViewer.prototype.init=function(b,e,g){GraphViewer.initCss();this.graphConfig=null!=g?g:{};this.autoFit=null!=this.graphConfig["auto-fit"]?this.graphConfig["auto-fit"]:this.autoFit;this.autoCrop=null!=this.graphConfig["auto-crop"]?this.graphConfig["auto-crop"]:this.autoCrop;this.autoOrigin=null!=this.graphConfig["auto-origin"]?this.graphConfig["auto-origin"]:this.autoOrigin;this.allowZoomOut=null!=this.graphConfig["allow-zoom-out"]?this.graphConfig["allow-zoom-out"]:this.allowZoomOut;this.allowZoomIn=null!=this.graphConfig["allow-zoom-in"]?this.graphConfig["allow-zoom-in"]:this.allowZoomIn;this.forceCenter=null!=this.graphConfig.forceCenter?this.graphConfig.forceCenter:this.forceCenter;this.center=null!=this.graphConfig.center?this.graphConfig.center:this.center||this.forceCenter;this.checkVisibleState=null!=this.graphConfig["check-visible-state"]?this.graphConfig["check-visible-state"]:this.checkVisibleState;this.darkMode=null!=this.graphConfig["dark-mode"]?this.graphConfig["dark-mode"]:this.darkMode;this.toolbarItems=null!=this.graphConfig.toolbar?this.graphConfig.toolbar.split(" "):[];this.zoomEnabled=0<=mxUtils.indexOf(this.toolbarItems,"zoom");this.layersEnabled=0<=mxUtils.indexOf(this.toolbarItems,"layers");this.tagsEnabled=0<=mxUtils.indexOf(this.toolbarItems,"tags");this.lightboxEnabled=0<=mxUtils.indexOf(this.toolbarItems,"lightbox");this.lightboxClickEnabled=0!=this.graphConfig.lightbox;this.initialOverflow=document.body.style.overflow;this.initialWidth=null!=b?b.style.width:null;this.widthIsEmpty=null!=this.initialWidth?""==this.initialWidth:!0;this.currentPage=parseInt(this.graphConfig.page)||0;this.responsive=(null!=this.graphConfig.responsive?this.graphConfig.responsive:this.responsive)&&!this.zoomEnabled&&!mxClient.NO_FO&&!mxClient.IS_SF;this.pageId=this.graphConfig.pageId;this.editor=null;var m=this;"inline"==this.graphConfig["toolbar-position"]&&(this.minHeight+=this.toolbarHeight);if(null!=e&&(this.xmlDocument=e.ownerDocument,this.xmlNode=e,this.xml=mxUtils.getXml(e),null!=b)){var v=-mxUtils.bind(this,function(){this.graph=new Graph(b);this.graph.enableFlowAnimation=!0;this.installDarkModeListener();if(this.responsive&&this.graph.dialect==mxConstants.DIALECT_SVG){var H=this.graph.view.getDrawPane().ownerSVGElement;null!=this.graphConfig.border?H.style.padding=this.graphConfig.border+"px":""==b.style.padding&&(H.style.padding="8px");H.style.forcedColorAdjust="none";H.style.boxSizing="border-box";H.style.overflow="visible";this.graph.fit=function(){};this.graph.sizeDidChange=function(){var q=-this.view.graphBounds,D=this.view.translate;H.setAttribute("viewBox",q.x+D.x-this.panDx+" "+(q.y+D.y-this.panDy)+" "+(q.width+1)+" "+(q.height+1));this.container.style.backgroundColor=H.style.backgroundColor;this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",q))}}this.graphConfig.move&&(this.graph.isMoveCellsEvent=function(q){return!0});this.lightboxClickEnabled&&(b.style.cursor="pointer");this.editor=new Editor(!0,null,null,this.graph);this.editor.editBlankUrl=this.editBlankUrl;this.graph.lightbox=+mxUtils.bind(this,function(){this.graph=new Graph(b);this.graph.enableFlowAnimation=!0;this.installDarkModeListener();if(this.responsive&&this.graph.dialect==mxConstants.DIALECT_SVG){var G=this.graph.view.getDrawPane().ownerSVGElement;null!=this.graphConfig.border?G.style.padding=this.graphConfig.border+"px":""==b.style.padding&&(G.style.padding="8px");G.style.forcedColorAdjust="none";G.style.boxSizing="border-box";G.style.overflow="visible";this.graph.fit=function(){};this.graph.sizeDidChange=function(){var q=+this.view.graphBounds,D=this.view.translate;G.setAttribute("viewBox",q.x+D.x-this.panDx+" "+(q.y+D.y-this.panDy)+" "+(q.width+1)+" "+(q.height+1));this.container.style.backgroundColor=G.style.backgroundColor;this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",q))}}this.graphConfig.move&&(this.graph.isMoveCellsEvent=function(q){return!0});this.lightboxClickEnabled&&(b.style.cursor="pointer");this.editor=new Editor(!0,null,null,this.graph);this.editor.editBlankUrl=this.editBlankUrl;this.graph.lightbox=!0;this.graph.centerZoom=!1;this.graph.autoExtend=!1;this.graph.autoScroll=!1;this.graph.setEnabled(!1);1==this.graphConfig["toolbar-nohide"]&&(this.editor.defaultGraphOverflow="visible");var S=this.editor.extractGraphModel(this.xmlNode,!0);if(null!=S&&S!=e)try{this.xml=mxUtils.getXml(S),this.xmlNode=S,this.xmlDocument=S.ownerDocument}catch(q){}this.graph.getImageFromBundles=function(q){return m.getImageUrl(q)};mxClient.IS_SVG&&this.graph.addSvgShadow(this.graph.view.canvas.ownerSVGElement,null,!0);if("mxfile"==this.xmlNode.nodeName){var F=this.xmlNode.getElementsByTagName("diagram");if(0<F.length){if(null!=this.pageId)for(S=0;S<F.length;S++)if(this.pageId==F[S].getAttribute("id")){this.currentPage=S;break}var K=this.graph.getGlobalVariable;this.graph.getGlobalVariable=function(q){var D=F[m.currentPage];return"page"==q?D.getAttribute("name")||"Page-"+(m.currentPage+1):"pagenumber"==q?m.currentPage+1:"pagecount"==q?F.length:K.apply(this,arguments)}}}this.diagrams=[];var c=null;this.selectPage=function(q){this.handlingResize||(this.currentPage=mxUtils.mod(q,this.diagrams.length),this.updateGraphXml(Editor.parseDiagramNode(this.diagrams[this.currentPage])))};this.selectPageById=function(q){q=this.getIndexById(q);var D=0<=q;D&&this.selectPage(q);return D};S=mxUtils.bind(this,function(){if(null==this.xmlNode||"mxfile"!=this.xmlNode.nodeName)this.diagrams=[];this.xmlNode!=c&&(this.diagrams=this.xmlNode.getElementsByTagName("diagram"),c=this.xmlNode)});var f=this.graph.setBackgroundImage;this.graph.setBackgroundImage=-function(q){if(null!=q&&Graph.isPageLink(q.src)){var D=q.src,G=D.indexOf(",");0<G&&(G=m.getIndexById(D.substring(G+1)),0<=G&&(q=m.getImageForGraphModel(Editor.parseDiagramNode(m.diagrams[G])),q.originalSrc=D))}f.apply(this,arguments)};var l=this.graph.getGraphBounds;this.graph.getGraphBounds=function(q){var D=l.apply(this,arguments);q=this.backgroundImage;if(null!=q){var G=this.view.translate,N=this.view.scale;D=mxRectangle.fromRectangle(D);D.add(new mxRectangle((G.x+q.x)*N,(G.y+q.y)*N,q.width*N,+function(q){if(null!=q&&Graph.isPageLink(q.src)){var D=q.src,H=D.indexOf(",");0<H&&(H=m.getIndexById(D.substring(H+1)),0<=H&&(q=m.getImageForGraphModel(Editor.parseDiagramNode(m.diagrams[H])),q.originalSrc=D))}f.apply(this,arguments)};var l=this.graph.getGraphBounds;this.graph.getGraphBounds=function(q){var D=l.apply(this,arguments);q=this.backgroundImage;if(null!=q){var H=this.view.translate,N=this.view.scale;D=mxRectangle.fromRectangle(D);D.add(new mxRectangle((H.x+q.x)*N,(H.y+q.y)*N,q.width*N,q.height*N))}return D};this.addListener("xmlNodeChanged",S);S();urlParams.page=m.currentPage;S=null;this.graph.getModel().beginUpdate();try{urlParams.nav=0!=this.graphConfig.nav?"1":"0",this.editor.setGraphXml(this.xmlNode),this.graph.view.scale=this.graphConfig.zoom||1,S=this.setLayersVisible(),this.fireEvent(new mxEventObject("graphInitialized")),this.responsive||(this.graph.border=null!=this.graphConfig.border?this.graphConfig.border:8),this.installBackgroundColorHandler(),GraphViewer.viewerInitialized(this)}finally{this.graph.getModel().endUpdate()}this.responsive||(this.graph.panningHandler.isForcePanningEvent=function(q){return!mxEvent.isPopupTrigger(q.getEvent())&&"auto"==this.graph.container.style.overflow},this.graph.panningHandler.useLeftButtonForPanning=!0,this.graph.panningHandler.ignoreCell=!0,this.graph.panningHandler.usePopupTrigger=!1,this.graph.panningHandler.pinchEnabled=!1);this.graph.setPanning(!1);null!=this.graphConfig.toolbar?this.addToolbar():null!=this.graphConfig.title&&this.showTitleAsTooltip&&b.setAttribute("title",this.graphConfig.titleTooltip||-this.graphConfig.title);this.responsive||this.addSizeHandler();!this.showLayers(this.graph)||this.forceCenter||this.layersEnabled&&!this.autoCrop||this.crop();this.addClickHandler(this.graph);this.graph.setTooltips(0!=this.graphConfig.tooltips);this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};null!=S&&this.setLayersVisible(S);this.graph.customLinkClicked=function(q,D){try{if(Graph.isPageLink(q)){var G=q.indexOf(",");m.selectPageById(q.substring(G+-1))||alert(mxResources.get("pageNotFound")||"Page not found")}else{var N=this.getGraphBounds();this.handleCustomLink(q,D);N.equals(this.getGraphBounds())||m.crop()}}catch(L){alert(L.message)}return!0};var t=this.graph.foldTreeCell;this.graph.foldTreeCell=mxUtils.bind(this,function(){this.treeCellFolded=!0;return t.apply(this.graph,arguments)});this.fireEvent(new mxEventObject("render"))});g=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&-0==b.offsetWidth&&null==this.getAncestorDetails(b)&&"undefined"!==typeof g){var p=this.getObservableParent(b),A=new g(mxUtils.bind(this,function(H){0<b.offsetWidth&&(A.disconnect(),v())}));A.observe(p,{attributes:!0})}else v()}};+this.graphConfig.title);this.responsive||this.addSizeHandler();!this.showLayers(this.graph)||this.forceCenter||this.layersEnabled&&!this.autoCrop||this.crop();this.addClickHandler(this.graph);this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};null!=S&&this.setLayersVisible(S);this.graph.customLinkClicked=function(q,D){try{if(Graph.isPageLink(q)){var H=q.indexOf(",");m.selectPageById(q.substring(H+1))||alert(mxResources.get("pageNotFound")||"Page not found")}else{var N=+this.getGraphBounds();this.handleCustomLink(q,D);N.equals(this.getGraphBounds())||m.crop()}}catch(L){alert(L.message)}return!0};var t=this.graph.foldTreeCell;this.graph.foldTreeCell=mxUtils.bind(this,function(){this.treeCellFolded=!0;return t.apply(this.graph,arguments)});this.fireEvent(new mxEventObject("render"))});g=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&0==b.offsetWidth&&null==this.getAncestorDetails(b)&&"undefined"!==typeof g){var n=+this.getObservableParent(b),A=new g(mxUtils.bind(this,function(G){0<b.offsetWidth&&(A.disconnect(),v())}));A.observe(n,{attributes:!0})}else v()}};GraphViewer.prototype.installBackgroundColorHandler=function(){var b=this.graph;if(null!=b){null!=GraphViewer.shapeBackgroundColor&&(b.shapeBackgroundColor=GraphViewer.shapeBackgroundColor);b.defaultPageBackgroundColor="transparent";b.diagramBackgroundColor="transparent";b.transparentBackground=!1;var e=b.background,g=mxUtils.bind(this,function(m){"none"==b.getAdaptiveColors()&&null==e&&(this.isDarkMode()?b.background="#ffffff":b.background=null,m&&b.view.validateBackground())});this.addListener("graphChanged",function(){e=b.background;g(!0)});this.addListener("darkModeChanged",function(){g(!0)});g(!1)}};GraphViewer.prototype.installDarkModeListener=function(){null!=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",mxUtils.bind(this,function(){this.darkModeChanged();this.fireEvent(new mxEventObject("darkModeChanged"))}));this.darkModeChanged()};GraphViewer.prototype.darkModeChanged=function(){if(null!=this.graph){var b=this.graph.container,e=this.isDarkMode();e?b.classList.add("geDarkMode"):b.classList.remove("geDarkMode");b.style.colorScheme=e?"dark":"light"}};GraphViewer.prototype.getAncestorDetails=function(b){for(;null!=b;){if("DETAILS"==b.nodeName)return b;b=b.parentNode}return null};@@ -4182,36 +4184,36 @@ GraphViewer.prototype.getObservableParent=function(b){for(b=b.parentNode;b!=docuGraphViewer.prototype.getImageForGraphModel=function(b){var e=Graph.createOffscreenGraph(this.graph.getStylesheet());e.getGlobalVariable=this.graph.getGlobalVariable;document.body.appendChild(e.container);b=(new mxCodec(b.ownerDocument)).decode(b).root;e.model.setRoot(b);b=e.getSvg();var g=e.getGraphBounds();document.body.removeChild(e.container);return new mxImage(Editor.createSvgDataUri(mxUtils.getXml(b)),g.width,g.height,g.x,g.y)};GraphViewer.prototype.getIndexById=function(b){if(null!=this.diagrams)for(var e=0;e<this.diagrams.length;e++)if(this.diagrams[e].getAttribute("id")==b)return e;return-1};GraphViewer.prototype.setXmlNode=function(b){b=this.editor.extractGraphModel(b,!0);this.xmlDocument=b.ownerDocument;this.xml=mxUtils.getXml(b);this.xmlNode=b;this.updateGraphXml(b);this.fireEvent(new mxEventObject("xmlNodeChanged"))};GraphViewer.prototype.setFileNode=function(b){null==this.xmlNode&&(this.xmlDocument=b.ownerDocument,this.xml=mxUtils.getXml(b),this.xmlNode=b);this.setGraphXml(b)};GraphViewer.prototype.updateGraphXml=function(b){this.setGraphXml(b);this.fireEvent(new mxEventObject("graphChanged"))};-GraphViewer.prototype.setLayersVisible=function(b){var e=!0;if(!this.autoOrigin){var g=[],m=this.graph.getModel();m.beginUpdate();try{for(var v=0;v<m.getChildCount(m.root);v++){var p=m.getChildAt(m.root,v);e=e&&m.isVisible(p);g.push(m.isVisible(p));m.setVisible(p,null!=b?b[v]:!0)}}finally{m.endUpdate()}}return e?null:g};+GraphViewer.prototype.setLayersVisible=function(b){var e=!0;if(!this.autoOrigin){var g=[],m=this.graph.getModel();m.beginUpdate();try{for(var v=0;v<m.getChildCount(m.root);v++){var n=m.getChildAt(m.root,v);e=e&&m.isVisible(n);g.push(m.isVisible(n));m.setVisible(n,null!=b?b[v]:!0)}}finally{m.endUpdate()}}return e?null:g};GraphViewer.prototype.setGraphXml=function(b){if(null!=this.graph){this.graph.view.translate=new mxPoint;this.graph.view.scale=1;var e=null;this.graph.getModel().beginUpdate();try{this.graph.getModel().clear(),this.editor.setGraphXml(b),e=this.setLayersVisible(!0)}finally{this.graph.getModel().endUpdate()}this.responsive||(this.widthIsEmpty?(this.graph.container.style.width="",this.graph.container.style.height=""):this.graph.container.style.width=this.initialWidth,this.positionGraph());this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};e&&this.setLayersVisible(e)}};GraphViewer.prototype.isDarkMode=function(){return"dark"==this.darkMode||"auto"==this.darkMode&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches};-GraphViewer.prototype.addSizeHandler=function(){var b=this.graph.container,e=this.graph.getGraphBounds(),g=!1;b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?"hidden":"visible";var m=mxUtils.bind(this,function(){if(!g){g=!0;var H=this.graph.getGraphBounds();b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?H.width+2*this.graph.border>b.offsetWidth-2?"auto":"hidden":"visible";if(null!=this.toolbar&&1!=this.graphConfig["toolbar-nohide"]){H=b.getBoundingClientRect();var S=mxUtils.getScrollOrigin(document.body);-S="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-S.x,top:-S.y};H={left:H.left-S.left,top:H.top-S.top,bottom:H.bottom-S.top,right:H.right-S.left};this.toolbar.style.left=H.left+"px";"bottom"==this.graphConfig["toolbar-position"]?this.toolbar.style.top=H.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px",this.toolbar.style.top=H.top+1+"px"):this.toolbar.style.top=H.top+"px"}else null!=-this.toolbar&&(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px");this.treeCellFolded&&(this.treeCellFolded=!1,this.positionGraph(this.graph.view.translate),this.graph.initialViewState.translate=this.graph.view.translate.clone());g=!1}}),v=null;this.handlingResize=!1;this.fitGraph=mxUtils.bind(this,function(H){var S=b.offsetWidth;S==v||this.handlingResize||(this.handlingResize=!0,"auto"==b.style.overflow&&(b.style.overflow="hidden"),this.graph.maxFitScale=null!=H?H:this.graphConfig.zoom||+GraphViewer.prototype.addSizeHandler=function(){var b=this.graph.container,e=this.graph.getGraphBounds(),g=!1;b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?"hidden":"visible";var m=mxUtils.bind(this,function(){if(!g){g=!0;var G=this.graph.getGraphBounds();b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?G.width+2*this.graph.border>b.offsetWidth-2?"auto":"hidden":"visible";if(null!=this.toolbar&&1!=this.graphConfig["toolbar-nohide"]){G=b.getBoundingClientRect();var S=mxUtils.getScrollOrigin(document.body);+S="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-S.x,top:-S.y};G={left:G.left-S.left,top:G.top-S.top,bottom:G.bottom-S.top,right:G.right-S.left};this.toolbar.style.left=G.left+"px";"bottom"==this.graphConfig["toolbar-position"]?this.toolbar.style.top=G.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px",this.toolbar.style.top=G.top+1+"px"):this.toolbar.style.top=G.top+"px"}else null!=+this.toolbar&&(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px");this.treeCellFolded&&(this.treeCellFolded=!1,this.positionGraph(this.graph.view.translate),this.graph.initialViewState.translate=this.graph.view.translate.clone());g=!1}}),v=null;this.handlingResize=!1;this.fitGraph=mxUtils.bind(this,function(G){var S=b.offsetWidth;S==v||this.handlingResize||(this.handlingResize=!0,"auto"==b.style.overflow&&(b.style.overflow="hidden"),this.graph.maxFitScale=null!=G?G:this.graphConfig.zoom||(this.allowZoomIn?null:1),this.graph.fit(null,null,null,null,null,!0),(this.center||0==this.graphConfig.resize&&""!=b.style.height)&&this.graph.center(),this.graph.maxFitScale=null,0==this.graphConfig.resize&&""!=b.style.height||this.updateContainerHeight(b,Math.max(this.minHeight,this.graph.getGraphBounds().height+2*this.graph.border+1)),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale},v=S,window.setTimeout(mxUtils.bind(this,function(){this.handlingResize=!1}),0))});GraphViewer.useResizeSensor&&(9>=document.documentMode?(mxEvent.addListener(window,"resize",m),this.graph.addListener("size",m)):new ResizeSensor(this.graph.container,m));if(this.graphConfig.resize||(this.zoomEnabled||!this.autoFit)&&0!=this.graphConfig.resize)this.graph.minimumContainerSize=new mxRectangle(0,0,this.minWidth,this.minHeight),this.graph.resizeContainer=!0;else if(!this.widthIsEmpty||""!=b.style.height&&this.autoFit||this.updateContainerWidth(b,e.width+2*this.graph.border),-0==this.graphConfig.resize&&""!=b.style.height||this.updateContainerHeight(b,Math.max(this.minHeight,e.height+2*this.graph.border+1)),!this.zoomEnabled&&this.autoFit){var p=v=null;m=mxUtils.bind(this,function(){window.clearTimeout(p);this.handlingResize||(p=window.setTimeout(mxUtils.bind(this,this.fitGraph),100))});GraphViewer.useResizeSensor&&(9>=document.documentMode?mxEvent.addListener(window,"resize",m):new ResizeSensor(this.graph.container,m))}else 9>=document.documentMode||this.graph.addListener("size",-m);var A=mxUtils.bind(this,function(H){var S=b.style.minWidth;this.widthIsEmpty&&(b.style.minWidth="100%");var F=null!=this.graphConfig["max-height"]?this.graphConfig["max-height"]:""!=b.style.height&&this.autoFit?b.offsetHeight:void 0;0<b.offsetWidth&&null==H&&this.allowZoomOut&&(this.allowZoomIn||e.width+2*this.graph.border>b.offsetWidth||e.height+2*this.graph.border>F)?(H=null,null!=F&&e.height+2*this.graph.border>F-2&&(H=(F-2*this.graph.border-2)/e.height),this.fitGraph(H)):this.widthIsEmpty||-null!=H||0!=this.graphConfig.resize||""==b.style.height?(H=null!=H?H:new mxPoint,this.graph.view.setTranslate(Math.floor(this.graph.border-e.x/this.graph.view.scale)+H.x,Math.floor(this.graph.border-e.y/this.graph.view.scale)+H.y),v=b.offsetWidth):this.graph.center((!this.widthIsEmpty||e.width<this.minWidth)&&1!=this.graphConfig.resize);b.style.minWidth=S});8==document.documentMode?window.setTimeout(A,0):A();this.positionGraph=function(H){e=this.graph.getGraphBounds();v=null;A(H)}};+0==this.graphConfig.resize&&""!=b.style.height||this.updateContainerHeight(b,Math.max(this.minHeight,e.height+2*this.graph.border+1)),!this.zoomEnabled&&this.autoFit){var n=v=null;m=mxUtils.bind(this,function(){window.clearTimeout(n);this.handlingResize||(n=window.setTimeout(mxUtils.bind(this,this.fitGraph),100))});GraphViewer.useResizeSensor&&(9>=document.documentMode?mxEvent.addListener(window,"resize",m):new ResizeSensor(this.graph.container,m))}else 9>=document.documentMode||this.graph.addListener("size",+m);var A=mxUtils.bind(this,function(G){var S=b.style.minWidth;this.widthIsEmpty&&(b.style.minWidth="100%");var F=null!=this.graphConfig["max-height"]?this.graphConfig["max-height"]:""!=b.style.height&&this.autoFit?b.offsetHeight:void 0;0<b.offsetWidth&&null==G&&this.allowZoomOut&&(this.allowZoomIn||e.width+2*this.graph.border>b.offsetWidth||e.height+2*this.graph.border>F)?(G=null,null!=F&&e.height+2*this.graph.border>F-2&&(G=(F-2*this.graph.border-2)/e.height),this.fitGraph(G)):this.widthIsEmpty||+null!=G||0!=this.graphConfig.resize||""==b.style.height?(G=null!=G?G:new mxPoint,this.graph.view.setTranslate(Math.floor(this.graph.border-e.x/this.graph.view.scale)+G.x,Math.floor(this.graph.border-e.y/this.graph.view.scale)+G.y),v=b.offsetWidth):this.graph.center((!this.widthIsEmpty||e.width<this.minWidth)&&1!=this.graphConfig.resize);b.style.minWidth=S});8==document.documentMode?window.setTimeout(A,0):A();this.positionGraph=function(G){e=this.graph.getGraphBounds();v=null;A(G)}};GraphViewer.prototype.crop=function(){var b=this.graph,e=b.getGraphBounds(),g=b.border,m=b.view.scale;b.view.setTranslate(null!=e.x?Math.floor(b.view.translate.x-e.x/m+g):g,null!=e.y?Math.floor(b.view.translate.y-e.y/m+g):g)};GraphViewer.prototype.updateContainerWidth=function(b,e){b.style.width=e+"px"};GraphViewer.prototype.updateContainerHeight=function(b,e){if(this.forceCenter||this.zoomEnabled||!this.autoFit||"BackCompat"==document.compatMode||8==document.documentMode)b.style.height=e+"px"};-GraphViewer.prototype.showLayers=function(b,e){var g=this.graphConfig.layers;g=null!=g&&0<g.length?g.split(" "):[];var m=this.graphConfig.layerIds,v=null!=m&&0<m.length,p=!1;if(0<g.length||v||null!=e){e=null!=e?e.getModel():null;b=b.getModel();b.beginUpdate();try{var A=b.getChildCount(b.root);if(null==e){e=!1;p={};if(v)for(var H=0;H<m.length;H++){var S=b.getCell(m[H]);null!=S&&(e=!0,p[S.id]=!0)}else for(H=0;H<g.length;H++)S=b.getChildAt(b.root,parseInt(g[H])),null!=S&&(e=!0,p[S.id]=!0);for(H=0;e&&-H<A;H++)S=b.getChildAt(b.root,H),b.setVisible(S,p[S.id]||!1)}else for(H=0;H<A;H++)b.setVisible(b.getChildAt(b.root,H),e.isVisible(e.getChildAt(e.root,H)))}finally{b.endUpdate()}p=!0}return p};+GraphViewer.prototype.showLayers=function(b,e){var g=this.graphConfig.layers;g=null!=g&&0<g.length?g.split(" "):[];var m=this.graphConfig.layerIds,v=null!=m&&0<m.length,n=!1;if(0<g.length||v||null!=e){e=null!=e?e.getModel():null;b=b.getModel();b.beginUpdate();try{var A=b.getChildCount(b.root);if(null==e){e=!1;n={};if(v)for(var G=0;G<m.length;G++){var S=b.getCell(m[G]);null!=S&&(e=!0,n[S.id]=!0)}else for(G=0;G<g.length;G++)S=b.getChildAt(b.root,parseInt(g[G])),null!=S&&(e=!0,n[S.id]=!0);for(G=0;e&&+G<A;G++)S=b.getChildAt(b.root,G),b.setVisible(S,n[S.id]||!1)}else for(G=0;G<A;G++)b.setVisible(b.getChildAt(b.root,G),e.isVisible(e.getChildAt(e.root,G)))}finally{b.endUpdate()}n=!0}return n};GraphViewer.prototype.addToolbar=function(){var b=this.graph.container;"bottom"==this.graphConfig["toolbar-position"]?b.style.marginBottom=this.toolbarHeight+"px":"inline"!=this.graphConfig["toolbar-position"]&&(b.style.marginTop=this.toolbarHeight+"px");var e=b.ownerDocument.createElement("div");e.style.display="flex";e.style.alignItems="center";e.style.position="absolute";e.style.overflow="hidden";e.style.boxSizing="border-box";e.style.whiteSpace="nowrap";e.style.textAlign="left";e.style.zIndex=this.toolbarZIndex;e.style.backgroundColor="light-dark(#eeeeee, "+GraphViewer.darkBackgroundColor+")";e.style.height=this.toolbarHeight+"px";var g=mxUtils.bind(this,function(){this.isDarkMode()?(e.classList.add("geDarkMode"),e.style.colorScheme="dark"):(e.classList.remove("geDarkMode"),e.style.colorScheme="light")});this.addListener("darkModeChanged",g);this.toolbar=e;g();if("inline"==this.graphConfig["toolbar-position"]){mxUtils.setPrefixedStyle(e.style,"transition","opacity 100ms ease-in-out");-mxUtils.setOpacity(e,30);var m=null,v=null,p=mxUtils.bind(this,function(aa){null!=m&&(window.clearTimeout(m),fadeThead=null);null!=v&&(window.clearTimeout(v),fadeThead2=null);m=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(e,0);m=null;v=window.setTimeout(mxUtils.bind(this,function(){e.style.display="none";v=null}),100)}),aa||200)}),A=mxUtils.bind(this,function(aa){null!=m&&(window.clearTimeout(m),fadeThead=null);null!=v&&(window.clearTimeout(v),fadeThead2=null);e.style.display=-"";mxUtils.setOpacity(e,aa||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(aa){mxEvent.isTouchEvent(aa)||(A(30),p())}));mxEvent.addListener(e,mxClient.IS_POINTER?"pointermove":"mousemove",function(aa){mxEvent.consume(aa)});mxEvent.addListener(e,"mouseenter",mxUtils.bind(this,function(aa){A(100)}));mxEvent.addListener(e,"mousemove",mxUtils.bind(this,function(aa){A(100);mxEvent.consume(aa)}));mxEvent.addListener(e,"mouseleave",-mxUtils.bind(this,function(aa){mxEvent.isTouchEvent(aa)||A(30)}));var H=this.graph,S=H.getTolerance();H.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(aa,na){this.startX=na.getGraphX();this.startY=na.getGraphY();this.scrollLeft=H.container.scrollLeft;this.scrollTop=H.container.scrollTop},mouseMove:function(aa,na){},mouseUp:function(aa,na){mxEvent.isTouchEvent(na.getEvent())&&Math.abs(this.scrollLeft-H.container.scrollLeft)<S&&Math.abs(this.scrollTop-H.container.scrollTop)<-S&&Math.abs(this.startX-na.getGraphX())<S&&Math.abs(this.startY-na.getGraphY())<S&&(0<parseFloat(e.style.opacity||0)?p():A(30))}})}g=this.toolbarItems;for(var F=0,K=mxUtils.bind(this,function(aa,na,W,ba){aa=this.createToolbarButton(aa,na,W,ba);e.appendChild(aa);F++;return aa}),c=this.graph.getModel(),f=null,l=null,t=null,q=null,D=0;D<g.length;D++){var G=g[D];if("pages"==G){q=b.ownerDocument.createElement("div");q.style.display="inline-flex";q.style.position="relative";q.style.alignItems="center";+mxUtils.setOpacity(e,30);var m=null,v=null,n=mxUtils.bind(this,function(aa){null!=m&&(window.clearTimeout(m),fadeThead=null);null!=v&&(window.clearTimeout(v),fadeThead2=null);m=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(e,0);m=null;v=window.setTimeout(mxUtils.bind(this,function(){e.style.display="none";v=null}),100)}),aa||200)}),A=mxUtils.bind(this,function(aa){null!=m&&(window.clearTimeout(m),fadeThead=null);null!=v&&(window.clearTimeout(v),fadeThead2=null);e.style.display=+"";mxUtils.setOpacity(e,aa||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(aa){mxEvent.isTouchEvent(aa)||(A(30),n())}));mxEvent.addListener(e,mxClient.IS_POINTER?"pointermove":"mousemove",function(aa){mxEvent.consume(aa)});mxEvent.addListener(e,"mouseenter",mxUtils.bind(this,function(aa){A(100)}));mxEvent.addListener(e,"mousemove",mxUtils.bind(this,function(aa){A(100);mxEvent.consume(aa)}));mxEvent.addListener(e,"mouseleave",+mxUtils.bind(this,function(aa){mxEvent.isTouchEvent(aa)||A(30)}));var G=this.graph,S=G.getTolerance();G.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(aa,na){this.startX=na.getGraphX();this.startY=na.getGraphY();this.scrollLeft=G.container.scrollLeft;this.scrollTop=G.container.scrollTop},mouseMove:function(aa,na){},mouseUp:function(aa,na){mxEvent.isTouchEvent(na.getEvent())&&Math.abs(this.scrollLeft-G.container.scrollLeft)<S&&Math.abs(this.scrollTop-G.container.scrollTop)<+S&&Math.abs(this.startX-na.getGraphX())<S&&Math.abs(this.startY-na.getGraphY())<S&&(0<parseFloat(e.style.opacity||0)?n():A(30))}})}g=this.toolbarItems;for(var F=0,K=mxUtils.bind(this,function(aa,na,W,ba){aa=this.createToolbarButton(aa,na,W,ba);e.appendChild(aa);F++;return aa}),c=this.graph.getModel(),f=null,l=null,t=null,q=null,D=0;D<g.length;D++){var H=g[D];if("pages"==H){q=b.ownerDocument.createElement("div");q.style.display="inline-flex";q.style.position="relative";q.style.alignItems="center";q.style.padding="4px";q.style.fontFamily=GraphViewer.cssFontFamily;q.style.fontSize="12px";q.style.cursor="default";q.style.color="light-dark(#000000, #ffffff)";mxUtils.setOpacity(q,70);var N=K(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.chevronLeftImage,mxResources.get("previousPage")||"Previous Page");N.style.borderRightStyle="none";N.style.paddingLeft="0px";N.style.paddingRight="0px";e.appendChild(q);var L=K(mxUtils.bind(this,function(){this.selectPage(this.currentPage+-1)}),Editor.chevronRightImage,mxResources.get("nextPage")||"Next Page");L.style.paddingLeft="0px";L.style.paddingRight="0px";G=mxUtils.bind(this,function(){q.innerText="";mxUtils.write(q,this.currentPage+1+" / "+this.diagrams.length);q.style.display=1<this.diagrams.length?"inline-flex":"none";N.style.display=q.style.display;L.style.display=q.style.display});this.addListener("graphChanged",G);G()}else if("zoom"==G)this.zoomEnabled&&(K(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage,-mxResources.get("zoomOut")||"Zoom Out"),K(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),K(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==G){if(this.layersEnabled){var J=K(mxUtils.bind(this,function(aa){if(null!=f)f.parentNode.removeChild(f),+1)}),Editor.chevronRightImage,mxResources.get("nextPage")||"Next Page");L.style.paddingLeft="0px";L.style.paddingRight="0px";H=mxUtils.bind(this,function(){q.innerText="";mxUtils.write(q,this.currentPage+1+" / "+this.diagrams.length);q.style.display=1<this.diagrams.length?"inline-flex":"none";N.style.display=q.style.display;L.style.display=q.style.display});this.addListener("graphChanged",H);H()}else if("zoom"==H)this.zoomEnabled&&(K(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage,+mxResources.get("zoomOut")||"Zoom Out"),K(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),K(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==H){if(this.layersEnabled){var J=K(mxUtils.bind(this,function(aa){if(null!=f)f.parentNode.removeChild(f),f=null;else{f=this.graph.createLayersDialog(mxUtils.bind(this,function(){if(this.autoCrop)this.crop();else if(this.autoOrigin){var W=this.graph.getGraphBounds(),ba=this.graph.view;0>W.x||0>W.y?(this.crop(),this.graph.originalViewState=this.graph.initialViewState,this.graph.initialViewState={translate:ba.translate.clone(),scale:ba.scale}):null!=this.graph.originalViewState&&0<W.x/ba.scale+this.graph.originalViewState.translate.x-ba.translate.x&&0<W.y/ba.scale+this.graph.originalViewState.translate.y-ba.translate.y&&(ba.setTranslate(this.graph.originalViewState.translate.x,this.graph.originalViewState.translate.y),this.graph.originalViewState=null,this.graph.initialViewState={translate:ba.translate.clone(),scale:ba.scale})}}));mxEvent.addListener(f,"mouseleave",function(){f.parentNode.removeChild(f);f=null});aa=J.getBoundingClientRect();f.style.width="140px";f.style.padding="2px 0px 2px 0px";f.style.border="1px solid #d0d0d0";f.style.backgroundColor="#eee";f.style.fontFamily=GraphViewer.cssFontFamily;f.style.fontSize="11px";f.style.overflowY="auto";f.style.maxHeight=this.graph.container.clientHeight-this.toolbarHeight-10+"px";f.style.zIndex=this.toolbarZIndex+1;f.style.color="#000";mxUtils.setOpacity(f,85);var na=mxUtils.getDocumentScrollOrigin(document);f.style.left=na.x+aa.left-1+"px";f.style.top=na.y+aa.bottom-2+"px";this.isDarkMode()&&(f.style.filter="invert(93%) hue-rotate(180deg)");document.body.appendChild(f)}}),Editor.layersImage,mxResources.get("layers")||"Layers");c.addListener(mxEvent.CHANGE,-function(){J.style.display=1<c.getChildCount(c.root)?"inline-flex":"none"});J.style.display=1<c.getChildCount(c.root)?"inline-flex":"none"}}else if("tags"==G){if(this.tagsEnabled){var Y=K(mxUtils.bind(this,function(aa){null==l&&(l=this.graph.createTagsDialog(mxUtils.bind(this,function(){return!0})),l.div.getElementsByTagName("div")[0].style.position="",l.div.style.maxHeight="160px",l.div.style.maxWidth="120px",l.div.style.padding="2px",l.div.style.overflow="auto",l.div.style.height="auto",l.div.style.position=+function(){J.style.display=1<c.getChildCount(c.root)?"inline-flex":"none"});J.style.display=1<c.getChildCount(c.root)?"inline-flex":"none"}}else if("tags"==H){if(this.tagsEnabled){var Y=K(mxUtils.bind(this,function(aa){null==l&&(l=this.graph.createTagsDialog(mxUtils.bind(this,function(){return!0})),l.div.getElementsByTagName("div")[0].style.position="",l.div.style.maxHeight="160px",l.div.style.maxWidth="120px",l.div.style.padding="2px",l.div.style.overflow="auto",l.div.style.height="auto",l.div.style.position="fixed",l.div.style.fontFamily=GraphViewer.cssFontFamily,l.div.style.fontSize="11px",l.div.style.backgroundColor="#eee",l.div.style.color="#000",l.div.style.border="1px solid #d0d0d0",l.div.style.zIndex=this.toolbarZIndex+1,this.isDarkMode()&&(l.div.style.filter="invert(93%) hue-rotate(180deg)"),mxUtils.setOpacity(l.div,85));if(null!=t)t.parentNode.removeChild(t),t=null;else{t=l.div;t.style.position="absolute";mxEvent.addListener(t,"mouseleave",function(){null!=t&&(t.parentNode.removeChild(t),t=null)});aa=Y.getBoundingClientRect();var na=mxUtils.getDocumentScrollOrigin(document);t.style.left=na.x+aa.left-1+"px";t.style.top=na.y+aa.bottom-2+"px";document.body.appendChild(t);l.refresh()}}),Editor.tagsImage,mxResources.get("tags")||"Tags");c.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){Y.style.display=0<this.graph.getAllTags().length?"inline-flex":"none";null!=t&&0==this.graph.getAllTags().length&&(t.parentNode.removeChild(t),t=null)}));Y.style.display=0<this.graph.getAllTags().length?"inline-flex":-"none"}}else"lightbox"==G?this.lightboxEnabled&&K(mxUtils.bind(this,function(){try{this.showLightbox()}catch(aa){alert(aa.message)}}),Editor.fullscreenImage,mxResources.get("fullscreen")||"Fullscreen"):null!=this.graphConfig["toolbar-buttons"]&&(G=this.graphConfig["toolbar-buttons"][G],null!=G&&(G.elem=K(null==G.enabled||G.enabled?G.handler:function(){},G.image,G.title,G.enabled)))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*F);null!=this.graphConfig.title&&(g=+"none"}}else"lightbox"==H?this.lightboxEnabled&&K(mxUtils.bind(this,function(){try{this.showLightbox()}catch(aa){alert(aa.message)}}),Editor.fullscreenImage,mxResources.get("fullscreen")||"Fullscreen"):null!=this.graphConfig["toolbar-buttons"]&&(H=this.graphConfig["toolbar-buttons"][H],null!=H&&(H.elem=K(null==H.enabled||H.enabled?H.handler:function(){},H.image,H.title,H.enabled)))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*F);null!=this.graphConfig.title&&(g=b.ownerDocument.createElement("div"),g.style.display="inline-flex",g.style.position="relative",g.style.alignItems="center",g.style.padding="6px",g.style.fontFamily=GraphViewer.cssFontFamily,g.style.fontSize="12px",g.style.cursor="default",g.style.color="light-dark(#000000, #ffffff)",g.setAttribute("title",this.graphConfig.titleTooltip||this.graphConfig.title),mxUtils.write(g,this.graphConfig.title),mxUtils.setOpacity(g,70),e.appendChild(g),this.filename=g);this.minToolbarWidth=34*F;var ha=b.style.border,ea=mxUtils.bind(this,function(){e.style.width="inline"==this.graphConfig["toolbar-position"]?"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";e.style.border="1px solid #d0d0d0";if(1!=this.graphConfig["toolbar-nohide"]){var aa=b.getBoundingClientRect(),na=mxUtils.getScrollOrigin(document.body);na="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-na.x,top:-na.y};aa={left:aa.left-na.left,top:aa.top-na.top,bottom:aa.bottom-na.top,right:aa.right-na.left};e.style.left=aa.left+"px";"bottom"==this.graphConfig["toolbar-position"]?e.style.top=aa.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(e.style.marginTop=-this.toolbarHeight+"px",e.style.top=aa.top+1+"px"):e.style.top=aa.top+"px";"1px solid transparent"==ha&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(e);var W=mxUtils.bind(this,function(){null!=e.parentNode&&e.parentNode.removeChild(e);null!=t&&(t.parentNode.removeChild(t),t=null);null!=f&&(f.parentNode.removeChild(f),f=null);@@ -4219,23 +4221,23 @@ b.style.border=ha});mxEvent.addListener(document,"mousemove",function(ba){for(baGraphViewer.prototype.createToolbarButton=function(b,e,g,m){var v=document.createElement("div");v.style.borderRight="1px solid #d0d0d0";v.style.display="inline-flex";v.style.alignItems="center";v.style.padding="6px";mxEvent.addListener(v,"click",b);null!=g&&v.setAttribute("title",g);b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",e);b.style.width="18px";b.className="geAdaptiveAsset";null==m||m?(mxEvent.addListener(v,"mouseenter",function(){v.style.backgroundColor="light-dark(#dddddd,#333333)"}),mxEvent.addListener(v,"mouseleave",function(){v.style.backgroundColor="transparent"}),mxUtils.setOpacity(b,60),v.style.cursor="pointer"):mxUtils.setOpacity(v,30);v.appendChild(b);return v};GraphViewer.prototype.disableButton=function(b,e){var g=this.graphConfig["toolbar-buttons"]?this.graphConfig["toolbar-buttons"][b]:null;null!=g&&(mxUtils.setOpacity(g.elem,30),mxEvent.removeListener(g.elem,"click",g.handler),mxEvent.addListener(g.elem,"mouseenter",function(){g.elem.style.backgroundColor="#eee"}),e&&g.elem.setAttribute("title",e))};-GraphViewer.prototype.addClickHandler=function(b,e){b.linkPolicy=this.graphConfig.target||b.linkPolicy;b.addClickHandler(this.graphConfig.highlight,mxUtils.bind(this,function(g,m,v){if(null==m)for(var p=mxEvent.getSource(g);p!=b.container&&null!=p&&null==m;)"a"==p.nodeName.toLowerCase()&&(m=p.getAttribute("href")),p=p.parentNode;null!=e?null==m||b.isCustomLink(m)?mxEvent.consume(g):b.isExternalProtocol(m)||b.isBlankLink(m)||window.setTimeout(function(){e.destroy()},0):null!=m&&null==e&&b.isCustomLink(m)&&+GraphViewer.prototype.addClickHandler=function(b,e){b.linkPolicy=this.graphConfig.target||b.linkPolicy;b.addClickHandler(this.graphConfig.highlight,mxUtils.bind(this,function(g,m,v){if(null==m)for(var n=mxEvent.getSource(g);n!=b.container&&null!=n&&null==m;)"a"==n.nodeName.toLowerCase()&&(m=n.getAttribute("href")),n=n.parentNode;null!=e?null==m||b.isCustomLink(m)?mxEvent.consume(g):b.isExternalProtocol(m)||b.isBlankLink(m)||window.setTimeout(function(){e.destroy()},0):null!=m&&null==e&&b.isCustomLink(m)&&(mxEvent.isTouchEvent(g)||!mxEvent.isPopupTrigger(g))&&b.customLinkClicked(m,v)&&(mxUtils.clearSelection(),mxEvent.consume(g))}),mxUtils.bind(this,function(g){if(null==e&&this.lightboxClickEnabled&&(!mxEvent.isTouchEvent(g)||0==this.toolbarItems.length))try{this.showLightbox()}catch(m){alert(m.message)}}))};GraphViewer.prototype.showLightbox=function(b,e,g){if("open"==this.graphConfig.lightbox||window.self!==window.top)if(null==this.lightboxWindow||this.lightboxWindow.closed){b=null!=b?b:null!=this.graphConfig.editable?this.graphConfig.editable:!0;g={client:1,target:null!=g?g:"blank"};b&&(g.edit=this.graphConfig.edit||"_blank");if(null!=e?e:1)g.close=1;this.layersEnabled&&(g.layers=1);this.tagsEnabled&&(g.tags={});null!=this.graphConfig&&0!=this.graphConfig.nav&&(g.nav=1);null!=this.graphConfig&&null!=this.graphConfig.highlight&&(g.highlight=this.graphConfig.highlight.substring(1));null!=this.currentPage&&0<this.currentPage&&(g.page=this.currentPage);"undefined"!==typeof window.postMessage&&(null==document.documentMode||10<=document.documentMode)?null==this.lightboxWindow&&mxEvent.addListener(window,"message",mxUtils.bind(this,function(m){"ready"==m.data&&m.source==this.lightboxWindow&&this.lightboxWindow.postMessage(this.xml,"*")})):g.data=encodeURIComponent(this.xml);"1"==urlParams.dev&&(g.dev="1");this.lightboxWindow=window.open(("1"!=urlParams.dev?EditorUi.lightboxHost:"https://test.draw.io")+"/#P"+encodeURIComponent(JSON.stringify(g)))}else this.lightboxWindow.focus();else this.showLocalLightbox()};GraphViewer.prototype.showLocalLightbox=function(b){var e=document.createElement("div");e.style.position="fixed";e.style.top="0";e.style.left="0";e.style.bottom="0";e.style.right="0";e.style.zIndex=this.lightboxZIndex;e.style.backgroundColor="#000000";mxUtils.setOpacity(e,70);document.body.appendChild(e);var g=document.createElement("img");g.setAttribute("border","0");g.setAttribute("src",Editor.closeBlackImage);g.style.position="fixed";g.style.top="32px";g.style.right="32px";g.style.cursor="pointer";-g.className="geAdaptiveAsset";var m=mxUtils.bind(this,function(){p.setDarkMode(this.isDarkMode())});mxEvent.addListener(g,"click",mxUtils.bind(this,function(){this.removeListener("darkModeChanged",m);p.destroy()}));urlParams.pages="1";urlParams.page=this.currentPage;urlParams["page-id"]=this.graphConfig.pageId;urlParams["layer-ids"]=null!=this.graphConfig.layerIds&&0<this.graphConfig.layerIds.length?this.graphConfig.layerIds.join(" "):null;urlParams.nav=0!=this.graphConfig.nav?"1":"0";urlParams.layers=+g.className="geAdaptiveAsset";var m=mxUtils.bind(this,function(){n.setDarkMode(this.isDarkMode())});mxEvent.addListener(g,"click",mxUtils.bind(this,function(){this.removeListener("darkModeChanged",m);n.destroy()}));urlParams.pages="1";urlParams.page=this.currentPage;urlParams["page-id"]=this.graphConfig.pageId;urlParams["layer-ids"]=null!=this.graphConfig.layerIds&&0<this.graphConfig.layerIds.length?this.graphConfig.layerIds.join(" "):null;urlParams.nav=0!=this.graphConfig.nav?"1":"0";urlParams.layers=this.layersEnabled?"1":"0";urlParams.dark=this.isDarkMode()?"1":"0";this.tagsEnabled&&(urlParams.tags="{}");if(null!=b)try{var v=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));v.noCloseBtn=!0;urlParams["toolbar-config"]=encodeURIComponent(JSON.stringify(v))}catch(l){}if(null==document.documentMode||10<=document.documentMode)Editor.prototype.editButtonLink=this.graphConfig.edit,Editor.prototype.editButtonFunc=this.graphConfig.editFunc;EditorUi.prototype.updateActionStates=function(){};-EditorUi.prototype.addBeforeUnloadListener=function(){};EditorUi.prototype.addChromelessClickHandler=function(){};v=Graph.prototype.shadowId;Graph.prototype.shadowId="lightboxDropShadow";var p=new EditorUi(new Editor(!0),document.createElement("div"),!0);this.addListener("darkModeChanged",m);p.editor.editBlankUrl=this.editBlankUrl;p.editor.graph.shadowId="lightboxDropShadow";Graph.prototype.shadowId=v;p.refresh=function(){};var A=mxUtils.bind(this,function(l){27==l.keyCode&&p.destroy()}),H=this.initialOverflow,-S=p.destroy;p.destroy=function(){null==b&&(mxEvent.removeListener(document.documentElement,"keydown",A),document.body.removeChild(e),document.body.removeChild(g),document.body.style.overflow=H,GraphViewer.resizeSensorEnabled=!0,S.apply(this,arguments))};var F=p.editor.graph,K=F.container;K.style.overflow="hidden";K.style.inset="0";this.lightboxChrome&&null==b?(K.style.border="1px solid #c0c0c0",K.style.margin="40px",mxEvent.addListener(document.documentElement,"keydown",A)):(e.style.display="none",-g.style.display="none");var c=this;F.getImageFromBundles=function(l){return c.getImageUrl(l)};var f=p.createTemporaryGraph;p.createTemporaryGraph=function(){var l=f.apply(this,arguments);l.getImageFromBundles=function(t){return c.getImageUrl(t)};return l};this.graphConfig.move&&(F.isMoveCellsEvent=function(l){return!0});mxUtils.setPrefixedStyle(K.style,"border-radius","4px");K.style.position="fixed";GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow="hidden";this.addClickHandler(F,p);-window.setTimeout(mxUtils.bind(this,function(){try{mxEvent.addListener(e,"click",function(){p.destroy()}),K.style.outline="none",K.style.zIndex=this.lightboxZIndex,g.style.zIndex=this.lightboxZIndex,null!=b?(b.innerHTML="",b.appendChild(K)):(document.body.appendChild(K),document.body.appendChild(g)),p.setFileData(this.xml),mxUtils.setPrefixedStyle(K.style,"transform","rotateY(0deg)"),p.chromelessToolbar.style.bottom="60px",p.chromelessToolbar.style.zIndex=this.lightboxZIndex,(b||document.body).appendChild(p.chromelessToolbar),-p.getEditBlankXml=mxUtils.bind(this,function(){return this.xml}),this.showLayers(F,this.graph),p.lightboxFit(),p.chromelessResize()}catch(l){p.handleError(l,null,function(){p.destroy()})}}),0);return p};Dialog.prototype.getDocumentSize=function(){return new mxRectangle(0,0,Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0))};+EditorUi.prototype.addBeforeUnloadListener=function(){};EditorUi.prototype.addChromelessClickHandler=function(){};v=Graph.prototype.shadowId;Graph.prototype.shadowId="lightboxDropShadow";var n=new EditorUi(new Editor(!0),document.createElement("div"),!0);this.addListener("darkModeChanged",m);n.editor.editBlankUrl=this.editBlankUrl;n.editor.graph.shadowId="lightboxDropShadow";Graph.prototype.shadowId=v;n.refresh=function(){};var A=mxUtils.bind(this,function(l){27==l.keyCode&&n.destroy()}),G=this.initialOverflow,+S=n.destroy;n.destroy=function(){null==b&&(mxEvent.removeListener(document.documentElement,"keydown",A),document.body.removeChild(e),document.body.removeChild(g),document.body.style.overflow=G,GraphViewer.resizeSensorEnabled=!0,S.apply(this,arguments))};var F=n.editor.graph,K=F.container;K.style.overflow="hidden";K.style.inset="0";this.lightboxChrome&&null==b?(K.style.border="1px solid #c0c0c0",K.style.margin="40px",mxEvent.addListener(document.documentElement,"keydown",A)):(e.style.display="none",+g.style.display="none");var c=this;F.getImageFromBundles=function(l){return c.getImageUrl(l)};var f=n.createTemporaryGraph;n.createTemporaryGraph=function(){var l=f.apply(this,arguments);l.getImageFromBundles=function(t){return c.getImageUrl(t)};return l};this.graphConfig.move&&(F.isMoveCellsEvent=function(l){return!0});mxUtils.setPrefixedStyle(K.style,"border-radius","4px");K.style.position="fixed";GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow="hidden";this.addClickHandler(F,n);+window.setTimeout(mxUtils.bind(this,function(){try{mxEvent.addListener(e,"click",function(){n.destroy()}),K.style.outline="none",K.style.zIndex=this.lightboxZIndex,g.style.zIndex=this.lightboxZIndex,null!=b?(b.innerHTML="",b.appendChild(K)):(document.body.appendChild(K),document.body.appendChild(g)),n.setFileData(this.xml),mxUtils.setPrefixedStyle(K.style,"transform","rotateY(0deg)"),n.chromelessToolbar.style.bottom="60px",n.chromelessToolbar.style.zIndex=this.lightboxZIndex,(b||document.body).appendChild(n.chromelessToolbar),+n.getEditBlankXml=mxUtils.bind(this,function(){return this.xml}),this.showLayers(F,this.graph),n.lightboxFit(),n.chromelessResize()}catch(l){n.handleError(l,null,function(){n.destroy()})}}),0);return n};Dialog.prototype.getDocumentSize=function(){return new mxRectangle(0,0,Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0))};GraphViewer.prototype.updateTitle=function(b,e){b=b||"";this.showTitleAsTooltip&&null!=this.graph&&null!=this.graph.container&&this.graph.container.setAttribute("title",e||b);null!=this.filename&&(this.filename.innerText="",mxUtils.write(this.filename,b),this.filename.setAttribute("title",e||b))};GraphViewer.processElements=function(b){mxUtils.forEach(GraphViewer.getElementsByClassName(b||"mxgraph"),function(e){try{e.innerText="",GraphViewer.createViewerForElement(e)}catch(g){e.innerText=g.message,null!=window.console&&console.error(g)}})};GraphViewer.getElementsByClassName=function(b){if(document.getElementsByClassName){var e=document.getElementsByClassName(b);b=[];for(var g=0;g<e.length;g++)b.push(e[g]);return b}var m=document.getElementsByTagName("*");e=[];for(g=0;g<m.length;g++){var v=m[g].className;null!=v&&0<v.length&&(v=v.split(" "),0<=mxUtils.indexOf(v,b)&&e.push(m[g]))}return e};-GraphViewer.createViewerForElement=function(b,e){var g=b.getAttribute("data-mxgraph");if(null!=g){var m=JSON.parse(g),v=function(p){p=mxUtils.parseXml(p);p=new GraphViewer(b,p.documentElement,m);null!=e&&e(p)};null!=m.url?GraphViewer.getUrl(m.url,function(p){v(p)}):v(m.xml)}};+GraphViewer.createViewerForElement=function(b,e){var g=b.getAttribute("data-mxgraph");if(null!=g){var m=JSON.parse(g),v=function(n){n=mxUtils.parseXml(n);n=new GraphViewer(b,n.documentElement,m);null!=e&&e(n)};null!=m.url?GraphViewer.getUrl(m.url,function(n){v(n)}):v(m.xml)}};GraphViewer.blockedAncestorFrames=function(){try{if(window.location.ancestorOrigins&&window.location.hostname&&window.location.ancestorOrigins.length&&0<window.location.ancestorOrigins.length){var b=window.location.hostname;b&&1<b.length&&"/"==b.charAt(b.length-1)&&(b=b.substring(0,b.length-1));for(var e="",g=0;g<window.location.ancestorOrigins.length;g++)if(e+=" -> "+window.location.ancestorOrigins[g],e.endsWith("dan6v7pm1f1a1.cloudfront.net")||e.endsWith("confluence-cloud-excalidraw-ll3likebca-uc.a.run.app"))return!0;(b.endsWith("ac.draw.io")||b.endsWith("aj.draw.io"))&&1==window.location.ancestorOrigins.length&&window.location.ancestorOrigins[0]&&window.location.ancestorOrigins[0].endsWith(".atlassian.net")}}catch(m){}return!1};GraphViewer.darkBackgroundColor=Editor.darkColor;GraphViewer.cssFontFamily=Editor.defaultHtmlFont;GraphViewer.shapeBackgroundColor=null;GraphViewer.viewerInitialized=function(b){};GraphViewer.initCss=function(){try{null==GraphViewer.styleElement&&(GraphViewer.styleElement=document.createElement("style"),GraphViewer.styleElement.setAttribute("type","text/css"),GraphViewer.styleElement.innerHTML=GraphViewer.getCss(),GraphViewer.blockedAncestorFrames()||document.getElementsByTagName("head")[0].appendChild(GraphViewer.styleElement))}catch(b){}};@@ -4245,9 +4247,9 @@ GraphViewer.getCss=function(){return[".geDarkMode img {\n filter: invert(1);\"\t z-index: "+(GraphViewer.prototype.lightboxZIndex+2)+";","}\n.geBackground {"," background-color: light-dark(#ffffff, "+GraphViewer.darkBackgroundColor+");","\t position: fixed;\n left: 0px;\n top: 0px;\n right: 0px;\n bottom: 0px;\n opacity: 0.9;","\t z-index: "+(GraphViewer.prototype.lightboxZIndex+1)+";","}\n.geDialogTitle {\n box-sizing: border-box;\n white-space: nowrap;"," background: light-dark(#f1f3f4, "+GraphViewer.darkBackgroundColor+");"," border-bottom: 1px solid rgb(192, 192, 192);\n font-size: 15px;\n font-weight: bold;\n text-align: center;\n color: rgb(35, 86, 149);\n}\n.geDialogFooter {"," background: light-dark(#f1f3f4, "+GraphViewer.darkBackgroundColor+");"," white-space: nowrap;\n text-align: right;\n box-sizing: border-box;\n border-top: 1px solid #e5e5e5;\n color: darkGray;\n}\n.geHelpIcon {\n width: 16px;\n margin: 0 4px;\n vertical-align: text-bottom;\n}\n.geBtn, .mxWindow .geBtn {\n background-color: light-dark(#eeeeee, #1b1d1e);\n border: 1px solid light-dark(#d8d8d8, #333333);\n color: light-dark(#3f3f3f, #c0c0c0);\n font-size: 13px;\n font-weight: 500;\n border-radius: 4px;\n height: 30px;\n margin: 0 0 0 8px;\n min-width: 72px;\n outline: 0;\n padding: 0 8px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n}\n.geBtn:hover:not(.gePrimaryBtn), .geBtn:focus {\n border: 1px solid light-dark(#c6c6c6, #333333);\n background: light-dark(#dadada, #333333);\n}\n.geBtn:disabled {\n opacity: .5;\n}\n.gePrimaryBtn {\n background: linear-gradient(light-dark(#4d90fe, #003555) 0px, light-dark(#4787ed, #003555) 100%);\n border: 1px solid light-dark(#3079ed, transparent);\n color: light-dark(#ffffff, #c0c0c0);\n}\n.gePrimaryBtn:hover:not([disabled]) {\n background: linear-gradient(light-dark(#4d90fe, #004a77) 0px, light-dark(#357ae8, #004a77) 100%);\n border: 1px solid light-dark(#2f5bb7, transparent);\n}\n.geBtn:disabled {\n opacity: .5;\n}"].join("\n")};GraphViewer.cachedUrls={};GraphViewer.getUrl=function(b,e,g){if(null!=GraphViewer.cachedUrls[b])e(GraphViewer.cachedUrls[b]);else{var m=null!=navigator.userAgent&&0<navigator.userAgent.indexOf("MSIE 9")?new XDomainRequest:new XMLHttpRequest;m.open("GET",b);m.onload=function(){e(null!=m.getText?m.getText():m.responseText)};m.onerror=g;m.send()}};GraphViewer.resizeSensorEnabled=!0;GraphViewer.useResizeObserver=!0;GraphViewer.useResizeSensor=!0;-(function(){var b=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(g){return window.setTimeout(g,20)},e=function(g,m){function v(){this.q=[];this.add=function(q){this.q.push(q)};var l,t;this.call=function(){l=0;for(t=this.q.length;l<t;l++)this.q[l].call()}}function p(l,t){return l.currentStyle?l.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(l,null).getPropertyValue(t):l.style[t]}function A(l,t){if(!l.resizedAttached)l.resizedAttached=+(function(){var b=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(g){return window.setTimeout(g,20)},e=function(g,m){function v(){this.q=[];this.add=function(q){this.q.push(q)};var l,t;this.call=function(){l=0;for(t=this.q.length;l<t;l++)this.q[l].call()}}function n(l,t){return l.currentStyle?l.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(l,null).getPropertyValue(t):l.style[t]}function A(l,t){if(!l.resizedAttached)l.resizedAttached=new v,l.resizedAttached.add(t);else if(l.resizedAttached){l.resizedAttached.add(t);return}l.resizeSensor=document.createElement("div");l.resizeSensor.className="resize-sensor";l.resizeSensor.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;";l.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s;"></div></div><div class="resize-sensor-shrink" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s; width: 200%; height: 200%"></div></div>';-l.appendChild(l.resizeSensor);"static"==p(l,"position")&&(l.style.position="relative");var q=l.resizeSensor.childNodes[0],D=q.childNodes[0],G=l.resizeSensor.childNodes[1],N=function(){D.style.width="100000px";D.style.height="100000px";q.scrollLeft=1E5;q.scrollTop=1E5;G.scrollLeft=1E5;G.scrollTop=1E5};N();var L=!1,J=function(){l.resizedAttached&&(L&&(l.resizedAttached.call(),L=!1),b(J))};b(J);var Y,ha,ea,aa;t=function(){if((ea=l.offsetWidth)!=Y||(aa=l.offsetHeight)!=ha)L=!0,Y=ea,ha=aa;N()};var na=-function(W,ba,ja){W.attachEvent?W.attachEvent("on"+ba,ja):W.addEventListener(ba,ja)};na(q,"scroll",t);na(G,"scroll",t)}var H=function(){GraphViewer.resizeSensorEnabled&&m()};if(GraphViewer.useResizeObserver&&"undefined"!==typeof ResizeObserver){var S=null,F=!1;(new ResizeObserver(function(){F||(null!=S&&window.clearTimeout(S),S=window.setTimeout(function(){F=!0;H();S=null;F=!1},200))})).observe(g)}else{var K=Object.prototype.toString.call(g),c="[object Array]"===K||"[object NodeList]"===K||"[object HTMLCollection]"===-K||"undefined"!==typeof jQuery&&g instanceof jQuery||"undefined"!==typeof Elements&&g instanceof Elements;if(c){K=0;for(var f=g.length;K<f;K++)A(g[K],H)}else A(g,H);this.detach=function(){if(c)for(var l=0,t=g.length;l<t;l++)e.detach(g[l]);else e.detach(g)}}};e.detach=function(g){g.resizeSensor&&(g.removeChild(g.resizeSensor),delete g.resizeSensor,delete g.resizedAttached)};window.ResizeSensor=e})();+l.appendChild(l.resizeSensor);"static"==n(l,"position")&&(l.style.position="relative");var q=l.resizeSensor.childNodes[0],D=q.childNodes[0],H=l.resizeSensor.childNodes[1],N=function(){D.style.width="100000px";D.style.height="100000px";q.scrollLeft=1E5;q.scrollTop=1E5;H.scrollLeft=1E5;H.scrollTop=1E5};N();var L=!1,J=function(){l.resizedAttached&&(L&&(l.resizedAttached.call(),L=!1),b(J))};b(J);var Y,ha,ea,aa;t=function(){if((ea=l.offsetWidth)!=Y||(aa=l.offsetHeight)!=ha)L=!0,Y=ea,ha=aa;N()};var na=+function(W,ba,ja){W.attachEvent?W.attachEvent("on"+ba,ja):W.addEventListener(ba,ja)};na(q,"scroll",t);na(H,"scroll",t)}var G=function(){GraphViewer.resizeSensorEnabled&&m()};if(GraphViewer.useResizeObserver&&"undefined"!==typeof ResizeObserver){var S=null,F=!1;(new ResizeObserver(function(){F||(null!=S&&window.clearTimeout(S),S=window.setTimeout(function(){F=!0;G();S=null;F=!1},200))})).observe(g)}else{var K=Object.prototype.toString.call(g),c="[object Array]"===K||"[object NodeList]"===K||"[object HTMLCollection]"===+K||"undefined"!==typeof jQuery&&g instanceof jQuery||"undefined"!==typeof Elements&&g instanceof Elements;if(c){K=0;for(var f=g.length;K<f;K++)A(g[K],G)}else A(g,G);this.detach=function(){if(c)for(var l=0,t=g.length;l<t;l++)e.detach(g[l]);else e.detach(g)}}};e.detach=function(g){g.resizeSensor&&(g.removeChild(g.resizeSensor),delete g.resizeSensor,delete g.resizedAttached)};window.ResizeSensor=e})();(function(){Editor.initMath();if(null!=window.onDrawioViewerLoad)window.onDrawioViewerLoad();else GraphViewer.processElements()})();diff --git a/src/main/webapp/service-worker.js b/src/main/webapp/service-worker.jsindex c5da322ab..4bcc50ad6 100644--- a/src/main/webapp/service-worker.js+++ b/src/main/webapp/service-worker.js@@ -1,2 +1,2 @@-if(!self.define){let e,i={};const r=(r,a)=>(r=new URL(r+".js",a).href,i[r]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=r,e.onload=i,document.head.appendChild(e)}else e=r,importScripts(r),i()})).then((()=>{let e=i[r];if(!e)throw new Error(`Module ${r} didn’t register its module`);return e})));self.define=(a,c)=>{const s=e||("document"in self?document.currentScript.src:"")||location.href;if(i[s])return;let d={};const o=e=>r(e,s),f={module:{uri:s},exports:d,require:o};i[s]=Promise.all(a.map((e=>f[e]||o(e)))).then((e=>(c(...e),d)))}}define(["./workbox-acfd85e3"],(function(e){"use strict";self.skipWaiting(),e.precacheAndRoute([{url:"js/app.min.js",revision:"1ef035dcc160b745ed03e388f2227b32"},{url:"js/extensions.min.js",revision:"07b950f7056e7f862ea59633531b8fdf"},{url:"js/orgchart.min.js",revision:"619d8c4dab47b81868916df31f55478b"},{url:"js/stencils.min.js",revision:"f760278d924467fb1d2289448c73fe27"},{url:"js/shapes-14-6-5.min.js",revision:"71913a30c93bc9aff182a3a2b3da1a21"},{url:"js/math-print.js",revision:"cf64f6a493a8cb5079f2b70813e478d7"},{url:"index.html",revision:"7f0094a1758e6c55ab5392910a13d13d"},{url:"open.html",revision:"d71816b3b00e769fc6019fcdd6921662"},{url:"shortcuts.svg",revision:"2381dd779ce6cfee954042a7f784c7e6"},{url:"styles/fonts/ArchitectsDaughter-Regular.ttf",revision:"31c2153c0530e32553b31a49b3d70736"},{url:"styles/grapheditor.css",revision:"9e384d158dffaa061b650c9e11603e2a"},{url:"styles/high-contrast.css",revision:"c8095fb62f147b591c84b8d290d6703b"},{url:"js/dropbox/Dropbox-sdk.min.js",revision:"4b9842892aa37b156db0a8364b7a83b0"},{url:"js/onedrive/OneDrive.js",revision:"505e8280346666f7ee801bc59521fa67"},{url:"js/viewer-static.min.js",revision:"f1587a7fd479b701f00db6ae7d48232e"},{url:"connect/jira/editor-1-3-3.html",revision:"41dc8af9576b47f359cff19fff7a41c2"},{url:"connect/jira/viewerPanel-1-3-12.html",revision:"4836f5e4308abe57830e441518364f23"},{url:"connect/jira/fullScreenViewer-1-3-3.html",revision:"abed474e47c0c41a5ad2366b4828f77a"},{url:"connect/jira/viewerPanel.js",revision:"75f816c208d0c621e3066a97ff0ee6cf"},{url:"connect/jira/spinner.gif",revision:"7d857ab9d86123e93d74d48e958fe743"},{url:"connect/jira/editor.js",revision:"c41221a9a51ff293f05ed13c7b142e5c"},{url:"connect/jira/fullscreen-viewer-init.js",revision:"d3269625ce04b7a277b779ff175957d0"},{url:"connect/jira/fullscreen-viewer.js",revision:"8eceb2fe587296dd11f9c8f6eae34c20"},{url:"plugins/connectJira.js",revision:"c4cb6b60234b04b2c8bc09e555746615"},{url:"plugins/cConf-comments.js",revision:"6deea8e9b96ff96043cd5cfd2a242a9f"},{url:"plugins/cConf-1-4-8.js",revision:"e1d883ad704552edcece6df9ed4ab00d"},{url:"connect/confluence/connectUtils-1-4-8.js",revision:"261a7494161cee976ecfb110ac7571d2"},{url:"connect/new_common/cac.js",revision:"740dce44cf53499f476ee8edc37d09a0"},{url:"connect/gdrive_common/gac.js",revision:"3bb38a5d9186a896ed04808e921ef888"},{url:"connect/onedrive_common/ac.js",revision:"5fb6ff1a73f54a9086b7a7e1f613b8ed"},{url:"connect/confluence/viewer-init.js",revision:"b82e366bf57ecced9435c2a8ba9cb9b9"},{url:"connect/confluence/viewer.js",revision:"6542434cf3df5c60163e2767678f1bfc"},{url:"connect/confluence/viewer-1-4-42.html",revision:"69c1bca25fd4889bf832e8441c972268"},{url:"connect/confluence/macroEditor-1-4-8.html",revision:"4ad77ae3f08c19eddac932b2fa8c7068"},{url:"connect/confluence/includeDiagram-1-4-8.js",revision:"30ff609b31d4a8c38da6c28e555947ea"},{url:"connect/confluence/includeDiagram.html",revision:"9613fec05b19ddef081ca6e9d8b057bf"},{url:"connect/confluence/macro-editor.js",revision:"03a8dcfc69612b44b6e75e6926a956fc"},{url:"math/es5/startup.js",revision:"dc7130cdc866593293dbb5dde11ceb40"},{url:"math/es5/core.js",revision:"f71bc0bfb7d2ac8261747f97a5d47dd4"},{url:"math/es5/ui/safe.js",revision:"8c1fcfee7c879588ad409edcdd9cce53"},{url:"math/es5/output/svg.js",revision:"4f55967d16197ebb01b86356d8ab179a"},{url:"math/es5/input/tex.js",revision:"5c4f470da2ccb1acf85041fcecd6fff6"},{url:"math/es5/input/asciimath.js",revision:"c2d4076dd8e26d509bfe3a378e71cfa7"},{url:"math/es5/output/svg/fonts/tex.js",revision:"6eab785a3788ea805bd2b552d1f0aab8"},{url:"resources/dia.txt",revision:"b44638cfed6404ac07cb82d0ee7d0437"},{url:"resources/dia_am.txt",revision:"0b1eb26b186aacfd5b6d67f88d144d0b"},{url:"resources/dia_ar.txt",revision:"bed70fa15f59b312c168b9ef9528d578"},{url:"resources/dia_bg.txt",revision:"1c846465cb20bf155acc937ba8cbc446"},{url:"resources/dia_bn.txt",revision:"0a7cc401f17390b415417153d8b87b84"},{url:"resources/dia_bs.txt",revision:"b5908edbf7e697b23a2bf90adcbb49c7"},{url:"resources/dia_ca.txt",revision:"c745e8f057b24e85f3f0eecba7af19eb"},{url:"resources/dia_cs.txt",revision:"5e0cf43a649bfdcd56bbebfba6db00ca"},{url:"resources/dia_da.txt",revision:"4766eaa4150ecbe04b89f767835b9406"},{url:"resources/dia_de.txt",revision:"4f0596f7aedfbb808095762f0bd63306"},{url:"resources/dia_el.txt",revision:"a8fa799c3eda7ed001ef011a1e5806dd"},{url:"resources/dia_eo.txt",revision:"6bd806494299f0ac942d1ca21c065478"},{url:"resources/dia_es.txt",revision:"5ea8d76e6966383bcc92bbc4752db5db"},{url:"resources/dia_et.txt",revision:"70aa0cb2ecbbe167a3e4a38aac6dbbdc"},{url:"resources/dia_eu.txt",revision:"1e5419dbdd0da6a6be4e9c48bd99220f"},{url:"resources/dia_fa.txt",revision:"13be854b8db535400e1cd1ec245e740e"},{url:"resources/dia_fi.txt",revision:"8947362d39bee93460c0d86713ee65b7"},{url:"resources/dia_fil.txt",revision:"74efdec615b1003983f77aa12834a75c"},{url:"resources/dia_fr.txt",revision:"8dd13eaca0fcd7e41072c571c201d661"},{url:"resources/dia_gl.txt",revision:"6e09dfae5d18a933d3bc11ba5de44f3c"},{url:"resources/dia_gu.txt",revision:"b9837957b0ca73e4414377b53b53a70b"},{url:"resources/dia_he.txt",revision:"7a8aef0306c6a94f6872896d219d1dc4"},{url:"resources/dia_hi.txt",revision:"3029801be7a36b67a29314a04d5d7d42"},{url:"resources/dia_hr.txt",revision:"57b724efdceb29d21ca8a64c59350b1a"},{url:"resources/dia_hu.txt",revision:"818262e6bcb84ed26563611045490649"},{url:"resources/dia_id.txt",revision:"71d0eb41a8336acdfff7a405c609e18f"},{url:"resources/dia_it.txt",revision:"c3574cb9042adcaea63a3944a09c518e"},{url:"resources/dia_ja.txt",revision:"1c3d11a6636c946d5a22ea52889a19e7"},{url:"resources/dia_kn.txt",revision:"457144ed2c2f51a5ec1d383cbfe9bbf7"},{url:"resources/dia_ko.txt",revision:"e20f9bd4bbf52bf9e3df6e92d7ee1722"},{url:"resources/dia_lt.txt",revision:"bd25b4eab36f6d663c66e4c957b8ef60"},{url:"resources/dia_lv.txt",revision:"e8d8899460a1c81632d7cac287f15354"},{url:"resources/dia_ml.txt",revision:"3b20dfcc809d4b13e3e705a1ae5fbc9f"},{url:"resources/dia_mr.txt",revision:"dd27583c966df6663526af940f7df5d6"},{url:"resources/dia_ms.txt",revision:"253bfb31cf6c8af7ff65527a9137bb9d"},{url:"resources/dia_my.txt",revision:"15f93018ad77289defe0d26df43c6846"},{url:"resources/dia_nl.txt",revision:"abc7305430780a7f3a611e95aa3d6d11"},{url:"resources/dia_no.txt",revision:"cc385ba00d44d6b025fc8b2cffc6721f"},{url:"resources/dia_pl.txt",revision:"485155d3dc8c3d20f42d2ce4689a225f"},{url:"resources/dia_pt-br.txt",revision:"d0bbfa8e826a73098fed085a83a72cdd"},{url:"resources/dia_pt.txt",revision:"18907cf9172320e86fa8aa2a91090ec7"},{url:"resources/dia_ro.txt",revision:"0581872bd0fe468143c7dba864257020"},{url:"resources/dia_ru.txt",revision:"c3789211d3006115131baeea8aab53f7"},{url:"resources/dia_si.txt",revision:"6905439a8ccb386864df2d708be0e8a2"},{url:"resources/dia_sk.txt",revision:"e05d29a790dab92f32a46d0228b5b696"},{url:"resources/dia_sl.txt",revision:"32608759b877e9e942ce209695e841f4"},{url:"resources/dia_sr.txt",revision:"4633d649f40d5b7cf610b6eeb7e6c840"},{url:"resources/dia_sv.txt",revision:"f81f1c1af4df00d757781e3d3b856e05"},{url:"resources/dia_sw.txt",revision:"4f7f39ab83d4ce75b980e1be971ee910"},{url:"resources/dia_ta.txt",revision:"83752a59dfa4f313b73da42e837d8519"},{url:"resources/dia_te.txt",revision:"476a89c596d24e1b1d80f90b76eea1b5"},{url:"resources/dia_th.txt",revision:"6c98c7c4d45c2c260be975ba4db965d3"},{url:"resources/dia_tr.txt",revision:"a4f04603060a5f900fefe32e7aa858a9"},{url:"resources/dia_uk.txt",revision:"2a9c088b5a04a843af42911a0e203fc9"},{url:"resources/dia_vi.txt",revision:"7ada081c11fd313ceee6f51bbc166e34"},{url:"resources/dia_zh-tw.txt",revision:"24281a99696e767ff085dfd6c49a3fe9"},{url:"resources/dia_zh.txt",revision:"3128f6e90a0db91c9d6adcdb94ca7522"},{url:"favicon.ico",revision:"b2bf17349e4b50ce4ba311f079f8bf7d"},{url:"images/manifest.json",revision:"38d3a7e4b63e8175f0aab6f03e000f07"},{url:"images/logo.png",revision:"e4e0d092abdb1e668b5ec41a7fe0713c"},{url:"images/drawlogo.svg",revision:"4bf4d14ebcf072d8bd4c5a1c89e88fc6"},{url:"images/drawlogo48.png",revision:"8b13428373aca67b895364d025f42417"},{url:"images/drawlogo-gray.svg",revision:"0aabacbc0873816e1e09e4736ae44c7d"},{url:"images/drawlogo-text-bottom.svg",revision:"f6c438823ab31f290940bd4feb8dd9c2"},{url:"images/logo-flat-small.png",revision:"4b178e59ff499d6dd1894fc498b59877"},{url:"images/apple-touch-icon.png",revision:"732c29e21332a926318a7005d21ec450"},{url:"images/icon-192-maskable.png",revision:"47e006d0ce4a35eb5beaa97f0c2bfed0"},{url:"images/icon-192.png",revision:"d022403d52435d76afec82c4e24a17ef"},{url:"images/icon-512-maskable.png",revision:"cf152feeb01fb21f3148a71a3540266e"},{url:"images/icon-512.png",revision:"a3a0df7e7a385244b74073f81ecc45de"},{url:"images/delete.png",revision:"5f2350f2fd20f1a229637aed32ed8f29"},{url:"images/droptarget.png",revision:"bbf7f563fb6784de1ce96f329519b043"},{url:"images/logo-flat.png",revision:"038070ab43aee6e54a791211859fc67b"},{url:"images/google-drive-logo.svg",revision:"5d9f2f5bbc7dcc252730a0072bb23059"},{url:"images/onedrive-logo.svg",revision:"3645b344ec0634c1290dd58d7dc87b97"},{url:"images/dropbox-logo.svg",revision:"e6be408c77cf9c82d41ac64fa854280a"},{url:"images/github-logo.svg",revision:"a1a999b69a275eac0cb918360ac05ae1"},{url:"images/gitlab-logo.svg",revision:"0faea8c818899e58533e153c44b10517"},{url:"images/trello-logo.svg",revision:"006fd0d7d70d7e95dc691674cb12e044"},{url:"images/osa_drive-harddisk.png",revision:"b954e1ae772087c5b4c6ae797e1f9649"},{url:"images/osa_database.png",revision:"c350d9d9b95f37b6cfe798b40ede5fb0"},{url:"images/google-drive-logo-white.svg",revision:"f329d8b1be7778515a85b93fc35d9f26"},{url:"images/dropbox-logo-white.svg",revision:"4ea8299ac3bc31a16f199ee3aec223bf"},{url:"images/onedrive-logo-white.svg",revision:"b3602fa0fc947009cff3f33a581cff4d"},{url:"images/github-logo-white.svg",revision:"537b1127b3ca0f95b45782d1304fb77a"},{url:"images/gitlab-logo-white.svg",revision:"5fede9ac2f394c716b8c23e3fddc3910"},{url:"images/trello-logo-white-orange.svg",revision:"e2a0a52ba3766682f138138d10a75eb5"},{url:"images/logo-confluence.png",revision:"ed1e55d44ae5eba8f999aba2c93e8331"},{url:"images/logo-jira.png",revision:"f8d460555a0d1f87cfd901e940666629"},{url:"images/spin.gif",revision:"487cbb40b9ced439aa1ad914e816d773"},{url:"images/aui-wait.gif",revision:"5a474bcbd8d2f2826f03d10ea44bf60e"},{url:"mxgraph/css/common.css",revision:"81d1704d5ab9207e2e5c7fc84379dc1a"},{url:"mxgraph/images/expanded.gif",revision:"2b67c2c035af1e9a5cc814f0d22074cf"},{url:"mxgraph/images/collapsed.gif",revision:"73cc826da002a3d740ca4ce6ec5c1f4a"},{url:"mxgraph/images/maximize.gif",revision:"5cd13d6925493ab51e876694cc1c2ec2"},{url:"mxgraph/images/minimize.gif",revision:"8957741b9b0f86af9438775f2aadbb54"},{url:"mxgraph/images/close.gif",revision:"8b84669812ac7382984fca35de8da48b"},{url:"mxgraph/images/resize.gif",revision:"a6477612b3567a34033f9cac6184eed3"},{url:"mxgraph/images/separator.gif",revision:"7819742ff106c97da7a801c2372bbbe5"},{url:"mxgraph/images/window.gif",revision:"fd9a21dd4181f98052a202a0a01f18ab"},{url:"mxgraph/images/window-title.gif",revision:"3fb1d6c43246cdf991a11dfe826dfe99"},{url:"mxgraph/images/button.gif",revision:"00759bdc3ad218fa739f584369541809"},{url:"mxgraph/images/point.gif",revision:"83a43717b284902442620f61bc4e9fa6"}],{ignoreURLParametersMatching:[/.*/]})}));+if(!self.define){let e,i={};const r=(r,a)=>(r=new URL(r+".js",a).href,i[r]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=r,e.onload=i,document.head.appendChild(e)}else e=r,importScripts(r),i()})).then((()=>{let e=i[r];if(!e)throw new Error(`Module ${r} didn’t register its module`);return e})));self.define=(a,c)=>{const s=e||("document"in self?document.currentScript.src:"")||location.href;if(i[s])return;let d={};const o=e=>r(e,s),f={module:{uri:s},exports:d,require:o};i[s]=Promise.all(a.map((e=>f[e]||o(e)))).then((e=>(c(...e),d)))}}define(["./workbox-72a83b64"],(function(e){"use strict";self.skipWaiting(),e.precacheAndRoute([{url:"js/app.min.js",revision:"80ecaf893beee464723370d0e7ab6dc8"},{url:"js/extensions.min.js",revision:"07b950f7056e7f862ea59633531b8fdf"},{url:"js/orgchart.min.js",revision:"619d8c4dab47b81868916df31f55478b"},{url:"js/stencils.min.js",revision:"f760278d924467fb1d2289448c73fe27"},{url:"js/shapes-14-6-5.min.js",revision:"71913a30c93bc9aff182a3a2b3da1a21"},{url:"js/math-print.js",revision:"cf64f6a493a8cb5079f2b70813e478d7"},{url:"index.html",revision:"7f0094a1758e6c55ab5392910a13d13d"},{url:"open.html",revision:"d71816b3b00e769fc6019fcdd6921662"},{url:"shortcuts.svg",revision:"2381dd779ce6cfee954042a7f784c7e6"},{url:"styles/fonts/ArchitectsDaughter-Regular.ttf",revision:"31c2153c0530e32553b31a49b3d70736"},{url:"styles/grapheditor.css",revision:"d9858ae2e59b4b4c3ba0249583afe7c9"},{url:"styles/high-contrast.css",revision:"c8095fb62f147b591c84b8d290d6703b"},{url:"js/dropbox/Dropbox-sdk.min.js",revision:"4b9842892aa37b156db0a8364b7a83b0"},{url:"js/onedrive/OneDrive.js",revision:"505e8280346666f7ee801bc59521fa67"},{url:"js/viewer-static.min.js",revision:"2b08fb48f17398c012ef275d3ae82374"},{url:"connect/jira/editor-1-3-3.html",revision:"41dc8af9576b47f359cff19fff7a41c2"},{url:"connect/jira/viewerPanel-1-3-12.html",revision:"4836f5e4308abe57830e441518364f23"},{url:"connect/jira/fullScreenViewer-1-3-3.html",revision:"abed474e47c0c41a5ad2366b4828f77a"},{url:"connect/jira/viewerPanel.js",revision:"75f816c208d0c621e3066a97ff0ee6cf"},{url:"connect/jira/spinner.gif",revision:"7d857ab9d86123e93d74d48e958fe743"},{url:"connect/jira/editor.js",revision:"c41221a9a51ff293f05ed13c7b142e5c"},{url:"connect/jira/fullscreen-viewer-init.js",revision:"d3269625ce04b7a277b779ff175957d0"},{url:"connect/jira/fullscreen-viewer.js",revision:"8eceb2fe587296dd11f9c8f6eae34c20"},{url:"plugins/connectJira.js",revision:"c4cb6b60234b04b2c8bc09e555746615"},{url:"plugins/cConf-comments.js",revision:"6deea8e9b96ff96043cd5cfd2a242a9f"},{url:"plugins/cConf-1-4-8.js",revision:"e3bb1453579008ea5e42fbddd5f33c54"},{url:"connect/confluence/connectUtils-1-4-8.js",revision:"94ba9ffc927e0d86a54e70b94504f4f0"},{url:"connect/new_common/cac.js",revision:"740dce44cf53499f476ee8edc37d09a0"},{url:"connect/gdrive_common/gac.js",revision:"3bb38a5d9186a896ed04808e921ef888"},{url:"connect/onedrive_common/ac.js",revision:"5fb6ff1a73f54a9086b7a7e1f613b8ed"},{url:"connect/confluence/viewer-init.js",revision:"b82e366bf57ecced9435c2a8ba9cb9b9"},{url:"connect/confluence/viewer.js",revision:"78b87563d88943ab816a3463927b9b50"},{url:"connect/confluence/viewer-1-4-42.html",revision:"69c1bca25fd4889bf832e8441c972268"},{url:"connect/confluence/macroEditor-1-4-8.html",revision:"4ad77ae3f08c19eddac932b2fa8c7068"},{url:"connect/confluence/includeDiagram-1-4-8.js",revision:"ddb4d1f6d316a187e55bb3fd89fc6165"},{url:"connect/confluence/includeDiagram.html",revision:"9613fec05b19ddef081ca6e9d8b057bf"},{url:"connect/confluence/macro-editor.js",revision:"03a8dcfc69612b44b6e75e6926a956fc"},{url:"math/es5/startup.js",revision:"dc7130cdc866593293dbb5dde11ceb40"},{url:"math/es5/core.js",revision:"f71bc0bfb7d2ac8261747f97a5d47dd4"},{url:"math/es5/ui/safe.js",revision:"8c1fcfee7c879588ad409edcdd9cce53"},{url:"math/es5/output/svg.js",revision:"4f55967d16197ebb01b86356d8ab179a"},{url:"math/es5/input/tex.js",revision:"5c4f470da2ccb1acf85041fcecd6fff6"},{url:"math/es5/input/asciimath.js",revision:"c2d4076dd8e26d509bfe3a378e71cfa7"},{url:"math/es5/output/svg/fonts/tex.js",revision:"6eab785a3788ea805bd2b552d1f0aab8"},{url:"resources/dia.txt",revision:"b44638cfed6404ac07cb82d0ee7d0437"},{url:"resources/dia_am.txt",revision:"0b1eb26b186aacfd5b6d67f88d144d0b"},{url:"resources/dia_ar.txt",revision:"bed70fa15f59b312c168b9ef9528d578"},{url:"resources/dia_bg.txt",revision:"1c846465cb20bf155acc937ba8cbc446"},{url:"resources/dia_bn.txt",revision:"0a7cc401f17390b415417153d8b87b84"},{url:"resources/dia_bs.txt",revision:"b5908edbf7e697b23a2bf90adcbb49c7"},{url:"resources/dia_ca.txt",revision:"c745e8f057b24e85f3f0eecba7af19eb"},{url:"resources/dia_cs.txt",revision:"5e0cf43a649bfdcd56bbebfba6db00ca"},{url:"resources/dia_da.txt",revision:"4766eaa4150ecbe04b89f767835b9406"},{url:"resources/dia_de.txt",revision:"4f0596f7aedfbb808095762f0bd63306"},{url:"resources/dia_el.txt",revision:"a8fa799c3eda7ed001ef011a1e5806dd"},{url:"resources/dia_eo.txt",revision:"6bd806494299f0ac942d1ca21c065478"},{url:"resources/dia_es.txt",revision:"5ea8d76e6966383bcc92bbc4752db5db"},{url:"resources/dia_et.txt",revision:"70aa0cb2ecbbe167a3e4a38aac6dbbdc"},{url:"resources/dia_eu.txt",revision:"1e5419dbdd0da6a6be4e9c48bd99220f"},{url:"resources/dia_fa.txt",revision:"13be854b8db535400e1cd1ec245e740e"},{url:"resources/dia_fi.txt",revision:"8947362d39bee93460c0d86713ee65b7"},{url:"resources/dia_fil.txt",revision:"74efdec615b1003983f77aa12834a75c"},{url:"resources/dia_fr.txt",revision:"8dd13eaca0fcd7e41072c571c201d661"},{url:"resources/dia_gl.txt",revision:"6e09dfae5d18a933d3bc11ba5de44f3c"},{url:"resources/dia_gu.txt",revision:"b9837957b0ca73e4414377b53b53a70b"},{url:"resources/dia_he.txt",revision:"7a8aef0306c6a94f6872896d219d1dc4"},{url:"resources/dia_hi.txt",revision:"3029801be7a36b67a29314a04d5d7d42"},{url:"resources/dia_hr.txt",revision:"57b724efdceb29d21ca8a64c59350b1a"},{url:"resources/dia_hu.txt",revision:"818262e6bcb84ed26563611045490649"},{url:"resources/dia_id.txt",revision:"71d0eb41a8336acdfff7a405c609e18f"},{url:"resources/dia_it.txt",revision:"c3574cb9042adcaea63a3944a09c518e"},{url:"resources/dia_ja.txt",revision:"1c3d11a6636c946d5a22ea52889a19e7"},{url:"resources/dia_kn.txt",revision:"457144ed2c2f51a5ec1d383cbfe9bbf7"},{url:"resources/dia_ko.txt",revision:"e20f9bd4bbf52bf9e3df6e92d7ee1722"},{url:"resources/dia_lt.txt",revision:"bd25b4eab36f6d663c66e4c957b8ef60"},{url:"resources/dia_lv.txt",revision:"e8d8899460a1c81632d7cac287f15354"},{url:"resources/dia_ml.txt",revision:"3b20dfcc809d4b13e3e705a1ae5fbc9f"},{url:"resources/dia_mr.txt",revision:"dd27583c966df6663526af940f7df5d6"},{url:"resources/dia_ms.txt",revision:"253bfb31cf6c8af7ff65527a9137bb9d"},{url:"resources/dia_my.txt",revision:"15f93018ad77289defe0d26df43c6846"},{url:"resources/dia_nl.txt",revision:"abc7305430780a7f3a611e95aa3d6d11"},{url:"resources/dia_no.txt",revision:"cc385ba00d44d6b025fc8b2cffc6721f"},{url:"resources/dia_pl.txt",revision:"485155d3dc8c3d20f42d2ce4689a225f"},{url:"resources/dia_pt-br.txt",revision:"d0bbfa8e826a73098fed085a83a72cdd"},{url:"resources/dia_pt.txt",revision:"18907cf9172320e86fa8aa2a91090ec7"},{url:"resources/dia_ro.txt",revision:"0581872bd0fe468143c7dba864257020"},{url:"resources/dia_ru.txt",revision:"c3789211d3006115131baeea8aab53f7"},{url:"resources/dia_si.txt",revision:"6905439a8ccb386864df2d708be0e8a2"},{url:"resources/dia_sk.txt",revision:"e05d29a790dab92f32a46d0228b5b696"},{url:"resources/dia_sl.txt",revision:"32608759b877e9e942ce209695e841f4"},{url:"resources/dia_sr.txt",revision:"4633d649f40d5b7cf610b6eeb7e6c840"},{url:"resources/dia_sv.txt",revision:"f81f1c1af4df00d757781e3d3b856e05"},{url:"resources/dia_sw.txt",revision:"4f7f39ab83d4ce75b980e1be971ee910"},{url:"resources/dia_ta.txt",revision:"83752a59dfa4f313b73da42e837d8519"},{url:"resources/dia_te.txt",revision:"476a89c596d24e1b1d80f90b76eea1b5"},{url:"resources/dia_th.txt",revision:"6c98c7c4d45c2c260be975ba4db965d3"},{url:"resources/dia_tr.txt",revision:"a4f04603060a5f900fefe32e7aa858a9"},{url:"resources/dia_uk.txt",revision:"2a9c088b5a04a843af42911a0e203fc9"},{url:"resources/dia_vi.txt",revision:"7ada081c11fd313ceee6f51bbc166e34"},{url:"resources/dia_zh-tw.txt",revision:"24281a99696e767ff085dfd6c49a3fe9"},{url:"resources/dia_zh.txt",revision:"3128f6e90a0db91c9d6adcdb94ca7522"},{url:"favicon.ico",revision:"b2bf17349e4b50ce4ba311f079f8bf7d"},{url:"images/manifest.json",revision:"38d3a7e4b63e8175f0aab6f03e000f07"},{url:"images/logo.png",revision:"e4e0d092abdb1e668b5ec41a7fe0713c"},{url:"images/drawlogo.svg",revision:"4bf4d14ebcf072d8bd4c5a1c89e88fc6"},{url:"images/drawlogo48.png",revision:"8b13428373aca67b895364d025f42417"},{url:"images/drawlogo-gray.svg",revision:"0aabacbc0873816e1e09e4736ae44c7d"},{url:"images/drawlogo-text-bottom.svg",revision:"f6c438823ab31f290940bd4feb8dd9c2"},{url:"images/logo-flat-small.png",revision:"4b178e59ff499d6dd1894fc498b59877"},{url:"images/apple-touch-icon.png",revision:"732c29e21332a926318a7005d21ec450"},{url:"images/icon-192-maskable.png",revision:"47e006d0ce4a35eb5beaa97f0c2bfed0"},{url:"images/icon-192.png",revision:"d022403d52435d76afec82c4e24a17ef"},{url:"images/icon-512-maskable.png",revision:"cf152feeb01fb21f3148a71a3540266e"},{url:"images/icon-512.png",revision:"a3a0df7e7a385244b74073f81ecc45de"},{url:"images/delete.png",revision:"5f2350f2fd20f1a229637aed32ed8f29"},{url:"images/droptarget.png",revision:"bbf7f563fb6784de1ce96f329519b043"},{url:"images/logo-flat.png",revision:"038070ab43aee6e54a791211859fc67b"},{url:"images/google-drive-logo.svg",revision:"5d9f2f5bbc7dcc252730a0072bb23059"},{url:"images/onedrive-logo.svg",revision:"3645b344ec0634c1290dd58d7dc87b97"},{url:"images/dropbox-logo.svg",revision:"e6be408c77cf9c82d41ac64fa854280a"},{url:"images/github-logo.svg",revision:"a1a999b69a275eac0cb918360ac05ae1"},{url:"images/gitlab-logo.svg",revision:"0faea8c818899e58533e153c44b10517"},{url:"images/trello-logo.svg",revision:"006fd0d7d70d7e95dc691674cb12e044"},{url:"images/osa_drive-harddisk.png",revision:"b954e1ae772087c5b4c6ae797e1f9649"},{url:"images/osa_database.png",revision:"c350d9d9b95f37b6cfe798b40ede5fb0"},{url:"images/google-drive-logo-white.svg",revision:"f329d8b1be7778515a85b93fc35d9f26"},{url:"images/dropbox-logo-white.svg",revision:"4ea8299ac3bc31a16f199ee3aec223bf"},{url:"images/onedrive-logo-white.svg",revision:"b3602fa0fc947009cff3f33a581cff4d"},{url:"images/github-logo-white.svg",revision:"537b1127b3ca0f95b45782d1304fb77a"},{url:"images/gitlab-logo-white.svg",revision:"5fede9ac2f394c716b8c23e3fddc3910"},{url:"images/trello-logo-white-orange.svg",revision:"e2a0a52ba3766682f138138d10a75eb5"},{url:"images/logo-confluence.png",revision:"ed1e55d44ae5eba8f999aba2c93e8331"},{url:"images/logo-jira.png",revision:"f8d460555a0d1f87cfd901e940666629"},{url:"images/spin.gif",revision:"487cbb40b9ced439aa1ad914e816d773"},{url:"images/aui-wait.gif",revision:"5a474bcbd8d2f2826f03d10ea44bf60e"},{url:"mxgraph/css/common.css",revision:"81d1704d5ab9207e2e5c7fc84379dc1a"},{url:"mxgraph/images/expanded.gif",revision:"2b67c2c035af1e9a5cc814f0d22074cf"},{url:"mxgraph/images/collapsed.gif",revision:"73cc826da002a3d740ca4ce6ec5c1f4a"},{url:"mxgraph/images/maximize.gif",revision:"5cd13d6925493ab51e876694cc1c2ec2"},{url:"mxgraph/images/minimize.gif",revision:"8957741b9b0f86af9438775f2aadbb54"},{url:"mxgraph/images/close.gif",revision:"8b84669812ac7382984fca35de8da48b"},{url:"mxgraph/images/resize.gif",revision:"a6477612b3567a34033f9cac6184eed3"},{url:"mxgraph/images/separator.gif",revision:"7819742ff106c97da7a801c2372bbbe5"},{url:"mxgraph/images/window.gif",revision:"fd9a21dd4181f98052a202a0a01f18ab"},{url:"mxgraph/images/window-title.gif",revision:"3fb1d6c43246cdf991a11dfe826dfe99"},{url:"mxgraph/images/button.gif",revision:"00759bdc3ad218fa739f584369541809"},{url:"mxgraph/images/point.gif",revision:"83a43717b284902442620f61bc4e9fa6"}],{ignoreURLParametersMatching:[/.*/]})}));//# sourceMappingURL=service-worker.js.mapdiff --git a/src/main/webapp/service-worker.js.map b/src/main/webapp/service-worker.js.mapindex 0c0dec1a6..0f4b55c7a 100644--- a/src/main/webapp/service-worker.js.map+++ b/src/main/webapp/service-worker.js.map@@ -1 +1 @@-{"version":3,"file":"service-worker.js","sources":["../../../../../../private/var/folders/w3/8z182_j14fbd1p8pn7nc032h0000gn/T/095c4121fdb8a98c76135511d4804010/service-worker.js"],"sourcesContent":["import {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/Users/davidbenson/.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-precaching/precacheAndRoute.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.skipWaiting();\n\n\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"js/app.min.js\",\n \"revision\": \"1ef035dcc160b745ed03e388f2227b32\"\n },\n {\n \"url\": \"js/extensions.min.js\",\n \"revision\": \"07b950f7056e7f862ea59633531b8fdf\"\n },\n {\n \"url\": \"js/orgchart.min.js\",\n \"revision\": \"619d8c4dab47b81868916df31f55478b\"\n },\n {\n \"url\": \"js/stencils.min.js\",\n \"revision\": \"f760278d924467fb1d2289448c73fe27\"\n },\n {\n \"url\": \"js/shapes-14-6-5.min.js\",\n \"revision\": \"71913a30c93bc9aff182a3a2b3da1a21\"\n },\n {\n \"url\": \"js/math-print.js\",\n \"revision\": \"cf64f6a493a8cb5079f2b70813e478d7\"\n },\n {\n \"url\": \"index.html\",\n \"revision\": \"7f0094a1758e6c55ab5392910a13d13d\"\n },\n {\n \"url\": \"open.html\",\n \"revision\": \"d71816b3b00e769fc6019fcdd6921662\"\n },\n {\n \"url\": \"shortcuts.svg\",\n \"revision\": \"2381dd779ce6cfee954042a7f784c7e6\"\n },\n {\n \"url\": \"styles/fonts/ArchitectsDaughter-Regular.ttf\",\n \"revision\": \"31c2153c0530e32553b31a49b3d70736\"\n },\n {\n \"url\": \"styles/grapheditor.css\",\n \"revision\": \"9e384d158dffaa061b650c9e11603e2a\"\n },\n {\n \"url\": \"styles/high-contrast.css\",\n \"revision\": \"c8095fb62f147b591c84b8d290d6703b\"\n },\n {\n \"url\": \"js/dropbox/Dropbox-sdk.min.js\",\n \"revision\": \"4b9842892aa37b156db0a8364b7a83b0\"\n },\n {\n \"url\": \"js/onedrive/OneDrive.js\",\n \"revision\": \"505e8280346666f7ee801bc59521fa67\"\n },\n {\n \"url\": \"js/viewer-static.min.js\",\n \"revision\": \"f1587a7fd479b701f00db6ae7d48232e\"\n },\n {\n \"url\": \"connect/jira/editor-1-3-3.html\",\n \"revision\": \"41dc8af9576b47f359cff19fff7a41c2\"\n },\n {\n \"url\": \"connect/jira/viewerPanel-1-3-12.html\",\n \"revision\": \"4836f5e4308abe57830e441518364f23\"\n },\n {\n \"url\": \"connect/jira/fullScreenViewer-1-3-3.html\",\n \"revision\": \"abed474e47c0c41a5ad2366b4828f77a\"\n },\n {\n \"url\": \"connect/jira/viewerPanel.js\",\n \"revision\": \"75f816c208d0c621e3066a97ff0ee6cf\"\n },\n {\n \"url\": \"connect/jira/spinner.gif\",\n \"revision\": \"7d857ab9d86123e93d74d48e958fe743\"\n },\n {\n \"url\": \"connect/jira/editor.js\",\n \"revision\": \"c41221a9a51ff293f05ed13c7b142e5c\"\n },\n {\n \"url\": \"connect/jira/fullscreen-viewer-init.js\",\n \"revision\": \"d3269625ce04b7a277b779ff175957d0\"\n },\n {\n \"url\": \"connect/jira/fullscreen-viewer.js\",\n \"revision\": \"8eceb2fe587296dd11f9c8f6eae34c20\"\n },\n {\n \"url\": \"plugins/connectJira.js\",\n \"revision\": \"c4cb6b60234b04b2c8bc09e555746615\"\n },\n {\n \"url\": \"plugins/cConf-comments.js\",\n \"revision\": \"6deea8e9b96ff96043cd5cfd2a242a9f\"\n },\n {\n \"url\": \"plugins/cConf-1-4-8.js\",\n \"revision\": \"e1d883ad704552edcece6df9ed4ab00d\"\n },\n {\n \"url\": \"connect/confluence/connectUtils-1-4-8.js\",\n \"revision\": \"261a7494161cee976ecfb110ac7571d2\"\n },\n {\n \"url\": \"connect/new_common/cac.js\",\n \"revision\": \"740dce44cf53499f476ee8edc37d09a0\"\n },\n {\n \"url\": \"connect/gdrive_common/gac.js\",\n \"revision\": \"3bb38a5d9186a896ed04808e921ef888\"\n },\n {\n \"url\": \"connect/onedrive_common/ac.js\",\n \"revision\": \"5fb6ff1a73f54a9086b7a7e1f613b8ed\"\n },\n {\n \"url\": \"connect/confluence/viewer-init.js\",\n \"revision\": \"b82e366bf57ecced9435c2a8ba9cb9b9\"\n },\n {\n \"url\": \"connect/confluence/viewer.js\",\n \"revision\": \"6542434cf3df5c60163e2767678f1bfc\"\n },\n {\n \"url\": \"connect/confluence/viewer-1-4-42.html\",\n \"revision\": \"69c1bca25fd4889bf832e8441c972268\"\n },\n {\n \"url\": \"connect/confluence/macroEditor-1-4-8.html\",\n \"revision\": \"4ad77ae3f08c19eddac932b2fa8c7068\"\n },\n {\n \"url\": \"connect/confluence/includeDiagram-1-4-8.js\",\n \"revision\": \"30ff609b31d4a8c38da6c28e555947ea\"\n },\n {\n \"url\": \"connect/confluence/includeDiagram.html\",\n \"revision\": \"9613fec05b19ddef081ca6e9d8b057bf\"\n },\n {\n \"url\": \"connect/confluence/macro-editor.js\",\n \"revision\": \"03a8dcfc69612b44b6e75e6926a956fc\"\n },\n {\n \"url\": \"math/es5/startup.js\",\n \"revision\": \"dc7130cdc866593293dbb5dde11ceb40\"\n },\n {\n \"url\": \"math/es5/core.js\",\n \"revision\": \"f71bc0bfb7d2ac8261747f97a5d47dd4\"\n },\n {\n \"url\": \"math/es5/ui/safe.js\",\n \"revision\": \"8c1fcfee7c879588ad409edcdd9cce53\"\n },\n {\n \"url\": \"math/es5/output/svg.js\",\n \"revision\": \"4f55967d16197ebb01b86356d8ab179a\"\n },\n {\n \"url\": \"math/es5/input/tex.js\",\n \"revision\": \"5c4f470da2ccb1acf85041fcecd6fff6\"\n },\n {\n \"url\": \"math/es5/input/asciimath.js\",\n \"revision\": \"c2d4076dd8e26d509bfe3a378e71cfa7\"\n },\n {\n \"url\": \"math/es5/output/svg/fonts/tex.js\",\n \"revision\": \"6eab785a3788ea805bd2b552d1f0aab8\"\n },\n {\n \"url\": \"resources/dia.txt\",\n \"revision\": \"b44638cfed6404ac07cb82d0ee7d0437\"\n },\n {\n \"url\": \"resources/dia_am.txt\",\n \"revision\": \"0b1eb26b186aacfd5b6d67f88d144d0b\"\n },\n {\n \"url\": \"resources/dia_ar.txt\",\n \"revision\": \"bed70fa15f59b312c168b9ef9528d578\"\n },\n {\n \"url\": \"resources/dia_bg.txt\",\n \"revision\": \"1c846465cb20bf155acc937ba8cbc446\"\n },\n {\n \"url\": \"resources/dia_bn.txt\",\n \"revision\": \"0a7cc401f17390b415417153d8b87b84\"\n },\n {\n \"url\": \"resources/dia_bs.txt\",\n \"revision\": \"b5908edbf7e697b23a2bf90adcbb49c7\"\n },\n {\n \"url\": \"resources/dia_ca.txt\",\n \"revision\": \"c745e8f057b24e85f3f0eecba7af19eb\"\n },\n {\n \"url\": \"resources/dia_cs.txt\",\n \"revision\": \"5e0cf43a649bfdcd56bbebfba6db00ca\"\n },\n {\n \"url\": \"resources/dia_da.txt\",\n \"revision\": \"4766eaa4150ecbe04b89f767835b9406\"\n },\n {\n \"url\": \"resources/dia_de.txt\",\n \"revision\": \"4f0596f7aedfbb808095762f0bd63306\"\n },\n {\n \"url\": \"resources/dia_el.txt\",\n \"revision\": \"a8fa799c3eda7ed001ef011a1e5806dd\"\n },\n {\n \"url\": \"resources/dia_eo.txt\",\n \"revision\": \"6bd806494299f0ac942d1ca21c065478\"\n },\n {\n \"url\": \"resources/dia_es.txt\",\n \"revision\": \"5ea8d76e6966383bcc92bbc4752db5db\"\n },\n {\n \"url\": \"resources/dia_et.txt\",\n \"revision\": \"70aa0cb2ecbbe167a3e4a38aac6dbbdc\"\n },\n {\n \"url\": \"resources/dia_eu.txt\",\n \"revision\": \"1e5419dbdd0da6a6be4e9c48bd99220f\"\n },\n {\n \"url\": \"resources/dia_fa.txt\",\n \"revision\": \"13be854b8db535400e1cd1ec245e740e\"\n },\n {\n \"url\": \"resources/dia_fi.txt\",\n \"revision\": \"8947362d39bee93460c0d86713ee65b7\"\n },\n {\n \"url\": \"resources/dia_fil.txt\",\n \"revision\": \"74efdec615b1003983f77aa12834a75c\"\n },\n {\n \"url\": \"resources/dia_fr.txt\",\n \"revision\": \"8dd13eaca0fcd7e41072c571c201d661\"\n },\n {\n \"url\": \"resources/dia_gl.txt\",\n \"revision\": \"6e09dfae5d18a933d3bc11ba5de44f3c\"\n },\n {\n \"url\": \"resources/dia_gu.txt\",\n \"revision\": \"b9837957b0ca73e4414377b53b53a70b\"\n },\n {\n \"url\": \"resources/dia_he.txt\",\n \"revision\": \"7a8aef0306c6a94f6872896d219d1dc4\"\n },\n {\n \"url\": \"resources/dia_hi.txt\",\n \"revision\": \"3029801be7a36b67a29314a04d5d7d42\"\n },\n {\n \"url\": \"resources/dia_hr.txt\",\n \"revision\": \"57b724efdceb29d21ca8a64c59350b1a\"\n },\n {\n \"url\": \"resources/dia_hu.txt\",\n \"revision\": \"818262e6bcb84ed26563611045490649\"\n },\n {\n \"url\": \"resources/dia_id.txt\",\n \"revision\": \"71d0eb41a8336acdfff7a405c609e18f\"\n },\n {\n \"url\": \"resources/dia_it.txt\",\n \"revision\": \"c3574cb9042adcaea63a3944a09c518e\"\n },\n {\n \"url\": \"resources/dia_ja.txt\",\n \"revision\": \"1c3d11a6636c946d5a22ea52889a19e7\"\n },\n {\n \"url\": \"resources/dia_kn.txt\",\n \"revision\": \"457144ed2c2f51a5ec1d383cbfe9bbf7\"\n },\n {\n \"url\": \"resources/dia_ko.txt\",\n \"revision\": \"e20f9bd4bbf52bf9e3df6e92d7ee1722\"\n },\n {\n \"url\": \"resources/dia_lt.txt\",\n \"revision\": \"bd25b4eab36f6d663c66e4c957b8ef60\"\n },\n {\n \"url\": \"resources/dia_lv.txt\",\n \"revision\": \"e8d8899460a1c81632d7cac287f15354\"\n },\n {\n \"url\": \"resources/dia_ml.txt\",\n \"revision\": \"3b20dfcc809d4b13e3e705a1ae5fbc9f\"\n },\n {\n \"url\": \"resources/dia_mr.txt\",\n \"revision\": \"dd27583c966df6663526af940f7df5d6\"\n },\n {\n \"url\": \"resources/dia_ms.txt\",\n \"revision\": \"253bfb31cf6c8af7ff65527a9137bb9d\"\n },\n {\n \"url\": \"resources/dia_my.txt\",\n \"revision\": \"15f93018ad77289defe0d26df43c6846\"\n },\n {\n \"url\": \"resources/dia_nl.txt\",\n \"revision\": \"abc7305430780a7f3a611e95aa3d6d11\"\n },\n {\n \"url\": \"resources/dia_no.txt\",\n \"revision\": \"cc385ba00d44d6b025fc8b2cffc6721f\"\n },\n {\n \"url\": \"resources/dia_pl.txt\",\n \"revision\": \"485155d3dc8c3d20f42d2ce4689a225f\"\n },\n {\n \"url\": \"resources/dia_pt-br.txt\",\n \"revision\": \"d0bbfa8e826a73098fed085a83a72cdd\"\n },\n {\n \"url\": \"resources/dia_pt.txt\",\n \"revision\": \"18907cf9172320e86fa8aa2a91090ec7\"\n },\n {\n \"url\": \"resources/dia_ro.txt\",\n \"revision\": \"0581872bd0fe468143c7dba864257020\"\n },\n {\n \"url\": \"resources/dia_ru.txt\",\n \"revision\": \"c3789211d3006115131baeea8aab53f7\"\n },\n {\n \"url\": \"resources/dia_si.txt\",\n \"revision\": \"6905439a8ccb386864df2d708be0e8a2\"\n },\n {\n \"url\": \"resources/dia_sk.txt\",\n \"revision\": \"e05d29a790dab92f32a46d0228b5b696\"\n },\n {\n \"url\": \"resources/dia_sl.txt\",\n \"revision\": \"32608759b877e9e942ce209695e841f4\"\n },\n {\n \"url\": \"resources/dia_sr.txt\",\n \"revision\": \"4633d649f40d5b7cf610b6eeb7e6c840\"\n },\n {\n \"url\": \"resources/dia_sv.txt\",\n \"revision\": \"f81f1c1af4df00d757781e3d3b856e05\"\n },\n {\n \"url\": \"resources/dia_sw.txt\",\n \"revision\": \"4f7f39ab83d4ce75b980e1be971ee910\"\n },\n {\n \"url\": \"resources/dia_ta.txt\",\n \"revision\": \"83752a59dfa4f313b73da42e837d8519\"\n },\n {\n \"url\": \"resources/dia_te.txt\",\n \"revision\": \"476a89c596d24e1b1d80f90b76eea1b5\"\n },\n {\n \"url\": \"resources/dia_th.txt\",\n \"revision\": \"6c98c7c4d45c2c260be975ba4db965d3\"\n },\n {\n \"url\": \"resources/dia_tr.txt\",\n \"revision\": \"a4f04603060a5f900fefe32e7aa858a9\"\n },\n {\n \"url\": \"resources/dia_uk.txt\",\n \"revision\": \"2a9c088b5a04a843af42911a0e203fc9\"\n },\n {\n \"url\": \"resources/dia_vi.txt\",\n \"revision\": \"7ada081c11fd313ceee6f51bbc166e34\"\n },\n {\n \"url\": \"resources/dia_zh-tw.txt\",\n \"revision\": \"24281a99696e767ff085dfd6c49a3fe9\"\n },\n {\n \"url\": \"resources/dia_zh.txt\",\n \"revision\": \"3128f6e90a0db91c9d6adcdb94ca7522\"\n },\n {\n \"url\": \"favicon.ico\",\n \"revision\": \"b2bf17349e4b50ce4ba311f079f8bf7d\"\n },\n {\n \"url\": \"images/manifest.json\",\n \"revision\": \"38d3a7e4b63e8175f0aab6f03e000f07\"\n },\n {\n \"url\": \"images/logo.png\",\n \"revision\": \"e4e0d092abdb1e668b5ec41a7fe0713c\"\n },\n {\n \"url\": \"images/drawlogo.svg\",\n \"revision\": \"4bf4d14ebcf072d8bd4c5a1c89e88fc6\"\n },\n {\n \"url\": \"images/drawlogo48.png\",\n \"revision\": \"8b13428373aca67b895364d025f42417\"\n },\n {\n \"url\": \"images/drawlogo-gray.svg\",\n \"revision\": \"0aabacbc0873816e1e09e4736ae44c7d\"\n },\n {\n \"url\": \"images/drawlogo-text-bottom.svg\",\n \"revision\": \"f6c438823ab31f290940bd4feb8dd9c2\"\n },\n {\n \"url\": \"images/logo-flat-small.png\",\n \"revision\": \"4b178e59ff499d6dd1894fc498b59877\"\n },\n {\n \"url\": \"images/apple-touch-icon.png\",\n \"revision\": \"732c29e21332a926318a7005d21ec450\"\n },\n {\n \"url\": \"images/icon-192-maskable.png\",\n \"revision\": \"47e006d0ce4a35eb5beaa97f0c2bfed0\"\n },\n {\n \"url\": \"images/icon-192.png\",\n \"revision\": \"d022403d52435d76afec82c4e24a17ef\"\n },\n {\n \"url\": \"images/icon-512-maskable.png\",\n \"revision\": \"cf152feeb01fb21f3148a71a3540266e\"\n },\n {\n \"url\": \"images/icon-512.png\",\n \"revision\": \"a3a0df7e7a385244b74073f81ecc45de\"\n },\n {\n \"url\": \"images/delete.png\",\n \"revision\": \"5f2350f2fd20f1a229637aed32ed8f29\"\n },\n {\n \"url\": \"images/droptarget.png\",\n \"revision\": \"bbf7f563fb6784de1ce96f329519b043\"\n },\n {\n \"url\": \"images/logo-flat.png\",\n \"revision\": \"038070ab43aee6e54a791211859fc67b\"\n },\n {\n \"url\": \"images/google-drive-logo.svg\",\n \"revision\": \"5d9f2f5bbc7dcc252730a0072bb23059\"\n },\n {\n \"url\": \"images/onedrive-logo.svg\",\n \"revision\": \"3645b344ec0634c1290dd58d7dc87b97\"\n },\n {\n \"url\": \"images/dropbox-logo.svg\",\n \"revision\": \"e6be408c77cf9c82d41ac64fa854280a\"\n },\n {\n \"url\": \"images/github-logo.svg\",\n \"revision\": \"a1a999b69a275eac0cb918360ac05ae1\"\n },\n {\n \"url\": \"images/gitlab-logo.svg\",\n \"revision\": \"0faea8c818899e58533e153c44b10517\"\n },\n {\n \"url\": \"images/trello-logo.svg\",\n \"revision\": \"006fd0d7d70d7e95dc691674cb12e044\"\n },\n {\n \"url\": \"images/osa_drive-harddisk.png\",\n \"revision\": \"b954e1ae772087c5b4c6ae797e1f9649\"\n },\n {\n \"url\": \"images/osa_database.png\",\n \"revision\": \"c350d9d9b95f37b6cfe798b40ede5fb0\"\n },\n {\n \"url\": \"images/google-drive-logo-white.svg\",\n \"revision\": \"f329d8b1be7778515a85b93fc35d9f26\"\n },\n {\n \"url\": \"images/dropbox-logo-white.svg\",\n \"revision\": \"4ea8299ac3bc31a16f199ee3aec223bf\"\n },\n {\n \"url\": \"images/onedrive-logo-white.svg\",\n \"revision\": \"b3602fa0fc947009cff3f33a581cff4d\"\n },\n {\n \"url\": \"images/github-logo-white.svg\",\n \"revision\": \"537b1127b3ca0f95b45782d1304fb77a\"\n },\n {\n \"url\": \"images/gitlab-logo-white.svg\",\n \"revision\": \"5fede9ac2f394c716b8c23e3fddc3910\"\n },\n {\n \"url\": \"images/trello-logo-white-orange.svg\",\n \"revision\": \"e2a0a52ba3766682f138138d10a75eb5\"\n },\n {\n \"url\": \"images/logo-confluence.png\",\n \"revision\": \"ed1e55d44ae5eba8f999aba2c93e8331\"\n },\n {\n \"url\": \"images/logo-jira.png\",\n \"revision\": \"f8d460555a0d1f87cfd901e940666629\"\n },\n {\n \"url\": \"images/spin.gif\",\n \"revision\": \"487cbb40b9ced439aa1ad914e816d773\"\n },\n {\n \"url\": \"images/aui-wait.gif\",\n \"revision\": \"5a474bcbd8d2f2826f03d10ea44bf60e\"\n },\n {\n \"url\": \"mxgraph/css/common.css\",\n \"revision\": \"81d1704d5ab9207e2e5c7fc84379dc1a\"\n },\n {\n \"url\": \"mxgraph/images/expanded.gif\",\n \"revision\": \"2b67c2c035af1e9a5cc814f0d22074cf\"\n },\n {\n \"url\": \"mxgraph/images/collapsed.gif\",\n \"revision\": \"73cc826da002a3d740ca4ce6ec5c1f4a\"\n },\n {\n \"url\": \"mxgraph/images/maximize.gif\",\n \"revision\": \"5cd13d6925493ab51e876694cc1c2ec2\"\n },\n {\n \"url\": \"mxgraph/images/minimize.gif\",\n \"revision\": \"8957741b9b0f86af9438775f2aadbb54\"\n },\n {\n \"url\": \"mxgraph/images/close.gif\",\n \"revision\": \"8b84669812ac7382984fca35de8da48b\"\n },\n {\n \"url\": \"mxgraph/images/resize.gif\",\n \"revision\": \"a6477612b3567a34033f9cac6184eed3\"\n },\n {\n \"url\": \"mxgraph/images/separator.gif\",\n \"revision\": \"7819742ff106c97da7a801c2372bbbe5\"\n },\n {\n \"url\": \"mxgraph/images/window.gif\",\n \"revision\": \"fd9a21dd4181f98052a202a0a01f18ab\"\n },\n {\n \"url\": \"mxgraph/images/window-title.gif\",\n \"revision\": \"3fb1d6c43246cdf991a11dfe826dfe99\"\n },\n {\n \"url\": \"mxgraph/images/button.gif\",\n \"revision\": \"00759bdc3ad218fa739f584369541809\"\n },\n {\n \"url\": \"mxgraph/images/point.gif\",\n \"revision\": \"83a43717b284902442620f61bc4e9fa6\"\n }\n], {\n \"ignoreURLParametersMatching\": [/.*/]\n});\n\n\n\n\n\n\n\n\n"],"names":["self","skipWaiting","workbox_precaching_precacheAndRoute","url","revision","ignoreURLParametersMatching"],"mappings":"0nBAmBAA,KAAKC,cAULC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,YACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,8CACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,mCACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,cACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,sCACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,qCAEb,CACDC,4BAA+B,CAAC"}\ No newline at end of file+{"version":3,"file":"service-worker.js","sources":["../../../../../../private/var/folders/5p/vxfp3wpj4slfjt2m12dxyp9c0000gn/T/e06219f203fda1d88182fed42cf6764c/service-worker.js"],"sourcesContent":["import {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-precaching/precacheAndRoute.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.skipWaiting();\n\n\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"js/app.min.js\",\n \"revision\": \"80ecaf893beee464723370d0e7ab6dc8\"\n },\n {\n \"url\": \"js/extensions.min.js\",\n \"revision\": \"07b950f7056e7f862ea59633531b8fdf\"\n },\n {\n \"url\": \"js/orgchart.min.js\",\n \"revision\": \"619d8c4dab47b81868916df31f55478b\"\n },\n {\n \"url\": \"js/stencils.min.js\",\n \"revision\": \"f760278d924467fb1d2289448c73fe27\"\n },\n {\n \"url\": \"js/shapes-14-6-5.min.js\",\n \"revision\": \"71913a30c93bc9aff182a3a2b3da1a21\"\n },\n {\n \"url\": \"js/math-print.js\",\n \"revision\": \"cf64f6a493a8cb5079f2b70813e478d7\"\n },\n {\n \"url\": \"index.html\",\n \"revision\": \"7f0094a1758e6c55ab5392910a13d13d\"\n },\n {\n \"url\": \"open.html\",\n \"revision\": \"d71816b3b00e769fc6019fcdd6921662\"\n },\n {\n \"url\": \"shortcuts.svg\",\n \"revision\": \"2381dd779ce6cfee954042a7f784c7e6\"\n },\n {\n \"url\": \"styles/fonts/ArchitectsDaughter-Regular.ttf\",\n \"revision\": \"31c2153c0530e32553b31a49b3d70736\"\n },\n {\n \"url\": \"styles/grapheditor.css\",\n \"revision\": \"d9858ae2e59b4b4c3ba0249583afe7c9\"\n },\n {\n \"url\": \"styles/high-contrast.css\",\n \"revision\": \"c8095fb62f147b591c84b8d290d6703b\"\n },\n {\n \"url\": \"js/dropbox/Dropbox-sdk.min.js\",\n \"revision\": \"4b9842892aa37b156db0a8364b7a83b0\"\n },\n {\n \"url\": \"js/onedrive/OneDrive.js\",\n \"revision\": \"505e8280346666f7ee801bc59521fa67\"\n },\n {\n \"url\": \"js/viewer-static.min.js\",\n \"revision\": \"2b08fb48f17398c012ef275d3ae82374\"\n },\n {\n \"url\": \"connect/jira/editor-1-3-3.html\",\n \"revision\": \"41dc8af9576b47f359cff19fff7a41c2\"\n },\n {\n \"url\": \"connect/jira/viewerPanel-1-3-12.html\",\n \"revision\": \"4836f5e4308abe57830e441518364f23\"\n },\n {\n \"url\": \"connect/jira/fullScreenViewer-1-3-3.html\",\n \"revision\": \"abed474e47c0c41a5ad2366b4828f77a\"\n },\n {\n \"url\": \"connect/jira/viewerPanel.js\",\n \"revision\": \"75f816c208d0c621e3066a97ff0ee6cf\"\n },\n {\n \"url\": \"connect/jira/spinner.gif\",\n \"revision\": \"7d857ab9d86123e93d74d48e958fe743\"\n },\n {\n \"url\": \"connect/jira/editor.js\",\n \"revision\": \"c41221a9a51ff293f05ed13c7b142e5c\"\n },\n {\n \"url\": \"connect/jira/fullscreen-viewer-init.js\",\n \"revision\": \"d3269625ce04b7a277b779ff175957d0\"\n },\n {\n \"url\": \"connect/jira/fullscreen-viewer.js\",\n \"revision\": \"8eceb2fe587296dd11f9c8f6eae34c20\"\n },\n {\n \"url\": \"plugins/connectJira.js\",\n \"revision\": \"c4cb6b60234b04b2c8bc09e555746615\"\n },\n {\n \"url\": \"plugins/cConf-comments.js\",\n \"revision\": \"6deea8e9b96ff96043cd5cfd2a242a9f\"\n },\n {\n \"url\": \"plugins/cConf-1-4-8.js\",\n \"revision\": \"e3bb1453579008ea5e42fbddd5f33c54\"\n },\n {\n \"url\": \"connect/confluence/connectUtils-1-4-8.js\",\n \"revision\": \"94ba9ffc927e0d86a54e70b94504f4f0\"\n },\n {\n \"url\": \"connect/new_common/cac.js\",\n \"revision\": \"740dce44cf53499f476ee8edc37d09a0\"\n },\n {\n \"url\": \"connect/gdrive_common/gac.js\",\n \"revision\": \"3bb38a5d9186a896ed04808e921ef888\"\n },\n {\n \"url\": \"connect/onedrive_common/ac.js\",\n \"revision\": \"5fb6ff1a73f54a9086b7a7e1f613b8ed\"\n },\n {\n \"url\": \"connect/confluence/viewer-init.js\",\n \"revision\": \"b82e366bf57ecced9435c2a8ba9cb9b9\"\n },\n {\n \"url\": \"connect/confluence/viewer.js\",\n \"revision\": \"78b87563d88943ab816a3463927b9b50\"\n },\n {\n \"url\": \"connect/confluence/viewer-1-4-42.html\",\n \"revision\": \"69c1bca25fd4889bf832e8441c972268\"\n },\n {\n \"url\": \"connect/confluence/macroEditor-1-4-8.html\",\n \"revision\": \"4ad77ae3f08c19eddac932b2fa8c7068\"\n },\n {\n \"url\": \"connect/confluence/includeDiagram-1-4-8.js\",\n \"revision\": \"ddb4d1f6d316a187e55bb3fd89fc6165\"\n },\n {\n \"url\": \"connect/confluence/includeDiagram.html\",\n \"revision\": \"9613fec05b19ddef081ca6e9d8b057bf\"\n },\n {\n \"url\": \"connect/confluence/macro-editor.js\",\n \"revision\": \"03a8dcfc69612b44b6e75e6926a956fc\"\n },\n {\n \"url\": \"math/es5/startup.js\",\n \"revision\": \"dc7130cdc866593293dbb5dde11ceb40\"\n },\n {\n \"url\": \"math/es5/core.js\",\n \"revision\": \"f71bc0bfb7d2ac8261747f97a5d47dd4\"\n },\n {\n \"url\": \"math/es5/ui/safe.js\",\n \"revision\": \"8c1fcfee7c879588ad409edcdd9cce53\"\n },\n {\n \"url\": \"math/es5/output/svg.js\",\n \"revision\": \"4f55967d16197ebb01b86356d8ab179a\"\n },\n {\n \"url\": \"math/es5/input/tex.js\",\n \"revision\": \"5c4f470da2ccb1acf85041fcecd6fff6\"\n },\n {\n \"url\": \"math/es5/input/asciimath.js\",\n \"revision\": \"c2d4076dd8e26d509bfe3a378e71cfa7\"\n },\n {\n \"url\": \"math/es5/output/svg/fonts/tex.js\",\n \"revision\": \"6eab785a3788ea805bd2b552d1f0aab8\"\n },\n {\n \"url\": \"resources/dia.txt\",\n \"revision\": \"b44638cfed6404ac07cb82d0ee7d0437\"\n },\n {\n \"url\": \"resources/dia_am.txt\",\n \"revision\": \"0b1eb26b186aacfd5b6d67f88d144d0b\"\n },\n {\n \"url\": \"resources/dia_ar.txt\",\n \"revision\": \"bed70fa15f59b312c168b9ef9528d578\"\n },\n {\n \"url\": \"resources/dia_bg.txt\",\n \"revision\": \"1c846465cb20bf155acc937ba8cbc446\"\n },\n {\n \"url\": \"resources/dia_bn.txt\",\n \"revision\": \"0a7cc401f17390b415417153d8b87b84\"\n },\n {\n \"url\": \"resources/dia_bs.txt\",\n \"revision\": \"b5908edbf7e697b23a2bf90adcbb49c7\"\n },\n {\n \"url\": \"resources/dia_ca.txt\",\n \"revision\": \"c745e8f057b24e85f3f0eecba7af19eb\"\n },\n {\n \"url\": \"resources/dia_cs.txt\",\n \"revision\": \"5e0cf43a649bfdcd56bbebfba6db00ca\"\n },\n {\n \"url\": \"resources/dia_da.txt\",\n \"revision\": \"4766eaa4150ecbe04b89f767835b9406\"\n },\n {\n \"url\": \"resources/dia_de.txt\",\n \"revision\": \"4f0596f7aedfbb808095762f0bd63306\"\n },\n {\n \"url\": \"resources/dia_el.txt\",\n \"revision\": \"a8fa799c3eda7ed001ef011a1e5806dd\"\n },\n {\n \"url\": \"resources/dia_eo.txt\",\n \"revision\": \"6bd806494299f0ac942d1ca21c065478\"\n },\n {\n \"url\": \"resources/dia_es.txt\",\n \"revision\": \"5ea8d76e6966383bcc92bbc4752db5db\"\n },\n {\n \"url\": \"resources/dia_et.txt\",\n \"revision\": \"70aa0cb2ecbbe167a3e4a38aac6dbbdc\"\n },\n {\n \"url\": \"resources/dia_eu.txt\",\n \"revision\": \"1e5419dbdd0da6a6be4e9c48bd99220f\"\n },\n {\n \"url\": \"resources/dia_fa.txt\",\n \"revision\": \"13be854b8db535400e1cd1ec245e740e\"\n },\n {\n \"url\": \"resources/dia_fi.txt\",\n \"revision\": \"8947362d39bee93460c0d86713ee65b7\"\n },\n {\n \"url\": \"resources/dia_fil.txt\",\n \"revision\": \"74efdec615b1003983f77aa12834a75c\"\n },\n {\n \"url\": \"resources/dia_fr.txt\",\n \"revision\": \"8dd13eaca0fcd7e41072c571c201d661\"\n },\n {\n \"url\": \"resources/dia_gl.txt\",\n \"revision\": \"6e09dfae5d18a933d3bc11ba5de44f3c\"\n },\n {\n \"url\": \"resources/dia_gu.txt\",\n \"revision\": \"b9837957b0ca73e4414377b53b53a70b\"\n },\n {\n \"url\": \"resources/dia_he.txt\",\n \"revision\": \"7a8aef0306c6a94f6872896d219d1dc4\"\n },\n {\n \"url\": \"resources/dia_hi.txt\",\n \"revision\": \"3029801be7a36b67a29314a04d5d7d42\"\n },\n {\n \"url\": \"resources/dia_hr.txt\",\n \"revision\": \"57b724efdceb29d21ca8a64c59350b1a\"\n },\n {\n \"url\": \"resources/dia_hu.txt\",\n \"revision\": \"818262e6bcb84ed26563611045490649\"\n },\n {\n \"url\": \"resources/dia_id.txt\",\n \"revision\": \"71d0eb41a8336acdfff7a405c609e18f\"\n },\n {\n \"url\": \"resources/dia_it.txt\",\n \"revision\": \"c3574cb9042adcaea63a3944a09c518e\"\n },\n {\n \"url\": \"resources/dia_ja.txt\",\n \"revision\": \"1c3d11a6636c946d5a22ea52889a19e7\"\n },\n {\n \"url\": \"resources/dia_kn.txt\",\n \"revision\": \"457144ed2c2f51a5ec1d383cbfe9bbf7\"\n },\n {\n \"url\": \"resources/dia_ko.txt\",\n \"revision\": \"e20f9bd4bbf52bf9e3df6e92d7ee1722\"\n },\n {\n \"url\": \"resources/dia_lt.txt\",\n \"revision\": \"bd25b4eab36f6d663c66e4c957b8ef60\"\n },\n {\n \"url\": \"resources/dia_lv.txt\",\n \"revision\": \"e8d8899460a1c81632d7cac287f15354\"\n },\n {\n \"url\": \"resources/dia_ml.txt\",\n \"revision\": \"3b20dfcc809d4b13e3e705a1ae5fbc9f\"\n },\n {\n \"url\": \"resources/dia_mr.txt\",\n \"revision\": \"dd27583c966df6663526af940f7df5d6\"\n },\n {\n \"url\": \"resources/dia_ms.txt\",\n \"revision\": \"253bfb31cf6c8af7ff65527a9137bb9d\"\n },\n {\n \"url\": \"resources/dia_my.txt\",\n \"revision\": \"15f93018ad77289defe0d26df43c6846\"\n },\n {\n \"url\": \"resources/dia_nl.txt\",\n \"revision\": \"abc7305430780a7f3a611e95aa3d6d11\"\n },\n {\n \"url\": \"resources/dia_no.txt\",\n \"revision\": \"cc385ba00d44d6b025fc8b2cffc6721f\"\n },\n {\n \"url\": \"resources/dia_pl.txt\",\n \"revision\": \"485155d3dc8c3d20f42d2ce4689a225f\"\n },\n {\n \"url\": \"resources/dia_pt-br.txt\",\n \"revision\": \"d0bbfa8e826a73098fed085a83a72cdd\"\n },\n {\n \"url\": \"resources/dia_pt.txt\",\n \"revision\": \"18907cf9172320e86fa8aa2a91090ec7\"\n },\n {\n \"url\": \"resources/dia_ro.txt\",\n \"revision\": \"0581872bd0fe468143c7dba864257020\"\n },\n {\n \"url\": \"resources/dia_ru.txt\",\n \"revision\": \"c3789211d3006115131baeea8aab53f7\"\n },\n {\n \"url\": \"resources/dia_si.txt\",\n \"revision\": \"6905439a8ccb386864df2d708be0e8a2\"\n },\n {\n \"url\": \"resources/dia_sk.txt\",\n \"revision\": \"e05d29a790dab92f32a46d0228b5b696\"\n },\n {\n \"url\": \"resources/dia_sl.txt\",\n \"revision\": \"32608759b877e9e942ce209695e841f4\"\n },\n {\n \"url\": \"resources/dia_sr.txt\",\n \"revision\": \"4633d649f40d5b7cf610b6eeb7e6c840\"\n },\n {\n \"url\": \"resources/dia_sv.txt\",\n \"revision\": \"f81f1c1af4df00d757781e3d3b856e05\"\n },\n {\n \"url\": \"resources/dia_sw.txt\",\n \"revision\": \"4f7f39ab83d4ce75b980e1be971ee910\"\n },\n {\n \"url\": \"resources/dia_ta.txt\",\n \"revision\": \"83752a59dfa4f313b73da42e837d8519\"\n },\n {\n \"url\": \"resources/dia_te.txt\",\n \"revision\": \"476a89c596d24e1b1d80f90b76eea1b5\"\n },\n {\n \"url\": \"resources/dia_th.txt\",\n \"revision\": \"6c98c7c4d45c2c260be975ba4db965d3\"\n },\n {\n \"url\": \"resources/dia_tr.txt\",\n \"revision\": \"a4f04603060a5f900fefe32e7aa858a9\"\n },\n {\n \"url\": \"resources/dia_uk.txt\",\n \"revision\": \"2a9c088b5a04a843af42911a0e203fc9\"\n },\n {\n \"url\": \"resources/dia_vi.txt\",\n \"revision\": \"7ada081c11fd313ceee6f51bbc166e34\"\n },\n {\n \"url\": \"resources/dia_zh-tw.txt\",\n \"revision\": \"24281a99696e767ff085dfd6c49a3fe9\"\n },\n {\n \"url\": \"resources/dia_zh.txt\",\n \"revision\": \"3128f6e90a0db91c9d6adcdb94ca7522\"\n },\n {\n \"url\": \"favicon.ico\",\n \"revision\": \"b2bf17349e4b50ce4ba311f079f8bf7d\"\n },\n {\n \"url\": \"images/manifest.json\",\n \"revision\": \"38d3a7e4b63e8175f0aab6f03e000f07\"\n },\n {\n \"url\": \"images/logo.png\",\n \"revision\": \"e4e0d092abdb1e668b5ec41a7fe0713c\"\n },\n {\n \"url\": \"images/drawlogo.svg\",\n \"revision\": \"4bf4d14ebcf072d8bd4c5a1c89e88fc6\"\n },\n {\n \"url\": \"images/drawlogo48.png\",\n \"revision\": \"8b13428373aca67b895364d025f42417\"\n },\n {\n \"url\": \"images/drawlogo-gray.svg\",\n \"revision\": \"0aabacbc0873816e1e09e4736ae44c7d\"\n },\n {\n \"url\": \"images/drawlogo-text-bottom.svg\",\n \"revision\": \"f6c438823ab31f290940bd4feb8dd9c2\"\n },\n {\n \"url\": \"images/logo-flat-small.png\",\n \"revision\": \"4b178e59ff499d6dd1894fc498b59877\"\n },\n {\n \"url\": \"images/apple-touch-icon.png\",\n \"revision\": \"732c29e21332a926318a7005d21ec450\"\n },\n {\n \"url\": \"images/icon-192-maskable.png\",\n \"revision\": \"47e006d0ce4a35eb5beaa97f0c2bfed0\"\n },\n {\n \"url\": \"images/icon-192.png\",\n \"revision\": \"d022403d52435d76afec82c4e24a17ef\"\n },\n {\n \"url\": \"images/icon-512-maskable.png\",\n \"revision\": \"cf152feeb01fb21f3148a71a3540266e\"\n },\n {\n \"url\": \"images/icon-512.png\",\n \"revision\": \"a3a0df7e7a385244b74073f81ecc45de\"\n },\n {\n \"url\": \"images/delete.png\",\n \"revision\": \"5f2350f2fd20f1a229637aed32ed8f29\"\n },\n {\n \"url\": \"images/droptarget.png\",\n \"revision\": \"bbf7f563fb6784de1ce96f329519b043\"\n },\n {\n \"url\": \"images/logo-flat.png\",\n \"revision\": \"038070ab43aee6e54a791211859fc67b\"\n },\n {\n \"url\": \"images/google-drive-logo.svg\",\n \"revision\": \"5d9f2f5bbc7dcc252730a0072bb23059\"\n },\n {\n \"url\": \"images/onedrive-logo.svg\",\n \"revision\": \"3645b344ec0634c1290dd58d7dc87b97\"\n },\n {\n \"url\": \"images/dropbox-logo.svg\",\n \"revision\": \"e6be408c77cf9c82d41ac64fa854280a\"\n },\n {\n \"url\": \"images/github-logo.svg\",\n \"revision\": \"a1a999b69a275eac0cb918360ac05ae1\"\n },\n {\n \"url\": \"images/gitlab-logo.svg\",\n \"revision\": \"0faea8c818899e58533e153c44b10517\"\n },\n {\n \"url\": \"images/trello-logo.svg\",\n \"revision\": \"006fd0d7d70d7e95dc691674cb12e044\"\n },\n {\n \"url\": \"images/osa_drive-harddisk.png\",\n \"revision\": \"b954e1ae772087c5b4c6ae797e1f9649\"\n },\n {\n \"url\": \"images/osa_database.png\",\n \"revision\": \"c350d9d9b95f37b6cfe798b40ede5fb0\"\n },\n {\n \"url\": \"images/google-drive-logo-white.svg\",\n \"revision\": \"f329d8b1be7778515a85b93fc35d9f26\"\n },\n {\n \"url\": \"images/dropbox-logo-white.svg\",\n \"revision\": \"4ea8299ac3bc31a16f199ee3aec223bf\"\n },\n {\n \"url\": \"images/onedrive-logo-white.svg\",\n \"revision\": \"b3602fa0fc947009cff3f33a581cff4d\"\n },\n {\n \"url\": \"images/github-logo-white.svg\",\n \"revision\": \"537b1127b3ca0f95b45782d1304fb77a\"\n },\n {\n \"url\": \"images/gitlab-logo-white.svg\",\n \"revision\": \"5fede9ac2f394c716b8c23e3fddc3910\"\n },\n {\n \"url\": \"images/trello-logo-white-orange.svg\",\n \"revision\": \"e2a0a52ba3766682f138138d10a75eb5\"\n },\n {\n \"url\": \"images/logo-confluence.png\",\n \"revision\": \"ed1e55d44ae5eba8f999aba2c93e8331\"\n },\n {\n \"url\": \"images/logo-jira.png\",\n \"revision\": \"f8d460555a0d1f87cfd901e940666629\"\n },\n {\n \"url\": \"images/spin.gif\",\n \"revision\": \"487cbb40b9ced439aa1ad914e816d773\"\n },\n {\n \"url\": \"images/aui-wait.gif\",\n \"revision\": \"5a474bcbd8d2f2826f03d10ea44bf60e\"\n },\n {\n \"url\": \"mxgraph/css/common.css\",\n \"revision\": \"81d1704d5ab9207e2e5c7fc84379dc1a\"\n },\n {\n \"url\": \"mxgraph/images/expanded.gif\",\n \"revision\": \"2b67c2c035af1e9a5cc814f0d22074cf\"\n },\n {\n \"url\": \"mxgraph/images/collapsed.gif\",\n \"revision\": \"73cc826da002a3d740ca4ce6ec5c1f4a\"\n },\n {\n \"url\": \"mxgraph/images/maximize.gif\",\n \"revision\": \"5cd13d6925493ab51e876694cc1c2ec2\"\n },\n {\n \"url\": \"mxgraph/images/minimize.gif\",\n \"revision\": \"8957741b9b0f86af9438775f2aadbb54\"\n },\n {\n \"url\": \"mxgraph/images/close.gif\",\n \"revision\": \"8b84669812ac7382984fca35de8da48b\"\n },\n {\n \"url\": \"mxgraph/images/resize.gif\",\n \"revision\": \"a6477612b3567a34033f9cac6184eed3\"\n },\n {\n \"url\": \"mxgraph/images/separator.gif\",\n \"revision\": \"7819742ff106c97da7a801c2372bbbe5\"\n },\n {\n \"url\": \"mxgraph/images/window.gif\",\n \"revision\": \"fd9a21dd4181f98052a202a0a01f18ab\"\n },\n {\n \"url\": \"mxgraph/images/window-title.gif\",\n \"revision\": \"3fb1d6c43246cdf991a11dfe826dfe99\"\n },\n {\n \"url\": \"mxgraph/images/button.gif\",\n \"revision\": \"00759bdc3ad218fa739f584369541809\"\n },\n {\n \"url\": \"mxgraph/images/point.gif\",\n \"revision\": \"83a43717b284902442620f61bc4e9fa6\"\n }\n], {\n \"ignoreURLParametersMatching\": [/.*/]\n});\n\n\n\n\n\n\n\n\n"],"names":["self","skipWaiting","workbox_precaching_precacheAndRoute","url","revision","ignoreURLParametersMatching"],"mappings":"0nBAmBAA,KAAKC,cAULC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,gBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,qBACKC,SAAA,oCAEd,CACED,IAAO,qBACKC,SAAA,oCAEd,CACED,IAAO,0BACKC,SAAA,oCAEd,CACED,IAAO,mBACKC,SAAA,oCAEd,CACED,IAAO,aACKC,SAAA,oCAEd,CACED,IAAO,YACKC,SAAA,oCAEd,CACED,IAAO,gBACKC,SAAA,oCAEd,CACED,IAAO,8CACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,2BACKC,SAAA,oCAEd,CACED,IAAO,gCACKC,SAAA,oCAEd,CACED,IAAO,0BACKC,SAAA,oCAEd,CACED,IAAO,0BACKC,SAAA,oCAEd,CACED,IAAO,iCACKC,SAAA,oCAEd,CACED,IAAO,uCACKC,SAAA,oCAEd,CACED,IAAO,2CACKC,SAAA,oCAEd,CACED,IAAO,8BACKC,SAAA,oCAEd,CACED,IAAO,2BACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,yCACKC,SAAA,oCAEd,CACED,IAAO,oCACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,4BACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,2CACKC,SAAA,oCAEd,CACED,IAAO,4BACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,gCACKC,SAAA,oCAEd,CACED,IAAO,oCACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,wCACKC,SAAA,oCAEd,CACED,IAAO,4CACKC,SAAA,oCAEd,CACED,IAAO,6CACKC,SAAA,oCAEd,CACED,IAAO,yCACKC,SAAA,oCAEd,CACED,IAAO,qCACKC,SAAA,oCAEd,CACED,IAAO,sBACKC,SAAA,oCAEd,CACED,IAAO,mBACKC,SAAA,oCAEd,CACED,IAAO,sBACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,wBACKC,SAAA,oCAEd,CACED,IAAO,8BACKC,SAAA,oCAEd,CACED,IAAO,mCACKC,SAAA,oCAEd,CACED,IAAO,oBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,wBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,0BACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,0BACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,cACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,kBACKC,SAAA,oCAEd,CACED,IAAO,sBACKC,SAAA,oCAEd,CACED,IAAO,wBACKC,SAAA,oCAEd,CACED,IAAO,2BACKC,SAAA,oCAEd,CACED,IAAO,kCACKC,SAAA,oCAEd,CACED,IAAO,6BACKC,SAAA,oCAEd,CACED,IAAO,8BACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,sBACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,sBACKC,SAAA,oCAEd,CACED,IAAO,oBACKC,SAAA,oCAEd,CACED,IAAO,wBACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,2BACKC,SAAA,oCAEd,CACED,IAAO,0BACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,gCACKC,SAAA,oCAEd,CACED,IAAO,0BACKC,SAAA,oCAEd,CACED,IAAO,qCACKC,SAAA,oCAEd,CACED,IAAO,gCACKC,SAAA,oCAEd,CACED,IAAO,iCACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,sCACKC,SAAA,oCAEd,CACED,IAAO,6BACKC,SAAA,oCAEd,CACED,IAAO,uBACKC,SAAA,oCAEd,CACED,IAAO,kBACKC,SAAA,oCAEd,CACED,IAAO,sBACKC,SAAA,oCAEd,CACED,IAAO,yBACKC,SAAA,oCAEd,CACED,IAAO,8BACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,8BACKC,SAAA,oCAEd,CACED,IAAO,8BACKC,SAAA,oCAEd,CACED,IAAO,2BACKC,SAAA,oCAEd,CACED,IAAO,4BACKC,SAAA,oCAEd,CACED,IAAO,+BACKC,SAAA,oCAEd,CACED,IAAO,4BACKC,SAAA,oCAEd,CACED,IAAO,kCACKC,SAAA,oCAEd,CACED,IAAO,4BACKC,SAAA,oCAEd,CACED,IAAO,2BACKC,SAAA,qCAEb,CACDC,4BAA+B,CAAC"}\ No newline at end of filediff --git a/src/main/webapp/styles/grapheditor.css b/src/main/webapp/styles/grapheditor.cssindex 53320d376..ca6ef078c 100644--- a/src/main/webapp/styles/grapheditor.css+++ b/src/main/webapp/styles/grapheditor.css@@ -164,6 +164,14 @@ div[id*="dgeMermaidOutput-"] {width: 100%;}+.geSmallAppIcon {+ padding: 0 4px 0 8px;+}++.geAtlas .geSmallAppIcon {+ padding-left: 8px;+}+.geAppIcon {display: block;position: absolute;@@ -505,6 +513,11 @@ html body.geEditor .gePrimaryBtn:hover:not([disabled]) {box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .11), inset 0 -1px 0 0 rgba(0, 0, 0, .08), 0 1px 2px 0 rgba(0, 0, 0, .04);}+.geDarkMode .geButtonGroup {+ border-style: solid;+ border-width: 1px;+}+.geButtonGroup .geButton {background-size: 22px;margin: 0 4px;@@ -866,7 +879,7 @@ div td.mxWindowTitle {}.geButtonContainer {- padding-right: 8px;+ padding-right: 14px;display: inline-flex;align-items: center;margin-left: auto;@@ -941,6 +954,10 @@ div td.mxWindowTitle {padding: 0 28px 0 16px;}+.geEditor.geClassic .geMenubarContainer {+ padding-left: 4px;+}+.geSidebarContainer a,.geMenubarContainer a,.geToolbar a {@@ -1055,12 +1072,21 @@ div.geFormatContainer {flex-shrink: 0;}+.geEmbed.geAtlas>.geMenubarContainer>.geStatusDiv,.geClassic.geEmbed.geCompactMode>.geMenubarContainer>.geStatusDiv {position: fixed;right: 16px;top: 6px;}+.geClassic.geEmbed.geCompactMode>.geMenubarContainer>.geStatusDiv {+ top: 6px;+}++.geEmbed.geAtlas>.geMenubarContainer>.geStatusDiv {+ top: 16px;+}+html body div.geSmallBanner {background-color: #F2931E;background: linear-gradient(#F2931E 0px, #F08707 100%);@@ -1544,7 +1570,7 @@ a.geStatus>div {padding: 1px;}-.geButton.geRoundButton {+.geButton.geRoundButton:not(.geEmbed.geCompactMode .geButtonContainer .geButton) {background-size: 24px 24px;justify-content: center;box-sizing: content-box;@@ -1858,6 +1884,11 @@ a.geStatus>div {box-sizing: border-box;}+.geEditor .picker-dialog,+.geEditor .picker-dialog-bg {+ z-index: 10004;+}+.geDialog.geInlineDialog {padding: 0px;left: auto;@@ -2735,7 +2766,6 @@ table.geProperties tr td {}.geAtlas .geMenubar .geButtonContainer {- padding-right: 8px;margin-top: 0px;}@@ -2759,8 +2789,9 @@ table.geProperties tr td {}.geEditor.geAtlas>.geMenubarContainer .geMenubar {- padding-left: 0px;+ padding-left: 12px;height: 100%;+ top: 0;}.geAtlas .geMenubarContainer .geItem {diff --git a/src/main/webapp/workbox-72a83b64.js b/src/main/webapp/workbox-72a83b64.jsnew file mode 100644index 000000000..041626f23--- /dev/null+++ b/src/main/webapp/workbox-72a83b64.js@@ -0,0 +1,2 @@+define(["exports"],(function(t){"use strict";try{self["workbox:core:6.5.1"]&&_()}catch(t){}const e=(t,...e)=>{let s=t;return e.length>0&&(s+=` :: ${JSON.stringify(e)}`),s};class s extends Error{constructor(t,s){super(e(t,s)),this.name=t,this.details=s}}try{self["workbox:routing:6.5.1"]&&_()}catch(t){}const n=t=>t&&"object"==typeof t?t:{handle:t};class i{constructor(t,e,s="GET"){this.handler=n(e),this.match=t,this.method=s}setCatchHandler(t){this.catchHandler=n(t)}}class r extends i{constructor(t,e,s){super((({url:e})=>{const s=t.exec(e.href);if(s&&(e.origin===location.origin||0===s.index))return s.slice(1)}),e,s)}}class o{constructor(){this.t=new Map,this.i=new Map}get routes(){return this.t}addFetchListener(){self.addEventListener("fetch",(t=>{const{request:e}=t,s=this.handleRequest({request:e,event:t});s&&t.respondWith(s)}))}addCacheListener(){self.addEventListener("message",(t=>{if(t.data&&"CACHE_URLS"===t.data.type){const{payload:e}=t.data,s=Promise.all(e.urlsToCache.map((e=>{"string"==typeof e&&(e=[e]);const s=new Request(...e);return this.handleRequest({request:s,event:t})})));t.waitUntil(s),t.ports&&t.ports[0]&&s.then((()=>t.ports[0].postMessage(!0)))}}))}handleRequest({request:t,event:e}){const s=new URL(t.url,location.href);if(!s.protocol.startsWith("http"))return;const n=s.origin===location.origin,{params:i,route:r}=this.findMatchingRoute({event:e,request:t,sameOrigin:n,url:s});let o=r&&r.handler;const a=t.method;if(!o&&this.i.has(a)&&(o=this.i.get(a)),!o)return;let c;try{c=o.handle({url:s,request:t,event:e,params:i})}catch(t){c=Promise.reject(t)}const h=r&&r.catchHandler;return c instanceof Promise&&(this.o||h)&&(c=c.catch((async n=>{if(h)try{return await h.handle({url:s,request:t,event:e,params:i})}catch(t){t instanceof Error&&(n=t)}if(this.o)return this.o.handle({url:s,request:t,event:e});throw n}))),c}findMatchingRoute({url:t,sameOrigin:e,request:s,event:n}){const i=this.t.get(s.method)||[];for(const r of i){let i;const o=r.match({url:t,sameOrigin:e,request:s,event:n});if(o)return i=o,(Array.isArray(i)&&0===i.length||o.constructor===Object&&0===Object.keys(o).length||"boolean"==typeof o)&&(i=void 0),{route:r,params:i}}return{}}setDefaultHandler(t,e="GET"){this.i.set(e,n(t))}setCatchHandler(t){this.o=n(t)}registerRoute(t){this.t.has(t.method)||this.t.set(t.method,[]),this.t.get(t.method).push(t)}unregisterRoute(t){if(!this.t.has(t.method))throw new s("unregister-route-but-not-found-with-method",{method:t.method});const e=this.t.get(t.method).indexOf(t);if(!(e>-1))throw new s("unregister-route-route-not-registered");this.t.get(t.method).splice(e,1)}}let a;const c={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},h=t=>[c.prefix,t,c.suffix].filter((t=>t&&t.length>0)).join("-"),u=t=>t||h(c.precache),l=t=>t||h(c.runtime);function f(t,e){const s=e();return t.waitUntil(s),s}try{self["workbox:precaching:6.5.1"]&&_()}catch(t){}function w(t){if(!t)throw new s("add-to-cache-list-unexpected-type",{entry:t});if("string"==typeof t){const e=new URL(t,location.href);return{cacheKey:e.href,url:e.href}}const{revision:e,url:n}=t;if(!n)throw new s("add-to-cache-list-unexpected-type",{entry:t});if(!e){const t=new URL(n,location.href);return{cacheKey:t.href,url:t.href}}const i=new URL(n,location.href),r=new URL(n,location.href);return i.searchParams.set("__WB_REVISION__",e),{cacheKey:i.href,url:r.href}}class d{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:t,state:e})=>{e&&(e.originalRequest=t)},this.cachedResponseWillBeUsed=async({event:t,state:e,cachedResponse:s})=>{if("install"===t.type&&e&&e.originalRequest&&e.originalRequest instanceof Request){const t=e.originalRequest.url;s?this.notUpdatedURLs.push(t):this.updatedURLs.push(t)}return s}}}class p{constructor({precacheController:t}){this.cacheKeyWillBeUsed=async({request:t,params:e})=>{const s=(null==e?void 0:e.cacheKey)||this.h.getCacheKeyForURL(t.url);return s?new Request(s,{headers:t.headers}):t},this.h=t}}let y;async function g(t,e){let n=null;if(t.url){n=new URL(t.url).origin}if(n!==self.location.origin)throw new s("cross-origin-copy-response",{origin:n});const i=t.clone(),r={headers:new Headers(i.headers),status:i.status,statusText:i.statusText},o=e?e(r):r,a=function(){if(void 0===y){const t=new Response("");if("body"in t)try{new Response(t.body),y=!0}catch(t){y=!1}y=!1}return y}()?i.body:await i.blob();return new Response(a,o)}function R(t,e){const s=new URL(t);for(const t of e)s.searchParams.delete(t);return s.href}class m{constructor(){this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}}const v=new Set;try{self["workbox:strategies:6.5.1"]&&_()}catch(t){}function q(t){return"string"==typeof t?new Request(t):t}class U{constructor(t,e){this.u={},Object.assign(this,e),this.event=e.event,this.l=t,this.p=new m,this.g=[],this.R=[...t.plugins],this.m=new Map;for(const t of this.R)this.m.set(t,{});this.event.waitUntil(this.p.promise)}async fetch(t){const{event:e}=this;let n=q(t);if("navigate"===n.mode&&e instanceof FetchEvent&&e.preloadResponse){const t=await e.preloadResponse;if(t)return t}const i=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const t of this.iterateCallbacks("requestWillFetch"))n=await t({request:n.clone(),event:e})}catch(t){if(t instanceof Error)throw new s("plugin-error-request-will-fetch",{thrownErrorMessage:t.message})}const r=n.clone();try{let t;t=await fetch(n,"navigate"===n.mode?void 0:this.l.fetchOptions);for(const s of this.iterateCallbacks("fetchDidSucceed"))t=await s({event:e,request:r,response:t});return t}catch(t){throw i&&await this.runCallbacks("fetchDidFail",{error:t,event:e,originalRequest:i.clone(),request:r.clone()}),t}}async fetchAndCachePut(t){const e=await this.fetch(t),s=e.clone();return this.waitUntil(this.cachePut(t,s)),e}async cacheMatch(t){const e=q(t);let s;const{cacheName:n,matchOptions:i}=this.l,r=await this.getCacheKey(e,"read"),o=Object.assign(Object.assign({},i),{cacheName:n});s=await caches.match(r,o);for(const t of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await t({cacheName:n,matchOptions:i,cachedResponse:s,request:r,event:this.event})||void 0;return s}async cachePut(t,e){const n=q(t);var i;await(i=0,new Promise((t=>setTimeout(t,i))));const r=await this.getCacheKey(n,"write");if(!e)throw new s("cache-put-with-no-response",{url:(o=r.url,new URL(String(o),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var o;const a=await this.v(e);if(!a)return!1;const{cacheName:c,matchOptions:h}=this.l,u=await self.caches.open(c),l=this.hasCallback("cacheDidUpdate"),f=l?await async function(t,e,s,n){const i=R(e.url,s);if(e.url===i)return t.match(e,n);const r=Object.assign(Object.assign({},n),{ignoreSearch:!0}),o=await t.keys(e,r);for(const e of o)if(i===R(e.url,s))return t.match(e,n)}(u,r.clone(),["__WB_REVISION__"],h):null;try{await u.put(r,l?a.clone():a)}catch(t){if(t instanceof Error)throw"QuotaExceededError"===t.name&&await async function(){for(const t of v)await t()}(),t}for(const t of this.iterateCallbacks("cacheDidUpdate"))await t({cacheName:c,oldResponse:f,newResponse:a.clone(),request:r,event:this.event});return!0}async getCacheKey(t,e){const s=`${t.url} | ${e}`;if(!this.u[s]){let n=t;for(const t of this.iterateCallbacks("cacheKeyWillBeUsed"))n=q(await t({mode:e,request:n,event:this.event,params:this.params}));this.u[s]=n}return this.u[s]}hasCallback(t){for(const e of this.l.plugins)if(t in e)return!0;return!1}async runCallbacks(t,e){for(const s of this.iterateCallbacks(t))await s(e)}*iterateCallbacks(t){for(const e of this.l.plugins)if("function"==typeof e[t]){const s=this.m.get(e),n=n=>{const i=Object.assign(Object.assign({},n),{state:s});return e[t](i)};yield n}}waitUntil(t){return this.g.push(t),t}async doneWaiting(){let t;for(;t=this.g.shift();)await t}destroy(){this.p.resolve(null)}async v(t){let e=t,s=!1;for(const t of this.iterateCallbacks("cacheWillUpdate"))if(e=await t({request:this.request,response:e,event:this.event})||void 0,s=!0,!e)break;return s||e&&200!==e.status&&(e=void 0),e}}class L extends class{constructor(t={}){this.cacheName=l(t.cacheName),this.plugins=t.plugins||[],this.fetchOptions=t.fetchOptions,this.matchOptions=t.matchOptions}handle(t){const[e]=this.handleAll(t);return e}handleAll(t){t instanceof FetchEvent&&(t={event:t,request:t.request});const e=t.event,s="string"==typeof t.request?new Request(t.request):t.request,n="params"in t?t.params:void 0,i=new U(this,{event:e,request:s,params:n}),r=this.q(i,s,e);return[r,this.U(r,i,s,e)]}async q(t,e,n){let i;await t.runCallbacks("handlerWillStart",{event:n,request:e});try{if(i=await this.L(e,t),!i||"error"===i.type)throw new s("no-response",{url:e.url})}catch(s){if(s instanceof Error)for(const r of t.iterateCallbacks("handlerDidError"))if(i=await r({error:s,event:n,request:e}),i)break;if(!i)throw s}for(const s of t.iterateCallbacks("handlerWillRespond"))i=await s({event:n,request:e,response:i});return i}async U(t,e,s,n){let i,r;try{i=await t}catch(r){}try{await e.runCallbacks("handlerDidRespond",{event:n,request:s,response:i}),await e.doneWaiting()}catch(t){t instanceof Error&&(r=t)}if(await e.runCallbacks("handlerDidComplete",{event:n,request:s,response:i,error:r}),e.destroy(),r)throw r}}{constructor(t={}){t.cacheName=u(t.cacheName),super(t),this._=!1!==t.fallbackToNetwork,this.plugins.push(L.copyRedirectedCacheableResponsesPlugin)}async L(t,e){const s=await e.cacheMatch(t);return s||(e.event&&"install"===e.event.type?await this.C(t,e):await this.O(t,e))}async O(t,e){let n;const i=e.params||{};if(!this._)throw new s("missing-precache-entry",{cacheName:this.cacheName,url:t.url});{const s=i.integrity,r=t.integrity,o=!r||r===s;n=await e.fetch(new Request(t,{integrity:r||s})),s&&o&&(this.N(),await e.cachePut(t,n.clone()))}return n}async C(t,e){this.N();const n=await e.fetch(t);if(!await e.cachePut(t,n.clone()))throw new s("bad-precaching-response",{url:t.url,status:n.status});return n}N(){let t=null,e=0;for(const[s,n]of this.plugins.entries())n!==L.copyRedirectedCacheableResponsesPlugin&&(n===L.defaultPrecacheCacheabilityPlugin&&(t=s),n.cacheWillUpdate&&e++);0===e?this.plugins.push(L.defaultPrecacheCacheabilityPlugin):e>1&&null!==t&&this.plugins.splice(t,1)}}L.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:t})=>!t||t.status>=400?null:t},L.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:t})=>t.redirected?await g(t):t};class b{constructor({cacheName:t,plugins:e=[],fallbackToNetwork:s=!0}={}){this.k=new Map,this.K=new Map,this.T=new Map,this.l=new L({cacheName:u(t),plugins:[...e,new p({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this.l}precache(t){this.addToCacheList(t),this.W||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this.W=!0)}addToCacheList(t){const e=[];for(const n of t){"string"==typeof n?e.push(n):n&&void 0===n.revision&&e.push(n.url);const{cacheKey:t,url:i}=w(n),r="string"!=typeof n&&n.revision?"reload":"default";if(this.k.has(i)&&this.k.get(i)!==t)throw new s("add-to-cache-list-conflicting-entries",{firstEntry:this.k.get(i),secondEntry:t});if("string"!=typeof n&&n.integrity){if(this.T.has(t)&&this.T.get(t)!==n.integrity)throw new s("add-to-cache-list-conflicting-integrities",{url:i});this.T.set(t,n.integrity)}if(this.k.set(i,t),this.K.set(i,r),e.length>0){const t=`Workbox is precaching URLs without revision info: ${e.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(t)}}}install(t){return f(t,(async()=>{const e=new d;this.strategy.plugins.push(e);for(const[e,s]of this.k){const n=this.T.get(s),i=this.K.get(e),r=new Request(e,{integrity:n,cache:i,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:s},request:r,event:t}))}const{updatedURLs:s,notUpdatedURLs:n}=e;return{updatedURLs:s,notUpdatedURLs:n}}))}activate(t){return f(t,(async()=>{const t=await self.caches.open(this.strategy.cacheName),e=await t.keys(),s=new Set(this.k.values()),n=[];for(const i of e)s.has(i.url)||(await t.delete(i),n.push(i.url));return{deletedURLs:n}}))}getURLsToCacheKeys(){return this.k}getCachedURLs(){return[...this.k.keys()]}getCacheKeyForURL(t){const e=new URL(t,location.href);return this.k.get(e.href)}getIntegrityForCacheKey(t){return this.T.get(t)}async matchPrecache(t){const e=t instanceof Request?t.url:t,s=this.getCacheKeyForURL(e);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(t){const e=this.getCacheKeyForURL(t);if(!e)throw new s("non-precached-url",{url:t});return s=>(s.request=new Request(t),s.params=Object.assign({cacheKey:e},s.params),this.strategy.handle(s))}}let C;const E=()=>(C||(C=new b),C);class O extends i{constructor(t,e){super((({request:s})=>{const n=t.getURLsToCacheKeys();for(const i of function*(t,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:n=!0,urlManipulation:i}={}){const r=new URL(t,location.href);r.hash="",yield r.href;const o=function(t,e=[]){for(const s of[...t.searchParams.keys()])e.some((t=>t.test(s)))&&t.searchParams.delete(s);return t}(r,e);if(yield o.href,s&&o.pathname.endsWith("/")){const t=new URL(o.href);t.pathname+=s,yield t.href}if(n){const t=new URL(o.href);t.pathname+=".html",yield t.href}if(i){const t=i({url:r});for(const e of t)yield e.href}}(s.url,e)){const e=n.get(i);if(e){return{cacheKey:e,integrity:t.getIntegrityForCacheKey(e)}}}}),t.strategy)}}function x(t){const e=E();!function(t,e,n){let c;if("string"==typeof t){const s=new URL(t,location.href);c=new i((({url:t})=>t.href===s.href),e,n)}else if(t instanceof RegExp)c=new r(t,e,n);else if("function"==typeof t)c=new i(t,e,n);else{if(!(t instanceof i))throw new s("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});c=t}(a||(a=new o,a.addFetchListener(),a.addCacheListener()),a).registerRoute(c)}(new O(e,t))}t.precacheAndRoute=function(t,e){!function(t){E().precache(t)}(t),x(e)}}));+//# sourceMappingURL=workbox-72a83b64.js.mapdiff --git a/src/main/webapp/workbox-72a83b64.js.map b/src/main/webapp/workbox-72a83b64.js.mapnew file mode 100644index 000000000..8a652dbbc--- /dev/null+++ b/src/main/webapp/workbox-72a83b64.js.map@@ -0,0 +1 @@+{"version":3,"file":"workbox-72a83b64.js","sources":["../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-core/_version.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-core/_private/logger.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-core/models/messages/messageGenerator.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-core/_private/WorkboxError.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-routing/_version.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-routing/utils/constants.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-routing/utils/normalizeHandler.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-routing/Route.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-routing/RegExpRoute.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-routing/Router.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-routing/utils/getOrCreateDefaultRouter.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-core/_private/cacheNames.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-core/_private/waitUntil.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-precaching/_version.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-precaching/utils/createCacheKey.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-precaching/utils/PrecacheInstallReportPlugin.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-precaching/utils/PrecacheCacheKeyPlugin.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-core/_private/canConstructResponseFromBodyStream.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-core/copyResponse.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-core/_private/cacheMatchIgnoreParams.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-core/_private/Deferred.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-core/models/quotaErrorCallbacks.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-strategies/_version.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-strategies/StrategyHandler.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-core/_private/timeout.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-core/_private/getFriendlyURL.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-core/_private/executeQuotaErrorCallbacks.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-precaching/PrecacheStrategy.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-strategies/Strategy.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-precaching/PrecacheController.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-precaching/utils/getOrCreatePrecacheController.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-precaching/PrecacheRoute.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-precaching/utils/generateURLVariations.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-precaching/utils/removeIgnoredSearchParams.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-precaching/addRoute.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-routing/registerRoute.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-precaching/precacheAndRoute.js","../../../../../../opt/homebrew/lib/node_modules/workbox-cli/node_modules/workbox-precaching/precache.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:core:6.5.1'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2019 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst logger = (process.env.NODE_ENV === 'production'\n ? null\n : (() => {\n // Don't overwrite this value if it's already set.\n // See https://github.com/GoogleChrome/workbox/pull/2284#issuecomment-560470923\n if (!('__WB_DISABLE_DEV_LOGS' in self)) {\n self.__WB_DISABLE_DEV_LOGS = false;\n }\n let inGroup = false;\n const methodToColorMap = {\n debug: `#7f8c8d`,\n log: `#2ecc71`,\n warn: `#f39c12`,\n error: `#c0392b`,\n groupCollapsed: `#3498db`,\n groupEnd: null, // No colored prefix on groupEnd\n };\n const print = function (method, args) {\n if (self.__WB_DISABLE_DEV_LOGS) {\n return;\n }\n if (method === 'groupCollapsed') {\n // Safari doesn't print all console.groupCollapsed() arguments:\n // https://bugs.webkit.org/show_bug.cgi?id=182754\n if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {\n console[method](...args);\n return;\n }\n }\n const styles = [\n `background: ${methodToColorMap[method]}`,\n `border-radius: 0.5em`,\n `color: white`,\n `font-weight: bold`,\n `padding: 2px 0.5em`,\n ];\n // When in a group, the workbox prefix is not displayed.\n const logPrefix = inGroup ? [] : ['%cworkbox', styles.join(';')];\n console[method](...logPrefix, ...args);\n if (method === 'groupCollapsed') {\n inGroup = true;\n }\n if (method === 'groupEnd') {\n inGroup = false;\n }\n };\n // eslint-disable-next-line @typescript-eslint/ban-types\n const api = {};\n const loggerMethods = Object.keys(methodToColorMap);\n for (const key of loggerMethods) {\n const method = key;\n api[method] = (...args) => {\n print(method, args);\n };\n }\n return api;\n })());\nexport { logger };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { messages } from './messages.js';\nimport '../../_version.js';\nconst fallback = (code, ...args) => {\n let msg = code;\n if (args.length > 0) {\n msg += ` :: ${JSON.stringify(args)}`;\n }\n return msg;\n};\nconst generatorFunction = (code, details = {}) => {\n const message = messages[code];\n if (!message) {\n throw new Error(`Unable to find message for code '${code}'.`);\n }\n return message(details);\n};\nexport const messageGenerator = process.env.NODE_ENV === 'production' ? fallback : generatorFunction;\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { messageGenerator } from '../models/messages/messageGenerator.js';\nimport '../_version.js';\n/**\n * Workbox errors should be thrown with this class.\n * This allows use to ensure the type easily in tests,\n * helps developers identify errors from workbox\n * easily and allows use to optimise error\n * messages correctly.\n *\n * @private\n */\nclass WorkboxError extends Error {\n /**\n *\n * @param {string} errorCode The error code that\n * identifies this particular error.\n * @param {Object=} details Any relevant arguments\n * that will help developers identify issues should\n * be added as a key on the context object.\n */\n constructor(errorCode, details) {\n const message = messageGenerator(errorCode, details);\n super(message);\n this.name = errorCode;\n this.details = details;\n }\n}\nexport { WorkboxError };\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:routing:6.5.1'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * The default HTTP method, 'GET', used when there's no specific method\n * configured for a route.\n *\n * @type {string}\n *\n * @private\n */\nexport const defaultMethod = 'GET';\n/**\n * The list of valid HTTP methods associated with requests that could be routed.\n *\n * @type {Array<string>}\n *\n * @private\n */\nexport const validMethods = [\n 'DELETE',\n 'GET',\n 'HEAD',\n 'PATCH',\n 'POST',\n 'PUT',\n];\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport '../_version.js';\n/**\n * @param {function()|Object} handler Either a function, or an object with a\n * 'handle' method.\n * @return {Object} An object with a handle method.\n *\n * @private\n */\nexport const normalizeHandler = (handler) => {\n if (handler && typeof handler === 'object') {\n if (process.env.NODE_ENV !== 'production') {\n assert.hasMethod(handler, 'handle', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'handler',\n });\n }\n return handler;\n }\n else {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(handler, 'function', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'handler',\n });\n }\n return { handle: handler };\n }\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { defaultMethod, validMethods } from './utils/constants.js';\nimport { normalizeHandler } from './utils/normalizeHandler.js';\nimport './_version.js';\n/**\n * A `Route` consists of a pair of callback functions, \"match\" and \"handler\".\n * The \"match\" callback determine if a route should be used to \"handle\" a\n * request by returning a non-falsy value if it can. The \"handler\" callback\n * is called when there is a match and should return a Promise that resolves\n * to a `Response`.\n *\n * @memberof workbox-routing\n */\nclass Route {\n /**\n * Constructor for Route class.\n *\n * @param {workbox-routing~matchCallback} match\n * A callback function that determines whether the route matches a given\n * `fetch` event by returning a non-falsy value.\n * @param {workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resolving to a Response.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n */\n constructor(match, handler, method = defaultMethod) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(match, 'function', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'match',\n });\n if (method) {\n assert.isOneOf(method, validMethods, { paramName: 'method' });\n }\n }\n // These values are referenced directly by Router so cannot be\n // altered by minificaton.\n this.handler = normalizeHandler(handler);\n this.match = match;\n this.method = method;\n }\n /**\n *\n * @param {workbox-routing-handlerCallback} handler A callback\n * function that returns a Promise resolving to a Response\n */\n setCatchHandler(handler) {\n this.catchHandler = normalizeHandler(handler);\n }\n}\nexport { Route };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { Route } from './Route.js';\nimport './_version.js';\n/**\n * RegExpRoute makes it easy to create a regular expression based\n * {@link workbox-routing.Route}.\n *\n * For same-origin requests the RegExp only needs to match part of the URL. For\n * requests against third-party servers, you must define a RegExp that matches\n * the start of the URL.\n *\n * @memberof workbox-routing\n * @extends workbox-routing.Route\n */\nclass RegExpRoute extends Route {\n /**\n * If the regular expression contains\n * [capture groups]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#grouping-back-references},\n * the captured values will be passed to the\n * {@link workbox-routing~handlerCallback} `params`\n * argument.\n *\n * @param {RegExp} regExp The regular expression to match against URLs.\n * @param {workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n */\n constructor(regExp, handler, method) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(regExp, RegExp, {\n moduleName: 'workbox-routing',\n className: 'RegExpRoute',\n funcName: 'constructor',\n paramName: 'pattern',\n });\n }\n const match = ({ url }) => {\n const result = regExp.exec(url.href);\n // Return immediately if there's no match.\n if (!result) {\n return;\n }\n // Require that the match start at the first character in the URL string\n // if it's a cross-origin request.\n // See https://github.com/GoogleChrome/workbox/issues/281 for the context\n // behind this behavior.\n if (url.origin !== location.origin && result.index !== 0) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`The regular expression '${regExp.toString()}' only partially matched ` +\n `against the cross-origin URL '${url.toString()}'. RegExpRoute's will only ` +\n `handle cross-origin requests if they match the entire URL.`);\n }\n return;\n }\n // If the route matches, but there aren't any capture groups defined, then\n // this will return [], which is truthy and therefore sufficient to\n // indicate a match.\n // If there are capture groups, then it will return their values.\n return result.slice(1);\n };\n super(match, handler, method);\n }\n}\nexport { RegExpRoute };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { defaultMethod } from './utils/constants.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { normalizeHandler } from './utils/normalizeHandler.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport './_version.js';\n/**\n * The Router can be used to process a `FetchEvent` using one or more\n * {@link workbox-routing.Route}, responding with a `Response` if\n * a matching route exists.\n *\n * If no route matches a given a request, the Router will use a \"default\"\n * handler if one is defined.\n *\n * Should the matching Route throw an error, the Router will use a \"catch\"\n * handler if one is defined to gracefully deal with issues and respond with a\n * Request.\n *\n * If a request matches multiple routes, the **earliest** registered route will\n * be used to respond to the request.\n *\n * @memberof workbox-routing\n */\nclass Router {\n /**\n * Initializes a new Router.\n */\n constructor() {\n this._routes = new Map();\n this._defaultHandlerMap = new Map();\n }\n /**\n * @return {Map<string, Array<workbox-routing.Route>>} routes A `Map` of HTTP\n * method name ('GET', etc.) to an array of all the corresponding `Route`\n * instances that are registered.\n */\n get routes() {\n return this._routes;\n }\n /**\n * Adds a fetch event listener to respond to events when a route matches\n * the event's request.\n */\n addFetchListener() {\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('fetch', ((event) => {\n const { request } = event;\n const responsePromise = this.handleRequest({ request, event });\n if (responsePromise) {\n event.respondWith(responsePromise);\n }\n }));\n }\n /**\n * Adds a message event listener for URLs to cache from the window.\n * This is useful to cache resources loaded on the page prior to when the\n * service worker started controlling it.\n *\n * The format of the message data sent from the window should be as follows.\n * Where the `urlsToCache` array may consist of URL strings or an array of\n * URL string + `requestInit` object (the same as you'd pass to `fetch()`).\n *\n * ```\n * {\n * type: 'CACHE_URLS',\n * payload: {\n * urlsToCache: [\n * './script1.js',\n * './script2.js',\n * ['./script3.js', {mode: 'no-cors'}],\n * ],\n * },\n * }\n * ```\n */\n addCacheListener() {\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('message', ((event) => {\n // event.data is type 'any'\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (event.data && event.data.type === 'CACHE_URLS') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const { payload } = event.data;\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Caching URLs from the window`, payload.urlsToCache);\n }\n const requestPromises = Promise.all(payload.urlsToCache.map((entry) => {\n if (typeof entry === 'string') {\n entry = [entry];\n }\n const request = new Request(...entry);\n return this.handleRequest({ request, event });\n // TODO(philipwalton): TypeScript errors without this typecast for\n // some reason (probably a bug). The real type here should work but\n // doesn't: `Array<Promise<Response> | undefined>`.\n })); // TypeScript\n event.waitUntil(requestPromises);\n // If a MessageChannel was used, reply to the message on success.\n if (event.ports && event.ports[0]) {\n void requestPromises.then(() => event.ports[0].postMessage(true));\n }\n }\n }));\n }\n /**\n * Apply the routing rules to a FetchEvent object to get a Response from an\n * appropriate Route's handler.\n *\n * @param {Object} options\n * @param {Request} options.request The request to handle.\n * @param {ExtendableEvent} options.event The event that triggered the\n * request.\n * @return {Promise<Response>|undefined} A promise is returned if a\n * registered route can handle the request. If there is no matching\n * route and there's no `defaultHandler`, `undefined` is returned.\n */\n handleRequest({ request, event, }) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(request, Request, {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'handleRequest',\n paramName: 'options.request',\n });\n }\n const url = new URL(request.url, location.href);\n if (!url.protocol.startsWith('http')) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Workbox Router only supports URLs that start with 'http'.`);\n }\n return;\n }\n const sameOrigin = url.origin === location.origin;\n const { params, route } = this.findMatchingRoute({\n event,\n request,\n sameOrigin,\n url,\n });\n let handler = route && route.handler;\n const debugMessages = [];\n if (process.env.NODE_ENV !== 'production') {\n if (handler) {\n debugMessages.push([`Found a route to handle this request:`, route]);\n if (params) {\n debugMessages.push([\n `Passing the following params to the route's handler:`,\n params,\n ]);\n }\n }\n }\n // If we don't have a handler because there was no matching route, then\n // fall back to defaultHandler if that's defined.\n const method = request.method;\n if (!handler && this._defaultHandlerMap.has(method)) {\n if (process.env.NODE_ENV !== 'production') {\n debugMessages.push(`Failed to find a matching route. Falling ` +\n `back to the default handler for ${method}.`);\n }\n handler = this._defaultHandlerMap.get(method);\n }\n if (!handler) {\n if (process.env.NODE_ENV !== 'production') {\n // No handler so Workbox will do nothing. If logs is set of debug\n // i.e. verbose, we should print out this information.\n logger.debug(`No route found for: ${getFriendlyURL(url)}`);\n }\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // We have a handler, meaning Workbox is going to handle the route.\n // print the routing details to the console.\n logger.groupCollapsed(`Router is responding to: ${getFriendlyURL(url)}`);\n debugMessages.forEach((msg) => {\n if (Array.isArray(msg)) {\n logger.log(...msg);\n }\n else {\n logger.log(msg);\n }\n });\n logger.groupEnd();\n }\n // Wrap in try and catch in case the handle method throws a synchronous\n // error. It should still callback to the catch handler.\n let responsePromise;\n try {\n responsePromise = handler.handle({ url, request, event, params });\n }\n catch (err) {\n responsePromise = Promise.reject(err);\n }\n // Get route's catch handler, if it exists\n const catchHandler = route && route.catchHandler;\n if (responsePromise instanceof Promise &&\n (this._catchHandler || catchHandler)) {\n responsePromise = responsePromise.catch(async (err) => {\n // If there's a route catch handler, process that first\n if (catchHandler) {\n if (process.env.NODE_ENV !== 'production') {\n // Still include URL here as it will be async from the console group\n // and may not make sense without the URL\n logger.groupCollapsed(`Error thrown when responding to: ` +\n ` ${getFriendlyURL(url)}. Falling back to route's Catch Handler.`);\n logger.error(`Error thrown by:`, route);\n logger.error(err);\n logger.groupEnd();\n }\n try {\n return await catchHandler.handle({ url, request, event, params });\n }\n catch (catchErr) {\n if (catchErr instanceof Error) {\n err = catchErr;\n }\n }\n }\n if (this._catchHandler) {\n if (process.env.NODE_ENV !== 'production') {\n // Still include URL here as it will be async from the console group\n // and may not make sense without the URL\n logger.groupCollapsed(`Error thrown when responding to: ` +\n ` ${getFriendlyURL(url)}. Falling back to global Catch Handler.`);\n logger.error(`Error thrown by:`, route);\n logger.error(err);\n logger.groupEnd();\n }\n return this._catchHandler.handle({ url, request, event });\n }\n throw err;\n });\n }\n return responsePromise;\n }\n /**\n * Checks a request and URL (and optionally an event) against the list of\n * registered routes, and if there's a match, returns the corresponding\n * route along with any params generated by the match.\n *\n * @param {Object} options\n * @param {URL} options.url\n * @param {boolean} options.sameOrigin The result of comparing `url.origin`\n * against the current origin.\n * @param {Request} options.request The request to match.\n * @param {Event} options.event The corresponding event.\n * @return {Object} An object with `route` and `params` properties.\n * They are populated if a matching route was found or `undefined`\n * otherwise.\n */\n findMatchingRoute({ url, sameOrigin, request, event, }) {\n const routes = this._routes.get(request.method) || [];\n for (const route of routes) {\n let params;\n // route.match returns type any, not possible to change right now.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const matchResult = route.match({ url, sameOrigin, request, event });\n if (matchResult) {\n if (process.env.NODE_ENV !== 'production') {\n // Warn developers that using an async matchCallback is almost always\n // not the right thing to do.\n if (matchResult instanceof Promise) {\n logger.warn(`While routing ${getFriendlyURL(url)}, an async ` +\n `matchCallback function was used. Please convert the ` +\n `following route to use a synchronous matchCallback function:`, route);\n }\n }\n // See https://github.com/GoogleChrome/workbox/issues/2079\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n params = matchResult;\n if (Array.isArray(params) && params.length === 0) {\n // Instead of passing an empty array in as params, use undefined.\n params = undefined;\n }\n else if (matchResult.constructor === Object && // eslint-disable-line\n Object.keys(matchResult).length === 0) {\n // Instead of passing an empty object in as params, use undefined.\n params = undefined;\n }\n else if (typeof matchResult === 'boolean') {\n // For the boolean value true (rather than just something truth-y),\n // don't set params.\n // See https://github.com/GoogleChrome/workbox/pull/2134#issuecomment-513924353\n params = undefined;\n }\n // Return early if have a match.\n return { route, params };\n }\n }\n // If no match was found above, return and empty object.\n return {};\n }\n /**\n * Define a default `handler` that's called when no routes explicitly\n * match the incoming request.\n *\n * Each HTTP method ('GET', 'POST', etc.) gets its own default handler.\n *\n * Without a default handler, unmatched requests will go against the\n * network as if there were no service worker present.\n *\n * @param {workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n * @param {string} [method='GET'] The HTTP method to associate with this\n * default handler. Each method has its own default.\n */\n setDefaultHandler(handler, method = defaultMethod) {\n this._defaultHandlerMap.set(method, normalizeHandler(handler));\n }\n /**\n * If a Route throws an error while handling a request, this `handler`\n * will be called and given a chance to provide a response.\n *\n * @param {workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n */\n setCatchHandler(handler) {\n this._catchHandler = normalizeHandler(handler);\n }\n /**\n * Registers a route with the router.\n *\n * @param {workbox-routing.Route} route The route to register.\n */\n registerRoute(route) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(route, 'object', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.hasMethod(route, 'match', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.isType(route.handler, 'object', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.hasMethod(route.handler, 'handle', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route.handler',\n });\n assert.isType(route.method, 'string', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route.method',\n });\n }\n if (!this._routes.has(route.method)) {\n this._routes.set(route.method, []);\n }\n // Give precedence to all of the earlier routes by adding this additional\n // route to the end of the array.\n this._routes.get(route.method).push(route);\n }\n /**\n * Unregisters a route with the router.\n *\n * @param {workbox-routing.Route} route The route to unregister.\n */\n unregisterRoute(route) {\n if (!this._routes.has(route.method)) {\n throw new WorkboxError('unregister-route-but-not-found-with-method', {\n method: route.method,\n });\n }\n const routeIndex = this._routes.get(route.method).indexOf(route);\n if (routeIndex > -1) {\n this._routes.get(route.method).splice(routeIndex, 1);\n }\n else {\n throw new WorkboxError('unregister-route-route-not-registered');\n }\n }\n}\nexport { Router };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { Router } from '../Router.js';\nimport '../_version.js';\nlet defaultRouter;\n/**\n * Creates a new, singleton Router instance if one does not exist. If one\n * does already exist, that instance is returned.\n *\n * @private\n * @return {Router}\n */\nexport const getOrCreateDefaultRouter = () => {\n if (!defaultRouter) {\n defaultRouter = new Router();\n // The helpers that use the default Router assume these listeners exist.\n defaultRouter.addFetchListener();\n defaultRouter.addCacheListener();\n }\n return defaultRouter;\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst _cacheNameDetails = {\n googleAnalytics: 'googleAnalytics',\n precache: 'precache-v2',\n prefix: 'workbox',\n runtime: 'runtime',\n suffix: typeof registration !== 'undefined' ? registration.scope : '',\n};\nconst _createCacheName = (cacheName) => {\n return [_cacheNameDetails.prefix, cacheName, _cacheNameDetails.suffix]\n .filter((value) => value && value.length > 0)\n .join('-');\n};\nconst eachCacheNameDetail = (fn) => {\n for (const key of Object.keys(_cacheNameDetails)) {\n fn(key);\n }\n};\nexport const cacheNames = {\n updateDetails: (details) => {\n eachCacheNameDetail((key) => {\n if (typeof details[key] === 'string') {\n _cacheNameDetails[key] = details[key];\n }\n });\n },\n getGoogleAnalyticsName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.googleAnalytics);\n },\n getPrecacheName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.precache);\n },\n getPrefix: () => {\n return _cacheNameDetails.prefix;\n },\n getRuntimeName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.runtime);\n },\n getSuffix: () => {\n return _cacheNameDetails.suffix;\n },\n};\n","/*\n Copyright 2020 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A utility method that makes it easier to use `event.waitUntil` with\n * async functions and return the result.\n *\n * @param {ExtendableEvent} event\n * @param {Function} asyncFn\n * @return {Function}\n * @private\n */\nfunction waitUntil(event, asyncFn) {\n const returnPromise = asyncFn();\n event.waitUntil(returnPromise);\n return returnPromise;\n}\nexport { waitUntil };\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:precaching:6.5.1'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport '../_version.js';\n// Name of the search parameter used to store revision info.\nconst REVISION_SEARCH_PARAM = '__WB_REVISION__';\n/**\n * Converts a manifest entry into a versioned URL suitable for precaching.\n *\n * @param {Object|string} entry\n * @return {string} A URL with versioning info.\n *\n * @private\n * @memberof workbox-precaching\n */\nexport function createCacheKey(entry) {\n if (!entry) {\n throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });\n }\n // If a precache manifest entry is a string, it's assumed to be a versioned\n // URL, like '/app.abcd1234.js'. Return as-is.\n if (typeof entry === 'string') {\n const urlObject = new URL(entry, location.href);\n return {\n cacheKey: urlObject.href,\n url: urlObject.href,\n };\n }\n const { revision, url } = entry;\n if (!url) {\n throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });\n }\n // If there's just a URL and no revision, then it's also assumed to be a\n // versioned URL.\n if (!revision) {\n const urlObject = new URL(url, location.href);\n return {\n cacheKey: urlObject.href,\n url: urlObject.href,\n };\n }\n // Otherwise, construct a properly versioned URL using the custom Workbox\n // search parameter along with the revision info.\n const cacheKeyURL = new URL(url, location.href);\n const originalURL = new URL(url, location.href);\n cacheKeyURL.searchParams.set(REVISION_SEARCH_PARAM, revision);\n return {\n cacheKey: cacheKeyURL.href,\n url: originalURL.href,\n };\n}\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A plugin, designed to be used with PrecacheController, to determine the\n * of assets that were updated (or not updated) during the install event.\n *\n * @private\n */\nclass PrecacheInstallReportPlugin {\n constructor() {\n this.updatedURLs = [];\n this.notUpdatedURLs = [];\n this.handlerWillStart = async ({ request, state, }) => {\n // TODO: `state` should never be undefined...\n if (state) {\n state.originalRequest = request;\n }\n };\n this.cachedResponseWillBeUsed = async ({ event, state, cachedResponse, }) => {\n if (event.type === 'install') {\n if (state &&\n state.originalRequest &&\n state.originalRequest instanceof Request) {\n // TODO: `state` should never be undefined...\n const url = state.originalRequest.url;\n if (cachedResponse) {\n this.notUpdatedURLs.push(url);\n }\n else {\n this.updatedURLs.push(url);\n }\n }\n }\n return cachedResponse;\n };\n }\n}\nexport { PrecacheInstallReportPlugin };\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A plugin, designed to be used with PrecacheController, to translate URLs into\n * the corresponding cache key, based on the current revision info.\n *\n * @private\n */\nclass PrecacheCacheKeyPlugin {\n constructor({ precacheController }) {\n this.cacheKeyWillBeUsed = async ({ request, params, }) => {\n // Params is type any, can't change right now.\n /* eslint-disable */\n const cacheKey = (params === null || params === void 0 ? void 0 : params.cacheKey) ||\n this._precacheController.getCacheKeyForURL(request.url);\n /* eslint-enable */\n return cacheKey\n ? new Request(cacheKey, { headers: request.headers })\n : request;\n };\n this._precacheController = precacheController;\n }\n}\nexport { PrecacheCacheKeyPlugin };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nlet supportStatus;\n/**\n * A utility function that determines whether the current browser supports\n * constructing a new `Response` from a `response.body` stream.\n *\n * @return {boolean} `true`, if the current browser can successfully\n * construct a `Response` from a `response.body` stream, `false` otherwise.\n *\n * @private\n */\nfunction canConstructResponseFromBodyStream() {\n if (supportStatus === undefined) {\n const testResponse = new Response('');\n if ('body' in testResponse) {\n try {\n new Response(testResponse.body);\n supportStatus = true;\n }\n catch (error) {\n supportStatus = false;\n }\n }\n supportStatus = false;\n }\n return supportStatus;\n}\nexport { canConstructResponseFromBodyStream };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { canConstructResponseFromBodyStream } from './_private/canConstructResponseFromBodyStream.js';\nimport { WorkboxError } from './_private/WorkboxError.js';\nimport './_version.js';\n/**\n * Allows developers to copy a response and modify its `headers`, `status`,\n * or `statusText` values (the values settable via a\n * [`ResponseInit`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#Syntax}\n * object in the constructor).\n * To modify these values, pass a function as the second argument. That\n * function will be invoked with a single object with the response properties\n * `{headers, status, statusText}`. The return value of this function will\n * be used as the `ResponseInit` for the new `Response`. To change the values\n * either modify the passed parameter(s) and return it, or return a totally\n * new object.\n *\n * This method is intentionally limited to same-origin responses, regardless of\n * whether CORS was used or not.\n *\n * @param {Response} response\n * @param {Function} modifier\n * @memberof workbox-core\n */\nasync function copyResponse(response, modifier) {\n let origin = null;\n // If response.url isn't set, assume it's cross-origin and keep origin null.\n if (response.url) {\n const responseURL = new URL(response.url);\n origin = responseURL.origin;\n }\n if (origin !== self.location.origin) {\n throw new WorkboxError('cross-origin-copy-response', { origin });\n }\n const clonedResponse = response.clone();\n // Create a fresh `ResponseInit` object by cloning the headers.\n const responseInit = {\n headers: new Headers(clonedResponse.headers),\n status: clonedResponse.status,\n statusText: clonedResponse.statusText,\n };\n // Apply any user modifications.\n const modifiedResponseInit = modifier ? modifier(responseInit) : responseInit;\n // Create the new response from the body stream and `ResponseInit`\n // modifications. Note: not all browsers support the Response.body stream,\n // so fall back to reading the entire body into memory as a blob.\n const body = canConstructResponseFromBodyStream()\n ? clonedResponse.body\n : await clonedResponse.blob();\n return new Response(body, modifiedResponseInit);\n}\nexport { copyResponse };\n","/*\n Copyright 2020 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nfunction stripParams(fullURL, ignoreParams) {\n const strippedURL = new URL(fullURL);\n for (const param of ignoreParams) {\n strippedURL.searchParams.delete(param);\n }\n return strippedURL.href;\n}\n/**\n * Matches an item in the cache, ignoring specific URL params. This is similar\n * to the `ignoreSearch` option, but it allows you to ignore just specific\n * params (while continuing to match on the others).\n *\n * @private\n * @param {Cache} cache\n * @param {Request} request\n * @param {Object} matchOptions\n * @param {Array<string>} ignoreParams\n * @return {Promise<Response|undefined>}\n */\nasync function cacheMatchIgnoreParams(cache, request, ignoreParams, matchOptions) {\n const strippedRequestURL = stripParams(request.url, ignoreParams);\n // If the request doesn't include any ignored params, match as normal.\n if (request.url === strippedRequestURL) {\n return cache.match(request, matchOptions);\n }\n // Otherwise, match by comparing keys\n const keysOptions = Object.assign(Object.assign({}, matchOptions), { ignoreSearch: true });\n const cacheKeys = await cache.keys(request, keysOptions);\n for (const cacheKey of cacheKeys) {\n const strippedCacheKeyURL = stripParams(cacheKey.url, ignoreParams);\n if (strippedRequestURL === strippedCacheKeyURL) {\n return cache.match(cacheKey, matchOptions);\n }\n }\n return;\n}\nexport { cacheMatchIgnoreParams };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * The Deferred class composes Promises in a way that allows for them to be\n * resolved or rejected from outside the constructor. In most cases promises\n * should be used directly, but Deferreds can be necessary when the logic to\n * resolve a promise must be separate.\n *\n * @private\n */\nclass Deferred {\n /**\n * Creates a promise and exposes its resolve and reject functions as methods.\n */\n constructor() {\n this.promise = new Promise((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n });\n }\n}\nexport { Deferred };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n// Callbacks to be executed whenever there's a quota error.\n// Can't change Function type right now.\n// eslint-disable-next-line @typescript-eslint/ban-types\nconst quotaErrorCallbacks = new Set();\nexport { quotaErrorCallbacks };\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:strategies:6.5.1'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheMatchIgnoreParams } from 'workbox-core/_private/cacheMatchIgnoreParams.js';\nimport { Deferred } from 'workbox-core/_private/Deferred.js';\nimport { executeQuotaErrorCallbacks } from 'workbox-core/_private/executeQuotaErrorCallbacks.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { timeout } from 'workbox-core/_private/timeout.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport './_version.js';\nfunction toRequest(input) {\n return typeof input === 'string' ? new Request(input) : input;\n}\n/**\n * A class created every time a Strategy instance instance calls\n * {@link workbox-strategies.Strategy~handle} or\n * {@link workbox-strategies.Strategy~handleAll} that wraps all fetch and\n * cache actions around plugin callbacks and keeps track of when the strategy\n * is \"done\" (i.e. all added `event.waitUntil()` promises have resolved).\n *\n * @memberof workbox-strategies\n */\nclass StrategyHandler {\n /**\n * Creates a new instance associated with the passed strategy and event\n * that's handling the request.\n *\n * The constructor also initializes the state that will be passed to each of\n * the plugins handling this request.\n *\n * @param {workbox-strategies.Strategy} strategy\n * @param {Object} options\n * @param {Request|string} options.request A request to run this strategy for.\n * @param {ExtendableEvent} options.event The event associated with the\n * request.\n * @param {URL} [options.url]\n * @param {*} [options.params] The return value from the\n * {@link workbox-routing~matchCallback} (if applicable).\n */\n constructor(strategy, options) {\n this._cacheKeys = {};\n /**\n * The request the strategy is performing (passed to the strategy's\n * `handle()` or `handleAll()` method).\n * @name request\n * @instance\n * @type {Request}\n * @memberof workbox-strategies.StrategyHandler\n */\n /**\n * The event associated with this request.\n * @name event\n * @instance\n * @type {ExtendableEvent}\n * @memberof workbox-strategies.StrategyHandler\n */\n /**\n * A `URL` instance of `request.url` (if passed to the strategy's\n * `handle()` or `handleAll()` method).\n * Note: the `url` param will be present if the strategy was invoked\n * from a workbox `Route` object.\n * @name url\n * @instance\n * @type {URL|undefined}\n * @memberof workbox-strategies.StrategyHandler\n */\n /**\n * A `param` value (if passed to the strategy's\n * `handle()` or `handleAll()` method).\n * Note: the `param` param will be present if the strategy was invoked\n * from a workbox `Route` object and the\n * {@link workbox-routing~matchCallback} returned\n * a truthy value (it will be that value).\n * @name params\n * @instance\n * @type {*|undefined}\n * @memberof workbox-strategies.StrategyHandler\n */\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(options.event, ExtendableEvent, {\n moduleName: 'workbox-strategies',\n className: 'StrategyHandler',\n funcName: 'constructor',\n paramName: 'options.event',\n });\n }\n Object.assign(this, options);\n this.event = options.event;\n this._strategy = strategy;\n this._handlerDeferred = new Deferred();\n this._extendLifetimePromises = [];\n // Copy the plugins list (since it's mutable on the strategy),\n // so any mutations don't affect this handler instance.\n this._plugins = [...strategy.plugins];\n this._pluginStateMap = new Map();\n for (const plugin of this._plugins) {\n this._pluginStateMap.set(plugin, {});\n }\n this.event.waitUntil(this._handlerDeferred.promise);\n }\n /**\n * Fetches a given request (and invokes any applicable plugin callback\n * methods) using the `fetchOptions` (for non-navigation requests) and\n * `plugins` defined on the `Strategy` object.\n *\n * The following plugin lifecycle methods are invoked when using this method:\n * - `requestWillFetch()`\n * - `fetchDidSucceed()`\n * - `fetchDidFail()`\n *\n * @param {Request|string} input The URL or request to fetch.\n * @return {Promise<Response>}\n */\n async fetch(input) {\n const { event } = this;\n let request = toRequest(input);\n if (request.mode === 'navigate' &&\n event instanceof FetchEvent &&\n event.preloadResponse) {\n const possiblePreloadResponse = (await event.preloadResponse);\n if (possiblePreloadResponse) {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Using a preloaded navigation response for ` +\n `'${getFriendlyURL(request.url)}'`);\n }\n return possiblePreloadResponse;\n }\n }\n // If there is a fetchDidFail plugin, we need to save a clone of the\n // original request before it's either modified by a requestWillFetch\n // plugin or before the original request's body is consumed via fetch().\n const originalRequest = this.hasCallback('fetchDidFail')\n ? request.clone()\n : null;\n try {\n for (const cb of this.iterateCallbacks('requestWillFetch')) {\n request = await cb({ request: request.clone(), event });\n }\n }\n catch (err) {\n if (err instanceof Error) {\n throw new WorkboxError('plugin-error-request-will-fetch', {\n thrownErrorMessage: err.message,\n });\n }\n }\n // The request can be altered by plugins with `requestWillFetch` making\n // the original request (most likely from a `fetch` event) different\n // from the Request we make. Pass both to `fetchDidFail` to aid debugging.\n const pluginFilteredRequest = request.clone();\n try {\n let fetchResponse;\n // See https://github.com/GoogleChrome/workbox/issues/1796\n fetchResponse = await fetch(request, request.mode === 'navigate' ? undefined : this._strategy.fetchOptions);\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Network request for ` +\n `'${getFriendlyURL(request.url)}' returned a response with ` +\n `status '${fetchResponse.status}'.`);\n }\n for (const callback of this.iterateCallbacks('fetchDidSucceed')) {\n fetchResponse = await callback({\n event,\n request: pluginFilteredRequest,\n response: fetchResponse,\n });\n }\n return fetchResponse;\n }\n catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Network request for ` +\n `'${getFriendlyURL(request.url)}' threw an error.`, error);\n }\n // `originalRequest` will only exist if a `fetchDidFail` callback\n // is being used (see above).\n if (originalRequest) {\n await this.runCallbacks('fetchDidFail', {\n error: error,\n event,\n originalRequest: originalRequest.clone(),\n request: pluginFilteredRequest.clone(),\n });\n }\n throw error;\n }\n }\n /**\n * Calls `this.fetch()` and (in the background) runs `this.cachePut()` on\n * the response generated by `this.fetch()`.\n *\n * The call to `this.cachePut()` automatically invokes `this.waitUntil()`,\n * so you do not have to manually call `waitUntil()` on the event.\n *\n * @param {Request|string} input The request or URL to fetch and cache.\n * @return {Promise<Response>}\n */\n async fetchAndCachePut(input) {\n const response = await this.fetch(input);\n const responseClone = response.clone();\n void this.waitUntil(this.cachePut(input, responseClone));\n return response;\n }\n /**\n * Matches a request from the cache (and invokes any applicable plugin\n * callback methods) using the `cacheName`, `matchOptions`, and `plugins`\n * defined on the strategy object.\n *\n * The following plugin lifecycle methods are invoked when using this method:\n * - cacheKeyWillByUsed()\n * - cachedResponseWillByUsed()\n *\n * @param {Request|string} key The Request or URL to use as the cache key.\n * @return {Promise<Response|undefined>} A matching response, if found.\n */\n async cacheMatch(key) {\n const request = toRequest(key);\n let cachedResponse;\n const { cacheName, matchOptions } = this._strategy;\n const effectiveRequest = await this.getCacheKey(request, 'read');\n const multiMatchOptions = Object.assign(Object.assign({}, matchOptions), { cacheName });\n cachedResponse = await caches.match(effectiveRequest, multiMatchOptions);\n if (process.env.NODE_ENV !== 'production') {\n if (cachedResponse) {\n logger.debug(`Found a cached response in '${cacheName}'.`);\n }\n else {\n logger.debug(`No cached response found in '${cacheName}'.`);\n }\n }\n for (const callback of this.iterateCallbacks('cachedResponseWillBeUsed')) {\n cachedResponse =\n (await callback({\n cacheName,\n matchOptions,\n cachedResponse,\n request: effectiveRequest,\n event: this.event,\n })) || undefined;\n }\n return cachedResponse;\n }\n /**\n * Puts a request/response pair in the cache (and invokes any applicable\n * plugin callback methods) using the `cacheName` and `plugins` defined on\n * the strategy object.\n *\n * The following plugin lifecycle methods are invoked when using this method:\n * - cacheKeyWillByUsed()\n * - cacheWillUpdate()\n * - cacheDidUpdate()\n *\n * @param {Request|string} key The request or URL to use as the cache key.\n * @param {Response} response The response to cache.\n * @return {Promise<boolean>} `false` if a cacheWillUpdate caused the response\n * not be cached, and `true` otherwise.\n */\n async cachePut(key, response) {\n const request = toRequest(key);\n // Run in the next task to avoid blocking other cache reads.\n // https://github.com/w3c/ServiceWorker/issues/1397\n await timeout(0);\n const effectiveRequest = await this.getCacheKey(request, 'write');\n if (process.env.NODE_ENV !== 'production') {\n if (effectiveRequest.method && effectiveRequest.method !== 'GET') {\n throw new WorkboxError('attempt-to-cache-non-get-request', {\n url: getFriendlyURL(effectiveRequest.url),\n method: effectiveRequest.method,\n });\n }\n // See https://github.com/GoogleChrome/workbox/issues/2818\n const vary = response.headers.get('Vary');\n if (vary) {\n logger.debug(`The response for ${getFriendlyURL(effectiveRequest.url)} ` +\n `has a 'Vary: ${vary}' header. ` +\n `Consider setting the {ignoreVary: true} option on your strategy ` +\n `to ensure cache matching and deletion works as expected.`);\n }\n }\n if (!response) {\n if (process.env.NODE_ENV !== 'production') {\n logger.error(`Cannot cache non-existent response for ` +\n `'${getFriendlyURL(effectiveRequest.url)}'.`);\n }\n throw new WorkboxError('cache-put-with-no-response', {\n url: getFriendlyURL(effectiveRequest.url),\n });\n }\n const responseToCache = await this._ensureResponseSafeToCache(response);\n if (!responseToCache) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Response '${getFriendlyURL(effectiveRequest.url)}' ` +\n `will not be cached.`, responseToCache);\n }\n return false;\n }\n const { cacheName, matchOptions } = this._strategy;\n const cache = await self.caches.open(cacheName);\n const hasCacheUpdateCallback = this.hasCallback('cacheDidUpdate');\n const oldResponse = hasCacheUpdateCallback\n ? await cacheMatchIgnoreParams(\n // TODO(philipwalton): the `__WB_REVISION__` param is a precaching\n // feature. Consider into ways to only add this behavior if using\n // precaching.\n cache, effectiveRequest.clone(), ['__WB_REVISION__'], matchOptions)\n : null;\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Updating the '${cacheName}' cache with a new Response ` +\n `for ${getFriendlyURL(effectiveRequest.url)}.`);\n }\n try {\n await cache.put(effectiveRequest, hasCacheUpdateCallback ? responseToCache.clone() : responseToCache);\n }\n catch (error) {\n if (error instanceof Error) {\n // See https://developer.mozilla.org/en-US/docs/Web/API/DOMException#exception-QuotaExceededError\n if (error.name === 'QuotaExceededError') {\n await executeQuotaErrorCallbacks();\n }\n throw error;\n }\n }\n for (const callback of this.iterateCallbacks('cacheDidUpdate')) {\n await callback({\n cacheName,\n oldResponse,\n newResponse: responseToCache.clone(),\n request: effectiveRequest,\n event: this.event,\n });\n }\n return true;\n }\n /**\n * Checks the list of plugins for the `cacheKeyWillBeUsed` callback, and\n * executes any of those callbacks found in sequence. The final `Request`\n * object returned by the last plugin is treated as the cache key for cache\n * reads and/or writes. If no `cacheKeyWillBeUsed` plugin callbacks have\n * been registered, the passed request is returned unmodified\n *\n * @param {Request} request\n * @param {string} mode\n * @return {Promise<Request>}\n */\n async getCacheKey(request, mode) {\n const key = `${request.url} | ${mode}`;\n if (!this._cacheKeys[key]) {\n let effectiveRequest = request;\n for (const callback of this.iterateCallbacks('cacheKeyWillBeUsed')) {\n effectiveRequest = toRequest(await callback({\n mode,\n request: effectiveRequest,\n event: this.event,\n // params has a type any can't change right now.\n params: this.params, // eslint-disable-line\n }));\n }\n this._cacheKeys[key] = effectiveRequest;\n }\n return this._cacheKeys[key];\n }\n /**\n * Returns true if the strategy has at least one plugin with the given\n * callback.\n *\n * @param {string} name The name of the callback to check for.\n * @return {boolean}\n */\n hasCallback(name) {\n for (const plugin of this._strategy.plugins) {\n if (name in plugin) {\n return true;\n }\n }\n return false;\n }\n /**\n * Runs all plugin callbacks matching the given name, in order, passing the\n * given param object (merged ith the current plugin state) as the only\n * argument.\n *\n * Note: since this method runs all plugins, it's not suitable for cases\n * where the return value of a callback needs to be applied prior to calling\n * the next callback. See\n * {@link workbox-strategies.StrategyHandler#iterateCallbacks}\n * below for how to handle that case.\n *\n * @param {string} name The name of the callback to run within each plugin.\n * @param {Object} param The object to pass as the first (and only) param\n * when executing each callback. This object will be merged with the\n * current plugin state prior to callback execution.\n */\n async runCallbacks(name, param) {\n for (const callback of this.iterateCallbacks(name)) {\n // TODO(philipwalton): not sure why `any` is needed. It seems like\n // this should work with `as WorkboxPluginCallbackParam[C]`.\n await callback(param);\n }\n }\n /**\n * Accepts a callback and returns an iterable of matching plugin callbacks,\n * where each callback is wrapped with the current handler state (i.e. when\n * you call each callback, whatever object parameter you pass it will\n * be merged with the plugin's current state).\n *\n * @param {string} name The name fo the callback to run\n * @return {Array<Function>}\n */\n *iterateCallbacks(name) {\n for (const plugin of this._strategy.plugins) {\n if (typeof plugin[name] === 'function') {\n const state = this._pluginStateMap.get(plugin);\n const statefulCallback = (param) => {\n const statefulParam = Object.assign(Object.assign({}, param), { state });\n // TODO(philipwalton): not sure why `any` is needed. It seems like\n // this should work with `as WorkboxPluginCallbackParam[C]`.\n return plugin[name](statefulParam);\n };\n yield statefulCallback;\n }\n }\n }\n /**\n * Adds a promise to the\n * [extend lifetime promises]{@link https://w3c.github.io/ServiceWorker/#extendableevent-extend-lifetime-promises}\n * of the event event associated with the request being handled (usually a\n * `FetchEvent`).\n *\n * Note: you can await\n * {@link workbox-strategies.StrategyHandler~doneWaiting}\n * to know when all added promises have settled.\n *\n * @param {Promise} promise A promise to add to the extend lifetime promises\n * of the event that triggered the request.\n */\n waitUntil(promise) {\n this._extendLifetimePromises.push(promise);\n return promise;\n }\n /**\n * Returns a promise that resolves once all promises passed to\n * {@link workbox-strategies.StrategyHandler~waitUntil}\n * have settled.\n *\n * Note: any work done after `doneWaiting()` settles should be manually\n * passed to an event's `waitUntil()` method (not this handler's\n * `waitUntil()` method), otherwise the service worker thread my be killed\n * prior to your work completing.\n */\n async doneWaiting() {\n let promise;\n while ((promise = this._extendLifetimePromises.shift())) {\n await promise;\n }\n }\n /**\n * Stops running the strategy and immediately resolves any pending\n * `waitUntil()` promises.\n */\n destroy() {\n this._handlerDeferred.resolve(null);\n }\n /**\n * This method will call cacheWillUpdate on the available plugins (or use\n * status === 200) to determine if the Response is safe and valid to cache.\n *\n * @param {Request} options.request\n * @param {Response} options.response\n * @return {Promise<Response|undefined>}\n *\n * @private\n */\n async _ensureResponseSafeToCache(response) {\n let responseToCache = response;\n let pluginsUsed = false;\n for (const callback of this.iterateCallbacks('cacheWillUpdate')) {\n responseToCache =\n (await callback({\n request: this.request,\n response: responseToCache,\n event: this.event,\n })) || undefined;\n pluginsUsed = true;\n if (!responseToCache) {\n break;\n }\n }\n if (!pluginsUsed) {\n if (responseToCache && responseToCache.status !== 200) {\n responseToCache = undefined;\n }\n if (process.env.NODE_ENV !== 'production') {\n if (responseToCache) {\n if (responseToCache.status !== 200) {\n if (responseToCache.status === 0) {\n logger.warn(`The response for '${this.request.url}' ` +\n `is an opaque response. The caching strategy that you're ` +\n `using will not cache opaque responses by default.`);\n }\n else {\n logger.debug(`The response for '${this.request.url}' ` +\n `returned a status code of '${response.status}' and won't ` +\n `be cached as a result.`);\n }\n }\n }\n }\n }\n return responseToCache;\n }\n}\nexport { StrategyHandler };\n","/*\n Copyright 2019 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * Returns a promise that resolves and the passed number of milliseconds.\n * This utility is an async/await-friendly version of `setTimeout`.\n *\n * @param {number} ms\n * @return {Promise}\n * @private\n */\nexport function timeout(ms) {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst getFriendlyURL = (url) => {\n const urlObj = new URL(String(url), location.href);\n // See https://github.com/GoogleChrome/workbox/issues/2323\n // We want to include everything, except for the origin if it's same-origin.\n return urlObj.href.replace(new RegExp(`^${location.origin}`), '');\n};\nexport { getFriendlyURL };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from '../_private/logger.js';\nimport { quotaErrorCallbacks } from '../models/quotaErrorCallbacks.js';\nimport '../_version.js';\n/**\n * Runs all of the callback functions, one at a time sequentially, in the order\n * in which they were registered.\n *\n * @memberof workbox-core\n * @private\n */\nasync function executeQuotaErrorCallbacks() {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`About to run ${quotaErrorCallbacks.size} ` +\n `callbacks to clean up caches.`);\n }\n for (const callback of quotaErrorCallbacks) {\n await callback();\n if (process.env.NODE_ENV !== 'production') {\n logger.log(callback, 'is complete.');\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.log('Finished running callbacks.');\n }\n}\nexport { executeQuotaErrorCallbacks };\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { copyResponse } from 'workbox-core/copyResponse.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Strategy } from 'workbox-strategies/Strategy.js';\nimport './_version.js';\n/**\n * A {@link workbox-strategies.Strategy} implementation\n * specifically designed to work with\n * {@link workbox-precaching.PrecacheController}\n * to both cache and fetch precached assets.\n *\n * Note: an instance of this class is created automatically when creating a\n * `PrecacheController`; it's generally not necessary to create this yourself.\n *\n * @extends workbox-strategies.Strategy\n * @memberof workbox-precaching\n */\nclass PrecacheStrategy extends Strategy {\n /**\n *\n * @param {Object} [options]\n * @param {string} [options.cacheName] Cache name to store and retrieve\n * requests. Defaults to the cache names provided by\n * {@link workbox-core.cacheNames}.\n * @param {Array<Object>} [options.plugins] {@link https://developers.google.com/web/tools/workbox/guides/using-plugins|Plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} [options.fetchOptions] Values passed along to the\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters|init}\n * of all fetch() requests made by this strategy.\n * @param {Object} [options.matchOptions] The\n * {@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions|CacheQueryOptions}\n * for any `cache.match()` or `cache.put()` calls made by this strategy.\n * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to\n * get the response from the network if there's a precache miss.\n */\n constructor(options = {}) {\n options.cacheName = cacheNames.getPrecacheName(options.cacheName);\n super(options);\n this._fallbackToNetwork =\n options.fallbackToNetwork === false ? false : true;\n // Redirected responses cannot be used to satisfy a navigation request, so\n // any redirected response must be \"copied\" rather than cloned, so the new\n // response doesn't contain the `redirected` flag. See:\n // https://bugs.chromium.org/p/chromium/issues/detail?id=669363&desc=2#c1\n this.plugins.push(PrecacheStrategy.copyRedirectedCacheableResponsesPlugin);\n }\n /**\n * @private\n * @param {Request|string} request A request to run this strategy for.\n * @param {workbox-strategies.StrategyHandler} handler The event that\n * triggered the request.\n * @return {Promise<Response>}\n */\n async _handle(request, handler) {\n const response = await handler.cacheMatch(request);\n if (response) {\n return response;\n }\n // If this is an `install` event for an entry that isn't already cached,\n // then populate the cache.\n if (handler.event && handler.event.type === 'install') {\n return await this._handleInstall(request, handler);\n }\n // Getting here means something went wrong. An entry that should have been\n // precached wasn't found in the cache.\n return await this._handleFetch(request, handler);\n }\n async _handleFetch(request, handler) {\n let response;\n const params = (handler.params || {});\n // Fall back to the network if we're configured to do so.\n if (this._fallbackToNetwork) {\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(`The precached response for ` +\n `${getFriendlyURL(request.url)} in ${this.cacheName} was not ` +\n `found. Falling back to the network.`);\n }\n const integrityInManifest = params.integrity;\n const integrityInRequest = request.integrity;\n const noIntegrityConflict = !integrityInRequest || integrityInRequest === integrityInManifest;\n response = await handler.fetch(new Request(request, {\n integrity: integrityInRequest || integrityInManifest,\n }));\n // It's only \"safe\" to repair the cache if we're using SRI to guarantee\n // that the response matches the precache manifest's expectations,\n // and there's either a) no integrity property in the incoming request\n // or b) there is an integrity, and it matches the precache manifest.\n // See https://github.com/GoogleChrome/workbox/issues/2858\n if (integrityInManifest && noIntegrityConflict) {\n this._useDefaultCacheabilityPluginIfNeeded();\n const wasCached = await handler.cachePut(request, response.clone());\n if (process.env.NODE_ENV !== 'production') {\n if (wasCached) {\n logger.log(`A response for ${getFriendlyURL(request.url)} ` +\n `was used to \"repair\" the precache.`);\n }\n }\n }\n }\n else {\n // This shouldn't normally happen, but there are edge cases:\n // https://github.com/GoogleChrome/workbox/issues/1441\n throw new WorkboxError('missing-precache-entry', {\n cacheName: this.cacheName,\n url: request.url,\n });\n }\n if (process.env.NODE_ENV !== 'production') {\n const cacheKey = params.cacheKey || (await handler.getCacheKey(request, 'read'));\n // Workbox is going to handle the route.\n // print the routing details to the console.\n logger.groupCollapsed(`Precaching is responding to: ` + getFriendlyURL(request.url));\n logger.log(`Serving the precached url: ${getFriendlyURL(cacheKey instanceof Request ? cacheKey.url : cacheKey)}`);\n logger.groupCollapsed(`View request details here.`);\n logger.log(request);\n logger.groupEnd();\n logger.groupCollapsed(`View response details here.`);\n logger.log(response);\n logger.groupEnd();\n logger.groupEnd();\n }\n return response;\n }\n async _handleInstall(request, handler) {\n this._useDefaultCacheabilityPluginIfNeeded();\n const response = await handler.fetch(request);\n // Make sure we defer cachePut() until after we know the response\n // should be cached; see https://github.com/GoogleChrome/workbox/issues/2737\n const wasCached = await handler.cachePut(request, response.clone());\n if (!wasCached) {\n // Throwing here will lead to the `install` handler failing, which\n // we want to do if *any* of the responses aren't safe to cache.\n throw new WorkboxError('bad-precaching-response', {\n url: request.url,\n status: response.status,\n });\n }\n return response;\n }\n /**\n * This method is complex, as there a number of things to account for:\n *\n * The `plugins` array can be set at construction, and/or it might be added to\n * to at any time before the strategy is used.\n *\n * At the time the strategy is used (i.e. during an `install` event), there\n * needs to be at least one plugin that implements `cacheWillUpdate` in the\n * array, other than `copyRedirectedCacheableResponsesPlugin`.\n *\n * - If this method is called and there are no suitable `cacheWillUpdate`\n * plugins, we need to add `defaultPrecacheCacheabilityPlugin`.\n *\n * - If this method is called and there is exactly one `cacheWillUpdate`, then\n * we don't have to do anything (this might be a previously added\n * `defaultPrecacheCacheabilityPlugin`, or it might be a custom plugin).\n *\n * - If this method is called and there is more than one `cacheWillUpdate`,\n * then we need to check if one is `defaultPrecacheCacheabilityPlugin`. If so,\n * we need to remove it. (This situation is unlikely, but it could happen if\n * the strategy is used multiple times, the first without a `cacheWillUpdate`,\n * and then later on after manually adding a custom `cacheWillUpdate`.)\n *\n * See https://github.com/GoogleChrome/workbox/issues/2737 for more context.\n *\n * @private\n */\n _useDefaultCacheabilityPluginIfNeeded() {\n let defaultPluginIndex = null;\n let cacheWillUpdatePluginCount = 0;\n for (const [index, plugin] of this.plugins.entries()) {\n // Ignore the copy redirected plugin when determining what to do.\n if (plugin === PrecacheStrategy.copyRedirectedCacheableResponsesPlugin) {\n continue;\n }\n // Save the default plugin's index, in case it needs to be removed.\n if (plugin === PrecacheStrategy.defaultPrecacheCacheabilityPlugin) {\n defaultPluginIndex = index;\n }\n if (plugin.cacheWillUpdate) {\n cacheWillUpdatePluginCount++;\n }\n }\n if (cacheWillUpdatePluginCount === 0) {\n this.plugins.push(PrecacheStrategy.defaultPrecacheCacheabilityPlugin);\n }\n else if (cacheWillUpdatePluginCount > 1 && defaultPluginIndex !== null) {\n // Only remove the default plugin; multiple custom plugins are allowed.\n this.plugins.splice(defaultPluginIndex, 1);\n }\n // Nothing needs to be done if cacheWillUpdatePluginCount is 1\n }\n}\nPrecacheStrategy.defaultPrecacheCacheabilityPlugin = {\n async cacheWillUpdate({ response }) {\n if (!response || response.status >= 400) {\n return null;\n }\n return response;\n },\n};\nPrecacheStrategy.copyRedirectedCacheableResponsesPlugin = {\n async cacheWillUpdate({ response }) {\n return response.redirected ? await copyResponse(response) : response;\n },\n};\nexport { PrecacheStrategy };\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { StrategyHandler } from './StrategyHandler.js';\nimport './_version.js';\n/**\n * An abstract base class that all other strategy classes must extend from:\n *\n * @memberof workbox-strategies\n */\nclass Strategy {\n /**\n * Creates a new instance of the strategy and sets all documented option\n * properties as public instance properties.\n *\n * Note: if a custom strategy class extends the base Strategy class and does\n * not need more than these properties, it does not need to define its own\n * constructor.\n *\n * @param {Object} [options]\n * @param {string} [options.cacheName] Cache name to store and retrieve\n * requests. Defaults to the cache names provided by\n * {@link workbox-core.cacheNames}.\n * @param {Array<Object>} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} [options.fetchOptions] Values passed along to the\n * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)\n * `fetch()` requests made by this strategy.\n * @param {Object} [options.matchOptions] The\n * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}\n * for any `cache.match()` or `cache.put()` calls made by this strategy.\n */\n constructor(options = {}) {\n /**\n * Cache name to store and retrieve\n * requests. Defaults to the cache names provided by\n * {@link workbox-core.cacheNames}.\n *\n * @type {string}\n */\n this.cacheName = cacheNames.getRuntimeName(options.cacheName);\n /**\n * The list\n * [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * used by this strategy.\n *\n * @type {Array<Object>}\n */\n this.plugins = options.plugins || [];\n /**\n * Values passed along to the\n * [`init`]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters}\n * of all fetch() requests made by this strategy.\n *\n * @type {Object}\n */\n this.fetchOptions = options.fetchOptions;\n /**\n * The\n * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}\n * for any `cache.match()` or `cache.put()` calls made by this strategy.\n *\n * @type {Object}\n */\n this.matchOptions = options.matchOptions;\n }\n /**\n * Perform a request strategy and returns a `Promise` that will resolve with\n * a `Response`, invoking all relevant plugin callbacks.\n *\n * When a strategy instance is registered with a Workbox\n * {@link workbox-routing.Route}, this method is automatically\n * called when the route matches.\n *\n * Alternatively, this method can be used in a standalone `FetchEvent`\n * listener by passing it to `event.respondWith()`.\n *\n * @param {FetchEvent|Object} options A `FetchEvent` or an object with the\n * properties listed below.\n * @param {Request|string} options.request A request to run this strategy for.\n * @param {ExtendableEvent} options.event The event associated with the\n * request.\n * @param {URL} [options.url]\n * @param {*} [options.params]\n */\n handle(options) {\n const [responseDone] = this.handleAll(options);\n return responseDone;\n }\n /**\n * Similar to {@link workbox-strategies.Strategy~handle}, but\n * instead of just returning a `Promise` that resolves to a `Response` it\n * it will return an tuple of `[response, done]` promises, where the former\n * (`response`) is equivalent to what `handle()` returns, and the latter is a\n * Promise that will resolve once any promises that were added to\n * `event.waitUntil()` as part of performing the strategy have completed.\n *\n * You can await the `done` promise to ensure any extra work performed by\n * the strategy (usually caching responses) completes successfully.\n *\n * @param {FetchEvent|Object} options A `FetchEvent` or an object with the\n * properties listed below.\n * @param {Request|string} options.request A request to run this strategy for.\n * @param {ExtendableEvent} options.event The event associated with the\n * request.\n * @param {URL} [options.url]\n * @param {*} [options.params]\n * @return {Array<Promise>} A tuple of [response, done]\n * promises that can be used to determine when the response resolves as\n * well as when the handler has completed all its work.\n */\n handleAll(options) {\n // Allow for flexible options to be passed.\n if (options instanceof FetchEvent) {\n options = {\n event: options,\n request: options.request,\n };\n }\n const event = options.event;\n const request = typeof options.request === 'string'\n ? new Request(options.request)\n : options.request;\n const params = 'params' in options ? options.params : undefined;\n const handler = new StrategyHandler(this, { event, request, params });\n const responseDone = this._getResponse(handler, request, event);\n const handlerDone = this._awaitComplete(responseDone, handler, request, event);\n // Return an array of promises, suitable for use with Promise.all().\n return [responseDone, handlerDone];\n }\n async _getResponse(handler, request, event) {\n await handler.runCallbacks('handlerWillStart', { event, request });\n let response = undefined;\n try {\n response = await this._handle(request, handler);\n // The \"official\" Strategy subclasses all throw this error automatically,\n // but in case a third-party Strategy doesn't, ensure that we have a\n // consistent failure when there's no response or an error response.\n if (!response || response.type === 'error') {\n throw new WorkboxError('no-response', { url: request.url });\n }\n }\n catch (error) {\n if (error instanceof Error) {\n for (const callback of handler.iterateCallbacks('handlerDidError')) {\n response = await callback({ error, event, request });\n if (response) {\n break;\n }\n }\n }\n if (!response) {\n throw error;\n }\n else if (process.env.NODE_ENV !== 'production') {\n logger.log(`While responding to '${getFriendlyURL(request.url)}', ` +\n `an ${error instanceof Error ? error.toString() : ''} error occurred. Using a fallback response provided by ` +\n `a handlerDidError plugin.`);\n }\n }\n for (const callback of handler.iterateCallbacks('handlerWillRespond')) {\n response = await callback({ event, request, response });\n }\n return response;\n }\n async _awaitComplete(responseDone, handler, request, event) {\n let response;\n let error;\n try {\n response = await responseDone;\n }\n catch (error) {\n // Ignore errors, as response errors should be caught via the `response`\n // promise above. The `done` promise will only throw for errors in\n // promises passed to `handler.waitUntil()`.\n }\n try {\n await handler.runCallbacks('handlerDidRespond', {\n event,\n request,\n response,\n });\n await handler.doneWaiting();\n }\n catch (waitUntilError) {\n if (waitUntilError instanceof Error) {\n error = waitUntilError;\n }\n }\n await handler.runCallbacks('handlerDidComplete', {\n event,\n request,\n response,\n error: error,\n });\n handler.destroy();\n if (error) {\n throw error;\n }\n }\n}\nexport { Strategy };\n/**\n * Classes extending the `Strategy` based class should implement this method,\n * and leverage the {@link workbox-strategies.StrategyHandler}\n * arg to perform all fetching and cache logic, which will ensure all relevant\n * cache, cache options, fetch options and plugins are used (per the current\n * strategy instance).\n *\n * @name _handle\n * @instance\n * @abstract\n * @function\n * @param {Request} request\n * @param {workbox-strategies.StrategyHandler} handler\n * @return {Promise<Response>}\n *\n * @memberof workbox-strategies.Strategy\n */\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { waitUntil } from 'workbox-core/_private/waitUntil.js';\nimport { createCacheKey } from './utils/createCacheKey.js';\nimport { PrecacheInstallReportPlugin } from './utils/PrecacheInstallReportPlugin.js';\nimport { PrecacheCacheKeyPlugin } from './utils/PrecacheCacheKeyPlugin.js';\nimport { printCleanupDetails } from './utils/printCleanupDetails.js';\nimport { printInstallDetails } from './utils/printInstallDetails.js';\nimport { PrecacheStrategy } from './PrecacheStrategy.js';\nimport './_version.js';\n/**\n * Performs efficient precaching of assets.\n *\n * @memberof workbox-precaching\n */\nclass PrecacheController {\n /**\n * Create a new PrecacheController.\n *\n * @param {Object} [options]\n * @param {string} [options.cacheName] The cache to use for precaching.\n * @param {string} [options.plugins] Plugins to use when precaching as well\n * as responding to fetch events for precached assets.\n * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to\n * get the response from the network if there's a precache miss.\n */\n constructor({ cacheName, plugins = [], fallbackToNetwork = true, } = {}) {\n this._urlsToCacheKeys = new Map();\n this._urlsToCacheModes = new Map();\n this._cacheKeysToIntegrities = new Map();\n this._strategy = new PrecacheStrategy({\n cacheName: cacheNames.getPrecacheName(cacheName),\n plugins: [\n ...plugins,\n new PrecacheCacheKeyPlugin({ precacheController: this }),\n ],\n fallbackToNetwork,\n });\n // Bind the install and activate methods to the instance.\n this.install = this.install.bind(this);\n this.activate = this.activate.bind(this);\n }\n /**\n * @type {workbox-precaching.PrecacheStrategy} The strategy created by this controller and\n * used to cache assets and respond to fetch events.\n */\n get strategy() {\n return this._strategy;\n }\n /**\n * Adds items to the precache list, removing any duplicates and\n * stores the files in the\n * {@link workbox-core.cacheNames|\"precache cache\"} when the service\n * worker installs.\n *\n * This method can be called multiple times.\n *\n * @param {Array<Object|string>} [entries=[]] Array of entries to precache.\n */\n precache(entries) {\n this.addToCacheList(entries);\n if (!this._installAndActiveListenersAdded) {\n self.addEventListener('install', this.install);\n self.addEventListener('activate', this.activate);\n this._installAndActiveListenersAdded = true;\n }\n }\n /**\n * This method will add items to the precache list, removing duplicates\n * and ensuring the information is valid.\n *\n * @param {Array<workbox-precaching.PrecacheController.PrecacheEntry|string>} entries\n * Array of entries to precache.\n */\n addToCacheList(entries) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isArray(entries, {\n moduleName: 'workbox-precaching',\n className: 'PrecacheController',\n funcName: 'addToCacheList',\n paramName: 'entries',\n });\n }\n const urlsToWarnAbout = [];\n for (const entry of entries) {\n // See https://github.com/GoogleChrome/workbox/issues/2259\n if (typeof entry === 'string') {\n urlsToWarnAbout.push(entry);\n }\n else if (entry && entry.revision === undefined) {\n urlsToWarnAbout.push(entry.url);\n }\n const { cacheKey, url } = createCacheKey(entry);\n const cacheMode = typeof entry !== 'string' && entry.revision ? 'reload' : 'default';\n if (this._urlsToCacheKeys.has(url) &&\n this._urlsToCacheKeys.get(url) !== cacheKey) {\n throw new WorkboxError('add-to-cache-list-conflicting-entries', {\n firstEntry: this._urlsToCacheKeys.get(url),\n secondEntry: cacheKey,\n });\n }\n if (typeof entry !== 'string' && entry.integrity) {\n if (this._cacheKeysToIntegrities.has(cacheKey) &&\n this._cacheKeysToIntegrities.get(cacheKey) !== entry.integrity) {\n throw new WorkboxError('add-to-cache-list-conflicting-integrities', {\n url,\n });\n }\n this._cacheKeysToIntegrities.set(cacheKey, entry.integrity);\n }\n this._urlsToCacheKeys.set(url, cacheKey);\n this._urlsToCacheModes.set(url, cacheMode);\n if (urlsToWarnAbout.length > 0) {\n const warningMessage = `Workbox is precaching URLs without revision ` +\n `info: ${urlsToWarnAbout.join(', ')}\\nThis is generally NOT safe. ` +\n `Learn more at https://bit.ly/wb-precache`;\n if (process.env.NODE_ENV === 'production') {\n // Use console directly to display this warning without bloating\n // bundle sizes by pulling in all of the logger codebase in prod.\n console.warn(warningMessage);\n }\n else {\n logger.warn(warningMessage);\n }\n }\n }\n }\n /**\n * Precaches new and updated assets. Call this method from the service worker\n * install event.\n *\n * Note: this method calls `event.waitUntil()` for you, so you do not need\n * to call it yourself in your event handlers.\n *\n * @param {ExtendableEvent} event\n * @return {Promise<workbox-precaching.InstallResult>}\n */\n install(event) {\n // waitUntil returns Promise<any>\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return waitUntil(event, async () => {\n const installReportPlugin = new PrecacheInstallReportPlugin();\n this.strategy.plugins.push(installReportPlugin);\n // Cache entries one at a time.\n // See https://github.com/GoogleChrome/workbox/issues/2528\n for (const [url, cacheKey] of this._urlsToCacheKeys) {\n const integrity = this._cacheKeysToIntegrities.get(cacheKey);\n const cacheMode = this._urlsToCacheModes.get(url);\n const request = new Request(url, {\n integrity,\n cache: cacheMode,\n credentials: 'same-origin',\n });\n await Promise.all(this.strategy.handleAll({\n params: { cacheKey },\n request,\n event,\n }));\n }\n const { updatedURLs, notUpdatedURLs } = installReportPlugin;\n if (process.env.NODE_ENV !== 'production') {\n printInstallDetails(updatedURLs, notUpdatedURLs);\n }\n return { updatedURLs, notUpdatedURLs };\n });\n }\n /**\n * Deletes assets that are no longer present in the current precache manifest.\n * Call this method from the service worker activate event.\n *\n * Note: this method calls `event.waitUntil()` for you, so you do not need\n * to call it yourself in your event handlers.\n *\n * @param {ExtendableEvent} event\n * @return {Promise<workbox-precaching.CleanupResult>}\n */\n activate(event) {\n // waitUntil returns Promise<any>\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return waitUntil(event, async () => {\n const cache = await self.caches.open(this.strategy.cacheName);\n const currentlyCachedRequests = await cache.keys();\n const expectedCacheKeys = new Set(this._urlsToCacheKeys.values());\n const deletedURLs = [];\n for (const request of currentlyCachedRequests) {\n if (!expectedCacheKeys.has(request.url)) {\n await cache.delete(request);\n deletedURLs.push(request.url);\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n printCleanupDetails(deletedURLs);\n }\n return { deletedURLs };\n });\n }\n /**\n * Returns a mapping of a precached URL to the corresponding cache key, taking\n * into account the revision information for the URL.\n *\n * @return {Map<string, string>} A URL to cache key mapping.\n */\n getURLsToCacheKeys() {\n return this._urlsToCacheKeys;\n }\n /**\n * Returns a list of all the URLs that have been precached by the current\n * service worker.\n *\n * @return {Array<string>} The precached URLs.\n */\n getCachedURLs() {\n return [...this._urlsToCacheKeys.keys()];\n }\n /**\n * Returns the cache key used for storing a given URL. If that URL is\n * unversioned, like `/index.html', then the cache key will be the original\n * URL with a search parameter appended to it.\n *\n * @param {string} url A URL whose cache key you want to look up.\n * @return {string} The versioned URL that corresponds to a cache key\n * for the original URL, or undefined if that URL isn't precached.\n */\n getCacheKeyForURL(url) {\n const urlObject = new URL(url, location.href);\n return this._urlsToCacheKeys.get(urlObject.href);\n }\n /**\n * @param {string} url A cache key whose SRI you want to look up.\n * @return {string} The subresource integrity associated with the cache key,\n * or undefined if it's not set.\n */\n getIntegrityForCacheKey(cacheKey) {\n return this._cacheKeysToIntegrities.get(cacheKey);\n }\n /**\n * This acts as a drop-in replacement for\n * [`cache.match()`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/match)\n * with the following differences:\n *\n * - It knows what the name of the precache is, and only checks in that cache.\n * - It allows you to pass in an \"original\" URL without versioning parameters,\n * and it will automatically look up the correct cache key for the currently\n * active revision of that URL.\n *\n * E.g., `matchPrecache('index.html')` will find the correct precached\n * response for the currently active service worker, even if the actual cache\n * key is `'/index.html?__WB_REVISION__=1234abcd'`.\n *\n * @param {string|Request} request The key (without revisioning parameters)\n * to look up in the precache.\n * @return {Promise<Response|undefined>}\n */\n async matchPrecache(request) {\n const url = request instanceof Request ? request.url : request;\n const cacheKey = this.getCacheKeyForURL(url);\n if (cacheKey) {\n const cache = await self.caches.open(this.strategy.cacheName);\n return cache.match(cacheKey);\n }\n return undefined;\n }\n /**\n * Returns a function that looks up `url` in the precache (taking into\n * account revision information), and returns the corresponding `Response`.\n *\n * @param {string} url The precached URL which will be used to lookup the\n * `Response`.\n * @return {workbox-routing~handlerCallback}\n */\n createHandlerBoundToURL(url) {\n const cacheKey = this.getCacheKeyForURL(url);\n if (!cacheKey) {\n throw new WorkboxError('non-precached-url', { url });\n }\n return (options) => {\n options.request = new Request(url);\n options.params = Object.assign({ cacheKey }, options.params);\n return this.strategy.handle(options);\n };\n }\n}\nexport { PrecacheController };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { PrecacheController } from '../PrecacheController.js';\nimport '../_version.js';\nlet precacheController;\n/**\n * @return {PrecacheController}\n * @private\n */\nexport const getOrCreatePrecacheController = () => {\n if (!precacheController) {\n precacheController = new PrecacheController();\n }\n return precacheController;\n};\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { Route } from 'workbox-routing/Route.js';\nimport { generateURLVariations } from './utils/generateURLVariations.js';\nimport './_version.js';\n/**\n * A subclass of {@link workbox-routing.Route} that takes a\n * {@link workbox-precaching.PrecacheController}\n * instance and uses it to match incoming requests and handle fetching\n * responses from the precache.\n *\n * @memberof workbox-precaching\n * @extends workbox-routing.Route\n */\nclass PrecacheRoute extends Route {\n /**\n * @param {PrecacheController} precacheController A `PrecacheController`\n * instance used to both match requests and respond to fetch events.\n * @param {Object} [options] Options to control how requests are matched\n * against the list of precached URLs.\n * @param {string} [options.directoryIndex=index.html] The `directoryIndex` will\n * check cache entries for a URLs ending with '/' to see if there is a hit when\n * appending the `directoryIndex` value.\n * @param {Array<RegExp>} [options.ignoreURLParametersMatching=[/^utm_/, /^fbclid$/]] An\n * array of regex's to remove search params when looking for a cache match.\n * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will\n * check the cache for the URL with a `.html` added to the end of the end.\n * @param {workbox-precaching~urlManipulation} [options.urlManipulation]\n * This is a function that should take a URL and return an array of\n * alternative URLs that should be checked for precache matches.\n */\n constructor(precacheController, options) {\n const match = ({ request, }) => {\n const urlsToCacheKeys = precacheController.getURLsToCacheKeys();\n for (const possibleURL of generateURLVariations(request.url, options)) {\n const cacheKey = urlsToCacheKeys.get(possibleURL);\n if (cacheKey) {\n const integrity = precacheController.getIntegrityForCacheKey(cacheKey);\n return { cacheKey, integrity };\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Precaching did not find a match for ` + getFriendlyURL(request.url));\n }\n return;\n };\n super(match, precacheController.strategy);\n }\n}\nexport { PrecacheRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { removeIgnoredSearchParams } from './removeIgnoredSearchParams.js';\nimport '../_version.js';\n/**\n * Generator function that yields possible variations on the original URL to\n * check, one at a time.\n *\n * @param {string} url\n * @param {Object} options\n *\n * @private\n * @memberof workbox-precaching\n */\nexport function* generateURLVariations(url, { ignoreURLParametersMatching = [/^utm_/, /^fbclid$/], directoryIndex = 'index.html', cleanURLs = true, urlManipulation, } = {}) {\n const urlObject = new URL(url, location.href);\n urlObject.hash = '';\n yield urlObject.href;\n const urlWithoutIgnoredParams = removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching);\n yield urlWithoutIgnoredParams.href;\n if (directoryIndex && urlWithoutIgnoredParams.pathname.endsWith('/')) {\n const directoryURL = new URL(urlWithoutIgnoredParams.href);\n directoryURL.pathname += directoryIndex;\n yield directoryURL.href;\n }\n if (cleanURLs) {\n const cleanURL = new URL(urlWithoutIgnoredParams.href);\n cleanURL.pathname += '.html';\n yield cleanURL.href;\n }\n if (urlManipulation) {\n const additionalURLs = urlManipulation({ url: urlObject });\n for (const urlToAttempt of additionalURLs) {\n yield urlToAttempt.href;\n }\n }\n}\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * Removes any URL search parameters that should be ignored.\n *\n * @param {URL} urlObject The original URL.\n * @param {Array<RegExp>} ignoreURLParametersMatching RegExps to test against\n * each search parameter name. Matches mean that the search parameter should be\n * ignored.\n * @return {URL} The URL with any ignored search parameters removed.\n *\n * @private\n * @memberof workbox-precaching\n */\nexport function removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching = []) {\n // Convert the iterable into an array at the start of the loop to make sure\n // deletion doesn't mess up iteration.\n for (const paramName of [...urlObject.searchParams.keys()]) {\n if (ignoreURLParametersMatching.some((regExp) => regExp.test(paramName))) {\n urlObject.searchParams.delete(paramName);\n }\n }\n return urlObject;\n}\n","/*\n Copyright 2019 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { registerRoute } from 'workbox-routing/registerRoute.js';\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport { PrecacheRoute } from './PrecacheRoute.js';\nimport './_version.js';\n/**\n * Add a `fetch` listener to the service worker that will\n * respond to\n * [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests}\n * with precached assets.\n *\n * Requests for assets that aren't precached, the `FetchEvent` will not be\n * responded to, allowing the event to fall through to other `fetch` event\n * listeners.\n *\n * @param {Object} [options] See the {@link workbox-precaching.PrecacheRoute}\n * options.\n *\n * @memberof workbox-precaching\n */\nfunction addRoute(options) {\n const precacheController = getOrCreatePrecacheController();\n const precacheRoute = new PrecacheRoute(precacheController, options);\n registerRoute(precacheRoute);\n}\nexport { addRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Route } from './Route.js';\nimport { RegExpRoute } from './RegExpRoute.js';\nimport { getOrCreateDefaultRouter } from './utils/getOrCreateDefaultRouter.js';\nimport './_version.js';\n/**\n * Easily register a RegExp, string, or function with a caching\n * strategy to a singleton Router instance.\n *\n * This method will generate a Route for you if needed and\n * call {@link workbox-routing.Router#registerRoute}.\n *\n * @param {RegExp|string|workbox-routing.Route~matchCallback|workbox-routing.Route} capture\n * If the capture param is a `Route`, all other arguments will be ignored.\n * @param {workbox-routing~handlerCallback} [handler] A callback\n * function that returns a Promise resulting in a Response. This parameter\n * is required if `capture` is not a `Route` object.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n * @return {workbox-routing.Route} The generated `Route`.\n *\n * @memberof workbox-routing\n */\nfunction registerRoute(capture, handler, method) {\n let route;\n if (typeof capture === 'string') {\n const captureUrl = new URL(capture, location.href);\n if (process.env.NODE_ENV !== 'production') {\n if (!(capture.startsWith('/') || capture.startsWith('http'))) {\n throw new WorkboxError('invalid-string', {\n moduleName: 'workbox-routing',\n funcName: 'registerRoute',\n paramName: 'capture',\n });\n }\n // We want to check if Express-style wildcards are in the pathname only.\n // TODO: Remove this log message in v4.\n const valueToCheck = capture.startsWith('http')\n ? captureUrl.pathname\n : capture;\n // See https://github.com/pillarjs/path-to-regexp#parameters\n const wildcards = '[*:?+]';\n if (new RegExp(`${wildcards}`).exec(valueToCheck)) {\n logger.debug(`The '$capture' parameter contains an Express-style wildcard ` +\n `character (${wildcards}). Strings are now always interpreted as ` +\n `exact matches; use a RegExp for partial or wildcard matches.`);\n }\n }\n const matchCallback = ({ url }) => {\n if (process.env.NODE_ENV !== 'production') {\n if (url.pathname === captureUrl.pathname &&\n url.origin !== captureUrl.origin) {\n logger.debug(`${capture} only partially matches the cross-origin URL ` +\n `${url.toString()}. This route will only handle cross-origin requests ` +\n `if they match the entire URL.`);\n }\n }\n return url.href === captureUrl.href;\n };\n // If `capture` is a string then `handler` and `method` must be present.\n route = new Route(matchCallback, handler, method);\n }\n else if (capture instanceof RegExp) {\n // If `capture` is a `RegExp` then `handler` and `method` must be present.\n route = new RegExpRoute(capture, handler, method);\n }\n else if (typeof capture === 'function') {\n // If `capture` is a function then `handler` and `method` must be present.\n route = new Route(capture, handler, method);\n }\n else if (capture instanceof Route) {\n route = capture;\n }\n else {\n throw new WorkboxError('unsupported-route-type', {\n moduleName: 'workbox-routing',\n funcName: 'registerRoute',\n paramName: 'capture',\n });\n }\n const defaultRouter = getOrCreateDefaultRouter();\n defaultRouter.registerRoute(route);\n return route;\n}\nexport { registerRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { addRoute } from './addRoute.js';\nimport { precache } from './precache.js';\nimport './_version.js';\n/**\n * This method will add entries to the precache list and add a route to\n * respond to fetch events.\n *\n * This is a convenience method that will call\n * {@link workbox-precaching.precache} and\n * {@link workbox-precaching.addRoute} in a single call.\n *\n * @param {Array<Object|string>} entries Array of entries to precache.\n * @param {Object} [options] See the\n * {@link workbox-precaching.PrecacheRoute} options.\n *\n * @memberof workbox-precaching\n */\nfunction precacheAndRoute(entries, options) {\n precache(entries);\n addRoute(options);\n}\nexport { precacheAndRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport './_version.js';\n/**\n * Adds items to the precache list, removing any duplicates and\n * stores the files in the\n * {@link workbox-core.cacheNames|\"precache cache\"} when the service\n * worker installs.\n *\n * This method can be called multiple times.\n *\n * Please note: This method **will not** serve any of the cached files for you.\n * It only precaches files. To respond to a network request you call\n * {@link workbox-precaching.addRoute}.\n *\n * If you have a single array of files to precache, you can just call\n * {@link workbox-precaching.precacheAndRoute}.\n *\n * @param {Array<Object|string>} [entries=[]] Array of entries to precache.\n *\n * @memberof workbox-precaching\n */\nfunction precache(entries) {\n const precacheController = getOrCreatePrecacheController();\n precacheController.precache(entries);\n}\nexport { precache };\n"],"names":["self","_","e","messageGenerator","code","args","msg","length","JSON","stringify","WorkboxError","Error","constructor","errorCode","details","super","name","normalizeHandler","handler","handle","Route","match","method","this","setCatchHandler","catchHandler","RegExpRoute","regExp","url","result","exec","href","origin","location","index","slice","Router","_routes","Map","_defaultHandlerMap","routes","addFetchListener","addEventListener","event","request","responsePromise","handleRequest","respondWith","addCacheListener","data","type","payload","requestPromises","Promise","all","urlsToCache","map","entry","Request","waitUntil","ports","then","postMessage","URL","protocol","startsWith","sameOrigin","params","route","findMatchingRoute","has","get","err","reject","_catchHandler","catch","async","catchErr","matchResult","Array","isArray","Object","keys","undefined","setDefaultHandler","set","registerRoute","push","unregisterRoute","routeIndex","indexOf","splice","defaultRouter","_cacheNameDetails","googleAnalytics","precache","prefix","runtime","suffix","registration","scope","_createCacheName","cacheName","filter","value","join","cacheNames","userCacheName","asyncFn","returnPromise","createCacheKey","urlObject","cacheKey","revision","cacheKeyURL","originalURL","searchParams","PrecacheInstallReportPlugin","updatedURLs","notUpdatedURLs","handlerWillStart","state","originalRequest","cachedResponseWillBeUsed","cachedResponse","PrecacheCacheKeyPlugin","precacheController","cacheKeyWillBeUsed","_precacheController","getCacheKeyForURL","headers","supportStatus","copyResponse","response","modifier","clonedResponse","clone","responseInit","Headers","status","statusText","modifiedResponseInit","body","testResponse","Response","error","canConstructResponseFromBodyStream","blob","stripParams","fullURL","ignoreParams","strippedURL","param","delete","Deferred","promise","resolve","quotaErrorCallbacks","Set","toRequest","input","StrategyHandler","strategy","options","_cacheKeys","assign","_strategy","_handlerDeferred","_extendLifetimePromises","_plugins","plugins","_pluginStateMap","plugin","fetch","mode","FetchEvent","preloadResponse","possiblePreloadResponse","hasCallback","cb","iterateCallbacks","thrownErrorMessage","message","pluginFilteredRequest","fetchResponse","fetchOptions","callback","runCallbacks","fetchAndCachePut","responseClone","cachePut","cacheMatch","key","matchOptions","effectiveRequest","getCacheKey","multiMatchOptions","caches","ms","setTimeout","String","replace","RegExp","responseToCache","_ensureResponseSafeToCache","cache","open","hasCacheUpdateCallback","oldResponse","strippedRequestURL","keysOptions","ignoreSearch","cacheKeys","cacheMatchIgnoreParams","put","executeQuotaErrorCallbacks","newResponse","statefulCallback","statefulParam","shift","destroy","pluginsUsed","PrecacheStrategy","responseDone","handleAll","_getResponse","_awaitComplete","_handle","doneWaiting","waitUntilError","_fallbackToNetwork","fallbackToNetwork","copyRedirectedCacheableResponsesPlugin","_handleInstall","_handleFetch","integrityInManifest","integrity","integrityInRequest","noIntegrityConflict","_useDefaultCacheabilityPluginIfNeeded","defaultPluginIndex","cacheWillUpdatePluginCount","entries","defaultPrecacheCacheabilityPlugin","cacheWillUpdate","redirected","PrecacheController","_urlsToCacheKeys","_urlsToCacheModes","_cacheKeysToIntegrities","install","bind","activate","addToCacheList","_installAndActiveListenersAdded","urlsToWarnAbout","cacheMode","firstEntry","secondEntry","warningMessage","console","warn","installReportPlugin","credentials","currentlyCachedRequests","expectedCacheKeys","values","deletedURLs","getURLsToCacheKeys","getCachedURLs","getIntegrityForCacheKey","matchPrecache","createHandlerBoundToURL","getOrCreatePrecacheController","PrecacheRoute","urlsToCacheKeys","possibleURL","ignoreURLParametersMatching","directoryIndex","cleanURLs","urlManipulation","hash","urlWithoutIgnoredParams","paramName","some","test","removeIgnoredSearchParams","pathname","endsWith","directoryURL","cleanURL","additionalURLs","urlToAttempt","generateURLVariations","addRoute","capture","captureUrl","moduleName","funcName"],"mappings":"6CAEA,IACIA,KAAK,uBAAyBC,IAElC,MAAOC,ICEP,MCgBaC,EAdI,CAACC,KAASC,KACnBC,IAAAA,EAAMF,EAIV,OAHIC,EAAKE,OAAS,IACdD,GAAQ,OAAME,KAAKC,UAAUJ,MAE1BC,GCIX,MAAMI,UAAqBC,MASvBC,YAAYC,EAAWC,GAEnBC,MADgBZ,EAAiBU,EAAWC,IAEvCE,KAAAA,KAAOH,EACPC,KAAAA,QAAUA,GC7BvB,IACId,KAAK,0BAA4BC,IAErC,MAAOC,ICWA,MCAMe,EAAoBC,GACzBA,GAA8B,iBAAZA,EASXA,EAWA,CAAEC,OAAQD,GCjBzB,MAAME,EAYFR,YAAYS,EAAOH,EAASI,EFhBH,OE8BrBC,KAAKL,QAAUD,EAAiBC,GAC3BG,KAAAA,MAAQA,EACRC,KAAAA,OAASA,EAOlBE,gBAAgBN,GACZK,KAAKE,aAAeR,EAAiBC,IClC7C,MAAMQ,UAAoBN,EActBR,YAAYe,EAAQT,EAASI,GAiCzBP,OAxBc,EAAGa,IAAAA,MACPC,MAAAA,EAASF,EAAOG,KAAKF,EAAIG,MAE3B,GAACF,IAODD,EAAII,SAAWC,SAASD,QAA2B,IAAjBH,EAAOK,OAY7C,OAAOL,EAAOM,MAAM,KAEXjB,EAASI,ICtC9B,MAAMc,EAIFxB,cACIW,KAAKc,EAAU,IAAIC,IACnBf,KAAKgB,EAAqB,IAAID,IAO9BE,aACA,OAAOjB,KAAKc,EAMhBI,mBAEIzC,KAAK0C,iBAAiB,SAAWC,IACvB,MAAAC,QAAEA,GAAYD,EACdE,EAAkBtB,KAAKuB,cAAc,CAAEF,QAAAA,EAASD,MAAAA,IAClDE,GACAF,EAAMI,YAAYF,MA0B9BG,mBAEIhD,KAAK0C,iBAAiB,WAAaC,IAG3BA,GAAAA,EAAMM,MAA4B,eAApBN,EAAMM,KAAKC,KAAuB,CAE1C,MAAAC,QAAEA,GAAYR,EAAMM,KAIpBG,EAAkBC,QAAQC,IAAIH,EAAQI,YAAYC,KAAKC,IACpC,iBAAVA,IACPA,EAAQ,CAACA,IAEb,MAAMb,EAAU,IAAIc,WAAWD,GACxB,OAAAlC,KAAKuB,cAAc,CAAEF,QAAAA,EAASD,MAAAA,QAKzCA,EAAMgB,UAAUP,GAEZT,EAAMiB,OAASjB,EAAMiB,MAAM,IACtBR,EAAgBS,MAAK,IAAMlB,EAAMiB,MAAM,GAAGE,aAAY,SAiB3EhB,eAAcF,QAAEA,EAAFD,MAAWA,IASrB,MAAMf,EAAM,IAAImC,IAAInB,EAAQhB,IAAKK,SAASF,MACtC,IAACH,EAAIoC,SAASC,WAAW,QAIzB,OAEEC,MAAAA,EAAatC,EAAII,SAAWC,SAASD,QACrCmC,OAAEA,EAAFC,MAAUA,GAAU7C,KAAK8C,kBAAkB,CAC7C1B,MAAAA,EACAC,QAAAA,EACAsB,WAAAA,EACAtC,IAAAA,IAEJ,IAAIV,EAAUkD,GAASA,EAAMlD,QAe7B,MAAMI,EAASsB,EAAQtB,OAQnB,IAPCJ,GAAWK,KAAKgB,EAAmB+B,IAAIhD,KAKxCJ,EAAUK,KAAKgB,EAAmBgC,IAAIjD,KAErCJ,EAMD,OAkBJ,IAAI2B,EACA,IACAA,EAAkB3B,EAAQC,OAAO,CAAES,IAAAA,EAAKgB,QAAAA,EAASD,MAAAA,EAAOwB,OAAAA,IAE5D,MAAOK,GACH3B,EAAkBQ,QAAQoB,OAAOD,GAGrC,MAAM/C,EAAe2C,GAASA,EAAM3C,aAuCpC,OAtCIoB,aAA2BQ,UAC1B9B,KAAKmD,GAAiBjD,KACvBoB,EAAkBA,EAAgB8B,OAAMC,MAAAA,IAEpC,GAAInD,EAUI,IACA,aAAaA,EAAaN,OAAO,CAAES,IAAAA,EAAKgB,QAAAA,EAASD,MAAAA,EAAOwB,OAAAA,IAE5D,MAAOU,GACCA,aAAoBlE,QACpB6D,EAAMK,GAId,GAAAtD,KAAKmD,EAUL,OAAOnD,KAAKmD,EAAcvD,OAAO,CAAES,IAAAA,EAAKgB,QAAAA,EAASD,MAAAA,IAErD,MAAM6B,MAGP3B,EAiBXwB,mBAAkBzC,IAAEA,EAAFsC,WAAOA,EAAPtB,QAAmBA,EAAnBD,MAA4BA,IACpCH,MAAAA,EAASjB,KAAKc,EAAQkC,IAAI3B,EAAQtB,SAAW,GACnD,IAAK,MAAM8C,KAAS5B,EAAQ,CACpB2B,IAAAA,EAGJ,MAAMW,EAAcV,EAAM/C,MAAM,CAAEO,IAAAA,EAAKsC,WAAAA,EAAYtB,QAAAA,EAASD,MAAAA,IAC5D,GAAImC,EA6BO,OAjBPX,EAASW,GACLC,MAAMC,QAAQb,IAA6B,IAAlBA,EAAO5D,QAI3BuE,EAAYlE,cAAgBqE,QACG,IAApCA,OAAOC,KAAKJ,GAAavE,QAIG,kBAAhBuE,KAPZX,OAASgB,GAcN,CAAEf,MAAAA,EAAOD,OAAAA,GAIxB,MAAO,GAgBXiB,kBAAkBlE,EAASI,EJ1SF,OI2ShBiB,KAAAA,EAAmB8C,IAAI/D,EAAQL,EAAiBC,IASzDM,gBAAgBN,GACZK,KAAKmD,EAAgBzD,EAAiBC,GAO1CoE,cAAclB,GAiCL7C,KAAKc,EAAQiC,IAAIF,EAAM9C,SACnBe,KAAAA,EAAQgD,IAAIjB,EAAM9C,OAAQ,IAI9Be,KAAAA,EAAQkC,IAAIH,EAAM9C,QAAQiE,KAAKnB,GAOxCoB,gBAAgBpB,GACR,IAAC7C,KAAKc,EAAQiC,IAAIF,EAAM9C,QACxB,MAAM,IAAIZ,EAAa,6CAA8C,CACjEY,OAAQ8C,EAAM9C,SAGtB,MAAMmE,EAAalE,KAAKc,EAAQkC,IAAIH,EAAM9C,QAAQoE,QAAQtB,GAC1D,KAAIqB,GAAc,GAId,MAAM,IAAI/E,EAAa,yCAHvBa,KAAKc,EAAQkC,IAAIH,EAAM9C,QAAQqE,OAAOF,EAAY,ICxX9D,IAAIG,ECDJ,MAAMC,EAAoB,CACtBC,gBAAiB,kBACjBC,SAAU,cACVC,OAAQ,UACRC,QAAS,UACTC,OAAgC,oBAAjBC,aAA+BA,aAAaC,MAAQ,IAEjEC,EAAoBC,GACf,CAACT,EAAkBG,OAAQM,EAAWT,EAAkBK,QAC1DK,QAAQC,GAAUA,GAASA,EAAMjG,OAAS,IAC1CkG,KAAK,KAODC,EAWSC,GACPA,GAAiBN,EAAiBR,EAAkBE,UAZtDW,EAiBQC,GACNA,GAAiBN,EAAiBR,EAAkBI,SC3BnE,SAAStC,EAAUhB,EAAOiE,GAChBC,MAAAA,EAAgBD,IAEtB,OADAjE,EAAMgB,UAAUkD,GACTA,ECjBX,IACI7G,KAAK,6BAA+BC,IAExC,MAAOC,ICeA,SAAS4G,EAAerD,GACvB,IAACA,EACD,MAAM,IAAI/C,EAAa,oCAAqC,CAAE+C,MAAAA,IAIlE,GAAqB,iBAAVA,EAAoB,CACrBsD,MAAAA,EAAY,IAAIhD,IAAIN,EAAOxB,SAASF,MACnC,MAAA,CACHiF,SAAUD,EAAUhF,KACpBH,IAAKmF,EAAUhF,MAGjB,MAAAkF,SAAEA,EAAFrF,IAAYA,GAAQ6B,EACtB,IAAC7B,EACD,MAAM,IAAIlB,EAAa,oCAAqC,CAAE+C,MAAAA,IAI9D,IAACwD,EAAU,CACLF,MAAAA,EAAY,IAAIhD,IAAInC,EAAKK,SAASF,MACjC,MAAA,CACHiF,SAAUD,EAAUhF,KACpBH,IAAKmF,EAAUhF,MAKjBmF,MAAAA,EAAc,IAAInD,IAAInC,EAAKK,SAASF,MACpCoF,EAAc,IAAIpD,IAAInC,EAAKK,SAASF,MAEnC,OADPmF,EAAYE,aAAa/B,IAxCC,kBAwC0B4B,GAC7C,CACHD,SAAUE,EAAYnF,KACtBH,IAAKuF,EAAYpF,MCvCzB,MAAMsF,EACFzG,cACS0G,KAAAA,YAAc,GACdC,KAAAA,eAAiB,GACjBC,KAAAA,iBAAmB5C,OAAShC,QAAAA,EAAS6E,MAAAA,MAElCA,IACAA,EAAMC,gBAAkB9E,IAG3B+E,KAAAA,yBAA2B/C,OAASjC,MAAAA,EAAO8E,MAAAA,EAAOG,eAAAA,MACnD,GAAmB,YAAfjF,EAAMO,MACFuE,GACAA,EAAMC,iBACND,EAAMC,2BAA2BhE,QAAS,CAE1C,MAAM9B,EAAM6F,EAAMC,gBAAgB9F,IAC9BgG,EACArG,KAAKgG,eAAehC,KAAK3D,GAGzBL,KAAK+F,YAAY/B,KAAK3D,GAIlC,OAAOgG,ICzBnB,MAAMC,EACFjH,aAAYkH,mBAAEA,IACLC,KAAAA,mBAAqBnD,OAAShC,QAAAA,EAASuB,OAAAA,MAGlC6C,MAAAA,GAAY7C,MAAAA,OAAuC,EAASA,EAAO6C,WACrEzF,KAAKyG,EAAoBC,kBAAkBrF,EAAQhB,KAEvD,OAAOoF,EACD,IAAItD,QAAQsD,EAAU,CAAEkB,QAAStF,EAAQsF,UACzCtF,GAELoF,KAAAA,EAAsBF,GClBnC,IAAIK,ECqBJvD,eAAewD,EAAaC,EAAUC,GAClC,IAAItG,EAAS,KAETqG,GAAAA,EAASzG,IAAK,CAEdI,EADoB,IAAI+B,IAAIsE,EAASzG,KAChBI,OAEzB,GAAIA,IAAWhC,KAAKiC,SAASD,OACzB,MAAM,IAAItB,EAAa,6BAA8B,CAAEsB,OAAAA,IAE3D,MAAMuG,EAAiBF,EAASG,QAE1BC,EAAe,CACjBP,QAAS,IAAIQ,QAAQH,EAAeL,SACpCS,OAAQJ,EAAeI,OACvBC,WAAYL,EAAeK,YAGzBC,EAAuBP,EAAWA,EAASG,GAAgBA,EAI3DK,EDjCV,WACQX,QAAkBhD,IAAlBgD,EAA6B,CAC7B,MAAMY,EAAe,IAAIC,SAAS,IAC9B,GAAA,SAAUD,EACN,IACA,IAAIC,SAASD,EAAaD,MAC1BX,GAAgB,EAEpB,MAAOc,GACHd,GAAgB,EAGxBA,GAAgB,EAEpB,OAAOA,ECmBMe,GACPX,EAAeO,WACTP,EAAeY,OAC3B,OAAO,IAAIH,SAASF,EAAMD,GC/C9B,SAASO,EAAYC,EAASC,GAC1B,MAAMC,EAAc,IAAIxF,IAAIsF,GAC5B,IAAK,MAAMG,KAASF,EAChBC,EAAYnC,aAAaqC,OAAOD,GAE7BD,OAAAA,EAAYxH,KCIvB,MAAM2H,EAIF9I,cACS+I,KAAAA,QAAU,IAAItG,SAAQ,CAACuG,EAASnF,KAC5BmF,KAAAA,QAAUA,EACVnF,KAAAA,OAASA,MCZ1B,MAAMoF,EAAsB,IAAIC,ICThC,IACI9J,KAAK,6BAA+BC,IAExC,MAAOC,ICWP,SAAS6J,EAAUC,GACR,MAAiB,iBAAVA,EAAqB,IAAItG,QAAQsG,GAASA,EAW5D,MAAMC,EAiBFrJ,YAAYsJ,EAAUC,GACbC,KAAAA,EAAa,GA8ClBnF,OAAOoF,OAAO9I,KAAM4I,GACpB5I,KAAKoB,MAAQwH,EAAQxH,MAChB2H,KAAAA,EAAYJ,EACjB3I,KAAKgJ,EAAmB,IAAIb,EAC5BnI,KAAKiJ,EAA0B,GAG/BjJ,KAAKkJ,EAAW,IAAIP,EAASQ,SAC7BnJ,KAAKoJ,EAAkB,IAAIrI,IAC3B,IAAK,MAAMsI,KAAUrJ,KAAKkJ,EACtBlJ,KAAKoJ,EAAgBtF,IAAIuF,EAAQ,IAErCrJ,KAAKoB,MAAMgB,UAAUpC,KAAKgJ,EAAiBZ,SAezCkB,YAAMb,GACF,MAAArH,MAAEA,GAAUpB,KAClB,IAAIqB,EAAUmH,EAAUC,GACxB,GAAqB,aAAjBpH,EAAQkI,MACRnI,aAAiBoI,YACjBpI,EAAMqI,gBAAiB,CACvB,MAAMC,QAAiCtI,EAAMqI,gBAC7C,GAAIC,EAKA,OAAOA,EAMf,MAAMvD,EAAkBnG,KAAK2J,YAAY,gBACnCtI,EAAQ4F,QACR,KACF,IACK,IAAA,MAAM2C,KAAM5J,KAAK6J,iBAAiB,oBACnCxI,QAAgBuI,EAAG,CAAEvI,QAASA,EAAQ4F,QAAS7F,MAAAA,IAGvD,MAAO6B,GACCA,GAAAA,aAAe7D,MACf,MAAM,IAAID,EAAa,kCAAmC,CACtD2K,mBAAoB7G,EAAI8G,UAOpC,MAAMC,EAAwB3I,EAAQ4F,QAClC,IACIgD,IAAAA,EAEJA,QAAsBX,MAAMjI,EAA0B,aAAjBA,EAAQkI,UAAsB3F,EAAY5D,KAAK+I,EAAUmB,cAMzF,IAAA,MAAMC,KAAYnK,KAAK6J,iBAAiB,mBACzCI,QAAsBE,EAAS,CAC3B/I,MAAAA,EACAC,QAAS2I,EACTlD,SAAUmD,IAGlB,OAAOA,EAEX,MAAOvC,GAeH,MARIvB,SACMnG,KAAKoK,aAAa,eAAgB,CACpC1C,MAAOA,EACPtG,MAAAA,EACA+E,gBAAiBA,EAAgBc,QACjC5F,QAAS2I,EAAsB/C,UAGjCS,GAaR2C,uBAAiB5B,GACnB,MAAM3B,QAAiB9G,KAAKsJ,MAAMb,GAC5B6B,EAAgBxD,EAASG,QAE/B,OADKjH,KAAKoC,UAAUpC,KAAKuK,SAAS9B,EAAO6B,IAClCxD,EAcL0D,iBAAWC,GACb,MAAMpJ,EAAUmH,EAAUiC,GAC1B,IAAIpE,EACE,MAAAtB,UAAEA,EAAF2F,aAAaA,GAAiB1K,KAAK+I,EACnC4B,QAAyB3K,KAAK4K,YAAYvJ,EAAS,QACnDwJ,EAAoBnH,OAAOoF,OAAOpF,OAAOoF,OAAO,GAAI4B,GAAe,CAAE3F,UAAAA,IAC3EsB,QAAuByE,OAAOhL,MAAM6K,EAAkBE,GASjD,IAAA,MAAMV,KAAYnK,KAAK6J,iBAAiB,4BACzCxD,QACW8D,EAAS,CACZpF,UAAAA,EACA2F,aAAAA,EACArE,eAAAA,EACAhF,QAASsJ,EACTvJ,MAAOpB,KAAKoB,cACTwC,EAEf,OAAOyC,EAiBGhD,eAACoH,EAAK3D,GAChB,MAAMzF,EAAUmH,EAAUiC,GCxP3B,IAAiBM,QAAAA,ED2PF,EC1PX,IAAIjJ,SAASuG,GAAY2C,WAAW3C,EAAS0C,MD2P1CJ,MAAAA,QAAyB3K,KAAK4K,YAAYvJ,EAAS,SAiBrD,IAACyF,EAKD,MAAM,IAAI3H,EAAa,6BAA8B,CACjDkB,KE1RQA,EF0RYsK,EAAiBtK,IEzRlC,IAAImC,IAAIyI,OAAO5K,GAAMK,SAASF,MAG/BA,KAAK0K,QAAQ,IAAIC,OAAQ,IAAGzK,SAASD,UAAW,OAJ1CJ,IAAAA,EF6RhB,MAAM+K,QAAwBpL,KAAKqL,EAA2BvE,GAC1D,IAACsE,EAKD,OAAO,EAEL,MAAArG,UAAEA,EAAF2F,aAAaA,GAAiB1K,KAAK+I,EACnCuC,QAAc7M,KAAKqM,OAAOS,KAAKxG,GAC/ByG,EAAyBxL,KAAK2J,YAAY,kBAC1C8B,EAAcD,QJtR5BnI,eAAsCiI,EAAOjK,EAAS0G,EAAc2C,GAC1DgB,MAAAA,EAAqB7D,EAAYxG,EAAQhB,IAAK0H,GAEpD,GAAI1G,EAAQhB,MAAQqL,EAChB,OAAOJ,EAAMxL,MAAMuB,EAASqJ,GAGhC,MAAMiB,EAAcjI,OAAOoF,OAAOpF,OAAOoF,OAAO,GAAI4B,GAAe,CAAEkB,cAAc,IAC7EC,QAAkBP,EAAM3H,KAAKtC,EAASsK,GAC5C,IAAK,MAAMlG,KAAYoG,EAEfH,GAAAA,IADwB7D,EAAYpC,EAASpF,IAAK0H,GAElD,OAAOuD,EAAMxL,MAAM2F,EAAUiF,GI2QrBoB,CAIRR,EAAOX,EAAiB1D,QAAS,CAAC,mBAAoByD,GACpD,KAKF,UACMY,EAAMS,IAAIpB,EAAkBa,EAAyBJ,EAAgBnE,QAAUmE,GAEzF,MAAO1D,GACCA,GAAAA,aAAiBtI,MAKjB,KAHmB,uBAAfsI,EAAMjI,YGhT1B4D,iBAKI,IAAK,MAAM8G,KAAY7B,QACb6B,IH2SY6B,GAEJtE,EAGT,IAAA,MAAMyC,KAAYnK,KAAK6J,iBAAiB,wBACnCM,EAAS,CACXpF,UAAAA,EACA0G,YAAAA,EACAQ,YAAab,EAAgBnE,QAC7B5F,QAASsJ,EACTvJ,MAAOpB,KAAKoB,QAGpB,OAAO,EAaMiC,kBAAChC,EAASkI,GACjBkB,MAAAA,EAAO,GAAEpJ,EAAQhB,SAASkJ,IAChC,IAAKvJ,KAAK6I,EAAW4B,GAAM,CACnBE,IAAAA,EAAmBtJ,EAClB,IAAA,MAAM8I,KAAYnK,KAAK6J,iBAAiB,sBACzCc,EAAmBnC,QAAgB2B,EAAS,CACxCZ,KAAAA,EACAlI,QAASsJ,EACTvJ,MAAOpB,KAAKoB,MAEZwB,OAAQ5C,KAAK4C,UAGrB5C,KAAK6I,EAAW4B,GAAOE,EAE3B,OAAO3K,KAAK6I,EAAW4B,GAS3Bd,YAAYlK,GACR,IAAK,MAAM4J,KAAUrJ,KAAK+I,EAAUI,QAC5B1J,GAAAA,KAAQ4J,EACR,OAAO,EAGf,OAAO,EAkBOhG,mBAAC5D,EAAMwI,GAChB,IAAA,MAAMkC,KAAYnK,KAAK6J,iBAAiBpK,SAGnC0K,EAASlC,GAYtB4B,kBAAiBpK,GACd,IAAK,MAAM4J,KAAUrJ,KAAK+I,EAAUI,QAChC,GAA4B,mBAAjBE,EAAO5J,GAAsB,CAC9ByG,MAAAA,EAAQlG,KAAKoJ,EAAgBpG,IAAIqG,GACjC6C,EAAoBjE,IACtB,MAAMkE,EAAgBzI,OAAOoF,OAAOpF,OAAOoF,OAAO,GAAIb,GAAQ,CAAE/B,MAAAA,IAGhE,OAAOmD,EAAO5J,GAAM0M,UAElBD,GAiBlB9J,UAAUgG,GAEN,OADApI,KAAKiJ,EAAwBjF,KAAKoE,GAC3BA,EAYM/E,oBACb,IAAI+E,EACJ,KAAQA,EAAUpI,KAAKiJ,EAAwBmD,eACrChE,EAOdiE,UACIrM,KAAKgJ,EAAiBX,QAAQ,MAY5BgD,QAA2BvE,GACzBsE,IAAAA,EAAkBtE,EAClBwF,GAAc,EACb,IAAA,MAAMnC,KAAYnK,KAAK6J,iBAAiB,mBAQrC,GAPJuB,QACWjB,EAAS,CACZ9I,QAASrB,KAAKqB,QACdyF,SAAUsE,EACVhK,MAAOpB,KAAKoB,cACTwC,EACX0I,GAAc,GACTlB,EACD,MAwBR,OArBKkB,GACGlB,GAA8C,MAA3BA,EAAgBhE,SACnCgE,OAAkBxH,GAmBnBwH,GIvef,MAAMmB,UCRN,MAuBIlN,YAAYuJ,EAAU,IAQb7D,KAAAA,UAAYI,EAA0ByD,EAAQ7D,WAQnD/E,KAAKmJ,QAAUP,EAAQO,SAAW,GAQlCnJ,KAAKkK,aAAetB,EAAQsB,aAQ5BlK,KAAK0K,aAAe9B,EAAQ8B,aAqBhC9K,OAAOgJ,GACH,MAAO4D,GAAgBxM,KAAKyM,UAAU7D,GACtC,OAAO4D,EAwBXC,UAAU7D,GAEFA,aAAmBY,aACnBZ,EAAU,CACNxH,MAAOwH,EACPvH,QAASuH,EAAQvH,UAGzB,MAAMD,EAAQwH,EAAQxH,MAChBC,EAAqC,iBAApBuH,EAAQvH,QACzB,IAAIc,QAAQyG,EAAQvH,SACpBuH,EAAQvH,QACRuB,EAAS,WAAYgG,EAAUA,EAAQhG,YAASgB,EAChDjE,EAAU,IAAI+I,EAAgB1I,KAAM,CAAEoB,MAAAA,EAAOC,QAAAA,EAASuB,OAAAA,IACtD4J,EAAexM,KAAK0M,EAAa/M,EAAS0B,EAASD,GAGzD,MAAO,CAACoL,EAFYxM,KAAK2M,EAAeH,EAAc7M,EAAS0B,EAASD,IAI1DiC,QAAC1D,EAAS0B,EAASD,GAE7B0F,IAAAA,QADEnH,EAAQyK,aAAa,mBAAoB,CAAEhJ,MAAAA,EAAOC,QAAAA,IAEpD,IAKI,GAJJyF,QAAiB9G,KAAK4M,EAAQvL,EAAS1B,IAIlCmH,GAA8B,UAAlBA,EAASnF,KACtB,MAAM,IAAIxC,EAAa,cAAe,CAAEkB,IAAKgB,EAAQhB,MAG7D,MAAOqH,GACCA,GAAAA,aAAiBtI,MACZ,IAAA,MAAM+K,KAAYxK,EAAQkK,iBAAiB,mBAE5C,GADA/C,QAAiBqD,EAAS,CAAEzC,MAAAA,EAAOtG,MAAAA,EAAOC,QAAAA,IACtCyF,EACA,MAIR,IAACA,EACD,MAAMY,EAQT,IAAA,MAAMyC,KAAYxK,EAAQkK,iBAAiB,sBAC5C/C,QAAiBqD,EAAS,CAAE/I,MAAAA,EAAOC,QAAAA,EAASyF,SAAAA,IAEhD,OAAOA,EAEL6F,QAAeH,EAAc7M,EAAS0B,EAASD,GACjD,IAAI0F,EACAY,EACA,IACAZ,QAAiB0F,EAErB,MAAO9E,IAKH,UACM/H,EAAQyK,aAAa,oBAAqB,CAC5ChJ,MAAAA,EACAC,QAAAA,EACAyF,SAAAA,UAEEnH,EAAQkN,cAElB,MAAOC,GACCA,aAA0B1N,QAC1BsI,EAAQoF,GAUhB,SAPMnN,EAAQyK,aAAa,qBAAsB,CAC7ChJ,MAAAA,EACAC,QAAAA,EACAyF,SAAAA,EACAY,MAAOA,IAEX/H,EAAQ0M,UACJ3E,EACA,MAAMA,IDlKdrI,YAAYuJ,EAAU,IAClBA,EAAQ7D,UAAYI,EAA2ByD,EAAQ7D,WACvDvF,MAAMoJ,GACN5I,KAAK+M,GAC6B,IAA9BnE,EAAQoE,kBAKZhN,KAAKmJ,QAAQnF,KAAKuI,EAAiBU,wCAS1B5J,QAAChC,EAAS1B,GACbmH,MAAAA,QAAiBnH,EAAQ6K,WAAWnJ,GAC1C,OAAIyF,IAKAnH,EAAQyB,OAAgC,YAAvBzB,EAAQyB,MAAMO,WAClB3B,KAAKkN,EAAe7L,EAAS1B,SAIjCK,KAAKmN,EAAa9L,EAAS1B,IAE1B0D,QAAChC,EAAS1B,GACxB,IAAImH,EACElE,MAAAA,EAAUjD,EAAQiD,QAAU,GAE9B,IAAA5C,KAAK+M,EA+BL,MAAM,IAAI5N,EAAa,yBAA0B,CAC7C4F,UAAW/E,KAAK+E,UAChB1E,IAAKgB,EAAQhB,MAjCQ,CAMzB,MAAM+M,EAAsBxK,EAAOyK,UAC7BC,EAAqBjM,EAAQgM,UAC7BE,GAAuBD,GAAsBA,IAAuBF,EAC1EtG,QAAiBnH,EAAQ2J,MAAM,IAAInH,QAAQd,EAAS,CAChDgM,UAAWC,GAAsBF,KAOjCA,GAAuBG,IACvBvN,KAAKwN,UACmB7N,EAAQ4K,SAASlJ,EAASyF,EAASG,UA+BnE,OAAOH,EAESzD,QAAChC,EAAS1B,GAC1BK,KAAKwN,IACC1G,MAAAA,QAAiBnH,EAAQ2J,MAAMjI,GAIjC,UADoB1B,EAAQ4K,SAASlJ,EAASyF,EAASG,SAIvD,MAAM,IAAI9H,EAAa,0BAA2B,CAC9CkB,IAAKgB,EAAQhB,IACb+G,OAAQN,EAASM,SAGzB,OAAON,EA6BX0G,IACQC,IAAAA,EAAqB,KACrBC,EAA6B,EACjC,IAAK,MAAO/M,EAAO0I,KAAWrJ,KAAKmJ,QAAQwE,UAEnCtE,IAAWkD,EAAiBU,yCAI5B5D,IAAWkD,EAAiBqB,oCAC5BH,EAAqB9M,GAErB0I,EAAOwE,iBACPH,KAG2B,IAA/BA,EACA1N,KAAKmJ,QAAQnF,KAAKuI,EAAiBqB,mCAE9BF,EAA6B,GAA4B,OAAvBD,GAEvCzN,KAAKmJ,QAAQ/E,OAAOqJ,EAAoB,IAKpDlB,EAAiBqB,kCAAoC,CACjDvK,gBAAA,OAAsByD,SAAEA,MACfA,GAAYA,EAASM,QAAU,IACzB,KAEJN,GAGfyF,EAAiBU,uCAAyC,CACtD5J,gBAAA,OAAsByD,SAAEA,KACbA,EAASgH,iBAAmBjH,EAAaC,GAAYA,GE3LpE,MAAMiH,EAWF1O,aAAY0F,UAAEA,EAAFoE,QAAaA,EAAU,GAAvB6D,kBAA2BA,GAAoB,GAAU,IACjEhN,KAAKgO,EAAmB,IAAIjN,IAC5Bf,KAAKiO,EAAoB,IAAIlN,IAC7Bf,KAAKkO,EAA0B,IAAInN,IACnCf,KAAK+I,EAAY,IAAIwD,EAAiB,CAClCxH,UAAWI,EAA2BJ,GACtCoE,QAAS,IACFA,EACH,IAAI7C,EAAuB,CAAEC,mBAAoBvG,QAErDgN,kBAAAA,IAGCmB,KAAAA,QAAUnO,KAAKmO,QAAQC,KAAKpO,MAC5BqO,KAAAA,SAAWrO,KAAKqO,SAASD,KAAKpO,MAMnC2I,eACA,OAAO3I,KAAK+I,EAYhBvE,SAASmJ,GACAW,KAAAA,eAAeX,GACf3N,KAAKuO,IACN9P,KAAK0C,iBAAiB,UAAWnB,KAAKmO,SACtC1P,KAAK0C,iBAAiB,WAAYnB,KAAKqO,UAClCE,KAAAA,GAAkC,GAU/CD,eAAeX,GASLa,MAAAA,EAAkB,GACxB,IAAK,MAAMtM,KAASyL,EAAS,CAEJ,iBAAVzL,EACPsM,EAAgBxK,KAAK9B,GAEhBA,QAA4B0B,IAAnB1B,EAAMwD,UACpB8I,EAAgBxK,KAAK9B,EAAM7B,KAEzB,MAAAoF,SAAEA,EAAFpF,IAAYA,GAAQkF,EAAerD,GACnCuM,EAA6B,iBAAVvM,GAAsBA,EAAMwD,SAAW,SAAW,UAC3E,GAAI1F,KAAKgO,EAAiBjL,IAAI1C,IAC1BL,KAAKgO,EAAiBhL,IAAI3C,KAASoF,EACnC,MAAM,IAAItG,EAAa,wCAAyC,CAC5DuP,WAAY1O,KAAKgO,EAAiBhL,IAAI3C,GACtCsO,YAAalJ,IAGjB,GAAiB,iBAAVvD,GAAsBA,EAAMmL,UAAW,CAC9C,GAAIrN,KAAKkO,EAAwBnL,IAAI0C,IACjCzF,KAAKkO,EAAwBlL,IAAIyC,KAAcvD,EAAMmL,UACrD,MAAM,IAAIlO,EAAa,4CAA6C,CAChEkB,IAAAA,IAGH6N,KAAAA,EAAwBpK,IAAI2B,EAAUvD,EAAMmL,WAIrD,GAFArN,KAAKgO,EAAiBlK,IAAIzD,EAAKoF,GAC/BzF,KAAKiO,EAAkBnK,IAAIzD,EAAKoO,GAC5BD,EAAgBxP,OAAS,EAAG,CAC5B,MAAM4P,EACD,qDAAQJ,EAAgBtJ,KAAK,8EAK9B2J,QAAQC,KAAKF,KAkB7BT,QAAQ/M,GAGJ,OAAOgB,EAAUhB,GAAOiC,UACpB,MAAM0L,EAAsB,IAAIjJ,EAC3B6C,KAAAA,SAASQ,QAAQnF,KAAK+K,GAGtB,IAAA,MAAO1O,EAAKoF,KAAazF,KAAKgO,EAAkB,CAC3CX,MAAAA,EAAYrN,KAAKkO,EAAwBlL,IAAIyC,GAC7CgJ,EAAYzO,KAAKiO,EAAkBjL,IAAI3C,GACvCgB,EAAU,IAAIc,QAAQ9B,EAAK,CAC7BgN,UAAAA,EACA/B,MAAOmD,EACPO,YAAa,sBAEXlN,QAAQC,IAAI/B,KAAK2I,SAAS8D,UAAU,CACtC7J,OAAQ,CAAE6C,SAAAA,GACVpE,QAAAA,EACAD,MAAAA,KAGF,MAAA2E,YAAEA,EAAFC,eAAeA,GAAmB+I,EAIjC,MAAA,CAAEhJ,YAAAA,EAAaC,eAAAA,MAa9BqI,SAASjN,GAGL,OAAOgB,EAAUhB,GAAOiC,UACpB,MAAMiI,QAAc7M,KAAKqM,OAAOS,KAAKvL,KAAK2I,SAAS5D,WAC7CkK,QAAgC3D,EAAM3H,OACtCuL,EAAoB,IAAI3G,IAAIvI,KAAKgO,EAAiBmB,UAClDC,EAAc,GACpB,IAAK,MAAM/N,KAAW4N,EACbC,EAAkBnM,IAAI1B,EAAQhB,aACzBiL,EAAMpD,OAAO7G,GACnB+N,EAAYpL,KAAK3C,EAAQhB,MAM1B,MAAA,CAAE+O,YAAAA,MASjBC,qBACI,OAAOrP,KAAKgO,EAQhBsB,gBACI,MAAO,IAAItP,KAAKgO,EAAiBrK,QAWrC+C,kBAAkBrG,GACRmF,MAAAA,EAAY,IAAIhD,IAAInC,EAAKK,SAASF,MACjC,OAAAR,KAAKgO,EAAiBhL,IAAIwC,EAAUhF,MAO/C+O,wBAAwB9J,GACpB,OAAOzF,KAAKkO,EAAwBlL,IAAIyC,GAoBtC+J,oBAAcnO,GACVhB,MAAAA,EAAMgB,aAAmBc,QAAUd,EAAQhB,IAAMgB,EACjDoE,EAAWzF,KAAK0G,kBAAkBrG,GACxC,GAAIoF,EAAU,CAEV,aADoBhH,KAAKqM,OAAOS,KAAKvL,KAAK2I,SAAS5D,YACtCjF,MAAM2F,IAY3BgK,wBAAwBpP,GACpB,MAAMoF,EAAWzF,KAAK0G,kBAAkBrG,GACpC,IAACoF,EACD,MAAM,IAAItG,EAAa,oBAAqB,CAAEkB,IAAAA,IAElD,OAAQuI,IACJA,EAAQvH,QAAU,IAAIc,QAAQ9B,GAC9BuI,EAAQhG,OAASc,OAAOoF,OAAO,CAAErD,SAAAA,GAAYmD,EAAQhG,QAC9C5C,KAAK2I,SAAS/I,OAAOgJ,KCtRxC,IAAIrC,EAKG,MAAMmJ,EAAgC,KACpCnJ,IACDA,EAAqB,IAAIwH,GAEtBxH,GCGX,MAAMoJ,UAAsB9P,EAiBxBR,YAAYkH,EAAoBqC,GAe5BpJ,OAdc,EAAG6B,QAAAA,MACb,MAAMuO,EAAkBrJ,EAAmB8I,qBACtC,IAAA,MAAMQ,KCtBhB,UAAgCxP,GAAKyP,4BAAEA,EAA8B,CAAC,QAAS,YAA1CC,eAAuDA,EAAiB,aAAxEC,UAAsFA,GAAY,EAAlGC,gBAAwGA,GAAqB,IAC/JzK,MAAAA,EAAY,IAAIhD,IAAInC,EAAKK,SAASF,MACxCgF,EAAU0K,KAAO,SACX1K,EAAUhF,KAChB,MAAM2P,ECHH,SAAmC3K,EAAWsK,EAA8B,IAG/E,IAAK,MAAMM,IAAa,IAAI5K,EAAUK,aAAalC,QAC3CmM,EAA4BO,MAAMjQ,GAAWA,EAAOkQ,KAAKF,MACzD5K,EAAUK,aAAaqC,OAAOkI,GAGtC,OAAO5K,EDLyB+K,CAA0B/K,EAAWsK,GAEjEC,SADEI,EAAwB3P,KAC1BuP,GAAkBI,EAAwBK,SAASC,SAAS,KAAM,CAC5DC,MAAAA,EAAe,IAAIlO,IAAI2N,EAAwB3P,MACrDkQ,EAAaF,UAAYT,QACnBW,EAAalQ,KAEvB,GAAIwP,EAAW,CACLW,MAAAA,EAAW,IAAInO,IAAI2N,EAAwB3P,MACjDmQ,EAASH,UAAY,cACfG,EAASnQ,KAEnB,GAAIyP,EAAiB,CACXW,MAAAA,EAAiBX,EAAgB,CAAE5P,IAAKmF,IAC9C,IAAK,MAAMqL,KAAgBD,QACjBC,EAAarQ,MDGOsQ,CAAsBzP,EAAQhB,IAAKuI,GAAU,CACnE,MAAMnD,EAAWmK,EAAgB5M,IAAI6M,GACrC,GAAIpK,EAAU,CAEH,MAAA,CAAEA,SAAAA,EAAU4H,UADD9G,EAAmBgJ,wBAAwB9J,QAS5Dc,EAAmBoC,WG5BxC,SAASoI,EAASnI,GACRrC,MAAAA,EAAqBmJ,KCK/B,SAAuBsB,EAASrR,EAASI,GACrC,IAAI8C,EACJ,GAAuB,iBAAZmO,EAAsB,CACvBC,MAAAA,EAAa,IAAIzO,IAAIwO,EAAStQ,SAASF,MAkC7CqC,EAAQ,IAAIhD,GAZU,EAAGQ,IAAAA,KASdA,EAAIG,OAASyQ,EAAWzQ,MAGFb,EAASI,QAEzC,GAAIiR,aAAmB7F,OAExBtI,EAAQ,IAAI1C,EAAY6Q,EAASrR,EAASI,QAEzC,GAAuB,mBAAZiR,EAEZnO,EAAQ,IAAIhD,EAAMmR,EAASrR,EAASI,OAEnC,CAAA,KAAIiR,aAAmBnR,GAIxB,MAAM,IAAIV,EAAa,yBAA0B,CAC7C+R,WAAY,kBACZC,SAAU,gBACVf,UAAW,YANfvN,EAAQmO,GzB7DP3M,IACDA,EAAgB,IAAIxD,EAEpBwD,EAAcnD,mBACdmD,EAAc5C,oBAEX4C,GyBiEON,cAAclB,GD7D5BkB,CADsB,IAAI4L,EAAcpJ,EAAoBqC,uBEHhE,SAA0B+E,EAAS/E,ICInC,SAAkB+E,GACa+B,IACRlL,SAASmJ,GDL5BnJ,CAASmJ,GACToD,EAASnI"}\ No newline at end of filediff --git a/src/main/webapp/workbox-acfd85e3.js b/src/main/webapp/workbox-acfd85e3.jsdeleted file mode 100644index 36b122b03..000000000--- a/src/main/webapp/workbox-acfd85e3.js+++ /dev/null@@ -1,2 +0,0 @@-define(["exports"],(function(t){"use strict";try{self["workbox:core:7.2.0"]&&_()}catch(t){}const e=(t,...e)=>{let s=t;return e.length>0&&(s+=` :: ${JSON.stringify(e)}`),s};class s extends Error{constructor(t,s){super(e(t,s)),this.name=t,this.details=s}}try{self["workbox:routing:7.2.0"]&&_()}catch(t){}const n=t=>t&&"object"==typeof t?t:{handle:t};class i{constructor(t,e,s="GET"){this.handler=n(e),this.match=t,this.method=s}setCatchHandler(t){this.catchHandler=n(t)}}class r extends i{constructor(t,e,s){super((({url:e})=>{const s=t.exec(e.href);if(s&&(e.origin===location.origin||0===s.index))return s.slice(1)}),e,s)}}class o{constructor(){this.t=new Map,this.i=new Map}get routes(){return this.t}addFetchListener(){self.addEventListener("fetch",(t=>{const{request:e}=t,s=this.handleRequest({request:e,event:t});s&&t.respondWith(s)}))}addCacheListener(){self.addEventListener("message",(t=>{if(t.data&&"CACHE_URLS"===t.data.type){const{payload:e}=t.data,s=Promise.all(e.urlsToCache.map((e=>{"string"==typeof e&&(e=[e]);const s=new Request(...e);return this.handleRequest({request:s,event:t})})));t.waitUntil(s),t.ports&&t.ports[0]&&s.then((()=>t.ports[0].postMessage(!0)))}}))}handleRequest({request:t,event:e}){const s=new URL(t.url,location.href);if(!s.protocol.startsWith("http"))return;const n=s.origin===location.origin,{params:i,route:r}=this.findMatchingRoute({event:e,request:t,sameOrigin:n,url:s});let o=r&&r.handler;const c=t.method;if(!o&&this.i.has(c)&&(o=this.i.get(c)),!o)return;let a;try{a=o.handle({url:s,request:t,event:e,params:i})}catch(t){a=Promise.reject(t)}const h=r&&r.catchHandler;return a instanceof Promise&&(this.o||h)&&(a=a.catch((async n=>{if(h)try{return await h.handle({url:s,request:t,event:e,params:i})}catch(t){t instanceof Error&&(n=t)}if(this.o)return this.o.handle({url:s,request:t,event:e});throw n}))),a}findMatchingRoute({url:t,sameOrigin:e,request:s,event:n}){const i=this.t.get(s.method)||[];for(const r of i){let i;const o=r.match({url:t,sameOrigin:e,request:s,event:n});if(o)return i=o,(Array.isArray(i)&&0===i.length||o.constructor===Object&&0===Object.keys(o).length||"boolean"==typeof o)&&(i=void 0),{route:r,params:i}}return{}}setDefaultHandler(t,e="GET"){this.i.set(e,n(t))}setCatchHandler(t){this.o=n(t)}registerRoute(t){this.t.has(t.method)||this.t.set(t.method,[]),this.t.get(t.method).push(t)}unregisterRoute(t){if(!this.t.has(t.method))throw new s("unregister-route-but-not-found-with-method",{method:t.method});const e=this.t.get(t.method).indexOf(t);if(!(e>-1))throw new s("unregister-route-route-not-registered");this.t.get(t.method).splice(e,1)}}let c;const a={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},h=t=>[a.prefix,t,a.suffix].filter((t=>t&&t.length>0)).join("-"),u=t=>t||h(a.precache),l=t=>t||h(a.runtime);function f(t,e){const s=e();return t.waitUntil(s),s}try{self["workbox:precaching:7.2.0"]&&_()}catch(t){}function w(t){if(!t)throw new s("add-to-cache-list-unexpected-type",{entry:t});if("string"==typeof t){const e=new URL(t,location.href);return{cacheKey:e.href,url:e.href}}const{revision:e,url:n}=t;if(!n)throw new s("add-to-cache-list-unexpected-type",{entry:t});if(!e){const t=new URL(n,location.href);return{cacheKey:t.href,url:t.href}}const i=new URL(n,location.href),r=new URL(n,location.href);return i.searchParams.set("__WB_REVISION__",e),{cacheKey:i.href,url:r.href}}class d{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:t,state:e})=>{e&&(e.originalRequest=t)},this.cachedResponseWillBeUsed=async({event:t,state:e,cachedResponse:s})=>{if("install"===t.type&&e&&e.originalRequest&&e.originalRequest instanceof Request){const t=e.originalRequest.url;s?this.notUpdatedURLs.push(t):this.updatedURLs.push(t)}return s}}}class p{constructor({precacheController:t}){this.cacheKeyWillBeUsed=async({request:t,params:e})=>{const s=(null==e?void 0:e.cacheKey)||this.h.getCacheKeyForURL(t.url);return s?new Request(s,{headers:t.headers}):t},this.h=t}}let y;async function g(t,e){let n=null;if(t.url){n=new URL(t.url).origin}if(n!==self.location.origin)throw new s("cross-origin-copy-response",{origin:n});const i=t.clone(),r={headers:new Headers(i.headers),status:i.status,statusText:i.statusText},o=e?e(r):r,c=function(){if(void 0===y){const t=new Response("");if("body"in t)try{new Response(t.body),y=!0}catch(t){y=!1}y=!1}return y}()?i.body:await i.blob();return new Response(c,o)}function R(t,e){const s=new URL(t);for(const t of e)s.searchParams.delete(t);return s.href}class m{constructor(){this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}}const v=new Set;try{self["workbox:strategies:7.2.0"]&&_()}catch(t){}function q(t){return"string"==typeof t?new Request(t):t}class U{constructor(t,e){this.u={},Object.assign(this,e),this.event=e.event,this.l=t,this.p=new m,this.R=[],this.m=[...t.plugins],this.v=new Map;for(const t of this.m)this.v.set(t,{});this.event.waitUntil(this.p.promise)}async fetch(t){const{event:e}=this;let n=q(t);if("navigate"===n.mode&&e instanceof FetchEvent&&e.preloadResponse){const t=await e.preloadResponse;if(t)return t}const i=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const t of this.iterateCallbacks("requestWillFetch"))n=await t({request:n.clone(),event:e})}catch(t){if(t instanceof Error)throw new s("plugin-error-request-will-fetch",{thrownErrorMessage:t.message})}const r=n.clone();try{let t;t=await fetch(n,"navigate"===n.mode?void 0:this.l.fetchOptions);for(const s of this.iterateCallbacks("fetchDidSucceed"))t=await s({event:e,request:r,response:t});return t}catch(t){throw i&&await this.runCallbacks("fetchDidFail",{error:t,event:e,originalRequest:i.clone(),request:r.clone()}),t}}async fetchAndCachePut(t){const e=await this.fetch(t),s=e.clone();return this.waitUntil(this.cachePut(t,s)),e}async cacheMatch(t){const e=q(t);let s;const{cacheName:n,matchOptions:i}=this.l,r=await this.getCacheKey(e,"read"),o=Object.assign(Object.assign({},i),{cacheName:n});s=await caches.match(r,o);for(const t of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await t({cacheName:n,matchOptions:i,cachedResponse:s,request:r,event:this.event})||void 0;return s}async cachePut(t,e){const n=q(t);var i;await(i=0,new Promise((t=>setTimeout(t,i))));const r=await this.getCacheKey(n,"write");if(!e)throw new s("cache-put-with-no-response",{url:(o=r.url,new URL(String(o),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var o;const c=await this.q(e);if(!c)return!1;const{cacheName:a,matchOptions:h}=this.l,u=await self.caches.open(a),l=this.hasCallback("cacheDidUpdate"),f=l?await async function(t,e,s,n){const i=R(e.url,s);if(e.url===i)return t.match(e,n);const r=Object.assign(Object.assign({},n),{ignoreSearch:!0}),o=await t.keys(e,r);for(const e of o)if(i===R(e.url,s))return t.match(e,n)}(u,r.clone(),["__WB_REVISION__"],h):null;try{await u.put(r,l?c.clone():c)}catch(t){if(t instanceof Error)throw"QuotaExceededError"===t.name&&await async function(){for(const t of v)await t()}(),t}for(const t of this.iterateCallbacks("cacheDidUpdate"))await t({cacheName:a,oldResponse:f,newResponse:c.clone(),request:r,event:this.event});return!0}async getCacheKey(t,e){const s=`${t.url} | ${e}`;if(!this.u[s]){let n=t;for(const t of this.iterateCallbacks("cacheKeyWillBeUsed"))n=q(await t({mode:e,request:n,event:this.event,params:this.params}));this.u[s]=n}return this.u[s]}hasCallback(t){for(const e of this.l.plugins)if(t in e)return!0;return!1}async runCallbacks(t,e){for(const s of this.iterateCallbacks(t))await s(e)}*iterateCallbacks(t){for(const e of this.l.plugins)if("function"==typeof e[t]){const s=this.v.get(e),n=n=>{const i=Object.assign(Object.assign({},n),{state:s});return e[t](i)};yield n}}waitUntil(t){return this.R.push(t),t}async doneWaiting(){let t;for(;t=this.R.shift();)await t}destroy(){this.p.resolve(null)}async q(t){let e=t,s=!1;for(const t of this.iterateCallbacks("cacheWillUpdate"))if(e=await t({request:this.request,response:e,event:this.event})||void 0,s=!0,!e)break;return s||e&&200!==e.status&&(e=void 0),e}}class L{constructor(t={}){this.cacheName=l(t.cacheName),this.plugins=t.plugins||[],this.fetchOptions=t.fetchOptions,this.matchOptions=t.matchOptions}handle(t){const[e]=this.handleAll(t);return e}handleAll(t){t instanceof FetchEvent&&(t={event:t,request:t.request});const e=t.event,s="string"==typeof t.request?new Request(t.request):t.request,n="params"in t?t.params:void 0,i=new U(this,{event:e,request:s,params:n}),r=this.U(i,s,e);return[r,this.L(r,i,s,e)]}async U(t,e,n){let i;await t.runCallbacks("handlerWillStart",{event:n,request:e});try{if(i=await this._(e,t),!i||"error"===i.type)throw new s("no-response",{url:e.url})}catch(s){if(s instanceof Error)for(const r of t.iterateCallbacks("handlerDidError"))if(i=await r({error:s,event:n,request:e}),i)break;if(!i)throw s}for(const s of t.iterateCallbacks("handlerWillRespond"))i=await s({event:n,request:e,response:i});return i}async L(t,e,s,n){let i,r;try{i=await t}catch(r){}try{await e.runCallbacks("handlerDidRespond",{event:n,request:s,response:i}),await e.doneWaiting()}catch(t){t instanceof Error&&(r=t)}if(await e.runCallbacks("handlerDidComplete",{event:n,request:s,response:i,error:r}),e.destroy(),r)throw r}}class b extends L{constructor(t={}){t.cacheName=u(t.cacheName),super(t),this.C=!1!==t.fallbackToNetwork,this.plugins.push(b.copyRedirectedCacheableResponsesPlugin)}async _(t,e){const s=await e.cacheMatch(t);return s||(e.event&&"install"===e.event.type?await this.O(t,e):await this.N(t,e))}async N(t,e){let n;const i=e.params||{};if(!this.C)throw new s("missing-precache-entry",{cacheName:this.cacheName,url:t.url});{const s=i.integrity,r=t.integrity,o=!r||r===s;n=await e.fetch(new Request(t,{integrity:"no-cors"!==t.mode?r||s:void 0})),s&&o&&"no-cors"!==t.mode&&(this.k(),await e.cachePut(t,n.clone()))}return n}async O(t,e){this.k();const n=await e.fetch(t);if(!await e.cachePut(t,n.clone()))throw new s("bad-precaching-response",{url:t.url,status:n.status});return n}k(){let t=null,e=0;for(const[s,n]of this.plugins.entries())n!==b.copyRedirectedCacheableResponsesPlugin&&(n===b.defaultPrecacheCacheabilityPlugin&&(t=s),n.cacheWillUpdate&&e++);0===e?this.plugins.push(b.defaultPrecacheCacheabilityPlugin):e>1&&null!==t&&this.plugins.splice(t,1)}}b.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:t})=>!t||t.status>=400?null:t},b.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:t})=>t.redirected?await g(t):t};class C{constructor({cacheName:t,plugins:e=[],fallbackToNetwork:s=!0}={}){this.K=new Map,this.T=new Map,this.W=new Map,this.l=new b({cacheName:u(t),plugins:[...e,new p({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this.l}precache(t){this.addToCacheList(t),this.j||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this.j=!0)}addToCacheList(t){const e=[];for(const n of t){"string"==typeof n?e.push(n):n&&void 0===n.revision&&e.push(n.url);const{cacheKey:t,url:i}=w(n),r="string"!=typeof n&&n.revision?"reload":"default";if(this.K.has(i)&&this.K.get(i)!==t)throw new s("add-to-cache-list-conflicting-entries",{firstEntry:this.K.get(i),secondEntry:t});if("string"!=typeof n&&n.integrity){if(this.W.has(t)&&this.W.get(t)!==n.integrity)throw new s("add-to-cache-list-conflicting-integrities",{url:i});this.W.set(t,n.integrity)}if(this.K.set(i,t),this.T.set(i,r),e.length>0){const t=`Workbox is precaching URLs without revision info: ${e.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(t)}}}install(t){return f(t,(async()=>{const e=new d;this.strategy.plugins.push(e);for(const[e,s]of this.K){const n=this.W.get(s),i=this.T.get(e),r=new Request(e,{integrity:n,cache:i,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:s},request:r,event:t}))}const{updatedURLs:s,notUpdatedURLs:n}=e;return{updatedURLs:s,notUpdatedURLs:n}}))}activate(t){return f(t,(async()=>{const t=await self.caches.open(this.strategy.cacheName),e=await t.keys(),s=new Set(this.K.values()),n=[];for(const i of e)s.has(i.url)||(await t.delete(i),n.push(i.url));return{deletedURLs:n}}))}getURLsToCacheKeys(){return this.K}getCachedURLs(){return[...this.K.keys()]}getCacheKeyForURL(t){const e=new URL(t,location.href);return this.K.get(e.href)}getIntegrityForCacheKey(t){return this.W.get(t)}async matchPrecache(t){const e=t instanceof Request?t.url:t,s=this.getCacheKeyForURL(e);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(t){const e=this.getCacheKeyForURL(t);if(!e)throw new s("non-precached-url",{url:t});return s=>(s.request=new Request(t),s.params=Object.assign({cacheKey:e},s.params),this.strategy.handle(s))}}let E;const O=()=>(E||(E=new C),E);class x extends i{constructor(t,e){super((({request:s})=>{const n=t.getURLsToCacheKeys();for(const i of function*(t,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:n=!0,urlManipulation:i}={}){const r=new URL(t,location.href);r.hash="",yield r.href;const o=function(t,e=[]){for(const s of[...t.searchParams.keys()])e.some((t=>t.test(s)))&&t.searchParams.delete(s);return t}(r,e);if(yield o.href,s&&o.pathname.endsWith("/")){const t=new URL(o.href);t.pathname+=s,yield t.href}if(n){const t=new URL(o.href);t.pathname+=".html",yield t.href}if(i){const t=i({url:r});for(const e of t)yield e.href}}(s.url,e)){const e=n.get(i);if(e){return{cacheKey:e,integrity:t.getIntegrityForCacheKey(e)}}}}),t.strategy)}}function N(t){const e=O();!function(t,e,n){let a;if("string"==typeof t){const s=new URL(t,location.href);a=new i((({url:t})=>t.href===s.href),e,n)}else if(t instanceof RegExp)a=new r(t,e,n);else if("function"==typeof t)a=new i(t,e,n);else{if(!(t instanceof i))throw new s("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});a=t}(c||(c=new o,c.addFetchListener(),c.addCacheListener()),c).registerRoute(a)}(new x(e,t))}t.precacheAndRoute=function(t,e){!function(t){O().precache(t)}(t),N(e)}}));-//# sourceMappingURL=workbox-acfd85e3.js.mapdiff --git a/src/main/webapp/workbox-acfd85e3.js.map b/src/main/webapp/workbox-acfd85e3.js.mapdeleted file mode 100644index d3e486f2c..000000000--- a/src/main/webapp/workbox-acfd85e3.js.map+++ /dev/null@@ -1 +0,0 @@-{"version":3,"file":"workbox-acfd85e3.js","sources":["../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-core/_version.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-core/_private/logger.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-core/models/messages/messageGenerator.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-core/_private/WorkboxError.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-routing/_version.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-routing/utils/constants.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-routing/utils/normalizeHandler.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-routing/Route.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-routing/RegExpRoute.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-routing/Router.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-routing/utils/getOrCreateDefaultRouter.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-core/_private/cacheNames.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-core/_private/waitUntil.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-precaching/_version.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-precaching/utils/createCacheKey.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-precaching/utils/PrecacheInstallReportPlugin.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-precaching/utils/PrecacheCacheKeyPlugin.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-core/_private/canConstructResponseFromBodyStream.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-core/copyResponse.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-core/_private/cacheMatchIgnoreParams.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-core/_private/Deferred.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-core/models/quotaErrorCallbacks.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-strategies/_version.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-strategies/StrategyHandler.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-core/_private/timeout.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-core/_private/getFriendlyURL.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-core/_private/executeQuotaErrorCallbacks.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-strategies/Strategy.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-precaching/PrecacheStrategy.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-precaching/PrecacheController.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-precaching/utils/getOrCreatePrecacheController.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-precaching/PrecacheRoute.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-precaching/utils/generateURLVariations.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-precaching/utils/removeIgnoredSearchParams.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-precaching/addRoute.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-routing/registerRoute.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-precaching/precacheAndRoute.js","../../../../.nvm/versions/node/v22.14.0/lib/node_modules/workbox-cli/node_modules/workbox-precaching/precache.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:core:7.2.0'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2019 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst logger = (process.env.NODE_ENV === 'production'\n ? null\n : (() => {\n // Don't overwrite this value if it's already set.\n // See https://github.com/GoogleChrome/workbox/pull/2284#issuecomment-560470923\n if (!('__WB_DISABLE_DEV_LOGS' in globalThis)) {\n self.__WB_DISABLE_DEV_LOGS = false;\n }\n let inGroup = false;\n const methodToColorMap = {\n debug: `#7f8c8d`,\n log: `#2ecc71`,\n warn: `#f39c12`,\n error: `#c0392b`,\n groupCollapsed: `#3498db`,\n groupEnd: null, // No colored prefix on groupEnd\n };\n const print = function (method, args) {\n if (self.__WB_DISABLE_DEV_LOGS) {\n return;\n }\n if (method === 'groupCollapsed') {\n // Safari doesn't print all console.groupCollapsed() arguments:\n // https://bugs.webkit.org/show_bug.cgi?id=182754\n if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {\n console[method](...args);\n return;\n }\n }\n const styles = [\n `background: ${methodToColorMap[method]}`,\n `border-radius: 0.5em`,\n `color: white`,\n `font-weight: bold`,\n `padding: 2px 0.5em`,\n ];\n // When in a group, the workbox prefix is not displayed.\n const logPrefix = inGroup ? [] : ['%cworkbox', styles.join(';')];\n console[method](...logPrefix, ...args);\n if (method === 'groupCollapsed') {\n inGroup = true;\n }\n if (method === 'groupEnd') {\n inGroup = false;\n }\n };\n // eslint-disable-next-line @typescript-eslint/ban-types\n const api = {};\n const loggerMethods = Object.keys(methodToColorMap);\n for (const key of loggerMethods) {\n const method = key;\n api[method] = (...args) => {\n print(method, args);\n };\n }\n return api;\n })());\nexport { logger };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { messages } from './messages.js';\nimport '../../_version.js';\nconst fallback = (code, ...args) => {\n let msg = code;\n if (args.length > 0) {\n msg += ` :: ${JSON.stringify(args)}`;\n }\n return msg;\n};\nconst generatorFunction = (code, details = {}) => {\n const message = messages[code];\n if (!message) {\n throw new Error(`Unable to find message for code '${code}'.`);\n }\n return message(details);\n};\nexport const messageGenerator = process.env.NODE_ENV === 'production' ? fallback : generatorFunction;\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { messageGenerator } from '../models/messages/messageGenerator.js';\nimport '../_version.js';\n/**\n * Workbox errors should be thrown with this class.\n * This allows use to ensure the type easily in tests,\n * helps developers identify errors from workbox\n * easily and allows use to optimise error\n * messages correctly.\n *\n * @private\n */\nclass WorkboxError extends Error {\n /**\n *\n * @param {string} errorCode The error code that\n * identifies this particular error.\n * @param {Object=} details Any relevant arguments\n * that will help developers identify issues should\n * be added as a key on the context object.\n */\n constructor(errorCode, details) {\n const message = messageGenerator(errorCode, details);\n super(message);\n this.name = errorCode;\n this.details = details;\n }\n}\nexport { WorkboxError };\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:routing:7.2.0'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * The default HTTP method, 'GET', used when there's no specific method\n * configured for a route.\n *\n * @type {string}\n *\n * @private\n */\nexport const defaultMethod = 'GET';\n/**\n * The list of valid HTTP methods associated with requests that could be routed.\n *\n * @type {Array<string>}\n *\n * @private\n */\nexport const validMethods = [\n 'DELETE',\n 'GET',\n 'HEAD',\n 'PATCH',\n 'POST',\n 'PUT',\n];\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport '../_version.js';\n/**\n * @param {function()|Object} handler Either a function, or an object with a\n * 'handle' method.\n * @return {Object} An object with a handle method.\n *\n * @private\n */\nexport const normalizeHandler = (handler) => {\n if (handler && typeof handler === 'object') {\n if (process.env.NODE_ENV !== 'production') {\n assert.hasMethod(handler, 'handle', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'handler',\n });\n }\n return handler;\n }\n else {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(handler, 'function', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'handler',\n });\n }\n return { handle: handler };\n }\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { defaultMethod, validMethods } from './utils/constants.js';\nimport { normalizeHandler } from './utils/normalizeHandler.js';\nimport './_version.js';\n/**\n * A `Route` consists of a pair of callback functions, \"match\" and \"handler\".\n * The \"match\" callback determine if a route should be used to \"handle\" a\n * request by returning a non-falsy value if it can. The \"handler\" callback\n * is called when there is a match and should return a Promise that resolves\n * to a `Response`.\n *\n * @memberof workbox-routing\n */\nclass Route {\n /**\n * Constructor for Route class.\n *\n * @param {workbox-routing~matchCallback} match\n * A callback function that determines whether the route matches a given\n * `fetch` event by returning a non-falsy value.\n * @param {workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resolving to a Response.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n */\n constructor(match, handler, method = defaultMethod) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(match, 'function', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'match',\n });\n if (method) {\n assert.isOneOf(method, validMethods, { paramName: 'method' });\n }\n }\n // These values are referenced directly by Router so cannot be\n // altered by minificaton.\n this.handler = normalizeHandler(handler);\n this.match = match;\n this.method = method;\n }\n /**\n *\n * @param {workbox-routing-handlerCallback} handler A callback\n * function that returns a Promise resolving to a Response\n */\n setCatchHandler(handler) {\n this.catchHandler = normalizeHandler(handler);\n }\n}\nexport { Route };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { Route } from './Route.js';\nimport './_version.js';\n/**\n * RegExpRoute makes it easy to create a regular expression based\n * {@link workbox-routing.Route}.\n *\n * For same-origin requests the RegExp only needs to match part of the URL. For\n * requests against third-party servers, you must define a RegExp that matches\n * the start of the URL.\n *\n * @memberof workbox-routing\n * @extends workbox-routing.Route\n */\nclass RegExpRoute extends Route {\n /**\n * If the regular expression contains\n * [capture groups]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#grouping-back-references},\n * the captured values will be passed to the\n * {@link workbox-routing~handlerCallback} `params`\n * argument.\n *\n * @param {RegExp} regExp The regular expression to match against URLs.\n * @param {workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n */\n constructor(regExp, handler, method) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(regExp, RegExp, {\n moduleName: 'workbox-routing',\n className: 'RegExpRoute',\n funcName: 'constructor',\n paramName: 'pattern',\n });\n }\n const match = ({ url }) => {\n const result = regExp.exec(url.href);\n // Return immediately if there's no match.\n if (!result) {\n return;\n }\n // Require that the match start at the first character in the URL string\n // if it's a cross-origin request.\n // See https://github.com/GoogleChrome/workbox/issues/281 for the context\n // behind this behavior.\n if (url.origin !== location.origin && result.index !== 0) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`The regular expression '${regExp.toString()}' only partially matched ` +\n `against the cross-origin URL '${url.toString()}'. RegExpRoute's will only ` +\n `handle cross-origin requests if they match the entire URL.`);\n }\n return;\n }\n // If the route matches, but there aren't any capture groups defined, then\n // this will return [], which is truthy and therefore sufficient to\n // indicate a match.\n // If there are capture groups, then it will return their values.\n return result.slice(1);\n };\n super(match, handler, method);\n }\n}\nexport { RegExpRoute };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { defaultMethod } from './utils/constants.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { normalizeHandler } from './utils/normalizeHandler.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport './_version.js';\n/**\n * The Router can be used to process a `FetchEvent` using one or more\n * {@link workbox-routing.Route}, responding with a `Response` if\n * a matching route exists.\n *\n * If no route matches a given a request, the Router will use a \"default\"\n * handler if one is defined.\n *\n * Should the matching Route throw an error, the Router will use a \"catch\"\n * handler if one is defined to gracefully deal with issues and respond with a\n * Request.\n *\n * If a request matches multiple routes, the **earliest** registered route will\n * be used to respond to the request.\n *\n * @memberof workbox-routing\n */\nclass Router {\n /**\n * Initializes a new Router.\n */\n constructor() {\n this._routes = new Map();\n this._defaultHandlerMap = new Map();\n }\n /**\n * @return {Map<string, Array<workbox-routing.Route>>} routes A `Map` of HTTP\n * method name ('GET', etc.) to an array of all the corresponding `Route`\n * instances that are registered.\n */\n get routes() {\n return this._routes;\n }\n /**\n * Adds a fetch event listener to respond to events when a route matches\n * the event's request.\n */\n addFetchListener() {\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('fetch', ((event) => {\n const { request } = event;\n const responsePromise = this.handleRequest({ request, event });\n if (responsePromise) {\n event.respondWith(responsePromise);\n }\n }));\n }\n /**\n * Adds a message event listener for URLs to cache from the window.\n * This is useful to cache resources loaded on the page prior to when the\n * service worker started controlling it.\n *\n * The format of the message data sent from the window should be as follows.\n * Where the `urlsToCache` array may consist of URL strings or an array of\n * URL string + `requestInit` object (the same as you'd pass to `fetch()`).\n *\n * ```\n * {\n * type: 'CACHE_URLS',\n * payload: {\n * urlsToCache: [\n * './script1.js',\n * './script2.js',\n * ['./script3.js', {mode: 'no-cors'}],\n * ],\n * },\n * }\n * ```\n */\n addCacheListener() {\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('message', ((event) => {\n // event.data is type 'any'\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (event.data && event.data.type === 'CACHE_URLS') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const { payload } = event.data;\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Caching URLs from the window`, payload.urlsToCache);\n }\n const requestPromises = Promise.all(payload.urlsToCache.map((entry) => {\n if (typeof entry === 'string') {\n entry = [entry];\n }\n const request = new Request(...entry);\n return this.handleRequest({ request, event });\n // TODO(philipwalton): TypeScript errors without this typecast for\n // some reason (probably a bug). The real type here should work but\n // doesn't: `Array<Promise<Response> | undefined>`.\n })); // TypeScript\n event.waitUntil(requestPromises);\n // If a MessageChannel was used, reply to the message on success.\n if (event.ports && event.ports[0]) {\n void requestPromises.then(() => event.ports[0].postMessage(true));\n }\n }\n }));\n }\n /**\n * Apply the routing rules to a FetchEvent object to get a Response from an\n * appropriate Route's handler.\n *\n * @param {Object} options\n * @param {Request} options.request The request to handle.\n * @param {ExtendableEvent} options.event The event that triggered the\n * request.\n * @return {Promise<Response>|undefined} A promise is returned if a\n * registered route can handle the request. If there is no matching\n * route and there's no `defaultHandler`, `undefined` is returned.\n */\n handleRequest({ request, event, }) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(request, Request, {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'handleRequest',\n paramName: 'options.request',\n });\n }\n const url = new URL(request.url, location.href);\n if (!url.protocol.startsWith('http')) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Workbox Router only supports URLs that start with 'http'.`);\n }\n return;\n }\n const sameOrigin = url.origin === location.origin;\n const { params, route } = this.findMatchingRoute({\n event,\n request,\n sameOrigin,\n url,\n });\n let handler = route && route.handler;\n const debugMessages = [];\n if (process.env.NODE_ENV !== 'production') {\n if (handler) {\n debugMessages.push([`Found a route to handle this request:`, route]);\n if (params) {\n debugMessages.push([\n `Passing the following params to the route's handler:`,\n params,\n ]);\n }\n }\n }\n // If we don't have a handler because there was no matching route, then\n // fall back to defaultHandler if that's defined.\n const method = request.method;\n if (!handler && this._defaultHandlerMap.has(method)) {\n if (process.env.NODE_ENV !== 'production') {\n debugMessages.push(`Failed to find a matching route. Falling ` +\n `back to the default handler for ${method}.`);\n }\n handler = this._defaultHandlerMap.get(method);\n }\n if (!handler) {\n if (process.env.NODE_ENV !== 'production') {\n // No handler so Workbox will do nothing. If logs is set of debug\n // i.e. verbose, we should print out this information.\n logger.debug(`No route found for: ${getFriendlyURL(url)}`);\n }\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // We have a handler, meaning Workbox is going to handle the route.\n // print the routing details to the console.\n logger.groupCollapsed(`Router is responding to: ${getFriendlyURL(url)}`);\n debugMessages.forEach((msg) => {\n if (Array.isArray(msg)) {\n logger.log(...msg);\n }\n else {\n logger.log(msg);\n }\n });\n logger.groupEnd();\n }\n // Wrap in try and catch in case the handle method throws a synchronous\n // error. It should still callback to the catch handler.\n let responsePromise;\n try {\n responsePromise = handler.handle({ url, request, event, params });\n }\n catch (err) {\n responsePromise = Promise.reject(err);\n }\n // Get route's catch handler, if it exists\n const catchHandler = route && route.catchHandler;\n if (responsePromise instanceof Promise &&\n (this._catchHandler || catchHandler)) {\n responsePromise = responsePromise.catch(async (err) => {\n // If there's a route catch handler, process that first\n if (catchHandler) {\n if (process.env.NODE_ENV !== 'production') {\n // Still include URL here as it will be async from the console group\n // and may not make sense without the URL\n logger.groupCollapsed(`Error thrown when responding to: ` +\n ` ${getFriendlyURL(url)}. Falling back to route's Catch Handler.`);\n logger.error(`Error thrown by:`, route);\n logger.error(err);\n logger.groupEnd();\n }\n try {\n return await catchHandler.handle({ url, request, event, params });\n }\n catch (catchErr) {\n if (catchErr instanceof Error) {\n err = catchErr;\n }\n }\n }\n if (this._catchHandler) {\n if (process.env.NODE_ENV !== 'production') {\n // Still include URL here as it will be async from the console group\n // and may not make sense without the URL\n logger.groupCollapsed(`Error thrown when responding to: ` +\n ` ${getFriendlyURL(url)}. Falling back to global Catch Handler.`);\n logger.error(`Error thrown by:`, route);\n logger.error(err);\n logger.groupEnd();\n }\n return this._catchHandler.handle({ url, request, event });\n }\n throw err;\n });\n }\n return responsePromise;\n }\n /**\n * Checks a request and URL (and optionally an event) against the list of\n * registered routes, and if there's a match, returns the corresponding\n * route along with any params generated by the match.\n *\n * @param {Object} options\n * @param {URL} options.url\n * @param {boolean} options.sameOrigin The result of comparing `url.origin`\n * against the current origin.\n * @param {Request} options.request The request to match.\n * @param {Event} options.event The corresponding event.\n * @return {Object} An object with `route` and `params` properties.\n * They are populated if a matching route was found or `undefined`\n * otherwise.\n */\n findMatchingRoute({ url, sameOrigin, request, event, }) {\n const routes = this._routes.get(request.method) || [];\n for (const route of routes) {\n let params;\n // route.match returns type any, not possible to change right now.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const matchResult = route.match({ url, sameOrigin, request, event });\n if (matchResult) {\n if (process.env.NODE_ENV !== 'production') {\n // Warn developers that using an async matchCallback is almost always\n // not the right thing to do.\n if (matchResult instanceof Promise) {\n logger.warn(`While routing ${getFriendlyURL(url)}, an async ` +\n `matchCallback function was used. Please convert the ` +\n `following route to use a synchronous matchCallback function:`, route);\n }\n }\n // See https://github.com/GoogleChrome/workbox/issues/2079\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n params = matchResult;\n if (Array.isArray(params) && params.length === 0) {\n // Instead of passing an empty array in as params, use undefined.\n params = undefined;\n }\n else if (matchResult.constructor === Object && // eslint-disable-line\n Object.keys(matchResult).length === 0) {\n // Instead of passing an empty object in as params, use undefined.\n params = undefined;\n }\n else if (typeof matchResult === 'boolean') {\n // For the boolean value true (rather than just something truth-y),\n // don't set params.\n // See https://github.com/GoogleChrome/workbox/pull/2134#issuecomment-513924353\n params = undefined;\n }\n // Return early if have a match.\n return { route, params };\n }\n }\n // If no match was found above, return and empty object.\n return {};\n }\n /**\n * Define a default `handler` that's called when no routes explicitly\n * match the incoming request.\n *\n * Each HTTP method ('GET', 'POST', etc.) gets its own default handler.\n *\n * Without a default handler, unmatched requests will go against the\n * network as if there were no service worker present.\n *\n * @param {workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n * @param {string} [method='GET'] The HTTP method to associate with this\n * default handler. Each method has its own default.\n */\n setDefaultHandler(handler, method = defaultMethod) {\n this._defaultHandlerMap.set(method, normalizeHandler(handler));\n }\n /**\n * If a Route throws an error while handling a request, this `handler`\n * will be called and given a chance to provide a response.\n *\n * @param {workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n */\n setCatchHandler(handler) {\n this._catchHandler = normalizeHandler(handler);\n }\n /**\n * Registers a route with the router.\n *\n * @param {workbox-routing.Route} route The route to register.\n */\n registerRoute(route) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(route, 'object', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.hasMethod(route, 'match', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.isType(route.handler, 'object', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.hasMethod(route.handler, 'handle', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route.handler',\n });\n assert.isType(route.method, 'string', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route.method',\n });\n }\n if (!this._routes.has(route.method)) {\n this._routes.set(route.method, []);\n }\n // Give precedence to all of the earlier routes by adding this additional\n // route to the end of the array.\n this._routes.get(route.method).push(route);\n }\n /**\n * Unregisters a route with the router.\n *\n * @param {workbox-routing.Route} route The route to unregister.\n */\n unregisterRoute(route) {\n if (!this._routes.has(route.method)) {\n throw new WorkboxError('unregister-route-but-not-found-with-method', {\n method: route.method,\n });\n }\n const routeIndex = this._routes.get(route.method).indexOf(route);\n if (routeIndex > -1) {\n this._routes.get(route.method).splice(routeIndex, 1);\n }\n else {\n throw new WorkboxError('unregister-route-route-not-registered');\n }\n }\n}\nexport { Router };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { Router } from '../Router.js';\nimport '../_version.js';\nlet defaultRouter;\n/**\n * Creates a new, singleton Router instance if one does not exist. If one\n * does already exist, that instance is returned.\n *\n * @private\n * @return {Router}\n */\nexport const getOrCreateDefaultRouter = () => {\n if (!defaultRouter) {\n defaultRouter = new Router();\n // The helpers that use the default Router assume these listeners exist.\n defaultRouter.addFetchListener();\n defaultRouter.addCacheListener();\n }\n return defaultRouter;\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst _cacheNameDetails = {\n googleAnalytics: 'googleAnalytics',\n precache: 'precache-v2',\n prefix: 'workbox',\n runtime: 'runtime',\n suffix: typeof registration !== 'undefined' ? registration.scope : '',\n};\nconst _createCacheName = (cacheName) => {\n return [_cacheNameDetails.prefix, cacheName, _cacheNameDetails.suffix]\n .filter((value) => value && value.length > 0)\n .join('-');\n};\nconst eachCacheNameDetail = (fn) => {\n for (const key of Object.keys(_cacheNameDetails)) {\n fn(key);\n }\n};\nexport const cacheNames = {\n updateDetails: (details) => {\n eachCacheNameDetail((key) => {\n if (typeof details[key] === 'string') {\n _cacheNameDetails[key] = details[key];\n }\n });\n },\n getGoogleAnalyticsName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.googleAnalytics);\n },\n getPrecacheName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.precache);\n },\n getPrefix: () => {\n return _cacheNameDetails.prefix;\n },\n getRuntimeName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.runtime);\n },\n getSuffix: () => {\n return _cacheNameDetails.suffix;\n },\n};\n","/*\n Copyright 2020 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A utility method that makes it easier to use `event.waitUntil` with\n * async functions and return the result.\n *\n * @param {ExtendableEvent} event\n * @param {Function} asyncFn\n * @return {Function}\n * @private\n */\nfunction waitUntil(event, asyncFn) {\n const returnPromise = asyncFn();\n event.waitUntil(returnPromise);\n return returnPromise;\n}\nexport { waitUntil };\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:precaching:7.2.0'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport '../_version.js';\n// Name of the search parameter used to store revision info.\nconst REVISION_SEARCH_PARAM = '__WB_REVISION__';\n/**\n * Converts a manifest entry into a versioned URL suitable for precaching.\n *\n * @param {Object|string} entry\n * @return {string} A URL with versioning info.\n *\n * @private\n * @memberof workbox-precaching\n */\nexport function createCacheKey(entry) {\n if (!entry) {\n throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });\n }\n // If a precache manifest entry is a string, it's assumed to be a versioned\n // URL, like '/app.abcd1234.js'. Return as-is.\n if (typeof entry === 'string') {\n const urlObject = new URL(entry, location.href);\n return {\n cacheKey: urlObject.href,\n url: urlObject.href,\n };\n }\n const { revision, url } = entry;\n if (!url) {\n throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });\n }\n // If there's just a URL and no revision, then it's also assumed to be a\n // versioned URL.\n if (!revision) {\n const urlObject = new URL(url, location.href);\n return {\n cacheKey: urlObject.href,\n url: urlObject.href,\n };\n }\n // Otherwise, construct a properly versioned URL using the custom Workbox\n // search parameter along with the revision info.\n const cacheKeyURL = new URL(url, location.href);\n const originalURL = new URL(url, location.href);\n cacheKeyURL.searchParams.set(REVISION_SEARCH_PARAM, revision);\n return {\n cacheKey: cacheKeyURL.href,\n url: originalURL.href,\n };\n}\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A plugin, designed to be used with PrecacheController, to determine the\n * of assets that were updated (or not updated) during the install event.\n *\n * @private\n */\nclass PrecacheInstallReportPlugin {\n constructor() {\n this.updatedURLs = [];\n this.notUpdatedURLs = [];\n this.handlerWillStart = async ({ request, state, }) => {\n // TODO: `state` should never be undefined...\n if (state) {\n state.originalRequest = request;\n }\n };\n this.cachedResponseWillBeUsed = async ({ event, state, cachedResponse, }) => {\n if (event.type === 'install') {\n if (state &&\n state.originalRequest &&\n state.originalRequest instanceof Request) {\n // TODO: `state` should never be undefined...\n const url = state.originalRequest.url;\n if (cachedResponse) {\n this.notUpdatedURLs.push(url);\n }\n else {\n this.updatedURLs.push(url);\n }\n }\n }\n return cachedResponse;\n };\n }\n}\nexport { PrecacheInstallReportPlugin };\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A plugin, designed to be used with PrecacheController, to translate URLs into\n * the corresponding cache key, based on the current revision info.\n *\n * @private\n */\nclass PrecacheCacheKeyPlugin {\n constructor({ precacheController }) {\n this.cacheKeyWillBeUsed = async ({ request, params, }) => {\n // Params is type any, can't change right now.\n /* eslint-disable */\n const cacheKey = (params === null || params === void 0 ? void 0 : params.cacheKey) ||\n this._precacheController.getCacheKeyForURL(request.url);\n /* eslint-enable */\n return cacheKey\n ? new Request(cacheKey, { headers: request.headers })\n : request;\n };\n this._precacheController = precacheController;\n }\n}\nexport { PrecacheCacheKeyPlugin };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nlet supportStatus;\n/**\n * A utility function that determines whether the current browser supports\n * constructing a new `Response` from a `response.body` stream.\n *\n * @return {boolean} `true`, if the current browser can successfully\n * construct a `Response` from a `response.body` stream, `false` otherwise.\n *\n * @private\n */\nfunction canConstructResponseFromBodyStream() {\n if (supportStatus === undefined) {\n const testResponse = new Response('');\n if ('body' in testResponse) {\n try {\n new Response(testResponse.body);\n supportStatus = true;\n }\n catch (error) {\n supportStatus = false;\n }\n }\n supportStatus = false;\n }\n return supportStatus;\n}\nexport { canConstructResponseFromBodyStream };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { canConstructResponseFromBodyStream } from './_private/canConstructResponseFromBodyStream.js';\nimport { WorkboxError } from './_private/WorkboxError.js';\nimport './_version.js';\n/**\n * Allows developers to copy a response and modify its `headers`, `status`,\n * or `statusText` values (the values settable via a\n * [`ResponseInit`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#Syntax}\n * object in the constructor).\n * To modify these values, pass a function as the second argument. That\n * function will be invoked with a single object with the response properties\n * `{headers, status, statusText}`. The return value of this function will\n * be used as the `ResponseInit` for the new `Response`. To change the values\n * either modify the passed parameter(s) and return it, or return a totally\n * new object.\n *\n * This method is intentionally limited to same-origin responses, regardless of\n * whether CORS was used or not.\n *\n * @param {Response} response\n * @param {Function} modifier\n * @memberof workbox-core\n */\nasync function copyResponse(response, modifier) {\n let origin = null;\n // If response.url isn't set, assume it's cross-origin and keep origin null.\n if (response.url) {\n const responseURL = new URL(response.url);\n origin = responseURL.origin;\n }\n if (origin !== self.location.origin) {\n throw new WorkboxError('cross-origin-copy-response', { origin });\n }\n const clonedResponse = response.clone();\n // Create a fresh `ResponseInit` object by cloning the headers.\n const responseInit = {\n headers: new Headers(clonedResponse.headers),\n status: clonedResponse.status,\n statusText: clonedResponse.statusText,\n };\n // Apply any user modifications.\n const modifiedResponseInit = modifier ? modifier(responseInit) : responseInit;\n // Create the new response from the body stream and `ResponseInit`\n // modifications. Note: not all browsers support the Response.body stream,\n // so fall back to reading the entire body into memory as a blob.\n const body = canConstructResponseFromBodyStream()\n ? clonedResponse.body\n : await clonedResponse.blob();\n return new Response(body, modifiedResponseInit);\n}\nexport { copyResponse };\n","/*\n Copyright 2020 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nfunction stripParams(fullURL, ignoreParams) {\n const strippedURL = new URL(fullURL);\n for (const param of ignoreParams) {\n strippedURL.searchParams.delete(param);\n }\n return strippedURL.href;\n}\n/**\n * Matches an item in the cache, ignoring specific URL params. This is similar\n * to the `ignoreSearch` option, but it allows you to ignore just specific\n * params (while continuing to match on the others).\n *\n * @private\n * @param {Cache} cache\n * @param {Request} request\n * @param {Object} matchOptions\n * @param {Array<string>} ignoreParams\n * @return {Promise<Response|undefined>}\n */\nasync function cacheMatchIgnoreParams(cache, request, ignoreParams, matchOptions) {\n const strippedRequestURL = stripParams(request.url, ignoreParams);\n // If the request doesn't include any ignored params, match as normal.\n if (request.url === strippedRequestURL) {\n return cache.match(request, matchOptions);\n }\n // Otherwise, match by comparing keys\n const keysOptions = Object.assign(Object.assign({}, matchOptions), { ignoreSearch: true });\n const cacheKeys = await cache.keys(request, keysOptions);\n for (const cacheKey of cacheKeys) {\n const strippedCacheKeyURL = stripParams(cacheKey.url, ignoreParams);\n if (strippedRequestURL === strippedCacheKeyURL) {\n return cache.match(cacheKey, matchOptions);\n }\n }\n return;\n}\nexport { cacheMatchIgnoreParams };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * The Deferred class composes Promises in a way that allows for them to be\n * resolved or rejected from outside the constructor. In most cases promises\n * should be used directly, but Deferreds can be necessary when the logic to\n * resolve a promise must be separate.\n *\n * @private\n */\nclass Deferred {\n /**\n * Creates a promise and exposes its resolve and reject functions as methods.\n */\n constructor() {\n this.promise = new Promise((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n });\n }\n}\nexport { Deferred };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n// Callbacks to be executed whenever there's a quota error.\n// Can't change Function type right now.\n// eslint-disable-next-line @typescript-eslint/ban-types\nconst quotaErrorCallbacks = new Set();\nexport { quotaErrorCallbacks };\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:strategies:7.2.0'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheMatchIgnoreParams } from 'workbox-core/_private/cacheMatchIgnoreParams.js';\nimport { Deferred } from 'workbox-core/_private/Deferred.js';\nimport { executeQuotaErrorCallbacks } from 'workbox-core/_private/executeQuotaErrorCallbacks.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { timeout } from 'workbox-core/_private/timeout.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport './_version.js';\nfunction toRequest(input) {\n return typeof input === 'string' ? new Request(input) : input;\n}\n/**\n * A class created every time a Strategy instance instance calls\n * {@link workbox-strategies.Strategy~handle} or\n * {@link workbox-strategies.Strategy~handleAll} that wraps all fetch and\n * cache actions around plugin callbacks and keeps track of when the strategy\n * is \"done\" (i.e. all added `event.waitUntil()` promises have resolved).\n *\n * @memberof workbox-strategies\n */\nclass StrategyHandler {\n /**\n * Creates a new instance associated with the passed strategy and event\n * that's handling the request.\n *\n * The constructor also initializes the state that will be passed to each of\n * the plugins handling this request.\n *\n * @param {workbox-strategies.Strategy} strategy\n * @param {Object} options\n * @param {Request|string} options.request A request to run this strategy for.\n * @param {ExtendableEvent} options.event The event associated with the\n * request.\n * @param {URL} [options.url]\n * @param {*} [options.params] The return value from the\n * {@link workbox-routing~matchCallback} (if applicable).\n */\n constructor(strategy, options) {\n this._cacheKeys = {};\n /**\n * The request the strategy is performing (passed to the strategy's\n * `handle()` or `handleAll()` method).\n * @name request\n * @instance\n * @type {Request}\n * @memberof workbox-strategies.StrategyHandler\n */\n /**\n * The event associated with this request.\n * @name event\n * @instance\n * @type {ExtendableEvent}\n * @memberof workbox-strategies.StrategyHandler\n */\n /**\n * A `URL` instance of `request.url` (if passed to the strategy's\n * `handle()` or `handleAll()` method).\n * Note: the `url` param will be present if the strategy was invoked\n * from a workbox `Route` object.\n * @name url\n * @instance\n * @type {URL|undefined}\n * @memberof workbox-strategies.StrategyHandler\n */\n /**\n * A `param` value (if passed to the strategy's\n * `handle()` or `handleAll()` method).\n * Note: the `param` param will be present if the strategy was invoked\n * from a workbox `Route` object and the\n * {@link workbox-routing~matchCallback} returned\n * a truthy value (it will be that value).\n * @name params\n * @instance\n * @type {*|undefined}\n * @memberof workbox-strategies.StrategyHandler\n */\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(options.event, ExtendableEvent, {\n moduleName: 'workbox-strategies',\n className: 'StrategyHandler',\n funcName: 'constructor',\n paramName: 'options.event',\n });\n }\n Object.assign(this, options);\n this.event = options.event;\n this._strategy = strategy;\n this._handlerDeferred = new Deferred();\n this._extendLifetimePromises = [];\n // Copy the plugins list (since it's mutable on the strategy),\n // so any mutations don't affect this handler instance.\n this._plugins = [...strategy.plugins];\n this._pluginStateMap = new Map();\n for (const plugin of this._plugins) {\n this._pluginStateMap.set(plugin, {});\n }\n this.event.waitUntil(this._handlerDeferred.promise);\n }\n /**\n * Fetches a given request (and invokes any applicable plugin callback\n * methods) using the `fetchOptions` (for non-navigation requests) and\n * `plugins` defined on the `Strategy` object.\n *\n * The following plugin lifecycle methods are invoked when using this method:\n * - `requestWillFetch()`\n * - `fetchDidSucceed()`\n * - `fetchDidFail()`\n *\n * @param {Request|string} input The URL or request to fetch.\n * @return {Promise<Response>}\n */\n async fetch(input) {\n const { event } = this;\n let request = toRequest(input);\n if (request.mode === 'navigate' &&\n event instanceof FetchEvent &&\n event.preloadResponse) {\n const possiblePreloadResponse = (await event.preloadResponse);\n if (possiblePreloadResponse) {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Using a preloaded navigation response for ` +\n `'${getFriendlyURL(request.url)}'`);\n }\n return possiblePreloadResponse;\n }\n }\n // If there is a fetchDidFail plugin, we need to save a clone of the\n // original request before it's either modified by a requestWillFetch\n // plugin or before the original request's body is consumed via fetch().\n const originalRequest = this.hasCallback('fetchDidFail')\n ? request.clone()\n : null;\n try {\n for (const cb of this.iterateCallbacks('requestWillFetch')) {\n request = await cb({ request: request.clone(), event });\n }\n }\n catch (err) {\n if (err instanceof Error) {\n throw new WorkboxError('plugin-error-request-will-fetch', {\n thrownErrorMessage: err.message,\n });\n }\n }\n // The request can be altered by plugins with `requestWillFetch` making\n // the original request (most likely from a `fetch` event) different\n // from the Request we make. Pass both to `fetchDidFail` to aid debugging.\n const pluginFilteredRequest = request.clone();\n try {\n let fetchResponse;\n // See https://github.com/GoogleChrome/workbox/issues/1796\n fetchResponse = await fetch(request, request.mode === 'navigate' ? undefined : this._strategy.fetchOptions);\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Network request for ` +\n `'${getFriendlyURL(request.url)}' returned a response with ` +\n `status '${fetchResponse.status}'.`);\n }\n for (const callback of this.iterateCallbacks('fetchDidSucceed')) {\n fetchResponse = await callback({\n event,\n request: pluginFilteredRequest,\n response: fetchResponse,\n });\n }\n return fetchResponse;\n }\n catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Network request for ` +\n `'${getFriendlyURL(request.url)}' threw an error.`, error);\n }\n // `originalRequest` will only exist if a `fetchDidFail` callback\n // is being used (see above).\n if (originalRequest) {\n await this.runCallbacks('fetchDidFail', {\n error: error,\n event,\n originalRequest: originalRequest.clone(),\n request: pluginFilteredRequest.clone(),\n });\n }\n throw error;\n }\n }\n /**\n * Calls `this.fetch()` and (in the background) runs `this.cachePut()` on\n * the response generated by `this.fetch()`.\n *\n * The call to `this.cachePut()` automatically invokes `this.waitUntil()`,\n * so you do not have to manually call `waitUntil()` on the event.\n *\n * @param {Request|string} input The request or URL to fetch and cache.\n * @return {Promise<Response>}\n */\n async fetchAndCachePut(input) {\n const response = await this.fetch(input);\n const responseClone = response.clone();\n void this.waitUntil(this.cachePut(input, responseClone));\n return response;\n }\n /**\n * Matches a request from the cache (and invokes any applicable plugin\n * callback methods) using the `cacheName`, `matchOptions`, and `plugins`\n * defined on the strategy object.\n *\n * The following plugin lifecycle methods are invoked when using this method:\n * - cacheKeyWillBeUsed()\n * - cachedResponseWillBeUsed()\n *\n * @param {Request|string} key The Request or URL to use as the cache key.\n * @return {Promise<Response|undefined>} A matching response, if found.\n */\n async cacheMatch(key) {\n const request = toRequest(key);\n let cachedResponse;\n const { cacheName, matchOptions } = this._strategy;\n const effectiveRequest = await this.getCacheKey(request, 'read');\n const multiMatchOptions = Object.assign(Object.assign({}, matchOptions), { cacheName });\n cachedResponse = await caches.match(effectiveRequest, multiMatchOptions);\n if (process.env.NODE_ENV !== 'production') {\n if (cachedResponse) {\n logger.debug(`Found a cached response in '${cacheName}'.`);\n }\n else {\n logger.debug(`No cached response found in '${cacheName}'.`);\n }\n }\n for (const callback of this.iterateCallbacks('cachedResponseWillBeUsed')) {\n cachedResponse =\n (await callback({\n cacheName,\n matchOptions,\n cachedResponse,\n request: effectiveRequest,\n event: this.event,\n })) || undefined;\n }\n return cachedResponse;\n }\n /**\n * Puts a request/response pair in the cache (and invokes any applicable\n * plugin callback methods) using the `cacheName` and `plugins` defined on\n * the strategy object.\n *\n * The following plugin lifecycle methods are invoked when using this method:\n * - cacheKeyWillBeUsed()\n * - cacheWillUpdate()\n * - cacheDidUpdate()\n *\n * @param {Request|string} key The request or URL to use as the cache key.\n * @param {Response} response The response to cache.\n * @return {Promise<boolean>} `false` if a cacheWillUpdate caused the response\n * not be cached, and `true` otherwise.\n */\n async cachePut(key, response) {\n const request = toRequest(key);\n // Run in the next task to avoid blocking other cache reads.\n // https://github.com/w3c/ServiceWorker/issues/1397\n await timeout(0);\n const effectiveRequest = await this.getCacheKey(request, 'write');\n if (process.env.NODE_ENV !== 'production') {\n if (effectiveRequest.method && effectiveRequest.method !== 'GET') {\n throw new WorkboxError('attempt-to-cache-non-get-request', {\n url: getFriendlyURL(effectiveRequest.url),\n method: effectiveRequest.method,\n });\n }\n // See https://github.com/GoogleChrome/workbox/issues/2818\n const vary = response.headers.get('Vary');\n if (vary) {\n logger.debug(`The response for ${getFriendlyURL(effectiveRequest.url)} ` +\n `has a 'Vary: ${vary}' header. ` +\n `Consider setting the {ignoreVary: true} option on your strategy ` +\n `to ensure cache matching and deletion works as expected.`);\n }\n }\n if (!response) {\n if (process.env.NODE_ENV !== 'production') {\n logger.error(`Cannot cache non-existent response for ` +\n `'${getFriendlyURL(effectiveRequest.url)}'.`);\n }\n throw new WorkboxError('cache-put-with-no-response', {\n url: getFriendlyURL(effectiveRequest.url),\n });\n }\n const responseToCache = await this._ensureResponseSafeToCache(response);\n if (!responseToCache) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Response '${getFriendlyURL(effectiveRequest.url)}' ` +\n `will not be cached.`, responseToCache);\n }\n return false;\n }\n const { cacheName, matchOptions } = this._strategy;\n const cache = await self.caches.open(cacheName);\n const hasCacheUpdateCallback = this.hasCallback('cacheDidUpdate');\n const oldResponse = hasCacheUpdateCallback\n ? await cacheMatchIgnoreParams(\n // TODO(philipwalton): the `__WB_REVISION__` param is a precaching\n // feature. Consider into ways to only add this behavior if using\n // precaching.\n cache, effectiveRequest.clone(), ['__WB_REVISION__'], matchOptions)\n : null;\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Updating the '${cacheName}' cache with a new Response ` +\n `for ${getFriendlyURL(effectiveRequest.url)}.`);\n }\n try {\n await cache.put(effectiveRequest, hasCacheUpdateCallback ? responseToCache.clone() : responseToCache);\n }\n catch (error) {\n if (error instanceof Error) {\n // See https://developer.mozilla.org/en-US/docs/Web/API/DOMException#exception-QuotaExceededError\n if (error.name === 'QuotaExceededError') {\n await executeQuotaErrorCallbacks();\n }\n throw error;\n }\n }\n for (const callback of this.iterateCallbacks('cacheDidUpdate')) {\n await callback({\n cacheName,\n oldResponse,\n newResponse: responseToCache.clone(),\n request: effectiveRequest,\n event: this.event,\n });\n }\n return true;\n }\n /**\n * Checks the list of plugins for the `cacheKeyWillBeUsed` callback, and\n * executes any of those callbacks found in sequence. The final `Request`\n * object returned by the last plugin is treated as the cache key for cache\n * reads and/or writes. If no `cacheKeyWillBeUsed` plugin callbacks have\n * been registered, the passed request is returned unmodified\n *\n * @param {Request} request\n * @param {string} mode\n * @return {Promise<Request>}\n */\n async getCacheKey(request, mode) {\n const key = `${request.url} | ${mode}`;\n if (!this._cacheKeys[key]) {\n let effectiveRequest = request;\n for (const callback of this.iterateCallbacks('cacheKeyWillBeUsed')) {\n effectiveRequest = toRequest(await callback({\n mode,\n request: effectiveRequest,\n event: this.event,\n // params has a type any can't change right now.\n params: this.params, // eslint-disable-line\n }));\n }\n this._cacheKeys[key] = effectiveRequest;\n }\n return this._cacheKeys[key];\n }\n /**\n * Returns true if the strategy has at least one plugin with the given\n * callback.\n *\n * @param {string} name The name of the callback to check for.\n * @return {boolean}\n */\n hasCallback(name) {\n for (const plugin of this._strategy.plugins) {\n if (name in plugin) {\n return true;\n }\n }\n return false;\n }\n /**\n * Runs all plugin callbacks matching the given name, in order, passing the\n * given param object (merged ith the current plugin state) as the only\n * argument.\n *\n * Note: since this method runs all plugins, it's not suitable for cases\n * where the return value of a callback needs to be applied prior to calling\n * the next callback. See\n * {@link workbox-strategies.StrategyHandler#iterateCallbacks}\n * below for how to handle that case.\n *\n * @param {string} name The name of the callback to run within each plugin.\n * @param {Object} param The object to pass as the first (and only) param\n * when executing each callback. This object will be merged with the\n * current plugin state prior to callback execution.\n */\n async runCallbacks(name, param) {\n for (const callback of this.iterateCallbacks(name)) {\n // TODO(philipwalton): not sure why `any` is needed. It seems like\n // this should work with `as WorkboxPluginCallbackParam[C]`.\n await callback(param);\n }\n }\n /**\n * Accepts a callback and returns an iterable of matching plugin callbacks,\n * where each callback is wrapped with the current handler state (i.e. when\n * you call each callback, whatever object parameter you pass it will\n * be merged with the plugin's current state).\n *\n * @param {string} name The name fo the callback to run\n * @return {Array<Function>}\n */\n *iterateCallbacks(name) {\n for (const plugin of this._strategy.plugins) {\n if (typeof plugin[name] === 'function') {\n const state = this._pluginStateMap.get(plugin);\n const statefulCallback = (param) => {\n const statefulParam = Object.assign(Object.assign({}, param), { state });\n // TODO(philipwalton): not sure why `any` is needed. It seems like\n // this should work with `as WorkboxPluginCallbackParam[C]`.\n return plugin[name](statefulParam);\n };\n yield statefulCallback;\n }\n }\n }\n /**\n * Adds a promise to the\n * [extend lifetime promises]{@link https://w3c.github.io/ServiceWorker/#extendableevent-extend-lifetime-promises}\n * of the event event associated with the request being handled (usually a\n * `FetchEvent`).\n *\n * Note: you can await\n * {@link workbox-strategies.StrategyHandler~doneWaiting}\n * to know when all added promises have settled.\n *\n * @param {Promise} promise A promise to add to the extend lifetime promises\n * of the event that triggered the request.\n */\n waitUntil(promise) {\n this._extendLifetimePromises.push(promise);\n return promise;\n }\n /**\n * Returns a promise that resolves once all promises passed to\n * {@link workbox-strategies.StrategyHandler~waitUntil}\n * have settled.\n *\n * Note: any work done after `doneWaiting()` settles should be manually\n * passed to an event's `waitUntil()` method (not this handler's\n * `waitUntil()` method), otherwise the service worker thread my be killed\n * prior to your work completing.\n */\n async doneWaiting() {\n let promise;\n while ((promise = this._extendLifetimePromises.shift())) {\n await promise;\n }\n }\n /**\n * Stops running the strategy and immediately resolves any pending\n * `waitUntil()` promises.\n */\n destroy() {\n this._handlerDeferred.resolve(null);\n }\n /**\n * This method will call cacheWillUpdate on the available plugins (or use\n * status === 200) to determine if the Response is safe and valid to cache.\n *\n * @param {Request} options.request\n * @param {Response} options.response\n * @return {Promise<Response|undefined>}\n *\n * @private\n */\n async _ensureResponseSafeToCache(response) {\n let responseToCache = response;\n let pluginsUsed = false;\n for (const callback of this.iterateCallbacks('cacheWillUpdate')) {\n responseToCache =\n (await callback({\n request: this.request,\n response: responseToCache,\n event: this.event,\n })) || undefined;\n pluginsUsed = true;\n if (!responseToCache) {\n break;\n }\n }\n if (!pluginsUsed) {\n if (responseToCache && responseToCache.status !== 200) {\n responseToCache = undefined;\n }\n if (process.env.NODE_ENV !== 'production') {\n if (responseToCache) {\n if (responseToCache.status !== 200) {\n if (responseToCache.status === 0) {\n logger.warn(`The response for '${this.request.url}' ` +\n `is an opaque response. The caching strategy that you're ` +\n `using will not cache opaque responses by default.`);\n }\n else {\n logger.debug(`The response for '${this.request.url}' ` +\n `returned a status code of '${response.status}' and won't ` +\n `be cached as a result.`);\n }\n }\n }\n }\n }\n return responseToCache;\n }\n}\nexport { StrategyHandler };\n","/*\n Copyright 2019 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * Returns a promise that resolves and the passed number of milliseconds.\n * This utility is an async/await-friendly version of `setTimeout`.\n *\n * @param {number} ms\n * @return {Promise}\n * @private\n */\nexport function timeout(ms) {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst getFriendlyURL = (url) => {\n const urlObj = new URL(String(url), location.href);\n // See https://github.com/GoogleChrome/workbox/issues/2323\n // We want to include everything, except for the origin if it's same-origin.\n return urlObj.href.replace(new RegExp(`^${location.origin}`), '');\n};\nexport { getFriendlyURL };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from '../_private/logger.js';\nimport { quotaErrorCallbacks } from '../models/quotaErrorCallbacks.js';\nimport '../_version.js';\n/**\n * Runs all of the callback functions, one at a time sequentially, in the order\n * in which they were registered.\n *\n * @memberof workbox-core\n * @private\n */\nasync function executeQuotaErrorCallbacks() {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`About to run ${quotaErrorCallbacks.size} ` +\n `callbacks to clean up caches.`);\n }\n for (const callback of quotaErrorCallbacks) {\n await callback();\n if (process.env.NODE_ENV !== 'production') {\n logger.log(callback, 'is complete.');\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.log('Finished running callbacks.');\n }\n}\nexport { executeQuotaErrorCallbacks };\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { StrategyHandler } from './StrategyHandler.js';\nimport './_version.js';\n/**\n * An abstract base class that all other strategy classes must extend from:\n *\n * @memberof workbox-strategies\n */\nclass Strategy {\n /**\n * Creates a new instance of the strategy and sets all documented option\n * properties as public instance properties.\n *\n * Note: if a custom strategy class extends the base Strategy class and does\n * not need more than these properties, it does not need to define its own\n * constructor.\n *\n * @param {Object} [options]\n * @param {string} [options.cacheName] Cache name to store and retrieve\n * requests. Defaults to the cache names provided by\n * {@link workbox-core.cacheNames}.\n * @param {Array<Object>} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} [options.fetchOptions] Values passed along to the\n * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)\n * `fetch()` requests made by this strategy.\n * @param {Object} [options.matchOptions] The\n * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}\n * for any `cache.match()` or `cache.put()` calls made by this strategy.\n */\n constructor(options = {}) {\n /**\n * Cache name to store and retrieve\n * requests. Defaults to the cache names provided by\n * {@link workbox-core.cacheNames}.\n *\n * @type {string}\n */\n this.cacheName = cacheNames.getRuntimeName(options.cacheName);\n /**\n * The list\n * [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * used by this strategy.\n *\n * @type {Array<Object>}\n */\n this.plugins = options.plugins || [];\n /**\n * Values passed along to the\n * [`init`]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters}\n * of all fetch() requests made by this strategy.\n *\n * @type {Object}\n */\n this.fetchOptions = options.fetchOptions;\n /**\n * The\n * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}\n * for any `cache.match()` or `cache.put()` calls made by this strategy.\n *\n * @type {Object}\n */\n this.matchOptions = options.matchOptions;\n }\n /**\n * Perform a request strategy and returns a `Promise` that will resolve with\n * a `Response`, invoking all relevant plugin callbacks.\n *\n * When a strategy instance is registered with a Workbox\n * {@link workbox-routing.Route}, this method is automatically\n * called when the route matches.\n *\n * Alternatively, this method can be used in a standalone `FetchEvent`\n * listener by passing it to `event.respondWith()`.\n *\n * @param {FetchEvent|Object} options A `FetchEvent` or an object with the\n * properties listed below.\n * @param {Request|string} options.request A request to run this strategy for.\n * @param {ExtendableEvent} options.event The event associated with the\n * request.\n * @param {URL} [options.url]\n * @param {*} [options.params]\n */\n handle(options) {\n const [responseDone] = this.handleAll(options);\n return responseDone;\n }\n /**\n * Similar to {@link workbox-strategies.Strategy~handle}, but\n * instead of just returning a `Promise` that resolves to a `Response` it\n * it will return an tuple of `[response, done]` promises, where the former\n * (`response`) is equivalent to what `handle()` returns, and the latter is a\n * Promise that will resolve once any promises that were added to\n * `event.waitUntil()` as part of performing the strategy have completed.\n *\n * You can await the `done` promise to ensure any extra work performed by\n * the strategy (usually caching responses) completes successfully.\n *\n * @param {FetchEvent|Object} options A `FetchEvent` or an object with the\n * properties listed below.\n * @param {Request|string} options.request A request to run this strategy for.\n * @param {ExtendableEvent} options.event The event associated with the\n * request.\n * @param {URL} [options.url]\n * @param {*} [options.params]\n * @return {Array<Promise>} A tuple of [response, done]\n * promises that can be used to determine when the response resolves as\n * well as when the handler has completed all its work.\n */\n handleAll(options) {\n // Allow for flexible options to be passed.\n if (options instanceof FetchEvent) {\n options = {\n event: options,\n request: options.request,\n };\n }\n const event = options.event;\n const request = typeof options.request === 'string'\n ? new Request(options.request)\n : options.request;\n const params = 'params' in options ? options.params : undefined;\n const handler = new StrategyHandler(this, { event, request, params });\n const responseDone = this._getResponse(handler, request, event);\n const handlerDone = this._awaitComplete(responseDone, handler, request, event);\n // Return an array of promises, suitable for use with Promise.all().\n return [responseDone, handlerDone];\n }\n async _getResponse(handler, request, event) {\n await handler.runCallbacks('handlerWillStart', { event, request });\n let response = undefined;\n try {\n response = await this._handle(request, handler);\n // The \"official\" Strategy subclasses all throw this error automatically,\n // but in case a third-party Strategy doesn't, ensure that we have a\n // consistent failure when there's no response or an error response.\n if (!response || response.type === 'error') {\n throw new WorkboxError('no-response', { url: request.url });\n }\n }\n catch (error) {\n if (error instanceof Error) {\n for (const callback of handler.iterateCallbacks('handlerDidError')) {\n response = await callback({ error, event, request });\n if (response) {\n break;\n }\n }\n }\n if (!response) {\n throw error;\n }\n else if (process.env.NODE_ENV !== 'production') {\n logger.log(`While responding to '${getFriendlyURL(request.url)}', ` +\n `an ${error instanceof Error ? error.toString() : ''} error occurred. Using a fallback response provided by ` +\n `a handlerDidError plugin.`);\n }\n }\n for (const callback of handler.iterateCallbacks('handlerWillRespond')) {\n response = await callback({ event, request, response });\n }\n return response;\n }\n async _awaitComplete(responseDone, handler, request, event) {\n let response;\n let error;\n try {\n response = await responseDone;\n }\n catch (error) {\n // Ignore errors, as response errors should be caught via the `response`\n // promise above. The `done` promise will only throw for errors in\n // promises passed to `handler.waitUntil()`.\n }\n try {\n await handler.runCallbacks('handlerDidRespond', {\n event,\n request,\n response,\n });\n await handler.doneWaiting();\n }\n catch (waitUntilError) {\n if (waitUntilError instanceof Error) {\n error = waitUntilError;\n }\n }\n await handler.runCallbacks('handlerDidComplete', {\n event,\n request,\n response,\n error: error,\n });\n handler.destroy();\n if (error) {\n throw error;\n }\n }\n}\nexport { Strategy };\n/**\n * Classes extending the `Strategy` based class should implement this method,\n * and leverage the {@link workbox-strategies.StrategyHandler}\n * arg to perform all fetching and cache logic, which will ensure all relevant\n * cache, cache options, fetch options and plugins are used (per the current\n * strategy instance).\n *\n * @name _handle\n * @instance\n * @abstract\n * @function\n * @param {Request} request\n * @param {workbox-strategies.StrategyHandler} handler\n * @return {Promise<Response>}\n *\n * @memberof workbox-strategies.Strategy\n */\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { copyResponse } from 'workbox-core/copyResponse.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Strategy } from 'workbox-strategies/Strategy.js';\nimport './_version.js';\n/**\n * A {@link workbox-strategies.Strategy} implementation\n * specifically designed to work with\n * {@link workbox-precaching.PrecacheController}\n * to both cache and fetch precached assets.\n *\n * Note: an instance of this class is created automatically when creating a\n * `PrecacheController`; it's generally not necessary to create this yourself.\n *\n * @extends workbox-strategies.Strategy\n * @memberof workbox-precaching\n */\nclass PrecacheStrategy extends Strategy {\n /**\n *\n * @param {Object} [options]\n * @param {string} [options.cacheName] Cache name to store and retrieve\n * requests. Defaults to the cache names provided by\n * {@link workbox-core.cacheNames}.\n * @param {Array<Object>} [options.plugins] {@link https://developers.google.com/web/tools/workbox/guides/using-plugins|Plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} [options.fetchOptions] Values passed along to the\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters|init}\n * of all fetch() requests made by this strategy.\n * @param {Object} [options.matchOptions] The\n * {@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions|CacheQueryOptions}\n * for any `cache.match()` or `cache.put()` calls made by this strategy.\n * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to\n * get the response from the network if there's a precache miss.\n */\n constructor(options = {}) {\n options.cacheName = cacheNames.getPrecacheName(options.cacheName);\n super(options);\n this._fallbackToNetwork =\n options.fallbackToNetwork === false ? false : true;\n // Redirected responses cannot be used to satisfy a navigation request, so\n // any redirected response must be \"copied\" rather than cloned, so the new\n // response doesn't contain the `redirected` flag. See:\n // https://bugs.chromium.org/p/chromium/issues/detail?id=669363&desc=2#c1\n this.plugins.push(PrecacheStrategy.copyRedirectedCacheableResponsesPlugin);\n }\n /**\n * @private\n * @param {Request|string} request A request to run this strategy for.\n * @param {workbox-strategies.StrategyHandler} handler The event that\n * triggered the request.\n * @return {Promise<Response>}\n */\n async _handle(request, handler) {\n const response = await handler.cacheMatch(request);\n if (response) {\n return response;\n }\n // If this is an `install` event for an entry that isn't already cached,\n // then populate the cache.\n if (handler.event && handler.event.type === 'install') {\n return await this._handleInstall(request, handler);\n }\n // Getting here means something went wrong. An entry that should have been\n // precached wasn't found in the cache.\n return await this._handleFetch(request, handler);\n }\n async _handleFetch(request, handler) {\n let response;\n const params = (handler.params || {});\n // Fall back to the network if we're configured to do so.\n if (this._fallbackToNetwork) {\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(`The precached response for ` +\n `${getFriendlyURL(request.url)} in ${this.cacheName} was not ` +\n `found. Falling back to the network.`);\n }\n const integrityInManifest = params.integrity;\n const integrityInRequest = request.integrity;\n const noIntegrityConflict = !integrityInRequest || integrityInRequest === integrityInManifest;\n // Do not add integrity if the original request is no-cors\n // See https://github.com/GoogleChrome/workbox/issues/3096\n response = await handler.fetch(new Request(request, {\n integrity: request.mode !== 'no-cors'\n ? integrityInRequest || integrityInManifest\n : undefined,\n }));\n // It's only \"safe\" to repair the cache if we're using SRI to guarantee\n // that the response matches the precache manifest's expectations,\n // and there's either a) no integrity property in the incoming request\n // or b) there is an integrity, and it matches the precache manifest.\n // See https://github.com/GoogleChrome/workbox/issues/2858\n // Also if the original request users no-cors we don't use integrity.\n // See https://github.com/GoogleChrome/workbox/issues/3096\n if (integrityInManifest &&\n noIntegrityConflict &&\n request.mode !== 'no-cors') {\n this._useDefaultCacheabilityPluginIfNeeded();\n const wasCached = await handler.cachePut(request, response.clone());\n if (process.env.NODE_ENV !== 'production') {\n if (wasCached) {\n logger.log(`A response for ${getFriendlyURL(request.url)} ` +\n `was used to \"repair\" the precache.`);\n }\n }\n }\n }\n else {\n // This shouldn't normally happen, but there are edge cases:\n // https://github.com/GoogleChrome/workbox/issues/1441\n throw new WorkboxError('missing-precache-entry', {\n cacheName: this.cacheName,\n url: request.url,\n });\n }\n if (process.env.NODE_ENV !== 'production') {\n const cacheKey = params.cacheKey || (await handler.getCacheKey(request, 'read'));\n // Workbox is going to handle the route.\n // print the routing details to the console.\n logger.groupCollapsed(`Precaching is responding to: ` + getFriendlyURL(request.url));\n logger.log(`Serving the precached url: ${getFriendlyURL(cacheKey instanceof Request ? cacheKey.url : cacheKey)}`);\n logger.groupCollapsed(`View request details here.`);\n logger.log(request);\n logger.groupEnd();\n logger.groupCollapsed(`View response details here.`);\n logger.log(response);\n logger.groupEnd();\n logger.groupEnd();\n }\n return response;\n }\n async _handleInstall(request, handler) {\n this._useDefaultCacheabilityPluginIfNeeded();\n const response = await handler.fetch(request);\n // Make sure we defer cachePut() until after we know the response\n // should be cached; see https://github.com/GoogleChrome/workbox/issues/2737\n const wasCached = await handler.cachePut(request, response.clone());\n if (!wasCached) {\n // Throwing here will lead to the `install` handler failing, which\n // we want to do if *any* of the responses aren't safe to cache.\n throw new WorkboxError('bad-precaching-response', {\n url: request.url,\n status: response.status,\n });\n }\n return response;\n }\n /**\n * This method is complex, as there a number of things to account for:\n *\n * The `plugins` array can be set at construction, and/or it might be added to\n * to at any time before the strategy is used.\n *\n * At the time the strategy is used (i.e. during an `install` event), there\n * needs to be at least one plugin that implements `cacheWillUpdate` in the\n * array, other than `copyRedirectedCacheableResponsesPlugin`.\n *\n * - If this method is called and there are no suitable `cacheWillUpdate`\n * plugins, we need to add `defaultPrecacheCacheabilityPlugin`.\n *\n * - If this method is called and there is exactly one `cacheWillUpdate`, then\n * we don't have to do anything (this might be a previously added\n * `defaultPrecacheCacheabilityPlugin`, or it might be a custom plugin).\n *\n * - If this method is called and there is more than one `cacheWillUpdate`,\n * then we need to check if one is `defaultPrecacheCacheabilityPlugin`. If so,\n * we need to remove it. (This situation is unlikely, but it could happen if\n * the strategy is used multiple times, the first without a `cacheWillUpdate`,\n * and then later on after manually adding a custom `cacheWillUpdate`.)\n *\n * See https://github.com/GoogleChrome/workbox/issues/2737 for more context.\n *\n * @private\n */\n _useDefaultCacheabilityPluginIfNeeded() {\n let defaultPluginIndex = null;\n let cacheWillUpdatePluginCount = 0;\n for (const [index, plugin] of this.plugins.entries()) {\n // Ignore the copy redirected plugin when determining what to do.\n if (plugin === PrecacheStrategy.copyRedirectedCacheableResponsesPlugin) {\n continue;\n }\n // Save the default plugin's index, in case it needs to be removed.\n if (plugin === PrecacheStrategy.defaultPrecacheCacheabilityPlugin) {\n defaultPluginIndex = index;\n }\n if (plugin.cacheWillUpdate) {\n cacheWillUpdatePluginCount++;\n }\n }\n if (cacheWillUpdatePluginCount === 0) {\n this.plugins.push(PrecacheStrategy.defaultPrecacheCacheabilityPlugin);\n }\n else if (cacheWillUpdatePluginCount > 1 && defaultPluginIndex !== null) {\n // Only remove the default plugin; multiple custom plugins are allowed.\n this.plugins.splice(defaultPluginIndex, 1);\n }\n // Nothing needs to be done if cacheWillUpdatePluginCount is 1\n }\n}\nPrecacheStrategy.defaultPrecacheCacheabilityPlugin = {\n async cacheWillUpdate({ response }) {\n if (!response || response.status >= 400) {\n return null;\n }\n return response;\n },\n};\nPrecacheStrategy.copyRedirectedCacheableResponsesPlugin = {\n async cacheWillUpdate({ response }) {\n return response.redirected ? await copyResponse(response) : response;\n },\n};\nexport { PrecacheStrategy };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { waitUntil } from 'workbox-core/_private/waitUntil.js';\nimport { createCacheKey } from './utils/createCacheKey.js';\nimport { PrecacheInstallReportPlugin } from './utils/PrecacheInstallReportPlugin.js';\nimport { PrecacheCacheKeyPlugin } from './utils/PrecacheCacheKeyPlugin.js';\nimport { printCleanupDetails } from './utils/printCleanupDetails.js';\nimport { printInstallDetails } from './utils/printInstallDetails.js';\nimport { PrecacheStrategy } from './PrecacheStrategy.js';\nimport './_version.js';\n/**\n * Performs efficient precaching of assets.\n *\n * @memberof workbox-precaching\n */\nclass PrecacheController {\n /**\n * Create a new PrecacheController.\n *\n * @param {Object} [options]\n * @param {string} [options.cacheName] The cache to use for precaching.\n * @param {string} [options.plugins] Plugins to use when precaching as well\n * as responding to fetch events for precached assets.\n * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to\n * get the response from the network if there's a precache miss.\n */\n constructor({ cacheName, plugins = [], fallbackToNetwork = true, } = {}) {\n this._urlsToCacheKeys = new Map();\n this._urlsToCacheModes = new Map();\n this._cacheKeysToIntegrities = new Map();\n this._strategy = new PrecacheStrategy({\n cacheName: cacheNames.getPrecacheName(cacheName),\n plugins: [\n ...plugins,\n new PrecacheCacheKeyPlugin({ precacheController: this }),\n ],\n fallbackToNetwork,\n });\n // Bind the install and activate methods to the instance.\n this.install = this.install.bind(this);\n this.activate = this.activate.bind(this);\n }\n /**\n * @type {workbox-precaching.PrecacheStrategy} The strategy created by this controller and\n * used to cache assets and respond to fetch events.\n */\n get strategy() {\n return this._strategy;\n }\n /**\n * Adds items to the precache list, removing any duplicates and\n * stores the files in the\n * {@link workbox-core.cacheNames|\"precache cache\"} when the service\n * worker installs.\n *\n * This method can be called multiple times.\n *\n * @param {Array<Object|string>} [entries=[]] Array of entries to precache.\n */\n precache(entries) {\n this.addToCacheList(entries);\n if (!this._installAndActiveListenersAdded) {\n self.addEventListener('install', this.install);\n self.addEventListener('activate', this.activate);\n this._installAndActiveListenersAdded = true;\n }\n }\n /**\n * This method will add items to the precache list, removing duplicates\n * and ensuring the information is valid.\n *\n * @param {Array<workbox-precaching.PrecacheController.PrecacheEntry|string>} entries\n * Array of entries to precache.\n */\n addToCacheList(entries) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isArray(entries, {\n moduleName: 'workbox-precaching',\n className: 'PrecacheController',\n funcName: 'addToCacheList',\n paramName: 'entries',\n });\n }\n const urlsToWarnAbout = [];\n for (const entry of entries) {\n // See https://github.com/GoogleChrome/workbox/issues/2259\n if (typeof entry === 'string') {\n urlsToWarnAbout.push(entry);\n }\n else if (entry && entry.revision === undefined) {\n urlsToWarnAbout.push(entry.url);\n }\n const { cacheKey, url } = createCacheKey(entry);\n const cacheMode = typeof entry !== 'string' && entry.revision ? 'reload' : 'default';\n if (this._urlsToCacheKeys.has(url) &&\n this._urlsToCacheKeys.get(url) !== cacheKey) {\n throw new WorkboxError('add-to-cache-list-conflicting-entries', {\n firstEntry: this._urlsToCacheKeys.get(url),\n secondEntry: cacheKey,\n });\n }\n if (typeof entry !== 'string' && entry.integrity) {\n if (this._cacheKeysToIntegrities.has(cacheKey) &&\n this._cacheKeysToIntegrities.get(cacheKey) !== entry.integrity) {\n throw new WorkboxError('add-to-cache-list-conflicting-integrities', {\n url,\n });\n }\n this._cacheKeysToIntegrities.set(cacheKey, entry.integrity);\n }\n this._urlsToCacheKeys.set(url, cacheKey);\n this._urlsToCacheModes.set(url, cacheMode);\n if (urlsToWarnAbout.length > 0) {\n const warningMessage = `Workbox is precaching URLs without revision ` +\n `info: ${urlsToWarnAbout.join(', ')}\\nThis is generally NOT safe. ` +\n `Learn more at https://bit.ly/wb-precache`;\n if (process.env.NODE_ENV === 'production') {\n // Use console directly to display this warning without bloating\n // bundle sizes by pulling in all of the logger codebase in prod.\n console.warn(warningMessage);\n }\n else {\n logger.warn(warningMessage);\n }\n }\n }\n }\n /**\n * Precaches new and updated assets. Call this method from the service worker\n * install event.\n *\n * Note: this method calls `event.waitUntil()` for you, so you do not need\n * to call it yourself in your event handlers.\n *\n * @param {ExtendableEvent} event\n * @return {Promise<workbox-precaching.InstallResult>}\n */\n install(event) {\n // waitUntil returns Promise<any>\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return waitUntil(event, async () => {\n const installReportPlugin = new PrecacheInstallReportPlugin();\n this.strategy.plugins.push(installReportPlugin);\n // Cache entries one at a time.\n // See https://github.com/GoogleChrome/workbox/issues/2528\n for (const [url, cacheKey] of this._urlsToCacheKeys) {\n const integrity = this._cacheKeysToIntegrities.get(cacheKey);\n const cacheMode = this._urlsToCacheModes.get(url);\n const request = new Request(url, {\n integrity,\n cache: cacheMode,\n credentials: 'same-origin',\n });\n await Promise.all(this.strategy.handleAll({\n params: { cacheKey },\n request,\n event,\n }));\n }\n const { updatedURLs, notUpdatedURLs } = installReportPlugin;\n if (process.env.NODE_ENV !== 'production') {\n printInstallDetails(updatedURLs, notUpdatedURLs);\n }\n return { updatedURLs, notUpdatedURLs };\n });\n }\n /**\n * Deletes assets that are no longer present in the current precache manifest.\n * Call this method from the service worker activate event.\n *\n * Note: this method calls `event.waitUntil()` for you, so you do not need\n * to call it yourself in your event handlers.\n *\n * @param {ExtendableEvent} event\n * @return {Promise<workbox-precaching.CleanupResult>}\n */\n activate(event) {\n // waitUntil returns Promise<any>\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return waitUntil(event, async () => {\n const cache = await self.caches.open(this.strategy.cacheName);\n const currentlyCachedRequests = await cache.keys();\n const expectedCacheKeys = new Set(this._urlsToCacheKeys.values());\n const deletedURLs = [];\n for (const request of currentlyCachedRequests) {\n if (!expectedCacheKeys.has(request.url)) {\n await cache.delete(request);\n deletedURLs.push(request.url);\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n printCleanupDetails(deletedURLs);\n }\n return { deletedURLs };\n });\n }\n /**\n * Returns a mapping of a precached URL to the corresponding cache key, taking\n * into account the revision information for the URL.\n *\n * @return {Map<string, string>} A URL to cache key mapping.\n */\n getURLsToCacheKeys() {\n return this._urlsToCacheKeys;\n }\n /**\n * Returns a list of all the URLs that have been precached by the current\n * service worker.\n *\n * @return {Array<string>} The precached URLs.\n */\n getCachedURLs() {\n return [...this._urlsToCacheKeys.keys()];\n }\n /**\n * Returns the cache key used for storing a given URL. If that URL is\n * unversioned, like `/index.html', then the cache key will be the original\n * URL with a search parameter appended to it.\n *\n * @param {string} url A URL whose cache key you want to look up.\n * @return {string} The versioned URL that corresponds to a cache key\n * for the original URL, or undefined if that URL isn't precached.\n */\n getCacheKeyForURL(url) {\n const urlObject = new URL(url, location.href);\n return this._urlsToCacheKeys.get(urlObject.href);\n }\n /**\n * @param {string} url A cache key whose SRI you want to look up.\n * @return {string} The subresource integrity associated with the cache key,\n * or undefined if it's not set.\n */\n getIntegrityForCacheKey(cacheKey) {\n return this._cacheKeysToIntegrities.get(cacheKey);\n }\n /**\n * This acts as a drop-in replacement for\n * [`cache.match()`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/match)\n * with the following differences:\n *\n * - It knows what the name of the precache is, and only checks in that cache.\n * - It allows you to pass in an \"original\" URL without versioning parameters,\n * and it will automatically look up the correct cache key for the currently\n * active revision of that URL.\n *\n * E.g., `matchPrecache('index.html')` will find the correct precached\n * response for the currently active service worker, even if the actual cache\n * key is `'/index.html?__WB_REVISION__=1234abcd'`.\n *\n * @param {string|Request} request The key (without revisioning parameters)\n * to look up in the precache.\n * @return {Promise<Response|undefined>}\n */\n async matchPrecache(request) {\n const url = request instanceof Request ? request.url : request;\n const cacheKey = this.getCacheKeyForURL(url);\n if (cacheKey) {\n const cache = await self.caches.open(this.strategy.cacheName);\n return cache.match(cacheKey);\n }\n return undefined;\n }\n /**\n * Returns a function that looks up `url` in the precache (taking into\n * account revision information), and returns the corresponding `Response`.\n *\n * @param {string} url The precached URL which will be used to lookup the\n * `Response`.\n * @return {workbox-routing~handlerCallback}\n */\n createHandlerBoundToURL(url) {\n const cacheKey = this.getCacheKeyForURL(url);\n if (!cacheKey) {\n throw new WorkboxError('non-precached-url', { url });\n }\n return (options) => {\n options.request = new Request(url);\n options.params = Object.assign({ cacheKey }, options.params);\n return this.strategy.handle(options);\n };\n }\n}\nexport { PrecacheController };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { PrecacheController } from '../PrecacheController.js';\nimport '../_version.js';\nlet precacheController;\n/**\n * @return {PrecacheController}\n * @private\n */\nexport const getOrCreatePrecacheController = () => {\n if (!precacheController) {\n precacheController = new PrecacheController();\n }\n return precacheController;\n};\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { Route } from 'workbox-routing/Route.js';\nimport { generateURLVariations } from './utils/generateURLVariations.js';\nimport './_version.js';\n/**\n * A subclass of {@link workbox-routing.Route} that takes a\n * {@link workbox-precaching.PrecacheController}\n * instance and uses it to match incoming requests and handle fetching\n * responses from the precache.\n *\n * @memberof workbox-precaching\n * @extends workbox-routing.Route\n */\nclass PrecacheRoute extends Route {\n /**\n * @param {PrecacheController} precacheController A `PrecacheController`\n * instance used to both match requests and respond to fetch events.\n * @param {Object} [options] Options to control how requests are matched\n * against the list of precached URLs.\n * @param {string} [options.directoryIndex=index.html] The `directoryIndex` will\n * check cache entries for a URLs ending with '/' to see if there is a hit when\n * appending the `directoryIndex` value.\n * @param {Array<RegExp>} [options.ignoreURLParametersMatching=[/^utm_/, /^fbclid$/]] An\n * array of regex's to remove search params when looking for a cache match.\n * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will\n * check the cache for the URL with a `.html` added to the end of the end.\n * @param {workbox-precaching~urlManipulation} [options.urlManipulation]\n * This is a function that should take a URL and return an array of\n * alternative URLs that should be checked for precache matches.\n */\n constructor(precacheController, options) {\n const match = ({ request, }) => {\n const urlsToCacheKeys = precacheController.getURLsToCacheKeys();\n for (const possibleURL of generateURLVariations(request.url, options)) {\n const cacheKey = urlsToCacheKeys.get(possibleURL);\n if (cacheKey) {\n const integrity = precacheController.getIntegrityForCacheKey(cacheKey);\n return { cacheKey, integrity };\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Precaching did not find a match for ` + getFriendlyURL(request.url));\n }\n return;\n };\n super(match, precacheController.strategy);\n }\n}\nexport { PrecacheRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { removeIgnoredSearchParams } from './removeIgnoredSearchParams.js';\nimport '../_version.js';\n/**\n * Generator function that yields possible variations on the original URL to\n * check, one at a time.\n *\n * @param {string} url\n * @param {Object} options\n *\n * @private\n * @memberof workbox-precaching\n */\nexport function* generateURLVariations(url, { ignoreURLParametersMatching = [/^utm_/, /^fbclid$/], directoryIndex = 'index.html', cleanURLs = true, urlManipulation, } = {}) {\n const urlObject = new URL(url, location.href);\n urlObject.hash = '';\n yield urlObject.href;\n const urlWithoutIgnoredParams = removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching);\n yield urlWithoutIgnoredParams.href;\n if (directoryIndex && urlWithoutIgnoredParams.pathname.endsWith('/')) {\n const directoryURL = new URL(urlWithoutIgnoredParams.href);\n directoryURL.pathname += directoryIndex;\n yield directoryURL.href;\n }\n if (cleanURLs) {\n const cleanURL = new URL(urlWithoutIgnoredParams.href);\n cleanURL.pathname += '.html';\n yield cleanURL.href;\n }\n if (urlManipulation) {\n const additionalURLs = urlManipulation({ url: urlObject });\n for (const urlToAttempt of additionalURLs) {\n yield urlToAttempt.href;\n }\n }\n}\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * Removes any URL search parameters that should be ignored.\n *\n * @param {URL} urlObject The original URL.\n * @param {Array<RegExp>} ignoreURLParametersMatching RegExps to test against\n * each search parameter name. Matches mean that the search parameter should be\n * ignored.\n * @return {URL} The URL with any ignored search parameters removed.\n *\n * @private\n * @memberof workbox-precaching\n */\nexport function removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching = []) {\n // Convert the iterable into an array at the start of the loop to make sure\n // deletion doesn't mess up iteration.\n for (const paramName of [...urlObject.searchParams.keys()]) {\n if (ignoreURLParametersMatching.some((regExp) => regExp.test(paramName))) {\n urlObject.searchParams.delete(paramName);\n }\n }\n return urlObject;\n}\n","/*\n Copyright 2019 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { registerRoute } from 'workbox-routing/registerRoute.js';\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport { PrecacheRoute } from './PrecacheRoute.js';\nimport './_version.js';\n/**\n * Add a `fetch` listener to the service worker that will\n * respond to\n * [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests}\n * with precached assets.\n *\n * Requests for assets that aren't precached, the `FetchEvent` will not be\n * responded to, allowing the event to fall through to other `fetch` event\n * listeners.\n *\n * @param {Object} [options] See the {@link workbox-precaching.PrecacheRoute}\n * options.\n *\n * @memberof workbox-precaching\n */\nfunction addRoute(options) {\n const precacheController = getOrCreatePrecacheController();\n const precacheRoute = new PrecacheRoute(precacheController, options);\n registerRoute(precacheRoute);\n}\nexport { addRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Route } from './Route.js';\nimport { RegExpRoute } from './RegExpRoute.js';\nimport { getOrCreateDefaultRouter } from './utils/getOrCreateDefaultRouter.js';\nimport './_version.js';\n/**\n * Easily register a RegExp, string, or function with a caching\n * strategy to a singleton Router instance.\n *\n * This method will generate a Route for you if needed and\n * call {@link workbox-routing.Router#registerRoute}.\n *\n * @param {RegExp|string|workbox-routing.Route~matchCallback|workbox-routing.Route} capture\n * If the capture param is a `Route`, all other arguments will be ignored.\n * @param {workbox-routing~handlerCallback} [handler] A callback\n * function that returns a Promise resulting in a Response. This parameter\n * is required if `capture` is not a `Route` object.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n * @return {workbox-routing.Route} The generated `Route`.\n *\n * @memberof workbox-routing\n */\nfunction registerRoute(capture, handler, method) {\n let route;\n if (typeof capture === 'string') {\n const captureUrl = new URL(capture, location.href);\n if (process.env.NODE_ENV !== 'production') {\n if (!(capture.startsWith('/') || capture.startsWith('http'))) {\n throw new WorkboxError('invalid-string', {\n moduleName: 'workbox-routing',\n funcName: 'registerRoute',\n paramName: 'capture',\n });\n }\n // We want to check if Express-style wildcards are in the pathname only.\n // TODO: Remove this log message in v4.\n const valueToCheck = capture.startsWith('http')\n ? captureUrl.pathname\n : capture;\n // See https://github.com/pillarjs/path-to-regexp#parameters\n const wildcards = '[*:?+]';\n if (new RegExp(`${wildcards}`).exec(valueToCheck)) {\n logger.debug(`The '$capture' parameter contains an Express-style wildcard ` +\n `character (${wildcards}). Strings are now always interpreted as ` +\n `exact matches; use a RegExp for partial or wildcard matches.`);\n }\n }\n const matchCallback = ({ url }) => {\n if (process.env.NODE_ENV !== 'production') {\n if (url.pathname === captureUrl.pathname &&\n url.origin !== captureUrl.origin) {\n logger.debug(`${capture} only partially matches the cross-origin URL ` +\n `${url.toString()}. This route will only handle cross-origin requests ` +\n `if they match the entire URL.`);\n }\n }\n return url.href === captureUrl.href;\n };\n // If `capture` is a string then `handler` and `method` must be present.\n route = new Route(matchCallback, handler, method);\n }\n else if (capture instanceof RegExp) {\n // If `capture` is a `RegExp` then `handler` and `method` must be present.\n route = new RegExpRoute(capture, handler, method);\n }\n else if (typeof capture === 'function') {\n // If `capture` is a function then `handler` and `method` must be present.\n route = new Route(capture, handler, method);\n }\n else if (capture instanceof Route) {\n route = capture;\n }\n else {\n throw new WorkboxError('unsupported-route-type', {\n moduleName: 'workbox-routing',\n funcName: 'registerRoute',\n paramName: 'capture',\n });\n }\n const defaultRouter = getOrCreateDefaultRouter();\n defaultRouter.registerRoute(route);\n return route;\n}\nexport { registerRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { addRoute } from './addRoute.js';\nimport { precache } from './precache.js';\nimport './_version.js';\n/**\n * This method will add entries to the precache list and add a route to\n * respond to fetch events.\n *\n * This is a convenience method that will call\n * {@link workbox-precaching.precache} and\n * {@link workbox-precaching.addRoute} in a single call.\n *\n * @param {Array<Object|string>} entries Array of entries to precache.\n * @param {Object} [options] See the\n * {@link workbox-precaching.PrecacheRoute} options.\n *\n * @memberof workbox-precaching\n */\nfunction precacheAndRoute(entries, options) {\n precache(entries);\n addRoute(options);\n}\nexport { precacheAndRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport './_version.js';\n/**\n * Adds items to the precache list, removing any duplicates and\n * stores the files in the\n * {@link workbox-core.cacheNames|\"precache cache\"} when the service\n * worker installs.\n *\n * This method can be called multiple times.\n *\n * Please note: This method **will not** serve any of the cached files for you.\n * It only precaches files. To respond to a network request you call\n * {@link workbox-precaching.addRoute}.\n *\n * If you have a single array of files to precache, you can just call\n * {@link workbox-precaching.precacheAndRoute}.\n *\n * @param {Array<Object|string>} [entries=[]] Array of entries to precache.\n *\n * @memberof workbox-precaching\n */\nfunction precache(entries) {\n const precacheController = getOrCreatePrecacheController();\n precacheController.precache(entries);\n}\nexport { precache };\n"],"names":["self","_","e","messageGenerator","fallback","code","args","msg","length","JSON","stringify","WorkboxError","Error","constructor","errorCode","details","super","this","name","normalizeHandler","handler","handle","Route","match","method","setCatchHandler","catchHandler","RegExpRoute","regExp","url","result","exec","href","origin","location","index","slice","Router","_routes","Map","_defaultHandlerMap","routes","addFetchListener","addEventListener","event","request","responsePromise","handleRequest","respondWith","addCacheListener","data","type","payload","requestPromises","Promise","all","urlsToCache","map","entry","Request","waitUntil","ports","then","postMessage","URL","protocol","startsWith","sameOrigin","params","route","findMatchingRoute","has","get","err","reject","_catchHandler","catch","async","catchErr","matchResult","Array","isArray","Object","keys","undefined","setDefaultHandler","set","registerRoute","push","unregisterRoute","routeIndex","indexOf","splice","defaultRouter","_cacheNameDetails","googleAnalytics","precache","prefix","runtime","suffix","registration","scope","_createCacheName","cacheName","filter","value","join","cacheNames","userCacheName","asyncFn","returnPromise","createCacheKey","urlObject","cacheKey","revision","cacheKeyURL","originalURL","searchParams","PrecacheInstallReportPlugin","updatedURLs","notUpdatedURLs","handlerWillStart","state","originalRequest","cachedResponseWillBeUsed","cachedResponse","PrecacheCacheKeyPlugin","precacheController","cacheKeyWillBeUsed","_precacheController","getCacheKeyForURL","headers","supportStatus","copyResponse","response","modifier","clonedResponse","clone","responseInit","Headers","status","statusText","modifiedResponseInit","body","testResponse","Response","error","canConstructResponseFromBodyStream","blob","stripParams","fullURL","ignoreParams","strippedURL","param","delete","Deferred","promise","resolve","quotaErrorCallbacks","Set","toRequest","input","StrategyHandler","strategy","options","_cacheKeys","assign","_strategy","_handlerDeferred","_extendLifetimePromises","_plugins","plugins","_pluginStateMap","plugin","fetch","mode","FetchEvent","preloadResponse","possiblePreloadResponse","hasCallback","cb","iterateCallbacks","thrownErrorMessage","message","pluginFilteredRequest","fetchResponse","fetchOptions","callback","runCallbacks","fetchAndCachePut","responseClone","cachePut","cacheMatch","key","matchOptions","effectiveRequest","getCacheKey","multiMatchOptions","caches","ms","setTimeout","String","replace","RegExp","responseToCache","_ensureResponseSafeToCache","cache","open","hasCacheUpdateCallback","oldResponse","strippedRequestURL","keysOptions","ignoreSearch","cacheKeys","cacheMatchIgnoreParams","put","executeQuotaErrorCallbacks","newResponse","statefulCallback","statefulParam","doneWaiting","shift","destroy","pluginsUsed","Strategy","responseDone","handleAll","_getResponse","_awaitComplete","_handle","waitUntilError","PrecacheStrategy","_fallbackToNetwork","fallbackToNetwork","copyRedirectedCacheableResponsesPlugin","_handleInstall","_handleFetch","integrityInManifest","integrity","integrityInRequest","noIntegrityConflict","_useDefaultCacheabilityPluginIfNeeded","defaultPluginIndex","cacheWillUpdatePluginCount","entries","defaultPrecacheCacheabilityPlugin","cacheWillUpdate","redirected","PrecacheController","_urlsToCacheKeys","_urlsToCacheModes","_cacheKeysToIntegrities","install","bind","activate","addToCacheList","_installAndActiveListenersAdded","urlsToWarnAbout","cacheMode","firstEntry","secondEntry","warningMessage","console","warn","installReportPlugin","credentials","currentlyCachedRequests","expectedCacheKeys","values","deletedURLs","getURLsToCacheKeys","getCachedURLs","getIntegrityForCacheKey","matchPrecache","createHandlerBoundToURL","getOrCreatePrecacheController","PrecacheRoute","urlsToCacheKeys","possibleURL","ignoreURLParametersMatching","directoryIndex","cleanURLs","urlManipulation","hash","urlWithoutIgnoredParams","paramName","some","test","removeIgnoredSearchParams","pathname","endsWith","directoryURL","cleanURL","additionalURLs","urlToAttempt","generateURLVariations","addRoute","capture","captureUrl","matchCallback","moduleName","funcName"],"mappings":"6CAEA,IACIA,KAAK,uBAAyBC,GAClC,CACA,MAAOC,GAAG,CCEV,MCgBaC,EAdIC,CAACC,KAASC,KACvB,IAAIC,EAAMF,EAIV,OAHIC,EAAKE,OAAS,IACdD,GAAO,OAAOE,KAAKC,UAAUJ,MAE1BC,CAAG,ECId,MAAMI,UAAqBC,MASvBC,WAAAA,CAAYC,EAAWC,GAEnBC,MADgBb,EAAiBW,EAAWC,IAE5CE,KAAKC,KAAOJ,EACZG,KAAKF,QAAUA,CACnB,EC9BJ,IACIf,KAAK,0BAA4BC,GACrC,CACA,MAAOC,GAAG,CCWH,MCAMiB,EAAoBC,GACzBA,GAA8B,iBAAZA,EASXA,EAWA,CAAEC,OAAQD,GCjBzB,MAAME,EAYFT,WAAAA,CAAYU,EAAOH,EAASI,EFhBH,OE8BrBP,KAAKG,QAAUD,EAAiBC,GAChCH,KAAKM,MAAQA,EACbN,KAAKO,OAASA,CAClB,CAMAC,eAAAA,CAAgBL,GACZH,KAAKS,aAAeP,EAAiBC,EACzC,ECnCJ,MAAMO,UAAoBL,EActBT,WAAAA,CAAYe,EAAQR,EAASI,GAiCzBR,OAxBcO,EAAGM,UACb,MAAMC,EAASF,EAAOG,KAAKF,EAAIG,MAE/B,GAAKF,IAODD,EAAII,SAAWC,SAASD,QAA2B,IAAjBH,EAAOK,OAY7C,OAAOL,EAAOM,MAAM,EAAE,GAEbhB,EAASI,EAC1B,ECvCJ,MAAMa,EAIFxB,WAAAA,GACII,KAAKqB,EAAU,IAAIC,IACnBtB,KAAKuB,EAAqB,IAAID,GAClC,CAMA,UAAIE,GACA,OAAOxB,KAAKqB,CAChB,CAKAI,gBAAAA,GAEI1C,KAAK2C,iBAAiB,SAAWC,IAC7B,MAAMC,QAAEA,GAAYD,EACdE,EAAkB7B,KAAK8B,cAAc,CAAEF,UAASD,UAClDE,GACAF,EAAMI,YAAYF,EACtB,GAER,CAuBAG,gBAAAA,GAEIjD,KAAK2C,iBAAiB,WAAaC,IAG/B,GAAIA,EAAMM,MAA4B,eAApBN,EAAMM,KAAKC,KAAuB,CAEhD,MAAMC,QAAEA,GAAYR,EAAMM,KAIpBG,EAAkBC,QAAQC,IAAIH,EAAQI,YAAYC,KAAKC,IACpC,iBAAVA,IACPA,EAAQ,CAACA,IAEb,MAAMb,EAAU,IAAIc,WAAWD,GAC/B,OAAOzC,KAAK8B,cAAc,CAAEF,UAASD,SAAQ,KAKjDA,EAAMgB,UAAUP,GAEZT,EAAMiB,OAASjB,EAAMiB,MAAM,IACtBR,EAAgBS,MAAK,IAAMlB,EAAMiB,MAAM,GAAGE,aAAY,IAEnE,IAER,CAaAhB,aAAAA,EAAcF,QAAEA,EAAOD,MAAEA,IASrB,MAAMf,EAAM,IAAImC,IAAInB,EAAQhB,IAAKK,SAASF,MAC1C,IAAKH,EAAIoC,SAASC,WAAW,QAIzB,OAEJ,MAAMC,EAAatC,EAAII,SAAWC,SAASD,QACrCmC,OAAEA,EAAMC,MAAEA,GAAUpD,KAAKqD,kBAAkB,CAC7C1B,QACAC,UACAsB,aACAtC,QAEJ,IAAIT,EAAUiD,GAASA,EAAMjD,QAe7B,MAAMI,EAASqB,EAAQrB,OAQvB,IAPKJ,GAAWH,KAAKuB,EAAmB+B,IAAI/C,KAKxCJ,EAAUH,KAAKuB,EAAmBgC,IAAIhD,KAErCJ,EAMD,OAkBJ,IAAI0B,EACJ,IACIA,EAAkB1B,EAAQC,OAAO,CAAEQ,MAAKgB,UAASD,QAAOwB,UAC3D,CACD,MAAOK,GACH3B,EAAkBQ,QAAQoB,OAAOD,EACrC,CAEA,MAAM/C,EAAe2C,GAASA,EAAM3C,aAuCpC,OAtCIoB,aAA2BQ,UAC1BrC,KAAK0D,GAAiBjD,KACvBoB,EAAkBA,EAAgB8B,OAAMC,UAEpC,GAAInD,EAUA,IACI,aAAaA,EAAaL,OAAO,CAAEQ,MAAKgB,UAASD,QAAOwB,UAC3D,CACD,MAAOU,GACCA,aAAoBlE,QACpB6D,EAAMK,EAEd,CAEJ,GAAI7D,KAAK0D,EAUL,OAAO1D,KAAK0D,EAActD,OAAO,CAAEQ,MAAKgB,UAASD,UAErD,MAAM6B,CAAG,KAGV3B,CACX,CAgBAwB,iBAAAA,EAAkBzC,IAAEA,EAAGsC,WAAEA,EAAUtB,QAAEA,EAAOD,MAAEA,IAC1C,MAAMH,EAASxB,KAAKqB,EAAQkC,IAAI3B,EAAQrB,SAAW,GACnD,IAAK,MAAM6C,KAAS5B,EAAQ,CACxB,IAAI2B,EAGJ,MAAMW,EAAcV,EAAM9C,MAAM,CAAEM,MAAKsC,aAAYtB,UAASD,UAC5D,GAAImC,EA6BA,OAjBAX,EAASW,GACLC,MAAMC,QAAQb,IAA6B,IAAlBA,EAAO5D,QAI3BuE,EAAYlE,cAAgBqE,QACG,IAApCA,OAAOC,KAAKJ,GAAavE,QAIG,kBAAhBuE,KAPZX,OAASgB,GAcN,CAAEf,QAAOD,SAExB,CAEA,MAAO,EACX,CAeAiB,iBAAAA,CAAkBjE,EAASI,EJ1SF,OI2SrBP,KAAKuB,EAAmB8C,IAAI9D,EAAQL,EAAiBC,GACzD,CAQAK,eAAAA,CAAgBL,GACZH,KAAK0D,EAAgBxD,EAAiBC,EAC1C,CAMAmE,aAAAA,CAAclB,GAiCLpD,KAAKqB,EAAQiC,IAAIF,EAAM7C,SACxBP,KAAKqB,EAAQgD,IAAIjB,EAAM7C,OAAQ,IAInCP,KAAKqB,EAAQkC,IAAIH,EAAM7C,QAAQgE,KAAKnB,EACxC,CAMAoB,eAAAA,CAAgBpB,GACZ,IAAKpD,KAAKqB,EAAQiC,IAAIF,EAAM7C,QACxB,MAAM,IAAIb,EAAa,6CAA8C,CACjEa,OAAQ6C,EAAM7C,SAGtB,MAAMkE,EAAazE,KAAKqB,EAAQkC,IAAIH,EAAM7C,QAAQmE,QAAQtB,GAC1D,KAAIqB,GAAc,GAId,MAAM,IAAI/E,EAAa,yCAHvBM,KAAKqB,EAAQkC,IAAIH,EAAM7C,QAAQoE,OAAOF,EAAY,EAK1D,EC7XJ,IAAIG,ECDJ,MAAMC,EAAoB,CACtBC,gBAAiB,kBACjBC,SAAU,cACVC,OAAQ,UACRC,QAAS,UACTC,OAAgC,oBAAjBC,aAA+BA,aAAaC,MAAQ,IAEjEC,EAAoBC,GACf,CAACT,EAAkBG,OAAQM,EAAWT,EAAkBK,QAC1DK,QAAQC,GAAUA,GAASA,EAAMjG,OAAS,IAC1CkG,KAAK,KAODC,EAWSC,GACPA,GAAiBN,EAAiBR,EAAkBE,UAZtDW,EAiBQC,GACNA,GAAiBN,EAAiBR,EAAkBI,SC3BnE,SAAStC,EAAUhB,EAAOiE,GACtB,MAAMC,EAAgBD,IAEtB,OADAjE,EAAMgB,UAAUkD,GACTA,CACX,CClBA,IACI9G,KAAK,6BAA+BC,GACxC,CACA,MAAOC,GAAG,CCeH,SAAS6G,EAAerD,GAC3B,IAAKA,EACD,MAAM,IAAI/C,EAAa,oCAAqC,CAAE+C,UAIlE,GAAqB,iBAAVA,EAAoB,CAC3B,MAAMsD,EAAY,IAAIhD,IAAIN,EAAOxB,SAASF,MAC1C,MAAO,CACHiF,SAAUD,EAAUhF,KACpBH,IAAKmF,EAAUhF,KAEvB,CACA,MAAMkF,SAAEA,EAAQrF,IAAEA,GAAQ6B,EAC1B,IAAK7B,EACD,MAAM,IAAIlB,EAAa,oCAAqC,CAAE+C,UAIlE,IAAKwD,EAAU,CACX,MAAMF,EAAY,IAAIhD,IAAInC,EAAKK,SAASF,MACxC,MAAO,CACHiF,SAAUD,EAAUhF,KACpBH,IAAKmF,EAAUhF,KAEvB,CAGA,MAAMmF,EAAc,IAAInD,IAAInC,EAAKK,SAASF,MACpCoF,EAAc,IAAIpD,IAAInC,EAAKK,SAASF,MAE1C,OADAmF,EAAYE,aAAa/B,IAxCC,kBAwC0B4B,GAC7C,CACHD,SAAUE,EAAYnF,KACtBH,IAAKuF,EAAYpF,KAEzB,CCzCA,MAAMsF,EACFzG,WAAAA,GACII,KAAKsG,YAAc,GACnBtG,KAAKuG,eAAiB,GACtBvG,KAAKwG,iBAAmB5C,OAAShC,UAAS6E,YAElCA,IACAA,EAAMC,gBAAkB9E,EAC5B,EAEJ5B,KAAK2G,yBAA2B/C,OAASjC,QAAO8E,QAAOG,qBACnD,GAAmB,YAAfjF,EAAMO,MACFuE,GACAA,EAAMC,iBACND,EAAMC,2BAA2BhE,QAAS,CAE1C,MAAM9B,EAAM6F,EAAMC,gBAAgB9F,IAC9BgG,EACA5G,KAAKuG,eAAehC,KAAK3D,GAGzBZ,KAAKsG,YAAY/B,KAAK3D,EAE9B,CAEJ,OAAOgG,CAAc,CAE7B,EC3BJ,MAAMC,EACFjH,WAAAA,EAAYkH,mBAAEA,IACV9G,KAAK+G,mBAAqBnD,OAAShC,UAASuB,aAGxC,MAAM6C,GAAY7C,aAAuC,EAASA,EAAO6C,WACrEhG,KAAKgH,EAAoBC,kBAAkBrF,EAAQhB,KAEvD,OAAOoF,EACD,IAAItD,QAAQsD,EAAU,CAAEkB,QAAStF,EAAQsF,UACzCtF,CAAO,EAEjB5B,KAAKgH,EAAsBF,CAC/B,ECnBJ,IAAIK,ECqBJvD,eAAewD,EAAaC,EAAUC,GAClC,IAAItG,EAAS,KAEb,GAAIqG,EAASzG,IAAK,CAEdI,EADoB,IAAI+B,IAAIsE,EAASzG,KAChBI,MACzB,CACA,GAAIA,IAAWjC,KAAKkC,SAASD,OACzB,MAAM,IAAItB,EAAa,6BAA8B,CAAEsB,WAE3D,MAAMuG,EAAiBF,EAASG,QAE1BC,EAAe,CACjBP,QAAS,IAAIQ,QAAQH,EAAeL,SACpCS,OAAQJ,EAAeI,OACvBC,WAAYL,EAAeK,YAGzBC,EAAuBP,EAAWA,EAASG,GAAgBA,EAI3DK,EDjCV,WACI,QAAsB3D,IAAlBgD,EAA6B,CAC7B,MAAMY,EAAe,IAAIC,SAAS,IAClC,GAAI,SAAUD,EACV,IACI,IAAIC,SAASD,EAAaD,MAC1BX,GAAgB,CACnB,CACD,MAAOc,GACHd,GAAgB,CACpB,CAEJA,GAAgB,CACpB,CACA,OAAOA,CACX,CCkBiBe,GACPX,EAAeO,WACTP,EAAeY,OAC3B,OAAO,IAAIH,SAASF,EAAMD,EAC9B,CChDA,SAASO,EAAYC,EAASC,GAC1B,MAAMC,EAAc,IAAIxF,IAAIsF,GAC5B,IAAK,MAAMG,KAASF,EAChBC,EAAYnC,aAAaqC,OAAOD,GAEpC,OAAOD,EAAYxH,IACvB,CCGA,MAAM2H,EAIF9I,WAAAA,GACII,KAAK2I,QAAU,IAAItG,SAAQ,CAACuG,EAASnF,KACjCzD,KAAK4I,QAAUA,EACf5I,KAAKyD,OAASA,CAAM,GAE5B,ECdJ,MAAMoF,EAAsB,IAAIC,ICThC,IACI/J,KAAK,6BAA+BC,GACxC,CACA,MAAOC,GAAG,CCWV,SAAS8J,EAAUC,GACf,MAAwB,iBAAVA,EAAqB,IAAItG,QAAQsG,GAASA,CAC5D,CAUA,MAAMC,EAiBFrJ,WAAAA,CAAYsJ,EAAUC,GAClBnJ,KAAKoJ,EAAa,GA8ClBnF,OAAOoF,OAAOrJ,KAAMmJ,GACpBnJ,KAAK2B,MAAQwH,EAAQxH,MACrB3B,KAAKsJ,EAAYJ,EACjBlJ,KAAKuJ,EAAmB,IAAIb,EAC5B1I,KAAKwJ,EAA0B,GAG/BxJ,KAAKyJ,EAAW,IAAIP,EAASQ,SAC7B1J,KAAK2J,EAAkB,IAAIrI,IAC3B,IAAK,MAAMsI,KAAU5J,KAAKyJ,EACtBzJ,KAAK2J,EAAgBtF,IAAIuF,EAAQ,CAAE,GAEvC5J,KAAK2B,MAAMgB,UAAU3C,KAAKuJ,EAAiBZ,QAC/C,CAcA,WAAMkB,CAAMb,GACR,MAAMrH,MAAEA,GAAU3B,KAClB,IAAI4B,EAAUmH,EAAUC,GACxB,GAAqB,aAAjBpH,EAAQkI,MACRnI,aAAiBoI,YACjBpI,EAAMqI,gBAAiB,CACvB,MAAMC,QAAiCtI,EAAMqI,gBAC7C,GAAIC,EAKA,OAAOA,CAEf,CAIA,MAAMvD,EAAkB1G,KAAKkK,YAAY,gBACnCtI,EAAQ4F,QACR,KACN,IACI,IAAK,MAAM2C,KAAMnK,KAAKoK,iBAAiB,oBACnCxI,QAAgBuI,EAAG,CAAEvI,QAASA,EAAQ4F,QAAS7F,SAEtD,CACD,MAAO6B,GACH,GAAIA,aAAe7D,MACf,MAAM,IAAID,EAAa,kCAAmC,CACtD2K,mBAAoB7G,EAAI8G,SAGpC,CAIA,MAAMC,EAAwB3I,EAAQ4F,QACtC,IACI,IAAIgD,EAEJA,QAAsBX,MAAMjI,EAA0B,aAAjBA,EAAQkI,UAAsB3F,EAAYnE,KAAKsJ,EAAUmB,cAM9F,IAAK,MAAMC,KAAY1K,KAAKoK,iBAAiB,mBACzCI,QAAsBE,EAAS,CAC3B/I,QACAC,QAAS2I,EACTlD,SAAUmD,IAGlB,OAAOA,CACV,CACD,MAAOvC,GAeH,MARIvB,SACM1G,KAAK2K,aAAa,eAAgB,CACpC1C,MAAOA,EACPtG,QACA+E,gBAAiBA,EAAgBc,QACjC5F,QAAS2I,EAAsB/C,UAGjCS,CACV,CACJ,CAWA,sBAAM2C,CAAiB5B,GACnB,MAAM3B,QAAiBrH,KAAK6J,MAAMb,GAC5B6B,EAAgBxD,EAASG,QAE/B,OADKxH,KAAK2C,UAAU3C,KAAK8K,SAAS9B,EAAO6B,IAClCxD,CACX,CAaA,gBAAM0D,CAAWC,GACb,MAAMpJ,EAAUmH,EAAUiC,GAC1B,IAAIpE,EACJ,MAAMtB,UAAEA,EAAS2F,aAAEA,GAAiBjL,KAAKsJ,EACnC4B,QAAyBlL,KAAKmL,YAAYvJ,EAAS,QACnDwJ,EAAoBnH,OAAOoF,OAAOpF,OAAOoF,OAAO,CAAA,EAAI4B,GAAe,CAAE3F,cAC3EsB,QAAuByE,OAAO/K,MAAM4K,EAAkBE,GAStD,IAAK,MAAMV,KAAY1K,KAAKoK,iBAAiB,4BACzCxD,QACW8D,EAAS,CACZpF,YACA2F,eACArE,iBACAhF,QAASsJ,EACTvJ,MAAO3B,KAAK2B,cACTwC,EAEf,OAAOyC,CACX,CAgBA,cAAMkE,CAASE,EAAK3D,GAChB,MAAMzF,EAAUmH,EAAUiC,GCxP3B,IAAiBM,UD2PF,EC1PX,IAAIjJ,SAASuG,GAAY2C,WAAW3C,EAAS0C,MD2PhD,MAAMJ,QAAyBlL,KAAKmL,YAAYvJ,EAAS,SAiBzD,IAAKyF,EAKD,MAAM,IAAI3H,EAAa,6BAA8B,CACjDkB,KE1RQA,EF0RYsK,EAAiBtK,IEzRlC,IAAImC,IAAIyI,OAAO5K,GAAMK,SAASF,MAG/BA,KAAK0K,QAAQ,IAAIC,OAAO,IAAIzK,SAASD,UAAW,OAJ1CJ,MF6RhB,MAAM+K,QAAwB3L,KAAK4L,EAA2BvE,GAC9D,IAAKsE,EAKD,OAAO,EAEX,MAAMrG,UAAEA,EAAS2F,aAAEA,GAAiBjL,KAAKsJ,EACnCuC,QAAc9M,KAAKsM,OAAOS,KAAKxG,GAC/ByG,EAAyB/L,KAAKkK,YAAY,kBAC1C8B,EAAcD,QJtR5BnI,eAAsCiI,EAAOjK,EAAS0G,EAAc2C,GAChE,MAAMgB,EAAqB7D,EAAYxG,EAAQhB,IAAK0H,GAEpD,GAAI1G,EAAQhB,MAAQqL,EAChB,OAAOJ,EAAMvL,MAAMsB,EAASqJ,GAGhC,MAAMiB,EAAcjI,OAAOoF,OAAOpF,OAAOoF,OAAO,CAAA,EAAI4B,GAAe,CAAEkB,cAAc,IAC7EC,QAAkBP,EAAM3H,KAAKtC,EAASsK,GAC5C,IAAK,MAAMlG,KAAYoG,EAEnB,GAAIH,IADwB7D,EAAYpC,EAASpF,IAAK0H,GAElD,OAAOuD,EAAMvL,MAAM0F,EAAUiF,EAIzC,CIuQoBoB,CAIRR,EAAOX,EAAiB1D,QAAS,CAAC,mBAAoByD,GACpD,KAKN,UACUY,EAAMS,IAAIpB,EAAkBa,EAAyBJ,EAAgBnE,QAAUmE,EACxF,CACD,MAAO1D,GACH,GAAIA,aAAiBtI,MAKjB,KAHmB,uBAAfsI,EAAMhI,YGhT1B2D,iBAKI,IAAK,MAAM8G,KAAY7B,QACb6B,GAQd,CHmS0B6B,GAEJtE,CAEd,CACA,IAAK,MAAMyC,KAAY1K,KAAKoK,iBAAiB,wBACnCM,EAAS,CACXpF,YACA0G,cACAQ,YAAab,EAAgBnE,QAC7B5F,QAASsJ,EACTvJ,MAAO3B,KAAK2B,QAGpB,OAAO,CACX,CAYA,iBAAMwJ,CAAYvJ,EAASkI,GACvB,MAAMkB,EAAM,GAAGpJ,EAAQhB,SAASkJ,IAChC,IAAK9J,KAAKoJ,EAAW4B,GAAM,CACvB,IAAIE,EAAmBtJ,EACvB,IAAK,MAAM8I,KAAY1K,KAAKoK,iBAAiB,sBACzCc,EAAmBnC,QAAgB2B,EAAS,CACxCZ,OACAlI,QAASsJ,EACTvJ,MAAO3B,KAAK2B,MAEZwB,OAAQnD,KAAKmD,UAGrBnD,KAAKoJ,EAAW4B,GAAOE,CAC3B,CACA,OAAOlL,KAAKoJ,EAAW4B,EAC3B,CAQAd,WAAAA,CAAYjK,GACR,IAAK,MAAM2J,KAAU5J,KAAKsJ,EAAUI,QAChC,GAAIzJ,KAAQ2J,EACR,OAAO,EAGf,OAAO,CACX,CAiBA,kBAAMe,CAAa1K,EAAMuI,GACrB,IAAK,MAAMkC,KAAY1K,KAAKoK,iBAAiBnK,SAGnCyK,EAASlC,EAEvB,CAUA,iBAAC4B,CAAiBnK,GACd,IAAK,MAAM2J,KAAU5J,KAAKsJ,EAAUI,QAChC,GAA4B,mBAAjBE,EAAO3J,GAAsB,CACpC,MAAMwG,EAAQzG,KAAK2J,EAAgBpG,IAAIqG,GACjC6C,EAAoBjE,IACtB,MAAMkE,EAAgBzI,OAAOoF,OAAOpF,OAAOoF,OAAO,CAAA,EAAIb,GAAQ,CAAE/B,UAGhE,OAAOmD,EAAO3J,GAAMyM,EAAc,QAEhCD,CACV,CAER,CAcA9J,SAAAA,CAAUgG,GAEN,OADA3I,KAAKwJ,EAAwBjF,KAAKoE,GAC3BA,CACX,CAWA,iBAAMgE,GACF,IAAIhE,EACJ,KAAQA,EAAU3I,KAAKwJ,EAAwBoD,eACrCjE,CAEd,CAKAkE,OAAAA,GACI7M,KAAKuJ,EAAiBX,QAAQ,KAClC,CAWA,OAAMgD,CAA2BvE,GAC7B,IAAIsE,EAAkBtE,EAClByF,GAAc,EAClB,IAAK,MAAMpC,KAAY1K,KAAKoK,iBAAiB,mBAQzC,GAPAuB,QACWjB,EAAS,CACZ9I,QAAS5B,KAAK4B,QACdyF,SAAUsE,EACVhK,MAAO3B,KAAK2B,cACTwC,EACX2I,GAAc,GACTnB,EACD,MAwBR,OArBKmB,GACGnB,GAA8C,MAA3BA,EAAgBhE,SACnCgE,OAAkBxH,GAmBnBwH,CACX,EIhfJ,MAAMoB,EAuBFnN,WAAAA,CAAYuJ,EAAU,IAQlBnJ,KAAKsF,UAAYI,EAA0ByD,EAAQ7D,WAQnDtF,KAAK0J,QAAUP,EAAQO,SAAW,GAQlC1J,KAAKyK,aAAetB,EAAQsB,aAQ5BzK,KAAKiL,aAAe9B,EAAQ8B,YAChC,CAoBA7K,MAAAA,CAAO+I,GACH,MAAO6D,GAAgBhN,KAAKiN,UAAU9D,GACtC,OAAO6D,CACX,CAuBAC,SAAAA,CAAU9D,GAEFA,aAAmBY,aACnBZ,EAAU,CACNxH,MAAOwH,EACPvH,QAASuH,EAAQvH,UAGzB,MAAMD,EAAQwH,EAAQxH,MAChBC,EAAqC,iBAApBuH,EAAQvH,QACzB,IAAIc,QAAQyG,EAAQvH,SACpBuH,EAAQvH,QACRuB,EAAS,WAAYgG,EAAUA,EAAQhG,YAASgB,EAChDhE,EAAU,IAAI8I,EAAgBjJ,KAAM,CAAE2B,QAAOC,UAASuB,WACtD6J,EAAehN,KAAKkN,EAAa/M,EAASyB,EAASD,GAGzD,MAAO,CAACqL,EAFYhN,KAAKmN,EAAeH,EAAc7M,EAASyB,EAASD,GAG5E,CACA,OAAMuL,CAAa/M,EAASyB,EAASD,GAEjC,IAAI0F,QADElH,EAAQwK,aAAa,mBAAoB,CAAEhJ,QAAOC,YAExD,IAKI,GAJAyF,QAAiBrH,KAAKoN,EAAQxL,EAASzB,IAIlCkH,GAA8B,UAAlBA,EAASnF,KACtB,MAAM,IAAIxC,EAAa,cAAe,CAAEkB,IAAKgB,EAAQhB,KAE5D,CACD,MAAOqH,GACH,GAAIA,aAAiBtI,MACjB,IAAK,MAAM+K,KAAYvK,EAAQiK,iBAAiB,mBAE5C,GADA/C,QAAiBqD,EAAS,CAAEzC,QAAOtG,QAAOC,YACtCyF,EACA,MAIZ,IAAKA,EACD,MAAMY,CAOd,CACA,IAAK,MAAMyC,KAAYvK,EAAQiK,iBAAiB,sBAC5C/C,QAAiBqD,EAAS,CAAE/I,QAAOC,UAASyF,aAEhD,OAAOA,CACX,CACA,OAAM8F,CAAeH,EAAc7M,EAASyB,EAASD,GACjD,IAAI0F,EACAY,EACJ,IACIZ,QAAiB2F,CACpB,CACD,MAAO/E,GAGH,CAEJ,UACU9H,EAAQwK,aAAa,oBAAqB,CAC5ChJ,QACAC,UACAyF,mBAEElH,EAAQwM,aACjB,CACD,MAAOU,GACCA,aAA0B1N,QAC1BsI,EAAQoF,EAEhB,CAQA,SAPMlN,EAAQwK,aAAa,qBAAsB,CAC7ChJ,QACAC,UACAyF,WACAY,MAAOA,IAEX9H,EAAQ0M,UACJ5E,EACA,MAAMA,CAEd,ECtLJ,MAAMqF,UAAyBP,EAkB3BnN,WAAAA,CAAYuJ,EAAU,IAClBA,EAAQ7D,UAAYI,EAA2ByD,EAAQ7D,WACvDvF,MAAMoJ,GACNnJ,KAAKuN,GAC6B,IAA9BpE,EAAQqE,kBAKZxN,KAAK0J,QAAQnF,KAAK+I,EAAiBG,uCACvC,CAQA,OAAML,CAAQxL,EAASzB,GACnB,MAAMkH,QAAiBlH,EAAQ4K,WAAWnJ,GAC1C,OAAIyF,IAKAlH,EAAQwB,OAAgC,YAAvBxB,EAAQwB,MAAMO,WAClBlC,KAAK0N,EAAe9L,EAASzB,SAIjCH,KAAK2N,EAAa/L,EAASzB,GAC5C,CACA,OAAMwN,CAAa/L,EAASzB,GACxB,IAAIkH,EACJ,MAAMlE,EAAUhD,EAAQgD,QAAU,GAElC,IAAInD,KAAKuN,EAuCL,MAAM,IAAI7N,EAAa,yBAA0B,CAC7C4F,UAAWtF,KAAKsF,UAChB1E,IAAKgB,EAAQhB,MAzCQ,CAMzB,MAAMgN,EAAsBzK,EAAO0K,UAC7BC,EAAqBlM,EAAQiM,UAC7BE,GAAuBD,GAAsBA,IAAuBF,EAG1EvG,QAAiBlH,EAAQ0J,MAAM,IAAInH,QAAQd,EAAS,CAChDiM,UAA4B,YAAjBjM,EAAQkI,KACbgE,GAAsBF,OACtBzJ,KASNyJ,GACAG,GACiB,YAAjBnM,EAAQkI,OACR9J,KAAKgO,UACmB7N,EAAQ2K,SAASlJ,EAASyF,EAASG,SAQnE,CAuBA,OAAOH,CACX,CACA,OAAMqG,CAAe9L,EAASzB,GAC1BH,KAAKgO,IACL,MAAM3G,QAAiBlH,EAAQ0J,MAAMjI,GAIrC,UADwBzB,EAAQ2K,SAASlJ,EAASyF,EAASG,SAIvD,MAAM,IAAI9H,EAAa,0BAA2B,CAC9CkB,IAAKgB,EAAQhB,IACb+G,OAAQN,EAASM,SAGzB,OAAON,CACX,CA4BA2G,CAAAA,GACI,IAAIC,EAAqB,KACrBC,EAA6B,EACjC,IAAK,MAAOhN,EAAO0I,KAAW5J,KAAK0J,QAAQyE,UAEnCvE,IAAW0D,EAAiBG,yCAI5B7D,IAAW0D,EAAiBc,oCAC5BH,EAAqB/M,GAErB0I,EAAOyE,iBACPH,KAG2B,IAA/BA,EACAlO,KAAK0J,QAAQnF,KAAK+I,EAAiBc,mCAE9BF,EAA6B,GAA4B,OAAvBD,GAEvCjO,KAAK0J,QAAQ/E,OAAOsJ,EAAoB,EAGhD,EAEJX,EAAiBc,kCAAoC,CACjDxK,gBAAqByK,OAAChH,SAAEA,MACfA,GAAYA,EAASM,QAAU,IACzB,KAEJN,GAGfiG,EAAiBG,uCAAyC,CACtD7J,gBAAqByK,OAAChH,SAAEA,KACbA,EAASiH,iBAAmBlH,EAAaC,GAAYA,GCnMpE,MAAMkH,EAWF3O,WAAAA,EAAY0F,UAAEA,EAASoE,QAAEA,EAAU,GAAE8D,kBAAEA,GAAoB,GAAU,IACjExN,KAAKwO,EAAmB,IAAIlN,IAC5BtB,KAAKyO,EAAoB,IAAInN,IAC7BtB,KAAK0O,EAA0B,IAAIpN,IACnCtB,KAAKsJ,EAAY,IAAIgE,EAAiB,CAClChI,UAAWI,EAA2BJ,GACtCoE,QAAS,IACFA,EACH,IAAI7C,EAAuB,CAAEC,mBAAoB9G,QAErDwN,sBAGJxN,KAAK2O,QAAU3O,KAAK2O,QAAQC,KAAK5O,MACjCA,KAAK6O,SAAW7O,KAAK6O,SAASD,KAAK5O,KACvC,CAKA,YAAIkJ,GACA,OAAOlJ,KAAKsJ,CAChB,CAWAvE,QAAAA,CAASoJ,GACLnO,KAAK8O,eAAeX,GACfnO,KAAK+O,IACNhQ,KAAK2C,iBAAiB,UAAW1B,KAAK2O,SACtC5P,KAAK2C,iBAAiB,WAAY1B,KAAK6O,UACvC7O,KAAK+O,GAAkC,EAE/C,CAQAD,cAAAA,CAAeX,GASX,MAAMa,EAAkB,GACxB,IAAK,MAAMvM,KAAS0L,EAAS,CAEJ,iBAAV1L,EACPuM,EAAgBzK,KAAK9B,GAEhBA,QAA4B0B,IAAnB1B,EAAMwD,UACpB+I,EAAgBzK,KAAK9B,EAAM7B,KAE/B,MAAMoF,SAAEA,EAAQpF,IAAEA,GAAQkF,EAAerD,GACnCwM,EAA6B,iBAAVxM,GAAsBA,EAAMwD,SAAW,SAAW,UAC3E,GAAIjG,KAAKwO,EAAiBlL,IAAI1C,IAC1BZ,KAAKwO,EAAiBjL,IAAI3C,KAASoF,EACnC,MAAM,IAAItG,EAAa,wCAAyC,CAC5DwP,WAAYlP,KAAKwO,EAAiBjL,IAAI3C,GACtCuO,YAAanJ,IAGrB,GAAqB,iBAAVvD,GAAsBA,EAAMoL,UAAW,CAC9C,GAAI7N,KAAK0O,EAAwBpL,IAAI0C,IACjChG,KAAK0O,EAAwBnL,IAAIyC,KAAcvD,EAAMoL,UACrD,MAAM,IAAInO,EAAa,4CAA6C,CAChEkB,QAGRZ,KAAK0O,EAAwBrK,IAAI2B,EAAUvD,EAAMoL,UACrD,CAGA,GAFA7N,KAAKwO,EAAiBnK,IAAIzD,EAAKoF,GAC/BhG,KAAKyO,EAAkBpK,IAAIzD,EAAKqO,GAC5BD,EAAgBzP,OAAS,EAAG,CAC5B,MAAM6P,EACF,qDAASJ,EAAgBvJ,KAAK,8EAK9B4J,QAAQC,KAAKF,EAKrB,CACJ,CACJ,CAWAT,OAAAA,CAAQhN,GAGJ,OAAOgB,EAAUhB,GAAOiC,UACpB,MAAM2L,EAAsB,IAAIlJ,EAChCrG,KAAKkJ,SAASQ,QAAQnF,KAAKgL,GAG3B,IAAK,MAAO3O,EAAKoF,KAAahG,KAAKwO,EAAkB,CACjD,MAAMX,EAAY7N,KAAK0O,EAAwBnL,IAAIyC,GAC7CiJ,EAAYjP,KAAKyO,EAAkBlL,IAAI3C,GACvCgB,EAAU,IAAIc,QAAQ9B,EAAK,CAC7BiN,YACAhC,MAAOoD,EACPO,YAAa,sBAEXnN,QAAQC,IAAItC,KAAKkJ,SAAS+D,UAAU,CACtC9J,OAAQ,CAAE6C,YACVpE,UACAD,UAER,CACA,MAAM2E,YAAEA,EAAWC,eAAEA,GAAmBgJ,EAIxC,MAAO,CAAEjJ,cAAaC,iBAAgB,GAE9C,CAWAsI,QAAAA,CAASlN,GAGL,OAAOgB,EAAUhB,GAAOiC,UACpB,MAAMiI,QAAc9M,KAAKsM,OAAOS,KAAK9L,KAAKkJ,SAAS5D,WAC7CmK,QAAgC5D,EAAM3H,OACtCwL,EAAoB,IAAI5G,IAAI9I,KAAKwO,EAAiBmB,UAClDC,EAAc,GACpB,IAAK,MAAMhO,KAAW6N,EACbC,EAAkBpM,IAAI1B,EAAQhB,aACzBiL,EAAMpD,OAAO7G,GACnBgO,EAAYrL,KAAK3C,EAAQhB,MAMjC,MAAO,CAAEgP,cAAa,GAE9B,CAOAC,kBAAAA,GACI,OAAO7P,KAAKwO,CAChB,CAOAsB,aAAAA,GACI,MAAO,IAAI9P,KAAKwO,EAAiBtK,OACrC,CAUA+C,iBAAAA,CAAkBrG,GACd,MAAMmF,EAAY,IAAIhD,IAAInC,EAAKK,SAASF,MACxC,OAAOf,KAAKwO,EAAiBjL,IAAIwC,EAAUhF,KAC/C,CAMAgP,uBAAAA,CAAwB/J,GACpB,OAAOhG,KAAK0O,EAAwBnL,IAAIyC,EAC5C,CAmBA,mBAAMgK,CAAcpO,GAChB,MAAMhB,EAAMgB,aAAmBc,QAAUd,EAAQhB,IAAMgB,EACjDoE,EAAWhG,KAAKiH,kBAAkBrG,GACxC,GAAIoF,EAAU,CAEV,aADoBjH,KAAKsM,OAAOS,KAAK9L,KAAKkJ,SAAS5D,YACtChF,MAAM0F,EACvB,CAEJ,CASAiK,uBAAAA,CAAwBrP,GACpB,MAAMoF,EAAWhG,KAAKiH,kBAAkBrG,GACxC,IAAKoF,EACD,MAAM,IAAItG,EAAa,oBAAqB,CAAEkB,QAElD,OAAQuI,IACJA,EAAQvH,QAAU,IAAIc,QAAQ9B,GAC9BuI,EAAQhG,OAASc,OAAOoF,OAAO,CAAErD,YAAYmD,EAAQhG,QAC9CnD,KAAKkJ,SAAS9I,OAAO+I,GAEpC,ECxRJ,IAAIrC,EAKG,MAAMoJ,EAAgCA,KACpCpJ,IACDA,EAAqB,IAAIyH,GAEtBzH,GCGX,MAAMqJ,UAAsB9P,EAiBxBT,WAAAA,CAAYkH,EAAoBqC,GAe5BpJ,OAdcO,EAAGsB,cACb,MAAMwO,EAAkBtJ,EAAmB+I,qBAC3C,IAAK,MAAMQ,KCtBhB,UAAgCzP,GAAK0P,4BAAEA,EAA8B,CAAC,QAAS,YAAWC,eAAEA,EAAiB,aAAYC,UAAEA,GAAY,EAAIC,gBAAEA,GAAqB,IACrK,MAAM1K,EAAY,IAAIhD,IAAInC,EAAKK,SAASF,MACxCgF,EAAU2K,KAAO,SACX3K,EAAUhF,KAChB,MAAM4P,ECHH,SAAmC5K,EAAWuK,EAA8B,IAG/E,IAAK,MAAMM,IAAa,IAAI7K,EAAUK,aAAalC,QAC3CoM,EAA4BO,MAAMlQ,GAAWA,EAAOmQ,KAAKF,MACzD7K,EAAUK,aAAaqC,OAAOmI,GAGtC,OAAO7K,CACX,CDNoCgL,CAA0BhL,EAAWuK,GAErE,SADMK,EAAwB5P,KAC1BwP,GAAkBI,EAAwBK,SAASC,SAAS,KAAM,CAClE,MAAMC,EAAe,IAAInO,IAAI4N,EAAwB5P,MACrDmQ,EAAaF,UAAYT,QACnBW,EAAanQ,IACvB,CACA,GAAIyP,EAAW,CACX,MAAMW,EAAW,IAAIpO,IAAI4N,EAAwB5P,MACjDoQ,EAASH,UAAY,cACfG,EAASpQ,IACnB,CACA,GAAI0P,EAAiB,CACjB,MAAMW,EAAiBX,EAAgB,CAAE7P,IAAKmF,IAC9C,IAAK,MAAMsL,KAAgBD,QACjBC,EAAatQ,IAE3B,CACJ,CDAsCuQ,CAAsB1P,EAAQhB,IAAKuI,GAAU,CACnE,MAAMnD,EAAWoK,EAAgB7M,IAAI8M,GACrC,GAAIrK,EAAU,CAEV,MAAO,CAAEA,WAAU6H,UADD/G,EAAmBiJ,wBAAwB/J,GAEjE,CACJ,CAIA,GAESc,EAAmBoC,SACpC,EG7BJ,SAASqI,EAASpI,GACd,MAAMrC,EAAqBoJ,KCK/B,SAAuBsB,EAASrR,EAASI,GACrC,IAAI6C,EACJ,GAAuB,iBAAZoO,EAAsB,CAC7B,MAAMC,EAAa,IAAI1O,IAAIyO,EAASvQ,SAASF,MAkC7CqC,EAAQ,IAAI/C,GAZUqR,EAAG9Q,SASdA,EAAIG,OAAS0Q,EAAW1Q,MAGFZ,EAASI,EAC9C,MACK,GAAIiR,aAAmB9F,OAExBtI,EAAQ,IAAI1C,EAAY8Q,EAASrR,EAASI,QAEzC,GAAuB,mBAAZiR,EAEZpO,EAAQ,IAAI/C,EAAMmR,EAASrR,EAASI,OAEnC,MAAIiR,aAAmBnR,GAIxB,MAAM,IAAIX,EAAa,yBAA0B,CAC7CiS,WAAY,kBACZC,SAAU,gBACVhB,UAAW,YANfxN,EAAQoO,CAQZ,EzBrEK5M,IACDA,EAAgB,IAAIxD,EAEpBwD,EAAcnD,mBACdmD,EAAc5C,oBAEX4C,GyBiEON,cAAclB,EAEhC,CD/DIkB,CADsB,IAAI6L,EAAcrJ,EAAoBqC,GAEhE,oBELA,SAA0BgF,EAAShF,ICInC,SAAkBgF,GACa+B,IACRnL,SAASoJ,EAChC,CDNIpJ,CAASoJ,GACToD,EAASpI,EACb"}\ No newline at end of file